Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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