-rw-r--r-- | noncore/tools/opie-sh/config.in | 2 | ||||
-rw-r--r-- | noncore/tools/opie-sh/fviewer.cpp | 4 | ||||
-rw-r--r-- | noncore/tools/opie-sh/fviewer.h | 1 | ||||
-rw-r--r-- | noncore/tools/opie-sh/mbox.cpp | 8 | ||||
-rw-r--r-- | noncore/tools/opie-sh/mbox.h | 1 | ||||
-rw-r--r-- | noncore/tools/opie-sh/opie-sh.control | 2 | ||||
-rw-r--r-- | noncore/tools/opie-sh/opie-sh.pro | 2 |
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 @@ config OPIE-SH boolean "opie-sh (qdialog frontend allows you to write dialogs from shell scripts)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) + 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,46 +1,48 @@ /* Opie-sh. convinience app to allow you to use qdialogs in scripts (mainly shell scripts) Copyright (C) 2002 Thomas Stephens This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "fviewer.h" +#include <opie2/oresource.h> + FViewer::FViewer(QString icon, QString filename, QString title, QWidget *parent, const char*name):QWidget(parent, name) { QVBoxLayout *layout = new QVBoxLayout(this); - setIcon(Resource::loadPixmap("opie-sh")); + setIcon(Opie::Core::OResource::loadPixmap("opie-sh", Opie::Core::OResource::SmallIcon)); textView = new QTextBrowser(this, "textview"); layout->addWidget(textView); QString string; if(title.isNull()) { setCaption(filename); } else { setCaption(title); } file = new QFile(); if(!filename.isNull()) { file->setName(filename); file->open(IO_ReadOnly); } else { 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 @@ /* Opie-sh. convinience app to allow you to use qdialogs in scripts (mainly shell scripts) Copyright (C) 2002 Thomas Stephens This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <qwidget.h> #include <qfile.h> #include <qtextstream.h> #include <qtextbrowser.h> #include <qlayout.h> #include <qtimer.h> #include <qdir.h> -#include <qpe/resource.h> class FViewer :public QWidget { Q_OBJECT public: FViewer(QString icon, QString filename, QString title, QWidget *parent=0, const char*name=0); private: QFile *file; QTextBrowser *textView; QTextStream *stream; QTimer *timer; }; 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 @@ /* Opie-sh. convinience app to allow you to use qdialogs in scripts (mainly shell scripts) Copyright (C) 2002 Thomas Stephens This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "mbox.h" +#include <opie2/oresource.h> + 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) { QVBoxLayout *layout = new QVBoxLayout(this); QHBoxLayout *hlayout1 = new QHBoxLayout(this); QHBoxLayout *hlayout2 = new QHBoxLayout(this); int x, y; layout->addLayout(hlayout1); layout->addLayout(hlayout2); setCaption(title); QLabel *image = new QLabel(this, "image"); QLabel *text = new QLabel(message, this, "text"); switch (type) { case 0: - image->setPixmap(Resource::loadPixmap("opie-sh/info")); + image->setPixmap(Opie::Core::OResource::loadPixmap("opie-sh/info", Opie::Core::OResource::SmallIcon)); break; case 1: - image->setPixmap(Resource::loadPixmap("opie-sh/warning")); + image->setPixmap(Opie::Core::OResource::loadPixmap("opie-sh/warning", Opie::Core::OResource::SmallIcon)); break; case 2: - image->setPixmap(Resource::loadPixmap("opie-sh/error")); + image->setPixmap(Opie::Core::OResource::loadPixmap("opie-sh/error", Opie::Core::OResource::SmallIcon)); break; } hlayout1->addWidget(image); hlayout1->addSpacing(5); hlayout1->addWidget(text); if(!btext0->isNull()) { QPushButton *button0 = new QPushButton((const QString)*btext0, this, "button0"); hlayout2->addSpacing(5); hlayout2->addWidget(button0); hlayout2->addSpacing(5); connect(button0, SIGNAL(clicked()), this, SLOT(b0pressed()) ); } else { QPushButton *button0 = new QPushButton("Ok", this, "button0"); hlayout2->addSpacing(5); hlayout2->addWidget(button0); hlayout2->addSpacing(5); connect(button0, SIGNAL(clicked()), this, SLOT(b0pressed()) ); } 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 @@ /* Opie-sh. convinience app to allow you to use qdialogs in scripts (mainly shell scripts) Copyright (C) 2002 Thomas Stephens This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <qpe/resource.h> #include <qdialog.h> #include <qstring.h> #include <qiconset.h> #include <qpixmap.h> #include <qlabel.h> #include <qlayout.h> #include <qpushbutton.h> #include <qwidget.h> #include <unistd.h> class MBox : public QDialog { Q_OBJECT public: 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); public slots: void b0pressed(){done(2);}; void b1pressed(){done(3);}; void b2pressed(){done(4);}; }; 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 @@ Package: opie-sh Files: bin/opie-sh apps/Opie-SH/opie-sh.desktop pics/opie-sh/*.png help/opie-sh/*.html Priority: optional Section: opie/sh Maintainer: Thomas Stephens <spiralman@softhome.net> Architecture: arm Version: 0.5$EXTRAVERSION -Depends: task-opie-minimal +Depends: task-opie-minimal, libopiecore2 License: GPL Description: A QDialog shell frontend 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 @@ TEMPLATE =app CONFIG +=qt warn_on DESTDIR =$(OPIEDIR)/bin HEADERS =mbox.h fviewer.h inputdialog.h SOURCES =opie-sh.cpp mbox.cpp fviewer.cpp inputdialog.cpp INCLUDEPATH +=$(OPIEDIR)/include DEPENDPATH +=$(OPIEDIR)/include -LIBS +=-lqpe +LIBS +=-lqpe -lopiecore2 TARGET = opie-sh include( $(OPIEDIR)/include.pro ) |