summaryrefslogtreecommitdiffstats
path: root/src/gui/mainWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/mainWindow.cpp')
-rw-r--r--src/gui/mainWindow.cpp105
1 files changed, 62 insertions, 43 deletions
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<ConnectionFrame*> 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<QString>* 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<QString>* 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