Add new information about when torrent was added to transmission in the Information Tab in transmission-qt (#3121)

This commit is contained in:
sewe2000 2022-05-23 05:02:46 +00:00 committed by GitHub
parent 67a078402d
commit 4617776253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 2 deletions

View File

@ -934,6 +934,37 @@ void DetailsDialog::refreshUI()
}
ui_.locationValueLabel->setText(string);
// myAddedLabel
string = none;
if (!torrents.empty())
{
auto const date = torrents[0]->dateAdded();
bool mixed_date = false;
for (Torrent const* const t : torrents)
{
mixed_date |= (date != t->dateAdded());
}
bool const empty_date = date <= 0;
if (empty_date)
{
string = tr("N/A");
}
else if (mixed_date)
{
string = mixed;
}
else
{
auto const date_str = QDateTime::fromSecsSinceEpoch(date).toString();
string = date_str;
}
}
ui_.addedLabelValue->setText(string);
///
/// Options Tab

View File

@ -442,7 +442,21 @@
</property>
</widget>
</item>
<item row="5" column="0">
<item row="5" column="0">
<widget class="QLabel" name="addedLabel">
<property name="text">
<string>Added:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="addedLabelValue">
<property name="text">
<string></string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="commentLabel">
<property name="text">
<string>Comment:</string>
@ -452,7 +466,7 @@
</property>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<widget class="QTextBrowser" name="commentBrowser">
<property name="textInteractionFlags">
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>