|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2010 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing a dialog to configure the offline storage. |
|
8 """ |
|
9 |
|
10 from PyQt4.QtGui import QDialog |
|
11 |
|
12 from .Ui_OfflineStorageConfigDialog import Ui_OfflineStorageConfigDialog |
|
13 |
|
14 import Preferences |
|
15 |
|
16 class OfflineStorageConfigDialog(QDialog, Ui_OfflineStorageConfigDialog): |
|
17 """ |
|
18 Class implementing a dialog to configure the offline storage. |
|
19 """ |
|
20 def __init__(self, parent = None): |
|
21 """ |
|
22 Constructor |
|
23 |
|
24 @param parent reference to the parent widget (QWidget) |
|
25 """ |
|
26 QDialog.__init__(self, parent) |
|
27 self.setupUi(self) |
|
28 |
|
29 self.databaseEnabledCheckBox.setChecked( |
|
30 Preferences.getHelp("OfflineStorageDatabaseEnabled")) |
|
31 self.databaseQuotaSpinBox.setValue( |
|
32 Preferences.getHelp("OfflineStorageDatabaseQuota")) |
|
33 |
|
34 def storeData(self): |
|
35 """ |
|
36 Public slot to store the configuration data. |
|
37 """ |
|
38 Preferences.setHelp("OfflineStorageDatabaseEnabled", |
|
39 self.databaseEnabledCheckBox.isChecked()) |
|
40 Preferences.setHelp("OfflineStorageDatabaseQuota", |
|
41 self.databaseQuotaSpinBox.value()) |