Diffstat (limited to 'noncore/tools/opie-sh/mbox.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/tools/opie-sh/mbox.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/tools/opie-sh/mbox.cpp b/noncore/tools/opie-sh/mbox.cpp index cb3ea1b..04b397d 100644 --- a/noncore/tools/opie-sh/mbox.cpp +++ b/noncore/tools/opie-sh/mbox.cpp | |||
@@ -1,67 +1,67 @@ | |||
1 | /* | 1 | /* |
2 | Opie-sh. convinience app to allow you to use qdialogs in scripts (mainly shell scripts) | 2 | Opie-sh. convinience app to allow you to use qdialogs in scripts (mainly shell scripts) |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "mbox.h" | 17 | #include "mbox.h" |
18 | 18 | ||
19 | MBox::MBox(int w, int h, int type, QString title, QString message, QString *btext0 = 0, QString *btext1= 0, QString *btext2 = 0, QWidget *parent=0, const char*name=0, bool modal=true, WFlags f=0):QDialog(parent, name, modal, f) | 19 | MBox::MBox(int w, int h, int type, QString title, QString message, QString *btext0, QString *btext1, QString *btext2, QWidget *parent, const char*name, bool modal, WFlags f):QDialog(parent, name, modal, f) |
20 | { | 20 | { |
21 | QVBoxLayout *layout = new QVBoxLayout(this); | 21 | QVBoxLayout *layout = new QVBoxLayout(this); |
22 | 22 | ||
23 | QHBoxLayout *hlayout1 = new QHBoxLayout(this); | 23 | QHBoxLayout *hlayout1 = new QHBoxLayout(this); |
24 | QHBoxLayout *hlayout2 = new QHBoxLayout(this); | 24 | QHBoxLayout *hlayout2 = new QHBoxLayout(this); |
25 | 25 | ||
26 | int x, y; | 26 | int x, y; |
27 | 27 | ||
28 | layout->addLayout(hlayout1); | 28 | layout->addLayout(hlayout1); |
29 | layout->addLayout(hlayout2); | 29 | layout->addLayout(hlayout2); |
30 | 30 | ||
31 | setCaption(title); | 31 | setCaption(title); |
32 | 32 | ||
33 | QLabel *image = new QLabel(this, "image"); | 33 | QLabel *image = new QLabel(this, "image"); |
34 | QLabel *text = new QLabel(message, this, "text"); | 34 | QLabel *text = new QLabel(message, this, "text"); |
35 | 35 | ||
36 | switch (type) | 36 | switch (type) |
37 | { | 37 | { |
38 | case 0: | 38 | case 0: |
39 | image->setPixmap(Resource::loadPixmap("opie-sh/info")); | 39 | image->setPixmap(Resource::loadPixmap("opie-sh/info")); |
40 | break; | 40 | break; |
41 | case 1: | 41 | case 1: |
42 | image->setPixmap(Resource::loadPixmap("opie-sh/warning")); | 42 | image->setPixmap(Resource::loadPixmap("opie-sh/warning")); |
43 | break; | 43 | break; |
44 | case 2: | 44 | case 2: |
45 | image->setPixmap(Resource::loadPixmap("opie-sh/error")); | 45 | image->setPixmap(Resource::loadPixmap("opie-sh/error")); |
46 | break; | 46 | break; |
47 | } | 47 | } |
48 | 48 | ||
49 | hlayout1->addWidget(image); | 49 | hlayout1->addWidget(image); |
50 | hlayout1->addSpacing(5); | 50 | hlayout1->addSpacing(5); |
51 | hlayout1->addWidget(text); | 51 | hlayout1->addWidget(text); |
52 | 52 | ||
53 | if(!btext0->isNull()) | 53 | if(!btext0->isNull()) |
54 | { | 54 | { |
55 | QPushButton *button0 = new QPushButton((const QString)*btext0, this, "button0"); | 55 | QPushButton *button0 = new QPushButton((const QString)*btext0, this, "button0"); |
56 | hlayout2->addSpacing(5); | 56 | hlayout2->addSpacing(5); |
57 | hlayout2->addWidget(button0); | 57 | hlayout2->addWidget(button0); |
58 | hlayout2->addSpacing(5); | 58 | hlayout2->addSpacing(5); |
59 | connect(button0, SIGNAL(clicked()), this, SLOT(b0pressed()) ); | 59 | connect(button0, SIGNAL(clicked()), this, SLOT(b0pressed()) ); |
60 | } | 60 | } |
61 | else | 61 | else |
62 | { | 62 | { |
63 | QPushButton *button0 = new QPushButton("Ok", this, "button0"); | 63 | QPushButton *button0 = new QPushButton("Ok", this, "button0"); |
64 | hlayout2->addSpacing(5); | 64 | hlayout2->addSpacing(5); |
65 | hlayout2->addWidget(button0); | 65 | hlayout2->addWidget(button0); |
66 | hlayout2->addSpacing(5); | 66 | hlayout2->addSpacing(5); |
67 | connect(button0, SIGNAL(clicked()), this, SLOT(b0pressed()) ); | 67 | connect(button0, SIGNAL(clicked()), this, SLOT(b0pressed()) ); |