From 4617776253df87735c716ad2782fb5f566238576 Mon Sep 17 00:00:00 2001 From: sewe2000 <59435262+sewe2000@users.noreply.github.com> Date: Mon, 23 May 2022 05:02:46 +0000 Subject: [PATCH] Add new information about when torrent was added to transmission in the Information Tab in transmission-qt (#3121) --- qt/DetailsDialog.cc | 31 +++++++++++++++++++++++++++++++ qt/DetailsDialog.ui | 18 ++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/qt/DetailsDialog.cc b/qt/DetailsDialog.cc index 3d3bd8472..2e910a314 100644 --- a/qt/DetailsDialog.cc +++ b/qt/DetailsDialog.cc @@ -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 diff --git a/qt/DetailsDialog.ui b/qt/DetailsDialog.ui index 5be532815..3a7090915 100644 --- a/qt/DetailsDialog.ui +++ b/qt/DetailsDialog.ui @@ -442,7 +442,21 @@ - + + + + Added: + + + + + + + + + + + Comment: @@ -452,7 +466,7 @@ - + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse