summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohann Latocha2010-11-22 20:52:05 +0100
committerJohann Latocha2010-11-22 20:52:05 +0100
commit859e1018ffa16769cf4f7dc93181564dbda14bd8 (patch)
tree9cb1a25a100bb5a2cfac01558b7e2e74c111fcc2
parent[PVSMGRTOUCH] Zoom, refresh and quality work again (diff)
downloadpvs-859e1018ffa16769cf4f7dc93181564dbda14bd8.tar.gz
pvs-859e1018ffa16769cf4f7dc93181564dbda14bd8.tar.xz
pvs-859e1018ffa16769cf4f7dc93181564dbda14bd8.zip
[PVSMGRTOUCH] SetPassword works again
-rw-r--r--icons/passwd.pngbin0 -> 1686 bytes
-rw-r--r--pvsmgr.qrc1
-rw-r--r--src/gui/mainWindow.cpp23
-rw-r--r--src/gui/mainWindow.h2
-rw-r--r--src/gui/ui/mainwindowtouch.ui46
5 files changed, 46 insertions, 26 deletions
diff --git a/icons/passwd.png b/icons/passwd.png
new file mode 100644
index 0000000..e334fb6
--- /dev/null
+++ b/icons/passwd.png
Binary files differ
diff --git a/pvsmgr.qrc b/pvsmgr.qrc
index 7e90df1..591553d 100644
--- a/pvsmgr.qrc
+++ b/pvsmgr.qrc
@@ -7,6 +7,7 @@
<file>icons/info.png</file>
<file>icons/image.png</file>
<file>icons/save.png</file>
+ <file>icons/passwd.png</file>
<file alias="finder">icons/finder.png</file>
<file alias="exit">icons/exit.png</file>
<file alias="terminal">icons/terminal.png</file>
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
diff --git a/src/gui/mainWindow.h b/src/gui/mainWindow.h
index 2776bf8..a8f892d 100644
--- a/src/gui/mainWindow.h
+++ b/src/gui/mainWindow.h
@@ -123,6 +123,7 @@ private:
QString _pwdCon;
QString _sessionName;
QString _profilName;
+ QLabel *_info;
int displayedClientNameEnum; //to tell if username, loginname or ip is shown in clientList
@@ -205,6 +206,7 @@ private slots:
void changeStatus (int index);
void setVNCQuality(int quality);
void setPasswordForConnection(int enabled);
+ void setPasswordForConnection(bool enabled);
void combobox1(int menuindex1); // Funktion um index der combobox auszulesen und weiterzuverarbeiten s. Ticker 671
//void combobox2(int menuindex2); // Funktion um index der combobox auszulesen und weiterzuverarbeiten
void configureNetwork();
diff --git a/src/gui/ui/mainwindowtouch.ui b/src/gui/ui/mainwindowtouch.ui
index 26a2742..7241895 100644
--- a/src/gui/ui/mainwindowtouch.ui
+++ b/src/gui/ui/mainwindowtouch.ui
@@ -35,17 +35,6 @@
<height>21</height>
</rect>
</property>
- <widget class="QMenu" name="menu_File">
- <property name="title">
- <string>&amp;File</string>
- </property>
- <addaction name="action_Info"/>
- <addaction name="separator"/>
- <addaction name="action_Save_Profile"/>
- <addaction name="action_Manage_Profiles"/>
- <addaction name="separator"/>
- <addaction name="action_Quit"/>
- </widget>
<widget class="QMenu" name="menu_Tools">
<property name="title">
<string>&amp;Tools</string>
@@ -66,6 +55,7 @@
<property name="title">
<string>&amp;Config</string>
</property>
+ <addaction name="action_Use_Password"/>
<addaction name="action_Set_as_Tutor_PC"/>
<addaction name="action_Config_Network"/>
</widget>
@@ -121,6 +111,16 @@
<addaction name="menu_Quality"/>
<addaction name="action_Backgroundimage"/>
</widget>
+ <widget class="QMenu" name="menu_File">
+ <property name="title">
+ <string>&amp;File</string>
+ </property>
+ <addaction name="separator"/>
+ <addaction name="action_Save_Profile"/>
+ <addaction name="action_Manage_Profiles"/>
+ <addaction name="separator"/>
+ <addaction name="action_Quit"/>
+ </widget>
<addaction name="menu_File"/>
<addaction name="menu_View"/>
<addaction name="menu_Tools"/>
@@ -143,7 +143,7 @@
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
- <addaction name="action_Info"/>
+ <addaction name="action_Use_Password"/>
<addaction name="action_Save_Profile"/>
<addaction name="separator"/>
<addaction name="action_Maximize"/>
@@ -160,21 +160,13 @@
<addaction name="action_Start_Processes"/>
<addaction name="separator"/>
<addaction name="action_Set_as_Tutor_PC"/>
+ <addaction name="separator"/>
</widget>
<action name="action_About">
<property name="text">
<string>&amp;About</string>
</property>
</action>
- <action name="action_Info">
- <property name="icon">
- <iconset resource="../../../pvsmgr.qrc">
- <normaloff>:/icons/info.png</normaloff>:/icons/info.png</iconset>
- </property>
- <property name="text">
- <string>&amp;Info</string>
- </property>
- </action>
<action name="action_Save_Profile">
<property name="icon">
<iconset resource="../../../pvsmgr.qrc">
@@ -487,6 +479,18 @@
<string>Low</string>
</property>
</action>
+ <action name="action_Use_Password">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="icon">
+ <iconset resource="../../../pvsmgr.qrc">
+ <normaloff>:/icons/passwd.png</normaloff>:/icons/passwd.png</iconset>
+ </property>
+ <property name="text">
+ <string>Use Password</string>
+ </property>
+ </action>
</widget>
<resources>
<include location="../../../pvsmgr.qrc"/>