From 33561a979d3f8dfbe91d54fc8d095c02a4ee42d1 Mon Sep 17 00:00:00 2001 From: Dirk Wilden Date: Thu, 18 Sep 2008 17:15:50 +0000 Subject: [PATCH] drawmodes git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@2905 383ad7c9-94d9-4d36-a494-682f7c89f535 --- widgets/optionsWidget/optionsWidget.cc | 61 ++- widgets/optionsWidget/ui_optionsWidget.ui | 443 ++++++++++------------ 2 files changed, 259 insertions(+), 245 deletions(-) diff --git a/widgets/optionsWidget/optionsWidget.cc b/widgets/optionsWidget/optionsWidget.cc index 37e3ca80..a46eb3ad 100644 --- a/widgets/optionsWidget/optionsWidget.cc +++ b/widgets/optionsWidget/optionsWidget.cc @@ -35,6 +35,8 @@ #include "optionsWidget.hh" #include #include +#include +#include OptionsWidget::OptionsWidget(std::vector& _plugins, std::vector& _core, QWidget *parent) : QWidget(parent), @@ -48,6 +50,39 @@ OptionsWidget::OptionsWidget(std::vector& _plugins, std::vectorsetIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"arrow-right.png") ); + remButton->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"arrow-left.png") ); + + uint mode = 2; + for (uint i=1; i < 22; i++) { + std::vector< QString > dm = drawModeToList( mode ); + + if (dm[0].trimmed() != ""){ + QListWidgetItem* item = new QListWidgetItem(dm[0]); + + item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsSelectable); + item->setCheckState(Qt::Unchecked); + + availDrawModes->addItem( item ); +break; +// QListWidgetItem* item2 = new QListWidgetItem(dm[0]); +// item2->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsSelectable); +// item2->setCheckState(Qt::Unchecked); +// availDrawModes->addItem( item2 ); +// break; + } + mode = mode<<1; + } + + //Check the drawModes from StandardDrawMode +// std::vector< QString > dm = drawModeToList( OpenFlipper::Options::standardDrawMode() ); +// +// for (uint i=0; i < dm.size(); i++){ +// QList found availDrawModes->findItems(dm[i],Qt::MatchExactly); +// for(int k=0; k < found.count(); k++) +// (found[k])->setCheckState(Qt::Checked); +// } http = new QHttp(this); @@ -115,9 +150,11 @@ void OptionsWidget::showEvent ( QShowEvent * event ) { QList plugins; + int off = 0; + for (uint i=0; i < plugins_.size(); i++){ -// if (plugins_[i].keys.count() == 0) -// continue; +// if (( (plugins_[i]).keys).size() == 0) +// continue; plugins.append(new QTreeWidgetItem(keyTree, QStringList( plugins_[i].name ))); @@ -127,11 +164,16 @@ void OptionsWidget::showEvent ( QShowEvent * event ) { QStringList row; QKeySequence keySequence( plugins_[i].keys[k].key + plugins_[i].keys[k].modifiers ); row << plugins_[i].keys[k].description << keySequence.toString(); - keys.append(new QTreeWidgetItem(plugins[i], row)); + keys.append(new QTreeWidgetItem(plugins[i-off], row)); } - plugins[i]->addChildren(keys); - + if (keys.count() > 0) + plugins[i-off]->addChildren(keys); + else{ + delete plugins[i-off]; + plugins.removeLast(); + off++; + } } if (plugins.count() > 0) @@ -160,6 +202,15 @@ void OptionsWidget::slotApply() { OpenFlipper::Options::restrictFrameRate( restrictFPS->isChecked() ); OpenFlipper::Options::maxFrameRate( FPS->value() ); + //standardDrawMode + std::vector< QString > mode; + + for (int i=0; i < availDrawModes->count(); i++) + if (availDrawModes->item(i)->checkState() == Qt::Checked) + mode.push_back( availDrawModes->item(i)->text() ); + + OpenFlipper::Options::standardDrawMode( ListToDrawMode(mode) ); + emit applyOptions(); emit saveOptions(); hide(); diff --git a/widgets/optionsWidget/ui_optionsWidget.ui b/widgets/optionsWidget/ui_optionsWidget.ui index b8a2872d..4d33dff6 100644 --- a/widgets/optionsWidget/ui_optionsWidget.ui +++ b/widgets/optionsWidget/ui_optionsWidget.ui @@ -5,8 +5,8 @@ 0 0 - 567 - 487 + 501 + 480 @@ -32,8 +32,8 @@ 0 0 - 545 - 409 + 644 + 606 @@ -132,8 +132,8 @@ 0 0 - 545 - 409 + 644 + 606 @@ -164,237 +164,217 @@ 0 0 - 545 - 409 + 479 + 402 Viewer - - - - 20 - 170 - 344 - 21 - - - - Enable backface culling - - - Enable backface culling - - - Backface culling - - - - - - 9 - 36 - 143 - 20 - - - - MouseWheel Zoomfactor: - - - - - - 192 - 36 - 100 - 22 - - - - - 100 - 16777215 - - - - Set the factor to control the zooming with the mouse-wheel - - - Set the factor to control the zooming with the mouse-wheel - - - 9.99; - - - - - - 9 - 64 - 177 - 20 - - - - MouseWheel Zoomfactor (shift): - - - - - - 192 - 64 - 100 - 22 - - - - - 100 - 16777215 - - - - Set the factor to control the zooming with the mouse-wheel while the shift key is pressed - - - Set the factor to control the zooming with the mouse-wheel while the shift key is pressed - - - 9.99; - - - - - - 192 - 92 - 344 - 22 - - - - Set the default drawMode for the viewer - - - Set the default drawMode for the viewer - + - - New Item - + + + Mouse Wheel + + + + + + MouseWheel Zoomfactor: + + + + + + + + 100 + 16777215 + + + + Set the factor to control the zooming with the mouse-wheel + + + Set the factor to control the zooming with the mouse-wheel + + + 9.99; + + + + + + + MouseWheel Zoomfactor (shift): + + + + + + + + 100 + 16777215 + + + + Set the factor to control the zooming with the mouse-wheel while the shift key is pressed + + + Set the factor to control the zooming with the mouse-wheel while the shift key is pressed + + + 9.99; + + + + + - - New Item - + + + DrawMode + + + + + + + + Available DrawModes: + + + + + + + + + + + + + + ... + + + + + + + ... + + + + + + + + + + + Standard DrawMode: + + + + + + + + + + - - ssdsf - + + + Other + + + + + + + + restrict maximum framerate + + + restrict maximum framerate + + + Restrict Framerate + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + maximum framerate + + + maximum framerate + + + 1 + + + 200 + + + + + + + FPS + + + + + + + + + Enable backface culling + + + Enable backface culling + + + Backface culling + + + + + - - - - - 9 - 92 - 107 - 20 - - - - Default DrawMode: - - - - - - 25 - 120 - 511 - 20 - - - - Qt::Horizontal - - - - - - 20 - 140 - 219 - 24 - - - - - - - restrict maximum framerate - - - restrict maximum framerate - - - Restrict Framerate - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - false - - - maximum framerate - - - maximum framerate - - - 1 - - - 200 - - - - - - - FPS - - - - - + 0 0 - 545 - 409 + 479 + 402 @@ -417,8 +397,8 @@ 0 0 - 545 - 409 + 644 + 606 @@ -566,22 +546,5 @@ - - - restrictFPS - toggled(bool) - FPS - setEnabled(bool) - - - 115 - 187 - - - 187 - 184 - - - - + -- GitLab