mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
Rework torrent details dialog in Qt client to load from .ui
Make squeeze labels (used for values on Information tab) display tooltip on hover if their text doesn't fit. Make selective labels (same as in GTK+ client) text selectable with keyboard in addition to mouse. Prevent dialog width growth occured before to fit long error texts.
This commit is contained in:
@@ -101,6 +101,7 @@ set(${PROJECT_NAME}_HEADERS
|
|||||||
)
|
)
|
||||||
|
|
||||||
tr_qt_wrap_ui(${PROJECT_NAME}_UI_SOURCES
|
tr_qt_wrap_ui(${PROJECT_NAME}_UI_SOURCES
|
||||||
|
details.ui
|
||||||
mainwin.ui
|
mainwin.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
475
qt/details.cc
475
qt/details.cc
@@ -11,17 +11,11 @@
|
|||||||
#include <climits> /* INT_MAX */
|
#include <climits> /* INT_MAX */
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
#include <QCheckBox>
|
|
||||||
#include <QComboBox>
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QDialogButtonBox>
|
|
||||||
#include <QDoubleSpinBox>
|
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QFontMetrics>
|
#include <QFontMetrics>
|
||||||
#include <QHBoxLayout>
|
|
||||||
#include <QHBoxLayout>
|
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QHostAddress>
|
#include <QHostAddress>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
@@ -30,18 +24,10 @@
|
|||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPushButton>
|
|
||||||
#include <QRadioButton>
|
|
||||||
#include <QResizeEvent>
|
#include <QResizeEvent>
|
||||||
#include <QSpinBox>
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QTabWidget>
|
|
||||||
#include <QTextBrowser>
|
|
||||||
#include <QTreeView>
|
|
||||||
#include <QTreeWidget>
|
|
||||||
#include <QTreeWidgetItem>
|
#include <QTreeWidgetItem>
|
||||||
#include <QVBoxLayout>
|
|
||||||
|
|
||||||
#include <libtransmission/transmission.h>
|
#include <libtransmission/transmission.h>
|
||||||
#include <libtransmission/utils.h> // tr_getRatio ()
|
#include <libtransmission/utils.h> // tr_getRatio ()
|
||||||
@@ -58,6 +44,7 @@
|
|||||||
#include "tracker-delegate.h"
|
#include "tracker-delegate.h"
|
||||||
#include "tracker-model.h"
|
#include "tracker-model.h"
|
||||||
#include "tracker-model-filter.h"
|
#include "tracker-model-filter.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
class Prefs;
|
class Prefs;
|
||||||
class Session;
|
class Session;
|
||||||
@@ -83,6 +70,16 @@ namespace
|
|||||||
COL_CLIENT,
|
COL_CLIENT,
|
||||||
N_COLUMNS
|
N_COLUMNS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int
|
||||||
|
measureViewItem (QAbstractItemView * view, const QString& text)
|
||||||
|
{
|
||||||
|
QStyleOptionViewItemV4 option;
|
||||||
|
option.features = QStyleOptionViewItemV2::HasDisplay;
|
||||||
|
option.text = text;
|
||||||
|
return view->style ()->sizeFromContents (QStyle::CT_ItemViewItem, &option,
|
||||||
|
QSize (QWIDGETSIZE_MAX, QWIDGETSIZE_MAX), view).width ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
@@ -184,28 +181,18 @@ Details::Details (Session & session,
|
|||||||
myChangedTorrents (false),
|
myChangedTorrents (false),
|
||||||
myHavePendingRefresh (false)
|
myHavePendingRefresh (false)
|
||||||
{
|
{
|
||||||
QVBoxLayout * layout = new QVBoxLayout (this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
setWindowTitle (tr ("Torrent Properties"));
|
initInfoTab ();
|
||||||
|
initPeersTab ();
|
||||||
|
initTrackerTab ();
|
||||||
|
initFilesTab ();
|
||||||
|
initOptionsTab ();
|
||||||
|
|
||||||
QTabWidget * t = new QTabWidget (this);
|
adjustSize ();
|
||||||
QWidget * w;
|
ui.commentBrowser->setMaximumHeight (QWIDGETSIZE_MAX);
|
||||||
t->addTab (w = createInfoTab (), tr ("Information"));
|
|
||||||
myWidgets << w;
|
|
||||||
t->addTab (w = createPeersTab (), tr ("Peers"));
|
|
||||||
myWidgets << w;
|
|
||||||
t->addTab (w = createTrackerTab (), tr ("Tracker"));
|
|
||||||
myWidgets << w;
|
|
||||||
t->addTab (w = createFilesTab (), tr ("Files"));
|
|
||||||
myWidgets << w;
|
|
||||||
t->addTab (w = createOptionsTab (), tr ("Options"));
|
|
||||||
myWidgets << w;
|
|
||||||
layout->addWidget (t);
|
|
||||||
|
|
||||||
QDialogButtonBox * buttons = new QDialogButtonBox (QDialogButtonBox::Close, Qt::Horizontal, this);
|
setAttribute (Qt::WA_DeleteOnClose, true);
|
||||||
connect (buttons, SIGNAL (rejected ()), this, SLOT (close ()));
|
|
||||||
layout->addWidget (buttons);
|
|
||||||
QWidget::setAttribute (Qt::WA_DeleteOnClose, true);
|
|
||||||
|
|
||||||
QList<int> initKeys;
|
QList<int> initKeys;
|
||||||
initKeys << Prefs::SHOW_TRACKER_SCRAPES
|
initKeys << Prefs::SHOW_TRACKER_SCRAPES
|
||||||
@@ -244,7 +231,7 @@ Details::setIds (const QSet<int>& ids)
|
|||||||
disconnect (tor, SIGNAL (torrentChanged (int)), this, SLOT (onTorrentChanged ()));
|
disconnect (tor, SIGNAL (torrentChanged (int)), this, SLOT (onTorrentChanged ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
myFileTreeView->clear ();
|
ui.filesView->clear ();
|
||||||
myIds = ids;
|
myIds = ids;
|
||||||
myTrackerModel->refresh (myModel, myIds);
|
myTrackerModel->refresh (myModel, myIds);
|
||||||
|
|
||||||
@@ -256,8 +243,8 @@ Details::setIds (const QSet<int>& ids)
|
|||||||
connect (tor, SIGNAL (torrentChanged (int)), this, SLOT (onTorrentChanged ()));
|
connect (tor, SIGNAL (torrentChanged (int)), this, SLOT (onTorrentChanged ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (QWidget * w, myWidgets)
|
for (int i = 0; i < ui.tabs->count (); ++i)
|
||||||
w->setEnabled (false);
|
ui.tabs->widget (i)->setEnabled (false);
|
||||||
|
|
||||||
onTimer ();
|
onTimer ();
|
||||||
}
|
}
|
||||||
@@ -271,12 +258,12 @@ Details::refreshPref (int key)
|
|||||||
{
|
{
|
||||||
case Prefs::SHOW_TRACKER_SCRAPES:
|
case Prefs::SHOW_TRACKER_SCRAPES:
|
||||||
{
|
{
|
||||||
QItemSelectionModel * selectionModel (myTrackerView->selectionModel ());
|
QItemSelectionModel * selectionModel (ui.trackersView->selectionModel ());
|
||||||
const QItemSelection selection (selectionModel->selection ());
|
const QItemSelection selection (selectionModel->selection ());
|
||||||
const QModelIndex currentIndex (selectionModel->currentIndex ());
|
const QModelIndex currentIndex (selectionModel->currentIndex ());
|
||||||
myTrackerDelegate->setShowMore (myPrefs.getBool (key));
|
myTrackerDelegate->setShowMore (myPrefs.getBool (key));
|
||||||
selectionModel->clear ();
|
selectionModel->clear ();
|
||||||
myTrackerView->reset ();
|
ui.trackersView->reset ();
|
||||||
selectionModel->select (selection, QItemSelectionModel::Select);
|
selectionModel->select (selection, QItemSelectionModel::Select);
|
||||||
selectionModel->setCurrentIndex (currentIndex, QItemSelectionModel::NoUpdate);
|
selectionModel->setCurrentIndex (currentIndex, QItemSelectionModel::NoUpdate);
|
||||||
break;
|
break;
|
||||||
@@ -429,7 +416,7 @@ Details::refresh ()
|
|||||||
else
|
else
|
||||||
string = torrents[0]->activityString ();
|
string = torrents[0]->activityString ();
|
||||||
}
|
}
|
||||||
myStateLabel->setText (string);
|
ui.stateValueLabel->setText (string);
|
||||||
const QString stateString = string;
|
const QString stateString = string;
|
||||||
|
|
||||||
// myHaveLabel
|
// myHaveLabel
|
||||||
@@ -487,7 +474,7 @@ Details::refresh ()
|
|||||||
.arg (Formatter::sizeToString (haveUnverified));
|
.arg (Formatter::sizeToString (haveUnverified));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
myHaveLabel->setText (string);
|
ui.haveValueLabel->setText (string);
|
||||||
|
|
||||||
// myAvailabilityLabel
|
// myAvailabilityLabel
|
||||||
if (torrents.empty ())
|
if (torrents.empty ())
|
||||||
@@ -496,7 +483,7 @@ Details::refresh ()
|
|||||||
string = none;
|
string = none;
|
||||||
else
|
else
|
||||||
string = QString ("%1%").arg (Formatter::percentToString ( (100.0 * available) / sizeWhenDone));
|
string = QString ("%1%").arg (Formatter::percentToString ( (100.0 * available) / sizeWhenDone));
|
||||||
myAvailabilityLabel->setText (string);
|
ui.availabilityValueLabel->setText (string);
|
||||||
|
|
||||||
// myDownloadedLabel
|
// myDownloadedLabel
|
||||||
if (torrents.empty ())
|
if (torrents.empty ())
|
||||||
@@ -519,7 +506,7 @@ Details::refresh ()
|
|||||||
else
|
else
|
||||||
string = dstr;
|
string = dstr;
|
||||||
}
|
}
|
||||||
myDownloadedLabel->setText (string);
|
ui.downloadedValueLabel->setText (string);
|
||||||
|
|
||||||
// myUploadedLabel
|
// myUploadedLabel
|
||||||
if (torrents.empty ())
|
if (torrents.empty ())
|
||||||
@@ -539,7 +526,7 @@ Details::refresh ()
|
|||||||
.arg (Formatter::sizeToString (u))
|
.arg (Formatter::sizeToString (u))
|
||||||
.arg (Formatter::ratioToString (tr_getRatio (u, d)));
|
.arg (Formatter::ratioToString (tr_getRatio (u, d)));
|
||||||
}
|
}
|
||||||
myUploadedLabel->setText (string);
|
ui.uploadedValueLabel->setText (string);
|
||||||
|
|
||||||
const QDateTime qdt_now = QDateTime::currentDateTime ();
|
const QDateTime qdt_now = QDateTime::currentDateTime ();
|
||||||
|
|
||||||
@@ -567,7 +554,7 @@ Details::refresh ()
|
|||||||
else
|
else
|
||||||
string = Formatter::timeToString (baseline.secsTo (qdt_now));
|
string = Formatter::timeToString (baseline.secsTo (qdt_now));
|
||||||
}
|
}
|
||||||
myRunTimeLabel->setText (string);
|
ui.runningTimeValueLabel->setText (string);
|
||||||
|
|
||||||
|
|
||||||
// myETALabel
|
// myETALabel
|
||||||
@@ -596,7 +583,7 @@ Details::refresh ()
|
|||||||
string = Formatter::timeToString (baseline);
|
string = Formatter::timeToString (baseline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
myETALabel->setText (string);
|
ui.remainingTimeValueLabel->setText (string);
|
||||||
|
|
||||||
|
|
||||||
// myLastActivityLabel
|
// myLastActivityLabel
|
||||||
@@ -622,7 +609,7 @@ Details::refresh ()
|
|||||||
else
|
else
|
||||||
string = tr ("%1 ago").arg (Formatter::timeToString (seconds));
|
string = tr ("%1 ago").arg (Formatter::timeToString (seconds));
|
||||||
}
|
}
|
||||||
myLastActivityLabel->setText (string);
|
ui.lastActivityValueLabel->setText (string);
|
||||||
|
|
||||||
|
|
||||||
if (torrents.empty ())
|
if (torrents.empty ())
|
||||||
@@ -643,7 +630,7 @@ Details::refresh ()
|
|||||||
}
|
}
|
||||||
if (string.isEmpty ())
|
if (string.isEmpty ())
|
||||||
string = none;
|
string = none;
|
||||||
myErrorLabel->setText (string);
|
ui.errorValueLabel->setText (string);
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -678,7 +665,7 @@ Details::refresh ()
|
|||||||
string = tr ("%1 (%Ln pieces)", "", pieces)
|
string = tr ("%1 (%Ln pieces)", "", pieces)
|
||||||
.arg (Formatter::sizeToString (size));
|
.arg (Formatter::sizeToString (size));
|
||||||
}
|
}
|
||||||
mySizeLabel->setText (string);
|
ui.sizeValueLabel->setText (string);
|
||||||
|
|
||||||
// myHashLabel
|
// myHashLabel
|
||||||
string = none;
|
string = none;
|
||||||
@@ -694,7 +681,7 @@ Details::refresh ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
myHashLabel->setText (string);
|
ui.hashValueLabel->setText (string);
|
||||||
|
|
||||||
// myPrivacyLabel
|
// myPrivacyLabel
|
||||||
string = none;
|
string = none;
|
||||||
@@ -712,10 +699,11 @@ Details::refresh ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
myPrivacyLabel->setText (string);
|
ui.privacyValueLabel->setText (string);
|
||||||
|
|
||||||
// myCommentBrowser
|
// myCommentBrowser
|
||||||
string = none;
|
string = none;
|
||||||
|
bool isCommentMixed = false;
|
||||||
if (!torrents.empty ())
|
if (!torrents.empty ())
|
||||||
{
|
{
|
||||||
string = torrents[0]->comment ();
|
string = torrents[0]->comment ();
|
||||||
@@ -724,15 +712,16 @@ Details::refresh ()
|
|||||||
if (string != t->comment ())
|
if (string != t->comment ())
|
||||||
{
|
{
|
||||||
string = mixed;
|
string = mixed;
|
||||||
|
isCommentMixed = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (myCommentBrowser->toPlainText() != string)
|
if (ui.commentBrowser->toPlainText() != string)
|
||||||
{
|
{
|
||||||
myCommentBrowser->setText (string);
|
ui.commentBrowser->setText (string);
|
||||||
myCommentBrowser->setMaximumHeight (QWIDGETSIZE_MAX);
|
|
||||||
}
|
}
|
||||||
|
ui.commentBrowser->setEnabled (!isCommentMixed && !string.isEmpty ());
|
||||||
|
|
||||||
// myOriginLabel
|
// myOriginLabel
|
||||||
string = none;
|
string = none;
|
||||||
@@ -758,7 +747,7 @@ Details::refresh ()
|
|||||||
else
|
else
|
||||||
string = tr ("Created by %1 on %2").arg (creator).arg (date);
|
string = tr ("Created by %1 on %2").arg (creator).arg (date);
|
||||||
}
|
}
|
||||||
myOriginLabel->setText (string);
|
ui.originValueLabel->setText (string);
|
||||||
|
|
||||||
// myLocationLabel
|
// myLocationLabel
|
||||||
string = none;
|
string = none;
|
||||||
@@ -774,7 +763,7 @@ Details::refresh ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
myLocationLabel->setText (string);
|
ui.locationValueLabel->setText (string);
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -794,33 +783,33 @@ Details::refresh ()
|
|||||||
uniform = true;
|
uniform = true;
|
||||||
baselineFlag = baseline->honorsSessionLimits ();
|
baselineFlag = baseline->honorsSessionLimits ();
|
||||||
foreach (tor, torrents) if (baselineFlag != tor->honorsSessionLimits ()) { uniform = false; break; }
|
foreach (tor, torrents) if (baselineFlag != tor->honorsSessionLimits ()) { uniform = false; break; }
|
||||||
mySessionLimitCheck->setChecked (uniform && baselineFlag);
|
ui.sessionLimitCheck->setChecked (uniform && baselineFlag);
|
||||||
|
|
||||||
// mySingleDownCheck
|
// mySingleDownCheck
|
||||||
uniform = true;
|
uniform = true;
|
||||||
baselineFlag = baseline->downloadIsLimited ();
|
baselineFlag = baseline->downloadIsLimited ();
|
||||||
foreach (tor, torrents) if (baselineFlag != tor->downloadIsLimited ()) { uniform = false; break; }
|
foreach (tor, torrents) if (baselineFlag != tor->downloadIsLimited ()) { uniform = false; break; }
|
||||||
mySingleDownCheck->setChecked (uniform && baselineFlag);
|
ui.singleDownCheck->setChecked (uniform && baselineFlag);
|
||||||
|
|
||||||
// mySingleUpCheck
|
// mySingleUpCheck
|
||||||
uniform = true;
|
uniform = true;
|
||||||
baselineFlag = baseline->uploadIsLimited ();
|
baselineFlag = baseline->uploadIsLimited ();
|
||||||
foreach (tor, torrents) if (baselineFlag != tor->uploadIsLimited ()) { uniform = false; break; }
|
foreach (tor, torrents) if (baselineFlag != tor->uploadIsLimited ()) { uniform = false; break; }
|
||||||
mySingleUpCheck->setChecked (uniform && baselineFlag);
|
ui.singleUpCheck->setChecked (uniform && baselineFlag);
|
||||||
|
|
||||||
// myBandwidthPriorityCombo
|
// myBandwidthPriorityCombo
|
||||||
uniform = true;
|
uniform = true;
|
||||||
baselineInt = baseline->getBandwidthPriority ();
|
baselineInt = baseline->getBandwidthPriority ();
|
||||||
foreach (tor, torrents) if (baselineInt != tor->getBandwidthPriority ()) { uniform = false; break; }
|
foreach (tor, torrents) if (baselineInt != tor->getBandwidthPriority ()) { uniform = false; break; }
|
||||||
if (uniform)
|
if (uniform)
|
||||||
i = myBandwidthPriorityCombo->findData (baselineInt);
|
i = ui.bandwidthPriorityCombo->findData (baselineInt);
|
||||||
else
|
else
|
||||||
i = -1;
|
i = -1;
|
||||||
setIfIdle (myBandwidthPriorityCombo, i);
|
setIfIdle (ui.bandwidthPriorityCombo, i);
|
||||||
|
|
||||||
setIfIdle (mySingleDownSpin, int (tor->downloadLimit ().KBps ()));
|
setIfIdle (ui.singleDownSpin, int (tor->downloadLimit ().KBps ()));
|
||||||
setIfIdle (mySingleUpSpin, int (tor->uploadLimit ().KBps ()));
|
setIfIdle (ui.singleUpSpin, int (tor->uploadLimit ().KBps ()));
|
||||||
setIfIdle (myPeerLimitSpin, tor->peerLimit ());
|
setIfIdle (ui.peerLimitSpin, tor->peerLimit ());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!torrents.empty ())
|
if (!torrents.empty ())
|
||||||
@@ -832,20 +821,20 @@ Details::refresh ()
|
|||||||
int baselineInt = torrents[0]->seedRatioMode ();
|
int baselineInt = torrents[0]->seedRatioMode ();
|
||||||
foreach (tor, torrents) if (baselineInt != tor->seedRatioMode ()) { uniform = false; break; }
|
foreach (tor, torrents) if (baselineInt != tor->seedRatioMode ()) { uniform = false; break; }
|
||||||
|
|
||||||
setIfIdle (myRatioCombo, uniform ? myRatioCombo->findData (baselineInt) : -1);
|
setIfIdle (ui.ratioCombo, uniform ? ui.ratioCombo->findData (baselineInt) : -1);
|
||||||
myRatioSpin->setVisible (uniform && (baselineInt == TR_RATIOLIMIT_SINGLE));
|
ui.ratioSpin->setVisible (uniform && (baselineInt == TR_RATIOLIMIT_SINGLE));
|
||||||
|
|
||||||
setIfIdle (myRatioSpin, tor->seedRatioLimit ());
|
setIfIdle (ui.ratioSpin, tor->seedRatioLimit ());
|
||||||
|
|
||||||
// idle
|
// idle
|
||||||
uniform = true;
|
uniform = true;
|
||||||
baselineInt = torrents[0]->seedIdleMode ();
|
baselineInt = torrents[0]->seedIdleMode ();
|
||||||
foreach (tor, torrents) if (baselineInt != tor->seedIdleMode ()) { uniform = false; break; }
|
foreach (tor, torrents) if (baselineInt != tor->seedIdleMode ()) { uniform = false; break; }
|
||||||
|
|
||||||
setIfIdle (myIdleCombo, uniform ? myIdleCombo->findData (baselineInt) : -1);
|
setIfIdle (ui.idleCombo, uniform ? ui.idleCombo->findData (baselineInt) : -1);
|
||||||
myIdleSpin->setVisible (uniform && (baselineInt == TR_RATIOLIMIT_SINGLE));
|
ui.idleSpin->setVisible (uniform && (baselineInt == TR_RATIOLIMIT_SINGLE));
|
||||||
|
|
||||||
setIfIdle (myIdleSpin, tor->seedIdleLimit ());
|
setIfIdle (ui.idleSpin, tor->seedIdleLimit ());
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -926,73 +915,38 @@ Details::refresh ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
myPeerTree->addTopLevelItems (newItems);
|
ui.peersView->addTopLevelItems (newItems);
|
||||||
foreach (QString key, myPeers.keys ())
|
foreach (QString key, myPeers.keys ())
|
||||||
{
|
{
|
||||||
if (!peers2.contains (key)) // old peer has disconnected
|
if (!peers2.contains (key)) // old peer has disconnected
|
||||||
{
|
{
|
||||||
QTreeWidgetItem * item = myPeers.value (key, 0);
|
QTreeWidgetItem * item = myPeers.value (key, 0);
|
||||||
myPeerTree->takeTopLevelItem (myPeerTree->indexOfTopLevelItem (item));
|
ui.peersView->takeTopLevelItem (ui.peersView->indexOfTopLevelItem (item));
|
||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
myPeers = peers2;
|
myPeers = peers2;
|
||||||
|
|
||||||
if (!single)
|
if (!single)
|
||||||
myFileTreeView->clear ();
|
ui.filesView->clear ();
|
||||||
if (single)
|
if (single)
|
||||||
myFileTreeView->update (torrents[0]->files (), myChangedTorrents);
|
ui.filesView->update (torrents[0]->files (), myChangedTorrents);
|
||||||
|
|
||||||
myChangedTorrents = false;
|
myChangedTorrents = false;
|
||||||
myHavePendingRefresh = false;
|
myHavePendingRefresh = false;
|
||||||
foreach (QWidget * w, myWidgets)
|
for (int i = 0; i < ui.tabs->count (); ++i)
|
||||||
w->setEnabled (true);
|
ui.tabs->widget (i)->setEnabled (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Details::enableWhenChecked (QCheckBox * box, QWidget * w)
|
|
||||||
{
|
|
||||||
connect (box, SIGNAL (toggled (bool)), w, SLOT (setEnabled (bool)));
|
|
||||||
w->setEnabled (box->isChecked ());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
****
|
****
|
||||||
***/
|
***/
|
||||||
|
|
||||||
QWidget *
|
void
|
||||||
Details::createInfoTab ()
|
Details::initInfoTab ()
|
||||||
{
|
{
|
||||||
HIG * hig = new HIG (this);
|
const int h = QFontMetrics (ui.commentBrowser->font ()).lineSpacing () * 4;
|
||||||
|
ui.commentBrowser->setFixedHeight (h);
|
||||||
hig->addSectionTitle (tr ("Activity"));
|
|
||||||
hig->addRow (tr ("Have:"), myHaveLabel = new SqueezeLabel);
|
|
||||||
hig->addRow (tr ("Availability:"), myAvailabilityLabel = new SqueezeLabel);
|
|
||||||
hig->addRow (tr ("Uploaded:"), myUploadedLabel = new SqueezeLabel);
|
|
||||||
hig->addRow (tr ("Downloaded:"), myDownloadedLabel = new SqueezeLabel);
|
|
||||||
hig->addRow (tr ("State:"), myStateLabel = new SqueezeLabel);
|
|
||||||
hig->addRow (tr ("Running time:"), myRunTimeLabel = new SqueezeLabel);
|
|
||||||
hig->addRow (tr ("Remaining time:"), myETALabel = new SqueezeLabel);
|
|
||||||
hig->addRow (tr ("Last activity:"), myLastActivityLabel = new SqueezeLabel);
|
|
||||||
hig->addRow (tr ("Error:"), myErrorLabel = new SqueezeLabel);
|
|
||||||
hig->addSectionDivider ();
|
|
||||||
|
|
||||||
hig->addSectionDivider ();
|
|
||||||
hig->addSectionTitle (tr ("Details"));
|
|
||||||
hig->addRow (tr ("Size:"), mySizeLabel = new SqueezeLabel);
|
|
||||||
hig->addRow (tr ("Location:"), myLocationLabel = new SqueezeLabel);
|
|
||||||
hig->addRow (tr ("Hash:"), myHashLabel = new SqueezeLabel);
|
|
||||||
hig->addRow (tr ("Privacy:"), myPrivacyLabel = new SqueezeLabel);
|
|
||||||
hig->addRow (tr ("Origin:"), myOriginLabel = new SqueezeLabel);
|
|
||||||
myOriginLabel->setMinimumWidth (325); // stop long origin strings from resizing the widgit
|
|
||||||
hig->addRow (tr ("Comment:"), myCommentBrowser = new QTextBrowser);
|
|
||||||
const int h = QFontMetrics (myCommentBrowser->font ()).lineSpacing () * 4;
|
|
||||||
myCommentBrowser->setFixedHeight (h);
|
|
||||||
|
|
||||||
hig->finish ();
|
|
||||||
|
|
||||||
return hig;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
@@ -1046,7 +1000,7 @@ Details::onUploadLimitedToggled (bool val)
|
|||||||
void
|
void
|
||||||
Details::onIdleModeChanged (int index)
|
Details::onIdleModeChanged (int index)
|
||||||
{
|
{
|
||||||
const int val = myIdleCombo->itemData (index).toInt ();
|
const int val = ui.idleCombo->itemData (index).toInt ();
|
||||||
mySession.torrentSet (myIds, TR_KEY_seedIdleMode, val);
|
mySession.torrentSet (myIds, TR_KEY_seedIdleMode, val);
|
||||||
getNewData ();
|
getNewData ();
|
||||||
}
|
}
|
||||||
@@ -1054,7 +1008,7 @@ Details::onIdleModeChanged (int index)
|
|||||||
void
|
void
|
||||||
Details::onRatioModeChanged (int index)
|
Details::onRatioModeChanged (int index)
|
||||||
{
|
{
|
||||||
const int val = myRatioCombo->itemData (index).toInt ();
|
const int val = ui.ratioCombo->itemData (index).toInt ();
|
||||||
mySession.torrentSet (myIds, TR_KEY_seedRatioMode, val);
|
mySession.torrentSet (myIds, TR_KEY_seedRatioMode, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1063,7 +1017,7 @@ Details::onBandwidthPriorityChanged (int index)
|
|||||||
{
|
{
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
{
|
{
|
||||||
const int priority = myBandwidthPriorityCombo->itemData (index).toInt ();
|
const int priority = ui.bandwidthPriorityCombo->itemData (index).toInt ();
|
||||||
mySession.torrentSet (myIds, TR_KEY_bandwidthPriority, priority);
|
mySession.torrentSet (myIds, TR_KEY_bandwidthPriority, priority);
|
||||||
getNewData ();
|
getNewData ();
|
||||||
}
|
}
|
||||||
@@ -1072,9 +1026,9 @@ Details::onBandwidthPriorityChanged (int index)
|
|||||||
void
|
void
|
||||||
Details::onTrackerSelectionChanged ()
|
Details::onTrackerSelectionChanged ()
|
||||||
{
|
{
|
||||||
const int selectionCount = myTrackerView->selectionModel ()->selectedRows ().size ();
|
const int selectionCount = ui.trackersView->selectionModel ()->selectedRows ().size ();
|
||||||
myEditTrackerButton->setEnabled (selectionCount == 1);
|
ui.editTrackerButton->setEnabled (selectionCount == 1);
|
||||||
myRemoveTrackerButton->setEnabled (selectionCount > 0);
|
ui.removeTrackerButton->setEnabled (selectionCount > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1118,11 +1072,11 @@ Details::onAddTrackerClicked ()
|
|||||||
void
|
void
|
||||||
Details::onEditTrackerClicked ()
|
Details::onEditTrackerClicked ()
|
||||||
{
|
{
|
||||||
QItemSelectionModel * selectionModel = myTrackerView->selectionModel ();
|
QItemSelectionModel * selectionModel = ui.trackersView->selectionModel ();
|
||||||
QModelIndexList selectedRows = selectionModel->selectedRows ();
|
QModelIndexList selectedRows = selectionModel->selectedRows ();
|
||||||
assert (selectedRows.size () == 1);
|
assert (selectedRows.size () == 1);
|
||||||
QModelIndex i = selectionModel->currentIndex ();
|
QModelIndex i = selectionModel->currentIndex ();
|
||||||
const TrackerInfo trackerInfo = myTrackerView->model ()->data (i, TrackerModel::TrackerRole).value<TrackerInfo> ();
|
const TrackerInfo trackerInfo = ui.trackersView->model ()->data (i, TrackerModel::TrackerRole).value<TrackerInfo> ();
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
const QString newval = QInputDialog::getText (this,
|
const QString newval = QInputDialog::getText (this,
|
||||||
@@ -1155,12 +1109,12 @@ void
|
|||||||
Details::onRemoveTrackerClicked ()
|
Details::onRemoveTrackerClicked ()
|
||||||
{
|
{
|
||||||
// make a map of torrentIds to announce URLs to remove
|
// make a map of torrentIds to announce URLs to remove
|
||||||
QItemSelectionModel * selectionModel = myTrackerView->selectionModel ();
|
QItemSelectionModel * selectionModel = ui.trackersView->selectionModel ();
|
||||||
QModelIndexList selectedRows = selectionModel->selectedRows ();
|
QModelIndexList selectedRows = selectionModel->selectedRows ();
|
||||||
QMap<int,int> torrentId_to_trackerIds;
|
QMap<int,int> torrentId_to_trackerIds;
|
||||||
foreach (QModelIndex i, selectedRows)
|
foreach (QModelIndex i, selectedRows)
|
||||||
{
|
{
|
||||||
const TrackerInfo inf = myTrackerView->model ()->data (i, TrackerModel::TrackerRole).value<TrackerInfo> ();
|
const TrackerInfo inf = ui.trackersView->model ()->data (i, TrackerModel::TrackerRole).value<TrackerInfo> ();
|
||||||
torrentId_to_trackerIds.insertMulti (inf.torrentId, inf.st.id);
|
torrentId_to_trackerIds.insertMulti (inf.torrentId, inf.st.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1176,253 +1130,110 @@ Details::onRemoveTrackerClicked ()
|
|||||||
getNewData ();
|
getNewData ();
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *
|
void
|
||||||
Details::createOptionsTab ()
|
Details::initOptionsTab ()
|
||||||
{
|
{
|
||||||
QSpinBox * s;
|
|
||||||
QCheckBox * c;
|
|
||||||
QComboBox * m;
|
|
||||||
QHBoxLayout * h;
|
|
||||||
QDoubleSpinBox * ds;
|
|
||||||
const QString speed_K_str = Formatter::unitStr (Formatter::SPEED, Formatter::KB);
|
const QString speed_K_str = Formatter::unitStr (Formatter::SPEED, Formatter::KB);
|
||||||
|
|
||||||
HIG * hig = new HIG (this);
|
ui.singleDownCheck->setText (ui.singleDownCheck->text ().arg(speed_K_str));
|
||||||
hig->addSectionTitle (tr ("Speed"));
|
ui.singleUpCheck->setText (ui.singleUpCheck->text ().arg(speed_K_str));
|
||||||
|
|
||||||
c = new QCheckBox (tr ("Honor global &limits"));
|
ui.singleDownSpin->setProperty (PREF_KEY, TR_KEY_downloadLimit);
|
||||||
mySessionLimitCheck = c;
|
ui.singleUpSpin->setProperty (PREF_KEY, TR_KEY_uploadLimit);
|
||||||
hig->addWideControl (c);
|
ui.ratioSpin->setProperty (PREF_KEY, TR_KEY_seedRatioLimit);
|
||||||
connect (c, SIGNAL (clicked (bool)), this, SLOT (onHonorsSessionLimitsToggled (bool)));
|
ui.idleSpin->setProperty (PREF_KEY, TR_KEY_seedIdleLimit);
|
||||||
|
ui.peerLimitSpin->setProperty (PREF_KEY, TR_KEY_peer_limit);
|
||||||
|
|
||||||
c = new QCheckBox (tr ("Limit &download speed (%1):").arg (speed_K_str));
|
ui.bandwidthPriorityCombo->addItem (tr ("High"), TR_PRI_HIGH);
|
||||||
mySingleDownCheck = c;
|
ui.bandwidthPriorityCombo->addItem (tr ("Normal"), TR_PRI_NORMAL);
|
||||||
s = new QSpinBox ();
|
ui.bandwidthPriorityCombo->addItem (tr ("Low"), TR_PRI_LOW);
|
||||||
s->setProperty (PREF_KEY, TR_KEY_downloadLimit);
|
|
||||||
s->setSingleStep (5);
|
|
||||||
s->setRange (0, INT_MAX);
|
|
||||||
mySingleDownSpin = s;
|
|
||||||
hig->addRow (c, s);
|
|
||||||
enableWhenChecked (c, s);
|
|
||||||
connect (c, SIGNAL (clicked (bool)), this, SLOT (onDownloadLimitedToggled (bool)));
|
|
||||||
connect (s, SIGNAL (editingFinished ()), this, SLOT (onSpinBoxEditingFinished ()));
|
|
||||||
|
|
||||||
c = new QCheckBox (tr ("Limit &upload speed (%1):").arg (speed_K_str));
|
ui.ratioCombo->addItem (tr ("Use Global Settings"), TR_RATIOLIMIT_GLOBAL);
|
||||||
mySingleUpCheck = c;
|
ui.ratioCombo->addItem (tr ("Seed regardless of ratio"), TR_RATIOLIMIT_UNLIMITED);
|
||||||
s = new QSpinBox ();
|
ui.ratioCombo->addItem (tr ("Stop seeding at ratio:"), TR_RATIOLIMIT_SINGLE);
|
||||||
s->setSingleStep (5);
|
|
||||||
s->setRange (0, INT_MAX);
|
|
||||||
s->setProperty (PREF_KEY, TR_KEY_uploadLimit);
|
|
||||||
mySingleUpSpin = s;
|
|
||||||
hig->addRow (c, s);
|
|
||||||
enableWhenChecked (c, s);
|
|
||||||
connect (c, SIGNAL (clicked (bool)), this, SLOT (onUploadLimitedToggled (bool)));
|
|
||||||
connect (s, SIGNAL (editingFinished ()), this, SLOT (onSpinBoxEditingFinished ()));
|
|
||||||
|
|
||||||
m = new QComboBox;
|
ui.idleCombo->addItem (tr ("Use Global Settings"), TR_IDLELIMIT_GLOBAL);
|
||||||
m->addItem (tr ("High"), TR_PRI_HIGH);
|
ui.idleCombo->addItem (tr ("Seed regardless of activity"), TR_IDLELIMIT_UNLIMITED);
|
||||||
m->addItem (tr ("Normal"), TR_PRI_NORMAL);
|
ui.idleCombo->addItem (tr ("Stop seeding if idle for N minutes:"), TR_IDLELIMIT_SINGLE);
|
||||||
m->addItem (tr ("Low"), TR_PRI_LOW);
|
|
||||||
connect (m, SIGNAL (currentIndexChanged (int)), this, SLOT (onBandwidthPriorityChanged (int)));
|
|
||||||
hig->addRow (tr ("Torrent &priority:"), m);
|
|
||||||
myBandwidthPriorityCombo = m;
|
|
||||||
|
|
||||||
hig->addSectionDivider ();
|
connect (ui.sessionLimitCheck, SIGNAL (clicked (bool)), SLOT (onHonorsSessionLimitsToggled (bool)));
|
||||||
hig->addSectionTitle (tr ("Seeding Limits"));
|
connect (ui.singleDownCheck, SIGNAL (clicked (bool)), SLOT (onDownloadLimitedToggled (bool)));
|
||||||
|
connect (ui.singleDownSpin, SIGNAL (editingFinished ()), SLOT (onSpinBoxEditingFinished ()));
|
||||||
h = new QHBoxLayout ();
|
connect (ui.singleUpCheck, SIGNAL (clicked (bool)), SLOT (onUploadLimitedToggled (bool)));
|
||||||
h->setSpacing (HIG::PAD);
|
connect (ui.singleUpSpin, SIGNAL (editingFinished ()), SLOT (onSpinBoxEditingFinished ()));
|
||||||
m = new QComboBox;
|
connect (ui.bandwidthPriorityCombo, SIGNAL (currentIndexChanged (int)), SLOT (onBandwidthPriorityChanged (int)));
|
||||||
m->addItem (tr ("Use Global Settings"), TR_RATIOLIMIT_GLOBAL);
|
connect (ui.ratioCombo, SIGNAL (currentIndexChanged (int)), SLOT (onRatioModeChanged (int)));
|
||||||
m->addItem (tr ("Seed regardless of ratio"), TR_RATIOLIMIT_UNLIMITED);
|
connect (ui.ratioSpin, SIGNAL (editingFinished ()), SLOT (onSpinBoxEditingFinished ()));
|
||||||
m->addItem (tr ("Stop seeding at ratio:"), TR_RATIOLIMIT_SINGLE);
|
connect (ui.idleCombo, SIGNAL (currentIndexChanged (int)), SLOT (onIdleModeChanged (int)));
|
||||||
connect (m, SIGNAL (currentIndexChanged (int)), this, SLOT (onRatioModeChanged (int)));
|
connect (ui.idleSpin, SIGNAL (editingFinished ()), SLOT (onSpinBoxEditingFinished ()));
|
||||||
h->addWidget (myRatioCombo = m);
|
connect (ui.peerLimitSpin, SIGNAL (editingFinished ()), SLOT (onSpinBoxEditingFinished ()));
|
||||||
ds = new QDoubleSpinBox ();
|
|
||||||
ds->setRange (0.5, INT_MAX);
|
|
||||||
ds->setProperty (PREF_KEY, TR_KEY_seedRatioLimit);
|
|
||||||
connect (ds, SIGNAL (editingFinished ()), this, SLOT (onSpinBoxEditingFinished ()));
|
|
||||||
h->addWidget (myRatioSpin = ds);
|
|
||||||
hig->addRow (tr ("&Ratio:"), h, m);
|
|
||||||
|
|
||||||
h = new QHBoxLayout ();
|
|
||||||
h->setSpacing (HIG::PAD);
|
|
||||||
m = new QComboBox;
|
|
||||||
m->addItem (tr ("Use Global Settings"), TR_IDLELIMIT_GLOBAL);
|
|
||||||
m->addItem (tr ("Seed regardless of activity"), TR_IDLELIMIT_UNLIMITED);
|
|
||||||
m->addItem (tr ("Stop seeding if idle for N minutes:"), TR_IDLELIMIT_SINGLE);
|
|
||||||
connect (m, SIGNAL (currentIndexChanged (int)), this, SLOT (onIdleModeChanged (int)));
|
|
||||||
h->addWidget (myIdleCombo = m);
|
|
||||||
s = new QSpinBox ();
|
|
||||||
s->setSingleStep (5);
|
|
||||||
s->setRange (1, 9999);
|
|
||||||
s->setProperty (PREF_KEY, TR_KEY_seedIdleLimit);
|
|
||||||
connect (s, SIGNAL (editingFinished ()), this, SLOT (onSpinBoxEditingFinished ()));
|
|
||||||
h->addWidget (myIdleSpin = s);
|
|
||||||
hig->addRow (tr ("&Idle:"), h, m);
|
|
||||||
|
|
||||||
|
|
||||||
hig->addSectionDivider ();
|
|
||||||
hig->addSectionTitle (tr ("Peer Connections"));
|
|
||||||
|
|
||||||
s = new QSpinBox ();
|
|
||||||
s->setSingleStep (5);
|
|
||||||
s->setRange (1, 300);
|
|
||||||
s->setProperty (PREF_KEY, TR_KEY_peer_limit);
|
|
||||||
connect (s, SIGNAL (editingFinished ()), this, SLOT (onSpinBoxEditingFinished ()));
|
|
||||||
myPeerLimitSpin = s;
|
|
||||||
hig->addRow (tr ("&Maximum peers:"), s);
|
|
||||||
|
|
||||||
hig->finish ();
|
|
||||||
|
|
||||||
return hig;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
****
|
****
|
||||||
***/
|
***/
|
||||||
|
|
||||||
QWidget *
|
void
|
||||||
Details::createTrackerTab ()
|
Details::initTrackerTab ()
|
||||||
{
|
{
|
||||||
QCheckBox * c;
|
myTrackerModel = new TrackerModel ();
|
||||||
QPushButton * p;
|
myTrackerFilter = new TrackerModelFilter ();
|
||||||
QWidget * top = new QWidget;
|
|
||||||
QVBoxLayout * v = new QVBoxLayout (top);
|
|
||||||
QHBoxLayout * h = new QHBoxLayout ();
|
|
||||||
QVBoxLayout * v2 = new QVBoxLayout ();
|
|
||||||
|
|
||||||
v->setSpacing (HIG::PAD_BIG);
|
|
||||||
v->setContentsMargins (HIG::PAD_BIG, HIG::PAD_BIG, HIG::PAD_BIG, HIG::PAD_BIG);
|
|
||||||
|
|
||||||
h->setSpacing (HIG::PAD);
|
|
||||||
h->setContentsMargins (HIG::PAD_SMALL, HIG::PAD_SMALL, HIG::PAD_SMALL, HIG::PAD_SMALL);
|
|
||||||
|
|
||||||
v2->setSpacing (HIG::PAD);
|
|
||||||
|
|
||||||
myTrackerModel = new TrackerModel;
|
|
||||||
myTrackerFilter = new TrackerModelFilter;
|
|
||||||
myTrackerFilter->setSourceModel (myTrackerModel);
|
myTrackerFilter->setSourceModel (myTrackerModel);
|
||||||
myTrackerView = new QTreeView;
|
myTrackerDelegate = new TrackerDelegate ();
|
||||||
myTrackerView->setModel (myTrackerFilter);
|
|
||||||
myTrackerView->setHeaderHidden (true);
|
|
||||||
myTrackerView->setSelectionMode (QTreeWidget::ExtendedSelection);
|
|
||||||
myTrackerView->setRootIsDecorated (false);
|
|
||||||
myTrackerView->setIndentation (2);
|
|
||||||
myTrackerView->setItemsExpandable (false);
|
|
||||||
myTrackerView->setAlternatingRowColors (true);
|
|
||||||
myTrackerView->setItemDelegate (myTrackerDelegate = new TrackerDelegate ());
|
|
||||||
connect (myTrackerView->selectionModel (), SIGNAL (selectionChanged (QItemSelection, QItemSelection)), this, SLOT (onTrackerSelectionChanged ()));
|
|
||||||
h->addWidget (myTrackerView, 1);
|
|
||||||
|
|
||||||
p = new QPushButton ();
|
ui.trackersView->setModel (myTrackerFilter);
|
||||||
p->setIcon (getStockIcon ("list-add", QStyle::SP_DialogOpenButton));
|
ui.trackersView->setItemDelegate (myTrackerDelegate);
|
||||||
p->setToolTip (tr ("Add Tracker"));
|
|
||||||
myAddTrackerButton = p;
|
|
||||||
v2->addWidget (p, 1);
|
|
||||||
connect (p, SIGNAL (clicked (bool)), this, SLOT (onAddTrackerClicked ()));
|
|
||||||
|
|
||||||
p = new QPushButton ();
|
ui.addTrackerButton->setIcon (getStockIcon ("list-add", QStyle::SP_DialogOpenButton));
|
||||||
p->setIcon (getStockIcon ("document-properties", QStyle::SP_DesktopIcon));
|
ui.editTrackerButton->setIcon (getStockIcon ("document-properties", QStyle::SP_DesktopIcon));
|
||||||
p->setToolTip (tr ("Edit Tracker"));
|
ui.removeTrackerButton->setIcon (getStockIcon ("list-remove", QStyle::SP_TrashIcon));
|
||||||
myAddTrackerButton = p;
|
|
||||||
p->setEnabled (false);
|
|
||||||
myEditTrackerButton = p;
|
|
||||||
v2->addWidget (p, 1);
|
|
||||||
connect (p, SIGNAL (clicked (bool)), this, SLOT (onEditTrackerClicked ()));
|
|
||||||
|
|
||||||
p = new QPushButton ();
|
ui.showTrackerScrapesCheck->setChecked (myPrefs.getBool (Prefs::SHOW_TRACKER_SCRAPES));
|
||||||
p->setIcon (getStockIcon ("list-remove", QStyle::SP_TrashIcon));
|
ui.showBackupTrackersCheck->setChecked (myPrefs.getBool (Prefs::SHOW_BACKUP_TRACKERS));
|
||||||
p->setToolTip (tr ("Remove Trackers"));
|
|
||||||
p->setEnabled (false);
|
|
||||||
myRemoveTrackerButton = p;
|
|
||||||
v2->addWidget (p, 1);
|
|
||||||
connect (p, SIGNAL (clicked (bool)), this, SLOT (onRemoveTrackerClicked ()));
|
|
||||||
|
|
||||||
v2->addStretch (1);
|
connect (ui.trackersView->selectionModel (), SIGNAL (selectionChanged (QItemSelection, QItemSelection)),
|
||||||
|
SLOT (onTrackerSelectionChanged ()));
|
||||||
|
connect (ui.addTrackerButton, SIGNAL (clicked ()), SLOT (onAddTrackerClicked ()));
|
||||||
|
connect (ui.editTrackerButton, SIGNAL (clicked ()), SLOT (onEditTrackerClicked ()));
|
||||||
|
connect (ui.removeTrackerButton, SIGNAL (clicked ()), SLOT (onRemoveTrackerClicked ()));
|
||||||
|
connect (ui.showTrackerScrapesCheck, SIGNAL (clicked (bool)), SLOT (onShowTrackerScrapesToggled (bool)));
|
||||||
|
connect (ui.showBackupTrackersCheck, SIGNAL (clicked (bool)), SLOT (onShowBackupTrackersToggled (bool)));
|
||||||
|
|
||||||
h->addLayout (v2, 1);
|
onTrackerSelectionChanged ();
|
||||||
h->setStretch (1, 0);
|
|
||||||
|
|
||||||
v->addLayout (h, 1);
|
|
||||||
|
|
||||||
c = new QCheckBox (tr ("Show &more details"));
|
|
||||||
c->setChecked (myPrefs.getBool (Prefs::SHOW_TRACKER_SCRAPES));
|
|
||||||
myShowTrackerScrapesCheck = c;
|
|
||||||
v->addWidget (c, 1);
|
|
||||||
connect (c, SIGNAL (clicked (bool)), this, SLOT (onShowTrackerScrapesToggled (bool)));
|
|
||||||
|
|
||||||
c = new QCheckBox (tr ("Show &backup trackers"));
|
|
||||||
c->setChecked (myPrefs.getBool (Prefs::SHOW_BACKUP_TRACKERS));
|
|
||||||
myShowBackupTrackersCheck = c;
|
|
||||||
v->addWidget (c, 1);
|
|
||||||
connect (c, SIGNAL (clicked (bool)), this, SLOT (onShowBackupTrackersToggled (bool)));
|
|
||||||
|
|
||||||
return top;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
****
|
****
|
||||||
***/
|
***/
|
||||||
|
|
||||||
QWidget *
|
void
|
||||||
Details::createPeersTab ()
|
Details::initPeersTab ()
|
||||||
{
|
{
|
||||||
QWidget * top = new QWidget;
|
|
||||||
QVBoxLayout * v = new QVBoxLayout (top);
|
|
||||||
v->setSpacing (HIG::PAD_BIG);
|
|
||||||
v->setContentsMargins (HIG::PAD_BIG, HIG::PAD_BIG, HIG::PAD_BIG, HIG::PAD_BIG);
|
|
||||||
|
|
||||||
QStringList headers;
|
QStringList headers;
|
||||||
headers << QString () << tr ("Up") << tr ("Down") << tr ("%") << tr ("Status") << tr ("Address") << tr ("Client");
|
headers << QString () << tr ("Up") << tr ("Down") << tr ("%") << tr ("Status") << tr ("Address") << tr ("Client");
|
||||||
myPeerTree = new QTreeWidget;
|
|
||||||
myPeerTree->setUniformRowHeights (true);
|
|
||||||
myPeerTree->setHeaderLabels (headers);
|
|
||||||
myPeerTree->setColumnWidth (0, 20);
|
|
||||||
myPeerTree->setSortingEnabled (true);
|
|
||||||
myPeerTree->sortByColumn (COL_ADDRESS, Qt::AscendingOrder);
|
|
||||||
myPeerTree->setRootIsDecorated (false);
|
|
||||||
myPeerTree->setTextElideMode (Qt::ElideRight);
|
|
||||||
v->addWidget (myPeerTree, 1);
|
|
||||||
|
|
||||||
const QFontMetrics m (font ());
|
ui.peersView->setHeaderLabels (headers);
|
||||||
QSize size = m.size (0, "1024 MiB/s");
|
ui.peersView->sortByColumn (COL_ADDRESS, Qt::AscendingOrder);
|
||||||
myPeerTree->setColumnWidth (COL_UP, size.width ());
|
|
||||||
myPeerTree->setColumnWidth (COL_DOWN, size.width ());
|
|
||||||
size = m.size (0, " 100% ");
|
|
||||||
myPeerTree->setColumnWidth (COL_PERCENT, size.width ());
|
|
||||||
size = m.size (0, "ODUK?EXI");
|
|
||||||
myPeerTree->setColumnWidth (COL_STATUS, size.width ());
|
|
||||||
size = m.size (0, "888.888.888.888");
|
|
||||||
myPeerTree->setColumnWidth (COL_ADDRESS, size.width ());
|
|
||||||
size = m.size (0, "Some BitTorrent Client");
|
|
||||||
myPeerTree->setColumnWidth (COL_CLIENT, size.width ());
|
|
||||||
myPeerTree->setAlternatingRowColors (true);
|
|
||||||
|
|
||||||
return top;
|
ui.peersView->setColumnWidth (COL_LOCK, 20);
|
||||||
|
ui.peersView->setColumnWidth (COL_UP, measureViewItem (ui.peersView, "1024 MiB/s"));
|
||||||
|
ui.peersView->setColumnWidth (COL_DOWN, measureViewItem (ui.peersView, "1024 MiB/s"));
|
||||||
|
ui.peersView->setColumnWidth (COL_PERCENT, measureViewItem (ui.peersView, "100%"));
|
||||||
|
ui.peersView->setColumnWidth (COL_STATUS, measureViewItem (ui.peersView, "ODUK?EXI"));
|
||||||
|
ui.peersView->setColumnWidth (COL_ADDRESS, measureViewItem (ui.peersView, "888.888.888.888"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
****
|
****
|
||||||
***/
|
***/
|
||||||
|
|
||||||
QWidget *
|
void
|
||||||
Details::createFilesTab ()
|
Details::initFilesTab ()
|
||||||
{
|
{
|
||||||
myFileTreeView = new FileTreeView ();
|
connect (ui.filesView, SIGNAL (priorityChanged (QSet<int>, int)), SLOT (onFilePriorityChanged (QSet<int>, int)));
|
||||||
|
connect (ui.filesView, SIGNAL (wantedChanged (QSet<int>, bool)), SLOT (onFileWantedChanged (QSet<int>, bool)));
|
||||||
connect (myFileTreeView, SIGNAL ( priorityChanged (QSet<int>, int)),
|
connect (ui.filesView, SIGNAL (pathEdited (QString, QString)), SLOT (onPathEdited (QString, QString)));
|
||||||
this, SLOT ( onFilePriorityChanged (QSet<int>, int)));
|
connect (ui.filesView, SIGNAL (openRequested (QString)), SLOT (onOpenRequested (QString)));
|
||||||
|
|
||||||
connect (myFileTreeView, SIGNAL ( wantedChanged (QSet<int>, bool)),
|
|
||||||
this, SLOT ( onFileWantedChanged (QSet<int>, bool)));
|
|
||||||
|
|
||||||
connect (myFileTreeView, SIGNAL (pathEdited (QString, QString)),
|
|
||||||
this, SLOT (onPathEdited (QString, QString)));
|
|
||||||
|
|
||||||
connect (myFileTreeView, SIGNAL (openRequested (QString)),
|
|
||||||
this, SLOT (onOpenRequested (QString)));
|
|
||||||
|
|
||||||
return myFileTreeView;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
75
qt/details.h
75
qt/details.h
@@ -15,20 +15,11 @@
|
|||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QWidgetList>
|
|
||||||
|
|
||||||
#include "prefs.h"
|
#include "prefs.h"
|
||||||
|
|
||||||
class FileTreeView;
|
#include "ui_details.h"
|
||||||
class QTreeView;
|
|
||||||
class QComboBox;
|
|
||||||
class QCheckBox;
|
|
||||||
class QDoubleSpinBox;
|
|
||||||
class QLabel;
|
|
||||||
class QRadioButton;
|
|
||||||
class QSpinBox;
|
|
||||||
class QTextBrowser;
|
|
||||||
class QTreeWidget;
|
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
class Session;
|
class Session;
|
||||||
class Torrent;
|
class Torrent;
|
||||||
@@ -55,17 +46,16 @@ class Details: public QDialog
|
|||||||
virtual QSize sizeHint () const { return QSize (440, 460); }
|
virtual QSize sizeHint () const { return QSize (440, 460); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QWidget * createPeersTab ();
|
void initPeersTab ();
|
||||||
QWidget * createTrackerTab ();
|
void initTrackerTab ();
|
||||||
QWidget * createInfoTab ();
|
void initInfoTab ();
|
||||||
QWidget * createFilesTab ();
|
void initFilesTab ();
|
||||||
QWidget * createOptionsTab ();
|
void initOptionsTab ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QIcon getStockIcon (const QString& freedesktop_name, int fallback);
|
QIcon getStockIcon (const QString& freedesktop_name, int fallback);
|
||||||
QString timeToStringRounded (int seconds);
|
QString timeToStringRounded (int seconds);
|
||||||
QString trimToDesiredWidth (const QString& str);
|
QString trimToDesiredWidth (const QString& str);
|
||||||
void enableWhenChecked (QCheckBox *, QWidget *);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Session& mySession;
|
Session& mySession;
|
||||||
@@ -76,63 +66,14 @@ class Details: public QDialog
|
|||||||
bool myChangedTorrents;
|
bool myChangedTorrents;
|
||||||
bool myHavePendingRefresh;
|
bool myHavePendingRefresh;
|
||||||
|
|
||||||
QLabel * myStateLabel;
|
Ui::DetailsDialog ui;
|
||||||
QLabel * myHaveLabel;
|
|
||||||
QLabel * myAvailabilityLabel;
|
|
||||||
QLabel * myDownloadedLabel;
|
|
||||||
QLabel * myUploadedLabel;
|
|
||||||
QLabel * myErrorLabel;
|
|
||||||
QLabel * myRunTimeLabel;
|
|
||||||
QLabel * myETALabel;
|
|
||||||
QLabel * myLastActivityLabel;
|
|
||||||
|
|
||||||
QCheckBox * mySessionLimitCheck;
|
|
||||||
QCheckBox * mySingleDownCheck;
|
|
||||||
QCheckBox * mySingleUpCheck;
|
|
||||||
QCheckBox * myShowTrackerScrapesCheck;
|
|
||||||
QCheckBox * myShowBackupTrackersCheck;
|
|
||||||
QPushButton * myAddTrackerButton;
|
|
||||||
QPushButton * myEditTrackerButton;
|
|
||||||
QPushButton * myRemoveTrackerButton;
|
|
||||||
QSpinBox * mySingleDownSpin;
|
|
||||||
QSpinBox * mySingleUpSpin;
|
|
||||||
QComboBox * myRatioCombo;
|
|
||||||
QDoubleSpinBox * myRatioSpin;
|
|
||||||
QComboBox * myIdleCombo;
|
|
||||||
QSpinBox * myIdleSpin;
|
|
||||||
QSpinBox * myPeerLimitSpin;
|
|
||||||
QComboBox * myBandwidthPriorityCombo;
|
|
||||||
|
|
||||||
QLabel * mySizeLabel;
|
|
||||||
QLabel * myHashLabel;
|
|
||||||
QLabel * myPrivacyLabel;
|
|
||||||
QLabel * myOriginLabel;
|
|
||||||
QLabel * myLocationLabel;
|
|
||||||
QTextBrowser * myCommentBrowser;
|
|
||||||
|
|
||||||
QLabel * myTrackerLabel;
|
|
||||||
QLabel * myScrapeTimePrevLabel;
|
|
||||||
QLabel * myScrapeTimeNextLabel;
|
|
||||||
QLabel * myScrapeResponseLabel;
|
|
||||||
QLabel * myAnnounceTimePrevLabel;
|
|
||||||
QLabel * myAnnounceTimeNextLabel;
|
|
||||||
QLabel * myAnnounceResponseLabel;
|
|
||||||
QLabel * myAnnounceManualLabel;
|
|
||||||
|
|
||||||
TrackerModel * myTrackerModel;
|
TrackerModel * myTrackerModel;
|
||||||
TrackerModelFilter * myTrackerFilter;
|
TrackerModelFilter * myTrackerFilter;
|
||||||
TrackerDelegate * myTrackerDelegate;
|
TrackerDelegate * myTrackerDelegate;
|
||||||
QTreeView * myTrackerView;
|
|
||||||
//QMap<QString,QTreeWidgetItem*> myTrackerTiers;
|
|
||||||
//QMap<QString,QTreeWidgetItem*> myTrackerItems;
|
|
||||||
|
|
||||||
QTreeWidget * myPeerTree;
|
|
||||||
QMap<QString,QTreeWidgetItem*> myPeers;
|
QMap<QString,QTreeWidgetItem*> myPeers;
|
||||||
|
|
||||||
QWidgetList myWidgets;
|
|
||||||
|
|
||||||
FileTreeView * myFileTreeView;
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void refreshPref (int key);
|
void refreshPref (int key);
|
||||||
void onBandwidthPriorityChanged (int);
|
void onBandwidthPriorityChanged (int);
|
||||||
|
|||||||
936
qt/details.ui
Normal file
936
qt/details.ui
Normal file
@@ -0,0 +1,936 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>DetailsDialog</class>
|
||||||
|
<widget class="QDialog" name="DetailsDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>505</width>
|
||||||
|
<height>579</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Torrent Properties</string>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">[tr-style~="form-section"]
|
||||||
|
{
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: 12px;
|
||||||
|
margin-bottom: 1px;
|
||||||
|
}
|
||||||
|
[tr-style~="form-section"][tr-style~="first"]
|
||||||
|
{
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
[tr-style~="form-label"]
|
||||||
|
{
|
||||||
|
margin-left: 18px;
|
||||||
|
}</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="dialogLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTabWidget" name="tabs">
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="infoTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Information</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QGridLayout" name="infoTabLayout" rowstretch="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1" columnstretch="0,1">
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="activitySectionLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Activity</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-section first</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="haveLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Have:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="SqueezeLabel" name="haveValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::NoTextInteraction</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="availabilityLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Availability:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="SqueezeLabel" name="availabilityValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::NoTextInteraction</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="uploadedLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Uploaded:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="SqueezeLabel" name="uploadedValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::NoTextInteraction</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="downloadedLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Downloaded:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="SqueezeLabel" name="downloadedValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::NoTextInteraction</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="stateLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>State:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="SqueezeLabel" name="stateValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::NoTextInteraction</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QLabel" name="runningTimeLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Running time:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="1">
|
||||||
|
<widget class="SqueezeLabel" name="runningTimeValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::NoTextInteraction</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<widget class="QLabel" name="remainingTimeLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Remaining time:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="1">
|
||||||
|
<widget class="SqueezeLabel" name="remainingTimeValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::NoTextInteraction</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="0">
|
||||||
|
<widget class="QLabel" name="lastActivityLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Last activity:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="1">
|
||||||
|
<widget class="SqueezeLabel" name="lastActivityValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::NoTextInteraction</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="0">
|
||||||
|
<widget class="QLabel" name="errorLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Error:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="1">
|
||||||
|
<widget class="SqueezeLabel" name="errorValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="detailsSectionLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Details</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-section</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="11" column="0">
|
||||||
|
<widget class="QLabel" name="sizeLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Size:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="11" column="1">
|
||||||
|
<widget class="SqueezeLabel" name="sizeValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::NoTextInteraction</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="12" column="0">
|
||||||
|
<widget class="QLabel" name="locationLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Location:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="12" column="1">
|
||||||
|
<widget class="SqueezeLabel" name="locationValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="13" column="0">
|
||||||
|
<widget class="QLabel" name="hashLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Hash:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="13" column="1">
|
||||||
|
<widget class="SqueezeLabel" name="hashValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="14" column="0">
|
||||||
|
<widget class="QLabel" name="privacyLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Privacy:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="14" column="1">
|
||||||
|
<widget class="SqueezeLabel" name="privacyValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::NoTextInteraction</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="15" column="0">
|
||||||
|
<widget class="QLabel" name="originLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Origin:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="15" column="1">
|
||||||
|
<widget class="SqueezeLabel" name="originValueLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="16" column="0">
|
||||||
|
<widget class="QLabel" name="commentLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Comment:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>commentBrowser</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="16" column="1">
|
||||||
|
<widget class="QTextBrowser" name="commentBrowser">
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="peersTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Peers</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="peersTabLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTreeWidget" name="peersView">
|
||||||
|
<property name="alternatingRowColors">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="rootIsDecorated">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="uniformRowHeights">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sortingEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="columnCount">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<attribute name="headerShowSortIndicator" stdset="0">
|
||||||
|
<bool>true</bool>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="trackersTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Tracker</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QGridLayout" name="trackersTabLayout">
|
||||||
|
<item row="0" column="0" rowspan="4">
|
||||||
|
<widget class="QListView" name="trackersView">
|
||||||
|
<property name="alternatingRowColors">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QToolButton" name="addTrackerButton">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Add Tracker</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolButtonStyle">
|
||||||
|
<enum>Qt::ToolButtonIconOnly</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QToolButton" name="editTrackerButton">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Edit Tracker</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolButtonStyle">
|
||||||
|
<enum>Qt::ToolButtonIconOnly</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QToolButton" name="removeTrackerButton">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Remove Trackers</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolButtonStyle">
|
||||||
|
<enum>Qt::ToolButtonIconOnly</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<spacer name="trackerButtonsSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>1</width>
|
||||||
|
<height>1</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QCheckBox" name="showTrackerScrapesCheck">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show &more details</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QCheckBox" name="showBackupTrackersCheck">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show &backup trackers</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="filesTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Files</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="filesTabLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="FileTreeView" name="filesView"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="optionsTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Options</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QGridLayout" name="optionsTabLayout" columnstretch="0,1">
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="speedSectionLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Speed</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-section first</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="sessionLimitCheck">
|
||||||
|
<property name="text">
|
||||||
|
<string>Honor global &limits</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QCheckBox" name="singleDownCheck">
|
||||||
|
<property name="text">
|
||||||
|
<string>Limit &download speed (%1):</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QSpinBox" name="singleDownSpin">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>999999999</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QCheckBox" name="singleUpCheck">
|
||||||
|
<property name="text">
|
||||||
|
<string>Limit &upload speed (%1):</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QSpinBox" name="singleUpSpin">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>999999999</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="bandwidthPriorityLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Torrent &priority:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>bandwidthPriorityCombo</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QComboBox" name="bandwidthPriorityCombo"/>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="seedingLimitsSectionLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Seeding Limits</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-section</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QLabel" name="ratioLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Ratio:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>ratioCombo</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="ratioValueLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="ratioCombo"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="ratioSpin">
|
||||||
|
<property name="minimum">
|
||||||
|
<double>0.500000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>999999999.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<widget class="QLabel" name="idleLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Idle:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>idleCombo</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="idleValueLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="idleCombo"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="idleSpin">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>9999</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="peerConnectionsSectionLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Peer Connections</string>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-section</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="0">
|
||||||
|
<widget class="QLabel" name="peerLimitLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Maximum peers:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>peerLimitSpin</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="tr-style" stdset="0">
|
||||||
|
<string notr="true">form-label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="1">
|
||||||
|
<widget class="QSpinBox" name="peerLimitSpin">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>300</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="0" colspan="2">
|
||||||
|
<spacer name="optionsTabBottomSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>1</width>
|
||||||
|
<height>1</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="dialogButtons">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Close</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>SqueezeLabel</class>
|
||||||
|
<extends>QLabel</extends>
|
||||||
|
<header>squeezelabel.h</header>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>FileTreeView</class>
|
||||||
|
<extends>QTreeView</extends>
|
||||||
|
<header>file-tree.h</header>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>tabs</tabstop>
|
||||||
|
<tabstop>errorValueLabel</tabstop>
|
||||||
|
<tabstop>locationValueLabel</tabstop>
|
||||||
|
<tabstop>hashValueLabel</tabstop>
|
||||||
|
<tabstop>originValueLabel</tabstop>
|
||||||
|
<tabstop>commentBrowser</tabstop>
|
||||||
|
<tabstop>peersView</tabstop>
|
||||||
|
<tabstop>trackersView</tabstop>
|
||||||
|
<tabstop>addTrackerButton</tabstop>
|
||||||
|
<tabstop>editTrackerButton</tabstop>
|
||||||
|
<tabstop>removeTrackerButton</tabstop>
|
||||||
|
<tabstop>showTrackerScrapesCheck</tabstop>
|
||||||
|
<tabstop>showBackupTrackersCheck</tabstop>
|
||||||
|
<tabstop>filesView</tabstop>
|
||||||
|
<tabstop>sessionLimitCheck</tabstop>
|
||||||
|
<tabstop>singleDownCheck</tabstop>
|
||||||
|
<tabstop>singleDownSpin</tabstop>
|
||||||
|
<tabstop>singleUpCheck</tabstop>
|
||||||
|
<tabstop>singleUpSpin</tabstop>
|
||||||
|
<tabstop>bandwidthPriorityCombo</tabstop>
|
||||||
|
<tabstop>ratioCombo</tabstop>
|
||||||
|
<tabstop>ratioSpin</tabstop>
|
||||||
|
<tabstop>idleCombo</tabstop>
|
||||||
|
<tabstop>idleSpin</tabstop>
|
||||||
|
<tabstop>peerLimitSpin</tabstop>
|
||||||
|
<tabstop>dialogButtons</tabstop>
|
||||||
|
</tabstops>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>dialogButtons</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>DetailsDialog</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>26</x>
|
||||||
|
<y>563</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>20</x>
|
||||||
|
<y>20</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>dialogButtons</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>DetailsDialog</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>26</x>
|
||||||
|
<y>563</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>20</x>
|
||||||
|
<y>20</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>singleDownCheck</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>singleDownSpin</receiver>
|
||||||
|
<slot>setEnabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>35</x>
|
||||||
|
<y>99</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>247</x>
|
||||||
|
<y>93</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>singleUpCheck</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>singleUpSpin</receiver>
|
||||||
|
<slot>setEnabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>35</x>
|
||||||
|
<y>131</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>247</x>
|
||||||
|
<y>125</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
||||||
@@ -46,7 +46,8 @@ TRANSLATIONS += translations/transmission_en.ts \
|
|||||||
translations/transmission_ru.ts \
|
translations/transmission_ru.ts \
|
||||||
translations/transmission_uk.ts
|
translations/transmission_uk.ts
|
||||||
|
|
||||||
FORMS += mainwin.ui
|
FORMS += details.ui \
|
||||||
|
mainwin.ui
|
||||||
RESOURCES += application.qrc
|
RESOURCES += application.qrc
|
||||||
SOURCES += about.cc \
|
SOURCES += about.cc \
|
||||||
add-data.cc \
|
add-data.cc \
|
||||||
|
|||||||
@@ -40,40 +40,33 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QResizeEvent>
|
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QStyleOption>
|
#include <QStyleOption>
|
||||||
|
|
||||||
#include "squeezelabel.h"
|
#include "squeezelabel.h"
|
||||||
|
|
||||||
void
|
|
||||||
SqueezeLabel::init ()
|
|
||||||
{
|
|
||||||
setTextInteractionFlags(Qt::TextSelectableByMouse);
|
|
||||||
}
|
|
||||||
|
|
||||||
SqueezeLabel::SqueezeLabel (const QString& text, QWidget * parent):
|
SqueezeLabel::SqueezeLabel (const QString& text, QWidget * parent):
|
||||||
QLabel (text, parent)
|
QLabel (text, parent)
|
||||||
{
|
{
|
||||||
init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SqueezeLabel::SqueezeLabel (QWidget * parent):
|
SqueezeLabel::SqueezeLabel (QWidget * parent):
|
||||||
QLabel (parent)
|
QLabel (parent)
|
||||||
{
|
{
|
||||||
init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SqueezeLabel::paintEvent (QPaintEvent * paintEvent)
|
SqueezeLabel::paintEvent (QPaintEvent * paintEvent)
|
||||||
{
|
{
|
||||||
Q_UNUSED (paintEvent);
|
if (hasFocus () && (textInteractionFlags () & (Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse)))
|
||||||
|
return QLabel::paintEvent (paintEvent);
|
||||||
|
|
||||||
QPainter painter (this);
|
QPainter painter (this);
|
||||||
QFontMetrics fm = fontMetrics ();
|
QFontMetrics fm = fontMetrics ();
|
||||||
QStyleOption opt;
|
QStyleOption opt;
|
||||||
opt.initFrom (this);
|
opt.initFrom (this);
|
||||||
const QString elidedText = fm.elidedText (text(), Qt::ElideMiddle, width());
|
const QString fullText = text ();
|
||||||
|
const QString elidedText = fm.elidedText (fullText, Qt::ElideRight, width());
|
||||||
style()->drawItemText (&painter,
|
style()->drawItemText (&painter,
|
||||||
contentsRect(),
|
contentsRect(),
|
||||||
alignment(),
|
alignment(),
|
||||||
@@ -81,4 +74,8 @@ SqueezeLabel::paintEvent (QPaintEvent * paintEvent)
|
|||||||
isEnabled(),
|
isEnabled(),
|
||||||
elidedText,
|
elidedText,
|
||||||
foregroundRole());
|
foregroundRole());
|
||||||
|
|
||||||
|
#ifndef QT_NO_TOOLTIP
|
||||||
|
setToolTip (fullText != elidedText ? fullText : QString ());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ class SqueezeLabel : public QLabel
|
|||||||
SqueezeLabel (const QString& text, QWidget *parent=0);
|
SqueezeLabel (const QString& text, QWidget *parent=0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void init ();
|
|
||||||
void paintEvent (QPaintEvent* paintEvent);
|
void paintEvent (QPaintEvent* paintEvent);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user