Merge branch 'CURA-5744-move-oauth-login' of github.com:Ultimaker/Cura into CURA-5744-move-oauth-login

This commit is contained in:
Jaime van Kessel 2018-09-27 11:11:54 +02:00
commit cf6d3b9289
11 changed files with 45 additions and 17 deletions

View File

@ -13,6 +13,6 @@ TryExec=@CMAKE_INSTALL_FULL_BINDIR@/cura
Icon=cura-icon Icon=cura-icon
Terminal=false Terminal=false
Type=Application Type=Application
MimeType=application/sla;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;image/bmp;image/gif;image/jpeg;image/png;model/x3d+xml; MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;image/bmp;image/gif;image/jpeg;image/png;model/x3d+xml;
Categories=Graphics; Categories=Graphics;
Keywords=3D;Printing;Slicer; Keywords=3D;Printing;Slicer;

View File

@ -6,7 +6,7 @@
<glob-deleteall/> <glob-deleteall/>
<glob pattern="*.3mf"/> <glob pattern="*.3mf"/>
</mime-type> </mime-type>
<mime-type type="application/sla"> <mime-type type="model/stl">
<comment>Computer-aided design and manufacturing format</comment> <comment>Computer-aided design and manufacturing format</comment>
<icon name="unknown"/> <icon name="unknown"/>
<glob-deleteall/> <glob-deleteall/>

View File

@ -36,11 +36,11 @@ class Account(QObject):
OAUTH_SERVER_URL= self._oauth_root, OAUTH_SERVER_URL= self._oauth_root,
CALLBACK_PORT=self._callback_port, CALLBACK_PORT=self._callback_port,
CALLBACK_URL="http://localhost:{}/callback".format(self._callback_port), CALLBACK_URL="http://localhost:{}/callback".format(self._callback_port),
CLIENT_ID="um---------------ultimaker_cura", CLIENT_ID="um---------------ultimaker_cura_drive_plugin",
CLIENT_SCOPES="user.read drive.backups.read drive.backups.write client.package.download", CLIENT_SCOPES="user.read drive.backups.read drive.backups.write",
AUTH_DATA_PREFERENCE_KEY="general/ultimaker_auth_data", AUTH_DATA_PREFERENCE_KEY="general/ultimaker_auth_data",
AUTH_SUCCESS_REDIRECT="{}/auth-success".format(self._cloud_api_root), AUTH_SUCCESS_REDIRECT="{}/auth-success".format(self._cloud_api_root),
AUTH_FAILED_REDIRECT="{}//auth-error".format(self._cloud_api_root) AUTH_FAILED_REDIRECT="{}/auth-error".format(self._cloud_api_root)
) )
self._authorization_service = AuthorizationService(Application.getInstance().getPreferences(), self._oauth_settings) self._authorization_service = AuthorizationService(Application.getInstance().getPreferences(), self._oauth_settings)

View File

@ -83,7 +83,6 @@ from cura.Settings.SettingInheritanceManager import SettingInheritanceManager
from cura.Settings.SimpleModeSettingsManager import SimpleModeSettingsManager from cura.Settings.SimpleModeSettingsManager import SimpleModeSettingsManager
from cura.Machines.VariantManager import VariantManager from cura.Machines.VariantManager import VariantManager
from plugins.SliceInfoPlugin.SliceInfo import SliceInfo
from .SingleInstance import SingleInstance from .SingleInstance import SingleInstance
from .AutoSave import AutoSave from .AutoSave import AutoSave
@ -1722,7 +1721,7 @@ class CuraApplication(QtApplication):
@pyqtSlot() @pyqtSlot()
def showMoreInformationDialogForAnonymousDataCollection(self): def showMoreInformationDialogForAnonymousDataCollection(self):
try: try:
slice_info = cast(SliceInfo, self._plugin_registry.getPluginObject("SliceInfoPlugin")) slice_info = self._plugin_registry.getPluginObject("SliceInfoPlugin")
slice_info.showMoreInfoDialog() slice_info.showMoreInfoDialog()
except PluginNotFoundError: except PluginNotFoundError:
Logger.log("w", "Plugin SliceInfo was not found, so not able to show the info dialog.") Logger.log("w", "Plugin SliceInfo was not found, so not able to show the info dialog.")

View File

@ -337,6 +337,7 @@ class MaterialManager(QObject):
machine_exclude_materials = machine_definition.getMetaDataEntry("exclude_materials", []) machine_exclude_materials = machine_definition.getMetaDataEntry("exclude_materials", [])
material_id_metadata_dict = dict() # type: Dict[str, MaterialNode] material_id_metadata_dict = dict() # type: Dict[str, MaterialNode]
excluded_materials = set()
for current_node in nodes_to_check: for current_node in nodes_to_check:
if current_node is None: if current_node is None:
continue continue
@ -345,13 +346,15 @@ class MaterialManager(QObject):
# Do not exclude other materials that are of the same type. # Do not exclude other materials that are of the same type.
for material_id, node in current_node.material_map.items(): for material_id, node in current_node.material_map.items():
if material_id in machine_exclude_materials: if material_id in machine_exclude_materials:
Logger.log("d", "Exclude material [%s] for machine [%s]", excluded_materials.add(material_id)
material_id, machine_definition.getId())
continue continue
if material_id not in material_id_metadata_dict: if material_id not in material_id_metadata_dict:
material_id_metadata_dict[material_id] = node material_id_metadata_dict[material_id] = node
if excluded_materials:
Logger.log("d", "Exclude materials {excluded_materials} for machine {machine_definition_id}".format(excluded_materials = ", ".join(excluded_materials), machine_definition_id = machine_definition_id))
return material_id_metadata_dict return material_id_metadata_dict
# #

View File

@ -291,7 +291,7 @@ class CuraContainerStack(ContainerStack):
# Helper to make sure we emit a PyQt signal on container changes. # Helper to make sure we emit a PyQt signal on container changes.
def _onContainersChanged(self, container: Any) -> None: def _onContainersChanged(self, container: Any) -> None:
self.pyqtContainersChanged.emit() Application.getInstance().callLater(self.pyqtContainersChanged.emit)
# Helper that can be overridden to get the "machine" definition, that is, the definition that defines the machine # Helper that can be overridden to get the "machine" definition, that is, the definition that defines the machine
# and its properties rather than, for example, the extruder. Defaults to simply returning the definition property. # and its properties rather than, for example, the extruder. Defaults to simply returning the definition property.

View File

@ -256,6 +256,7 @@ fragment41core =
out vec4 frag_color; out vec4 frag_color;
uniform mediump vec4 u_ambientColor; uniform mediump vec4 u_ambientColor;
uniform mediump vec4 u_minimumAlbedo;
uniform highp vec3 u_lightPosition; uniform highp vec3 u_lightPosition;
void main() void main()
@ -263,7 +264,7 @@ fragment41core =
mediump vec4 finalColor = vec4(0.0); mediump vec4 finalColor = vec4(0.0);
float alpha = f_color.a; float alpha = f_color.a;
finalColor.rgb += f_color.rgb * 0.3; finalColor.rgb += f_color.rgb * 0.2 + u_minimumAlbedo.rgb;
highp vec3 normal = normalize(f_normal); highp vec3 normal = normalize(f_normal);
highp vec3 light_dir = normalize(u_lightPosition - f_vertex); highp vec3 light_dir = normalize(u_lightPosition - f_vertex);
@ -285,6 +286,7 @@ u_extruder_opacity = [1.0, 1.0, 1.0, 1.0]
u_specularColor = [0.4, 0.4, 0.4, 1.0] u_specularColor = [0.4, 0.4, 0.4, 1.0]
u_ambientColor = [0.3, 0.3, 0.3, 0.0] u_ambientColor = [0.3, 0.3, 0.3, 0.0]
u_diffuseColor = [1.0, 0.79, 0.14, 1.0] u_diffuseColor = [1.0, 0.79, 0.14, 1.0]
u_minimumAlbedo = [0.1, 0.1, 0.1, 1.0]
u_shininess = 20.0 u_shininess = 20.0
u_show_travel_moves = 0 u_show_travel_moves = 0

View File

@ -37,7 +37,7 @@
"top_bottom_thickness": { "top_bottom_thickness": {
"default_value": 0.6 "default_value": 0.6
}, },
"top_bottom_pattern": { "top_bottom_pattern_0": {
"default_value": "concentric" "default_value": "concentric"
}, },
"infill_pattern": { "infill_pattern": {

View File

@ -29,7 +29,6 @@ Menu
onTriggered: onTriggered:
{ {
settingVisibilityPresetsModel.setActivePreset(model.id); settingVisibilityPresetsModel.setActivePreset(model.id);
showSettingVisibilityProfile();
} }
} }

View File

@ -27,9 +27,20 @@ Item
function updateMaterialPropertiesObject() function updateMaterialPropertiesObject()
{ {
// DRAGON WARNING!!! DO NOT TOUCH THIS IF YOU DON'T KNOW.
// TL;DR: Always update "container_id" first!
//
// Other widgets such as MaterialsView have bindings towards "materialProperties" and its properties. Here the
// properties are updated one by one, and each change can trigger a reaction on those widgets that have
// connections to the property gets changed, and some reactions will use functions such as
// ContainerManager.getContainerMetaDataEntry() to fetch data using the "container_id" as the reference.
// We need to change "container_id" first so any underlying triggers will use the correct "container_id" to
// fetch data. Or, for example, if we change GUID first, which triggered the weight widget to fetch weight
// before we can update "container_id", so it will fetch weight with the wrong (old) "container_id".
materialProperties.container_id = currentItem.id
materialProperties.name = currentItem.name || "Unknown" materialProperties.name = currentItem.name || "Unknown"
materialProperties.guid = currentItem.GUID materialProperties.guid = currentItem.GUID
materialProperties.container_id = currentItem.id
materialProperties.brand = currentItem.brand || "Unknown" materialProperties.brand = currentItem.brand || "Unknown"
materialProperties.material = currentItem.material || "Unknown" materialProperties.material = currentItem.material || "Unknown"
materialProperties.color_name = currentItem.color_name || "Yellow" materialProperties.color_name = currentItem.color_name || "Yellow"

View File

@ -17,9 +17,23 @@ Item
// Children // Children
UM.I18nCatalog { id: catalog; name: "cura"; } UM.I18nCatalog { id: catalog; name: "cura"; }
Cura.MaterialBrandsModel { id: materialsModel } Cura.MaterialBrandsModel
Cura.FavoriteMaterialsModel { id: favoriteMaterialsModel } {
Cura.GenericMaterialsModel { id: genericMaterialsModel } id: materialsModel
extruderPosition: Cura.ExtruderManager.activeExtruderIndex
}
Cura.FavoriteMaterialsModel
{
id: favoriteMaterialsModel
extruderPosition: Cura.ExtruderManager.activeExtruderIndex
}
Cura.GenericMaterialsModel
{
id: genericMaterialsModel
extruderPosition: Cura.ExtruderManager.activeExtruderIndex
}
property var currentType: null property var currentType: null
property var currentBrand: null property var currentBrand: null