# HG changeset patch # User John W. Eaton # Date 1390200086 18000 # Node ID 9d62b5f041ee2795bab6aab8dec9fc31fd58e3c9 # Parent c1baf94184af9d3ded5664e454ade931964c34cb# Parent 7ac2a8b758fcf45b670f8e9a2c9b9b14a00e6fab maint: Periodic merge of gui-release to default. diff -r c1baf94184af -r 9d62b5f041ee libgui/src/files-dock-widget.cc --- a/libgui/src/files-dock-widget.cc Sat Jan 18 22:43:07 2014 -0500 +++ b/libgui/src/files-dock-widget.cc Mon Jan 20 01:41:26 2014 -0500 @@ -155,8 +155,29 @@ QSettings *settings = resource_manager::get_settings (); // FIXME: what should happen if settings is 0? - // Create the QFileSystemModel starting in the actual directory - QDir curr_dir; + // Create the QFileSystemModel starting in the desired directory + QDir startup_dir; // take current dir + + if (settings->value ("filesdockwidget/restore_last_dir",false).toBool ()) + { + // restore last dir from previous session + QStringList last_dirs + = settings->value ("filesdockwidget/mru_dir_list").toStringList (); + if (last_dirs.length () > 0) + startup_dir = QDir (last_dirs.at (0)); // last dir in previous session + } + else if (! settings->value ("filesdockwidget/startup_dir").toString ().isEmpty ()) + { + // do not restore but there is a startup dir configured + startup_dir = QDir (settings->value ("filesdockwidget/startup_dir").toString ()); + } + + if (! startup_dir.exists ()) + { + // the configured startup dir does not exist, take actual one + startup_dir = QDir (); + } + _file_system_model = new QFileSystemModel (this); if (settings->value ("filesdockwidget/showHiddenFiles",false).toBool ()) { @@ -168,7 +189,7 @@ _file_system_model->setFilter (QDir::NoDotAndDotDot | QDir::AllEntries); } QModelIndex rootPathIndex = _file_system_model->setRootPath ( - curr_dir.absolutePath ()); + startup_dir.absolutePath ()); // Attach the model to the QTreeView and set the root index _file_tree_view = new FileTreeViewer (container); diff -r c1baf94184af -r 9d62b5f041ee libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Sat Jan 18 22:43:07 2014 -0500 +++ b/libgui/src/m-editor/file-editor-tab.cc Mon Jan 20 01:41:26 2014 -0500 @@ -746,6 +746,25 @@ } void +file_editor_tab::indent_selected_text (const QWidget *ID) +{ + if (ID != this) + return; + + do_indent_selected_text (true); +} + +void +file_editor_tab::unindent_selected_text (const QWidget *ID) +{ + if (ID != this) + return; + + do_indent_selected_text (false); +} + + +void file_editor_tab::handle_find_dialog_finished (int) { // Find dialog is going to hide. Save location of window for @@ -813,6 +832,43 @@ _edit_area->setCursorPosition (line-1, 0); } +void +file_editor_tab::do_indent_selected_text (bool indent) +{ + // TODO + _edit_area->beginUndoAction (); + + if (_edit_area->hasSelectedText ()) + { + int lineFrom, lineTo, colFrom, colTo; + _edit_area->getSelection (&lineFrom, &colFrom, &lineTo, &colTo); + + if (colTo == 0) // the beginning of last line is not selected + lineTo--; // stop at line above + + for (int i = lineFrom; i <= lineTo; i++) + { + if (indent) + _edit_area->indent (i); + else + _edit_area->unindent (i); + } + //set selection on (un)indented section + _edit_area->setSelection (lineFrom, 0, lineTo, + _edit_area->text (lineTo).length ()); + } + else + { + int cpline, col; + _edit_area->getCursorPosition (&cpline, &col); + if (indent) + _edit_area->indent (cpline); + else + _edit_area->unindent (cpline); + } + + _edit_area->endUndoAction (); +} void file_editor_tab::do_comment_selected_text (bool comment) @@ -1011,6 +1067,7 @@ return file.errorString (); QTextStream in (&file); + in.setCodec("UTF-8"); QApplication::setOverrideCursor (Qt::WaitCursor); _edit_area->setText (in.readAll ()); QApplication::restoreOverrideCursor (); @@ -1077,6 +1134,7 @@ // save the contents into the file QTextStream out (&file); + out.setCodec("UTF-8"); QApplication::setOverrideCursor (Qt::WaitCursor); out << _edit_area->text (); out.flush (); diff -r c1baf94184af -r 9d62b5f041ee libgui/src/m-editor/file-editor-tab.h --- a/libgui/src/m-editor/file-editor-tab.h Sat Jan 18 22:43:07 2014 -0500 +++ b/libgui/src/m-editor/file-editor-tab.h Mon Jan 20 01:41:26 2014 -0500 @@ -93,6 +93,10 @@ void comment_selected_text (const QWidget *ID); void uncomment_selected_text (const QWidget *ID); + + void indent_selected_text (const QWidget *ID); + void unindent_selected_text (const QWidget *ID); + void find (const QWidget *ID); void goto_line (const QWidget *ID, int line = -1); @@ -186,6 +190,7 @@ int check_file_modified (); void do_comment_selected_text (bool comment); QString comment_string (const QString&); + void do_indent_selected_text (bool indent); void add_breakpoint_callback (const bp_info& info); void remove_breakpoint_callback (const bp_info& info); diff -r c1baf94184af -r 9d62b5f041ee libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Sat Jan 18 22:43:07 2014 -0500 +++ b/libgui/src/m-editor/file-editor.cc Mon Jan 20 01:41:26 2014 -0500 @@ -670,6 +670,19 @@ } void +file_editor::request_indent_selected_text (void) +{ + emit fetab_indent_selected_text (_tab_widget->currentWidget ()); +} + +void +file_editor::request_unindent_selected_text (void) +{ + emit fetab_unindent_selected_text (_tab_widget->currentWidget ()); +} + + +void file_editor::request_find (void) { emit fetab_find (_tab_widget->currentWidget ()); @@ -843,7 +856,7 @@ int icon_size = settings->value ("toolbar_icon_size", 16).toInt (); _tool_bar->setIconSize (QSize (icon_size, icon_size)); - int tab_width = settings->value ("editor/tab_width", 300).toInt (); + int tab_width = settings->value ("editor/notebook_tab_width", 300).toInt (); QString style_sheet = QString ("QTabBar::tab {max-height: 4ex; " "max-width: %1px; text-align: right }"). arg (tab_width); @@ -945,6 +958,11 @@ _uncomment_selection_action = new QAction (tr ("&Uncomment"), _tool_bar); + _indent_selection_action + = new QAction (tr ("&Indent"), _tool_bar); + _unindent_selection_action + = new QAction (tr ("&Unindent"), _tool_bar); + _find_action = new QAction (QIcon (":/actions/icons/find.png"), tr ("&Find and Replace..."), _tool_bar); @@ -978,6 +996,8 @@ _toggle_bookmark_action->setShortcutContext (Qt::WindowShortcut); _comment_selection_action->setShortcutContext (Qt::WindowShortcut); _uncomment_selection_action->setShortcutContext (Qt::WindowShortcut); + _indent_selection_action->setShortcutContext (Qt::WindowShortcut); + _unindent_selection_action->setShortcutContext (Qt::WindowShortcut); _find_action->setShortcutContext (Qt::WindowShortcut); _goto_line_action->setShortcutContext (Qt::WindowShortcut); @@ -1058,6 +1078,9 @@ editMenu->addAction (_comment_selection_action); editMenu->addAction (_uncomment_selection_action); editMenu->addSeparator (); + editMenu->addAction (_indent_selection_action); + editMenu->addAction (_unindent_selection_action); + editMenu->addSeparator (); editMenu->addAction (_toggle_bookmark_action); editMenu->addAction (_next_bookmark_action); editMenu->addAction (_previous_bookmark_action); @@ -1187,6 +1210,12 @@ connect (_uncomment_selection_action, SIGNAL (triggered ()), this, SLOT (request_uncomment_selected_text ())); + connect (_indent_selection_action, SIGNAL (triggered ()), + this, SLOT (request_indent_selected_text ())); + + connect (_unindent_selection_action, SIGNAL (triggered ()), + this, SLOT (request_unindent_selected_text ())); + connect (_find_action, SIGNAL (triggered ()), this, SLOT (request_find ())); @@ -1340,6 +1369,12 @@ connect (this, SIGNAL (fetab_uncomment_selected_text (const QWidget*)), f, SLOT (uncomment_selected_text (const QWidget*))); + connect (this, SIGNAL (fetab_indent_selected_text (const QWidget*)), + f, SLOT (indent_selected_text (const QWidget*))); + + connect (this, SIGNAL (fetab_unindent_selected_text (const QWidget*)), + f, SLOT (unindent_selected_text (const QWidget*))); + connect (this, SIGNAL (fetab_find (const QWidget*)), f, SLOT (find (const QWidget*))); @@ -1395,6 +1430,11 @@ + Qt::ControlModifier + Qt::Key_R); + _indent_selection_action->setShortcut (Qt::ControlModifier + Qt::Key_Tab); + _unindent_selection_action->setShortcut (Qt::SHIFT + + Qt::ControlModifier + + Qt::Key_Tab); + _copy_action->setShortcut (QKeySequence::Copy); _cut_action->setShortcut (QKeySequence::Cut); _paste_action->setShortcut (QKeySequence::Paste); @@ -1427,6 +1467,9 @@ _comment_selection_action->setShortcut (no_key); _uncomment_selection_action->setShortcut (no_key); + _indent_selection_action->setShortcut (no_key); + _unindent_selection_action->setShortcut (no_key); + _copy_action->setShortcut (no_key); _cut_action->setShortcut (no_key); _paste_action->setShortcut (no_key); @@ -1461,6 +1504,9 @@ _comment_selection_action->setEnabled (have_tabs); _uncomment_selection_action->setEnabled (have_tabs); + _indent_selection_action->setEnabled (have_tabs); + _unindent_selection_action->setEnabled (have_tabs); + _paste_action->setEnabled (have_tabs); _context_help_action->setEnabled (have_tabs); _context_doc_action->setEnabled (have_tabs); diff -r c1baf94184af -r 9d62b5f041ee libgui/src/m-editor/file-editor.h --- a/libgui/src/m-editor/file-editor.h Sat Jan 18 22:43:07 2014 -0500 +++ b/libgui/src/m-editor/file-editor.h Mon Jan 20 01:41:26 2014 -0500 @@ -91,6 +91,8 @@ void fetab_remove_all_breakpoints (const QWidget* ID); void fetab_comment_selected_text (const QWidget* ID); void fetab_uncomment_selected_text (const QWidget* ID); + void fetab_indent_selected_text (const QWidget* ID); + void fetab_unindent_selected_text (const QWidget* ID); void fetab_find (const QWidget* ID); void fetab_goto_line (const QWidget* ID, int line = -1); void fetab_insert_debugger_pointer (const QWidget* ID, int line = -1); @@ -139,6 +141,10 @@ void request_comment_selected_text (void); void request_uncomment_selected_text (void); + + void request_indent_selected_text (void); + void request_unindent_selected_text (void); + void request_find (void); void request_goto_line (void); @@ -201,6 +207,9 @@ QAction *_comment_selection_action; QAction *_uncomment_selection_action; + QAction *_indent_selection_action; + QAction *_unindent_selection_action; + QAction *_copy_action; QAction *_cut_action; QAction *_paste_action; diff -r c1baf94184af -r 9d62b5f041ee libgui/src/main-window.cc --- a/libgui/src/main-window.cc Sat Jan 18 22:43:07 2014 -0500 +++ b/libgui/src/main-window.cc Mon Jan 20 01:41:26 2014 -0500 @@ -1261,19 +1261,48 @@ int))); #endif - QDir curr_dir; - set_current_working_directory (curr_dir.absolutePath ()); - octave_link::post_event (this, &main_window::resize_command_window_callback); set_global_shortcuts (true); } + +void +main_window::handle_octave_ready () +{ + // actions after the startup files are executed + QSettings *settings = resource_manager::get_settings (); + + QDir startup_dir = QDir (); // current octave dir after startup + + if (settings->value ("restore_octave_dir").toBool ()) + { + // restore last dir from previous session + QStringList curr_dirs + = settings->value ("MainWindow/current_directory_list").toStringList (); + startup_dir = QDir (curr_dirs.at (0)); // last dir in previous session + } + else if (! settings->value ("octave_startup_dir").toString ().isEmpty ()) + { + // do not restore but there is a startup dir configured + startup_dir = QDir (settings->value ("octave_startup_dir").toString ()); + } + + if (! startup_dir.exists ()) + { + // the configured startup dir does not exist, take actual one + startup_dir = QDir (); + } + + set_current_working_directory (startup_dir.absolutePath ()); +} + + void main_window::construct_octave_qt_link (void) { - _octave_qt_link = new octave_qt_link (); + _octave_qt_link = new octave_qt_link (this); connect (_octave_qt_link, SIGNAL (exit_signal (int)), this, SLOT (exit (int))); diff -r c1baf94184af -r 9d62b5f041ee libgui/src/main-window.h --- a/libgui/src/main-window.h Sat Jan 18 22:43:07 2014 -0500 +++ b/libgui/src/main-window.h Mon Jan 20 01:41:26 2014 -0500 @@ -185,6 +185,8 @@ void handle_show_doc (const QString &file); + void handle_octave_ready (); + // find files dialog void find_files (const QString &startdir=QDir::currentPath ()); void find_files_finished (int); diff -r c1baf94184af -r 9d62b5f041ee libgui/src/octave-interpreter.cc --- a/libgui/src/octave-interpreter.cc Sat Jan 18 22:43:07 2014 -0500 +++ b/libgui/src/octave-interpreter.cc Mon Jan 20 01:41:26 2014 -0500 @@ -43,6 +43,8 @@ octave_initialize_interpreter (octave_cmdline_argc, octave_cmdline_argv, octave_embedded); + emit octave_ready_signal (); + octave_execute_interpreter (); } diff -r c1baf94184af -r 9d62b5f041ee libgui/src/octave-interpreter.h --- a/libgui/src/octave-interpreter.h Sat Jan 18 22:43:07 2014 -0500 +++ b/libgui/src/octave-interpreter.h Mon Jan 20 01:41:26 2014 -0500 @@ -38,6 +38,10 @@ octave_interpreter (void) : QObject (), thread_manager () { } +signals: + + void octave_ready_signal (); + public slots: // Initialize and execute the octave interpreter. diff -r c1baf94184af -r 9d62b5f041ee libgui/src/octave-qt-link.cc --- a/libgui/src/octave-qt-link.cc Sat Jan 18 22:43:07 2014 -0500 +++ b/libgui/src/octave-qt-link.cc Mon Jan 20 01:41:26 2014 -0500 @@ -43,13 +43,16 @@ #include "resource-manager.h" -octave_qt_link::octave_qt_link (void) +octave_qt_link::octave_qt_link (QWidget *p) : octave_link (), main_thread (new QThread ()), command_interpreter (new octave_interpreter ()) { connect (this, SIGNAL (execute_interpreter_signal (void)), command_interpreter, SLOT (execute (void))); + connect (command_interpreter, SIGNAL (octave_ready_signal ()), + p, SLOT (handle_octave_ready ())); + command_interpreter->moveToThread (main_thread); main_thread->start (); diff -r c1baf94184af -r 9d62b5f041ee libgui/src/octave-qt-link.h --- a/libgui/src/octave-qt-link.h Sat Jan 18 22:43:07 2014 -0500 +++ b/libgui/src/octave-qt-link.h Mon Jan 20 01:41:26 2014 -0500 @@ -53,7 +53,7 @@ public: - octave_qt_link (void); + octave_qt_link (QWidget *p); ~octave_qt_link (void); diff -r c1baf94184af -r 9d62b5f041ee libgui/src/settings-dialog.cc --- a/libgui/src/settings-dialog.cc Sat Jan 18 22:43:07 2014 -0500 +++ b/libgui/src/settings-dialog.cc Mon Jan 20 01:41:26 2014 -0500 @@ -30,6 +30,7 @@ #include "ui-settings-dialog.h" #include #include +#include #include #include @@ -57,7 +58,9 @@ ui->setupUi (this); QSettings *settings = resource_manager::get_settings (); - // FIXME: what should happen if settings is 0? + + // restore last geometry + restoreGeometry (settings->value("settings/geometry").toByteArray ()); // look for available language files and the actual settings QString qm_dir_name = resource_manager::get_gui_translation_dir (); @@ -112,6 +115,14 @@ ui->cb_widget_custom_style->setChecked ( settings->value ("DockWidgets/widget_title_custom_style",false).toBool ()); + // Octave startup + ui->cb_restore_octave_dir->setChecked ( + settings->value ("restore_octave_dir",false).toBool ()); + ui->le_octave_dir->setText ( + settings->value ("octave_startup_dir").toString ()); + connect (ui->pb_octave_dir, SIGNAL (pressed ()), + this, SLOT (get_octave_dir ())); + // editor ui->useCustomFileEditor->setChecked (settings->value ("useCustomFileEditor", false).toBool ()); @@ -162,8 +173,8 @@ settings->value ("editor/tab_width", 2).toInt ()); ui->editor_longWindowTitle->setChecked ( settings->value ("editor/longWindowTitle",false).toBool ()); - ui->editor_tab_width->setValue ( - settings->value ("editor/tab_width", 300).toInt ()); + ui->editor_notebook_tab_width->setValue ( + settings->value ("editor/notebook_tab_width", 300).toInt ()); ui->editor_restoreSession->setChecked ( settings->value ("editor/restoreSession", true).toBool ()); ui->editor_create_new_file->setChecked ( @@ -172,6 +183,8 @@ settings->value ("terminal/fontName","Courier New").toString ()) ); ui->terminal_fontSize->setValue ( settings->value ("terminal/fontSize", 10).toInt ()); + + // file browser ui->showFileSize->setChecked ( settings->value ("filesdockwidget/showFileSize", false).toBool ()); ui->showFileType->setChecked ( @@ -182,8 +195,17 @@ settings->value ("filesdockwidget/showHiddenFiles",false).toBool ()); ui->useAlternatingRowColors->setChecked ( settings->value ("filesdockwidget/useAlternatingRowColors",true).toBool ()); + connect (ui->sync_octave_directory, SIGNAL (toggled (bool)), + this, SLOT (set_disabled_pref_file_browser_dir (bool))); ui->sync_octave_directory->setChecked ( settings->value ("filesdockwidget/sync_octave_directory",true).toBool ()); + ui->cb_restore_file_browser_dir->setChecked ( + settings->value ("filesdockwidget/restore_last_dir",false).toBool ()); + ui->le_file_browser_dir->setText ( + settings->value ("filesdockwidget/startup_dir").toString ()); + connect (ui->pb_file_browser_dir, SIGNAL (pressed ()), + this, SLOT (get_file_browser_dir ())); + ui->checkbox_allow_web_connect->setChecked ( settings->value ("news/allow_web_connection",false).toBool ()); ui->useProxyServer->setChecked ( @@ -500,8 +522,15 @@ settings->setValue ("Dockwidgets/title_fg_color", _widget_title_fg_color->color ()); - // other settings + // icon size settings->setValue ("toolbar_icon_size", ui->toolbar_icon_size->value ()); + + // Octave startup + settings->setValue ("restore_octave_dir", + ui->cb_restore_octave_dir->isChecked ()); + settings->setValue ("octave_startup_dir", ui->le_octave_dir->text ()); + + //editor settings->setValue ("useCustomFileEditor", ui->useCustomFileEditor->isChecked ()); settings->setValue ("customFileEditor", ui->customFileEditor->text ()); @@ -541,8 +570,8 @@ ui->editor_tab_width_spinbox->value ()); settings->setValue ("editor/longWindowTitle", ui->editor_longWindowTitle->isChecked ()); - settings->setValue ("editor/tab_width", - ui->editor_tab_width->value ()); + settings->setValue ("editor/notebook_tab_width", + ui->editor_notebook_tab_width->value ()); settings->setValue ("editor/restoreSession", ui->editor_restoreSession->isChecked ()); settings->setValue ("editor/create_new_file", @@ -550,6 +579,7 @@ settings->setValue ("terminal/fontSize", ui->terminal_fontSize->value ()); settings->setValue ("terminal/fontName", ui->terminal_fontName->currentFont ().family ()); + settings->setValue ("filesdockwidget/showFileSize", ui->showFileSize->isChecked ()); settings->setValue ("filesdockwidget/showFileType", @@ -562,6 +592,12 @@ ui->useAlternatingRowColors->isChecked ()); settings->setValue ("filesdockwidget/sync_octave_directory", ui->sync_octave_directory->isChecked ()); + settings->setValue ("filesdockwidget/restore_last_dir", + ui->cb_restore_file_browser_dir->isChecked ()); + settings->setValue ("filesdockwidget/startup_dir", + ui->le_file_browser_dir->text ()); + + settings->setValue ("news/allow_web_connection", ui->checkbox_allow_web_connect->isChecked ()); settings->setValue ("useProxyServer", ui->useProxyServer->isChecked ()); @@ -622,6 +658,8 @@ write_terminal_colors (settings); settings->setValue ("settings/last_tab",ui->tabWidget->currentIndex ()); + settings->setValue ("settings/geometry",saveGeometry ()); + settings->sync (); } #ifdef HAVE_QSCINTILLA @@ -705,6 +743,7 @@ settings->setValue ( "settings/last_editor_styles_tab",ui->tabs_editor_lexers->currentIndex ()); + settings->sync (); } #endif @@ -742,3 +781,44 @@ } settings->sync (); } + + +// internal slots + +void +settings_dialog::get_dir (QLineEdit *line_edit, const QString& title) +{ + QString dir = QFileDialog::getExistingDirectory(this, + title, line_edit->text (), + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + line_edit->setText (dir); +} + +void +settings_dialog::get_octave_dir () +{ + get_dir (ui->le_octave_dir, tr ("Set Octave Startup Directory")); +} + +void +settings_dialog::get_file_browser_dir () +{ + get_dir (ui->le_file_browser_dir, tr ("Set File Browser Startup Directory")); +} + +void +settings_dialog::set_disabled_pref_file_browser_dir (bool disable) +{ + ui->cb_restore_file_browser_dir->setDisabled (disable); + + if (! disable) + { + ui->le_file_browser_dir->setDisabled (ui->cb_restore_file_browser_dir->isChecked ()); + ui->pb_file_browser_dir->setDisabled (ui->cb_restore_file_browser_dir->isChecked ()); + } + else + { + ui->le_file_browser_dir->setDisabled (disable); + ui->pb_file_browser_dir->setDisabled (disable); + } +} diff -r c1baf94184af -r 9d62b5f041ee libgui/src/settings-dialog.h --- a/libgui/src/settings-dialog.h Sat Jan 18 22:43:07 2014 -0500 +++ b/libgui/src/settings-dialog.h Mon Jan 20 01:41:26 2014 -0500 @@ -25,6 +25,7 @@ #include #include +#include #include "color-picker.h" @@ -45,6 +46,12 @@ ~settings_dialog (); void write_changed_settings (); +private slots: + void get_octave_dir (); + void get_file_browser_dir (); + void get_dir (QLineEdit*, const QString&); + void set_disabled_pref_file_browser_dir (bool disable); + private: Ui::settings_dialog * ui; #ifdef HAVE_QSCINTILLA diff -r c1baf94184af -r 9d62b5f041ee libgui/src/settings-dialog.ui --- a/libgui/src/settings-dialog.ui Sat Jan 18 22:43:07 2014 -0500 +++ b/libgui/src/settings-dialog.ui Mon Jan 20 01:41:26 2014 -0500 @@ -9,20 +9,14 @@ 0 0 - 700 + 720 480 - 700 - 480 - - - - - 700 - 480 + 400 + 400 @@ -31,8 +25,14 @@ + + + 0 + 0 + + - 1 + 0 @@ -41,243 +41,337 @@ General - - - - 9 - 10 - 651 - 371 - - - - - - - - - Icon set for dock widgets - - - - - - - Language (requires restart) - - - - - - - Icon size - - - - - - - - - 16 - - - 32 - - - 4 - - - 24 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - QComboBox::InsertAtBottom - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Octave logo only - - - true - - - - - - - Letter icons - - - - - - - Graphic icons - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Dock widget title bar - - - - - - - - - Custom style - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - false - - - Background color - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 12 - 20 - - - - - - - - false - - - Text color - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Qt::Vertical + + + + + true + + + + + 0 + 0 + 678 + 378 + - - - 20 - 40 - - - - - - + + + + + Interface + + + + + + + + Dock widget title bar + + + + + + + + + QComboBox::InsertAtBottom + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Icon size + + + + + + + + + Custom style + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + false + + + Background color + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 12 + 20 + + + + + + + + false + + + Text color + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 16 + + + 32 + + + 4 + + + 24 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Language (requires restart) + + + + + + + + + Octave logo only + + + true + + + + + + + Letter icons + + + + + + + Graphic icons + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Icon set for dock widgets + + + + + + + + + + + + Octave Startup + + + + + + These preferences are applied after the startup files like .octaverc. + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Startup path + + + + + + + + 0 + 0 + + + + Browse + + + + + + + Restore last Octave directory of previous session + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + @@ -285,1015 +379,1180 @@ - - - 4 + + + true - - - - 6 - - - - - Show whitespace - - - - - - - true - - - Show line numbers - - - - - - - Show complete path in window title - - - - - - - false - - - Do not show whitespace used for indentation - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - true - - - Highlight current line - - - - - - - 12 - - - 0 - - - - - false + + + + 0 + 0 + 554 + 399 + + + + + + + + + 6 - - Color - - + + + + Show whitespace + + + + + + + true + + + Show line numbers + + + + + + + + 0 + 0 + + + + Show complete path in window title + + + + + + + false + + + Do not show whitespace used for indentation + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + true + + + Highlight current line + + + + + + + 12 + + + 0 + + + + + false + + + Color + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 80 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Max. tab width in pixel + + + + + + + 100 + + + 600 + + + 20 + + + 300 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 0 + + + + + - - + + Qt::Horizontal - - QSizePolicy::Fixed - - - - 80 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Max. tab width in pixel - - - - - 100 + + + + 0 - - 600 - - - 20 - - - 300 + + + + Indent width + + + + + + + Tab indents line + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 0 + + + + + + + + Auto indentation + + + + + + + 1 + + + 32 + + + 2 + + + + + + + Tab width + + + + + + + Show indentation guides + + + + + + + 1 + + + 32 + + + + + + + Backspace unindents line + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 0 + + + + + + + + + + Qt::Horizontal - - + + + + 0 + + + + + true + + + Code completion + + + false + + + + + + + 6 + + + + + false + + + # of characters typed before completion list displayed + + + + + + + false + + + + + + + + + + + + 1 + + + 6 + + + 2 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 0 + + + + + + + + false + + + Match keywords + + + true + + + + + + + false + + + Case sensitive + + + true + + + + + + + false + + + Replace word by suggested one + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + Match words in document + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 0 + + + + + + + + Qt::Horizontal - - - 40 - 20 - + + + + + + 0 + + + 0 - + + + + + 0 + 0 + + + + Restore editor tabs from previous session on startup + + + + + + + + 0 + 0 + + + + Create nonexistent files without prompting + + + + + + + + + Qt::Horizontal + + + + + + + + + true + + + Use custom file editor + + + + + + + false + + + command line (%f=file, %l=line): + + + + + + + false + + + emacs + + + + - - + + - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 0 - - - - - - - - - - Qt::Horizontal - - - - - - - 0 - - - - - Indent width - - - - - - - Tab indents line - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed + Qt::Vertical - 10 - 0 - - - - - - - - Auto indentation - - - - - - - 1 - - - 32 - - - 2 - - - - - - - Tab width - - - - - - - Show indentation guides - - - - - - - 1 - - - 32 - - - - - - - Backspace unindents line - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 0 + 20 + 40 - + + + + + + + + + 0 + 0 + + + + Editor Styles + + + + - - - Qt::Horizontal + + + + 0 + 0 + + + + QFrame::NoFrame + + + <html><head/><body><p>Select font, font size (as a difference from the default size), font style (<b>b</b>old, <b>i</b>talic, <b>u</b>nderline), text color and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color).</p></body></html> + + + false + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + 4 - - - 0 + + + + 0 + 0 + - - - - true - - - Code completion - - - false - - - - - - - 6 - + + + + + + + + + Terminal + + + + + + true + + + + + 0 + 0 + 678 + 378 + + + + + - - - false - - - # of characters typed before completion list displayed - - + + + + + + + Use foreground color + + + + + + + Cursor blinking + + + + + + + + + + + Cursor type: + + + + + + + + + + + + + + Font + + + + + + + false + + + QFontComboBox::MonospacedFonts + + + + + + + + + + + Font size + + + + + + + 2 + + + 96 + + + 10 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - - false - - - - - - - - - - - - 1 - - - 6 - - - 2 + + + Qt::Horizontal - - - Qt::Horizontal - - + + - 40 - 20 + 0 + 81 - + + Terminal Colors + + - - - - - - 0 - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - + + + - 10 + 0 0 - - - - - - false - - - Match keywords - - - true - - - - - - - false - - - Case sensitive - - - true + + Qt::Horizontal - - - - false - + + - Replace word by suggested one + Set focus to terminal when running a command from within another widget - - + + Qt::Horizontal - - - 40 - 20 - - - - - - - - false - - - Match words in document - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + - Qt::Horizontal - - - QSizePolicy::Fixed + Qt::Vertical - 10 - 0 + 20 + 40 - - - - - Qt::Horizontal - - - - - - - 0 - - - 0 - - - - - - 0 - 0 - - - - Restore editor tabs from previous session on startup - - - - - - - - 0 - 0 - - - - Create nonexistent files without prompting - - - - - - - - - - - Qt::Horizontal - + - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - - - - - 0 - - - 0 - - - - - - - true - - - Use custom file editor - - - - - - - false - - - command line (%f=file, %l=line): - - - - - - - false - - - emacs - - - - - - - - - - Editor Styles - - - - - 0 - 0 - 651 - 401 - - - - - - - - 676 - 16777215 - - - - QFrame::NoFrame - - - <html><head/><body><p>Select font, font size (as a difference from the default size), font style (<b>b</b>old, <b>i</b>talic, <b>u</b>nderline), text color and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color).</p></body></html> - - - false - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - 4 - - - - - - - - 676 - 351 - - - - - - - - - - Terminal - - - - - 10 - 10 - 631 - 371 - - - - - - - - - Font - - - - - - - false - - - QFontComboBox::MonospacedFonts - - - - - - - Font size - - - - - - - 2 - - - 96 - - - 10 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Cursor type: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Cursor blinking - - - - - - - Use foreground color - - - - - - - - - Qt::Horizontal - - - - - - - - 0 - 81 - - - - Terminal Colors - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - - - - - Set focus to terminal when running a command from within another widget - - - - - - - Qt::Horizontal - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - File Browser - - - Show file size - - - - - - - Show file type + + + true - - - - - - Show date of last modification - - - - - - - Show hidden files - + + + + 0 + 0 + 474 + 318 + + + + + + + Display + + + + + + 0 + + + + + Show file type + + + + + + + Show hidden files + + + + + + + Show file size + + + + + + + Show date of last modification + + + + + + + Alternating row colors + + + + + + + + + + + + Behavior + + + + + + + + Synchronize Octave working directory with file browser + + + + + + + + + Startup path + + + + + + + + + + Restore last directory of previous session + + + + + + + Browse + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 360 + + + + + + - - - - Synchronize Octave working directory with file browser - - - - - - - Alternating row colors - - - - - - - Qt::Vertical - - - - 20 - 360 - - - - Workspace - - - - 10 - 8 - 631 - 381 - - - - - - - true - - - - 0 - 0 - - - - - 0 - 81 - - - - Storage Class Colors + + + + + true + + + + + 0 + 0 + 154 + 114 + - - - - - - - 0 - 1 - - - - Qt::Horizontal - + + + + + + + true + + + + 0 + 0 + + + + + 0 + 81 + + + + Storage Class Colors + + + + + + + + 0 + 1 + + + + Qt::Horizontal + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - + + + @@ -1301,137 +1560,156 @@ - - - - - Allow Octave to connect to the Octave web site to display current news and information - - - - - - - - - false - - - Hostname: - - - - - - - false - + + + true + + + + + 0 + 0 + 529 + 204 + + + + + - - HttpProxy - + + + Allow Octave to connect to the Octave web site to display current news and information + + - - Socks5Proxy - + + + + + false + + + Hostname: + + + + + + + false + + + + HttpProxy + + + + + Socks5Proxy + + + + + + + + false + + + Username: + + + + + + + Use proxy server + + + + + + + false + + + Proxy type: + + + + + + + false + + + Port: + + + + + + + false + + + Password: + + + + + + + false + + + + + + + false + + + + + + + false + + + + + + + false + + + QLineEdit::Password + + + + - - - - - - false - - - Username: - - + - - - - Use proxy server - - - - - - - false - - - Proxy type: - - - - - - - false - - - Port: + + + + Qt::Vertical - - - - - - false - - - Password: - - - - - - - false + + + 20 + 40 + - - - - - - false - - - - - - - false - - - - - - - false - - - QLineEdit::Password - - + - - - - - - - Qt::Vertical - - - - 20 - 40 - - - + + @@ -1832,5 +2110,69 @@ + + cb_restore_octave_dir + toggled(bool) + le_octave_dir + setDisabled(bool) + + + 270 + 255 + + + 270 + 285 + + + + + cb_restore_octave_dir + toggled(bool) + pb_octave_dir + setDisabled(bool) + + + 270 + 255 + + + 467 + 285 + + + + + cb_restore_file_browser_dir + toggled(bool) + le_file_browser_dir + setDisabled(bool) + + + 250 + 294 + + + 250 + 324 + + + + + cb_restore_file_browser_dir + toggled(bool) + pb_file_browser_dir + setDisabled(bool) + + + 250 + 294 + + + 426 + 324 + + + diff -r c1baf94184af -r 9d62b5f041ee libinterp/dldfcn/__init_fltk__.cc --- a/libinterp/dldfcn/__init_fltk__.cc Sat Jan 18 22:43:07 2014 -0500 +++ b/libinterp/dldfcn/__init_fltk__.cc Mon Jan 20 01:41:26 2014 -0500 @@ -111,7 +111,7 @@ in_zoom (false), zoom_box (), print_mode (false) { // Ask for double buffering and a depth buffer. - mode (FL_DEPTH | FL_DOUBLE); + mode (FL_DEPTH | FL_DOUBLE | FL_MULTISAMPLE); } ~OpenGL_fltk (void) { } @@ -752,7 +752,7 @@ status->box (FL_ENGRAVED_BOX); // This allows us to have a valid OpenGL context right away. - canvas->mode (FL_DEPTH | FL_DOUBLE ); + canvas->mode (FL_DEPTH | FL_DOUBLE | FL_MULTISAMPLE); if (fp.is_visible ()) { // FIXME: This code should be removed when Octave drops support diff -r c1baf94184af -r 9d62b5f041ee libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll Sat Jan 18 22:43:07 2014 -0500 +++ b/libinterp/parse-tree/lex.ll Mon Jan 20 01:41:26 2014 -0500 @@ -277,6 +277,7 @@ EXPON ([DdEe][+-]?{D}+) NUMBER (({D}+\.?{D}*{EXPON}?)|(\.{D}+{EXPON}?)|(0[xX][0-9a-fA-F]+)) +ANY_EXCEPT_NL [^\r\n] ANY_INCLUDING_NL (.|{NL}) %% @@ -309,8 +310,8 @@ // If an argument is in construction, it is completed. %} -(\.\.\.)[^\r\n]*{NL} { - curr_lexer->lexer_debug ("(\\.\\.\\.)[^\\r\\n]*{NL}"); +(\.\.\.){ANY_EXCEPT_NL}*{NL} { + curr_lexer->lexer_debug ("(\\.\\.\\.){ANY_EXCEPT_NL}*{NL}"); COMMAND_ARG_FINISH; @@ -324,8 +325,8 @@ // Commands normally end at the end of a line or a semicolon. %} -({CCHAR}[^\r\n]*)?{NL} { - curr_lexer->lexer_debug ("({CCHAR}[^\\r\\n])?{NL}"); +({CCHAR}{ANY_EXCEPT_NL}*)?{NL} { + curr_lexer->lexer_debug ("({CCHAR}{ANY_EXCEPT_NL}*)?{NL}"); COMMAND_ARG_FINISH; @@ -633,8 +634,8 @@ // Body of a block comment. %} -.*{NL} { - curr_lexer->lexer_debug (".*{NL}"); +{ANY_EXCEPT_NL}*{NL} { + curr_lexer->lexer_debug ("{ANY_EXCEPT_NL}*{NL}"); curr_lexer->input_line_number++; curr_lexer->current_input_column = 1; @@ -645,15 +646,15 @@ // Full-line or end-of-line comment. %} -{S}*{CCHAR}.*{NL} { - curr_lexer->lexer_debug ("{S}*{CCHAR}.*{NL}"); +{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL} { + curr_lexer->lexer_debug ("{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}"); curr_lexer->push_start_state (LINE_COMMENT_START); yyless (0); } -{S}*{CCHAR}.*{NL} { - curr_lexer->lexer_debug ("{S}*{CCHAR}.*{NL}"); +{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL} { + curr_lexer->lexer_debug ("{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}"); bool full_line_comment = curr_lexer->current_input_column == 1; curr_lexer->input_line_number++; @@ -869,8 +870,8 @@ } (\.\.\.){S}*{NL} | -(\.\.\.){S}*{CCHAR}.*{NL} { - curr_lexer->lexer_debug ("(\\.\\.\\.){S}*{NL}|(\\.\\.\\.){S}*{CCHAR}.*{NL}"); +(\.\.\.){S}*{CCHAR}{ANY_EXCEPT_NL}*{NL} { + curr_lexer->lexer_debug ("(\\.\\.\\.){S}*{NL}|(\\.\\.\\.){S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}"); static const char *msg = "'...' continuations in double-quoted character strings are obsolete and will not be allowed in a future version of Octave; please use '\\' instead"; @@ -887,8 +888,8 @@ } \\{S}+{NL} | -\\{S}*{CCHAR}.*{NL} { - curr_lexer->lexer_debug ("\\\\{S}+{NL}|\\\\{S}*{CCHAR}.*{NL}"); +\\{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL} { + curr_lexer->lexer_debug ("\\\\{S}+{NL}|\\\\{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}"); static const char *msg = "white space and comments after continuation markers in double-quoted character strings are obsolete and will not be allowed in a future version of Octave"; @@ -1077,8 +1078,8 @@ // Continuation lines. Allow arbitrary text after continuations. %} -\.\.\..*{NL} { - curr_lexer->lexer_debug ("\\.\\.\\..*{NL}"); +\.\.\.{ANY_EXCEPT_NL}*{NL} { + curr_lexer->lexer_debug ("\\.\\.\\.{ANY_EXCEPT_NL}*{NL}"); curr_lexer->handle_continuation (); } @@ -1088,8 +1089,8 @@ %} \\{S}*{NL} | -\\{S}*{CCHAR}.*{NL} { - curr_lexer->lexer_debug ("\\\\{S}*{NL}|\\\\{S}*{CCHAR}.*{NL}"); +\\{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL} { + curr_lexer->lexer_debug ("\\\\{S}*{NL}|\\\\{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}"); static const char *msg = "using continuation marker \\ outside of double quoted strings is deprecated and will be removed in a future version of Octave";