Skip to content

Commit

Permalink
Add new information about when torrent was added to transmission in t…
Browse files Browse the repository at this point in the history
…he Information Tab in transmission-qt (#3121)
  • Loading branch information
sewe2000 committed May 23, 2022
1 parent 67a0784 commit 4617776
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
31 changes: 31 additions & 0 deletions qt/DetailsDialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 16 additions & 2 deletions qt/DetailsDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down

0 comments on commit 4617776

Please sign in to comment.