Commit 231563f6 authored by Dirk Wilden's avatar Dirk Wilden

moved acghelper to pluginlib

windowStates and geometry is now stored 

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@3222 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 3196d319
...@@ -418,6 +418,30 @@ Core::init() { ...@@ -418,6 +418,30 @@ Core::init() {
applyOptions(); applyOptions();
if ( OpenFlipper::Options::gui() ) { if ( OpenFlipper::Options::gui() ) {
//try to restore the windowState
QFile file(QDir::home().absolutePath() + OpenFlipper::Options::dirSeparator() + ".OpenFlipper" +
OpenFlipper::Options::dirSeparator() + "windowState.dat");
if (file.open(QIODevice::ReadOnly)){
QByteArray bytes = file.readAll();
coreWidget_->restoreState( bytes );
file.close();
}
//try to restore the geometry
QFile file2(QDir::home().absolutePath() + OpenFlipper::Options::dirSeparator() + ".OpenFlipper" +
OpenFlipper::Options::dirSeparator() + "geometry.dat");
if (file2.open(QIODevice::ReadOnly)){
QByteArray bytes = file2.readAll();
coreWidget_->restoreGeometry( bytes );
file2.close();
}
coreWidget_->show(); coreWidget_->show();
if ( OpenFlipper::Options::splash() ) { if ( OpenFlipper::Options::splash() ) {
...@@ -674,6 +698,24 @@ Core::writeOnExit() { ...@@ -674,6 +698,24 @@ Core::writeOnExit() {
ini.disconnect(); ini.disconnect();
} }
//store the windowState
if ( OpenFlipper::Options::gui() ) {
QFile file(QDir::home().absolutePath() + OpenFlipper::Options::dirSeparator() + ".OpenFlipper" +
OpenFlipper::Options::dirSeparator() + "windowState.dat");
if (file.open(QIODevice::WriteOnly))
{
file.write( coreWidget_->saveState() );
file.close();
}
QFile file2(QDir::home().absolutePath() + OpenFlipper::Options::dirSeparator() + ".OpenFlipper" +
OpenFlipper::Options::dirSeparator() + "geometry.dat");
if (file2.open(QIODevice::WriteOnly))
{
file2.write( coreWidget_->saveGeometry() );
file2.close();
}
}
// Call exit for all plugins // Call exit for all plugins
for (uint i = 0 ; i < plugins.size() ; ++i) { for (uint i = 0 ; i < plugins.size() ; ++i) {
BaseInterface* basePlugin = qobject_cast< BaseInterface * >(plugins[i].plugin); BaseInterface* basePlugin = qobject_cast< BaseInterface * >(plugins[i].plugin);
......
...@@ -553,7 +553,8 @@ void Core::loadPlugin(QString filename, bool silent){ ...@@ -553,7 +553,8 @@ void Core::loadPlugin(QString filename, bool silent){
widget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum); widget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum);
widget->setMinimumWidth(300); widget->setMinimumWidth(300);
widget->setMaximumWidth(600); widget->setMaximumWidth(600);
dock->setObjectName( "ToolWidget" + QString::number(toolboxindex_++) );
coreWidget_->setDockOptions(QMainWindow::AllowTabbedDocks | QMainWindow::VerticalTabs); coreWidget_->setDockOptions(QMainWindow::AllowTabbedDocks | QMainWindow::VerticalTabs);
coreWidget_->addDockWidget(Qt::RightDockWidgetArea,dock); coreWidget_->addDockWidget(Qt::RightDockWidgetArea,dock);
......
...@@ -11,7 +11,7 @@ openmesh() ...@@ -11,7 +11,7 @@ openmesh()
glut() glut()
glew() glew()
DIRECTORIES = ../ ../ACGHelper ../Core ../Logging \ DIRECTORIES = ../ ../Core ../Logging \
../Scripting ../Scripting/scriptPrototypes ../Scripting/scriptWrappers ../SimpleOpt \ ../Scripting ../Scripting/scriptPrototypes ../Scripting/scriptWrappers ../SimpleOpt \
../widgets/addEmptyWidget ../widgets/coreWidget ../widgets/helpBrowser \ ../widgets/addEmptyWidget ../widgets/coreWidget ../widgets/helpBrowser \
../widgets/loadWidget ../widgets/optionsWidget ../widgets/unloadPluginsWidget \ ../widgets/loadWidget ../widgets/optionsWidget ../widgets/unloadPluginsWidget \
......
...@@ -12,7 +12,7 @@ glut() ...@@ -12,7 +12,7 @@ glut()
glew() glew()
openmp() openmp()
DIRECTORIES = ../BasePlugin ../common ../common/bsp ../INIFile $$files( $${TOPDIR}/ObjectTypes/* ) DIRECTORIES = ../BasePlugin ../ACGHelper ../common ../common/bsp ../INIFile $$files( $${TOPDIR}/ObjectTypes/* )
# Input # Input
HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
......
...@@ -139,6 +139,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -139,6 +139,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
// ====================================================================== // ======================================================================
mainToolbar_ = new QToolBar("Main Toolbar"); mainToolbar_ = new QToolBar("Main Toolbar");
mainToolbar_->setObjectName("MainToolbar");
addToolBar(mainToolbar_); addToolBar(mainToolbar_);
// ====================================================================== // ======================================================================
...@@ -151,6 +152,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -151,6 +152,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
viewerToolbar_->setParent(this); viewerToolbar_->setParent(this);
viewerToolbar_->setAllowedAreas(Qt::AllToolBarAreas); viewerToolbar_->setAllowedAreas(Qt::AllToolBarAreas);
viewerToolbar_->setIconSize(QSize(20,20)); viewerToolbar_->setIconSize(QSize(20,20));
viewerToolbar_->setObjectName("ViewerToolbar");
// Set our own Icons // Set our own Icons
QList<QAction *> actions = viewerToolbar_->actions(); QList<QAction *> actions = viewerToolbar_->actions();
...@@ -231,6 +233,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -231,6 +233,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
// Create Upper DockWidget for ToolWidget control // Create Upper DockWidget for ToolWidget control
// ====================================================================== // ======================================================================
dockViewMode_ = new QDockWidget("ViewMode" , this ); dockViewMode_ = new QDockWidget("ViewMode" , this );
dockViewMode_->setObjectName("DockViewMode");
QPushButton* button = new QPushButton("Change View Mode"); QPushButton* button = new QPushButton("Change View Mode");
dockViewMode_->setWidget(button); dockViewMode_->setWidget(button);
button->setParent(dockViewMode_); button->setParent(dockViewMode_);
......
...@@ -344,6 +344,8 @@ public: ...@@ -344,6 +344,8 @@ public:
//=========================================================================== //===========================================================================
private: private:
QToolBar* viewerToolbar_; QToolBar* viewerToolbar_;
int toolbarCount_;
/** @} */ /** @} */
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
void CoreWidget::slotAddToolbar(QToolBar* _toolbar) { void CoreWidget::slotAddToolbar(QToolBar* _toolbar) {
addToolBar( _toolbar ); addToolBar( _toolbar );
_toolbar->setObjectName("Toolbar" + QString::number(toolbarCount_++));
} }
void CoreWidget::slotRemoveToolbar(QToolBar* _toolbar) { void CoreWidget::slotRemoveToolbar(QToolBar* _toolbar) {
......
...@@ -50,7 +50,7 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB ...@@ -50,7 +50,7 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
connect(applyButton,SIGNAL(clicked()),this,SLOT(slotApply())); connect(applyButton,SIGNAL(clicked()),this,SLOT(slotApply()));
connect(cancelButton,SIGNAL(clicked()),this,SLOT(slotCancel())); connect(cancelButton,SIGNAL(clicked()),this,SLOT(slotCancel()));
connect(checkUpdateButton,SIGNAL(clicked()),this,SLOT(slotCheckUpdates())); connect(checkUpdateButton,SIGNAL(clicked()),this,SLOT(slotCheckUpdates()));
connect( restrictFPS, SIGNAL(toggled(bool)), FPS, SLOT(setEnabled(bool)) );
uint mode = 2; uint mode = 2;
for (uint i=1; i < 22; i++) { for (uint i=1; i < 22; i++) {
std::vector< QString > dm = drawModeToDescriptions( mode ); std::vector< QString > dm = drawModeToDescriptions( mode );
...@@ -182,7 +182,7 @@ void OptionsWidget::showEvent ( QShowEvent * event ) { ...@@ -182,7 +182,7 @@ void OptionsWidget::showEvent ( QShowEvent * event ) {
availDrawModes->item( i )->setCheckState(Qt::Unchecked) ; availDrawModes->item( i )->setCheckState(Qt::Unchecked) ;
//Check the drawModes from StandardDrawMode //Check the drawModes from StandardDrawMode
std::vector< QString > dm = drawModeToList( OpenFlipper::Options::standardDrawMode() ); std::vector< QString > dm = drawModeToDescriptions( OpenFlipper::Options::standardDrawMode() );
for (uint i=0; i < dm.size(); i++){ for (uint i=0; i < dm.size(); i++){
if ( !dm.empty() ) { if ( !dm.empty() ) {
......
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