From a422ddb57b3a0a0c8eefd26c40dc614d52b4d5c3 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 21 Apr 2009 02:16:17 +0900 Subject: [PATCH] experiment with standalone windows --- ankiqt/config.py | 1 + ankiqt/ui/addcards.py | 6 +++++- ankiqt/ui/cardlist.py | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ankiqt/config.py b/ankiqt/config.py index 2b3e6d26e..90f667a32 100644 --- a/ankiqt/config.py +++ b/ankiqt/config.py @@ -75,6 +75,7 @@ class Config(dict): 'showStudyOptions': False, 'showStudyStats': True, 'showCardTimer': True, + 'standaloneWindows': True, 'extraNewCards': 5, 'randomizeOnCram': True, 'created': time.time(), diff --git a/ankiqt/ui/addcards.py b/ankiqt/ui/addcards.py index 31f98e13c..40497f545 100644 --- a/ankiqt/ui/addcards.py +++ b/ankiqt/ui/addcards.py @@ -22,7 +22,11 @@ class FocusButton(QPushButton): class AddCards(QDialog): 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.config = parent.config self.dialog = ankiqt.forms.addcards.Ui_AddCards() diff --git a/ankiqt/ui/cardlist.py b/ankiqt/ui/cardlist.py index 31327983a..e458b7205 100644 --- a/ankiqt/ui/cardlist.py +++ b/ankiqt/ui/cardlist.py @@ -278,6 +278,10 @@ class StatusDelegate(QItemDelegate): class EditDeck(QMainWindow): def __init__(self, parent): + if parent.config['standaloneWindows']: + windParent = None + else: + windParent = parent QMainWindow.__init__(self, parent) self.parent = parent self.deck = self.parent.deck