The branch, master has been updated via 2e0e6e8669e8285046ae3f3c32578a5406fa11e2 (commit) from 94ab8224f72c17665780a906647669403cf82cd5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2e0e6e8669e8285046ae3f3c32578a5406fa11e2 Author: Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> Date: Thu Oct 25 12:03:19 2012 +0200 add MessageBox class and modified X2GO_PROPERTY macros ----------------------------------------------------------------------- Summary of changes: configuratordisplay.cpp | 38 +- configuratorkeyboard.cpp | 12 +- configuratorprinting.cpp | 4 +- configuratorprofile.cpp | 8 +- configuratorserver.cpp | 62 ++-- configuratorsharing.cpp | 22 +- configuratorsound.cpp | 16 +- configuratorspeed.cpp | 14 +- configuratortype.cpp | 66 ++-- icons/32x32/{preferences.png => critical.png} | Bin 2545 -> 2545 bytes icons/32x32/{preferences.png => information.png} | Bin 2545 -> 2545 bytes icons/32x32/{edit.png => input.png} | Bin 1232 -> 1232 bytes icons/32x32/{preferences.png => warning.png} | Bin 2545 -> 2545 bytes mainwindow.cpp | 19 +- mainwindow.h | 15 +- messagebox.cpp | 142 ++++++++ profiledetailconfiguratorform.h => messagebox.h | 55 ++- messagebox.ui | 385 ++++++++++++++++++++ profile.cpp | 28 +- profile.h | 100 ++--- profiledetailconfigurator.cpp | 2 +- profiledetailconfiguratorform.cpp | 34 +- profileform.cpp | 10 +- profilesettingsform.cpp | 32 +- profilesettingsform.h | 2 +- resources.qrc | 6 + ...rofile2settingsconnector.svg => messagebox.svg} | 67 ++-- ...2settingsconnector.svg => messageboxbutton.svg} | 47 +-- workarea.cpp | 10 +- workarea.h | 2 +- x2goapplication.cpp | 18 +- x2goapplication.h | 23 +- x2goclient2.pro | 3 + 33 files changed, 909 insertions(+), 333 deletions(-) copy icons/32x32/{preferences.png => critical.png} (100%) copy icons/32x32/{preferences.png => information.png} (100%) copy icons/32x32/{edit.png => input.png} (100%) copy icons/32x32/{preferences.png => warning.png} (100%) create mode 100644 messagebox.cpp copy profiledetailconfiguratorform.h => messagebox.h (60%) create mode 100644 messagebox.ui copy svg/{profile2settingsconnector.svg => messagebox.svg} (51%) copy svg/{profile2settingsconnector.svg => messageboxbutton.svg} (61%) The diff of changes is: diff --git a/configuratordisplay.cpp b/configuratordisplay.cpp index 1e0a6d7..e2aab73 100644 --- a/configuratordisplay.cpp +++ b/configuratordisplay.cpp @@ -29,7 +29,7 @@ ConfiguratorDisplay::ConfiguratorDisplay(Profile* profile, QWidget* parent, Qt:: setupUi(this); init(); multiDisplay=(QApplication::desktop()->screenCount()>1); - bool directRDP=(profile->getDesktop()=="RDP" && profile->getDirectRDP()); + bool directRDP=(profile->get_desktop()=="RDP" && profile->get_directRDP()); rbDisplay->setHidden(directRDP || !multiDisplay); lDisplay->setHidden(directRDP|| !multiDisplay); sbDisplay->setHidden(directRDP|| !multiDisplay); @@ -50,15 +50,15 @@ ConfiguratorDisplay::~ConfiguratorDisplay() void ConfiguratorDisplay::apply() { - profile->setDisplayWidth(sbWidth->value()); - profile->setDisplayHeight(sbHeight->value()); - profile->setDisplayNumber(sbDisplay->value()); - profile->setDpi(sbDPI->value()); - profile->setFullscreen(rbFullscreen->isChecked()); - profile->setMultiDisplay(rbDisplay->isChecked()); - profile->setMaxDimension(rbMaximum->isChecked()); - profile->setChangeDPI(cbDPI->isChecked()); - profile->setXinerama(cbXinerama->isChecked()); + profile->set_displayWidth(sbWidth->value()); + profile->set_displayHeight(sbHeight->value()); + profile->set_displayNumber(sbDisplay->value()); + profile->set_dpi(sbDPI->value()); + profile->set_fullscreen(rbFullscreen->isChecked()); + profile->set_multiDisplay(rbDisplay->isChecked()); + profile->set_maxDimension(rbMaximum->isChecked()); + profile->set_changeDPI(cbDPI->isChecked()); + profile->set_xinerama(cbXinerama->isChecked()); ProfileDetailConfigurator::apply(); } @@ -77,15 +77,15 @@ void ConfiguratorDisplay::defaults() void ConfiguratorDisplay::init() { rbCustom->setChecked(true); - rbFullscreen->setChecked(profile->getFullscreen()); - rbDisplay->setChecked(multiDisplay & profile->getMultiDisplay()); - rbMaximum->setChecked(profile->getMaxDimension()); - sbWidth->setValue(profile->getDisplayWidth()); - sbHeight->setValue(profile->getDisplayHeight()); - sbDisplay->setValue(profile->getDisplayNumber()); - cbDPI->setChecked(profile->getChangeDPI()); - sbDPI->setValue(profile->getDpi()); - cbXinerama->setChecked(profile->getXinerama()); + rbFullscreen->setChecked(profile->get_fullscreen()); + rbDisplay->setChecked(multiDisplay & profile->get_multiDisplay()); + rbMaximum->setChecked(profile->get_maxDimension()); + sbWidth->setValue(profile->get_displayWidth()); + sbHeight->setValue(profile->get_displayHeight()); + sbDisplay->setValue(profile->get_displayNumber()); + cbDPI->setChecked(profile->get_changeDPI()); + sbDPI->setValue(profile->get_dpi()); + cbXinerama->setChecked(profile->get_xinerama()); } void ConfiguratorDisplay::slotIdentifyDisplays() diff --git a/configuratorkeyboard.cpp b/configuratorkeyboard.cpp index 5736b1d..56b49aa 100644 --- a/configuratorkeyboard.cpp +++ b/configuratorkeyboard.cpp @@ -36,16 +36,16 @@ ConfiguratorKeyboard::~ConfiguratorKeyboard() void ConfiguratorKeyboard::init() { - cbKeyboard->setChecked(!profile->getChangeKeyboard()); - leLayout->setText(profile->getKeyboardLayout()); - leModel->setText(profile->getKeyboardModel()); + cbKeyboard->setChecked(!profile->get_changeKeyboard()); + leLayout->setText(profile->get_keyboardLayout()); + leModel->setText(profile->get_keyboardModel()); } void ConfiguratorKeyboard::apply() { - profile->setChangeKeyboard(!cbKeyboard->isChecked()); - profile->setKeyboardModel(leModel->text()); - profile->setKeyboardLayout(leLayout->text()); + profile->set_changeKeyboard(!cbKeyboard->isChecked()); + profile->set_keyboardModel(leModel->text()); + profile->set_keyboardLayout(leLayout->text()); ProfileDetailConfigurator::apply(); } diff --git a/configuratorprinting.cpp b/configuratorprinting.cpp index 10fb009..b6e153c 100644 --- a/configuratorprinting.cpp +++ b/configuratorprinting.cpp @@ -34,7 +34,7 @@ ConfiguratorPrinting::~ConfiguratorPrinting() void ConfiguratorPrinting::apply() { - profile->setPrinting(checkBox->isChecked()); + profile->set_printing(checkBox->isChecked()); ProfileDetailConfigurator::apply(); } @@ -46,5 +46,5 @@ void ConfiguratorPrinting::defaults() void ConfiguratorPrinting::init() { - checkBox->setChecked(profile->getPrinting()); + checkBox->setChecked(profile->get_printing()); } diff --git a/configuratorprofile.cpp b/configuratorprofile.cpp index 74262e4..ff9bd3c 100644 --- a/configuratorprofile.cpp +++ b/configuratorprofile.cpp @@ -39,14 +39,14 @@ ConfiguratorProfile::~ConfiguratorProfile() void ConfiguratorProfile::init() { - leName->setText(profile->getProfileName()); - pbIcon->setIcon(profile->getPicture()); + leName->setText(profile->get_profileName()); + pbIcon->setIcon(profile->get_picture()); } void ConfiguratorProfile::apply() { - profile->setPicture(pbIcon->icon().pixmap(80,80)); - profile->setProfileName(leName->text()); + profile->set_picture(pbIcon->icon().pixmap(80,80)); + profile->set_profileName(leName->text()); ProfileDetailConfigurator::apply(); } diff --git a/configuratorserver.cpp b/configuratorserver.cpp index ce38bc5..54606ca 100644 --- a/configuratorserver.cpp +++ b/configuratorserver.cpp @@ -36,24 +36,24 @@ ConfiguratorServer::~ConfiguratorServer() void ConfiguratorServer::apply() { - profile->setSSHPort(sbPort->value()); - profile->setServer(leHost->text()); - profile->setUser(leLogin->text()); - profile->setKey(leKey->text()); - profile->setAutologin(cbAutoLogin->isChecked()); + profile->set_SSHPort(sbPort->value()); + profile->set_server(leHost->text()); + profile->set_user(leLogin->text()); + profile->set_key(leKey->text()); + profile->set_autoLogin(cbAutoLogin->isChecked()); - profile->setProxy(cbProxy->isChecked()); + profile->set_proxy(cbProxy->isChecked()); if(rbProxySSH->isChecked()) - profile->setProxyType(Profile::SSH); + profile->set_proxyType(Profile::SSH); else - profile->setProxyType(Profile::HTTP); - profile->setProxyHost(leProxyHost->text()); - profile->setProxyPort(sbProxyPort->value()); - profile->setProxySameLogin(cbSameLogin->isChecked()); - profile->setProxyLogin(leProxyLogin->text()); - profile->setProxySamePass(cbSamePass->isChecked()); - profile->setProxyKey(leProxyKey->text()); - profile->setProxyAutologin(cbProxyAutoLogin->isChecked()); + profile->set_proxyType(Profile::HTTP); + profile->set_proxyHost(leProxyHost->text()); + profile->set_proxyPort(sbProxyPort->value()); + profile->set_proxySameLogin(cbSameLogin->isChecked()); + profile->set_proxyLogin(leProxyLogin->text()); + profile->set_proxySamePass(cbSamePass->isChecked()); + profile->set_proxyKey(leProxyKey->text()); + profile->set_proxyAutoLogin(cbProxyAutoLogin->isChecked()); ProfileDetailConfigurator::apply(); } @@ -75,26 +75,26 @@ void ConfiguratorServer::defaults() void ConfiguratorServer::init() { - if(profile->getDirectRDP() && profile->getDesktop()=="RDP") + if(profile->get_directRDP() && profile->get_desktop()=="RDP") { gbSSH->hide(); } - sbPort->setValue(profile->getSSHPort()); + sbPort->setValue(profile->get_SSHPort()); lPort->setText(tr("SSH port:")); - leHost->setText(profile->getServer()); - leLogin->setText(profile->getUser()); - leKey->setText(profile->getKey()); - cbAutoLogin->setChecked(profile->getAutologin()); - cbProxy->setChecked(profile->getProxy()); - rbProxySSH->setChecked(profile->getProxyType()!=Profile::HTTP); - rbProxyHTTP->setChecked(profile->getProxyType()==Profile::HTTP); - leProxyHost->setText(profile->getProxyHost()); - sbProxyPort->setValue(profile->getProxyPort()); - cbSameLogin->setChecked(profile->getProxySameLogin()); - leProxyLogin->setText(profile->getProxyLogin()); - cbSamePass->setChecked(profile->getProxySamePass()); - leProxyKey->setText(profile->getProxyKey()); - cbProxyAutoLogin->setChecked(profile->getProxyAutologin()); + leHost->setText(profile->get_server()); + leLogin->setText(profile->get_user()); + leKey->setText(profile->get_key()); + cbAutoLogin->setChecked(profile->get_autoLogin()); + cbProxy->setChecked(profile->get_proxy()); + rbProxySSH->setChecked(profile->get_proxyType()!=Profile::HTTP); + rbProxyHTTP->setChecked(profile->get_proxyType()==Profile::HTTP); + leProxyHost->setText(profile->get_proxyHost()); + sbProxyPort->setValue(profile->get_proxyPort()); + cbSameLogin->setChecked(profile->get_proxySameLogin()); + leProxyLogin->setText(profile->get_proxyLogin()); + cbSamePass->setChecked(profile->get_proxySamePass()); + leProxyKey->setText(profile->get_proxyKey()); + cbProxyAutoLogin->setChecked(profile->get_proxyAutoLogin()); } void ConfiguratorServer::slotGetKey() diff --git a/configuratorsharing.cpp b/configuratorsharing.cpp index b2cff8a..bd95b93 100644 --- a/configuratorsharing.cpp +++ b/configuratorsharing.cpp @@ -49,10 +49,10 @@ ConfiguratorSharing::~ConfiguratorSharing() void ConfiguratorSharing::apply() { - profile->setEncodeFS(cbEncoding->isChecked()); - profile->setExportFSTunnel(cbTunnel->isChecked()); - profile->setLocalFSEncoding(cbLocal->currentText()); - profile->setRemoteFSEncoding(cbRemote->currentText()); + profile->set_encodeFS(cbEncoding->isChecked()); + profile->set_exportFSTunnel(cbTunnel->isChecked()); + profile->set_localFSEncoding(cbLocal->currentText()); + profile->set_remoteFSEncoding(cbRemote->currentText()); QString exportDirs; QStandardItemModel* model=(QStandardItemModel*)treeView->model(); for ( int i=0; i<model->rowCount(); ++i ) @@ -68,17 +68,17 @@ void ConfiguratorSharing::apply() else exportDirs+="0;"; } - profile->setExportFolders(exportDirs); + profile->set_exportFolders(exportDirs); ProfileDetailConfigurator::apply(); } void ConfiguratorSharing::init() { - cbEncoding->setChecked(profile->getEncodeFS()); - cbTunnel->setChecked(profile->getExportFSTunnel()); - cbLocal->setCurrentIndex(cbLocal->findText(profile->getLocalFSEncoding())); - cbRemote->setCurrentIndex(cbRemote->findText(profile->getRemoteFSEncoding())); - QStringList lst=profile->getExportFolders().split ( ";",QString::SkipEmptyParts ); + cbEncoding->setChecked(profile->get_encodeFS()); + cbTunnel->setChecked(profile->get_exportFSTunnel()); + cbLocal->setCurrentIndex(cbLocal->findText(profile->get_localFSEncoding())); + cbRemote->setCurrentIndex(cbRemote->findText(profile->get_remoteFSEncoding())); + QStringList lst=profile->get_exportFolders().split ( ";",QString::SkipEmptyParts ); QStandardItemModel* model=(QStandardItemModel*)treeView->model(); model->removeRows(0, model->rowCount()); for ( int i=0; i<lst.size(); ++i ) @@ -104,7 +104,7 @@ void ConfiguratorSharing::defaults() { cbEncoding->setChecked(false); cbTunnel->setChecked(true); - cbLocal->setCurrentIndex(cbLocal->findText(profile->getLocalFSEncoding())); + cbLocal->setCurrentIndex(cbLocal->findText(profile->get_localFSEncoding())); cbRemote->setCurrentIndex(cbRemote->findText("UTF-8")); #ifdef Q_OS_WIN cbLocal->setCurrentIndex(cbLocal->findText("WINDOWS-1252")); diff --git a/configuratorsound.cpp b/configuratorsound.cpp index 01893c7..ac8d7b2 100644 --- a/configuratorsound.cpp +++ b/configuratorsound.cpp @@ -34,10 +34,10 @@ ConfiguratorSound::~ConfiguratorSound() void ConfiguratorSound::apply() { - profile->setSound(gbSound->isChecked()); - profile->setSoundTunnel(cbTunnel->isChecked()); - profile->setUseDefaultSoundPort(cbPort->isChecked()); - profile->setSoundPort(sbPort->value()); + profile->set_sound(gbSound->isChecked()); + profile->set_soundTunnel(cbTunnel->isChecked()); + profile->set_useDefaultSoundPort(cbPort->isChecked()); + profile->set_soundPort(sbPort->value()); ProfileDetailConfigurator::apply(); } @@ -52,8 +52,8 @@ void ConfiguratorSound::defaults() void ConfiguratorSound::init() { - gbSound->setChecked(profile->getSound()); - cbTunnel->setChecked(profile->getSoundTunnel()); - cbPort->setChecked(profile->getUseDefaultSoundPort()); - sbPort->setValue(profile->getSoundPort()); + gbSound->setChecked(profile->get_sound()); + cbTunnel->setChecked(profile->get_soundTunnel()); + cbPort->setChecked(profile->get_useDefaultSoundPort()); + sbPort->setValue(profile->get_soundPort()); } diff --git a/configuratorspeed.cpp b/configuratorspeed.cpp index 4838a48..4bd3460 100644 --- a/configuratorspeed.cpp +++ b/configuratorspeed.cpp @@ -51,9 +51,9 @@ ConfiguratorSpeed::~ConfiguratorSpeed() void ConfiguratorSpeed::apply() { - profile->setSpeed((Profile::SpeedType)hsSpeed->value()); - profile->setQuality(sbQuality->value()); - profile->setMethod(cbMethod->currentText()); + profile->set_speed((Profile::SpeedType)hsSpeed->value()); + profile->set_quality(sbQuality->value()); + profile->set_method(cbMethod->currentText()); ProfileDetailConfigurator::apply(); } @@ -67,10 +67,10 @@ void ConfiguratorSpeed::defaults() void ConfiguratorSpeed::init() { - hsSpeed->setValue(profile->getSpeed()); - sbQuality->setValue(profile->getQuality()); - cbMethod->setCurrentIndex(cbMethod->findText(profile->getMethod())); - slotMethodChanged(profile->getMethod()); + hsSpeed->setValue(profile->get_speed()); + sbQuality->setValue(profile->get_quality()); + cbMethod->setCurrentIndex(cbMethod->findText(profile->get_method())); + slotMethodChanged(profile->get_method()); } void ConfiguratorSpeed::slotMethodChanged(QString method) diff --git a/configuratortype.cpp b/configuratortype.cpp index 2d0ea3a..d9831e3 100644 --- a/configuratortype.cpp +++ b/configuratortype.cpp @@ -51,37 +51,37 @@ ConfiguratorType::~ConfiguratorType() void ConfiguratorType::init() { - QString readableName=X2GoApplication::instance()->getReadableDesktopName(profile->getDesktop()); + QString readableName=X2GoApplication::instance()->getReadableDesktopName(profile->get_desktop()); if(readableName!=QString::null) cbDesktop->setCurrentIndex(cbDesktop->findText(readableName)); else { cbDesktop->setCurrentIndex(cbDesktop->findText(X2GoApplication::instance()->getReadableDesktopName("OTHER"))); - leDesktopCommand->setText(profile->getDesktop()); + leDesktopCommand->setText(profile->get_desktop()); } - if(profile->getPublished()) + if(profile->get_published()) cbDesktop->setCurrentIndex(cbDesktop->findText(X2GoApplication::instance()->getReadableDesktopName("PUBLISHED"))); - if(profile->getRootless()) + if(profile->get_rootless()) { cbDesktop->setCurrentIndex(cbDesktop->findText(X2GoApplication::instance()->getReadableDesktopName("APPLICATION"))); - readableName=X2GoApplication::instance()->getReadableAppName(profile->getDesktop()); + readableName=X2GoApplication::instance()->getReadableAppName(profile->get_desktop()); if(readableName!=QString::null) cbApplication->setCurrentIndex(cbApplication->findText(readableName)); else { cbApplication->setCurrentIndex(cbApplication->findText(tr("Other"))); - leApplicationPath->setText(profile->getDesktop()); + leApplicationPath->setText(profile->get_desktop()); } } - leXDMCPServer->setText(profile->getXDMCPServer()); - cbDirectRDP->setChecked(profile->getDirectRDP()); - leRDPServer->setText(profile->getRDPServer()); - sbRDPPort->setValue(profile->getRDPPort()); - if(profile->getRDPClient()=="rdesktop") + leXDMCPServer->setText(profile->get_XDMCPServer()); + cbDirectRDP->setChecked(profile->get_directRDP()); + leRDPServer->setText(profile->get_RDPServer()); + sbRDPPort->setValue(profile->get_RDPPort()); + if(profile->get_RDPClient()=="rdesktop") rbRdesktop->setChecked(true); else rbXfreerdp->setChecked(true); - leRDPClientOptions->setText(profile->getRDPOptions()); + leRDPClientOptions->setText(profile->get_RDPOptions()); slotApplicationSelected(); slotDesktopTypeSelected(); slotRDPOptionsModified(); @@ -90,35 +90,35 @@ void ConfiguratorType::init() void ConfiguratorType::apply() { QString desktopType=X2GoApplication::instance()->getInternDesktopName(cbDesktop->currentText()); - profile->setPublished(false); - profile->setRootless(false); - profile->setDesktop(desktopType); + profile->set_published(false); + profile->set_rootless(false); + profile->set_desktop(desktopType); if(desktopType=="OTHER") { - profile->setDesktop(leDesktopCommand->text()); + profile->set_desktop(leDesktopCommand->text()); } if(desktopType=="APPLICATION") { QString appName=X2GoApplication::instance()->getInternAppName(cbApplication->currentText()); if(appName==QString::null) appName=leApplicationPath->text(); - profile->setDesktop(appName); - profile->setRootless(true); + profile->set_desktop(appName); + profile->set_rootless(true); } if(desktopType=="PUBLISHED") { - profile->setPublished(true); - profile->setDesktop(QString::null); + profile->set_published(true); + profile->set_desktop(QString::null); } - profile->setXDMCPServer(leXDMCPServer->text()); - profile->setDirectRDP(cbDirectRDP->isChecked()); - profile->setRDPServer(leRDPServer->text()); - profile->setRDPPort(sbRDPPort->value()); + profile->set_XDMCPServer(leXDMCPServer->text()); + profile->set_directRDP(cbDirectRDP->isChecked()); + profile->set_RDPServer(leRDPServer->text()); + profile->set_RDPPort(sbRDPPort->value()); if(rbRdesktop->isChecked()) - profile->setRDPClient("rdesktop"); + profile->set_RDPClient("rdesktop"); else - profile->setRDPClient("xfreerdp"); - profile->setRDPOptions(leRDPClientOptions->text()); + profile->set_RDPClient("xfreerdp"); + profile->set_RDPOptions(leRDPClientOptions->text()); ProfileDetailConfigurator::apply(); } @@ -159,10 +159,10 @@ void ConfiguratorType::slotRDPOptionsModified() { QString client="xfreerdp"; QString userOpt; - if (profile->getUser().length()>0) + if (profile->get_user().length()>0) { userOpt=" -u "; - userOpt+=profile->getUser(); + userOpt+=profile->get_user(); } if (rbRdesktop->isChecked()) { @@ -173,17 +173,17 @@ void ConfiguratorType::slotRDPOptionsModified() if(cbDirectRDP) { - if (profile->getFullscreen()) + if (profile->get_fullscreen()) grOpt=" -f "; - else if (profile->getMaxDimension()) + else if (profile->get_maxDimension()) grOpt=" -D -g "+QString::number(QApplication::desktop()->screenGeometry().width())+"x"+ QString::number(QApplication::desktop()->screenGeometry().height()); else - grOpt=" -g "+QString::number(profile->getDisplayWidth())+"x"+QString::number(profile->getDisplayHeight()); + grOpt=" -g "+QString::number(profile->get_displayWidth())+"x"+QString::number(profile->get_displayHeight()); } QString server; if(cbDirectRDP->isChecked()) - server=profile->getServer(); + server=profile->get_server(); else server=leRDPServer->text(); leRDPCommandLine->setText(client +" "+leRDPClientOptions->text()+ grOpt +userOpt+" "+ server+":"+ diff --git a/icons/32x32/preferences.png b/icons/32x32/critical.png similarity index 100% copy from icons/32x32/preferences.png copy to icons/32x32/critical.png diff --git a/icons/32x32/preferences.png b/icons/32x32/information.png similarity index 100% copy from icons/32x32/preferences.png copy to icons/32x32/information.png diff --git a/icons/32x32/edit.png b/icons/32x32/input.png similarity index 100% copy from icons/32x32/edit.png copy to icons/32x32/input.png diff --git a/icons/32x32/preferences.png b/icons/32x32/warning.png similarity index 100% copy from icons/32x32/preferences.png copy to icons/32x32/warning.png diff --git a/mainwindow.cpp b/mainwindow.cpp index ca42008..b961fb4 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -25,32 +25,29 @@ #include <QMessageBox> #include <QFrame> #include <QVBoxLayout> +#include <QResizeEvent> #include "workarea.h" #include "svgframe.h" #include "x2goapplication.h" MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags): QMainWindow(parent, flags) { - X2GoApplication::instance()->setMainWindow(this); + X2GoApplication::instance()->set_mainWindow(this); setupUi(this); mdiArea->setOption(QMdiArea::DontMaximizeSubWindowOnActivation,true); QMdiSubWindow* win=new QMdiSubWindow(mdiArea,Qt::SubWindow| Qt::WindowTitleHint | Qt::CustomizeWindowHint | Qt::WindowStaysOnBottomHint); workArea=new WorkArea(win); win->setWidget(workArea); win->showMaximized(); - -// QMdiSubWindow* dialog=new QMdiSubWindow(mdiArea,Qt::FramelessWindowHint |Qt::WindowStaysOnTopHint); -// QFrame* fr=new QFrame(dialog); -// dialog->setWidget(fr); -// fr->show(); -// dialog->setFixedSize(340,190); -// dialog->move(300,30); -// dialog->show(); -// dialog->setStyleSheet("background:transparent"); -// fr->setStyleSheet("background-repeat: no-repeat;background-image: url(:/svg/sessionbut.svg)"); } MainWindow::~MainWindow() { } + +void MainWindow::resizeEvent(QResizeEvent* event) +{ + QWidget::resizeEvent(event); + emit signalResized(event); +} diff --git a/mainwindow.h b/mainwindow.h index b73f49a..30b40c6 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -29,16 +29,21 @@ class WorkArea; class MainWindow :public QMainWindow, public Ui_MainWindow { Q_OBJECT - X2GO_PROPERTY_GETTER( QAction*, actionNew_profile, getActionNewProfile) - X2GO_PROPERTY_GETTER( QAction*, actionProfile_preferences, getActionProfilePreferences) - X2GO_PROPERTY_GETTER( QAction*, actionCreate_profile_icon_on_desktop, getActionCreateProfileIconOnDesktop) - X2GO_PROPERTY_GETTER( QAction*, actionDelete_profile, getActionDeleteProfile) - X2GO_PROPERTY_GETTER( QAction*, action_Settings, getActionSettings) + X2GO_PROPERTY_GETTER( QAction*, actionNew_profile) + X2GO_PROPERTY_GETTER( QAction*, actionProfile_preferences) + X2GO_PROPERTY_GETTER( QAction*, actionCreate_profile_icon_on_desktop) + X2GO_PROPERTY_GETTER( QAction*, actionDelete_profile) + X2GO_PROPERTY_GETTER( QAction*, action_Settings) + X2GO_PROPERTY_GETTER( QMdiArea*, mdiArea) public: MainWindow(QWidget* parent = 0, Qt::WindowFlags flags = 0); ~MainWindow(); private: WorkArea* workArea; +protected: + virtual void resizeEvent ( QResizeEvent * event ); +signals: + void signalResized(QResizeEvent * event); }; #endif // MAINWINDOW_H diff --git a/messagebox.cpp b/messagebox.cpp new file mode 100644 index 0000000..0b8ba33 --- /dev/null +++ b/messagebox.cpp @@ -0,0 +1,142 @@ +/************************************************************************** +* Copyright (C) 2005-2012 by Oleksandr Shneyder * +* o.shneyder@phoca-gmbh.de * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ + + +#include "messagebox.h" +#include "mainwindow.h" +#include "workarea.h" +#include <QResizeEvent> +#include <QPushButton> +#include <QEventLoop> +#include <QDebug> + +MessageBox::MessageBox(): QMdiSubWindow(X2GoApplication::instance()->get_mainWindow()->get_mdiArea(), + Qt::FramelessWindowHint |Qt::WindowStaysOnTopHint) +{ + setStyleSheet("background:transparent"); + setupUi(this); + setWidget(frame); + connect(X2GoApplication::instance()->get_mainWindow(), SIGNAL(signalResized(QResizeEvent*)), this, SLOT(slotResize(QResizeEvent*))); + move (5,10); + setFixedWidth(X2GoApplication::instance()->get_mainWindow()->width()-10); + lInputLabel->hide(); + leInput->hide(); + show(); + loop=new QEventLoop(this); +} + +MessageBox::~MessageBox() +{ + +} +void MessageBox::slotResize(QResizeEvent* event) +{ + setFixedWidth(event->size().width()-10); +} + +void MessageBox::slotOkClicked() +{ + X2GoApplication::instance()->get_workArea()->setEnabled(true); + loop->exit(OK); +} + +void MessageBox::slotCancelClicked() +{ + X2GoApplication::instance()->get_workArea()->setEnabled(true); + loop->exit(CANCEL); +} + +void MessageBox::slotNoClicked() +{ + X2GoApplication::instance()->get_workArea()->setEnabled(true); + loop->exit(NO); +} + +void MessageBox::slotYesClicked() +{ + X2GoApplication::instance()->get_workArea()->setEnabled(true); + loop->exit(YES); +} + +MessageBox::Buttons MessageBox::exec() +{ + lText->setFixedHeight(lText->sizeHint().height()); + setFixedHeight(sizeHint().height()); + X2GoApplication::instance()->get_workArea()->setEnabled(false); + return (MessageBox::Buttons)loop->exec(); +} + +void MessageBox::setupDialog(QString pix, QString text, int buttons, QString inputLabel, QLineEdit::EchoMode echoMode) +{ + lText->setText(text); + lInputLabel->setText(inputLabel); + leInput->setEchoMode(echoMode); + lPixmap->setPixmap(QPixmap(pix)); + pbCancel->setVisible(buttons&CANCEL); + pbOk->setVisible(buttons&OK); + pbYes->setVisible(buttons&YES); + pbNo->setVisible(buttons&NO); + if(leInput->isHidden()) + vlDisplayLayout->removeItem(hlInputLayout); + else + leInput->setFocus(); +} + +MessageBox::Buttons MessageBox::critical(QString text, int buttons) +{ + MessageBox* box=new MessageBox(); + box->setupDialog(":/icons/32x32/critical.png", text, buttons); + Buttons res=box->exec(); + delete box; + return res; +} + +MessageBox::Buttons MessageBox::warning(QString text, int buttons) +{ + MessageBox* box=new MessageBox(); + box->setupDialog(":/icons/32x32/warning.png", text, buttons, QString::null); + Buttons res=box->exec(); + delete box; + return res; +} + +MessageBox::Buttons MessageBox::information(QString text, int buttons) +{ + MessageBox* box=new MessageBox(); + box->setupDialog(":/icons/32x32/information.png", text, buttons, QString::null); + Buttons res=box->exec(); + delete box; + return res; +} + +MessageBox::Buttons MessageBox::input(QString text, QString inputLabel, QString& input, QLineEdit::EchoMode echoMode, QString pixPath) +{ + MessageBox* box=new MessageBox(); + if(pixPath==QString::null) + pixPath=":/icons/32x32/input.png"; + box->leInput->setText(input); + box->leInput->show(); + box->lInputLabel->show(); + box->setupDialog(pixPath, text, OK|CANCEL, inputLabel, echoMode); + Buttons res=box->exec(); + input=box->leInput->text(); + delete box; + return res; +} diff --git a/profiledetailconfiguratorform.h b/messagebox.h similarity index 60% copy from profiledetailconfiguratorform.h copy to messagebox.h index c8b2a8c..9a3f4cb 100644 --- a/profiledetailconfiguratorform.h +++ b/messagebox.h @@ -18,42 +18,37 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ - -#ifndef PROFILEDETAILCONFIGURATORFORM_H -#define PROFILEDETAILCONFIGURATORFORM_H - -#include <QWidget> -#include "ui_profiledetailconfiguratorform.h" +#ifndef MESSAGEBOX_H +#define MESSAGEBOX_H +#include <QMdiSubWindow> +#include "ui_messagebox.h" #include "x2goapplication.h" +class QEventLoop; -class ToolBar; -class ProfileDetailConfigurator; -class Profile; - -class ProfileDetailConfiguratorForm : public QWidget, public Ui_ProfileDetailConfiguratorForm +class MessageBox: public QMdiSubWindow, public Ui_MessageBox { Q_OBJECT public: - enum configuratorType {PROFILE, SERVER, SESSIONTYPE, CONNECTION, DISPLAY, KEYBOARD, SOUND, PRINTING, FOLDERS}; - ProfileDetailConfiguratorForm(QWidget* parent = 0, Qt::WindowFlags f = 0); - ~ProfileDetailConfiguratorForm(); - void setConfigurator(Profile* profile, configuratorType type); - -private slots: - void slotApply(); - void slotDefaults(); - void slotReset(); - void slotBack(); - void slotOk(); - void slotDetailModified(); - + enum Buttons {YES=1,NO=2,OK=8,CANCEL=16}; private: - void setModified(bool value); - + QEventLoop* loop; +private slots: + void slotResize(QResizeEvent* event); + void slotYesClicked(); + void slotNoClicked(); + void slotOkClicked(); + void slotCancelClicked(); +public: + static Buttons information(QString text, int buttons); + static Buttons critical(QString text, int buttons); + static Buttons warning(QString text, int buttons); + static Buttons input(QString text, QString inputLabel, QString& input, QLineEdit::EchoMode echoMode = QLineEdit::Normal, + QString pixPath=QString::null); private: - ToolBar* toolBar; - bool modified; - ProfileDetailConfigurator* profileDetailConfigurator; + MessageBox(); + virtual ~MessageBox(); + Buttons exec(); + void setupDialog(QString pix, QString text, int buttons, QString inputLabel = QString::null, QLineEdit::EchoMode echoMode = QLineEdit::Normal); }; -#endif // PROFILEDETAILCONFIGURATORFORM_H +#endif // MESSAGEBOX_H diff --git a/messagebox.ui b/messagebox.ui new file mode 100644 index 0000000..d18f5e6 --- /dev/null +++ b/messagebox.ui @@ -0,0 +1,385 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>MessageBox</class> + <widget class="QWidget" name="MessageBox"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>577</width> + <height>227</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <widget class="QFrame" name="frame"> + <property name="geometry"> + <rect> + <x>10</x> + <y>0</y> + <width>531</width> + <height>121</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">border-image: url(:/svg/messagebox.svg);border-top: 12px transparent; border-bottom: 12px transparent;border-right: 12px transparent; border-left: 12px transparent</string> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="margin"> + <number>2</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="spacing"> + <number>20</number> + </property> + <item> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="lPixmap"> + <property name="minimumSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">border-image: url(:/svg/transparent.svg);border-top: 0px transparent; border-bottom: 0px transparent;border-right: 0px transparent; border-left: 0px transparent</string> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="resources.qrc">:/icons/32x32/preferences.png</pixmap> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="vlDisplayLayout"> + <item> + <widget class="QLabel" name="lText"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Minimum"> + <horstretch>99</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">border-image: url(:/svg/transparent.svg);border-top: 0px transparent; border-bottom: 0px transparent;border-right: 0px transparent; border-left: 0px transparent</string> + </property> + <property name="text"> + <string>TextLabel</string> + </property> + <property name="textFormat"> + <enum>Qt::AutoText</enum> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="hlInputLayout"> + <item> + <widget class="QLabel" name="lInputLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Minimum"> + <horstretch>99</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">border-image: url(:/svg/transparent.svg);border-top: 0px transparent; border-bottom: 0px transparent;border-right: 0px transparent; border-left: 0px transparent</string> + </property> + <property name="text"> + <string>Input:</string> + </property> + <property name="textFormat"> + <enum>Qt::AutoText</enum> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="leInput"> + <property name="minimumSize"> + <size> + <width>200</width> + <height>0</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">border-image: url(:/svg/messageboxbutton.svg);border-top: 2px transparent; border-bottom: 2px transparent;border-right: 2px transparent; border-left: 2px transparent</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>1000000</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>3</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="pbYes"> + <property name="minimumSize"> + <size> + <width>60</width> + <height>28</height> + </size> + </property> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> + <property name="styleSheet"> + <string notr="true">border-image: url(:/svg/messageboxbutton.svg);border-top: 2px transparent; border-bottom: 2px transparent;border-right: 2px transparent; border-left: 2px transparent</string> + </property> + <property name="text"> + <string>Yes</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="pbNo"> + <property name="minimumSize"> + <size> + <width>60</width> + <height>28</height> + </size> + </property> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> + <property name="styleSheet"> + <string notr="true">border-image: url(:/svg/messageboxbutton.svg);border-top: 2px transparent; border-bottom: 2px transparent;border-right: 2px transparent; border-left: 2px transparent</string> + </property> + <property name="text"> + <string>No</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="pbOk"> + <property name="minimumSize"> + <size> + <width>60</width> + <height>28</height> + </size> + </property> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> + <property name="styleSheet"> + <string notr="true">border-image: url(:/svg/messageboxbutton.svg);border-top: 2px transparent; border-bottom: 2px transparent;border-right: 2px transparent; border-left: 2px transparent</string> + </property> + <property name="text"> + <string>OK</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="pbCancel"> + <property name="minimumSize"> + <size> + <width>60</width> + <height>28</height> + </size> + </property> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> + <property name="styleSheet"> + <string notr="true">border-image: url(:/svg/messageboxbutton.svg);border-top: 2px transparent; border-bottom: 2px transparent;border-right: 2px transparent; border-left: 2px transparent</string> + </property> + <property name="text"> + <string>Cancel</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + </widget> + <resources> + <include location="resources.qrc"/> + </resources> + <connections> + <connection> + <sender>pbYes</sender> + <signal>clicked()</signal> + <receiver>MessageBox</receiver> + <slot>slotYesClicked()</slot> + <hints> + <hint type="sourcelabel"> + <x>63</x> + <y>138</y> + </hint> + <hint type="destinationlabel"> + <x>270</x> + <y>197</y> + </hint> + </hints> + </connection> + <connection> + <sender>pbNo</sender> + <signal>clicked()</signal> + <receiver>MessageBox</receiver> + <slot>slotNoClicked()</slot> + <hints> + <hint type="sourcelabel"> + <x>121</x> + <y>133</y> + </hint> + <hint type="destinationlabel"> + <x>120</x> + <y>201</y> + </hint> + </hints> + </connection> + <connection> + <sender>pbOk</sender> + <signal>clicked()</signal> + <receiver>MessageBox</receiver> + <slot>slotOkClicked()</slot> + <hints> + <hint type="sourcelabel"> + <x>172</x> + <y>133</y> + </hint> + <hint type="destinationlabel"> + <x>171</x> + <y>204</y> + </hint> + </hints> + </connection> + <connection> + <sender>pbCancel</sender> + <signal>clicked()</signal> + <receiver>MessageBox</receiver> + <slot>slotCancelClicked()</slot> + <hints> + <hint type="sourcelabel"> + <x>247</x> + <y>135</y> + </hint> + <hint type="destinationlabel"> + <x>215</x> + <y>202</y> + </hint> + </hints> + </connection> + <connection> + <sender>leInput</sender> + <signal>returnPressed()</signal> + <receiver>MessageBox</receiver> + <slot>slotOkClicked()</slot> + <hints> + <hint type="sourcelabel"> + <x>289</x> + <y>70</y> + </hint> + <hint type="destinationlabel"> + <x>462</x> + <y>197</y> + </hint> + </hints> + </connection> + </connections> + <slots> + <slot>slotYesClicked()</slot> + <slot>slotNoClicked()</slot> + <slot>slotOkClicked()</slot> + <slot>slotCancelClicked()</slot> + </slots> +</ui> diff --git a/profile.cpp b/profile.cpp index a63c6e7..3b10262 100644 --- a/profile.cpp +++ b/profile.cpp @@ -86,12 +86,12 @@ Profile::Profile(QWidget* parent, Qt::WindowFlags f): QFrame(parent, f) f2SettingsConnector=0; setFixedWidth(PROFILE_HEIGHT); - connect(X2GoApplication::instance()->getProfileForm(), SIGNAL(signalViewPortResized()), this, SLOT(slotUpdateProfileWidget())); - connect(X2GoApplication::instance()->getProfileForm(), SIGNAL(signalProfilesScrolled()), this, SLOT(slotUpdateProfileWidget())); - connect(X2GoApplication::instance()->getProfileForm()->scrollArea->verticalScrollBar(), + connect(X2GoApplication::instance()->get_profileForm(), SIGNAL(signalViewPortResized()), this, SLOT(slotUpdateProfileWidget())); + connect(X2GoApplication::instance()->get_profileForm(), SIGNAL(signalProfilesScrolled()), this, SLOT(slotUpdateProfileWidget())); + connect(X2GoApplication::instance()->get_profileForm()->scrollArea->verticalScrollBar(), SIGNAL(rangeChanged(int,int)), this, SLOT(slotUpdateProfileWidget())); connect(X2GoApplication::instance(), SIGNAL(signalUpdateProfiles()), this, SLOT(slotUpdateProfileWidget())); - connect(this, SIGNAL(signalDragFinished()), X2GoApplication::instance()->getWorkArea(), SLOT(slotScrollToNearestForm())); + connect(this, SIGNAL(signalDragFinished()), X2GoApplication::instance()->get_workArea(), SLOT(slotScrollToNearestForm())); connect(this, SIGNAL(signalSelected(Profile*)), X2GoApplication::instance(), SIGNAL(signalProfilesSelectionChanged(Profile*))); connect(X2GoApplication::instance(), SIGNAL(signalProfilesSelectionChanged(Profile*)),this, SLOT(slotProfileSelected(Profile*))); } @@ -116,14 +116,14 @@ int Profile::getProfileIndex() void Profile::slotUpdateProfileWidget() { - QWidget* scrollAreaWidget=X2GoApplication::instance()->getProfileForm()->getScrollArea()->widget(); - QWidget* viewPort=X2GoApplication::instance()->getProfileForm()->getScrollArea()->viewport(); + QWidget* scrollAreaWidget=X2GoApplication::instance()->get_profileForm()->getScrollArea()->widget(); + QWidget* viewPort=X2GoApplication::instance()->get_profileForm()->getScrollArea()->viewport(); QList<Profile*>* profiles=X2GoApplication::instance()->getProfiles(); if(scrollAreaWidget->width() != viewPort->width() || scrollAreaWidget->height() != profiles->count()*100) { scrollAreaWidget->setFixedSize(viewPort->width(), profiles->count()*100); } - QScrollBar* scrollBar=X2GoApplication::instance()->getProfileForm()->getScrollArea()->verticalScrollBar(); + QScrollBar* scrollBar=X2GoApplication::instance()->get_profileForm()->getScrollArea()->verticalScrollBar(); int index=getProfileIndex(); int minYVisible=scrollBar->value(); @@ -156,8 +156,8 @@ void Profile::slotUpdateProfileWidget() f2SettingsConnector->show(); } show(); - if(X2GoApplication::instance()->getWorkArea()->getScrollArea()->horizontalScrollBar()->value() > - X2GoApplication::instance()->getProfileForm()->x()) + if(X2GoApplication::instance()->get_workArea()->getScrollArea()->horizontalScrollBar()->value() > + X2GoApplication::instance()->get_profileForm()->x()) lProfileShort->show(); else lProfileShort->hide(); @@ -189,7 +189,7 @@ void Profile::initWidget() border-top: 0px transparent; border-bottom: 0px transparent; \ border-right: 0px transparent; border-left: 0px transparent"); connect(pbSettings, SIGNAL(clicked(bool)), this, SLOT(slotSelectProfile())); - connect(pbSettings, SIGNAL(clicked(bool)), X2GoApplication::instance()->getWorkArea(), SLOT(slotScrollToProfileSettingsForm())); + connect(pbSettings, SIGNAL(clicked(bool)), X2GoApplication::instance()->get_workArea(), SLOT(slotScrollToProfileSettingsForm())); updateProfileDetails(); } @@ -264,8 +264,8 @@ void Profile::slotProfileSelected(Profile* profile) if(selected) { setupSelectedWidget(); - X2GoApplication::instance()->getProfileSettingsForm()->setProfile(this); - X2GoApplication::instance()->getProfileSettingsForm()->updateProfile(); + X2GoApplication::instance()->get_profileSettingsForm()->set_profile(this); + X2GoApplication::instance()->get_profileSettingsForm()->updateProfile(); } else { @@ -280,7 +280,7 @@ void Profile::mouseMoveEvent(QMouseEvent* event) QWidget::mouseMoveEvent(event); if(startDragPoint>0) { - X2GoApplication::instance()->getWorkArea()->getScrollArea()->horizontalScrollBar()->setValue(startScrollPosition- + X2GoApplication::instance()->get_workArea()->getScrollArea()->horizontalScrollBar()->setValue(startScrollPosition- (event->globalX()-startDragPoint)); } } @@ -290,7 +290,7 @@ void Profile::mousePressEvent(QMouseEvent* event) if(event->button()== Qt::LeftButton && (event->x()>width()-10 || (event->y()>7 && event->y()< PROFILE_HEIGHT-7) )) { startDragPoint=event->globalX(); - startScrollPosition= X2GoApplication::instance()->getWorkArea()->getScrollArea()->horizontalScrollBar()->value(); + startScrollPosition= X2GoApplication::instance()->get_workArea()->getScrollArea()->horizontalScrollBar()->value(); slotSelectProfile(); } QWidget::mousePressEvent(event); diff --git a/profile.h b/profile.h index 464bf6d..f639cdf 100644 --- a/profile.h +++ b/profile.h @@ -34,64 +34,64 @@ public: enum ProxyType {SSH, HTTP}; enum SpeedType {MODEM, ISDN, ADSL, WAN, LAN}; - X2GO_PROPERTY(QString, profileName, setProfileName, getProfileName) - X2GO_PROPERTY(QPixmap, picture, setPicture, getPicture) + X2GO_PROPERTY(QString, profileName) + X2GO_PROPERTY(QPixmap, picture) - X2GO_PROPERTY(QString, server, setServer, getServer) - X2GO_PROPERTY(QString, user, setUser, getUser) - X2GO_PROPERTY(int, SSHPort, setSSHPort, getSSHPort) - X2GO_PROPERTY(QString, key, setKey, getKey) - X2GO_PROPERTY(bool, autoLogin, setAutologin, getAutologin) - X2GO_PROPERTY(bool, proxy, setProxy, getProxy) - X2GO_PROPERTY(ProxyType, proxyType, setProxyType, getProxyType) - X2GO_PROPERTY(QString, proxyHost, setProxyHost, getProxyHost) - X2GO_PROPERTY(int, proxyPort, setProxyPort, getProxyPort) - X2GO_PROPERTY(QString, proxyLogin, setProxyLogin, getProxyLogin) - X2GO_PROPERTY(bool, proxySameLogin, setProxySameLogin, getProxySameLogin) - X2GO_PROPERTY(bool, proxySamePass, setProxySamePass, getProxySamePass) - X2GO_PROPERTY(QString, proxyKey, setProxyKey, getProxyKey) - X2GO_PROPERTY(bool, proxyAutoLogin, setProxyAutologin, getProxyAutologin) + X2GO_PROPERTY(QString, server) + X2GO_PROPERTY(QString, user) + X2GO_PROPERTY(int, SSHPort) + X2GO_PROPERTY(QString, key) + X2GO_PROPERTY(bool, autoLogin) + X2GO_PROPERTY(bool, proxy) + X2GO_PROPERTY(ProxyType, proxyType) + X2GO_PROPERTY(QString, proxyHost) + X2GO_PROPERTY(int, proxyPort) + X2GO_PROPERTY(QString, proxyLogin) + X2GO_PROPERTY(bool, proxySameLogin) + X2GO_PROPERTY(bool, proxySamePass) + X2GO_PROPERTY(QString, proxyKey) + X2GO_PROPERTY(bool, proxyAutoLogin) - X2GO_PROPERTY(bool, rootless, setRootless, getRootless) - X2GO_PROPERTY(bool, published, setPublished, getPublished) - X2GO_PROPERTY(QString, desktop, setDesktop, getDesktop) - X2GO_PROPERTY(QString, XDMCPServer, setXDMCPServer, getXDMCPServer) - X2GO_PROPERTY(QString, RDPServer, setRDPServer, getRDPServer) - X2GO_PROPERTY(QString, RDPClient, setRDPClient, getRDPClient) - X2GO_PROPERTY(QString, RDPOptions, setRDPOptions, getRDPOptions) - X2GO_PROPERTY(int, RDPPort, setRDPPort, getRDPPort) - X2GO_PROPERTY(bool, directRDP, setDirectRDP, getDirectRDP) + X2GO_PROPERTY(bool, rootless) + X2GO_PROPERTY(bool, published) + X2GO_PROPERTY(QString, desktop) + X2GO_PROPERTY(QString, XDMCPServer) + X2GO_PROPERTY(QString, RDPServer) + X2GO_PROPERTY(QString, RDPClient) + X2GO_PROPERTY(QString, RDPOptions) + X2GO_PROPERTY(int, RDPPort) + X2GO_PROPERTY(bool, directRDP) - X2GO_PROPERTY(SpeedType, speed, setSpeed, getSpeed) - X2GO_PROPERTY(QString, method, setMethod, getMethod) - X2GO_PROPERTY(int, quality, setQuality, getQuality) + X2GO_PROPERTY(SpeedType, speed) + X2GO_PROPERTY(QString, method) + X2GO_PROPERTY(int, quality) - X2GO_PROPERTY(bool, fullscreen, setFullscreen, getFullscreen) - X2GO_PROPERTY(int, displayWidth, setDisplayWidth, getDisplayWidth) - X2GO_PROPERTY(int, displayHeight, setDisplayHeight, getDisplayHeight) - X2GO_PROPERTY(bool, multiDisplay, setMultiDisplay, getMultiDisplay) - X2GO_PROPERTY(int, displayNumber, setDisplayNumber, getDisplayNumber) - X2GO_PROPERTY(bool, maxDimension, setMaxDimension, getMaxDimension) - X2GO_PROPERTY(bool, changeDPI, setChangeDPI, getChangeDPI) - X2GO_PROPERTY(int, dpi, setDpi, getDpi) - X2GO_PROPERTY(bool, xinerama, setXinerama, getXinerama) + X2GO_PROPERTY(bool, fullscreen) + X2GO_PROPERTY(int, displayWidth) + X2GO_PROPERTY(int, displayHeight) + X2GO_PROPERTY(bool, multiDisplay) + X2GO_PROPERTY(int, displayNumber) + X2GO_PROPERTY(bool, maxDimension) + X2GO_PROPERTY(bool, changeDPI) + X2GO_PROPERTY(int, dpi) + X2GO_PROPERTY(bool, xinerama) - X2GO_PROPERTY(bool, changeKeyboard, setChangeKeyboard, getChangeKeyboard) - X2GO_PROPERTY(QString, keyboardLayout, setKeyboardLayout, getKeyboardLayout) - X2GO_PROPERTY(QString, keyboardModel, setKeyboardModel, getKeyboardModel) + X2GO_PROPERTY(bool, changeKeyboard) + X2GO_PROPERTY(QString, keyboardLayout) + X2GO_PROPERTY(QString, keyboardModel) - X2GO_PROPERTY(bool, sound, setSound, getSound) - X2GO_PROPERTY(bool, soundTunnel, setSoundTunnel, getSoundTunnel) - X2GO_PROPERTY(bool, useDefaultSoundPort, setUseDefaultSoundPort, getUseDefaultSoundPort) - X2GO_PROPERTY(int, soundPort, setSoundPort, getSoundPort) + X2GO_PROPERTY(bool, sound) + X2GO_PROPERTY(bool, soundTunnel) + X2GO_PROPERTY(bool, useDefaultSoundPort) + X2GO_PROPERTY(int, soundPort) - X2GO_PROPERTY(bool, printing, setPrinting, getPrinting) + X2GO_PROPERTY(bool, printing) - X2GO_PROPERTY(QString, exportFolders, setExportFolders, getExportFolders) - X2GO_PROPERTY(bool, exportFSTunnel, setExportFSTunnel, getExportFSTunnel) - X2GO_PROPERTY(bool, encodeFS, setEncodeFS, getEncodeFS) - X2GO_PROPERTY(QString, localFSEncoding, setLocalFSEncoding, getLocalFSEncoding) - X2GO_PROPERTY(QString, remoteFSEncoding, setRemoteFSEncoding, getRemoteFSEncoding) + X2GO_PROPERTY(QString, exportFolders) + X2GO_PROPERTY(bool, exportFSTunnel) + X2GO_PROPERTY(bool, encodeFS) + X2GO_PROPERTY(QString, localFSEncoding) + X2GO_PROPERTY(QString, remoteFSEncoding) public: Profile(QWidget* parent = 0, Qt::WindowFlags f = 0); virtual ~Profile(); diff --git a/profiledetailconfigurator.cpp b/profiledetailconfigurator.cpp index e893ca5..9d6c518 100644 --- a/profiledetailconfigurator.cpp +++ b/profiledetailconfigurator.cpp @@ -44,7 +44,7 @@ ProfileDetailConfigurator::~ProfileDetailConfigurator() void ProfileDetailConfigurator::apply() { profile->updateProfileDetails(); - X2GoApplication::instance()->getProfileSettingsForm()->updateProfile(); + X2GoApplication::instance()->get_profileSettingsForm()->updateProfile(); } void ProfileDetailConfigurator::slotEmitModified() diff --git a/profiledetailconfiguratorform.cpp b/profiledetailconfiguratorform.cpp index 41f27b9..3adc4a9 100644 --- a/profiledetailconfiguratorform.cpp +++ b/profiledetailconfiguratorform.cpp @@ -35,6 +35,7 @@ #include "profileform.h" #include "profilesettingsform.h" #include "sessionform.h" +#include "messagebox.h" ProfileDetailConfiguratorForm::ProfileDetailConfiguratorForm(QWidget* parent, Qt::WindowFlags f): QWidget(parent, f) { @@ -99,6 +100,23 @@ void ProfileDetailConfiguratorForm::slotReset() void ProfileDetailConfiguratorForm::slotBack() { + + if(modified) + { + switch(MessageBox::information(tr ( "<b>Settings was changed</b><br>Do you want to save them before exit?"), + MessageBox::YES|MessageBox::NO|MessageBox::CANCEL)) + { + + case MessageBox::CANCEL: + return; + case MessageBox::YES: + slotApply(); + break; + default: + break; + } + } + if(profileDetailConfigurator) { scrollArea->takeWidget(); @@ -106,11 +124,11 @@ void ProfileDetailConfiguratorForm::slotBack() profileDetailConfigurator=0; } hide(); - X2GoApplication::instance()->getSessionForm()->show(); - X2GoApplication::instance()->getProfileForm()->show(); - X2GoApplication::instance()->getProfileSettingsForm()->show(); - X2GoApplication::instance()->getWorkArea()->setAnimateNextScroll(false); - QTimer::singleShot(10, X2GoApplication::instance()->getWorkArea(), SLOT(slotScrollToProfileSettingsForm())); + X2GoApplication::instance()->get_sessionForm()->show(); + X2GoApplication::instance()->get_profileForm()->show(); + X2GoApplication::instance()->get_profileSettingsForm()->show(); + X2GoApplication::instance()->get_workArea()->set_animateNextScroll(false); + QTimer::singleShot(10, X2GoApplication::instance()->get_workArea(), SLOT(slotScrollToProfileSettingsForm())); } void ProfileDetailConfiguratorForm::setConfigurator(Profile* profile, ProfileDetailConfiguratorForm::configuratorType type) @@ -174,9 +192,9 @@ void ProfileDetailConfiguratorForm::setConfigurator(Profile* profile, ProfileDet if(profileDetailConfigurator) { scrollArea->setWidget(profileDetailConfigurator); - X2GoApplication::instance()->getSessionForm()->hide(); - X2GoApplication::instance()->getProfileForm()->hide(); - X2GoApplication::instance()->getProfileSettingsForm()->hide(); + X2GoApplication::instance()->get_sessionForm()->hide(); + X2GoApplication::instance()->get_profileForm()->hide(); + X2GoApplication::instance()->get_profileSettingsForm()->hide(); show(); connect(profileDetailConfigurator, SIGNAL(signalModified()), this, SLOT(slotDetailModified())); } diff --git a/profileform.cpp b/profileform.cpp index 3996898..c8a3d2e 100644 --- a/profileform.cpp +++ b/profileform.cpp @@ -46,7 +46,7 @@ ProfileForm::ProfileForm(QWidget* parent, Qt::WindowFlags f):SVGFrame(":svg/prof barLayout->setMargin(0); barLayout->addWidget(toolBar); barLayout->addWidget(searchBar); - MainWindow* mw=X2GoApplication::instance()->getMainWindow(); + MainWindow* mw=X2GoApplication::instance()->get_mainWindow(); pbPageDown->hide(); pbPageUp->hide(); @@ -57,11 +57,11 @@ ProfileForm::ProfileForm(QWidget* parent, Qt::WindowFlags f):SVGFrame(":svg/prof toolBar->addSpacer(25); toolBar->addWidget(toolbarIcon); toolBar->addSpacer(30); - toolBar->addAction(mw->getActionNewProfile()); - toolBar->addAction(mw->getActionProfilePreferences()); - toolBar->addAction(mw->getActionCreateProfileIconOnDesktop()); + toolBar->addAction(mw->get_actionNew_profile()); + toolBar->addAction(mw->get_actionProfile_preferences()); + toolBar->addAction(mw->get_actionCreate_profile_icon_on_desktop()); toolBar->addSpacer(15); - toolBar->addAction(mw->getActionSettings()); + toolBar->addAction(mw->get_action_Settings()); ((QVBoxLayout*)layout())->insertLayout(0,barLayout); connect(scrollArea->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SIGNAL(signalProfilesScrolled())); diff --git a/profilesettingsform.cpp b/profilesettingsform.cpp index 9bdc784..f832c75 100644 --- a/profilesettingsform.cpp +++ b/profilesettingsform.cpp @@ -36,7 +36,7 @@ ProfileSettingsForm::ProfileSettingsForm(QWidget* parent, Qt::WindowFlags f): QW setupUi(this); toolBar=new ToolBar(this); ((QVBoxLayout*)layout())->insertWidget(0,toolBar); - connect(this, SIGNAL(signalDragFinished()), X2GoApplication::instance()->getWorkArea(), SLOT(slotScrollToNearestForm())); + connect(this, SIGNAL(signalDragFinished()), X2GoApplication::instance()->get_workArea(), SLOT(slotScrollToNearestForm())); lwiProfile=new QListWidgetItem(QIcon(":/icons/128x128/x2gosession.png"),tr("Name & icon"),lwProfile); lwiServer=new QListWidgetItem(QIcon(":/icons/64x64/personal.png"),tr("Server & authorization"),lwProfile); lwiSessionType=new QListWidgetItem(QIcon(":/icons/128x128/lxde.png"),tr("Session type"),lwProfile); @@ -58,7 +58,7 @@ ProfileSettingsForm::ProfileSettingsForm(QWidget* parent, Qt::WindowFlags f): QW QAction* actionScrollToProfiles=new QAction(QIcon(":/icons/32x32/tbleft.png"),tr("Back"),this); toolBar->addSpacer(5); toolBar->addAction(actionScrollToProfiles); - connect(actionScrollToProfiles, SIGNAL(triggered(bool)), X2GoApplication::instance()->getWorkArea(), SLOT(slotScrollToProfileForm())); + connect(actionScrollToProfiles, SIGNAL(triggered(bool)), X2GoApplication::instance()->get_workArea(), SLOT(slotScrollToProfileForm())); } ProfileSettingsForm::~ProfileSettingsForm() @@ -77,7 +77,7 @@ void ProfileSettingsForm::mouseMoveEvent(QMouseEvent* event) QWidget::mouseMoveEvent(event); if(startDragPoint>0) { - X2GoApplication::instance()->getWorkArea()->getScrollArea()->horizontalScrollBar()->setValue(startScrollPosition- + X2GoApplication::instance()->get_workArea()->getScrollArea()->horizontalScrollBar()->setValue(startScrollPosition- (event->globalX()-startDragPoint)); } } @@ -87,7 +87,7 @@ void ProfileSettingsForm::mousePressEvent(QMouseEvent* event) if(event->button()== Qt::LeftButton) { startDragPoint=event->globalX(); - startScrollPosition= X2GoApplication::instance()->getWorkArea()->getScrollArea()->horizontalScrollBar()->value(); + startScrollPosition= X2GoApplication::instance()->get_workArea()->getScrollArea()->horizontalScrollBar()->value(); } QWidget::mousePressEvent(event); } @@ -131,24 +131,24 @@ void ProfileSettingsForm::slotItemActivated(QListWidgetItem* item) item->setSelected(true); if(item==lwiProfile) - X2GoApplication::instance()->getProfileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::PROFILE); + X2GoApplication::instance()->get_profileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::PROFILE); if(item==lwiServer) - X2GoApplication::instance()->getProfileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::SERVER); + X2GoApplication::instance()->get_profileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::SERVER); if(item==lwiSessionType) - X2GoApplication::instance()->getProfileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::SESSIONTYPE); + X2GoApplication::instance()->get_profileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::SESSIONTYPE); if(item==lwiConnection) - X2GoApplication::instance()->getProfileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::CONNECTION); + X2GoApplication::instance()->get_profileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::CONNECTION); if(item==lwiDisplay) - X2GoApplication::instance()->getProfileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::DISPLAY); + X2GoApplication::instance()->get_profileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::DISPLAY); if(item==lwiKeyboard) - X2GoApplication::instance()->getProfileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::KEYBOARD); + X2GoApplication::instance()->get_profileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::KEYBOARD); if(item==lwiSound) - X2GoApplication::instance()->getProfileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::SOUND); + X2GoApplication::instance()->get_profileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::SOUND); if(item==lwiPrinting) - X2GoApplication::instance()->getProfileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::PRINTING); + X2GoApplication::instance()->get_profileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::PRINTING); if(item==lwiFolders) - X2GoApplication::instance()->getProfileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::FOLDERS); - X2GoApplication::instance()->getWorkArea()->slotScrollToProfileDetailConfiguratorForm(); + X2GoApplication::instance()->get_profileDetailConfiguratorForm()->setConfigurator(profile, ProfileDetailConfiguratorForm::FOLDERS); + X2GoApplication::instance()->get_workArea()->slotScrollToProfileDetailConfiguratorForm(); } void ProfileSettingsForm::setItemEnabled(QListWidgetItem* item, bool value) @@ -170,8 +170,8 @@ bool ProfileSettingsForm::isItemEnabled(QListWidgetItem* item) void ProfileSettingsForm::updateProfile() { - lProfileName->setText(profile->getProfileName()); - bool directRDP=(profile->getDesktop()=="RDP" && profile->getDirectRDP()); + lProfileName->setText(profile->get_profileName()); + bool directRDP=(profile->get_desktop()=="RDP" && profile->get_directRDP()); setItemEnabled(lwiConnection, !directRDP); setItemEnabled(lwiKeyboard, !directRDP); setItemEnabled(lwiSound, !directRDP); diff --git a/profilesettingsform.h b/profilesettingsform.h index 38f633c..bc5c9ab 100644 --- a/profilesettingsform.h +++ b/profilesettingsform.h @@ -31,7 +31,7 @@ class ToolBar; class ProfileSettingsForm : public QWidget, public Ui_ProfileSettingsForm { Q_OBJECT - X2GO_PROPERTY(Profile*, profile, setProfile, getProfile) + X2GO_PROPERTY(Profile*, profile) public: ProfileSettingsForm(QWidget* parent = 0, Qt::WindowFlags f = 0); ~ProfileSettingsForm(); diff --git a/resources.qrc b/resources.qrc index 21e1876..b804dfa 100644 --- a/resources.qrc +++ b/resources.qrc @@ -8,6 +8,8 @@ <file>svg/profile.svg</file> <file>svg/settingsleftbar.svg</file> <file>svg/transparent.svg</file> + <file>svg/messagebox.svg</file> + <file>svg/messageboxbutton.svg</file> <file>svg/profile2settingsconnector.svg</file> <file>svg/profilebuttonsettings.svg</file> <file>svg/profilebuttonstart.svg</file> @@ -58,6 +60,10 @@ <file>icons/32x32/open_dir.png</file> <file>icons/32x32/suspend_session.png</file> <file>icons/32x32/stop_session.png</file> + <file>icons/32x32/input.png</file> + <file>icons/32x32/warning.png</file> + <file>icons/32x32/critical.png</file> + <file>icons/32x32/information.png</file> <file>icons/16x16/audio.png</file> <file>icons/16x16/file-open.png</file> <file>icons/16x16/delete.png</file> diff --git a/svg/profile2settingsconnector.svg b/svg/messagebox.svg similarity index 51% copy from svg/profile2settingsconnector.svg copy to svg/messagebox.svg index 9c7d621..253b21b 100644 --- a/svg/profile2settingsconnector.svg +++ b/svg/messagebox.svg @@ -9,14 +9,14 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="30" - height="90" - id="svg10301" + width="170" + height="105" + id="svg2" version="1.1" inkscape:version="0.48.3.1 r9886" - sodipodi:docname="profile2settingsconnector.svg"> + sodipodi:docname="Neues Dokument 1"> <defs - id="defs10303" /> + id="defs4" /> <sodipodi:namedview id="base" pagecolor="#ffffff" @@ -24,30 +24,40 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="5.6" - inkscape:cx="-41.328559" - inkscape:cy="57.591105" + inkscape:zoom="7.9195959" + inkscape:cx="76.79977" + inkscape:cy="56.993856" inkscape:document-units="px" inkscape:current-layer="layer1" - showgrid="false" + showgrid="true" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" inkscape:window-width="1920" - inkscape:window-height="1025" - inkscape:window-x="1917" + inkscape:window-height="1060" + inkscape:window-x="-3" inkscape:window-y="-3" - inkscape:window-maximized="1" /> + inkscape:window-maximized="1"> + <inkscape:grid + type="xygrid" + id="grid3000" + empspacing="5" + visible="true" + enabled="true" + snapvisiblegridlinesonly="true" + originx="-233px" + originy="-231.03711px" /> + </sodipodi:namedview> <metadata - id="metadata10306"> + id="metadata7"> <rdf:RDF> <cc:Work rdf:about=""> <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> + <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> @@ -55,12 +65,27 @@ inkscape:label="Ebene 1" inkscape:groupmode="layer" id="layer1" - transform="translate(-299.59861,-518.35906)"> - <path - sodipodi:nodetypes="ccccccc" - inkscape:connector-curvature="0" - id="path6182" - d="m 329.59861,518.35906 c 0,5 -5,10 -10,10 l -20,0 0,70 20,0 c 5,0 10,5 10,10 z" - style="fill:#ffffff;fill-opacity:1;stroke:none" /> + transform="translate(-233,-716.32507)"> + <g + id="g3002"> + <rect + ry="8.9297485" + rx="10" + y="717.43243" + x="233" + height="103.89264" + width="168" + id="rect3937-8" + style="fill:#000000;fill-opacity:0.50196078;fill-rule:nonzero;stroke:none" /> + <rect + ry="7.93573" + rx="9" + y="719.42645" + x="235.01743" + height="99.985687" + width="163.98257" + id="rect3937" + style="fill:#ffffff;fill-opacity:0.85882353;fill-rule:nonzero;stroke:none" /> + </g> </g> </svg> diff --git a/svg/profile2settingsconnector.svg b/svg/messageboxbutton.svg similarity index 61% copy from svg/profile2settingsconnector.svg copy to svg/messageboxbutton.svg index 9c7d621..5472d6c 100644 --- a/svg/profile2settingsconnector.svg +++ b/svg/messageboxbutton.svg @@ -10,13 +10,13 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="30" - height="90" - id="svg10301" + height="20" + id="svg2" version="1.1" inkscape:version="0.48.3.1 r9886" - sodipodi:docname="profile2settingsconnector.svg"> + sodipodi:docname="messageboxbutton.svg"> <defs - id="defs10303" /> + id="defs4" /> <sodipodi:namedview id="base" pagecolor="#ffffff" @@ -24,30 +24,30 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="5.6" - inkscape:cx="-41.328559" - inkscape:cy="57.591105" + inkscape:zoom="11.2" + inkscape:cx="18.39907" + inkscape:cy="8.7701659" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" + inkscape:window-width="1239" + inkscape:window-height="671" + inkscape:window-x="572" + inkscape:window-y="0" + inkscape:window-maximized="0" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" - fit-margin-bottom="0" - inkscape:window-width="1920" - inkscape:window-height="1025" - inkscape:window-x="1917" - inkscape:window-y="-3" - inkscape:window-maximized="1" /> + fit-margin-bottom="0" /> <metadata - id="metadata10306"> + id="metadata7"> <rdf:RDF> <cc:Work rdf:about=""> <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> + <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> @@ -55,12 +55,15 @@ inkscape:label="Ebene 1" inkscape:groupmode="layer" id="layer1" - transform="translate(-299.59861,-518.35906)"> - <path - sodipodi:nodetypes="ccccccc" - inkscape:connector-curvature="0" - id="path6182" - d="m 329.59861,518.35906 c 0,5 -5,10 -10,10 l -20,0 0,70 20,0 c 5,0 10,5 10,10 z" - style="fill:#ffffff;fill-opacity:1;stroke:none" /> + transform="translate(-84.352814,-307.37976)"> + <rect + style="fill:#ffffff;fill-opacity:0;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:0.50196078;stroke-dasharray:none" + id="rect2985" + width="29" + height="19" + x="84.852814" + y="307.87976" + rx="2" + ry="2" /> </g> </svg> diff --git a/workarea.cpp b/workarea.cpp index e42953a..bb8dbbc 100644 --- a/workarea.cpp +++ b/workarea.cpp @@ -38,7 +38,7 @@ WorkArea::WorkArea(QWidget* parent, Qt::WindowFlags f): QWidget( parent, f) sessionForm=0; profileSettingsForm=0; setupUi(this); - X2GoApplication::instance()->setWorkArea(this); + X2GoApplication::instance()->set_workArea(this); delete scrollArea->takeWidget(); QWidget* scrollWidget=new QWidget(scrollArea); scrollArea->setWidget(scrollWidget); @@ -54,10 +54,10 @@ WorkArea::WorkArea(QWidget* parent, Qt::WindowFlags f): QWidget( parent, f) scrollWidget->setFocusPolicy(Qt::NoFocus); sessionForm->hide(); - X2GoApplication::instance()->setSessionForm(sessionForm); - X2GoApplication::instance()->setProfileForm(profileForm); - X2GoApplication::instance()->setProfileSettingsForm(profileSettingsForm); - X2GoApplication::instance()->setProfileDetailConfiguratorForm(profileDetailConfiguratorForm); + X2GoApplication::instance()->set_sessionForm(sessionForm); + X2GoApplication::instance()->set_profileForm(profileForm); + X2GoApplication::instance()->set_profileSettingsForm(profileSettingsForm); + X2GoApplication::instance()->set_profileDetailConfiguratorForm(profileDetailConfiguratorForm); QTimer::singleShot(100, this, SLOT(slotResizeChildForms())); QTimer::singleShot(400, X2GoApplication::instance(), SLOT(slotInitProfiles())); diff --git a/workarea.h b/workarea.h index 2b67062..dc19f0c 100644 --- a/workarea.h +++ b/workarea.h @@ -33,7 +33,7 @@ class ProfileDetailConfiguratorForm; class WorkArea : public QWidget, public Ui_WorkArea { Q_OBJECT - X2GO_PROPERTY(bool, animateNextScroll, setAnimateNextScroll, getAnimateNextScroll) + X2GO_PROPERTY(bool, animateNextScroll) public: explicit WorkArea(QWidget* parent = 0, Qt::WindowFlags f = 0); QScrollArea* getScrollArea() diff --git a/x2goapplication.cpp b/x2goapplication.cpp index b4508ba..f388fd9 100644 --- a/x2goapplication.cpp +++ b/x2goapplication.cpp @@ -25,6 +25,7 @@ #include "profile.h" #include "profileform.h" #include "workarea.h" +#include "messagebox.h" #include <QScrollBar> X2GoApplication::X2GoApplication(int& argc, char** argv, int flags): QApplication(argc, argv, flags) @@ -101,18 +102,15 @@ void X2GoApplication::slotInitProfiles() for(int i=0; i<numProfiles; ++i) { Profile* profile=new Profile(profileForm->getScrollArea()->widget()); - profile->setPicture(pic); - profile->setServer("x2go.org"); - profile->setUser("user"); - profile->setDesktop("KDE"); - profile->setSSHPort(22); - profile->setProfileName("Example X2Go Profile - "+QString::number(i+1)); - profile->setSound(true); + profile->set_picture(pic); + profile->set_server("x2go.org"); + profile->set_user("user"); + profile->set_desktop("KDE"); + profile->set_SSHPort(22); + profile->set_profileName("Example X2Go Profile - "+QString::number(i+1)); + profile->set_sound(true); profiles<<profile; } -// profileForm->getScrollArea()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); -// emit signalUpdateProfiles(); -// profileForm->getScrollArea()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); emit signalUpdateProfiles(); } diff --git a/x2goapplication.h b/x2goapplication.h index 12401a4..7045353 100644 --- a/x2goapplication.h +++ b/x2goapplication.h @@ -22,12 +22,12 @@ #define X2GOAPPLICATION_H #include <QApplication> -#define X2GO_PROPERTY(TYPE,NAME,SET,GET) private: TYPE NAME; \ -public: void SET(TYPE val){NAME=val;} \ -public: TYPE GET(){return NAME;} +#define X2GO_PROPERTY(TYPE,NAME) private: TYPE NAME; \ +public: void set_##NAME(TYPE val){NAME=val;} \ +public: TYPE get_##NAME(){return NAME;} -#define X2GO_PROPERTY_GETTER(TYPE,NAME,GET) public: TYPE GET(){return NAME;} -#define X2GO_PROPERTY_SETTER(TYP,NAME,SET) public: void SET(TYPE val){NAME=val;} +#define X2GO_PROPERTY_GETTER(TYPE,NAME) public: TYPE get_##NAME(){return NAME;} +#define X2GO_PROPERTY_SETTER(TYP,NAME) public: void set_##NAME(TYPE val){NAME=val;} class SessionForm; @@ -47,13 +47,12 @@ struct nameTranslator class X2GoApplication: public QApplication { Q_OBJECT - X2GO_PROPERTY(ProfileForm*, profileForm, setProfileForm, getProfileForm) - X2GO_PROPERTY(WorkArea*, workArea, setWorkArea, getWorkArea) - X2GO_PROPERTY(ProfileSettingsForm*, profileSettingsForm, setProfileSettingsForm, getProfileSettingsForm) - X2GO_PROPERTY(SessionForm*, sessionForm, setSessionForm, getSessionForm) - X2GO_PROPERTY(MainWindow*, mainWindow, setMainWindow, getMainWindow) - X2GO_PROPERTY(ProfileDetailConfiguratorForm*, profileDetailConfiguratorForm, setProfileDetailConfiguratorForm, - getProfileDetailConfiguratorForm) + X2GO_PROPERTY(ProfileForm*, profileForm) + X2GO_PROPERTY(WorkArea*, workArea) + X2GO_PROPERTY(ProfileSettingsForm*, profileSettingsForm) + X2GO_PROPERTY(SessionForm*, sessionForm) + X2GO_PROPERTY(MainWindow*, mainWindow) + X2GO_PROPERTY(ProfileDetailConfiguratorForm*, profileDetailConfiguratorForm) public: ~X2GoApplication(); X2GoApplication(int& argc, char** argv, int = ApplicationFlags); diff --git a/x2goclient2.pro b/x2goclient2.pro index ff99272..d02c685 100755 --- a/x2goclient2.pro +++ b/x2goclient2.pro @@ -25,6 +25,7 @@ FORMS += mainwindow.ui \ configuratorsound.ui \ configuratorprinting.ui \ configuratorsharing.ui \ + messagebox.ui \ profile.ui SOURCES += main.cpp \ @@ -48,6 +49,7 @@ SOURCES += main.cpp \ configuratorsound.cpp \ configuratorprinting.cpp \ configuratorsharing.cpp \ + messagebox.cpp \ profile.cpp HEADERS += mainwindow.h \ @@ -70,6 +72,7 @@ HEADERS += mainwindow.h \ configuratorsound.h \ configuratorprinting.h \ configuratorsharing.h \ + messagebox.h \ profile.h LIBS += -lssh hooks/post-receive -- x2goclient2.git (X2Go Client 2 (rewrite of x2goclient.git)) This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "x2goclient2.git" (X2Go Client 2 (rewrite of x2goclient.git)).