Commit b3aa7db8 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

added a "role" property.

2003-11-21  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpdialog.c: added a "role" property.

	* app/widgets/gimptexteditor.c
	* app/widgets/gimpviewabledialog.c: use it instead of calling
	gtk_window_set_role().
parent d611d303
2003-11-21 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpdialog.c: added a "role" property.
* app/widgets/gimptexteditor.c
* app/widgets/gimpviewabledialog.c: use it instead of calling
gtk_window_set_role().
2003-11-21 Michael Natterer <mitch@gimp.org>
 
* app/plug-in/plug-ins.c (plug_ins_help_domains): argh, need to
......@@ -172,9 +172,9 @@ gimp_text_editor_new (const gchar *title,
editor = g_object_new (GIMP_TYPE_TEXT_EDITOR,
"title", title,
"role", "gimp-text-editor",
NULL);
gtk_window_set_role (GTK_WINDOW (editor), "gimp-text-editor");
gimp_help_connect (GTK_WIDGET (editor), gimp_standard_help_func,
GIMP_HELP_TEXT_EDITOR_DIALOG, NULL);
......
......@@ -174,10 +174,9 @@ gimp_viewable_dialog_new (GimpViewable *viewable,
dialog = g_object_new (GIMP_TYPE_VIEWABLE_DIALOG,
"title", title,
"role", role,
NULL);
gtk_window_set_role (GTK_WINDOW (dialog), role);
if (parent)
{
if (GTK_IS_WINDOW (parent))
......
......@@ -30,9 +30,25 @@
#include "gimphelpui.h"
enum
{
PROP_0,
PROP_ROLE
};
static void gimp_dialog_class_init (GimpDialogClass *klass);
static void gimp_dialog_init (GimpDialog *dialog);
static void gimp_dialog_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_dialog_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gboolean gimp_dialog_delete_event (GtkWidget *widget,
GdkEventAny *event);
static void gimp_dialog_close (GtkDialog *dialog);
......@@ -72,17 +88,61 @@ gimp_dialog_get_type (void)
static void
gimp_dialog_class_init (GimpDialogClass *klass)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkDialogClass *dialog_class;
object_class = G_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
dialog_class = GTK_DIALOG_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->set_property = gimp_dialog_set_property;
object_class->get_property = gimp_dialog_get_property;
widget_class->delete_event = gimp_dialog_delete_event;
dialog_class->close = gimp_dialog_close;
g_object_class_install_property (object_class, PROP_ROLE,
g_param_spec_string ("role", NULL, NULL,
NULL,
G_PARAM_READWRITE));
}
static void
gimp_dialog_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
switch (property_id)
{
case PROP_ROLE:
gtk_window_set_role (GTK_WINDOW (object), g_value_get_string (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_dialog_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
switch (property_id)
{
case PROP_ROLE:
g_value_set_string (value, gtk_window_get_role (GTK_WINDOW (object)));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
......@@ -206,10 +266,9 @@ gimp_dialog_new_valist (const gchar *title,
dialog = g_object_new (GIMP_TYPE_DIALOG,
"title", title,
"role", role,
NULL);
gtk_window_set_role (GTK_WINDOW (dialog), role);
if (parent)
{
if (GTK_IS_WINDOW (parent))
......
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