mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
CURA-4390 add new menu item for plugins
This commit is contained in:
parent
a3eae31982
commit
b0fa87231c
4 changed files with 56 additions and 4 deletions
|
@ -220,7 +220,8 @@ class CuraApplication(QtApplication):
|
|||
"LocalFileOutputDevice",
|
||||
"TranslateTool",
|
||||
"FileLogger",
|
||||
"XmlMaterialProfile"
|
||||
"XmlMaterialProfile",
|
||||
|
||||
])
|
||||
self._physics = None
|
||||
self._volume = None
|
||||
|
|
|
@ -23,9 +23,9 @@ i18n_catalog = i18nCatalog("cura")
|
|||
|
||||
|
||||
class PluginBrowser(QObject, Extension):
|
||||
def __init__(self, parent = None):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.addMenuItem(i18n_catalog.i18nc("@menuitem", "Browse plugins"), self.browsePlugins)
|
||||
|
||||
self._api_version = 1
|
||||
self._api_url = "http://software.ultimaker.com/cura/v%s/" % self._api_version
|
||||
|
||||
|
@ -92,6 +92,7 @@ class PluginBrowser(QObject, Extension):
|
|||
def isDownloading(self):
|
||||
return self._is_downloading
|
||||
|
||||
@pyqtSlot()
|
||||
def browsePlugins(self):
|
||||
self._createNetworkManager()
|
||||
self.requestPluginList()
|
||||
|
|
|
@ -61,6 +61,9 @@ Item
|
|||
|
||||
property alias configureSettingVisibility: configureSettingVisibilityAction
|
||||
|
||||
property alias browsePlugins: browsePluginsAction
|
||||
property alias configurePlugins: configurePluginsAction
|
||||
|
||||
UM.I18nCatalog{id: catalog; name:"cura"}
|
||||
|
||||
Action
|
||||
|
@ -362,4 +365,18 @@ Item
|
|||
text: catalog.i18nc("@action:menu", "Configure setting visibility...");
|
||||
iconName: "configure"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: browsePluginsAction
|
||||
text: catalog.i18nc("@action:menu", "Browse plugins...")
|
||||
iconName: "plugins_browse"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: configurePluginsAction
|
||||
text: catalog.i18nc("@action:menu", "Installed plugins...");
|
||||
iconName: "plugins_configure"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -207,7 +207,7 @@ UM.MainWindow
|
|||
id: sub_menu
|
||||
title: model.name;
|
||||
visible: actions != null
|
||||
enabled:actions != null
|
||||
enabled: actions != null
|
||||
Instantiator
|
||||
{
|
||||
model: actions
|
||||
|
@ -226,6 +226,15 @@ UM.MainWindow
|
|||
}
|
||||
}
|
||||
|
||||
Menu
|
||||
{
|
||||
id: plugin_menu
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel", "P&lugins")
|
||||
|
||||
MenuItem { action: Cura.Actions.browsePlugins }
|
||||
MenuItem { action: Cura.Actions.configurePlugins }
|
||||
}
|
||||
|
||||
Menu
|
||||
{
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel","P&references");
|
||||
|
@ -543,6 +552,30 @@ UM.MainWindow
|
|||
}
|
||||
}
|
||||
|
||||
// show the installed plugins page in the preferences dialog
|
||||
Connections
|
||||
{
|
||||
target: Cura.Actions.configurePlugins
|
||||
onTriggered:
|
||||
{
|
||||
preferences.visible = true
|
||||
preferences.setPage(5)
|
||||
}
|
||||
}
|
||||
|
||||
UM.ExtensionModel {
|
||||
id: curaExtensions
|
||||
}
|
||||
|
||||
// show the plugin browser dialog
|
||||
Connections
|
||||
{
|
||||
target: Cura.Actions.browsePlugins
|
||||
onTriggered: {
|
||||
curaExtensions.callExtensionMethod("Plugin Browser", "browsePlugins")
|
||||
}
|
||||
}
|
||||
|
||||
Timer
|
||||
{
|
||||
id: createProfileTimer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue