author | drw <drw> | 2003-02-04 23:38:30 (UTC) |
---|---|---|
committer | drw <drw> | 2003-02-04 23:38:30 (UTC) |
commit | 97b96e141fca844317e59ca5b99c1bf5fa52b1f0 (patch) (side-by-side diff) | |
tree | cb2d505a72747fef0d2c99debab7c4c9fedd0553 | |
parent | 294f0a9b5e5678a6eba1fb77943201fac804049f (diff) | |
download | opie-97b96e141fca844317e59ca5b99c1bf5fa52b1f0.zip opie-97b96e141fca844317e59ca5b99c1bf5fa52b1f0.tar.gz opie-97b96e141fca844317e59ca5b99c1bf5fa52b1f0.tar.bz2 |
More dialog clean-up. Except for QWhatsThis, the UI changes are pretty much done now for AQPkg
-rw-r--r-- | noncore/settings/aqpkg/.cvsignore | 4 | ||||
-rw-r--r-- | noncore/settings/aqpkg/aqpkg.pro | 3 | ||||
-rw-r--r-- | noncore/settings/aqpkg/categoryfilter.ui | 123 | ||||
-rw-r--r-- | noncore/settings/aqpkg/categoryfilterimpl.cpp | 33 | ||||
-rw-r--r-- | noncore/settings/aqpkg/categoryfilterimpl.h | 11 | ||||
-rw-r--r-- | noncore/settings/aqpkg/instoptions.ui | 167 | ||||
-rw-r--r-- | noncore/settings/aqpkg/instoptionsimpl.cpp | 37 | ||||
-rw-r--r-- | noncore/settings/aqpkg/instoptionsimpl.h | 14 |
8 files changed, 79 insertions, 313 deletions
diff --git a/noncore/settings/aqpkg/.cvsignore b/noncore/settings/aqpkg/.cvsignore index 12658fc..2888d4a 100644 --- a/noncore/settings/aqpkg/.cvsignore +++ b/noncore/settings/aqpkg/.cvsignore @@ -1,6 +1,2 @@ Makefile* -instoptions.cpp -instoptions.h moc* -categoryfilter.cpp -categoryfilter.h diff --git a/noncore/settings/aqpkg/aqpkg.pro b/noncore/settings/aqpkg/aqpkg.pro index f66fd95..6b4fb30 100644 --- a/noncore/settings/aqpkg/aqpkg.pro +++ b/noncore/settings/aqpkg/aqpkg.pro @@ -33,6 +33,5 @@ SOURCES = mainwin.cpp \ version.cpp \ categoryfilterimpl.cpp -INTERFACES = instoptions.ui \ - categoryfilter.ui +INTERFACES = TARGET = aqpkg INCLUDEPATH += $(OPIEDIR)/include diff --git a/noncore/settings/aqpkg/categoryfilter.ui b/noncore/settings/aqpkg/categoryfilter.ui deleted file mode 100644 index c167cc9..0000000 --- a/noncore/settings/aqpkg/categoryfilter.ui +++ b/dev/null @@ -1,123 +0,0 @@ -<!DOCTYPE UI><UI> -<class>CategoryFilterDlg</class> -<widget> - <class>QDialog</class> - <property stdset="1"> - <name>name</name> - <cstring>CategoryFilterDlg</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>0</x> - <y>0</y> - <width>211</width> - <height>295</height> - </rect> - </property> - <property stdset="1"> - <name>caption</name> - <string>Category Filter</string> - </property> - <grid> - <property stdset="1"> - <name>margin</name> - <number>11</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="1" column="0" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout4</cstring> - </property> - <grid> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="0" column="1" > - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>btnOK</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>&OK</string> - </property> - </widget> - <widget row="0" column="0" > - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>btnCancel</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>&Cancel</string> - </property> - </widget> - </grid> - </widget> - <widget row="0" column="0" > - <class>QGroupBox</class> - <property stdset="1"> - <name>name</name> - <cstring>GroupBox1</cstring> - </property> - <property stdset="1"> - <name>title</name> - <string>Select groups to show</string> - </property> - <grid> - <property stdset="1"> - <name>margin</name> - <number>11</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="0" column="0" > - <class>QListBox</class> - <property stdset="1"> - <name>name</name> - <cstring>lstCategories</cstring> - </property> - <property stdset="1"> - <name>selectionMode</name> - <enum>Multi</enum> - </property> - </widget> - </grid> - </widget> - </grid> -</widget> -<connections> - <connection> - <sender>btnCancel</sender> - <signal>clicked()</signal> - <receiver>CategoryFilterDlg</receiver> - <slot>reject()</slot> - </connection> - <connection> - <sender>btnOK</sender> - <signal>clicked()</signal> - <receiver>CategoryFilterDlg</receiver> - <slot>accept()</slot> - </connection> -</connections> -<tabstops> - <tabstop>lstCategories</tabstop> - <tabstop>btnCancel</tabstop> - <tabstop>btnOK</tabstop> -</tabstops> -</UI> diff --git a/noncore/settings/aqpkg/categoryfilterimpl.cpp b/noncore/settings/aqpkg/categoryfilterimpl.cpp index 0746da6..e8ce7e7 100644 --- a/noncore/settings/aqpkg/categoryfilterimpl.cpp +++ b/noncore/settings/aqpkg/categoryfilterimpl.cpp @@ -17,5 +17,7 @@ #include <iostream> using namespace std; - + +#include <qgroupbox.h> +#include <qlayout.h> #include <qlistbox.h> #include <qstring.h> @@ -24,6 +26,23 @@ using namespace std; CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name ) - : CategoryFilterDlg(parent,name, true) + : QDialog( parent, name, true ) { + setCaption( tr( "Category Filter" ) ); + + QVBoxLayout *layout = new QVBoxLayout( this ); + layout->setMargin( 2 ); + layout->setSpacing( 4 ); + + QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Select one or more groups" ), this ); + grpbox->layout()->setSpacing( 2 ); + grpbox->layout()->setMargin( 4 ); + layout->addWidget( grpbox ); + + QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); + + lstCategories = new QListBox( grpbox ); + lstCategories->setSelectionMode( QListBox::Multi ); + grplayout->addWidget( lstCategories ); + // Split up categories and add them to the listbox int start = 1; @@ -31,4 +50,5 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin QString item; int end; + QString finditem; do { @@ -38,6 +58,6 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin { lstCategories->insertItem( item ); - - if ( selectedCategories.find( "#" + item + "#" ) != -1 ) + finditem = QString( "#%1#" ).arg( item ); + if ( selectedCategories.find( finditem ) != -1 ) lstCategories->setSelected( lstCategories->count()-1, true ); } @@ -63,5 +83,8 @@ QString CategoryFilterImpl :: getSelectedFilter() { if ( lstCategories->isSelected( i ) ) - ret += lstCategories->text( i ) + "#"; + { + ret.append( lstCategories->text( i ) ); + ret.append( "#" ); + } } diff --git a/noncore/settings/aqpkg/categoryfilterimpl.h b/noncore/settings/aqpkg/categoryfilterimpl.h index b6b4fd5..a85fce4 100644 --- a/noncore/settings/aqpkg/categoryfilterimpl.h +++ b/noncore/settings/aqpkg/categoryfilterimpl.h @@ -19,8 +19,7 @@ #define CATEGORYFILTERIMPL_H -#include <qwidget.h> -#include <qstring.h> +#include <qdialog.h> -#include "categoryfilter.h" +class QListBox; /** @@ -28,5 +27,5 @@ */ -class CategoryFilterImpl : public CategoryFilterDlg +class CategoryFilterImpl : public QDialog { Q_OBJECT @@ -36,4 +35,8 @@ public: QString getSelectedFilter(); + +private: + QListBox *lstCategories; + }; diff --git a/noncore/settings/aqpkg/instoptions.ui b/noncore/settings/aqpkg/instoptions.ui deleted file mode 100644 index 00eab1e..0000000 --- a/noncore/settings/aqpkg/instoptions.ui +++ b/dev/null @@ -1,167 +0,0 @@ -<!DOCTYPE UI><UI> -<class>InstallOptionsDlg</class> -<widget> - <class>QDialog</class> - <property stdset="1"> - <name>name</name> - <cstring>InstallOptionsDlg</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>0</x> - <y>0</y> - <width>283</width> - <height>274</height> - </rect> - </property> - <property stdset="1"> - <name>caption</name> - <string>Options</string> - </property> - <property stdset="1"> - <name>sizeGripEnabled</name> - <bool>false</bool> - </property> - <vbox> - <property stdset="1"> - <name>margin</name> - <number>11</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QGroupBox</class> - <property stdset="1"> - <name>name</name> - <cstring>GroupBox1</cstring> - </property> - <property stdset="1"> - <name>title</name> - <string>Options</string> - </property> - <widget> - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>forceDepends</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>12</x> - <y>20</y> - <width>110</width> - <height>19</height> - </rect> - </property> - <property stdset="1"> - <name>text</name> - <string>Force Depends</string> - </property> - </widget> - <widget> - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>forceReinstall</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>12</x> - <y>45</y> - <width>107</width> - <height>19</height> - </rect> - </property> - <property stdset="1"> - <name>text</name> - <string>Force Reinstall</string> - </property> - </widget> - <widget> - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>forceRemove</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>12</x> - <y>70</y> - <width>105</width> - <height>19</height> - </rect> - </property> - <property stdset="1"> - <name>text</name> - <string>Force Remove</string> - </property> - </widget> - <widget> - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>forceOverwrite</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>12</x> - <y>95</y> - <width>114</width> - <height>19</height> - </rect> - </property> - <property stdset="1"> - <name>text</name> - <string>Force Overwrite</string> - </property> - </widget> - <widget> - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>verboseWget</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>12</x> - <y>120</y> - <width>104</width> - <height>19</height> - </rect> - </property> - <property stdset="1"> - <name>text</name> - <string>Verbose WGet</string> - </property> - </widget> - </widget> - <widget> - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>btnOK</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>OK</string> - </property> - </widget> - </vbox> -</widget> -<connections> - <connection> - <sender>btnOK</sender> - <signal>clicked()</signal> - <receiver>InstallOptionsDlg</receiver> - <slot>accept()</slot> - </connection> -</connections> -</UI> diff --git a/noncore/settings/aqpkg/instoptionsimpl.cpp b/noncore/settings/aqpkg/instoptionsimpl.cpp index 3a37eec..47b250d 100644 --- a/noncore/settings/aqpkg/instoptionsimpl.cpp +++ b/noncore/settings/aqpkg/instoptionsimpl.cpp @@ -20,14 +20,43 @@ #endif -#include <qdialog.h> #include <qcheckbox.h> +#include <qgroupbox.h> +#include <qlayout.h> +#include "global.h" #include "instoptionsimpl.h" #include "ipkg.h" -#include "global.h" InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, QWidget * parent, const char* name, bool modal, WFlags fl ) - : InstallOptionsDlg( parent, name, modal, fl ) + : QDialog( parent, name, modal, fl ) { + setCaption( tr( "Options" ) ); + + QVBoxLayout *layout = new QVBoxLayout( this ); + layout->setMargin( 2 ); + layout->setSpacing( 4 ); + + QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Options" ), this ); + grpbox->layout()->setSpacing( 2 ); + grpbox->layout()->setMargin( 4 ); + layout->addWidget( grpbox ); + + QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); + + forceDepends = new QCheckBox( tr( "Force Depends" ), grpbox ); + grplayout->addWidget( forceDepends ); + + forceReinstall = new QCheckBox( tr( "Force Reinstall" ), grpbox ); + grplayout->addWidget( forceReinstall ); + + forceRemove = new QCheckBox( tr( "Force Remove" ), grpbox ); + grplayout->addWidget( forceRemove ); + + forceOverwrite = new QCheckBox( tr( "Force Overwrite" ), grpbox ); + grplayout->addWidget( forceOverwrite ); + + verboseWget = new QCheckBox( tr( "Verbose WGet" ), grpbox ); + grplayout->addWidget( verboseWget ); + if ( flags & FORCE_DEPENDS ) forceDepends->setChecked( true ); @@ -68,3 +97,3 @@ int InstallOptionsDlgImpl :: getFlags() return flags; -}
\ No newline at end of file +} diff --git a/noncore/settings/aqpkg/instoptionsimpl.h b/noncore/settings/aqpkg/instoptionsimpl.h index 893f9bb..f4724a0 100644 --- a/noncore/settings/aqpkg/instoptionsimpl.h +++ b/noncore/settings/aqpkg/instoptionsimpl.h @@ -18,8 +18,11 @@ #define INSTALLOPTIONSIMPL_H -#include "instoptions.h" +#include <qdialog.h> -class InstallOptionsDlgImpl : public InstallOptionsDlg +class QCheckBox; + +class InstallOptionsDlgImpl : public QDialog { + Q_OBJECT public: InstallOptionsDlgImpl( int flags, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); @@ -27,7 +30,10 @@ public: int getFlags(); -protected: - private: + QCheckBox* forceDepends; + QCheckBox* forceReinstall; + QCheckBox* forceRemove; + QCheckBox* forceOverwrite; + QCheckBox* verboseWget; }; |