forked from Ultimaker/Cura
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
3,531 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (c) 2021 Ultimaker B.V. | ||
# Cura is released under the terms of the LGPLv3 or higher. | ||
|
||
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase | ||
from .src import DigitalFactoryFileProvider, DigitalFactoryOutputDevicePlugin, DigitalFactoryController | ||
|
||
|
||
def getMetaData(): | ||
return {} | ||
|
||
|
||
def register(app): | ||
df_controller = DigitalFactoryController.DigitalFactoryController(app) | ||
return { | ||
"file_provider": DigitalFactoryFileProvider.DigitalFactoryFileProvider(df_controller), | ||
"output_device": DigitalFactoryOutputDevicePlugin.DigitalFactoryOutputDevicePlugin(df_controller) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "Ultimaker Digital Library", | ||
"author": "Ultimaker B.V.", | ||
"description": "Connects to the Digital Library, allowing Cura to open files from and save files to the Digital Library.", | ||
"version": "1.0.0", | ||
"api": "7.5.0", | ||
"i18n-catalog": "cura" | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
159 changes: 159 additions & 0 deletions
159
plugins/DigitalLibrary/resources/qml/CreateNewProjectPopup.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
// Copyright (C) 2021 Ultimaker B.V. | ||
|
||
import QtQuick 2.10 | ||
import QtQuick.Window 2.2 | ||
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one | ||
import QtQuick.Controls 2.3 | ||
import QtQuick.Controls.Styles 1.4 | ||
|
||
import UM 1.2 as UM | ||
import Cura 1.6 as Cura | ||
|
||
import DigitalFactory 1.0 as DF | ||
|
||
|
||
Popup | ||
{ | ||
id: base | ||
|
||
padding: UM.Theme.getSize("default_margin").width | ||
|
||
closePolicy: Popup.CloseOnEscape | ||
focus: true | ||
modal: true | ||
background: Cura.RoundedRectangle | ||
{ | ||
cornerSide: Cura.RoundedRectangle.Direction.All | ||
border.color: UM.Theme.getColor("lining") | ||
border.width: UM.Theme.getSize("default_lining").width | ||
radius: UM.Theme.getSize("default_radius").width | ||
width: parent.width | ||
height: parent.height | ||
color: UM.Theme.getColor("main_background") | ||
} | ||
|
||
Connections | ||
{ | ||
target: manager | ||
|
||
function onCreatingNewProjectStatusChanged(status) | ||
{ | ||
if (status == DF.RetrievalStatus.Success) | ||
{ | ||
base.close(); | ||
} | ||
} | ||
} | ||
|
||
onOpened: | ||
{ | ||
newProjectNameTextField.text = "" | ||
newProjectNameTextField.focus = true | ||
} | ||
|
||
Label | ||
{ | ||
id: createNewLibraryProjectLabel | ||
text: "Create new Library project" | ||
font: UM.Theme.getFont("medium") | ||
color: UM.Theme.getColor("small_button_text") | ||
anchors | ||
{ | ||
top: parent.top | ||
left: parent.left | ||
right: parent.right | ||
} | ||
} | ||
|
||
Label | ||
{ | ||
id: projectNameLabel | ||
text: "Project Name" | ||
font: UM.Theme.getFont("default") | ||
color: UM.Theme.getColor("text") | ||
anchors | ||
{ | ||
top: createNewLibraryProjectLabel.bottom | ||
topMargin: UM.Theme.getSize("default_margin").width | ||
left: parent.left | ||
right: parent.right | ||
} | ||
} | ||
|
||
Cura.TextField | ||
{ | ||
id: newProjectNameTextField | ||
width: parent.width | ||
anchors | ||
{ | ||
top: projectNameLabel.bottom | ||
topMargin: UM.Theme.getSize("thin_margin").width | ||
left: parent.left | ||
right: parent.right | ||
} | ||
validator: RegExpValidator | ||
{ | ||
regExp: /^[^\\\/\*\?\|\[\]]{0,96}$/ | ||
} | ||
|
||
text: PrintInformation.jobName | ||
font: UM.Theme.getFont("default") | ||
placeholderText: "Enter a name for your new project." | ||
onAccepted: | ||
{ | ||
if (verifyProjectCreationButton.enabled) | ||
{ | ||
verifyProjectCreationButton.clicked() | ||
} | ||
} | ||
} | ||
|
||
Label | ||
{ | ||
id: errorWhileCreatingProjectLabel | ||
text: manager.projectCreationErrorText | ||
width: parent.width | ||
wrapMode: Text.WordWrap | ||
font: UM.Theme.getFont("default") | ||
color: UM.Theme.getColor("error") | ||
visible: manager.creatingNewProjectStatus == DF.RetrievalStatus.Failed | ||
anchors | ||
{ | ||
top: newProjectNameTextField.bottom | ||
left: parent.left | ||
right: parent.right | ||
} | ||
} | ||
|
||
Cura.SecondaryButton | ||
{ | ||
id: cancelProjectCreationButton | ||
|
||
anchors.bottom: parent.bottom | ||
anchors.left: parent.left | ||
|
||
text: "Cancel" | ||
|
||
onClicked: | ||
{ | ||
base.close() | ||
} | ||
busy: false | ||
} | ||
|
||
Cura.PrimaryButton | ||
{ | ||
id: verifyProjectCreationButton | ||
|
||
anchors.bottom: parent.bottom | ||
anchors.right: parent.right | ||
text: "Create" | ||
enabled: newProjectNameTextField.text != "" && !busy | ||
|
||
onClicked: | ||
{ | ||
manager.createLibraryProjectAndSetAsPreselected(newProjectNameTextField.text) | ||
} | ||
busy: manager.creatingNewProjectStatus == DF.RetrievalStatus.InProgress | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
plugins/DigitalLibrary/resources/qml/DigitalFactoryOpenDialog.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright (C) 2021 Ultimaker B.V. | ||
|
||
import QtQuick 2.10 | ||
import QtQuick.Window 2.2 | ||
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one | ||
import QtQuick.Controls 2.3 | ||
import QtQuick.Controls.Styles 1.4 | ||
|
||
import UM 1.2 as UM | ||
import Cura 1.6 as Cura | ||
|
||
import DigitalFactory 1.0 as DF | ||
|
||
Window | ||
{ | ||
id: digitalFactoryOpenDialogBase | ||
title: "Open file from Library" | ||
|
||
modality: Qt.ApplicationModal | ||
width: 800 * screenScaleFactor | ||
height: 600 * screenScaleFactor | ||
minimumWidth: 800 * screenScaleFactor | ||
minimumHeight: 600 * screenScaleFactor | ||
|
||
Shortcut | ||
{ | ||
sequence: "Esc" | ||
onActivated: digitalFactoryOpenDialogBase.close() | ||
} | ||
color: UM.Theme.getColor("main_background") | ||
|
||
SelectProjectPage | ||
{ | ||
visible: manager.selectedProjectIndex == -1 | ||
createNewProjectButtonVisible: false | ||
} | ||
|
||
OpenProjectFilesPage | ||
{ | ||
visible: manager.selectedProjectIndex >= 0 | ||
onOpenFilePressed: digitalFactoryOpenDialogBase.close() | ||
} | ||
|
||
|
||
BusyIndicator | ||
{ | ||
// Shows up while Cura is waiting to receive the user's projects from the digital factory library | ||
id: retrievingProjectsBusyIndicator | ||
|
||
anchors { | ||
verticalCenter: parent.verticalCenter | ||
horizontalCenter: parent.horizontalCenter | ||
} | ||
|
||
width: parent.width / 4 | ||
height: width | ||
visible: manager.retrievingProjectsStatus == DF.RetrievalStatus.InProgress | ||
running: visible | ||
palette.dark: UM.Theme.getColor("text") | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
plugins/DigitalLibrary/resources/qml/DigitalFactorySaveDialog.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright (C) 2021 Ultimaker B.V. | ||
|
||
import QtQuick 2.10 | ||
import QtQuick.Window 2.2 | ||
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one | ||
import QtQuick.Controls 2.3 | ||
import QtQuick.Controls.Styles 1.4 | ||
|
||
import UM 1.2 as UM | ||
import Cura 1.6 as Cura | ||
|
||
import DigitalFactory 1.0 as DF | ||
|
||
Window | ||
{ | ||
id: digitalFactorySaveDialogBase | ||
title: "Save Cura project to Library" | ||
|
||
modality: Qt.ApplicationModal | ||
width: 800 * screenScaleFactor | ||
height: 600 * screenScaleFactor | ||
minimumWidth: 800 * screenScaleFactor | ||
minimumHeight: 600 * screenScaleFactor | ||
|
||
Shortcut | ||
{ | ||
sequence: "Esc" | ||
onActivated: digitalFactorySaveDialogBase.close() | ||
} | ||
color: UM.Theme.getColor("main_background") | ||
|
||
SelectProjectPage | ||
{ | ||
visible: manager.selectedProjectIndex == -1 | ||
createNewProjectButtonVisible: true | ||
} | ||
|
||
SaveProjectFilesPage | ||
{ | ||
visible: manager.selectedProjectIndex >= 0 | ||
onSavePressed: digitalFactorySaveDialogBase.close() | ||
onSelectDifferentProjectPressed: manager.clearProjectSelection() | ||
} | ||
|
||
|
||
BusyIndicator | ||
{ | ||
// Shows up while Cura is waiting to receive the user's projects from the digital factory library | ||
id: retrievingProjectsBusyIndicator | ||
|
||
anchors { | ||
verticalCenter: parent.verticalCenter | ||
horizontalCenter: parent.horizontalCenter | ||
} | ||
|
||
width: parent.width / 4 | ||
height: width | ||
visible: manager.retrievingProjectsStatus == DF.RetrievalStatus.InProgress | ||
running: visible | ||
palette.dark: UM.Theme.getColor("text") | ||
} | ||
} |
Oops, something went wrong.