12 import imp |
12 import imp |
13 import shutil |
13 import shutil |
14 |
14 |
15 from PyQt4.QtGui import * |
15 from PyQt4.QtGui import * |
16 from PyQt4.QtCore import * |
16 from PyQt4.QtCore import * |
|
17 |
|
18 from E5Gui import E5MessageBox |
17 |
19 |
18 from .PluginManager import PluginManager |
20 from .PluginManager import PluginManager |
19 from .Ui_PluginUninstallDialog import Ui_PluginUninstallDialog |
21 from .Ui_PluginUninstallDialog import Ui_PluginUninstallDialog |
20 |
22 |
21 class PluginUninstallWidget(QWidget, Ui_PluginUninstallDialog): |
23 class PluginUninstallWidget(QWidget, Ui_PluginUninstallDialog): |
133 if os.path.exists(fnamec): |
135 if os.path.exists(fnamec): |
134 os.remove(fnamec) |
136 os.remove(fnamec) |
135 |
137 |
136 os.remove(pluginFile) |
138 os.remove(pluginFile) |
137 except OSError as err: |
139 except OSError as err: |
138 QMessageBox.critical(None, |
140 QMessageBox.critical(self, |
139 self.trUtf8("Plugin Uninstallation"), |
141 self.trUtf8("Plugin Uninstallation"), |
140 self.trUtf8("""<p>The plugin package <b>{0}</b> could not be""" |
142 self.trUtf8("""<p>The plugin package <b>{0}</b> could not be""" |
141 """ removed. Aborting...</p>""" |
143 """ removed. Aborting...</p>""" |
142 """<p>Reason: {1}</p>""").format(packageDir, str(err))) |
144 """<p>Reason: {1}</p>""").format(packageDir, str(err))) |
143 return False |
145 return False |
144 |
146 |
145 QMessageBox.information(None, |
147 E5MessageBox.information(self, |
146 self.trUtf8("Plugin Uninstallation"), |
148 self.trUtf8("Plugin Uninstallation"), |
147 self.trUtf8("""<p>The plugin <b>{0}</b> was uninstalled successfully""" |
149 self.trUtf8("""<p>The plugin <b>{0}</b> was uninstalled successfully""" |
148 """ from {1}.</p>""")\ |
150 """ from {1}.</p>""")\ |
149 .format(pluginName, pluginDirectory)) |
151 .format(pluginName, pluginDirectory)) |
150 return True |
152 return True |