-rw-r--r-- | core/apps/textedit/textedit.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 8b3c4c6..af427ac 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -952,50 +952,51 @@ void TextEdit::clear() { | |||
952 | void TextEdit::updateCaption( const QString &name ) { | 952 | void TextEdit::updateCaption( const QString &name ) { |
953 | 953 | ||
954 | if ( name.isEmpty() ) | 954 | if ( name.isEmpty() ) |
955 | setCaption( tr("Text Editor") ); | 955 | setCaption( tr("Text Editor") ); |
956 | else { | 956 | else { |
957 | QString s = name; | 957 | QString s = name; |
958 | if ( s.isNull() ) | 958 | if ( s.isNull() ) |
959 | s = doc->name(); | 959 | s = doc->name(); |
960 | if ( s.isEmpty() ) { | 960 | if ( s.isEmpty() ) { |
961 | s = tr( "Unnamed" ); | 961 | s = tr( "Unnamed" ); |
962 | currentFileName=s; | 962 | currentFileName=s; |
963 | } | 963 | } |
964 | // if(s.left(1) == "/") | 964 | // if(s.left(1) == "/") |
965 | // s = s.right(s.length()-1); | 965 | // s = s.right(s.length()-1); |
966 | setCaption( s + " - " + tr("Text Editor") ); | 966 | setCaption( s + " - " + tr("Text Editor") ); |
967 | } | 967 | } |
968 | } | 968 | } |
969 | 969 | ||
970 | void TextEdit::setDocument(const QString& fileref) { | 970 | void TextEdit::setDocument(const QString& fileref) { |
971 | if(fileref != "Unnamed") { | 971 | if(fileref != "Unnamed") { |
972 | currentFileName=fileref; | 972 | currentFileName=fileref; |
973 | qDebug("setDocument"); | 973 | qDebug("setDocument"); |
974 | QFileInfo fi(currentFileName); | 974 | QFileInfo fi(currentFileName); |
975 | qDebug("basename:"+fi.baseName()+": current filenmame "+currentFileName); | 975 | qDebug("basename:"+fi.baseName()+": current filenmame "+currentFileName); |
976 | if(fi.baseName().left(1) == "") { | 976 | if( (fi.baseName().left(1)).isEmpty() ) { |
977 | // openDotFile(currentFileName); | 977 | openDotFile(currentFileName); |
978 | |||
978 | } else { | 979 | } else { |
979 | qDebug("setDoc open"); | 980 | qDebug("setDoc open"); |
980 | bFromDocView = true; | 981 | bFromDocView = true; |
981 | openFile(fileref); | 982 | openFile(fileref); |
982 | editor->setEdited(true); | 983 | editor->setEdited(true); |
983 | edited1=false; | 984 | edited1=false; |
984 | edited=true; | 985 | edited=true; |
985 | // fromSetDocument=false; | 986 | // fromSetDocument=false; |
986 | // doSearchBar(); | 987 | // doSearchBar(); |
987 | } | 988 | } |
988 | } | 989 | } |
989 | updateCaption( currentFileName); | 990 | updateCaption( currentFileName); |
990 | } | 991 | } |
991 | 992 | ||
992 | void TextEdit::changeFont() { | 993 | void TextEdit::changeFont() { |
993 | QDialog *d = new QDialog ( this, "FontDialog", true ); | 994 | QDialog *d = new QDialog ( this, "FontDialog", true ); |
994 | d-> setCaption ( tr( "Choose font" )); | 995 | d-> setCaption ( tr( "Choose font" )); |
995 | QBoxLayout *lay = new QVBoxLayout ( d ); | 996 | QBoxLayout *lay = new QVBoxLayout ( d ); |
996 | OFontSelector *ofs = new OFontSelector ( true, d ); | 997 | OFontSelector *ofs = new OFontSelector ( true, d ); |
997 | lay-> addWidget ( ofs ); | 998 | lay-> addWidget ( ofs ); |
998 | ofs-> setSelectedFont ( editor-> font ( )); | 999 | ofs-> setSelectedFont ( editor-> font ( )); |
999 | 1000 | ||
1000 | d-> showMaximized ( ); | 1001 | d-> showMaximized ( ); |
1001 | if ( d-> exec ( ) == QDialog::Accepted ) | 1002 | if ( d-> exec ( ) == QDialog::Accepted ) |