summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorFabian Schillinger2010-07-10 02:14:20 +0200
committerFabian Schillinger2010-07-10 02:14:20 +0200
commit99021fc683c36f57fdad8dc812e2267fca4cbcf7 (patch)
tree5fd77585e4e5dbd171427186e4c31ad09ca18e68 /src/gui
parentInserted some Buttons in GUI and TouchGUI and modified handling of commands i... (diff)
parentConfiguration by pvs via D-Bus. Old .allow ist now deprecated, config file: .... (diff)
downloadpvs-99021fc683c36f57fdad8dc812e2267fca4cbcf7.tar.gz
pvs-99021fc683c36f57fdad8dc812e2267fca4cbcf7.tar.xz
pvs-99021fc683c36f57fdad8dc812e2267fca4cbcf7.zip
Merge branch 'master' of openslx.org:pvs
Conflicts: i18n/pvs_ar_JO.ts i18n/pvs_de_DE.ts i18n/pvs_es_MX.ts i18n/pvs_fr_FR.ts i18n/pvs_pl_PL.ts
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/clientConfigDialog.cpp84
-rw-r--r--src/gui/clientConfigDialog.h2
-rw-r--r--src/gui/ui/clientToolbar.ui31
3 files changed, 56 insertions, 61 deletions
diff --git a/src/gui/clientConfigDialog.cpp b/src/gui/clientConfigDialog.cpp
index 76b4f5e..3e1ee50 100644
--- a/src/gui/clientConfigDialog.cpp
+++ b/src/gui/clientConfigDialog.cpp
@@ -26,6 +26,12 @@ ClientConfigDialog::ClientConfigDialog(QWidget *parent) :
connect(radioButtonOtherRO, SIGNAL(clicked()), this,
SLOT(checkPermissions()));
+ // connect to D-Bus and get interface
+ QDBusConnection dbus = QDBusConnection::sessionBus();
+ dbus.registerObject("/config", this);
+ dbus.registerService("org.openslx.pvsgui");
+ _ifaceDBus = new OrgOpenslxPvsInterface("org.openslx.pvs", "/", dbus, this);
+
}
ClientConfigDialog::~ClientConfigDialog()
@@ -49,50 +55,66 @@ void ClientConfigDialog::readSettings()
else
comboBox->setCurrentIndex(_settings.value("Display/location").toInt());
- if (_settings.value("Permissions/vnc_lecturer").toString() == "rw")
- radioButtonLecturerRW->setChecked(true);
- else if (_settings.value("Permissions/vnc_lecturer").toString() == "ro")
- radioButtonLecturerRO->setChecked(true);
- else
- radioButtonLecturerNO->setChecked(true);
- if (_settings.value("Permissions/vnc_other").toString() == "rw")
- radioButtonOtherRW->setChecked(true);
- else if (_settings.value("Permissions/vnc_other").toString() == "ro")
- radioButtonOtherRO->setChecked(true);
- else
- radioButtonOtherNO->setChecked(true);
- checkBoxAllowChat->setChecked(
- _settings.value("Permissions/allow_chat").toBool());
- checkBoxAllowFiletransfer->setChecked(_settings.value(
- "Permissions/allow_filetransfer").toBool());
-
- qDebug("[%s] Setting read from: '%s'", metaObject()->className(),
- qPrintable(_settings.fileName()));
+ QDBusPendingReply<QString> reply = _ifaceDBus->getConfigValue("Permissions/vnc_lecturer");
+ reply.waitForFinished();
+ if (reply.isValid())
+ {
+ if (reply.value() == "rw")
+ radioButtonLecturerRW->setChecked(true);
+ else if (reply.value() == "ro")
+ radioButtonLecturerRO->setChecked(true);
+ else
+ radioButtonLecturerNO->setChecked(true);
+ }
+
+ reply = _ifaceDBus->getConfigValue("Permissions/vnc_other");
+ reply.waitForFinished();
+ if (reply.isValid())
+ {
+ if (reply.value() == "rw")
+ radioButtonOtherRW->setChecked(true);
+ else if (reply.value() == "ro")
+ radioButtonOtherRO->setChecked(true);
+ else
+ radioButtonOtherNO->setChecked(true);
+ }
+
+ reply = _ifaceDBus->getConfigValue("Permissions/allow_chat");
+ reply.waitForFinished();
+ if (reply.isValid())
+ checkBoxAllowChat->setChecked(reply.value() == "T");
+
+ reply = _ifaceDBus->getConfigValue("Permissions/allow_filetransfer");
+ reply.waitForFinished();
+ if (reply.isValid())
+ checkBoxAllowFiletransfer->setChecked(reply.value() == "T");
+
}
void ClientConfigDialog::writeSettings()
{
_settings.setValue("Display/location", comboBox->currentIndex());
+
if (radioButtonLecturerRW->isChecked())
- _settings.setValue("Permissions/vnc_lecturer", "rw");
+ _ifaceDBus->setConfigValue("Permissions/vnc_lecturer", "rw");
else if (radioButtonLecturerRO->isChecked())
- _settings.setValue("Permissions/vnc_lecturer", "ro");
+ _ifaceDBus->setConfigValue("Permissions/vnc_lecturer", "ro");
else
- _settings.setValue("Permissions/vnc_lecturer", "no");
+ _ifaceDBus->setConfigValue("Permissions/vnc_lecturer", "no");
if (radioButtonOtherRW->isChecked())
- _settings.setValue("Permissions/vnc_other", "rw");
+ _ifaceDBus->setConfigValue("Permissions/vnc_other", "rw");
else if (radioButtonOtherRO->isChecked())
- _settings.setValue("Permissions/vnc_other", "ro");
+ _ifaceDBus->setConfigValue("Permissions/vnc_other", "ro");
else
- _settings.setValue("Permissions/vnc_other", "no");
- _settings.setValue("Permissions/allow_chat", checkBoxAllowChat->isChecked());
- _settings.setValue("Permissions/allow_filetransfer",
- checkBoxAllowFiletransfer->isChecked());
+ _ifaceDBus->setConfigValue("Permissions/vnc_other", "no");
+
+ _ifaceDBus->setConfigValue("Permissions/allow_chat",
+ QString(checkBoxAllowChat->isChecked() ? "T" : "F"));
+ _ifaceDBus->setConfigValue("Permissions/allow_filetransfer",
+ QString(checkBoxAllowFiletransfer->isChecked() ? "T" : "F"));
+
_settings.sync();
emit configChanged();
-
- qDebug("[%s] Settings written to: '%s'.", metaObject()->className(),
- qPrintable(_settings.fileName()));
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gui/clientConfigDialog.h b/src/gui/clientConfigDialog.h
index 706bd8a..98da54f 100644
--- a/src/gui/clientConfigDialog.h
+++ b/src/gui/clientConfigDialog.h
@@ -15,6 +15,7 @@
#define CLIENTCONFIGDIALOG_H_
#include <QtGui>
+#include "pvsinterface.h"
#include "ui_clientConfigDialog.h"
class ClientConfigDialog: public QDialog, private Ui::ClientConfigDialogClass
@@ -37,6 +38,7 @@ private Q_SLOTS:
void checkPermissions();
private:
+ OrgOpenslxPvsInterface *_ifaceDBus;
QSettings _settings;
};
diff --git a/src/gui/ui/clientToolbar.ui b/src/gui/ui/clientToolbar.ui
index 5a59c5f..51cb62e 100644
--- a/src/gui/ui/clientToolbar.ui
+++ b/src/gui/ui/clientToolbar.ui
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>577</width>
+ <width>463</width>
<height>28</height>
</rect>
</property>
@@ -144,35 +144,6 @@ p, li { white-space: pre-wrap; }
</spacer>
</item>
<item>
- <widget class="QCheckBox" name="vncCheckBox">
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Enable/Disable VNC only for this session</string>
- </property>
- <property name="text">
- <string>Allow VNC</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;