chiark / gitweb /
Add a description to the material and show it
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Thu, 3 Sep 2015 19:40:42 +0000 (15:40 -0400)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Thu, 3 Sep 2015 19:40:42 +0000 (15:40 -0400)
Cura/gui/simpleMode.py
Cura/util/resources.py

index 0216f0677f01dbed60e9b78e7cf4aaf8fbee0815..5e1f825b4b054515f07343b794e460147ffd7776 100644 (file)
@@ -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
index b3c031a6a2cd97f22a78b65e60b4e8b3fefbd7dc..1f9526c50f9fa7cdf2207778586fe7e48e75b734 100644 (file)
@@ -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):