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 &)
QAction *act = menu.exec(QCursor::pos()); QAction *act = menu.exec(QCursor::pos());
if (act == 0) return; if (act == 0) return;
if (act == addPeerAct) { if (act == addPeerAct) {
QList<BitTorrent::PeerAddress> peersList = PeersAdditionDlg::askForPeers(); QList<BitTorrent::PeerAddress> peersList = PeersAdditionDlg::askForPeers(this);
int peerCount = 0; int peerCount = 0;
foreach (const BitTorrent::PeerAddress &addr, peersList) { foreach (const BitTorrent::PeerAddress &addr, peersList) {
if (torrent->connectPeer(addr)) { if (torrent->connectPeer(addr)) {

4
src/gui/properties/peersadditiondlg.cpp

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

4
src/gui/properties/peersadditiondlg.h

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

5
src/gui/properties/peersadditiondlg.ui

@ -17,7 +17,7 @@
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <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> </property>
</widget> </widget>
</item> </item>
@ -40,9 +40,6 @@
</item> </item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>

Loading…
Cancel
Save