-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 10 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/oipkg.pro | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 10 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/package.h | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pksettingsbase.ui | 10 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 142 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.h | 14 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/runwindow.ui | 112 |
8 files changed, 233 insertions, 70 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 997f449..54ee115 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -1,348 +1,348 @@ | |||
1 | // adadpted form qpe/qipkg | 1 | // adadpted form qpe/qipkg |
2 | 2 | ||
3 | 3 | ||
4 | #include "mainwindow.h" | 4 | #include "mainwindow.h" |
5 | 5 | ||
6 | #include <qpe/qpemenubar.h> | 6 | #include <qpe/qpemenubar.h> |
7 | #include <qpe/qpemessagebox.h> | 7 | #include <qpe/qpemessagebox.h> |
8 | #include <qpe/resource.h> | 8 | #include <qpe/resource.h> |
9 | #include <qpe/qpetoolbar.h> | 9 | #include <qpe/qpetoolbar.h> |
10 | #include <qaction.h> | 10 | #include <qaction.h> |
11 | #include <qmessagebox.h> | 11 | #include <qmessagebox.h> |
12 | #include <qpopupmenu.h> | 12 | #include <qpopupmenu.h> |
13 | #include <qtoolbutton.h> | 13 | #include <qtoolbutton.h> |
14 | #include <qstring.h> | 14 | #include <qstring.h> |
15 | #include <qlabel.h> | 15 | #include <qlabel.h> |
16 | #include <qlistview.h> | 16 | #include <qlistview.h> |
17 | #include <qtextview.h> | 17 | #include <qtextview.h> |
18 | #include <qlineedit.h> | 18 | #include <qlineedit.h> |
19 | #include <qtabwidget.h> | 19 | #include <qtabwidget.h> |
20 | #include <qcombobox.h> | 20 | #include <qcombobox.h> |
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | 22 | ||
23 | #include "pksettingsbase.h" | 23 | #include "pksettingsbase.h" |
24 | #include "packagelistitem.h" | 24 | #include "packagelistitem.h" |
25 | 25 | ||
26 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | 26 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : |
27 | QMainWindow( parent, name, f ) | 27 | QMainWindow( parent, name, f ) |
28 | { | 28 | { |
29 | setCaption( tr("Package Manager") ); | 29 | setCaption( tr("Package Manager") ); |
30 | 30 | ||
31 | listViewPackages = new QListView( this,0,0 ); | 31 | listViewPackages = new QListView( this,0,0 ); |
32 | setCentralWidget( listViewPackages ); | 32 | setCentralWidget( listViewPackages ); |
33 | 33 | ||
34 | makeMenu(); | 34 | makeMenu(); |
35 | 35 | ||
36 | QFontMetrics fm = fontMetrics(); | 36 | QFontMetrics fm = fontMetrics(); |
37 | int wlw = width()*2; | 37 | int wlw = width()*2; |
38 | int w0 = fm.width(tr("Package"))+30; | 38 | int w0 = fm.width(tr("Package"))+30; |
39 | // int w0 = fm.width(tr("Package"))+30; | 39 | // int w0 = fm.width(tr("Package"))+30; |
40 | int w2 = fm.width("00000")+4; | 40 | int w2 = fm.width("00000")+4; |
41 | int w1 = wlw-w2-w0-20; | 41 | int w1 = wlw-w2-w0-20; |
42 | listViewPackages->addColumn( tr("Package"), w0 ); | 42 | listViewPackages->addColumn( tr("Package"), w0 ); |
43 | listViewPackages->addColumn( tr("Description"), w1 ); | 43 | listViewPackages->addColumn( tr("Description"), w1 ); |
44 | listViewPackages->addColumn( tr("Size"), w2 ); | 44 | listViewPackages->addColumn( tr("Size"), w2 ); |
45 | listViewPackages->setColumnWidthMode(0,QListView::Manual); | 45 | listViewPackages->setColumnWidthMode(0,QListView::Manual); |
46 | listViewPackages->setColumnWidthMode(1,QListView::Manual); | 46 | listViewPackages->setColumnWidthMode(1,QListView::Manual); |
47 | listViewPackages->setColumnWidthMode(2,QListView::Manual); | 47 | listViewPackages->setColumnWidthMode(2,QListView::Manual); |
48 | listViewPackages->setSelectionMode( QListView::Multi ); | 48 | listViewPackages->setSelectionMode( QListView::Multi ); |
49 | 49 | ||
50 | connect( section, SIGNAL( activated(int) ), | 50 | connect( section, SIGNAL( activated(int) ), |
51 | this, SLOT( sectionChanged() ) ); | 51 | this, SLOT( sectionChanged() ) ); |
52 | connect( subsection, SIGNAL(activated(int) ), | 52 | connect( subsection, SIGNAL(activated(int) ), |
53 | this, SLOT( subSectionChanged() ) ); | 53 | this, SLOT( subSectionChanged() ) ); |
54 | connect( listViewPackages, SIGNAL( pressed( QListViewItem* ) ), | 54 | connect( listViewPackages, SIGNAL( pressed( QListViewItem* ) ), |
55 | this, SLOT( setCurrent( QListViewItem* ) ) ); | 55 | this, SLOT( setCurrent( QListViewItem* ) ) ); |
56 | 56 | ||
57 | settings = new PackageManagerSettings(this,0,TRUE); | 57 | settings = new PackageManagerSettings(this,0,TRUE); |
58 | 58 | ||
59 | ipkg = new PmIpkg( settings, this ); | 59 | ipkg = new PmIpkg( settings, this ); |
60 | packageList.setSettings( settings ); | 60 | packageList.setSettings( settings ); |
61 | getList(); | 61 | getList(); |
62 | setSections(); | 62 | setSections(); |
63 | setSubSections(); | 63 | setSubSections(); |
64 | displayList(); | 64 | displayList(); |
65 | } | 65 | } |
66 | 66 | ||
67 | void MainWindow::makeMenu() | 67 | void MainWindow::makeMenu() |
68 | { | 68 | { |
69 | 69 | ||
70 | QPEToolBar *toolBar = new QPEToolBar( this ); | 70 | QPEToolBar *toolBar = new QPEToolBar( this ); |
71 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); | 71 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); |
72 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); | 72 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); |
73 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); | 73 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); |
74 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); | 74 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); |
75 | // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); | 75 | // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); |
76 | 76 | ||
77 | popupMenu = new QPopupMenu( this ); | 77 | popupMenu = new QPopupMenu( this ); |
78 | 78 | ||
79 | contextMenu = new QPopupMenu( this ); | 79 | contextMenu = new QPopupMenu( this ); |
80 | 80 | ||
81 | setToolBarsMovable( false ); | 81 | setToolBarsMovable( false ); |
82 | toolBar->setHorizontalStretchable( true ); | 82 | toolBar->setHorizontalStretchable( true ); |
83 | menuBar->insertItem( tr( "Package" ), srvMenu ); | 83 | menuBar->insertItem( tr( "Package" ), srvMenu ); |
84 | menuBar->insertItem( tr( "View" ), viewMenu ); | 84 | menuBar->insertItem( tr( "View" ), viewMenu ); |
85 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 85 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
86 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); | 86 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); |
87 | 87 | ||
88 | QLabel *spacer = new QLabel( "", toolBar ); | 88 | QLabel *spacer = new QLabel( "", toolBar ); |
89 | spacer->setBackgroundColor( toolBar->backgroundColor() ); | 89 | spacer->setBackgroundColor( toolBar->backgroundColor() ); |
90 | toolBar->setStretchableWidget( spacer ); | 90 | toolBar->setStretchableWidget( spacer ); |
91 | 91 | ||
92 | 92 | ||
93 | runAction = new QAction( tr( "Commit" ), | 93 | runAction = new QAction( tr( "Commit" ), |
94 | Resource::loadPixmap( "oipkg/install" ), | 94 | Resource::loadPixmap( "oipkg/install" ), |
95 | QString::null, 0, this, 0 ); | 95 | QString::null, 0, this, 0 ); |
96 | connect( runAction, SIGNAL( activated() ), | 96 | connect( runAction, SIGNAL( activated() ), |
97 | this, SLOT( runIpkg() ) ); | 97 | this, SLOT( runIpkg() ) ); |
98 | runAction->addTo( toolBar ); | 98 | runAction->addTo( toolBar ); |
99 | runAction->addTo( srvMenu ); | 99 | runAction->addTo( srvMenu ); |
100 | 100 | ||
101 | srvMenu->insertSeparator (); | 101 | srvMenu->insertSeparator (); |
102 | 102 | ||
103 | updateAction = new QAction( tr( "Update" ), | 103 | updateAction = new QAction( tr( "Update" ), |
104 | Resource::loadIconSet( "oipkg/repeat" ), | 104 | Resource::loadIconSet( "oipkg/update" ), |
105 | QString::null, 0, this, 0 ); | 105 | QString::null, 0, this, 0 ); |
106 | connect( updateAction, SIGNAL( activated() ), | 106 | connect( updateAction, SIGNAL( activated() ), |
107 | this , SLOT( updateList() ) ); | 107 | this , SLOT( updateList() ) ); |
108 | updateAction->addTo( toolBar ); | 108 | updateAction->addTo( toolBar ); |
109 | updateAction->addTo( srvMenu ); | 109 | updateAction->addTo( srvMenu ); |
110 | 110 | ||
111 | detailsAction = new QAction( tr( "Details" ), | 111 | detailsAction = new QAction( tr( "Details" ), |
112 | Resource::loadIconSet( "find" ), | 112 | Resource::loadIconSet( "find" ), |
113 | QString::null, 0, this, 0 ); | 113 | QString::null, 0, this, 0 ); |
114 | connect( detailsAction, SIGNAL( activated() ), | 114 | connect( detailsAction, SIGNAL( activated() ), |
115 | this , SLOT( showDetails() ) ); | 115 | this , SLOT( showDetails() ) ); |
116 | detailsAction->addTo( toolBar ); | 116 | detailsAction->addTo( toolBar ); |
117 | detailsAction->addTo( srvMenu ); | 117 | detailsAction->addTo( srvMenu ); |
118 | 118 | ||
119 | QAction *cfgact; | 119 | QAction *cfgact; |
120 | 120 | ||
121 | cfgact = new QAction( tr( "Setups" ), | 121 | cfgact = new QAction( tr( "Setups" ), |
122 | // Resource::loadIconSet( "" ), | 122 | // Resource::loadIconSet( "" ), |
123 | QString::null, 0, this, 0 ); | 123 | QString::null, 0, this, 0 ); |
124 | connect( cfgact, SIGNAL( activated() ), | 124 | connect( cfgact, SIGNAL( activated() ), |
125 | SLOT( showSettings() ) ); | 125 | SLOT( showSettings() ) ); |
126 | cfgact->addTo( cfgMenu ); | 126 | cfgact->addTo( cfgMenu ); |
127 | 127 | ||
128 | cfgact = new QAction( tr( "Servers" ), | 128 | cfgact = new QAction( tr( "Servers" ), |
129 | // Resource::loadIconSet( "" ), | 129 | // Resource::loadIconSet( "" ), |
130 | QString::null, 0, this, 0 ); | 130 | QString::null, 0, this, 0 ); |
131 | connect( cfgact, SIGNAL( activated() ), | 131 | connect( cfgact, SIGNAL( activated() ), |
132 | SLOT( showSettingsSrv() ) ); | 132 | SLOT( showSettingsSrv() ) ); |
133 | cfgact->addTo( cfgMenu ); | 133 | cfgact->addTo( cfgMenu ); |
134 | cfgact = new QAction( tr( "Destinations" ), | 134 | cfgact = new QAction( tr( "Destinations" ), |
135 | //Resource::loadIconSet( "" ), | 135 | //Resource::loadIconSet( "" ), |
136 | QString::null, 0, this, 0 ); | 136 | QString::null, 0, this, 0 ); |
137 | connect( cfgact, SIGNAL( activated() ), | 137 | connect( cfgact, SIGNAL( activated() ), |
138 | SLOT( showSettingsDst() ) ); | 138 | SLOT( showSettingsDst() ) ); |
139 | cfgact->addTo( cfgMenu ); | 139 | cfgact->addTo( cfgMenu ); |
140 | 140 | ||
141 | QAction *a; | 141 | QAction *a; |
142 | 142 | ||
143 | sectionBar = new QPEToolBar( this ); | 143 | sectionBar = new QPEToolBar( this ); |
144 | addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); | 144 | addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); |
145 | sectionBar->setHorizontalStretchable( true ); | 145 | sectionBar->setHorizontalStretchable( true ); |
146 | QLabel *label = new QLabel( tr("Section: "), sectionBar ); | 146 | QLabel *label = new QLabel( tr("Section: "), sectionBar ); |
147 | label->setBackgroundColor( sectionBar->backgroundColor() ); | 147 | label->setBackgroundColor( sectionBar->backgroundColor() ); |
148 | sectionBar->setStretchableWidget( label ); | ||
148 | section = new QComboBox( false, sectionBar ); | 149 | section = new QComboBox( false, sectionBar ); |
149 | // section->setBackgroundMode( PaletteBackground ); | 150 | // section->setBackgroundMode( PaletteBackground ); |
150 | label = new QLabel( " / ", sectionBar ); | 151 | label = new QLabel( " / ", sectionBar ); |
151 | label->setBackgroundColor( sectionBar->backgroundColor() ); | 152 | label->setBackgroundColor( sectionBar->backgroundColor() ); |
152 | subsection = new QComboBox( false, sectionBar ); | 153 | subsection = new QComboBox( false, sectionBar ); |
153 | sectionBar->setStretchableWidget( label ); | ||
154 | 154 | ||
155 | a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 155 | a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
156 | connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); | 156 | connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); |
157 | a->addTo( sectionBar ); | 157 | a->addTo( sectionBar ); |
158 | 158 | ||
159 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); | 159 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); |
160 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); | 160 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); |
161 | sectionAction->setToggleAction( true ); | 161 | sectionAction->setToggleAction( true ); |
162 | sectionAction->setOn( true ); | 162 | sectionAction->setOn( true ); |
163 | sectionAction->addTo( viewMenu ); | 163 | sectionAction->addTo( viewMenu ); |
164 | 164 | ||
165 | findBar = new QPEToolBar(this); | 165 | findBar = new QPEToolBar(this); |
166 | addToolBar( findBar, "Search", QMainWindow::Top, TRUE ); | 166 | addToolBar( findBar, "Search", QMainWindow::Top, TRUE ); |
167 | label = new QLabel( tr("Filter: "), findBar ); | 167 | label = new QLabel( tr("Filter: "), findBar ); |
168 | label->setBackgroundColor( findBar->backgroundColor() ); | 168 | label->setBackgroundColor( findBar->backgroundColor() ); |
169 | findBar->setHorizontalStretchable( TRUE ); | 169 | findBar->setHorizontalStretchable( TRUE ); |
170 | findEdit = new QLineEdit( findBar, "findEdit" ); | 170 | findEdit = new QLineEdit( findBar, "findEdit" ); |
171 | findBar->setStretchableWidget( findEdit ); | 171 | findBar->setStretchableWidget( findEdit ); |
172 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), | 172 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), |
173 | this, SLOT( displayList() ) ); | 173 | this, SLOT( displayList() ) ); |
174 | //a = new QAction( tr( "Filter" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); | 174 | //a = new QAction( tr( "Filter" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); |
175 | // connect( a, SIGNAL( activated() ), this, SLOT( filterList() ) ); | 175 | // connect( a, SIGNAL( activated() ), this, SLOT( filterList() ) ); |
176 | // a->addTo( findBar ); | 176 | // a->addTo( findBar ); |
177 | // a->addTo( edit ); | 177 | // a->addTo( edit ); |
178 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 178 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
179 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); | 179 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); |
180 | a->addTo( findBar ); | 180 | a->addTo( findBar ); |
181 | findAction = new QAction( tr( "Find" ), QString::null, 0, this, 0 ); | 181 | findAction = new QAction( tr( "Find" ), QString::null, 0, this, 0 ); |
182 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); | 182 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); |
183 | findAction->setToggleAction( true ); | 183 | findAction->setToggleAction( true ); |
184 | findAction->setOn( true ); | 184 | findAction->setOn( true ); |
185 | findAction->addTo( viewMenu ); | 185 | findAction->addTo( viewMenu ); |
186 | 186 | ||
187 | } | 187 | } |
188 | 188 | ||
189 | MainWindow::~MainWindow() | 189 | MainWindow::~MainWindow() |
190 | { | 190 | { |
191 | } | 191 | } |
192 | 192 | ||
193 | void MainWindow::runIpkg() | 193 | void MainWindow::runIpkg() |
194 | { | 194 | { |
195 | ipkg->commit( packageList ); | 195 | ipkg->commit( packageList ); |
196 | updateList(); //to remove | 196 | updateList(); //to remove |
197 | } | 197 | } |
198 | 198 | ||
199 | void MainWindow::updateList() | 199 | void MainWindow::updateList() |
200 | { | 200 | { |
201 | packageList.clear(); | 201 | packageList.clear(); |
202 | ipkg->update(); | 202 | ipkg->update(); |
203 | getList(); | 203 | getList(); |
204 | } | 204 | } |
205 | 205 | ||
206 | void MainWindow::getList() | 206 | void MainWindow::getList() |
207 | { | 207 | { |
208 | packageList.update(); | 208 | packageList.update(); |
209 | displayList(); | 209 | displayList(); |
210 | } | 210 | } |
211 | 211 | ||
212 | void MainWindow::filterList() | 212 | void MainWindow::filterList() |
213 | { | 213 | { |
214 | QString f = ""; | 214 | QString f = ""; |
215 | if ( findAction->isOn() ) f = findEdit->text(); | 215 | if ( findAction->isOn() ) f = findEdit->text(); |
216 | packageList.filterPackages( f ); | 216 | packageList.filterPackages( f ); |
217 | } | 217 | } |
218 | 218 | ||
219 | void MainWindow::displayList() | 219 | void MainWindow::displayList() |
220 | { | 220 | { |
221 | filterList(); | 221 | filterList(); |
222 | listViewPackages->clear(); | 222 | listViewPackages->clear(); |
223 | Package *pack = packageList.first(); | 223 | Package *pack = packageList.first(); |
224 | while( pack ) | 224 | while( pack ) |
225 | { | 225 | { |
226 | if ( pack && (pack->name() != "") ) | 226 | if ( pack && (pack->name() != "") ) |
227 | listViewPackages->insertItem( new PackageListItem( listViewPackages, pack ) ); | 227 | listViewPackages->insertItem( new PackageListItem( listViewPackages, pack ) ); |
228 | pack = packageList.next(); | 228 | pack = packageList.next(); |
229 | } | 229 | } |
230 | } | 230 | } |
231 | 231 | ||
232 | void MainWindow::sectionChanged() | 232 | void MainWindow::sectionChanged() |
233 | { | 233 | { |
234 | disconnect( section, SIGNAL( activated(int) ), | 234 | disconnect( section, SIGNAL( activated(int) ), |
235 | this, SLOT( sectionChanged() ) ); | 235 | this, SLOT( sectionChanged() ) ); |
236 | disconnect( subsection, SIGNAL(activated(int) ), | 236 | disconnect( subsection, SIGNAL(activated(int) ), |
237 | this, SLOT( subSectionChanged() ) ); | 237 | this, SLOT( subSectionChanged() ) ); |
238 | subsection->clear(); | 238 | subsection->clear(); |
239 | packageList.setSection( section->currentText() ); | 239 | packageList.setSection( section->currentText() ); |
240 | setSubSections(); | 240 | setSubSections(); |
241 | connect( section, SIGNAL( activated(int) ), | 241 | connect( section, SIGNAL( activated(int) ), |
242 | this, SLOT( sectionChanged() ) ); | 242 | this, SLOT( sectionChanged() ) ); |
243 | connect( subsection, SIGNAL(activated(int) ), | 243 | connect( subsection, SIGNAL(activated(int) ), |
244 | this, SLOT( subSectionChanged() ) ); | 244 | this, SLOT( subSectionChanged() ) ); |
245 | displayList(); | 245 | displayList(); |
246 | } | 246 | } |
247 | 247 | ||
248 | void MainWindow::subSectionChanged() | 248 | void MainWindow::subSectionChanged() |
249 | { | 249 | { |
250 | disconnect( section, SIGNAL( activated(int) ), | 250 | disconnect( section, SIGNAL( activated(int) ), |
251 | this, SLOT( sectionChanged() ) ); | 251 | this, SLOT( sectionChanged() ) ); |
252 | disconnect( subsection, SIGNAL(activated(int) ), | 252 | disconnect( subsection, SIGNAL(activated(int) ), |
253 | this, SLOT( subSectionChanged() ) ); | 253 | this, SLOT( subSectionChanged() ) ); |
254 | packageList.setSubSection( subsection->currentText() ); | 254 | packageList.setSubSection( subsection->currentText() ); |
255 | connect( section, SIGNAL( activated(int) ), | 255 | connect( section, SIGNAL( activated(int) ), |
256 | this, SLOT( sectionChanged() ) ); | 256 | this, SLOT( sectionChanged() ) ); |
257 | connect( subsection, SIGNAL(activated(int) ), | 257 | connect( subsection, SIGNAL(activated(int) ), |
258 | this, SLOT( subSectionChanged() ) ); | 258 | this, SLOT( subSectionChanged() ) ); |
259 | displayList(); | 259 | displayList(); |
260 | } | 260 | } |
261 | 261 | ||
262 | void MainWindow::setSections() | 262 | void MainWindow::setSections() |
263 | { | 263 | { |
264 | section->clear(); | 264 | section->clear(); |
265 | section->insertStringList( packageList.getSections() ); | 265 | section->insertStringList( packageList.getSections() ); |
266 | } | 266 | } |
267 | 267 | ||
268 | void MainWindow::setSubSections() | 268 | void MainWindow::setSubSections() |
269 | { | 269 | { |
270 | subsection->clear(); | 270 | subsection->clear(); |
271 | subsection->insertStringList( packageList.getSubSections() ); | 271 | subsection->insertStringList( packageList.getSubSections() ); |
272 | } | 272 | } |
273 | 273 | ||
274 | 274 | ||
275 | void MainWindow::showSettings() | 275 | void MainWindow::showSettings() |
276 | { | 276 | { |
277 | if ( settings->showDialog( 0 ) ) | 277 | if ( settings->showDialog( 0 ) ) |
278 | getList(); | 278 | updateList(); |
279 | } | 279 | } |
280 | void MainWindow::showSettingsSrv() | 280 | void MainWindow::showSettingsSrv() |
281 | { | 281 | { |
282 | if ( settings->showDialog( 1 ) ) | 282 | if ( settings->showDialog( 1 ) ) |
283 | getList(); | 283 | updateList(); |
284 | } | 284 | } |
285 | void MainWindow::showSettingsDst() | 285 | void MainWindow::showSettingsDst() |
286 | { | 286 | { |
287 | if ( settings->showDialog( 2 ) ) | 287 | if ( settings->showDialog( 2 ) ) |
288 | getList(); | 288 | updateList(); |
289 | } | 289 | } |
290 | 290 | ||
291 | 291 | ||
292 | void MainWindow::showDetails() | 292 | void MainWindow::showDetails() |
293 | { | 293 | { |
294 | if ( activePackage ) return; | 294 | if ( activePackage ) return; |
295 | if ( details ) | 295 | if ( details ) |
296 | { | 296 | { |
297 | details = new PackageDetails( this ); | 297 | details = new PackageDetails( this ); |
298 | connect( details->install, SIGNAL(clicked()), SLOT( toggleActivePackage() ) ); | 298 | connect( details->install, SIGNAL(clicked()), SLOT( toggleActivePackage() ) ); |
299 | connect( details->remove, SIGNAL(clicked()), SLOT( toggleActivePackage() ) ); | 299 | connect( details->remove, SIGNAL(clicked()), SLOT( toggleActivePackage() ) ); |
300 | connect( details->ignore, SIGNAL(clicked()), details, SLOT(close())); | 300 | connect( details->ignore, SIGNAL(clicked()), details, SLOT(close())); |
301 | details->description->setTextFormat(RichText); | 301 | details->description->setTextFormat(RichText); |
302 | } | 302 | } |
303 | 303 | ||
304 | details->setCaption("Package: " + activePackage->name()); | 304 | details->setCaption("Package: " + activePackage->name()); |
305 | details->description->setText(activePackage->details() ); | 305 | details->description->setText(activePackage->details() ); |
306 | details->install->setEnabled(!activePackage->installed()); | 306 | details->install->setEnabled(!activePackage->installed()); |
307 | details->remove->setEnabled(activePackage->installed()); | 307 | details->remove->setEnabled(activePackage->installed()); |
308 | details->showMaximized(); | 308 | details->showMaximized(); |
309 | } | 309 | } |
310 | 310 | ||
311 | void MainWindow::toggleActivePackage() | 311 | void MainWindow::toggleActivePackage() |
312 | { | 312 | { |
313 | activePackage->toggleProcess(); | 313 | activePackage->toggleProcess(); |
314 | if ( details ) details->close(); | 314 | if ( details ) details->close(); |
315 | } | 315 | } |
316 | 316 | ||
317 | void MainWindow::setCurrent( QListViewItem* p ) | 317 | void MainWindow::setCurrent( QListViewItem* p ) |
318 | { | 318 | { |
319 | pvDebug(2, "MainWindow::setCurrent "); | 319 | pvDebug(2, "MainWindow::setCurrent "); |
320 | return; | 320 | return; |
321 | pvDebug(2, "name "+((Package*)p)->name()); | 321 | pvDebug(2, "name "+((Package*)p)->name()); |
322 | activePackage = (Package*)p; | 322 | activePackage = (Package*)p; |
323 | } | 323 | } |
324 | 324 | ||
325 | void MainWindow::sectionShow(bool b) | 325 | void MainWindow::sectionShow(bool b) |
326 | { | 326 | { |
327 | if (b) sectionBar->show(); | 327 | if (b) sectionBar->show(); |
328 | else sectionBar->hide(); | 328 | else sectionBar->hide(); |
329 | sectionAction->setOn( b ); | 329 | sectionAction->setOn( b ); |
330 | } | 330 | } |
331 | 331 | ||
332 | void MainWindow::sectionClose() | 332 | void MainWindow::sectionClose() |
333 | { | 333 | { |
334 | sectionAction->setOn( false ); | 334 | sectionAction->setOn( false ); |
335 | } | 335 | } |
336 | 336 | ||
337 | void MainWindow::findShow(bool b) | 337 | void MainWindow::findShow(bool b) |
338 | { | 338 | { |
339 | if (b) findBar->show(); | 339 | if (b) findBar->show(); |
340 | else findBar->hide(); | 340 | else findBar->hide(); |
341 | findAction->setOn( b ); | 341 | findAction->setOn( b ); |
342 | } | 342 | } |
343 | 343 | ||
344 | void MainWindow::findClose() | 344 | void MainWindow::findClose() |
345 | { | 345 | { |
346 | findAction->setOn( false ); | 346 | findAction->setOn( false ); |
347 | } | 347 | } |
348 | 348 | ||
diff --git a/noncore/unsupported/oipkg/oipkg.pro b/noncore/unsupported/oipkg/oipkg.pro index c16cc73..955c7f3 100644 --- a/noncore/unsupported/oipkg/oipkg.pro +++ b/noncore/unsupported/oipkg/oipkg.pro | |||
@@ -1,26 +1,25 @@ | |||
1 | DESTDIR = $(OPIEDIR)/bin | 1 | DESTDIR = $(OPIEDIR)/bin |
2 | TEMPLATE= app | 2 | TEMPLATE= app |
3 | #CONFIG = qt warn_on release | 3 | #CONFIG = qt warn_on release |
4 | CONFIG = qt warn_on debug | 4 | CONFIG = qt warn_on debug |
5 | HEADERS = mainwindow.h \ | 5 | HEADERS = mainwindow.h \ |
6 | pksettings.h \ | 6 | pksettings.h \ |
7 | pmipkg.h \ | 7 | pmipkg.h \ |
8 | packagelistitem.h \ | 8 | packagelistitem.h \ |
9 | packagelist.h \ | 9 | packagelist.h \ |
10 | package.h | 10 | package.h |
11 | SOURCES = main.cpp \ | 11 | SOURCES = main.cpp \ |
12 | mainwindow.cpp \ | 12 | mainwindow.cpp \ |
13 | pksettings.cpp \ | 13 | pksettings.cpp \ |
14 | pmipkg.cpp \ | 14 | pmipkg.cpp \ |
15 | packagelistitem.cpp \ | 15 | packagelistitem.cpp \ |
16 | packagelist.cpp \ | 16 | packagelist.cpp \ |
17 | package.cpp | 17 | package.cpp |
18 | INCLUDEPATH += $(OPIEDIR)/include | 18 | INCLUDEPATH += $(OPIEDIR)/include |
19 | DEPENDPATH+= $(OPIEDIR)/include | 19 | DEPENDPATH+= $(OPIEDIR)/ioclude |
20 | LIBS += -lqpe | 20 | LIBS += -lqpe |
21 | INTERFACES= pkdesc.ui \ | 21 | INTERFACES= pkdesc.ui \ |
22 | pkfind.ui \ | ||
23 | runwindow.ui \ | 22 | runwindow.ui \ |
24 | pksettingsbase.ui | 23 | pksettingsbase.ui |
25 | TARGET = oipkg | 24 | TARGET = oipkg |
26 | 25 | ||
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index e317308..1705f78 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp | |||
@@ -1,255 +1,263 @@ | |||
1 | #include "package.h" | 1 | #include "package.h" |
2 | 2 | ||
3 | #include <qpe/process.h> | 3 | #include <qpe/process.h> |
4 | #include <qpe/stringutil.h> | 4 | #include <qpe/stringutil.h> |
5 | 5 | ||
6 | #include "debug.h" | 6 | #include "debug.h" |
7 | 7 | ||
8 | Package::~Package() | 8 | Package::~Package() |
9 | { | 9 | { |
10 | } | 10 | } |
11 | 11 | ||
12 | Package::Package() | 12 | Package::Package() |
13 | { | 13 | { |
14 | _size = ""; | 14 | _size = ""; |
15 | _section = ""; | 15 | _section = ""; |
16 | _subsection = ""; | 16 | _subsection = ""; |
17 | _shortDesc = ""; | 17 | _shortDesc = ""; |
18 | _desc = ""; | 18 | _desc = ""; |
19 | _name = ""; | 19 | _name = ""; |
20 | _toProcess = true; | 20 | _toProcess = false; |
21 | _status = ""; | 21 | _status = ""; |
22 | } | 22 | } |
23 | 23 | ||
24 | Package::Package( QStringList pack ) | 24 | Package::Package( QStringList pack ) |
25 | { | 25 | { |
26 | Package(); | 26 | Package(); |
27 | parsePackage( pack ); | 27 | parsePackage( pack ); |
28 | _toProcess = false; | 28 | _toProcess = false; |
29 | } | 29 | } |
30 | 30 | ||
31 | Package::Package( QString n ) | 31 | Package::Package( QString n ) |
32 | { | 32 | { |
33 | Package(); | 33 | Package(); |
34 | _name = QString( n ); | 34 | _name = QString( n ); |
35 | _toProcess = false; | 35 | _toProcess = false; |
36 | } | 36 | } |
37 | 37 | ||
38 | Package::Package( Package *pi ) | 38 | Package::Package( Package *pi ) |
39 | { | 39 | { |
40 | Package(); | 40 | Package(); |
41 | copyValues( pi ); | 41 | copyValues( pi ); |
42 | _toProcess = false; | 42 | _toProcess = false; |
43 | } | 43 | } |
44 | 44 | ||
45 | 45 | ||
46 | void Package::setValue( QString n, QString t ) | 46 | void Package::setValue( QString n, QString t ) |
47 | { | 47 | { |
48 | if ( n == "Status" && installed() ) return; | 48 | if ( n == "Status" && installed() ) return; |
49 | if ( n == "Package" ) | 49 | if ( n == "Package" ) |
50 | { | 50 | { |
51 | _name = QString( t ); | 51 | _name = QString( t ); |
52 | } | 52 | } |
53 | if ( n == "Installed-Size" ) | 53 | if ( n == "Installed-Size" ) |
54 | { | 54 | { |
55 | _size = t; | 55 | _size = t; |
56 | } | 56 | } |
57 | if ( n == "Priority") | 57 | if ( n == "Priority") |
58 | { | 58 | { |
59 | 59 | ||
60 | } | 60 | } |
61 | if ( n == "Section") | 61 | if ( n == "Section") |
62 | { | 62 | { |
63 | setSection( t ); | 63 | setSection( t ); |
64 | } | 64 | } |
65 | if ( n == "Maintainer") | 65 | if ( n == "Maintainer") |
66 | { | 66 | { |
67 | 67 | ||
68 | } | 68 | } |
69 | if ( n == "Architecture") | 69 | if ( n == "Architecture") |
70 | { | 70 | { |
71 | 71 | ||
72 | } | 72 | } |
73 | if ( n == "Version") | 73 | if ( n == "Version") |
74 | { | 74 | { |
75 | 75 | ||
76 | } | 76 | } |
77 | if ( n == "Pre-Depends") | 77 | if ( n == "Pre-Depends") |
78 | { | 78 | { |
79 | 79 | ||
80 | } | 80 | } |
81 | if ( n == "Depends") | 81 | if ( n == "Depends") |
82 | { | 82 | { |
83 | 83 | ||
84 | }else if ( n == "Filename") | 84 | }else if ( n == "Filename") |
85 | { | 85 | { |
86 | 86 | ||
87 | }else if ( n == "Size") | 87 | }else if ( n == "Size") |
88 | { | 88 | { |
89 | 89 | ||
90 | }else if ( n == "MD5Sum") | 90 | }else if ( n == "MD5Sum") |
91 | { | 91 | { |
92 | 92 | ||
93 | } | 93 | } |
94 | if ( n == "Description") | 94 | if ( n == "Description") |
95 | { | 95 | { |
96 | setDesc( t ); | 96 | setDesc( t ); |
97 | } | 97 | } |
98 | if ( n == "Status") | 98 | if ( n == "Status") |
99 | { | 99 | { |
100 | if ( installed() ) return; | 100 | if ( installed() ) return; |
101 | _status = t; | 101 | _status = t; |
102 | } | 102 | } |
103 | if ( t == "Essential") | 103 | if ( t == "Essential") |
104 | { | 104 | { |
105 | 105 | ||
106 | } | 106 | } |
107 | }; | 107 | }; |
108 | 108 | ||
109 | QString Package::name() | 109 | QString Package::name() |
110 | { | 110 | { |
111 | return _name; | 111 | return _name; |
112 | } | 112 | } |
113 | 113 | ||
114 | bool Package::installed() | 114 | bool Package::installed() |
115 | { | 115 | { |
116 | return _status.contains("installed"); | 116 | return _status.contains("installed"); |
117 | } | 117 | } |
118 | 118 | ||
119 | void Package::setDesc( QString s ) | 119 | void Package::setDesc( QString s ) |
120 | { | 120 | { |
121 | _desc = s; | 121 | _desc = s; |
122 | _shortDesc = s.left( s.find("\n") ); | 122 | _shortDesc = s.left( s.find("\n") ); |
123 | } | 123 | } |
124 | 124 | ||
125 | QString Package::desc() | 125 | QString Package::desc() |
126 | { | 126 | { |
127 | return _desc; | 127 | return _desc; |
128 | } | 128 | } |
129 | 129 | ||
130 | QString Package::shortDesc() | 130 | QString Package::shortDesc() |
131 | { | 131 | { |
132 | return _shortDesc; | 132 | return _shortDesc; |
133 | } | 133 | } |
134 | 134 | ||
135 | QString Package::size() | 135 | QString Package::size() |
136 | { | 136 | { |
137 | return _size; | 137 | return _size; |
138 | } | 138 | } |
139 | 139 | ||
140 | bool Package::toProcess() | 140 | bool Package::toProcess() |
141 | { | 141 | { |
142 | return _toProcess; | 142 | return _toProcess; |
143 | } | 143 | } |
144 | 144 | ||
145 | bool Package::toRemove() | 145 | bool Package::toRemove() |
146 | { | 146 | { |
147 | if ( _toProcess && installed() ) return true; | 147 | if ( _toProcess && installed() ) return true; |
148 | else return false; | 148 | else return false; |
149 | } | 149 | } |
150 | 150 | ||
151 | bool Package::toInstall() | 151 | bool Package::toInstall() |
152 | { | 152 | { |
153 | if ( _toProcess && !installed() ) return true; | 153 | if ( _toProcess && !installed() ) return true; |
154 | else return false; | 154 | else return false; |
155 | } | 155 | } |
156 | 156 | ||
157 | void Package::toggleProcess() | 157 | void Package::toggleProcess() |
158 | { | 158 | { |
159 | _toProcess = ! _toProcess; | 159 | _toProcess = ! _toProcess; |
160 | } | 160 | } |
161 | 161 | ||
162 | 162 | ||
163 | 163 | ||
164 | void Package::copyValues( Package* pack ) | 164 | void Package::copyValues( Package* pack ) |
165 | { | 165 | { |
166 | if (_size.isEmpty() && !pack->_size.isEmpty()) _size = QString( pack->_size ); | 166 | if (_size.isEmpty() && !pack->_size.isEmpty()) _size = QString( pack->_size ); |
167 | if (_section.isEmpty() && !pack->_section.isEmpty()) _section = QString( pack->_section ); | 167 | if (_section.isEmpty() && !pack->_section.isEmpty()) _section = QString( pack->_section ); |
168 | if (_subsection.isEmpty()&& !pack->_subsection.isEmpty()) _subsection = QString( pack->_subsection ); | 168 | if (_subsection.isEmpty()&& !pack->_subsection.isEmpty()) _subsection = QString( pack->_subsection ); |
169 | if (_shortDesc.isEmpty() && !pack->_shortDesc.isEmpty()) _shortDesc = QString( pack->_shortDesc ); | 169 | if (_shortDesc.isEmpty() && !pack->_shortDesc.isEmpty()) _shortDesc = QString( pack->_shortDesc ); |
170 | if (_desc.isEmpty() && !pack->_desc.isEmpty()) _desc = QString( pack->_desc ); | 170 | if (_desc.isEmpty() && !pack->_desc.isEmpty()) _desc = QString( pack->_desc ); |
171 | if (_name.isEmpty() && !pack->_name.isEmpty()) _name = QString( pack->_name ); | 171 | if (_name.isEmpty() && !pack->_name.isEmpty()) _name = QString( pack->_name ); |
172 | if (!installed() && _status.isEmpty() && !pack->_status.isEmpty()) _status = QString( pack->_status ); | 172 | if (!installed() && _status.isEmpty() && !pack->_status.isEmpty()) _status = QString( pack->_status ); |
173 | } | 173 | } |
174 | 174 | ||
175 | QString Package::getSection() | 175 | QString Package::getSection() |
176 | { | 176 | { |
177 | return _section; | 177 | return _section; |
178 | } | 178 | } |
179 | 179 | ||
180 | void Package::setSection( QString s) | 180 | void Package::setSection( QString s) |
181 | { | 181 | { |
182 | int i = s.find("/"); | 182 | int i = s.find("/"); |
183 | if ( i > 0 ) | 183 | if ( i > 0 ) |
184 | { | 184 | { |
185 | _section = s.left(i); | 185 | _section = s.left(i); |
186 | _subsection = s.mid(i+1); | 186 | _subsection = s.mid(i+1); |
187 | }else{ | 187 | }else{ |
188 | _section = s; | 188 | _section = s; |
189 | _subsection = ""; | 189 | _subsection = ""; |
190 | } | 190 | } |
191 | } | 191 | } |
192 | 192 | ||
193 | QString Package::getSubSection() | 193 | QString Package::getSubSection() |
194 | { | 194 | { |
195 | return _subsection; | 195 | return _subsection; |
196 | } | 196 | } |
197 | 197 | ||
198 | void Package::parsePackage( QStringList pack ) | 198 | void Package::parsePackage( QStringList pack ) |
199 | { | 199 | { |
200 | if ( pack.isEmpty() ) return; | 200 | if ( pack.isEmpty() ) return; |
201 | int count = pack.count(); | 201 | int count = pack.count(); |
202 | for( int i = 0; i < count; i++ ) | 202 | for( int i = 0; i < count; i++ ) |
203 | { | 203 | { |
204 | QString line = pack[i]; | 204 | QString line = pack[i]; |
205 | int sep = line.find( QRegExp(":[\t ]+") ); | 205 | int sep = line.find( QRegExp(":[\t ]+") ); |
206 | if ( sep >= 0 ) | 206 | if ( sep >= 0 ) |
207 | { | 207 | { |
208 | QString tag = line.left(sep); | 208 | QString tag = line.left(sep); |
209 | QString value = line.mid(sep+2).simplifyWhiteSpace(); | 209 | QString value = line.mid(sep+2).simplifyWhiteSpace(); |
210 | setValue( tag, value ); | 210 | setValue( tag, value ); |
211 | }else{ | 211 | }else{ |
212 | } | 212 | } |
213 | } | 213 | } |
214 | return; | 214 | return; |
215 | } | 215 | } |
216 | 216 | ||
217 | QString Package::details() | 217 | QString Package::details() |
218 | { | 218 | { |
219 | QString status; | 219 | QString status; |
220 | Process ipkg_status(QStringList() << "ipkg" << "info" << name() ); | 220 | Process ipkg_status(QStringList() << "ipkg" << "info" << name() ); |
221 | QString description; | 221 | QString description; |
222 | if ( ipkg_status.exec("",status) ) | 222 | if ( ipkg_status.exec("",status) ) |
223 | { | 223 | { |
224 | QStringList lines = QStringList::split('\n',status,TRUE); | 224 | QStringList lines = QStringList::split('\n',status,TRUE); |
225 | for (QStringList::Iterator it = lines.begin(); it!=lines.end(); ++it) { | 225 | for (QStringList::Iterator it = lines.begin(); it!=lines.end(); ++it) { |
226 | QString line = *it; | 226 | QString line = *it; |
227 | if ( line == " ." ) | 227 | if ( line == " ." ) |
228 | { | 228 | { |
229 | description.append("<p>"); | 229 | description.append("<p>"); |
230 | } else | 230 | } else |
231 | if ( line[0] == ' ' || line[0] == '\t' ) | 231 | if ( line[0] == ' ' || line[0] == '\t' ) |
232 | { | 232 | { |
233 | // continuation | 233 | // continuation |
234 | description.append(" "); | 234 | description.append(" "); |
235 | description.append(Qtopia::escapeString(line)); | 235 | description.append(Qtopia::escapeString(line)); |
236 | } else { | 236 | } else { |
237 | int sep = line.find(QRegExp(":[\t ]+")); | 237 | int sep = line.find(QRegExp(":[\t ]+")); |
238 | if ( sep >= 0 ) | 238 | if ( sep >= 0 ) |
239 | { | 239 | { |
240 | QString tag = line.left(sep); | 240 | QString tag = line.left(sep); |
241 | description.append("<br>"); | 241 | description.append("<br>"); |
242 | description.append("<b>"); | 242 | description.append("<b>"); |
243 | description.append(Qtopia::escapeString(tag)); | 243 | description.append(Qtopia::escapeString(tag)); |
244 | description.append(":</b> "); | 244 | description.append(":</b> "); |
245 | description.append(Qtopia::escapeString(line.mid(sep+2))); | 245 | description.append(Qtopia::escapeString(line.mid(sep+2))); |
246 | } else { | 246 | } else { |
247 | description.append(" "); | 247 | description.append(" "); |
248 | description.append(Qtopia::escapeString(line)); | 248 | description.append(Qtopia::escapeString(line)); |
249 | } | 249 | } |
250 | } | 250 | } |
251 | } | 251 | } |
252 | } | 252 | } |
253 | return description; | 253 | return description; |
254 | } | 254 | } |
255 | 255 | ||
256 | /** No descriptions */ | ||
257 | void Package::processed() | ||
258 | { | ||
259 | _toProcess = false; | ||
260 | //hack, but we're mot writing status anyway... | ||
261 | if ( installed() ) _status = "install"; | ||
262 | else _status = "installed"; | ||
263 | } | ||
diff --git a/noncore/unsupported/oipkg/package.h b/noncore/unsupported/oipkg/package.h index 08d0c57..cf2af75 100644 --- a/noncore/unsupported/oipkg/package.h +++ b/noncore/unsupported/oipkg/package.h | |||
@@ -1,54 +1,56 @@ | |||
1 | #ifndef PK_ITEM_H | 1 | #ifndef PK_ITEM_H |
2 | #define PK_ITEM_H | 2 | #define PK_ITEM_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qlistview.h> | 5 | #include <qlistview.h> |
6 | #include <qpainter.h> | 6 | #include <qpainter.h> |
7 | #include <qpixmap.h> | 7 | #include <qpixmap.h> |
8 | #include <qdict.h> | 8 | #include <qdict.h> |
9 | #include <qobject.h> | 9 | #include <qobject.h> |
10 | 10 | ||
11 | class Package //: public QObject | 11 | class Package //: public QObject |
12 | { | 12 | { |
13 | //Q_OBJECT | 13 | //Q_OBJECT |
14 | public: | 14 | public: |
15 | Package(); | 15 | Package(); |
16 | ~Package(); | 16 | ~Package(); |
17 | Package( QStringList ); | 17 | Package( QStringList ); |
18 | Package( QString ); | 18 | Package( QString ); |
19 | Package( Package* ); | 19 | Package( Package* ); |
20 | 20 | ||
21 | void setValue( QString, QString ); | 21 | void setValue( QString, QString ); |
22 | void copyValues( Package* ); | 22 | void copyValues( Package* ); |
23 | 23 | ||
24 | QString name() ; | 24 | QString name() ; |
25 | bool installed(); | 25 | bool installed(); |
26 | 26 | ||
27 | void setDesc( QString ); | 27 | void setDesc( QString ); |
28 | QString shortDesc(); | 28 | QString shortDesc(); |
29 | QString desc(); | 29 | QString desc(); |
30 | QString size(); | 30 | QString size(); |
31 | void setSection( QString ); | 31 | void setSection( QString ); |
32 | QString getSection(); | 32 | QString getSection(); |
33 | QString getSubSection(); | 33 | QString getSubSection(); |
34 | QString details(); | 34 | QString details(); |
35 | bool toProcess(); | 35 | bool toProcess(); |
36 | bool toInstall(); | 36 | bool toInstall(); |
37 | bool toRemove(); | 37 | bool toRemove(); |
38 | /** No descriptions */ | ||
39 | void processed(); | ||
38 | public slots: | 40 | public slots: |
39 | void toggleProcess(); | 41 | void toggleProcess(); |
40 | 42 | ||
41 | private: | 43 | private: |
42 | QString _name; | 44 | QString _name; |
43 | bool _toProcess; | 45 | bool _toProcess; |
44 | QString _status; | 46 | QString _status; |
45 | QString _size; | 47 | QString _size; |
46 | QString _section; | 48 | QString _section; |
47 | QString _subsection; | 49 | QString _subsection; |
48 | QString _shortDesc; | 50 | QString _shortDesc; |
49 | QString _desc; | 51 | QString _desc; |
50 | void parsePackage( QStringList ); | 52 | void parsePackage( QStringList ); |
51 | }; | 53 | }; |
52 | 54 | ||
53 | 55 | ||
54 | #endif | 56 | #endif |
diff --git a/noncore/unsupported/oipkg/pksettingsbase.ui b/noncore/unsupported/oipkg/pksettingsbase.ui index ea507a8..196a89f 100644 --- a/noncore/unsupported/oipkg/pksettingsbase.ui +++ b/noncore/unsupported/oipkg/pksettingsbase.ui | |||
@@ -1,371 +1,371 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>PackageManagerSettingsBase</class> | 2 | <class>PackageManagerSettingsBase</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>Form4</cstring> | 7 | <cstring>Form4</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>353</width> | 14 | <width>349</width> |
15 | <height>454</height> | 15 | <height>454</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Package Servers</string> | 20 | <string>Package Servers</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <grid> | 28 | <grid> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>3</number> | 31 | <number>3</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>3</number> | 35 | <number>3</number> |
36 | </property> | 36 | </property> |
37 | <widget row="0" column="0" > | 37 | <widget row="0" column="0" > |
38 | <class>QTabWidget</class> | 38 | <class>QTabWidget</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>TabWidget</cstring> | 41 | <cstring>TabWidget</cstring> |
42 | </property> | 42 | </property> |
43 | <property stdset="1"> | 43 | <property stdset="1"> |
44 | <name>enabled</name> | 44 | <name>enabled</name> |
45 | <bool>true</bool> | 45 | <bool>true</bool> |
46 | </property> | 46 | </property> |
47 | <property> | 47 | <property> |
48 | <name>layoutMargin</name> | 48 | <name>layoutMargin</name> |
49 | </property> | 49 | </property> |
50 | <property> | 50 | <property> |
51 | <name>layoutSpacing</name> | 51 | <name>layoutSpacing</name> |
52 | </property> | 52 | </property> |
53 | <widget> | 53 | <widget> |
54 | <class>QWidget</class> | 54 | <class>QWidget</class> |
55 | <property stdset="1"> | 55 | <property stdset="1"> |
56 | <name>name</name> | 56 | <name>name</name> |
57 | <cstring>tab</cstring> | 57 | <cstring>tab</cstring> |
58 | </property> | 58 | </property> |
59 | <attribute> | 59 | <attribute> |
60 | <name>title</name> | 60 | <name>title</name> |
61 | <string>Settings</string> | 61 | <string>Settings</string> |
62 | </attribute> | 62 | </attribute> |
63 | <grid> | 63 | <grid> |
64 | <property stdset="1"> | 64 | <property stdset="1"> |
65 | <name>margin</name> | 65 | <name>margin</name> |
66 | <number>3</number> | 66 | <number>3</number> |
67 | </property> | 67 | </property> |
68 | <property stdset="1"> | 68 | <property stdset="1"> |
69 | <name>spacing</name> | 69 | <name>spacing</name> |
70 | <number>3</number> | 70 | <number>3</number> |
71 | </property> | 71 | </property> |
72 | <widget row="0" column="0" > | 72 | <widget row="0" column="0" > |
73 | <class>QLayoutWidget</class> | 73 | <class>QLayoutWidget</class> |
74 | <property stdset="1"> | 74 | <property stdset="1"> |
75 | <name>name</name> | 75 | <name>name</name> |
76 | <cstring>Layout3_2</cstring> | 76 | <cstring>Layout3_2</cstring> |
77 | </property> | 77 | </property> |
78 | <hbox> | 78 | <hbox> |
79 | <property stdset="1"> | 79 | <property stdset="1"> |
80 | <name>margin</name> | 80 | <name>margin</name> |
81 | <number>0</number> | 81 | <number>0</number> |
82 | </property> | 82 | </property> |
83 | <property stdset="1"> | 83 | <property stdset="1"> |
84 | <name>spacing</name> | 84 | <name>spacing</name> |
85 | <number>6</number> | 85 | <number>6</number> |
86 | </property> | 86 | </property> |
87 | <widget> | 87 | <widget> |
88 | <class>QLabel</class> | 88 | <class>QLabel</class> |
89 | <property stdset="1"> | 89 | <property stdset="1"> |
90 | <name>name</name> | 90 | <name>name</name> |
91 | <cstring>Settings</cstring> | 91 | <cstring>Settings</cstring> |
92 | </property> | 92 | </property> |
93 | <property stdset="1"> | 93 | <property stdset="1"> |
94 | <name>text</name> | 94 | <name>text</name> |
95 | <string>Installation Setups</string> | 95 | <string>Installation Setups</string> |
96 | </property> | 96 | </property> |
97 | </widget> | 97 | </widget> |
98 | <spacer> | 98 | <spacer> |
99 | <property> | 99 | <property> |
100 | <name>name</name> | 100 | <name>name</name> |
101 | <cstring>Spacer2_2_2</cstring> | 101 | <cstring>Spacer2_2_2</cstring> |
102 | </property> | 102 | </property> |
103 | <property stdset="1"> | 103 | <property stdset="1"> |
104 | <name>orientation</name> | 104 | <name>orientation</name> |
105 | <enum>Horizontal</enum> | 105 | <enum>Horizontal</enum> |
106 | </property> | 106 | </property> |
107 | <property stdset="1"> | 107 | <property stdset="1"> |
108 | <name>sizeType</name> | 108 | <name>sizeType</name> |
109 | <enum>Expanding</enum> | 109 | <enum>Expanding</enum> |
110 | </property> | 110 | </property> |
111 | <property> | 111 | <property> |
112 | <name>sizeHint</name> | 112 | <name>sizeHint</name> |
113 | <size> | 113 | <size> |
114 | <width>20</width> | 114 | <width>20</width> |
115 | <height>20</height> | 115 | <height>20</height> |
116 | </size> | 116 | </size> |
117 | </property> | 117 | </property> |
118 | </spacer> | 118 | </spacer> |
119 | </hbox> | 119 | </hbox> |
120 | </widget> | 120 | </widget> |
121 | <widget row="5" column="0" > | 121 | <widget row="5" column="0" > |
122 | <class>QLayoutWidget</class> | 122 | <class>QLayoutWidget</class> |
123 | <property stdset="1"> | 123 | <property stdset="1"> |
124 | <name>name</name> | 124 | <name>name</name> |
125 | <cstring>Layout8</cstring> | 125 | <cstring>Layout8</cstring> |
126 | </property> | 126 | </property> |
127 | <hbox> | 127 | <hbox> |
128 | <property stdset="1"> | 128 | <property stdset="1"> |
129 | <name>margin</name> | 129 | <name>margin</name> |
130 | <number>0</number> | 130 | <number>0</number> |
131 | </property> | 131 | </property> |
132 | <property stdset="1"> | 132 | <property stdset="1"> |
133 | <name>spacing</name> | 133 | <name>spacing</name> |
134 | <number>6</number> | 134 | <number>6</number> |
135 | </property> | 135 | </property> |
136 | <widget> | 136 | <widget> |
137 | <class>QLabel</class> | 137 | <class>QLabel</class> |
138 | <property stdset="1"> | 138 | <property stdset="1"> |
139 | <name>name</name> | 139 | <name>name</name> |
140 | <cstring>TextLabel1</cstring> | 140 | <cstring>TextLabel1</cstring> |
141 | </property> | 141 | </property> |
142 | <property stdset="1"> | 142 | <property stdset="1"> |
143 | <name>text</name> | 143 | <name>text</name> |
144 | <string>Install destination:</string> | 144 | <string>Install destination:</string> |
145 | </property> | 145 | </property> |
146 | </widget> | 146 | </widget> |
147 | <widget> | 147 | <widget> |
148 | <class>QComboBox</class> | 148 | <class>QComboBox</class> |
149 | <property stdset="1"> | 149 | <property stdset="1"> |
150 | <name>name</name> | 150 | <name>name</name> |
151 | <cstring>activeDestination</cstring> | 151 | <cstring>activeDestination</cstring> |
152 | </property> | 152 | </property> |
153 | </widget> | 153 | </widget> |
154 | </hbox> | 154 | </hbox> |
155 | </widget> | 155 | </widget> |
156 | <widget row="6" column="0" > | 156 | <widget row="6" column="0" > |
157 | <class>QLayoutWidget</class> | 157 | <class>QLayoutWidget</class> |
158 | <property stdset="1"> | 158 | <property stdset="1"> |
159 | <name>name</name> | 159 | <name>name</name> |
160 | <cstring>Layout9</cstring> | 160 | <cstring>Layout9</cstring> |
161 | </property> | 161 | </property> |
162 | <hbox> | 162 | <hbox> |
163 | <property stdset="1"> | 163 | <property stdset="1"> |
164 | <name>margin</name> | 164 | <name>margin</name> |
165 | <number>0</number> | 165 | <number>0</number> |
166 | </property> | 166 | </property> |
167 | <property stdset="1"> | 167 | <property stdset="1"> |
168 | <name>spacing</name> | 168 | <name>spacing</name> |
169 | <number>6</number> | 169 | <number>6</number> |
170 | </property> | 170 | </property> |
171 | <widget> | 171 | <widget> |
172 | <class>QCheckBox</class> | 172 | <class>QCheckBox</class> |
173 | <property stdset="1"> | 173 | <property stdset="1"> |
174 | <name>name</name> | 174 | <name>name</name> |
175 | <cstring>CheckBoxLink</cstring> | 175 | <cstring>CheckBoxLink</cstring> |
176 | </property> | 176 | </property> |
177 | <property stdset="1"> | 177 | <property stdset="1"> |
178 | <name>text</name> | 178 | <name>text</name> |
179 | <string>Link Destination:</string> | 179 | <string>Link Destination: root</string> |
180 | </property> | 180 | </property> |
181 | </widget> | 181 | </widget> |
182 | <widget> | 182 | <widget> |
183 | <class>QComboBox</class> | 183 | <class>QComboBox</class> |
184 | <property stdset="1"> | 184 | <property stdset="1"> |
185 | <name>name</name> | 185 | <name>name</name> |
186 | <cstring>activeLinkDestination</cstring> | 186 | <cstring>activeLinkDestination</cstring> |
187 | </property> | 187 | </property> |
188 | <property stdset="1"> | 188 | <property stdset="1"> |
189 | <name>enabled</name> | 189 | <name>enabled</name> |
190 | <bool>false</bool> | 190 | <bool>false</bool> |
191 | </property> | 191 | </property> |
192 | </widget> | 192 | </widget> |
193 | </hbox> | 193 | </hbox> |
194 | </widget> | 194 | </widget> |
195 | <widget row="3" column="0" > | 195 | <widget row="3" column="0" > |
196 | <class>QLayoutWidget</class> | 196 | <class>QLayoutWidget</class> |
197 | <property stdset="1"> | 197 | <property stdset="1"> |
198 | <name>name</name> | 198 | <name>name</name> |
199 | <cstring>Layout13</cstring> | 199 | <cstring>Layout13</cstring> |
200 | </property> | 200 | </property> |
201 | <hbox> | 201 | <hbox> |
202 | <property stdset="1"> | 202 | <property stdset="1"> |
203 | <name>margin</name> | 203 | <name>margin</name> |
204 | <number>0</number> | 204 | <number>0</number> |
205 | </property> | 205 | </property> |
206 | <property stdset="1"> | 206 | <property stdset="1"> |
207 | <name>spacing</name> | 207 | <name>spacing</name> |
208 | <number>6</number> | 208 | <number>6</number> |
209 | </property> | 209 | </property> |
210 | <widget> | 210 | <widget> |
211 | <class>QLabel</class> | 211 | <class>QLabel</class> |
212 | <property stdset="1"> | 212 | <property stdset="1"> |
213 | <name>name</name> | 213 | <name>name</name> |
214 | <cstring>TextLabel1_2</cstring> | 214 | <cstring>TextLabel1_2</cstring> |
215 | </property> | 215 | </property> |
216 | <property stdset="1"> | 216 | <property stdset="1"> |
217 | <name>text</name> | 217 | <name>text</name> |
218 | <string>Used servers:</string> | 218 | <string>Used servers:</string> |
219 | </property> | 219 | </property> |
220 | </widget> | 220 | </widget> |
221 | <spacer> | 221 | <spacer> |
222 | <property> | 222 | <property> |
223 | <name>name</name> | 223 | <name>name</name> |
224 | <cstring>Spacer4</cstring> | 224 | <cstring>Spacer4</cstring> |
225 | </property> | 225 | </property> |
226 | <property stdset="1"> | 226 | <property stdset="1"> |
227 | <name>orientation</name> | 227 | <name>orientation</name> |
228 | <enum>Horizontal</enum> | 228 | <enum>Horizontal</enum> |
229 | </property> | 229 | </property> |
230 | <property stdset="1"> | 230 | <property stdset="1"> |
231 | <name>sizeType</name> | 231 | <name>sizeType</name> |
232 | <enum>Expanding</enum> | 232 | <enum>Expanding</enum> |
233 | </property> | 233 | </property> |
234 | <property> | 234 | <property> |
235 | <name>sizeHint</name> | 235 | <name>sizeHint</name> |
236 | <size> | 236 | <size> |
237 | <width>20</width> | 237 | <width>20</width> |
238 | <height>20</height> | 238 | <height>20</height> |
239 | </size> | 239 | </size> |
240 | </property> | 240 | </property> |
241 | </spacer> | 241 | </spacer> |
242 | </hbox> | 242 | </hbox> |
243 | </widget> | 243 | </widget> |
244 | <widget row="4" column="0" > | 244 | <widget row="4" column="0" > |
245 | <class>QListBox</class> | 245 | <class>QListBox</class> |
246 | <property stdset="1"> | 246 | <property stdset="1"> |
247 | <name>name</name> | 247 | <name>name</name> |
248 | <cstring>activeServers</cstring> | 248 | <cstring>activeServers</cstring> |
249 | </property> | 249 | </property> |
250 | <property stdset="1"> | 250 | <property stdset="1"> |
251 | <name>enabled</name> | 251 | <name>enabled</name> |
252 | <bool>true</bool> | 252 | <bool>true</bool> |
253 | </property> | 253 | </property> |
254 | <property stdset="1"> | 254 | <property stdset="1"> |
255 | <name>selectionMode</name> | 255 | <name>selectionMode</name> |
256 | <enum>Multi</enum> | 256 | <enum>Multi</enum> |
257 | </property> | 257 | </property> |
258 | </widget> | 258 | </widget> |
259 | <widget row="1" column="0" > | 259 | <widget row="1" column="0" > |
260 | <class>QComboBox</class> | 260 | <class>QComboBox</class> |
261 | <property stdset="1"> | 261 | <property stdset="1"> |
262 | <name>name</name> | 262 | <name>name</name> |
263 | <cstring>settingName</cstring> | 263 | <cstring>settingName</cstring> |
264 | </property> | 264 | </property> |
265 | <property stdset="1"> | 265 | <property stdset="1"> |
266 | <name>enabled</name> | 266 | <name>enabled</name> |
267 | <bool>true</bool> | 267 | <bool>true</bool> |
268 | </property> | 268 | </property> |
269 | <property stdset="1"> | 269 | <property stdset="1"> |
270 | <name>focusPolicy</name> | 270 | <name>focusPolicy</name> |
271 | <enum>NoFocus</enum> | 271 | <enum>NoFocus</enum> |
272 | </property> | 272 | </property> |
273 | <property stdset="1"> | 273 | <property stdset="1"> |
274 | <name>editable</name> | 274 | <name>editable</name> |
275 | <bool>false</bool> | 275 | <bool>false</bool> |
276 | </property> | 276 | </property> |
277 | </widget> | 277 | </widget> |
278 | <widget row="2" column="0" > | 278 | <widget row="2" column="0" > |
279 | <class>QLayoutWidget</class> | 279 | <class>QLayoutWidget</class> |
280 | <property stdset="1"> | 280 | <property stdset="1"> |
281 | <name>name</name> | 281 | <name>name</name> |
282 | <cstring>Layout11</cstring> | 282 | <cstring>Layout11</cstring> |
283 | </property> | 283 | </property> |
284 | <hbox> | 284 | <hbox> |
285 | <property stdset="1"> | 285 | <property stdset="1"> |
286 | <name>margin</name> | 286 | <name>margin</name> |
287 | <number>0</number> | 287 | <number>0</number> |
288 | </property> | 288 | </property> |
289 | <property stdset="1"> | 289 | <property stdset="1"> |
290 | <name>spacing</name> | 290 | <name>spacing</name> |
291 | <number>6</number> | 291 | <number>6</number> |
292 | </property> | 292 | </property> |
293 | <widget> | 293 | <widget> |
294 | <class>QPushButton</class> | 294 | <class>QPushButton</class> |
295 | <property stdset="1"> | 295 | <property stdset="1"> |
296 | <name>name</name> | 296 | <name>name</name> |
297 | <cstring>newsetting</cstring> | 297 | <cstring>newsetting</cstring> |
298 | </property> | 298 | </property> |
299 | <property stdset="1"> | 299 | <property stdset="1"> |
300 | <name>enabled</name> | 300 | <name>enabled</name> |
301 | <bool>false</bool> | 301 | <bool>false</bool> |
302 | </property> | 302 | </property> |
303 | <property stdset="1"> | 303 | <property stdset="1"> |
304 | <name>text</name> | 304 | <name>text</name> |
305 | <string>New</string> | 305 | <string>New</string> |
306 | </property> | 306 | </property> |
307 | <property stdset="1"> | 307 | <property stdset="1"> |
308 | <name>autoDefault</name> | 308 | <name>autoDefault</name> |
309 | <bool>false</bool> | 309 | <bool>false</bool> |
310 | </property> | 310 | </property> |
311 | </widget> | 311 | </widget> |
312 | <widget> | 312 | <widget> |
313 | <class>QPushButton</class> | 313 | <class>QPushButton</class> |
314 | <property stdset="1"> | 314 | <property stdset="1"> |
315 | <name>name</name> | 315 | <name>name</name> |
316 | <cstring>renamesetting</cstring> | 316 | <cstring>renamesetting</cstring> |
317 | </property> | 317 | </property> |
318 | <property stdset="1"> | 318 | <property stdset="1"> |
319 | <name>enabled</name> | 319 | <name>enabled</name> |
320 | <bool>false</bool> | 320 | <bool>false</bool> |
321 | </property> | 321 | </property> |
322 | <property stdset="1"> | 322 | <property stdset="1"> |
323 | <name>text</name> | 323 | <name>text</name> |
324 | <string>Rename</string> | 324 | <string>Rename</string> |
325 | </property> | 325 | </property> |
326 | </widget> | 326 | </widget> |
327 | <widget> | 327 | <widget> |
328 | <class>QPushButton</class> | 328 | <class>QPushButton</class> |
329 | <property stdset="1"> | 329 | <property stdset="1"> |
330 | <name>name</name> | 330 | <name>name</name> |
331 | <cstring>removesetting</cstring> | 331 | <cstring>removesetting</cstring> |
332 | </property> | 332 | </property> |
333 | <property stdset="1"> | 333 | <property stdset="1"> |
334 | <name>enabled</name> | 334 | <name>enabled</name> |
335 | <bool>false</bool> | 335 | <bool>false</bool> |
336 | </property> | 336 | </property> |
337 | <property stdset="1"> | 337 | <property stdset="1"> |
338 | <name>text</name> | 338 | <name>text</name> |
339 | <string>Remove</string> | 339 | <string>Remove</string> |
340 | </property> | 340 | </property> |
341 | <property stdset="1"> | 341 | <property stdset="1"> |
342 | <name>autoDefault</name> | 342 | <name>autoDefault</name> |
343 | <bool>false</bool> | 343 | <bool>false</bool> |
344 | </property> | 344 | </property> |
345 | </widget> | 345 | </widget> |
346 | </hbox> | 346 | </hbox> |
347 | </widget> | 347 | </widget> |
348 | </grid> | 348 | </grid> |
349 | </widget> | 349 | </widget> |
350 | <widget> | 350 | <widget> |
351 | <class>QWidget</class> | 351 | <class>QWidget</class> |
352 | <property stdset="1"> | 352 | <property stdset="1"> |
353 | <name>name</name> | 353 | <name>name</name> |
354 | <cstring>tab</cstring> | 354 | <cstring>tab</cstring> |
355 | </property> | 355 | </property> |
356 | <attribute> | 356 | <attribute> |
357 | <name>title</name> | 357 | <name>title</name> |
358 | <string>Servers</string> | 358 | <string>Servers</string> |
359 | </attribute> | 359 | </attribute> |
360 | <grid> | 360 | <grid> |
361 | <property stdset="1"> | 361 | <property stdset="1"> |
362 | <name>margin</name> | 362 | <name>margin</name> |
363 | <number>3</number> | 363 | <number>3</number> |
364 | </property> | 364 | </property> |
365 | <property stdset="1"> | 365 | <property stdset="1"> |
366 | <name>spacing</name> | 366 | <name>spacing</name> |
367 | <number>3</number> | 367 | <number>3</number> |
368 | </property> | 368 | </property> |
369 | <widget row="3" column="0" rowspan="1" colspan="2" > | 369 | <widget row="3" column="0" rowspan="1" colspan="2" > |
370 | <class>QLayoutWidget</class> | 370 | <class>QLayoutWidget</class> |
371 | <property stdset="1"> | 371 | <property stdset="1"> |
@@ -529,216 +529,210 @@ | |||
529 | <name>title</name> | 529 | <name>title</name> |
530 | <string>Destinations</string> | 530 | <string>Destinations</string> |
531 | </attribute> | 531 | </attribute> |
532 | <grid> | 532 | <grid> |
533 | <property stdset="1"> | 533 | <property stdset="1"> |
534 | <name>margin</name> | 534 | <name>margin</name> |
535 | <number>3</number> | 535 | <number>3</number> |
536 | </property> | 536 | </property> |
537 | <property stdset="1"> | 537 | <property stdset="1"> |
538 | <name>spacing</name> | 538 | <name>spacing</name> |
539 | <number>3</number> | 539 | <number>3</number> |
540 | </property> | 540 | </property> |
541 | <widget row="0" column="0" > | 541 | <widget row="0" column="0" > |
542 | <class>QLayoutWidget</class> | 542 | <class>QLayoutWidget</class> |
543 | <property stdset="1"> | 543 | <property stdset="1"> |
544 | <name>name</name> | 544 | <name>name</name> |
545 | <cstring>Layout3</cstring> | 545 | <cstring>Layout3</cstring> |
546 | </property> | 546 | </property> |
547 | <hbox> | 547 | <hbox> |
548 | <property stdset="1"> | 548 | <property stdset="1"> |
549 | <name>margin</name> | 549 | <name>margin</name> |
550 | <number>0</number> | 550 | <number>0</number> |
551 | </property> | 551 | </property> |
552 | <property stdset="1"> | 552 | <property stdset="1"> |
553 | <name>spacing</name> | 553 | <name>spacing</name> |
554 | <number>6</number> | 554 | <number>6</number> |
555 | </property> | 555 | </property> |
556 | <widget> | 556 | <widget> |
557 | <class>QLabel</class> | 557 | <class>QLabel</class> |
558 | <property stdset="1"> | 558 | <property stdset="1"> |
559 | <name>name</name> | 559 | <name>name</name> |
560 | <cstring>Destinations</cstring> | 560 | <cstring>Destinations</cstring> |
561 | </property> | 561 | </property> |
562 | <property stdset="1"> | 562 | <property stdset="1"> |
563 | <name>text</name> | 563 | <name>text</name> |
564 | <string>Destinations</string> | 564 | <string>Destinations</string> |
565 | </property> | 565 | </property> |
566 | </widget> | 566 | </widget> |
567 | <spacer> | 567 | <spacer> |
568 | <property> | 568 | <property> |
569 | <name>name</name> | 569 | <name>name</name> |
570 | <cstring>Spacer2_2</cstring> | 570 | <cstring>Spacer2_2</cstring> |
571 | </property> | 571 | </property> |
572 | <property stdset="1"> | 572 | <property stdset="1"> |
573 | <name>orientation</name> | 573 | <name>orientation</name> |
574 | <enum>Horizontal</enum> | 574 | <enum>Horizontal</enum> |
575 | </property> | 575 | </property> |
576 | <property stdset="1"> | 576 | <property stdset="1"> |
577 | <name>sizeType</name> | 577 | <name>sizeType</name> |
578 | <enum>Expanding</enum> | 578 | <enum>Expanding</enum> |
579 | </property> | 579 | </property> |
580 | <property> | 580 | <property> |
581 | <name>sizeHint</name> | 581 | <name>sizeHint</name> |
582 | <size> | 582 | <size> |
583 | <width>20</width> | 583 | <width>20</width> |
584 | <height>20</height> | 584 | <height>20</height> |
585 | </size> | 585 | </size> |
586 | </property> | 586 | </property> |
587 | </spacer> | 587 | </spacer> |
588 | </hbox> | 588 | </hbox> |
589 | </widget> | 589 | </widget> |
590 | <widget row="1" column="0" > | 590 | <widget row="1" column="0" > |
591 | <class>QListBox</class> | 591 | <class>QListBox</class> |
592 | <property stdset="1"> | 592 | <property stdset="1"> |
593 | <name>name</name> | 593 | <name>name</name> |
594 | <cstring>destinations</cstring> | 594 | <cstring>destinations</cstring> |
595 | </property> | 595 | </property> |
596 | <property stdset="1"> | 596 | <property stdset="1"> |
597 | <name>selectionMode</name> | 597 | <name>selectionMode</name> |
598 | <enum>Single</enum> | 598 | <enum>Single</enum> |
599 | </property> | 599 | </property> |
600 | </widget> | 600 | </widget> |
601 | <widget row="2" column="0" > | 601 | <widget row="2" column="0" > |
602 | <class>QLayoutWidget</class> | 602 | <class>QLayoutWidget</class> |
603 | <property stdset="1"> | 603 | <property stdset="1"> |
604 | <name>name</name> | 604 | <name>name</name> |
605 | <cstring>Layout5</cstring> | 605 | <cstring>Layout5</cstring> |
606 | </property> | 606 | </property> |
607 | <hbox> | 607 | <hbox> |
608 | <property stdset="1"> | 608 | <property stdset="1"> |
609 | <name>margin</name> | 609 | <name>margin</name> |
610 | <number>0</number> | 610 | <number>0</number> |
611 | </property> | 611 | </property> |
612 | <property stdset="1"> | 612 | <property stdset="1"> |
613 | <name>spacing</name> | 613 | <name>spacing</name> |
614 | <number>6</number> | 614 | <number>6</number> |
615 | </property> | 615 | </property> |
616 | <widget> | 616 | <widget> |
617 | <class>QPushButton</class> | 617 | <class>QPushButton</class> |
618 | <property stdset="1"> | 618 | <property stdset="1"> |
619 | <name>name</name> | 619 | <name>name</name> |
620 | <cstring>newdestination</cstring> | 620 | <cstring>newdestination</cstring> |
621 | </property> | 621 | </property> |
622 | <property stdset="1"> | 622 | <property stdset="1"> |
623 | <name>enabled</name> | 623 | <name>enabled</name> |
624 | <bool>true</bool> | 624 | <bool>true</bool> |
625 | </property> | 625 | </property> |
626 | <property stdset="1"> | 626 | <property stdset="1"> |
627 | <name>text</name> | 627 | <name>text</name> |
628 | <string>New</string> | 628 | <string>New</string> |
629 | </property> | 629 | </property> |
630 | <property stdset="1"> | 630 | <property stdset="1"> |
631 | <name>autoDefault</name> | 631 | <name>autoDefault</name> |
632 | <bool>false</bool> | 632 | <bool>false</bool> |
633 | </property> | 633 | </property> |
634 | </widget> | 634 | </widget> |
635 | <widget> | 635 | <widget> |
636 | <class>QPushButton</class> | 636 | <class>QPushButton</class> |
637 | <property stdset="1"> | 637 | <property stdset="1"> |
638 | <name>name</name> | 638 | <name>name</name> |
639 | <cstring>removedestination</cstring> | 639 | <cstring>removedestination</cstring> |
640 | </property> | 640 | </property> |
641 | <property stdset="1"> | 641 | <property stdset="1"> |
642 | <name>enabled</name> | 642 | <name>enabled</name> |
643 | <bool>true</bool> | 643 | <bool>true</bool> |
644 | </property> | 644 | </property> |
645 | <property stdset="1"> | 645 | <property stdset="1"> |
646 | <name>text</name> | 646 | <name>text</name> |
647 | <string>Remove</string> | 647 | <string>Remove</string> |
648 | </property> | 648 | </property> |
649 | <property stdset="1"> | 649 | <property stdset="1"> |
650 | <name>autoDefault</name> | 650 | <name>autoDefault</name> |
651 | <bool>false</bool> | 651 | <bool>false</bool> |
652 | </property> | 652 | </property> |
653 | </widget> | 653 | </widget> |
654 | </hbox> | 654 | </hbox> |
655 | </widget> | 655 | </widget> |
656 | <widget row="3" column="0" > | 656 | <widget row="3" column="0" > |
657 | <class>QLayoutWidget</class> | 657 | <class>QLayoutWidget</class> |
658 | <property stdset="1"> | 658 | <property stdset="1"> |
659 | <name>name</name> | 659 | <name>name</name> |
660 | <cstring>Layout11</cstring> | 660 | <cstring>Layout11</cstring> |
661 | </property> | 661 | </property> |
662 | <property> | 662 | <property> |
663 | <name>layoutMargin</name> | 663 | <name>layoutMargin</name> |
664 | </property> | 664 | </property> |
665 | <property> | 665 | <property> |
666 | <name>layoutSpacing</name> | 666 | <name>layoutSpacing</name> |
667 | </property> | 667 | </property> |
668 | <grid> | 668 | <grid> |
669 | <property stdset="1"> | 669 | <property stdset="1"> |
670 | <name>margin</name> | 670 | <name>margin</name> |
671 | <number>3</number> | 671 | <number>3</number> |
672 | </property> | 672 | </property> |
673 | <property stdset="1"> | 673 | <property stdset="1"> |
674 | <name>spacing</name> | 674 | <name>spacing</name> |
675 | <number>3</number> | 675 | <number>3</number> |
676 | </property> | 676 | </property> |
677 | <widget row="1" column="0" > | 677 | <widget row="1" column="0" > |
678 | <class>QLabel</class> | 678 | <class>QLabel</class> |
679 | <property stdset="1"> | 679 | <property stdset="1"> |
680 | <name>name</name> | 680 | <name>name</name> |
681 | <cstring>TextLabel1_3_2_2</cstring> | 681 | <cstring>TextLabel1_3_2_2</cstring> |
682 | </property> | 682 | </property> |
683 | <property stdset="1"> | 683 | <property stdset="1"> |
684 | <name>text</name> | 684 | <name>text</name> |
685 | <string>URL:</string> | 685 | <string>URL:</string> |
686 | </property> | 686 | </property> |
687 | </widget> | 687 | </widget> |
688 | <widget row="0" column="1" > | 688 | <widget row="0" column="1" > |
689 | <class>QLineEdit</class> | 689 | <class>QLineEdit</class> |
690 | <property stdset="1"> | 690 | <property stdset="1"> |
691 | <name>name</name> | 691 | <name>name</name> |
692 | <cstring>destinationname</cstring> | 692 | <cstring>destinationname</cstring> |
693 | </property> | 693 | </property> |
694 | </widget> | 694 | </widget> |
695 | <widget row="1" column="1" > | 695 | <widget row="1" column="1" > |
696 | <class>QLineEdit</class> | 696 | <class>QLineEdit</class> |
697 | <property stdset="1"> | 697 | <property stdset="1"> |
698 | <name>name</name> | 698 | <name>name</name> |
699 | <cstring>destinationurl</cstring> | 699 | <cstring>destinationurl</cstring> |
700 | </property> | 700 | </property> |
701 | </widget> | 701 | </widget> |
702 | <widget row="0" column="0" > | 702 | <widget row="0" column="0" > |
703 | <class>QLabel</class> | 703 | <class>QLabel</class> |
704 | <property stdset="1"> | 704 | <property stdset="1"> |
705 | <name>name</name> | 705 | <name>name</name> |
706 | <cstring>TextLabel1_3_2</cstring> | 706 | <cstring>TextLabel1_3_2</cstring> |
707 | </property> | 707 | </property> |
708 | <property stdset="1"> | 708 | <property stdset="1"> |
709 | <name>text</name> | 709 | <name>text</name> |
710 | <string>Name:</string> | 710 | <string>Name:</string> |
711 | </property> | 711 | </property> |
712 | </widget> | 712 | </widget> |
713 | </grid> | 713 | </grid> |
714 | </widget> | 714 | </widget> |
715 | </grid> | 715 | </grid> |
716 | </widget> | 716 | </widget> |
717 | </widget> | 717 | </widget> |
718 | </grid> | 718 | </grid> |
719 | </widget> | 719 | </widget> |
720 | <connections> | 720 | <connections> |
721 | <connection> | ||
722 | <sender>CheckBoxLink</sender> | ||
723 | <signal>toggled(bool)</signal> | ||
724 | <receiver>Form4</receiver> | ||
725 | <slot>linkEnabled(bool)</slot> | ||
726 | </connection> | ||
727 | <slot access="public">destNameChanged(const QString&)</slot> | 721 | <slot access="public">destNameChanged(const QString&)</slot> |
728 | <slot access="public">destUrlChanged(const QString&)</slot> | 722 | <slot access="public">destUrlChanged(const QString&)</slot> |
729 | <slot access="public">editDestination(int)</slot> | 723 | <slot access="public">editDestination(int)</slot> |
730 | <slot access="public">editServer(int)</slot> | 724 | <slot access="public">editServer(int)</slot> |
731 | <slot access="public">installationSettingChange(int)</slot> | 725 | <slot access="public">installationSettingChange(int)</slot> |
732 | <slot access="public">installationSettingSetName(const QString &)</slot> | 726 | <slot access="public">installationSettingSetName(const QString &)</slot> |
733 | <slot access="public">linkEnabled(bool)</slot> | 727 | <slot access="public">linkEnabled(bool)</slot> |
734 | <slot access="public">newDestination()</slot> | 728 | <slot access="public">newDestination()</slot> |
735 | <slot access="public">newInstallationSetting()</slot> | 729 | <slot access="public">newInstallationSetting()</slot> |
736 | <slot access="public">newServer()</slot> | 730 | <slot access="public">newServer()</slot> |
737 | <slot access="public">removeDestination()</slot> | 731 | <slot access="public">removeDestination()</slot> |
738 | <slot access="public">removeInstallationSetting()</slot> | 732 | <slot access="public">removeInstallationSetting()</slot> |
739 | <slot access="public">removeServer()</slot> | 733 | <slot access="public">removeServer()</slot> |
740 | <slot access="public">renameInstallationSetting()</slot> | 734 | <slot access="public">renameInstallationSetting()</slot> |
741 | <slot access="public">serverNameChanged(const QString&)</slot> | 735 | <slot access="public">serverNameChanged(const QString&)</slot> |
742 | <slot access="public">serverUrlChanged(const QString&)</slot> | 736 | <slot access="public">serverUrlChanged(const QString&)</slot> |
743 | </connections> | 737 | </connections> |
744 | </UI> | 738 | </UI> |
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index b2ddf95..b23b9ea 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -1,247 +1,297 @@ | |||
1 | #include "pmipkg.h" | 1 | #include "pmipkg.h" |
2 | #include "pkdesc.h" | 2 | #include "pkdesc.h" |
3 | #include "pkfind.h" | ||
4 | #include "pksettings.h" | 3 | #include "pksettings.h" |
5 | #include "package.h" | 4 | #include "package.h" |
6 | #include "packagelistitem.h" | 5 | #include "packagelistitem.h" |
7 | 6 | ||
8 | #include <qpe/process.h> | 7 | #include <qpe/process.h> |
9 | #include <qpe/resource.h> | 8 | #include <qpe/resource.h> |
10 | #include <qpe/config.h> | 9 | #include <qpe/config.h> |
11 | #include <qpe/stringutil.h> | 10 | #include <qpe/stringutil.h> |
12 | #include <qpe/qcopenvelope_qws.h> | 11 | #include <qpe/qcopenvelope_qws.h> |
13 | #include <qdir.h> | 12 | #include <qdir.h> |
14 | #include <qfile.h> | 13 | #include <qfile.h> |
15 | #include <qmultilineedit.h> | 14 | #include <qmultilineedit.h> |
16 | #include <qstring.h> | 15 | #include <qstring.h> |
17 | #include <qtextstream.h> | 16 | #include <qtextstream.h> |
18 | #include <qtextview.h> | 17 | #include <qtextview.h> |
19 | 18 | ||
19 | #include <qprogressbar.h> | ||
20 | #include <qpushbutton.h> | ||
21 | #include <qlayout.h> | ||
22 | |||
20 | #include <stdlib.h> | 23 | #include <stdlib.h> |
21 | #include <unistd.h> | 24 | #include <unistd.h> |
22 | 25 | ||
23 | #include "mainwindow.h" | 26 | #include "mainwindow.h" |
24 | #include "runwindow.h" | ||
25 | |||
26 | 27 | ||
27 | #define PARSE_FILELIST | ||
28 | // #define IPKG_FILELIST | ||
29 | 28 | ||
30 | PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) | 29 | PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) |
31 | // : RunWindow ( p, name, f ) | ||
32 | : QObject ( p ) | 30 | : QObject ( p ) |
33 | { | 31 | { |
34 | settings = s; | 32 | settings = s; |
35 | runwindow = new RunWindow ( p, name, f ); | 33 | runwindowopen = false; |
36 | linkDest = new QCopChannel( "QPE/oipkg", this ); | 34 | runwindow = new RunWindow( p, name, true, f ); |
37 | connect( linkDest, SIGNAL(received(const QCString &, const QByteArray &)), | ||
38 | this, SLOT(linkDestination( const QString &, const QByteArray&)) ); | ||
39 | } | 35 | } |
40 | 36 | ||
41 | PmIpkg::~PmIpkg() | 37 | PmIpkg::~PmIpkg() |
42 | { | 38 | { |
43 | } | 39 | } |
44 | 40 | ||
45 | //#define PROC | 41 | //#define PROC |
46 | #define SYSTEM | 42 | #define SYSTEM |
47 | int PmIpkg::runIpkg(const QString& args) | 43 | int PmIpkg::runIpkg(const QString& args) |
48 | { | 44 | { |
49 | pvDebug(2,"PmIpkg::runIpkg "+args); | 45 | pvDebug(2,"PmIpkg::runIpkg "+args); |
50 | #ifdef PROC | 46 | #ifdef PROC |
51 | QStringList cmd = "/usr/bin/ipkg "; | 47 | QStringList cmd = "/usr/bin/ipkg "; |
52 | #endif | 48 | #endif |
53 | #ifdef SYSTEM | 49 | #ifdef SYSTEM |
54 | QString cmd = "/usr/bin/ipkg "; | 50 | QString cmd = "/usr/bin/ipkg "; |
55 | #endif | 51 | #endif |
56 | cmd += " -dest "+settings->getDestinationName(); | 52 | cmd += " -dest "+settings->getDestinationName(); |
57 | cmd += " -force-defaults "; | 53 | cmd += " -force-defaults "; |
58 | 54 | ||
59 | out( "<hr><br>Starting to "+ args+"<br>\n"); | 55 | out( "<hr><br>Starting to "+ args+"<br>\n"); |
60 | cmd += args; | 56 | cmd += args; |
61 | out( "running:<br>\n"+cmd+"<br>\n" ); | 57 | out( "running:<br>\n"+cmd+"<br>\n" ); |
62 | int r = 0; | 58 | int r = 0; |
63 | #ifdef PROC | 59 | #ifdef PROC |
64 | QString o = "start"; | 60 | QString o = "start"; |
65 | Process ipkg( cmd ); | 61 | Process ipkg( cmd ); |
66 | QString description; | 62 | QString description; |
67 | ipkg.exec("",o); | 63 | ipkg.exec("",o); |
68 | out( o ); | 64 | out( o ); |
69 | #endif | 65 | #endif |
70 | #ifdef SYSTEM | 66 | #ifdef SYSTEM |
71 | QString redirect = "/tmp/oipkg.pipe"; | 67 | QString redirect = "/tmp/oipkg.pipe"; |
72 | cmd += " | tee "+redirect+" 2>&1"; | 68 | cmd += " | tee "+redirect+" 2>&1"; |
73 | pvDebug(2, "running >"+cmd+"<"); | 69 | pvDebug(2, "running >"+cmd+"<"); |
74 | r = system(cmd.latin1()); | 70 | r = system(cmd.latin1()); |
75 | QFile f( redirect ); | 71 | QFile f( redirect ); |
72 | QString line; | ||
73 | QString oldLine; | ||
76 | while ( ! f.open(IO_ReadOnly) ) {}; | 74 | while ( ! f.open(IO_ReadOnly) ) {}; |
77 | // if ( f.open(IO_ReadOnly) ) {}; | ||
78 | { | 75 | { |
79 | QTextStream t( &f ); | 76 | QTextStream t( &f ); |
80 | QString fp; | 77 | // QString fp; |
81 | while ( !t.eof() ) | 78 | while ( !t.eof() ) |
82 | { | 79 | { |
83 | out( t.readLine() +"<br>" ); | 80 | line = t.readLine(); |
81 | if ( line != oldLine ) out( line +"<br>" ); | ||
82 | oldLine = line; | ||
84 | } | 83 | } |
85 | } | 84 | } |
86 | f.close(); | 85 | f.close(); |
87 | out( "Finished!<br>"); | 86 | out( "Finished!<br>"); |
88 | #endif | 87 | #endif |
89 | 88 | ||
90 | return r; | 89 | return r; |
91 | } | 90 | } |
92 | 91 | ||
93 | void PmIpkg::makeLinks(QString pack) | 92 | void PmIpkg::makeLinks(QString pack) |
94 | { | 93 | { |
95 | pvDebug( 2, "PmIpkg::makeLinks "+ pack); | 94 | pvDebug( 2, "PmIpkg::makeLinks "+ pack); |
96 | out( "<br>creating links<br>" ); | 95 | out( "<br>creating links<br>" ); |
97 | QString dest = settings->getDestinationUrl(); | 96 | QString dest = settings->getDestinationUrl(); |
98 | out("for package "+pack+" in "+dest+"<br>"); | 97 | out("for package "+pack+" in "+dest+"<br>"); |
99 | #ifdef IPKG_FILELIST | ||
100 | system(("ipkg -d "+dest+" files "+pack+"> /tmp/oipkg.pipe 2>&1").latin1()); | ||
101 | QFile f( "/tmp/oipkg.pipe" ); | ||
102 | while ( ! f.open(IO_ReadOnly) ) {}; | ||
103 | #endif | ||
104 | #ifdef PARSE_FILELIST | ||
105 | { | 98 | { |
106 | Config cfg( "oipkg", Config::User ); | 99 | Config cfg( "oipkg", Config::User ); |
107 | cfg.setGroup( "Common" ); | 100 | cfg.setGroup( "Common" ); |
108 | QString statusDir = cfg.readEntry( "statusDir", "" ); | 101 | QString statusDir = cfg.readEntry( "statusDir", "" ); |
109 | } | 102 | } |
110 | QString fn = dest+"/"+statusDir+"/info/"+pack+".list"; | 103 | QString fn = dest+"/"+statusDir+"/info/"+pack+".list"; |
111 | QFile f( fn ); | 104 | QFile f( fn ); |
112 | if ( ! f.open(IO_ReadOnly) ) | 105 | if ( ! f.open(IO_ReadOnly) ) |
113 | { | 106 | { |
114 | out( "<b>Panik!</b> Could not open:<br>"+fn ); | 107 | out( "<b>Panik!</b> Could not open:<br>"+fn ); |
115 | }; | 108 | }; |
116 | #endif | ||
117 | QTextStream t( &f ); | 109 | QTextStream t( &f ); |
118 | QString fp; | 110 | QString fp; |
119 | while ( !t.eof() ) | 111 | while ( !t.eof() ) |
120 | { | 112 | { |
121 | fp = t.readLine(); | 113 | fp = t.readLine(); |
122 | processLinkDir( fp, dest ); | 114 | processLinkDir( fp, dest ); |
123 | } | 115 | } |
124 | f.close(); | 116 | f.close(); |
125 | } | 117 | } |
126 | 118 | ||
127 | void PmIpkg::processLinkDir( QString file, QString dest ) | 119 | void PmIpkg::processLinkDir( QString file, QString dest ) |
128 | { | 120 | { |
129 | |||
130 | #ifdef PARSE_FILELIST | ||
131 | QString destFile = file; | 121 | QString destFile = file; |
132 | file = dest+"/"+file; | 122 | file = dest+"/"+file; |
133 | #endif | ||
134 | #ifdef IPKG_FILELIST | ||
135 | QString destFile = file.right( file.length() - dest.length() ); | ||
136 | #endif | ||
137 | QFileInfo fileInfo( file ); | 123 | QFileInfo fileInfo( file ); |
138 | if ( fileInfo.isDir() ) | 124 | if ( fileInfo.isDir() ) |
139 | { | 125 | { |
140 | QDir destDir( destFile ); | 126 | QDir destDir( destFile ); |
141 | destDir.mkdir( destFile, true ); | 127 | destDir.mkdir( destFile, true ); |
142 | QDir d( file ); | 128 | QDir d( file ); |
143 | d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); | 129 | d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); |
144 | const QFileInfoList *list = d.entryInfoList(); | 130 | const QFileInfoList *list = d.entryInfoList(); |
145 | QFileInfoListIterator it( *list ); | 131 | QFileInfoListIterator it( *list ); |
146 | QFileInfo *fi; | 132 | QFileInfo *fi; |
147 | while ( (fi=it.current()) ) | 133 | while ( (fi=it.current()) ) |
148 | { | 134 | { |
149 | out( "<b>"+fi->absFilePath()+"</b>" ); | 135 | // out( "<b>"+fi->absFilePath()+"</b>" ); |
150 | processLinkDir( fi->absFilePath(), dest ); | 136 | processLinkDir( fi->absFilePath(), dest ); |
151 | ++it; | 137 | ++it; |
152 | } | 138 | } |
153 | } else | 139 | } else |
154 | if ( fileInfo.isFile() ) | 140 | if ( fileInfo.isFile() ) |
155 | { | 141 | { |
156 | const char *instFile = strdup( (file).ascii() ); | 142 | const char *instFile = strdup( (file).ascii() ); |
157 | const char *linkFile = strdup( (destFile).ascii()); | 143 | const char *linkFile = strdup( (destFile).ascii()); |
158 | out( "linking: "+file+" -> "+destFile ); | 144 | // out( "linking: "+file+" -> "+destFile ); |
159 | qDebug( "linking: %s -> %s", instFile, linkFile ); | 145 | qDebug( "linking: %s -> %s", instFile, linkFile ); |
160 | symlink( instFile, linkFile ); | 146 | symlink( instFile, linkFile ); |
161 | } | 147 | } |
162 | } | 148 | } |
163 | 149 | ||
164 | void PmIpkg::commit( PackageList pl ) | 150 | void PmIpkg::commit( PackageList pl ) |
165 | { | 151 | { |
166 | runwindow->showMaximized(); | 152 | show( false ); |
167 | // exec(); | ||
168 | runwindow->outPut->setText(""); | 153 | runwindow->outPut->setText(""); |
169 | out( "<h1>Starting...</h1><br>\n"); | 154 | out( "<h1>"+tr("Todo")+"</h1>\n"); |
170 | QStringList to_remove, to_install; | ||
171 | 155 | ||
172 | QString rem="<b>To remove:</b><br>\n"; | 156 | QString rem="<b>To remove:</b><br>\n"; |
173 | QString inst="<b>To install:</b><br>\n";; | 157 | QString inst="<b>To install:</b><br>\n";; |
174 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) | 158 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) |
175 | { | 159 | { |
176 | if ( pack && (pack->name() != "") && pack) | 160 | if ( pack && (pack->name() != "") && pack) |
177 | { | 161 | { |
178 | if ( pack->toInstall() ) | 162 | if ( pack->toInstall() ) |
179 | { | 163 | { |
180 | to_install.append( pack->name() ); | 164 | to_install.append( pack->name() ); |
181 | inst += pack->name()+"<br>"; | 165 | inst += pack->name()+"<br>"; |
182 | } | 166 | } |
183 | if ( pack->toRemove() ) | 167 | if ( pack->toRemove() ) |
184 | { | 168 | { |
185 | to_remove.append( pack->name() ); | 169 | to_remove.append( pack->name() ); |
186 | rem += pack->name()+"<br>"; | 170 | rem += pack->name()+"<br>"; |
187 | } | 171 | } |
188 | } | 172 | } |
189 | } | 173 | } |
190 | 174 | ||
191 | out("<p>"+inst+"</p>"+"<p>"+rem+"</p>"); | 175 | out("<p>"+inst+"</p>"+"<p>"+rem+"</p><hl>"); |
192 | bool ok=TRUE; | ||
193 | 176 | ||
194 | qDebug("to remove=%i; to install=%i",to_remove.count(),to_install.count()); | 177 | qDebug("to remove=%i; to install=%i",to_remove.count(),to_install.count()); |
195 | 178 | ||
196 | int jobs = to_remove.count()+to_install.count(); | 179 | connect( runwindow->doItButton, SIGNAL( clicked() ), |
197 | if ( jobs < 1 ) return; | 180 | SLOT( doIt() ) ); |
181 | connect( runwindow->installButton, SIGNAL( clicked() ), | ||
182 | this, SLOT( install() ) ); | ||
183 | connect( runwindow->removeButton, SIGNAL( clicked() ), | ||
184 | this, SLOT( remove() ) ); | ||
185 | connect( runwindow->cancelButton, SIGNAL( clicked() ), | ||
186 | runwindow, SLOT( close() ) ); | ||
187 | |||
188 | runwindow->exec(); | ||
189 | // ##### If we looked in the list of files, we could send out accurate | ||
190 | // ##### messages. But we don't bother yet, and just do an "all". | ||
191 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | ||
192 | QString lf = QString::null; | ||
193 | e << lf; | ||
194 | return; | ||
195 | } | ||
196 | |||
197 | void PmIpkg::doIt() | ||
198 | { | ||
199 | remove(); | ||
200 | install(); | ||
201 | } | ||
202 | |||
198 | 203 | ||
199 | if ( to_remove.count() ) | 204 | void PmIpkg::remove() |
205 | { | ||
206 | if ( to_remove.count() == 0 ) return; | ||
207 | show( true ); | ||
208 | |||
209 | out("<hr><hr><b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br>"); | ||
200 | for (QStringList::ConstIterator it=to_remove.begin(); it!=to_remove.end(); ++it) | 210 | for (QStringList::ConstIterator it=to_remove.begin(); it!=to_remove.end(); ++it) |
201 | if ( runIpkg("remove " + *it) != 0 ) ok = false; | 211 | { |
212 | if ( runIpkg("remove " + *it) == 0) | ||
213 | { | ||
214 | |||
215 | }else{ | ||
216 | out("<b>"+tr("Error while removing")+"</b>"+*it); | ||
217 | } | ||
218 | } | ||
219 | } | ||
220 | |||
221 | |||
222 | void PmIpkg::install() | ||
223 | { | ||
224 | if ( to_install.count() == 0 ) return; | ||
225 | show( true ); | ||
226 | out("<hr><hr><b>"+tr("Installing")+"<br>"+tr("please wait")+"<b><br>"); | ||
202 | if ( to_install.count() ) | 227 | if ( to_install.count() ) |
203 | for (QStringList::ConstIterator it=to_install.begin(); it!=to_install.end(); ++it) | 228 | for (QStringList::ConstIterator it=to_install.begin(); it!=to_install.end(); ++it) |
204 | { | 229 | { |
205 | if ( runIpkg("install " + *it) == 0 ) | 230 | if ( runIpkg("install " + *it) == 0 ) |
206 | { | 231 | { |
207 | if ( settings->createLinks() ) | 232 | if ( settings->createLinks() ) |
208 | makeLinks( *it ); | 233 | makeLinks( *it ); |
209 | }else{ | 234 | }else{ |
210 | ok = false; | 235 | out("<b>"+tr("Error while installing")+"</b>"+*it); |
211 | } | 236 | } |
212 | } | 237 | } |
213 | 238 | ||
214 | // ##### If we looked in the list of files, we could send out accurate | ||
215 | // ##### messages. But we don't bother yet, and just do an "all". | ||
216 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | ||
217 | QString lf = QString::null; | ||
218 | e << lf; | ||
219 | } | 239 | } |
220 | 240 | ||
221 | void PmIpkg::linkDestination( const QString msg, const QByteArray dest ) | 241 | void PmIpkg::linkDestination( const QString msg, const QByteArray dest ) |
222 | // add 3rd package parameter | 242 | // add 3rd package parameter |
223 | { | 243 | { |
224 | qDebug("msg="+msg+" -- "+QString(dest) ); | 244 | qDebug("msg="+msg+" -- "+QString(dest) ); |
225 | // QDir d( src ); | 245 | // QDir d( src ); |
226 | // d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); | 246 | // d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); |
227 | //// if (! d.exists() ) return; | 247 | //// if (! d.exists() ) return; |
228 | // const QFileInfoList *list = d.entryInfoList(); | 248 | // const QFileInfoList *list = d.entryInfoList(); |
229 | // QFileInfoListIterator it( *list ); | 249 | // QFileInfoListIterator it( *list ); |
230 | // QFileInfo *fi; | 250 | // QFileInfo *fi; |
231 | // while ( (fi=it.current()) ) { | 251 | // while ( (fi=it.current()) ) { |
232 | // processLinkDir( fi->absFilePath(), dest ); | 252 | // processLinkDir( fi->absFilePath(), dest ); |
233 | // ++it; | 253 | // ++it; |
234 | // } | 254 | // } |
235 | } | 255 | } |
236 | 256 | ||
237 | void PmIpkg::update() | 257 | void PmIpkg::update() |
238 | { | 258 | { |
239 | runwindow->showMaximized(); | 259 | show( false ); |
240 | runIpkg( "update" ); | 260 | runIpkg( "update" ); |
261 | runwindow->close(); | ||
241 | } | 262 | } |
242 | 263 | ||
243 | void PmIpkg::out( QString o ) | 264 | void PmIpkg::out( QString o ) |
244 | { | 265 | { |
245 | runwindow->outPut->setText( runwindow->outPut->text()+o ); | 266 | runwindow->outPut->setText( runwindow->outPut->text()+o ); |
246 | runwindow->outPut->setContentsPos(0,runwindow->outPut->contentsHeight()); | 267 | runwindow->outPut->setContentsPos(0, runwindow->outPut->contentsHeight()); |
268 | } | ||
269 | |||
270 | |||
271 | void PmIpkg::showButtons(bool b) | ||
272 | { | ||
273 | if ( b ) | ||
274 | { | ||
275 | runwindow->cancelButton->hide(); | ||
276 | runwindow->doItButton->hide(); | ||
277 | runwindow->removeButton->hide(); | ||
278 | runwindow->installButton->hide(); | ||
279 | }else{ | ||
280 | runwindow->cancelButton->show(); | ||
281 | runwindow->doItButton->show(); | ||
282 | runwindow->removeButton->show(); | ||
283 | runwindow->installButton->show(); | ||
284 | |||
285 | } | ||
286 | } | ||
287 | |||
288 | void PmIpkg::show(bool b) | ||
289 | { | ||
290 | if (!runwindow->isVisible()) | ||
291 | runwindow->showMaximized(); | ||
292 | showButtons(b); | ||
293 | if ( b ) | ||
294 | runwindow->progress->show(); | ||
295 | else | ||
296 | runwindow->progress->show(); | ||
247 | } | 297 | } |
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index e6486ff..8718f49 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h | |||
@@ -1,46 +1,48 @@ | |||
1 | #ifndef PMIPKG_H | 1 | #ifndef PMIPKG_H |
2 | #define PMIPKG_H | 2 | #define PMIPKG_H |
3 | 3 | ||
4 | 4 | ||
5 | #include <qobject.h> | 5 | #include <qobject.h> |
6 | #include <qstring.h> | 6 | #include <qstring.h> |
7 | #include <qwidget.h> | 7 | #include <qwidget.h> |
8 | #include "pksettings.h" | 8 | #include "pksettings.h" |
9 | #include "runwindow.h" | 9 | #include "runwindow.h" |
10 | #include "packagelist.h" | 10 | #include "packagelist.h" |
11 | #include "debug.h" | 11 | #include "debug.h" |
12 | 12 | ||
13 | //#define DIA | ||
14 | 13 | ||
15 | #include <qpe/qcopenvelope_qws.h> | ||
16 | 14 | ||
17 | |||
18 | //class PmIpkg : public RunWindow | ||
19 | class PmIpkg : public QObject | 15 | class PmIpkg : public QObject |
20 | { | 16 | { |
21 | Q_OBJECT | 17 | Q_OBJECT |
22 | public: | 18 | public: |
23 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); | 19 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); |
24 | //PmIpkg( QObject*, PackageManagerSettings* ); | ||
25 | ~PmIpkg(); | 20 | ~PmIpkg(); |
26 | 21 | ||
27 | void commit( PackageList ); | 22 | void commit( PackageList ); |
28 | void update(); | 23 | void update(); |
29 | PackageList* getPackageList(); | 24 | PackageList* getPackageList(); |
25 | void showButtons(bool b=true); | ||
26 | void show( bool buttons=true ); | ||
30 | 27 | ||
31 | private: | 28 | private: |
32 | PackageManagerSettings* settings; | 29 | PackageManagerSettings* settings; |
33 | RunWindow *runwindow; | 30 | RunWindow *runwindow; |
34 | QCopChannel *linkDest; | 31 | QStringList to_remove; |
32 | QStringList to_install; | ||
33 | bool runwindowopen; | ||
35 | 34 | ||
36 | void makeLinks(QString); | 35 | void makeLinks(QString); |
37 | void processLinkDir( QString, QString ); | 36 | void processLinkDir( QString, QString ); |
38 | 37 | ||
39 | int runIpkg(const QString& args); | 38 | int runIpkg(const QString& args); |
40 | void out( QString ); | 39 | void out( QString ); |
41 | 40 | ||
42 | public slots: | 41 | public slots: |
42 | void doIt(); | ||
43 | void install(); | ||
44 | void remove(); | ||
43 | void linkDestination( const QString, const QByteArray ); | 45 | void linkDestination( const QString, const QByteArray ); |
44 | }; | 46 | }; |
45 | 47 | ||
46 | #endif | 48 | #endif |
diff --git a/noncore/unsupported/oipkg/runwindow.ui b/noncore/unsupported/oipkg/runwindow.ui index 9113f2d..5359fe2 100644 --- a/noncore/unsupported/oipkg/runwindow.ui +++ b/noncore/unsupported/oipkg/runwindow.ui | |||
@@ -1,63 +1,171 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>RunWindow</class> | 2 | <class>RunWindow</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>RunWindow</cstring> | 7 | <cstring>RunWindow</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>197</width> | 14 | <width>344</width> |
15 | <height>291</height> | 15 | <height>291</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>running...</string> | 20 | <string>running...</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <grid> | 28 | <grid> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>5</number> | 31 | <number>2</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>2</number> | 35 | <number>2</number> |
36 | </property> | 36 | </property> |
37 | <widget row="0" column="0" > | 37 | <widget row="0" column="0" > |
38 | <class>QProgressBar</class> | 38 | <class>QProgressBar</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>progress</cstring> | 41 | <cstring>progress</cstring> |
42 | </property> | 42 | </property> |
43 | <property stdset="1"> | 43 | <property stdset="1"> |
44 | <name>progress</name> | 44 | <name>progress</name> |
45 | <number>42</number> | 45 | <number>42</number> |
46 | </property> | 46 | </property> |
47 | </widget> | 47 | </widget> |
48 | <widget row="1" column="0" > | 48 | <widget row="1" column="0" > |
49 | <class>QTextView</class> | 49 | <class>QTextView</class> |
50 | <property stdset="1"> | 50 | <property stdset="1"> |
51 | <name>name</name> | 51 | <name>name</name> |
52 | <cstring>outPut</cstring> | 52 | <cstring>outPut</cstring> |
53 | </property> | 53 | </property> |
54 | <property stdset="1"> | 54 | <property stdset="1"> |
55 | <name>font</name> | 55 | <name>font</name> |
56 | <font> | 56 | <font> |
57 | <pointsize>6</pointsize> | 57 | <pointsize>6</pointsize> |
58 | </font> | 58 | </font> |
59 | </property> | 59 | </property> |
60 | </widget> | 60 | </widget> |
61 | <widget row="2" column="0" > | ||
62 | <class>QLayoutWidget</class> | ||
63 | <property stdset="1"> | ||
64 | <name>name</name> | ||
65 | <cstring>buttons</cstring> | ||
66 | </property> | ||
67 | <hbox> | ||
68 | <property stdset="1"> | ||
69 | <name>margin</name> | ||
70 | <number>0</number> | ||
71 | </property> | ||
72 | <property stdset="1"> | ||
73 | <name>spacing</name> | ||
74 | <number>6</number> | ||
75 | </property> | ||
76 | <widget> | ||
77 | <class>QPushButton</class> | ||
78 | <property stdset="1"> | ||
79 | <name>name</name> | ||
80 | <cstring>doItButton</cstring> | ||
81 | </property> | ||
82 | <property stdset="1"> | ||
83 | <name>sizePolicy</name> | ||
84 | <sizepolicy> | ||
85 | <hsizetype>0</hsizetype> | ||
86 | <vsizetype>0</vsizetype> | ||
87 | </sizepolicy> | ||
88 | </property> | ||
89 | <property stdset="1"> | ||
90 | <name>font</name> | ||
91 | <font> | ||
92 | <pointsize>8</pointsize> | ||
93 | </font> | ||
94 | </property> | ||
95 | <property stdset="1"> | ||
96 | <name>text</name> | ||
97 | <string>Do all </string> | ||
98 | </property> | ||
99 | <property stdset="1"> | ||
100 | <name>autoResize</name> | ||
101 | <bool>true</bool> | ||
102 | </property> | ||
103 | </widget> | ||
104 | <widget> | ||
105 | <class>QPushButton</class> | ||
106 | <property stdset="1"> | ||
107 | <name>name</name> | ||
108 | <cstring>installButton</cstring> | ||
109 | </property> | ||
110 | <property stdset="1"> | ||
111 | <name>font</name> | ||
112 | <font> | ||
113 | <pointsize>8</pointsize> | ||
114 | </font> | ||
115 | </property> | ||
116 | <property stdset="1"> | ||
117 | <name>text</name> | ||
118 | <string>Install</string> | ||
119 | </property> | ||
120 | <property stdset="1"> | ||
121 | <name>autoResize</name> | ||
122 | <bool>true</bool> | ||
123 | </property> | ||
124 | </widget> | ||
125 | <widget> | ||
126 | <class>QPushButton</class> | ||
127 | <property stdset="1"> | ||
128 | <name>name</name> | ||
129 | <cstring>removeButton</cstring> | ||
130 | </property> | ||
131 | <property stdset="1"> | ||
132 | <name>font</name> | ||
133 | <font> | ||
134 | <pointsize>7</pointsize> | ||
135 | </font> | ||
136 | </property> | ||
137 | <property stdset="1"> | ||
138 | <name>text</name> | ||
139 | <string>Remove</string> | ||
140 | </property> | ||
141 | <property stdset="1"> | ||
142 | <name>autoResize</name> | ||
143 | <bool>true</bool> | ||
144 | </property> | ||
145 | </widget> | ||
146 | <widget> | ||
147 | <class>QPushButton</class> | ||
148 | <property stdset="1"> | ||
149 | <name>name</name> | ||
150 | <cstring>cancelButton</cstring> | ||
151 | </property> | ||
152 | <property stdset="1"> | ||
153 | <name>font</name> | ||
154 | <font> | ||
155 | <pointsize>8</pointsize> | ||
156 | </font> | ||
157 | </property> | ||
158 | <property stdset="1"> | ||
159 | <name>text</name> | ||
160 | <string>Cancel</string> | ||
161 | </property> | ||
162 | <property stdset="1"> | ||
163 | <name>autoResize</name> | ||
164 | <bool>true</bool> | ||
165 | </property> | ||
166 | </widget> | ||
167 | </hbox> | ||
168 | </widget> | ||
61 | </grid> | 169 | </grid> |
62 | </widget> | 170 | </widget> |
63 | </UI> | 171 | </UI> |