Beispiel #1
0
gchar *input_dialog_with_checkbtn(const gchar	*title,
				   const gchar	*message,
				   const gchar	*default_string,
				   const gchar  *checkbtn_label,
				   gboolean *checkbtn_state)
{
	if (dialog && gtk_widget_get_visible(dialog)) return NULL;

	if (!dialog)
		input_dialog_create(FALSE);

	type = INPUT_DIALOG_NORMAL;
	gtk_widget_hide(combo);
	gtk_widget_show(entry);

	if (checkbtn_label && checkbtn_state)
		gtk_widget_show(remember_checkbtn);
	else
		gtk_widget_hide(remember_checkbtn);

	gtk_widget_show(icon_q);
	gtk_widget_hide(icon_p);
	is_pass = FALSE;
	gtk_entry_set_visibility(GTK_ENTRY(entry), TRUE);

	return input_dialog_open(title, message, checkbtn_label, default_string, 
	       			 prefs_common.inherit_folder_props, checkbtn_state);
}
Beispiel #2
0
gchar *input_dialog_with_invisible_checkbtn(const gchar *title, const gchar *message,
				   const gchar *default_string, const gchar *checkbtn_label,
				   gboolean *checkbtn_state)
{
	if (dialog && gtk_widget_get_visible(dialog)) return NULL;

	if (!dialog)
		input_dialog_create(TRUE);

	type = INPUT_DIALOG_INVISIBLE;
	gtk_widget_hide(combo);
	gtk_widget_show(entry);

	if (checkbtn_label && checkbtn_state) {
		gtk_widget_show(remember_checkbtn);
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remember_checkbtn), *checkbtn_state);
	}
	else {
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remember_checkbtn), FALSE);
		gtk_widget_hide(remember_checkbtn);
	}

	gtk_widget_hide(icon_q);
	gtk_widget_show(icon_p);
	is_pass = TRUE;
	gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);

	return input_dialog_open(title, message, checkbtn_label, default_string, (checkbtn_state? *checkbtn_state:FALSE), checkbtn_state);
}
Beispiel #3
0
gchar *input_dialog_combo_remember(const gchar *title, const gchar *message,
			  const gchar *default_string, GList *list,
			  gboolean *remember)
{
	if (dialog && gtk_widget_get_visible(dialog)) return NULL;

	if (!dialog)
		input_dialog_create(FALSE);

	type = INPUT_DIALOG_COMBO;
	gtk_widget_hide(entry);
	gtk_widget_show(combo);

	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remember_checkbtn), FALSE);
	if (remember)
		gtk_widget_show(remember_checkbtn);
	else
		gtk_widget_hide(remember_checkbtn);

	gtk_widget_show(icon_q);
	gtk_widget_hide(icon_p);
	is_pass = FALSE;
#if !GTK_CHECK_VERSION(2, 24, 0)
	combobox_unset_popdown_strings(GTK_COMBO_BOX(combo));
	combobox_set_popdown_strings(GTK_COMBO_BOX(combo), list);
#else
	combobox_unset_popdown_strings(GTK_COMBO_BOX_TEXT(combo));
	combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(combo), list);
#endif
	return input_dialog_open(title, message, NULL, default_string, FALSE, remember);
}
Beispiel #4
0
gchar *input_dialog(const gchar *title, const gchar *message,
		    const gchar *default_string)
{
	if (dialog)
		return NULL;

	input_dialog_create(INPUT_DIALOG_NORMAL);

	return input_dialog_open(title, message, default_string);
}
Beispiel #5
0
gchar *input_dialog_with_invisible(const gchar *title, const gchar *message,
				   const gchar *default_string)
{
	if (dialog)
		return NULL;

	input_dialog_create(INPUT_DIALOG_INVISIBLE);

	return input_dialog_open(title, message, default_string);
}
Beispiel #6
0
gchar *input_dialog_with_filesel(const gchar *title, const gchar *message,
				 const gchar *default_string,
				 GtkFileChooserAction action)
{
	if (dialog)
		return NULL;

	input_dialog_create(INPUT_DIALOG_FILESEL);
	chooser_action = action;

	return input_dialog_open(title, message, default_string);
}
Beispiel #7
0
gchar *input_dialog_with_invisible(const gchar *title, const gchar *message,
				   const gchar *default_string)
{
	if (dialog && gtk_widget_get_visible(dialog)) return NULL;

	if (!dialog)
		input_dialog_create(TRUE);

	type = INPUT_DIALOG_INVISIBLE;
	gtk_widget_hide(combo);
	gtk_widget_show(entry);
	gtk_widget_hide(remember_checkbtn);

	gtk_widget_hide(icon_q);
	gtk_widget_show(icon_p);
	is_pass = TRUE;
	gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);

	return input_dialog_open(title, message, NULL, default_string, FALSE, NULL);
}
Beispiel #8
0
gchar *input_dialog_combo(const gchar *title, const gchar *message,
			  const gchar *default_string, GList *list,
			  gboolean case_sensitive)
{
	if (dialog)
		return NULL;

	input_dialog_create(INPUT_DIALOG_COMBO);

	if (!list) {
		GList empty_list;

		empty_list.data = (gpointer)"";
		empty_list.next = NULL;
		empty_list.prev = NULL;
		gtk_combo_set_popdown_strings(GTK_COMBO(combo), &empty_list);
	} else
		gtk_combo_set_popdown_strings(GTK_COMBO(combo), list);

	gtk_combo_set_case_sensitive(GTK_COMBO(combo), case_sensitive);

	return input_dialog_open(title, message, default_string);
}