chiark / gitweb /
Add a url to materials and show a hyperlink
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Wed, 2 Sep 2015 18:37:22 +0000 (14:37 -0400)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Wed, 2 Sep 2015 18:37:22 +0000 (14:37 -0400)
Cura/gui/simpleMode.py
Cura/util/resources.py

index 288fee4748953b0537c0f5e1938d4b88b1bd7f6d..fbdd2ffc3ccfe490a8403f3f40b034454689a39e 100644 (file)
@@ -132,6 +132,9 @@ class simpleModePanel(wx.Panel):
                        boxsizer.Add(label, flag=wx.EXPAND)
                        boxsizer.Add(self.materialCombo, border=5, flag=wx.BOTTOM|wx.TOP|wx.EXPAND)
                        self.printMaterialPanel.SetSizer(boxsizer)
+               self.materialHyperlink = wx.HyperlinkCtrl(self.printMaterialPanel, -1, label=_('Click here for more!'), url='')
+               self.materialHyperlink.Show(False)
+               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)
 
                sb = wx.StaticBox(self.printTypePanel, label=_("Select a quickprint profile:"))
@@ -231,6 +234,10 @@ class simpleModePanel(wx.Panel):
                self.printOptionsBox.Show(True)
                self.printTypePanel.Show(True)
 
+               if material.url:
+                       self.materialHyperlink.SetURL(material.url)
+               self.materialHyperlink.Show(material.url is not None)
+
                # Add new profiles
                selectedProfile = None
                for print_profile in material.profiles:
index 1e9ed86fff611821aef6a6d6d385a11957f96f47..b3c031a6a2cd97f22a78b65e60b4e8b3fefbd7dc 100644 (file)
@@ -132,6 +132,8 @@ class ProfileIni(object):
                self.full_name = self._getProfileInfo(ini_file, 'full_name')
                if self.full_name is None:
                        self.full_name = self.name
+               # URL for the profile
+               self.url = self._getProfileInfo(ini_file, 'url')
                # Finds the full path to the real profile_file
                self.profile_file = self._findProfileFile()
                # default = The default profile to select