summaryrefslogtreecommitdiff
path: root/core/apps/textedit/textedit.cpp
Side-by-side diff
Diffstat (limited to 'core/apps/textedit/textedit.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp38
1 files changed, 32 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
@@ -167,5 +167,5 @@ public:
- //public slots:
void find( const QString &txt, bool caseSensitive,
bool backwards );
+//public slots:
/*
@@ -242,3 +242,4 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
doc = 0;
-
+ edited=FALSE;
+ edited1=FALSE;
setToolBarsMovable( FALSE );
@@ -402,2 +403,3 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
editorStack->addWidget( editor, get_unique_id() );
+ connect( editor, SIGNAL( textChanged() ), this, SLOT( editorChanged() ) );
@@ -558,3 +560,6 @@ void TextEdit::newFileOpen()
delete browseForFiles;
- editor->setEdited( true );
+ editor->setEdited( FALSE);
+ edited1=FALSE;
+ edited=FALSE;
+ setCaption(caption().right(caption().length()-1));
}
@@ -686,3 +691,7 @@ void TextEdit::openFile( const DocLnk &f )
editor->setText(txt);
- editor->setEdited( false);
+ editor->setEdited( FALSE);
+ edited1=FALSE;
+ edited=FALSE;
+ setCaption(caption().right(caption().length()-1));
+
qDebug("openFile doclnk "+currentFileName);
@@ -733,3 +742,7 @@ bool TextEdit::save()
}
- editor->setEdited( false );
+ editor->setEdited( FALSE);
+ edited1=FALSE;
+ edited=FALSE;
+ setCaption(caption().right(caption().length()-1));
+
@@ -815,3 +828,3 @@ bool TextEdit::saveAs()
filePerm->exec();
- editor->setEdited( false );
+
if( filePerm)
@@ -821,2 +834,7 @@ bool TextEdit::saveAs()
}
+ editor->setEdited( FALSE);
+ edited1=FALSE;
+ edited=FALSE;
+ if(caption().left(1)=="*")
+ setCaption(caption().right(caption().length()-1));
@@ -940 +958,9 @@ void TextEdit::changeStartConfig( bool b ) {
}
+
+void TextEdit::editorChanged() {
+ if(editor->edited() && edited && !edited1) {
+ setCaption( "*"+caption());
+ edited1=TRUE;
+ }
+ edited=TRUE;
+}