author | drw <drw> | 2004-02-12 15:14:07 (UTC) |
---|---|---|
committer | drw <drw> | 2004-02-12 15:14:07 (UTC) |
commit | 596d87e16d593cbc52d510973ece99ffe26cd4c4 (patch) (unidiff) | |
tree | 1b04d79f2c5b61aeccca85505d87c9f0d9612d4d | |
parent | c06370063cb3983c1e90434ee66db4d7a3bedda2 (diff) | |
download | opie-596d87e16d593cbc52d510973ece99ffe26cd4c4.zip opie-596d87e16d593cbc52d510973ece99ffe26cd4c4.tar.gz opie-596d87e16d593cbc52d510973ece99ffe26cd4c4.tar.bz2 |
QDialog::exec() -> QPEApplication::execDialog()
-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 @@ | |||
1 | 2004-mm-dd Dan Williams <drw@handhelds.org> | 1 | 2004-02-12 Dan Williams <drw@handhelds.org> |
2 | 2 | ||
3 | * Package information dialog implemented | 3 | * Package information dialog implemented |
4 | * What's This app icon enabled | 4 | * What's This app icon enabled |
5 | * Changed all QDialog::exec() occurences to QPEApplication::execDialog() | ||
5 | 6 | ||
6 | 2004-01-23 Dan Williams <drw@handhelds.org> | 7 | 2004-01-23 Dan Williams <drw@handhelds.org> |
7 | 8 | ||
8 | * Added package download functionality | 9 | * Added package download functionality |
9 | * Have Opie update links after install/removal so that apps | 10 | * Have Opie update links after install/removal so that apps |
10 | will display properly in Launcher | 11 | will display properly in Launcher |
11 | 12 | ||
12 | 2004-01-20 Dan Williams <drw@handhelds.org> | 13 | 2004-01-20 Dan Williams <drw@handhelds.org> |
13 | 14 | ||
14 | * Released version 0.2.0 | 15 | * Released version 0.2.0 |
15 | * Converted to use libipkg in place of spawning ipkg process | 16 | * Converted to use libipkg in place of spawning ipkg process |
16 | 17 | ||
17 | 2004-01-13 Dan Williams <drw@handhelds.org> | 18 | 2004-01-13 Dan Williams <drw@handhelds.org> |
18 | 19 | ||
19 | * Released version 0.1.0 | 20 | * Released version 0.1.0 |
20 | * Initial check-in of new package management client to eventually replace AQPkg | 21 | * 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 | |||
@@ -25,24 +25,26 @@ | |||
25 | 59 Temple Place - Suite 330, | 25 | 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "entrydlg.h" | 30 | #include "entrydlg.h" |
31 | 31 | ||
32 | #include <qlabel.h> | 32 | #include <qlabel.h> |
33 | #include <qlayout.h> | 33 | #include <qlayout.h> |
34 | #include <qlineedit.h> | 34 | #include <qlineedit.h> |
35 | #include <qpushbutton.h> | 35 | #include <qpushbutton.h> |
36 | 36 | ||
37 | #include <qpe/qpeapplication.h> | ||
38 | |||
37 | EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal ) | 39 | EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal ) |
38 | : QDialog( parent, name, modal ) | 40 | : QDialog( parent, name, modal ) |
39 | { | 41 | { |
40 | QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 ); | 42 | QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 ); |
41 | 43 | ||
42 | QLabel *l = new QLabel( label, this ); | 44 | QLabel *l = new QLabel( label, this ); |
43 | l->setAlignment( AlignLeft | AlignTop | WordBreak ); | 45 | l->setAlignment( AlignLeft | AlignTop | WordBreak ); |
44 | vbox->addWidget( l ); | 46 | vbox->addWidget( l ); |
45 | 47 | ||
46 | m_entry = new QLineEdit( this ); | 48 | m_entry = new QLineEdit( this ); |
47 | vbox->addWidget( m_entry ); | 49 | vbox->addWidget( m_entry ); |
48 | 50 | ||
@@ -59,24 +61,25 @@ QString EntryDlg::getText() | |||
59 | { | 61 | { |
60 | return m_entry->text(); | 62 | return m_entry->text(); |
61 | } | 63 | } |
62 | 64 | ||
63 | QString EntryDlg::getText( const QString &caption, const QString &label, const QString &text, bool *ok, | 65 | QString EntryDlg::getText( const QString &caption, const QString &label, const QString &text, bool *ok, |
64 | QWidget *parent, const char *name ) | 66 | QWidget *parent, const char *name ) |
65 | { | 67 | { |
66 | EntryDlg *dlg = new EntryDlg( label, parent, name, true ); | 68 | EntryDlg *dlg = new EntryDlg( label, parent, name, true ); |
67 | dlg->setCaption( caption ); | 69 | dlg->setCaption( caption ); |
68 | dlg->setText( text ); | 70 | dlg->setText( text ); |
69 | 71 | ||
70 | QString result; | 72 | QString result; |
71 | *ok = ( dlg->exec() == QDialog::Accepted ); | 73 | |
74 | *ok = ( QPEApplication::execDialog( dlg ) == QDialog::Accepted ); | ||
72 | if ( *ok ) | 75 | if ( *ok ) |
73 | result = dlg->getText(); | 76 | result = dlg->getText(); |
74 | 77 | ||
75 | delete dlg; | 78 | delete dlg; |
76 | return result; | 79 | return result; |
77 | } | 80 | } |
78 | void EntryDlg::tryAccept() | 81 | void EntryDlg::tryAccept() |
79 | { | 82 | { |
80 | if ( !m_entry->text().isEmpty() ) | 83 | if ( !m_entry->text().isEmpty() ) |
81 | accept(); | 84 | accept(); |
82 | } | 85 | } |
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 | |||
@@ -99,25 +99,25 @@ FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name, | |||
99 | layout->addWidget( m_serverCB ); | 99 | layout->addWidget( m_serverCB ); |
100 | layout->addWidget( m_server ); | 100 | layout->addWidget( m_server ); |
101 | 101 | ||
102 | // Destination | 102 | // Destination |
103 | m_destCB = new QCheckBox( tr( "Installed on device at:" ), container ); | 103 | m_destCB = new QCheckBox( tr( "Installed on device at:" ), container ); |
104 | connect( m_destCB, SIGNAL(toggled(bool)), this, SLOT(slotDestSelected(bool)) ); | 104 | connect( m_destCB, SIGNAL(toggled(bool)), this, SLOT(slotDestSelected(bool)) ); |
105 | m_destination = new QComboBox( container ); | 105 | m_destination = new QComboBox( container ); |
106 | m_destination->insertStringList( *(pm->destinations()) ); | 106 | m_destination->insertStringList( *(pm->destinations()) ); |
107 | initItem( m_destination, m_destCB, destination ); | 107 | initItem( m_destination, m_destCB, destination ); |
108 | layout->addWidget( m_destCB ); | 108 | layout->addWidget( m_destCB ); |
109 | layout->addWidget( m_destination ); | 109 | layout->addWidget( m_destination ); |
110 | 110 | ||
111 | showMaximized(); | 111 | //showMaximized(); |
112 | } | 112 | } |
113 | 113 | ||
114 | void FilterDlg::initItem( QComboBox *comboBox, QCheckBox *checkBox, const QString &selection ) | 114 | void FilterDlg::initItem( QComboBox *comboBox, QCheckBox *checkBox, const QString &selection ) |
115 | { | 115 | { |
116 | if ( !selection.isNull() ) | 116 | if ( !selection.isNull() ) |
117 | { | 117 | { |
118 | checkBox->setChecked( true ); | 118 | checkBox->setChecked( true ); |
119 | 119 | ||
120 | for ( int i = 0; i < comboBox->count(); i++ ) | 120 | for ( int i = 0; i < comboBox->count(); i++ ) |
121 | { | 121 | { |
122 | if ( comboBox->text( i ) == selection ) | 122 | if ( comboBox->text( i ) == selection ) |
123 | { | 123 | { |
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 | |||
@@ -602,25 +602,25 @@ void MainWindow::slotShowUpdated() | |||
602 | 602 | ||
603 | if ( packageList ) | 603 | if ( packageList ) |
604 | { | 604 | { |
605 | loadPackageList( packageList, true ); | 605 | loadPackageList( packageList, true ); |
606 | delete packageList; | 606 | delete packageList; |
607 | } | 607 | } |
608 | } | 608 | } |
609 | 609 | ||
610 | void MainWindow::slotFilterChange() | 610 | void MainWindow::slotFilterChange() |
611 | { | 611 | { |
612 | FilterDlg dlg( this, &m_packman, m_filterName, m_filterServer, m_filterDest, m_filterStatus, | 612 | FilterDlg dlg( this, &m_packman, m_filterName, m_filterServer, m_filterDest, m_filterStatus, |
613 | m_filterCategory ); | 613 | m_filterCategory ); |
614 | if ( dlg.exec() == QDialog::Accepted ) | 614 | if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) |
615 | { | 615 | { |
616 | m_filterName = dlg.name(); | 616 | m_filterName = dlg.name(); |
617 | m_filterServer = dlg.server(); | 617 | m_filterServer = dlg.server(); |
618 | m_filterDest = dlg.destination(); | 618 | m_filterDest = dlg.destination(); |
619 | m_filterStatus = dlg.status(); | 619 | m_filterStatus = dlg.status(); |
620 | m_filterCategory = dlg.category(); | 620 | m_filterCategory = dlg.category(); |
621 | m_actionFilter->setOn( true ); | 621 | m_actionFilter->setOn( true ); |
622 | slotFilter( true ); | 622 | slotFilter( true ); |
623 | } | 623 | } |
624 | else | 624 | else |
625 | { | 625 | { |
626 | m_actionFilter->setOn( false ); | 626 | m_actionFilter->setOn( 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 | |||
@@ -74,25 +74,25 @@ OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *paren | |||
74 | { | 74 | { |
75 | m_tabWidget.addTab( m_serverWidget, "packagemanager/servertab", tr( "Servers" ) ); | 75 | m_tabWidget.addTab( m_serverWidget, "packagemanager/servertab", tr( "Servers" ) ); |
76 | m_tabWidget.addTab( m_destWidget, "packagemanager/desttab", tr( "Destinations" ) ); | 76 | m_tabWidget.addTab( m_destWidget, "packagemanager/desttab", tr( "Destinations" ) ); |
77 | m_tabWidget.addTab( m_proxyWidget, "packagemanager/proxytab", tr( "Proxies" ) ); | 77 | m_tabWidget.addTab( m_proxyWidget, "packagemanager/proxytab", tr( "Proxies" ) ); |
78 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); | 78 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); |
79 | m_tabWidget.setCurrentTab( tr( "Servers" ) ); | 79 | m_tabWidget.setCurrentTab( tr( "Servers" ) ); |
80 | } | 80 | } |
81 | else | 81 | else |
82 | { | 82 | { |
83 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); | 83 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); |
84 | } | 84 | } |
85 | 85 | ||
86 | showMaximized(); | 86 | //showMaximized(); |
87 | } | 87 | } |
88 | 88 | ||
89 | void OIpkgConfigDlg::accept() | 89 | void OIpkgConfigDlg::accept() |
90 | { | 90 | { |
91 | // Save server, destination and proxy configuration | 91 | // Save server, destination and proxy configuration |
92 | if ( !m_installOptions ) | 92 | if ( !m_installOptions ) |
93 | m_ipkg->setConfigItems( m_configs ); | 93 | m_ipkg->setConfigItems( m_configs ); |
94 | 94 | ||
95 | // Save options configuration | 95 | // Save options configuration |
96 | int options = 0; | 96 | int options = 0; |
97 | if ( m_optForceDepends->isChecked() ) | 97 | if ( m_optForceDepends->isChecked() ) |
98 | options |= FORCE_DEPENDS; | 98 | options |= FORCE_DEPENDS; |
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 | |||
@@ -298,25 +298,25 @@ int OPackageManager::compareVersions( const QString &version1, const QString &ve | |||
298 | // TODO - do proper compare! | 298 | // TODO - do proper compare! |
299 | if ( version1 < version2 ) | 299 | if ( version1 < version2 ) |
300 | return -1; | 300 | return -1; |
301 | else if ( version1 > version2 ) | 301 | else if ( version1 > version2 ) |
302 | return 1; | 302 | return 1; |
303 | 303 | ||
304 | return 0; | 304 | return 0; |
305 | } | 305 | } |
306 | 306 | ||
307 | bool OPackageManager::configureDlg( bool installOptions ) | 307 | bool OPackageManager::configureDlg( bool installOptions ) |
308 | { | 308 | { |
309 | OIpkgConfigDlg dlg( &m_ipkg, installOptions, static_cast<QWidget *>(parent()) ); | 309 | OIpkgConfigDlg dlg( &m_ipkg, installOptions, static_cast<QWidget *>(parent()) ); |
310 | return ( dlg.exec() == QDialog::Accepted ); | 310 | return ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); |
311 | } | 311 | } |
312 | 312 | ||
313 | void OPackageManager::saveSettings() | 313 | void OPackageManager::saveSettings() |
314 | { | 314 | { |
315 | m_ipkg.saveSettings(); | 315 | m_ipkg.saveSettings(); |
316 | } | 316 | } |
317 | 317 | ||
318 | bool OPackageManager::executeCommand( OPackage::Command command, QStringList *packages, | 318 | bool OPackageManager::executeCommand( OPackage::Command command, QStringList *packages, |
319 | const QString &destination, const QObject *receiver, | 319 | const QString &destination, const QObject *receiver, |
320 | const char *slotOutput, bool rawOutput ) | 320 | const char *slotOutput, bool rawOutput ) |
321 | { | 321 | { |
322 | return m_ipkg.executeCommand( command, packages, destination, receiver, slotOutput, rawOutput ); | 322 | 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 | |||
@@ -48,25 +48,25 @@ PromptDlg::PromptDlg( const QString &caption, const QString &text, const QString | |||
48 | label->setAlignment( AlignCenter | AlignTop | WordBreak ); | 48 | label->setAlignment( AlignCenter | AlignTop | WordBreak ); |
49 | layout->addMultiCellWidget( label, 0, 0, 0, 1 ); | 49 | layout->addMultiCellWidget( label, 0, 0, 0, 1 ); |
50 | 50 | ||
51 | QPushButton *btn = new QPushButton( btn1, this ); | 51 | QPushButton *btn = new QPushButton( btn1, this ); |
52 | layout->addWidget( btn, 1, 0 ); | 52 | layout->addWidget( btn, 1, 0 ); |
53 | connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn1Clicked()) ); | 53 | connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn1Clicked()) ); |
54 | 54 | ||
55 | btn = new QPushButton( btn2, this ); | 55 | btn = new QPushButton( btn2, this ); |
56 | layout->addWidget( btn, 1, 1 ); | 56 | layout->addWidget( btn, 1, 1 ); |
57 | connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn2Clicked()) ); | 57 | connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn2Clicked()) ); |
58 | } | 58 | } |
59 | 59 | ||
60 | int PromptDlg::exec() | 60 | int PromptDlg::display() |
61 | { | 61 | { |
62 | // Determine position of dialog. Derived from QT's QDialog::show() method. | 62 | // Determine position of dialog. Derived from QT's QDialog::show() method. |
63 | QWidget *w = parentWidget(); | 63 | QWidget *w = parentWidget(); |
64 | QPoint p( 0, 0 ); | 64 | QPoint p( 0, 0 ); |
65 | int extraw = 0, extrah = 0; | 65 | int extraw = 0, extrah = 0; |
66 | QWidget * desk = QApplication::desktop(); | 66 | QWidget * desk = QApplication::desktop(); |
67 | if ( w ) | 67 | if ( w ) |
68 | w = w->topLevelWidget(); | 68 | w = w->topLevelWidget(); |
69 | 69 | ||
70 | QWidgetList *list = QApplication::topLevelWidgets(); | 70 | QWidgetList *list = QApplication::topLevelWidgets(); |
71 | QWidgetListIt it( *list ); | 71 | QWidgetListIt it( *list ); |
72 | while ( (extraw == 0 || extrah == 0) && it.current() != 0 ) | 72 | while ( (extraw == 0 || extrah == 0) && it.current() != 0 ) |
@@ -113,25 +113,25 @@ int PromptDlg::exec() | |||
113 | show(); | 113 | show(); |
114 | 114 | ||
115 | // Enter event loop for modality | 115 | // Enter event loop for modality |
116 | qApp->enter_loop(); | 116 | qApp->enter_loop(); |
117 | 117 | ||
118 | return m_btnClicked; | 118 | return m_btnClicked; |
119 | } | 119 | } |
120 | 120 | ||
121 | int PromptDlg::ask( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, | 121 | int PromptDlg::ask( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, |
122 | QWidget *parent ) | 122 | QWidget *parent ) |
123 | { | 123 | { |
124 | PromptDlg *dlg = new PromptDlg( caption, text, btn1, btn2, parent ); | 124 | PromptDlg *dlg = new PromptDlg( caption, text, btn1, btn2, parent ); |
125 | int rc = dlg->exec(); | 125 | int rc = dlg->display(); |
126 | delete dlg; | 126 | delete dlg; |
127 | return rc; | 127 | return rc; |
128 | } | 128 | } |
129 | 129 | ||
130 | void PromptDlg::slotBtn1Clicked() | 130 | void PromptDlg::slotBtn1Clicked() |
131 | { | 131 | { |
132 | m_btnClicked = 1; | 132 | m_btnClicked = 1; |
133 | qApp->exit_loop(); | 133 | qApp->exit_loop(); |
134 | } | 134 | } |
135 | 135 | ||
136 | void PromptDlg::slotBtn2Clicked() | 136 | void PromptDlg::slotBtn2Clicked() |
137 | { | 137 | { |
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 | |||
@@ -31,25 +31,25 @@ | |||
31 | #define PROMPTDLG_H | 31 | #define PROMPTDLG_H |
32 | 32 | ||
33 | #include <qwidget.h> | 33 | #include <qwidget.h> |
34 | 34 | ||
35 | class PromptDlg : public QWidget | 35 | class PromptDlg : public QWidget |
36 | { | 36 | { |
37 | Q_OBJECT | 37 | Q_OBJECT |
38 | 38 | ||
39 | public: | 39 | public: |
40 | PromptDlg( const QString &caption = 0x0, const QString &text = 0x0, const QString &btn1 = 0x0, | 40 | PromptDlg( const QString &caption = 0x0, const QString &text = 0x0, const QString &btn1 = 0x0, |
41 | const QString &btn2 = 0x0, QWidget *parent = 0x0 ); | 41 | const QString &btn2 = 0x0, QWidget *parent = 0x0 ); |
42 | 42 | ||
43 | int exec(); | 43 | int display(); |
44 | int btnPressed() { return m_btnClicked; } | 44 | int btnPressed() { return m_btnClicked; } |
45 | 45 | ||
46 | static int ask( const QString &caption = 0x0, const QString &text = 0x0, const QString &btn1 = 0x0, | 46 | static int ask( const QString &caption = 0x0, const QString &text = 0x0, const QString &btn1 = 0x0, |
47 | const QString &btn2 = 0x0, QWidget *parent = 0x0 ); | 47 | const QString &btn2 = 0x0, QWidget *parent = 0x0 ); |
48 | 48 | ||
49 | private: | 49 | private: |
50 | int m_btnClicked; // Indicator for which button was pressed | 50 | int m_btnClicked; // Indicator for which button was pressed |
51 | 51 | ||
52 | private slots: | 52 | private slots: |
53 | void slotBtn1Clicked(); | 53 | void slotBtn1Clicked(); |
54 | void slotBtn2Clicked(); | 54 | void slotBtn2Clicked(); |
55 | }; | 55 | }; |