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
e6438644
Commit
e6438644
authored
May 23, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor rework of PronterOptions
parent
30549a77
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
22 deletions
+30
-22
pronterface_widgets.py
printrun/pronterface_widgets.py
+30
-22
No files found.
printrun/pronterface_widgets.py
View file @
e6438644
...
@@ -120,32 +120,40 @@ class MacroEditor(wx.Dialog):
...
@@ -120,32 +120,40 @@ class MacroEditor(wx.Dialog):
reindented
+=
self
.
indent_chars
+
line
+
"
\n
"
reindented
+=
self
.
indent_chars
+
line
+
"
\n
"
return
reindented
return
reindented
class
PronterOptions
(
wx
.
Dialog
):
class
PronterOptions
Dialog
(
wx
.
Dialog
):
"""Options editor"""
"""Options editor"""
def
__init__
(
self
,
pronterface
):
def
__init__
(
self
,
pronterface
):
wx
.
Dialog
.
__init__
(
self
,
None
,
title
=
_
(
"Edit settings"
),
style
=
wx
.
DEFAULT_DIALOG_STYLE
|
wx
.
RESIZE_BORDER
)
wx
.
Dialog
.
__init__
(
self
,
parent
=
None
,
title
=
_
(
"Edit settings"
),
size
=
(
400
,
500
),
style
=
wx
.
DEFAULT_DIALOG_STYLE
|
wx
.
RESIZE_BORDER
|
wx
.
DIALOG_NO_PARENT
,
pos
=
(
100
,
100
))
topsizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
panel
=
wx
.
Panel
(
self
)
vbox
=
wx
.
StaticBoxSizer
(
wx
.
StaticBox
(
self
,
label
=
_
(
"Settings"
))
,
wx
.
VERTICAL
)
header
=
wx
.
StaticBox
(
panel
,
label
=
_
(
"Settings"
))
topsizer
.
Add
(
vbox
,
1
,
wx
.
ALL
+
wx
.
EXPAND
)
sbox
=
wx
.
StaticBoxSizer
(
header
,
wx
.
VERTICAL
)
panel2
=
wx
.
Panel
(
panel
)
grid
=
wx
.
FlexGridSizer
(
rows
=
0
,
cols
=
2
,
hgap
=
8
,
vgap
=
2
)
grid
=
wx
.
FlexGridSizer
(
rows
=
0
,
cols
=
2
,
hgap
=
8
,
vgap
=
2
)
grid
.
SetFlexibleDirection
(
wx
.
BOTH
)
grid
.
SetFlexibleDirection
(
wx
.
BOTH
)
grid
.
AddGrowableCol
(
1
)
grid
.
AddGrowableCol
(
1
)
grid
.
SetNonFlexibleGrowMode
(
wx
.
FLEX_GROWMODE_SPECIFIED
)
grid
.
SetNonFlexibleGrowMode
(
wx
.
FLEX_GROWMODE_SPECIFIED
)
vbox
.
Add
(
grid
,
0
,
wx
.
EXPAND
)
for
setting
in
pronterface
.
settings
.
_all_settings
():
for
setting
in
pronterface
.
settings
.
_all_settings
():
grid
.
Add
(
setting
.
get_label
(
self
),
0
,
wx
.
ALIGN_CENTER_VERTICAL
|
wx
.
ALL
|
wx
.
ALIGN_RIGHT
)
grid
.
Add
(
setting
.
get_label
(
panel2
),
0
,
wx
.
ALIGN_CENTER_VERTICAL
|
wx
.
ALL
|
wx
.
ALIGN_RIGHT
)
grid
.
Add
(
setting
.
get_widget
(
self
),
1
,
wx
.
ALIGN_CENTER_VERTICAL
|
wx
.
ALL
|
wx
.
EXPAND
)
grid
.
Add
(
setting
.
get_widget
(
panel2
),
1
,
wx
.
ALIGN_CENTER_VERTICAL
|
wx
.
ALL
)
topsizer
.
Add
(
self
.
CreateSeparatedButtonSizer
(
wx
.
OK
+
wx
.
CANCEL
),
0
,
wx
.
EXPAND
)
panel2
.
SetSizer
(
grid
)
self
.
SetSizer
(
topsizer
)
sbox
.
Add
(
panel2
,
1
,
wx
.
EXPAND
)
topsizer
.
Layout
()
panel
.
SetSizer
(
sbox
)
topsizer
.
Fit
(
self
)
topsizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
if
self
.
ShowModal
()
==
wx
.
ID_OK
:
topsizer
.
Add
(
panel
,
1
,
wx
.
ALL
|
wx
.
EXPAND
)
topsizer
.
Add
(
self
.
CreateButtonSizer
(
wx
.
OK
|
wx
.
CANCEL
),
0
,
wx
.
ALIGN_RIGHT
)
self
.
SetSizerAndFit
(
topsizer
)
self
.
SetMinSize
(
self
.
GetSize
())
#self.CentreOnScreen()
def
PronterOptions
(
pronterface
):
dialog
=
PronterOptionsDialog
(
pronterface
)
if
dialog
.
ShowModal
()
==
wx
.
ID_OK
:
for
setting
in
pronterface
.
settings
.
_all_settings
():
for
setting
in
pronterface
.
settings
.
_all_settings
():
old_value
=
setting
.
value
old_value
=
setting
.
value
setting
.
update
()
setting
.
update
()
if
setting
.
value
!=
old_value
:
if
setting
.
value
!=
old_value
:
pronterface
.
set
(
setting
.
name
,
setting
.
value
)
pronterface
.
set
(
setting
.
name
,
setting
.
value
)
self
.
Destroy
()
dialog
.
Destroy
()
class
ButtonEdit
(
wx
.
Dialog
):
class
ButtonEdit
(
wx
.
Dialog
):
"""Custom button edit dialog"""
"""Custom button edit dialog"""
...
...
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