summaryrefslogtreecommitdiff
path: root/core/apps/textedit/textedit.cpp
Side-by-side diff
Diffstat (limited to 'core/apps/textedit/textedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 68ee1b4..d3f5fb4 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -347,25 +347,24 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
mb->insertItem( tr( "View" ), font );
searchBar = new QPEToolBar(this);
addToolBar( searchBar, "Search", QMainWindow::Top, TRUE );
searchBar->setHorizontalStretchable( TRUE );
searchEdit = new QLineEdit( searchBar, "searchEdit" );
searchBar->setStretchableWidget( searchEdit );
connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
this, SLOT( search() ) );
-
a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) );
a->addTo( searchBar );
a->addTo( edit );
a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
a->addTo( searchBar );
edit->insertSeparator();
a = new QAction( tr( "Delete" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( editDelete() ) );
@@ -410,25 +409,25 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
TextEdit::~TextEdit()
{
// save();
Config cfg("TextEdit");
cfg.setGroup("View");
QFont f = editor->font();
cfg.writeEntry("FontSize",f.pointSize());
cfg.writeEntry("Bold",f.bold());
cfg.writeEntry("Italic",f.italic());
cfg.writeEntry("Wrap",editor->wordWrap() == QMultiLineEdit::WidgetWidth);
- cfg.writeEntry( "FileView", viewSelection );
+ cfg.writeEntry( "FileView", viewSelection );
}
void TextEdit::zoomIn()
{
setFontSize(editor->font().pointSize()+1,FALSE);
}
void TextEdit::zoomOut()
{
setFontSize(editor->font().pointSize()-1,TRUE);
}
@@ -508,24 +507,28 @@ void TextEdit::fileOpen()
qDebug("please open "+currentFileName);
openFile(fileName );
}
}
viewSelection = browseForFiles->SelectionCombo->currentItem();
}
delete browseForFiles;
editor->setEdited( FALSE);
edited1=FALSE;
edited=FALSE;
if(caption().left(1)=="*")
setCaption(caption().right(caption().length()-1));
+ Config cfg("TextEdit");
+ cfg.setGroup("View");
+ if(cfg.readEntry("SearchBar","Closed") != "Opened")
+ searchBar->hide();
}
#if 0
void TextEdit::slotFind()
{
FindDialog frmFind( "Text Editor", this );
connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)),
editor, SLOT(slotDoFind( const QString&,bool,bool)));
//case sensitive, backwards, [category]
connect( editor, SIGNAL(notFound()),
@@ -562,36 +565,44 @@ void TextEdit::editCopy()
void TextEdit::editPaste()
{
#ifndef QT_NO_CLIPBOARD
editor->paste();
#endif
}
void TextEdit::editFind()
{
searchBar->show();
searchVisible = TRUE;
searchEdit->setFocus();
+ Config cfg("TextEdit");
+ cfg.setGroup("View");
+ cfg.writeEntry("SearchBar","Opened");
+
}
void TextEdit::findNext()
{
editor->find( searchEdit->text(), FALSE, FALSE );
}
void TextEdit::findClose()
{
searchVisible = FALSE;
searchBar->hide();
+ Config cfg("TextEdit");
+ cfg.setGroup("View");
+ cfg.writeEntry("SearchBar","Closed");
+ cfg.write();
}
void TextEdit::search()
{
editor->find( searchEdit->text(), FALSE, FALSE );
}
void TextEdit::newFile( const DocLnk &f )
{
DocLnk nf = f;
nf.setType("text/plain");
clear();