Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
VIGNET Pierre
cadbiom
Commits
85fa8f55
Commit
85fa8f55
authored
Sep 15, 2017
by
VIGNET Pierre
Browse files
Filechooser option: Open window instead of alawys a save window...
parent
ac7123fd
Changes
4
Hide whitespace changes
Inline
Side-by-side
gui/cadbiom_gui/gt_gui/chart_misc_widgets.py
View file @
85fa8f55
...
...
@@ -453,7 +453,8 @@ class ImportPIDParam(object):
"""
lauch import
"""
fch
=
FileChooser
(
"Import from PID xml"
,
"xml files"
,
"*.xml"
)
fch
=
FileChooser
(
"Import from PID xml"
,
"xml files"
,
"*.xml"
,
save_window
=
False
)
fch
.
do_action
(
self
.
import_from_pid_file
)
def
import_from_pid_file
(
self
,
file
):
...
...
@@ -577,7 +578,8 @@ class ImportBioPAXParams(object):
"""
Choose blacklist file of entities
"""
fch
=
FileChooser
(
"Choose the blacklist file"
,
"txt files"
,
"*.txt"
)
fch
=
FileChooser
(
"Choose the blacklist file"
,
"txt files"
,
"*.txt"
,
save_window
=
False
)
fch
.
do_action
(
self
.
set_blacklist_file
)
...
...
gui/cadbiom_gui/gt_gui/chart_simulator/chart_simul_controler.py
View file @
85fa8f55
...
...
@@ -235,7 +235,7 @@ class ChartSimulControler(object):
"""
chose an input file
"""
fch
=
FileChooser
(
"Input file"
,
""
,
"*"
)
fch
=
FileChooser
(
"Input file"
,
""
,
"*"
,
save_window
=
False
)
fch
.
do_action
(
self
.
set_input_file
)
def
set_input_file
(
self
,
filename
):
...
...
gui/cadbiom_gui/gt_gui/charter.py
View file @
85fa8f55
...
...
@@ -584,7 +584,8 @@ class Charter(object):
"""
open a window to search xml file
"""
fch
=
FileChooser
(
"Import Cadbiom model"
,
"bcx files"
,
"*.bcx"
)
fch
=
FileChooser
(
"Import Cadbiom model"
,
"bcx files"
,
"*.bcx"
,
save_window
=
False
)
fch
.
do_action
(
self
.
import_from_xml_file
)
def
import_from_xml_file
(
self
,
ffile
):
...
...
@@ -611,8 +612,8 @@ class Charter(object):
"""
open a window to search xml file
"""
fch
=
FileChooser
(
"Import from Cadbiom-chart lang"
,
"cadbiom-l"
,
"*.cal"
)
fch
=
FileChooser
(
"Import from Cadbiom-chart lang"
,
"cadbiom-l"
,
"*.cal"
,
save_window
=
False
)
fch
.
do_action
(
self
.
import_from_cl_file
)
def
import_from_cl_file
(
self
,
ffile
):
...
...
gui/cadbiom_gui/gt_gui/utils/fileHandling.py
View file @
85fa8f55
...
...
@@ -43,17 +43,32 @@
## Contributor(s): Geoffroy Andrieux
##
from
gtk
import
FileChooserDialog
,
FileFilter
,
FILE_CHOOSER_ACTION_SAVE
,
\
STOCK_CANCEL
,
RESPONSE_CANCEL
,
STOCK_SAVE
,
RESPONSE_OK
from
gtk
import
FileChooserDialog
,
FileFilter
,
\
STOCK_CANCEL
,
RESPONSE_CANCEL
,
RESPONSE_OK
,
\
FILE_CHOOSER_ACTION_SAVE
,
STOCK_SAVE
,
\
FILE_CHOOSER_ACTION_OPEN
,
STOCK_OPEN
class
FileChooser
(
FileChooserDialog
):
"""
Create a customed file chooser
"""
def
__init__
(
self
,
title
,
filter_name
,
filter_pattern
):
FileChooserDialog
.
__init__
(
self
,
title
,
None
,
FILE_CHOOSER_ACTION_SAVE
,
(
STOCK_CANCEL
,
RESPONSE_CANCEL
,
STOCK_SAVE
,
RESPONSE_OK
))
def
__init__
(
self
,
title
,
filter_name
,
filter_pattern
,
save_window
=
True
):
"""Open a custom file chooser.
if save_window is False, an open window will be initialized
"""
if
save_window
:
FileChooserDialog
.
__init__
(
self
,
title
,
None
,
FILE_CHOOSER_ACTION_SAVE
,
(
STOCK_CANCEL
,
RESPONSE_CANCEL
,
STOCK_SAVE
,
RESPONSE_OK
)
)
else
:
FileChooserDialog
.
__init__
(
self
,
title
,
None
,
FILE_CHOOSER_ACTION_OPEN
,
(
STOCK_CANCEL
,
RESPONSE_CANCEL
,
STOCK_OPEN
,
RESPONSE_OK
)
)
self
.
set_default_response
(
RESPONSE_OK
)
#add a filter to see only files for BioSignal (*.sig)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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