static void combo_changed_cb (glNewLabelDialog *this);
static void rotate_toggled_cb (glNewLabelDialog *this);
-static gchar *get_default_name (void);
-
static void set_info (glNewLabelDialog *this,
const gchar *name);
/*****************************************************************************/
/* Boilerplate object stuff. */
/*****************************************************************************/
-G_DEFINE_TYPE (glNewLabelDialog, gl_new_label_dialog, GTK_TYPE_ASSISTANT);
+G_DEFINE_TYPE (glNewLabelDialog, gl_new_label_dialog, GTK_TYPE_ASSISTANT)
/*****************************************************************************/
static void
gl_new_label_dialog_init (glNewLabelDialog *this)
{
- GtkWidget *vbox;
+ GdkRGBA banner_color = { 0, 0.5, 1.0, 1.0 };
+ GtkWidget *page_1_banner_eventbox, *page_2_banner_eventbox, *page_3_banner_eventbox;
+ GtkWidget *page_1_image, *page_2_image, *page_3_image;
gchar *logo_filename;
GdkPixbuf *logo;
GtkBuilder *builder;
"confirm_page_vbox",
NULL };
GError *error = NULL;
- GtkWidget *new_label_dialog_hbox;
gl_debug (DEBUG_FILE, "START");
this->priv = g_new0 (glNewLabelDialogPrivate, 1);
builder = gtk_builder_new ();
- builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "new-label-dialog.builder", NULL);
+ builder_filename = g_build_filename (GLABELS_DATA_DIR, "ui", "new-label-dialog.ui", NULL);
gtk_builder_add_objects_from_file (builder, builder_filename, object_ids, &error);
g_free (builder_filename);
if (error) {
}
gl_builder_util_get_widgets (builder,
+ "page_1_banner_eventbox", &page_1_banner_eventbox,
+ "page_2_banner_eventbox", &page_2_banner_eventbox,
+ "page_3_banner_eventbox", &page_3_banner_eventbox,
+ "page_1_image", &page_1_image,
+ "page_2_image", &page_2_image,
+ "page_3_image", &page_3_image,
"template_page_vbox", &this->priv->template_page_vbox,
"combo_hbox", &this->priv->combo_hbox,
"rotate_page_vbox", &this->priv->rotate_page_vbox,
this->priv->builder = builder;
gtk_assistant_append_page (GTK_ASSISTANT (this), this->priv->template_page_vbox);
- gtk_assistant_set_page_title (GTK_ASSISTANT (this), this->priv->template_page_vbox, _("Select Product"));
+ gtk_assistant_set_page_title (GTK_ASSISTANT (this), this->priv->template_page_vbox,
+ C_("Title of dialog page to select a stationary product",
+ "Select Product"));
gtk_assistant_set_page_type (GTK_ASSISTANT (this), this->priv->template_page_vbox, GTK_ASSISTANT_PAGE_INTRO);
+ gtk_widget_override_background_color (page_1_banner_eventbox, GTK_STATE_NORMAL, &banner_color);
logo_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "new-select.png", NULL);
logo = gdk_pixbuf_new_from_file (logo_filename, NULL);
- gtk_assistant_set_page_header_image (GTK_ASSISTANT (this), this->priv->template_page_vbox, logo);
+ gtk_image_set_from_pixbuf (GTK_IMAGE (page_1_image), logo);
g_free (logo_filename);
g_object_unref (logo);
gtk_assistant_append_page (GTK_ASSISTANT (this), this->priv->rotate_page_vbox);
gtk_assistant_set_page_title (GTK_ASSISTANT (this), this->priv->rotate_page_vbox, _("Choose Orientation"));
gtk_assistant_set_page_complete (GTK_ASSISTANT (this), this->priv->rotate_page_vbox, TRUE);
+ gtk_widget_override_background_color (page_2_banner_eventbox, GTK_STATE_NORMAL, &banner_color);
logo_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "new-rotate.png", NULL);
logo = gdk_pixbuf_new_from_file (logo_filename, NULL);
- gtk_assistant_set_page_header_image (GTK_ASSISTANT (this), this->priv->rotate_page_vbox, logo);
+ gtk_image_set_from_pixbuf (GTK_IMAGE (page_2_image), logo);
g_free (logo_filename);
g_object_unref (logo);
gtk_assistant_set_page_title (GTK_ASSISTANT (this), this->priv->confirm_page_vbox, _("Review"));
gtk_assistant_set_page_type (GTK_ASSISTANT (this), this->priv->confirm_page_vbox, GTK_ASSISTANT_PAGE_CONFIRM);
gtk_assistant_set_page_complete (GTK_ASSISTANT (this), this->priv->confirm_page_vbox, TRUE);
+ gtk_widget_override_background_color (page_3_banner_eventbox, GTK_STATE_NORMAL, &banner_color);
logo_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "new-confirm.png", NULL);
logo = gdk_pixbuf_new_from_file (logo_filename, NULL);
- gtk_assistant_set_page_header_image (GTK_ASSISTANT (this), this->priv->confirm_page_vbox, logo);
+ gtk_image_set_from_pixbuf (GTK_IMAGE (page_3_image), logo);
g_free (logo_filename);
g_object_unref (logo);
escaped_url = g_markup_escape_text (vendor->url, -1);
markup = g_strdup_printf ("<a href='%s'>%s</a>", escaped_url, vendor->name);
gtk_label_set_markup (GTK_LABEL (this->priv->vendor_label), markup);
+ gtk_widget_set_tooltip_text (this->priv->vendor_label, escaped_url);
g_free (escaped_url);
g_free (markup);
}
{
/* FIXME: Using set_markup instead of set_text to clear out previous link. */
gtk_label_set_markup (GTK_LABEL (this->priv->vendor_label), template->brand);
+ gtk_widget_set_has_tooltip (this->priv->vendor_label, FALSE);
}
if ( template->product_url )
escaped_url = g_markup_escape_text (template->product_url, -1);
markup = g_strdup_printf ("<a href='%s'>%s</a>", escaped_url, template->part);
gtk_label_set_markup (GTK_LABEL (this->priv->part_label), markup);
+ gtk_widget_set_tooltip_text (this->priv->part_label, escaped_url);
g_free (escaped_url);
g_free (markup);
}
{
/* FIXME: Using set_markup instead of set_text to clear out previous link. */
gtk_label_set_markup (GTK_LABEL (this->priv->part_label), template->part);
+ gtk_widget_set_has_tooltip (this->priv->part_label, FALSE);
}
list = lgl_db_get_similar_template_name_list (name);