def signal_window_destroy(self, window):
		gui_utilities.gtk_widget_destroy_children(self)
		gui_utilities.gtk_sync()
		self.server_disconnect()
		self.save_config()
		Gtk.main_quit()
		return
Example #2
0
	def do_exit(self):
		self.main_window.hide()
		gui_utilities.gtk_widget_destroy_children(self.main_window)
		gui_utilities.gtk_sync()
		self.server_disconnect()
		self.main_window.destroy()
		return
Example #3
0
	def do_exit(self):
		self.plugin_manager.shutdown()
		self.main_window.hide()
		gui_utilities.gtk_widget_destroy_children(self.main_window)
		gui_utilities.gtk_sync()
		self.emit('server-disconnected')
		self.main_window.destroy()
		return
Example #4
0
	def do_exit(self):
		self.plugin_manager.shutdown()
		self.main_window.hide()
		gui_utilities.gtk_widget_destroy_children(self.main_window)
		gui_utilities.gtk_sync()
		self.emit('server-disconnected')
		self.main_window.destroy()
		return
Example #5
0
 def do_exit(self):
     self.hide()
     gui_utilities.gtk_widget_destroy_children(self)
     gui_utilities.gtk_sync()
     self.server_disconnect()
     self.save_config()
     self.destroy()
     Gtk.main_quit()
     return
Example #6
0
 def _set_info_plugin_reference_urls(self, reference_urls):
     label = self.gobjects['label_plugin_info_for_references']
     listbox = self.gobjects['listbox_plugin_info_references']
     gui_utilities.gtk_widget_destroy_children(listbox)
     if not reference_urls:
         label.set_property('visible', False)
         listbox.set_property('visible', False)
         return
     label.set_property('visible', True)
     listbox.set_property('visible', True)
     gui_utilities.gtk_listbox_populate_urls(
         listbox,
         reference_urls,
         signals={'activate-link': self.signal_label_activate_link})
Example #7
0
    def signal_combobox_changed_set_url_information(self, _):
        for label in ('info_title', 'info_authors', 'info_created',
                      'info_description'):
            self.gobjects['label_url_' + label].set_text('')
        hostname = gui_utilities.gtk_combobox_get_entry_text(
            self.gobjects['combobox_url_hostname'])
        if not hostname:
            return
        combobox_url_path = self.gobjects['combobox_url_path']
        path = gui_utilities.gtk_combobox_get_active_cell(combobox_url_path,
                                                          column=1)
        if path is None:
            model = combobox_url_path.get_model()
            text = utilities.make_webrelpath(
                gui_utilities.gtk_combobox_get_entry_text(combobox_url_path))
            row_iter = gui_utilities.gtk_list_store_search(model, text)
            if row_iter:
                path = model[row_iter][1]
        gui_utilities.gtk_widget_destroy_children(
            self.gobjects['listbox_url_info_classifiers'])
        gui_utilities.gtk_widget_destroy_children(
            self.gobjects['listbox_url_info_references'])
        cached_result = self._cache_site_template.get((hostname, path))
        if cached_result:
            self.__async_rpc_cb_populate_url_info(hostname, path,
                                                  cached_result)
            return
        self.application.rpc.async_graphql(
            """
			query getSiteTemplate($hostname: String, $path: String) {
			  siteTemplate(hostname: $hostname, path: $path) {
				created path metadata { title authors description referenceUrls classifiers pages }
			  }
			}
			""",
            query_vars={
                'hostname': hostname,
                'path': path
            },
            on_success=self.__async_rpc_cb_populate_url_info,
            cb_args=(hostname, path),
            when_idle=True)
Example #8
0
 def _set_info_plugin_classifiers(self, classifiers):
     label = self.gobjects['label_plugin_info_for_classifiers']
     listbox = self.gobjects['listbox_plugin_info_classifiers']
     gui_utilities.gtk_widget_destroy_children(listbox)
     if not classifiers:
         label.set_property('visible', False)
         listbox.set_property('visible', False)
         return
     label.set_property('visible', True)
     listbox.set_property('visible', True)
     for classifier in classifiers:
         label = Gtk.Label()
         label.set_markup(
             "<span font=\"smaller\"><tt>{0}</tt></span>".format(
                 saxutils.escape(classifier)))
         label.set_property('halign', Gtk.Align.START)
         label.set_property('use-markup', True)
         label.set_property('valign', Gtk.Align.START)
         label.set_property('visible', True)
         listbox.add(label)
	def _set_info_plugin_reference_urls(self, reference_urls):
		label = self.gobjects['label_plugin_info_for_references']
		listbox = self.gobjects['listbox_plugin_info_references']
		gui_utilities.gtk_widget_destroy_children(listbox)
		if not reference_urls:
			label.set_property('visible', False)
			listbox.set_property('visible', False)
			return
		label.set_property('visible', True)
		listbox.set_property('visible', True)
		for reference_url in reference_urls:
			label = Gtk.Label()
			label.connect('activate-link', self.signal_label_activate_link)
			label.set_markup("<a href=\"{0}\">{1}</a>".format(reference_url.replace('"', '&quot;'), saxutils.escape(reference_url)))
			label.set_property('halign', Gtk.Align.START)
			label.set_property('track-visited-links', False)
			label.set_property('use-markup', True)
			label.set_property('valign', Gtk.Align.START)
			label.set_property('visible', True)
			listbox.add(label)
Example #10
0
 def _set_info_plugin_reference_urls(self, reference_urls):
     label = self.gobjects['label_plugin_info_for_references']
     listbox = self.gobjects['listbox_plugin_info_references']
     gui_utilities.gtk_widget_destroy_children(listbox)
     if not reference_urls:
         label.set_property('visible', False)
         listbox.set_property('visible', False)
         return
     label.set_property('visible', True)
     listbox.set_property('visible', True)
     for reference_url in reference_urls:
         label = Gtk.Label()
         label.connect('activate-link', self.signal_label_activate_link)
         label.set_markup("<a href=\"{0}\">{1}</a>".format(
             reference_url.replace('"', '&quot;'),
             saxutils.escape(reference_url)))
         label.set_property('halign', Gtk.Align.START)
         label.set_property('track-visited-links', False)
         label.set_property('use-markup', True)
         label.set_property('valign', Gtk.Align.START)
         label.set_property('visible', True)
         listbox.add(label)