Mercurial > hg > octave-terminal
changeset 13546:5ef33f99a078
Command get inserted by double clicking in the command history again.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Wed, 27 Jul 2011 00:34:28 +0200 |
parents | ffc2e1d1ad5f |
children | 7d106550be8f |
files | gui/src/HistoryDockWidget.cpp gui/src/HistoryDockWidget.h gui/src/MainWindow.cpp |
diffstat | 3 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/src/HistoryDockWidget.cpp +++ b/gui/src/HistoryDockWidget.cpp @@ -46,6 +46,7 @@ widget ()->setLayout (layout); connect (m_filterLineEdit, SIGNAL (textEdited (QString)), this, SLOT (setFilter (QString))); + connect (m_historyListView, SIGNAL (doubleClicked (QModelIndex)), this, SLOT (handleDoubleClick (QModelIndex))); } void @@ -55,9 +56,15 @@ } void -HistoryDockWidget::setFilter(QString filter) +HistoryDockWidget::setFilter (QString filter) { m_historyListView->setEnabled (false); m_sortFilterProxyModel.setFilterWildcard ( QString ("*%1*").arg (filter)); m_historyListView->setEnabled (true); } + +void +HistoryDockWidget::handleDoubleClick (QModelIndex modelIndex) +{ + emit commandDoubleClicked (modelIndex.data().toString()); +}
--- a/gui/src/HistoryDockWidget.h +++ b/gui/src/HistoryDockWidget.h @@ -37,8 +37,13 @@ /** Tells the widget to notice settings that are probably new. */ void noticeSettings (); void setFilter (QString filter); + signals: void information (QString message); + void commandDoubleClicked (QString command); + +private slots: + void handleDoubleClick (QModelIndex modelIndex); private: void construct ();
--- a/gui/src/MainWindow.cpp +++ b/gui/src/MainWindow.cpp @@ -284,6 +284,7 @@ connect (m_filesDockWidget, SIGNAL (openFile (QString)), this, SLOT (handleOpenFileRequest (QString))); connect (m_historyDockWidget, SIGNAL (information (QString)), this, SLOT (reportStatusMessage (QString))); + connect (m_historyDockWidget, SIGNAL (commandDoubleClicked (QString)), this, SLOT (handleCommandDoubleClicked (QString))); connect (saveWorkspaceAction, SIGNAL (triggered ()), this, SLOT (handleSaveWorkspaceRequest ())); connect (loadWorkspaceAction, SIGNAL (triggered ()), this, SLOT (handleLoadWorkspaceRequest ())); connect (clearWorkspaceAction, SIGNAL (triggered ()), this, SLOT (handleClearWorkspaceRequest ()));