Diffstat (limited to 'noncore/settings/packagemanager/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp index 4611404..486561d 100644 --- a/noncore/settings/packagemanager/mainwindow.cpp +++ b/noncore/settings/packagemanager/mainwindow.cpp | |||
@@ -28,6 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <qaction.h> | 30 | #include <qaction.h> |
31 | #include <qdir.h> | ||
31 | #include <qlayout.h> | 32 | #include <qlayout.h> |
32 | #include <qlineedit.h> | 33 | #include <qlineedit.h> |
33 | #include <qmenubar.h> | 34 | #include <qmenubar.h> |
@@ -37,6 +38,7 @@ | |||
37 | #include <qtoolbar.h> | 38 | #include <qtoolbar.h> |
38 | #include <qwhatsthis.h> | 39 | #include <qwhatsthis.h> |
39 | 40 | ||
41 | #include <qpe/qcopenvelope_qws.h> | ||
40 | #include <qpe/qpeapplication.h> | 42 | #include <qpe/qpeapplication.h> |
41 | #include <qpe/resource.h> | 43 | #include <qpe/resource.h> |
42 | 44 | ||
@@ -44,6 +46,7 @@ | |||
44 | #include "installdlg.h" | 46 | #include "installdlg.h" |
45 | #include "filterdlg.h" | 47 | #include "filterdlg.h" |
46 | #include "promptdlg.h" | 48 | #include "promptdlg.h" |
49 | #include "entrydlg.h" | ||
47 | 50 | ||
48 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags fl ) | 51 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags fl ) |
49 | : QMainWindow( parent, name, fl || WStyle_ContextHelp ) | 52 | : QMainWindow( parent, name, fl || WStyle_ContextHelp ) |
@@ -162,7 +165,6 @@ void MainWindow::initUI() | |||
162 | actionUpgrade->addTo( popup ); | 165 | actionUpgrade->addTo( popup ); |
163 | actionUpgrade->addTo( &m_toolBar ); | 166 | actionUpgrade->addTo( &m_toolBar ); |
164 | 167 | ||
165 | /* | ||
166 | QPixmap iconDownload = Resource::loadPixmap( "packagemanager/download" ); | 168 | QPixmap iconDownload = Resource::loadPixmap( "packagemanager/download" ); |
167 | QPixmap iconRemove = Resource::loadPixmap( "packagemanager/remove" ); | 169 | QPixmap iconRemove = Resource::loadPixmap( "packagemanager/remove" ); |
168 | QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); | 170 | QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); |
@@ -170,7 +172,6 @@ void MainWindow::initUI() | |||
170 | connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) ); | 172 | connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) ); |
171 | actionDownload->addTo( popup ); | 173 | actionDownload->addTo( popup ); |
172 | actionDownload->addTo( &m_toolBar ); | 174 | actionDownload->addTo( &m_toolBar ); |
173 | */ | ||
174 | 175 | ||
175 | a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 ); | 176 | a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 ); |
176 | a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) ); | 177 | a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) ); |
@@ -370,7 +371,6 @@ void MainWindow::slotUpgrade() | |||
370 | m_widgetStack.raiseWidget( dlg ); | 371 | m_widgetStack.raiseWidget( dlg ); |
371 | } | 372 | } |
372 | 373 | ||
373 | /* | ||
374 | void MainWindow::slotDownload() | 374 | void MainWindow::slotDownload() |
375 | { | 375 | { |
376 | // Retrieve list of packages selected for download (if any) | 376 | // Retrieve list of packages selected for download (if any) |
@@ -386,7 +386,8 @@ void MainWindow::slotDownload() | |||
386 | 386 | ||
387 | if ( workingPackages->isEmpty() ) | 387 | if ( workingPackages->isEmpty() ) |
388 | { | 388 | { |
389 | // No packages were selected, prompt for URL of package to download | 389 | QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) ); |
390 | return; | ||
390 | } | 391 | } |
391 | else | 392 | else |
392 | { | 393 | { |
@@ -394,22 +395,18 @@ void MainWindow::slotDownload() | |||
394 | m_config.setGroup( "settings" ); | 395 | m_config.setGroup( "settings" ); |
395 | QString workingDir = m_config.readEntry( "DownloadDir", "/tmp" ); | 396 | QString workingDir = m_config.readEntry( "DownloadDir", "/tmp" ); |
396 | 397 | ||
397 | // QString text = InputDialog::getText( tr( "Download to where" ), tr( "Enter path to download to" ), workingDir, &ok, this ); | 398 | bool ok = false; |
398 | // if ( ok && !text.isEmpty() ) | 399 | QString text = EntryDlg::getText( tr( "Download" ), tr( "Enter path to download package to:" ), workingDir, &ok, this ); |
399 | // workingDir = text; // user entered something and pressed ok | 400 | if ( ok && !text.isEmpty() ) |
400 | // else | 401 | workingDir = text; // user entered something and pressed ok |
401 | // return; // user entered nothing or pressed cancel | 402 | else |
403 | return; // user entered nothing or pressed cancel | ||
402 | 404 | ||
403 | // // Store download directory in config file | 405 | // Store download directory in config file |
404 | // m_config.writeEntry( "DownloadDir", workingDir ); | 406 | m_config.writeEntry( "DownloadDir", workingDir ); |
405 | 407 | ||
406 | // Get starting directory | 408 | // Get starting directory |
407 | // char initDir[PATH_MAX]; | 409 | QDir::setCurrent( workingDir ); |
408 | // getcwd( initDir, PATH_MAX ); | ||
409 | |||
410 | // Download packages | ||
411 | |||
412 | } | ||
413 | 410 | ||
414 | // Create package manager output widget | 411 | // Create package manager output widget |
415 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), false, | 412 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), false, |
@@ -420,7 +417,7 @@ void MainWindow::slotDownload() | |||
420 | m_widgetStack.addWidget( dlg, 3 ); | 417 | m_widgetStack.addWidget( dlg, 3 ); |
421 | m_widgetStack.raiseWidget( dlg ); | 418 | m_widgetStack.raiseWidget( dlg ); |
422 | } | 419 | } |
423 | */ | 420 | } |
424 | 421 | ||
425 | void MainWindow::slotApply() | 422 | void MainWindow::slotApply() |
426 | { | 423 | { |
@@ -526,6 +523,11 @@ void MainWindow::slotCloseInstallDlg() | |||
526 | 523 | ||
527 | // Reload package list | 524 | // Reload package list |
528 | initPackageInfo(); | 525 | initPackageInfo(); |
526 | |||
527 | // Update Opie launcher links | ||
528 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | ||
529 | QString lf = QString::null; | ||
530 | e << lf; | ||
529 | } | 531 | } |
530 | 532 | ||
531 | void MainWindow::slotConfigure() | 533 | void MainWindow::slotConfigure() |