mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
CURA-5035: Clean-up
This commit is contained in:
parent
6e9f7174b6
commit
e13c45daee
19 changed files with 185 additions and 179 deletions
|
|
@ -43,27 +43,27 @@ Window
|
|||
ToolboxLoadingPage
|
||||
{
|
||||
id: viewLoading
|
||||
visible: manager.viewCategory != "installed" && manager.viewPage == "loading"
|
||||
visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "loading"
|
||||
}
|
||||
ToolboxDownloadsPage
|
||||
{
|
||||
id: viewDownloads
|
||||
visible: manager.viewCategory != "installed" && manager.viewPage == "overview"
|
||||
visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "overview"
|
||||
}
|
||||
ToolboxDetailPage
|
||||
{
|
||||
id: viewDetail
|
||||
visible: manager.viewCategory != "installed" && manager.viewPage == "detail"
|
||||
visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "detail"
|
||||
}
|
||||
ToolboxAuthorPage
|
||||
{
|
||||
id: viewAuthor
|
||||
visible: manager.viewCategory != "installed" && manager.viewPage == "author"
|
||||
visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "author"
|
||||
}
|
||||
ToolboxInstalledPage
|
||||
{
|
||||
id: installedPluginList
|
||||
visible: manager.viewCategory == "installed"
|
||||
visible: toolbox.viewCategory == "installed"
|
||||
}
|
||||
}
|
||||
ToolboxShadow
|
||||
|
|
@ -83,21 +83,21 @@ Window
|
|||
|
||||
Connections
|
||||
{
|
||||
target: manager
|
||||
target: toolbox
|
||||
onShowLicenseDialog:
|
||||
{
|
||||
licenseDialog.pluginName = manager.getLicenseDialogPluginName();
|
||||
licenseDialog.licenseContent = manager.getLicenseDialogLicenseContent();
|
||||
licenseDialog.pluginFileLocation = manager.getLicenseDialogPluginFileLocation();
|
||||
licenseDialog.pluginName = toolbox.getLicenseDialogPluginName();
|
||||
licenseDialog.licenseContent = toolbox.getLicenseDialogLicenseContent();
|
||||
licenseDialog.pluginFileLocation = toolbox.getLicenseDialogPluginFileLocation();
|
||||
licenseDialog.show();
|
||||
}
|
||||
}
|
||||
Connections
|
||||
{
|
||||
target: manager
|
||||
target: toolbox
|
||||
onShowRestartDialog:
|
||||
{
|
||||
restartDialog.message = manager.getRestartDialogMessage();
|
||||
restartDialog.message = toolbox.getRestartDialogMessage();
|
||||
restartDialog.show();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import UM 1.1 as UM
|
|||
Item
|
||||
{
|
||||
id: base
|
||||
property var details: manager.authorsModel.items[0]
|
||||
property var details: toolbox.authorsModel.items[0]
|
||||
anchors.fill: parent
|
||||
ToolboxBackColumn
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ Item
|
|||
height: UM.Theme.getSize("base_unit").height * 2
|
||||
onClicked:
|
||||
{
|
||||
manager.viewPage = "overview"
|
||||
manager.filterPackages("type", manager.viewCategory)
|
||||
manager.filterAuthors("type", manager.viewCategory)
|
||||
toolbox.viewPage = "overview"
|
||||
toolbox.filterPackages("type", toolbox.viewCategory)
|
||||
toolbox.filterAuthors("type", toolbox.viewCategory)
|
||||
}
|
||||
style: ButtonStyle
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ Item
|
|||
spacing: UM.Theme.getSize("default_margin").height
|
||||
Repeater
|
||||
{
|
||||
model: manager.packagesModel
|
||||
model: toolbox.packagesModel
|
||||
delegate: ToolboxDetailTile {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import UM 1.1 as UM
|
|||
Item
|
||||
{
|
||||
id: base
|
||||
property var details: manager.packagesModel.items[0]
|
||||
property var details: toolbox.packagesModel.items[0]
|
||||
anchors.fill: parent
|
||||
ToolboxBackColumn
|
||||
{
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ Rectangle
|
|||
Button {
|
||||
id: installButton
|
||||
text: {
|
||||
if ( manager.isDownloading && manager.activePackage == model )
|
||||
if ( toolbox.isDownloading && toolbox.activePackage == model )
|
||||
{
|
||||
return catalog.i18nc("@action:button", "Cancel")
|
||||
}
|
||||
|
|
@ -59,9 +59,9 @@ Rectangle
|
|||
}
|
||||
enabled:
|
||||
{
|
||||
if ( manager.isDownloading )
|
||||
if ( toolbox.isDownloading )
|
||||
{
|
||||
return manager.activePackage == model ? true : false
|
||||
return toolbox.activePackage == model ? true : false
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -88,21 +88,21 @@ Rectangle
|
|||
onClicked:
|
||||
{
|
||||
console.log( "MODEL", model.id )
|
||||
manager.activePackage = model
|
||||
// if ( manager.isDownloading && manager.activePackage == model )
|
||||
if ( manager.isDownloading )
|
||||
toolbox.activePackage = model
|
||||
// if ( toolbox.isDownloading && toolbox.activePackage == model )
|
||||
if ( toolbox.isDownloading )
|
||||
{
|
||||
manager.cancelDownload();
|
||||
toolbox.cancelDownload();
|
||||
}
|
||||
else
|
||||
{
|
||||
// manager.activePackage = model;
|
||||
// toolbox.activePackage = model;
|
||||
if ( model.can_upgrade )
|
||||
{
|
||||
// manager.downloadAndInstallPlugin( model.update_url );
|
||||
// toolbox.downloadAndInstallPlugin( model.update_url );
|
||||
}
|
||||
else {
|
||||
manager.startDownload( model.download_url );
|
||||
toolbox.startDownload( model.download_url );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Column
|
|||
Label
|
||||
{
|
||||
id: heading
|
||||
text: manager.viewCategory == "material" ? "Maker Choices" : "Community Plugins"
|
||||
text: toolbox.viewCategory == "material" ? "Maker Choices" : "Community Plugins"
|
||||
width: parent.width
|
||||
color: UM.Theme.getColor("text_medium")
|
||||
font: UM.Theme.getFont("medium")
|
||||
|
|
@ -34,7 +34,7 @@ Column
|
|||
|
||||
Repeater
|
||||
{
|
||||
model: manager.viewCategory == "material" ? manager.authorsModel : manager.packagesModel
|
||||
model: toolbox.viewCategory == "material" ? toolbox.authorsModel : toolbox.packagesModel
|
||||
delegate: ToolboxDownloadsGridTile
|
||||
{
|
||||
Layout.preferredWidth: (grid.width - (grid.columns - 1) * grid.columnSpacing) / grid.columns
|
||||
|
|
|
|||
|
|
@ -88,19 +88,19 @@ Item
|
|||
}
|
||||
onClicked:
|
||||
{
|
||||
if ( manager.viewCategory == "material" )
|
||||
if ( toolbox.viewCategory == "material" )
|
||||
{
|
||||
manager.viewSelection = model.name
|
||||
manager.viewPage = "author"
|
||||
manager.filterAuthors("name", model.name)
|
||||
manager.filterPackages("author_name", model.name)
|
||||
toolbox.viewSelection = model.name
|
||||
toolbox.viewPage = "author"
|
||||
toolbox.filterAuthors("name", model.name)
|
||||
toolbox.filterPackages("author_name", model.name)
|
||||
}
|
||||
else
|
||||
{
|
||||
manager.viewSelection = model.id
|
||||
manager.viewPage = "detail"
|
||||
manager.filterAuthors("name", model.author_name)
|
||||
manager.filterPackages("id", model.id)
|
||||
toolbox.viewSelection = model.id
|
||||
toolbox.viewPage = "detail"
|
||||
toolbox.filterAuthors("name", model.author_name)
|
||||
toolbox.filterPackages("id", model.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,13 +35,13 @@ Column
|
|||
Repeater
|
||||
{
|
||||
model: {
|
||||
if ( manager.viewCategory == "plugin" )
|
||||
if ( toolbox.viewCategory == "plugin" )
|
||||
{
|
||||
return manager.pluginsShowcaseModel
|
||||
return toolbox.pluginsShowcaseModel
|
||||
}
|
||||
if ( manager.viewCategory == "material" )
|
||||
if ( toolbox.viewCategory == "material" )
|
||||
{
|
||||
return manager.materialsShowcaseModel
|
||||
return toolbox.materialsShowcaseModel
|
||||
}
|
||||
}
|
||||
delegate: ToolboxDownloadsShowcaseTile {}
|
||||
|
|
|
|||
|
|
@ -51,19 +51,19 @@ Item
|
|||
{
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
switch(manager.viewCategory)
|
||||
switch(toolbox.viewCategory)
|
||||
{
|
||||
case "material":
|
||||
manager.viewSelection = model.name
|
||||
manager.viewPage = "author"
|
||||
manager.filterAuthors("name", model.name)
|
||||
manager.filterPackages("author_name", model.name)
|
||||
toolbox.viewSelection = model.name
|
||||
toolbox.viewPage = "author"
|
||||
toolbox.filterAuthors("name", model.name)
|
||||
toolbox.filterPackages("author_name", model.name)
|
||||
break
|
||||
default:
|
||||
manager.viewSelection = model.id
|
||||
manager.viewPage = "detail"
|
||||
manager.filterAuthors("name", model.author_name)
|
||||
manager.filterPackages("id", model.id)
|
||||
toolbox.viewSelection = model.id
|
||||
toolbox.viewPage = "detail"
|
||||
toolbox.filterAuthors("name", model.author_name)
|
||||
toolbox.filterPackages("id", model.id)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Item
|
|||
anchors.bottom: parent.bottom
|
||||
Label
|
||||
{
|
||||
visible: manager.restartRequired
|
||||
visible: toolbox.restartRequired
|
||||
text: "You will need to restart Cura before changes in plugins have effect."
|
||||
height: UM.Theme.getSize("base_unit").height * 2
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
|
@ -39,9 +39,9 @@ Item
|
|||
right: closeButton.left
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
visible: manager.restartRequired
|
||||
visible: toolbox.restartRequired
|
||||
iconName: "dialog-restart"
|
||||
onClicked: manager.restart()
|
||||
onClicked: toolbox.restart()
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
|
|
@ -72,9 +72,9 @@ Item
|
|||
iconName: "dialog-close"
|
||||
onClicked:
|
||||
{
|
||||
if ( manager.isDownloading )
|
||||
if ( toolbox.isDownloading )
|
||||
{
|
||||
manager.cancelDownload()
|
||||
toolbox.cancelDownload()
|
||||
}
|
||||
base.close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ Rectangle {
|
|||
implicitHeight: 48
|
||||
Rectangle
|
||||
{
|
||||
visible: manager.viewCategory == "plugin"
|
||||
visible: toolbox.viewCategory == "plugin"
|
||||
color: UM.Theme.getColor("primary")
|
||||
anchors.bottom: parent.bottom
|
||||
width: parent.width
|
||||
|
|
@ -55,10 +55,10 @@ Rectangle {
|
|||
}
|
||||
onClicked:
|
||||
{
|
||||
manager.filterPackages("type", "plugin")
|
||||
manager.filterAuthors("type", "plugin")
|
||||
manager.viewCategory = "plugin"
|
||||
manager.viewPage = "overview"
|
||||
toolbox.filterPackages("type", "plugin")
|
||||
toolbox.filterAuthors("type", "plugin")
|
||||
toolbox.viewCategory = "plugin"
|
||||
toolbox.viewPage = "overview"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ Rectangle {
|
|||
implicitHeight: 48
|
||||
Rectangle
|
||||
{
|
||||
visible: manager.viewCategory == "material"
|
||||
visible: toolbox.viewCategory == "material"
|
||||
color: UM.Theme.getColor("primary")
|
||||
anchors.bottom: parent.bottom
|
||||
width: parent.width
|
||||
|
|
@ -92,10 +92,10 @@ Rectangle {
|
|||
}
|
||||
onClicked:
|
||||
{
|
||||
manager.filterPackages("type", "material")
|
||||
manager.filterAuthors("type", "material")
|
||||
manager.viewCategory = "material"
|
||||
manager.viewPage = "overview"
|
||||
toolbox.filterPackages("type", "material")
|
||||
toolbox.filterAuthors("type", "material")
|
||||
toolbox.viewCategory = "material"
|
||||
toolbox.viewPage = "overview"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -113,7 +113,7 @@ Rectangle {
|
|||
implicitWidth: 96
|
||||
implicitHeight: 48
|
||||
Rectangle {
|
||||
visible: manager.viewCategory == "installed"
|
||||
visible: toolbox.viewCategory == "installed"
|
||||
color: UM.Theme.getColor("primary")
|
||||
anchors.bottom: parent.bottom
|
||||
width: parent.width
|
||||
|
|
@ -129,6 +129,6 @@ Rectangle {
|
|||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
}
|
||||
onClicked: manager.viewCategory = "installed"
|
||||
onClicked: toolbox.viewCategory = "installed"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ ScrollView
|
|||
Repeater
|
||||
{
|
||||
id: materialList
|
||||
model: manager.packagesModel
|
||||
model: toolbox.packagesModel
|
||||
delegate: ToolboxInstalledTile {}
|
||||
}
|
||||
}
|
||||
|
|
@ -93,7 +93,7 @@ ScrollView
|
|||
Repeater
|
||||
{
|
||||
id: pluginList
|
||||
model: manager.packagesModel
|
||||
model: toolbox.packagesModel
|
||||
delegate: ToolboxInstalledTile {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ Item
|
|||
id: removeButton
|
||||
text: "Uninstall"
|
||||
visible: model.can_uninstall && model.status == "installed"
|
||||
enabled: !manager.isDownloading
|
||||
enabled: !toolbox.isDownloading
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
|
|
@ -125,7 +125,7 @@ Item
|
|||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
}
|
||||
onClicked: manager.removePlugin( model.id )
|
||||
onClicked: toolbox.removePlugin( model.id )
|
||||
}
|
||||
|
||||
Button {
|
||||
|
|
@ -151,7 +151,7 @@ Item
|
|||
}
|
||||
onClicked:
|
||||
{
|
||||
manager.updatePackage(model.id);
|
||||
toolbox.updatePackage(model.id);
|
||||
}
|
||||
}
|
||||
ProgressBar
|
||||
|
|
@ -161,8 +161,8 @@ Item
|
|||
anchors.right: installButton.right
|
||||
anchors.top: installButton.bottom
|
||||
anchors.topMargin: 4
|
||||
value: manager.isDownloading ? manager.downloadProgress : 0
|
||||
visible: manager.isDownloading
|
||||
value: toolbox.isDownloading ? toolbox.downloadProgress : 0
|
||||
visible: toolbox.isDownloading
|
||||
style: ProgressBarStyle
|
||||
{
|
||||
background: Rectangle
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ UM.Dialog {
|
|||
onClicked:
|
||||
{
|
||||
licenseDialog.close();
|
||||
manager.installPlugin(licenseDialog.pluginFileLocation);
|
||||
toolbox.installPlugin(licenseDialog.pluginFileLocation);
|
||||
}
|
||||
},
|
||||
Button
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ Window {
|
|||
bottom: parent.bottom
|
||||
bottomMargin: UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
onClicked: manager.restart()
|
||||
onClicked: toolbox.restart()
|
||||
style: ButtonStyle {
|
||||
background: Rectangle {
|
||||
implicitWidth: 96
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue