summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/clientConfigDialog.cpp16
-rw-r--r--src/gui/connectionFrame.cpp104
-rw-r--r--src/gui/connectionFrame.h16
-rw-r--r--src/gui/connectionWindow.cpp2
-rw-r--r--src/gui/frame.cpp40
-rw-r--r--src/gui/mainWindow.cpp69
-rw-r--r--src/gui/mainWindow.h3
-rw-r--r--src/gui/ui/clientConfigDialog.ui30
-rw-r--r--src/gui/ui/mainwindowtouch.ui6
9 files changed, 79 insertions, 207 deletions
diff --git a/src/gui/clientConfigDialog.cpp b/src/gui/clientConfigDialog.cpp
index b7ba407..0ddada0 100644
--- a/src/gui/clientConfigDialog.cpp
+++ b/src/gui/clientConfigDialog.cpp
@@ -96,16 +96,6 @@ void ClientConfigDialog::readSettings()
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()
@@ -125,12 +115,6 @@ void ClientConfigDialog::writeSettings()
else
_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"));
- _ifaceDBus->setConfigValue("multicast/interface", interfaceList->currentText());
-
_settings.sync();
emit configChanged();
}
diff --git a/src/gui/connectionFrame.cpp b/src/gui/connectionFrame.cpp
index b618668..32e20f7 100644
--- a/src/gui/connectionFrame.cpp
+++ b/src/gui/connectionFrame.cpp
@@ -28,58 +28,31 @@ extern "C"
ConnectionFrame::ConnectionFrame(QWidget *parent) :
QGroupBox(parent)
{
-
//defines the ui-stuff
-
- _gL = new QGridLayout(this);
- _gL->setSpacing(6);
- _gL->setMargin(1);
-
- _split = new QSplitter(this);
- _split->setOrientation(Qt::Vertical);
-
- _frame = new Frame("", _split);
- _frame->setConFrame(this);
- _split->addWidget(_frame);
-
- _conFrameTaskbar = new QWidget(_split);
- _conFrameTaskbar->setMaximumHeight(30);
-
- _gLayout = new QGridLayout(_conFrameTaskbar);
- _gLayout->setMargin(0);
- _gLayout->setSpacing(0);
-
- _hLayoutInCfTaskbar = new QHBoxLayout();
-
- _ip = new QLabel(_conFrameTaskbar);
- _ip->setAlignment(Qt::AlignCenter);
-
- _hLayoutInCfTaskbar->addWidget(_ip);
-
- _dozentContaimner = new QLabel(_conFrameTaskbar);
- _dozentContaimner->setAlignment(Qt::AlignRight);
- _dozentContaimner->setMaximumSize(QSize(20, 20));
- _dozentContaimner->setScaledContents(true);
-
- _hLayoutInCfTaskbar->addWidget(_dozentContaimner);
-
- _dozentContaimner->setDisabled(true);
-
- _status = new QLabel(_conFrameTaskbar);
- _status->setAlignment(Qt::AlignRight);
- _status->setMaximumSize(QSize(22, 21));
-
- _hLayoutInCfTaskbar->addWidget(_status);
-
- _gLayout->addLayout(_hLayoutInCfTaskbar, 0, 0, 1, 1);
- _split->addWidget(_conFrameTaskbar);
-
- _gL->addWidget(_split, 0, 0, 1, 1);
-
- this->setLayout(_gL);
+ _layoutTop = new QVBoxLayout(this);
+ _layoutTop->setMargin(0);
+ _frame = new Frame("", this);
+ _frame->setConFrame(this);
+ _frame->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
+ _layoutTop->addWidget(_frame);
+ _layoutBottom = new QHBoxLayout(this);
+ _layoutBottom->setMargin(0);
+ _conFrameTaskbar = new QWidget(this);
+ _conFrameTaskbar->setLayout(_layoutBottom);
+ _conFrameTaskbar->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
+ _ip = new QLabel(_conFrameTaskbar);
+ _layoutBottom->addStretch();
+ _layoutBottom->addWidget(_ip);
+ _layoutBottom->addStretch();
+ _dozentContaimner = new QLabel(_conFrameTaskbar);
+ _dozentContaimner->setDisabled(true);
+ _layoutBottom->addWidget(_dozentContaimner);
+ _status = new QLabel(_conFrameTaskbar);
+ _layoutBottom->addWidget(_status);
+ _layoutTop->addWidget(_conFrameTaskbar);
+ this->setLayout(_layoutTop);
setInitSize(190,168);
-
initFrame();
nat_height = 0;
@@ -176,7 +149,7 @@ void ConnectionFrame::setInitSize(int w, int h)
{
resize(w, h);
_frame->resize(w, h);
- _conFrameTaskbar->resize(w, h);
+ //_conFrameTaskbar->resize(w, h);
prev_height = h;
prev_width = w;
init_w = w;
@@ -470,32 +443,11 @@ void ConnectionFrame::mouseMoveEvent(QMouseEvent *event)
void ConnectionFrame::paintCloseUp(int w, int h)
{
-
-
- if (!_frame->image().isNull())
- {
- /*this->setFixedWidth(w);
- _conFrameTaskbar->setMaximumWidth(w);
- resize(w, h);*/
- resizeComponent(w, h);
- setMaximumSize(w,h);
- resize(w, h);
- }
- else
- {
- std::cout << "pixel is NULL" << std::endl;
- }
-
-}
-
-void ConnectionFrame::resizeComponent(int w, int h)
-{
- int th = (h*_conFrameTaskbar->width())/w;
- int uh = (h*_ip->width())/w;
- _conFrameTaskbar->setMaximumSize(w, th);
- _conFrameTaskbar->resize(w, th);
- _ip->setMaximumSize(w, uh);
- _ip->resize(w,uh);
+ if (!_frame->image().isNull())
+ {
+ //move(0,0);
+ resize(w, h);
+ }
}
void ConnectionFrame::setSource()
diff --git a/src/gui/connectionFrame.h b/src/gui/connectionFrame.h
index 235d0fc..fe6dc95 100644
--- a/src/gui/connectionFrame.h
+++ b/src/gui/connectionFrame.h
@@ -16,8 +16,8 @@ extern "C"
}
#define PROFILE
-#define STYLE_DEFAULT "QGroupBox{background-color: rgb(150, 150, 150); margin: 2px; border: 1px solid black; border-radius: 8px; padding: 2px; padding-top: 1.5em;}"
-#define STYLE_SELECTED "QGroupBox{background-color: rgb(150, 150, 150); margin: 2px; border: 1px solid red; border-radius: 8px; padding: 2px; padding-top: 1.5em;}"
+#define STYLE_DEFAULT "QGroupBox{background-color: #DCDCDC; margin: 2px; border: 1px solid black; border-radius: 8px; padding: 2px; padding-top: 1.5em;}"
+#define STYLE_SELECTED "QGroupBox{background-color: #DCDCDC; margin: 2px; border: 1px solid red; border-radius: 8px; padding: 2px; padding-top: 1.5em;}"
#include <src/util/timeUtil.h>
@@ -118,7 +118,6 @@ public:
void setFrameRate(int newRate);
bool isClientOnline;
void paintCloseUp(int w, int h);
- void resizeComponent(int w, int h);
void setSource();
void setTarget();
void setUnproject();
@@ -145,8 +144,8 @@ public Q_SLOTS:
protected:
//virtual void paintEvent(QPaintEvent *event);
void mouseReleaseEvent ( QMouseEvent * e );
- virtual void enterEvent ( QEvent * event );
- virtual void leaveEvent ( QEvent * event );
+ virtual void enterEvent ( QEvent * event );
+ virtual void leaveEvent ( QEvent * event );
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
//void mouseReleaseEvent ( QMouseEvent * event );
@@ -154,15 +153,12 @@ protected:
private:
Frame *_frame;
- //clickableLabel *frame;
- QSplitter *_split;
- QGridLayout* _gL;
+ QVBoxLayout *_layoutTop;
+ QHBoxLayout *_layoutBottom;
QLabel* _ip;
QLabel* _status;
QLabel* _dozentContaimner;
QWidget* _conFrameTaskbar;
- QGridLayout* _gLayout;
- QHBoxLayout* _hLayoutInCfTaskbar;
PVSClient* _myConnection;
QPixmap _clientPix;
diff --git a/src/gui/connectionWindow.cpp b/src/gui/connectionWindow.cpp
index df31562..ec6db1b 100644
--- a/src/gui/connectionWindow.cpp
+++ b/src/gui/connectionWindow.cpp
@@ -38,6 +38,8 @@ ConnectionWindow::ConnectionWindow(QWidget *parent) :
menu->addAction(newDummy);
setAcceptDrops(true); //drag&drop should be enabled
+
+ setStyleSheet("background-color: #DCDCDC;");
}
ConnectionWindow::~ConnectionWindow() {
diff --git a/src/gui/frame.cpp b/src/gui/frame.cpp
index aa6b0cb..6054065 100644
--- a/src/gui/frame.cpp
+++ b/src/gui/frame.cpp
@@ -36,13 +36,10 @@ Frame::Frame(const QString & text, QWidget * parent) :
Y = 0;
setBackgroundRole(QPalette::Base);
- setStyleSheet(QString::fromUtf8("QLabel{border-radius:10px;\n"
- "background-color: rgb(150,150,150);}"));
-
- setAlignment(Qt::AlignCenter);
+ setAlignment(Qt::AlignCenter);
setAutoFillBackground(true);
- setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
+ setFrameStyle(QFrame::StyledPanel | QFrame::Plain);
_isLocked = false;
_dozent = false;
@@ -51,12 +48,13 @@ Frame::Frame(const QString & text, QWidget * parent) :
//QIcon icon;
//icon.addFile(QString::fromUtf8(), QSize(), QIcon::Normal, QIcon::Off);
- button_closeUp = createToolButton(tr("View"), QIcon(":/restore"),SLOT(closeUp()));
- button_closeUp->setCheckable(true);
- button_foto = createToolButton(tr("Foto"), QIcon(":/photos"),SLOT(foto()));
- button_lock = createToolButton(tr("Lock this client"), QIcon(":/lock"),SLOT(setLock()));
+// button_closeUp = createToolButton(tr("View"), QIcon(":/restore"),SLOT(closeUp()));
+// button_closeUp->setCheckable(true);
+// button_foto = createToolButton(tr("Foto"), QIcon(":/photos"),SLOT(foto()));
+// button_lock = createToolButton(tr("Lock this client"), QIcon(":/lock"),SLOT(setLock()));
//button_unlock = createToolButton(tr("Unlock this client"), QIcon(":/lock"),SLOT(setLock()));
- button_dozent = createToolButton(tr("Set as Superclient"), QIcon(":/dozent2"),SLOT(setDozent()));
+// button_dozent = createToolButton(tr("Set as Superclient"), QIcon(":/dozent2"),SLOT(setDozent()));
+// button_dozent->setCheckable(true);
button_control = createToolButton(tr("Enable Remote Control"), QIcon(":/remotecontrol"), SLOT(remoteControlClicked()));
button_control->setCheckable(true);
button_control_all = createToolButton(tr("Remote Control All Clients"), QIcon(":/remotecontrolall"), SLOT(remoteControlAllClicked()));
@@ -292,27 +290,25 @@ QToolButton* Frame::createToolButton(const QString &toolTip, const QIcon &icon,
QToolButton *button = new QToolButton(this);
button->setToolTip(toolTip);
button->setIcon(icon);
- button->setIconSize(QSize(15, 15));
- button->setStyleSheet(QString::fromUtf8("background-color: rgb(230, 230, 230);"));
+ button->setIconSize(QSize(30, 30));
addButton(button);
toolButtonList.append(button);
connect(button, SIGNAL(clicked()), this, member);
-
return button;
}
void Frame::addButton(QToolButton *button)
{
button->move(X,Y);
- Y += button->size().height()-5;
+ Y += button->size().height() + 10;
}
void Frame::setToolButtonListVisible(bool visible)
{
foreach (QToolButton* tb, toolButtonList)
tb->setVisible(visible);
- if (visible && MainWindow::getConnectionWindow()->hasDozent && !_dozent)
- button_dozent->setVisible(false);//At this time this button should only be visible on the dozent machine (the superclient).
+// if (visible && MainWindow::getConnectionWindow()->hasDozent && !_dozent)
+// button_dozent->setVisible(false);//At this time this button should only be visible on the dozent machine (the superclient).
}
@@ -320,12 +316,12 @@ void Frame::setLockStatus(bool lock)
{
if (lock)
{
- button_lock->setToolTip(tr("Unlock this client"));
+ //button_lock->setToolTip(tr("Unlock this client"));
//button_lock->setIcon() TODO
}
else
{
- button_lock->setToolTip(tr("Lock this client"));
+ //button_lock->setToolTip(tr("Lock this client"));
//button_lock->setIcon() TODO
}
_isLocked = lock;
@@ -373,14 +369,14 @@ void Frame::setDozent()
{
if (_dozent)
{
- button_dozent->setToolTip(tr("Set client as Superclient"));
+ //button_dozent->setToolTip(tr("Set client as Superclient"));
_dozent = false;
MainWindow::getConnectionWindow()->hasDozent = false;
getConFrame()->setDozent(false);
}
else
{
- button_dozent->setToolTip(tr("Unset client as Superclient"));
+ //button_dozent->setToolTip(tr("Unset client as Superclient"));
_dozent = true;
MainWindow::getConnectionWindow()->hasDozent = true;
getConFrame()->setDozent(true);
@@ -390,7 +386,7 @@ void Frame::setDozent()
void Frame::setCloseUp(bool value)
{
_isCloseUp = value;
- button_closeUp->setChecked(value);
+ //button_closeUp->setChecked(value);
}
void Frame::remoteControlClicked()
@@ -503,6 +499,7 @@ void Frame::updateMousePosition(QMouseEvent* event)
void Frame::enterEvent(QEvent* event)
{
+ QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
_mouseOver = true;
if(_remoteControlEnabled)
{
@@ -512,6 +509,7 @@ void Frame::enterEvent(QEvent* event)
void Frame::leaveEvent(QEvent* event)
{
+ QApplication::setOverrideCursor(QCursor(Qt::OpenHandCursor));
_mouseOver = false;
if(_remoteControlEnabled)
{
diff --git a/src/gui/mainWindow.cpp b/src/gui/mainWindow.cpp
index 6bb84a4..4eae44e 100644
--- a/src/gui/mainWindow.cpp
+++ b/src/gui/mainWindow.cpp
@@ -47,8 +47,6 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) :
{
ui->setupUi(this);
- _info = new QLabel("");
-
if (!QFile::exists(_settings.fileName()))
{
QDir::root().mkpath(QFileInfo(_settings.fileName()).path());
@@ -131,6 +129,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) :
qualityActionGroup->addAction(ui->action_quality_Low);
// define the slots we want to use
+ connect(ui->action_Info, SIGNAL(triggered()), this, SLOT(info()));
connect(ui->action_Quit, SIGNAL(triggered()), this, SLOT(close()));
connect(ui->action_Manage_Profiles, SIGNAL(triggered()), this, SLOT(createProfile()));
connect(ui->action_Reset, SIGNAL(triggered()), this, SLOT(resetall()));
@@ -200,8 +199,6 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) :
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()));
@@ -361,7 +358,7 @@ void MainWindow::loadSettings()
title.append(" [" + _sessionName + " : ");
title.append(_pwdCon + "]");
setWindowTitle(title);
- _info->setText(title);
+ _info = title;
}
else
{
@@ -370,7 +367,7 @@ void MainWindow::loadSettings()
title.append(" [" + _sessionName + " : ");
title.append(_pwdCon + "]");
setWindowTitle(title);
- _info->setText(title);
+ _info = title;
settings.beginGroup(current);
QStringList keys = settings.childKeys();
for (int i = 0; i < keys.size(); i++)
@@ -446,7 +443,7 @@ void MainWindow::loadSettings(QString profilname) // loads the current profile
title.append(" [" + _sessionName + " : ");
title.append(_pwdCon + "]");
setWindowTitle(title);
- _info->setText(title);
+ _info = title;
}
}
@@ -648,47 +645,8 @@ void MainWindow::changeEvent(QEvent *e)
*/
void MainWindow::resizeEvent(QResizeEvent *event)
{
-
if (bgimage == true)
- {
repaintbackgroundpicture(); // repaint the backgroundpicture scaled to the window size
- }
-
- if (_firstResize == 3)
- {
- QSize oldSize = event->oldSize();
- _initW = ui->widget->width();
- _initH = ui->widget->height();
- _firstResize++;
- }
- std::list<QString>* selectedClients =
- MainWindow::getConnectionList()->getSelectedClients();
- if (is_closeup && selectedClients->size() == 1)
- {
- PVSClient* pvsClient =
- PVSConnectionManager::getManager()->getClientFromIp(
- selectedClients->front().toStdString().c_str());
- pvsClient->getConnectionFrame()->paintCloseUp(ui->widget->width(),
- ui->widget->height());
- }
- else if (!is_closeup && _firstResize > 3)
- {
- int ratio_w = (ui->widget->width() * 100) / _initW;
- int ratio_h = (ui->widget->height() * 100) / _initH;
-foreach (ConnectionFrame* cf, getConnectionWindow()->getFrameList())
- {
- /*int margin = ui->widget->style()->pixelMetric(QStyle::PM_DefaultTopLevelMargin);
- int x = ui->widget->width() - margin;
- int y = ui->widget->height() - margin;
- updatePos(cf, x, y);*/
- int w = (cf->init_w * ratio_w) / 100;
- int h = (cf->init_h * ratio_h) / 100;
- cf->paintCloseUp(w,h);
- }
-}
-
-if (_firstResize < 3)
-_firstResize++;
}
void MainWindow::updatePos(ConnectionFrame* cf, int x, int y)
@@ -803,16 +761,10 @@ void MainWindow::closeUp(ConnectionFrame* connFrame, PVSClient* pvsClient)
// Do we already have a closeUp Frame?
ConnectionFrame* closeupFrame = conWin->getCloseupFrame();
-
if(closeupFrame)
{
- // Is it the same as the sender one?
- if(connFrame == closeupFrame)
- // Then it already is close up.
- return;
- else
- // We need to un-closeUp the currently selected closeUp-Frame.
- unCloseUp(closeupFrame);
+ unCloseUp(closeupFrame);
+ return;
}
_framePosOnCloseUp = connFrame->pos();//get the actualy position before run closeup
@@ -1122,7 +1074,7 @@ void MainWindow::setPasswordForConnection(int enabled)
title.append(_profilName);
title.append(" [" + _sessionName + " : ]");
setWindowTitle(title);
- _info->setText(title);
+ _info = title;
}
else if (enabled == 2) //password is needed, we show it in the titlebar
{
@@ -1133,7 +1085,7 @@ void MainWindow::setPasswordForConnection(int enabled)
title.append(" [" + _sessionName + " : ");
title.append(_pwdCon + "]");
setWindowTitle(title);
- _info->setText(title);
+ _info = title;
}
}
//#endif
@@ -1318,6 +1270,11 @@ int MainWindow::getDisplayedClientNameEnum()
return displayedClientNameEnum;
}
+void MainWindow::info()
+{
+ QMessageBox::information(this, tr("Information"), _info);
+}
+
MainWindow* MainWindow::myself = NULL;
ConnectionList* MainWindow::conList = NULL;
ConnectionWindow* MainWindow::conWin = NULL;
diff --git a/src/gui/mainWindow.h b/src/gui/mainWindow.h
index bbe9c49..cf618f0 100644
--- a/src/gui/mainWindow.h
+++ b/src/gui/mainWindow.h
@@ -123,7 +123,7 @@ private:
QString _pwdCon;
QString _sessionName;
QString _profilName;
- QLabel *_info;
+ QString _info;
int displayedClientNameEnum; //to tell if username, loginname or ip is shown in clientList
@@ -182,6 +182,7 @@ public slots:
void unCloseUp(ConnectionFrame* connFrame);
void closeUp();
void foto();
+ void info();
void backgroundpicture();
void repaintbackgroundpicture();
void setdozenttoolbar();
diff --git a/src/gui/ui/clientConfigDialog.ui b/src/gui/ui/clientConfigDialog.ui
index bb4bdc9..aa73433 100644
--- a/src/gui/ui/clientConfigDialog.ui
+++ b/src/gui/ui/clientConfigDialog.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>445</width>
- <height>266</height>
+ <width>366</width>
+ <height>195</height>
</rect>
</property>
<property name="windowTitle">
@@ -27,7 +27,7 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
- <number>2</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="tabPermissions">
<attribute name="title">
@@ -130,30 +130,6 @@
</property>
</widget>
</item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_5">
- <item>
- <widget class="QCheckBox" name="checkBoxAllowChat">
- <property name="text">
- <string>Accept chat messages</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="checkBoxAllowFiletransfer">
- <property name="text">
- <string>Accept file transfers</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
</layout>
</widget>
<widget class="QWidget" name="tabDisplay">
diff --git a/src/gui/ui/mainwindowtouch.ui b/src/gui/ui/mainwindowtouch.ui
index 7241895..651217e 100644
--- a/src/gui/ui/mainwindowtouch.ui
+++ b/src/gui/ui/mainwindowtouch.ui
@@ -116,6 +116,7 @@
<string>&amp;File</string>
</property>
<addaction name="separator"/>
+ <addaction name="action_Info"/>
<addaction name="action_Save_Profile"/>
<addaction name="action_Manage_Profiles"/>
<addaction name="separator"/>
@@ -491,6 +492,11 @@
<string>Use Password</string>
</property>
</action>
+ <action name="action_Info">
+ <property name="text">
+ <string>&amp;Info</string>
+ </property>
+ </action>
</widget>
<resources>
<include location="../../../pvsmgr.qrc"/>