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