summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/opie-sh/config.in2
-rw-r--r--noncore/tools/opie-sh/fviewer.cpp4
-rw-r--r--noncore/tools/opie-sh/fviewer.h1
-rw-r--r--noncore/tools/opie-sh/mbox.cpp8
-rw-r--r--noncore/tools/opie-sh/mbox.h1
-rw-r--r--noncore/tools/opie-sh/opie-sh.control2
-rw-r--r--noncore/tools/opie-sh/opie-sh.pro2
7 files changed, 11 insertions, 9 deletions
diff --git a/noncore/tools/opie-sh/config.in b/noncore/tools/opie-sh/config.in
index b3ca373..c4e99c3 100644
--- a/noncore/tools/opie-sh/config.in
+++ b/noncore/tools/opie-sh/config.in
@@ -1,4 +1,4 @@
1 config OPIE-SH 1 config OPIE-SH
2 boolean "opie-sh (qdialog frontend allows you to write dialogs from shell scripts)" 2 boolean "opie-sh (qdialog frontend allows you to write dialogs from shell scripts)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE
diff --git a/noncore/tools/opie-sh/fviewer.cpp b/noncore/tools/opie-sh/fviewer.cpp
index 6f8f054..bef7233 100644
--- a/noncore/tools/opie-sh/fviewer.cpp
+++ b/noncore/tools/opie-sh/fviewer.cpp
@@ -1,59 +1,61 @@
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#include "fviewer.h" 16#include "fviewer.h"
17 17
18#include <opie2/oresource.h>
19
18FViewer::FViewer(QString icon, QString filename, QString title, QWidget *parent, const char*name):QWidget(parent, name) 20FViewer::FViewer(QString icon, QString filename, QString title, QWidget *parent, const char*name):QWidget(parent, name)
19{ 21{
20 QVBoxLayout *layout = new QVBoxLayout(this); 22 QVBoxLayout *layout = new QVBoxLayout(this);
21 23
22 setIcon(Resource::loadPixmap("opie-sh")); 24 setIcon(Opie::Core::OResource::loadPixmap("opie-sh", Opie::Core::OResource::SmallIcon));
23 25
24 textView = new QTextBrowser(this, "textview"); 26 textView = new QTextBrowser(this, "textview");
25 layout->addWidget(textView); 27 layout->addWidget(textView);
26 28
27 QString string; 29 QString string;
28 30
29 if(title.isNull()) 31 if(title.isNull())
30 { 32 {
31 setCaption(filename); 33 setCaption(filename);
32 } 34 }
33 else 35 else
34 { 36 {
35 setCaption(title); 37 setCaption(title);
36 } 38 }
37 39
38 file = new QFile(); 40 file = new QFile();
39 41
40 if(!filename.isNull()) 42 if(!filename.isNull())
41 { 43 {
42 file->setName(filename); 44 file->setName(filename);
43 file->open(IO_ReadOnly); 45 file->open(IO_ReadOnly);
44 } 46 }
45 else 47 else
46 { 48 {
47 file->open(IO_ReadOnly, 0); 49 file->open(IO_ReadOnly, 0);
48 } 50 }
49 51
50 stream = new QTextStream(file); 52 stream = new QTextStream(file);
51 53
52 string = stream->read(); 54 string = stream->read();
53 textView->mimeSourceFactory()->setFilePath(QDir::currentDirPath()+"/"); 55 textView->mimeSourceFactory()->setFilePath(QDir::currentDirPath()+"/");
54 textView->setText(string, QDir::currentDirPath()+"/"); 56 textView->setText(string, QDir::currentDirPath()+"/");
55 printf("%s\n", QDir::currentDirPath().latin1()); 57 printf("%s\n", QDir::currentDirPath().latin1());
56 file->close(); 58 file->close();
57 59
58} 60}
59 61
diff --git a/noncore/tools/opie-sh/fviewer.h b/noncore/tools/opie-sh/fviewer.h
index cd5206c..e0b3813 100644
--- a/noncore/tools/opie-sh/fviewer.h
+++ b/noncore/tools/opie-sh/fviewer.h
@@ -1,36 +1,35 @@
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 <qwidget.h> 17#include <qwidget.h>
18#include <qfile.h> 18#include <qfile.h>
19#include <qtextstream.h> 19#include <qtextstream.h>
20#include <qtextbrowser.h> 20#include <qtextbrowser.h>
21#include <qlayout.h> 21#include <qlayout.h>
22#include <qtimer.h> 22#include <qtimer.h>
23#include <qdir.h> 23#include <qdir.h>
24#include <qpe/resource.h>
25 24
26class FViewer :public QWidget 25class FViewer :public QWidget
27{ 26{
28 Q_OBJECT 27 Q_OBJECT
29public: 28public:
30 FViewer(QString icon, QString filename, QString title, QWidget *parent=0, const char*name=0); 29 FViewer(QString icon, QString filename, QString title, QWidget *parent=0, const char*name=0);
31private: 30private:
32 QFile *file; 31 QFile *file;
33 QTextBrowser *textView; 32 QTextBrowser *textView;
34 QTextStream *stream; 33 QTextStream *stream;
35 QTimer *timer; 34 QTimer *timer;
36}; 35};
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,90 +1,92 @@
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
70 if(!btext1->isNull()) 72 if(!btext1->isNull())
71 { 73 {
72 QPushButton *button1 = new QPushButton((const QString)*btext1, this, "button1"); 74 QPushButton *button1 = new QPushButton((const QString)*btext1, this, "button1");
73 hlayout2->addWidget(button1); 75 hlayout2->addWidget(button1);
74 hlayout2->addSpacing(5); 76 hlayout2->addSpacing(5);
75 connect(button1, SIGNAL(clicked()), this, SLOT(b1pressed()) ); 77 connect(button1, SIGNAL(clicked()), this, SLOT(b1pressed()) );
76 } 78 }
77 79
78 if(!btext2->isNull()) 80 if(!btext2->isNull())
79 { 81 {
80 QPushButton *button2 = new QPushButton((const QString)*btext2, this, "button2"); 82 QPushButton *button2 = new QPushButton((const QString)*btext2, this, "button2");
81 hlayout2->addWidget(button2); 83 hlayout2->addWidget(button2);
82 hlayout2->addSpacing(5); 84 hlayout2->addSpacing(5);
83 connect(button2, SIGNAL(clicked()), this, SLOT(b2pressed()) ); 85 connect(button2, SIGNAL(clicked()), this, SLOT(b2pressed()) );
84 } 86 }
85 87
86 x=(w/2)-(width()/2); 88 x=(w/2)-(width()/2);
87 y=(h/2)-(height()/2); 89 y=(h/2)-(height()/2);
88 90
89 move(x, y); 91 move(x, y);
90} 92}
diff --git a/noncore/tools/opie-sh/mbox.h b/noncore/tools/opie-sh/mbox.h
index 66c982a..967a0a3 100644
--- a/noncore/tools/opie-sh/mbox.h
+++ b/noncore/tools/opie-sh/mbox.h
@@ -1,38 +1,37 @@
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 <qpe/resource.h>
18#include <qdialog.h> 17#include <qdialog.h>
19#include <qstring.h> 18#include <qstring.h>
20#include <qiconset.h> 19#include <qiconset.h>
21#include <qpixmap.h> 20#include <qpixmap.h>
22#include <qlabel.h> 21#include <qlabel.h>
23#include <qlayout.h> 22#include <qlayout.h>
24#include <qpushbutton.h> 23#include <qpushbutton.h>
25#include <qwidget.h> 24#include <qwidget.h>
26 25
27#include <unistd.h> 26#include <unistd.h>
28 27
29class MBox : public QDialog 28class MBox : public QDialog
30{ 29{
31 Q_OBJECT 30 Q_OBJECT
32public: 31public:
33 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); 32 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);
34public slots: 33public slots:
35 void b0pressed(){done(2);}; 34 void b0pressed(){done(2);};
36 void b1pressed(){done(3);}; 35 void b1pressed(){done(3);};
37 void b2pressed(){done(4);}; 36 void b2pressed(){done(4);};
38}; 37};
diff --git a/noncore/tools/opie-sh/opie-sh.control b/noncore/tools/opie-sh/opie-sh.control
index 6627335..67b552f 100644
--- a/noncore/tools/opie-sh/opie-sh.control
+++ b/noncore/tools/opie-sh/opie-sh.control
@@ -1,11 +1,11 @@
1Package: opie-sh 1Package: opie-sh
2Files: bin/opie-sh apps/Opie-SH/opie-sh.desktop pics/opie-sh/*.png help/opie-sh/*.html 2Files: bin/opie-sh apps/Opie-SH/opie-sh.desktop pics/opie-sh/*.png help/opie-sh/*.html
3Priority: optional 3Priority: optional
4Section: opie/sh 4Section: opie/sh
5Maintainer: Thomas Stephens <spiralman@softhome.net> 5Maintainer: Thomas Stephens <spiralman@softhome.net>
6Architecture: arm 6Architecture: arm
7Version: 0.5$EXTRAVERSION 7Version: 0.5$EXTRAVERSION
8Depends: task-opie-minimal 8Depends: task-opie-minimal, libopiecore2
9License: GPL 9License: GPL
10Description: A QDialog shell frontend 10Description: A QDialog shell frontend
11 A program to let you use various dialogs from the console (or a shell script) 11 A program to let you use various dialogs from the console (or a shell script)
diff --git a/noncore/tools/opie-sh/opie-sh.pro b/noncore/tools/opie-sh/opie-sh.pro
index 57f7978..b0cf052 100644
--- a/noncore/tools/opie-sh/opie-sh.pro
+++ b/noncore/tools/opie-sh/opie-sh.pro
@@ -1,11 +1,11 @@
1 TEMPLATE =app 1 TEMPLATE =app
2 CONFIG +=qt warn_on 2 CONFIG +=qt warn_on
3 DESTDIR =$(OPIEDIR)/bin 3 DESTDIR =$(OPIEDIR)/bin
4 HEADERS =mbox.h fviewer.h inputdialog.h 4 HEADERS =mbox.h fviewer.h inputdialog.h
5 SOURCES =opie-sh.cpp mbox.cpp fviewer.cpp inputdialog.cpp 5 SOURCES =opie-sh.cpp mbox.cpp fviewer.cpp inputdialog.cpp
6 INCLUDEPATH +=$(OPIEDIR)/include 6 INCLUDEPATH +=$(OPIEDIR)/include
7 DEPENDPATH +=$(OPIEDIR)/include 7 DEPENDPATH +=$(OPIEDIR)/include
8 LIBS +=-lqpe 8 LIBS +=-lqpe -lopiecore2
9TARGET = opie-sh 9TARGET = opie-sh
10 10
11include( $(OPIEDIR)/include.pro ) 11include( $(OPIEDIR)/include.pro )