37
37
from base.g import *
38
38
from base import utils, module
44
40
USAGE = [ (__doc__, "", "name", True),
45
("Usage: %s [MODE] [OPTIONS]" % __mod__, "", "summary", True),
47
("Installation for required printer mode:", "--required (Qt4 only)", "option", False),
48
("Installation for optional printer mode:", "--optional (Qt4 only)", "option", False),
49
#("Installation generic mode:", "--generic (default)", "option", False),
41
("Usage: %s [OPTIONS]" % __mod__, "", "summary", True),
51
42
utils.USAGE_OPTIONS,
52
43
utils.USAGE_LOGGING1, utils.USAGE_LOGGING2, utils.USAGE_LOGGING3,
67
58
mod.parseStdOpts( handle_device_printer=False)
70
install_mode = PLUGIN_NONE # reuse plugin types for mode (PLUGIN_NONE = generic)
61
install_mode = PLUGIN_REQUIRED
71
62
plugin_reason = PLUGIN_REASON_NONE
75
install_mode = PLUGIN_REQUIRED
76
if ui_toolkit == 'qt3':
77
log.warn("--required switch ignored.")
79
elif o == '--optional':
80
install_mode = PLUGIN_OPTIONAL
81
if ui_toolkit == 'qt3':
82
log.warn("--optional switch ignored.")
85
plugin_reason = int(a)
88
version = prop.installed_version
92
64
if mode == GUI_MODE:
93
65
if ui_toolkit == 'qt3':
94
if not utils.canEnterGUIMode():
95
log.error("%s requires GUI support (try running with --qt4). Try using interactive (-i) mode." % __mod__)
66
log.error("Unable to load Qt3. Please use Qt4")
98
69
if not utils.canEnterGUIMode4():
99
log.error("%s requires GUI support (try running with --qt3). Try using interactive (-i) mode." % __mod__)
70
log.error("%s requires GUI support . Is Qt4 installed?" % __mod__)
104
if ui_toolkit == 'qt3':
105
log.error("Unable to load Qt3. Please use qt4")
109
74
from PyQt4.QtGui import QApplication, QMessageBox
110
75
from ui4.plugindiagnose import PluginDiagnose
76
from installer import core_install
111
77
except ImportError:
112
78
log.error("Unable to load Qt4 support. Is it installed?")
115
81
app = QApplication(sys.argv)
82
core = core_install.CoreInstall()
83
plugin_sts = core.check_for_plugin()
84
if plugin_sts == PLUGIN_INSTALLED:
85
log.info("Device Plugin is already installed")
87
elif plugin_sts == PLUGIN_VERSION_MISMATCH:
88
dialog = PluginDiagnose(None, install_mode, plugin_reason, True)
90
dialog = PluginDiagnose(None, install_mode, plugin_reason)
117
dialog = PluginDiagnose(None, install_mode, plugin_reason)
121
94
log.debug("Starting GUI loop...")
123
96
except KeyboardInterrupt:
124
97
log.error("User exit")
99
else: #Interaction mode
100
log.error("Only Qt4 GUI mode is supported \n")
129
104
log.info("Done.")