Diffstat (limited to 'noncore/settings/packagemanager/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.cpp | 50 |
1 files changed, 26 insertions, 24 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 @@ -29,4 +29,5 @@ #include <qaction.h> +#include <qdir.h> #include <qlayout.h> #include <qlineedit.h> @@ -38,4 +39,5 @@ #include <qwhatsthis.h> +#include <qpe/qcopenvelope_qws.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> @@ -45,4 +47,5 @@ #include "filterdlg.h" #include "promptdlg.h" +#include "entrydlg.h" MainWindow::MainWindow( QWidget *parent, const char *name, WFlags fl ) @@ -163,5 +166,4 @@ void MainWindow::initUI() actionUpgrade->addTo( &m_toolBar ); -/* QPixmap iconDownload = Resource::loadPixmap( "packagemanager/download" ); QPixmap iconRemove = Resource::loadPixmap( "packagemanager/remove" ); @@ -171,5 +173,4 @@ void MainWindow::initUI() actionDownload->addTo( popup ); actionDownload->addTo( &m_toolBar ); -*/ a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 ); @@ -371,5 +372,4 @@ void MainWindow::slotUpgrade() } -/* void MainWindow::slotDownload() { @@ -387,5 +387,6 @@ void MainWindow::slotDownload() if ( workingPackages->isEmpty() ) { - // No packages were selected, prompt for URL of package to download + QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) ); + return; } else @@ -395,31 +396,27 @@ void MainWindow::slotDownload() QString workingDir = m_config.readEntry( "DownloadDir", "/tmp" ); -// QString text = InputDialog::getText( tr( "Download to where" ), tr( "Enter path to download to" ), workingDir, &ok, this ); -// if ( ok && !text.isEmpty() ) -// workingDir = text; // user entered something and pressed ok -// else -// return; // user entered nothing or pressed cancel + bool ok = false; + QString text = EntryDlg::getText( tr( "Download" ), tr( "Enter path to download package to:" ), workingDir, &ok, this ); + if ( ok && !text.isEmpty() ) + workingDir = text; // user entered something and pressed ok + else + return; // user entered nothing or pressed cancel -// // Store download directory in config file -// m_config.writeEntry( "DownloadDir", workingDir ); + // Store download directory in config file + m_config.writeEntry( "DownloadDir", workingDir ); // Get starting directory -// char initDir[PATH_MAX]; -// getcwd( initDir, PATH_MAX ); + QDir::setCurrent( workingDir ); - // Download packages + // Create package manager output widget + InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), false, + OPackage::Download, workingPackages ); + connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseInstallDlg()) ); + // Display widget + m_widgetStack.addWidget( dlg, 3 ); + m_widgetStack.raiseWidget( dlg ); } - - // Create package manager output widget - InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), false, - OPackage::Download, workingPackages ); - connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseInstallDlg()) ); - - // Display widget - m_widgetStack.addWidget( dlg, 3 ); - m_widgetStack.raiseWidget( dlg ); } -*/ void MainWindow::slotApply() @@ -527,4 +524,9 @@ void MainWindow::slotCloseInstallDlg() // Reload package list initPackageInfo(); + + // Update Opie launcher links + QCopEnvelope e("QPE/System", "linkChanged(QString)"); + QString lf = QString::null; + e << lf; } |