2020import lzma
2121import bz2
2222import zipfile
23-
24- from Orange .widgets .settings import PerfectDomainContextHandler
25- from Orange .widgets .utils .itemdelegates import TableDataDelegate
2623from itertools import chain
2724
2825from xml .sax .saxutils import escape
3936 Qt , QFileInfo , QTimer , QSettings , QObject , QSize , QMimeDatabase , QMimeType
4037)
4138from AnyQt .QtGui import (
42- QStandardItem , QStandardItemModel , QPalette , QColor , QIcon , QTextOption
39+ QStandardItem , QStandardItemModel , QPalette , QColor , QIcon ,
4340)
4441from AnyQt .QtWidgets import (
45- QLabel , QComboBox , QPushButton , QDialog , QDialogButtonBox , QGridLayout ,
42+ QLabel , QComboBox , QPushButton , QDialog , QDialogButtonBox ,
4643 QVBoxLayout , QSizePolicy , QFileIconProvider , QFileDialog ,
4744 QApplication , QMessageBox , QTextBrowser ,
4845 QStyle , QMenu , QHBoxLayout , QTableView , QHeaderView
5956from Orange .data import Table , ContinuousVariable , StringVariable
6057from Orange .misc .collections import natural_sorted
6158
62- from Orange .widgets import widget , gui , settings
59+ from Orange .widgets import widget , gui
6360from Orange .widgets .data .owtable import DataTableView , RichTableModel , is_sortable , TableSliceProxy
61+ from Orange .widgets .settings import PerfectDomainContextHandler
62+ from Orange .widgets .utils .settings import (
63+ QSettings_readArray , QSettings_writeArray
64+ )
6465from Orange .widgets .utils .concurrent import PyOwned
6566from Orange .widgets .utils import (
6667 textimport , concurrent as qconcurrent , unique_everseen , enum_get , qname
7172 PathItem , VarPath , AbsPath , samepath , prettyfypath , isprefixed ,
7273)
7374from Orange .widgets .utils .overlay import OverlayWidget
74- from Orange .widgets .utils .settings import (
75- QSettings_readArray , QSettings_writeArray
76- )
77- from orangewidget .settings import Setting , ContextSetting , SettingProvider
75+ from Orange .widgets .utils .itemdelegates import TableDataDelegate
76+ from orangewidget .settings import Setting , SettingProvider , widget_settings_dir
7877
7978if typing .TYPE_CHECKING :
8079 # pylint: disable=invalid-name
@@ -658,13 +657,13 @@ class Warning(widget.OWWidget.Warning):
658657 'the Import Options to avoid this.' )
659658
660659 #: Paths and options of files accessed in a 'session'
661- _session_items = settings . Setting (
660+ _session_items = Setting (
662661 [], schema_only = True ) # type: List[Tuple[str, dict]]
663662
664- _session_items_v2 = settings . Setting (
663+ _session_items_v2 = Setting (
665664 [], schema_only = True ) # type: List[Tuple[Dict[str, str], dict]]
666665 #: Saved dialog state (last directory and selected filter)
667- dialog_state = settings . Setting ({
666+ dialog_state = Setting ({
668667 "directory" : "" ,
669668 "filter" : ""
670669 }) # type: Dict[str, str]
@@ -678,7 +677,7 @@ class Warning(widget.OWWidget.Warning):
678677 # with older saved workflows, where types not guessed differently, when
679678 # compatibility_mode=True widget have older guessing behaviour
680679 settings_version = 3
681- compatibility_mode = settings . Setting (False , schema_only = True )
680+ compatibility_mode = Setting (False , schema_only = True )
682681
683682 MaxHistorySize = 50
684683
@@ -968,7 +967,7 @@ def _path_must_be_relative_mb(self, prefix: str) -> QMessageBox:
968967 return mb
969968
970969 @Slot ()
971- def browse (self , prefixname = None , directory = None ):
970+ def browse (self ):
972971 """
973972 Open a file dialog and select a user specified file.
974973 """
@@ -1089,7 +1088,7 @@ def _local_settings(cls):
10891088 # type: () -> QSettings
10901089 """Return a QSettings instance with local persistent settings."""
10911090 filename = "{}.ini" .format (qname (cls ))
1092- fname = os .path .join (settings . widget_settings_dir (), filename )
1091+ fname = os .path .join (widget_settings_dir (), filename )
10931092 return QSettings (fname , QSettings .IniFormat )
10941093
10951094 def _add_recent (self , filename , options = None ):
0 commit comments