48 #include <OpenFlipper/widgets/viewModeWidget/viewModeWidget.hh> 49 #include <OpenFlipper/widgets/viewModeWidget/viewModeChangeWidget.hh> 66 bool seenCustom =
false;
77 QAction* acViewMode =
new QAction(
viewModes_[i]->name,
this);
78 acViewMode->setStatusTip(tr(
"Change ViewMode"));
101 for (
int i = 0 ; i <
viewModes_.size(); i++) {
113 vm->
icon =
"Unknown.png";
115 vm->
visibleToolbars = QString(
"Main Toolbar;Viewer Toolbar").split(
";");
148 for (
int i = 0 ; i <
viewModes_.size(); i++) {
160 vm->
icon =
"Unknown.png";
183 if ( ! _usedToolbars.contains(
"Viewer Toolbar") )
184 _usedToolbars.prepend(
"Viewer Toolbar");
187 if ( ! _usedToolbars.contains(
"Main Toolbar") )
188 _usedToolbars.prepend(
"Main Toolbar");
204 for (
int i = 0 ; i <
viewModes_.size(); i++) {
216 vm->
icon =
"Unknown.png";
218 vm->
visibleToolbars = QString(
"Main Toolbar;Viewer Toolbar").split(
";");
253 for (
int i = 0 ; i <
viewModes_.size(); i++) {
265 vm->
icon = _iconName;
287 vm->
icon = _iconName;
317 slotChangeView(_mode, QStringList(), QStringList(), QStringList(), _expandAll);
332 widget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
333 connect(widget, SIGNAL(changeView(QString, QStringList, QStringList, QStringList)),
this, SLOT(
slotChangeView(QString, QStringList, QStringList, QStringList)) );
334 connect(widget, SIGNAL(saveMode(QString,
bool, QStringList, QStringList, QStringList)),
this, SLOT(
slotAddViewModeComplete(QString,
bool, QStringList, QStringList, QStringList)) );
335 connect(widget, SIGNAL(removeMode(QString)),
this, SLOT(
slotRemoveViewMode(QString)) );
337 widget->
show( OpenFlipper::Options::currentViewMode() );
347 void CoreWidget::slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus,
bool _expandAll ){
350 if (_mode !=
"" && _toolboxWidgets.size() == 0 && _toolbars.size() == 0)
353 _toolboxWidgets =
viewModes_[i]->visibleToolboxes;
355 _contextmenus =
viewModes_[i]->visibleContextMenus;
360 if (_mode != OpenFlipper::Options::currentViewMode()) {
366 for (
int i=0; i < _toolboxWidgets.size(); i++) {
367 for (uint p=0; p <
plugins().size(); p++){
368 for ( uint j = 0 ; j <
plugins()[p].toolboxWidgets.size(); ++j )
369 if (_toolboxWidgets[i] ==
plugins()[p].toolboxWidgets[j].first ) {
384 if (i < toolBox_->lastPos_) {
391 if (
plugins()[p].name ==
"Scripting") {
393 QFile statesFile(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"WindowStates.dat");
395 if (statesFile.exists() ) {
396 QSettings windowStates(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() +
"WindowStates.dat", QSettings::IniFormat);
399 windowStates.beginGroup (
"Core");
400 windowStates.beginGroup(
"SideArea");
401 windowStates.beginGroup(_toolboxWidgets[i]);
402 bool active = windowStates.value (
"Active",
false).toBool();
403 windowStates.endGroup();
404 windowStates.endGroup();
405 windowStates.endGroup();
415 if (_mode != OpenFlipper::Options::currentViewMode()) {
425 for (uint p=0; p <
plugins().size(); p++)
426 for ( uint j = 0 ; j <
plugins()[p].toolbars.size(); ++j )
427 if (_toolbars.contains(
plugins()[p].toolbars[j].first ) )
428 plugins()[p].toolbars[j].second->show();
430 plugins()[p].toolbars[j].second->hide();
434 if ( _toolbars.contains(tr(
"Main Toolbar")) )
440 if ( _toolbars.contains(tr(
"Viewer Toolbar")) )
448 OpenFlipper::Options::currentViewMode(_mode);
465 if(!OpenFlipper::Options::glStereo()) {
468 stereoSettingsWidget_->stereoOpengl->setChecked(OpenFlipper::Options::stereoMode() == OpenFlipper::Options::OpenGL);
472 stereoSettingsWidget_->stereoAnaglyph->setChecked(OpenFlipper::Options::stereoMode() == OpenFlipper::Options::AnaglyphRedCyan);
473 stereoSettingsWidget_->stereoCustomAnaglyph->setChecked(OpenFlipper::Options::stereoMode() == OpenFlipper::Options::AnaglyphCustom);
489 OpenFlipper::Options::stereoMode(OpenFlipper::Options::AnaglyphCustom);
493 OpenFlipper::Options::stereoMode(OpenFlipper::Options::AnaglyphRedCyan);
496 OpenFlipper::Options::stereoMode(OpenFlipper::Options::OpenGL);
505 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i) {
void setElementActive(QString _name, bool _active)
set the active state of given element
QStringList visibleContextMenus
List of context Menus in this view mode.
ViewMode struct This struct contains a ViewMode and its status information such as used widgets...
QString name
Name of the View Mode.
void moveItemToPosition(const QString &_name, int _position)
Move a toolbox widget to a given position.
void addItem(QObject const *const _plugin, QWidget *_w, QString _name, QIcon *_icon=0, QWidget *_headerAreaWidget=0)
int getNumberOfWidgets() const
Get number of widgets.
QStringList visibleToolboxes
List of Visible Toolboxes in this view mode.
QStringList visibleToolbars
List of Toolbars in this view mode.
void restoreViewModeState(const QString &_viewMode)
restores the active state of _viewMode
void clear()
clears the whole tool widget area
bool custom
Is this a user defined custom view mode or a plugin generated one.
const QList< const QObject * > & plugins()
Get plugins in side area.
void setValue(const QString &key, const QVariant &value)
Wrapper function which makes it possible to enable Debugging output with -DOPENFLIPPER_SETTINGS_DEBUG...
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
void saveViewModeState(const QString &_viewMode)
saves the active state of _viewMode
const QStringList & names()
Get item names.