Mercurial > hg > octave-terminal
changeset 13532:fd87d6f7e185
Dock windows are now selectable form the menus.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Mon, 25 Jul 2011 23:44:05 +0200 |
parents | bb3676025b36 |
children | edaf8e72070e |
files | gui/src/MainWindow.cpp gui/src/MainWindow.h |
diffstat | 2 files changed, 29 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/src/MainWindow.cpp +++ b/gui/src/MainWindow.cpp @@ -28,6 +28,8 @@ #include "SettingsDialog.h" #include "cmd-edit.h" +#define VERSION_STRING "Octave GUI (0.6.0)" + MainWindow::MainWindow (QWidget * parent):QMainWindow (parent), m_isRunning (true) { @@ -233,10 +235,20 @@ QAction *exitAction = controlMenu->addAction (tr ("Exit")); QMenu *interfaceMenu = menuBar ()->addMenu (tr ("Interface")); - QAction *alignWindowsAction = - interfaceMenu->addAction (tr ("Align Windows")); - QAction *openEditorAction = - interfaceMenu->addAction (tr ("Open New Editor Window")); + + QAction *alignWindowsAction = interfaceMenu->addAction (tr ("Align Windows")); + interfaceMenu->addSeparator (); + QAction *showWorkspaceAction = interfaceMenu->addAction (tr ("Workspace")); + showWorkspaceAction->setCheckable (true); + + QAction *showHistoryAction = interfaceMenu->addAction (tr ("History")); + showHistoryAction->setCheckable (true); + + QAction *showFileBrowserAction = interfaceMenu->addAction (tr ("File Browser")); + showFileBrowserAction->setCheckable (true); + + interfaceMenu->addSeparator (); + QAction *openEditorAction = interfaceMenu->addAction (tr ("Open New Editor Window")); QMenu *workspaceMenu = menuBar ()->addMenu (tr ("Workspace")); QAction *loadWorkspaceAction = workspaceMenu->addAction (tr ("Load")); @@ -247,17 +259,19 @@ QMenu *communityMenu = menuBar ()->addMenu (tr ("Community")); QAction *reportBugAction = communityMenu->addAction (tr ("Report Bug")); - connect (settingsAction, SIGNAL (triggered ()), this, - SLOT (processSettingsDialogRequest ())); + connect (settingsAction, SIGNAL (triggered ()), this, SLOT (processSettingsDialogRequest ())); connect (exitAction, SIGNAL (triggered ()), this, SLOT (close ())); - connect (alignWindowsAction, SIGNAL (triggered ()), this, - SLOT (alignMdiWindows ())); - connect (openEditorAction, SIGNAL (triggered ()), this, - SLOT (openEditor ())); - connect (reportBugAction, SIGNAL (triggered ()), this, - SLOT (openBugTrackerPage ())); + connect (alignWindowsAction, SIGNAL (triggered ()), this, SLOT (alignMdiWindows ())); + connect (openEditorAction, SIGNAL (triggered ()), this, SLOT (openEditor ())); + connect (reportBugAction, SIGNAL (triggered ()), this, SLOT (openBugTrackerPage ())); + connect (showWorkspaceAction, SIGNAL (toggled (bool)), m_variablesDockWidget, SLOT (setShown (bool))); + connect (m_variablesDockWidget, SIGNAL (visibilityChanged (bool)), showWorkspaceAction, SLOT (setChecked (bool))); + connect (showHistoryAction, SIGNAL (toggled (bool)), m_historyDockWidget, SLOT (setShown (bool))); + connect (m_variablesDockWidget, SIGNAL (visibilityChanged (bool)), showHistoryAction, SLOT (setChecked (bool))); + connect (showFileBrowserAction, SIGNAL (toggled (bool)), m_filesDockWidget, SLOT (setShown (bool))); + connect (m_filesDockWidget, SIGNAL (visibilityChanged (bool)), showFileBrowserAction, SLOT (setChecked (bool))); - setWindowTitle (QString ("Octave GUI (0.1.1)")); + setWindowTitle (QString (VERSION_STRING)); setCentralWidget (m_centralMdiArea); addDockWidget (Qt::LeftDockWidgetArea, m_variablesDockWidget);
--- a/gui/src/MainWindow.h +++ b/gui/src/MainWindow.h @@ -69,7 +69,8 @@ return m_filesDockWidget; } - public slots:void handleOpenFileRequest (QString fileName); + public slots: + void handleOpenFileRequest (QString fileName); void reportStatusMessage (QString statusMessage); void openWebPage (QString url); void handleSaveWorkspaceRequest ();