added a "menu_factory" parameter instead of trying to get it from the

2004-11-22  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimptextoptions.[ch] (gimp_text_options_editor_new):
	added a "menu_factory" parameter instead of trying to get it from
	the toplevel GimpDock (which does not exists if the tool options
	dialog does not exist). Fixes bug #159071.

	* app/tools/gimptexttool.c (gimp_text_tool_editor): pass the
	menu_factory.

	* app/dialogs/dialogs.c (dialogs_init): pass the global menu
	factory also when constructing the "toplevel" dialog factory so
	the above works.
This commit is contained in:
Michael Natterer 2004-11-22 16:03:54 +00:00 committed by Michael Natterer
parent 20ac70e76f
commit 512b1120c4
5 changed files with 26 additions and 13 deletions

View File

@ -1,3 +1,17 @@
2004-11-22 Michael Natterer <mitch@gimp.org>
* app/tools/gimptextoptions.[ch] (gimp_text_options_editor_new):
added a "menu_factory" parameter instead of trying to get it from
the toplevel GimpDock (which does not exists if the tool options
dialog does not exist). Fixes bug #159071.
* app/tools/gimptexttool.c (gimp_text_tool_editor): pass the
menu_factory.
* app/dialogs/dialogs.c (dialogs_init): pass the global menu
factory also when constructing the "toplevel" dialog factory so
the above works.
2004-11-22 Michael Natterer <mitch@gimp.org>
* libgimpbase/gimputils.c (gimp_any_to_utf8): use g_strndup()

View File

@ -225,7 +225,7 @@ dialogs_init (Gimp *gimp,
global_dialog_factory = gimp_dialog_factory_new ("toplevel",
gimp_get_user_context (gimp),
NULL,
menu_factory,
NULL);
global_toolbox_factory = gimp_dialog_factory_new ("toolbox",

View File

@ -38,6 +38,7 @@
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdock.h"
#include "widgets/gimpmenufactory.h"
#include "widgets/gimppropwidgets.h"
#include "widgets/gimptexteditor.h"
#include "widgets/gimpviewablebox.h"
@ -510,22 +511,15 @@ gimp_text_options_notify_dir (GimpTextOptions *options,
GtkWidget *
gimp_text_options_editor_new (GimpTextOptions *options,
GimpMenuFactory *menu_factory,
const gchar *title)
{
GimpMenuFactory *menu_factory;
GtkWidget *vbox;
GtkWidget *toplevel;
GtkWidget *editor;
GtkWidget *editor;
g_return_val_if_fail (GIMP_IS_TEXT_OPTIONS (options), NULL);
g_return_val_if_fail (GIMP_IS_MENU_FACTORY (menu_factory), NULL);
g_return_val_if_fail (title != NULL, NULL);
vbox = g_object_get_data (G_OBJECT (options), "tool-options-vbox");
toplevel = gtk_widget_get_toplevel (vbox);
menu_factory = GIMP_DOCK (toplevel)->dialog_factory->menu_factory;
editor = gimp_text_editor_new (title, menu_factory);
gimp_text_editor_set_direction (GIMP_TEXT_EDITOR (editor),

View File

@ -61,6 +61,7 @@ void gimp_text_options_connect_text (GimpTextOptions *options,
GtkWidget * gimp_text_options_gui (GimpToolOptions *tool_options);
GtkWidget * gimp_text_options_editor_new (GimpTextOptions *options,
GimpMenuFactory *menu_factory,
const gchar *title);

View File

@ -714,7 +714,8 @@ gimp_text_tool_create_layer (GimpTextTool *text_tool,
static void
gimp_text_tool_editor (GimpTextTool *text_tool)
{
GimpTextOptions *options;
GimpTextOptions *options;
GimpDialogFactory *dialog_factory;
if (text_tool->editor)
{
@ -724,13 +725,16 @@ gimp_text_tool_editor (GimpTextTool *text_tool)
options = GIMP_TEXT_OPTIONS (GIMP_TOOL (text_tool)->tool_info->tool_options);
dialog_factory = gimp_dialog_factory_from_name ("toplevel");
text_tool->editor = gimp_text_options_editor_new (options,
dialog_factory->menu_factory,
_("GIMP Text Editor"));
g_object_add_weak_pointer (G_OBJECT (text_tool->editor),
(gpointer *) &text_tool->editor);
gimp_dialog_factory_add_foreign (gimp_dialog_factory_from_name ("toplevel"),
gimp_dialog_factory_add_foreign (dialog_factory,
"gimp-text-tool-dialog",
text_tool->editor);