diff options
Diffstat (limited to 'src/gui/mainWindow.cpp')
-rw-r--r-- | src/gui/mainWindow.cpp | 44 |
1 files changed, 11 insertions, 33 deletions
diff --git a/src/gui/mainWindow.cpp b/src/gui/mainWindow.cpp index beb80f4..260da89 100644 --- a/src/gui/mainWindow.cpp +++ b/src/gui/mainWindow.cpp @@ -168,6 +168,13 @@ MainWindow::MainWindow(QWidget *parent) : _serverSocket = new QTcpServer(); _serverSocket->listen(QHostAddress::Any, 29481); connect(_serverSocket, SIGNAL(newConnection()), this, SLOT(incomingFile())); + _profileDialog = new profileDialog(this); + +#ifdef MAINWINDOW_USE_TOUCHGUI + connect(ui->saveProfileButton, SIGNAL(clicked()), _profileDialog, SLOT(save())); +#else + connect(ui->actionSave_Profile, SIGNAL(triggered()), _profileDialog, SLOT(save())); +#endif } MainWindow::~MainWindow() @@ -242,27 +249,6 @@ QStringList MainWindow::getProfilList() // loads the profile list return profilList; } -#ifdef MAINWINDOW_USE_NORMALGUI -void MainWindow::addProfileInMenu(QString name) -{ - QAction* action = new QAction(name,this); - ui->menuLoad_profile->addAction(action); - connect(ui->menuLoad_profile, SIGNAL(triggered(QAction*)), this, SLOT(loadProfile(QAction*))); - _mapProfileToAction.insert(name, action); -} - -void MainWindow::removeProfileInMenu(QString name) -{ - if (_mapProfileToAction.contains(name)) - { - QAction* action = _mapProfileToAction.value(name); - ui->menuLoad_profile->removeAction(action); - _mapProfileToAction.take(name); - } - -} - -#endif void MainWindow::loadSettings() { QSettings settings("openslx", "pvsmgr"); @@ -319,10 +305,6 @@ void MainWindow::loadSettings() } MainWindow::getConnectionWindow()->showFrameFromSettings(); -#ifdef MAINWINDOW_USE_NORMALGUI - foreach (QString profile, getProfilList()) - addProfileInMenu(profile); -#endif } void MainWindow::loadProfile(QAction* actiontriggered) @@ -407,18 +389,12 @@ void MainWindow::saveSettings(QString profilname) profil.append(QString("%1").arg(i + 1)); settings.setValue(profil, current->pos()); } -#ifdef MAINWINDOW_USE_NORMALGUI - addProfileInMenu(profilname); -#endif } void MainWindow::removeProfil(QString profilname) { QSettings settings("openslx", "pvsmgr"); settings.remove(profilname); -#ifdef MAINWINDOW_USE_NORMALGUI - removeProfileInMenu(profilname); -#endif } void MainWindow::addConnection(PVSClient* newCon) @@ -431,6 +407,8 @@ void MainWindow::addConnection(PVSClient* newCon) sChatDialog.chat_nicklist_update(); } // sChatDialog->chat_nicklist_update(newCon->getUserName()); + + _profileDialog->load(); } void MainWindow::removeConnection(PVSClient* newCon) @@ -885,8 +863,8 @@ void MainWindow::foto() // makes a screenshot of the selected client void MainWindow::createProfile() { - profileDialog proDiag; - proDiag.exec(); + + _profileDialog->exec(); } void MainWindow::showusername() |