def __init__(self, parent, new_sig_cb=None, sigs_list_cb=None): if not new_sig_cb or not sigs_list_cb: raise TypeError("You must set callbacks for signals retrieval and" " creation on NewSignalWizard objects.") Wizard.__init__(self, parent) self._type = None self.page_add("default", "New Signal", "Name the new signal to be created and choose its type.") self._sig_name_entry = NameEntry( self, changed_cb=self._name_changed_cb, weight_hints=(evas.EVAS_HINT_EXPAND, 0.0), align_hints=(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL), ) self.content_add("default", self._sig_name_entry) self._sig_name_entry.show() self._types_btns = SignalTypesButtons(self, self._type_select) self._types_btns.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) self._types_btns.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL) self.content_add("default", self._types_btns) self._types_btns.show() self.action_add("default", "Cancel", self._cancel, key="Escape") self.action_add("default", "Add", self._add, key="Return") self.action_disabled_set("default", "Add", True) self._new_sig_cb = new_sig_cb self._sigs_list_cb = sigs_list_cb
def __init__(self, parent, new_sig_cb=None, sigs_list_cb=None): if not new_sig_cb or not sigs_list_cb: raise TypeError("You must set callbacks for signals retrieval and" " creation on NewSignalWizard objects.") Wizard.__init__(self, parent) self._type = None self.page_add( "default", "New Signal", "Name the new signal to be created and choose its type.") self._sig_name_entry = NameEntry(self, changed_cb=self._name_changed_cb, weight_hints=(evas.EVAS_HINT_EXPAND, 0.0), align_hints=(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)) self.content_add("default", self._sig_name_entry) self._sig_name_entry.show() self._types_btns = SignalTypesButtons(self, self._type_select) self._types_btns.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) self._types_btns.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL) self.content_add("default", self._types_btns) self._types_btns.show() self.action_add("default", "Cancel", self._cancel, key="Escape") self.action_add("default", "Add", self._add, key="Return") self.action_disabled_set("default", "Add", True) self._new_sig_cb = new_sig_cb self._sigs_list_cb = sigs_list_cb
def __init__(self, parent, switch_only=False, selected_set_cb=None, selected_get_cb=None, new_grp_cb=None, check_grp_cb=None, del_grp_cb=None, error_get_cb=None): if not selected_set_cb or not selected_get_cb or not new_grp_cb or \ not check_grp_cb or not del_grp_cb: raise TypeError("You must set callbacks for group" \ " {selection,addition,checking,deletion} on" \ " GroupSelectionWizard objects.") Wizard.__init__(self, parent) self._select_set_cb = selected_set_cb self._select_get_cb = selected_get_cb self._check_group_cb = check_grp_cb self._delete_cb = del_grp_cb self._error_get_cb = error_get_cb self.page_add("group_list", "Select a group", "Select an existing group to edit, or create a new one.") self._groups_list = GroupsList(self, self._goto_preview) self.content_add("group_list", self._groups_list) self._groups_list.show() if not switch_only: self.action_add("group_list", "Cancel", self.close, key="Escape") self.action_add("group_list", "New", self._goto_new_group, key="n") def group_added(cb_func): name = self._grp_name_entry.entry success = cb_func(name) if not success: self.notify("Error creating new group.") return self._group_selected(name) self.page_add("new_group", "Create a new group", "Enter a name for a new group in the file.", separator=True) self._grp_name_entry = NameEntry(self, changed_cb=self._name_changed_cb) self.content_add("new_group", self._grp_name_entry) self._grp_name_entry.show() self.action_add("new_group", "Cancel", self.goto, "group_list", key="Escape") self.action_add("new_group", "Create", group_added, new_grp_cb, key="Return") self.page_add("group_preview", "Group preview", "Delete or start editing this group.") self._preview = PreviewFrame(self) self.content_add("group_preview", self._preview) self._preview.show() self.action_add("group_preview", "Cancel", self._goto_group_list, key="Escape") self.action_add("group_preview", "Delete", self._delete_group, key="Delete") self.action_add("group_preview", "Open", self._group_selected, key="Return") self.goto("group_list")
def __init__(self, parent, editable_grp, operation_stack_cb, img_new_img_cb=None, img_list_get_cb=None, img_id_get_cb=None, workfile_name_get_cb=None): Wizard.__init__(self, parent) self._parent = parent self._edit_grp = editable_grp self._operation_stack_cb = operation_stack_cb self._new_img_cb = img_new_img_cb self._img_list_get_cb = img_list_get_cb self._img_id_get_cb = img_id_get_cb self._workfile_name_get_cb = workfile_name_get_cb self._part_name = None self._type = None self.page_add("default", "New Part", "Name the new part to be inserted and choose its type.") self._part_name_entry = NameEntry( self, changed_cb=self._name_changed_cb, weight_hints=(evas.EVAS_HINT_EXPAND, 0.0), align_hints=(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)) self.content_add("default", self._part_name_entry) self._part_name_entry.show() self._types_list = TypesList(self, self._type_select) self.content_add("default", self._types_list) self._types_list.show() self._ext_list = ExternalSelector(self, self._default_name_set) self._ext_list.size_hint_weight_set(0.0, 0.0) self.content_add("default", self._ext_list) self._ext_list.show() self.action_add("default", "Cancel", self._cancel, key="Escape") self.action_add("default", "Add", self._sizing_go, key="Return") self.action_disabled_set("default", "Add", True) edje.message_signal_process() self._name_changed = False self.page_add("sizing", "New Part", "Position and size of new part.") self._partsetup = PartSetup(self) self._partsetup.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) self._partsetup.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL) self._partsetup.show() self.action_add("sizing", "Cancel", self._default_go, key="Escape") self.action_add("sizing", "Add", self._add, key="Return") self.content_add("sizing", self._partsetup) self.goto("default")
def __init__(self, parent, new_anim_cb=None, anims_list_cb=None, parts_list_cb=None): if not new_anim_cb or not anims_list_cb: raise TypeError("You must set callbacks for animations retrieval" " and creation on NewAnimationWizard objects.") Wizard.__init__(self, parent) self.page_add("default", "New Animation", "Name the new animation to be created.", separator=True) self._anim_name_entry = NameEntry(self, changed_cb=self._name_changed_cb, weight_hints=(evas.EVAS_HINT_EXPAND, 0.0), align_hints=(evas.EVAS_HINT_FILL, 0.5)) self.content_add("default", self._anim_name_entry) self._anim_name_entry.show() lbl = elementary.Label(self) lbl.text_set("Select the parts to use in the animation." " An empty selection will use all parts.") self.content_add("default", lbl) lbl.show() self._parts_list = elementary.List(self) self._parts_list.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) self._parts_list.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL) if parts_list_cb: for p in parts_list_cb(): self._parts_list.item_append(p) self._parts_list.multi_select = True self._parts_list.go() self.content_add("default", self._parts_list) self._parts_list.show() self.alternate_background_set(True) self.action_add("default", "Cancel", self._cancel, key="Escape") self.action_add("default", "Add", self._add, key="Return") self.action_disabled_set("default", "Add", True) self._new_anim_cb = new_anim_cb self._anims_list_cb = anims_list_cb
def __init__(self, parent, new_anim_cb=None, anims_list_cb=None, parts_list_cb=None): if not new_anim_cb or not anims_list_cb: raise TypeError("You must set callbacks for animations retrieval" " and creation on NewAnimationWizard objects.") Wizard.__init__(self, parent) self.page_add("default", "New Animation", "Name the new animation to be created.", separator=True) self._anim_name_entry = NameEntry( self, changed_cb=self._name_changed_cb, weight_hints=(evas.EVAS_HINT_EXPAND, 0.0), align_hints=(evas.EVAS_HINT_FILL, 0.5)) self.content_add("default", self._anim_name_entry) self._anim_name_entry.show() lbl = elementary.Label(self) lbl.text_set("Select the parts to use in the animation." " An empty selection will use all parts.") self.content_add("default", lbl) lbl.show() self._parts_list = elementary.List(self) self._parts_list.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) self._parts_list.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL) if parts_list_cb: for p in parts_list_cb(): self._parts_list.item_append(p) self._parts_list.multi_select = True self._parts_list.go() self.content_add("default", self._parts_list) self._parts_list.show() self.alternate_background_set(True) self.action_add("default", "Cancel", self._cancel, key="Escape") self.action_add("default", "Add", self._add, key="Return") self.action_disabled_set("default", "Add", True) self._new_anim_cb = new_anim_cb self._anims_list_cb = anims_list_cb
def __init__(self, parent, selected_cb, file_add_cb): Wizard.__init__(self, parent) self._selected_cb = selected_cb self._file_add_cb = file_add_cb self._selection = "" self._file_list_page_created = False self._add_new_file_page_created = False self._file_preview_page_created = False self._file_list_add() if self._files == []: self._create_add_new_file_page() else: self._create_file_list_page()
def __init__(self, parent): Wizard.__init__(self, parent) self.page_add("default", "About Editje") ico = elementary.Icon(self) ico.file_set(sysconfig.theme_file_get("default"), "editje/icon/editje") ico.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL) ico.size_hint_min_set(128, 128) ico.size_hint_max_set(128, 128) ico.show() self.content_add("default", ico) name = elementary.Label(self) name.text_set("<b>Editje " + str(sysconfig.VERSION) + "</b>") name.show() self.content_add("default", name) name = elementary.Label(self) name.text_set("Copyright (C) 2009-2010") name.show() self.content_add("default", name) name = elementary.Label(self) name.text_set("Samsung Electronics.") name.show() self.content_add("default", name) url = elementary.Entry(self) url.entry_set("http://trac.enlightenment.org/e/wiki/Editje") url.editable_set(False) url.show() self.content_add("default", url) sc = elementary.Scroller(self) sc.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) sc.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL) sc.bounce_set(False, False) sc.show() self.content_add("default", sc) copyright = elementary.Label(self) copyright.text_set( "Editje is free software: you can redistribute it and/or modify it <br>" "under the terms of the GNU Lesser General Public License as <br>" "published by the Free Software Foundation, either version 3 of the<br>" "License, or (at your option) any later version. <br>" " <br>" "Editje is distributed in the hope that it will be useful, <br>" "but WITHOUT ANY WARRANTY; without even the implied warranty of <br>" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the <br>" "GNU Lesser General Public License for more details. <br>" " <br>" "You should have received a copy of the GNU Lesser General Public <br>" "License along with Editje. If not, see <br>" "http://www.gnu.org/licenses/ <br>" ) copyright.show() sc.content_set(copyright) self.action_add("default", "Close", self.close, key="Escape")
def goto(self, page, alt_bg_style=None): Wizard.goto(self, page)
def goto(self, page, alt_bg_style=None): Wizard.goto(self, page) if alt_bg_style is True: self.alternate_background_set(True) else: self.alternate_background_set(False)
def __init__(self, parent, switch_only=False, selected_set_cb=None, selected_get_cb=None, new_grp_cb=None, check_grp_cb=None, del_grp_cb=None, error_get_cb=None): if not selected_set_cb or not selected_get_cb or not new_grp_cb or \ not check_grp_cb or not del_grp_cb: raise TypeError("You must set callbacks for group" \ " {selection,addition,checking,deletion} on" \ " GroupSelectionWizard objects.") Wizard.__init__(self, parent) self._select_set_cb = selected_set_cb self._select_get_cb = selected_get_cb self._check_group_cb = check_grp_cb self._delete_cb = del_grp_cb self._error_get_cb = error_get_cb self.page_add( "group_list", "Select a group", "Select an existing group to edit, or create a new one.") self._groups_list = GroupsList(self, self._goto_preview) self.content_add("group_list", self._groups_list) self._groups_list.show() if not switch_only: self.action_add("group_list", "Cancel", self.close, key="Escape") self.action_add("group_list", "New", self._goto_new_group, key="n") def group_added(cb_func): name = self._grp_name_entry.entry success = cb_func(name) if not success: self.notify("Error creating new group.") return self._group_selected(name) self.page_add("new_group", "Create a new group", "Enter a name for a new group in the file.", separator=True) self._grp_name_entry = NameEntry(self, changed_cb=self._name_changed_cb) self.content_add("new_group", self._grp_name_entry) self._grp_name_entry.show() self.action_add("new_group", "Cancel", self.goto, "group_list", key="Escape") self.action_add("new_group", "Create", group_added, new_grp_cb, key="Return") self.page_add("group_preview", "Group preview", "Delete or start editing this group.") self._preview = PreviewFrame(self) self.content_add("group_preview", self._preview) self._preview.show() self.action_add("group_preview", "Cancel", self._goto_group_list, key="Escape") self.action_add("group_preview", "Delete", self._delete_group, key="Delete") self.action_add("group_preview", "Open", self._group_selected, key="Return") self.goto("group_list")
def __init__(self, parent): Wizard.__init__(self, parent) self.page_add("default", "About Editje") ico = elementary.Icon(self) ico.file_set(sysconfig.theme_file_get("default"), "editje/icon/editje") ico.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL) ico.size_hint_min_set(128, 128) ico.size_hint_max_set(128, 128) ico.show() self.content_add("default", ico) name = elementary.Label(self) name.text_set("<b>Editje " + str(sysconfig.VERSION) + "</b>") name.show() self.content_add("default", name) name = elementary.Label(self) name.text_set("Copyright (C) 2009-2010") name.show() self.content_add("default", name) name = elementary.Label(self) name.text_set("Samsung Electronics.") name.show() self.content_add("default", name) url = elementary.Entry(self) url.entry_set("http://trac.enlightenment.org/e/wiki/Editje") url.editable_set(False) url.show() self.content_add("default", url) sc = elementary.Scroller(self) sc.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) sc.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL) sc.bounce_set(False, False) sc.show() self.content_add("default", sc) copyright = elementary.Label(self) copyright.text_set( "Editje is free software: you can redistribute it and/or modify it <br>" "under the terms of the GNU Lesser General Public License as <br>" "published by the Free Software Foundation, either version 3 of the<br>" "License, or (at your option) any later version. <br>" " <br>" "Editje is distributed in the hope that it will be useful, <br>" "but WITHOUT ANY WARRANTY; without even the implied warranty of <br>" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the <br>" "GNU Lesser General Public License for more details. <br>" " <br>" "You should have received a copy of the GNU Lesser General Public <br>" "License along with Editje. If not, see <br>" "http://www.gnu.org/licenses/ <br>") copyright.show() sc.content_set(copyright) self.action_add("default", "Close", self.close, key="Escape")