Exemple #1
0
void File_Browser::value_action_callback(const String & in)
{
    value_callback(in);

    if (_value.type() != File::DIRECTORY)
    {
        ok_callback(true);
    }
}
Exemple #2
0
void File_Browser::browser_action_callback(const File & in)
{
    //DJV_DEBUG("File_Browser::browser_action_callback");
    //DJV_DEBUG_PRINT("in = " << in);

    set(in.type() == File::DIRECTORY ? File(File_Util::path_fix(in)) : in);

    if (_value.type() != File::DIRECTORY)
    {
        ok_callback(true);
    }
}
Exemple #3
0
void edit_group_window_new(grouplist *g)
{
	gchar buff[1024];
	gchar *name;
	if (g)
		name = g->name;
	else
		name = "";
	if (!window_open) {
		GtkWidget *hbox = gtk_hbox_new(FALSE, 5);
		GtkWidget *label;
		GtkWidget *frame;
		GtkWidget *dialog_content_area;

		label = gtk_label_new(_("Group Name:"));
		gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);

		group_name = gtk_entry_new();
		gtk_box_pack_start(GTK_BOX(hbox), group_name, TRUE, TRUE, 5);
		gtk_entry_set_text(GTK_ENTRY(group_name), name);

		frame = gtk_frame_new(NULL);

		g_snprintf(buff, 1024, _("%s group%s%s"),
			g ? _("Edit") : _("Add"), g ? " " : "", name);

		gtk_frame_set_label(GTK_FRAME(frame), buff);
		gtk_container_add(GTK_CONTAINER(frame), hbox);

		edit_group_window = gtk_dialog_new_with_buttons("Ayttm",
			GTK_WINDOW(statuswindow),
			GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
			g ? GTK_STOCK_SAVE : GTK_STOCK_ADD,
			GTK_RESPONSE_ACCEPT,
			GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL);

		gtk_dialog_set_default_response(GTK_DIALOG(edit_group_window),
			GTK_RESPONSE_ACCEPT);

#ifdef HAVE_GTK_2_14
		dialog_content_area =
			gtk_dialog_get_content_area(GTK_DIALOG
			(edit_group_window));
#else
		dialog_content_area = GTK_DIALOG(edit_group_window)->vbox;
#endif

		gtk_box_pack_start(GTK_BOX(dialog_content_area), frame, TRUE,
			TRUE, 5);
		gtk_widget_show_all(edit_group_window);

		window_open = 1;
	}

	gtk_entry_set_text(GTK_ENTRY(group_name), name);
	if (g)
		g_snprintf(buff, 1024, _("Edit Properties for %s"), name);
	else
		g_snprintf(buff, 1024, _("Add group"));

	gtk_window_set_title(GTK_WINDOW(edit_group_window), buff);

	gtk_widget_grab_focus(group_name);

	if (GTK_RESPONSE_ACCEPT ==
		gtk_dialog_run(GTK_DIALOG(edit_group_window)))
		ok_callback(g);

	gtk_widget_destroy(edit_group_window);
	window_open = 0;
}
Exemple #4
0
static void destroy_callback(GtkWidget *widget, GtkWidget *cached_window)
{
ok_callback(widget, widget);
}