-rw-r--r-- | core/apps/textedit/textedit.cpp | 23 | ||||
-rw-r--r-- | core/apps/textedit/textedit.h | 2 |
2 files changed, 23 insertions, 2 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 429c195..834971a 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -277,2 +277,6 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) | |||
277 | 277 | ||
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() ) ); | ||
280 | a->addTo( file ); | ||
281 | |||
278 | 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 ); |
@@ -416,3 +420,3 @@ TextEdit::~TextEdit() | |||
416 | { | 420 | { |
417 | save(); | 421 | saveAs(); |
418 | 422 | ||
@@ -488,3 +492,3 @@ void TextEdit::fileNew() | |||
488 | if( !bFromDocView ) { | 492 | if( !bFromDocView ) { |
489 | save(); | 493 | saveAs(); |
490 | } | 494 | } |
@@ -682,2 +686,17 @@ bool TextEdit::save() | |||
682 | { | 686 | { |
687 | QString rt = editor->text(); | ||
688 | doc->setName( currentFileName); | ||
689 | FileManager fm; | ||
690 | if ( !fm.saveFile( *doc, rt ) ) { | ||
691 | return false; | ||
692 | } | ||
693 | delete doc; | ||
694 | doc = 0; | ||
695 | editor->setEdited( false ); | ||
696 | return true; | ||
697 | |||
698 | } | ||
699 | |||
700 | bool TextEdit::saveAs() | ||
701 | { | ||
683 | // case of nothing to save... | 702 | // case of nothing to save... |
diff --git a/core/apps/textedit/textedit.h b/core/apps/textedit/textedit.h index 4bfb260..f9eb241 100644 --- a/core/apps/textedit/textedit.h +++ b/core/apps/textedit/textedit.h | |||
@@ -63,2 +63,4 @@ private slots: | |||
63 | bool save(); | 63 | bool save(); |
64 | bool saveAs(); | ||
65 | |||
64 | 66 | ||