Example #1
0
void
gnc_GWEN_Gui_shutdown(void)
{
    GncGWENGui *gui = full_gui;

    ENTER(" ");

    if (log_gwen_gui)
    {
        GWEN_Gui_free(log_gwen_gui);
        log_gwen_gui = NULL;
    }
    GWEN_Gui_SetGui(NULL);

    if (!gui)
        return;

    gui->parent = NULL;
    reset_dialog(gui);
    if (gui->passwords)
        g_hash_table_destroy(gui->passwords);
    if (gui->showbox_hash)
        g_hash_table_destroy(gui->showbox_hash);
    if (gui->permanently_accepted_certs)
        GWEN_DB_Group_free(gui->permanently_accepted_certs);
    if (gui->accepted_certs)
        g_hash_table_destroy(gui->accepted_certs);
    gtk_widget_destroy(gui->dialog);
    g_free(gui);

    full_gui = NULL;

    LEAVE(" ");
}
Example #2
0
int main(int ac, char **av)
{
	char *mode;
	int res;

	setlocale(LC_ALL, "");
	bindtextdomain(PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);

	conf_parse(av[1]);
	conf_read(NULL);

	mode = getenv("MENUCONFIG_MODE");
	if (mode) {
		if (!strcasecmp(mode, "single_menu"))
			single_menu_mode = 1;
	}

	tcgetattr(1, &ios_org);
	atexit(conf_cleanup);
	init_wsize();
	reset_dialog();
	init_dialog(NULL);
	set_config_filename(conf_get_configname());
	do {
		conf(&rootmenu);
		dialog_clear();
		if (conf_get_changed())
			res = dialog_yesno(NULL,
					   _("Do you wish to save your "
					     "new configuration?\n"
					     "<ESC><ESC> to continue."),
					   6, 60);
		else
			res = -1;
	} while (res == KEY_ESC);
	end_dialog();

	switch (res) {
	case 0:
		if (conf_write(filename)) {
			fprintf(stderr, _("\n\n"
				"Error during writing of the configuration.\n"
				"Your configuration changes were NOT saved."
				"\n\n"));
			return 1;
		}
	case -1:
		printf(_("\n\n"
			"*** End of configuration.\n"
			"\n\n"));
		break;
	default:
		fprintf(stderr, _("\n\n"
			"Your configuration changes were NOT saved."
			"\n\n"));
	}

	return 0;
}
Example #3
0
GncGWENGui *
gnc_GWEN_Gui_get(GtkWidget *parent)
{
    GncGWENGui *gui;

    ENTER("parent=%p", parent);

    if (full_gui)
    {
        if (full_gui->state == INIT || full_gui->state == RUNNING)
        {
            LEAVE("full_gui in use, state=%d", full_gui->state);
            return NULL;
        }

        gui = full_gui;
        gui->parent = parent;
        reset_dialog(gui);
        register_callbacks(gui);

        LEAVE("gui=%p", gui);
        return gui;
    }

    gui = g_new0(GncGWENGui, 1);
    gui->parent = parent;
    setup_dialog(gui);
    register_callbacks(gui);

    full_gui = gui;

    LEAVE("new gui=%p", gui);
    return gui;
}
Example #4
0
int main(int ac, char **av)
{
	struct symbol *sym;
	char *mode;
	int res;

	setlocale(LC_ALL, "");
	bindtextdomain(PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);

	conf_parse(av[1]);
	conf_read(NULL);

	sym = sym_lookup("KERNELVERSION", 0);
	sym_calc_value(sym);
	sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"),
		sym_get_string_value(sym));

	mode = getenv("MENUCONFIG_MODE");
	if (mode) {
		if (!strcasecmp(mode, "single_menu"))
			single_menu_mode = 1;
	}

	tcgetattr(1, &ios_org);
	atexit(conf_cleanup);
	init_wsize();
	reset_dialog();
	init_dialog(menu_backtitle);
	do {
		conf(&rootmenu);
		dialog_clear();
		res = dialog_yesno(NULL,
				   _("Do you wish to save your "
				     "new kernel configuration?\n"
				     "<ESC><ESC> to continue."),
				   6, 60);
	} while (res == KEY_ESC);
	end_dialog();
	if (res == 0) {
		if (conf_write(NULL)) {
			fprintf(stderr, _("\n\n"
				"Error during writing of the kernel configuration.\n"
				"Your kernel configuration changes were NOT saved."
				"\n\n"));
			return 1;
		}
		printf(_("\n\n"
			"*** End of Linux kernel configuration.\n"
			"*** Execute 'make' to build the kernel or try 'make help'."
			"\n\n"));
	} else {
		fprintf(stderr, _("\n\n"
			"Your kernel configuration changes were NOT saved."
			"\n\n"));
	}

	return 0;
}
static void
html_editor_find_dialog_show (GtkWidget *widget)
{
	EHTMLEditorFindDialog *dialog = E_HTML_EDITOR_FIND_DIALOG (widget);

	reset_dialog (dialog);
	gtk_widget_grab_focus (dialog->priv->entry);

	/* Chain up to parent's implementation */
	GTK_WIDGET_CLASS (e_html_editor_find_dialog_parent_class)->show (widget);
}
Example #6
0
static gboolean
entry_key_release_event (GtkWidget *widget,
                         GdkEvent *event,
                         gpointer user_data)
{
	GdkEventKey *key = &event->key;
	EHTMLEditorFindDialog *dialog = user_data;

	if (key->keyval == GDK_KEY_Return) {
		html_editor_find_dialog_find_cb (dialog);
		return TRUE;
	}

	reset_dialog (dialog);
	return FALSE;
}
Example #7
0
static void
setup_dialog(GncGWENGui *gui)
{
    GladeXML *xml;
    gint component_id;

    g_return_if_fail(gui);

    ENTER("gui=%p", gui);

    xml = gnc_glade_xml_new("aqbanking.glade", "Connection Dialog");

    gui->dialog = glade_xml_get_widget(xml, "Connection Dialog");
    g_object_set_data_full(G_OBJECT(gui->dialog), "xml", xml, g_object_unref);
    glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, gui);
    gui->entries_table = glade_xml_get_widget(xml, "entries_table");
    gui->top_entry = glade_xml_get_widget(xml, "top_entry");
    gui->top_progress = glade_xml_get_widget(xml, "top_progress");
    gui->second_entry = glade_xml_get_widget(xml, "second_entry");
    gui->other_entries_box = NULL;
    gui->progresses = NULL;
    gui->log_text = glade_xml_get_widget(xml, "log_text");
    gui->abort_button = glade_xml_get_widget(xml, "abort_button");
    gui->close_button = glade_xml_get_widget(xml, "close_button");
    gui->close_checkbutton = glade_xml_get_widget(xml, "close_checkbutton");
    gui->accepted_certs = NULL;
    gui->permanently_accepted_certs = NULL;
    gui->showbox_hash = NULL;
    gui->showbox_id = 1;

    gtk_toggle_button_set_active(
        GTK_TOGGLE_BUTTON(gui->close_checkbutton),
        gnc_gconf_get_bool(GCONF_SECTION_AQBANKING, KEY_CLOSE_ON_FINISH, NULL));

    component_id = gnc_register_gui_component(GWEN_GUI_CM_CLASS, NULL,
                   cm_close_handler, gui);
    gnc_gui_component_set_session(component_id, gnc_get_current_session());

    reset_dialog(gui);

    LEAVE(" ");
}