-rw-r--r-- | noncore/settings/packagemanager/ChangeLog | 21 | ||||
-rw-r--r-- | noncore/settings/packagemanager/entrydlg.cpp | 5 | ||||
-rw-r--r-- | noncore/settings/packagemanager/filterdlg.cpp | 2 | ||||
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.cpp | 2 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.cpp | 2 | ||||
-rw-r--r-- | noncore/settings/packagemanager/opackagemanager.cpp | 2 | ||||
-rw-r--r-- | noncore/settings/packagemanager/promptdlg.cpp | 4 | ||||
-rw-r--r-- | noncore/settings/packagemanager/promptdlg.h | 2 |
8 files changed, 22 insertions, 18 deletions
diff --git a/noncore/settings/packagemanager/ChangeLog b/noncore/settings/packagemanager/ChangeLog index 72e6169..744122f 100644 --- a/noncore/settings/packagemanager/ChangeLog +++ b/noncore/settings/packagemanager/ChangeLog @@ -1,20 +1,21 @@ -2004-mm-dd Dan Williams <drw@handhelds.org> +2004-02-12 Dan Williams <drw@handhelds.org> - * Package information dialog implemented - * What's This app icon enabled + * Package information dialog implemented + * What's This app icon enabled + * Changed all QDialog::exec() occurences to QPEApplication::execDialog() 2004-01-23 Dan Williams <drw@handhelds.org> - * Added package download functionality - * Have Opie update links after install/removal so that apps - will display properly in Launcher + * Added package download functionality + * Have Opie update links after install/removal so that apps + will display properly in Launcher 2004-01-20 Dan Williams <drw@handhelds.org> - * Released version 0.2.0 - * Converted to use libipkg in place of spawning ipkg process + * Released version 0.2.0 + * Converted to use libipkg in place of spawning ipkg process 2004-01-13 Dan Williams <drw@handhelds.org> - * Released version 0.1.0 - * Initial check-in of new package management client to eventually replace AQPkg + * Released version 0.1.0 + * Initial check-in of new package management client to eventually replace AQPkg diff --git a/noncore/settings/packagemanager/entrydlg.cpp b/noncore/settings/packagemanager/entrydlg.cpp index 8deaa37..663abd2 100644 --- a/noncore/settings/packagemanager/entrydlg.cpp +++ b/noncore/settings/packagemanager/entrydlg.cpp @@ -21,32 +21,34 @@ : = ...= . :.=- You should have received a copy of the GNU -. .:....=;==+<; General Public License along with this file; -_. . . )=. = see the file COPYING. If not, write to the -- :-=` Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "entrydlg.h" #include <qlabel.h> #include <qlayout.h> #include <qlineedit.h> #include <qpushbutton.h> +#include <qpe/qpeapplication.h> + EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal ) : QDialog( parent, name, modal ) { QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 ); QLabel *l = new QLabel( label, this ); l->setAlignment( AlignLeft | AlignTop | WordBreak ); vbox->addWidget( l ); m_entry = new QLineEdit( this ); vbox->addWidget( m_entry ); connect( m_entry, SIGNAL(returnPressed()), this, SLOT(tryAccept()) ); } void EntryDlg::setText( const QString &text ) @@ -55,28 +57,29 @@ void EntryDlg::setText( const QString &text ) m_entry->selectAll(); } QString EntryDlg::getText() { return m_entry->text(); } QString EntryDlg::getText( const QString &caption, const QString &label, const QString &text, bool *ok, QWidget *parent, const char *name ) { EntryDlg *dlg = new EntryDlg( label, parent, name, true ); dlg->setCaption( caption ); dlg->setText( text ); QString result; - *ok = ( dlg->exec() == QDialog::Accepted ); + + *ok = ( QPEApplication::execDialog( dlg ) == QDialog::Accepted ); if ( *ok ) result = dlg->getText(); delete dlg; return result; } void EntryDlg::tryAccept() { if ( !m_entry->text().isEmpty() ) accept(); } diff --git a/noncore/settings/packagemanager/filterdlg.cpp b/noncore/settings/packagemanager/filterdlg.cpp index 2e48d5b..0da9d19 100644 --- a/noncore/settings/packagemanager/filterdlg.cpp +++ b/noncore/settings/packagemanager/filterdlg.cpp @@ -95,33 +95,33 @@ FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name, connect( m_serverCB, SIGNAL(toggled(bool)), this, SLOT(slotServerSelected(bool)) ); m_server = new QComboBox( container ); m_server->insertStringList( *(pm->servers()) ); initItem( m_server, m_serverCB, server ); layout->addWidget( m_serverCB ); layout->addWidget( m_server ); // Destination m_destCB = new QCheckBox( tr( "Installed on device at:" ), container ); connect( m_destCB, SIGNAL(toggled(bool)), this, SLOT(slotDestSelected(bool)) ); m_destination = new QComboBox( container ); m_destination->insertStringList( *(pm->destinations()) ); initItem( m_destination, m_destCB, destination ); layout->addWidget( m_destCB ); layout->addWidget( m_destination ); - showMaximized(); + //showMaximized(); } void FilterDlg::initItem( QComboBox *comboBox, QCheckBox *checkBox, const QString &selection ) { if ( !selection.isNull() ) { checkBox->setChecked( true ); for ( int i = 0; i < comboBox->count(); i++ ) { if ( comboBox->text( i ) == selection ) { comboBox->setCurrentItem( i ); return; } } diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp index 8b374ab..2cb11ba 100644 --- a/noncore/settings/packagemanager/mainwindow.cpp +++ b/noncore/settings/packagemanager/mainwindow.cpp @@ -598,33 +598,33 @@ void MainWindow::slotShowUpdated() OPackageManager::Updated, QString::null ); } else packageList = m_packman.packages(); if ( packageList ) { loadPackageList( packageList, true ); delete packageList; } } void MainWindow::slotFilterChange() { FilterDlg dlg( this, &m_packman, m_filterName, m_filterServer, m_filterDest, m_filterStatus, m_filterCategory ); - if ( dlg.exec() == QDialog::Accepted ) + if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) { m_filterName = dlg.name(); m_filterServer = dlg.server(); m_filterDest = dlg.destination(); m_filterStatus = dlg.status(); m_filterCategory = dlg.category(); m_actionFilter->setOn( true ); slotFilter( true ); } else { m_actionFilter->setOn( false ); slotFilter( false ); } } diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp index e335f8f..84c6de4 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp +++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp @@ -70,33 +70,33 @@ OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *paren // Setup tabs for all info m_layout.addWidget( &m_tabWidget ); if ( !m_installOptions ) { m_tabWidget.addTab( m_serverWidget, "packagemanager/servertab", tr( "Servers" ) ); m_tabWidget.addTab( m_destWidget, "packagemanager/desttab", tr( "Destinations" ) ); m_tabWidget.addTab( m_proxyWidget, "packagemanager/proxytab", tr( "Proxies" ) ); m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); m_tabWidget.setCurrentTab( tr( "Servers" ) ); } else { m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); } - showMaximized(); + //showMaximized(); } void OIpkgConfigDlg::accept() { // Save server, destination and proxy configuration if ( !m_installOptions ) m_ipkg->setConfigItems( m_configs ); // Save options configuration int options = 0; if ( m_optForceDepends->isChecked() ) options |= FORCE_DEPENDS; if ( m_optForceReinstall->isChecked() ) options |= FORCE_REINSTALL; if ( m_optForceRemove->isChecked() ) options |= FORCE_REMOVE; diff --git a/noncore/settings/packagemanager/opackagemanager.cpp b/noncore/settings/packagemanager/opackagemanager.cpp index e1c8a21..ad2fe02 100644 --- a/noncore/settings/packagemanager/opackagemanager.cpp +++ b/noncore/settings/packagemanager/opackagemanager.cpp @@ -294,30 +294,30 @@ OPackage *OPackageManager::findPackage( const QString &name ) } int OPackageManager::compareVersions( const QString &version1, const QString &version2 ) { // TODO - do proper compare! if ( version1 < version2 ) return -1; else if ( version1 > version2 ) return 1; return 0; } bool OPackageManager::configureDlg( bool installOptions ) { OIpkgConfigDlg dlg( &m_ipkg, installOptions, static_cast<QWidget *>(parent()) ); - return ( dlg.exec() == QDialog::Accepted ); + return ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); } void OPackageManager::saveSettings() { m_ipkg.saveSettings(); } bool OPackageManager::executeCommand( OPackage::Command command, QStringList *packages, const QString &destination, const QObject *receiver, const char *slotOutput, bool rawOutput ) { return m_ipkg.executeCommand( command, packages, destination, receiver, slotOutput, rawOutput ); } diff --git a/noncore/settings/packagemanager/promptdlg.cpp b/noncore/settings/packagemanager/promptdlg.cpp index bb27190..128e88e 100644 --- a/noncore/settings/packagemanager/promptdlg.cpp +++ b/noncore/settings/packagemanager/promptdlg.cpp @@ -44,33 +44,33 @@ PromptDlg::PromptDlg( const QString &caption, const QString &text, const QString setCaption( caption ); QGridLayout *layout = new QGridLayout( this, 2, 2, 4, 2 ); QLabel *label = new QLabel( text, this ); label->setAlignment( AlignCenter | AlignTop | WordBreak ); layout->addMultiCellWidget( label, 0, 0, 0, 1 ); QPushButton *btn = new QPushButton( btn1, this ); layout->addWidget( btn, 1, 0 ); connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn1Clicked()) ); btn = new QPushButton( btn2, this ); layout->addWidget( btn, 1, 1 ); connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn2Clicked()) ); } -int PromptDlg::exec() +int PromptDlg::display() { // Determine position of dialog. Derived from QT's QDialog::show() method. QWidget *w = parentWidget(); QPoint p( 0, 0 ); int extraw = 0, extrah = 0; QWidget * desk = QApplication::desktop(); if ( w ) w = w->topLevelWidget(); QWidgetList *list = QApplication::topLevelWidgets(); QWidgetListIt it( *list ); while ( (extraw == 0 || extrah == 0) && it.current() != 0 ) { int w, h; QWidget * current = it.current(); ++it; @@ -109,32 +109,32 @@ int PromptDlg::exec() if ( p.y() < 0 ) p.setY( 0 ); move( p ); show(); // Enter event loop for modality qApp->enter_loop(); return m_btnClicked; } int PromptDlg::ask( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, QWidget *parent ) { PromptDlg *dlg = new PromptDlg( caption, text, btn1, btn2, parent ); - int rc = dlg->exec(); + int rc = dlg->display(); delete dlg; return rc; } void PromptDlg::slotBtn1Clicked() { m_btnClicked = 1; qApp->exit_loop(); } void PromptDlg::slotBtn2Clicked() { m_btnClicked = 2; qApp->exit_loop(); } diff --git a/noncore/settings/packagemanager/promptdlg.h b/noncore/settings/packagemanager/promptdlg.h index e0e9f41..790ff4d 100644 --- a/noncore/settings/packagemanager/promptdlg.h +++ b/noncore/settings/packagemanager/promptdlg.h @@ -27,31 +27,31 @@ */ #ifndef PROMPTDLG_H #define PROMPTDLG_H #include <qwidget.h> class PromptDlg : public QWidget { Q_OBJECT public: PromptDlg( const QString &caption = 0x0, const QString &text = 0x0, const QString &btn1 = 0x0, const QString &btn2 = 0x0, QWidget *parent = 0x0 ); - int exec(); + int display(); int btnPressed() { return m_btnClicked; } static int ask( const QString &caption = 0x0, const QString &text = 0x0, const QString &btn1 = 0x0, const QString &btn2 = 0x0, QWidget *parent = 0x0 ); private: int m_btnClicked; // Indicator for which button was pressed private slots: void slotBtn1Clicked(); void slotBtn2Clicked(); }; #endif |