Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CCS
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marko Mecina
CCS
Commits
4ea39093
Commit
4ea39093
authored
2 years ago
by
Marko Mecina
Browse files
Options
Downloads
Patches
Plain Diff
add new shortcuts to TST
parent
0ad1abd6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Tst/tst/app_menu.xml
+4
-2
4 additions, 2 deletions
Tst/tst/app_menu.xml
Tst/tst/style/style.css
+7
-1
7 additions, 1 deletion
Tst/tst/style/style.css
Tst/tst/tst.py
+39
-20
39 additions, 20 deletions
Tst/tst/tst.py
with
50 additions
and
23 deletions
Tst/tst/app_menu.xml
+
4
−
2
View file @
4ea39093
...
@@ -6,7 +6,8 @@
...
@@ -6,7 +6,8 @@
<section>
<section>
<item>
<item>
<attribute
name=
"label"
translatable=
"yes"
>
New
</attribute>
<attribute
name=
"label"
translatable=
"yes"
>
New
</attribute>
<attribute
name=
"action"
>
win.make_new_test
</attribute>
<attribute
name=
"action"
>
win.makenewtest
</attribute>
<attribute
name=
"accel"
>
<
Primary
>
n
</attribute>
</item>
</item>
<item>
<item>
<attribute
name=
"label"
translatable=
"yes"
>
Open
</attribute>
<attribute
name=
"label"
translatable=
"yes"
>
Open
</attribute>
...
@@ -20,7 +21,8 @@
...
@@ -20,7 +21,8 @@
</item>
</item>
<item>
<item>
<attribute
name=
"label"
translatable=
"yes"
>
Save as
</attribute>
<attribute
name=
"label"
translatable=
"yes"
>
Save as
</attribute>
<attribute
name=
"action"
>
win.save_as
</attribute>
<attribute
name=
"action"
>
win.saveas
</attribute>
<attribute
name=
"accel"
>
<
Shift
><
Primary
>
s
</attribute>
</item>
</item>
<item>
<item>
<attribute
name=
"label"
translatable=
"yes"
>
Import CSV
</attribute>
<attribute
name=
"label"
translatable=
"yes"
>
Import CSV
</attribute>
...
...
This diff is collapsed.
Click to expand it.
Tst/tst/style/style.css
+
7
−
1
View file @
4ea39093
...
@@ -128,6 +128,12 @@
...
@@ -128,6 +128,12 @@
border-color
:
orange
;
border-color
:
orange
;
}
}
.board
{
background-color
:
@
bg_color
;
}
.text-view
{
.text-view
{
padding
:
3px
;
padding
:
3px
;
}
}
/*.cond-dialog label{
font-weight: bold;
}*/
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Tst/tst/tst.py
+
39
−
20
View file @
4ea39093
...
@@ -200,7 +200,7 @@ class TstAppWindow(Gtk.ApplicationWindow):
...
@@ -200,7 +200,7 @@ class TstAppWindow(Gtk.ApplicationWindow):
self
.
product_paths
=
[]
self
.
product_paths
=
[]
# actions
# actions
action
=
Gio
.
SimpleAction
.
new
(
'
make
_
new
_
test
'
,
None
)
action
=
Gio
.
SimpleAction
.
new
(
'
makenewtest
'
,
None
)
action
.
connect
(
'
activate
'
,
self
.
on_new_test
)
action
.
connect
(
'
activate
'
,
self
.
on_new_test
)
self
.
add_action
(
action
)
self
.
add_action
(
action
)
...
@@ -212,7 +212,7 @@ class TstAppWindow(Gtk.ApplicationWindow):
...
@@ -212,7 +212,7 @@ class TstAppWindow(Gtk.ApplicationWindow):
action
.
connect
(
'
activate
'
,
self
.
on_save
)
action
.
connect
(
'
activate
'
,
self
.
on_save
)
self
.
add_action
(
action
)
self
.
add_action
(
action
)
action
=
Gio
.
SimpleAction
.
new
(
'
save
_
as
'
,
None
)
action
=
Gio
.
SimpleAction
.
new
(
'
saveas
'
,
None
)
action
.
connect
(
'
activate
'
,
self
.
on_save_as
)
action
.
connect
(
'
activate
'
,
self
.
on_save_as
)
self
.
add_action
(
action
)
self
.
add_action
(
action
)
...
@@ -264,10 +264,19 @@ class TstAppWindow(Gtk.ApplicationWindow):
...
@@ -264,10 +264,19 @@ class TstAppWindow(Gtk.ApplicationWindow):
self
.
btn_save
.
set_icon_name
(
'
document-save
'
)
self
.
btn_save
.
set_icon_name
(
'
document-save
'
)
self
.
btn_save
.
set_tooltip_text
(
'
Save
'
)
self
.
btn_save
.
set_tooltip_text
(
'
Save
'
)
self
.
btn_save
.
connect
(
'
clicked
'
,
self
.
on_save
)
self
.
btn_save
.
connect
(
'
clicked
'
,
self
.
on_save
)
self
.
btn_save_as
=
Gtk
.
ToolButton
()
self
.
btn_save_as
.
set_icon_name
(
'
document-save-as
'
)
self
.
btn_save_as
.
set_tooltip_text
(
'
Save as
'
)
self
.
btn_save_as
.
connect
(
'
clicked
'
,
self
.
on_save_as
)
# self.btn_show_model_viewer = Gtk.ToolButton()
# self.btn_show_model_viewer = Gtk.ToolButton()
# self.btn_show_model_viewer.set_icon_name('accessories-dictionary-symbolic')
# self.btn_show_model_viewer.set_icon_name('accessories-dictionary-symbolic')
# self.btn_show_model_viewer.set_tooltip_text('Show/hide model viewer')
# self.btn_show_model_viewer.set_tooltip_text('Show/hide model viewer')
# self.btn_show_model_viewer.connect('clicked', self.model_viewer_toggle_hide)
# self.btn_show_model_viewer.connect('clicked', self.model_viewer_toggle_hide)
self
.
btn_export_csv
=
Gtk
.
ToolButton
()
self
.
btn_export_csv
.
set_label
(
'
Export to CSV
'
)
self
.
btn_export_csv
.
set_icon_name
(
'
text-csv
'
)
self
.
btn_export_csv
.
set_tooltip_text
(
'
Export current spec to CSV
'
)
self
.
btn_export_csv
.
connect
(
'
clicked
'
,
self
.
on_generate_csv
)
self
.
btn_generate_products
=
Gtk
.
ToolButton
()
self
.
btn_generate_products
=
Gtk
.
ToolButton
()
self
.
btn_generate_products
.
set_label
(
'
Generate scripts
'
)
self
.
btn_generate_products
.
set_label
(
'
Generate scripts
'
)
self
.
btn_generate_products
.
set_icon_name
(
'
text-x-python
'
)
self
.
btn_generate_products
.
set_icon_name
(
'
text-x-python
'
)
...
@@ -293,10 +302,12 @@ class TstAppWindow(Gtk.ApplicationWindow):
...
@@ -293,10 +302,12 @@ class TstAppWindow(Gtk.ApplicationWindow):
self
.
toolbar
.
insert
(
self
.
btn_new_file
,
0
)
self
.
toolbar
.
insert
(
self
.
btn_new_file
,
0
)
self
.
toolbar
.
insert
(
self
.
btn_open_file
,
1
)
self
.
toolbar
.
insert
(
self
.
btn_open_file
,
1
)
self
.
toolbar
.
insert
(
self
.
btn_save
,
2
)
self
.
toolbar
.
insert
(
self
.
btn_save
,
2
)
self
.
toolbar
.
insert
(
self
.
btn_save_as
,
3
)
# self.toolbar.insert(self.btn_show_model_viewer, 2)
# self.toolbar.insert(self.btn_show_model_viewer, 2)
self
.
toolbar
.
insert
(
self
.
btn_generate_products
,
3
)
self
.
toolbar
.
insert
(
self
.
btn_export_csv
,
4
)
self
.
toolbar
.
insert
(
self
.
btn_start_ccs_editor
,
4
)
self
.
toolbar
.
insert
(
self
.
btn_generate_products
,
5
)
self
.
toolbar
.
insert
(
self
.
btn_open_progress_view
,
5
)
self
.
toolbar
.
insert
(
self
.
btn_start_ccs_editor
,
6
)
self
.
toolbar
.
insert
(
self
.
btn_open_progress_view
,
7
)
# IDB chooser
# IDB chooser
self
.
idb_chooser
=
Gtk
.
ToolButton
()
self
.
idb_chooser
=
Gtk
.
ToolButton
()
...
@@ -306,12 +317,12 @@ class TstAppWindow(Gtk.ApplicationWindow):
...
@@ -306,12 +317,12 @@ class TstAppWindow(Gtk.ApplicationWindow):
self
.
idb_chooser
.
set_label_widget
(
label
)
self
.
idb_chooser
.
set_label_widget
(
label
)
self
.
idb_chooser
.
set_tooltip_text
(
'
Select IDB
'
)
self
.
idb_chooser
.
set_tooltip_text
(
'
Select IDB
'
)
self
.
idb_chooser
.
connect
(
'
clicked
'
,
self
.
on_set_idb_version
)
self
.
idb_chooser
.
connect
(
'
clicked
'
,
self
.
on_set_idb_version
)
self
.
toolbar
.
insert
(
self
.
idb_chooser
,
6
)
self
.
toolbar
.
insert
(
self
.
idb_chooser
,
8
)
# separator
# separator
sepa
=
Gtk
.
SeparatorToolItem
()
sepa
=
Gtk
.
SeparatorToolItem
()
sepa
.
set_expand
(
True
)
sepa
.
set_expand
(
True
)
self
.
toolbar
.
insert
(
sepa
,
7
)
self
.
toolbar
.
insert
(
sepa
,
9
)
# logo
# logo
self
.
unilogo
=
Gtk
.
ToolButton
()
self
.
unilogo
=
Gtk
.
ToolButton
()
...
@@ -320,7 +331,7 @@ class TstAppWindow(Gtk.ApplicationWindow):
...
@@ -320,7 +331,7 @@ class TstAppWindow(Gtk.ApplicationWindow):
icon
=
Gtk
.
Image
.
new_from_pixbuf
(
pixbuf
)
icon
=
Gtk
.
Image
.
new_from_pixbuf
(
pixbuf
)
self
.
unilogo
.
set_icon_widget
(
icon
)
self
.
unilogo
.
set_icon_widget
(
icon
)
self
.
unilogo
.
connect
(
'
clicked
'
,
self
.
on_about
)
self
.
unilogo
.
connect
(
'
clicked
'
,
self
.
on_about
)
self
.
toolbar
.
insert
(
self
.
unilogo
,
8
)
self
.
toolbar
.
insert
(
self
.
unilogo
,
10
)
self
.
box
.
pack_start
(
self
.
toolbar
,
False
,
True
,
0
)
self
.
box
.
pack_start
(
self
.
toolbar
,
False
,
True
,
0
)
self
.
info_bar
=
None
self
.
info_bar
=
None
...
@@ -646,6 +657,10 @@ class TstAppWindow(Gtk.ApplicationWindow):
...
@@ -646,6 +657,10 @@ class TstAppWindow(Gtk.ApplicationWindow):
def
save_as_file_dialog
(
self
):
def
save_as_file_dialog
(
self
):
current_test
=
self
.
current_test_instance
()
current_test
=
self
.
current_test_instance
()
if
current_test
is
None
:
return
current_name
=
self
.
current_model
().
name
current_name
=
self
.
current_model
().
name
current_model
=
self
.
current_model
()
current_model
=
self
.
current_model
()
dialog
=
Gtk
.
FileChooserDialog
(
'
Please choose a file
'
,
dialog
=
Gtk
.
FileChooserDialog
(
'
Please choose a file
'
,
...
@@ -889,16 +904,18 @@ class TstAppWindow(Gtk.ApplicationWindow):
...
@@ -889,16 +904,18 @@ class TstAppWindow(Gtk.ApplicationWindow):
outfile_basic
=
'
{}-TS-{}.py
'
.
format
(
current_model
.
name
,
current_model
.
spec_version
)
outfile_basic
=
'
{}-TS-{}.py
'
.
format
(
current_model
.
name
,
current_model
.
spec_version
)
dialog
.
set_current_name
(
outfile_basic
)
dialog
.
set_current_name
(
outfile_basic
)
dialog
.
set_current_folder
(
cfg
.
get
(
'
tst-history
'
,
'
last-folder
'
))
dialog
.
set_current_folder
(
cfg
.
get
(
'
tst-history
'
,
'
last-folder
'
))
dialog
.
set_do_overwrite_confirmation
(
True
)
response
=
dialog
.
run
()
response
=
dialog
.
run
()
while
response
==
Gtk
.
ResponseType
.
OK
:
if
response
==
Gtk
.
ResponseType
.
OK
:
if
os
.
path
.
exists
(
dialog
.
get_filename
()):
# while response == Gtk.ResponseType.OK:
if
not
self
.
existing_file_dialog
(
dialog
.
get_filename
()):
# if os.path.exists(dialog.get_filename()):
response
=
dialog
.
run
()
# if not self.existing_file_dialog(dialog.get_filename()):
continue
# response = dialog.run()
# continue
json_to_barescript
.
run
(
current_model
.
encode_to_json
(),
dialog
.
get_filename
())
json_to_barescript
.
run
(
current_model
.
encode_to_json
(),
dialog
.
get_filename
())
cfg
.
save_option_to_file
(
'
tst-history
'
,
'
last-folder
'
,
dialog
.
get_current_folder
())
cfg
.
save_option_to_file
(
'
tst-history
'
,
'
last-folder
'
,
dialog
.
get_current_folder
())
break
#
break
dialog
.
destroy
()
dialog
.
destroy
()
return
return
...
@@ -925,16 +942,18 @@ class TstAppWindow(Gtk.ApplicationWindow):
...
@@ -925,16 +942,18 @@ class TstAppWindow(Gtk.ApplicationWindow):
outfile_basic
=
'
{}-TS-{}.csv_PIPE
'
.
format
(
current_model
.
name
,
current_model
.
spec_version
)
outfile_basic
=
'
{}-TS-{}.csv_PIPE
'
.
format
(
current_model
.
name
,
current_model
.
spec_version
)
dialog
.
set_current_name
(
outfile_basic
)
dialog
.
set_current_name
(
outfile_basic
)
dialog
.
set_current_folder
(
cfg
.
get
(
'
tst-history
'
,
'
last-folder
'
))
dialog
.
set_current_folder
(
cfg
.
get
(
'
tst-history
'
,
'
last-folder
'
))
dialog
.
set_do_overwrite_confirmation
(
True
)
response
=
dialog
.
run
()
response
=
dialog
.
run
()
while
response
==
Gtk
.
ResponseType
.
OK
:
if
response
==
Gtk
.
ResponseType
.
OK
:
if
os
.
path
.
exists
(
dialog
.
get_filename
()):
# while response == Gtk.ResponseType.OK:
if
not
self
.
existing_file_dialog
(
dialog
.
get_filename
()):
# if os.path.exists(dialog.get_filename()):
response
=
dialog
.
run
()
# if not self.existing_file_dialog(dialog.get_filename()):
continue
# response = dialog.run()
# continue
json_to_csv
.
run
(
current_model
.
encode_to_json
(),
dialog
.
get_filename
())
json_to_csv
.
run
(
current_model
.
encode_to_json
(),
dialog
.
get_filename
())
cfg
.
save_option_to_file
(
'
tst-history
'
,
'
last-folder
'
,
dialog
.
get_current_folder
())
cfg
.
save_option_to_file
(
'
tst-history
'
,
'
last-folder
'
,
dialog
.
get_current_folder
())
break
#
break
dialog
.
destroy
()
dialog
.
destroy
()
return
return
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment