comparison gui/src/MainWindow.cpp @ 14681:66ff321cb62e gui

Integrated the editor to be docked with the other widgets. * FilesDockWidget: Some code style corrections. * MainWindow: Added a checkable menu entry for the editor and added file editor as dockable widget. * FileEditor: Moved setting the object name to the interface. * FileEditorInterface: Added routines to correctly handle closing and opening the dock widget.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Thu, 24 May 2012 13:20:27 +0200
parents 35512b788af2
children 9ea75ea686b5
comparison
equal deleted inserted replaced
14680:628eeaf879f7 14681:66ff321cb62e
226 // Octave Terminal subwindow. 226 // Octave Terminal subwindow.
227 m_terminalView = new QTerminal(this); 227 m_terminalView = new QTerminal(this);
228 setCentralWidget (m_terminalView); 228 setCentralWidget (m_terminalView);
229 229
230 m_fileEditor = new FileEditor (m_terminalView, this); 230 m_fileEditor = new FileEditor (m_terminalView, this);
231 addDockWidget (Qt::BottomDockWidgetArea, m_fileEditor);
231 232
232 QMenu *fileMenu = menuBar ()->addMenu (tr ("&File")); 233 QMenu *fileMenu = menuBar ()->addMenu (tr ("&File"));
233 QAction *newFileAction 234 QAction *newFileAction
234 = fileMenu->addAction (QIcon::fromTheme ("document-new", 235 = fileMenu->addAction (QIcon::fromTheme ("document-new",
235 style->standardIcon (QStyle::SP_FileIcon)), tr ("New File")); 236 style->standardIcon (QStyle::SP_FileIcon)), tr ("New File"));
282 showWorkspaceAction->setCheckable (true); 283 showWorkspaceAction->setCheckable (true);
283 QAction *showHistoryAction = windowMenu->addAction (tr ("History")); 284 QAction *showHistoryAction = windowMenu->addAction (tr ("History"));
284 showHistoryAction->setCheckable (true); 285 showHistoryAction->setCheckable (true);
285 QAction *showFileBrowserAction = windowMenu->addAction (tr ("File Browser")); 286 QAction *showFileBrowserAction = windowMenu->addAction (tr ("File Browser"));
286 showFileBrowserAction->setCheckable (true); 287 showFileBrowserAction->setCheckable (true);
288 QAction *showEditorAction = windowMenu->addAction (tr ("Editor"));
289 showEditorAction->setCheckable (true);
287 290
288 // Help menu 291 // Help menu
289 QMenu *helpMenu = menuBar ()->addMenu (tr ("&Help")); 292 QMenu *helpMenu = menuBar ()->addMenu (tr ("&Help"));
290 QAction *reportBugAction = helpMenu->addAction (tr ("Report Bug")); 293 QAction *reportBugAction = helpMenu->addAction (tr ("Report Bug"));
291 QAction *agoraAction = helpMenu->addAction (tr ("Visit Agora")); 294 QAction *agoraAction = helpMenu->addAction (tr ("Visit Agora"));
322 connect (m_workspaceView, SIGNAL (activeChanged (bool)), showWorkspaceAction, SLOT (setChecked (bool))); 325 connect (m_workspaceView, SIGNAL (activeChanged (bool)), showWorkspaceAction, SLOT (setChecked (bool)));
323 connect (showHistoryAction, SIGNAL (toggled (bool)), m_historyDockWidget, SLOT (setShown (bool))); 326 connect (showHistoryAction, SIGNAL (toggled (bool)), m_historyDockWidget, SLOT (setShown (bool)));
324 connect (m_historyDockWidget, SIGNAL (activeChanged (bool)), showHistoryAction, SLOT (setChecked (bool))); 327 connect (m_historyDockWidget, SIGNAL (activeChanged (bool)), showHistoryAction, SLOT (setChecked (bool)));
325 connect (showFileBrowserAction, SIGNAL (toggled (bool)), m_filesDockWidget, SLOT (setShown (bool))); 328 connect (showFileBrowserAction, SIGNAL (toggled (bool)), m_filesDockWidget, SLOT (setShown (bool)));
326 connect (m_filesDockWidget, SIGNAL (activeChanged (bool)), showFileBrowserAction, SLOT (setChecked (bool))); 329 connect (m_filesDockWidget, SIGNAL (activeChanged (bool)), showFileBrowserAction, SLOT (setChecked (bool)));
330 connect (showEditorAction, SIGNAL (toggled (bool)), m_fileEditor, SLOT (setShown (bool)));
331 connect (m_fileEditor, SIGNAL (activeChanged (bool)), showEditorAction, SLOT (setChecked (bool)));
327 332
328 //connect (this, SIGNAL (settingsChanged ()), m_workspaceView, SLOT (noticeSettings ())); 333 //connect (this, SIGNAL (settingsChanged ()), m_workspaceView, SLOT (noticeSettings ()));
329 //connect (this, SIGNAL (settingsChanged ()), m_historyDockWidget, SLOT (noticeSettings ())); 334 //connect (this, SIGNAL (settingsChanged ()), m_historyDockWidget, SLOT (noticeSettings ()));
330 connect (this, SIGNAL (settingsChanged ()), m_filesDockWidget, SLOT (noticeSettings ())); 335 connect (this, SIGNAL (settingsChanged ()), m_filesDockWidget, SLOT (noticeSettings ()));
331 336