From 3053a42d2854ba232e388228c61e0d253c0207e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 4 Sep 2008 13:38:11 +0000 Subject: [PATCH] Added Options widget ( forgot to check in earlier ) git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@2629 383ad7c9-94d9-4d36-a494-682f7c89f535 --- ACGMakefile | 1 + Core/Core.cc | 1 + Core/Core.hh | 6 +- Core/saveFunctions.cc | 2 + Icons/preferences-system.png | Bin 0 -> 4042 bytes widgets/ACGMakefile | 2 +- widgets/coreWidget/CoreWidget.cc | 15 ++++- widgets/coreWidget/CoreWidget.hh | 20 +++++++ widgets/coreWidget/MenuBar.cc | 11 ++++ widgets/optionsWidget/ACGMakefile | 17 ++++++ widgets/optionsWidget/optionsWidget.cc | 60 ++++++++++++++++++++ widgets/optionsWidget/optionsWidget.hh | 64 ++++++++++++++++++++++ widgets/optionsWidget/ui_optionsWidget.ui | 45 +++++++++++++++ 13 files changed, 239 insertions(+), 5 deletions(-) create mode 100644 Icons/preferences-system.png create mode 100644 widgets/optionsWidget/ACGMakefile create mode 100644 widgets/optionsWidget/optionsWidget.cc create mode 100644 widgets/optionsWidget/optionsWidget.hh create mode 100644 widgets/optionsWidget/ui_optionsWidget.ui diff --git a/ACGMakefile b/ACGMakefile index af72b909..af523c76 100644 --- a/ACGMakefile +++ b/ACGMakefile @@ -68,6 +68,7 @@ PROJ_LIBS += OpenFlipper/BasePlugin \ OpenFlipper/widgets/unloadPluginsWidget \ OpenFlipper/widgets/viewModeWidget \ OpenFlipper/widgets/addEmptyWidget \ + OpenFlipper/widgets/optionsWidget \ OpenFlipper/widgets/viewModeWidget MODULES := moc4 cxx diff --git a/Core/Core.cc b/Core/Core.cc index 81bc2411..468aa662 100644 --- a/Core/Core.cc +++ b/Core/Core.cc @@ -162,6 +162,7 @@ Core::init() { connect(coreWidget_, SIGNAL(saveToMenu()) , this, SLOT(slotSaveToMenu())); connect(coreWidget_, SIGNAL(loadIniMenu()) , this, SLOT(slotLoadIniMenu())); connect(coreWidget_, SIGNAL(saveIniMenu()) , this, SLOT(slotSaveIniMenu())); + connect(coreWidget_, SIGNAL(applyOptions()) , this, SLOT(applyOptions())); connect(coreWidget_, SIGNAL(recentOpen(QAction*)) , this, SLOT(slotRecentOpen(QAction*))); connect(coreWidget_, SIGNAL(exit()) , this, SLOT(slotExit())); diff --git a/Core/Core.hh b/Core/Core.hh index e19b7fdb..855c0f45 100644 --- a/Core/Core.hh +++ b/Core/Core.hh @@ -401,9 +401,6 @@ private: /// Get all ini files and set basic paths and options void setupOptions(); - /// after ini-files have been loaded and core is up -> apply Options - void applyOptions(); - /// Get and set Application options from ini file void readApplicationOptions(INIFile& _ini); @@ -412,6 +409,9 @@ private: public slots: + /// after ini-files have been loaded and core is up or if options have been changed -> apply Options + void applyOptions(); + /// Open an ini file and load everything in it ( Application/File Options ) void openIniFile(QString _filename); diff --git a/Core/saveFunctions.cc b/Core/saveFunctions.cc index 3ac7231b..9b6120c8 100644 --- a/Core/saveFunctions.cc +++ b/Core/saveFunctions.cc @@ -317,3 +317,5 @@ void Core::slotSaveIniMenu(){ } + + diff --git a/Icons/preferences-system.png b/Icons/preferences-system.png new file mode 100644 index 0000000000000000000000000000000000000000..06740ba1152ee681b57484017840f19c4acf6b29 GIT binary patch literal 4042 zcmV;*4>jg6-tX1NlE+qKj(hG`8t;~=N}=?>ALQ#`oHh} z{^x$*=eeKdV?^|S2Yx;P=96&4oKlP5*M6Dleyq~fQ=R9;@*91sw& zRF*ybM{)D!&C?1B3Yr=l8>zm&o=QqfDdYbACI<(H$$Zg!AfTY4qN2HL*RC||I^S`@ z@TX6o5;l;Ymp`Y9iV99b8Wj~)|J`@r6&V;9tirlZvIw-_vSrKWipol=Z)gx6kdKFD z=jPJBeICznT?3GR$GhKQ_UzfVAt4vJ@!07idiLxYy?F70s;a68MmM^tqrDhF!gSwWzeLOfWttFOL!u6X{||C@om9;25rV2ISrm0X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9Xjo~B)QElE#ssf2BNN(C`MpwUQ70b(>0qlP6zUvt~^`2sC3BN@&gnAgF~F5echANlA%k&;BjP+J*svg^e-$HQbFg z7heYn5Xm~l=xHP;p+U9T`Uq?lAx1I+p-@{{-IiI*L|EVQ%E!~w(+O(BeLj^>;Q%vW zzO%FQJ)XD_q&z{{O^LYs$S0)(b^bcrKqRkg-2Tl1QVtYXWk($tRW{9Cjk=KXBZWPfJAY7s?F3y*`Y`kL5zO; zp7{xJBogQasSM+Ojg#OPJ`^9SHhubZ2Lx*~CwJz|nL5ZTPgKKO8Lzi#Kw$bQ+aKh} z8XjH12}FYge821#0y|HE%5NxA)-hJWbIHpmpo!Ny&M1MoG#0_vb;L5D7XmgBB?3=W z+<13ciRvAaP!KoINKcDxKld%GeHaK5P^XehNO*9koMTMtV8wQbpu!?5Yw)0i&FW^Eu-(EY ziXPCiND0u!M9d8aH}J;%#EBCG^%0E6lx-&`2&l_QRPT#KS71~hHRkAJ&m`#Fe#ifd zfRQh6;(xS={9?Oy?Uvfw+J@m>Z8G}Z^Kx=>OT`h0x{O5izDaPKv;ck4@V-FDmpwq% w0&Tzum?#>q4RmSa{H86vx1uQ3%Ccshow(); - +} //============================================================================= diff --git a/widgets/coreWidget/CoreWidget.hh b/widgets/coreWidget/CoreWidget.hh index f595b0c4..29cd4976 100644 --- a/widgets/coreWidget/CoreWidget.hh +++ b/widgets/coreWidget/CoreWidget.hh @@ -67,6 +67,7 @@ #include +#include #include /** Type defining a currently loaded Plugin */ @@ -425,6 +426,25 @@ public: HelpWidget* helpBrowserUser_; /** @} */ + + //=========================================================================== + /** @name Options System + * @{ */ + //=========================================================================== + + public slots: + /// Display the Options Browser + void showOptionsWidget(); + + signals: + void applyOptions(); + + private: + + /// Pointer to the OptionsWidget + OptionsWidget* optionsWidget_; + + /** @} */ //=========================================================================== /** @name ToolBar controls diff --git a/widgets/coreWidget/MenuBar.cc b/widgets/coreWidget/MenuBar.cc index 5f511761..f8c9217a 100644 --- a/widgets/coreWidget/MenuBar.cc +++ b/widgets/coreWidget/MenuBar.cc @@ -157,6 +157,17 @@ void CoreWidget::setupMenuBar() AC_save_ini->setIcon(icon); connect(AC_save_ini, SIGNAL(triggered()), this, SIGNAL(saveIniMenu())); fileMenu_->addAction(AC_save_ini); + + fileMenu_->addSeparator(); + + //Options + QAction* AC_Options = new QAction(tr("&Options"), this); + AC_Options->setStatusTip(tr("Edit OpenFlipper Options")); + AC_Options->setWhatsThis("Edit OpenFlipper Options"); + icon.addFile(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"preferences-system.png"); + AC_Options->setIcon(icon); + connect(AC_Options, SIGNAL(triggered()), this, SLOT(showOptionsWidget())); + fileMenu_->addAction(AC_Options); //Remember entry of menu (required for adding File Menu entries from plugins) fileMenuEnd_ = fileMenu_->addSeparator(); diff --git a/widgets/optionsWidget/ACGMakefile b/widgets/optionsWidget/ACGMakefile new file mode 100644 index 00000000..ddce7616 --- /dev/null +++ b/widgets/optionsWidget/ACGMakefile @@ -0,0 +1,17 @@ +#== SYSTEM PART -- DON'T TOUCH ============================================== +include $(ACGMAKE)/Config +#============================================================================== + + +SUBDIRS = $(call find-subdirs) + +PACKAGES := qt4 glut opengl x11 math ACG2 openmesh2 + +PROJ_LIBS = + +MODULES := uic4 moc4 cxx + + +#== SYSTEM PART -- DON'T TOUCH ============================================== +include $(ACGMAKE)/Rules +#============================================================================== diff --git a/widgets/optionsWidget/optionsWidget.cc b/widgets/optionsWidget/optionsWidget.cc new file mode 100644 index 00000000..e004a62f --- /dev/null +++ b/widgets/optionsWidget/optionsWidget.cc @@ -0,0 +1,60 @@ +//============================================================================= +// +// OpenFlipper +// Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen +// www.openflipper.org +// +//----------------------------------------------------------------------------- +// +// License +// +// OpenFlipper is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// OpenFlipper 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with OpenFlipper. If not, see . +// +//----------------------------------------------------------------------------- +// +// $Revision: 1909 $ +// $Author: wilden $ +// $Date: 2008-06-03 18:45:21 +0200 (Tue, 03 Jun 2008) $ +// +//============================================================================= + + + + +#include "optionsWidget.hh" +#include +#include + +OptionsWidget::OptionsWidget( QWidget *parent) + : QWidget(parent) +{ + setupUi(this); + connect(applyButton,SIGNAL(clicked()),this,SLOT(slotApply())); + connect(cancelButton,SIGNAL(clicked()),this,SLOT(slotCancel())); +} + +void OptionsWidget::showEvent ( QShowEvent * event ) { + std::cerr << "Todo : Set Options in Widget" << std::endl; +} + +void OptionsWidget::slotApply() { + std::cerr << "Todo : Get Options from Widget and set them in the core" << std::endl; + emit applyOptions(); + hide(); +} + +void OptionsWidget::slotCancel() { + hide(); +} + diff --git a/widgets/optionsWidget/optionsWidget.hh b/widgets/optionsWidget/optionsWidget.hh new file mode 100644 index 00000000..364f964c --- /dev/null +++ b/widgets/optionsWidget/optionsWidget.hh @@ -0,0 +1,64 @@ +//============================================================================= +// +// OpenFlipper +// Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen +// www.openflipper.org +// +//----------------------------------------------------------------------------- +// +// License +// +// OpenFlipper is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// OpenFlipper 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with OpenFlipper. If not, see . +// +//----------------------------------------------------------------------------- +// +// $Revision: 1909 $ +// $Author: wilden $ +// $Date: 2008-06-03 18:45:21 +0200 (Tue, 03 Jun 2008) $ +// +//============================================================================= + + + + +#ifndef OPTIONSWIDGET_HH +#define OPTIONSWIDGET_HH + +#include "ui_optionsWidget.hh" +#include +#include + +class OptionsWidget : public QWidget, public Ui::OptionsWidget +{ + + Q_OBJECT + public: + OptionsWidget(QWidget *parent = 0 ); + + signals: + void applyOptions(); + + private slots: + /// Hide widget, Update Options and tell others about changed Options + void slotApply(); + + /// Only hide widget + void slotCancel(); + + protected: + void showEvent ( QShowEvent * event ); + +}; + +#endif //OPTIONSWIDGET_HH diff --git a/widgets/optionsWidget/ui_optionsWidget.ui b/widgets/optionsWidget/ui_optionsWidget.ui new file mode 100644 index 00000000..1a43df2f --- /dev/null +++ b/widgets/optionsWidget/ui_optionsWidget.ui @@ -0,0 +1,45 @@ + + OptionsWidget + + + + 0 + 0 + 290 + 404 + + + + Options + + + + + + TODO + + + + + + + + + Apply + + + + + + + Cancel + + + + + + + + + + -- GitLab