author | llornkcor <llornkcor> | 2002-03-19 13:29:51 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-19 13:29:51 (UTC) |
commit | f6b540e14072d9cfcd5f4a787dcd9039fae7011b (patch) (side-by-side diff) | |
tree | d0505f71c851a7156862c0fb67c8c640f8c49205 | |
parent | 3ed6f60e2eb329edda0d3786c58009d06c7e5b18 (diff) | |
download | opie-f6b540e14072d9cfcd5f4a787dcd9039fae7011b.zip opie-f6b540e14072d9cfcd5f4a787dcd9039fae7011b.tar.gz opie-f6b540e14072d9cfcd5f4a787dcd9039fae7011b.tar.bz2 |
searchbar was being shown when text opened from setDocument
-rw-r--r-- | core/apps/textedit/textedit.cpp | 7 | ||||
-rw-r--r-- | core/apps/textedit/textedit.h | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index f56d5d3..1a1b186 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -360,33 +360,32 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) 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() ) ); a->addTo( edit ); searchBar->hide(); - editor = new QpeEditor( this ); setCentralWidget( editor ); editor->setFrameStyle( QFrame::Panel | QFrame::Sunken ); connect( editor, SIGNAL( textChanged() ), this, SLOT( editorChanged() ) ); resize( 200, 300 ); // setFontSize(defsize,TRUE); FontDatabase fdb; QFont defaultFont=editor->font(); QFontInfo fontInfo(defaultFont); cfg.setGroup("Font"); QString family = cfg.readEntry("Family", fontInfo.family()); QString style = cfg.readEntry("Style", fdb.styleString(defaultFont)); int i_size = cfg.readNumEntry("Size", fontInfo.pointSize()/10); @@ -508,32 +507,37 @@ void TextEdit::fileOpen() fileTemp.right( fileTemp.length()-5); QString fileName = fileTemp; if( fileName != "Unnamed" || fileName != "Empty Text" ) { currentFileName = fileName; 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)); + doSearchBar(); +} + +void TextEdit::doSearchBar() +{ 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()), @@ -836,32 +840,33 @@ void TextEdit::updateCaption( const QString &name ) } } void TextEdit::setDocument(const QString& fileref) { bFromDocView = TRUE; qDebug("setDocument "+fileref); bFromDocView = TRUE; if(fileref.find(".desktop",0,TRUE) == -1) { openFile(fileref); } else { openFile(DocLnk(fileref)); } editor->setEdited(TRUE); edited1=FALSE; edited=TRUE; + doSearchBar(); } void TextEdit::closeEvent( QCloseEvent *e ) { bFromDocView = FALSE; e->accept(); } void TextEdit::accept() { QString file = doc->file(); if (file.find("_.txt",0,TRUE) ==-1) save(); else { QFile(file).remove(); } diff --git a/core/apps/textedit/textedit.h b/core/apps/textedit/textedit.h index a70b581..70cf068 100644 --- a/core/apps/textedit/textedit.h +++ b/core/apps/textedit/textedit.h @@ -48,33 +48,33 @@ class QPopupMenu; class TextEdit : public QMainWindow { Q_OBJECT public: TextEdit( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); ~TextEdit(); QPopupMenu *font; QAction *nStart; bool edited, edited1; void openFile( const QString & ); public slots: void editorChanged(); protected: void closeEvent( QCloseEvent *e ); - + void doSearchBar(); private slots: void setDocument(const QString&); void changeFont(); void fileNew(); void fileRevert(); void fileOpen(); void changeStartConfig(bool); bool save(); bool saveAs(); void cleanUp(); void editCut(); void editCopy(); void editPaste(); void editFind(); |