experiment with standalone windows

This commit is contained in:
Damien Elmes 2009-04-21 02:16:17 +09:00
parent 36881da474
commit a422ddb57b
3 changed files with 10 additions and 1 deletions

View file

@ -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(),

View file

@ -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()

View file

@ -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