author | kergoth <kergoth> | 2003-08-09 17:42:14 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 17:42:14 (UTC) |
commit | 1ab4ca95e4d2cf24d32b38c9031cb6076351e730 (patch) (unidiff) | |
tree | 644d196b01c7f280981bd17da23c7592a18e5643 /core/apps/textedit/textedit.cpp | |
parent | ec14206f63dd93e9fb84c76cbc76fc1968637590 (diff) | |
download | opie-1ab4ca95e4d2cf24d32b38c9031cb6076351e730.zip opie-1ab4ca95e4d2cf24d32b38c9031cb6076351e730.tar.gz opie-1ab4ca95e4d2cf24d32b38c9031cb6076351e730.tar.bz2 |
Merge from BRANCH_1_0
Diffstat (limited to 'core/apps/textedit/textedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/textedit/textedit.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 6f96574..1c95a97 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -568,22 +568,20 @@ void TextEdit::fileNew() { | |||
568 | 568 | ||
569 | void TextEdit::fileOpen() { | 569 | void TextEdit::fileOpen() { |
570 | Config cfg("TextEdit"); | 570 | Config cfg("TextEdit"); |
571 | cfg. setGroup ( "View" ); | 571 | cfg. setGroup ( "View" ); |
572 | QString dir = cfg.readEntry("LastOpenDirectory", QPEApplication::documentDir()); | ||
573 | QMap<QString, QStringList> map; | 572 | QMap<QString, QStringList> map; |
574 | map.insert(tr("All"), QStringList() ); | 573 | map.insert(tr("All"), QStringList() ); |
575 | QStringList text; | 574 | QStringList text; |
576 | text << "text/*"; | 575 | text << "text/*"; |
577 | map.insert(tr("Text"), text ); | 576 | map.insert(tr("Text"), text ); |
578 | text << "*"; | 577 | text << "*"; |
579 | map.insert(tr("All"), text ); | 578 | map.insert(tr("All"), text ); |
580 | QString str = OFileDialog::getOpenFileName( 2, | 579 | QString str = OFileDialog::getOpenFileName( 2, |
581 | dir , | 580 | QString::null , |
582 | QString::null, map); | 581 | QString::null, map); |
583 | if( !str.isEmpty() && QFile(str).exists() && !QFileInfo(str).isDir() ) | 582 | if( !str.isEmpty() && QFile(str).exists() && !QFileInfo(str).isDir() ) |
584 | { | 583 | { |
585 | cfg.writeEntry("LastOpenDirectory", QFileInfo(str).dirPath(false)); | ||
586 | openFile( str ); | 584 | openFile( str ); |
587 | } | 585 | } |
588 | else | 586 | else |
589 | updateCaption(); | 587 | updateCaption(); |
@@ -975,9 +973,9 @@ void TextEdit::updateCaption( const QString &name ) { | |||
975 | currentFileName=s; | 973 | currentFileName=s; |
976 | } | 974 | } |
977 | // if(s.left(1) == "/") | 975 | // if(s.left(1) == "/") |
978 | // s = s.right(s.length()-1); | 976 | // s = s.right(s.length()-1); |
979 | setCaption( s + " - " + tr("Text Editor") ); | 977 | setCaption( tr("%1 - Text Editor").arg( s ) ); |
980 | } | 978 | } |
981 | } | 979 | } |
982 | 980 | ||
983 | void TextEdit::setDocument(const QString& fileref) { | 981 | void TextEdit::setDocument(const QString& fileref) { |
@@ -1021,9 +1019,9 @@ void TextEdit::changeFont() { | |||
1021 | void TextEdit::editDelete() { | 1019 | void TextEdit::editDelete() { |
1022 | switch ( QMessageBox::warning(this,tr("Text Editor"), | 1020 | switch ( QMessageBox::warning(this,tr("Text Editor"), |
1023 | tr("Do you really want<BR>to <B>delete</B> " | 1021 | tr("Do you really want<BR>to <B>delete</B> " |
1024 | "the current file\nfrom the disk?<BR>This is " | 1022 | "the current file\nfrom the disk?<BR>This is " |
1025 | "<B>irreversable!!</B>"), | 1023 | "<B>irreversable!</B>"), |
1026 | tr("Yes"),tr("No"),0,0,1) ) { | 1024 | tr("Yes"),tr("No"),0,0,1) ) { |
1027 | case 0: | 1025 | case 0: |
1028 | if(doc) { | 1026 | if(doc) { |
1029 | doc->removeFiles(); | 1027 | doc->removeFiles(); |