# HG changeset patch # User Jacob Dawid # Date 1338154920 -7200 # Node ID c952f1e35e50c2911bdd09625b26e5e5ebad63cb # Parent d6d250812c01ce6c0f414871c4678002826a99b8 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings. * FileEditorTab: Parameter of setModified was not used properly. * OctaveLink: Exit status was not used, surrounded with Q_UNUSED. * MainWindow: Added prepareQuit slot to always save settings before quiting. diff -r d6d250812c01 -r c952f1e35e50 .hgsubstate --- a/.hgsubstate Sun May 27 13:54:03 2012 +0200 +++ b/.hgsubstate Sun May 27 23:42:00 2012 +0200 @@ -1,2 +1,2 @@ f9813bce2c06a6130a68db4478d1b16ddadaf276 gnulib -a81f99b9b77d9a402b92463b41c5fdb82324349a gui/qterminal +5c51db4e3b1fcce6a05c59af5be78f43ebc24db4 gui/qterminal diff -r d6d250812c01 -r c952f1e35e50 gui/src/MainWindow.cpp --- a/gui/src/MainWindow.cpp Sun May 27 13:54:03 2012 +0200 +++ b/gui/src/MainWindow.cpp Sun May 27 23:42:00 2012 +0200 @@ -138,6 +138,12 @@ } void +MainWindow::prepareForQuit () +{ + writeSettings (); +} + +void MainWindow::showAboutOctave () { QString message = @@ -168,7 +174,7 @@ reportStatusMessage (tr ("Saving data and shutting down.")); writeSettings (); m_closing = true; // inform editor window that whole application is closed - OctaveLink::instance ()->terminateOctave(); + OctaveLink::instance ()->terminateOctave (); QMainWindow::closeEvent (closeEvent); } @@ -220,7 +226,13 @@ m_terminal = new QTerminal(this); m_terminalDockWidget = new TerminalDockWidget (m_terminal, this); - //setCentralWidget (new QWidget (this)); + /* + QWidget *dummyWidget = new QWidget (); + dummyWidget->setObjectName ("DummyWidget"); + dummyWidget->setFixedSize (100, 100); + dummyWidget->setSizePolicy (QSizePolicy::Minimum, QSizePolicy::Minimum); + setCentralWidget (dummyWidget);*/ + //dummyWidget->hide (); m_fileEditor = new FileEditor (m_terminal, this); @@ -277,9 +289,9 @@ showCommandWindowAction->setCheckable (true); QAction *showWorkspaceAction = windowMenu->addAction (tr ("Workspace")); showWorkspaceAction->setCheckable (true); - QAction *showHistoryAction = windowMenu->addAction (tr ("History")); + QAction *showHistoryAction = windowMenu->addAction (tr ("Command History")); showHistoryAction->setCheckable (true); - QAction *showFileBrowserAction = windowMenu->addAction (tr ("File Browser")); + QAction *showFileBrowserAction = windowMenu->addAction (tr ("Current Directory")); showFileBrowserAction->setCheckable (true); QAction *showEditorAction = windowMenu->addAction (tr ("Editor")); showEditorAction->setCheckable (true); @@ -308,6 +320,8 @@ mainToolBar->addWidget (m_currentDirectoryToolButton); mainToolBar->addWidget (m_currentDirectoryUpToolButton); + connect (qApp, SIGNAL(aboutToQuit ()), this, SLOT (prepareForQuit ())); + connect (settingsAction, SIGNAL (triggered ()), this, SLOT (processSettingsDialogRequest ())); connect (exitAction, SIGNAL (triggered ()), this, SLOT (close ())); connect (newFileAction, SIGNAL (triggered ()), this, SLOT (newFile ())); diff -r d6d250812c01 -r c952f1e35e50 gui/src/MainWindow.h --- a/gui/src/MainWindow.h Sun May 27 13:54:03 2012 +0200 +++ b/gui/src/MainWindow.h Sun May 27 23:42:00 2012 +0200 @@ -90,6 +90,7 @@ void processSettingsDialogRequest (); void showAboutOctave (); void updateTerminalFont (); + void prepareForQuit (); protected: void closeEvent (QCloseEvent * closeEvent); diff -r d6d250812c01 -r c952f1e35e50 gui/src/backend/OctaveLink.cpp --- a/gui/src/backend/OctaveLink.cpp Sun May 27 13:54:03 2012 +0200 +++ b/gui/src/backend/OctaveLink.cpp Sun May 27 23:42:00 2012 +0200 @@ -30,6 +30,7 @@ void octave_exit_hook (int status) { + Q_UNUSED (status); OctaveLink::instance ()->terminateOctave (); } diff -r d6d250812c01 -r c952f1e35e50 gui/src/editor/FileEditorTab.cpp --- a/gui/src/editor/FileEditorTab.cpp Sun May 27 13:54:03 2012 +0200 +++ b/gui/src/editor/FileEditorTab.cpp Sun May 27 23:42:00 2012 +0200 @@ -319,7 +319,7 @@ void FileEditorTab::setModified (bool modified) { - m_editArea->setModified (true); + m_editArea->setModified (modified); } bool diff -r d6d250812c01 -r c952f1e35e50 gui/src/editor/FileEditorTab.h --- a/gui/src/editor/FileEditorTab.h Sun May 27 13:54:03 2012 +0200 +++ b/gui/src/editor/FileEditorTab.h Sun May 27 23:42:00 2012 +0200 @@ -47,7 +47,7 @@ void undo (); void redo (); - void setModified (bool modified); + void setModified (bool modified = true); bool openFile(); void loadFile (QString fileName);