mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
experiment with standalone windows
This commit is contained in:
parent
36881da474
commit
a422ddb57b
3 changed files with 10 additions and 1 deletions
|
@ -75,6 +75,7 @@ class Config(dict):
|
||||||
'showStudyOptions': False,
|
'showStudyOptions': False,
|
||||||
'showStudyStats': True,
|
'showStudyStats': True,
|
||||||
'showCardTimer': True,
|
'showCardTimer': True,
|
||||||
|
'standaloneWindows': True,
|
||||||
'extraNewCards': 5,
|
'extraNewCards': 5,
|
||||||
'randomizeOnCram': True,
|
'randomizeOnCram': True,
|
||||||
'created': time.time(),
|
'created': time.time(),
|
||||||
|
|
|
@ -22,7 +22,11 @@ class FocusButton(QPushButton):
|
||||||
class AddCards(QDialog):
|
class AddCards(QDialog):
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
QDialog.__init__(self, parent, Qt.Window)
|
if parent.config['standaloneWindows']:
|
||||||
|
windParent = None
|
||||||
|
else:
|
||||||
|
windParent = parent
|
||||||
|
QDialog.__init__(self, windParent, Qt.Window)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.config = parent.config
|
self.config = parent.config
|
||||||
self.dialog = ankiqt.forms.addcards.Ui_AddCards()
|
self.dialog = ankiqt.forms.addcards.Ui_AddCards()
|
||||||
|
|
|
@ -278,6 +278,10 @@ class StatusDelegate(QItemDelegate):
|
||||||
class EditDeck(QMainWindow):
|
class EditDeck(QMainWindow):
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
|
if parent.config['standaloneWindows']:
|
||||||
|
windParent = None
|
||||||
|
else:
|
||||||
|
windParent = parent
|
||||||
QMainWindow.__init__(self, parent)
|
QMainWindow.__init__(self, parent)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.deck = self.parent.deck
|
self.deck = self.parent.deck
|
||||||
|
|
Loading…
Reference in a new issue