+2005-05-18 Jim Evins <evins@snaught.com>
+
+ * src/hig.h:
+ * src/hig.c:
+ Removed glHigDialog class.
+ * src/file.c: (gl_file_new), (create_new_dialog_widgets),
+ (gl_file_properties), (create_properties_dialog_widgets):
+ * src/prefs-dialog.h:
+ * src/prefs-dialog.c: (gl_prefs_dialog_get_type),
+ (gl_prefs_dialog_init), (gl_prefs_dialog_construct):
+ * src/print-dialog.h:
+ * src/prefs-dialog.h:
+ * src/print-dialog.c: (gl_print_dialog_get_type),
+ (gl_print_dialog_init), (gl_print_dialog_construct):
+ Replaced all instances of glHigDialog with GtkDialog.
+
2005-05-17 Jim Evins <evins@snaught.com>
* src/hig.h:
/*===========================================*/
/* Local function prototypes. */
/*===========================================*/
-static void create_new_dialog_widgets (glHigDialog *dlg);
+static void create_new_dialog_widgets (GtkDialog *dlg);
static void new_template_changed (glWdgtMediaSelect *select,
gpointer data);
static void new_response (GtkDialog *dlg,
gint response,
gpointer user_data);
-static void create_properties_dialog_widgets (glHigDialog *dlg,
+static void create_properties_dialog_widgets (GtkDialog *dlg,
glLabel *label);
static void properties_template_changed (glWdgtMediaSelect *select,
gpointer data);
g_return_if_fail (window != NULL);
- dlg = gl_hig_dialog_new_with_buttons (_("New Label or Card"),
- GTK_WINDOW (window),
- GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
+ dlg = gtk_dialog_new_with_buttons (_("New Label or Card"),
+ GTK_WINDOW (window),
+ GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT|GTK_DIALOG_NO_SEPARATOR,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OK, GTK_RESPONSE_OK,
+ NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dlg), GTK_RESPONSE_OK);
+ gtk_container_set_border_width (GTK_CONTAINER(dlg), GL_HIG_PAD2);
- create_new_dialog_widgets (GL_HIG_DIALOG (dlg));
+ create_new_dialog_widgets (GTK_DIALOG (dlg));
g_object_set_data (G_OBJECT (dlg), "parent_window", window);
/* PRIVATE. Create widgets. */
/*---------------------------------------------------------------------------*/
static void
-create_new_dialog_widgets (glHigDialog *dlg)
+create_new_dialog_widgets (GtkDialog *dlg)
{
- GtkWidget *wframe, *template_entry, *rotate_sel;
+ GtkWidget *wvbox, *wframe, *template_entry, *rotate_sel;
gl_debug (DEBUG_FILE, "START");
+ wvbox = gtk_vbox_new (FALSE, GL_HIG_PAD2);
+ gtk_box_pack_start (GTK_BOX(dlg->vbox), wvbox, FALSE, FALSE, 0);
+
wframe = gl_hig_category_new (_("Media Type"));
- gl_hig_dialog_add_widget (dlg, wframe);
+ gtk_box_pack_start (GTK_BOX (wvbox), wframe, FALSE, FALSE, 0);
template_entry = gl_wdgt_media_select_new ();
gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe), template_entry);
wframe = gl_hig_category_new (_("Label orientation"));
- gl_hig_dialog_add_widget (dlg, wframe);
+ gtk_box_pack_start (GTK_BOX (wvbox), wframe, FALSE, FALSE, 0);
rotate_sel = gl_wdgt_rotate_label_new ();
gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe), rotate_sel);
g_return_if_fail (label && GL_IS_LABEL (label));
g_return_if_fail (window && GTK_IS_WINDOW (window));
- dlg = gl_hig_dialog_new_with_buttons (_("Label properties"),
- GTK_WINDOW (window),
- GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
+ dlg = gtk_dialog_new_with_buttons (_("Label properties"),
+ GTK_WINDOW (window),
+ GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT|GTK_DIALOG_NO_SEPARATOR,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OK, GTK_RESPONSE_OK,
+ NULL);
+ gtk_container_set_border_width (GTK_CONTAINER(dlg), GL_HIG_PAD2);
gtk_dialog_set_default_response (GTK_DIALOG (dlg), GTK_RESPONSE_OK);
- create_properties_dialog_widgets (GL_HIG_DIALOG (dlg), label);
+ create_properties_dialog_widgets (GTK_DIALOG (dlg), label);
g_object_set_data (G_OBJECT (dlg), "label", label);
/* PRIVATE. Create widgets. */
/*---------------------------------------------------------------------------*/
static void
-create_properties_dialog_widgets (glHigDialog *dlg,
+create_properties_dialog_widgets (GtkDialog *dlg,
glLabel *label)
{
- GtkWidget *wframe, *template_entry, *rotate_sel;
+ GtkWidget *wvbox, *wframe, *template_entry, *rotate_sel;
glTemplate *template;
gboolean rotate_flag;
gl_debug (DEBUG_FILE, "START");
+ wvbox = gtk_vbox_new (FALSE, GL_HIG_PAD2);
+ gtk_box_pack_start (GTK_BOX(dlg->vbox), wvbox, FALSE, FALSE, 0);
+
wframe = gl_hig_category_new (_("Media Type"));
- gl_hig_dialog_add_widget (dlg, wframe);
+ gtk_box_pack_start (GTK_BOX (wvbox), wframe, FALSE, FALSE, 0);
template_entry = gl_wdgt_media_select_new ();
gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe), template_entry);
wframe = gl_hig_category_new (_("Label orientation"));
- gl_hig_dialog_add_widget (dlg, wframe);
+ gtk_box_pack_start (GTK_BOX (wvbox), wframe, FALSE, FALSE, 0);
rotate_sel = gl_wdgt_rotate_label_new ();
gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe), rotate_sel);
/*===========================================*/
/* Private globals */
/*===========================================*/
-static GtkDialogClass *hig_dialog_parent_class;
static GtkVBoxClass *hig_category_parent_class;
static GtkVBoxClass *hig_vbox_parent_class;
static GtkHBoxClass *hig_hbox_parent_class;
/* Local function prototypes */
/*===========================================*/
-static void gl_hig_dialog_class_init (glHigDialogClass *class);
-static void gl_hig_dialog_init (glHigDialog *hig_dialog);
-static void gl_hig_dialog_finalize (GObject *object);
-
-static void add_buttons_valist (glHigDialog *dialog,
- const gchar *first_button_text,
- va_list args);
-
static void gl_hig_category_class_init (glHigCategoryClass *class);
static void gl_hig_category_init (glHigCategory *hig_category);
static void gl_hig_category_finalize (GObject *object);
static void gl_hig_hbox_init (glHigHBox *hig_hbox);
static void gl_hig_hbox_finalize (GObject *object);
-/****************************************************************************/
-/****************************************************************************/
-/* Boilerplate Dialog Object stuff. */
-/****************************************************************************/
-/****************************************************************************/
-GType
-gl_hig_dialog_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (glHigDialogClass),
- NULL,
- NULL,
- (GClassInitFunc) gl_hig_dialog_class_init,
- NULL,
- NULL,
- sizeof (glHigDialog),
- 0,
- (GInstanceInitFunc) gl_hig_dialog_init,
- NULL
- };
-
- type = g_type_register_static (GTK_TYPE_DIALOG,
- "glHigDialog", &info, 0);
- }
-
- return type;
-}
-
-static void
-gl_hig_dialog_class_init (glHigDialogClass *class)
-{
- GObjectClass *object_class = (GObjectClass *) class;
-
- hig_dialog_parent_class = g_type_class_peek_parent (class);
-
- object_class->finalize = gl_hig_dialog_finalize;
-}
-
-static void
-gl_hig_dialog_init (glHigDialog *hig_dialog)
-{
- gtk_container_set_border_width (GTK_CONTAINER(hig_dialog),
- HIG_DIALOG_BORDER);
-
- hig_dialog->vbox = gtk_vbox_new (FALSE, HIG_DIALOG_VBOX_SPACING);
- gtk_box_pack_start (GTK_BOX(GTK_DIALOG(hig_dialog)->vbox),
- hig_dialog->vbox, FALSE, FALSE, 0);
-
- gtk_box_set_spacing (GTK_BOX(GTK_DIALOG(hig_dialog)->vbox),
- HIG_DIALOG_OUTER_VBOX_SPACING);
-}
-
-static void
-gl_hig_dialog_finalize (GObject *object)
-{
- glHigDialog *hig_dialog;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (GL_IS_HIG_DIALOG (object));
-
- hig_dialog = GL_HIG_DIALOG (object);
-
- G_OBJECT_CLASS (hig_dialog_parent_class)->finalize (object);
-}
-
-
-/****************************************************************************/
-/* Create a dialog that attempts to be HIG compliant. */
-/****************************************************************************/
-GtkWidget* gl_hig_dialog_new (void)
-{
- GtkWidget *dialog;
-
- dialog = g_object_new (gl_hig_dialog_get_type (), NULL);
-
- return dialog;
-}
-
-
-
-/****************************************************************************/
-/* Create a dialog that attempts to be HIG compliant with buttons. */
-/****************************************************************************/
-GtkWidget *gl_hig_dialog_new_with_buttons (const gchar *title,
- GtkWindow *parent,
- GtkDialogFlags flags,
- const gchar *first_button_text,
- ...)
-{
- GtkWidget *dialog;
- va_list args;
-
- /* Create bare dialog */
- dialog = g_object_new (gl_hig_dialog_get_type (), NULL);
-
- /* Title */
- gtk_window_set_title (GTK_WINDOW(dialog), title);
-
- /* Parent */
- gtk_window_set_transient_for (GTK_WINDOW(dialog), parent);
-
- /* Flags */
- if ( flags & GTK_DIALOG_MODAL ) {
- gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
- }
- if ( flags & GTK_DIALOG_DESTROY_WITH_PARENT ) {
- gtk_window_set_destroy_with_parent (GTK_WINDOW(dialog), TRUE);
- }
-
- /* Buttons */
- va_start (args, first_button_text);
- add_buttons_valist (GL_HIG_DIALOG(dialog), first_button_text, args);
- va_end (args);
-
-
- return dialog;
-}
-
-/*---------------------------------------------------------------------------*/
-/* PRIVATE. Add buttons to dialog from va_list. */
-/*---------------------------------------------------------------------------*/
-static void
-add_buttons_valist(glHigDialog *dialog,
- const gchar *first_button_text,
- va_list args)
-{
- const gchar* text;
- gint response_id;
-
- g_return_if_fail (GL_IS_HIG_DIALOG (dialog));
-
- if (first_button_text == NULL)
- return;
-
- text = first_button_text;
- response_id = va_arg (args, gint);
-
- while (text != NULL)
- {
- gtk_dialog_add_button (GTK_DIALOG(dialog), text, response_id);
-
- text = va_arg (args, gchar*);
- if (text == NULL)
- break;
- response_id = va_arg (args, int);
- }
-}
-
-/****************************************************************************/
-/* Add widget (from top) to dialog's vbox. */
-/****************************************************************************/
-void
-gl_hig_dialog_add_widget (glHigDialog *dialog,
- GtkWidget *widget)
-{
- gtk_box_pack_start (GTK_BOX (dialog->vbox), widget, FALSE, FALSE, 0);
-}
-
-
/****************************************************************************/
/****************************************************************************/
/* Boilerplate Category Object stuff. */
#define GL_HIG_PAD2 12
-/*===========================================================================*/
-/* HIG Dialog wrapper. */
-/*===========================================================================*/
-
-#define GL_TYPE_HIG_DIALOG (gl_hig_dialog_get_type ())
-#define GL_HIG_DIALOG(obj) \
- (GTK_CHECK_CAST((obj), GL_TYPE_HIG_DIALOG, glHigDialog ))
-#define GL_HIG_DIALOG_CLASS(klass) \
- (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_HIG_DIALOG, glHigDialogClass))
-#define GL_IS_HIG_DIALOG(obj) \
- (GTK_CHECK_TYPE ((obj), GL_TYPE_HIG_DIALOG))
-#define GL_IS_HIG_DIALOG_CLASS(klass) \
- (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_HIG_DIALOG))
-
-typedef struct _glHigDialog glHigDialog;
-typedef struct _glHigDialogClass glHigDialogClass;
-
-struct _glHigDialog {
- GtkDialog parent_widget;
-
- GtkWidget *vbox;
-};
-
-struct _glHigDialogClass {
- GtkDialogClass parent_class;
-};
-
-GType gl_hig_dialog_get_type (void) G_GNUC_CONST;
-
-GtkWidget *gl_hig_dialog_new (void);
-
-GtkWidget *gl_hig_dialog_new_with_buttons (const gchar *title,
- GtkWindow *parent,
- GtkDialogFlags flags,
- const gchar *first_button_text,
- ...);
-
-void gl_hig_dialog_add_widget (glHigDialog *dialog,
- GtkWidget *widget);
-
-
/*===========================================================================*/
/* HIG Category (analogous to a gtk_frame). */
/*===========================================================================*/
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
#include <gtk/gtkspinbutton.h>
#include "prefs.h"
+#include "hig.h"
#include "mygal/widget-color-combo.h"
#include "color.h"
#include "util.h"
/* Private globals. */
/*========================================================*/
-static glHigDialogClass* parent_class = NULL;
+static GtkDialogClass* parent_class = NULL;
/*========================================================*/
/* Private function prototypes. */
NULL
};
- type = g_type_register_static (GL_TYPE_HIG_DIALOG,
+ type = g_type_register_static (GTK_TYPE_DIALOG,
"glPrefsDialog", &info, 0);
}
return;
}
+ gtk_container_set_border_width (GTK_CONTAINER(dlg), GL_HIG_PAD2);
+
+ gtk_dialog_set_has_separator (GTK_DIALOG(dlg), FALSE);
+ gtk_dialog_add_button (GTK_DIALOG(dlg), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
+ gtk_dialog_set_default_response (GTK_DIALOG (dlg), GTK_RESPONSE_CLOSE);
+
+ g_signal_connect(G_OBJECT (dlg), "response",
+ G_CALLBACK (response_cb), NULL);
+
+ gtk_window_set_modal (GTK_WINDOW (dlg), TRUE);
+ gtk_window_set_title (GTK_WINDOW (dlg), _("gLabels Preferences"));
+ gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE);
+
gl_debug (DEBUG_PREFS, "END");
}
g_return_if_fail (GL_IS_PREFS_DIALOG (dlg));
g_return_if_fail (dlg->priv != NULL);
- gtk_dialog_add_button (GTK_DIALOG(dlg),
- GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dlg), GTK_RESPONSE_CLOSE);
-
- g_signal_connect(G_OBJECT (dlg), "response",
- G_CALLBACK (response_cb), NULL);
-
notebook = glade_xml_get_widget (dlg->priv->gui, "prefs_notebook");
- gl_hig_dialog_add_widget (GL_HIG_DIALOG(dlg), notebook);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), notebook, FALSE, FALSE, 0);
construct_locale_page (dlg);
construct_object_page (dlg);
update_object_page_from_prefs (dlg);
gtk_widget_show_all (GTK_DIALOG (dlg)->vbox);
-
- gtk_window_set_modal (GTK_WINDOW (dlg), TRUE);
- gtk_window_set_title (GTK_WINDOW (dlg), _("gLabels Preferences"));
- gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE);
}
/*---------------------------------------------------------------------------*/
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
#define __PREFS_DIALOG_H__
#include <gtk/gtkwindow.h>
-#include "hig.h"
+#include <gtk/gtkdialog.h>
G_BEGIN_DECLS
struct _glPrefsDialog
{
- glHigDialog parent_instance;
+ GtkDialog parent_instance;
glPrefsDialogPrivate *priv;
struct _glPrefsDialogClass
{
- glHigDialogClass parent_class;
+ GtkDialogClass parent_class;
};
GType gl_prefs_dialog_get_type (void) G_GNUC_CONST;
/* Private globals */
/*===========================================*/
-static glHigDialogClass* parent_class = NULL;
+static GtkDialogClass* parent_class = NULL;
/*===========================================*/
/* Local function prototypes */
NULL
};
- type = g_type_register_static (GL_TYPE_HIG_DIALOG,
+ type = g_type_register_static (GTK_TYPE_DIALOG,
"glPrintDialog", &info, 0);
}
dialog->priv = g_new0 (glPrintDialogPrivate, 1);
+ gtk_container_set_border_width (GTK_CONTAINER(dialog), GL_HIG_PAD2);
+
+ gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE);
gtk_dialog_add_buttons (GTK_DIALOG(dialog),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_PRINT, GNOME_PRINT_DIALOG_RESPONSE_PRINT,
}
notebook = gtk_notebook_new ();
- gl_hig_dialog_add_widget (GL_HIG_DIALOG(dialog), notebook);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), notebook, FALSE, FALSE, 0);
/* ----- Create Job notebook page ----- */
page = job_page_new (dialog, label);
#define __PRINT_DIALOG_H__
#include <gtk/gtkwindow.h>
-#include "hig.h"
+#include <gtk/gtkdialog.h>
#include "view.h"
G_BEGIN_DECLS
struct _glPrintDialog
{
- glHigDialog parent_instance;
+ GtkDialog parent_instance;
glPrintDialogPrivate *priv;
struct _glPrintDialogClass
{
- glHigDialogClass parent_class;
+ GtkDialogClass parent_class;
};