diff options
author | daid303 <daid303@gmail.com> | 2013-03-08 17:13:54 +0400 |
---|---|---|
committer | daid303 <daid303@gmail.com> | 2013-03-08 17:13:54 +0400 |
commit | 636ee8b6f6bb5cc15a47cfcb55fc68c10a76e498 (patch) | |
tree | 26ad7a882a01c55736463be78384e2f970384b00 | |
parent | 6139f90bcadf44bab3e04ea04976d73e1f319f91 (diff) |
-rw-r--r-- | Cura/gui/preview3d.py | 4 | ||||
-rw-r--r-- | Cura/gui/util/openglGui.py | 9 | ||||
-rw-r--r-- | Cura/resources/images/glButtons.png | bin | 71773 -> 71461 bytes | |||
-rw-r--r-- | Cura/slice/__main__.py | 5 | ||||
-rw-r--r-- | Cura/util/profile.py | 18 |
5 files changed, 35 insertions, 1 deletions
diff --git a/Cura/gui/preview3d.py b/Cura/gui/preview3d.py index df36953e96..77b8bdc27c 100644 --- a/Cura/gui/preview3d.py +++ b/Cura/gui/preview3d.py @@ -98,6 +98,10 @@ class previewPanel(wx.Panel): self.sliceButton = openglGui.glButton(self.glCanvas, 5, 'Prepare', (1,0), lambda : self.GetParent().GetParent().GetParent().OnSlice(None)) self.printButton = openglGui.glButton(self.glCanvas, 6, 'Print', (2,0), lambda : self.GetParent().GetParent().GetParent().OnPrint(None)) + self.rotateToolButton.setExpandArrow(True) + self.scaleToolButton.setExpandArrow(True) + self.mirrorToolButton.setExpandArrow(True) + extruderCount = int(profile.getPreference('extruder_amount')) if extruderCount > 1: openglGui.glButton(self.glCanvas, 4, 'Load dual', (0,1), lambda : self.GetParent().GetParent().GetParent()._showModelLoadDialog(2)) diff --git a/Cura/gui/util/openglGui.py b/Cura/gui/util/openglGui.py index 438475259f..1782d1fe7f 100644 --- a/Cura/gui/util/openglGui.py +++ b/Cura/gui/util/openglGui.py @@ -328,10 +328,14 @@ class glButton(glGuiControl): self._focus = False self._hidden = False self._disabled = False + self._showExpandArrow = False def setSelected(self, value): self._selected = value + def setExpandArrow(self, value): + self._showExpandArrow = value + def setHidden(self, value): self._hidden = value @@ -369,6 +373,11 @@ class glButton(glGuiControl): glColor4ub(255,255,255,255) opengl.glDrawTexturedQuad(pos[0]-bs*scale/2, pos[1]-bs*scale/2, bs*scale, bs*scale, 0) opengl.glDrawTexturedQuad(pos[0]-bs*scale/2, pos[1]-bs*scale/2, bs*scale, bs*scale, self._imageID) + if self._showExpandArrow: + if self._selected: + opengl.glDrawTexturedQuad(pos[0]+bs*scale/2-bs*scale/4*1.2, pos[1]-bs*scale/2*1.2, bs*scale/4, bs*scale/4, 1) + else: + opengl.glDrawTexturedQuad(pos[0]+bs*scale/2-bs*scale/4*1.2, pos[1]-bs*scale/2*1.2, bs*scale/4, bs*scale/4, 1, 2) glPushMatrix() glTranslatef(pos[0], pos[1], 0) glDisable(GL_TEXTURE_2D) diff --git a/Cura/resources/images/glButtons.png b/Cura/resources/images/glButtons.png Binary files differindex 51db5c73ed..9d079212cc 100644 --- a/Cura/resources/images/glButtons.png +++ b/Cura/resources/images/glButtons.png diff --git a/Cura/slice/__main__.py b/Cura/slice/__main__.py index 9f4e585825..eecb3f4890 100644 --- a/Cura/slice/__main__.py +++ b/Cura/slice/__main__.py @@ -15,6 +15,7 @@ if not hasattr(sys, 'frozen'): sys.path.append(cura_sf_path) from Cura.util import profile +from Cura.util import version from Cura.slice.cura_sf.skeinforge_application.skeinforge_plugins.craft_plugins import export def fixUTF8(input): @@ -108,10 +109,12 @@ def main(): 'machine': platform.machine(), 'platform': platform.platform(), 'profile': profile.getGlobalProfileString(), + 'preferences': profile.getGlobalPreferencesString(), 'modelhash': m.hexdigest(), + 'version': version.getVersion(), } try: - f = urllib2.urlopen("http://software.ultimaker.com/upload_stats.php", data = urllib.urlencode(data), timeout = 5); + f = urllib2.urlopen("http://platform.ultimaker.com/curastats/", data = urllib.urlencode(data), timeout = 5); f.read() f.close() except: diff --git a/Cura/util/profile.py b/Cura/util/profile.py index 823fe3e95c..023fae49d8 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -284,6 +284,24 @@ def getGlobalProfileString(): ret = base64.b64encode(zlib.compress(ret, 9)) return ret +def getGlobalPreferencesString(): + global globalPreferenceParser + if globalPreferenceParser is None: + globalPreferenceParser = ConfigParser.ConfigParser() + try: + globalPreferenceParser.read(getPreferencePath()) + except ConfigParser.ParsingError: + pass + + p = [] + if globalPreferenceParser.has_section('preference'): + for key in globalPreferenceParser.options('preference'): + p.append(key + "=" + globalPreferenceParser.get('preference', key)) + ret = '\b'.join(p) + ret = base64.b64encode(zlib.compress(ret, 9)) + return ret + + def getProfileSetting(name): if name in tempOverride: return unicode(tempOverride[name], "utf-8") |