Commit 7439750d authored by Jan Möbius's avatar Jan Möbius

Fixed draw Modes in options widget

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@2922 383ad7c9-94d9-4d36-a494-682f7c89f535
parent fe37d3e7
...@@ -50,39 +50,22 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB ...@@ -50,39 +50,22 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
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()));
//setup drawmodes
addButton->setIcon( 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; uint mode = 2;
for (uint i=1; i < 22; i++) { for (uint i=1; i < 22; i++) {
std::vector< QString > dm = drawModeToList( mode ); std::vector< QString > dm = drawModeToList( mode );
if (dm[0].trimmed() != ""){ if ( !dm.empty() && dm[0].trimmed() != ""){
QListWidgetItem* item = new QListWidgetItem(dm[0]); QListWidgetItem* item = new QListWidgetItem(dm[0]);
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsSelectable); item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsSelectable);
item->setCheckState(Qt::Unchecked); item->setCheckState(Qt::Unchecked);
availDrawModes->addItem( item ); 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; 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<QListWidgetItem *> found availDrawModes->findItems(dm[i],Qt::MatchExactly);
// for(int k=0; k < found.count(); k++)
// (found[k])->setCheckState(Qt::Checked);
// }
http = new QHttp(this); http = new QHttp(this);
...@@ -183,6 +166,21 @@ void OptionsWidget::showEvent ( QShowEvent * event ) { ...@@ -183,6 +166,21 @@ void OptionsWidget::showEvent ( QShowEvent * event ) {
keyTree->addTopLevelItems( plugins ); keyTree->addTopLevelItems( plugins );
keyTree->setColumnWidth(0,350); keyTree->setColumnWidth(0,350);
for (int i = 0 ; i < availDrawModes->count(); ++i )
availDrawModes->item( i )->setCheckState(Qt::Unchecked) ;
//Check the drawModes from StandardDrawMode
std::vector< QString > dm = drawModeToList( OpenFlipper::Options::standardDrawMode() );
for (uint i=0; i < dm.size(); i++){
if ( !dm.empty() ) {
QList< QListWidgetItem* > found = availDrawModes->findItems(dm[i],Qt::MatchExactly);
for(int k=0; k < found.count(); k++)
(found[k])->setCheckState(Qt::Checked);
}
}
} }
void OptionsWidget::slotApply() { void OptionsWidget::slotApply() {
...@@ -215,11 +213,11 @@ void OptionsWidget::slotApply() { ...@@ -215,11 +213,11 @@ void OptionsWidget::slotApply() {
if (availDrawModes->item(i)->checkState() == Qt::Checked) if (availDrawModes->item(i)->checkState() == Qt::Checked)
mode.push_back( availDrawModes->item(i)->text() ); mode.push_back( availDrawModes->item(i)->text() );
std::cerr << "Optionswidget: standarddrawmode not set yet" << std::endl; OpenFlipper::Options::standardDrawMode( ListToDrawMode(mode) );
// OpenFlipper::Options::standardDrawMode( ListToDrawMode(mode) );
emit applyOptions(); emit applyOptions();
emit saveOptions(); emit saveOptions();
hide(); hide();
} }
......
...@@ -5,24 +5,25 @@ ...@@ -5,24 +5,25 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>501</width> <width>488</width>
<height>480</height> <height>689</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
<string>Options</string> <string>Options</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout" > <layout class="QVBoxLayout" name="verticalLayout_11" >
<item> <item>
<widget class="QTabWidget" name="tabWidget" > <widget class="QTabWidget" name="tabWidget" >
<property name="toolTip" > <property name="toolTip" >
<string/> <string>This list shows the active draw modes.
You can select multiple modes at the same time.</string>
</property> </property>
<property name="statusTip" > <property name="statusTip" >
<string/> <string/>
</property> </property>
<property name="currentIndex" > <property name="currentIndex" >
<number>5</number> <number>2</number>
</property> </property>
<property name="usesScrollButtons" > <property name="usesScrollButtons" >
<bool>true</bool> <bool>true</bool>
...@@ -32,8 +33,8 @@ ...@@ -32,8 +33,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>479</width> <width>466</width>
<height>394</height> <height>603</height>
</rect> </rect>
</property> </property>
<attribute name="title" > <attribute name="title" >
...@@ -132,8 +133,8 @@ ...@@ -132,8 +133,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>479</width> <width>466</width>
<height>394</height> <height>603</height>
</rect> </rect>
</property> </property>
<attribute name="title" > <attribute name="title" >
...@@ -164,20 +165,32 @@ ...@@ -164,20 +165,32 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>479</width> <width>466</width>
<height>394</height> <height>603</height>
</rect> </rect>
</property> </property>
<attribute name="title" > <attribute name="title" >
<string>Viewer</string> <string>Viewer</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_11" > <layout class="QVBoxLayout" name="verticalLayout" >
<item> <item>
<widget class="QGroupBox" name="groupBox" > <widget class="QGroupBox" name="groupBox" >
<property name="title" > <property name="title" >
<string> Mouse Wheel </string> <string> Mouse Wheel </string>
</property> </property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="flat" >
<bool>false</bool>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
<layout class="QFormLayout" name="formLayout" > <layout class="QFormLayout" name="formLayout" >
<property name="fieldGrowthPolicy" >
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="label_2" > <widget class="QLabel" name="label_2" >
<property name="text" > <property name="text" >
...@@ -235,54 +248,43 @@ ...@@ -235,54 +248,43 @@
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_3" > <widget class="QGroupBox" name="groupBox_3" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" > <property name="title" >
<string> DrawMode </string> <string> DrawMode </string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_6" > <layout class="QVBoxLayout" name="verticalLayout_7" >
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_8" > <layout class="QVBoxLayout" name="verticalLayout_8" >
<item> <item>
<widget class="QLabel" name="label_7" > <widget class="QLabel" name="label_7" >
<property name="text" > <property name="toolTip" >
<string>Available DrawModes:</string> <string>This list shows the draw modes OpenFlipper uses at startup.
You can select multiple modes at the same time.</string>
</property> </property>
</widget>
</item>
<item>
<widget class="QListWidget" name="availDrawModes" />
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_7" >
<item>
<widget class="QToolButton" name="addButton" >
<property name="text" > <property name="text" >
<string>...</string> <string>Startup DrawModes:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="remButton" > <widget class="QListWidget" name="availDrawModes" >
<property name="text" > <property name="minimumSize" >
<string>...</string> <size>
<width>0</width>
<height>300</height>
</size>
</property> </property>
</widget> <property name="toolTip" >
</item> <string>This list shows the draw modes OpenFlipper uses at startup.
</layout> You can select multiple modes at the same time.</string>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_9" >
<item>
<widget class="QLabel" name="label_9" >
<property name="text" >
<string>Standard DrawMode:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QListWidget" name="standardDrawMode" />
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
...@@ -373,8 +375,8 @@ ...@@ -373,8 +375,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>479</width> <width>466</width>
<height>394</height> <height>603</height>
</rect> </rect>
</property> </property>
<attribute name="title" > <attribute name="title" >
...@@ -397,8 +399,8 @@ ...@@ -397,8 +399,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>479</width> <width>466</width>
<height>394</height> <height>603</height>
</rect> </rect>
</property> </property>
<attribute name="title" > <attribute name="title" >
...@@ -511,6 +513,14 @@ ...@@ -511,6 +513,14 @@
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="Debug" > <widget class="QWidget" name="Debug" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>466</width>
<height>603</height>
</rect>
</property>
<attribute name="title" > <attribute name="title" >
<string>Debug</string> <string>Debug</string>
</attribute> </attribute>
......
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