Diffstat (limited to 'core/apps/textedit/textedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/textedit/textedit.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index b54da34..5bb65a9 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -1,90 +1,88 @@ | |||
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 <opie2/ofileselector.h> | 18 | #include <opie2/ofileselector.h> |
19 | #include <opie2/ofiledialog.h> | 19 | #include <opie2/ofiledialog.h> |
20 | #include <opie2/ofontselector.h> | 20 | #include <opie2/ofontselector.h> |
21 | 21 | ||
22 | #include <qpe/resource.h> | 22 | #include <qpe/resource.h> |
23 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
24 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
25 | #include <qmenubar.h> | 25 | #include <qmenubar.h> |
26 | #include <qtoolbar.h> | 26 | #include <qtoolbar.h> |
27 | 27 | ||
28 | #include <qtextstream.h> | 28 | #include <qtextstream.h> |
29 | #include <qclipboard.h> | 29 | #include <qclipboard.h> |
30 | #include <qaction.h> | 30 | #include <qaction.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qmessagebox.h> | 32 | #include <qmessagebox.h> |
33 | #include <qlayout.h> | 33 | #include <qlayout.h> |
34 | #include <qtimer.h> | 34 | #include <qtimer.h> |
35 | #include <qdir.h> | 35 | #include <qdir.h> |
36 | #include <unistd.h> | 36 | #include <unistd.h> |
37 | #include <sys/stat.h> | 37 | #include <sys/stat.h> |
38 | #include <stdlib.h> //getenv | 38 | #include <stdlib.h> //getenv |
39 | 39 | ||
40 | using Opie::OFileDialog; | 40 | using namespace Opie::Ui; |
41 | using Opie::OFileSelector; | ||
42 | using Opie::OFontSelector; | ||
43 | 41 | ||
44 | #if QT_VERSION < 300 | 42 | #if QT_VERSION < 300 |
45 | 43 | ||
46 | class QpeEditor : public QMultiLineEdit | 44 | class QpeEditor : public QMultiLineEdit |
47 | { | 45 | { |
48 | 46 | ||
49 | public: | 47 | public: |
50 | QpeEditor( QWidget *parent, const char * name = 0 ) | 48 | QpeEditor( QWidget *parent, const char * name = 0 ) |
51 | : QMultiLineEdit( parent, name ) { | 49 | : QMultiLineEdit( parent, name ) { |
52 | clearTableFlags(); | 50 | clearTableFlags(); |
53 | setTableFlags( Tbl_vScrollBar | Tbl_autoHScrollBar ); | 51 | setTableFlags( Tbl_vScrollBar | Tbl_autoHScrollBar ); |
54 | } | 52 | } |
55 | 53 | ||
56 | void find( const QString &txt, bool caseSensitive, | 54 | void find( const QString &txt, bool caseSensitive, |
57 | bool backwards ); | 55 | bool backwards ); |
58 | protected: | 56 | protected: |
59 | bool markIt; | 57 | bool markIt; |
60 | int line1, line2, col1, col2; | 58 | int line1, line2, col1, col2; |
61 | void mousePressEvent( QMouseEvent * ); | 59 | void mousePressEvent( QMouseEvent * ); |
62 | void mouseReleaseEvent( QMouseEvent * ); | 60 | void mouseReleaseEvent( QMouseEvent * ); |
63 | 61 | ||
64 | //public slots: | 62 | //public slots: |
65 | /* | 63 | /* |
66 | signals: | 64 | signals: |
67 | void notFound(); | 65 | void notFound(); |
68 | void searchWrapped(); | 66 | void searchWrapped(); |
69 | */ | 67 | */ |
70 | 68 | ||
71 | private: | 69 | private: |
72 | 70 | ||
73 | }; | 71 | }; |
74 | 72 | ||
75 | void QpeEditor::mousePressEvent( QMouseEvent *e ) { | 73 | void QpeEditor::mousePressEvent( QMouseEvent *e ) { |
76 | switch(e->button()) { | 74 | switch(e->button()) { |
77 | case RightButton: | 75 | case RightButton: |
78 | { //rediculous workaround for qt popup menu | 76 | { //rediculous workaround for qt popup menu |
79 | //and the hold right click mechanism | 77 | //and the hold right click mechanism |
80 | this->setSelection( line1, col1, line2, col2); | 78 | this->setSelection( line1, col1, line2, col2); |
81 | QMultiLineEdit::mousePressEvent( e ); | 79 | QMultiLineEdit::mousePressEvent( e ); |
82 | markIt = false; | 80 | markIt = false; |
83 | } | 81 | } |
84 | break; | 82 | break; |
85 | default: | 83 | default: |
86 | { | 84 | { |
87 | if(!markIt) { | 85 | if(!markIt) { |
88 | int line, col; | 86 | int line, col; |
89 | this->getCursorPosition(&line, &col); | 87 | this->getCursorPosition(&line, &col); |
90 | line1=line2=line; | 88 | line1=line2=line; |