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
connect(cancelButton,SIGNAL(clicked()),this,SLOT(slotCancel()));
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;
for (uint i=1; i < 22; i++) {
std::vector< QString > dm = drawModeToList( mode );
if (dm[0].trimmed() != ""){
if ( !dm.empty() && 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<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);
......@@ -183,6 +166,21 @@ void OptionsWidget::showEvent ( QShowEvent * event ) {
keyTree->addTopLevelItems( plugins );
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() {
......@@ -215,11 +213,11 @@ void OptionsWidget::slotApply() {
if (availDrawModes->item(i)->checkState() == Qt::Checked)
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 saveOptions();
hide();
}
......
......@@ -5,24 +5,25 @@
<rect>
<x>0</x>
<y>0</y>
<width>501</width>
<height>480</height>
<width>488</width>
<height>689</height>
</rect>
</property>
<property name="windowTitle" >
<string>Options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<layout class="QVBoxLayout" name="verticalLayout_11" >
<item>
<widget class="QTabWidget" name="tabWidget" >
<property name="toolTip" >
<string/>
<string>This list shows the active draw modes.
You can select multiple modes at the same time.</string>
</property>
<property name="statusTip" >
<string/>
</property>
<property name="currentIndex" >
<number>5</number>
<number>2</number>
</property>
<property name="usesScrollButtons" >
<bool>true</bool>
......@@ -32,8 +33,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>479</width>
<height>394</height>
<width>466</width>
<height>603</height>
</rect>
</property>
<attribute name="title" >
......@@ -132,8 +133,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>479</width>
<height>394</height>
<width>466</width>
<height>603</height>
</rect>
</property>
<attribute name="title" >
......@@ -164,20 +165,32 @@
<rect>
<x>0</x>
<y>0</y>
<width>479</width>
<height>394</height>
<width>466</width>
<height>603</height>
</rect>
</property>
<attribute name="title" >
<string>Viewer</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_11" >
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string> Mouse Wheel </string>
</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" >
<property name="fieldGrowthPolicy" >
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
......@@ -235,54 +248,43 @@
</item>
<item>
<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" >
<string> DrawMode </string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6" >
<layout class="QVBoxLayout" name="verticalLayout_7" >
<item>
<layout class="QVBoxLayout" name="verticalLayout_8" >
<item>
<widget class="QLabel" name="label_7" >
<property name="text" >
<string>Available DrawModes:</string>
<property name="toolTip" >
<string>This list shows the draw modes OpenFlipper uses at startup.
You can select multiple modes at the same time.</string>
</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" >
<string>...</string>
<string>Startup DrawModes:</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="remButton" >
<property name="text" >
<string>...</string>
<widget class="QListWidget" name="availDrawModes" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>300</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_9" >
<item>
<widget class="QLabel" name="label_9" >
<property name="text" >
<string>Standard DrawMode:</string>
<property name="toolTip" >
<string>This list shows the draw modes OpenFlipper uses at startup.
You can select multiple modes at the same time.</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="standardDrawMode" />
</item>
</layout>
</item>
</layout>
......@@ -373,8 +375,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>479</width>
<height>394</height>
<width>466</width>
<height>603</height>
</rect>
</property>
<attribute name="title" >
......@@ -397,8 +399,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>479</width>
<height>394</height>
<width>466</width>
<height>603</height>
</rect>
</property>
<attribute name="title" >
......@@ -511,6 +513,14 @@
</layout>
</widget>
<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" >
<string>Debug</string>
</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