-rw-r--r-- | core/apps/textedit/textedit.cpp | 11 | ||||
-rw-r--r-- | core/apps/textedit/textedit.h | 3 | ||||
-rw-r--r-- | core/apps/textedit/textedit.pro | 4 |
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, static const int nfontsizes = 6; static const int fontsize[nfontsizes] = {8,10,12,14,18,24}; TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) : QMainWindow( parent, name, f ), bFromDocView( FALSE ) { doc = 0; edited=FALSE; edited1=FALSE; setToolBarsMovable( FALSE ); + connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); setIcon( Resource::loadPixmap( "TextEditor" ) ); QPEToolBar *bar = new QPEToolBar( this ); bar->setHorizontalStretchable( TRUE ); menu = bar; QPEMenuBar *mb = new QPEMenuBar( bar ); QPopupMenu *file = new QPopupMenu( this ); QPopupMenu *edit = new QPopupMenu( this ); font = new QPopupMenu( this ); @@ -398,36 +399,40 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) updateCaption(); cfg.setGroup("View"); if(cfg.readEntry("startNew","TRUE") == "TRUE") { nStart->setOn(TRUE); fileNew(); } else { fileOpen(); } viewSelection = cfg.readNumEntry( "FileView", 0 ); } -TextEdit::~TextEdit() +void TextEdit::cleanUp() { // save(); - Config cfg("TextEdit"); cfg.setGroup("View"); QFont f = editor->font(); cfg.writeEntry("FontSize",f.pointSize()); cfg.writeEntry("Bold",f.bold()); cfg.writeEntry("Italic",f.italic()); cfg.writeEntry("Wrap",editor->wordWrap() == QMultiLineEdit::WidgetWidth); - cfg.writeEntry( "FileView", viewSelection ); + cfg.writeEntry( "FileView", viewSelection ); + +} + +TextEdit::~TextEdit() +{ } void TextEdit::zoomIn() { setFontSize(editor->font().pointSize()+1,FALSE); } void TextEdit::zoomOut() { setFontSize(editor->font().pointSize()-1,TRUE); } 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: protected: void closeEvent( QCloseEvent *e ); private slots: void setDocument(const QString&); void changeFont(); void fileNew(); void fileRevert(); void fileOpen(); void changeStartConfig(bool); bool save(); bool saveAs(); + void cleanUp(); void editCut(); void editCopy(); void editPaste(); void editFind(); void editDelete(); void findNext(); void findClose(); void search(); @@ -102,18 +103,18 @@ private: void setFontSize(int sz, bool round_down_not_up); private: fileSaver *fileSaveDlg; fileBrowser *browseForFiles; QpeEditor* editor; QToolBar *menu, *editBar, *searchBar; QLineEdit *searchEdit; DocLnk *doc; bool searchVisible; bool bFromDocView; - int viewSelection; + int viewSelection; QAction *zin, *zout; QString currentFileName; }; #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 CONFIG += qt warn_on release DESTDIR = $(OPIEDIR)/bin HEADERS = textedit.h fileBrowser.h fontDialog.h fileSaver.h filePermissions.h inputDialog.h SOURCES = main.cpp textedit.cpp fileBrowser.cpp fontDialog.cpp fileSaver.cpp filePermissions.cpp inputDialog.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe TARGET = textedit -TRANSLATIONS = ../i18n/de/textedit.ts -TRANSLATIONS = ../i18n/pt_BR/textedit.ts +TRANSLATIONS += ../i18n/de/textedit.ts +TRANSLATIONS += ../i18n/pt_BR/textedit.ts |