mirror of https://github.com/GNOME/gimp.git
gtk_item_factory_parse_rc->gtk_accel_map_load,
2001-11-14 Manish Singh <yosh@gimp.org> * RELEASE-TO-CVS.patch: gtk_item_factory_parse_rc->gtk_accel_map_load, gtk_item_factory_dump_rc->gtk_accel_map_save * configure.in: fixes for newer autoconf, AC_INIT with etc/gimprc.in now * app/core/gimpcontainer.c: g_type_instance_is_a is private (and got renamed recently), use G_TYPE_CHECK_INSTANCE_TYPE instead * app/gui/gradient-editor.c: use gtk_accel_label_set_accel_widget instead of gtk_accel_label_set_accel_object * app/gui/module-browser.c: replaced CList with a TreeView
This commit is contained in:
parent
11df0e6f0c
commit
1c27bdcc4f
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
||||||
|
2001-11-14 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
|
* RELEASE-TO-CVS.patch: gtk_item_factory_parse_rc->gtk_accel_map_load,
|
||||||
|
gtk_item_factory_dump_rc->gtk_accel_map_save
|
||||||
|
|
||||||
|
* configure.in: fixes for newer autoconf, AC_INIT with etc/gimprc.in
|
||||||
|
now
|
||||||
|
|
||||||
|
* app/core/gimpcontainer.c: g_type_instance_is_a is private (and
|
||||||
|
got renamed recently), use G_TYPE_CHECK_INSTANCE_TYPE instead
|
||||||
|
|
||||||
|
* app/gui/gradient-editor.c: use gtk_accel_label_set_accel_widget
|
||||||
|
instead of gtk_accel_label_set_accel_object
|
||||||
|
|
||||||
|
* app/gui/module-browser.c: replaced CList with a TreeView
|
||||||
|
|
||||||
2001-11-14 Michael Natterer <mitch@gimp.org>
|
2001-11-14 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* data/misc/Makefile.am
|
* data/misc/Makefile.am
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
Index: menus.c
|
||||||
|
===================================================================
|
||||||
|
RCS file: /cvs/gnome/gimp/app/gui/menus.c,v
|
||||||
|
retrieving revision 1.242
|
||||||
|
diff -u -r1.242 menus.c
|
||||||
|
--- menus.c 2001/11/13 16:56:58 1.242
|
||||||
|
+++ menus.c 2001/11/14 22:33:49
|
||||||
|
@@ -1813,7 +1813,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
filename = gimp_personal_rc_file ("menurc");
|
||||||
|
- gtk_item_factory_parse_rc (filename);
|
||||||
|
+ gtk_accel_map_load (filename);
|
||||||
|
g_free (filename);
|
||||||
|
|
||||||
|
g_signal_connect (G_OBJECT (gimp->documents), "add",
|
||||||
|
@@ -1841,7 +1841,7 @@
|
||||||
|
gimp);
|
||||||
|
|
||||||
|
filename = gimp_personal_rc_file ("menurc");
|
||||||
|
- gtk_item_factory_dump_rc (filename, NULL, TRUE);
|
||||||
|
+ gtk_accel_map_save (filename);
|
||||||
|
g_free (filename);
|
||||||
|
|
||||||
|
if (toolbox_factory)
|
|
@ -359,8 +359,9 @@ gimp_container_add (GimpContainer *container,
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
||||||
g_return_val_if_fail (object != NULL, FALSE);
|
g_return_val_if_fail (object != NULL, FALSE);
|
||||||
g_return_val_if_fail (g_type_instance_is_a ((GTypeInstance *) object,
|
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object,
|
||||||
container->children_type), FALSE);
|
container->children_type),
|
||||||
|
FALSE);
|
||||||
|
|
||||||
if (gimp_container_have (container, object))
|
if (gimp_container_have (container, object))
|
||||||
{
|
{
|
||||||
|
@ -412,8 +413,9 @@ gimp_container_remove (GimpContainer *container,
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
||||||
g_return_val_if_fail (object != NULL, FALSE);
|
g_return_val_if_fail (object != NULL, FALSE);
|
||||||
g_return_val_if_fail (g_type_instance_is_a ((GTypeInstance *) object,
|
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object,
|
||||||
container->children_type), FALSE);
|
container->children_type),
|
||||||
|
FALSE);
|
||||||
|
|
||||||
if (! gimp_container_have (container, object))
|
if (! gimp_container_have (container, object))
|
||||||
{
|
{
|
||||||
|
@ -466,8 +468,9 @@ gimp_container_insert (GimpContainer *container,
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
||||||
g_return_val_if_fail (object != NULL, FALSE);
|
g_return_val_if_fail (object != NULL, FALSE);
|
||||||
g_return_val_if_fail (g_type_instance_is_a ((GTypeInstance *) object,
|
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object,
|
||||||
container->children_type), FALSE);
|
container->children_type),
|
||||||
|
FALSE);
|
||||||
|
|
||||||
g_return_val_if_fail (index >= -1 &&
|
g_return_val_if_fail (index >= -1 &&
|
||||||
index <= container->num_children, FALSE);
|
index <= container->num_children, FALSE);
|
||||||
|
@ -494,8 +497,9 @@ gimp_container_reorder (GimpContainer *container,
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
||||||
g_return_val_if_fail (object != NULL, FALSE);
|
g_return_val_if_fail (object != NULL, FALSE);
|
||||||
g_return_val_if_fail (g_type_instance_is_a ((GTypeInstance *) object,
|
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object,
|
||||||
container->children_type), FALSE);
|
container->children_type),
|
||||||
|
FALSE);
|
||||||
|
|
||||||
g_return_val_if_fail (new_index >= -1 &&
|
g_return_val_if_fail (new_index >= -1 &&
|
||||||
new_index < container->num_children, FALSE);
|
new_index < container->num_children, FALSE);
|
||||||
|
@ -598,8 +602,9 @@ gimp_container_get_child_index (const GimpContainer *container,
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GIMP_IS_CONTAINER (container), -1);
|
g_return_val_if_fail (GIMP_IS_CONTAINER (container), -1);
|
||||||
g_return_val_if_fail (object != NULL, -1);
|
g_return_val_if_fail (object != NULL, -1);
|
||||||
g_return_val_if_fail (g_type_instance_is_a ((GTypeInstance *) object,
|
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object,
|
||||||
container->children_type), -1);
|
container->children_type),
|
||||||
|
-1);
|
||||||
|
|
||||||
return GIMP_CONTAINER_GET_CLASS (container)->get_child_index (container,
|
return GIMP_CONTAINER_GET_CLASS (container)->get_child_index (container,
|
||||||
object);
|
object);
|
||||||
|
|
|
@ -39,6 +39,12 @@
|
||||||
|
|
||||||
#define NUM_INFO_LINES 7
|
#define NUM_INFO_LINES 7
|
||||||
|
|
||||||
|
enum {
|
||||||
|
PATH_COLUMN,
|
||||||
|
INFO_COLUMN,
|
||||||
|
NUM_COLUMNS
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
GtkWidget *table;
|
GtkWidget *table;
|
||||||
|
@ -46,7 +52,7 @@ typedef struct
|
||||||
GtkWidget *button_label;
|
GtkWidget *button_label;
|
||||||
GimpModuleInfoObj *last_update;
|
GimpModuleInfoObj *last_update;
|
||||||
GtkWidget *button;
|
GtkWidget *button;
|
||||||
GtkWidget *list;
|
GtkListStore *list;
|
||||||
GtkWidget *load_inhibit_check;
|
GtkWidget *load_inhibit_check;
|
||||||
|
|
||||||
GQuark modules_handler_id;
|
GQuark modules_handler_id;
|
||||||
|
@ -62,8 +68,8 @@ static void browser_destroy_callback (GtkWidget *widget,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void browser_load_inhibit_callback (GtkWidget *widget,
|
static void browser_load_inhibit_callback (GtkWidget *widget,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void browser_select_callback (GtkWidget *widget,
|
static void browser_select_callback (GtkTreeSelection *sel,
|
||||||
GtkWidget *child);
|
gpointer data);
|
||||||
static void browser_load_unload_callback (GtkWidget *widget,
|
static void browser_load_unload_callback (GtkWidget *widget,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void browser_refresh_callback (GtkWidget *widget,
|
static void browser_refresh_callback (GtkWidget *widget,
|
||||||
|
@ -87,12 +93,15 @@ static void browser_info_init (BrowserState *st,
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
module_browser_new (Gimp *gimp)
|
module_browser_new (Gimp *gimp)
|
||||||
{
|
{
|
||||||
GtkWidget *shell;
|
GtkWidget *shell;
|
||||||
GtkWidget *hbox;
|
GtkWidget *hbox;
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
GtkWidget *listbox;
|
GtkWidget *listbox;
|
||||||
GtkWidget *button;
|
GtkWidget *button;
|
||||||
BrowserState *st;
|
GtkWidget *tv;
|
||||||
|
BrowserState *st;
|
||||||
|
GtkTreeSelection *sel;
|
||||||
|
GtkTreeIter iter;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||||
|
|
||||||
|
@ -124,14 +133,22 @@ module_browser_new (Gimp *gimp)
|
||||||
|
|
||||||
st->gimp = gimp;
|
st->gimp = gimp;
|
||||||
|
|
||||||
st->list = gtk_list_new ();
|
st->list = gtk_list_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER);
|
||||||
gtk_list_set_selection_mode (GTK_LIST (st->list), GTK_SELECTION_BROWSE);
|
tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (st->list));
|
||||||
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (listbox),
|
g_object_unref (st->list);
|
||||||
st->list);
|
|
||||||
|
|
||||||
gimp_container_foreach (gimp->modules, make_list_item, st);
|
gimp_container_foreach (gimp->modules, make_list_item, st);
|
||||||
|
|
||||||
gtk_widget_show (st->list);
|
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tv),
|
||||||
|
-1, NULL,
|
||||||
|
gtk_cell_renderer_text_new (),
|
||||||
|
"text", PATH_COLUMN,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv), FALSE);
|
||||||
|
|
||||||
|
gtk_container_add (GTK_CONTAINER (listbox), tv);
|
||||||
|
gtk_widget_show (tv);
|
||||||
|
|
||||||
st->table = gtk_table_new (5, NUM_INFO_LINES + 1, FALSE);
|
st->table = gtk_table_new (5, NUM_INFO_LINES + 1, FALSE);
|
||||||
gtk_table_set_col_spacings (GTK_TABLE (st->table), 4);
|
gtk_table_set_col_spacings (GTK_TABLE (st->table), 4);
|
||||||
|
@ -152,7 +169,7 @@ module_browser_new (Gimp *gimp)
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
||||||
|
|
||||||
st->button = gtk_button_new_with_label ("");
|
st->button = gtk_button_new_with_label ("");
|
||||||
st->button_label = GTK_BIN (st->button)->child;
|
st->button_label = gtk_bin_get_child (GTK_BIN (st->button));
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), st->button, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), st->button, TRUE, TRUE, 0);
|
||||||
gtk_widget_show (st->button);
|
gtk_widget_show (st->button);
|
||||||
g_signal_connect (G_OBJECT (st->button), "clicked",
|
g_signal_connect (G_OBJECT (st->button), "clicked",
|
||||||
|
@ -162,10 +179,12 @@ module_browser_new (Gimp *gimp)
|
||||||
browser_info_init (st, st->table);
|
browser_info_init (st, st->table);
|
||||||
browser_info_update (st->last_update, st);
|
browser_info_update (st->last_update, st);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (st->list), "state", st);
|
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv));
|
||||||
|
g_signal_connect (G_OBJECT (sel), "changed",
|
||||||
|
G_CALLBACK (browser_select_callback), st);
|
||||||
|
|
||||||
g_signal_connect (G_OBJECT (st->list), "select_child",
|
if (gtk_tree_model_get_iter_root (GTK_TREE_MODEL (st->list), &iter))
|
||||||
G_CALLBACK (browser_select_callback), NULL);
|
gtk_tree_selection_select_iter (sel, &iter);
|
||||||
|
|
||||||
/* hook the GimpContainer signals so we can refresh the display
|
/* hook the GimpContainer signals so we can refresh the display
|
||||||
* appropriately.
|
* appropriately.
|
||||||
|
@ -235,14 +254,15 @@ browser_load_inhibit_callback (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
browser_select_callback (GtkWidget *widget,
|
browser_select_callback (GtkTreeSelection *sel,
|
||||||
GtkWidget *child)
|
gpointer data)
|
||||||
{
|
{
|
||||||
|
BrowserState *st = data;
|
||||||
GimpModuleInfoObj *info;
|
GimpModuleInfoObj *info;
|
||||||
BrowserState *st;
|
GtkTreeIter iter;
|
||||||
|
|
||||||
info = g_object_get_data (G_OBJECT (child), "module_info");
|
gtk_tree_selection_get_selected (sel, NULL, &iter);
|
||||||
st = g_object_get_data (G_OBJECT (widget), "state");
|
gtk_tree_model_get (GTK_TREE_MODEL (st->list), &iter, INFO_COLUMN, &info, -1);
|
||||||
|
|
||||||
if (st->last_update == info)
|
if (st->last_update == info)
|
||||||
return;
|
return;
|
||||||
|
@ -281,17 +301,16 @@ make_list_item (gpointer data,
|
||||||
{
|
{
|
||||||
GimpModuleInfoObj *info = data;
|
GimpModuleInfoObj *info = data;
|
||||||
BrowserState *st = user_data;
|
BrowserState *st = user_data;
|
||||||
GtkWidget *list_item;
|
GtkTreeIter iter;
|
||||||
|
|
||||||
if (!st->last_update)
|
if (!st->last_update)
|
||||||
st->last_update = info;
|
st->last_update = info;
|
||||||
|
|
||||||
list_item = gtk_list_item_new_with_label (info->fullpath);
|
gtk_list_store_append (st->list, &iter);
|
||||||
|
gtk_list_store_set (st->list, &iter,
|
||||||
gtk_widget_show (list_item);
|
PATH_COLUMN, info->fullpath,
|
||||||
g_object_set_data (G_OBJECT (list_item), "module_info", info);
|
INFO_COLUMN, info,
|
||||||
|
-1);
|
||||||
gtk_container_add (GTK_CONTAINER (st->list), list_item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -307,33 +326,29 @@ browser_info_remove (GimpContainer *container,
|
||||||
GimpModuleInfoObj *mod,
|
GimpModuleInfoObj *mod,
|
||||||
BrowserState *st)
|
BrowserState *st)
|
||||||
{
|
{
|
||||||
GList *dlist;
|
GtkTreeIter iter;
|
||||||
GList *free_list;
|
|
||||||
GtkWidget *list_item;
|
|
||||||
GimpModuleInfoObj *info;
|
GimpModuleInfoObj *info;
|
||||||
|
|
||||||
dlist = gtk_container_get_children (GTK_CONTAINER (st->list));
|
/* FIXME: Use gtk_list_store_foreach_remove when it becomes available */
|
||||||
free_list = dlist;
|
|
||||||
|
|
||||||
while (dlist)
|
if (! gtk_tree_model_get_iter_root (GTK_TREE_MODEL (st->list), &iter))
|
||||||
|
return;
|
||||||
|
|
||||||
|
do
|
||||||
{
|
{
|
||||||
list_item = dlist->data;
|
gtk_tree_model_get (GTK_TREE_MODEL (st->list), &iter,
|
||||||
|
INFO_COLUMN, &info,
|
||||||
info = g_object_get_data (G_OBJECT (list_item), "module_info");
|
-1);
|
||||||
g_return_if_fail (info != NULL);
|
|
||||||
|
|
||||||
if (info == mod)
|
if (info == mod)
|
||||||
{
|
{
|
||||||
gtk_container_remove (GTK_CONTAINER (st->list), list_item);
|
gtk_list_store_remove (st->list, &iter);
|
||||||
g_list_free (free_list);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dlist = dlist->next;
|
|
||||||
}
|
}
|
||||||
|
while (gtk_tree_model_iter_next (GTK_TREE_MODEL (st->list), &iter));
|
||||||
|
|
||||||
g_warning ("tried to remove module that wasn't in brower's list");
|
g_warning ("tried to remove module that wasn't in brower's list");
|
||||||
g_list_free (free_list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -374,7 +389,7 @@ browser_info_update (GimpModuleInfoObj *mod,
|
||||||
text[2] = mod->info->version;
|
text[2] = mod->info->version;
|
||||||
text[3] = mod->info->copyright;
|
text[3] = mod->info->copyright;
|
||||||
text[4] = mod->info->date;
|
text[4] = mod->info->date;
|
||||||
text[5] = mod->on_disk? _("on disk") : _("only in memory");
|
text[5] = mod->on_disk ? _("on disk") : _("only in memory");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -383,7 +398,7 @@ browser_info_update (GimpModuleInfoObj *mod,
|
||||||
text[2] = "--";
|
text[2] = "--";
|
||||||
text[3] = "--";
|
text[3] = "--";
|
||||||
text[4] = "--";
|
text[4] = "--";
|
||||||
text[5] = mod->on_disk? _("on disk") : _("nowhere (click 'refresh')");
|
text[5] = mod->on_disk ? _("on disk") : _("nowhere (click 'refresh')");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mod->state == GIMP_MODULE_STATE_ERROR && mod->last_module_error)
|
if (mod->state == GIMP_MODULE_STATE_ERROR && mod->last_module_error)
|
||||||
|
@ -427,7 +442,7 @@ browser_info_update (GimpModuleInfoObj *mod,
|
||||||
case GIMP_MODULE_STATE_LOADED_OK:
|
case GIMP_MODULE_STATE_LOADED_OK:
|
||||||
gtk_label_set_text (GTK_LABEL(st->button_label), _("Unload"));
|
gtk_label_set_text (GTK_LABEL(st->button_label), _("Unload"));
|
||||||
gtk_widget_set_sensitive (GTK_WIDGET (st->button),
|
gtk_widget_set_sensitive (GTK_WIDGET (st->button),
|
||||||
mod->unload? TRUE : FALSE);
|
mod->unload ? TRUE : FALSE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2643,8 +2643,8 @@ cpopup_create_menu_item_with_label (gchar *str,
|
||||||
accel_label = gtk_accel_label_new (str);
|
accel_label = gtk_accel_label_new (str);
|
||||||
gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
|
||||||
gtk_container_add (GTK_CONTAINER (menuitem), accel_label);
|
gtk_container_add (GTK_CONTAINER (menuitem), accel_label);
|
||||||
gtk_accel_label_set_accel_object (GTK_ACCEL_LABEL (accel_label),
|
gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label),
|
||||||
G_OBJECT (menuitem));
|
GTK_WIDGET (menuitem));
|
||||||
gtk_widget_show (accel_label);
|
gtk_widget_show (accel_label);
|
||||||
|
|
||||||
if (label)
|
if (label)
|
||||||
|
|
|
@ -39,6 +39,12 @@
|
||||||
|
|
||||||
#define NUM_INFO_LINES 7
|
#define NUM_INFO_LINES 7
|
||||||
|
|
||||||
|
enum {
|
||||||
|
PATH_COLUMN,
|
||||||
|
INFO_COLUMN,
|
||||||
|
NUM_COLUMNS
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
GtkWidget *table;
|
GtkWidget *table;
|
||||||
|
@ -46,7 +52,7 @@ typedef struct
|
||||||
GtkWidget *button_label;
|
GtkWidget *button_label;
|
||||||
GimpModuleInfoObj *last_update;
|
GimpModuleInfoObj *last_update;
|
||||||
GtkWidget *button;
|
GtkWidget *button;
|
||||||
GtkWidget *list;
|
GtkListStore *list;
|
||||||
GtkWidget *load_inhibit_check;
|
GtkWidget *load_inhibit_check;
|
||||||
|
|
||||||
GQuark modules_handler_id;
|
GQuark modules_handler_id;
|
||||||
|
@ -62,8 +68,8 @@ static void browser_destroy_callback (GtkWidget *widget,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void browser_load_inhibit_callback (GtkWidget *widget,
|
static void browser_load_inhibit_callback (GtkWidget *widget,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void browser_select_callback (GtkWidget *widget,
|
static void browser_select_callback (GtkTreeSelection *sel,
|
||||||
GtkWidget *child);
|
gpointer data);
|
||||||
static void browser_load_unload_callback (GtkWidget *widget,
|
static void browser_load_unload_callback (GtkWidget *widget,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void browser_refresh_callback (GtkWidget *widget,
|
static void browser_refresh_callback (GtkWidget *widget,
|
||||||
|
@ -87,12 +93,15 @@ static void browser_info_init (BrowserState *st,
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
module_browser_new (Gimp *gimp)
|
module_browser_new (Gimp *gimp)
|
||||||
{
|
{
|
||||||
GtkWidget *shell;
|
GtkWidget *shell;
|
||||||
GtkWidget *hbox;
|
GtkWidget *hbox;
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
GtkWidget *listbox;
|
GtkWidget *listbox;
|
||||||
GtkWidget *button;
|
GtkWidget *button;
|
||||||
BrowserState *st;
|
GtkWidget *tv;
|
||||||
|
BrowserState *st;
|
||||||
|
GtkTreeSelection *sel;
|
||||||
|
GtkTreeIter iter;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||||
|
|
||||||
|
@ -124,14 +133,22 @@ module_browser_new (Gimp *gimp)
|
||||||
|
|
||||||
st->gimp = gimp;
|
st->gimp = gimp;
|
||||||
|
|
||||||
st->list = gtk_list_new ();
|
st->list = gtk_list_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER);
|
||||||
gtk_list_set_selection_mode (GTK_LIST (st->list), GTK_SELECTION_BROWSE);
|
tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (st->list));
|
||||||
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (listbox),
|
g_object_unref (st->list);
|
||||||
st->list);
|
|
||||||
|
|
||||||
gimp_container_foreach (gimp->modules, make_list_item, st);
|
gimp_container_foreach (gimp->modules, make_list_item, st);
|
||||||
|
|
||||||
gtk_widget_show (st->list);
|
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tv),
|
||||||
|
-1, NULL,
|
||||||
|
gtk_cell_renderer_text_new (),
|
||||||
|
"text", PATH_COLUMN,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv), FALSE);
|
||||||
|
|
||||||
|
gtk_container_add (GTK_CONTAINER (listbox), tv);
|
||||||
|
gtk_widget_show (tv);
|
||||||
|
|
||||||
st->table = gtk_table_new (5, NUM_INFO_LINES + 1, FALSE);
|
st->table = gtk_table_new (5, NUM_INFO_LINES + 1, FALSE);
|
||||||
gtk_table_set_col_spacings (GTK_TABLE (st->table), 4);
|
gtk_table_set_col_spacings (GTK_TABLE (st->table), 4);
|
||||||
|
@ -152,7 +169,7 @@ module_browser_new (Gimp *gimp)
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
||||||
|
|
||||||
st->button = gtk_button_new_with_label ("");
|
st->button = gtk_button_new_with_label ("");
|
||||||
st->button_label = GTK_BIN (st->button)->child;
|
st->button_label = gtk_bin_get_child (GTK_BIN (st->button));
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), st->button, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), st->button, TRUE, TRUE, 0);
|
||||||
gtk_widget_show (st->button);
|
gtk_widget_show (st->button);
|
||||||
g_signal_connect (G_OBJECT (st->button), "clicked",
|
g_signal_connect (G_OBJECT (st->button), "clicked",
|
||||||
|
@ -162,10 +179,12 @@ module_browser_new (Gimp *gimp)
|
||||||
browser_info_init (st, st->table);
|
browser_info_init (st, st->table);
|
||||||
browser_info_update (st->last_update, st);
|
browser_info_update (st->last_update, st);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (st->list), "state", st);
|
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv));
|
||||||
|
g_signal_connect (G_OBJECT (sel), "changed",
|
||||||
|
G_CALLBACK (browser_select_callback), st);
|
||||||
|
|
||||||
g_signal_connect (G_OBJECT (st->list), "select_child",
|
if (gtk_tree_model_get_iter_root (GTK_TREE_MODEL (st->list), &iter))
|
||||||
G_CALLBACK (browser_select_callback), NULL);
|
gtk_tree_selection_select_iter (sel, &iter);
|
||||||
|
|
||||||
/* hook the GimpContainer signals so we can refresh the display
|
/* hook the GimpContainer signals so we can refresh the display
|
||||||
* appropriately.
|
* appropriately.
|
||||||
|
@ -235,14 +254,15 @@ browser_load_inhibit_callback (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
browser_select_callback (GtkWidget *widget,
|
browser_select_callback (GtkTreeSelection *sel,
|
||||||
GtkWidget *child)
|
gpointer data)
|
||||||
{
|
{
|
||||||
|
BrowserState *st = data;
|
||||||
GimpModuleInfoObj *info;
|
GimpModuleInfoObj *info;
|
||||||
BrowserState *st;
|
GtkTreeIter iter;
|
||||||
|
|
||||||
info = g_object_get_data (G_OBJECT (child), "module_info");
|
gtk_tree_selection_get_selected (sel, NULL, &iter);
|
||||||
st = g_object_get_data (G_OBJECT (widget), "state");
|
gtk_tree_model_get (GTK_TREE_MODEL (st->list), &iter, INFO_COLUMN, &info, -1);
|
||||||
|
|
||||||
if (st->last_update == info)
|
if (st->last_update == info)
|
||||||
return;
|
return;
|
||||||
|
@ -281,17 +301,16 @@ make_list_item (gpointer data,
|
||||||
{
|
{
|
||||||
GimpModuleInfoObj *info = data;
|
GimpModuleInfoObj *info = data;
|
||||||
BrowserState *st = user_data;
|
BrowserState *st = user_data;
|
||||||
GtkWidget *list_item;
|
GtkTreeIter iter;
|
||||||
|
|
||||||
if (!st->last_update)
|
if (!st->last_update)
|
||||||
st->last_update = info;
|
st->last_update = info;
|
||||||
|
|
||||||
list_item = gtk_list_item_new_with_label (info->fullpath);
|
gtk_list_store_append (st->list, &iter);
|
||||||
|
gtk_list_store_set (st->list, &iter,
|
||||||
gtk_widget_show (list_item);
|
PATH_COLUMN, info->fullpath,
|
||||||
g_object_set_data (G_OBJECT (list_item), "module_info", info);
|
INFO_COLUMN, info,
|
||||||
|
-1);
|
||||||
gtk_container_add (GTK_CONTAINER (st->list), list_item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -307,33 +326,29 @@ browser_info_remove (GimpContainer *container,
|
||||||
GimpModuleInfoObj *mod,
|
GimpModuleInfoObj *mod,
|
||||||
BrowserState *st)
|
BrowserState *st)
|
||||||
{
|
{
|
||||||
GList *dlist;
|
GtkTreeIter iter;
|
||||||
GList *free_list;
|
|
||||||
GtkWidget *list_item;
|
|
||||||
GimpModuleInfoObj *info;
|
GimpModuleInfoObj *info;
|
||||||
|
|
||||||
dlist = gtk_container_get_children (GTK_CONTAINER (st->list));
|
/* FIXME: Use gtk_list_store_foreach_remove when it becomes available */
|
||||||
free_list = dlist;
|
|
||||||
|
|
||||||
while (dlist)
|
if (! gtk_tree_model_get_iter_root (GTK_TREE_MODEL (st->list), &iter))
|
||||||
|
return;
|
||||||
|
|
||||||
|
do
|
||||||
{
|
{
|
||||||
list_item = dlist->data;
|
gtk_tree_model_get (GTK_TREE_MODEL (st->list), &iter,
|
||||||
|
INFO_COLUMN, &info,
|
||||||
info = g_object_get_data (G_OBJECT (list_item), "module_info");
|
-1);
|
||||||
g_return_if_fail (info != NULL);
|
|
||||||
|
|
||||||
if (info == mod)
|
if (info == mod)
|
||||||
{
|
{
|
||||||
gtk_container_remove (GTK_CONTAINER (st->list), list_item);
|
gtk_list_store_remove (st->list, &iter);
|
||||||
g_list_free (free_list);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dlist = dlist->next;
|
|
||||||
}
|
}
|
||||||
|
while (gtk_tree_model_iter_next (GTK_TREE_MODEL (st->list), &iter));
|
||||||
|
|
||||||
g_warning ("tried to remove module that wasn't in brower's list");
|
g_warning ("tried to remove module that wasn't in brower's list");
|
||||||
g_list_free (free_list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -374,7 +389,7 @@ browser_info_update (GimpModuleInfoObj *mod,
|
||||||
text[2] = mod->info->version;
|
text[2] = mod->info->version;
|
||||||
text[3] = mod->info->copyright;
|
text[3] = mod->info->copyright;
|
||||||
text[4] = mod->info->date;
|
text[4] = mod->info->date;
|
||||||
text[5] = mod->on_disk? _("on disk") : _("only in memory");
|
text[5] = mod->on_disk ? _("on disk") : _("only in memory");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -383,7 +398,7 @@ browser_info_update (GimpModuleInfoObj *mod,
|
||||||
text[2] = "--";
|
text[2] = "--";
|
||||||
text[3] = "--";
|
text[3] = "--";
|
||||||
text[4] = "--";
|
text[4] = "--";
|
||||||
text[5] = mod->on_disk? _("on disk") : _("nowhere (click 'refresh')");
|
text[5] = mod->on_disk ? _("on disk") : _("nowhere (click 'refresh')");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mod->state == GIMP_MODULE_STATE_ERROR && mod->last_module_error)
|
if (mod->state == GIMP_MODULE_STATE_ERROR && mod->last_module_error)
|
||||||
|
@ -427,7 +442,7 @@ browser_info_update (GimpModuleInfoObj *mod,
|
||||||
case GIMP_MODULE_STATE_LOADED_OK:
|
case GIMP_MODULE_STATE_LOADED_OK:
|
||||||
gtk_label_set_text (GTK_LABEL(st->button_label), _("Unload"));
|
gtk_label_set_text (GTK_LABEL(st->button_label), _("Unload"));
|
||||||
gtk_widget_set_sensitive (GTK_WIDGET (st->button),
|
gtk_widget_set_sensitive (GTK_WIDGET (st->button),
|
||||||
mod->unload? TRUE : FALSE);
|
mod->unload ? TRUE : FALSE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2643,8 +2643,8 @@ cpopup_create_menu_item_with_label (gchar *str,
|
||||||
accel_label = gtk_accel_label_new (str);
|
accel_label = gtk_accel_label_new (str);
|
||||||
gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
|
||||||
gtk_container_add (GTK_CONTAINER (menuitem), accel_label);
|
gtk_container_add (GTK_CONTAINER (menuitem), accel_label);
|
||||||
gtk_accel_label_set_accel_object (GTK_ACCEL_LABEL (accel_label),
|
gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label),
|
||||||
G_OBJECT (menuitem));
|
GTK_WIDGET (menuitem));
|
||||||
gtk_widget_show (accel_label);
|
gtk_widget_show (accel_label);
|
||||||
|
|
||||||
if (label)
|
if (label)
|
||||||
|
|
12
configure.in
12
configure.in
|
@ -1,5 +1,5 @@
|
||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
AC_INIT(gimprc.in)
|
AC_INIT(etc/gimprc.in)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Making releases:
|
# Making releases:
|
||||||
|
@ -824,6 +824,11 @@ AC_SUBST(GIMP_MODULES)
|
||||||
|
|
||||||
dnl Output the Makefiles
|
dnl Output the Makefiles
|
||||||
|
|
||||||
|
dnl plug-ins/perl/config.pl
|
||||||
|
dnl plug-ins/gap/Makefile
|
||||||
|
dnl plug-ins/gdyntext/Makefile
|
||||||
|
dnl plug-ins/helpbrowser/Makefile
|
||||||
|
dnl plug-ins/perl/po/Makefile.in
|
||||||
AC_OUTPUT([
|
AC_OUTPUT([
|
||||||
gimptool-1.4
|
gimptool-1.4
|
||||||
gimp.spec
|
gimp.spec
|
||||||
|
@ -861,7 +866,6 @@ app/widgets/Makefile
|
||||||
app/xcf/Makefile
|
app/xcf/Makefile
|
||||||
plug-ins/Makefile
|
plug-ins/Makefile
|
||||||
plug-ins/makefile.mingw
|
plug-ins/makefile.mingw
|
||||||
dnl plug-ins/perl/config.pl
|
|
||||||
plug-ins/libgck/Makefile
|
plug-ins/libgck/Makefile
|
||||||
plug-ins/libgck/gck/Makefile
|
plug-ins/libgck/gck/Makefile
|
||||||
plug-ins/dbbrowser/Makefile
|
plug-ins/dbbrowser/Makefile
|
||||||
|
@ -879,8 +883,6 @@ plug-ins/faxg3/Makefile
|
||||||
plug-ins/fits/Makefile
|
plug-ins/fits/Makefile
|
||||||
plug-ins/flame/Makefile
|
plug-ins/flame/Makefile
|
||||||
plug-ins/fp/Makefile
|
plug-ins/fp/Makefile
|
||||||
dnl plug-ins/gap/Makefile
|
|
||||||
dnl plug-ins/gdyntext/Makefile
|
|
||||||
plug-ins/gfig/Makefile
|
plug-ins/gfig/Makefile
|
||||||
plug-ins/gfig/gfig-examples/Makefile
|
plug-ins/gfig/gfig-examples/Makefile
|
||||||
plug-ins/gflare/Makefile
|
plug-ins/gflare/Makefile
|
||||||
|
@ -890,7 +892,6 @@ plug-ins/gimpressionist/Makefile
|
||||||
plug-ins/gimpressionist/Brushes/Makefile
|
plug-ins/gimpressionist/Brushes/Makefile
|
||||||
plug-ins/gimpressionist/Paper/Makefile
|
plug-ins/gimpressionist/Paper/Makefile
|
||||||
plug-ins/gimpressionist/Presets/Makefile
|
plug-ins/gimpressionist/Presets/Makefile
|
||||||
dnl plug-ins/helpbrowser/Makefile
|
|
||||||
plug-ins/ifscompose/Makefile
|
plug-ins/ifscompose/Makefile
|
||||||
plug-ins/imagemap/Makefile
|
plug-ins/imagemap/Makefile
|
||||||
plug-ins/maze/Makefile
|
plug-ins/maze/Makefile
|
||||||
|
@ -937,7 +938,6 @@ po/Makefile.in
|
||||||
po-libgimp/Makefile.in
|
po-libgimp/Makefile.in
|
||||||
po-plug-ins/Makefile.in
|
po-plug-ins/Makefile.in
|
||||||
po-script-fu/Makefile.in
|
po-script-fu/Makefile.in
|
||||||
dnl plug-ins/perl/po/Makefile.in
|
|
||||||
],[
|
],[
|
||||||
chmod +x gimptool-1.4
|
chmod +x gimptool-1.4
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue