-
Notifications
You must be signed in to change notification settings - Fork 1
/
emain.py
55 lines (41 loc) · 1.57 KB
/
emain.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2017, Kerim Ölçer <[email protected]>, Ali Güven Odabaşıoğlu <[email protected]>'
__docformat__ = 'restructuredtext en'
if False:
get_icons = get_resources = None
#Another import
import os, re, sys
from PyQt5.Qt import QDialog, QVBoxLayout, QPushButton, QMessageBox, QLabel, QLineEdit
from PyQt5.QtWidgets import QWidget, QDesktopWidget
from PyQt5.QtCore import Qt
#Calibre config files import
from calibre_plugins.cloud_sync.config import prefs
from calibre.utils.config import config_dir
#Gui import
from calibre_plugins.cloud_sync.gui.error import Ui_Dialog as ErrorMainWindow
try:
load_translations()
except NameError:
pass # load_translations() added in calibre 1.9
class DemoDialog(QDialog):
def __init__(self, gui, icon, do_user_config):
QDialog.__init__(self, gui)
self.gui = gui
self.do_user_config = do_user_config
self.db = gui.current_db
#MainWindow
class MainWindowForm(QWidget, ErrorMainWindow):
def __init__(self, parent=None):
QWidget.__init__(self, parent)
self.setupUi(self)
self.setWindowFlags(Qt.Window)
self.move(QDesktopWidget().availableGeometry().center() - self.frameGeometry().center())
def error_dialog(self):
self.errorMainWindow = ErrorMainWindow()
self.hide()
self.errorMainWindow.exec_()
self.show()