Rework forms layout to workaround some stylesheet issues (Qt client)
This commit is contained in:
parent
9b8c6bc0f0
commit
beeb4521c0
|
@ -28,6 +28,7 @@ set(${PROJECT_NAME}_SOURCES
|
|||
about.cc
|
||||
add-data.cc
|
||||
app.cc
|
||||
column-resizer.cc
|
||||
dbus-adaptor.cc
|
||||
details.cc
|
||||
favicon.cc
|
||||
|
@ -67,6 +68,7 @@ set(${PROJECT_NAME}_HEADERS
|
|||
about.h
|
||||
add-data.h
|
||||
app.h
|
||||
column-resizer.h
|
||||
dbus-adaptor.h
|
||||
details.h
|
||||
favicon.h
|
||||
|
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* This file Copyright (C) 2015 Mnemosyne LLC
|
||||
*
|
||||
* It may be used under the GNU GPL versions 2 or 3
|
||||
* or any future license endorsed by Mnemosyne LLC.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <QEvent>
|
||||
#include <QGridLayout>
|
||||
#include <QTimer>
|
||||
|
||||
#include "column-resizer.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
int
|
||||
itemColumnSpan (QGridLayout * layout, const QLayoutItem * item)
|
||||
{
|
||||
for (int i = 0, count = layout->count (); i < count; ++i)
|
||||
{
|
||||
if (layout->itemAt (i) != item)
|
||||
continue;
|
||||
|
||||
int row, column, rowSpan, columnSpan;
|
||||
layout->getItemPosition (i, &row, &column, &rowSpan, &columnSpan);
|
||||
return columnSpan;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
ColumnResizer::ColumnResizer (QObject * parent):
|
||||
QObject (parent),
|
||||
myTimer (new QTimer (this)),
|
||||
myLayouts ()
|
||||
{
|
||||
myTimer->setSingleShot (true);
|
||||
connect (myTimer, SIGNAL (timeout ()), SLOT (update ()));
|
||||
}
|
||||
|
||||
void
|
||||
ColumnResizer::addLayout (QGridLayout * layout)
|
||||
{
|
||||
myLayouts << layout;
|
||||
scheduleUpdate ();
|
||||
}
|
||||
|
||||
bool
|
||||
ColumnResizer::eventFilter (QObject * object, QEvent * event)
|
||||
{
|
||||
if (event->type () == QEvent::Resize)
|
||||
scheduleUpdate ();
|
||||
return QObject::eventFilter (object, event);
|
||||
}
|
||||
|
||||
void
|
||||
ColumnResizer::update ()
|
||||
{
|
||||
int maxWidth = 0;
|
||||
foreach (QGridLayout * layout, myLayouts)
|
||||
{
|
||||
for (int i = 0, count = layout->rowCount (); i < count; ++i)
|
||||
{
|
||||
QLayoutItem * item = layout->itemAtPosition (i, 0);
|
||||
if (item == nullptr || itemColumnSpan (layout, item) > 1)
|
||||
continue;
|
||||
maxWidth = qMax (maxWidth, item->sizeHint ().width ());
|
||||
}
|
||||
}
|
||||
|
||||
foreach (QGridLayout * layout, myLayouts)
|
||||
layout->setColumnMinimumWidth (0, maxWidth);
|
||||
}
|
||||
|
||||
void
|
||||
ColumnResizer::scheduleUpdate ()
|
||||
{
|
||||
myTimer->start (0);
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* This file Copyright (C) 2015 Mnemosyne LLC
|
||||
*
|
||||
* It may be used under the GNU GPL versions 2 or 3
|
||||
* or any future license endorsed by Mnemosyne LLC.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef QTR_COLUMN_RESIZER_H
|
||||
#define QTR_COLUMN_RESIZER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
|
||||
class QGridLayout;
|
||||
class QTimer;
|
||||
|
||||
class ColumnResizer: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ColumnResizer (QObject * parent = nullptr);
|
||||
|
||||
void addLayout (QGridLayout * layout);
|
||||
|
||||
virtual bool eventFilter (QObject * object, QEvent * event);
|
||||
|
||||
public slots:
|
||||
void update ();
|
||||
|
||||
private:
|
||||
void scheduleUpdate ();
|
||||
|
||||
private:
|
||||
QTimer * myTimer;
|
||||
QSet<QGridLayout *> myLayouts;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -32,6 +32,7 @@
|
|||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h> // tr_getRatio ()
|
||||
|
||||
#include "column-resizer.h"
|
||||
#include "details.h"
|
||||
#include "file-tree.h"
|
||||
#include "formatter.h"
|
||||
|
@ -959,6 +960,11 @@ Details::initInfoTab ()
|
|||
{
|
||||
const int h = QFontMetrics (ui.commentBrowser->font ()).lineSpacing () * 4;
|
||||
ui.commentBrowser->setFixedHeight (h);
|
||||
|
||||
ColumnResizer * cr (new ColumnResizer (this));
|
||||
cr->addLayout (ui.activitySectionLayout);
|
||||
cr->addLayout (ui.detailsSectionLayout);
|
||||
cr->update ();
|
||||
}
|
||||
|
||||
/***
|
||||
|
@ -1177,6 +1183,13 @@ Details::initOptionsTab ()
|
|||
ui.idleCombo->addItem (tr ("Seed regardless of activity"), TR_IDLELIMIT_UNLIMITED);
|
||||
ui.idleCombo->addItem (tr ("Stop seeding if idle for:"), TR_IDLELIMIT_SINGLE);
|
||||
|
||||
ColumnResizer * cr (new ColumnResizer (this));
|
||||
cr->addLayout (ui.speedSectionLayout);
|
||||
cr->addLayout (ui.seedingLimitsSectionRatioLayout);
|
||||
cr->addLayout (ui.seedingLimitsSectionIdleLayout);
|
||||
cr->addLayout (ui.peerConnectionsSectionLayout);
|
||||
cr->update ();
|
||||
|
||||
connect (ui.sessionLimitCheck, SIGNAL (clicked (bool)), SLOT (onHonorsSessionLimitsToggled (bool)));
|
||||
connect (ui.singleDownCheck, SIGNAL (clicked (bool)), SLOT (onDownloadLimitedToggled (bool)));
|
||||
connect (ui.singleDownSpin, SIGNAL (editingFinished ()), SLOT (onSpinBoxEditingFinished ()));
|
||||
|
|
1190
qt/details.ui
1190
qt/details.ui
File diff suppressed because it is too large
Load Diff
|
@ -17,6 +17,7 @@
|
|||
#include <libtransmission/makemeta.h>
|
||||
#include <libtransmission/utils.h>
|
||||
|
||||
#include "column-resizer.h"
|
||||
#include "formatter.h"
|
||||
#include "make-dialog.h"
|
||||
#include "session.h"
|
||||
|
@ -220,14 +221,19 @@ MakeDialog::MakeDialog (Session& session, QWidget * parent):
|
|||
{
|
||||
ui.setupUi (this);
|
||||
|
||||
resize (minimumSizeHint ());
|
||||
|
||||
ui.destinationButton->setMode (TrPathButton::DirectoryMode);
|
||||
ui.destinationButton->setPath (QDir::homePath ());
|
||||
|
||||
ui.sourceFolderButton->setMode (TrPathButton::DirectoryMode);
|
||||
ui.sourceFileButton->setMode (TrPathButton::FileMode);
|
||||
|
||||
ColumnResizer * cr (new ColumnResizer (this));
|
||||
cr->addLayout (ui.filesSectionLayout);
|
||||
cr->addLayout (ui.propertiesSectionLayout);
|
||||
cr->update ();
|
||||
|
||||
resize (minimumSizeHint ());
|
||||
|
||||
connect (ui.sourceFolderRadio, SIGNAL (toggled (bool)), this, SLOT (onSourceChanged ()));
|
||||
connect (ui.sourceFolderButton, SIGNAL (pathChanged (QString)), this, SLOT (onSourceChanged ()));
|
||||
connect (ui.sourceFileRadio, SIGNAL (toggled (bool)), this, SLOT (onSourceChanged ()));
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>566</width>
|
||||
<height>417</height>
|
||||
<height>426</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
|
@ -16,161 +16,157 @@
|
|||
<property name="windowTitle">
|
||||
<string>New Torrent</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="QGridLayout" name="dialogLayout">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QVBoxLayout" name="dialogLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="filesSectionLabel">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-weight:bold</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Files</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="destinationLabel">
|
||||
<property name="text">
|
||||
<string>Sa&ve to:</string>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="filesSectionLayout" columnstretch="0,1">
|
||||
<property name="leftMargin">
|
||||
<number>18</number>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>destinationButton</cstring>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="destinationLabel">
|
||||
<property name="text">
|
||||
<string>Sa&ve to:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>destinationButton</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="TrPathButton" name="destinationButton"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="sourceFolderRadio">
|
||||
<property name="text">
|
||||
<string>Source f&older:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="TrPathButton" name="sourceFolderButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QRadioButton" name="sourceFileRadio">
|
||||
<property name="text">
|
||||
<string>Source &file:</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="TrPathButton" name="sourceFileButton"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="sourceSizeLabel">
|
||||
<property name="text">
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="TrPathButton" name="destinationButton"/>
|
||||
<item>
|
||||
<spacer name="propertiesSectionSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>1</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QRadioButton" name="sourceFolderRadio">
|
||||
<property name="text">
|
||||
<string>Source f&older:</string>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="TrPathButton" name="sourceFolderButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QRadioButton" name="sourceFileRadio">
|
||||
<property name="text">
|
||||
<string>Source &file:</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="TrPathButton" name="sourceFileButton"/>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="sourceSizeLabel">
|
||||
<property name="text">
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<item>
|
||||
<widget class="QLabel" name="propertiesSectionLabel">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-weight:bold</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Properties</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="trackersLabel">
|
||||
<property name="text">
|
||||
<string>&Trackers:</string>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="propertiesSectionLayout" columnstretch="0,1">
|
||||
<property name="leftMargin">
|
||||
<number>18</number>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>trackersEdit</cstring>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QPlainTextEdit" name="trackersEdit">
|
||||
<property name="tabChangesFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="lineWrapMode">
|
||||
<enum>QPlainTextEdit::NoWrap</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLabel" name="trackersDescriptionLabel">
|
||||
<property name="text">
|
||||
<string>To add a backup URL, add it on the line after the primary URL.
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="trackersLabel">
|
||||
<property name="text">
|
||||
<string>&Trackers:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>trackersEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPlainTextEdit" name="trackersEdit">
|
||||
<property name="tabChangesFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="lineWrapMode">
|
||||
<enum>QPlainTextEdit::NoWrap</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="trackersDescriptionLabel">
|
||||
<property name="text">
|
||||
<string>To add a backup URL, add it on the line after the primary URL.
|
||||
To add another primary URL, add it after a blank line.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="commentCheck">
|
||||
<property name="text">
|
||||
<string>Co&mment:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="commentEdit">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="privateCheck">
|
||||
<property name="text">
|
||||
<string>&Private torrent</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QCheckBox" name="commentCheck">
|
||||
<property name="text">
|
||||
<string>Co&mment:</string>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLineEdit" name="commentEdit">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="privateCheck">
|
||||
<property name="text">
|
||||
<string>&Private torrent</string>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0" colspan="2">
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="dialogButtons">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
|
|
@ -63,6 +63,7 @@ win32|macx:RESOURCES += icons/Faenza/Faenza.qrc
|
|||
SOURCES += about.cc \
|
||||
add-data.cc \
|
||||
app.cc \
|
||||
column-resizer.cc \
|
||||
dbus-adaptor.cc \
|
||||
details.cc \
|
||||
favicon.cc \
|
||||
|
|
102
qt/relocate.ui
102
qt/relocate.ui
|
@ -6,84 +6,62 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>339</width>
|
||||
<height>151</height>
|
||||
<width>333</width>
|
||||
<height>155</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Set Torrent Location</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;
|
||||
}
|
||||
#newLocationStack
|
||||
{
|
||||
min-width: 15em;
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="dialogLayout">
|
||||
<layout class="QVBoxLayout" name="dialogLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<item>
|
||||
<widget class="QLabel" name="setLocationSectionLabel">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-weight:bold</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Set Location</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="newLocationLabel">
|
||||
<property name="text">
|
||||
<string>New &location:</string>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="setLocationSectionLayout" columnstretch="0,1">
|
||||
<property name="leftMargin">
|
||||
<number>18</number>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="newLocationLabel">
|
||||
<property name="text">
|
||||
<string>New &location:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QStackedWidget" name="newLocationStack">
|
||||
<widget class="TrPathButton" name="newLocationButton"/>
|
||||
<widget class="QLineEdit" name="newLocationEdit"/>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="moveDataRadio">
|
||||
<property name="text">
|
||||
<string>&Move from the current folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="findDataRadio">
|
||||
<property name="text">
|
||||
<string>Local data is &already there</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QStackedWidget" name="newLocationStack">
|
||||
<widget class="TrPathButton" name="newLocationButton"/>
|
||||
<widget class="QLineEdit" name="newLocationEdit"/>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="moveDataRadio">
|
||||
<property name="text">
|
||||
<string>&Move from the current folder</string>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="findDataRadio">
|
||||
<property name="text">
|
||||
<string>Local data is &already there</string>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="dialogButtons">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
|
|
@ -6,149 +6,119 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>248</width>
|
||||
<height>263</height>
|
||||
<width>250</width>
|
||||
<height>265</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Change Session</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="QGridLayout" name="dialogLayout">
|
||||
<layout class="QVBoxLayout" name="dialogLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<item>
|
||||
<widget class="QLabel" name="sourceSectionLabel">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-weight:bold</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Source</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="QRadioButton" name="localSessionRadio">
|
||||
<property name="text">
|
||||
<string>Start &Local Session</string>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="sourceSectionLayout" columnstretch="0,1">
|
||||
<property name="leftMargin">
|
||||
<number>18</number>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="localSessionRadio">
|
||||
<property name="text">
|
||||
<string>Start &Local Session</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="remoteSessionRadio">
|
||||
<property name="text">
|
||||
<string>Connect to &Remote Session</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="hostLabel">
|
||||
<property name="text">
|
||||
<string>&Host:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>hostEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="hostEdit"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="portLabel">
|
||||
<property name="text">
|
||||
<string>&Port:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>portSpin</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="portSpin">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>65535</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="authCheck">
|
||||
<property name="text">
|
||||
<string>&Authentication required</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="usernameLabel">
|
||||
<property name="text">
|
||||
<string>&Username:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>usernameEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="usernameEdit"/>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="passwordLabel">
|
||||
<property name="text">
|
||||
<string>Pass&word:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>passwordEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="passwordEdit">
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="remoteSessionRadio">
|
||||
<property name="text">
|
||||
<string>Connect to &Remote Session</string>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="hostLabel">
|
||||
<property name="text">
|
||||
<string>&Host:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>hostEdit</cstring>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="hostEdit"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="portLabel">
|
||||
<property name="text">
|
||||
<string>&Port:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>portSpin</cstring>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QSpinBox" name="portSpin">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>65535</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="authCheck">
|
||||
<property name="text">
|
||||
<string>&Authentication required</string>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="usernameLabel">
|
||||
<property name="text">
|
||||
<string>&Username:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>usernameEdit</cstring>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="usernameEdit"/>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="passwordLabel">
|
||||
<property name="text">
|
||||
<string>Pass&word:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>passwordEdit</cstring>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLineEdit" name="passwordEdit">
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="2">
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="dialogButtons">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <QTimer>
|
||||
|
||||
#include "column-resizer.h"
|
||||
#include "formatter.h"
|
||||
#include "session.h"
|
||||
#include "stats-dialog.h"
|
||||
|
@ -25,6 +26,11 @@ StatsDialog::StatsDialog (Session& session, QWidget * parent):
|
|||
{
|
||||
ui.setupUi (this);
|
||||
|
||||
ColumnResizer * cr (new ColumnResizer (this));
|
||||
cr->addLayout (ui.currentSessionSectionLayout);
|
||||
cr->addLayout (ui.totalSectionLayout);
|
||||
cr->update ();
|
||||
|
||||
myTimer->setSingleShot (false);
|
||||
connect (myTimer, SIGNAL (timeout ()), &mySession, SLOT (refreshSessionStats ()));
|
||||
|
||||
|
|
|
@ -6,165 +6,187 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>139</width>
|
||||
<height>303</height>
|
||||
<width>138</width>
|
||||
<height>315</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Statistics</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="QGridLayout" name="dialogLayout">
|
||||
<layout class="QVBoxLayout" name="dialogLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<item>
|
||||
<widget class="QLabel" name="currentSessionSectionLabel">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-weight:bold</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Current Session</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="currentUploadedLabel">
|
||||
<property name="text">
|
||||
<string>Uploaded:</string>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="currentSessionSectionLayout" columnstretch="0,1">
|
||||
<property name="leftMargin">
|
||||
<number>18</number>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="currentUploadedLabel">
|
||||
<property name="text">
|
||||
<string>Uploaded:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="currentUploadedValueLabel">
|
||||
<property name="text">
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="currentDownloadedLabel">
|
||||
<property name="text">
|
||||
<string>Downloaded:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="currentDownloadedValueLabel">
|
||||
<property name="text">
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="currentRatioLabel">
|
||||
<property name="text">
|
||||
<string>Ratio:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="currentRatioValueLabel">
|
||||
<property name="text">
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="currentDurationLabel">
|
||||
<property name="text">
|
||||
<string>Duration:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="currentDurationValueLabel">
|
||||
<property name="text">
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="totalSectionSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="currentUploadedValueLabel"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="currentDownloadedLabel">
|
||||
<property name="text">
|
||||
<string>Downloaded:</string>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>1</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="currentDownloadedValueLabel"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="currentRatioLabel">
|
||||
<property name="text">
|
||||
<string>Ratio:</string>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="currentRatioValueLabel"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="currentDurationLabel">
|
||||
<property name="text">
|
||||
<string>Duration:</string>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="currentDurationValueLabel"/>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<item>
|
||||
<widget class="QLabel" name="totalSectionLabel">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-weight:bold</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Total</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="startCountLabel">
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="totalSectionLayout" columnstretch="0,1">
|
||||
<property name="leftMargin">
|
||||
<number>18</number>
|
||||
</property>
|
||||
</widget>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="startCountLabel">
|
||||
<property name="text">
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="totalUploadedLabel">
|
||||
<property name="text">
|
||||
<string>Uploaded:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="totalUploadedValueLabel">
|
||||
<property name="text">
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="totalDownloadedLabel">
|
||||
<property name="text">
|
||||
<string>Downloaded:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="totalDownloadedValueLabel">
|
||||
<property name="text">
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="totalRatioLabel">
|
||||
<property name="text">
|
||||
<string>Ratio:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="totalRatioValueLabel">
|
||||
<property name="text">
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="totalDurationLabel">
|
||||
<property name="text">
|
||||
<string>Duration:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="totalDurationValueLabel">
|
||||
<property name="text">
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="totalUploadedLabel">
|
||||
<property name="text">
|
||||
<string>Uploaded:</string>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLabel" name="totalUploadedValueLabel"/>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="totalDownloadedLabel">
|
||||
<property name="text">
|
||||
<string>Downloaded:</string>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLabel" name="totalDownloadedValueLabel"/>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="totalRatioLabel">
|
||||
<property name="text">
|
||||
<string>Ratio:</string>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QLabel" name="totalRatioValueLabel"/>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="totalDurationLabel">
|
||||
<property name="text">
|
||||
<string>Duration:</string>
|
||||
</property>
|
||||
<property name="tr-style" stdset="0">
|
||||
<string notr="true">form-label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QLabel" name="totalDurationValueLabel"/>
|
||||
</item>
|
||||
<item row="11" column="0" colspan="2">
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="dialogButtons">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
|
Loading…
Reference in New Issue