about.ui
details.ui
mainwin.ui
+ relocate.ui
session-dialog.ui
stats-dialog.ui
)
FORMS += about.ui \
details.ui \
mainwin.ui \
+ relocate.ui \
session-dialog.ui \
stats-dialog.ui
RESOURCES += application.qrc
* $Id$
*/
-#include <QApplication>
-#include <QDialogButtonBox>
#include <QDir>
#include <QFileIconProvider>
-#include <QLabel>
-#include <QPushButton>
-#include <QRadioButton>
-#include <QSet>
-#include <QStyle>
-#include <QVBoxLayout>
-#include <QWidget>
-
-#include "hig.h"
+#include <QFileInfo>
+
#include "relocate.h"
#include "session.h"
#include "torrent.h"
RelocateDialog::onSetLocation ()
{
mySession.torrentSetLocation (myIds, myPath, myMoveFlag);
- deleteLater ();
+ close ();
}
void
RelocateDialog::onFileSelected (const QString& path)
{
myPath = path;
- myDirButton->setText (myPath);
+
+ const QFileInfo pathInfo (path);
+ const QFileIconProvider iconProvider;
+
+ ui.newLocationButton->setIcon (mySession.isLocal () ?
+ iconProvider.icon (pathInfo) :
+ iconProvider.icon (QFileIconProvider::Folder));
+ ui.newLocationButton->setText (pathInfo.baseName ());
+ ui.newLocationButton->setToolTip (path);
}
void
myMoveFlag = b;
}
-RelocateDialog::RelocateDialog (Session & session,
- TorrentModel & model,
- const QSet<int> & ids,
- QWidget * parent):
+RelocateDialog::RelocateDialog (Session & session,
+ const TorrentModel & model,
+ const QSet<int> & ids,
+ QWidget * parent):
QDialog (parent),
mySession (session),
- myModel (model),
myIds (ids)
{
- const int iconSize (style ()->pixelMetric (QStyle::PM_SmallIconSize));
- const QFileIconProvider iconProvider;
- const QIcon folderIcon = iconProvider.icon (QFileIconProvider::Folder);
- const QPixmap folderPixmap = folderIcon.pixmap (iconSize);
-
- QRadioButton * find_rb;
- setWindowTitle (tr ("Set Torrent Location"));
+ ui.setupUi (this);
foreach (int id, myIds)
{
- const Torrent * tor = myModel.getTorrentFromId (id);
+ const Torrent * tor = model.getTorrentFromId (id);
if (myPath.isEmpty ())
{
myPath = QDir::homePath ();
else
myPath = QDir::rootPath ();
+ break;
}
}
- HIG * hig = new HIG ();
- hig->addSectionTitle (tr ("Set Location"));
- hig->addRow (tr ("New &location:"), myDirButton = new QPushButton (folderPixmap, myPath));
- hig->addWideControl (myMoveRadio = new QRadioButton (tr ("&Move from the current folder"), this));
- hig->addWideControl (find_rb = new QRadioButton (tr ("Local data is &already there"), this));
- hig->finish ();
+ onFileSelected (myPath);
if (myMoveFlag)
- myMoveRadio->setChecked (true);
+ ui.moveDataRadio->setChecked (true);
else
- find_rb->setChecked (true);
-
- connect (myMoveRadio, SIGNAL (toggled (bool)), this, SLOT (onMoveToggled (bool)));
- connect (myDirButton, SIGNAL (clicked (bool)), this, SLOT (onDirButtonClicked ()));
-
- QLayout * layout = new QVBoxLayout (this);
- layout->addWidget (hig);
- QDialogButtonBox * buttons = new QDialogButtonBox (QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
- connect (buttons, SIGNAL (rejected ()), this, SLOT (deleteLater ()));
- connect (buttons, SIGNAL (accepted ()), this, SLOT (onSetLocation ()));
- layout->addWidget (buttons);
- QWidget::setAttribute (Qt::WA_DeleteOnClose, true);
+ ui.findDataRadio->setChecked (true);
+
+ connect (ui.moveDataRadio, SIGNAL (toggled (bool)), this, SLOT (onMoveToggled (bool)));
+ connect (ui.newLocationButton, SIGNAL (clicked ()), this, SLOT (onDirButtonClicked ()));
+ connect (ui.dialogButtons, SIGNAL (rejected ()), this, SLOT (close ()));
+ connect (ui.dialogButtons, SIGNAL (accepted ()), this, SLOT (onSetLocation ()));
+
+ setAttribute (Qt::WA_DeleteOnClose, true);
}
#include <QSet>
#include <QString>
-class QPushButton;
-class QRadioButton;
+#include "ui_relocate.h"
+
class Session;
-class Torrent;
class TorrentModel;
class RelocateDialog: public QDialog
{
Q_OBJECT
- private:
- QString myPath;
- static bool myMoveFlag;
-
- private:
- Session & mySession;
- TorrentModel& myModel;
- QSet<int> myIds;
- QPushButton * myDirButton;
- QRadioButton * myMoveRadio;
+ public:
+ RelocateDialog (Session&, const TorrentModel&, const QSet<int>& ids, QWidget * parent = 0);
+ ~RelocateDialog () {}
private slots:
void onFileSelected (const QString& path);
void onSetLocation ();
void onMoveToggled (bool);
- public:
- RelocateDialog (Session&, TorrentModel&, const QSet<int>& ids, QWidget * parent = 0);
- ~RelocateDialog () {}
+ private:
+ Session& mySession;
+ const QSet<int> myIds;
+ Ui::RelocateDialog ui;
+ QString myPath;
+
+ static bool myMoveFlag;
};
#endif
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>RelocateDialog</class>
+ <widget class="QDialog" name="RelocateDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>225</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;
+}</string>
+ </property>
+ <layout class="QGridLayout" name="dialogLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetFixedSize</enum>
+ </property>
+ <item row="0" column="0" colspan="2">
+ <widget class="QLabel" name="setLocationSectionLabel">
+ <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>
+ </property>
+ <property name="buddy">
+ <cstring>newLocationButton</cstring>
+ </property>
+ <property name="tr-style" stdset="0">
+ <string notr="true">form-label</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QPushButton" name="newLocationButton">
+ <property name="styleSheet">
+ <string notr="true">text-align:left</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </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">
+ <widget class="QDialogButtonBox" name="dialogButtons">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../about.cc" line="+27"/>
+ <location filename="../about.cc" line="+28"/>
<source><big><b>Transmission %1</b></big></source>
<translation type="unfinished"></translation>
</message>
<context>
<name>RelocateDialog</name>
<message>
- <location filename="../relocate.cc" line="+48"/>
+ <location filename="../relocate.cc" line="+47"/>
<source>Select Location</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+28"/>
+ <location filename="../relocate.ui" line="+14"/>
<source>Set Torrent Location</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+20"/>
+ <location line="+25"/>
<source>Set Location</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>New &location:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+23"/>
<source>&Move from the current folder</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>Local data is &already there</source>
<translation type="unfinished"></translation>
</message>
<translation>Acerca de Transmission</translation>
</message>
<message>
- <location filename="../about.cc" line="+27"/>
+ <location filename="../about.cc" line="+28"/>
<source><big><b>Transmission %1</b></big></source>
<translation><big><b>Transmission %1</b></big></translation>
</message>
<context>
<name>RelocateDialog</name>
<message>
- <location filename="../relocate.cc" line="+48"/>
+ <location filename="../relocate.cc" line="+47"/>
<source>Select Location</source>
<translation>Seleccione localización</translation>
</message>
<message>
- <location line="+28"/>
+ <location filename="../relocate.ui" line="+14"/>
<source>Set Torrent Location</source>
<translation>Defina localización del torrent</translation>
</message>
<message>
- <location line="+20"/>
+ <location line="+25"/>
<source>Set Location</source>
<translation>Definir localización</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>New &location:</source>
<translation>Nueva &localización:</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+23"/>
<source>&Move from the current folder</source>
<translation>&Mover del directorio actual</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>Local data is &already there</source>
<translation>Los datos locales &ya están ahí</translation>
</message>
<translation>Transmissioni buruz</translation>
</message>
<message>
- <location filename="../about.cc" line="+27"/>
+ <location filename="../about.cc" line="+28"/>
<source><big><b>Transmission %1</b></big></source>
<translation><big><b>Transmission %1</b></big></translation>
</message>
<context>
<name>RelocateDialog</name>
<message>
- <location filename="../relocate.cc" line="+48"/>
+ <location filename="../relocate.cc" line="+47"/>
<source>Select Location</source>
<translation>Hautatu Kokalekua</translation>
</message>
<message>
- <location line="+28"/>
+ <location filename="../relocate.ui" line="+14"/>
<source>Set Torrent Location</source>
<translation>Ezarri Torrentaren Kokalekua</translation>
</message>
<message>
- <location line="+20"/>
+ <location line="+25"/>
<source>Set Location</source>
<translation>Ezarri Kokalekua</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>New &location:</source>
<translation>&Kokaleku berria:</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+23"/>
<source>&Move from the current folder</source>
<translation>&Mugitu oraingo agiritegitik</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>Local data is &already there</source>
<translation>&Tokiko datuak jadanik hor daude</translation>
</message>
<translation>Transmission</translation>
</message>
<message>
- <location filename="../about.cc" line="+27"/>
+ <location filename="../about.cc" line="+28"/>
<source><big><b>Transmission %1</b></big></source>
<translation><big><b>Transmission %1</b></big></translation>
</message>
<context>
<name>RelocateDialog</name>
<message>
- <location filename="../relocate.cc" line="+48"/>
+ <location filename="../relocate.cc" line="+47"/>
<source>Select Location</source>
<translation>Séléctionner l'emplacement</translation>
</message>
<message>
- <location line="+28"/>
+ <location filename="../relocate.ui" line="+14"/>
<source>Set Torrent Location</source>
<translation>Définir l'emplacement du torrent</translation>
</message>
<message>
- <location line="+20"/>
+ <location line="+25"/>
<source>Set Location</source>
<translation>Définir l'emplacement</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>New &location:</source>
<translation>Nouvel emp&lacement:</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+23"/>
<source>&Move from the current folder</source>
<translation>&Déplacer depuis le dossier courant</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>Local data is &already there</source>
<translation>Les données locales sont &déjà là</translation>
</message>
<translation>A Transmission-ről</translation>
</message>
<message>
- <location filename="../about.cc" line="+27"/>
+ <location filename="../about.cc" line="+28"/>
<source><big><b>Transmission %1</b></big></source>
<translation><big><b>Transmission %1</b></big></translation>
</message>
<context>
<name>RelocateDialog</name>
<message>
- <location filename="../relocate.cc" line="+48"/>
+ <location filename="../relocate.cc" line="+47"/>
<source>Select Location</source>
<translation>Válaszd ki a mappát</translation>
</message>
<message>
- <location line="+28"/>
+ <location filename="../relocate.ui" line="+14"/>
<source>Set Torrent Location</source>
<translation>Válaszd ki a torrentet</translation>
</message>
<message>
- <location line="+20"/>
+ <location line="+25"/>
<source>Set Location</source>
<translation>Válaszd ki a mappát</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>New &location:</source>
<translation>Új &hely:</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+23"/>
<source>&Move from the current folder</source>
<translation>Áthelyezés a &jelenlegi mappából</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>Local data is &already there</source>
<translation>A letöltött adat &már itt van</translation>
</message>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../about.cc" line="+27"/>
+ <location filename="../about.cc" line="+28"/>
<source><big><b>Transmission %1</b></big></source>
<translation type="unfinished"></translation>
</message>
<context>
<name>RelocateDialog</name>
<message>
- <location filename="../relocate.cc" line="+48"/>
+ <location filename="../relocate.cc" line="+47"/>
<source>Select Location</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+28"/>
+ <location filename="../relocate.ui" line="+14"/>
<source>Set Torrent Location</source>
<translation>Торрент орналасуын көрсетіңіз</translation>
</message>
<message>
- <location line="+20"/>
+ <location line="+25"/>
<source>Set Location</source>
<translation>Орналасуын көрсету</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>New &location:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+23"/>
<source>&Move from the current folder</source>
<translation>&Ағымдағы бумадан жылжыту</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>Local data is &already there</source>
<translation>Жергілікті мәліметтер ол жерде &болып тұр</translation>
</message>
<context>
<name>AboutDialog</name>
<message>
- <location filename="../about.cc" line="+35"/>
+ <location filename="../about.cc" line="+36"/>
<source>&License</source>
<translation>&Licencija</translation>
</message>
<context>
<name>RelocateDialog</name>
<message>
- <location filename="../relocate.cc" line="+98"/>
+ <location filename="../relocate.ui" line="+72"/>
<source>&Move from the current folder</source>
<translation>&Perkelti iš dabartinio aplanko</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>Local data is &already there</source>
<translation>Vietiniai duomenys jau yra &ten</translation>
</message>
<message>
- <location line="-2"/>
+ <location line="-33"/>
<source>New &location:</source>
<translation>Nauja &vieta:</translation>
</message>
<message>
- <location line="-49"/>
+ <location filename="../relocate.cc" line="+47"/>
<source>Select Location</source>
<translation>Parinkite vietą</translation>
</message>
<message>
- <location line="+48"/>
+ <location filename="../relocate.ui" line="-10"/>
<source>Set Location</source>
<translation>Nustatyti vietą</translation>
</message>
<message>
- <location line="-20"/>
+ <location line="-25"/>
<source>Set Torrent Location</source>
<translation>Torento vietos nustatymas</translation>
</message>
<translation>Sobre o Transmission</translation>
</message>
<message>
- <location filename="../about.cc" line="+27"/>
+ <location filename="../about.cc" line="+28"/>
<source><big><b>Transmission %1</b></big></source>
<translation type="unfinished"></translation>
</message>
<context>
<name>RelocateDialog</name>
<message>
- <location filename="../relocate.cc" line="+48"/>
+ <location filename="../relocate.cc" line="+47"/>
<source>Select Location</source>
<translation>Selecionar local</translation>
</message>
<message>
- <location line="+28"/>
+ <location filename="../relocate.ui" line="+14"/>
<source>Set Torrent Location</source>
<translation>Definir Local do Torrent</translation>
</message>
<message>
- <location line="+20"/>
+ <location line="+25"/>
<source>Set Location</source>
<translation>Definir Local</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>New &location:</source>
<translation>Novo local:</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+23"/>
<source>&Move from the current folder</source>
<translation>Mover da pasta atual</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>Local data is &already there</source>
<translation>Os dados locais já estão lá</translation>
</message>
<translation>О программе "Transmission"</translation>
</message>
<message>
- <location filename="../about.cc" line="+27"/>
+ <location filename="../about.cc" line="+28"/>
<source><big><b>Transmission %1</b></big></source>
<translation type="unfinished"></translation>
</message>
<context>
<name>RelocateDialog</name>
<message>
- <location filename="../relocate.cc" line="+48"/>
+ <location filename="../relocate.cc" line="+47"/>
<source>Select Location</source>
<translation>Выберите местоположение</translation>
</message>
<message>
- <location line="+28"/>
+ <location filename="../relocate.ui" line="+14"/>
<source>Set Torrent Location</source>
<translation>Указать местоположение торрента</translation>
</message>
<message>
- <location line="+20"/>
+ <location line="+25"/>
<source>Set Location</source>
<translation>Указать местоположение</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>New &location:</source>
<translation>Новое &местоположение:</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+23"/>
<source>&Move from the current folder</source>
<translation>&Переместить из текущей папки</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>Local data is &already there</source>
<translation>&Локальные данные уже там</translation>
</message>
<translation>Про Transmission</translation>
</message>
<message>
- <location filename="../about.cc" line="+27"/>
+ <location filename="../about.cc" line="+28"/>
<source><big><b>Transmission %1</b></big></source>
<translation><big><b>Transmission %1</b></big></translation>
</message>
<context>
<name>RelocateDialog</name>
<message>
- <location filename="../relocate.cc" line="+48"/>
+ <location filename="../relocate.cc" line="+47"/>
<source>Select Location</source>
<translation>Обрати розташування</translation>
</message>
<message>
- <location line="+28"/>
+ <location filename="../relocate.ui" line="+14"/>
<source>Set Torrent Location</source>
<translation>Встановити розташування торенту</translation>
</message>
<message>
- <location line="+20"/>
+ <location line="+25"/>
<source>Set Location</source>
<translation>Встановити розташування</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>New &location:</source>
<translation>Но&ве розташування:</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+23"/>
<source>&Move from the current folder</source>
<translation>&Перенести зі старої теки у вказану</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+10"/>
<source>Local data is &already there</source>
<translation>&Локальні дані вже перенесено</translation>
</message>