diff --git a/LoginWindow.cpp b/LoginWindow.cpp index 7638238..e7e6f3b 100644 --- a/LoginWindow.cpp +++ b/LoginWindow.cpp @@ -3,10 +3,12 @@ #include -LoginWindow::LoginWindow(bool adminMode, QWidget *parent) : +LoginWindow::LoginWindow(bool adminMode, const char* const serverAddress, const short serverPort, QWidget *parent) : QMainWindow(parent), socket(new QTcpSocket()), adminMode(adminMode), //value of adminMode as a parameter (that was sent from main() function) is set to adminMode attribute of LoginWindow (that's required because it will be forwarded next to instance of MainWindow class) + serverAddress(serverAddress), + serverPort(serverPort), ui(new Ui::LoginWindow) { this->ui->setupUi(this); diff --git a/LoginWindow.h b/LoginWindow.h index 6320434..b929bfd 100644 --- a/LoginWindow.h +++ b/LoginWindow.h @@ -18,7 +18,7 @@ class LoginWindow : public QMainWindow Q_OBJECT public: - explicit LoginWindow(bool adminMode, QWidget *parent = 0); + explicit LoginWindow(bool adminMode, const char* const serverAddress, const short serverPort, QWidget *parent = 0); ~LoginWindow(); private slots: @@ -30,8 +30,8 @@ private slots: Ui::LoginWindow *ui; QTcpSocket* socket; bool adminMode; - const char* const serverAddress = "165.227.174.7"; - const ushort serverPort = 1337; + const char* const serverAddress; + const ushort serverPort; }; #endif // LOGINWINDOW_H diff --git a/logo.ico b/logo.ico deleted file mode 100644 index be2f593..0000000 Binary files a/logo.ico and /dev/null differ diff --git a/main.cpp b/main.cpp index ba154e8..f7481fd 100644 --- a/main.cpp +++ b/main.cpp @@ -5,6 +5,7 @@ #include "LoginWindow.h" #include #include +#include #include #define LOCKFILE "lock.dat" @@ -55,6 +56,36 @@ int main(int argc, char *argv[]) { QApplication::addLibraryPath("."); bool adminMode = isRunningAsAdministrator(); + const char* serverAddress = "165.227.174.7"; + short serverPort = 1337; + if (argc % 2 == 1) { + for (int i=1; i