diff --git a/delete_all.py b/delete_all.py index 98d1ad4..043c269 100644 --- a/delete_all.py +++ b/delete_all.py @@ -21,6 +21,7 @@ import os from qgis.core import QgsProject +from qgis.gui import QgsGui from qgis.PyQt.QtCore import QCoreApplication, QSettings, QTranslator from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtWidgets import QAction, QMenu, QMessageBox @@ -62,6 +63,10 @@ def initGui(self): self.action.triggered.connect(self.deleteAll) self.aboutAction.triggered.connect(self.about) + self.iface.registerMainWindowAction(self.action, self.tr("Ctrl+Alt+D")) + if self.action.shortcut().isEmpty() and QgsGui.shortcutsManager().actionForSequence(self.tr("Ctrl+Alt+D")) is None: + QgsGui.shortcutsManager().setObjectKeySequence(self.action, self.tr("Ctrl+Alt+D")) + self.menu = QMenu(self.tr("&delete-all")) self.menu.setIcon(QIcon(os.path.join(self.plugin_dir, "delete_all.png"))) self.menu.addActions([self.action, self.aboutAction]) @@ -72,6 +77,7 @@ def initGui(self): def unload(self): self.iface.removePluginMenu(self.tr("&delete-all"), self.action) self.iface.removePluginMenu(self.tr("&delete-all"), self.aboutAction) + self.iface.unregisterMainWindowAction(self.action) del self.action del self.toolbar diff --git a/i18n/delete_all_de.qm b/i18n/delete_all_de.qm index 4020b3e..60423d0 100644 Binary files a/i18n/delete_all_de.qm and b/i18n/delete_all_de.qm differ diff --git a/i18n/delete_all_de.ts b/i18n/delete_all_de.ts index 4f81150..eb554d1 100644 --- a/i18n/delete_all_de.ts +++ b/i18n/delete_all_de.ts @@ -4,29 +4,34 @@ DeleteAll - + delete-all alles-löschen - + &delete-all &alles-löschen - + QGIS plugin to delete all groups and layers from the layer widget QGIS-Plugin zum Löschen aller Gruppen und Layer im Layer-Fenster - + About delete-all Über alles-löschen - + &About delete-all &Über alles-löschen + + + Ctrl+Alt+D + Strg+Alt+D +