summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-02-25 05:24:43 (UTC)
committer llornkcor <llornkcor>2002-02-25 05:24:43 (UTC)
commit160308bc29cf01582775f73e1aca13e82c65bffd (patch) (unidiff)
tree67ebc478e5eef47e881f3f4ea330633a67df0827
parent1bebd27631a6c9d1ab967cbb32dd4e796b3b0402 (diff)
downloadopie-160308bc29cf01582775f73e1aca13e82c65bffd.zip
opie-160308bc29cf01582775f73e1aca13e82c65bffd.tar.gz
opie-160308bc29cf01582775f73e1aca13e82c65bffd.tar.bz2
fixed open setDoc bug
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/Makefile.in6
-rw-r--r--core/apps/textedit/textedit.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/core/apps/textedit/Makefile.in b/core/apps/textedit/Makefile.in
index fa394d6..234965b 100644
--- a/core/apps/textedit/Makefile.in
+++ b/core/apps/textedit/Makefile.in
@@ -39,100 +39,98 @@ OBJECTS = main.o \
39 fileBrowser.o \ 39 fileBrowser.o \
40 fontDialog.o \ 40 fontDialog.o \
41 fileSaver.o \ 41 fileSaver.o \
42 filePermissions.o 42 filePermissions.o
43INTERFACES = 43INTERFACES =
44UICDECLS = 44UICDECLS =
45UICIMPLS = 45UICIMPLS =
46 SRCMOC =moc_textedit.cpp \ 46 SRCMOC =moc_textedit.cpp \
47 moc_fileBrowser.cpp \ 47 moc_fileBrowser.cpp \
48 moc_fontDialog.cpp \ 48 moc_fontDialog.cpp \
49 moc_fileSaver.cpp \ 49 moc_fileSaver.cpp \
50 moc_filePermissions.cpp 50 moc_filePermissions.cpp
51 OBJMOC =moc_textedit.o \ 51 OBJMOC =moc_textedit.o \
52 moc_fileBrowser.o \ 52 moc_fileBrowser.o \
53 moc_fontDialog.o \ 53 moc_fontDialog.o \
54 moc_fileSaver.o \ 54 moc_fileSaver.o \
55 moc_filePermissions.o 55 moc_filePermissions.o
56 56
57 57
58####### Implicit rules 58####### Implicit rules
59 59
60.SUFFIXES: .cpp .cxx .cc .C .c 60.SUFFIXES: .cpp .cxx .cc .C .c
61 61
62.cpp.o: 62.cpp.o:
63 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 63 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
64 64
65.cxx.o: 65.cxx.o:
66 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 66 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
67 67
68.cc.o: 68.cc.o:
69 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 69 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
70 70
71.C.o: 71.C.o:
72 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 72 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
73 73
74.c.o: 74.c.o:
75 $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< 75 $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
76 76
77####### Build rules 77####### Build rules
78 78
79 79
80all: $(DESTDIR)$(TARGET) 80all: $(DESTDIR)$(TARGET)
81 81
82$(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) 82$(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS)
83 $(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) 83 $(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)
84 84
85moc: $(SRCMOC) 85moc: $(SRCMOC)
86 86
87tmake: Makefile.in 87tmake:
88 88 tmake textedit.pro
89Makefile.in: textedit.pro
90 tmake textedit.pro -o Makefile.in
91 89
92clean: 90clean:
93 -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) 91 -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS)
94 -rm -f *~ core 92 -rm -f *~ core
95 -rm -f allmoc.cpp 93 -rm -f allmoc.cpp
96 94
97####### Extension Modules 95####### Extension Modules
98 96
99listpromodules: 97listpromodules:
100 @echo 98 @echo
101 99
102listallmodules: 100listallmodules:
103 @echo 101 @echo
104 102
105listaddonpromodules: 103listaddonpromodules:
106 @echo 104 @echo
107 105
108listaddonentmodules: 106listaddonentmodules:
109 @echo 107 @echo
110 108
111 109
112REQUIRES= 110REQUIRES=
113 111
114####### Sub-libraries 112####### Sub-libraries
115 113
116 114
117###### Combined headers 115###### Combined headers
118 116
119 117
120 118
121####### Compile 119####### Compile
122 120
123main.o: main.cpp \ 121main.o: main.cpp \
124 textedit.h \ 122 textedit.h \
125 fileBrowser.h \ 123 fileBrowser.h \
126 fileSaver.h \ 124 fileSaver.h \
127 $(OPIEDIR)/include/qpe/filemanager.h \ 125 $(OPIEDIR)/include/qpe/filemanager.h \
128 $(OPIEDIR)/include/qpe/qpeapplication.h \ 126 $(OPIEDIR)/include/qpe/qpeapplication.h \
129 $(OPIEDIR)/include/qpedecoration_qws.h \ 127 $(OPIEDIR)/include/qpedecoration_qws.h \
130 $(OPIEDIR)/include/timestring.h 128 $(OPIEDIR)/include/timestring.h
131 129
132textedit.o: textedit.cpp \ 130textedit.o: textedit.cpp \
133 textedit.h \ 131 textedit.h \
134 fileBrowser.h \ 132 fileBrowser.h \
135 fileSaver.h \ 133 fileSaver.h \
136 $(OPIEDIR)/include/qpe/filemanager.h \ 134 $(OPIEDIR)/include/qpe/filemanager.h \
137 filePermissions.h \ 135 filePermissions.h \
138 fontDialog.h \ 136 fontDialog.h \
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 603f032..bc975f3 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -787,97 +787,99 @@ bool TextEdit::saveAs()
787 787
788 FileManager fm; 788 FileManager fm;
789 if ( !fm.saveFile( *doc, rt ) ) { 789 if ( !fm.saveFile( *doc, rt ) ) {
790 return false; 790 return false;
791 } 791 }
792 if( fileSaveDlg->filePermCheck->isChecked() ) { 792 if( fileSaveDlg->filePermCheck->isChecked() ) {
793 filePermissions *filePerm; 793 filePermissions *filePerm;
794 filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)fileNm); 794 filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)fileNm);
795 filePerm->exec(); 795 filePerm->exec();
796 editor->setEdited( false ); 796 editor->setEdited( false );
797 if( filePerm) 797 if( filePerm)
798 delete filePerm; 798 delete filePerm;
799 } 799 }
800 } 800 }
801 } 801 }
802 802
803 if(fileSaveDlg) 803 if(fileSaveDlg)
804 delete fileSaveDlg; 804 delete fileSaveDlg;
805 return true; 805 return true;
806} 806}
807 807
808void TextEdit::clear() 808void TextEdit::clear()
809{ 809{
810 delete doc; 810 delete doc;
811 doc = 0; 811 doc = 0;
812 editor->clear(); 812 editor->clear();
813} 813}
814 814
815void TextEdit::updateCaption( const QString &name ) 815void TextEdit::updateCaption( const QString &name )
816{ 816{
817 if ( !doc ) 817 if ( !doc )
818 setCaption( tr("Text Editor") ); 818 setCaption( tr("Text Editor") );
819 else { 819 else {
820 QString s = name; 820 QString s = name;
821 if ( s.isNull() ) 821 if ( s.isNull() )
822 s = doc->name(); 822 s = doc->name();
823 if ( s.isEmpty() ) { 823 if ( s.isEmpty() ) {
824 s = tr( "Unnamed" ); 824 s = tr( "Unnamed" );
825 currentFileName=s; 825 currentFileName=s;
826 } 826 }
827 827
828 setCaption( s + " - " + tr("Text Editor") ); 828 setCaption( s + " - " + tr("Text Editor") );
829 } 829 }
830} 830}
831 831
832void TextEdit::setDocument(const QString& fileref) 832void TextEdit::setDocument(const QString& fileref)
833{ 833{
834 bFromDocView = TRUE; 834 bFromDocView = TRUE;
835 openFile(DocLnk(fileref)); 835 openFile(fileref);
836// bFromDocView = TRUE;
837// openFile(DocLnk(fileref));
836// showEditTools(); 838// showEditTools();
837} 839}
838 840
839void TextEdit::closeEvent( QCloseEvent *e ) 841void TextEdit::closeEvent( QCloseEvent *e )
840{ 842{
841 if ( editorStack->visibleWidget() == fileSelector && !bFromDocView ) { 843 if ( editorStack->visibleWidget() == fileSelector && !bFromDocView ) {
842 e->ignore(); 844 e->ignore();
843 repaint(); 845 repaint();
844// fileRevert(); 846// fileRevert();
845 847
846 } else { 848 } else {
847 bFromDocView = FALSE; 849 bFromDocView = FALSE;
848 e->accept(); 850 e->accept();
849 } 851 }
850} 852}
851 853
852void TextEdit::accept() 854void TextEdit::accept()
853{ 855{
854 save(); 856 save();
855 close(); 857 close();
856// fileOpen(); //godamn thats obnoxious! lemme out!!! 858// fileOpen(); //godamn thats obnoxious! lemme out!!!
857} 859}
858 860
859void TextEdit::changeFont() { 861void TextEdit::changeFont() {
860 FontDatabase fdb; 862 FontDatabase fdb;
861 QFont defaultFont=editor->font(); 863 QFont defaultFont=editor->font();
862 QFontInfo fontInfo(defaultFont); 864 QFontInfo fontInfo(defaultFont);
863 Config cfg("TextEdit"); 865 Config cfg("TextEdit");
864 cfg.setGroup("Font"); 866 cfg.setGroup("Font");
865 QString family = cfg.readEntry("Family", fontInfo.family()); 867 QString family = cfg.readEntry("Family", fontInfo.family());
866 QString style = cfg.readEntry("Style", fdb.styleString(defaultFont)); 868 QString style = cfg.readEntry("Style", fdb.styleString(defaultFont));
867 int i_size = cfg.readNumEntry("Size", fontInfo.pointSize()/10); 869 int i_size = cfg.readNumEntry("Size", fontInfo.pointSize()/10);
868 QString charSet = cfg.readEntry("CharSet", QFont::encodingName( fontInfo.charSet()) ); 870 QString charSet = cfg.readEntry("CharSet", QFont::encodingName( fontInfo.charSet()) );
869 871
870 defaultFont = fdb.font(family,style,i_size,charSet); 872 defaultFont = fdb.font(family,style,i_size,charSet);
871 873
872 FontDialog *fontDlg; 874 FontDialog *fontDlg;
873 fontDlg=new FontDialog(this,"FontDialog",TRUE); 875 fontDlg=new FontDialog(this,"FontDialog",TRUE);
874 876
875 fontDlg->exec(); 877 fontDlg->exec();
876 878
877 QFont myFont=fontDlg->selectedFont; 879 QFont myFont=fontDlg->selectedFont;
878 editor->setFont( myFont); 880 editor->setFont( myFont);
879 delete fontDlg; 881 delete fontDlg;
880 882
881} 883}
882 884
883void TextEdit::editDelete() 885void TextEdit::editDelete()