Diffstat (limited to 'noncore/settings/packagemanager/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.cpp | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp index 0e40c01..e0e5e04 100644 --- a/noncore/settings/packagemanager/mainwindow.cpp +++ b/noncore/settings/packagemanager/mainwindow.cpp | |||
@@ -33,16 +33,16 @@ | |||
33 | #include "filterdlg.h" | 33 | #include "filterdlg.h" |
34 | #include "promptdlg.h" | 34 | #include "promptdlg.h" |
35 | #include "entrydlg.h" | 35 | #include "entrydlg.h" |
36 | #include "packageinfodlg.h" | 36 | #include "packageinfodlg.h" |
37 | 37 | ||
38 | #include <opie2/ofiledialog.h> | 38 | #include <opie2/ofiledialog.h> |
39 | #include <opie2/oresource.h> | ||
39 | 40 | ||
40 | #include <qpe/qcopenvelope_qws.h> | 41 | #include <qpe/qcopenvelope_qws.h> |
41 | #include <qpe/qpeapplication.h> | 42 | #include <qpe/qpeapplication.h> |
42 | #include <qpe/resource.h> | ||
43 | 43 | ||
44 | #include <qaction.h> | 44 | #include <qaction.h> |
45 | #include <qdir.h> | 45 | #include <qdir.h> |
46 | #include <qlayout.h> | 46 | #include <qlayout.h> |
47 | #include <qlineedit.h> | 47 | #include <qlineedit.h> |
48 | #include <qmenubar.h> | 48 | #include <qmenubar.h> |
@@ -61,14 +61,14 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ ) | |||
61 | , m_findBar( this ) | 61 | , m_findBar( this ) |
62 | , m_widgetStack( this ) | 62 | , m_widgetStack( this ) |
63 | , m_packageList( this ) | 63 | , m_packageList( this ) |
64 | , m_statusWidget( this ) | 64 | , m_statusWidget( this ) |
65 | , m_statusText( &m_statusWidget ) | 65 | , m_statusText( &m_statusWidget ) |
66 | , m_statusBar( &m_statusWidget ) | 66 | , m_statusBar( &m_statusWidget ) |
67 | , m_iconUpdated( Resource::loadPixmap( "packagemanager/updated" ) ) | 67 | , m_iconUpdated( Opie::Core::OResource::loadPixmap( "packagemanager/updated" ) ) |
68 | , m_iconInstalled( Resource::loadPixmap( "installed" ) ) | 68 | , m_iconInstalled( Opie::Core::OResource::loadPixmap( "installed" ) ) |
69 | , m_iconNull( m_iconUpdated.size() ) | 69 | , m_iconNull( m_iconUpdated.size() ) |
70 | , m_filterName( QString::null ) | 70 | , m_filterName( QString::null ) |
71 | , m_filterServer( QString::null ) | 71 | , m_filterServer( QString::null ) |
72 | , m_filterDest( QString::null ) | 72 | , m_filterDest( QString::null ) |
73 | , m_filterStatus( OPackageManager::NotDefined ) | 73 | , m_filterStatus( OPackageManager::NotDefined ) |
74 | , m_filterCategory( QString::null ) | 74 | , m_filterCategory( QString::null ) |
@@ -156,47 +156,52 @@ void MainWindow::initUI() | |||
156 | m_findBar.setStretchableWidget( m_findEdit ); | 156 | m_findBar.setStretchableWidget( m_findEdit ); |
157 | connect( m_findEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotFindChanged(const QString&)) ); | 157 | connect( m_findEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotFindChanged(const QString&)) ); |
158 | 158 | ||
159 | // Packages menu | 159 | // Packages menu |
160 | QPopupMenu *popup = new QPopupMenu( this ); | 160 | QPopupMenu *popup = new QPopupMenu( this ); |
161 | 161 | ||
162 | QAction *a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "packagemanager/update" ), QString::null, 0, this, 0 ); | 162 | QAction *a = new QAction( tr( "Update lists" ), Opie::Core::OResource::loadPixmap( "packagemanager/update", |
163 | Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); | ||
163 | a->setWhatsThis( tr( "Tap here to update package lists from servers." ) ); | 164 | a->setWhatsThis( tr( "Tap here to update package lists from servers." ) ); |
164 | connect( a, SIGNAL(activated()), this, SLOT(slotUpdate()) ); | 165 | connect( a, SIGNAL(activated()), this, SLOT(slotUpdate()) ); |
165 | a->addTo( popup ); | 166 | a->addTo( popup ); |
166 | a->addTo( &m_toolBar ); | 167 | a->addTo( &m_toolBar ); |
167 | 168 | ||
168 | QAction *actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "packagemanager/upgrade" ), QString::null, 0, this, 0 ); | 169 | QAction *actionUpgrade = new QAction( tr( "Upgrade" ), Opie::Core::OResource::loadPixmap( "packagemanager/upgrade", |
170 | Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); | ||
169 | actionUpgrade->setWhatsThis( tr( "Tap here to upgrade all installed packages if a newer version is available." ) ); | 171 | actionUpgrade->setWhatsThis( tr( "Tap here to upgrade all installed packages if a newer version is available." ) ); |
170 | connect( actionUpgrade, SIGNAL(activated()), this, SLOT(slotUpgrade()) ); | 172 | connect( actionUpgrade, SIGNAL(activated()), this, SLOT(slotUpgrade()) ); |
171 | actionUpgrade->addTo( popup ); | 173 | actionUpgrade->addTo( popup ); |
172 | actionUpgrade->addTo( &m_toolBar ); | 174 | actionUpgrade->addTo( &m_toolBar ); |
173 | 175 | ||
174 | QPixmap iconDownload = Resource::loadPixmap( "packagemanager/download" ); | 176 | QPixmap iconDownload = Opie::Core::OResource::loadPixmap( "packagemanager/download", Opie::Core::OResource::SmallIcon ); |
175 | QPixmap iconRemove = Resource::loadPixmap( "packagemanager/remove" ); | 177 | QPixmap iconRemove = Opie::Core::OResource::loadPixmap( "packagemanager/remove", Opie::Core::OResource::SmallIcon ); |
176 | QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); | 178 | QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); |
177 | actionDownload->setWhatsThis( tr( "Tap here to download the currently selected package(s)." ) ); | 179 | actionDownload->setWhatsThis( tr( "Tap here to download the currently selected package(s)." ) ); |
178 | connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) ); | 180 | connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) ); |
179 | actionDownload->addTo( popup ); | 181 | actionDownload->addTo( popup ); |
180 | actionDownload->addTo( &m_toolBar ); | 182 | actionDownload->addTo( &m_toolBar ); |
181 | 183 | ||
182 | a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 ); | 184 | a = new QAction( tr( "Apply changes" ), Opie::Core::OResource::loadPixmap( "packagemanager/apply", |
185 | Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); | ||
183 | a->setWhatsThis( tr( "Tap here to install, remove or upgrade currently selected package(s)." ) ); | 186 | a->setWhatsThis( tr( "Tap here to install, remove or upgrade currently selected package(s)." ) ); |
184 | connect( a, SIGNAL(activated()), this, SLOT(slotApply()) ); | 187 | connect( a, SIGNAL(activated()), this, SLOT(slotApply()) ); |
185 | a->addTo( popup ); | 188 | a->addTo( popup ); |
186 | a->addTo( &m_toolBar ); | 189 | a->addTo( &m_toolBar ); |
187 | 190 | ||
188 | a = new QAction( tr( "Install local package" ), Resource::loadPixmap( "folder" ), QString::null, 0, this, 0 ); | 191 | a = new QAction( tr( "Install local package" ), Opie::Core::OResource::loadPixmap( "folder", |
192 | Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); | ||
189 | a->setWhatsThis( tr( "Tap here to install a package file located on device." ) ); | 193 | a->setWhatsThis( tr( "Tap here to install a package file located on device." ) ); |
190 | connect( a, SIGNAL(activated()), this, SLOT(slotInstallLocal()) ); | 194 | connect( a, SIGNAL(activated()), this, SLOT(slotInstallLocal()) ); |
191 | a->addTo( popup ); | 195 | a->addTo( popup ); |
192 | //a->addTo( &m_toolBar ); | 196 | //a->addTo( &m_toolBar ); |
193 | 197 | ||
194 | popup->insertSeparator(); | 198 | popup->insertSeparator(); |
195 | 199 | ||
196 | a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 ); | 200 | a = new QAction( tr( "Configure" ), Opie::Core::OResource::loadPixmap( "SettingsIcon", |
201 | Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); | ||
197 | a->setWhatsThis( tr( "Tap here to configure this application." ) ); | 202 | a->setWhatsThis( tr( "Tap here to configure this application." ) ); |
198 | connect( a, SIGNAL(activated()), this, SLOT(slotConfigure()) ); | 203 | connect( a, SIGNAL(activated()), this, SLOT(slotConfigure()) ); |
199 | a->addTo( popup ); | 204 | a->addTo( popup ); |
200 | mb->insertItem( tr( "Actions" ), popup ); | 205 | mb->insertItem( tr( "Actions" ), popup ); |
201 | 206 | ||
202 | // View menu | 207 | // View menu |
@@ -219,42 +224,45 @@ void MainWindow::initUI() | |||
219 | m_actionShowUpdated->setWhatsThis( tr( "Tap here to show packages currently installed on this device which have a newer version available." ) ); | 224 | m_actionShowUpdated->setWhatsThis( tr( "Tap here to show packages currently installed on this device which have a newer version available." ) ); |
220 | connect( m_actionShowUpdated, SIGNAL(activated()), this, SLOT(slotShowUpdated()) ); | 225 | connect( m_actionShowUpdated, SIGNAL(activated()), this, SLOT(slotShowUpdated()) ); |
221 | m_actionShowUpdated->addTo( popup ); | 226 | m_actionShowUpdated->addTo( popup ); |
222 | 227 | ||
223 | popup->insertSeparator(); | 228 | popup->insertSeparator(); |
224 | 229 | ||
225 | m_actionFilter = new QAction( tr( "Filter" ), Resource::loadPixmap( "packagemanager/filter" ), | 230 | m_actionFilter = new QAction( tr( "Filter" ), Opie::Core::OResource::loadPixmap( "packagemanager/filter", |
226 | QString::null, 0, this, 0 ); | 231 | Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); |
227 | m_actionFilter->setToggleAction( true ); | 232 | m_actionFilter->setToggleAction( true ); |
228 | m_actionFilter->setWhatsThis( tr( "Tap here to apply current filter." ) ); | 233 | m_actionFilter->setWhatsThis( tr( "Tap here to apply current filter." ) ); |
229 | connect( m_actionFilter, SIGNAL(toggled(bool)), this, SLOT(slotFilter(bool)) ); | 234 | connect( m_actionFilter, SIGNAL(toggled(bool)), this, SLOT(slotFilter(bool)) ); |
230 | m_actionFilter->addTo( popup ); | 235 | m_actionFilter->addTo( popup ); |
231 | 236 | ||
232 | a = new QAction( tr( "Filter settings" ), QString::null, 0, this, 0 ); | 237 | a = new QAction( tr( "Filter settings" ), QString::null, 0, this, 0 ); |
233 | a->setWhatsThis( tr( "Tap here to change the package filter criteria." ) ); | 238 | a->setWhatsThis( tr( "Tap here to change the package filter criteria." ) ); |
234 | connect( a, SIGNAL(activated()), this, SLOT(slotFilterChange()) ); | 239 | connect( a, SIGNAL(activated()), this, SLOT(slotFilterChange()) ); |
235 | a->addTo( popup ); | 240 | a->addTo( popup ); |
236 | 241 | ||
237 | popup->insertSeparator(); | 242 | popup->insertSeparator(); |
238 | 243 | ||
239 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | 244 | a = new QAction( tr( "Find" ), Opie::Core::OResource::loadPixmap( "find", Opie::Core::OResource::SmallIcon ), |
245 | QString::null, 0, this, 0 ); | ||
240 | a->setWhatsThis( tr( "Tap here to search for text in package names." ) ); | 246 | a->setWhatsThis( tr( "Tap here to search for text in package names." ) ); |
241 | connect( a, SIGNAL(activated()), this, SLOT(slotFindShowToolbar()) ); | 247 | connect( a, SIGNAL(activated()), this, SLOT(slotFindShowToolbar()) ); |
242 | a->addTo( popup ); | 248 | a->addTo( popup ); |
243 | 249 | ||
244 | m_actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 ); | 250 | m_actionFindNext = new QAction( tr( "Find next" ), Opie::Core::OResource::loadPixmap( "next", |
251 | Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); | ||
245 | m_actionFindNext->setEnabled( false ); | 252 | m_actionFindNext->setEnabled( false ); |
246 | m_actionFindNext->setWhatsThis( tr( "Tap here to find the next package name containing the text you are searching for." ) ); | 253 | m_actionFindNext->setWhatsThis( tr( "Tap here to find the next package name containing the text you are searching for." ) ); |
247 | connect( m_actionFindNext, SIGNAL(activated()), this, SLOT(slotFindNext()) ); | 254 | connect( m_actionFindNext, SIGNAL(activated()), this, SLOT(slotFindNext()) ); |
248 | m_actionFindNext->addTo( popup ); | 255 | m_actionFindNext->addTo( popup ); |
249 | m_actionFindNext->addTo( &m_findBar ); | 256 | m_actionFindNext->addTo( &m_findBar ); |
250 | 257 | ||
251 | mb->insertItem( tr( "View" ), popup ); | 258 | mb->insertItem( tr( "View" ), popup ); |
252 | 259 | ||
253 | // Finish find toolbar creation | 260 | // Finish find toolbar creation |
254 | a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 261 | a = new QAction( QString::null, Opie::Core::OResource::loadPixmap( "close", Opie::Core::OResource::SmallIcon ), |
262 | QString::null, 0, this, 0 ); | ||
255 | a->setWhatsThis( tr( "Tap here to hide the find toolbar." ) ); | 263 | a->setWhatsThis( tr( "Tap here to hide the find toolbar." ) ); |
256 | connect( a, SIGNAL(activated()), this, SLOT(slotFindHideToolbar()) ); | 264 | connect( a, SIGNAL(activated()), this, SLOT(slotFindHideToolbar()) ); |
257 | a->addTo( &m_findBar ); | 265 | a->addTo( &m_findBar ); |
258 | m_findBar.hide(); | 266 | m_findBar.hide(); |
259 | } | 267 | } |
260 | 268 | ||