summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/.cvsignore4
-rw-r--r--noncore/settings/aqpkg/aqpkg.pro3
-rw-r--r--noncore/settings/aqpkg/categoryfilter.ui123
-rw-r--r--noncore/settings/aqpkg/categoryfilterimpl.cpp33
-rw-r--r--noncore/settings/aqpkg/categoryfilterimpl.h11
-rw-r--r--noncore/settings/aqpkg/instoptions.ui167
-rw-r--r--noncore/settings/aqpkg/instoptionsimpl.cpp37
-rw-r--r--noncore/settings/aqpkg/instoptionsimpl.h14
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 @@
1Makefile* 1Makefile*
2instoptions.cpp
3instoptions.h
4moc* 2moc*
5categoryfilter.cpp
6categoryfilter.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 \
32 inputdlg.cpp \ 32 inputdlg.cpp \
33 version.cpp \ 33 version.cpp \
34 categoryfilterimpl.cpp 34 categoryfilterimpl.cpp
35 INTERFACES= instoptions.ui \ 35 INTERFACES=
36 categoryfilter.ui
37 TARGET = aqpkg 36 TARGET = aqpkg
38INCLUDEPATH += $(OPIEDIR)/include 37INCLUDEPATH += $(OPIEDIR)/include
39DEPENDPATH += $(OPIEDIR)/include 38DEPENDPATH += $(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 @@
1<!DOCTYPE UI><UI>
2<class>CategoryFilterDlg</class>
3<widget>
4 <class>QDialog</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>CategoryFilterDlg</cstring>
8 </property>
9 <property stdset="1">
10 <name>geometry</name>
11 <rect>
12 <x>0</x>
13 <y>0</y>
14 <width>211</width>
15 <height>295</height>
16 </rect>
17 </property>
18 <property stdset="1">
19 <name>caption</name>
20 <string>Category Filter</string>
21 </property>
22 <grid>
23 <property stdset="1">
24 <name>margin</name>
25 <number>11</number>
26 </property>
27 <property stdset="1">
28 <name>spacing</name>
29 <number>6</number>
30 </property>
31 <widget row="1" column="0" >
32 <class>QLayoutWidget</class>
33 <property stdset="1">
34 <name>name</name>
35 <cstring>Layout4</cstring>
36 </property>
37 <grid>
38 <property stdset="1">
39 <name>margin</name>
40 <number>0</number>
41 </property>
42 <property stdset="1">
43 <name>spacing</name>
44 <number>6</number>
45 </property>
46 <widget row="0" column="1" >
47 <class>QPushButton</class>
48 <property stdset="1">
49 <name>name</name>
50 <cstring>btnOK</cstring>
51 </property>
52 <property stdset="1">
53 <name>text</name>
54 <string>&amp;OK</string>
55 </property>
56 </widget>
57 <widget row="0" column="0" >
58 <class>QPushButton</class>
59 <property stdset="1">
60 <name>name</name>
61 <cstring>btnCancel</cstring>
62 </property>
63 <property stdset="1">
64 <name>text</name>
65 <string>&amp;Cancel</string>
66 </property>
67 </widget>
68 </grid>
69 </widget>
70 <widget row="0" column="0" >
71 <class>QGroupBox</class>
72 <property stdset="1">
73 <name>name</name>
74 <cstring>GroupBox1</cstring>
75 </property>
76 <property stdset="1">
77 <name>title</name>
78 <string>Select groups to show</string>
79 </property>
80 <grid>
81 <property stdset="1">
82 <name>margin</name>
83 <number>11</number>
84 </property>
85 <property stdset="1">
86 <name>spacing</name>
87 <number>6</number>
88 </property>
89 <widget row="0" column="0" >
90 <class>QListBox</class>
91 <property stdset="1">
92 <name>name</name>
93 <cstring>lstCategories</cstring>
94 </property>
95 <property stdset="1">
96 <name>selectionMode</name>
97 <enum>Multi</enum>
98 </property>
99 </widget>
100 </grid>
101 </widget>
102 </grid>
103</widget>
104<connections>
105 <connection>
106 <sender>btnCancel</sender>
107 <signal>clicked()</signal>
108 <receiver>CategoryFilterDlg</receiver>
109 <slot>reject()</slot>
110 </connection>
111 <connection>
112 <sender>btnOK</sender>
113 <signal>clicked()</signal>
114 <receiver>CategoryFilterDlg</receiver>
115 <slot>accept()</slot>
116 </connection>
117</connections>
118<tabstops>
119 <tabstop>lstCategories</tabstop>
120 <tabstop>btnCancel</tabstop>
121 <tabstop>btnOK</tabstop>
122</tabstops>
123</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
@@ -16,20 +16,40 @@
16 ***************************************************************************/ 16 ***************************************************************************/
17#include <iostream> 17#include <iostream>
18using namespace std; 18using namespace std;
19 19
20#include <qgroupbox.h>
21#include <qlayout.h>
20#include <qlistbox.h> 22#include <qlistbox.h>
21#include <qstring.h> 23#include <qstring.h>
22 24
23#include "categoryfilterimpl.h" 25#include "categoryfilterimpl.h"
24 26
25CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name ) 27CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name )
26 : CategoryFilterDlg(parent,name, true) 28 : QDialog( parent, name, true )
27{ 29{
30 setCaption( tr( "Category Filter" ) );
31
32 QVBoxLayout *layout = new QVBoxLayout( this );
33 layout->setMargin( 2 );
34 layout->setSpacing( 4 );
35
36 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Select one or more groups" ), this );
37 grpbox->layout()->setSpacing( 2 );
38 grpbox->layout()->setMargin( 4 );
39 layout->addWidget( grpbox );
40
41 QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() );
42
43 lstCategories = new QListBox( grpbox );
44 lstCategories->setSelectionMode( QListBox::Multi );
45 grplayout->addWidget( lstCategories );
46
28 // Split up categories and add them to the listbox 47 // Split up categories and add them to the listbox
29 int start = 1; 48 int start = 1;
30 49
31 QString item; 50 QString item;
32 int end; 51 int end;
52 QString finditem;
33 do 53 do
34 { 54 {
35 end = categories.find( "#", start ); 55 end = categories.find( "#", start );
@@ -37,8 +57,8 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin
37 if ( item != "" ) 57 if ( item != "" )
38 { 58 {
39 lstCategories->insertItem( item ); 59 lstCategories->insertItem( item );
40 60 finditem = QString( "#%1#" ).arg( item );
41 if ( selectedCategories.find( "#" + item + "#" ) != -1 ) 61 if ( selectedCategories.find( finditem ) != -1 )
42 lstCategories->setSelected( lstCategories->count()-1, true ); 62 lstCategories->setSelected( lstCategories->count()-1, true );
43 } 63 }
44 64
@@ -62,7 +82,10 @@ QString CategoryFilterImpl :: getSelectedFilter()
62 for ( int i = 0 ; i < (int)lstCategories->count() ; ++i ) 82 for ( int i = 0 ; i < (int)lstCategories->count() ; ++i )
63 { 83 {
64 if ( lstCategories->isSelected( i ) ) 84 if ( lstCategories->isSelected( i ) )
65 ret += lstCategories->text( i ) + "#"; 85 {
86 ret.append( lstCategories->text( i ) );
87 ret.append( "#" );
88 }
66 } 89 }
67 90
68 if ( ret == "#" ) 91 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 @@
18#ifndef CATEGORYFILTERIMPL_H 18#ifndef CATEGORYFILTERIMPL_H
19#define CATEGORYFILTERIMPL_H 19#define CATEGORYFILTERIMPL_H
20 20
21#include <qwidget.h> 21#include <qdialog.h>
22#include <qstring.h>
23 22
24#include "categoryfilter.h" 23class QListBox;
25 24
26/** 25/**
27 *@author Andy Qua 26 *@author Andy Qua
28 */ 27 */
29 28
30class CategoryFilterImpl : public CategoryFilterDlg 29class CategoryFilterImpl : public QDialog
31{ 30{
32 Q_OBJECT 31 Q_OBJECT
33public: 32public:
@@ -35,6 +34,10 @@ public:
35 ~CategoryFilterImpl(); 34 ~CategoryFilterImpl();
36 35
37 QString getSelectedFilter(); 36 QString getSelectedFilter();
37
38private:
39 QListBox *lstCategories;
40
38}; 41};
39 42
40#endif 43#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 @@
1<!DOCTYPE UI><UI>
2<class>InstallOptionsDlg</class>
3<widget>
4 <class>QDialog</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>InstallOptionsDlg</cstring>
8 </property>
9 <property stdset="1">
10 <name>geometry</name>
11 <rect>
12 <x>0</x>
13 <y>0</y>
14 <width>283</width>
15 <height>274</height>
16 </rect>
17 </property>
18 <property stdset="1">
19 <name>caption</name>
20 <string>Options</string>
21 </property>
22 <property stdset="1">
23 <name>sizeGripEnabled</name>
24 <bool>false</bool>
25 </property>
26 <vbox>
27 <property stdset="1">
28 <name>margin</name>
29 <number>11</number>
30 </property>
31 <property stdset="1">
32 <name>spacing</name>
33 <number>6</number>
34 </property>
35 <widget>
36 <class>QGroupBox</class>
37 <property stdset="1">
38 <name>name</name>
39 <cstring>GroupBox1</cstring>
40 </property>
41 <property stdset="1">
42 <name>title</name>
43 <string>Options</string>
44 </property>
45 <widget>
46 <class>QCheckBox</class>
47 <property stdset="1">
48 <name>name</name>
49 <cstring>forceDepends</cstring>
50 </property>
51 <property stdset="1">
52 <name>geometry</name>
53 <rect>
54 <x>12</x>
55 <y>20</y>
56 <width>110</width>
57 <height>19</height>
58 </rect>
59 </property>
60 <property stdset="1">
61 <name>text</name>
62 <string>Force Depends</string>
63 </property>
64 </widget>
65 <widget>
66 <class>QCheckBox</class>
67 <property stdset="1">
68 <name>name</name>
69 <cstring>forceReinstall</cstring>
70 </property>
71 <property stdset="1">
72 <name>geometry</name>
73 <rect>
74 <x>12</x>
75 <y>45</y>
76 <width>107</width>
77 <height>19</height>
78 </rect>
79 </property>
80 <property stdset="1">
81 <name>text</name>
82 <string>Force Reinstall</string>
83 </property>
84 </widget>
85 <widget>
86 <class>QCheckBox</class>
87 <property stdset="1">
88 <name>name</name>
89 <cstring>forceRemove</cstring>
90 </property>
91 <property stdset="1">
92 <name>geometry</name>
93 <rect>
94 <x>12</x>
95 <y>70</y>
96 <width>105</width>
97 <height>19</height>
98 </rect>
99 </property>
100 <property stdset="1">
101 <name>text</name>
102 <string>Force Remove</string>
103 </property>
104 </widget>
105 <widget>
106 <class>QCheckBox</class>
107 <property stdset="1">
108 <name>name</name>
109 <cstring>forceOverwrite</cstring>
110 </property>
111 <property stdset="1">
112 <name>geometry</name>
113 <rect>
114 <x>12</x>
115 <y>95</y>
116 <width>114</width>
117 <height>19</height>
118 </rect>
119 </property>
120 <property stdset="1">
121 <name>text</name>
122 <string>Force Overwrite</string>
123 </property>
124 </widget>
125 <widget>
126 <class>QCheckBox</class>
127 <property stdset="1">
128 <name>name</name>
129 <cstring>verboseWget</cstring>
130 </property>
131 <property stdset="1">
132 <name>geometry</name>
133 <rect>
134 <x>12</x>
135 <y>120</y>
136 <width>104</width>
137 <height>19</height>
138 </rect>
139 </property>
140 <property stdset="1">
141 <name>text</name>
142 <string>Verbose WGet</string>
143 </property>
144 </widget>
145 </widget>
146 <widget>
147 <class>QPushButton</class>
148 <property stdset="1">
149 <name>name</name>
150 <cstring>btnOK</cstring>
151 </property>
152 <property stdset="1">
153 <name>text</name>
154 <string>OK</string>
155 </property>
156 </widget>
157 </vbox>
158</widget>
159<connections>
160 <connection>
161 <sender>btnOK</sender>
162 <signal>clicked()</signal>
163 <receiver>InstallOptionsDlg</receiver>
164 <slot>accept()</slot>
165 </connection>
166</connections>
167</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
@@ -19,16 +19,45 @@
19#include <qpe/config.h> 19#include <qpe/config.h>
20#endif 20#endif
21 21
22#include <qdialog.h>
23#include <qcheckbox.h> 22#include <qcheckbox.h>
23#include <qgroupbox.h>
24#include <qlayout.h>
24 25
26#include "global.h"
25#include "instoptionsimpl.h" 27#include "instoptionsimpl.h"
26#include "ipkg.h" 28#include "ipkg.h"
27#include "global.h"
28 29
29InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, QWidget * parent, const char* name, bool modal, WFlags fl ) 30InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, QWidget * parent, const char* name, bool modal, WFlags fl )
30 : InstallOptionsDlg( parent, name, modal, fl ) 31 : QDialog( parent, name, modal, fl )
31{ 32{
33 setCaption( tr( "Options" ) );
34
35 QVBoxLayout *layout = new QVBoxLayout( this );
36 layout->setMargin( 2 );
37 layout->setSpacing( 4 );
38
39 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Options" ), this );
40 grpbox->layout()->setSpacing( 2 );
41 grpbox->layout()->setMargin( 4 );
42 layout->addWidget( grpbox );
43
44 QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() );
45
46 forceDepends = new QCheckBox( tr( "Force Depends" ), grpbox );
47 grplayout->addWidget( forceDepends );
48
49 forceReinstall = new QCheckBox( tr( "Force Reinstall" ), grpbox );
50 grplayout->addWidget( forceReinstall );
51
52 forceRemove = new QCheckBox( tr( "Force Remove" ), grpbox );
53 grplayout->addWidget( forceRemove );
54
55 forceOverwrite = new QCheckBox( tr( "Force Overwrite" ), grpbox );
56 grplayout->addWidget( forceOverwrite );
57
58 verboseWget = new QCheckBox( tr( "Verbose WGet" ), grpbox );
59 grplayout->addWidget( verboseWget );
60
32 if ( flags & FORCE_DEPENDS ) 61 if ( flags & FORCE_DEPENDS )
33 forceDepends->setChecked( true ); 62 forceDepends->setChecked( true );
34 if ( flags & FORCE_REINSTALL ) 63 if ( flags & FORCE_REINSTALL )
@@ -67,4 +96,4 @@ int InstallOptionsDlgImpl :: getFlags()
67 flags |= VERBOSE_WGET; 96 flags |= VERBOSE_WGET;
68 97
69 return flags; 98 return flags;
70} \ No newline at end of file 99}
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 @@
17#ifndef INSTALLOPTIONSIMPL_H 17#ifndef INSTALLOPTIONSIMPL_H
18#define INSTALLOPTIONSIMPL_H 18#define INSTALLOPTIONSIMPL_H
19 19
20#include "instoptions.h" 20#include <qdialog.h>
21 21
22class InstallOptionsDlgImpl : public InstallOptionsDlg 22class QCheckBox;
23
24class InstallOptionsDlgImpl : public QDialog
23{ 25{
26 Q_OBJECT
24public: 27public:
25 InstallOptionsDlgImpl( int flags, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); 28 InstallOptionsDlgImpl( int flags, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );
26 ~InstallOptionsDlgImpl(); 29 ~InstallOptionsDlgImpl();
27 int getFlags(); 30 int getFlags();
28 31
29protected:
30
31private: 32private:
33 QCheckBox* forceDepends;
34 QCheckBox* forceReinstall;
35 QCheckBox* forceRemove;
36 QCheckBox* forceOverwrite;
37 QCheckBox* verboseWget;
32}; 38};
33 39
34#endif 40#endif