mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-10 00:07:51 -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",
|
"LocalFileOutputDevice",
|
||||||
"TranslateTool",
|
"TranslateTool",
|
||||||
"FileLogger",
|
"FileLogger",
|
||||||
"XmlMaterialProfile"
|
"XmlMaterialProfile",
|
||||||
|
|
||||||
])
|
])
|
||||||
self._physics = None
|
self._physics = None
|
||||||
self._volume = None
|
self._volume = None
|
||||||
|
|
|
@ -23,9 +23,9 @@ i18n_catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
|
|
||||||
class PluginBrowser(QObject, Extension):
|
class PluginBrowser(QObject, Extension):
|
||||||
def __init__(self, parent = None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.addMenuItem(i18n_catalog.i18nc("@menuitem", "Browse plugins"), self.browsePlugins)
|
|
||||||
self._api_version = 1
|
self._api_version = 1
|
||||||
self._api_url = "http://software.ultimaker.com/cura/v%s/" % self._api_version
|
self._api_url = "http://software.ultimaker.com/cura/v%s/" % self._api_version
|
||||||
|
|
||||||
|
@ -92,6 +92,7 @@ class PluginBrowser(QObject, Extension):
|
||||||
def isDownloading(self):
|
def isDownloading(self):
|
||||||
return self._is_downloading
|
return self._is_downloading
|
||||||
|
|
||||||
|
@pyqtSlot()
|
||||||
def browsePlugins(self):
|
def browsePlugins(self):
|
||||||
self._createNetworkManager()
|
self._createNetworkManager()
|
||||||
self.requestPluginList()
|
self.requestPluginList()
|
||||||
|
|
|
@ -61,6 +61,9 @@ Item
|
||||||
|
|
||||||
property alias configureSettingVisibility: configureSettingVisibilityAction
|
property alias configureSettingVisibility: configureSettingVisibilityAction
|
||||||
|
|
||||||
|
property alias browsePlugins: browsePluginsAction
|
||||||
|
property alias configurePlugins: configurePluginsAction
|
||||||
|
|
||||||
UM.I18nCatalog{id: catalog; name:"cura"}
|
UM.I18nCatalog{id: catalog; name:"cura"}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
|
@ -362,4 +365,18 @@ Item
|
||||||
text: catalog.i18nc("@action:menu", "Configure setting visibility...");
|
text: catalog.i18nc("@action:menu", "Configure setting visibility...");
|
||||||
iconName: "configure"
|
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
|
id: sub_menu
|
||||||
title: model.name;
|
title: model.name;
|
||||||
visible: actions != null
|
visible: actions != null
|
||||||
enabled:actions != null
|
enabled: actions != null
|
||||||
Instantiator
|
Instantiator
|
||||||
{
|
{
|
||||||
model: actions
|
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
|
Menu
|
||||||
{
|
{
|
||||||
title: catalog.i18nc("@title:menu menubar:toplevel","P&references");
|
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
|
Timer
|
||||||
{
|
{
|
||||||
id: createProfileTimer
|
id: createProfileTimer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue