Browse Source

Cleanup downloadfromurldlg, statsdialog

adaptive-webui-19844
Chocobo1 9 years ago
parent
commit
73047e3c84
  1. 6
      src/gui/downloadfromurldlg.h
  2. 42
      src/gui/downloadfromurldlg.ui
  3. 1
      src/gui/mainwindow.h
  4. 3
      src/gui/statsdialog.cpp
  5. 2
      src/gui/statsdialog.h
  6. 31
      src/gui/statsdialog.ui

6
src/gui/downloadfromurldlg.h

@ -47,7 +47,7 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL{
setupUi(this); setupUi(this);
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
setModal(true); setModal(true);
show();
// Paste clipboard if there is an URL in it // Paste clipboard if there is an URL in it
QString clip_txt = qApp->clipboard()->text(); QString clip_txt = qApp->clipboard()->text();
QStringList clip_txt_list = clip_txt.split(QString::fromUtf8("\n")); QStringList clip_txt_list = clip_txt.split(QString::fromUtf8("\n"));
@ -71,6 +71,8 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL{
} }
if (clip_txt_list_cleaned.size() > 0) if (clip_txt_list_cleaned.size() > 0)
textUrls->setText(clip_txt_list_cleaned.join("\n")); textUrls->setText(clip_txt_list_cleaned.join("\n"));
show();
} }
~downloadFromURL() {} ~downloadFromURL() {}
@ -93,7 +95,7 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL{
} }
} }
if (!url_list_cleaned.size()) { if (!url_list_cleaned.size()) {
QMessageBox::warning(0, tr("No URL entered"), tr("Please type at least one URL.")); QMessageBox::warning(this, tr("No URL entered"), tr("Please type at least one URL."));
return; return;
} }
emit urlsReadyToBeDownloaded(url_list_cleaned); emit urlsReadyToBeDownloaded(url_list_cleaned);

42
src/gui/downloadfromurldlg.ui

@ -11,51 +11,41 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Download from urls</string> <string>Download from URLs</string>
</property> </property>
<layout class="QVBoxLayout"> <layout class="QVBoxLayout">
<item> <item>
<layout class="QHBoxLayout"> <widget class="QLabel" name="downloadURL_lbl">
<item> <property name="font">
<widget class="QLabel" name="downloadURL_lbl"> <font>
<property name="font"> <weight>75</weight>
<font> <bold>true</bold>
<weight>75</weight> </font>
<bold>true</bold> </property>
</font> <property name="text">
</property> <string>Add torrent links</string>
<property name="text"> </property>
<string>Add torrent links</string> </widget>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QTextEdit" name="textUrls"> <widget class="QTextEdit" name="textUrls">
<property name="acceptRichText">
<bool>false</bool>
</property>
<property name="tabChangesFocus"> <property name="tabChangesFocus">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="acceptRichText">
<bool>false</bool>
</property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_infos"> <widget class="QLabel" name="label_infos">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>17</height>
</size>
</property>
<property name="font"> <property name="font">
<font> <font>
<italic>true</italic> <italic>true</italic>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>One per line (HTTP links, Magnet links and info-hashes are supported)</string> <string>One link per line (HTTP links, Magnet links and info-hashes are supported)</string>
</property> </property>
</widget> </widget>
</item> </item>

1
src/gui/mainwindow.h

@ -52,7 +52,6 @@ class TransferListFiltersWidget;
class PropertiesWidget; class PropertiesWidget;
class StatusBar; class StatusBar;
class TorrentCreatorDlg; class TorrentCreatorDlg;
class downloadFromURL;
class LineEdit; class LineEdit;
class ExecutionLog; class ExecutionLog;
class PowerManagement; class PowerManagement;

3
src/gui/statsdialog.cpp

@ -44,12 +44,13 @@ StatsDialog::StatsDialog(QWidget *parent)
{ {
ui->setupUi(this); ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
connect(ui->buttonOK, SIGNAL(clicked()), SLOT(close())); connect(ui->buttonBox, SIGNAL(accepted()), SLOT(close()));
updateUI(); updateUI();
t = new QTimer(this); t = new QTimer(this);
t->setInterval(1500); t->setInterval(1500);
connect(t, SIGNAL(timeout()), SLOT(updateUI())); connect(t, SIGNAL(timeout()), SLOT(updateUI()));
t->start(); t->start();
show(); show();
} }

2
src/gui/statsdialog.h

@ -42,7 +42,7 @@ class StatsDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
explicit StatsDialog(QWidget *parent = 0); explicit StatsDialog(QWidget *parent);
~StatsDialog(); ~StatsDialog();
private slots: private slots:

31
src/gui/statsdialog.ui

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>273</width> <width>286</width>
<height>395</height> <height>401</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -223,28 +223,11 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <widget class="QDialogButtonBox" name="buttonBox">
<item> <property name="standardButtons">
<spacer name="horizontalSpacer"> <set>QDialogButtonBox::Ok</set>
<property name="orientation"> </property>
<enum>Qt::Horizontal</enum> </widget>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="buttonOK">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>

Loading…
Cancel
Save