# HG changeset patch # User Jacob Dawid # Date 1328107999 -3600 # Node ID be3e1a14a6dee48e2bf67194b630f25110a9420c # Parent c3b62d211b80e324d24bcd882d9c6ddecebaa3bb Added an interface settings tab to the settings dialog. Made a few improvements on the editor. Wrote a small welcome text in the welcome wizard. Moved configuration file to ~/.config/octave-gui/settings. * FileEditorMdiSubWindow: Set sources for code completion to all, lowered completion threshold, changed colors. * SettingsDialog: Added interface tab with shortcut configuration table widget. * WelcomeWizard: Wrote a little text to appear at startup. diff -r c3b62d211b80 -r be3e1a14a6de gui/src/FileEditorMdiSubWindow.cpp --- a/gui/src/FileEditorMdiSubWindow.cpp Wed Feb 01 11:27:39 2012 +0100 +++ b/gui/src/FileEditorMdiSubWindow.cpp Wed Feb 01 15:53:19 2012 +0100 @@ -428,20 +428,20 @@ m_editor->setMarginType (3, QsciScintilla::SymbolMargin); m_editor->setFolding (QsciScintilla::BoxedTreeFoldStyle , 3); // other features - if ( settings->value ("editor/highlightActualLine",true).toBool () ) + if ( settings->value ("editor/highlightCurrentLine",true).toBool () ) { m_editor->setCaretLineVisible(true); - m_editor->setCaretLineBackgroundColor(QColor(255,255,200)); + m_editor->setCaretLineBackgroundColor(QColor(245,245,245)); } - m_editor->setBraceMatching (QsciScintilla::SloppyBraceMatch); + m_editor->setBraceMatching (QsciScintilla::StrictBraceMatch); m_editor->setAutoIndent (true); m_editor->setIndentationWidth (2); m_editor->setIndentationsUseTabs (false); if ( settings->value ("editor/codeCompletion",true).toBool () ) { - m_editor->autoCompleteFromAll(); - m_editor->setAutoCompletionSource(QsciScintilla::AcsAPIs); - m_editor->setAutoCompletionThreshold (3); + m_editor->autoCompleteFromAll (); + m_editor->setAutoCompletionSource(QsciScintilla::AcsAll); + m_editor->setAutoCompletionThreshold (1); } m_editor->setUtf8 (true); m_longTitle = settings->value ("editor/longWindowTitle",true).toBool (); diff -r c3b62d211b80 -r be3e1a14a6de gui/src/FileEditorMdiSubWindow.h --- a/gui/src/FileEditorMdiSubWindow.h Wed Feb 01 11:27:39 2012 +0100 +++ b/gui/src/FileEditorMdiSubWindow.h Wed Feb 01 15:53:19 2012 +0100 @@ -41,7 +41,9 @@ class FileEditorMdiSubWindow:public QMdiSubWindow { -Q_OBJECT public: +Q_OBJECT + +public: FileEditorMdiSubWindow (QWidget * parent = 0); ~FileEditorMdiSubWindow (); void loadFile (QString fileName); diff -r c3b62d211b80 -r be3e1a14a6de gui/src/OctaveGUI.cpp --- a/gui/src/OctaveGUI.cpp Wed Feb 01 11:27:39 2012 +0100 +++ b/gui/src/OctaveGUI.cpp Wed Feb 01 15:53:19 2012 +0100 @@ -43,7 +43,7 @@ settings->setValue ("useCustomFileEditor", false); settings->setValue ("customFileEditor", "emacs"); settings->setValue ("editor/showLineNumbers", true); - settings->setValue ("editor/highlightActualLine", true); + settings->setValue ("editor/highlightCurrentLine", true); settings->setValue ("editor/codeCompletion", true); settings->setValue ("editor/fontName", "Monospace"); settings->setValue ("editor/fontSize", 10); diff -r c3b62d211b80 -r be3e1a14a6de gui/src/ResourceManager.cpp --- a/gui/src/ResourceManager.cpp Wed Feb 01 11:27:39 2012 +0100 +++ b/gui/src/ResourceManager.cpp Wed Feb 01 15:53:19 2012 +0100 @@ -49,7 +49,7 @@ { QDesktopServices desktopServices; m_homePath = desktopServices.storageLocation (QDesktopServices::HomeLocation); - setSettings(m_homePath + "/.octave-gui"); + setSettings(m_homePath + "/.config/octave-gui/settings"); } void diff -r c3b62d211b80 -r be3e1a14a6de gui/src/SettingsDialog.cpp --- a/gui/src/SettingsDialog.cpp Wed Feb 01 11:27:39 2012 +0100 +++ b/gui/src/SettingsDialog.cpp Wed Feb 01 15:53:19 2012 +0100 @@ -34,7 +34,7 @@ ui->useCustomFileEditor->setChecked (settings->value ("useCustomFileEditor").toBool ()); ui->customFileEditor->setText (settings->value ("customFileEditor").toString ()); ui->editor_showLineNumbers->setChecked (settings->value ("editor/showLineNumbers",true).toBool () ); - ui->editor_highlightActualLine->setChecked (settings->value ("editor/highlightActualLine",true).toBool () ); + ui->editor_highlightCurrentLine->setChecked (settings->value ("editor/highlightCurrentLine",true).toBool () ); ui->editor_codeCompletion->setChecked (settings->value ("editor/codeCompletion",true).toBool () ); ui->editor_fontName->setCurrentFont (QFont (settings->value ("editor/fontName","Courier").toString()) ); ui->editor_fontSize->setValue (settings->value ("editor/fontSize",10).toInt ()); @@ -59,6 +59,33 @@ ui->proxyPort->setText (settings->value ("proxyPort").toString ()); ui->proxyUserName->setText (settings->value ("proxyUserName").toString ()); ui->proxyPassword->setText (settings->value ("proxyPassword").toString ()); + + // Short cuts + QStringList headerLabels; + headerLabels << "Modifier" << "Key" << "Action"; + ui->shortcutTableWidget->setColumnCount (3); + ui->shortcutTableWidget->setRowCount (10); + ui->shortcutTableWidget->horizontalHeader ()->setStretchLastSection (true); + ui->shortcutTableWidget->setHorizontalHeaderLabels (headerLabels); + ui->shortcutTableWidget->setSelectionBehavior(QAbstractItemView::SelectRows); + ui->shortcutTableWidget->setSelectionMode(QAbstractItemView::SingleSelection); + + /* + newAction->setShortcut(QKeySequence::New); + openAction->setShortcut(QKeySequence::Open); + saveAction->setShortcut(QKeySequence::Save); + saveAsAction->setShortcut(QKeySequence::SaveAs); + undoAction->setShortcut(QKeySequence::Undo); + redoAction->setShortcut(QKeySequence::Redo); + m_copyAction->setShortcut(QKeySequence::Copy); + m_cutAction->setShortcut(QKeySequence::Cut); + pasteAction->setShortcut(QKeySequence::Paste); + runAction->setShortcut(Qt::Key_F5); + nextBookmarkAction->setShortcut(Qt::Key_F2); + prevBookmarkAction->setShortcut(Qt::SHIFT + Qt::Key_F2); + toggleBookmarkAction->setShortcut(Qt::Key_F7); + commentSelectedAction->setShortcut(Qt::CTRL + Qt::Key_R); + uncommentSelectedAction->setShortcut(Qt::CTRL + Qt::Key_T);*/ } SettingsDialog::~SettingsDialog () @@ -72,7 +99,7 @@ settings->setValue ("useCustomFileEditor", ui->useCustomFileEditor->isChecked ()); settings->setValue ("customFileEditor", ui->customFileEditor->text ()); settings->setValue ("editor/showLineNumbers", ui->editor_showLineNumbers->isChecked ()); - settings->setValue ("editor/highlightActualLine", ui->editor_highlightActualLine->isChecked ()); + settings->setValue ("editor/highlightCurrentLine", ui->editor_highlightCurrentLine->isChecked ()); settings->setValue ("editor/codeCompletion", ui->editor_codeCompletion->isChecked ()); settings->setValue ("editor/fontName", ui->editor_fontName->currentFont().family()); settings->setValue ("editor/fontSize", ui->editor_fontSize->value()); diff -r c3b62d211b80 -r be3e1a14a6de gui/src/SettingsDialog.ui --- a/gui/src/SettingsDialog.ui Wed Feb 01 11:27:39 2012 +0100 +++ b/gui/src/SettingsDialog.ui Wed Feb 01 15:53:19 2012 +0100 @@ -9,20 +9,20 @@ 0 0 - 500 - 300 + 600 + 400 - 500 - 300 + 600 + 400 - 500 - 300 + 600 + 400 @@ -34,87 +34,59 @@ 0 - + - Chat + Interface - - - - - - - Connect to #octave on startup - - - true - - - + + + + + Shortcuts: + + + + + + + false + + + + + - - - Show message of the day + + + false - - - - - Show topic - - - - - - - Automatically identify on NickServ + Add - + + + false + - Warning: Your password will be stored in ~/.octavegui in human-readable format. Do not enter your password if you worry about security issues. - - - true + Remove - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Password: - - - - - - - false - - - QLineEdit::Password - - - - + + + Qt::Horizontal + + + + 40 + 20 + + + @@ -124,21 +96,8 @@ Editor - - - - - Qt::Vertical - - - - 20 - 158 - - - - - + + @@ -178,12 +137,12 @@ - + true - Highlight actual line + Highlight current line false @@ -212,7 +171,7 @@ - + @@ -263,6 +222,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -312,6 +284,19 @@ + + + + Qt::Vertical + + + + 20 + 360 + + + + @@ -430,6 +415,105 @@ + + + Chat + + + + + + + + Connect to #octave on startup + + + true + + + + + + + Show message of the day + + + + + + + Show topic + + + + + + + Automatically identify on NickServ + + + + + + + Warning: Your password will be stored in ~/.octavegui in human-readable format. Do not enter your password if you worry about security issues. + + + true + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Password: + + + + + + + false + + + QLineEdit::Password + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + @@ -645,9 +729,9 @@ - editor_highlightActualLine + editor_highlightCurrentLine toggled(bool) - editor_highlightActualLine + editor_highlightCurrentLine setEnabled(bool) diff -r c3b62d211b80 -r be3e1a14a6de gui/src/WelcomeWizard.ui --- a/gui/src/WelcomeWizard.ui Wed Feb 01 11:27:39 2012 +0100 +++ b/gui/src/WelcomeWizard.ui Wed Feb 01 15:53:19 2012 +0100 @@ -246,6 +246,38 @@ + + + + 20 + + + + Welcome to Octave! + + + + + + + This is the development version of Octave with the first official GUI. + + + true + + + + + + + You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click 'Finish' to write a configuration file and launch Octave GUI. + + + true + + + + Qt::Vertical @@ -262,6 +294,9 @@ + + false + Previous