summaryrefslogtreecommitdiff
authordrw <drw>2004-02-23 23:19:47 (UTC)
committer drw <drw>2004-02-23 23:19:47 (UTC)
commit8fe156f20106aaa4861a60314273733685d37dad (patch) (unidiff)
tree3f069e0b432863fd27f0f1c28287b4a835f3d302
parentbff739b1760881bb326ec38ebe62a52195b8c032 (diff)
downloadopie-8fe156f20106aaa4861a60314273733685d37dad.zip
opie-8fe156f20106aaa4861a60314273733685d37dad.tar.gz
opie-8fe156f20106aaa4861a60314273733685d37dad.tar.bz2
Text Editor: libopie->libopie2
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/config.in2
-rw-r--r--core/apps/textedit/main.cpp3
-rw-r--r--core/apps/textedit/opie-textedit.control2
-rw-r--r--core/apps/textedit/textedit.cpp10
-rw-r--r--core/apps/textedit/textedit.h2
-rw-r--r--core/apps/textedit/textedit.pro2
6 files changed, 12 insertions, 9 deletions
diff --git a/core/apps/textedit/config.in b/core/apps/textedit/config.in
index e22135b..749af6c 100644
--- a/core/apps/textedit/config.in
+++ b/core/apps/textedit/config.in
@@ -1,4 +1,4 @@
1 config TEXTEDIT 1 config TEXTEDIT
2 boolean "opie-textedit (simple text editor)" 2 boolean "opie-textedit (simple text editor)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI
diff --git a/core/apps/textedit/main.cpp b/core/apps/textedit/main.cpp
index edab73d..9aee47b 100644
--- a/core/apps/textedit/main.cpp
+++ b/core/apps/textedit/main.cpp
@@ -1,26 +1,25 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "textedit.h" 21#include "textedit.h"
22 22
23#include <qpe/qpeapplication.h> 23#include <opie2/oapplicationfactory.h>
24#include <opie/oapplicationfactory.h>
25 24
26OPIE_EXPORT_APP( OApplicationFactory<TextEdit> ) 25OPIE_EXPORT_APP( OApplicationFactory<TextEdit> )
diff --git a/core/apps/textedit/opie-textedit.control b/core/apps/textedit/opie-textedit.control
index 44af66c..aeaef72 100644
--- a/core/apps/textedit/opie-textedit.control
+++ b/core/apps/textedit/opie-textedit.control
@@ -1,10 +1,10 @@
1Package: opie-textedit 1Package: opie-textedit
2Files: plugins/application/libtextedit.so* bin/textedit apps/1Pim/textedit.desktop pics/textedit 2Files: plugins/application/libtextedit.so* bin/textedit apps/1Pim/textedit.desktop pics/textedit
3Priority: optional 3Priority: optional
4Section: opie/pim 4Section: opie/pim
5Maintainer: L.J. Potter <lpotter@trolltech.com> 5Maintainer: L.J. Potter <lpotter@trolltech.com>
6Architecture: arm 6Architecture: arm
7Depends: task-opie-minimal, libopie1 7Depends: task-opie-minimal, libopiecore2, libopieui2
8Description: Text Editor 8Description: Text Editor
9 The text editor for the Opie environment. 9 The text editor for the Opie environment.
10Version: $QPE_VERSION$EXTRAVERSION 10Version: $QPE_VERSION$EXTRAVERSION
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 1299fe3..2a4d391 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -1,105 +1,109 @@
1/********************************************************************** 1/**********************************************************************
2// textedit.cpp 2// textedit.cpp
3** Copyright (C) 2000 Trolltech AS. All rights reserved. 3** Copyright (C) 2000 Trolltech AS. All rights reserved.
4** 4**
5** This file is part of Opie Environment. 5** This file is part of Opie Environment.
6** 6**
7** This file may be distributed and/or modified under the terms of the 7** This file may be distributed and/or modified under the terms of the
8** GNU General Public License version 2 as published by the Free Software 8** GNU General Public License version 2 as published by the Free Software
9** Foundation and appearing in the file LICENSE.GPL included in the 9** Foundation and appearing in the file LICENSE.GPL included in the
10** packaging of this file. 10** packaging of this file.
11** 11**
12**********************************************************************/ 12**********************************************************************/
13// changes added by L. J. Potter Sun 02-17-2002 21:31:31 13// changes added by L. J. Potter Sun 02-17-2002 21:31:31
14#include "textedit.h" 14#include "textedit.h"
15#include "filePermissions.h" 15#include "filePermissions.h"
16 16
17 17
18#include <opie/ofileselector.h> 18#include <opie2/ofileselector.h>
19#include <opie/ofiledialog.h> 19#include <opie2/ofiledialog.h>
20#include <opie/ofontselector.h> 20#include <opie2/ofontselector.h>
21 21
22#include <qpe/fontdatabase.h> 22#include <qpe/fontdatabase.h>
23#include <qpe/global.h> 23#include <qpe/global.h>
24#include <qpe/fileselector.h> 24#include <qpe/fileselector.h>
25#include <qpe/applnk.h> 25#include <qpe/applnk.h>
26#include <qpe/resource.h> 26#include <qpe/resource.h>
27#include <qpe/config.h> 27#include <qpe/config.h>
28#include <qpe/qpeapplication.h> 28#include <qpe/qpeapplication.h>
29#include <qmenubar.h> 29#include <qmenubar.h>
30#include <qtoolbar.h> 30#include <qtoolbar.h>
31#include <qpe/qcopenvelope_qws.h> 31#include <qpe/qcopenvelope_qws.h>
32 32
33#include <qpoint.h> 33#include <qpoint.h>
34#include <qtextstream.h> 34#include <qtextstream.h>
35#include <qdatetime.h> 35#include <qdatetime.h>
36#include <qclipboard.h> 36#include <qclipboard.h>
37#include <qstringlist.h> 37#include <qstringlist.h>
38#include <qaction.h> 38#include <qaction.h>
39#include <qcolordialog.h> 39#include <qcolordialog.h>
40#include <qfileinfo.h> 40#include <qfileinfo.h>
41#include <qlineedit.h> 41#include <qlineedit.h>
42#include <qmessagebox.h> 42#include <qmessagebox.h>
43#include <qobjectlist.h> 43#include <qobjectlist.h>
44#include <qpopupmenu.h> 44#include <qpopupmenu.h>
45#include <qspinbox.h> 45#include <qspinbox.h>
46#include <qtoolbutton.h> 46#include <qtoolbutton.h>
47#include <qwidgetstack.h> 47#include <qwidgetstack.h>
48#include <qcheckbox.h> 48#include <qcheckbox.h>
49#include <qcombo.h> 49#include <qcombo.h>
50#include <qlayout.h> 50#include <qlayout.h>
51#include <qapplication.h> 51#include <qapplication.h>
52#include <qtimer.h> 52#include <qtimer.h>
53#include <qdir.h> 53#include <qdir.h>
54#include <unistd.h> 54#include <unistd.h>
55#include <sys/stat.h> 55#include <sys/stat.h>
56#include <stdlib.h> //getenv 56#include <stdlib.h> //getenv
57 57
58using Opie::OFileDialog;
59using Opie::OFileSelector;
60using Opie::OFontSelector;
61
58#if QT_VERSION < 300 62#if QT_VERSION < 300
59 63
60class QpeEditor : public QMultiLineEdit 64class QpeEditor : public QMultiLineEdit
61{ 65{
62 66
63public: 67public:
64 QpeEditor( QWidget *parent, const char * name = 0 ) 68 QpeEditor( QWidget *parent, const char * name = 0 )
65 : QMultiLineEdit( parent, name ) { 69 : QMultiLineEdit( parent, name ) {
66 clearTableFlags(); 70 clearTableFlags();
67 setTableFlags( Tbl_vScrollBar | Tbl_autoHScrollBar ); 71 setTableFlags( Tbl_vScrollBar | Tbl_autoHScrollBar );
68} 72}
69 73
70 void find( const QString &txt, bool caseSensitive, 74 void find( const QString &txt, bool caseSensitive,
71 bool backwards ); 75 bool backwards );
72protected: 76protected:
73 bool markIt; 77 bool markIt;
74 int line1, line2, col1, col2; 78 int line1, line2, col1, col2;
75 void mousePressEvent( QMouseEvent * ); 79 void mousePressEvent( QMouseEvent * );
76 void mouseReleaseEvent( QMouseEvent * ); 80 void mouseReleaseEvent( QMouseEvent * );
77 81
78//public slots: 82//public slots:
79 /* 83 /*
80signals: 84signals:
81 void notFound(); 85 void notFound();
82 void searchWrapped(); 86 void searchWrapped();
83 */ 87 */
84 88
85private: 89private:
86 90
87}; 91};
88 92
89void QpeEditor::mousePressEvent( QMouseEvent *e ) { 93void QpeEditor::mousePressEvent( QMouseEvent *e ) {
90 switch(e->button()) { 94 switch(e->button()) {
91 case RightButton: 95 case RightButton:
92 { //rediculous workaround for qt popup menu 96 { //rediculous workaround for qt popup menu
93 //and the hold right click mechanism 97 //and the hold right click mechanism
94 this->setSelection( line1, col1, line2, col2); 98 this->setSelection( line1, col1, line2, col2);
95 QMultiLineEdit::mousePressEvent( e ); 99 QMultiLineEdit::mousePressEvent( e );
96 markIt = false; 100 markIt = false;
97 } 101 }
98 break; 102 break;
99 default: 103 default:
100 { 104 {
101 if(!markIt) { 105 if(!markIt) {
102 int line, col; 106 int line, col;
103 this->getCursorPosition(&line, &col); 107 this->getCursorPosition(&line, &col);
104 line1=line2=line; 108 line1=line2=line;
105 col1=col2=col; 109 col1=col2=col;
diff --git a/core/apps/textedit/textedit.h b/core/apps/textedit/textedit.h
index 303b707..34f3617 100644
--- a/core/apps/textedit/textedit.h
+++ b/core/apps/textedit/textedit.h
@@ -1,81 +1,81 @@
1/********************************************************************** 1/**********************************************************************
2 ** Copyright (C) 2000 Trolltech AS. All rights reserved. 2 ** Copyright (C) 2000 Trolltech AS. All rights reserved.
3 ** 3 **
4 ** This file is part of Qtopia Environment. 4 ** This file is part of Qtopia Environment.
5 ** 5 **
6 ** This file may be distributed and/or modified under the terms of the 6 ** This file may be distributed and/or modified under the terms of the
7 ** GNU General Public License version 2 as published by the Free Software 7 ** GNU General Public License version 2 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.GPL included in the 8 ** Foundation and appearing in the file LICENSE.GPL included in the
9 ** packaging of this file. 9 ** packaging of this file.
10 ** 10 **
11 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13 ** 13 **
14 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 14 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
15 ** 15 **
16 ** Contact info@trolltech.com if any conditions of this licensing are 16 ** Contact info@trolltech.com if any conditions of this licensing are
17 ** not clear to you. 17 ** not clear to you.
18 ** 18 **
19 **********************************************************************/ 19 **********************************************************************/
20// additions made by L.J. Potter Sun 02-17-2002 22:27:46 20// additions made by L.J. Potter Sun 02-17-2002 22:27:46
21 21
22#ifndef TEXTEDIT_H 22#ifndef TEXTEDIT_H
23#define TEXTEDIT_H 23#define TEXTEDIT_H
24 24
25#define QTEXTEDIT_OPEN_API 25#define QTEXTEDIT_OPEN_API
26 26
27//#include "fileBrowser.h" 27//#include "fileBrowser.h"
28//#include "fileSaver.h" 28//#include "fileSaver.h"
29 29
30#include <qpe/filemanager.h> 30#include <qpe/filemanager.h>
31#include <qpe/qcopenvelope_qws.h> 31#include <qpe/qcopenvelope_qws.h>
32 32
33#include <opie/ofileselector.h> 33//#include <opie/ofileselector.h>
34 34
35#include <qmainwindow.h> 35#include <qmainwindow.h>
36#include <qmultilineedit.h> 36#include <qmultilineedit.h>
37#include <qlist.h> 37#include <qlist.h>
38#include <qmap.h> 38#include <qmap.h>
39 39
40class QAction; 40class QAction;
41class QWidgetStack; 41class QWidgetStack;
42class QToolButton; 42class QToolButton;
43class QPopupMenu; 43class QPopupMenu;
44class QToolBar; 44class QToolBar;
45class QLineEdit; 45class QLineEdit;
46class QAction; 46class QAction;
47class FileSelector; 47class FileSelector;
48class QpeEditor; 48class QpeEditor;
49class QPopupMenu; 49class QPopupMenu;
50class QTimer; 50class QTimer;
51 51
52class TextEdit : public QMainWindow 52class TextEdit : public QMainWindow
53{ 53{
54 Q_OBJECT 54 Q_OBJECT
55 55
56public: 56public:
57 static QString appName() { return QString::fromLatin1("textedit"); } 57 static QString appName() { return QString::fromLatin1("textedit"); }
58 TextEdit( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 58 TextEdit( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
59 ~TextEdit(); 59 ~TextEdit();
60 60
61protected: 61protected:
62 QPopupMenu *font; 62 QPopupMenu *font;
63 QAction *nStart, *nFileDlgOpt, *nAdvanced, *desktopAction, *filePermAction, *searchBarAction, *nAutoSave; 63 QAction *nStart, *nFileDlgOpt, *nAdvanced, *desktopAction, *filePermAction, *searchBarAction, *nAutoSave;
64 bool edited, edited1; 64 bool edited, edited1;
65 void openFile( const QString & ); 65 void openFile( const QString & );
66 QCopChannel * channel; 66 QCopChannel * channel;
67 67
68 bool featureAutoSave; 68 bool featureAutoSave;
69 void closeEvent( QCloseEvent *e ); 69 void closeEvent( QCloseEvent *e );
70 void doSearchBar(); 70 void doSearchBar();
71 int savePrompt(); 71 int savePrompt();
72 void setTimer(); 72 void setTimer();
73private slots: 73private slots:
74 void editorChanged(); 74 void editorChanged();
75 void receive(const QCString&, const QByteArray&); 75 void receive(const QCString&, const QByteArray&);
76 void timerCrank(); 76 void timerCrank();
77 void doTimer(bool); 77 void doTimer(bool);
78 void editPasteTimeDate(); 78 void editPasteTimeDate();
79 void doPrompt(bool); 79 void doPrompt(bool);
80 void doDesktop(bool); 80 void doDesktop(bool);
81 void doFilePerms(bool); 81 void doFilePerms(bool);
diff --git a/core/apps/textedit/textedit.pro b/core/apps/textedit/textedit.pro
index 6b77ca8..b6d8f15 100644
--- a/core/apps/textedit/textedit.pro
+++ b/core/apps/textedit/textedit.pro
@@ -1,9 +1,9 @@
1CONFIG += qt warn_on release quick-app 1CONFIG += qt warn_on release quick-app
2HEADERS = textedit.h filePermissions.h 2HEADERS = textedit.h filePermissions.h
3SOURCES = main.cpp textedit.cpp filePermissions.cpp 3SOURCES = main.cpp textedit.cpp filePermissions.cpp
4INCLUDEPATH += $(OPIEDIR)/include 4INCLUDEPATH += $(OPIEDIR)/include
5DEPENDPATH += $(OPIEDIR)/include 5DEPENDPATH += $(OPIEDIR)/include
6LIBS += -lqpe -lopie 6LIBS += -lqpe -lopiecore2 -lopieui2
7TARGET = textedit 7TARGET = textedit
8 8
9include ( $(OPIEDIR)/include.pro ) 9include ( $(OPIEDIR)/include.pro )