summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/mainwindow/tinykate.cpp27
-rw-r--r--noncore/apps/tinykate/mainwindow/tinykate.h4
2 files changed, 23 insertions, 8 deletions
diff --git a/noncore/apps/tinykate/mainwindow/tinykate.cpp b/noncore/apps/tinykate/mainwindow/tinykate.cpp
index e808a2e..b1b88e9 100644
--- a/noncore/apps/tinykate/mainwindow/tinykate.cpp
+++ b/noncore/apps/tinykate/mainwindow/tinykate.cpp
@@ -90,4 +90,5 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
//EDIT ACTIONS
+ popup = new QPopupMenu( this );
bool useBigIcon = qApp->desktop()->size().width() > 330;
@@ -110,9 +111,16 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
editPaste->setIconSet( Opie::Core::OResource::loadPixmap( "paste", Opie::Core::OResource::SmallIcon ) );
- // Action for finding / replacing text
- editFindReplace = new QToolButton( 0 );
- editFindReplace->setUsesBigPixmap( useBigIcon );
- editFindReplace->setAutoRaise( true );
- editFindReplace->setIconSet( Opie::Core::OResource::loadPixmap( "find", Opie::Core::OResource::SmallIcon ) );
+ // Action for finding text
+ editFind = new QAction( tr( "Find..." ), Opie::Core::OResource::loadPixmap( "find", Opie::Core::OResource::SmallIcon ),
+ QString::null, 0, this, 0 );
+ editFind->addTo(popup);
+
+ // Action for replacing text
+ editReplace = new QAction( tr( "Replace..." ), QString::null, 0, this, 0 );
+ editReplace->addTo(popup);
+
+ // Action for going to a specific line
+ editGotoLine = new QAction( tr( "Goto Line..." ), QString::null, 0, this, 0 );
+ editGotoLine->addTo(popup);
// Action for undo
@@ -128,4 +136,6 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
editRedo->setIconSet( Opie::Core::OResource::loadPixmap( "redo", Opie::Core::OResource::SmallIcon ) );
+ mb->insertItem(tr("Edit"),popup);
+
//VIEW ACITONS
popup = new QPopupMenu( this );
@@ -146,5 +156,4 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
mb->insertItem( editCopy );
mb->insertItem( editPaste );
- mb->insertItem( editFindReplace );
mb->insertItem( editUndo );
mb->insertItem( editRedo );
@@ -247,4 +256,7 @@ void TinyKate::slotCurrentChanged( QWidget * view)
disconnect(editUndo,SIGNAL(clicked()),currentView,SLOT(undo()));
disconnect(editRedo,SIGNAL(clicked()),currentView,SLOT(redo()));
+ disconnect(editFind,SIGNAL(activated()),currentView,SLOT(find()));
+ disconnect(editReplace,SIGNAL(activated()),currentView,SLOT(replace()));
+ disconnect(editGotoLine,SIGNAL(activated()),currentView,SLOT(gotoLine()));
disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes()));
disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes()));
@@ -260,4 +272,7 @@ void TinyKate::slotCurrentChanged( QWidget * view)
connect(editUndo,SIGNAL(clicked()),currentView,SLOT(undo()));
connect(editRedo,SIGNAL(clicked()),currentView,SLOT(redo()));
+ connect(editFind,SIGNAL(activated()),currentView,SLOT(find()));
+ connect(editReplace,SIGNAL(activated()),currentView,SLOT(replace()));
+ connect(editGotoLine,SIGNAL(activated()),currentView,SLOT(gotoLine()));
connect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes()));
connect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes()));
diff --git a/noncore/apps/tinykate/mainwindow/tinykate.h b/noncore/apps/tinykate/mainwindow/tinykate.h
index 8eb344d..6e95d87 100644
--- a/noncore/apps/tinykate/mainwindow/tinykate.h
+++ b/noncore/apps/tinykate/mainwindow/tinykate.h
@@ -55,6 +55,6 @@ private:
bool shutDown;
- QToolButton *editCopy, *editCut, *editPaste, *editUndo, *editRedo, *editFindReplace;
- QAction *viewIncFontSizes, *viewDecFontSizes, *utilSettings;
+ QToolButton *editCopy, *editCut, *editPaste, *editUndo, *editRedo;
+ QAction *viewIncFontSizes, *viewDecFontSizes, *utilSettings, *editFind, *editReplace, *editGotoLine;
QPopupMenu *hlmenu;