def _start_email_client(self, obj=None): import GrampsDisplay GrampsDisplay.url('mailto:[email protected]?subject=' '"bug report"&body="%s"' \ % self._final_report_text_buffer.get_text( self._final_report_text_buffer.get_start_iter(), self._final_report_text_buffer.get_end_iter()))
def __init__(self, tag_list, full_list, uistate, track): """ Initiate and display the dialog. """ ManagedWindow.ManagedWindow.__init__(self, uistate, track, self) self.namemodel = None top = self._create_dialog() self.set_window(top, None, _('Tag selection')) for tag in full_list: self.namemodel.add([tag[0], tag in tag_list, tag[1]]) self.namemodel.connect_model() # The dialog is modal. We don't want to have several open dialogs of # this type, since then the user will loose track of which is which. self.return_list = None self.show() while True: response = self.window.run() if response == gtk.RESPONSE_HELP: GrampsDisplay.help(webpage=WIKI_HELP_PAGE, section=WIKI_HELP_SEC) elif response == gtk.RESPONSE_DELETE_EVENT: break else: if response == gtk.RESPONSE_OK: self.return_list = [(row[0], row[2]) for row in self.namemodel.model if row[1]] self.close() break
def run(self): """ Run the dialog and return the result. """ self._populate_model() while True: response = self.top.run() if response == gtk.RESPONSE_HELP: GrampsDisplay.help(webpage=WIKI_HELP_PAGE, section=WIKI_HELP_SEC) else: break # Save changed priority values if self.__priorities_changed(): with DbTxn(_('Change Tag Priority'), self.db) as trans: self.__change_tag_priority(trans) self.top.destroy()
def handle_response(self, object, response): """ Callback for taking care of button clicks. """ if response in [gtk.RESPONSE_CLOSE, gtk.STOCK_CLOSE]: self.close() elif response == gtk.RESPONSE_HELP: # translated name: if self.gramplet.help_url: if self.gramplet.help_url.startswith("http://"): GrampsDisplay.url(self.gramplet.help_url) else: GrampsDisplay.help(self.gramplet.help_url) else: GrampsDisplay.help(WIKI_HELP_PAGE, self.gramplet.tname.replace(" ", "_"))
def help(self, obj): """Display the relevant portion of GRAMPS manual""" GrampsDisplay.help('adv-merge-people')
def help(self,obj): """Display the relevant portion of GRAMPS manual""" GrampsDisplay.help('adv-merge-people')
def define_help_button(self, button, webpage='', section=''): import GrampsDisplay button.connect('clicked', lambda x: GrampsDisplay.help(webpage, section)) button.set_sensitive(True)
def define_help_button(self, button, webpage='', section=''): button.connect('clicked', lambda x: GrampsDisplay.help(webpage, section))
def on_help_clicked(self, *obj): import GrampsDisplay GrampsDisplay.help(URL_REPORT_PAGE, self.report_name.replace(" ", "_"))
def on_help_clicked(self, obj): """Display the relevant portion of GRAMPS manual""" GrampsDisplay.help(WIKI_HELP_PAGE, WIKI_HELP_SEC)
def on_help_clicked(self, obj): """Display the relevant portion of GRAMPS manual""" GrampsDisplay.help()
def jump_to(self, obj): if self.obj.get_path(): import GrampsDisplay GrampsDisplay.url(self.obj.get_path())
def _start_gramps_bts_in_browser(self, obj=None): import GrampsDisplay GrampsDisplay.url('http://bugs.gramps-project.org/bug_report_page.php')
def help_clicked(self): """Display the relevant portion of GRAMPS manual.""" GrampsDisplay.help(webpage=WIKI_HELP_PAGE, section=WIKI_HELP_SEC)
def on_help_clicked(self,obj): """Display the relevant portion of GRAMPS manual""" GrampsDisplay.help('tools-db')
def on_help_button_clicked(self, obj): """Display the relevant portion of GRAMPS manual""" GrampsDisplay.help(webpage=WIKI_HELP_PAGE, section=WIKI_HELP_SEC)
def __display(self): """Show the url in an external browser""" if self.url: GrampsDisplay.url(self.url)
def cb_help(self, obj): """Display the relevant portion of the Gramps manual""" GrampsDisplay.help(webpage=WIKI_HELP_PAGE, section=WIKI_HELP_SEC)
def __init__(self, date, uistate, track): """ Initiate and display the dialog. """ ManagedWindow.ManagedWindow.__init__(self, uistate, track, self) # Create self.date as a copy of the given Date object. self.date = Date(date) self.top = Glade() self.set_window(self.top.toplevel, self.top.get_object('title'), _('Date selection')) self.statusbar = self.top.get_object('statusbar') self.ok_button = self.top.get_object('ok_button') self.calendar_box = self.top.get_object('calendar_box') for name in Date.ui_calendar_names: self.calendar_box.get_model().append([name]) self.calendar_box.set_active(self.date.get_calendar()) self.calendar_box.connect('changed', self.switch_calendar) self.quality_box = self.top.get_object('quality_box') for item_number in range(len(QUAL_TEXT)): self.quality_box.append_text(QUAL_TEXT[item_number][1]) if self.date.get_quality() == QUAL_TEXT[item_number][0]: self.quality_box.set_active(item_number) self.type_box = self.top.get_object('type_box') for item_number in range(len(MOD_TEXT)): self.type_box.append_text(MOD_TEXT[item_number][1]) if self.date.get_modifier() == MOD_TEXT[item_number][0]: self.type_box.set_active(item_number) self.type_box.connect('changed', self.switch_type) self.start_month_box = self.top.get_object('start_month_box') self.stop_month_box = self.top.get_object('stop_month_box') month_names = CAL_TO_MONTHS_NAMES[self.date.get_calendar()] for name in month_names: self.start_month_box.append_text(name) self.stop_month_box.append_text(name) self.start_month_box.set_active(self.date.get_month()) self.stop_month_box.set_active(self.date.get_stop_month()) self.start_day = self.top.get_object('start_day') self.start_day.set_value(self.date.get_day()) self.start_year = self.top.get_object('start_year') self.start_year.set_value(self.date.get_year()) self.stop_day = self.top.get_object('stop_day') self.stop_day.set_value(self.date.get_stop_day()) self.stop_year = self.top.get_object('stop_year') self.stop_year.set_value(self.date.get_stop_year()) self.dual_dated = self.top.get_object('dualdated') self.new_year = self.top.get_object('newyear') self.new_year.set_text(self.date.newyear_to_str()) # Disable second date controls if not compound date if not self.date.is_compound(): self.stop_day.set_sensitive(0) self.stop_month_box.set_sensitive(0) self.stop_year.set_sensitive(0) # Disable the rest of controls if a text-only date if self.date.get_modifier() == Date.MOD_TEXTONLY: self.start_day.set_sensitive(0) self.start_month_box.set_sensitive(0) self.start_year.set_sensitive(0) self.calendar_box.set_sensitive(0) self.quality_box.set_sensitive(0) self.dual_dated.set_sensitive(0) self.new_year.set_sensitive(0) self.text_entry = self.top.get_object('date_text_entry') self.text_entry.set_text(self.date.get_text()) if self.date.get_slash(): self.dual_dated.set_active(1) self.calendar_box.set_sensitive(0) self.calendar_box.set_active(Date.CAL_JULIAN) self.dual_dated.connect('toggled', self.switch_dual_dated) # The dialog is modal -- since dates don't have names, we don't # want to have several open dialogs, since then the user will # loose track of which is which. Much like opening files. self.validated_date = self.return_date = None for o in self.top.get_objects(): try: if o != self.ok_button: o.connect_after('changed', self.revalidate) except TypeError: pass # some of them don't support the signal, ignore them... self.revalidate() self.show() while True: response = self.window.run() if response == gtk.RESPONSE_HELP: GrampsDisplay.help(webpage=WIKI_HELP_PAGE, section=WIKI_HELP_SEC) elif response == gtk.RESPONSE_DELETE_EVENT: break else: if response == gtk.RESPONSE_OK: # if the user pressed OK/enter while inside an edit field, # e.g., the year, # build_date_from_ui won't pick up the new text in the # run of revalidate that allowed the OK! if not self.revalidate(): continue self.return_date = Date() self.return_date.copy(self.validated_date) self.close() break