Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rosie go: improve new suite wizard behaviour. #1338

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions etc/rose-meta/rose-suite-info/rose-meta.conf
Expand Up @@ -2,7 +2,7 @@
compulsory=true

[=access-list]
description=A space-separated list of users with commit access to the trunk.
description=A space-separated list of trunk-commit-access users.
help=Specify a space-separated list of users apart from the owner who have
= commit access to the suite trunk.
=
Expand Down Expand Up @@ -40,7 +40,7 @@ help=Specify a space-separated list of ticket/issue ids.
= #32 #45

[=opts]
description=A space-delimited list of optional configuration keys to switch on.
description=A space-delimited list of optional configurations.
help=A space-delimited list of optional configuration keys to switch on.
=
= This tells the run time program to load the relevant optional
Expand All @@ -54,20 +54,22 @@ help=User ID of the owner of the suite.
= The owner has full commit access to the suite.
= Only the owner can pass the suite's ownership to someone else.
= Only the owner can delete the suite.
pattern=^.+(?# Must not be empty)
sort-key=02-users-1

[=project]
compulsory=true
description=The name of the project associated with the suite.
description=The project associated with the suite.
help=A relevant project for the suite.
=
= This is used to look for metadata for the rest of the suite discovery
= information.
pattern=^.+(?# Must not be empty)
sort-key=00-type-0
type=meta

[=sub-project]
description=Sub-division of =project (if applicable)
description=Sub-division of =project
help=An optional sub-project name.
=
= For example, if =project was Human Genome, =sub-project might be
Expand All @@ -77,4 +79,5 @@ help=An optional sub-project name.
compulsory=true
description=A short title for the suite.
help=Title of the suite e.g. Spam Testing
pattern=^.+(?# Must not be empty)
sort-key=01-help-1
3 changes: 2 additions & 1 deletion lib/python/rosie/browser/__init__.py
Expand Up @@ -196,7 +196,8 @@
COLUMNS_SHOWN = ["local", "idx", "revision", "owner", "title"]
PREFIX_LEN = 5
SIZE_WINDOW = (900, 600)
SIZE_WINDOW_NEW_SUITE = (500, 400)
SIZE_WINDOW_NEW_SUITE = (400, 180)
SIZE_WINDOW_NEW_SUITE_EDIT = (800, 500)
SIZE_TOP_TREES = 100
SIZE_LEFT_TREE = 600
TITLEBAR = "{0} - rosie go"
Expand Down
3 changes: 3 additions & 0 deletions lib/python/rosie/browser/main.py
Expand Up @@ -45,6 +45,7 @@
import rose.gtk.run
import rose.gtk.splash
import rose.gtk.util
import rose.macro
from rose.opt_parse import RoseOptionParser
from rose.popen import RosePopenError
import rose.reporter
Expand Down Expand Up @@ -131,6 +132,8 @@ def __init__(self, opts=None, args=None, splash_updater=None):
rosie.browser.PROGRAM_NAME))
self.suite_engine_proc = SuiteEngineProcessor.get_processor(
event_handler=self.handle_view_output_event)
rose.macro.add_site_meta_paths()
rose.macro.add_env_meta_paths()
self.show()

def setup_window(self):
Expand Down
14 changes: 10 additions & 4 deletions lib/python/rosie/browser/suite.py
Expand Up @@ -18,6 +18,8 @@
# along with Rose. If not, see <http://www.gnu.org/licenses/>.
#-----------------------------------------------------------------------------

import copy

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra newline?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better style, technically, so I left it in - it added from an import sys I was
using for debugging.

import pygtk
pygtk.require("2.0")
import gtk
Expand Down Expand Up @@ -109,20 +111,21 @@ def delete_local(self, sid, *args):
return False

def _edit_config(self, config, window, back_function, finish_function):
window.set_modal(False)
project = config.get(["project"]).value
config.set(["project"], project)
meta_config = rose.macro.load_meta_config(config)
fixer_macro = rose.macros.DefaultTransforms()
config, change_list = fixer_macro.transform(config, meta_config)
config_copy = copy.deepcopy(config)
config_copy, change_list = fixer_macro.transform(config_copy,
meta_config)
for child in window.action_area:
window.action_area.remove(child)
for child in window.vbox:
if window.vbox.query_child_packing(child)[3] == gtk.PACK_END:
break
window.vbox.remove(child)
editor = rose.config_editor.main.MainController(
config_objs={"discovery": config},
config_objs={"discovery": config_copy},
config_obj_types={"discovery":
rose.INFO_CONFIG_NAME},
pluggable=True)
Expand Down Expand Up @@ -160,6 +163,7 @@ def _edit_config(self, config, window, back_function, finish_function):
window.vbox.pack_start(hbox, expand=False, fill=False)
window.vbox.pack_start(vbox, expand=True, fill=True)
vbox.grab_focus()
window.resize(*rosie.browser.SIZE_WINDOW_NEW_SUITE_EDIT)

def _finish_config(self, page_container, window, editor, finish_function):
page = page_container.get_children()[0]
Expand Down Expand Up @@ -187,7 +191,10 @@ def run_new_suite_wizard(self, config, create_suite, parent_window,
window = gtk.Dialog(title=rosie.browser.TITLE_NEW_SUITE_WIZARD,
parent=parent_window)
window.set_default_size(*rosie.browser.SIZE_WINDOW_NEW_SUITE)
window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_NORMAL)
window.set_modal(False)
else:
window.resize(*rosie.browser.SIZE_WINDOW_NEW_SUITE)
project = self._select_project(config.get(["project"]).value, window)
if project is None:
window.destroy()
Expand Down Expand Up @@ -244,4 +251,3 @@ def _select_project(self, project, window):
if response == gtk.RESPONSE_ACCEPT:
return project_text
return None