Commit 512b1120 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

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.
parent 20ac70e7
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()
......
......@@ -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",
......
......@@ -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),
......
......@@ -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);
......
......@@ -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);
......
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