author | llornkcor <llornkcor> | 2002-06-29 00:51:23 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-06-29 00:51:23 (UTC) |
commit | a9e336965e1cccb41d3e9f5c31168c85cf4e7d36 (patch) (unidiff) | |
tree | bf902af67089de044833da378d1f491574ac4965 | |
parent | 9cc6f3de75b884f338f708ff03900b197f281802 (diff) | |
download | opie-a9e336965e1cccb41d3e9f5c31168c85cf4e7d36.zip opie-a9e336965e1cccb41d3e9f5c31168c85cf4e7d36.tar.gz opie-a9e336965e1cccb41d3e9f5c31168c85cf4e7d36.tar.bz2 |
on your way out, save dialog
-rw-r--r-- | core/apps/textedit/textedit.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index ea27e1b..40ea501 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -783,35 +783,44 @@ bool TextEdit::saveAs() | |||
783 | docname = docname.mid( 1 ); | 783 | docname = docname.mid( 1 ); |
784 | docname.replace( QRegExp("/"), "_" ); | 784 | docname.replace( QRegExp("/"), "_" ); |
785 | // cut the length. filenames longer than that don't make sense and something goes wrong when they get too long. | 785 | // cut the length. filenames longer than that don't make sense and something goes wrong when they get too long. |
786 | if ( docname.length() > 40 ) | 786 | if ( docname.length() > 40 ) |
787 | docname = docname.left(40); | 787 | docname = docname.left(40); |
788 | if ( docname.isEmpty() ) | 788 | if ( docname.isEmpty() ) |
789 | docname = tr("Unnamed"); | 789 | docname = tr("Unnamed"); |
790 | doc->setName(docname); | 790 | doc->setName(docname); |
791 | currentFileName=docname; | 791 | currentFileName=docname; |
792 | } | 792 | } |
793 | } | 793 | } |
794 | 794 | ||
795 | 795 | /* | |
796 | // QString str = OFileDialog::getSaveFileName( 2,"/");//,"", "*", this ); | 796 | QMap<QString, QStringList> map; |
797 | // if(!str.isEmpty() ) { | 797 | map.insert(tr("All"), QStringList() ); |
798 | // openFile( str ); | 798 | QStringList text; |
799 | text << "text/*"; | ||
800 | map.insert(tr("Text"), text ); | ||
801 | text << "*"; | ||
802 | map.insert(tr("All"), text ); | ||
803 | QString str = OFileDialog::getSaveFileName( 2,"/", QString::null, map); | ||
804 | if(!str.isEmpty() ) { | ||
805 | QString fileNm=str; | ||
806 | */ | ||
799 | 807 | ||
800 | fileSaveDlg=new fileSaver(this,tr("Save File As?"),TRUE, 0, currentFileName); | 808 | fileSaveDlg=new fileSaver(this,tr("Save File As?"),TRUE, 0, currentFileName); |
801 | qDebug("wanna save filename "+currentFileName); | 809 | qDebug("wanna save filename "+currentFileName); |
802 | fileSaveDlg->exec(); | 810 | fileSaveDlg->exec(); |
803 | if( fileSaveDlg->result() == 1 ) { | 811 | if( fileSaveDlg->result() == 1 ) { |
804 | QString fileNm=fileSaveDlg->selectedFileName; | 812 | QString fileNm=fileSaveDlg->selectedFileName; |
805 | // QString fileNm=srt; | 813 | |
814 | |||
806 | qDebug("saving filename "+fileNm); | 815 | qDebug("saving filename "+fileNm); |
807 | QFileInfo fi(fileNm); | 816 | QFileInfo fi(fileNm); |
808 | currentFileName=fi.fileName(); | 817 | currentFileName=fi.fileName(); |
809 | if(doc) { | 818 | if(doc) { |
810 | // QString file = doc->file(); | 819 | // QString file = doc->file(); |
811 | // doc->removeFiles(); | 820 | // doc->removeFiles(); |
812 | delete doc; | 821 | delete doc; |
813 | DocLnk nf; | 822 | DocLnk nf; |
814 | nf.setType("text/plain"); | 823 | nf.setType("text/plain"); |
815 | nf.setFile( fileNm); | 824 | nf.setFile( fileNm); |
816 | doc = new DocLnk(nf); | 825 | doc = new DocLnk(nf); |
817 | // editor->setText(rt); | 826 | // editor->setText(rt); |