Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
5226bc29
Commit
5226bc29
authored
Jul 24, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factor Windows-binary-specific hack for icons loading
parent
495cbaea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
11 deletions
+10
-11
plater.py
plater.py
+2
-6
printrun_utils.py
printrun/printrun_utils.py
+6
-0
pronterface.py
pronterface.py
+2
-5
No files found.
plater.py
View file @
5226bc29
...
@@ -19,7 +19,7 @@ import os
...
@@ -19,7 +19,7 @@ import os
# Set up Internationalization using gettext
# Set up Internationalization using gettext
# searching for installed locales on /usr/share; uses relative folder if not found (windows)
# searching for installed locales on /usr/share; uses relative folder if not found (windows)
from
printrun.printrun_utils
import
install_locale
from
printrun.printrun_utils
import
install_locale
,
iconfile
install_locale
(
'plater'
)
install_locale
(
'plater'
)
import
wx
import
wx
...
@@ -30,7 +30,6 @@ import sys
...
@@ -30,7 +30,6 @@ import sys
import
traceback
import
traceback
from
printrun
import
stltool
from
printrun
import
stltool
from
printrun.printrun_utils
import
pixmapfile
glview
=
False
glview
=
False
if
"-nogl"
not
in
sys
.
argv
:
if
"-nogl"
not
in
sys
.
argv
:
...
@@ -235,10 +234,7 @@ class stlwin(wx.Frame):
...
@@ -235,10 +234,7 @@ class stlwin(wx.Frame):
def
__init__
(
self
,
filenames
=
[],
size
=
(
800
,
580
),
callback
=
None
,
parent
=
None
,
build_dimensions
=
None
):
def
__init__
(
self
,
filenames
=
[],
size
=
(
800
,
580
),
callback
=
None
,
parent
=
None
,
build_dimensions
=
None
):
wx
.
Frame
.
__init__
(
self
,
parent
,
title
=
_
(
"Plate building tool"
),
size
=
size
)
wx
.
Frame
.
__init__
(
self
,
parent
,
title
=
_
(
"Plate building tool"
),
size
=
size
)
self
.
filenames
=
filenames
self
.
filenames
=
filenames
if
hasattr
(
sys
,
"frozen"
)
and
sys
.
frozen
==
"windows_exe"
:
self
.
SetIcon
(
wx
.
Icon
(
iconfile
(
"plater.ico"
),
wx
.
BITMAP_TYPE_ICO
))
self
.
SetIcon
(
wx
.
Icon
(
sys
.
executable
,
wx
.
BITMAP_TYPE_ICO
))
else
:
self
.
SetIcon
(
wx
.
Icon
(
pixmapfile
(
"plater.ico"
),
wx
.
BITMAP_TYPE_ICO
))
self
.
mainsizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
self
.
mainsizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
self
.
panel
=
wx
.
Panel
(
self
,
-
1
,
size
=
(
150
,
600
),
pos
=
(
0
,
0
))
self
.
panel
=
wx
.
Panel
(
self
,
-
1
,
size
=
(
150
,
600
),
pos
=
(
0
,
0
))
#self.panel.SetBackgroundColour((10, 10, 10))
#self.panel.SetBackgroundColour((10, 10, 10))
...
...
printrun/printrun_utils.py
View file @
5226bc29
...
@@ -29,6 +29,12 @@ def install_locale(domain):
...
@@ -29,6 +29,12 @@ def install_locale(domain):
else
:
else
:
gettext
.
install
(
domain
,
'./locale'
,
unicode
=
1
)
gettext
.
install
(
domain
,
'./locale'
,
unicode
=
1
)
def
iconfile
(
filename
):
if
hasattr
(
sys
,
"frozen"
)
and
sys
.
frozen
==
"windows_exe"
:
return
sys
.
executable
else
:
return
pixmapfile
(
"plater.ico"
)
def
imagefile
(
filename
):
def
imagefile
(
filename
):
for
prefix
in
[
'/usr/local/share/pronterface/images'
,
for
prefix
in
[
'/usr/local/share/pronterface/images'
,
'/usr/share/pronterface/images'
]:
'/usr/share/pronterface/images'
]:
...
...
pronterface.py
View file @
5226bc29
...
@@ -45,7 +45,7 @@ layerindex = 0
...
@@ -45,7 +45,7 @@ layerindex = 0
if
os
.
name
==
"nt"
:
if
os
.
name
==
"nt"
:
winsize
=
(
800
,
530
)
winsize
=
(
800
,
530
)
from
printrun.printrun_utils
import
pixmap
file
,
configfile
from
printrun.printrun_utils
import
icon
file
,
configfile
from
printrun.gui
import
MainWindow
from
printrun.gui
import
MainWindow
from
printrun.excluder
import
Excluder
from
printrun.excluder
import
Excluder
import
pronsole
import
pronsole
...
@@ -218,10 +218,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -218,10 +218,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
filename
=
filename
self
.
filename
=
filename
os
.
putenv
(
"UBUNTU_MENUPROXY"
,
"0"
)
os
.
putenv
(
"UBUNTU_MENUPROXY"
,
"0"
)
MainWindow
.
__init__
(
self
,
None
,
title
=
_
(
"Pronterface"
),
size
=
size
)
MainWindow
.
__init__
(
self
,
None
,
title
=
_
(
"Pronterface"
),
size
=
size
)
if
hasattr
(
sys
,
"frozen"
)
and
sys
.
frozen
==
"windows_exe"
:
self
.
SetIcon
(
wx
.
Icon
(
iconfile
(
"P-face.ico"
),
wx
.
BITMAP_TYPE_ICO
))
self
.
SetIcon
(
wx
.
Icon
(
sys
.
executable
,
wx
.
BITMAP_TYPE_ICO
))
else
:
self
.
SetIcon
(
wx
.
Icon
(
pixmapfile
(
"P-face.ico"
),
wx
.
BITMAP_TYPE_ICO
))
self
.
statuscheck
=
False
self
.
statuscheck
=
False
self
.
status_thread
=
None
self
.
status_thread
=
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment