summaryrefslogtreecommitdiff
path: root/core/apps/textedit/textedit.cpp
authorllornkcor <llornkcor>2002-03-10 00:09:03 (UTC)
committer llornkcor <llornkcor>2002-03-10 00:09:03 (UTC)
commit637cea2664defb5414a3897f70b616deba926ffe (patch) (side-by-side diff)
tree369bac70a10207db8e464dc591b7015cafb0624a /core/apps/textedit/textedit.cpp
parent1ad5936cfea54786379c58200d7bbf321dcd6185 (diff)
downloadopie-637cea2664defb5414a3897f70b616deba926ffe.zip
opie-637cea2664defb5414a3897f70b616deba926ffe.tar.gz
opie-637cea2664defb5414a3897f70b616deba926ffe.tar.bz2
added an asterik in the caption if the text is edited and unsaved
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
@@ -166,7 +166,7 @@ public:
}
- //public slots:
void find( const QString &txt, bool caseSensitive,
bool backwards );
+//public slots:
/*
signals:
@@ -241,5 +241,6 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
{
doc = 0;
-
+ edited=FALSE;
+ edited1=FALSE;
setToolBarsMovable( FALSE );
@@ -401,4 +402,5 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
editor->setFrameStyle( QFrame::Panel | QFrame::Sunken );
editorStack->addWidget( editor, get_unique_id() );
+ connect( editor, SIGNAL( textChanged() ), this, SLOT( editorChanged() ) );
resize( 200, 300 );
@@ -557,5 +559,8 @@ void TextEdit::newFileOpen()
}
delete browseForFiles;
- editor->setEdited( true );
+ editor->setEdited( FALSE);
+ edited1=FALSE;
+ edited=FALSE;
+ setCaption(caption().right(caption().length()-1));
}
@@ -685,5 +690,9 @@ void TextEdit::openFile( const DocLnk &f )
doc = new 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);
doc->setName(currentFileName);
@@ -732,5 +741,9 @@ bool TextEdit::save()
return false;
}
- editor->setEdited( false );
+ editor->setEdited( FALSE);
+ edited1=FALSE;
+ edited=FALSE;
+ setCaption(caption().right(caption().length()-1));
+
chmod( file.latin1(), mode);
@@ -814,5 +827,5 @@ bool TextEdit::saveAs()
filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)fileNm);
filePerm->exec();
- editor->setEdited( false );
+
if( filePerm)
delete filePerm;
@@ -820,4 +833,9 @@ bool TextEdit::saveAs()
}
}
+ editor->setEdited( FALSE);
+ edited1=FALSE;
+ edited=FALSE;
+ if(caption().left(1)=="*")
+ setCaption(caption().right(caption().length()-1));
if(fileSaveDlg)
@@ -939,2 +957,10 @@ void TextEdit::changeStartConfig( bool b ) {
update();
}
+
+void TextEdit::editorChanged() {
+ if(editor->edited() && edited && !edited1) {
+ setCaption( "*"+caption());
+ edited1=TRUE;
+ }
+ edited=TRUE;
+}