Split trackerlogin into .h and .cpp

This commit is contained in:
Ivan Sorokin
2014-11-05 03:05:21 +03:00
parent ed197a193d
commit da867fd022
4 changed files with 65 additions and 25 deletions

View File

@@ -32,9 +32,6 @@
#define TRACKERLOGIN_H
#include <QDialog>
#include <QMessageBox>
#include <libtorrent/session.hpp>
#include "ui_login.h"
#include "qtorrenthandle.h"
@@ -46,32 +43,15 @@ class trackerLogin : public QDialog, private Ui::authentication{
QTorrentHandle h;
public:
trackerLogin(QWidget *parent, QTorrentHandle h): QDialog(parent), h(h) {
setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
login_logo->setPixmap(QPixmap(QString::fromUtf8(":/Icons/oxygen/encrypted.png")));
tracker_url->setText(h.current_tracker());
connect(this, SIGNAL(trackerLoginCancelled(QPair<QTorrentHandle,QString>)), parent, SLOT(addUnauthenticatedTracker(QPair<QTorrentHandle,QString>)));
show();
}
~trackerLogin() {}
trackerLogin(QWidget *parent, QTorrentHandle h);
~trackerLogin();
signals:
void trackerLoginCancelled(QPair<QTorrentHandle,QString> tracker);
public slots:
void on_loginButton_clicked() {
// login
h.set_tracker_login(lineUsername->text(), linePasswd->text());
close();
}
void on_cancelButton_clicked() {
// Emit a signal to GUI to stop asking for authentication
emit trackerLoginCancelled(QPair<QTorrentHandle,QString>(h, h.current_tracker()));
close();
}
void on_loginButton_clicked();
void on_cancelButton_clicked();
};
#endif