Mercurial > hg > octave-nkf
changeset 14682:9ea75ea686b5 gui
Allowing nested dock widgets and fixed small bug in loading a workspace.
* MainWindow: Added explicit dock options and check if workspace file to be loaded is empty.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Thu, 24 May 2012 13:45:33 +0200 |
parents | 66ff321cb62e |
children | dd19de736ee4 |
files | gui/src/MainWindow.cpp |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/src/MainWindow.cpp +++ b/gui/src/MainWindow.cpp @@ -86,8 +86,11 @@ QString selectedFile = QFileDialog::getOpenFileName (this, tr ("Load Workspace"), ResourceManager::instance ()->homePath ()); - m_terminalView->sendText (QString ("load \'%1\'\n").arg (selectedFile)); - m_terminalView->setFocus (); + if (!selectedFile.isEmpty ()) + { + m_terminalView->sendText (QString ("load \'%1\'\n").arg (selectedFile)); + m_terminalView->setFocus (); + } } void @@ -228,7 +231,6 @@ setCentralWidget (m_terminalView); m_fileEditor = new FileEditor (m_terminalView, this); - addDockWidget (Qt::BottomDockWidgetArea, m_fileEditor); QMenu *fileMenu = menuBar ()->addMenu (tr ("&File")); QAction *newFileAction @@ -345,9 +347,12 @@ connect (pasteAction, SIGNAL (triggered()), m_terminalView, SLOT(pasteClipboard ())); setWindowTitle ("Octave"); + setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks); + addDockWidget (Qt::LeftDockWidgetArea, m_workspaceView); addDockWidget (Qt::LeftDockWidgetArea, m_historyDockWidget); addDockWidget (Qt::RightDockWidgetArea, m_filesDockWidget); + addDockWidget (Qt::BottomDockWidgetArea, m_fileEditor); setStatusBar (m_statusBar); readSettings ();