Mercurial > octave
changeset 33413:4debdac5478a bytecode-interpreter
maint: Merge default to bytecode-interpreter
author | Arun Giridhar <arungiridhar@gmail.com> |
---|---|
date | Mon, 15 Apr 2024 12:16:19 -0400 |
parents | 0978c2874881 (current diff) ada37b7a4b28 (diff) |
children | 8643f7ca9504 |
files | etc/NEWS.9.md |
diffstat | 8 files changed, 73 insertions(+), 51 deletions(-) [+] |
line wrap: on
line diff
--- a/etc/NEWS.9.md Sat Apr 13 15:45:32 2024 -0400 +++ b/etc/NEWS.9.md Mon Apr 15 12:16:19 2024 -0400 @@ -7,15 +7,21 @@ - `hist.m`: Add input validation for `Y` restricting it to 2-D array (bug #65478). - -- `cross.m`: Add input validation for 'dim' restricting it to a numeric - integer valued scalar. +- `cross.m`: Add input validation for `dim` restricting it to a numeric + integer valued scalar (bug #65544, bug #65527). +- `getframe.m`: Respect pixel ratio (high DPI) of screen with figure + (bug #65540). +- `legend.m`: Fix error if root property `"showhiddenhandles"` is `"on"` + (bug #65442) +- `savepath.m`: Correctly handle packages without binaries (bug #65559). +- Correctly scale figure position on screen with DPI scaling (high DPI). ### GUI - Use first word for options in right-click menu of command window widget (bug #65518). - Set `DontUseNativeDialog` flag as first property in `QFileDialog`. +- Explicitly raise non-modal message boxes ensuring visibility. ### Build system / Tests @@ -23,6 +29,12 @@ This fixes an error that might have lead to overlinking of shared libraries (e.g., `.oct` files). Consider rebuilding shared libraries that have been built with Octave 9.1.0. +- Add BIST for `is_valid_file_id.m` (bug #65543). +- Update metainfo.xml with new fields for AppStream 1.0 (bug #65355). +- Show result of check for `std::pmr::polymorphic_allocator` in configure + summary. +- Run test for polymorphic allocators if possible instead of a simple build + check. ### Documentation
--- a/libgui/src/documentation.cc Sat Apr 13 15:45:32 2024 -0400 +++ b/libgui/src/documentation.cc Mon Apr 15 12:16:19 2024 -0400 @@ -330,6 +330,8 @@ insertWidget (0, navi); insertWidget (1, browser_find); setStretchFactor (1, 1); + + restoreState (settings.byte_array_value (dc_splitter_state)); } } @@ -684,6 +686,7 @@ { gui_settings settings; + settings.setValue (dc_splitter_state.settings_key (), saveState ()); m_doc_browser->save_settings (); m_bookmarks->save_settings (); }
--- a/libgui/src/gui-preferences-dc.cc Sat Apr 13 15:45:32 2024 -0400 +++ b/libgui/src/gui-preferences-dc.cc Mon Apr 15 12:16:19 2024 -0400 @@ -43,3 +43,7 @@ // Zoom level gui_pref dc_browser_zoom_level ("documentation_widget/browser_zoom_level", QVariant (0)); + +// Splitter state +gui_pref +dc_splitter_state ("documentation_widget/splitter_state", QVariant (0));
--- a/libgui/src/gui-preferences-dc.h Sat Apr 13 15:45:32 2024 -0400 +++ b/libgui/src/gui-preferences-dc.h Mon Apr 15 12:16:19 2024 -0400 @@ -39,6 +39,8 @@ extern gui_pref dc_bookmark_filter_mru; +extern gui_pref dc_splitter_state; + // Constants for the xbel file format const QLatin1String dc_xbel_doctype ("<!DOCTYPE xbel>"); const QLatin1String dc_xbel_attr_href ("href");
--- a/libgui/src/gui-settings.cc Sat Apr 13 15:45:32 2024 -0400 +++ b/libgui/src/gui-settings.cc Mon Apr 15 12:16:19 2024 -0400 @@ -192,12 +192,18 @@ QString gui_settings::sc_value (const sc_pref& scpref) const { - QKeySequence key_seq = sc_def_value (scpref); + QString full_settings_key = sc_group + "/" + scpref.settings_key (); + + if (contains (full_settings_key)) + { + QKeySequence key_seq = sc_def_value (scpref); - // Get the value from the settings where the key sequences are stored - // as strings - return value (sc_group + "/" + scpref.settings_key (), - key_seq.toString ()).toString (); + // Get the value from the settings where the key sequences are stored + // as strings + return value (full_settings_key, key_seq.toString ()).toString (); + } + else + return scpref.def_text (); } QKeySequence @@ -216,25 +222,15 @@ return; } - QString shortcut = sc_value (scpref); - - if (! shortcut.isEmpty ()) + QString shortcut = sc_value (scpref); action->setShortcut (QKeySequence (shortcut)); - else - qDebug () << "Key: " << scpref.settings_key () - << " not found in settings"; } void gui_settings::shortcut (QShortcut *sc, const sc_pref& scpref) { QString shortcut = sc_value (scpref); - - if (! shortcut.isEmpty ()) - sc->setKey (QKeySequence (shortcut)); - else - qDebug () << "Key: " << scpref.settings_key () - << " not found in settings"; + sc->setKey (QKeySequence (shortcut)); } void
--- a/libgui/src/main-window.cc Sat Apr 13 15:45:32 2024 -0400 +++ b/libgui/src/main-window.cc Mon Apr 15 12:16:19 2024 -0400 @@ -1211,6 +1211,13 @@ load_path& lp = interp.get_load_path (); + // Rehashing the load path is only needed when executing new files + // in the built-in editor for the first time and the command line + // prompt hasn't been displayed yet again since this *new* file has + // been saved for the first time. + // FIXME: Is there a way to detect here that a file is new? + lp.rehash (); + std::string path = info.absolutePath ().toStdString (); if (lp.contains_file_in_dir (file_path, path))
--- a/libgui/src/shortcuts-tree-widget.cc Sat Apr 13 15:45:32 2024 -0400 +++ b/libgui/src/shortcuts-tree-widget.cc Mon Apr 15 12:16:19 2024 -0400 @@ -221,12 +221,11 @@ grid->addWidget (def, 1, 0); grid->addWidget (label_default, 1, 1); + QPushButton *clear_text = new QPushButton (tr ("Clear")); QPushButton *set_default = new QPushButton (tr ("Set to default")); - connect (set_default, &QPushButton::clicked, - this, &shortcut_edit_dialog::set_default_shortcut); - - grid->addWidget (set_default, 0, 2); + grid->addWidget (clear_text, 0, 2); + grid->addWidget (set_default, 0, 3); box->addLayout (grid); box->addSpacing (18); @@ -260,12 +259,16 @@ const sc_pref scpref = all_shortcut_preferences::value (m_settings_key); - QString actual_text = settings.sc_value (scpref); + m_default_text = scpref.def_text (); + label_default->setText (m_default_text); - m_default_text = scpref.def_text (); + QString actual_text = shortcut_item->actual_text (); + m_edit_actual->setText (actual_text); - m_edit_actual->setText (actual_text); - label_default->setText (m_default_text); + connect (clear_text, &QPushButton::clicked, + [this] () { m_edit_actual->setText (QString ()); }); + connect (set_default, &QPushButton::clicked, + [this] () { m_edit_actual->setText (m_default_text); }); m_edit_actual->setFocus (); @@ -344,13 +347,6 @@ m_shortcut_item->set_actual_text (actual_text); } -void -shortcut_edit_dialog::set_default_shortcut () -{ - // Just remove user-set value so that the default will be used. - m_edit_actual->setText (""); -} - shortcuts_tree_widget::shortcuts_tree_widget (QWidget *parent) : QTreeWidget (parent) { @@ -450,13 +446,12 @@ connect (this, &QTreeWidget::itemDoubleClicked, this, &shortcuts_tree_widget::edit_selection); - const QList<QString> shortcut_settings_keys + QList<QString> shortcut_settings_keys = all_shortcut_preferences::keys (); + shortcut_settings_keys.sort (); gui_settings settings; - settings.beginGroup (sc_group); - for (const auto& settings_key : shortcut_settings_keys) { QTreeWidgetItem *section = level_hash[settings_key.section (':', 0, 0)]; @@ -482,17 +477,13 @@ section = main_zoom; } - // We don't want to apply default value here. - QString actual_text = settings.value (settings_key).toString (); - const sc_pref scpref = all_shortcut_preferences::value (settings_key); // Inserts itself in the tree widget in SECTION. The parent // object will delete it. + QString actual_text = settings.sc_value (scpref); new tree_widget_shortcut_item (section, scpref, actual_text); } - - settings.endGroup (); } void @@ -625,7 +616,7 @@ // Export all shortcuts from the tree view to the settings object. void -shortcuts_tree_widget::export_shortcuts (gui_settings& settings) +shortcuts_tree_widget::export_shortcuts (gui_settings& settings, bool full) { settings.beginGroup (sc_group); @@ -643,10 +634,19 @@ QString settings_key = shortcut_item->settings_key (); QString sc_text = shortcut_item->actual_text (); - if (sc_text.isEmpty ()) - sc_text = shortcut_item->default_text (); + if (full || sc_text != shortcut_item->default_text ()) + { + // Only write the shortcut to the settings file if it is + // different to its default value or if an export into a + // custom file is desired by the user. + settings.setValue (settings_key, sc_text); + } else - settings.setValue (settings_key, sc_text); + { + // Remove the key otherwise, the default value will be + // chosen for non existing shortcut keys. + settings.remove (settings_key); + } QString section = get_shortcut_section (settings_key); @@ -723,7 +723,7 @@ { gui_settings settings; - export_shortcuts (settings); + export_shortcuts (settings, false); // false: omit values identical to the default } OCTAVE_END_NAMESPACE(octave)
--- a/libgui/src/shortcuts-tree-widget.h Sat Apr 13 15:45:32 2024 -0400 +++ b/libgui/src/shortcuts-tree-widget.h Mon Apr 15 12:16:19 2024 -0400 @@ -105,8 +105,6 @@ void finished (int result); - void set_default_shortcut (); - signals: void set_shortcut (const QString& settings_key, @@ -132,7 +130,7 @@ void import_shortcuts (gui_settings& settings); - void export_shortcuts (gui_settings& settings); + void export_shortcuts (gui_settings& settings, bool full = true); void set_default_shortcuts ();