From 97b96e141fca844317e59ca5b99c1bf5fa52b1f0 Mon Sep 17 00:00:00 2001 From: drw Date: Tue, 04 Feb 2003 23:38:30 +0000 Subject: More dialog clean-up. Except for QWhatsThis, the UI changes are pretty much done now for AQPkg --- (limited to 'noncore/settings/aqpkg') 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 @@ -32,8 +32,7 @@ SOURCES = mainwin.cpp \ inputdlg.cpp \ version.cpp \ categoryfilterimpl.cpp -INTERFACES = instoptions.ui \ - categoryfilter.ui +INTERFACES = TARGET = aqpkg INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(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 @@ - -CategoryFilterDlg - - QDialog - - name - CategoryFilterDlg - - - geometry - - 0 - 0 - 211 - 295 - - - - caption - Category Filter - - - - margin - 11 - - - spacing - 6 - - - QLayoutWidget - - name - Layout4 - - - - margin - 0 - - - spacing - 6 - - - QPushButton - - name - btnOK - - - text - &OK - - - - QPushButton - - name - btnCancel - - - text - &Cancel - - - - - - QGroupBox - - name - GroupBox1 - - - title - Select groups to show - - - - margin - 11 - - - spacing - 6 - - - QListBox - - name - lstCategories - - - selectionMode - Multi - - - - - - - - - btnCancel - clicked() - CategoryFilterDlg - reject() - - - btnOK - clicked() - CategoryFilterDlg - accept() - - - - lstCategories - btnCancel - btnOK - - 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 @@ -16,20 +16,40 @@ ***************************************************************************/ #include using namespace std; - + +#include +#include #include #include #include "categoryfilterimpl.h" 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; QString item; int end; + QString finditem; do { end = categories.find( "#", start ); @@ -37,8 +57,8 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin if ( item != "" ) { lstCategories->insertItem( item ); - - if ( selectedCategories.find( "#" + item + "#" ) != -1 ) + finditem = QString( "#%1#" ).arg( item ); + if ( selectedCategories.find( finditem ) != -1 ) lstCategories->setSelected( lstCategories->count()-1, true ); } @@ -62,7 +82,10 @@ QString CategoryFilterImpl :: getSelectedFilter() for ( int i = 0 ; i < (int)lstCategories->count() ; ++i ) { if ( lstCategories->isSelected( i ) ) - ret += lstCategories->text( i ) + "#"; + { + ret.append( lstCategories->text( i ) ); + ret.append( "#" ); + } } if ( ret == "#" ) 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 @@ -18,16 +18,15 @@ #ifndef CATEGORYFILTERIMPL_H #define CATEGORYFILTERIMPL_H -#include -#include +#include -#include "categoryfilter.h" +class QListBox; /** *@author Andy Qua */ -class CategoryFilterImpl : public CategoryFilterDlg +class CategoryFilterImpl : public QDialog { Q_OBJECT public: @@ -35,6 +34,10 @@ public: ~CategoryFilterImpl(); QString getSelectedFilter(); + +private: + QListBox *lstCategories; + }; #endif 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 @@ - -InstallOptionsDlg - - QDialog - - name - InstallOptionsDlg - - - geometry - - 0 - 0 - 283 - 274 - - - - caption - Options - - - sizeGripEnabled - false - - - - margin - 11 - - - spacing - 6 - - - QGroupBox - - name - GroupBox1 - - - title - Options - - - QCheckBox - - name - forceDepends - - - geometry - - 12 - 20 - 110 - 19 - - - - text - Force Depends - - - - QCheckBox - - name - forceReinstall - - - geometry - - 12 - 45 - 107 - 19 - - - - text - Force Reinstall - - - - QCheckBox - - name - forceRemove - - - geometry - - 12 - 70 - 105 - 19 - - - - text - Force Remove - - - - QCheckBox - - name - forceOverwrite - - - geometry - - 12 - 95 - 114 - 19 - - - - text - Force Overwrite - - - - QCheckBox - - name - verboseWget - - - geometry - - 12 - 120 - 104 - 19 - - - - text - Verbose WGet - - - - - QPushButton - - name - btnOK - - - text - OK - - - - - - - btnOK - clicked() - InstallOptionsDlg - accept() - - - 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 @@ -19,16 +19,45 @@ #include #endif -#include #include +#include +#include +#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 ); if ( flags & FORCE_REINSTALL ) @@ -67,4 +96,4 @@ int InstallOptionsDlgImpl :: getFlags() flags |= VERBOSE_WGET; 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 @@ -17,18 +17,24 @@ #ifndef INSTALLOPTIONSIMPL_H #define INSTALLOPTIONSIMPL_H -#include "instoptions.h" +#include -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 ); ~InstallOptionsDlgImpl(); int getFlags(); -protected: - private: + QCheckBox* forceDepends; + QCheckBox* forceReinstall; + QCheckBox* forceRemove; + QCheckBox* forceOverwrite; + QCheckBox* verboseWget; }; #endif -- cgit v0.9.0.2