app: make the rotation import dialog more similar to profile import
and some general cleanup in both dialogs.
This commit is contained in:
@ -147,7 +147,8 @@ color_profile_import_dialog_run (GimpImage *image,
|
|||||||
gtk_widget_show (stack);
|
gtk_widget_show (stack);
|
||||||
|
|
||||||
frame = gimp_frame_new (frame_title);
|
frame = gimp_frame_new (frame_title);
|
||||||
gtk_stack_add_titled (GTK_STACK (stack), frame, "builtin", "Built-in Profile");
|
gtk_stack_add_titled (GTK_STACK (stack), frame, "builtin",
|
||||||
|
_("Built-in Profile"));
|
||||||
gtk_widget_show (frame);
|
gtk_widget_show (frame);
|
||||||
|
|
||||||
label = gimp_color_profile_label_new (*dest_profile);
|
label = gimp_color_profile_label_new (*dest_profile);
|
||||||
@ -162,7 +163,8 @@ color_profile_import_dialog_run (GimpImage *image,
|
|||||||
frame_title = _("Convert the image to the preferred RGB color profile?");
|
frame_title = _("Convert the image to the preferred RGB color profile?");
|
||||||
|
|
||||||
frame = gimp_frame_new (frame_title);
|
frame = gimp_frame_new (frame_title);
|
||||||
gtk_stack_add_titled (GTK_STACK (stack), frame, "preferred", "Preferred Profile");
|
gtk_stack_add_titled (GTK_STACK (stack), frame, "preferred",
|
||||||
|
_("Preferred Profile"));
|
||||||
gtk_widget_show (frame);
|
gtk_widget_show (frame);
|
||||||
|
|
||||||
label = gimp_color_profile_label_new (pref_profile);
|
label = gimp_color_profile_label_new (pref_profile);
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
|
|
||||||
GimpColorProfilePolicy
|
GimpColorProfilePolicy
|
||||||
color_profile_import_dialog_run (GimpImage *image,
|
color_profile_import_dialog_run (GimpImage *image,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
GtkWidget *parent,
|
GtkWidget *parent,
|
||||||
GimpColorProfile **dest_profile,
|
GimpColorProfile **dest_profile,
|
||||||
|
@ -37,7 +37,6 @@
|
|||||||
|
|
||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
#include "widgets/gimpviewabledialog.h"
|
#include "widgets/gimpviewabledialog.h"
|
||||||
#include "widgets/gimpwidgets-constructors.h"
|
|
||||||
|
|
||||||
#include "metadata-rotation-import-dialog.h"
|
#include "metadata-rotation-import-dialog.h"
|
||||||
|
|
||||||
@ -46,6 +45,7 @@
|
|||||||
|
|
||||||
static GimpMetadataRotationPolicy gimp_image_metadata_rotate_dialog (GimpImage *image,
|
static GimpMetadataRotationPolicy gimp_image_metadata_rotate_dialog (GimpImage *image,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
|
GtkWidget *parent,
|
||||||
GExiv2Orientation orientation,
|
GExiv2Orientation orientation,
|
||||||
gboolean *dont_ask);
|
gboolean *dont_ask);
|
||||||
static GdkPixbuf * gimp_image_metadata_rotate_pixbuf (GdkPixbuf *pixbuf,
|
static GdkPixbuf * gimp_image_metadata_rotate_pixbuf (GdkPixbuf *pixbuf,
|
||||||
@ -70,12 +70,14 @@ metadata_rotation_import_dialog_run (GimpImage *image,
|
|||||||
orientation > GEXIV2_ORIENTATION_MAX)
|
orientation > GEXIV2_ORIENTATION_MAX)
|
||||||
return GIMP_METADATA_ROTATION_POLICY_KEEP;
|
return GIMP_METADATA_ROTATION_POLICY_KEEP;
|
||||||
|
|
||||||
return gimp_image_metadata_rotate_dialog (image, context, orientation, dont_ask);
|
return gimp_image_metadata_rotate_dialog (image, context, parent,
|
||||||
|
orientation, dont_ask);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GimpMetadataRotationPolicy
|
static GimpMetadataRotationPolicy
|
||||||
gimp_image_metadata_rotate_dialog (GimpImage *image,
|
gimp_image_metadata_rotate_dialog (GimpImage *image,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
|
GtkWidget *parent,
|
||||||
GExiv2Orientation orientation,
|
GExiv2Orientation orientation,
|
||||||
gboolean *dont_ask)
|
gboolean *dont_ask)
|
||||||
{
|
{
|
||||||
@ -84,27 +86,28 @@ gimp_image_metadata_rotate_dialog (GimpImage *image,
|
|||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
GtkWidget *toggle;
|
GtkWidget *toggle;
|
||||||
const gchar *name;
|
gchar *text;
|
||||||
gchar *title;
|
|
||||||
GdkPixbuf *pixbuf;
|
GdkPixbuf *pixbuf;
|
||||||
gint width;
|
gint width;
|
||||||
gint scale_factor;
|
gint scale_factor;
|
||||||
gint height;
|
gint height;
|
||||||
gint response;
|
gint response;
|
||||||
|
|
||||||
name = gimp_image_get_display_name (image);
|
dialog =
|
||||||
title = g_strdup_printf (_("Rotate %s?"), name);
|
gimp_viewable_dialog_new (g_list_prepend (NULL, image), context,
|
||||||
|
_("Rotate Image?"),
|
||||||
dialog = gimp_dialog_new (title, "gimp-metadata-rotate-dialog",
|
"gimp-metadata-rotate-dialog",
|
||||||
NULL, 0, NULL, NULL,
|
GIMP_ICON_OBJECT_ROTATE_180,
|
||||||
|
_("Apply metadata rotation"),
|
||||||
|
parent,
|
||||||
|
gimp_standard_help_func,
|
||||||
|
GIMP_HELP_IMAGE_METADATA_ROTATION_IMPORT,
|
||||||
|
|
||||||
_("_Keep Original"), GTK_RESPONSE_CANCEL,
|
_("_Keep Original"), GTK_RESPONSE_CANCEL,
|
||||||
_("_Rotate"), GTK_RESPONSE_OK,
|
_("_Rotate"), GTK_RESPONSE_OK,
|
||||||
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
g_free (title);
|
|
||||||
|
|
||||||
gimp_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
|
gimp_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
|
||||||
GTK_RESPONSE_OK,
|
GTK_RESPONSE_OK,
|
||||||
GTK_RESPONSE_CANCEL,
|
GTK_RESPONSE_CANCEL,
|
||||||
@ -118,6 +121,24 @@ gimp_image_metadata_rotate_dialog (GimpImage *image,
|
|||||||
main_vbox, FALSE, FALSE, 0);
|
main_vbox, FALSE, FALSE, 0);
|
||||||
gtk_widget_show (main_vbox);
|
gtk_widget_show (main_vbox);
|
||||||
|
|
||||||
|
text = g_strdup_printf (_("The image '%s' contains Exif orientation "
|
||||||
|
"metadata"),
|
||||||
|
gimp_image_get_display_name (image));
|
||||||
|
label = g_object_new (GTK_TYPE_LABEL,
|
||||||
|
"label", text,
|
||||||
|
"wrap", TRUE,
|
||||||
|
"justify", GTK_JUSTIFY_LEFT,
|
||||||
|
"xalign", 0.0,
|
||||||
|
"yalign", 0.5,
|
||||||
|
NULL);
|
||||||
|
g_free (text);
|
||||||
|
|
||||||
|
gimp_label_set_attributes (GTK_LABEL (label),
|
||||||
|
PANGO_ATTR_WEIGHT, PANGO_WEIGHT_BOLD,
|
||||||
|
-1);
|
||||||
|
gtk_box_pack_start (GTK_BOX (main_vbox), label, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (label);
|
||||||
|
|
||||||
scale_factor = gtk_widget_get_scale_factor (main_vbox);
|
scale_factor = gtk_widget_get_scale_factor (main_vbox);
|
||||||
width = gimp_image_get_width (image);
|
width = gimp_image_get_width (image);
|
||||||
height = gimp_image_get_height (image);
|
height = gimp_image_get_height (image);
|
||||||
@ -190,21 +211,6 @@ gimp_image_metadata_rotate_dialog (GimpImage *image,
|
|||||||
gtk_widget_show (image);
|
gtk_widget_show (image);
|
||||||
}
|
}
|
||||||
|
|
||||||
label = g_object_new (GTK_TYPE_LABEL,
|
|
||||||
"label", _("This image contains Exif orientation "
|
|
||||||
"metadata."),
|
|
||||||
"wrap", TRUE,
|
|
||||||
"justify", GTK_JUSTIFY_LEFT,
|
|
||||||
"xalign", 0.0,
|
|
||||||
"yalign", 0.5,
|
|
||||||
NULL);
|
|
||||||
gimp_label_set_attributes (GTK_LABEL (label),
|
|
||||||
PANGO_ATTR_SCALE, PANGO_SCALE_LARGE,
|
|
||||||
PANGO_ATTR_WEIGHT, PANGO_WEIGHT_BOLD,
|
|
||||||
-1);
|
|
||||||
gtk_box_pack_start (GTK_BOX (main_vbox), label, FALSE, FALSE, 0);
|
|
||||||
gtk_widget_show (label);
|
|
||||||
|
|
||||||
label = g_object_new (GTK_TYPE_LABEL,
|
label = g_object_new (GTK_TYPE_LABEL,
|
||||||
"label", _("Would you like to rotate the image?"),
|
"label", _("Would you like to rotate the image?"),
|
||||||
"wrap", TRUE,
|
"wrap", TRUE,
|
||||||
@ -212,6 +218,9 @@ gimp_image_metadata_rotate_dialog (GimpImage *image,
|
|||||||
"xalign", 0.0,
|
"xalign", 0.0,
|
||||||
"yalign", 0.5,
|
"yalign", 0.5,
|
||||||
NULL);
|
NULL);
|
||||||
|
gimp_label_set_attributes (GTK_LABEL (label),
|
||||||
|
PANGO_ATTR_WEIGHT, PANGO_WEIGHT_BOLD,
|
||||||
|
-1);
|
||||||
gtk_box_pack_start (GTK_BOX (main_vbox), label, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (main_vbox), label, FALSE, FALSE, 0);
|
||||||
gtk_widget_show (label);
|
gtk_widget_show (label);
|
||||||
|
|
||||||
@ -225,7 +234,8 @@ gimp_image_metadata_rotate_dialog (GimpImage *image,
|
|||||||
|
|
||||||
gtk_widget_destroy (dialog);
|
gtk_widget_destroy (dialog);
|
||||||
|
|
||||||
return (response == GTK_RESPONSE_OK) ? GIMP_METADATA_ROTATION_POLICY_ROTATE : GIMP_COLOR_PROFILE_POLICY_KEEP;
|
return (response == GTK_RESPONSE_OK) ?
|
||||||
|
GIMP_METADATA_ROTATION_POLICY_ROTATE : GIMP_COLOR_PROFILE_POLICY_KEEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GdkPixbuf *
|
static GdkPixbuf *
|
||||||
|
@ -22,7 +22,8 @@
|
|||||||
#define __METADATA_ROTATION_IMPORT_DIALOG_H__
|
#define __METADATA_ROTATION_IMPORT_DIALOG_H__
|
||||||
|
|
||||||
|
|
||||||
GimpMetadataRotationPolicy metadata_rotation_import_dialog_run (GimpImage *image,
|
GimpMetadataRotationPolicy
|
||||||
|
metadata_rotation_import_dialog_run (GimpImage *image,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
GtkWidget *parent,
|
GtkWidget *parent,
|
||||||
gboolean *dont_ask);
|
gboolean *dont_ask);
|
||||||
|
@ -165,6 +165,7 @@
|
|||||||
#define GIMP_HELP_IMAGE_COLOR_PROFILE_USE_SRGB "gimp-image-color-profile-use-srgb"
|
#define GIMP_HELP_IMAGE_COLOR_PROFILE_USE_SRGB "gimp-image-color-profile-use-srgb"
|
||||||
#define GIMP_HELP_IMAGE_COLOR_PROFILE_SAVE "gimp-image-color-profile-save"
|
#define GIMP_HELP_IMAGE_COLOR_PROFILE_SAVE "gimp-image-color-profile-save"
|
||||||
#define GIMP_HELP_IMAGE_COLOR_PROFILE_IMPORT "gimp-image-color-profile-import"
|
#define GIMP_HELP_IMAGE_COLOR_PROFILE_IMPORT "gimp-image-color-profile-import"
|
||||||
|
#define GIMP_HELP_IMAGE_METADATA_ROTATION_IMPORT "gimp-image-metdata-rotation-import"
|
||||||
#define GIMP_HELP_IMAGE_GRID "gimp-image-grid"
|
#define GIMP_HELP_IMAGE_GRID "gimp-image-grid"
|
||||||
#define GIMP_HELP_IMAGE_PROPERTIES "gimp-image-properties"
|
#define GIMP_HELP_IMAGE_PROPERTIES "gimp-image-properties"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user