summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp11
-rw-r--r--core/apps/textedit/textedit.h3
-rw-r--r--core/apps/textedit/textedit.pro4
3 files changed, 12 insertions, 6 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index d3f5fb4..f56d5d3 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -227,24 +227,25 @@ void QpeEditor::find ( const QString &txt, bool caseSensitive,
227 227
228 228
229static const int nfontsizes = 6; 229static const int nfontsizes = 6;
230static const int fontsize[nfontsizes] = {8,10,12,14,18,24}; 230static const int fontsize[nfontsizes] = {8,10,12,14,18,24};
231 231
232TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) 232TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
233 : QMainWindow( parent, name, f ), bFromDocView( FALSE ) 233 : QMainWindow( parent, name, f ), bFromDocView( FALSE )
234{ 234{
235 doc = 0; 235 doc = 0;
236 edited=FALSE; 236 edited=FALSE;
237 edited1=FALSE; 237 edited1=FALSE;
238 setToolBarsMovable( FALSE ); 238 setToolBarsMovable( FALSE );
239 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
239 240
240 setIcon( Resource::loadPixmap( "TextEditor" ) ); 241 setIcon( Resource::loadPixmap( "TextEditor" ) );
241 242
242 QPEToolBar *bar = new QPEToolBar( this ); 243 QPEToolBar *bar = new QPEToolBar( this );
243 bar->setHorizontalStretchable( TRUE ); 244 bar->setHorizontalStretchable( TRUE );
244 menu = bar; 245 menu = bar;
245 246
246 QPEMenuBar *mb = new QPEMenuBar( bar ); 247 QPEMenuBar *mb = new QPEMenuBar( bar );
247 QPopupMenu *file = new QPopupMenu( this ); 248 QPopupMenu *file = new QPopupMenu( this );
248 QPopupMenu *edit = new QPopupMenu( this ); 249 QPopupMenu *edit = new QPopupMenu( this );
249 font = new QPopupMenu( this ); 250 font = new QPopupMenu( this );
250 251
@@ -398,36 +399,40 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
398 updateCaption(); 399 updateCaption();
399 400
400 cfg.setGroup("View"); 401 cfg.setGroup("View");
401 if(cfg.readEntry("startNew","TRUE") == "TRUE") { 402 if(cfg.readEntry("startNew","TRUE") == "TRUE") {
402 nStart->setOn(TRUE); 403 nStart->setOn(TRUE);
403 fileNew(); 404 fileNew();
404 } else { 405 } else {
405 fileOpen(); 406 fileOpen();
406 } 407 }
407 viewSelection = cfg.readNumEntry( "FileView", 0 ); 408 viewSelection = cfg.readNumEntry( "FileView", 0 );
408} 409}
409 410
410TextEdit::~TextEdit() 411void TextEdit::cleanUp()
411{ 412{
412// save(); 413// save();
413
414 Config cfg("TextEdit"); 414 Config cfg("TextEdit");
415 cfg.setGroup("View"); 415 cfg.setGroup("View");
416 QFont f = editor->font(); 416 QFont f = editor->font();
417 cfg.writeEntry("FontSize",f.pointSize()); 417 cfg.writeEntry("FontSize",f.pointSize());
418 cfg.writeEntry("Bold",f.bold()); 418 cfg.writeEntry("Bold",f.bold());
419 cfg.writeEntry("Italic",f.italic()); 419 cfg.writeEntry("Italic",f.italic());
420 cfg.writeEntry("Wrap",editor->wordWrap() == QMultiLineEdit::WidgetWidth); 420 cfg.writeEntry("Wrap",editor->wordWrap() == QMultiLineEdit::WidgetWidth);
421 cfg.writeEntry( "FileView", viewSelection ); 421 cfg.writeEntry( "FileView", viewSelection );
422
423}
424
425TextEdit::~TextEdit()
426{
422} 427}
423 428
424void TextEdit::zoomIn() 429void TextEdit::zoomIn()
425{ 430{
426 setFontSize(editor->font().pointSize()+1,FALSE); 431 setFontSize(editor->font().pointSize()+1,FALSE);
427} 432}
428 433
429void TextEdit::zoomOut() 434void TextEdit::zoomOut()
430{ 435{
431 setFontSize(editor->font().pointSize()-1,TRUE); 436 setFontSize(editor->font().pointSize()-1,TRUE);
432} 437}
433 438
diff --git a/core/apps/textedit/textedit.h b/core/apps/textedit/textedit.h
index aca2933..a70b581 100644
--- a/core/apps/textedit/textedit.h
+++ b/core/apps/textedit/textedit.h
@@ -62,24 +62,25 @@ public slots:
62protected: 62protected:
63 void closeEvent( QCloseEvent *e ); 63 void closeEvent( QCloseEvent *e );
64 64
65private slots: 65private slots:
66 void setDocument(const QString&); 66 void setDocument(const QString&);
67 void changeFont(); 67 void changeFont();
68 void fileNew(); 68 void fileNew();
69 void fileRevert(); 69 void fileRevert();
70 void fileOpen(); 70 void fileOpen();
71 void changeStartConfig(bool); 71 void changeStartConfig(bool);
72 bool save(); 72 bool save();
73 bool saveAs(); 73 bool saveAs();
74 void cleanUp();
74 75
75 76
76 void editCut(); 77 void editCut();
77 void editCopy(); 78 void editCopy();
78 void editPaste(); 79 void editPaste();
79 void editFind(); 80 void editFind();
80 void editDelete(); 81 void editDelete();
81 82
82 void findNext(); 83 void findNext();
83 void findClose(); 84 void findClose();
84 85
85 void search(); 86 void search();
@@ -102,18 +103,18 @@ private:
102 void setFontSize(int sz, bool round_down_not_up); 103 void setFontSize(int sz, bool round_down_not_up);
103 104
104private: 105private:
105 fileSaver *fileSaveDlg; 106 fileSaver *fileSaveDlg;
106 fileBrowser *browseForFiles; 107 fileBrowser *browseForFiles;
107 108
108 QpeEditor* editor; 109 QpeEditor* editor;
109 QToolBar *menu, *editBar, *searchBar; 110 QToolBar *menu, *editBar, *searchBar;
110 QLineEdit *searchEdit; 111 QLineEdit *searchEdit;
111 DocLnk *doc; 112 DocLnk *doc;
112 bool searchVisible; 113 bool searchVisible;
113 bool bFromDocView; 114 bool bFromDocView;
114 int viewSelection; 115 int viewSelection;
115 QAction *zin, *zout; 116 QAction *zin, *zout;
116 QString currentFileName; 117 QString currentFileName;
117}; 118};
118 119
119#endif 120#endif
diff --git a/core/apps/textedit/textedit.pro b/core/apps/textedit/textedit.pro
index 1301aed..37ddf15 100644
--- a/core/apps/textedit/textedit.pro
+++ b/core/apps/textedit/textedit.pro
@@ -2,14 +2,14 @@ TEMPLATE = app
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3 3
4DESTDIR = $(OPIEDIR)/bin 4DESTDIR = $(OPIEDIR)/bin
5HEADERS = textedit.h fileBrowser.h fontDialog.h fileSaver.h filePermissions.h inputDialog.h 5HEADERS = textedit.h fileBrowser.h fontDialog.h fileSaver.h filePermissions.h inputDialog.h
6SOURCES = main.cpp textedit.cpp fileBrowser.cpp fontDialog.cpp fileSaver.cpp filePermissions.cpp inputDialog.cpp 6SOURCES = main.cpp textedit.cpp fileBrowser.cpp fontDialog.cpp fileSaver.cpp filePermissions.cpp inputDialog.cpp
7 7
8INCLUDEPATH += $(OPIEDIR)/include 8INCLUDEPATH += $(OPIEDIR)/include
9DEPENDPATH += $(OPIEDIR)/include 9DEPENDPATH += $(OPIEDIR)/include
10LIBS += -lqpe 10LIBS += -lqpe
11 11
12TARGET = textedit 12TARGET = textedit
13 13
14TRANSLATIONS = ../i18n/de/textedit.ts 14TRANSLATIONS += ../i18n/de/textedit.ts
15TRANSLATIONS = ../i18n/pt_BR/textedit.ts 15TRANSLATIONS += ../i18n/pt_BR/textedit.ts