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.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/gui/mainWindow.cpp b/src/gui/mainWindow.cpp
index 7c8a686..476a40f 100644
--- a/src/gui/mainWindow.cpp
+++ b/src/gui/mainWindow.cpp
@@ -47,6 +47,8 @@ MainWindow::MainWindow(QWidget *parent) :
{
ui->setupUi(this);
+ _info = new QLabel("");
+
if (!QFile::exists(_settings.fileName()))
{
QDir::root().mkpath(QFileInfo(_settings.fileName()).path());
@@ -101,11 +103,6 @@ MainWindow::MainWindow(QWidget *parent) :
_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
// group actions (zoom, refresh and quality) so we get radio-buttons
QActionGroup *zoomActionGroup = new QActionGroup(this);
@@ -152,6 +149,7 @@ MainWindow::MainWindow(QWidget *parent) :
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()));
+ connect(ui->action_Use_Password, SIGNAL(toggled(bool)), this, SLOT(setPasswordForConnection(bool)));
// using QSignalMapper to get advanced signals&slots (Zoom, Refresh and Quality)
QSignalMapper *zoomSignalMapper = new QSignalMapper(this);
@@ -203,6 +201,8 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->action_quality_Low, SIGNAL(triggered()), qualitySignalMapper, SLOT (map()));
connect(qualitySignalMapper, SIGNAL(mapped(int)), this, SLOT(setVNCQuality(int)));
+ ui->toolBar->addWidget(_info);
+
#else
// toolbar and actions in pvsmgr
connect(ui->action_Exit, SIGNAL(triggered()), this, SLOT(close()));
@@ -362,6 +362,7 @@ void MainWindow::loadSettings()
title.append(" [" + _sessionName + " : ");
title.append(_pwdCon + "]");
setWindowTitle(title);
+ _info->setText(title);
}
else
{
@@ -370,6 +371,7 @@ void MainWindow::loadSettings()
title.append(" [" + _sessionName + " : ");
title.append(_pwdCon + "]");
setWindowTitle(title);
+ _info->setText(title);
settings.beginGroup(current);
QStringList keys = settings.childKeys();
for (int i = 0; i < keys.size(); i++)
@@ -445,6 +447,7 @@ void MainWindow::loadSettings(QString profilname) // loads the current profile
title.append(" [" + _sessionName + " : ");
title.append(_pwdCon + "]");
setWindowTitle(title);
+ _info->setText(title);
}
}
@@ -1187,6 +1190,14 @@ foreach (ConnectionFrame* frame, FrameList)
}
+void MainWindow::setPasswordForConnection(bool enabled)
+{
+ if (enabled)
+ setPasswordForConnection(2);
+ else
+ setPasswordForConnection(0);
+}
+
void MainWindow::setPasswordForConnection(int enabled)
{
if (enabled == 0)//the checkbox isn't checked, so no passowrd needed, we remove it in the titlebar
@@ -1198,6 +1209,7 @@ void MainWindow::setPasswordForConnection(int enabled)
title.append(_profilName);
title.append(" [" + _sessionName + " : ]");
setWindowTitle(title);
+ _info->setText(title);
}
else if (enabled == 2) //password is needed, we show it in the titlebar
{
@@ -1208,6 +1220,7 @@ void MainWindow::setPasswordForConnection(int enabled)
title.append(" [" + _sessionName + " : ");
title.append(_pwdCon + "]");
setWindowTitle(title);
+ _info->setText(title);
}
}
//#endif