Browse Source

Fix peeradditiondlg position

adaptive-webui-19844
Chocobo1 9 years ago
parent
commit
bd2f69a9d6
  1. 2
      src/gui/properties/peerlistwidget.cpp
  2. 4
      src/gui/properties/peersadditiondlg.cpp
  3. 4
      src/gui/properties/peersadditiondlg.h
  4. 5
      src/gui/properties/peersadditiondlg.ui

2
src/gui/properties/peerlistwidget.cpp

@ -245,7 +245,7 @@ void PeerListWidget::showPeerListMenu(const QPoint &) @@ -245,7 +245,7 @@ void PeerListWidget::showPeerListMenu(const QPoint &)
QAction *act = menu.exec(QCursor::pos());
if (act == 0) return;
if (act == addPeerAct) {
QList<BitTorrent::PeerAddress> peersList = PeersAdditionDlg::askForPeers();
QList<BitTorrent::PeerAddress> peersList = PeersAdditionDlg::askForPeers(this);
int peerCount = 0;
foreach (const BitTorrent::PeerAddress &addr, peersList) {
if (torrent->connectPeer(addr)) {

4
src/gui/properties/peersadditiondlg.cpp

@ -51,9 +51,9 @@ PeersAdditionDlg::~PeersAdditionDlg() @@ -51,9 +51,9 @@ PeersAdditionDlg::~PeersAdditionDlg()
delete m_ui;
}
QList<BitTorrent::PeerAddress> PeersAdditionDlg::askForPeers()
QList<BitTorrent::PeerAddress> PeersAdditionDlg::askForPeers(QWidget *parent)
{
PeersAdditionDlg dlg;
PeersAdditionDlg dlg(parent);
dlg.exec();
return dlg.m_peersList;
}

4
src/gui/properties/peersadditiondlg.h

@ -47,10 +47,10 @@ class PeersAdditionDlg: public QDialog @@ -47,10 +47,10 @@ class PeersAdditionDlg: public QDialog
Q_OBJECT
public:
PeersAdditionDlg(QWidget *parent = 0);
PeersAdditionDlg(QWidget *parent);
~PeersAdditionDlg();
static QList<BitTorrent::PeerAddress> askForPeers();
static QList<BitTorrent::PeerAddress> askForPeers(QWidget *parent);
protected slots:
void validateInput();

5
src/gui/properties/peersadditiondlg.ui

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>List of peers to add (one per line):</string>
<string>List of peers to add (one IP per line):</string>
</property>
</widget>
</item>
@ -40,9 +40,6 @@ @@ -40,9 +40,6 @@
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>

Loading…
Cancel
Save