From: Youness Alaoui Date: Thu, 3 Sep 2015 19:40:42 +0000 (-0400) Subject: Add a description to the material and show it X-Git-Tag: lulzbot-16.01~8 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=e4520a5ae9a9ef6f0f7623107b72e22d62370fb8;p=cura.git Add a description to the material and show it --- diff --git a/Cura/gui/simpleMode.py b/Cura/gui/simpleMode.py index 0216f067..5e1f825b 100644 --- a/Cura/gui/simpleMode.py +++ b/Cura/gui/simpleMode.py @@ -135,6 +135,10 @@ class simpleModePanel(wx.Panel): self.materialHyperlink = wx.HyperlinkCtrl(self.printMaterialPanel, -1, label=_('Click here for more!'), url='', style=wx.HL_ALIGN_LEFT|wx.BORDER_NONE|wx.HL_CONTEXTMENU) self.materialHyperlink.Show(False) + #self.materialDescription = wx.TextCtrl(self.printMaterialPanel, -1, '', style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_NO_VSCROLL) + self.materialDescription = wx.StaticText(self.printMaterialPanel, -1, '') + self.materialDescription.Show(False) + boxsizer.Add(self.materialDescription, border=5, flag=wx.BOTTOM|wx.TOP|wx.EXPAND) boxsizer.Add(self.materialHyperlink, border=5, flag=wx.BOTTOM|wx.TOP|wx.EXPAND) sizer.Add(self.printMaterialPanel, (1,0), border=10, flag=wx.EXPAND|wx.RIGHT|wx.LEFT|wx.TOP) @@ -238,6 +242,13 @@ class simpleModePanel(wx.Panel): if material.url: self.materialHyperlink.SetURL(material.url) self.materialHyperlink.Show(material.url is not None) + if material.description: + #self.materialDescription.SetValue(material.description) + self.materialDescription.SetLabel(material.description) + self.materialDescription.Show(material.description is not None) + self.materialDescription.Layout() + self.materialDescription.GetParent().Fit() + self.materialDescription.GetParent().Layout() # Add new profiles selectedProfile = None diff --git a/Cura/util/resources.py b/Cura/util/resources.py index b3c031a6..1f9526c5 100644 --- a/Cura/util/resources.py +++ b/Cura/util/resources.py @@ -215,6 +215,9 @@ class PrintMaterial(ProfileIni): if types != None: for type in types.split('|'): self.types.append(type.strip()) + # Comment for the profile + self.description = self._getProfileInfo(ini_file, 'description') + self.parseDirectory(self.path) def parseDirectory(self, path):