mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Refactor to make QSettings more python friendly
This commit is contained in:
parent
6663154e16
commit
e6b649d8a0
@ -19,7 +19,7 @@ __author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
||||
__appname__ = 'libprs500'
|
||||
|
||||
import sys, os, logging, mechanize, locale, copy, cStringIO, re, subprocess, \
|
||||
textwrap, atexit
|
||||
textwrap, atexit, cPickle
|
||||
from gettext import GNUTranslations
|
||||
from math import floor
|
||||
from optparse import OptionParser as _OptionParser
|
||||
@ -27,6 +27,7 @@ from optparse import IndentedHelpFormatter
|
||||
from logging import Formatter
|
||||
|
||||
from ttfquery import findsystem, describe
|
||||
from PyQt4.QtCore import QSettings, QVariant
|
||||
|
||||
from libprs500.translations.msgfmt import make
|
||||
from libprs500.ebooks.chardet import detect
|
||||
@ -307,6 +308,10 @@ def get_font_families(cached=None):
|
||||
else:
|
||||
zlist = []
|
||||
for ff in ffiles:
|
||||
if 'Optane' in str(ff):
|
||||
font = describe.openFont(ff)
|
||||
wt, italic = describe.modifiers(font)
|
||||
print ff, wt, italic
|
||||
try:
|
||||
font = describe.openFont(ff)
|
||||
except: # Some font files cause ttfquery to raise an exception, in which case they are ignored
|
||||
@ -450,3 +455,32 @@ def singleinstance(name):
|
||||
return False
|
||||
|
||||
return False
|
||||
|
||||
class Settings(QSettings):
|
||||
|
||||
def __init__(self):
|
||||
QSettings.__init__(self, QSettings.IniFormat, QSettings.UserScope,
|
||||
'kovidgoyal.net', 'calibre')
|
||||
|
||||
def migrate(self, settings):
|
||||
for key in settings.allKeys():
|
||||
self.setValue(key, settings.value(key, QVariant()))
|
||||
|
||||
def get(self, key, default=None):
|
||||
key = str(key)
|
||||
if not self.contains(key):
|
||||
return default
|
||||
val = str(self.value(key, QVariant()).toString())
|
||||
if not val:
|
||||
return None
|
||||
return cPickle.loads(val)
|
||||
|
||||
def set(self, key, val):
|
||||
val = cPickle.dumps(val, -1)
|
||||
self.setValue(str(key), QVariant(val))
|
||||
|
||||
_settings = Settings()
|
||||
if not _settings.get('migrated from QSettings'):
|
||||
_settings.migrate(QSettings('KovidsBrain', 'libprs500'))
|
||||
_settings.set('migrated from QSettings', True)
|
||||
_settings.sync()
|
@ -14,7 +14,7 @@
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
""" The GUI """
|
||||
import sys, os, re, StringIO, traceback
|
||||
from PyQt4.QtCore import QVariant, QSettings, QFileInfo, QObject, SIGNAL, QBuffer, \
|
||||
from PyQt4.QtCore import QVariant, QFileInfo, QObject, SIGNAL, QBuffer, \
|
||||
QByteArray, QLocale, QTranslator, QUrl
|
||||
from PyQt4.QtGui import QFileDialog, QMessageBox, QPixmap, QFileIconProvider, \
|
||||
QIcon, QTableView
|
||||
@ -85,14 +85,14 @@ class TableView(QTableView):
|
||||
|
||||
|
||||
def read_settings(self):
|
||||
self.cw = str(QSettings().value(self.__class__.__name__ + ' column widths', QVariant('')).toString())
|
||||
self.cw = str(Settings().value(self.__class__.__name__ + ' column widths', QVariant('')).toString())
|
||||
try:
|
||||
self.cw = tuple(int(i) for i in self.cw.split(','))
|
||||
except ValueError:
|
||||
self.cw = None
|
||||
|
||||
def write_settings(self):
|
||||
settings = QSettings()
|
||||
settings = Settings()
|
||||
settings.setValue(self.__class__.__name__ + ' column widths',
|
||||
QVariant(','.join(str(self.columnWidth(i))
|
||||
for i in range(self.model().columnCount(None)))))
|
||||
@ -109,10 +109,10 @@ class TableView(QTableView):
|
||||
is hidden, if True it is shown.
|
||||
'''
|
||||
if cols:
|
||||
QSettings().setValue(self.__class__.__name__ + ' visible columns',
|
||||
Settings().setValue(self.__class__.__name__ + ' visible columns',
|
||||
QVariant(repr(cols)))
|
||||
else:
|
||||
cols = qstring_to_unicode(QSettings().value(self.__class__.__name__ + ' visible columns',
|
||||
cols = qstring_to_unicode(Settings().value(self.__class__.__name__ + ' visible columns',
|
||||
QVariant('')).toString())
|
||||
if cols:
|
||||
cols = eval(cols)
|
||||
@ -219,7 +219,7 @@ _sidebar_directories = []
|
||||
def set_sidebar_directories(dirs):
|
||||
global _sidebar_directories
|
||||
if dirs is None:
|
||||
dirs = QSettings().value('frequently used directories', QVariant([])).toStringList()
|
||||
dirs = Settings().value('frequently used directories', QVariant([])).toStringList()
|
||||
_sidebar_directories = [QUrl.fromLocalFile(i) for i in dirs]
|
||||
|
||||
class FileDialog(QObject):
|
||||
@ -242,7 +242,7 @@ class FileDialog(QObject):
|
||||
if add_all_files_filter or not ftext:
|
||||
ftext += 'All files (*)'
|
||||
|
||||
settings = QSettings()
|
||||
settings = Settings()
|
||||
self.dialog_name = name if name else 'dialog_' + title
|
||||
self.selected_files = None
|
||||
self.fd = None
|
||||
@ -298,7 +298,7 @@ class FileDialog(QObject):
|
||||
|
||||
def save_dir(self):
|
||||
if self.fd:
|
||||
settings = QSettings()
|
||||
settings = Settings()
|
||||
settings.setValue(self.dialog_name, QVariant(self.fd.saveState()))
|
||||
|
||||
|
||||
|
@ -15,9 +15,9 @@
|
||||
import os
|
||||
|
||||
from PyQt4.QtGui import QDialog, QMessageBox, QListWidgetItem, QVBoxLayout
|
||||
from PyQt4.QtCore import QSettings, QVariant, SIGNAL, QStringList, QTimer, Qt
|
||||
from PyQt4.QtCore import QVariant, SIGNAL, QStringList, QTimer, Qt
|
||||
|
||||
from libprs500 import islinux
|
||||
from libprs500 import islinux, Settings
|
||||
from libprs500.gui2.dialogs.config_ui import Ui_Dialog
|
||||
from libprs500.gui2 import qstring_to_unicode, choose_dir, error_dialog
|
||||
from libprs500.gui2.widgets import FilenamePattern
|
||||
@ -31,7 +31,7 @@ class ConfigDialog(QDialog, Ui_Dialog):
|
||||
|
||||
self.db = db
|
||||
self.current_cols = columns
|
||||
settings = QSettings()
|
||||
settings = Settings()
|
||||
path = qstring_to_unicode(\
|
||||
settings.value("database path",
|
||||
QVariant(os.path.join(os.path.expanduser('~'),'library1.db'))).toString())
|
||||
@ -89,7 +89,7 @@ class ConfigDialog(QDialog, Ui_Dialog):
|
||||
self.directory_list.takeItem(idx)
|
||||
|
||||
def accept(self):
|
||||
settings = QSettings()
|
||||
settings = Settings()
|
||||
settings.setValue('use roman numerals for series number', QVariant(self.roman_numerals.isChecked()))
|
||||
settings.setValue('network timeout', QVariant(self.timeout.value()))
|
||||
path = qstring_to_unicode(self.location.text())
|
||||
@ -121,4 +121,4 @@ class Vacuum(QMessageBox):
|
||||
def vacuum(self):
|
||||
self.db.vacuum()
|
||||
self.accept()
|
||||
|
||||
|
||||
|
@ -18,13 +18,14 @@ GUI for fetching metadata from servers.
|
||||
|
||||
import logging, cStringIO
|
||||
|
||||
from PyQt4.QtCore import Qt, QObject, SIGNAL, QSettings, QVariant, \
|
||||
from PyQt4.QtCore import Qt, QObject, SIGNAL, QVariant, \
|
||||
QAbstractTableModel, QCoreApplication
|
||||
from PyQt4.QtGui import QDialog, QItemSelectionModel
|
||||
|
||||
from libprs500.gui2.dialogs.fetch_metadata_ui import Ui_FetchMetadata
|
||||
from libprs500.gui2 import error_dialog, NONE
|
||||
from libprs500.ebooks.metadata.isbndb import create_books, option_parser
|
||||
from libprs500 import Settings
|
||||
|
||||
class Matches(QAbstractTableModel):
|
||||
|
||||
@ -87,7 +88,7 @@ class FetchMetadata(QDialog, Ui_FetchMetadata):
|
||||
self.timeout = timeout
|
||||
QObject.connect(self.fetch, SIGNAL('clicked()'), self.fetch_metadata)
|
||||
|
||||
self.key.setText(QSettings().value('isbndb.com key', QVariant('')).toString())
|
||||
self.key.setText(Settings().value('isbndb.com key', QVariant('')).toString())
|
||||
|
||||
self.setWindowTitle(title if title else 'Unknown')
|
||||
self.tlabel.setText(self.tlabel.text().arg(title if title else 'Unknown'))
|
||||
@ -113,7 +114,7 @@ class FetchMetadata(QDialog, Ui_FetchMetadata):
|
||||
_('You must specify a valid access key for isbndb.com'))
|
||||
return
|
||||
else:
|
||||
QSettings().setValue('isbndb.com key', QVariant(self.key.text()))
|
||||
Settings().setValue('isbndb.com key', QVariant(self.key.text()))
|
||||
|
||||
args = ['isbndb']
|
||||
if self.isbn:
|
||||
|
@ -14,7 +14,7 @@
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
import os, cPickle, codecs
|
||||
|
||||
from PyQt4.QtCore import QObject, SIGNAL, Qt, QSettings, QVariant, QByteArray
|
||||
from PyQt4.QtCore import QObject, SIGNAL, Qt, QVariant, QByteArray
|
||||
from PyQt4.QtGui import QAbstractSpinBox, QLineEdit, QCheckBox, QDialog, \
|
||||
QPixmap, QTextEdit
|
||||
|
||||
@ -25,7 +25,7 @@ from libprs500.gui2 import qstring_to_unicode, error_dialog, \
|
||||
from libprs500.gui2.widgets import FontFamilyModel
|
||||
from libprs500.ebooks.lrf import option_parser
|
||||
from libprs500.ptempfile import PersistentTemporaryFile
|
||||
from libprs500 import __appname__
|
||||
from libprs500 import __appname__, Settings
|
||||
|
||||
font_family_model = None
|
||||
|
||||
@ -110,7 +110,7 @@ class LRFSingleDialog(QDialog, Ui_LRFSingleDialog):
|
||||
|
||||
|
||||
def load_saved_global_defaults(self):
|
||||
cmdline = QSettings().value('LRF conversion defaults', QVariant(QByteArray(''))).toByteArray().data()
|
||||
cmdline = Settings().value('LRF conversion defaults', QVariant(QByteArray(''))).toByteArray().data()
|
||||
if cmdline:
|
||||
cmdline = cPickle.loads(cmdline)
|
||||
self.set_options_from_cmdline(cmdline)
|
||||
@ -390,7 +390,7 @@ class LRFSingleDialog(QDialog, Ui_LRFSingleDialog):
|
||||
cmdline.extend([u'--cover', self.cover_file.name])
|
||||
self.cmdline = [unicode(i) for i in cmdline]
|
||||
else:
|
||||
QSettings().setValue('LRF conversion defaults', QVariant(QByteArray(cPickle.dumps(cmdline))))
|
||||
Settings().setValue('LRF conversion defaults', QVariant(QByteArray(cPickle.dumps(cmdline))))
|
||||
QDialog.accept(self)
|
||||
|
||||
class LRFBulkDialog(LRFSingleDialog):
|
||||
@ -411,4 +411,4 @@ class LRFBulkDialog(LRFSingleDialog):
|
||||
self.cmdline = self.cmdline = [unicode(i) for i in self.build_commandline()]
|
||||
self.cover_file = None
|
||||
QDialog.accept(self)
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ add/remove formats
|
||||
'''
|
||||
import os
|
||||
|
||||
from PyQt4.QtCore import SIGNAL, QObject, QCoreApplication, Qt, QVariant, QSettings
|
||||
from PyQt4.QtCore import SIGNAL, QObject, QCoreApplication, Qt, QVariant
|
||||
from PyQt4.QtGui import QPixmap, QListWidgetItem, QErrorMessage, QDialog
|
||||
|
||||
|
||||
@ -30,6 +30,7 @@ from libprs500.gui2.dialogs.tag_editor import TagEditor
|
||||
from libprs500.gui2.dialogs.password import PasswordDialog
|
||||
from libprs500.ebooks import BOOK_EXTENSIONS
|
||||
from libprs500.ebooks.metadata.library_thing import login, cover_from_isbn, LibraryThingError
|
||||
from libprs500 import Settings
|
||||
|
||||
class Format(QListWidgetItem):
|
||||
def __init__(self, parent, ext, size, path=None):
|
||||
@ -154,7 +155,7 @@ class MetadataSingleDialog(QDialog, Ui_MetadataSingleDialog):
|
||||
self.edit_tags)
|
||||
QObject.connect(self.remove_series_button, SIGNAL('clicked()'),
|
||||
self.remove_unused_series)
|
||||
self.timeout = float(QSettings().value('network timeout', QVariant(5)).toInt()[0])
|
||||
self.timeout = float(Settings().value('network timeout', QVariant(5)).toInt()[0])
|
||||
self.title.setText(db.title(row))
|
||||
isbn = db.isbn(self.id, index_is_id=True)
|
||||
if not isbn:
|
||||
@ -332,4 +333,4 @@ class MetadataSingleDialog(QDialog, Ui_MetadataSingleDialog):
|
||||
self.db.set_cover(self.id, pixmap_to_data(self.cover.pixmap()))
|
||||
self.changed = True
|
||||
QDialog.accept(self)
|
||||
|
||||
|
||||
|
@ -14,10 +14,11 @@
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from PyQt4.QtGui import QDialog, QLineEdit
|
||||
from PyQt4.QtCore import QSettings, QVariant, SIGNAL, Qt
|
||||
from PyQt4.QtCore import QVariant, SIGNAL, Qt
|
||||
|
||||
from libprs500.gui2.dialogs.password_ui import Ui_Dialog
|
||||
from libprs500.gui2 import qstring_to_unicode
|
||||
from libprs500 import Settings
|
||||
|
||||
class PasswordDialog(QDialog, Ui_Dialog):
|
||||
|
||||
@ -26,7 +27,7 @@ class PasswordDialog(QDialog, Ui_Dialog):
|
||||
Ui_Dialog.__init__(self)
|
||||
self.setupUi(self)
|
||||
|
||||
settings = QSettings()
|
||||
settings = Settings()
|
||||
un = settings.value(name+': un', QVariant('')).toString()
|
||||
pw = settings.value(name+': pw', QVariant('')).toString()
|
||||
self.gui_username.setText(un)
|
||||
@ -48,7 +49,7 @@ class PasswordDialog(QDialog, Ui_Dialog):
|
||||
return qstring_to_unicode(self.gui_password.text())
|
||||
|
||||
def accept(self):
|
||||
settings = QSettings()
|
||||
settings = Settings()
|
||||
settings.setValue(self.sname+': un', QVariant(self.gui_username.text()))
|
||||
settings.setValue(self.sname+': pw', QVariant(self.gui_password.text()))
|
||||
QDialog.accept(self)
|
||||
QDialog.accept(self)
|
||||
|
@ -15,10 +15,10 @@
|
||||
import traceback, logging, collections, time
|
||||
|
||||
from PyQt4.QtCore import QAbstractTableModel, QMutex, QObject, SIGNAL, Qt, \
|
||||
QVariant, QThread, QSettings
|
||||
QVariant, QThread
|
||||
from PyQt4.QtGui import QIcon, QDialog
|
||||
|
||||
from libprs500 import detect_ncpus
|
||||
from libprs500 import detect_ncpus, Settings
|
||||
from libprs500.gui2 import NONE, error_dialog
|
||||
from libprs500.parallel import Server
|
||||
from libprs500.gui2.dialogs.job_view_ui import Ui_Dialog
|
||||
@ -258,7 +258,7 @@ class JobManager(QAbstractTableModel):
|
||||
desc = kwargs.pop('job_description', '')
|
||||
if args and hasattr(args[0], 'append') and '--verbose' not in args[0]:
|
||||
args[0].append('--verbose')
|
||||
priority = self.PRIORITY[str(QSettings().value('conversion job priority',
|
||||
priority = self.PRIORITY[str(Settings().value('conversion job priority',
|
||||
QVariant('Normal')).toString())]
|
||||
job = self.create_job(ConversionJob, desc, slot, priority,
|
||||
callable, *args, **kwargs)
|
||||
|
@ -21,10 +21,9 @@ from PyQt4.QtGui import QTableView, QProgressDialog, QAbstractItemView, QColor,
|
||||
QPen, QStyle, QPainter, QLineEdit, QApplication, \
|
||||
QPalette
|
||||
from PyQt4.QtCore import QAbstractTableModel, QVariant, Qt, QString, \
|
||||
QCoreApplication, SIGNAL, QObject, QSize, QModelIndex, \
|
||||
QSettings
|
||||
QCoreApplication, SIGNAL, QObject, QSize, QModelIndex
|
||||
|
||||
from libprs500 import iswindows
|
||||
from libprs500 import iswindows, Settings
|
||||
from libprs500.ptempfile import PersistentTemporaryFile
|
||||
from libprs500.library.database import LibraryDatabase, SearchToken
|
||||
from libprs500.gui2 import NONE, TableView, qstring_to_unicode
|
||||
@ -115,7 +114,7 @@ class BooksModel(QAbstractTableModel):
|
||||
self.read_config()
|
||||
|
||||
def read_config(self):
|
||||
self.use_roman_numbers = bool(QSettings().value('use roman numerals for series number',
|
||||
self.use_roman_numbers = bool(Settings().value('use roman numerals for series number',
|
||||
QVariant(True)).toBool())
|
||||
|
||||
|
||||
@ -800,4 +799,4 @@ class SearchBox(QLineEdit):
|
||||
self.setText(txt)
|
||||
self.emit(SIGNAL('search(PyQt_PyObject, PyQt_PyObject)'), txt, False)
|
||||
self.end(False)
|
||||
self.initial_state = False
|
||||
self.initial_state = False
|
||||
|
@ -16,9 +16,9 @@ import sys, logging, os, traceback, time, cPickle
|
||||
|
||||
from PyQt4.QtGui import QApplication, QKeySequence, QPainter, QDialog
|
||||
from PyQt4.QtCore import Qt, QObject, SIGNAL, QCoreApplication, QThread, \
|
||||
QSettings, QVariant
|
||||
QVariant
|
||||
|
||||
from libprs500 import __appname__, __version__, __author__, setup_cli_handlers, islinux
|
||||
from libprs500 import __appname__, __version__, __author__, setup_cli_handlers, islinux, Settings
|
||||
from libprs500.ebooks.lrf.parser import LRFDocument
|
||||
|
||||
from libprs500.gui2 import ORG_NAME, APP_UID, error_dialog, choose_files
|
||||
@ -112,13 +112,13 @@ class Main(MainWindow, Ui_MainWindow):
|
||||
|
||||
|
||||
def configure(self, triggered):
|
||||
opts = cPickle.loads(str(QSettings().value('ebook viewer options', QVariant(cPickle.dumps(self.opts))).toString()))
|
||||
opts = cPickle.loads(str(Settings().value('ebook viewer options', QVariant(cPickle.dumps(self.opts))).toString()))
|
||||
d = Config(self, opts)
|
||||
d.exec_()
|
||||
if d.result() == QDialog.Accepted:
|
||||
opts.white_background = bool(d.white_background.isChecked())
|
||||
opts.hyphenate = bool(d.hyphenate.isChecked())
|
||||
QSettings().setValue('ebook viewer options', QVariant(cPickle.dumps(opts)))
|
||||
Settings().setValue('ebook viewer options', QVariant(cPickle.dumps(opts)))
|
||||
|
||||
def set_ebook(self, stream):
|
||||
self.progress_bar.setMinimum(0)
|
||||
@ -281,7 +281,7 @@ def option_parser():
|
||||
return parser
|
||||
|
||||
def normalize_settings(parser, opts):
|
||||
settings = QSettings()
|
||||
settings = Settings()
|
||||
saved_opts = cPickle.loads(str(settings.value('ebook viewer options', QVariant(cPickle.dumps(opts))).toString()))
|
||||
for opt in parser.option_list:
|
||||
if not opt.dest:
|
||||
|
@ -15,12 +15,12 @@
|
||||
import os, sys, textwrap, collections, traceback, shutil, time
|
||||
|
||||
from PyQt4.QtCore import Qt, SIGNAL, QObject, QCoreApplication, \
|
||||
QSettings, QVariant, QThread, QString
|
||||
QVariant, QThread, QString
|
||||
from PyQt4.QtGui import QPixmap, QColor, QPainter, QMenu, QIcon, QMessageBox, \
|
||||
QToolButton, QDialog
|
||||
from PyQt4.QtSvg import QSvgRenderer
|
||||
|
||||
from libprs500 import __version__, __appname__, islinux, sanitize_file_name, launch
|
||||
from libprs500 import __version__, __appname__, islinux, sanitize_file_name, launch, Settings
|
||||
from libprs500.ptempfile import PersistentTemporaryFile
|
||||
from libprs500.ebooks.metadata.meta import get_metadata, get_filename_pat, set_filename_pat
|
||||
from libprs500.devices.errors import FreeSpaceError
|
||||
@ -865,7 +865,7 @@ class Main(MainWindow, Ui_MainWindow):
|
||||
_('<p>An invalid database already exists at %s, delete it before trying to move the existing database.<br>Error: %s')%(newloc, str(err)))
|
||||
newloc = self.database_path
|
||||
self.database_path = newloc
|
||||
settings = QSettings()
|
||||
settings = Settings()
|
||||
settings.setValue("database path", QVariant(self.database_path))
|
||||
os.unlink(src.name)
|
||||
except Exception, err:
|
||||
@ -952,7 +952,7 @@ class Main(MainWindow, Ui_MainWindow):
|
||||
|
||||
|
||||
def read_settings(self):
|
||||
settings = QSettings()
|
||||
settings = Settings()
|
||||
settings.beginGroup("Main Window")
|
||||
geometry = settings.value('main window geometry', QVariant()).toByteArray()
|
||||
self.restoreGeometry(geometry)
|
||||
@ -965,7 +965,7 @@ class Main(MainWindow, Ui_MainWindow):
|
||||
|
||||
|
||||
def write_settings(self):
|
||||
settings = QSettings()
|
||||
settings = Settings()
|
||||
settings.beginGroup("Main Window")
|
||||
settings.setValue("main window geometry", QVariant(self.saveGeometry()))
|
||||
settings.endGroup()
|
||||
|
@ -20,12 +20,12 @@ from PyQt4.QtGui import QListView, QIcon, QFont, QLabel, QListWidget, \
|
||||
QListWidgetItem, QTextCharFormat, QApplication, \
|
||||
QSyntaxHighlighter, QCursor, QColor, QWidget
|
||||
from PyQt4.QtCore import QAbstractListModel, QVariant, Qt, QSize, SIGNAL, \
|
||||
QObject, QRegExp, QSettings
|
||||
QObject, QRegExp
|
||||
|
||||
from libprs500.gui2.jobs import DetailView
|
||||
from libprs500.gui2 import human_readable, NONE, TableView, qstring_to_unicode, error_dialog
|
||||
from libprs500.gui2.filename_pattern_ui import Ui_Form
|
||||
from libprs500 import fit_image, get_font_families
|
||||
from libprs500 import fit_image, get_font_families, Settings
|
||||
from libprs500.ebooks.metadata.meta import get_filename_pat, metadata_from_filename, \
|
||||
set_filename_pat
|
||||
|
||||
@ -303,7 +303,7 @@ class PythonHighlighter(QSyntaxHighlighter):
|
||||
value = default
|
||||
Config[name] = value
|
||||
|
||||
settings = QSettings()
|
||||
settings = Settings()
|
||||
for name in ("window", "shell"):
|
||||
Config["%swidth" % name] = settings.value("%swidth" % name,
|
||||
QVariant(QApplication.desktop() \
|
||||
|
Loading…
x
Reference in New Issue
Block a user