Commit 2174da27 authored by Dirk Wilden's avatar Dirk Wilden

fixed fullscreen/toolbar/logger options

moved standardDrawMode to globaloptions

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@2899 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7ab14ab7
......@@ -102,7 +102,6 @@ Core::
Core() :
QObject(),
nextBackupId_(0),
standard_draw_mode_(ACG::SceneGraph::DrawModes::SOLID_SMOOTH_SHADED),
set_random_base_color_(true),
coreWidget_(0)
{
......
......@@ -620,9 +620,6 @@ private:
/// Id for the next backup
int nextBackupId_;
/// Standard draw mode
unsigned int standard_draw_mode_;
/// Use white or a random color for new objects
bool set_random_base_color_;
......
......@@ -182,6 +182,13 @@ void Core::readApplicationOptions(INIFile& _ini) {
if ( _ini.get_entry( hideLogger, "Options" , "HideLogger") )
OpenFlipper::Options::hideLogger(hideLogger);
//============================================================================
// Load the setting for the toolbox window
//============================================================================
bool hideToolbox = false;
if ( _ini.get_entry( hideToolbox, "Options" , "HideToolbox") )
OpenFlipper::Options::hideToolbox(hideToolbox);
//============================================================================
// Load the setting for the fullscreen option
//============================================================================
......@@ -201,7 +208,7 @@ void Core::readApplicationOptions(INIFile& _ini) {
//============================================================================
std::vector< QString > draw_modes;
if( _ini.get_entry(draw_modes, "Options", "StandardDrawModes") )
standard_draw_mode_ = ListToDrawMode(draw_modes);
OpenFlipper::Options::standardDrawMode( ListToDrawMode(draw_modes) );
//============================================================================
// Load logFile status
......@@ -337,13 +344,14 @@ void Core::writeApplicationOptions(INIFile& _ini) {
// Save the current draw modes
//============================================================================
std::vector< QString > draw_modes;
draw_modes = drawModeToList( coreWidget_->examiner_widget_->drawMode() );
draw_modes = drawModeToList( OpenFlipper::Options::standardDrawMode() );
_ini.add_entry("Options","StandardDrawModes",draw_modes);
_ini.add_entry("Options","HideLogger",(coreWidget_->splitter_->sizes())[1] == 0 );
_ini.add_entry("Options","HideLogger", OpenFlipper::Options::hideLogger() );
_ini.add_entry("Options","HideToolbox", OpenFlipper::Options::hideToolbox() );
// check if we are in fullscreen mode:
_ini.add_entry("Options","FullScreen", bool(coreWidget_->windowFlags() & Qt::FramelessWindowHint) );
_ini.add_entry("Options","FullScreen", OpenFlipper::Options::fullScreen() );
}
_ini.add_entry("Options","Stereo",OpenFlipper::Options::stereo() );
......
......@@ -53,7 +53,7 @@ void Core::resetScenegraph() {
coreWidget_->examiner_widget_->scene_radius() /* 10.0*/ );
coreWidget_->examiner_widget_->setHome();
coreWidget_->examiner_widget_->drawMode(standard_draw_mode_);
coreWidget_->examiner_widget_->drawMode( OpenFlipper::Options::standardDrawMode() );
coreWidget_->examiner_widget_->unlockUpdate();
coreWidget_->examiner_widget_->updateGL();
}
......
......@@ -65,16 +65,10 @@ void Core::applyOptions(){
if ( OpenFlipper::Options::fullScreen() )
coreWidget_->setWindowState( coreWidget_->windowState() | Qt::WindowFullScreen);
else
coreWidget_->setWindowState( (coreWidget_->windowState() | Qt::WindowFullScreen) ^ Qt::WindowFullScreen);
//Hide Logger
if (OpenFlipper::Options::hideLogger()) {
QList<int> wsizes( coreWidget_->splitter_->sizes() );
wsizes[0] = wsizes[0]+wsizes[1];
wsizes[1] = 0;
coreWidget_->splitter_->setSizes(wsizes);
}
coreWidget_->setWindowState( (coreWidget_->windowState() | Qt::WindowFullScreen) ^ Qt::WindowFullScreen);
// Logger
coreWidget_->hideLogger( OpenFlipper::Options::hideLogger() );
//animation
coreWidget_->examiner_widget_->animation(OpenFlipper::Options::animation());
......
......@@ -42,6 +42,7 @@
#include "GlobalOptions.hh"
#include <stdlib.h>
#include <ACG/Scenegraph/DrawModes.hh>
namespace OpenFlipper {
......@@ -98,6 +99,9 @@ static bool restrictFrameRate_ = false;
/// Store the maxFrameRate_ mode
static int maxFrameRate_ = 35;
/// Store the standardDrawMode_ mode
static uint standardDrawMode_ = ACG::SceneGraph::DrawModes::SOLID_SMOOTH_SHADED;
/// Store the toolbox gui Mode mode
static bool hideToolbox_ = false;
......@@ -365,6 +369,14 @@ int maxFrameRate(){
return maxFrameRate_;
}
void standardDrawMode( uint _mode ){
standardDrawMode_ = _mode;
}
uint standardDrawMode(){
return standardDrawMode_;
}
/// Set if we start the logging widget closed
void hideLogger( bool _hide) {
hideLogger_ = _hide;
......
......@@ -325,6 +325,14 @@ bool iconDir(QString _dir);
DLLEXPORT
int maxFrameRate( );
/// Store standardDrawMode setting
DLLEXPORT
void standardDrawMode( uint _mode );
/// get standardDrawMode setting
DLLEXPORT
uint standardDrawMode( );
/** @} */
//===========================================================================
......
......@@ -101,6 +101,8 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
textedit_->resize( splitter_->width() ,120);
textedit_->setLineWrapMode( QTextEdit::NoWrap );
originalLoggerSize_ = 0;
QList<int> wsizes( splitter_->sizes() );
if (OpenFlipper::Options::hideLogger()) {
wsizes[1] = 0;
......@@ -277,9 +279,11 @@ CoreWidget::~CoreWidget() {
*/
void
CoreWidget::toggleFullscreen() {
setWindowFlags( windowFlags () ^ Qt::FramelessWindowHint) ;
OpenFlipper::Options::fullScreen( bool( windowFlags () | Qt::FramelessWindowHint) );
resize(QApplication::desktop()->size());
setWindowState( windowState() ^ Qt::WindowFullScreen);
OpenFlipper::Options::fullScreen( bool( windowState() & Qt::WindowFullScreen) );
show();
}
......@@ -292,8 +296,16 @@ CoreWidget::toggleLogger() {
// toggle
OpenFlipper::Options::hideLogger( !OpenFlipper::Options::hideLogger() );
// Hide/Show Logger
hideLogger( OpenFlipper::Options::hideLogger() );
}
/** Hide or show logger
*/
void
CoreWidget::hideLogger(bool _hide) {
//Hide Logger
if ( OpenFlipper::Options::hideLogger() ) {
if ( _hide ) {
QList<int> wsizes( splitter_->sizes() );
// Remember old size
......@@ -308,6 +320,10 @@ CoreWidget::toggleLogger() {
originalLoggerSize_ = 240;
QList<int> wsizes( splitter_->sizes() );
if (wsizes[0] == 0)
wsizes[0] = height();
wsizes[0] = wsizes[0]+wsizes[1] - originalLoggerSize_;
wsizes[1] = originalLoggerSize_;
splitter_->setSizes(wsizes);
......
......@@ -205,6 +205,9 @@ public:
/// Hide or show logging area
void toggleLogger();
/// Change visibility of the logger
void hideLogger(bool _hide);
/// Hide or show toolbox area
void toggleToolbox();
......
......@@ -84,6 +84,9 @@ void OptionsWidget::showEvent ( QShowEvent * event ) {
restrictFPS->setChecked( OpenFlipper::Options::restrictFrameRate() );
FPS->setValue( OpenFlipper::Options::maxFrameRate() );
//set drawmodes
//keyBindings
keyTree->clear();
......
......@@ -281,6 +281,21 @@
<property name="statusTip" >
<string>Set the default drawMode for the viewer</string>
</property>
<item>
<property name="text" >
<string>New Item</string>
</property>
</item>
<item>
<property name="text" >
<string>New Item</string>
</property>
</item>
<item>
<property name="text" >
<string>ssdsf</string>
</property>
</item>
</widget>
<widget class="QLabel" name="label_7" >
<property name="geometry" >
......@@ -320,6 +335,12 @@
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<item>
<widget class="QCheckBox" name="restrictFPS" >
<property name="toolTip" >
<string>restrict maximum framerate</string>
</property>
<property name="statusTip" >
<string>restrict maximum framerate</string>
</property>
<property name="text" >
<string>Restrict Framerate</string>
</property>
......@@ -343,6 +364,12 @@
<property name="enabled" >
<bool>false</bool>
</property>
<property name="toolTip" >
<string>maximum framerate</string>
</property>
<property name="statusTip" >
<string>maximum framerate</string>
</property>
<property name="minimum" >
<number>1</number>
</property>
......
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