author | llornkcor <llornkcor> | 2002-04-17 23:27:59 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-17 23:27:59 (UTC) |
commit | 025156262b9bcab1e484347fe89657671f8f951f (patch) (unidiff) | |
tree | 1d80440bb9c954de4efb92afe30c7441aa85f92c | |
parent | 7b19e1d98d5acf01102ac057ec077fc036c034c6 (diff) | |
download | opie-025156262b9bcab1e484347fe89657671f8f951f.zip opie-025156262b9bcab1e484347fe89657671f8f951f.tar.gz opie-025156262b9bcab1e484347fe89657671f8f951f.tar.bz2 |
bug fix
-rw-r--r-- | core/apps/textedit/textedit.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 834bd8c..18402d4 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -1,963 +1,962 @@ | |||
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 | // changes added by L. J. Potter Sun 02-17-2002 21:31:31 | 20 | // changes added by L. J. Potter Sun 02-17-2002 21:31:31 |
21 | 21 | ||
22 | #include "textedit.h" | 22 | #include "textedit.h" |
23 | #include "fileBrowser.h" | 23 | #include "fileBrowser.h" |
24 | #include "fileSaver.h" | 24 | #include "fileSaver.h" |
25 | #include "filePermissions.h" | 25 | #include "filePermissions.h" |
26 | 26 | ||
27 | #include "fontDialog.h" | 27 | #include "fontDialog.h" |
28 | 28 | ||
29 | #include <qpe/fontdatabase.h> | 29 | #include <qpe/fontdatabase.h> |
30 | #include <qpe/global.h> | 30 | #include <qpe/global.h> |
31 | #include <qpe/fileselector.h> | 31 | #include <qpe/fileselector.h> |
32 | #include <qpe/applnk.h> | 32 | #include <qpe/applnk.h> |
33 | #include <qpe/resource.h> | 33 | #include <qpe/resource.h> |
34 | #include <qpe/config.h> | 34 | #include <qpe/config.h> |
35 | #include <qpe/qpeapplication.h> | 35 | #include <qpe/qpeapplication.h> |
36 | #include <qpe/qpemenubar.h> | 36 | #include <qpe/qpemenubar.h> |
37 | #include <qpe/qpetoolbar.h> | 37 | #include <qpe/qpetoolbar.h> |
38 | #include <qpe/qcopenvelope_qws.h> | 38 | #include <qpe/qcopenvelope_qws.h> |
39 | //#include <qpe/finddialog.h> | 39 | //#include <qpe/finddialog.h> |
40 | 40 | ||
41 | #include <opie/ofileselector.h> | 41 | #include <opie/ofileselector.h> |
42 | #include <opie/ofiledialog.h> | 42 | #include <opie/ofiledialog.h> |
43 | 43 | ||
44 | #include <qstringlist.h> | 44 | #include <qstringlist.h> |
45 | #include <qaction.h> | 45 | #include <qaction.h> |
46 | #include <qcolordialog.h> | 46 | #include <qcolordialog.h> |
47 | #include <qfileinfo.h> | 47 | #include <qfileinfo.h> |
48 | #include <qlineedit.h> | 48 | #include <qlineedit.h> |
49 | #include <qmessagebox.h> | 49 | #include <qmessagebox.h> |
50 | #include <qobjectlist.h> | 50 | #include <qobjectlist.h> |
51 | #include <qpopupmenu.h> | 51 | #include <qpopupmenu.h> |
52 | #include <qspinbox.h> | 52 | #include <qspinbox.h> |
53 | #include <qtoolbutton.h> | 53 | #include <qtoolbutton.h> |
54 | #include <qwidgetstack.h> | 54 | #include <qwidgetstack.h> |
55 | #include <qcheckbox.h> | 55 | #include <qcheckbox.h> |
56 | #include <qcombo.h> | 56 | #include <qcombo.h> |
57 | #include <unistd.h> | 57 | #include <unistd.h> |
58 | #include <sys/stat.h> | 58 | #include <sys/stat.h> |
59 | 59 | ||
60 | #include <stdlib.h> //getenv | 60 | #include <stdlib.h> //getenv |
61 | /* XPM */ | 61 | /* XPM */ |
62 | static char * filesave_xpm[] = { | 62 | static char * filesave_xpm[] = { |
63 | "16 16 78 1", | 63 | "16 16 78 1", |
64 | " c None", | 64 | " c None", |
65 | ". c #343434", | 65 | ". c #343434", |
66 | "+ c #A0A0A0", | 66 | "+ c #A0A0A0", |
67 | "@ c #565656", | 67 | "@ c #565656", |
68 | "# c #9E9E9E", | 68 | "# c #9E9E9E", |
69 | "$ c #525252", | 69 | "$ c #525252", |
70 | "% c #929292", | 70 | "% c #929292", |
71 | "& c #676767", | 71 | "& c #676767", |
72 | "* c #848484", | 72 | "* c #848484", |
73 | "= c #666666", | 73 | "= c #666666", |
74 | "- c #D8D8D8", | 74 | "- c #D8D8D8", |
75 | "; c #FFFFFF", | 75 | "; c #FFFFFF", |
76 | "> c #DBDBDB", | 76 | "> c #DBDBDB", |
77 | ", c #636363", | 77 | ", c #636363", |
78 | "' c #989898", | 78 | "' c #989898", |
79 | ") c #2D2D2D", | 79 | ") c #2D2D2D", |
80 | "! c #909090", | 80 | "! c #909090", |
81 | "~ c #AEAEAE", | 81 | "~ c #AEAEAE", |
82 | "{ c #EAEAEA", | 82 | "{ c #EAEAEA", |
83 | "] c #575757", | 83 | "] c #575757", |
84 | "^ c #585858", | 84 | "^ c #585858", |
85 | "/ c #8A8A8A", | 85 | "/ c #8A8A8A", |
86 | "( c #828282", | 86 | "( c #828282", |
87 | "_ c #6F6F6F", | 87 | "_ c #6F6F6F", |
88 | ": c #C9C9C9", | 88 | ": c #C9C9C9", |
89 | "< c #050505", | 89 | "< c #050505", |
90 | "[ c #292929", | 90 | "[ c #292929", |
91 | "} c #777777", | 91 | "} c #777777", |
92 | "| c #616161", | 92 | "| c #616161", |
93 | "1 c #3A3A3A", | 93 | "1 c #3A3A3A", |
94 | "2 c #BEBEBE", | 94 | "2 c #BEBEBE", |
95 | "3 c #2C2C2C", | 95 | "3 c #2C2C2C", |
96 | "4 c #7C7C7C", | 96 | "4 c #7C7C7C", |
97 | "5 c #F6F6F6", | 97 | "5 c #F6F6F6", |
98 | "6 c #FCFCFC", | 98 | "6 c #FCFCFC", |
99 | "7 c #6B6B6B", | 99 | "7 c #6B6B6B", |
100 | "8 c #959595", | 100 | "8 c #959595", |
101 | "9 c #4F4F4F", | 101 | "9 c #4F4F4F", |
102 | "0 c #808080", | 102 | "0 c #808080", |
103 | "a c #767676", | 103 | "a c #767676", |
104 | "b c #818181", | 104 | "b c #818181", |
105 | "c c #B8B8B8", | 105 | "c c #B8B8B8", |
106 | "d c #FBFBFB", | 106 | "d c #FBFBFB", |
107 | "e c #F9F9F9", | 107 | "e c #F9F9F9", |
108 | "f c #CCCCCC", | 108 | "f c #CCCCCC", |
109 | "g c #030303", | 109 | "g c #030303", |
110 | "h c #737373", | 110 | "h c #737373", |
111 | "i c #7A7A7A", | 111 | "i c #7A7A7A", |
112 | "j c #7E7E7E", | 112 | "j c #7E7E7E", |
113 | "k c #6A6A6A", | 113 | "k c #6A6A6A", |
114 | "l c #FAFAFA", | 114 | "l c #FAFAFA", |
115 | "m c #505050", | 115 | "m c #505050", |
116 | "n c #9D9D9D", | 116 | "n c #9D9D9D", |
117 | "o c #333333", | 117 | "o c #333333", |
118 | "p c #7B7B7B", | 118 | "p c #7B7B7B", |
119 | "q c #787878", | 119 | "q c #787878", |
120 | "r c #696969", | 120 | "r c #696969", |
121 | "s c #494949", | 121 | "s c #494949", |
122 | "t c #555555", | 122 | "t c #555555", |
123 | "u c #949494", | 123 | "u c #949494", |
124 | "v c #E6E6E6", | 124 | "v c #E6E6E6", |
125 | "w c #424242", | 125 | "w c #424242", |
126 | "x c #515151", | 126 | "x c #515151", |
127 | "y c #535353", | 127 | "y c #535353", |
128 | "z c #3E3E3E", | 128 | "z c #3E3E3E", |
129 | "A c #D4D4D4", | 129 | "A c #D4D4D4", |
130 | "B c #0C0C0C", | 130 | "B c #0C0C0C", |
131 | "C c #353535", | 131 | "C c #353535", |
132 | "D c #474747", | 132 | "D c #474747", |
133 | "E c #ECECEC", | 133 | "E c #ECECEC", |
134 | "F c #919191", | 134 | "F c #919191", |
135 | "G c #7D7D7D", | 135 | "G c #7D7D7D", |
136 | "H c #000000", | 136 | "H c #000000", |
137 | "I c #404040", | 137 | "I c #404040", |
138 | "J c #858585", | 138 | "J c #858585", |
139 | "K c #323232", | 139 | "K c #323232", |
140 | "L c #D0D0D0", | 140 | "L c #D0D0D0", |
141 | "M c #1C1C1C", | 141 | "M c #1C1C1C", |
142 | " ...+ ", | 142 | " ...+ ", |
143 | " @#$%&..+ ", | 143 | " @#$%&..+ ", |
144 | " .*=-;;>,..+ ", | 144 | " .*=-;;>,..+ ", |
145 | " ')!~;;;;;;{]..", | 145 | " ')!~;;;;;;{]..", |
146 | " ^/(-;;;;;;;_:<", | 146 | " ^/(-;;;;;;;_:<", |
147 | " [}|;;;;;;;{12$", | 147 | " [}|;;;;;;;{12$", |
148 | " #34-55;;;;678$+", | 148 | " #34-55;;;;678$+", |
149 | " 90ab=c;dd;e1fg ", | 149 | " 90ab=c;dd;e1fg ", |
150 | " [ahij((kbl0mn$ ", | 150 | " [ahij((kbl0mn$ ", |
151 | " op^q^^7r&]s/$+ ", | 151 | " op^q^^7r&]s/$+ ", |
152 | "@btu;vbwxy]zAB ", | 152 | "@btu;vbwxy]zAB ", |
153 | "CzDEvEv;;DssF$ ", | 153 | "CzDEvEv;;DssF$ ", |
154 | "G.H{E{E{IxsJ$+ ", | 154 | "G.H{E{E{IxsJ$+ ", |
155 | " +...vEKxzLM ", | 155 | " +...vEKxzLM ", |
156 | " +...z]n$ ", | 156 | " +...z]n$ ", |
157 | " +... "}; | 157 | " +... "}; |
158 | 158 | ||
159 | 159 | ||
160 | #if QT_VERSION < 300 | 160 | #if QT_VERSION < 300 |
161 | 161 | ||
162 | class QpeEditor : public QMultiLineEdit | 162 | class QpeEditor : public QMultiLineEdit |
163 | { | 163 | { |
164 | // Q_OBJECT | 164 | // Q_OBJECT |
165 | public: | 165 | public: |
166 | QpeEditor( QWidget *parent, const char * name = 0 ) | 166 | QpeEditor( QWidget *parent, const char * name = 0 ) |
167 | : QMultiLineEdit( parent, name ) | 167 | : QMultiLineEdit( parent, name ) |
168 | { | 168 | { |
169 | clearTableFlags(); | 169 | clearTableFlags(); |
170 | setTableFlags( Tbl_vScrollBar | Tbl_autoHScrollBar ); | 170 | setTableFlags( Tbl_vScrollBar | Tbl_autoHScrollBar ); |
171 | } | 171 | } |
172 | 172 | ||
173 | void find( const QString &txt, bool caseSensitive, | 173 | void find( const QString &txt, bool caseSensitive, |
174 | bool backwards ); | 174 | bool backwards ); |
175 | //public slots: | 175 | //public slots: |
176 | /* | 176 | /* |
177 | signals: | 177 | signals: |
178 | void notFound(); | 178 | void notFound(); |
179 | void searchWrapped(); | 179 | void searchWrapped(); |
180 | */ | 180 | */ |
181 | 181 | ||
182 | private: | 182 | private: |
183 | 183 | ||
184 | }; | 184 | }; |
185 | 185 | ||
186 | 186 | ||
187 | void QpeEditor::find ( const QString &txt, bool caseSensitive, | 187 | void QpeEditor::find ( const QString &txt, bool caseSensitive, |
188 | bool backwards ) | 188 | bool backwards ) |
189 | { | 189 | { |
190 | static bool wrap = FALSE; | 190 | static bool wrap = FALSE; |
191 | int line, col; | 191 | int line, col; |
192 | if ( wrap ) { | 192 | if ( wrap ) { |
193 | if ( !backwards ) | 193 | if ( !backwards ) |
194 | line = col = 0; | 194 | line = col = 0; |
195 | wrap = FALSE; | 195 | wrap = FALSE; |
196 | // emit searchWrapped(); | 196 | // emit searchWrapped(); |
197 | } else { | 197 | } else { |
198 | getCursorPosition( &line, &col ); | 198 | getCursorPosition( &line, &col ); |
199 | } | 199 | } |
200 | //ignore backwards for now.... | 200 | //ignore backwards for now.... |
201 | if ( !backwards ) { | 201 | if ( !backwards ) { |
202 | for ( ; ; ) { | 202 | for ( ; ; ) { |
203 | if ( line >= numLines() ) { | 203 | if ( line >= numLines() ) { |
204 | wrap = TRUE; | 204 | wrap = TRUE; |
205 | //emit notFound(); | 205 | //emit notFound(); |
206 | break; | 206 | break; |
207 | } | 207 | } |
208 | int findCol = getString( line )->find( txt, col, caseSensitive ); | 208 | int findCol = getString( line )->find( txt, col, caseSensitive ); |
209 | if ( findCol >= 0 ) { | 209 | if ( findCol >= 0 ) { |
210 | setCursorPosition( line, findCol, FALSE ); | 210 | setCursorPosition( line, findCol, FALSE ); |
211 | col = findCol + txt.length(); | 211 | col = findCol + txt.length(); |
212 | setCursorPosition( line, col, TRUE ); | 212 | setCursorPosition( line, col, TRUE ); |
213 | 213 | ||
214 | //found = TRUE; | 214 | //found = TRUE; |
215 | break; | 215 | break; |
216 | } | 216 | } |
217 | line++; | 217 | line++; |
218 | col = 0; | 218 | col = 0; |
219 | } | 219 | } |
220 | 220 | ||
221 | } | 221 | } |
222 | 222 | ||
223 | } | 223 | } |
224 | 224 | ||
225 | 225 | ||
226 | #else | 226 | #else |
227 | 227 | ||
228 | #error "Must make a QpeEditor that inherits QTextEdit" | 228 | #error "Must make a QpeEditor that inherits QTextEdit" |
229 | 229 | ||
230 | #endif | 230 | #endif |
231 | 231 | ||
232 | 232 | ||
233 | static const int nfontsizes = 6; | 233 | static const int nfontsizes = 6; |
234 | static const int fontsize[nfontsizes] = {8,10,12,14,18,24}; | 234 | static const int fontsize[nfontsizes] = {8,10,12,14,18,24}; |
235 | 235 | ||
236 | TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) | 236 | TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) |
237 | : QMainWindow( parent, name, f ), bFromDocView( FALSE ) | 237 | : QMainWindow( parent, name, f ), bFromDocView( FALSE ) |
238 | { | 238 | { |
239 | doc = 0; | 239 | doc = 0; |
240 | edited=FALSE; | 240 | edited=FALSE; |
241 | edited1=FALSE; | 241 | edited1=FALSE; |
242 | setToolBarsMovable( FALSE ); | 242 | setToolBarsMovable( FALSE ); |
243 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 243 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
244 | 244 | ||
245 | channel = new QCopChannel( "QPE/Application/textedit", this ); | 245 | channel = new QCopChannel( "QPE/Application/textedit", this ); |
246 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 246 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), |
247 | this, SLOT(receive(const QCString&, const QByteArray&)) ); | 247 | this, SLOT(receive(const QCString&, const QByteArray&)) ); |
248 | 248 | ||
249 | setIcon( Resource::loadPixmap( "TextEditor" ) ); | 249 | setIcon( Resource::loadPixmap( "TextEditor" ) ); |
250 | 250 | ||
251 | QPEToolBar *bar = new QPEToolBar( this ); | 251 | QPEToolBar *bar = new QPEToolBar( this ); |
252 | bar->setHorizontalStretchable( TRUE ); | 252 | bar->setHorizontalStretchable( TRUE ); |
253 | menu = bar; | 253 | menu = bar; |
254 | 254 | ||
255 | QPEMenuBar *mb = new QPEMenuBar( bar ); | 255 | QPEMenuBar *mb = new QPEMenuBar( bar ); |
256 | QPopupMenu *file = new QPopupMenu( this ); | 256 | QPopupMenu *file = new QPopupMenu( this ); |
257 | QPopupMenu *edit = new QPopupMenu( this ); | 257 | QPopupMenu *edit = new QPopupMenu( this ); |
258 | font = new QPopupMenu( this ); | 258 | font = new QPopupMenu( this ); |
259 | 259 | ||
260 | bar = new QPEToolBar( this ); | 260 | bar = new QPEToolBar( this ); |
261 | editBar = bar; | 261 | editBar = bar; |
262 | 262 | ||
263 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); | 263 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); |
264 | connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); | 264 | connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); |
265 | a->addTo( bar ); | 265 | a->addTo( bar ); |
266 | a->addTo( file ); | 266 | a->addTo( file ); |
267 | 267 | ||
268 | a = new QAction( tr( "Open" ), Resource::loadPixmap( "fileopen" ), QString::null, 0, this, 0 ); | 268 | a = new QAction( tr( "Open" ), Resource::loadPixmap( "fileopen" ), QString::null, 0, this, 0 ); |
269 | connect( a, SIGNAL( activated() ), this, SLOT( fileOpen() ) ); | 269 | connect( a, SIGNAL( activated() ), this, SLOT( fileOpen() ) ); |
270 | a->addTo( bar ); | 270 | a->addTo( bar ); |
271 | a->addTo( file ); | 271 | a->addTo( file ); |
272 | 272 | ||
273 | a = new QAction( tr( "Save" ), QPixmap(( const char** ) filesave_xpm ) , QString::null, 0, this, 0 ); | 273 | a = new QAction( tr( "Save" ), QPixmap(( const char** ) filesave_xpm ) , QString::null, 0, this, 0 ); |
274 | connect( a, SIGNAL( activated() ), this, SLOT( save() ) ); | 274 | connect( a, SIGNAL( activated() ), this, SLOT( save() ) ); |
275 | file->insertSeparator(); | 275 | file->insertSeparator(); |
276 | a->addTo( file ); | 276 | a->addTo( file ); |
277 | 277 | ||
278 | a = new QAction( tr( "Save As" ), QPixmap(( const char** ) filesave_xpm ) , QString::null, 0, this, 0 ); | 278 | a = new QAction( tr( "Save As" ), QPixmap(( const char** ) filesave_xpm ) , QString::null, 0, this, 0 ); |
279 | connect( a, SIGNAL( activated() ), this, SLOT( saveAs() ) ); | 279 | connect( a, SIGNAL( activated() ), this, SLOT( saveAs() ) ); |
280 | a->addTo( file ); | 280 | a->addTo( file ); |
281 | 281 | ||
282 | a = new QAction( tr( "Cut" ), Resource::loadPixmap( "cut" ), QString::null, 0, this, 0 ); | 282 | a = new QAction( tr( "Cut" ), Resource::loadPixmap( "cut" ), QString::null, 0, this, 0 ); |
283 | connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) ); | 283 | connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) ); |
284 | a->addTo( editBar ); | 284 | a->addTo( editBar ); |
285 | a->addTo( edit ); | 285 | a->addTo( edit ); |
286 | 286 | ||
287 | a = new QAction( tr( "Copy" ), Resource::loadPixmap( "copy" ), QString::null, 0, this, 0 ); | 287 | a = new QAction( tr( "Copy" ), Resource::loadPixmap( "copy" ), QString::null, 0, this, 0 ); |
288 | connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) ); | 288 | connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) ); |
289 | a->addTo( editBar ); | 289 | a->addTo( editBar ); |
290 | a->addTo( edit ); | 290 | a->addTo( edit ); |
291 | 291 | ||
292 | a = new QAction( tr( "Paste" ), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); | 292 | a = new QAction( tr( "Paste" ), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); |
293 | connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) ); | 293 | connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) ); |
294 | a->addTo( editBar ); | 294 | a->addTo( editBar ); |
295 | a->addTo( edit ); | 295 | a->addTo( edit ); |
296 | 296 | ||
297 | a = new QAction( tr( "Find..." ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | 297 | a = new QAction( tr( "Find..." ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); |
298 | connect( a, SIGNAL( activated() ), this, SLOT( editFind() ) ); | 298 | connect( a, SIGNAL( activated() ), this, SLOT( editFind() ) ); |
299 | edit->insertSeparator(); | 299 | edit->insertSeparator(); |
300 | a->addTo( bar ); | 300 | a->addTo( bar ); |
301 | a->addTo( edit ); | 301 | a->addTo( edit ); |
302 | 302 | ||
303 | int defsize; | 303 | int defsize; |
304 | bool defb, defi, wrap; | 304 | bool defb, defi, wrap; |
305 | 305 | ||
306 | Config cfg("TextEdit"); | 306 | Config cfg("TextEdit"); |
307 | cfg.setGroup("View"); | 307 | cfg.setGroup("View"); |
308 | defsize = cfg.readNumEntry("FontSize",10); | 308 | defsize = cfg.readNumEntry("FontSize",10); |
309 | defb = cfg.readBoolEntry("Bold",FALSE); | 309 | defb = cfg.readBoolEntry("Bold",FALSE); |
310 | defi = cfg.readBoolEntry("Italic",FALSE); | 310 | defi = cfg.readBoolEntry("Italic",FALSE); |
311 | wrap = cfg.readBoolEntry("Wrap",TRUE); | 311 | wrap = cfg.readBoolEntry("Wrap",TRUE); |
312 | 312 | ||
313 | zin = new QAction( tr("Zoom in"), QString::null, 0, this, 0 ); | 313 | zin = new QAction( tr("Zoom in"), QString::null, 0, this, 0 ); |
314 | connect( zin, SIGNAL( activated() ), this, SLOT( zoomIn() ) ); | 314 | connect( zin, SIGNAL( activated() ), this, SLOT( zoomIn() ) ); |
315 | zin->addTo( font ); | 315 | zin->addTo( font ); |
316 | 316 | ||
317 | zout = new QAction( tr("Zoom out"), QString::null, 0, this, 0 ); | 317 | zout = new QAction( tr("Zoom out"), QString::null, 0, this, 0 ); |
318 | connect( zout, SIGNAL( activated() ), this, SLOT( zoomOut() ) ); | 318 | connect( zout, SIGNAL( activated() ), this, SLOT( zoomOut() ) ); |
319 | zout->addTo( font ); | 319 | zout->addTo( font ); |
320 | 320 | ||
321 | font->insertSeparator(); | 321 | font->insertSeparator(); |
322 | 322 | ||
323 | #if 0 | 323 | #if 0 |
324 | QAction *ba = new QAction( tr("Bold"), QString::null, 0, this, 0 ); | 324 | QAction *ba = new QAction( tr("Bold"), QString::null, 0, this, 0 ); |
325 | connect( ba, SIGNAL( toggled(bool) ), this, SLOT( setBold(bool) ) ); | 325 | connect( ba, SIGNAL( toggled(bool) ), this, SLOT( setBold(bool) ) ); |
326 | ba->setToggleAction(TRUE); | 326 | ba->setToggleAction(TRUE); |
327 | ba->addTo( font ); | 327 | ba->addTo( font ); |
328 | 328 | ||
329 | QAction *ia = new QAction( tr("Italic"), QString::null, 0, this, 0 ); | 329 | QAction *ia = new QAction( tr("Italic"), QString::null, 0, this, 0 ); |
330 | connect( ia, SIGNAL( toggled(bool) ), this, SLOT( setItalic(bool) ) ); | 330 | connect( ia, SIGNAL( toggled(bool) ), this, SLOT( setItalic(bool) ) ); |
331 | ia->setToggleAction(TRUE); | 331 | ia->setToggleAction(TRUE); |
332 | ia->addTo( font ); | 332 | ia->addTo( font ); |
333 | 333 | ||
334 | ba->setOn(defb); | 334 | ba->setOn(defb); |
335 | ia->setOn(defi); | 335 | ia->setOn(defi); |
336 | 336 | ||
337 | font->insertSeparator(); | 337 | font->insertSeparator(); |
338 | #endif | 338 | #endif |
339 | 339 | ||
340 | QAction *wa = new QAction( tr("Wrap lines"), QString::null, 0, this, 0 ); | 340 | QAction *wa = new QAction( tr("Wrap lines"), QString::null, 0, this, 0 ); |
341 | connect( wa, SIGNAL( toggled(bool) ), this, SLOT( setWordWrap(bool) ) ); | 341 | connect( wa, SIGNAL( toggled(bool) ), this, SLOT( setWordWrap(bool) ) ); |
342 | wa->setToggleAction(TRUE); | 342 | wa->setToggleAction(TRUE); |
343 | wa->addTo( font ); | 343 | wa->addTo( font ); |
344 | 344 | ||
345 | font->insertSeparator(); | 345 | font->insertSeparator(); |
346 | font->insertItem(tr("Font"), this, SLOT(changeFont()) ); | 346 | font->insertItem(tr("Font"), this, SLOT(changeFont()) ); |
347 | 347 | ||
348 | font->insertSeparator(); | 348 | font->insertSeparator(); |
349 | nStart = new QAction( tr("Start with new file"), QString::null, 0, this, 0 ); | 349 | nStart = new QAction( tr("Start with new file"), QString::null, 0, this, 0 ); |
350 | connect( nStart, SIGNAL( toggled(bool) ), this, SLOT( changeStartConfig(bool) ) ); | 350 | connect( nStart, SIGNAL( toggled(bool) ), this, SLOT( changeStartConfig(bool) ) ); |
351 | nStart->setToggleAction(TRUE); | 351 | nStart->setToggleAction(TRUE); |
352 | nStart->addTo( font ); | 352 | nStart->addTo( font ); |
353 | 353 | ||
354 | mb->insertItem( tr( "File" ), file ); | 354 | mb->insertItem( tr( "File" ), file ); |
355 | mb->insertItem( tr( "Edit" ), edit ); | 355 | mb->insertItem( tr( "Edit" ), edit ); |
356 | mb->insertItem( tr( "View" ), font ); | 356 | mb->insertItem( tr( "View" ), font ); |
357 | 357 | ||
358 | searchBar = new QPEToolBar(this); | 358 | searchBar = new QPEToolBar(this); |
359 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | 359 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); |
360 | 360 | ||
361 | searchBar->setHorizontalStretchable( TRUE ); | 361 | searchBar->setHorizontalStretchable( TRUE ); |
362 | 362 | ||
363 | searchEdit = new QLineEdit( searchBar, "searchEdit" ); | 363 | searchEdit = new QLineEdit( searchBar, "searchEdit" ); |
364 | searchBar->setStretchableWidget( searchEdit ); | 364 | searchBar->setStretchableWidget( searchEdit ); |
365 | connect( searchEdit, SIGNAL( textChanged( const QString & ) ), | 365 | connect( searchEdit, SIGNAL( textChanged( const QString & ) ), |
366 | this, SLOT( search() ) ); | 366 | this, SLOT( search() ) ); |
367 | 367 | ||
368 | a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); | 368 | a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); |
369 | connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) ); | 369 | connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) ); |
370 | a->addTo( searchBar ); | 370 | a->addTo( searchBar ); |
371 | a->addTo( edit ); | 371 | a->addTo( edit ); |
372 | 372 | ||
373 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 373 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
374 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); | 374 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); |
375 | a->addTo( searchBar ); | 375 | a->addTo( searchBar ); |
376 | 376 | ||
377 | edit->insertSeparator(); | 377 | edit->insertSeparator(); |
378 | a = new QAction( tr( "Delete" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 378 | a = new QAction( tr( "Delete" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
379 | connect( a, SIGNAL( activated() ), this, SLOT( editDelete() ) ); | 379 | connect( a, SIGNAL( activated() ), this, SLOT( editDelete() ) ); |
380 | a->addTo( edit ); | 380 | a->addTo( edit ); |
381 | 381 | ||
382 | searchBar->hide(); | 382 | searchBar->hide(); |
383 | 383 | ||
384 | editor = new QpeEditor( this ); | 384 | editor = new QpeEditor( this ); |
385 | setCentralWidget( editor ); | 385 | setCentralWidget( editor ); |
386 | editor->setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 386 | editor->setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
387 | connect( editor, SIGNAL( textChanged() ), this, SLOT( editorChanged() ) ); | 387 | connect( editor, SIGNAL( textChanged() ), this, SLOT( editorChanged() ) ); |
388 | 388 | ||
389 | // resize( 200, 300 ); | 389 | // resize( 200, 300 ); |
390 | 390 | ||
391 | // setFontSize(defsize,TRUE); | 391 | // setFontSize(defsize,TRUE); |
392 | FontDatabase fdb; | 392 | FontDatabase fdb; |
393 | QFont defaultFont=editor->font(); | 393 | QFont defaultFont=editor->font(); |
394 | QFontInfo fontInfo(defaultFont); | 394 | QFontInfo fontInfo(defaultFont); |
395 | 395 | ||
396 | cfg.setGroup("Font"); | 396 | cfg.setGroup("Font"); |
397 | QString family = cfg.readEntry("Family", fontInfo.family()); | 397 | QString family = cfg.readEntry("Family", fontInfo.family()); |
398 | QString style = cfg.readEntry("Style", fdb.styleString(defaultFont)); | 398 | QString style = cfg.readEntry("Style", fdb.styleString(defaultFont)); |
399 | int i_size = cfg.readNumEntry("Size", fontInfo.pointSize()/10); | 399 | int i_size = cfg.readNumEntry("Size", fontInfo.pointSize()/10); |
400 | QString charSet = cfg.readEntry("CharSet", QFont::encodingName( fontInfo.charSet()) ); | 400 | QString charSet = cfg.readEntry("CharSet", QFont::encodingName( fontInfo.charSet()) ); |
401 | 401 | ||
402 | defaultFont = fdb.font(family,style,i_size,charSet); | 402 | defaultFont = fdb.font(family,style,i_size,charSet); |
403 | editor->setFont( defaultFont); | 403 | editor->setFont( defaultFont); |
404 | 404 | ||
405 | wa->setOn(wrap); | 405 | wa->setOn(wrap); |
406 | updateCaption(); | 406 | updateCaption(); |
407 | 407 | ||
408 | cfg.setGroup("View"); | 408 | cfg.setGroup("View"); |
409 | if(cfg.readEntry("startNew","TRUE") == "TRUE") { | 409 | if(cfg.readEntry("startNew","TRUE") == "TRUE") { |
410 | nStart->setOn(TRUE); | 410 | nStart->setOn(TRUE); |
411 | fileNew(); | 411 | fileNew(); |
412 | } else { | 412 | } else { |
413 | fileOpen(); | 413 | fileOpen(); |
414 | } | 414 | } |
415 | viewSelection = cfg.readNumEntry( "FileView", 0 ); | 415 | viewSelection = cfg.readNumEntry( "FileView", 0 ); |
416 | } | 416 | } |
417 | 417 | ||
418 | void TextEdit::cleanUp() | 418 | void TextEdit::cleanUp() |
419 | { | 419 | { |
420 | // save(); | 420 | // save(); |
421 | Config cfg("TextEdit"); | 421 | Config cfg("TextEdit"); |
422 | cfg.setGroup("View"); | 422 | cfg.setGroup("View"); |
423 | QFont f = editor->font(); | 423 | QFont f = editor->font(); |
424 | cfg.writeEntry("FontSize",f.pointSize()); | 424 | cfg.writeEntry("FontSize",f.pointSize()); |
425 | cfg.writeEntry("Bold",f.bold()); | 425 | cfg.writeEntry("Bold",f.bold()); |
426 | cfg.writeEntry("Italic",f.italic()); | 426 | cfg.writeEntry("Italic",f.italic()); |
427 | cfg.writeEntry("Wrap",editor->wordWrap() == QMultiLineEdit::WidgetWidth); | 427 | cfg.writeEntry("Wrap",editor->wordWrap() == QMultiLineEdit::WidgetWidth); |
428 | cfg.writeEntry( "FileView", viewSelection ); | 428 | cfg.writeEntry( "FileView", viewSelection ); |
429 | 429 | ||
430 | } | 430 | } |
431 | 431 | ||
432 | TextEdit::~TextEdit() | 432 | TextEdit::~TextEdit() |
433 | { | 433 | { |
434 | } | 434 | } |
435 | 435 | ||
436 | void TextEdit::zoomIn() | 436 | void TextEdit::zoomIn() |
437 | { | 437 | { |
438 | setFontSize(editor->font().pointSize()+1,FALSE); | 438 | setFontSize(editor->font().pointSize()+1,FALSE); |
439 | } | 439 | } |
440 | 440 | ||
441 | void TextEdit::zoomOut() | 441 | void TextEdit::zoomOut() |
442 | { | 442 | { |
443 | setFontSize(editor->font().pointSize()-1,TRUE); | 443 | setFontSize(editor->font().pointSize()-1,TRUE); |
444 | } | 444 | } |
445 | 445 | ||
446 | 446 | ||
447 | void TextEdit::setFontSize(int sz, bool round_down_not_up) | 447 | void TextEdit::setFontSize(int sz, bool round_down_not_up) |
448 | { | 448 | { |
449 | int s=10; | 449 | int s=10; |
450 | for (int i=0; i<nfontsizes; i++) { | 450 | for (int i=0; i<nfontsizes; i++) { |
451 | if ( fontsize[i] == sz ) { | 451 | if ( fontsize[i] == sz ) { |
452 | s = sz; | 452 | s = sz; |
453 | break; | 453 | break; |
454 | } else if ( round_down_not_up ) { | 454 | } else if ( round_down_not_up ) { |
455 | if ( fontsize[i] < sz ) | 455 | if ( fontsize[i] < sz ) |
456 | s = fontsize[i]; | 456 | s = fontsize[i]; |
457 | } else { | 457 | } else { |
458 | if ( fontsize[i] > sz ) { | 458 | if ( fontsize[i] > sz ) { |
459 | s = fontsize[i]; | 459 | s = fontsize[i]; |
460 | break; | 460 | break; |
461 | } | 461 | } |
462 | } | 462 | } |
463 | } | 463 | } |
464 | 464 | ||
465 | QFont f = editor->font(); | 465 | QFont f = editor->font(); |
466 | f.setPointSize(s); | 466 | f.setPointSize(s); |
467 | editor->setFont(f); | 467 | editor->setFont(f); |
468 | 468 | ||
469 | zin->setEnabled(s != fontsize[nfontsizes-1]); | 469 | zin->setEnabled(s != fontsize[nfontsizes-1]); |
470 | zout->setEnabled(s != fontsize[0]); | 470 | zout->setEnabled(s != fontsize[0]); |
471 | } | 471 | } |
472 | 472 | ||
473 | void TextEdit::setBold(bool y) | 473 | void TextEdit::setBold(bool y) |
474 | { | 474 | { |
475 | QFont f = editor->font(); | 475 | QFont f = editor->font(); |
476 | f.setBold(y); | 476 | f.setBold(y); |
477 | editor->setFont(f); | 477 | editor->setFont(f); |
478 | } | 478 | } |
479 | 479 | ||
480 | void TextEdit::setItalic(bool y) | 480 | void TextEdit::setItalic(bool y) |
481 | { | 481 | { |
482 | QFont f = editor->font(); | 482 | QFont f = editor->font(); |
483 | f.setItalic(y); | 483 | f.setItalic(y); |
484 | editor->setFont(f); | 484 | editor->setFont(f); |
485 | } | 485 | } |
486 | 486 | ||
487 | void TextEdit::setWordWrap(bool y) | 487 | void TextEdit::setWordWrap(bool y) |
488 | { | 488 | { |
489 | bool state = editor->edited(); | 489 | bool state = editor->edited(); |
490 | editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap ); | 490 | editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap ); |
491 | editor->setEdited( state ); | 491 | editor->setEdited( state ); |
492 | } | 492 | } |
493 | 493 | ||
494 | void TextEdit::fileNew() | 494 | void TextEdit::fileNew() |
495 | { | 495 | { |
496 | // if( !bFromDocView ) { | 496 | // if( !bFromDocView ) { |
497 | // saveAs(); | 497 | // saveAs(); |
498 | // } | 498 | // } |
499 | newFile(DocLnk()); | 499 | newFile(DocLnk()); |
500 | } | 500 | } |
501 | 501 | ||
502 | void TextEdit::fileOpen() | 502 | void TextEdit::fileOpen() |
503 | { | 503 | { |
504 | // OFileSelector *fileSelector; | ||
505 | // fileSelector = new OFileSelector( this, 1,1,"/","", "text/*"); | ||
506 | //fileSelector->showMaximized(); | ||
507 | QString str = OFileDialog::getOpenFileName(1,"/","", QStringList() , this ); | 504 | QString str = OFileDialog::getOpenFileName(1,"/","", QStringList() , this ); |
508 | if(!str.isEmpty() ) | 505 | if(!str.isEmpty() ) |
509 | openFile( str ); | 506 | openFile( str ); |
510 | // browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "text/*"); // | 507 | // browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "text/*"); // |
511 | // browseForFiles->setFileView( viewSelection ); | 508 | // browseForFiles->setFileView( viewSelection ); |
512 | // browseForFiles->showMaximized(); | 509 | // browseForFiles->showMaximized(); |
513 | // // if( result != -1 ) | 510 | // // if( result != -1 ) |
514 | 511 | ||
515 | // if( browseForFiles->exec() != -1 ) { | 512 | // if( browseForFiles->exec() != -1 ) { |
516 | // QString selFile = browseForFiles->selectedFileName; | 513 | // QString selFile = browseForFiles->selectedFileName; |
517 | // QStringList fileList = browseForFiles->fileList; | 514 | // QStringList fileList = browseForFiles->fileList; |
518 | // qDebug(selFile); | 515 | // qDebug(selFile); |
519 | // QStringList::ConstIterator f; | 516 | // QStringList::ConstIterator f; |
520 | // QString fileTemp; | 517 | // QString fileTemp; |
521 | // for ( f = fileList.begin(); f != fileList.end(); f++ ) { | 518 | // for ( f = fileList.begin(); f != fileList.end(); f++ ) { |
522 | // fileTemp = *f; | 519 | // fileTemp = *f; |
523 | // fileTemp.right( fileTemp.length()-5); | 520 | // fileTemp.right( fileTemp.length()-5); |
524 | // QString fileName = fileTemp; | 521 | // QString fileName = fileTemp; |
525 | // if( fileName != "Unnamed" || fileName != "Empty Text" ) { | 522 | // if( fileName != "Unnamed" || fileName != "Empty Text" ) { |
526 | // currentFileName = fileName; | 523 | // currentFileName = fileName; |
527 | // qDebug("please open "+currentFileName); | 524 | // qDebug("please open "+currentFileName); |
528 | // openFile(str ); | 525 | // openFile(str ); |
529 | // } | 526 | // } |
530 | // } | 527 | // } |
531 | // viewSelection = browseForFiles->SelectionCombo->currentItem(); | 528 | // viewSelection = browseForFiles->SelectionCombo->currentItem(); |
532 | // } | 529 | // } |
533 | // delete browseForFiles; | 530 | // delete browseForFiles; |
534 | // editor->setEdited( FALSE); | 531 | // editor->setEdited( FALSE); |
535 | // edited1=FALSE; | 532 | // edited1=FALSE; |
536 | // edited=FALSE; | 533 | // edited=FALSE; |
537 | // if(caption().left(1)=="*") | 534 | // if(caption().left(1)=="*") |
538 | // setCaption(caption().right(caption().length()-1)); | 535 | // setCaption(caption().right(caption().length()-1)); |
539 | // doSearchBar(); | 536 | // doSearchBar(); |
540 | } | 537 | } |
541 | 538 | ||
542 | void TextEdit::doSearchBar() | 539 | void TextEdit::doSearchBar() |
543 | { | 540 | { |
544 | Config cfg("TextEdit"); | 541 | Config cfg("TextEdit"); |
545 | cfg.setGroup("View"); | 542 | cfg.setGroup("View"); |
546 | if(cfg.readEntry("SearchBar","Closed") != "Opened") | 543 | if(cfg.readEntry("SearchBar","Closed") != "Opened") |
547 | searchBar->hide(); | 544 | searchBar->hide(); |
548 | } | 545 | } |
549 | 546 | ||
550 | #if 0 | 547 | #if 0 |
551 | void TextEdit::slotFind() | 548 | void TextEdit::slotFind() |
552 | { | 549 | { |
553 | FindDialog frmFind( tr("Text Editor"), this ); | 550 | FindDialog frmFind( tr("Text Editor"), this ); |
554 | connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), | 551 | connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), |
555 | editor, SLOT(slotDoFind( const QString&,bool,bool))); | 552 | editor, SLOT(slotDoFind( const QString&,bool,bool))); |
556 | 553 | ||
557 | //case sensitive, backwards, [category] | 554 | //case sensitive, backwards, [category] |
558 | 555 | ||
559 | connect( editor, SIGNAL(notFound()), | 556 | connect( editor, SIGNAL(notFound()), |
560 | &frmFind, SLOT(slotNotFound()) ); | 557 | &frmFind, SLOT(slotNotFound()) ); |
561 | connect( editor, SIGNAL(searchWrapped()), | 558 | connect( editor, SIGNAL(searchWrapped()), |
562 | &frmFind, SLOT(slotWrapAround()) ); | 559 | &frmFind, SLOT(slotWrapAround()) ); |
563 | 560 | ||
564 | frmFind.exec(); | 561 | frmFind.exec(); |
565 | 562 | ||
566 | 563 | ||
567 | } | 564 | } |
568 | #endif | 565 | #endif |
569 | 566 | ||
570 | void TextEdit::fileRevert() | 567 | void TextEdit::fileRevert() |
571 | { | 568 | { |
572 | clear(); | 569 | clear(); |
573 | fileOpen(); | 570 | fileOpen(); |
574 | } | 571 | } |
575 | 572 | ||
576 | void TextEdit::editCut() | 573 | void TextEdit::editCut() |
577 | { | 574 | { |
578 | #ifndef QT_NO_CLIPBOARD | 575 | #ifndef QT_NO_CLIPBOARD |
579 | editor->cut(); | 576 | editor->cut(); |
580 | #endif | 577 | #endif |
581 | } | 578 | } |
582 | 579 | ||
583 | void TextEdit::editCopy() | 580 | void TextEdit::editCopy() |
584 | { | 581 | { |
585 | #ifndef QT_NO_CLIPBOARD | 582 | #ifndef QT_NO_CLIPBOARD |
586 | editor->copy(); | 583 | editor->copy(); |
587 | #endif | 584 | #endif |
588 | } | 585 | } |
589 | 586 | ||
590 | void TextEdit::editPaste() | 587 | void TextEdit::editPaste() |
591 | { | 588 | { |
592 | #ifndef QT_NO_CLIPBOARD | 589 | #ifndef QT_NO_CLIPBOARD |
593 | editor->paste(); | 590 | editor->paste(); |
594 | #endif | 591 | #endif |
595 | } | 592 | } |
596 | 593 | ||
597 | void TextEdit::editFind() | 594 | void TextEdit::editFind() |
598 | { | 595 | { |
599 | searchBar->show(); | 596 | searchBar->show(); |
600 | searchVisible = TRUE; | 597 | searchVisible = TRUE; |
601 | searchEdit->setFocus(); | 598 | searchEdit->setFocus(); |
602 | Config cfg("TextEdit"); | 599 | Config cfg("TextEdit"); |
603 | cfg.setGroup("View"); | 600 | cfg.setGroup("View"); |
604 | cfg.writeEntry("SearchBar","Opened"); | 601 | cfg.writeEntry("SearchBar","Opened"); |
605 | 602 | ||
606 | } | 603 | } |
607 | 604 | ||
608 | void TextEdit::findNext() | 605 | void TextEdit::findNext() |
609 | { | 606 | { |
610 | editor->find( searchEdit->text(), FALSE, FALSE ); | 607 | editor->find( searchEdit->text(), FALSE, FALSE ); |
611 | 608 | ||
612 | } | 609 | } |
613 | 610 | ||
614 | void TextEdit::findClose() | 611 | void TextEdit::findClose() |
615 | { | 612 | { |
616 | searchVisible = FALSE; | 613 | searchVisible = FALSE; |
617 | searchBar->hide(); | 614 | searchBar->hide(); |
618 | Config cfg("TextEdit"); | 615 | Config cfg("TextEdit"); |
619 | cfg.setGroup("View"); | 616 | cfg.setGroup("View"); |
620 | cfg.writeEntry("SearchBar","Closed"); | 617 | cfg.writeEntry("SearchBar","Closed"); |
621 | cfg.write(); | 618 | cfg.write(); |
622 | } | 619 | } |
623 | 620 | ||
624 | void TextEdit::search() | 621 | void TextEdit::search() |
625 | { | 622 | { |
626 | editor->find( searchEdit->text(), FALSE, FALSE ); | 623 | editor->find( searchEdit->text(), FALSE, FALSE ); |
627 | } | 624 | } |
628 | 625 | ||
629 | void TextEdit::newFile( const DocLnk &f ) | 626 | void TextEdit::newFile( const DocLnk &f ) |
630 | { | 627 | { |
631 | DocLnk nf = f; | 628 | DocLnk nf = f; |
632 | nf.setType("text/plain"); | 629 | nf.setType("text/plain"); |
633 | clear(); | 630 | clear(); |
634 | setWState (WState_Reserved1 ); | 631 | setWState (WState_Reserved1 ); |
635 | editor->setFocus(); | 632 | editor->setFocus(); |
636 | doc = new DocLnk(nf); | 633 | doc = new DocLnk(nf); |
637 | currentFileName = "Unnamed"; | 634 | currentFileName = "Unnamed"; |
638 | qDebug("newFile "+currentFileName); | 635 | qDebug("newFile "+currentFileName); |
639 | updateCaption( currentFileName); | 636 | updateCaption( currentFileName); |
640 | // editor->setEdited( FALSE); | 637 | // editor->setEdited( FALSE); |
641 | } | 638 | } |
642 | 639 | ||
643 | void TextEdit::openFile( const QString &f ) | 640 | void TextEdit::openFile( const QString &f ) |
644 | { | 641 | { |
645 | qDebug("filename is "+ f); | 642 | qDebug("filename is "+ f); |
646 | QString filer; | 643 | QString filer; |
647 | // bFromDocView = TRUE; | 644 | // bFromDocView = TRUE; |
648 | if(f.find(".desktop",0,TRUE)) { | 645 | if(f.find(".desktop",0,TRUE) != -1) { |
649 | switch ( QMessageBox::warning(this,tr("Text Editor"), | 646 | switch ( QMessageBox::warning(this,tr("Text Editor"), |
650 | tr("Text Editor has detected\n you selected a .desktop file.\nOpen .desktop file or linked file?"), | 647 | tr("Text Editor has detected\n you selected a .desktop file.\nOpen .desktop file or linked file?"), |
651 | tr(".desktop File"),tr("Link"),0,0,1) ) { | 648 | tr(".desktop File"),tr("Linked Document"),0,1,1) ) { |
652 | case 0: | 649 | case 0: |
653 | filer = f; | 650 | filer = f; |
654 | break; | 651 | break; |
655 | case 1: | 652 | case 1: |
656 | DocLnk sf(f); | 653 | DocLnk sf(f); |
657 | filer = sf.file(); | 654 | filer = sf.file(); |
658 | break; | 655 | break; |
659 | } | 656 | } |
660 | } | 657 | } else |
658 | filer = f; | ||
659 | |||
661 | DocLnk nf; | 660 | DocLnk nf; |
662 | nf.setType("text/plain"); | 661 | nf.setType("text/plain"); |
663 | nf.setFile(filer); | 662 | nf.setFile(filer); |
664 | currentFileName=filer; | 663 | currentFileName=filer; |
665 | QFileInfo fi( currentFileName); | 664 | QFileInfo fi( currentFileName); |
666 | nf.setName(fi.baseName()); | 665 | nf.setName(fi.baseName()); |
667 | qDebug("openFile string "+currentFileName); | 666 | qDebug("openFile string "+currentFileName); |
668 | 667 | ||
669 | openFile(nf); | 668 | openFile(nf); |
670 | showEditTools(); | 669 | showEditTools(); |
671 | // Show filename in caption | 670 | // Show filename in caption |
672 | QString name = filer; | 671 | QString name = filer; |
673 | int sep = name.findRev( '/' ); | 672 | int sep = name.findRev( '/' ); |
674 | if ( sep > 0 ) | 673 | if ( sep > 0 ) |
675 | name = name.mid( sep+1 ); | 674 | name = name.mid( sep+1 ); |
676 | updateCaption( name ); | 675 | updateCaption( name ); |
677 | } | 676 | } |
678 | 677 | ||
679 | void TextEdit::openFile( const DocLnk &f ) | 678 | void TextEdit::openFile( const DocLnk &f ) |
680 | { | 679 | { |
681 | // clear(); | 680 | // clear(); |
682 | // bFromDocView = TRUE; | 681 | // bFromDocView = TRUE; |
683 | FileManager fm; | 682 | FileManager fm; |
684 | QString txt; | 683 | QString txt; |
685 | currentFileName=f.name(); | 684 | currentFileName=f.file(); |
686 | qDebug("openFile doclnk " + currentFileName); | 685 | qDebug("openFile doclnk " + currentFileName); |
687 | if ( !fm.loadFile( f, txt ) ) { | 686 | if ( !fm.loadFile( f, txt ) ) { |
688 | // ####### could be a new file | 687 | // ####### could be a new file |
689 | qDebug( "Cannot open file" ); | 688 | qDebug( "Cannot open file" ); |
690 | } | 689 | } |
691 | // fileNew(); | 690 | // fileNew(); |
692 | if ( doc ) | 691 | if ( doc ) |
693 | delete doc; | 692 | delete doc; |
694 | doc = new DocLnk(f); | 693 | doc = new DocLnk(f); |
695 | editor->setText(txt); | 694 | editor->setText(txt); |
696 | editor->setEdited( FALSE); | 695 | editor->setEdited( FALSE); |
697 | edited1=FALSE; | 696 | edited1=FALSE; |
698 | edited=FALSE; | 697 | edited=FALSE; |
699 | 698 | ||
700 | doc->setName(currentFileName); | 699 | doc->setName(currentFileName); |
701 | updateCaption(); | 700 | updateCaption(); |
702 | } | 701 | } |
703 | 702 | ||
704 | void TextEdit::showEditTools() | 703 | void TextEdit::showEditTools() |
705 | { | 704 | { |
706 | // if ( !doc ) | 705 | // if ( !doc ) |
707 | // close(); | 706 | // close(); |
708 | // clear(); | 707 | // clear(); |
709 | menu->show(); | 708 | menu->show(); |
710 | editBar->show(); | 709 | editBar->show(); |
711 | if ( searchVisible ) | 710 | if ( searchVisible ) |
712 | searchBar->show(); | 711 | searchBar->show(); |
713 | // updateCaption(); | 712 | // updateCaption(); |
714 | setWState (WState_Reserved1 ); | 713 | setWState (WState_Reserved1 ); |
715 | } | 714 | } |
716 | 715 | ||
717 | /*! | 716 | /*! |
718 | unprompted save */ | 717 | unprompted save */ |
719 | bool TextEdit::save() | 718 | bool TextEdit::save() |
720 | { | 719 | { |
721 | QString file = doc->file(); | 720 | QString file = doc->file(); |
722 | qDebug("saver file "+file); | 721 | qDebug("saver file "+file); |
723 | QString name= doc->name(); | 722 | QString name= doc->name(); |
724 | qDebug("File named "+name); | 723 | qDebug("File named "+name); |
725 | QString rt = editor->text(); | 724 | QString rt = editor->text(); |
726 | if( !rt.isEmpty() ) { | 725 | if( !rt.isEmpty() ) { |
727 | if(name.isEmpty()) { | 726 | if(name.isEmpty()) { |
728 | saveAs(); | 727 | saveAs(); |
729 | } else { | 728 | } else { |
730 | currentFileName= name ; | 729 | currentFileName= name ; |
731 | qDebug("saveFile "+currentFileName); | 730 | qDebug("saveFile "+currentFileName); |
732 | 731 | ||
733 | struct stat buf; | 732 | struct stat buf; |
734 | mode_t mode; | 733 | mode_t mode; |
735 | stat(file.latin1(), &buf); | 734 | stat(file.latin1(), &buf); |
736 | mode = buf.st_mode; | 735 | mode = buf.st_mode; |
737 | 736 | ||
738 | doc->setName( name); | 737 | doc->setName( name); |
739 | FileManager fm; | 738 | FileManager fm; |
740 | if ( !fm.saveFile( *doc, rt ) ) { | 739 | if ( !fm.saveFile( *doc, rt ) ) { |
741 | return false; | 740 | return false; |
742 | } | 741 | } |
743 | editor->setEdited( FALSE); | 742 | editor->setEdited( FALSE); |
744 | edited1=FALSE; | 743 | edited1=FALSE; |
745 | edited=FALSE; | 744 | edited=FALSE; |
746 | if(caption().left(1)=="*") | 745 | if(caption().left(1)=="*") |
747 | setCaption(caption().right(caption().length()-1)); | 746 | setCaption(caption().right(caption().length()-1)); |
748 | 747 | ||
749 | 748 | ||
750 | chmod( file.latin1(), mode); | 749 | chmod( file.latin1(), mode); |
751 | } | 750 | } |
752 | return true; | 751 | return true; |
753 | } | 752 | } |
754 | return false; | 753 | return false; |
755 | } | 754 | } |
756 | 755 | ||
757 | /*! | 756 | /*! |
758 | prompted save */ | 757 | prompted save */ |
759 | bool TextEdit::saveAs() | 758 | bool TextEdit::saveAs() |
760 | { | 759 | { |
761 | // qDebug("saveAsFile "+currentFileName); | 760 | // qDebug("saveAsFile "+currentFileName); |
762 | // case of nothing to save... | 761 | // case of nothing to save... |
763 | if ( !doc )//|| !bFromDocView) | 762 | if ( !doc )//|| !bFromDocView) |
764 | { | 763 | { |
765 | qDebug("no doc"); | 764 | qDebug("no doc"); |
766 | return true; | 765 | return true; |
767 | } | 766 | } |
768 | if ( !editor->edited() ) { | 767 | if ( !editor->edited() ) { |
769 | delete doc; | 768 | delete doc; |
770 | doc = 0; | 769 | doc = 0; |
771 | return true; | 770 | return true; |
772 | } | 771 | } |
773 | 772 | ||
774 | QString rt = editor->text(); | 773 | QString rt = editor->text(); |
775 | qDebug(currentFileName); | 774 | qDebug(currentFileName); |
776 | 775 | ||
777 | if( currentFileName.isEmpty() || currentFileName == tr("Unnamed") || currentFileName == tr("Text Editor")) { | 776 | if( currentFileName.isEmpty() || currentFileName == tr("Unnamed") || currentFileName == tr("Text Editor")) { |
778 | qDebug("do silly TT filename thing"); | 777 | qDebug("do silly TT filename thing"); |
779 | if ( doc->name().isEmpty() ) { | 778 | if ( doc->name().isEmpty() ) { |
780 | QString pt = rt.simplifyWhiteSpace(); | 779 | QString pt = rt.simplifyWhiteSpace(); |
781 | int i = pt.find( ' ' ); | 780 | int i = pt.find( ' ' ); |
782 | QString docname = pt; | 781 | QString docname = pt; |
783 | if ( i > 0 ) | 782 | if ( i > 0 ) |
784 | docname = pt.left( i ); | 783 | docname = pt.left( i ); |
785 | // remove "." at the beginning | 784 | // remove "." at the beginning |
786 | while( docname.startsWith( "." ) ) | 785 | while( docname.startsWith( "." ) ) |
787 | docname = docname.mid( 1 ); | 786 | docname = docname.mid( 1 ); |
788 | docname.replace( QRegExp("/"), "_" ); | 787 | docname.replace( QRegExp("/"), "_" ); |
789 | // cut the length. filenames longer than that don't make sense and something goes wrong when they get too long. | 788 | // cut the length. filenames longer than that don't make sense and something goes wrong when they get too long. |
790 | if ( docname.length() > 40 ) | 789 | if ( docname.length() > 40 ) |
791 | docname = docname.left(40); | 790 | docname = docname.left(40); |
792 | if ( docname.isEmpty() ) | 791 | if ( docname.isEmpty() ) |
793 | docname = tr("Unnamed"); | 792 | docname = tr("Unnamed"); |
794 | doc->setName(docname); | 793 | doc->setName(docname); |
795 | currentFileName=docname; | 794 | currentFileName=docname; |
796 | } | 795 | } |
797 | } | 796 | } |
798 | 797 | ||
799 | 798 | ||
800 | fileSaveDlg=new fileSaver(this,tr("Save File As?"),TRUE, 0, currentFileName); | 799 | fileSaveDlg=new fileSaver(this,tr("Save File As?"),TRUE, 0, currentFileName); |
801 | qDebug("wanna save filename "+currentFileName); | 800 | qDebug("wanna save filename "+currentFileName); |
802 | fileSaveDlg->exec(); | 801 | fileSaveDlg->exec(); |
803 | if( fileSaveDlg->result() == 1 ) { | 802 | if( fileSaveDlg->result() == 1 ) { |
804 | QString fileNm=fileSaveDlg->selectedFileName; | 803 | QString fileNm=fileSaveDlg->selectedFileName; |
805 | qDebug("saving filename "+fileNm); | 804 | qDebug("saving filename "+fileNm); |
806 | QFileInfo fi(fileNm); | 805 | QFileInfo fi(fileNm); |
807 | currentFileName=fi.fileName(); | 806 | currentFileName=fi.fileName(); |
808 | if(doc) { | 807 | if(doc) { |
809 | // QString file = doc->file(); | 808 | // QString file = doc->file(); |
810 | // doc->removeFiles(); | 809 | // doc->removeFiles(); |
811 | delete doc; | 810 | delete doc; |
812 | DocLnk nf; | 811 | DocLnk nf; |
813 | nf.setType("text/plain"); | 812 | nf.setType("text/plain"); |
814 | nf.setFile( fileNm); | 813 | nf.setFile( fileNm); |
815 | doc = new DocLnk(nf); | 814 | doc = new DocLnk(nf); |
816 | // editor->setText(rt); | 815 | // editor->setText(rt); |
817 | // qDebug("openFile doclnk "+currentFileName); | 816 | // qDebug("openFile doclnk "+currentFileName); |
818 | doc->setName( currentFileName); | 817 | doc->setName( currentFileName); |
819 | updateCaption( currentFileName); | 818 | updateCaption( currentFileName); |
820 | 819 | ||
821 | FileManager fm; | 820 | FileManager fm; |
822 | if ( !fm.saveFile( *doc, rt ) ) { | 821 | if ( !fm.saveFile( *doc, rt ) ) { |
823 | return false; | 822 | return false; |
824 | } | 823 | } |
825 | if( fileSaveDlg->filePermCheck->isChecked() ) { | 824 | if( fileSaveDlg->filePermCheck->isChecked() ) { |
826 | filePermissions *filePerm; | 825 | filePermissions *filePerm; |
827 | filePerm = new filePermissions(this, tr("Permissions"),true,0,(const QString &)fileNm); | 826 | filePerm = new filePermissions(this, tr("Permissions"),true,0,(const QString &)fileNm); |
828 | filePerm->exec(); | 827 | filePerm->exec(); |
829 | 828 | ||
830 | if( filePerm) | 829 | if( filePerm) |
831 | delete filePerm; | 830 | delete filePerm; |
832 | } | 831 | } |
833 | } | 832 | } |
834 | } | 833 | } |
835 | editor->setEdited(TRUE); | 834 | editor->setEdited(TRUE); |
836 | edited1=FALSE; | 835 | edited1=FALSE; |
837 | edited=TRUE; | 836 | edited=TRUE; |
838 | if(caption().left(1)=="*") | 837 | if(caption().left(1)=="*") |
839 | setCaption(caption().right(caption().length()-1)); | 838 | setCaption(caption().right(caption().length()-1)); |
840 | 839 | ||
841 | if(fileSaveDlg) | 840 | if(fileSaveDlg) |
842 | delete fileSaveDlg; | 841 | delete fileSaveDlg; |
843 | return true; | 842 | return true; |
844 | } //end saveAs | 843 | } //end saveAs |
845 | 844 | ||
846 | void TextEdit::clear() | 845 | void TextEdit::clear() |
847 | { | 846 | { |
848 | delete doc; | 847 | delete doc; |
849 | doc = 0; | 848 | doc = 0; |
850 | editor->clear(); | 849 | editor->clear(); |
851 | } | 850 | } |
852 | 851 | ||
853 | void TextEdit::updateCaption( const QString &name ) | 852 | void TextEdit::updateCaption( const QString &name ) |
854 | { | 853 | { |
855 | if ( !doc ) | 854 | if ( !doc ) |
856 | setCaption( tr("Text Editor") ); | 855 | setCaption( tr("Text Editor") ); |
857 | else { | 856 | else { |
858 | QString s = name; | 857 | QString s = name; |
859 | if ( s.isNull() ) | 858 | if ( s.isNull() ) |
860 | s = doc->name(); | 859 | s = doc->name(); |
861 | if ( s.isEmpty() ) { | 860 | if ( s.isEmpty() ) { |
862 | s = tr( "Unnamed" ); | 861 | s = tr( "Unnamed" ); |
863 | currentFileName=s; | 862 | currentFileName=s; |
864 | } | 863 | } |
865 | if(s.left(1) == "/") | 864 | if(s.left(1) == "/") |
866 | s = s.right(s.length()-1); | 865 | s = s.right(s.length()-1); |
867 | setCaption( s + " - " + tr("Text Editor") ); | 866 | setCaption( s + " - " + tr("Text Editor") ); |
868 | } | 867 | } |
869 | } | 868 | } |
870 | 869 | ||
871 | void TextEdit::setDocument(const QString& fileref) | 870 | void TextEdit::setDocument(const QString& fileref) |
872 | { | 871 | { |
873 | bFromDocView = TRUE; | 872 | bFromDocView = TRUE; |
874 | openFile(fileref); | 873 | openFile(fileref); |
875 | editor->setEdited(TRUE); | 874 | editor->setEdited(TRUE); |
876 | edited1=FALSE; | 875 | edited1=FALSE; |
877 | edited=TRUE; | 876 | edited=TRUE; |
878 | doSearchBar(); | 877 | doSearchBar(); |
879 | } | 878 | } |
880 | 879 | ||
881 | void TextEdit::closeEvent( QCloseEvent *e ) | 880 | void TextEdit::closeEvent( QCloseEvent *e ) |
882 | { | 881 | { |
883 | bFromDocView = FALSE; | 882 | bFromDocView = FALSE; |
884 | e->accept(); | 883 | e->accept(); |
885 | } | 884 | } |
886 | 885 | ||
887 | void TextEdit::accept() | 886 | void TextEdit::accept() |
888 | { | 887 | { |
889 | //if(caption() !="Unnamed") | 888 | //if(caption() !="Unnamed") |
890 | if(edited1) | 889 | if(edited1) |
891 | saveAs(); | 890 | saveAs(); |
892 | exit(0); | 891 | exit(0); |
893 | 892 | ||
894 | } | 893 | } |
895 | 894 | ||
896 | void TextEdit::changeFont() { | 895 | void TextEdit::changeFont() { |
897 | FontDatabase fdb; | 896 | FontDatabase fdb; |
898 | QFont defaultFont=editor->font(); | 897 | QFont defaultFont=editor->font(); |
899 | QFontInfo fontInfo(defaultFont); | 898 | QFontInfo fontInfo(defaultFont); |
900 | Config cfg("TextEdit"); | 899 | Config cfg("TextEdit"); |
901 | cfg.setGroup("Font"); | 900 | cfg.setGroup("Font"); |
902 | QString family = cfg.readEntry("Family", fontInfo.family()); | 901 | QString family = cfg.readEntry("Family", fontInfo.family()); |
903 | QString style = cfg.readEntry("Style", fdb.styleString(defaultFont)); | 902 | QString style = cfg.readEntry("Style", fdb.styleString(defaultFont)); |
904 | int i_size = cfg.readNumEntry("Size", fontInfo.pointSize()/10); | 903 | int i_size = cfg.readNumEntry("Size", fontInfo.pointSize()/10); |
905 | QString charSet = cfg.readEntry("CharSet", QFont::encodingName( fontInfo.charSet()) ); | 904 | QString charSet = cfg.readEntry("CharSet", QFont::encodingName( fontInfo.charSet()) ); |
906 | 905 | ||
907 | defaultFont = fdb.font(family,style,i_size,charSet); | 906 | defaultFont = fdb.font(family,style,i_size,charSet); |
908 | 907 | ||
909 | FontDialog *fontDlg; | 908 | FontDialog *fontDlg; |
910 | fontDlg=new FontDialog(this,tr("FontDialog"),TRUE); | 909 | fontDlg=new FontDialog(this,tr("FontDialog"),TRUE); |
911 | 910 | ||
912 | fontDlg->exec(); | 911 | fontDlg->exec(); |
913 | 912 | ||
914 | QFont myFont=fontDlg->selectedFont; | 913 | QFont myFont=fontDlg->selectedFont; |
915 | editor->setFont( myFont); | 914 | editor->setFont( myFont); |
916 | delete fontDlg; | 915 | delete fontDlg; |
917 | 916 | ||
918 | } | 917 | } |
919 | 918 | ||
920 | void TextEdit::editDelete() | 919 | void TextEdit::editDelete() |
921 | { | 920 | { |
922 | switch ( QMessageBox::warning(this,tr("Text Editor"),tr("Do you really want\nto delete the current file\nfrom the disk?\nThis is irreversable!!"),tr("Yes"),tr("No"),0,0,1) ) { | 921 | switch ( QMessageBox::warning(this,tr("Text Editor"),tr("Do you really want\nto delete the current file\nfrom the disk?\nThis is irreversable!!"),tr("Yes"),tr("No"),0,0,1) ) { |
923 | case 0: | 922 | case 0: |
924 | if(doc) { | 923 | if(doc) { |
925 | doc->removeFiles(); | 924 | doc->removeFiles(); |
926 | clear(); | 925 | clear(); |
927 | setCaption( tr("Text Editor") ); | 926 | setCaption( tr("Text Editor") ); |
928 | } | 927 | } |
929 | break; | 928 | break; |
930 | case 1: | 929 | case 1: |
931 | // exit | 930 | // exit |
932 | break; | 931 | break; |
933 | }; | 932 | }; |
934 | } | 933 | } |
935 | 934 | ||
936 | void TextEdit::changeStartConfig( bool b ) { | 935 | void TextEdit::changeStartConfig( bool b ) { |
937 | 936 | ||
938 | Config cfg("TextEdit"); | 937 | Config cfg("TextEdit"); |
939 | cfg.setGroup("View"); | 938 | cfg.setGroup("View"); |
940 | if(b) { | 939 | if(b) { |
941 | qDebug("bool"); | 940 | qDebug("bool"); |
942 | cfg.writeEntry("startNew","TRUE"); | 941 | cfg.writeEntry("startNew","TRUE"); |
943 | } else { | 942 | } else { |
944 | cfg.writeEntry("startNew","FALSE"); | 943 | cfg.writeEntry("startNew","FALSE"); |
945 | } | 944 | } |
946 | update(); | 945 | update(); |
947 | } | 946 | } |
948 | 947 | ||
949 | void TextEdit::editorChanged() { | 948 | void TextEdit::editorChanged() { |
950 | if(editor->edited() && edited && !edited1) { | 949 | if(editor->edited() && edited && !edited1) { |
951 | setCaption( "*"+caption()); | 950 | setCaption( "*"+caption()); |
952 | edited1=TRUE; | 951 | edited1=TRUE; |
953 | } | 952 | } |
954 | edited=TRUE; | 953 | edited=TRUE; |
955 | } | 954 | } |
956 | 955 | ||
957 | void TextEdit::receive(const QCString&msg, const QByteArray&) { | 956 | void TextEdit::receive(const QCString&msg, const QByteArray&) { |
958 | qDebug("QCop "+msg); | 957 | qDebug("QCop "+msg); |
959 | if ( msg == "setDocument(QString)" ) { | 958 | if ( msg == "setDocument(QString)" ) { |
960 | qDebug("bugger all"); | 959 | qDebug("bugger all"); |
961 | } | 960 | } |
962 | 961 | ||
963 | } | 962 | } |