53
53
class PluginDialog(QDialog, Ui_Dialog):
54
def __init__(self, parent, install_mode=PLUGIN_NONE):
54
def __init__(self, parent, install_mode=PLUGIN_NONE, plugin_reason=PLUGIN_REASON_NONE):
55
55
QDialog.__init__(self, parent)
56
56
self.install_mode = install_mode
57
self.plugin_reason = plugin_reason
57
58
self.plugin_path = None
58
59
self.result = False
59
60
self.core = CoreInstall()
82
83
self.setWindowIcon(QIcon(load_pixmap('hp_logo', '128x128')))
85
self.PLUGIN_REASON_TEXT = {
86
PLUGIN_REASON_NONE: None,
87
PLUGIN_REASON_PRINTING_SUPPORT: self.__tr("This plugin will enable printing support."),
88
PLUGIN_REASON_FASTER_PRINTING: self.__tr("This plugin will enhance print speed."),
89
PLUGIN_REASON_BETTER_PRINTING_PQ: self.__tr("This plugin will enhance print quality."),
90
PLUGIN_REASON_PRINTING_FEATURES: self.__tr("This plugin will add printing features."),
91
PLUGIN_REASON_RESERVED_10: None,
92
PLUGIN_REASON_RESERVED_20: None,
93
PLUGIN_REASON_SCANNING_SUPPORT: self.__tr("This plugin will enable scanning support."),
94
PLUGIN_REASON_FASTER_SCANNING: self.__tr("This plugin will enhance scanning speed."),
95
PLUGIN_REASON_BETTER_SCANNING_IQ: self.__tr("This plugin will enhance scanning image quality."),
96
PLUGIN_REASON_RESERVED_200: None,
97
PLUGIN_REASON_RESERVED_400: None,
98
PLUGIN_REASON_FAXING_SUPPORT: self.__tr("This plugin will enable faxing support."),
99
PLUGIN_REASON_FAX_FEATURES: self.__tr("This plugin will enhnace faxing features."),
100
PLUGIN_REASON_RESERVED_20000: None,
101
PLUGIN_REASON_RESERVED_40000: None,
88
107
def showSourcePage(self):
89
if self.install_mode == PLUGIN_REQUIRED:
90
self.TitleLabel.setText(self.__tr("An additional driver plug-in is required to operate this printer. You may download the plug-in directly from an HP authorized server (recommended), or, if you already have a copy of the file, you can specify a path to the file (advanced)."))
91
self.SkipRadioButton.setEnabled(False)
93
elif self.install_mode == PLUGIN_OPTIONAL:
94
self.TitleLabel.setText(self.__tr("An optional driver plug-in is available to enhance the operation of this printer. You may download the plug-in directly from an HP authorized server (recommended), skip this installation (not recommended), or, if you already have a copy of the file, you can specify a path to the file (advanced)."))
108
reason_text = self.plugin_reason_text()
110
if reason_text is not None:
111
if self.install_mode == PLUGIN_REQUIRED:
112
self.TitleLabel.setText(self.__tr("An additional driver plug-in is required to operate this printer. You may download the plug-in directly from an HP authorized server (recommended), or, if you already have a copy of the file, you can specify a path to the file (advanced). <br><br>%1").arg(reason_text))
113
self.SkipRadioButton.setEnabled(False)
115
elif self.install_mode == PLUGIN_OPTIONAL:
116
self.TitleLabel.setText(self.__tr("An optional driver plug-in is available to enhance the operation of this printer. You may download the plug-in directly from an HP authorized server (recommended), skip this installation (not recommended), or, if you already have a copy of the file, you can specify a path to the file (advanced).<br><br>%1").arg(reason_text))
96
118
self.connect(self.DownloadRadioButton, SIGNAL("toggled(bool)"), self.DownloadRadioButton_toggled)
97
119
self.connect(self.CopyRadioButton, SIGNAL("toggled(bool)"), self.CopyRadioButton_toggled)