-rw-r--r-- | core/apps/textedit/textedit.cpp | 38 | ||||
-rw-r--r-- | core/apps/textedit/textedit.h | 3 |
2 files changed, 35 insertions, 6 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 03f3a1e..78c4d8a 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -166,7 +166,7 @@ public: | |||
166 | } | 166 | } |
167 | 167 | ||
168 | //public slots: | ||
169 | void find( const QString &txt, bool caseSensitive, | 168 | void find( const QString &txt, bool caseSensitive, |
170 | bool backwards ); | 169 | bool backwards ); |
170 | //public slots: | ||
171 | /* | 171 | /* |
172 | signals: | 172 | signals: |
@@ -241,5 +241,6 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) | |||
241 | { | 241 | { |
242 | doc = 0; | 242 | doc = 0; |
243 | 243 | edited=FALSE; | |
244 | edited1=FALSE; | ||
244 | setToolBarsMovable( FALSE ); | 245 | setToolBarsMovable( FALSE ); |
245 | 246 | ||
@@ -401,4 +402,5 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) | |||
401 | editor->setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 402 | editor->setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
402 | editorStack->addWidget( editor, get_unique_id() ); | 403 | editorStack->addWidget( editor, get_unique_id() ); |
404 | connect( editor, SIGNAL( textChanged() ), this, SLOT( editorChanged() ) ); | ||
403 | 405 | ||
404 | resize( 200, 300 ); | 406 | resize( 200, 300 ); |
@@ -557,5 +559,8 @@ void TextEdit::newFileOpen() | |||
557 | } | 559 | } |
558 | delete browseForFiles; | 560 | delete browseForFiles; |
559 | editor->setEdited( true ); | 561 | editor->setEdited( FALSE); |
562 | edited1=FALSE; | ||
563 | edited=FALSE; | ||
564 | setCaption(caption().right(caption().length()-1)); | ||
560 | } | 565 | } |
561 | 566 | ||
@@ -685,5 +690,9 @@ void TextEdit::openFile( const DocLnk &f ) | |||
685 | doc = new DocLnk(f); | 690 | doc = new DocLnk(f); |
686 | editor->setText(txt); | 691 | editor->setText(txt); |
687 | editor->setEdited( false); | 692 | editor->setEdited( FALSE); |
693 | edited1=FALSE; | ||
694 | edited=FALSE; | ||
695 | setCaption(caption().right(caption().length()-1)); | ||
696 | |||
688 | qDebug("openFile doclnk "+currentFileName); | 697 | qDebug("openFile doclnk "+currentFileName); |
689 | doc->setName(currentFileName); | 698 | doc->setName(currentFileName); |
@@ -732,5 +741,9 @@ bool TextEdit::save() | |||
732 | return false; | 741 | return false; |
733 | } | 742 | } |
734 | editor->setEdited( false ); | 743 | editor->setEdited( FALSE); |
744 | edited1=FALSE; | ||
745 | edited=FALSE; | ||
746 | setCaption(caption().right(caption().length()-1)); | ||
747 | |||
735 | 748 | ||
736 | chmod( file.latin1(), mode); | 749 | chmod( file.latin1(), mode); |
@@ -814,5 +827,5 @@ bool TextEdit::saveAs() | |||
814 | filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)fileNm); | 827 | filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)fileNm); |
815 | filePerm->exec(); | 828 | filePerm->exec(); |
816 | editor->setEdited( false ); | 829 | |
817 | if( filePerm) | 830 | if( filePerm) |
818 | delete filePerm; | 831 | delete filePerm; |
@@ -820,4 +833,9 @@ bool TextEdit::saveAs() | |||
820 | } | 833 | } |
821 | } | 834 | } |
835 | editor->setEdited( FALSE); | ||
836 | edited1=FALSE; | ||
837 | edited=FALSE; | ||
838 | if(caption().left(1)=="*") | ||
839 | setCaption(caption().right(caption().length()-1)); | ||
822 | 840 | ||
823 | if(fileSaveDlg) | 841 | if(fileSaveDlg) |
@@ -939,2 +957,10 @@ void TextEdit::changeStartConfig( bool b ) { | |||
939 | update(); | 957 | update(); |
940 | } | 958 | } |
959 | |||
960 | void TextEdit::editorChanged() { | ||
961 | if(editor->edited() && edited && !edited1) { | ||
962 | setCaption( "*"+caption()); | ||
963 | edited1=TRUE; | ||
964 | } | ||
965 | edited=TRUE; | ||
966 | } | ||
diff --git a/core/apps/textedit/textedit.h b/core/apps/textedit/textedit.h index fb58738..e7e20e3 100644 --- a/core/apps/textedit/textedit.h +++ b/core/apps/textedit/textedit.h | |||
@@ -55,5 +55,8 @@ public: | |||
55 | QPopupMenu *font; | 55 | QPopupMenu *font; |
56 | QAction *nStart; | 56 | QAction *nStart; |
57 | bool edited, edited1; | ||
57 | void openFile( const QString & ); | 58 | void openFile( const QString & ); |
59 | public slots: | ||
60 | void editorChanged(); | ||
58 | 61 | ||
59 | protected: | 62 | protected: |