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.cpp69
1 files changed, 13 insertions, 56 deletions
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;