From b44fd3fa5894869211533414103eff2a83917a22 Mon Sep 17 00:00:00 2001 From: Johann Latocha Date: Thu, 18 Nov 2010 23:51:14 +0100 Subject: [PVSMGRTOUCH] New GUI TODO: Zoom, Refresh, Quality, Info --- icons/dozent.png | Bin 1078 -> 1757 bytes icons/image.png | Bin 0 -> 1562 bytes icons/info.png | Bin 0 -> 1641 bytes icons/save.png | Bin 0 -> 1263 bytes pvsmgr.qrc | 3 + src/gui/mainWindow.cpp | 105 +++--- src/gui/ui/mainwindowtouch.ui | 835 ++++++++++++++++-------------------------- 7 files changed, 388 insertions(+), 555 deletions(-) create mode 100644 icons/image.png create mode 100644 icons/info.png create mode 100644 icons/save.png diff --git a/icons/dozent.png b/icons/dozent.png index 847d63e..13e6e2f 100644 Binary files a/icons/dozent.png and b/icons/dozent.png differ diff --git a/icons/image.png b/icons/image.png new file mode 100644 index 0000000..b0c9a3c Binary files /dev/null and b/icons/image.png differ diff --git a/icons/info.png b/icons/info.png new file mode 100644 index 0000000..209f1d2 Binary files /dev/null and b/icons/info.png differ diff --git a/icons/save.png b/icons/save.png new file mode 100644 index 0000000..7fa489c Binary files /dev/null and b/icons/save.png differ diff --git a/pvsmgr.qrc b/pvsmgr.qrc index b4de3bc..7e90df1 100644 --- a/pvsmgr.qrc +++ b/pvsmgr.qrc @@ -4,6 +4,9 @@ icons/gears.png icons/projection.png icons/reset.png + icons/info.png + icons/image.png + icons/save.png icons/finder.png icons/exit.png icons/terminal.png diff --git a/src/gui/mainWindow.cpp b/src/gui/mainWindow.cpp index 260da89..1e60ab9 100644 --- a/src/gui/mainWindow.cpp +++ b/src/gui/mainWindow.cpp @@ -52,17 +52,18 @@ MainWindow::MainWindow(QWidget *parent) : QDir::root().mkpath(QFileInfo(_settings.fileName()).path()); QFile::copy("/etc/openslx/pvsmgr.conf", _settings.fileName()); } + myself = this; +#ifdef MAINWINDOW_USE_NORMALGUI ui->horizontalSlider->setValue(100); ui->label_2->setText("100"); - ui->separator->setVisible(false); + conList = new ConnectionList(ui->ClWidget); + ui->ClientGLayout->addWidget(conList); +#endif - myself = this; conWin = new ConnectionWindow(ui->widget); ui->VconWinLayout->addWidget(conWin); - conList = new ConnectionList(ui->ClWidget); - ui->ClientGLayout->addWidget(conList); bgimage = false; @@ -73,10 +74,11 @@ MainWindow::MainWindow(QWidget *parent) : PVSConnectionManager::getManager(); //set the maximum width for list content +#ifdef MAINWINDOW_USE_NORMALGUI ui->ClWidget->setMaximumWidth(160); - ui->pvsLog->setReadOnly(true); ui->pvsLog->hide(); +#endif onToggleLog(false); // add ourself to the log listeners, so we can output them too @@ -97,32 +99,41 @@ MainWindow::MainWindow(QWidget *parent) : _pwdCon = PVSConnectionManager::getManager()->setNeedPassword(false); _sessionName = PVSConnectionManager::getManager()->getSessionName(); + _profileDialog = new profileDialog(this); + + // TODO: implement passwd!!! +#ifdef MAINWINDOW_USE_NORMALGUI ui->setPassword->setCheckState(Qt::Checked); +#endif #ifdef MAINWINDOW_USE_TOUCHGUI //only used for the touchgui // define the slots we want to use - connect(ui->comboBox_touch1, SIGNAL(currentIndexChanged(int)), this, SLOT(combobox1(int))); // Combobox 1 verkn��pfen mit IndexChangend Signal - connect(ui->comboBox_touch1, SIGNAL(currentIndexChanged(int)), this, SLOT(setindexback())); - - connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(createProfile())); // profile button - connect(ui->pushButton_2, SIGNAL(clicked()), this, SLOT(clientlisthide())); // clienlist button + connect(ui->action_Manage_Profiles, SIGNAL(triggered()), this, SLOT(createProfile())); + connect(ui->action_Reset, SIGNAL(triggered()), this, SLOT(resetall())); + connect(ui->action_Lock, SIGNAL(triggered()), this, SLOT(locksingle())); + connect(ui->action_Unlock, SIGNAL(triggered()), this, SLOT(unlocksingle())); + connect(ui->action_Project, SIGNAL(triggered()), this, SLOT(projecttoolbar())); + connect(ui->action_Unproject, SIGNAL(triggered()), this, SLOT(unprojecttoolbar())); + connect(ui->action_Set_as_Tutor_PC, SIGNAL(triggered()), this, SLOT(setdozenttoolbar())); + connect(ui->action_Maximize, SIGNAL(triggered()), this, SLOT(closeUp())); + connect(ui->action_Screenshot, SIGNAL(triggered()), this, SLOT(foto())); + connect(ui->action_Lock_All, SIGNAL(triggered()), this, SLOT(lockalltoolbar())); + connect(ui->action_Manage_Profiles, SIGNAL(triggered()), this, SLOT(createProfile())); + connect(ui->action_Config_Network, SIGNAL(triggered()), this, SLOT(configureNetwork())); + connect(ui->action_Show_Processes, SIGNAL(triggered()), this, SLOT(showProcesses())); + connect(ui->action_Start_Processes, SIGNAL(triggered()), this, SLOT(startProcess())); + connect(ui->action_About, SIGNAL(triggered()), _aboutDialog, SLOT(open())); + connect(ui->action_Save_Profile, SIGNAL(triggered()), _profileDialog, SLOT(save())); + connect(ui->action_Backgroundimage, SIGNAL(triggered()), this, SLOT(backgroundpicture())); + + // TODO: change to actions!!! +// connect(ui->horizontalSlider, SIGNAL(valueChanged (int)), this, SLOT(changeRatio(int))); +// connect(ui->vncQuality, SIGNAL(currentIndexChanged (int)), this, SLOT(setVNCQuality(int))); +// connect(ui->thumbStatus, SIGNAL(currentIndexChanged(int)), this, SLOT(changeStatus(int))); - // toolbar slots - connect(ui->actionresetall, SIGNAL(triggered()), this, SLOT(resetall())); - connect(ui->actionLocksingle, SIGNAL(triggered()), this, SLOT(locksingle())); - connect(ui->actionUnlocksingle, SIGNAL(triggered()), this, SLOT(unlocksingle())); - connect(ui->actionProjection, SIGNAL(triggered()), this, SLOT(projecttoolbar())); - connect(ui->actionUnprojection, SIGNAL(triggered()), this, SLOT(unprojecttoolbar())); - connect(ui->actionDozent, SIGNAL(triggered()), this, SLOT(setdozenttoolbar())); - // Ui specific settings - - ui->ClWidget->hide(); - ui->progressBar->hide(); - ui->pvsLog->hide(); - -#endif +#else // toolbar and actions in pvsmgr connect(ui->action_Exit, SIGNAL(triggered()), this, SLOT(close())); ui->action_Exit->setStatusTip(tr("Exit")); @@ -142,7 +153,6 @@ MainWindow::MainWindow(QWidget *parent) : ui->actionShowProcesses->setStatusTip(tr("Show Processes of the selected Client")); connect(ui->actionStartProcess, SIGNAL(triggered()), this, SLOT(startProcess())); ui->actionStartProcess->setStatusTip(tr("Starts Process on the selected Client(s)")); - connect(ui->actionShow_Username, SIGNAL(triggered()), this, SLOT(showusername())); connect(ui->actionShow_Hostname_IP, SIGNAL(triggered()), this, SLOT(showip())); connect(ui->actionShow_Fullname, SIGNAL(triggered()), this, SLOT(showname())); @@ -157,24 +167,22 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->actionShow_Normal, SIGNAL(toggled(bool)), this, SLOT(onToggleLog(bool))); connect(ui->actionShow_Error, SIGNAL(toggled(bool)), this, SLOT(onToggleLog(bool))); connect(ui->actionAbout_pvs, SIGNAL(triggered()), _aboutDialog, SLOT(open())); + connect(ui->actionSave_Profile, SIGNAL(triggered()), _profileDialog, SLOT(save())); +#endif loadSettings(); //we load the appliocation settings setUnifiedTitleAndToolBarOnMac(true); +#ifdef MAINWINDOW_USE_NORMALGUI statusBar()->showMessage(tr("The pvs manager")); +#endif this->showMaximized(); // show the Mainwindow maximized // listen on port 29481 for incoming file transfers _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() @@ -244,14 +252,14 @@ int MainWindow::getConnectionWindowHeight() // returns the height of the Coonect QStringList MainWindow::getProfilList() // loads the profile list { - QSettings settings("openslx", "pvsmgr"); + QSettings settings("openslx", "profiles"); profilList = settings.childGroups(); return profilList; } void MainWindow::loadSettings() { - QSettings settings("openslx", "pvsmgr"); + QSettings settings("openslx", "profiles"); QString current = settings.value("current", "default").toString(); currentProfi = current; _profilName = current; @@ -322,7 +330,7 @@ void MainWindow::loadSettings(QString profilname) // loads the current profile { _profilName = profilname; MainWindow::getConnectionWindow()->ClientLocationList.clear(); - QSettings settings("openslx", "pvsmgr"); + QSettings settings("openslx", "profiles"); settings.setValue("current", _profilName); ConnectionFrame* cFrame; foreach (cFrame, AllFrameOnWindow) @@ -374,7 +382,7 @@ void MainWindow::saveSettings(QString profilname) { QList AllFrameOnWindow = MainWindow::getConnectionWindow()->getAllFrameOnWindow(); - QSettings settings("openslx", "pvsmgr"); + QSettings settings("openslx", "profiles"); settings.setValue("current", profilname); settings.setValue("size", QString("%1").arg(AllFrameOnWindow.size())); @@ -393,7 +401,7 @@ void MainWindow::saveSettings(QString profilname) void MainWindow::removeProfil(QString profilname) { - QSettings settings("openslx", "pvsmgr"); + QSettings settings("openslx", "profiles"); settings.remove(profilname); } @@ -635,7 +643,9 @@ void MainWindow::on_log_line(LogEntry consoleEntry) if (level == ConsoleLogger::LOG_CHAT && !showChat) return; +#ifdef MAINWINDOW_USE_NORMALGUI ui->pvsLog->insertPlainText(consoleEntry.getLine()); +#endif } @@ -643,11 +653,13 @@ void MainWindow::onToggleLog(bool showtime) { if (showtime) ;//to kill the system warning due "unused variable" +#ifdef MAINWINDOW_USE_NORMALGUI showError = ui->actionShow_Error->isChecked(); showTerminal = ui->actionShow_Terminal->isChecked(); showNetwork = ui->actionShow_Network->isChecked(); showChat = ui->actionShow_Chat->isChecked(); showNormal = ui->actionShow_Normal->isChecked(); +#endif //showAtAll = ui->logAtAllAction->get_active(); @@ -656,10 +668,12 @@ void MainWindow::onToggleLog(bool showtime) void MainWindow::setLogConsoleDisabled(bool visible) { +#ifdef MAINWINDOW_USE_NORMALGUI if (!visible) ui->pvsLog->hide(); else ui->pvsLog->show(); +#endif } /*void MainWindow::close() @@ -905,7 +919,9 @@ void MainWindow::changeRatio(int ratio) // needed the change the size of the vnc { QString str; str.append(QString("%1").arg(ratio)); +#ifdef MAINWINDOW_USE_NORMALGUI ui->label_2->setText(str); +#endif std::list* selClients = getConnectionList()->getSelectedClients(); @@ -946,7 +962,9 @@ else int updatefreq = (ratio*500)/100; QString str; str.append(QString("%1").arg(updatefreq)); +#ifdef MAINWINDOW_USE_NORMALGUI ui->label_2->setText(str); +#endif std::list* selClients = getConnectionList()->getSelectedClients(); if (selClients->size() > 0) { @@ -984,6 +1002,7 @@ else */ void MainWindow::changeStatus(int index) { +#ifdef MAINWINDOW_USE_NORMALGUI QString status = ui->thumbStatus->currentText(); if (status == "Thumbnailratio") @@ -998,11 +1017,13 @@ void MainWindow::changeStatus(int index) PVSConnectionManager::getManager()->getClientFromIp( selClients->front().toStdString().c_str()); int ratio = pvsClient->getConnectionFrame()->getRatio(); + ui->label_2->setText(QString::number(ratio)); ui->horizontalSlider->setValue(ratio); } else { + ui->label_2->setText("100"); ui->horizontalSlider->setValue(100); } @@ -1021,9 +1042,7 @@ void MainWindow::changeStatus(int index) selClients->front().toStdString().c_str()); if (pvsClient->getVNCConnection()) { - int - updatefreq = - pvsClient->getConnectionFrame()->getFrame()->getVNCClientThread()->getUpdatefreq(); + int updatefreq = pvsClient->getConnectionFrame()->getFrame()->getVNCClientThread()->getUpdatefreq(); int showfreq = (updatefreq * 100) / 500; ui->label_2->setText(QString::number(updatefreq)); ui->horizontalSlider->setValue(showfreq); @@ -1035,6 +1054,7 @@ void MainWindow::changeStatus(int index) ui->horizontalSlider->setValue(100); } } +#endif } /* @@ -1096,13 +1116,12 @@ void MainWindow::setPasswordForConnection(int enabled) void MainWindow::setindexback() //sets the index of the combobox back { -#ifdef MAINWINDOW_USE_TOUCHGUI - ui->comboBox_touch1->setCurrentIndex(0); -#endif + // TODO: delete this } void MainWindow::clientlisthide() // hide or show the clientlist { +#ifdef MAINWINDOW_USE_NORMALGUI if (locked1 == false) { @@ -1115,7 +1134,7 @@ void MainWindow::clientlisthide() // hide or show the clientlist ui->ClWidget->hide(); locked1 = false; } - +#endif } void MainWindow::lockalltoolbar() // locks all if a dozent is set diff --git a/src/gui/ui/mainwindowtouch.ui b/src/gui/ui/mainwindowtouch.ui index 1f329d6..26a2742 100644 --- a/src/gui/ui/mainwindowtouch.ui +++ b/src/gui/ui/mainwindowtouch.ui @@ -6,677 +6,488 @@ 0 0 - 1349 - 768 + 842 + 600 - PVSmgr + MainWindow - + + + background-color: rgb(150, 150, 150); + + + 0 + - - - border-color: rgb(0, 0, 0); - - - true - - - - - 0 - 0 - 1431 - 655 - - - - - - - - - - 15 - - - - - All - - - - - Lock - - - - - Unlock - - - - - Unproject - - - - - Backgroundimage - - - - - - - - Qt::Vertical - - - - - - - VNC-Quality - - - - - - - - 15 - - - - - HIGH - - - - - MEDIUM - - - - - LOW - - - - - - - - Qt::Vertical - - - - - - - - 15 - - - - ClientList - - - - - - - Qt::Vertical - - - - - - - - 15 - - - - Save Profile - - - - - - - - 15 - - - - Manage Profiles - - - - - - - Qt::Vertical - - - - - - - border-color: rgb(0, 0, 0); - - - 0 - - - Qt::Horizontal - - - - - - - Qt::Vertical - - - - - - - - 15 - - - - setPassword - - - - - - - Qt::Vertical - - - - - - - - 15 - - - - - Thumbnailratio - - - - - Thumbnailrate - - - - - - - - 25 - - - 200 - - - 25 - - - 25 - - - 25 - - - Qt::Horizontal - - - QSlider::TicksBothSides - - - 0 - - - - - - - 0 - - - - - - - % - - - - - - - - - Qt::Vertical - - - - Qt::Horizontal - - - - - 150 - 240 - - - - background-color: rgb(255, 255, 255); - - - - - - - - - - background-color: rgb(150, 150, 150); - - - - - - - - - - - - - - + - + + + + 0 + 0 + 842 + 21 + + + + + &File + + + + + + + + + + + &Tools + + + + + + + + + + + + + + + + &Config + + + + + + + &Help + + + + + + &View + + + + &Refresh + + + + + + + + + + + + + + + &Quality + + + + + + + + &Zoom + + + + + + + + + + + + + + + + + + + + + + - - true - - - - 129000 - 12900 - - - - - 15 - true - - toolBar - - Qt::LeftToRight - - - true - - - false - - 50 - 50 + 32 + 32 - - Qt::ToolButtonIconOnly - - - false - TopToolBarArea false - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - false - + - Show Username + &About - - - false + + + + :/icons/info.png:/icons/info.png - Show Hostname/IP + &Info - - - true + + + + :/icons/save.png:/icons/save.png - VNC-Placeholders + &Save Profile - - - true - - - false - + - Show Log + &Manage Profiles - - - true - + - Show Normal + &Quit - - - true + + + + :/icons/image.png:/icons/image.png - Show Error + &Backgroundimage - - - true + + + + :/photos:/photos - Show Network + &Screenshot - - - true + + + + :/icons/projection.png:/icons/projection.png - Show Terminal + &Project - - - true - - - Show Chat + + + + :/icons/unprojection.png:/icons/unprojection.png - - - About pvs + &Unproject - - - true + + + + :/icons/locksingle.png:/icons/locksingle.png - 100 x 100 + &Lock - - - true + + + + :/icons/unlocksingle.png:/icons/unlocksingle.png - 200 x 200 + U&nlock - - - true + + + + :/lock:/lock - 500 x 500 + Lock &All - + - :/logout:/logout + :/icons/reset.png:/icons/reset.png - &Disconnect - - - Ctrl+W + &Reset All - + - :/exit - :/exit:/exit + :/icons/gears.png:/icons/gears.png - &Exit - - - Ctrl+Q + Show &Processes - + - :/photos:/photos + :/icons/gearsgo.png:/icons/gearsgo.png - Foto - - - Foto + Start Pr&ocess - + - :/restore:/restore + :/dozent2:/dozent2 - view + Set as &Tutor PC - - View + + + + Config &Network - - - - :/lock:/lock + + + true - lock - - - Lock All Clients + 25% - - - - :/profile:/profile + + + true - Create profile + 50% - - - - :/icons/reset.png - + + + true - resetall + 75% + + + + + true - - Reset Projections and Locks + + true - - Ctrl+R + + 100% - - - - :/icons/locksingle.png:/icons/locksingle.png + + + true - locksingle + 125% - - Locks a Single Target + + + + true + + + 150% - - - - :/icons/unlocksingle.png:/icons/unlocksingle.png + + + true - unlocksingle + 175% - - Unlocks a single target + + + + true + + + 200% - + - :/icons/projection.png:/icons/projection.png + :/restore:/restore - projection + &Maximize + + + + + true - - Projects a single target + + 100ms - - - - :/icons/unprojection.png:/icons/unprojection.png + + + true - unprojection + 200ms + + + + + true - - Unprojects a single target + + 300ms - - - - :/dozent2:/dozent2 + + + true - dozent + 400ms - - Select Tutor PC + + + + true + + + true + + + 500ms - + + + true + - Show Name + 600ms - - - - :/chat:/chat + + + true - Chat + 700ms - - Start chat with client(s) + + + + true - - Ctrl+D + + 800ms - - - - :/netconf:/netconf + + + true - Configure Network... + 900ms - - - - :/icons/gears.png:/icons/gears.png + + + true - showProcesses + 1000ms + + + + + true + + + true - - Show processes of all clients + + High - - - - :/icons/gearsgo.png:/icons/gearsgo.png + + + true + + + false - Start Process + Medium + + + + + true - - Start process on the selected client(s) + + Low - -- cgit v1.2.3-55-g7522