summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-11-09 23:21:57 (UTC)
committer llornkcor <llornkcor>2002-11-09 23:21:57 (UTC)
commitdc4e5e557d8a506eb1461ff97e1fdcc7a9a91264 (patch) (unidiff)
tree19a4cd404200d3feee9f0b1654dc3b4712768dfd
parent0c81c6287771d5ad416c2ddf0ae32ad5ce18c116 (diff)
downloadopie-dc4e5e557d8a506eb1461ff97e1fdcc7a9a91264.zip
opie-dc4e5e557d8a506eb1461ff97e1fdcc7a9a91264.tar.gz
opie-dc4e5e557d8a506eb1461ff97e1fdcc7a9a91264.tar.bz2
caption fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 1c3b393..e978fa4 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -908,98 +908,98 @@ bool TextEdit::saveAs() {
908 908
909 FileManager fm; 909 FileManager fm;
910 if ( !fm.saveFile( *doc, rt ) ) { 910 if ( !fm.saveFile( *doc, rt ) ) {
911 return false; 911 return false;
912 } 912 }
913 913
914 if( filePerms ) { 914 if( filePerms ) {
915 filePermissions *filePerm; 915 filePermissions *filePerm;
916 filePerm = new filePermissions(this, 916 filePerm = new filePermissions(this,
917 tr("Permissions"),true, 917 tr("Permissions"),true,
918 0,(const QString &)fileNm); 918 0,(const QString &)fileNm);
919 filePerm->showMaximized(); 919 filePerm->showMaximized();
920 filePerm->exec(); 920 filePerm->exec();
921 921
922 if( filePerm) 922 if( filePerm)
923 delete filePerm; 923 delete filePerm;
924 } 924 }
925// } 925// }
926 editor->setEdited( false); 926 editor->setEdited( false);
927 edited1 = false; 927 edited1 = false;
928 edited = false; 928 edited = false;
929 if(caption().left(1)=="*") 929 if(caption().left(1)=="*")
930 setCaption(caption().right(caption().length()-1)); 930 setCaption(caption().right(caption().length()-1));
931 931
932 return true; 932 return true;
933 } 933 }
934 qDebug("returning false"); 934 qDebug("returning false");
935 return false; 935 return false;
936} //end saveAs 936} //end saveAs
937 937
938void TextEdit::clear() { 938void TextEdit::clear() {
939 delete doc; 939 delete doc;
940 doc = 0; 940 doc = 0;
941 editor->clear(); 941 editor->clear();
942} 942}
943 943
944void TextEdit::updateCaption( const QString &name ) { 944void TextEdit::updateCaption( const QString &name ) {
945 945
946 if ( name.isEmpty() ) 946 if ( name.isEmpty() )
947 setCaption( tr("Text Editor") ); 947 setCaption( tr("Text Editor") );
948 else { 948 else {
949 QString s = name; 949 QString s = name;
950 if ( s.isNull() ) 950 if ( s.isNull() )
951 s = doc->name(); 951 s = doc->name();
952 if ( s.isEmpty() ) { 952 if ( s.isEmpty() ) {
953 s = tr( "Unnamed" ); 953 s = tr( "Unnamed" );
954 currentFileName=s; 954 currentFileName=s;
955 } 955 }
956 if(s.left(1) == "/") 956// if(s.left(1) == "/")
957 s = s.right(s.length()-1); 957// s = s.right(s.length()-1);
958 setCaption( s + " - " + tr("Text Editor") ); 958 setCaption( s + " - " + tr("Text Editor") );
959 } 959 }
960} 960}
961 961
962void TextEdit::setDocument(const QString& fileref) { 962void TextEdit::setDocument(const QString& fileref) {
963 if(fileref != "Unnamed") { 963 if(fileref != "Unnamed") {
964 currentFileName=fileref; 964 currentFileName=fileref;
965 qDebug("setDocument"); 965 qDebug("setDocument");
966 QFileInfo fi(currentFileName); 966 QFileInfo fi(currentFileName);
967 qDebug("basename:"+fi.baseName()+": current filenmame "+currentFileName); 967 qDebug("basename:"+fi.baseName()+": current filenmame "+currentFileName);
968 if(fi.baseName().left(1) == "") { 968 if(fi.baseName().left(1) == "") {
969// openDotFile(currentFileName); 969// openDotFile(currentFileName);
970 } else { 970 } else {
971 qDebug("setDoc open"); 971 qDebug("setDoc open");
972 bFromDocView = true; 972 bFromDocView = true;
973 openFile(fileref); 973 openFile(fileref);
974 editor->setEdited(true); 974 editor->setEdited(true);
975 edited1=false; 975 edited1=false;
976 edited=true; 976 edited=true;
977 977
978// doSearchBar(); 978// doSearchBar();
979 } 979 }
980 } 980 }
981 updateCaption( currentFileName); 981 updateCaption( currentFileName);
982} 982}
983 983
984void TextEdit::changeFont() { 984void TextEdit::changeFont() {
985 QDialog *d = new QDialog ( this, "FontDialog", true ); 985 QDialog *d = new QDialog ( this, "FontDialog", true );
986 d-> setCaption ( tr( "Choose font" )); 986 d-> setCaption ( tr( "Choose font" ));
987 QBoxLayout *lay = new QVBoxLayout ( d ); 987 QBoxLayout *lay = new QVBoxLayout ( d );
988 OFontSelector *ofs = new OFontSelector ( true, d ); 988 OFontSelector *ofs = new OFontSelector ( true, d );
989 lay-> addWidget ( ofs ); 989 lay-> addWidget ( ofs );
990 ofs-> setSelectedFont ( editor-> font ( )); 990 ofs-> setSelectedFont ( editor-> font ( ));
991 991
992 d-> showMaximized ( ); 992 d-> showMaximized ( );
993 if ( d-> exec ( ) == QDialog::Accepted ) 993 if ( d-> exec ( ) == QDialog::Accepted )
994 editor-> setFont ( ofs-> selectedFont ( )); 994 editor-> setFont ( ofs-> selectedFont ( ));
995 delete d; 995 delete d;
996 996
997} 997}
998 998
999void TextEdit::editDelete() { 999void TextEdit::editDelete() {
1000 switch ( QMessageBox::warning(this,tr("Text Editor"),tr("Do you really want<BR>to <B>delete</B> the current file\nfrom the disk?<BR>This is <B>irreversable!!</B>"),tr("Yes"),tr("No"),0,0,1) ) { 1000 switch ( QMessageBox::warning(this,tr("Text Editor"),tr("Do you really want<BR>to <B>delete</B> the current file\nfrom the disk?<BR>This is <B>irreversable!!</B>"),tr("Yes"),tr("No"),0,0,1) ) {
1001 case 0: 1001 case 0:
1002 if(doc) { 1002 if(doc) {
1003 doc->removeFiles(); 1003 doc->removeFiles();
1004 clear(); 1004 clear();
1005 setCaption( tr("Text Editor") ); 1005 setCaption( tr("Text Editor") );