Commit 1aa31b9f authored by Jan Möbius's avatar Jan Möbius

Added scripting function to show or hide the view mode control box

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10413 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e0172ad1
......@@ -911,6 +911,14 @@ void Core::fullscreen( bool _state ) {
//-----------------------------------------------------------------------------
void Core::showViewModeControls( bool _show ) {
if ( OpenFlipper::Options::gui() ) {
coreWidget_->showViewModeControls(_show);
}
}
//-----------------------------------------------------------------------------
void Core::loggerState(int _state) {
OpenFlipper::Options::LoggerState state = static_cast<OpenFlipper::Options::LoggerState> (_state);
if ( OpenFlipper::Options::gui() &&
......@@ -1333,6 +1341,9 @@ void Core::setDescriptions(){
emit setSlotDescription("fullscreen(bool)", tr("Enable or disable fullscreen mode"),
QStringList(tr("enabled")) ,
QStringList(tr("Enable or disable fullscreen mode")));
emit setSlotDescription("showViewModeControls(bool)", tr("Show or hide the view mode control box"),
QStringList(tr("Show?")) ,
QStringList());
emit setSlotDescription("loggerState(int)", tr("Change the logger window state"), QStringList(tr("Change the logger window state")), QStringList());
emit setSlotDescription("showToolbox(bool)", tr("Show or hide toolbox"), QStringList(tr("Show or hide the toolbox")), QStringList());
emit setSlotDescription("multiViewMode(int)", tr("Switch MultiView Mode"),
......
......@@ -469,6 +469,9 @@ public slots:
/// set fullscreen mode
void fullscreen( bool _state );
/// Show or Hide the viewmode control widget.
void showViewModeControls( bool _show );
/// Change the logging window state
void loggerState(int _state);
......
......@@ -95,6 +95,7 @@
* * Core/Gui/glViewer/useMultipleViewers Use only one viewer or automatically generate multiple viewers (bool)\n
* * Core/Gui/ToolBoxes/hidden Hide the toolbox sidebar (bool)\n
* * Core/Gui/ToolBoxes/ToolBoxOnTheRight Toolbox on the right or on the left (bool)\n
* * Core/Gui/TaskSwitcher/Hide Show or Hide the task switcher(bool)\n
* * Core/Gui/LogWindow/LogWindowMode Log Window Mode .. 0 InScene, 1 Window, 2 Hidden (int)\n
* * Core/Gui/splash This setting controls if the splash screen is shown at startup(bool)\n
* * Core/Gui/fullscreen Show OpenFlipper in Fullscreen Mode(bool)\n
......
......@@ -58,7 +58,7 @@ namespace Viewer {
ViewerProperties::ViewerProperties():
currentDrawMode_(ACG::SceneGraph::DrawModes::NONE),
snapshotName_("snap.png"),
snapshotName_("snap"),
snapshotFileType_("png"),
snapshotCounter_(0),
wZoomFactor_(1.0),
......
......@@ -446,7 +446,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
toolBoxArea_ = new QWidget (toolSplitter_);
QGroupBox *gb = new QGroupBox (tr("ViewMode"));
viewModeControlBox_ = new QGroupBox (tr("ViewMode"));
QHBoxLayout *hLayout = new QHBoxLayout;
......@@ -455,7 +455,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
hLayout->addWidget(vmChangeButton_);
hLayout->addWidget(vmEditButton);
gb->setLayout (hLayout);
viewModeControlBox_->setLayout (hLayout);
connect(vmChangeButton_, SIGNAL(clicked()), this, SLOT(slotViewChangeDialog()));
connect(vmEditButton, SIGNAL(clicked()), this, SLOT(slotViewModeDialog()));
......@@ -467,8 +467,11 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
toolBoxScroll_->setFrameStyle (QFrame::StyledPanel);
QVBoxLayout *vLayout = new QVBoxLayout;
vLayout->addWidget(gb);
vLayout->addWidget(viewModeControlBox_);
vLayout->addWidget(toolBoxScroll_);
if ( OpenFlipperSettings().value("Core/Gui/TaskSwitcher/Hide",false).toBool() )
viewModeControlBox_->hide();
toolBoxArea_->setLayout (vLayout);
......@@ -650,6 +653,27 @@ CoreWidget::setFullscreen(bool _state ) {
show();
}
//-----------------------------------------------------------------------------
void
CoreWidget::showViewModeControls(bool _show) {
// Only change if the actual setting has changed!
if ( OpenFlipper::Options::gui() && ( !_show != OpenFlipperSettings().value("Core/Gui/TaskSwitcher/Hide",false).toBool() ) ) {
// Update setting in Conf storage
OpenFlipperSettings().setValue("Core/Gui/TaskSwitcher/Hide",!_show);
if ( _show ) {
viewModeControlBox_->show();
} else {
viewModeControlBox_->hide();
}
}
}
//-----------------------------------------------------------------------------
/** Hide or show logger
......
......@@ -437,6 +437,9 @@ public:
/// Set orientation of tool box (either on the right or the left side of the screen)
void setToolBoxOrientationOnTheRight(bool _toolBoxRight);
/// Hide or show the View Mode controls
void showViewModeControls(bool _show);
private slots:
/// Remove viewMode
......@@ -473,6 +476,9 @@ public:
///Spliter between toplevel objects and the textedit at the bottom
QSplitter* splitter_;
/// Group box containing Task Switcher Controls
QGroupBox *viewModeControlBox_;
/// Textedit at the bottom for log messages
LoggerWidget* logWidget_;
......
......@@ -2220,9 +2220,7 @@ void glViewer::snapshot( int _width, int _height, bool _alpha )
QFileInfo fi(properties_.snapshotName());
QString fname = fi.path() + QDir::separator() +fi.baseName() + "." + QString::number(properties_.snapshotCounter()) + ".";
fname += properties_.snapshotFileType();
QString fname = fi.path() + QDir::separator() +fi.baseName() + "." + QString::number(properties_.snapshotCounter()) + "." + properties_.snapshotFileType();
bool rval=image.save(fname,properties_.snapshotFileType().toUpper().toLatin1());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment