author | llornkcor <llornkcor> | 2004-03-01 09:02:25 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-03-01 09:02:25 (UTC) |
commit | aa4539e4ccc23c47f720819e23c9a6faf53a4df8 (patch) (unidiff) | |
tree | 7c501175e1655b27cc144954e741d7eb8dc9372b | |
parent | 47cb805563e76732320f082975aad3046be1992a (diff) | |
download | opie-aa4539e4ccc23c47f720819e23c9a6faf53a4df8.zip opie-aa4539e4ccc23c47f720819e23c9a6faf53a4df8.tar.gz opie-aa4539e4ccc23c47f720819e23c9a6faf53a4df8.tar.bz2 |
add error dialogs
-rw-r--r-- | core/apps/textedit/textedit.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 2a4d391..8e106bf 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -814,23 +814,24 @@ bool TextEdit::save() { | |||
814 | mode = buf.st_mode; | 814 | mode = buf.st_mode; |
815 | 815 | ||
816 | if(!fileIs) { | 816 | if(!fileIs) { |
817 | doc->setName( name); | 817 | doc->setName( name); |
818 | FileManager fm; | 818 | FileManager fm; |
819 | if ( !fm.saveFile( *doc, rt ) ) { | 819 | if ( !fm.saveFile( *doc, rt ) ) { |
820 | QMessageBox::message(tr("Text Edit"),tr("Save Failed")); | ||
820 | return false; | 821 | return false; |
821 | } | 822 | } |
822 | } else { | 823 | } else { |
823 | qDebug("regular save file"); | 824 | qDebug("regular save file"); |
824 | QFile f(file); | 825 | QFile f(file); |
825 | if( f.open(IO_WriteOnly)) { | 826 | if( f.open(IO_WriteOnly)) { |
826 | QCString crt = rt.utf8(); | 827 | QCString crt = rt.utf8(); |
827 | f.writeBlock(crt,crt.length()); | 828 | f.writeBlock(crt,crt.length()); |
828 | } else { | 829 | } else { |
829 | QMessageBox::message(tr("Text Edit"),tr("Write Failed")); | 830 | QMessageBox::message(tr("Text Edit"),tr("Write Failed")); |
830 | return false; | 831 | return false; |
831 | } | 832 | } |
832 | 833 | ||
833 | } | 834 | } |
834 | editor->setEdited( false); | 835 | editor->setEdited( false); |
835 | edited1=false; | 836 | edited1=false; |
836 | edited=false; | 837 | edited=false; |
@@ -906,20 +907,19 @@ bool TextEdit::saveAs() { | |||
906 | QFileInfo cuFi( currentFileName); | 907 | QFileInfo cuFi( currentFileName); |
907 | QString filee = cuFi.fileName(); | 908 | QString filee = cuFi.fileName(); |
908 | QString dire = cuFi.dirPath(); | 909 | QString dire = cuFi.dirPath(); |
909 | if(dire==".") | 910 | if(dire==".") |
910 | dire = QPEApplication::documentDir(); | 911 | dire = QPEApplication::documentDir(); |
911 | QString str; | 912 | QString str; |
912 | if( !featureAutoSave) | 913 | if( !featureAutoSave) { |
913 | { | ||
914 | str = OFileDialog::getSaveFileName( 2, | 914 | str = OFileDialog::getSaveFileName( 2, |
915 | dire, | 915 | dire, |
916 | filee, map); | 916 | filee, map); |
917 | } | 917 | } else |
918 | else | ||
919 | str=currentFileName; | 918 | str=currentFileName; |
919 | |||
920 | if(!str.isEmpty()) { | 920 | if(!str.isEmpty()) { |
921 | QString fileNm=str; | 921 | QString fileNm=str; |
922 | 922 | ||
923 | qDebug("saving filename "+fileNm); | 923 | qDebug("saving filename "+fileNm); |
924 | QFileInfo fi(fileNm); | 924 | QFileInfo fi(fileNm); |
925 | currentFileName=fi.fileName(); | 925 | currentFileName=fi.fileName(); |
@@ -935,12 +935,13 @@ bool TextEdit::saveAs() { | |||
935 | qDebug("Saving file as "+currentFileName); | 935 | qDebug("Saving file as "+currentFileName); |
936 | doc->setName( currentFileName); | 936 | doc->setName( currentFileName); |
937 | updateCaption( currentFileName); | 937 | updateCaption( currentFileName); |
938 | 938 | ||
939 | FileManager fm; | 939 | FileManager fm; |
940 | if ( !fm.saveFile( *doc, rt ) ) { | 940 | if ( !fm.saveFile( *doc, rt ) ) { |
941 | QMessageBox::message(tr("Text Edit"),tr("Save Failed")); | ||
941 | return false; | 942 | return false; |
942 | } | 943 | } |
943 | 944 | ||
944 | if( filePerms ) { | 945 | if( filePerms ) { |
945 | filePermissions *filePerm; | 946 | filePermissions *filePerm; |
946 | filePerm = new filePermissions(this, | 947 | filePerm = new filePermissions(this, |