Diffstat (limited to 'noncore/settings/packagemanager/promptdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/promptdlg.cpp | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/noncore/settings/packagemanager/promptdlg.cpp b/noncore/settings/packagemanager/promptdlg.cpp index 841b98e..5053caa 100644 --- a/noncore/settings/packagemanager/promptdlg.cpp +++ b/noncore/settings/packagemanager/promptdlg.cpp | |||
@@ -1,75 +1,76 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | Â Â Â Â Â Â Â Â This file is part of the Opie Project |
3 | 3 | ||
4 | =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> | 4 | Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> |
5 | .=l. | 5 | =. |
6 | .>+-= | 6 | .=l. |
7 | _;:, .> :=|. This file is free software; you can | 7 | Â Â Â Â Â Â .>+-= |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | Â _;:, Â Â .> Â Â :=|. This program is free software; you can |
9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 9 | .> <`_, Â > Â . Â <= redistribute it and/or modify it under |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | :`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | .="- .-=="i, Â Â .._ License as published by the Free Software |
12 | ._= =} : or (at your option) any later version. | 12 | Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, |
13 | .%`+i> _;_. | 13 | Â Â Â ._= =} Â Â Â : or (at your option) any later version. |
14 | .i_,=:_. -<s. This file is distributed in the hope that | 14 | Â Â .%`+i> Â Â Â _;_. |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that |
16 | : .. .:, . . . without even the implied warranty of | 16 | Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | : .. Â Â .:, Â Â . . . without even the implied warranty of |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 18 | Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | ..}^=.= = ; Public License for more details. | 19 | Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ++= -. .` .: | 20 | ..}^=.= Â Â Â = Â Â Â ; Library General Public License for more |
21 | : = ...= . :.=- You should have received a copy of the GNU | 21 | ++= Â -. Â Â .` Â Â .: details. |
22 | -. .:....=;==+<; General Public License along with this file; | 22 | : Â Â = Â ...= . :.=- |
23 | -_. . . )=. = see the file COPYING. If not, write to the | 23 | Â -. Â .:....=;==+<; You should have received a copy of the GNU |
24 | -- :-=` Free Software Foundation, Inc., | 24 | Â -_. . . Â )=. Â = Library General Public License along with |
25 | 59 Temple Place - Suite 330, | 25 | Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
26 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
27 | |||
28 | */ | 29 | */ |
29 | 30 | ||
30 | #include "promptdlg.h" | 31 | #include "promptdlg.h" |
31 | 32 | ||
32 | #include <qpe/qpeapplication.h> | 33 | #include <qpe/qpeapplication.h> |
33 | 34 | ||
34 | #include <qlabel.h> | 35 | #include <qlabel.h> |
35 | #include <qlayout.h> | 36 | #include <qlayout.h> |
36 | #include <qpushbutton.h> | 37 | #include <qpushbutton.h> |
37 | #include <qwidgetlist.h> | 38 | #include <qwidgetlist.h> |
38 | 39 | ||
39 | PromptDlg::PromptDlg( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, | 40 | PromptDlg::PromptDlg( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, |
40 | QWidget *parent ) | 41 | QWidget *parent ) |
41 | : QWidget( parent, QString::null, WType_Modal | WType_TopLevel | WStyle_Dialog ) | 42 | : QWidget( parent, QString::null, WType_Modal | WType_TopLevel | WStyle_Dialog ) |
42 | , m_btnClicked( -1 ) | 43 | , m_btnClicked( -1 ) |
43 | { | 44 | { |
44 | setCaption( caption ); | 45 | setCaption( caption ); |
45 | 46 | ||
46 | QGridLayout *layout = new QGridLayout( this, 2, 2, 4, 2 ); | 47 | QGridLayout *layout = new QGridLayout( this, 2, 2, 4, 2 ); |
47 | QLabel *label = new QLabel( text, this ); | 48 | QLabel *label = new QLabel( text, this ); |
48 | label->setAlignment( AlignCenter | WordBreak ); | 49 | label->setAlignment( AlignCenter | WordBreak ); |
49 | layout->addMultiCellWidget( label, 0, 0, 0, 1 ); | 50 | layout->addMultiCellWidget( label, 0, 0, 0, 1 ); |
50 | 51 | ||
51 | QPushButton *btn = new QPushButton( btn1, this ); | 52 | QPushButton *btn = new QPushButton( btn1, this ); |
52 | layout->addWidget( btn, 1, 0 ); | 53 | layout->addWidget( btn, 1, 0 ); |
53 | connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn1Clicked()) ); | 54 | connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn1Clicked()) ); |
54 | 55 | ||
55 | btn = new QPushButton( btn2, this ); | 56 | btn = new QPushButton( btn2, this ); |
56 | layout->addWidget( btn, 1, 1 ); | 57 | layout->addWidget( btn, 1, 1 ); |
57 | connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn2Clicked()) ); | 58 | connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn2Clicked()) ); |
58 | } | 59 | } |
59 | 60 | ||
60 | int PromptDlg::display() | 61 | int PromptDlg::display() |
61 | { | 62 | { |
62 | // Determine position of dialog. Derived from QT's QDialog::show() method. | 63 | // Determine position of dialog. Derived from QT's QDialog::show() method. |
63 | QWidget *w = parentWidget(); | 64 | QWidget *w = parentWidget(); |
64 | QPoint p( 0, 0 ); | 65 | QPoint p( 0, 0 ); |
65 | int extraw = 0, extrah = 0; | 66 | int extraw = 0, extrah = 0; |
66 | QWidget * desk = QApplication::desktop(); | 67 | QWidget * desk = QApplication::desktop(); |
67 | if ( w ) | 68 | if ( w ) |
68 | w = w->topLevelWidget(); | 69 | w = w->topLevelWidget(); |
69 | 70 | ||
70 | QWidgetList *list = QApplication::topLevelWidgets(); | 71 | QWidgetList *list = QApplication::topLevelWidgets(); |
71 | QWidgetListIt it( *list ); | 72 | QWidgetListIt it( *list ); |
72 | while ( (extraw == 0 || extrah == 0) && it.current() != 0 ) | 73 | while ( (extraw == 0 || extrah == 0) && it.current() != 0 ) |
73 | { | 74 | { |
74 | int w, h; | 75 | int w, h; |
75 | QWidget * current = it.current(); | 76 | QWidget * current = it.current(); |