Mercurial > hg > octave-terminal
changeset 13650:b93bfa9486ad
editor: bookmarks now toggled by F7 (bug #34066), menu entry for removing all bookmarks
author | ttl <ttl@justmail.de> |
---|---|
date | Tue, 23 Aug 2011 21:51:14 +0200 |
parents | 0a19410e88c0 |
children | 3d4f5cf3ca34 |
files | gui/src/FileEditorMdiSubWindow.cpp gui/src/FileEditorMdiSubWindow.h |
diffstat | 2 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/src/FileEditorMdiSubWindow.cpp +++ b/gui/src/FileEditorMdiSubWindow.cpp @@ -247,6 +247,12 @@ //m_terminalEmulation->setFocus (); } +// remove bookmarks +void +FileEditorMdiSubWindow::removeBookmark () +{ + m_editor->markerDeleteAll(MARKER_BOOKMARK); +} // toggle bookmark void FileEditorMdiSubWindow::toggleBookmark () @@ -408,6 +414,7 @@ QAction *nextBookmarkAction = new QAction (tr("&Next Bookmark"),m_toolBar); QAction *prevBookmarkAction = new QAction (tr("Pre&vious Bookmark"),m_toolBar); QAction *toggleBookmarkAction = new QAction (tr("Toggle &Bookmark"),m_toolBar); + QAction *removeBookmarkAction = new QAction (tr("&Remove All &Bookmarks"),m_toolBar); QAction *runAction = new QAction ( QIcon::fromTheme("media-play",style->standardIcon (QStyle::SP_MediaPlay)), tr("&Run File"), m_toolBar); @@ -430,7 +437,7 @@ runAction->setShortcut(Qt::Key_F5); nextBookmarkAction->setShortcut(Qt::Key_F2); prevBookmarkAction->setShortcut(Qt::SHIFT + Qt::Key_F2); - toggleBookmarkAction->setShortcut(Qt::CTRL + Qt::Key_F2); + toggleBookmarkAction->setShortcut(Qt::Key_F7); // toolbar m_toolBar->setIconSize(QSize(16,16)); // smaller icons (make configurable in user settings?) @@ -468,6 +475,7 @@ editMenu->addAction(toggleBookmarkAction); editMenu->addAction(nextBookmarkAction); editMenu->addAction(prevBookmarkAction); + editMenu->addAction(removeBookmarkAction); m_menuBar->addMenu(editMenu); QMenu *runMenu = new QMenu(tr("&Run"),m_menuBar); runMenu->addAction(runAction); @@ -496,6 +504,7 @@ connect (toggleBookmarkAction, SIGNAL (triggered ()), this, SLOT (toggleBookmark ())); connect (nextBookmarkAction, SIGNAL (triggered ()), this, SLOT (nextBookmark ())); connect (prevBookmarkAction, SIGNAL (triggered ()), this, SLOT (prevBookmark ())); + connect (removeBookmarkAction, SIGNAL (triggered ()), this, SLOT (removeBookmark ())); // TODO: Do we still need tool tips in the status bar? Tool tips are now // shown directly at the theme icons
--- a/gui/src/FileEditorMdiSubWindow.h +++ b/gui/src/FileEditorMdiSubWindow.h @@ -85,6 +85,7 @@ void handleMarginClicked(int line, int margin, Qt::KeyboardModifiers state); void handleCopyAvailable(bool enableCopy); void runFile(); + void removeBookmark (); void toggleBookmark (); void nextBookmark(); void prevBookmark();