diff gui/src/SettingsDialog.cpp @ 14307:be3e1a14a6de gui

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.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Wed, 01 Feb 2012 15:53:19 +0100
parents faece6b2ab90
children 3b6177bd63b0
line wrap: on
line diff
--- 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());