added a hack that ensures that the toolbox is always first in all
2003-07-08 Sven Neumann <sven@gimp.org> * app/widgets/gimpdialogfactory.c: added a hack that ensures that the toolbox is always first in all dialog_factories_foreach calls. This way the toolbox appears first in sessionrc and first on screen. * etc/sessionrc: updated the sample sessionrc, tweaked it a little.
This commit is contained in:

committed by
Sven Neumann

parent
48f68d1e7b
commit
c1921c104a
@ -1,3 +1,11 @@
|
|||||||
|
2003-07-08 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/widgets/gimpdialogfactory.c: added a hack that ensures that
|
||||||
|
the toolbox is always first in all dialog_factories_foreach calls.
|
||||||
|
This way the toolbox appears first in sessionrc and first on screen.
|
||||||
|
|
||||||
|
* etc/sessionrc: updated the sample sessionrc, tweaked it a little.
|
||||||
|
|
||||||
2003-07-08 Michael Natterer <mitch@gimp.org>
|
2003-07-08 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* themes/Default/images/preferences/Makefile.am
|
* themes/Default/images/preferences/Makefile.am
|
||||||
|
@ -81,13 +81,13 @@ static gboolean gimp_dialog_factory_set_user_pos (GtkWidget *dialog
|
|||||||
static gboolean gimp_dialog_factory_dialog_configure (GtkWidget *dialog,
|
static gboolean gimp_dialog_factory_dialog_configure (GtkWidget *dialog,
|
||||||
GdkEventConfigure *cevent,
|
GdkEventConfigure *cevent,
|
||||||
GimpDialogFactory *factory);
|
GimpDialogFactory *factory);
|
||||||
static void gimp_dialog_factories_save_foreach (gchar *name,
|
static void gimp_dialog_factories_save_foreach (gconstpointer key,
|
||||||
GimpDialogFactory *factory,
|
GimpDialogFactory *factory,
|
||||||
GimpConfigWriter *writer);
|
GimpConfigWriter *writer);
|
||||||
static void gimp_dialog_factories_restore_foreach (gchar *name,
|
static void gimp_dialog_factories_restore_foreach (gconstpointer key,
|
||||||
GimpDialogFactory *factory,
|
GimpDialogFactory *factory,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void gimp_dialog_factories_clear_foreach (gchar *name,
|
static void gimp_dialog_factories_clear_foreach (gconstpointer key,
|
||||||
GimpDialogFactory *factory,
|
GimpDialogFactory *factory,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void gimp_dialog_factory_get_window_info (GtkWidget *window,
|
static void gimp_dialog_factory_get_window_info (GtkWidget *window,
|
||||||
@ -98,16 +98,16 @@ static void gimp_dialog_factory_get_aux_info (GtkWidget *dialog
|
|||||||
GimpSessionInfo *info);
|
GimpSessionInfo *info);
|
||||||
static void gimp_dialog_factory_set_aux_info (GtkWidget *dialog,
|
static void gimp_dialog_factory_set_aux_info (GtkWidget *dialog,
|
||||||
GimpSessionInfo *info);
|
GimpSessionInfo *info);
|
||||||
static void gimp_dialog_factories_hide_foreach (gchar *name,
|
static void gimp_dialog_factories_hide_foreach (gconstpointer key,
|
||||||
GimpDialogFactory *factory,
|
GimpDialogFactory *factory,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void gimp_dialog_factories_show_foreach (gchar *name,
|
static void gimp_dialog_factories_show_foreach (gconstpointer key,
|
||||||
GimpDialogFactory *factory,
|
GimpDialogFactory *factory,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void gimp_dialog_factories_idle_foreach (gchar *name,
|
static void gimp_dialog_factories_idle_foreach (gconstpointer key,
|
||||||
GimpDialogFactory *factory,
|
GimpDialogFactory *factory,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void gimp_dialog_factories_unidle_foreach (gchar *name,
|
static void gimp_dialog_factories_unidle_foreach (gconstpointer key,
|
||||||
GimpDialogFactory *factory,
|
GimpDialogFactory *factory,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
@ -246,18 +246,15 @@ gimp_dialog_factory_new (const gchar *name,
|
|||||||
GimpMenuFactory *menu_factory,
|
GimpMenuFactory *menu_factory,
|
||||||
GimpDialogNewFunc new_dock_func)
|
GimpDialogNewFunc new_dock_func)
|
||||||
{
|
{
|
||||||
GimpDialogFactoryClass *factory_class;
|
GimpDialogFactory *factory;
|
||||||
GimpDialogFactory *factory;
|
gpointer key;
|
||||||
|
|
||||||
g_return_val_if_fail (name != NULL, NULL);
|
g_return_val_if_fail (name != NULL, NULL);
|
||||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||||
g_return_val_if_fail (! menu_factory || GIMP_IS_MENU_FACTORY (menu_factory),
|
g_return_val_if_fail (! menu_factory || GIMP_IS_MENU_FACTORY (menu_factory),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
/* EEK */
|
if (gimp_dialog_factory_from_name (name))
|
||||||
factory_class = g_type_class_ref (GIMP_TYPE_DIALOG_FACTORY);
|
|
||||||
|
|
||||||
if (g_hash_table_lookup (factory_class->factories, name))
|
|
||||||
{
|
{
|
||||||
g_warning ("%s: dialog factory \"%s\" already exists",
|
g_warning ("%s: dialog factory \"%s\" already exists",
|
||||||
G_GNUC_FUNCTION, name);
|
G_GNUC_FUNCTION, name);
|
||||||
@ -268,8 +265,14 @@ gimp_dialog_factory_new (const gchar *name,
|
|||||||
|
|
||||||
gimp_object_set_name (GIMP_OBJECT (factory), name);
|
gimp_object_set_name (GIMP_OBJECT (factory), name);
|
||||||
|
|
||||||
g_hash_table_insert (factory_class->factories,
|
/* hack to keep the toolbox on the pool position */
|
||||||
GIMP_OBJECT (factory)->name, factory);
|
if (strcmp (name, "toolbox") == 0)
|
||||||
|
key = "";
|
||||||
|
else
|
||||||
|
key = GIMP_OBJECT (factory)->name;
|
||||||
|
|
||||||
|
g_hash_table_insert (GIMP_DIALOG_FACTORY_GET_CLASS (factory)->factories,
|
||||||
|
key, factory);
|
||||||
|
|
||||||
factory->context = context;
|
factory->context = context;
|
||||||
factory->menu_factory = menu_factory;
|
factory->menu_factory = menu_factory;
|
||||||
@ -287,9 +290,15 @@ gimp_dialog_factory_from_name (const gchar *name)
|
|||||||
g_return_val_if_fail (name != NULL, NULL);
|
g_return_val_if_fail (name != NULL, NULL);
|
||||||
|
|
||||||
factory_class = g_type_class_peek (GIMP_TYPE_DIALOG_FACTORY);
|
factory_class = g_type_class_peek (GIMP_TYPE_DIALOG_FACTORY);
|
||||||
|
if (! factory_class)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/* hack to keep the toolbox on the pool position */
|
||||||
|
if (strcmp (name, "toolbox") == 0)
|
||||||
|
name = "";
|
||||||
|
|
||||||
factory = (GimpDialogFactory *)
|
factory =
|
||||||
g_hash_table_lookup (factory_class->factories, name);
|
(GimpDialogFactory *) g_hash_table_lookup (factory_class->factories, name);
|
||||||
|
|
||||||
return factory;
|
return factory;
|
||||||
}
|
}
|
||||||
@ -1142,7 +1151,7 @@ gimp_dialog_factory_dialog_configure (GtkWidget *dialog,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_dialog_factories_save_foreach (gchar *name,
|
gimp_dialog_factories_save_foreach (gconstpointer key,
|
||||||
GimpDialogFactory *factory,
|
GimpDialogFactory *factory,
|
||||||
GimpConfigWriter *writer)
|
GimpConfigWriter *writer)
|
||||||
{
|
{
|
||||||
@ -1175,7 +1184,7 @@ gimp_dialog_factories_save_foreach (gchar *name,
|
|||||||
dialog_name = "dock";
|
dialog_name = "dock";
|
||||||
|
|
||||||
gimp_config_writer_open (writer, "session-info");
|
gimp_config_writer_open (writer, "session-info");
|
||||||
gimp_config_writer_string (writer, name);
|
gimp_config_writer_string (writer, GIMP_OBJECT (factory)->name);
|
||||||
gimp_config_writer_string (writer, dialog_name);
|
gimp_config_writer_string (writer, dialog_name);
|
||||||
|
|
||||||
gimp_config_writer_open (writer, "position");
|
gimp_config_writer_open (writer, "position");
|
||||||
@ -1301,7 +1310,7 @@ gimp_dialog_factories_save_foreach (gchar *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_dialog_factories_restore_foreach (gchar *name,
|
gimp_dialog_factories_restore_foreach (gconstpointer key,
|
||||||
GimpDialogFactory *factory,
|
GimpDialogFactory *factory,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
@ -1436,7 +1445,7 @@ gimp_dialog_factories_restore_foreach (gchar *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_dialog_factories_clear_foreach (gchar *name,
|
gimp_dialog_factories_clear_foreach (gconstpointer key,
|
||||||
GimpDialogFactory *factory,
|
GimpDialogFactory *factory,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
@ -1583,7 +1592,7 @@ gimp_dialog_factory_set_aux_info (GtkWidget *dialog,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_dialog_factories_hide_foreach (gchar *name,
|
gimp_dialog_factories_hide_foreach (gconstpointer key,
|
||||||
GimpDialogFactory *factory,
|
GimpDialogFactory *factory,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
@ -1614,7 +1623,7 @@ gimp_dialog_factories_hide_foreach (gchar *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_dialog_factories_show_foreach (gchar *name,
|
gimp_dialog_factories_show_foreach (gconstpointer key,
|
||||||
GimpDialogFactory *factory,
|
GimpDialogFactory *factory,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
@ -1640,7 +1649,7 @@ gimp_dialog_factories_show_foreach (gchar *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_dialog_factories_idle_foreach (gchar *name,
|
gimp_dialog_factories_idle_foreach (gconstpointer key,
|
||||||
GimpDialogFactory *factory,
|
GimpDialogFactory *factory,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
@ -1665,7 +1674,7 @@ gimp_dialog_factories_idle_foreach (gchar *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_dialog_factories_unidle_foreach (gchar *name,
|
gimp_dialog_factories_unidle_foreach (gconstpointer key,
|
||||||
GimpDialogFactory *factory,
|
GimpDialogFactory *factory,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
|
@ -3,25 +3,26 @@
|
|||||||
# This is a sample sessionrc that will be used on first startup after
|
# This is a sample sessionrc that will be used on first startup after
|
||||||
# user installation.
|
# user installation.
|
||||||
|
|
||||||
|
(session-info "toolbox" "dock"
|
||||||
|
(position 48 48)
|
||||||
|
(size 192 660)
|
||||||
|
(open-on-exit)
|
||||||
|
(dock
|
||||||
|
(book
|
||||||
|
"gimp-tool-options@icon"
|
||||||
|
"gimp-brush-grid@icon"
|
||||||
|
"gimp-gradient-list@icon"
|
||||||
|
"gimp-pattern-grid@icon")))
|
||||||
(session-info "dock" "dock"
|
(session-info "dock" "dock"
|
||||||
(position 280 28)
|
(position 328 48)
|
||||||
(size 250 440)
|
(size 250 440)
|
||||||
(open-on-exit)
|
(open-on-exit)
|
||||||
(aux-info "menu-shown" "follow-active-image")
|
(aux-info "menu-shown" "follow-active-image")
|
||||||
(dock
|
(dock
|
||||||
(book
|
(book
|
||||||
"gimp-layer-list@32"
|
"gimp-layer-list@name"
|
||||||
"gimp-channel-list@32"
|
"gimp-channel-list@name"
|
||||||
"gimp-vectors-list@32")))
|
"gimp-vectors-list@name"
|
||||||
(session-info "toolbox" "dock"
|
"gimp-undo-history@name")))
|
||||||
(position 0 28)
|
|
||||||
(size 192 660)
|
|
||||||
(open-on-exit)
|
|
||||||
(dock
|
|
||||||
(book
|
|
||||||
"gimp-tool-options"
|
|
||||||
"gimp-brush-grid"
|
|
||||||
"gimp-gradient-list"
|
|
||||||
"gimp-pattern-grid")))
|
|
||||||
|
|
||||||
# end of sessionrc
|
# end of sessionrc
|
||||||
|
Reference in New Issue
Block a user