Commit a3ccdb82 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

libgimpwidgets/gimpfileentry.c libgimpwidgets/gimppatheditor.c moved

2003-12-18  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpfileentry.c
	* libgimpwidgets/gimppatheditor.c
	* libgimpwidgets/gimpunitmenu.c (*_class_init): moved signal
	documentation from the gtk-doc templates to comments.

	* libgimpwidgets/gimppatheditor.c (gimp_path_editor_set_path):
	emit the "path-changed" signal.

	* libgimpwidgets/gimppatheditor.[ch]: s/gpe/editor/g.

2003-12-18  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/tmpl/gimppatheditor.sgml
	* libgimpwidgets/tmpl/gimpunitmenu.sgml: removed signal
	documentation, it lives in the .c files now.

	* libgimpwidgets/tmpl/gimpwidgets.sgml: updated.
parent cfb6640e
2003-12-18 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpfileentry.c
* libgimpwidgets/gimppatheditor.c
* libgimpwidgets/gimpunitmenu.c (*_class_init): moved signal
documentation from the gtk-doc templates to comments.
* libgimpwidgets/gimppatheditor.c (gimp_path_editor_set_path):
emit the "path-changed" signal.
* libgimpwidgets/gimppatheditor.[ch]: s/gpe/editor/g.
2003-12-17 Dave Neary <bolsh@gimp.org>
* libgimpwidgets/gimpwidgets.[ch]: Change randomize boolean to
2003-12-18 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/tmpl/gimppatheditor.sgml
* libgimpwidgets/tmpl/gimpunitmenu.sgml: removed signal
documentation, it lives in the .c files now.
* libgimpwidgets/tmpl/gimpwidgets.sgml: updated.
2003-12-16 Dave Neary <bolsh@gimp.org>
* */Makefile.am: Fixed syntax errors in makefiles. Oops.
......
......@@ -51,8 +51,10 @@ the search path, the "path_changed" signal will be emitted.
</para>
@gpe:
@editor:
@Returns:
<!-- # Unused Parameters # -->
@gpe:
<!-- ##### FUNCTION gimp_path_editor_set_path ##### -->
......@@ -60,14 +62,15 @@ the search path, the "path_changed" signal will be emitted.
</para>
@gpe:
@editor:
@path:
<!-- # Unused Parameters # -->
@gpe:
<!-- ##### SIGNAL GimpPathEditor::path-changed ##### -->
<para>
This signal is emitted whenever the user adds, deletes, modifies or
reorders an element of the search path.
</para>
@gimppatheditor: the object which received the signal.
......
......@@ -90,8 +90,7 @@ gimp_coordinates_new()
<!-- ##### SIGNAL GimpUnitMenu::unit-changed ##### -->
<para>
This signal is emitted whenever the user selects a #GimpUnit from the
#GimpUnitMenu.
</para>
@gimpunitmenu: the object which received the signal.
......
......@@ -301,6 +301,7 @@ Returns the #GtkAdjustment of the random_seed's #GtkSpinButton.
</para>
@seed:
@random_seed:
@Returns:
......
......@@ -104,6 +104,11 @@ gimp_file_entry_class_init (GimpFileEntryClass *klass)
parent_class = g_type_class_peek_parent (klass);
/**
* GimpFileEntry::filename-changed:
*
* This signal is emitted whenever the user changes the filename.
**/
gimp_file_entry_signals[FILENAME_CHANGED] =
g_signal_new ("filename_changed",
G_TYPE_FROM_CLASS (klass),
......
......@@ -40,18 +40,18 @@ enum
static void gimp_path_editor_class_init (GimpPathEditorClass *klass);
static void gimp_path_editor_init (GimpPathEditor *gpe);
static void gimp_path_editor_init (GimpPathEditor *editor);
static void gimp_path_editor_new_clicked (GtkWidget *widget,
GimpPathEditor *gpe);
GimpPathEditor *editor);
static void gimp_path_editor_move_clicked (GtkWidget *widget,
GimpPathEditor *gpe);
GimpPathEditor *editor);
static void gimp_path_editor_delete_clicked (GtkWidget *widget,
GimpPathEditor *gpe);
GimpPathEditor *editor);
static void gimp_path_editor_file_entry_changed (GtkWidget *widget,
GimpPathEditor *gpe);
GimpPathEditor *editor);
static void gimp_path_editor_selection_changed (GtkTreeSelection *sel,
GimpPathEditor *gpe);
GimpPathEditor *editor);
static gboolean build_path (GtkTreeModel *model,
GtkTreePath *tpath,
......@@ -67,11 +67,11 @@ static GtkVBoxClass *parent_class = NULL;
GType
gimp_path_editor_get_type (void)
{
static GType gpe_type = 0;
static GType type = 0;
if (! gpe_type)
if (! type)
{
static const GTypeInfo gpe_info =
static const GTypeInfo info =
{
sizeof (GimpPathEditorClass),
(GBaseInitFunc) NULL,
......@@ -84,12 +84,12 @@ gimp_path_editor_get_type (void)
(GInstanceInitFunc) gimp_path_editor_init,
};
gpe_type = g_type_register_static (GTK_TYPE_VBOX,
"GimpPathEditor",
&gpe_info, 0);
type = g_type_register_static (GTK_TYPE_VBOX,
"GimpPathEditor",
&info, 0);
}
return gpe_type;
return type;
}
static void
......@@ -97,6 +97,12 @@ gimp_path_editor_class_init (GimpPathEditorClass *klass)
{
parent_class = g_type_class_peek_parent (klass);
/**
* GimpPathEditor::path-changed:
*
* This signal is emitted whenever the user adds, deletes, modifies
* or reorders an element of the search path.
**/
gimp_path_editor_signals[PATH_CHANGED] =
g_signal_new ("path_changed",
G_TYPE_FROM_CLASS (klass),
......@@ -110,7 +116,7 @@ gimp_path_editor_class_init (GimpPathEditorClass *klass)
}
static void
gimp_path_editor_init (GimpPathEditor *gpe)
gimp_path_editor_init (GimpPathEditor *editor)
{
GtkWidget *button_box;
GtkWidget *button;
......@@ -118,19 +124,19 @@ gimp_path_editor_init (GimpPathEditor *gpe)
GtkWidget *scrolled_window;
GtkWidget *tv;
gpe->file_entry = NULL;
gpe->sel_path = NULL;
gpe->num_items = 0;
editor->file_entry = NULL;
editor->sel_path = NULL;
editor->num_items = 0;
gpe->upper_hbox = gtk_hbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (gpe), gpe->upper_hbox, FALSE, TRUE, 0);
gtk_widget_show (gpe->upper_hbox);
editor->upper_hbox = gtk_hbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (editor), editor->upper_hbox, FALSE, TRUE, 0);
gtk_widget_show (editor->upper_hbox);
button_box = gtk_hbox_new (TRUE, 0);
gtk_box_pack_start (GTK_BOX (gpe->upper_hbox), button_box, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (editor->upper_hbox), button_box, FALSE, TRUE, 0);
gtk_widget_show (button_box);
gpe->new_button = button = gtk_button_new ();
editor->new_button = button = gtk_button_new ();
gtk_box_pack_start (GTK_BOX (button_box), button, TRUE, TRUE, 0);
gtk_widget_show (button);
......@@ -140,9 +146,9 @@ gimp_path_editor_init (GimpPathEditor *gpe)
g_signal_connect (button, "clicked",
G_CALLBACK (gimp_path_editor_new_clicked),
gpe);
editor);
gpe->up_button = button = gtk_button_new ();
editor->up_button = button = gtk_button_new ();
gtk_widget_set_sensitive (button, FALSE);
gtk_box_pack_start (GTK_BOX (button_box), button, TRUE, TRUE, 0);
gtk_widget_show (button);
......@@ -153,9 +159,9 @@ gimp_path_editor_init (GimpPathEditor *gpe)
g_signal_connect (button, "clicked",
G_CALLBACK (gimp_path_editor_move_clicked),
gpe);
editor);
gpe->down_button = button = gtk_button_new ();
editor->down_button = button = gtk_button_new ();
gtk_widget_set_sensitive (button, FALSE);
gtk_box_pack_start (GTK_BOX (button_box), button, TRUE, TRUE, 0);
gtk_widget_show (button);
......@@ -166,9 +172,9 @@ gimp_path_editor_init (GimpPathEditor *gpe)
g_signal_connect (button, "clicked",
G_CALLBACK (gimp_path_editor_move_clicked),
gpe);
editor);
gpe->delete_button = button = gtk_button_new ();
editor->delete_button = button = gtk_button_new ();
gtk_widget_set_sensitive (button, FALSE);
gtk_box_pack_start (GTK_BOX (button_box), button, TRUE, TRUE, 0);
gtk_widget_show (button);
......@@ -179,7 +185,7 @@ gimp_path_editor_init (GimpPathEditor *gpe)
g_signal_connect (button, "clicked",
G_CALLBACK (gimp_path_editor_delete_clicked),
gpe);
editor);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
......@@ -187,12 +193,12 @@ gimp_path_editor_init (GimpPathEditor *gpe)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
gtk_box_pack_start (GTK_BOX (gpe), scrolled_window, TRUE, TRUE, 2);
gtk_box_pack_start (GTK_BOX (editor), scrolled_window, TRUE, TRUE, 2);
gtk_widget_show (scrolled_window);
gpe->dir_list = gtk_list_store_new (1, G_TYPE_STRING);
tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (gpe->dir_list));
g_object_unref (gpe->dir_list);
editor->dir_list = gtk_list_store_new (1, G_TYPE_STRING);
tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (editor->dir_list));
g_object_unref (editor->dir_list);
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tv),
-1, NULL,
......@@ -205,17 +211,17 @@ gimp_path_editor_init (GimpPathEditor *gpe)
gtk_container_add (GTK_CONTAINER (scrolled_window), tv);
gtk_widget_show (tv);
gpe->sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv));
g_signal_connect (gpe->sel, "changed",
editor->sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv));
g_signal_connect (editor->sel, "changed",
G_CALLBACK (gimp_path_editor_selection_changed),
gpe);
editor);
}
/**
* gimp_path_editor_new:
* @filesel_title: The title of the #GtkFileSelection dialog which can be
* popped up by the attached #GimpFileSelection.
* @path: The initial search path.
* @path: The initial search path.
*
* Creates a new #GimpPathEditor widget.
*
......@@ -228,31 +234,31 @@ GtkWidget *
gimp_path_editor_new (const gchar *filesel_title,
const gchar *path)
{
GimpPathEditor *gpe;
GimpPathEditor *editor;
g_return_val_if_fail (filesel_title != NULL, NULL);
gpe = g_object_new (GIMP_TYPE_PATH_EDITOR, NULL);
editor = g_object_new (GIMP_TYPE_PATH_EDITOR, NULL);
gpe->file_entry = gimp_file_entry_new (filesel_title, "", TRUE, TRUE);
gtk_widget_set_sensitive (gpe->file_entry, FALSE);
gtk_box_pack_start (GTK_BOX (gpe->upper_hbox), gpe->file_entry,
editor->file_entry = gimp_file_entry_new (filesel_title, "", TRUE, TRUE);
gtk_widget_set_sensitive (editor->file_entry, FALSE);
gtk_box_pack_start (GTK_BOX (editor->upper_hbox), editor->file_entry,
TRUE, TRUE, 0);
gtk_widget_show (gpe->file_entry);
gtk_widget_show (editor->file_entry);
g_signal_connect (gpe->file_entry, "filename_changed",
g_signal_connect (editor->file_entry, "filename_changed",
G_CALLBACK (gimp_path_editor_file_entry_changed),
gpe);
editor);
if (path)
gimp_path_editor_set_path (gpe, path);
gimp_path_editor_set_path (editor, path);
return GTK_WIDGET (gpe);
return GTK_WIDGET (editor);
}
/**
* gimp_path_editor_get_path:
* @gpe: The path editor you want to get the search path from.
* @editor: The path editor you want to get the search path from.
*
* The elements of the returned search path string are separated with the
* #G_SEARCHPATH_SEPARATOR character.
......@@ -262,40 +268,40 @@ gimp_path_editor_new (const gchar *filesel_title,
* Returns: The search path the user has selected in the path editor.
**/
gchar *
gimp_path_editor_get_path (GimpPathEditor *gpe)
gimp_path_editor_get_path (GimpPathEditor *editor)
{
GString *path;
g_return_val_if_fail (GIMP_IS_PATH_EDITOR (gpe), g_strdup (""));
g_return_val_if_fail (GIMP_IS_PATH_EDITOR (editor), g_strdup (""));
path = g_string_new ("");
gtk_tree_model_foreach (GTK_TREE_MODEL (gpe->dir_list), build_path, path);
gtk_tree_model_foreach (GTK_TREE_MODEL (editor->dir_list), build_path, path);
return g_string_free (path, FALSE);
}
/**
* gimp_path_editor_set_path:
* @gpe: The path editor you want to set the search path from.
* @path: The new path to set.
* @editor: The path editor you want to set the search path from.
* @path: The new path to set.
*
* The elements of the initial search path must be separated with the
* #G_SEARCHPATH_SEPARATOR character.
**/
void
gimp_path_editor_set_path (GimpPathEditor *gpe,
gimp_path_editor_set_path (GimpPathEditor *editor,
const gchar *path)
{
gchar *directory;
gchar *mypath;
GtkTreeIter iter;
g_return_if_fail (GIMP_IS_PATH_EDITOR (gpe));
g_return_if_fail (GIMP_IS_PATH_EDITOR (editor));
directory = mypath = g_strdup (path);
gtk_list_store_clear (gpe->dir_list);
gtk_list_store_clear (editor->dir_list);
/* split up the path */
while (strlen (directory))
......@@ -306,10 +312,10 @@ gimp_path_editor_set_path (GimpPathEditor *gpe,
if (next_separator != NULL)
*next_separator = '\0';
gtk_list_store_append (gpe->dir_list, &iter);
gtk_list_store_set (gpe->dir_list, &iter, 0, directory, -1);
gtk_list_store_append (editor->dir_list, &iter);
gtk_list_store_set (editor->dir_list, &iter, 0, directory, -1);
gpe->num_items++;
editor->num_items++;
if (next_separator != NULL)
directory = next_separator + 1;
......@@ -318,6 +324,8 @@ gimp_path_editor_set_path (GimpPathEditor *gpe,
}
g_free (mypath);
g_signal_emit (editor, gimp_path_editor_signals[PATH_CHANGED], 0);
}
......@@ -325,124 +333,124 @@ gimp_path_editor_set_path (GimpPathEditor *gpe,
static void
gimp_path_editor_new_clicked (GtkWidget *widget,
GimpPathEditor *gpe)
GimpPathEditor *editor)
{
if (gpe->sel_path)
if (editor->sel_path)
{
g_signal_handlers_block_by_func (gpe->sel,
g_signal_handlers_block_by_func (editor->sel,
gimp_path_editor_selection_changed,
gpe);
editor);
gtk_tree_selection_unselect_path (gpe->sel, gpe->sel_path);
gtk_tree_selection_unselect_path (editor->sel, editor->sel_path);
g_signal_handlers_unblock_by_func (gpe->sel,
g_signal_handlers_unblock_by_func (editor->sel,
gimp_path_editor_selection_changed,
gpe);
editor);
gtk_tree_path_free (gpe->sel_path);
gpe->sel_path = NULL;
gtk_tree_path_free (editor->sel_path);
editor->sel_path = NULL;
}
gtk_widget_set_sensitive (gpe->delete_button, FALSE);
gtk_widget_set_sensitive (gpe->up_button, FALSE);
gtk_widget_set_sensitive (gpe->down_button, FALSE);
gtk_widget_set_sensitive (gpe->file_entry, TRUE);
gtk_widget_set_sensitive (editor->delete_button, FALSE);
gtk_widget_set_sensitive (editor->up_button, FALSE);
gtk_widget_set_sensitive (editor->down_button, FALSE);
gtk_widget_set_sensitive (editor->file_entry, TRUE);
gtk_editable_set_position
(GTK_EDITABLE (GIMP_FILE_ENTRY (gpe->file_entry)->entry), -1);
(GTK_EDITABLE (GIMP_FILE_ENTRY (editor->file_entry)->entry), -1);
gtk_widget_grab_focus
(GTK_WIDGET (GIMP_FILE_ENTRY (gpe->file_entry)->entry));
(GTK_WIDGET (GIMP_FILE_ENTRY (editor->file_entry)->entry));
}
static void
gimp_path_editor_move_clicked (GtkWidget *widget,
GimpPathEditor *gpe)
GimpPathEditor *editor)
{
GtkTreePath *path;
GtkTreeModel *model;
GtkTreeIter iter1, iter2;
gchar *dir1, *dir2;
if (gpe->sel_path == NULL)
if (editor->sel_path == NULL)
return;
path = gtk_tree_path_copy (gpe->sel_path);
path = gtk_tree_path_copy (editor->sel_path);
if (widget == gpe->up_button)
if (widget == editor->up_button)
gtk_tree_path_prev (path);
else
gtk_tree_path_next (path);
model = GTK_TREE_MODEL (gpe->dir_list);
model = GTK_TREE_MODEL (editor->dir_list);
gtk_tree_model_get_iter (model, &iter1, gpe->sel_path);
gtk_tree_model_get_iter (model, &iter1, editor->sel_path);
gtk_tree_model_get_iter (model, &iter2, path);
gtk_tree_model_get (model, &iter1, 0, &dir1, -1);
gtk_tree_model_get (model, &iter2, 0, &dir2, -1);
gtk_list_store_set (gpe->dir_list, &iter1, 0, dir2, -1);
gtk_list_store_set (gpe->dir_list, &iter2, 0, dir1, -1);
gtk_list_store_set (editor->dir_list, &iter1, 0, dir2, -1);
gtk_list_store_set (editor->dir_list, &iter2, 0, dir1, -1);
g_free (dir2);
g_free (dir1);
gtk_tree_selection_select_iter (gpe->sel, &iter2);
gtk_tree_selection_select_iter (editor->sel, &iter2);
g_signal_emit (gpe, gimp_path_editor_signals[PATH_CHANGED], 0);
g_signal_emit (editor, gimp_path_editor_signals[PATH_CHANGED], 0);
}
static void
gimp_path_editor_delete_clicked (GtkWidget *widget,
GimpPathEditor *gpe)
GimpPathEditor *editor)
{
GtkTreeIter iter;
gint *indices;
if (gpe->sel_path == NULL)
if (editor->sel_path == NULL)
return;
gtk_tree_model_get_iter (GTK_TREE_MODEL (gpe->dir_list), &iter,
gpe->sel_path);
gtk_list_store_remove (gpe->dir_list, &iter);
gtk_tree_model_get_iter (GTK_TREE_MODEL (editor->dir_list), &iter,
editor->sel_path);
gtk_list_store_remove (editor->dir_list, &iter);
gpe->num_items--;
editor->num_items--;
if (gpe->num_items == 0)
if (editor->num_items == 0)
{
gtk_tree_path_free (gpe->sel_path);
gpe->sel_path = NULL;
gtk_tree_path_free (editor->sel_path);
editor->sel_path = NULL;
g_signal_handlers_block_by_func (gpe->file_entry,
g_signal_handlers_block_by_func (editor->file_entry,
gimp_path_editor_file_entry_changed,
gpe);
editor);
gimp_file_entry_set_filename (GIMP_FILE_ENTRY (gpe->file_entry), "");
gimp_file_entry_set_filename (GIMP_FILE_ENTRY (editor->file_entry), "");
g_signal_handlers_unblock_by_func (gpe->file_entry,
g_signal_handlers_unblock_by_func (editor->file_entry,
gimp_path_editor_file_entry_changed,
gpe);
editor);
gtk_widget_set_sensitive (gpe->delete_button, FALSE);
gtk_widget_set_sensitive (gpe->up_button, FALSE);
gtk_widget_set_sensitive (gpe->down_button, FALSE);
gtk_widget_set_sensitive (gpe->file_entry, FALSE);
gtk_widget_set_sensitive (editor->delete_button, FALSE);
gtk_widget_set_sensitive (editor->up_button, FALSE);
gtk_widget_set_sensitive (editor->down_button, FALSE);
gtk_widget_set_sensitive (editor->file_entry, FALSE);
return;
}
indices = gtk_tree_path_get_indices (gpe->sel_path);
if ((indices[0] == gpe->num_items) && (indices[0] > 0))
gtk_tree_path_prev (gpe->sel_path);
indices = gtk_tree_path_get_indices (editor->sel_path);
if ((indices[0] == editor->num_items) && (indices[0] > 0))
gtk_tree_path_prev (editor->sel_path);
gtk_tree_selection_select_path (gpe->sel, gpe->sel_path);
gtk_tree_selection_select_path (editor->sel, editor->sel_path);
g_signal_emit (gpe, gimp_path_editor_signals[PATH_CHANGED], 0);
g_signal_emit (editor, gimp_path_editor_signals[PATH_CHANGED], 0);
}
static void
gimp_path_editor_file_entry_changed (GtkWidget *widget,
GimpPathEditor *gpe)
GimpPathEditor *editor)
{
gchar *directory;
GtkTreeIter iter;
......@@ -454,29 +462,29 @@ gimp_path_editor_file_entry_changed (GtkWidget *widget,
return;
}
if (gpe->sel_path == NULL)
if (editor->sel_path == NULL)
{
gtk_list_store_append (gpe->dir_list, &iter);
gtk_list_store_set (gpe->dir_list, &iter, 0, directory, -1);
gpe->num_items++;
gtk_list_store_append (editor->dir_list, &iter);
gtk_list_store_set (editor->dir_list, &iter, 0, directory, -1);
editor->num_items++;
gtk_tree_selection_select_iter (gpe->sel, &iter);
gtk_tree_selection_select_iter (editor->sel, &iter);
}
else
{
gtk_tree_model_get_iter (GTK_TREE_MODEL (gpe->dir_list), &iter,
gpe->sel_path);
gtk_list_store_set (gpe->dir_list, &iter, 0, directory, -1);
gtk_tree_model_get_iter (GTK_TREE_MODEL (editor->dir_list), &iter,
editor->sel_path);
gtk_list_store_set (editor->dir_list, &iter, 0, directory, -1);
}
g_free (directory);
g_signal_emit (gpe, gimp_path_editor_signals[PATH_CHANGED], 0);
g_signal_emit (editor, gimp_path_editor_signals[PATH_CHANGED], 0);
}
static void
gimp_path_editor_selection_changed (GtkTreeSelection *sel,
GimpPathEditor *gpe)
GimpPathEditor *editor)
{
GtkTreeIter iter;
gchar *directory;
......@@ -484,48 +492,48 @@ gimp_path_editor_selection_changed (GtkTreeSelection *sel,
if (gtk_tree_selection_get_selected (sel, NULL, &iter))
{
gtk_tree_model_get (GTK_TREE_MODEL (gpe->dir_list), &iter,
gtk_tree_model_get (GTK_TREE_MODEL (editor->dir_list), &iter,
0, &directory,
-1);
g_signal_handlers_block_by_func (gpe->file_entry,
g_signal_handlers_block_by_func (editor->file_entry,
gimp_path_editor_file_entry_changed,
gpe);
editor);
gimp_file_entry_set_filename (GIMP_FILE_ENTRY (gpe->file_entry),
gimp_file_entry_set_filename (GIMP_FILE_ENTRY (editor->file_entry),
directory);
g_signal_handlers_unblock_by_func (gpe->file_entry,
g_signal_handlers_unblock_by_func (editor->file_entry,
gimp_path_editor_file_entry_changed,
gpe);
editor);
g_free (directory);
if (gpe->sel_path)
gtk_tree_path_free (gpe->sel_path);
if (editor->sel_path)
gtk_tree_path_free (editor->sel_path);
gpe->sel_path = gtk_tree_model_get_path (GTK_TREE_MODEL (gpe->dir_list),
&iter);
editor->sel_path =
gtk_tree_model_get_path (GTK_TREE_MODEL (editor->dir_list), &iter);
indices = gtk_tree_path_get_indices (gpe->sel_path);
indices = gtk_tree_path_get_indices (editor->sel_path);
gtk_widget_set_sensitive (gpe->delete_button, TRUE);
gtk_widget_set_sensitive (gpe->up_button, (indices[0] > 0));
gtk_widget_set_sensitive (gpe->down_button,
(indices[0] < (gpe->num_items - 1)));
gtk_widget_set_sensitive (gpe->file_entry, TRUE);
gtk_widget_set_sensitive (editor->delete_button, TRUE);
gtk_widget_set_sensitive (editor->up_button, (indices[0] > 0));
gtk_widget_set_sensitive (editor->down_button,
(indices[0] < (editor->num_items - 1)));
gtk_widget_set_sensitive (editor->file_entry, TRUE);
}
else
{
g_signal_handlers_block_by_func (sel,
gimp_path_editor_selection_changed,
gpe);
editor);
gtk_tree_selection_select_path (gpe->sel, gpe->sel_path);
gtk_tree_selection_select_path (editor->sel, editor->sel_path);
g_signal_handlers_unblock_by_func (sel,
gimp_path_editor_selection_changed,
gpe);
editor);
}
}
......
......@@ -63,7 +63,7 @@ struct _GimpPathEditorClass
{
GtkVBoxClass parent_class;
void (* path_changed) (GimpPathEditor *gpe);
void (* path_changed) (GimpPathEditor *editor);
};
......@@ -74,8 +74,8 @@ GType gimp_path_editor_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_path_editor_new (const gchar *filesel_title,
const gchar *path);
gchar * gimp_path_editor_get_path (GimpPathEditor *gpe);
void gimp_path_editor_set_path (GimpPathEditor *gpe,
gchar * gimp_path_editor_get_path (GimpPathEditor *editor);
void gimp_path_editor_set_path (GimpPathEditor *editor,
const gchar *path);
......
......@@ -104,6 +104,12 @@ gimp_unit_menu_class_init (GimpUnitMenuClass *klass)
parent_class = g_type_class_peek_parent (klass);
/**
* GimpUnitMenu::unit-changed:
*
* This signal is emitted whenever the user selects a #GimpUnit from
* the #GimpUnitMenu.
**/
gimp_unit_menu_signals[UNIT_CHANGED] =
g_signal_new ("unit_changed",
G_TYPE_FROM_CLASS (klass),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment