Diffstat (limited to 'core/apps/textedit/textedit.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/apps/textedit/textedit.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 14bc496..429c195 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -486,5 +486,7 @@ void TextEdit::setWordWrap(bool y) void TextEdit::fileNew() { + if( !bFromDocView ) { save(); + } newFile(DocLnk()); } @@ -513,5 +515,5 @@ void TextEdit::fileOpen() editorStack->raiseWidget( fileSelector ); fileSelector->reread(); - updateCaption(); + updateCaption(currentFileName); } @@ -520,5 +522,5 @@ void TextEdit::newFileOpen() fileBrowser *browseForFiles; browseForFiles=new fileBrowser(this,"fileBrowser",TRUE,0, "*"); - browseForFiles->exec(); + if( browseForFiles->exec()!= 0 ) { QString selFile= browseForFiles->selectedFileName; QStringList fileList=browseForFiles->fileList; @@ -532,8 +534,9 @@ void TextEdit::newFileOpen() if( fileName != "Unnamed" || fileName != "Empty Text" ) { currentFileName = fileName; - qDebug("please open "+currentFileName); +// qDebug("please open "+currentFileName); openFile(fileName ); } } + } delete browseForFiles; @@ -620,5 +623,5 @@ void TextEdit::newFile( const DocLnk &f ) editor->setFocus(); doc = new DocLnk(nf); - updateCaption(); +// updateCaption(); } @@ -642,4 +645,5 @@ void TextEdit::openFile( const DocLnk &f ) { // clear(); + bFromDocView = TRUE; FileManager fm; QString txt; @@ -657,5 +661,5 @@ void TextEdit::openFile( const DocLnk &f ) editor->setText(txt); editor->setEdited(FALSE); - updateCaption(); + updateCaption(currentFileName); } @@ -670,5 +674,5 @@ void TextEdit::showEditTools() if ( searchVisible ) searchBar->show(); - updateCaption(); +// updateCaption(); editorStack->raiseWidget( editor ); setWState (WState_Reserved1 ); @@ -687,4 +691,5 @@ bool TextEdit::save() QString rt = editor->text(); + qDebug(currentFileName); if(currentFileName.isEmpty() || currentFileName == "Unnamed") { @@ -712,9 +717,10 @@ bool TextEdit::save() fileSaver *fileSaveDlg; fileSaveDlg=new fileSaver(this,"SaveFile",TRUE,0, currentFileName); - fileSaveDlg->exec(); + if( fileSaveDlg->exec() != 0 ) { QString fileNm=fileSaveDlg->selectedFileName; qDebug("save filename "+fileNm); doc->setName(fileNm); - updateCaption(); + updateCaption(fileNm); + } delete fileSaveDlg; |