summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-02-18 14:52:54 (UTC)
committer llornkcor <llornkcor>2002-02-18 14:52:54 (UTC)
commit00f89d28e669140eb50f1f220c389f88fba1105c (patch) (side-by-side diff)
treedeb87bb87d855bbacddc79d8a0a79edfb1cf1cd8
parent9741205aa0b0892b870d2b7df7c5dd7e25b0bb18 (diff)
downloadopie-00f89d28e669140eb50f1f220c389f88fba1105c.zip
opie-00f89d28e669140eb50f1f220c389f88fba1105c.tar.gz
opie-00f89d28e669140eb50f1f220c389f88fba1105c.tar.bz2
fixed filesave and fileopen cancel
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/textedit/fileSaver.cpp12
-rw-r--r--core/apps/textedit/textedit.cpp22
-rw-r--r--core/apps/textedit/textedit.h0
3 files changed, 24 insertions, 10 deletions
diff --git a/core/apps/textedit/fileSaver.cpp b/core/apps/textedit/fileSaver.cpp
index d01daee..88608cc 100644
--- a/core/apps/textedit/fileSaver.cpp
+++ b/core/apps/textedit/fileSaver.cpp
@@ -31,3 +31,5 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl
setCaption(tr( "Save file" ) );
-// filterStr=currentFileName;
+ QFileInfo fi(currentFileName);
+ QString tmpFileName=fi.fileName();
+// qDebug( tmpFileName);
@@ -51,3 +53,5 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl
fileEdit->setGeometry( QRect( 10, 230, 200, 25));
- fileEdit->setText(currentFileName);
+
+ fileEdit->setText( tmpFileName);
+
// signals and slots connections
@@ -55,2 +59,5 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl
connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
+
+// tmpFileName=fi.FilePath();
+// qDebug( tmpFileName);
currentDir.setPath(QDir::currentDirPath() );
@@ -162,2 +169,3 @@ void fileSaver::accept() {
selectedFileName = currentDir.canonicalPath()+ selectedFileName;
+ qDebug("goint to save "+selectedFileName);
reject();
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
@@ -487,3 +487,5 @@ void TextEdit::fileNew()
{
+ if( !bFromDocView ) {
save();
+ }
newFile(DocLnk());
@@ -514,3 +516,3 @@ void TextEdit::fileOpen()
fileSelector->reread();
- updateCaption();
+ updateCaption(currentFileName);
}
@@ -521,3 +523,3 @@ void TextEdit::newFileOpen()
browseForFiles=new fileBrowser(this,"fileBrowser",TRUE,0, "*");
- browseForFiles->exec();
+ if( browseForFiles->exec()!= 0 ) {
QString selFile= browseForFiles->selectedFileName;
@@ -533,3 +535,3 @@ void TextEdit::newFileOpen()
currentFileName = fileName;
- qDebug("please open "+currentFileName);
+// qDebug("please open "+currentFileName);
openFile(fileName );
@@ -537,2 +539,3 @@ void TextEdit::newFileOpen()
}
+ }
delete browseForFiles;
@@ -621,3 +624,3 @@ void TextEdit::newFile( const DocLnk &f )
doc = new DocLnk(nf);
- updateCaption();
+// updateCaption();
}
@@ -643,2 +646,3 @@ void TextEdit::openFile( const DocLnk &f )
// clear();
+ bFromDocView = TRUE;
FileManager fm;
@@ -658,3 +662,3 @@ void TextEdit::openFile( const DocLnk &f )
editor->setEdited(FALSE);
- updateCaption();
+ updateCaption(currentFileName);
}
@@ -671,3 +675,3 @@ void TextEdit::showEditTools()
searchBar->show();
- updateCaption();
+// updateCaption();
editorStack->raiseWidget( editor );
@@ -688,2 +692,3 @@ bool TextEdit::save()
QString rt = editor->text();
+ qDebug(currentFileName);
@@ -713,3 +718,3 @@ bool TextEdit::save()
fileSaveDlg=new fileSaver(this,"SaveFile",TRUE,0, currentFileName);
- fileSaveDlg->exec();
+ if( fileSaveDlg->exec() != 0 ) {
QString fileNm=fileSaveDlg->selectedFileName;
@@ -717,3 +722,4 @@ bool TextEdit::save()
doc->setName(fileNm);
- updateCaption();
+ updateCaption(fileNm);
+ }
delete fileSaveDlg;
diff --git a/core/apps/textedit/textedit.h b/core/apps/textedit/textedit.h
index 4e469cc..4bfb260 100644
--- a/core/apps/textedit/textedit.h
+++ b/core/apps/textedit/textedit.h