diff --git a/plover/gui_qt/dictionaries_widget.py b/plover/gui_qt/dictionaries_widget.py index 2408274e6..5ed22f243 100644 --- a/plover/gui_qt/dictionaries_widget.py +++ b/plover/gui_qt/dictionaries_widget.py @@ -377,6 +377,22 @@ def _create_new_dictionary(self): self._update_dictionaries(dictionaries, keep_selection=False, loaded_dictionaries=self._loaded_dictionaries) + def on_save_as(self, row: int) -> None: + new_filename = QFileDialog.getSaveFileName( + self, _('Save dictionary as'), None, + _dictionary_filters(include_readonly=False), + )[0] + if not new_filename: + return + new_filename = normalize_path(new_filename) + try: + d = create_dictionary(new_filename, threaded_save=False) + d.update(self._loaded_dictionaries[self._config_dictionaries[row].path]) + d.save() + except: + log.error('creating dictionary %s failed', new_filename, exc_info=True) + return + def on_add_translation(self): selection = self._get_selection() if selection: diff --git a/plover/gui_qt/dictionaries_widget.ui b/plover/gui_qt/dictionaries_widget.ui index bdc028f91..341a4d326 100644 --- a/plover/gui_qt/dictionaries_widget.ui +++ b/plover/gui_qt/dictionaries_widget.ui @@ -33,7 +33,7 @@ 0 - + QFrame::Box @@ -173,6 +173,13 @@ + + + DictionariesTable + QTableWidget +
plover.gui_qt.dictionaries_table
+
+