Commit 571655ec authored by Jim Nelson's avatar Jim Nelson

#2733: Moved Page Setup into the Print dialog. Courtesy Till Kamppeter. ...

#2733: Moved Page Setup into the Print dialog.  Courtesy Till Kamppeter.  Also, forgot to add Glade file for #1296.
parent e10a4823
......@@ -16,6 +16,7 @@ David Jeske <davidj@gmail.com>
Matt Jones <mattjones@workhorsy.org>
Maxim <perezk@mail.ru>
mcben <mcbennn@gmail.com>
Till Kamppeter <till.kamppeter@gmail.com>
Andreas Kühntopf <andreas@kuehntopf.org>
Dominic Lloyd <dwlloyd@telus.net>
Tobias Lott <tobias@lott.eu.org>
......
......@@ -102,7 +102,6 @@ public abstract class CollectionPage : MediaPage {
#if !NO_PRINTING
group.add_menu_item("Print");
group.add_menu_item("PageSetup");
#endif
#if !NO_PUBLISHING
......@@ -187,12 +186,6 @@ public abstract class CollectionPage : MediaPage {
Gtk.ActionEntry[] actions = base.init_collect_action_entries();
#if !NO_PRINTING
Gtk.ActionEntry page_setup = { "PageSetup", Gtk.STOCK_PAGE_SETUP, TRANSLATABLE, null,
TRANSLATABLE, on_page_setup };
page_setup.label = Resources.PAGE_SETUP_MENU;
page_setup.tooltip = Resources.PAGE_SETUP_TOOLTIP;
actions += page_setup;
Gtk.ActionEntry print = { "Print", Gtk.STOCK_PRINT, TRANSLATABLE, "<Ctrl>P",
TRANSLATABLE, on_print };
print.label = Resources.PRINT_MENU;
......@@ -460,10 +453,6 @@ public abstract class CollectionPage : MediaPage {
if (get_view().get_selected_count() == 1)
PrintManager.get_instance().spool_photo((Photo) get_view().get_selected_at(0).get_source());
}
protected void on_page_setup() {
PrintManager.get_instance().do_page_setup();
}
#endif
private void on_external_app_changed() {
......
......@@ -2114,12 +2114,6 @@ public class LibraryPhotoPage : EditingHostPage {
actions += export;
#if !NO_PRINTING
Gtk.ActionEntry page_setup = { "PageSetup", Gtk.STOCK_PAGE_SETUP, TRANSLATABLE, null,
TRANSLATABLE, on_page_setup };
page_setup.label = Resources.PAGE_SETUP_MENU;
page_setup.tooltip = Resources.PAGE_SETUP_TOOLTIP;
actions += page_setup;
Gtk.ActionEntry print = { "Print", Gtk.STOCK_PRINT, TRANSLATABLE, "<Ctrl>P",
TRANSLATABLE, on_print };
print.label = Resources.PRINT_MENU;
......@@ -2408,7 +2402,6 @@ public class LibraryPhotoPage : EditingHostPage {
#if !NO_PRINTING
InjectionGroup print_group = new InjectionGroup("/PhotoMenuBar/FileMenu/PrintPlaceholder");
print_group.add_menu_item("PageSetup");
print_group.add_menu_item("Print");
groups += print_group;
......@@ -2840,10 +2833,6 @@ public class LibraryPhotoPage : EditingHostPage {
private void on_print() {
PrintManager.get_instance().spool_photo(get_photo());
}
private void on_page_setup() {
PrintManager.get_instance().do_page_setup();
}
#endif
private void on_external_app_changed() {
......@@ -3294,11 +3283,6 @@ public class DirectPhotoPage : EditingHostPage {
actions += send_to;
#if !NO_PRINTING
Gtk.ActionEntry page_setup = { "PageSetup", Gtk.STOCK_PAGE_SETUP, TRANSLATABLE, null,
TRANSLATABLE, on_page_setup };
page_setup.label = _("Page _Setup...");
actions += page_setup;
Gtk.ActionEntry print = { "Print", Gtk.STOCK_PRINT, TRANSLATABLE, "<Ctrl>P",
TRANSLATABLE, on_print };
print.label = Resources.PRINT_MENU;
......@@ -3444,7 +3428,6 @@ public class DirectPhotoPage : EditingHostPage {
#if !NO_PRINTING
InjectionGroup print_group = new InjectionGroup("/DirectMenuBar/FileMenu/PrintPlaceholder");
print_group.add_menu_item("PageSetup");
print_group.add_menu_item("Print");
groups += print_group;
......@@ -3763,9 +3746,5 @@ public class DirectPhotoPage : EditingHostPage {
private void on_print() {
PrintManager.get_instance().spool_photo(get_photo());
}
private void on_page_setup() {
PrintManager.get_instance().do_page_setup();
}
#endif
}
......@@ -712,6 +712,7 @@ public class PrintJob : Gtk.PrintOperation {
public PrintJob(Photo source_photo) {
this.settings = PrintManager.get_instance().get_global_settings();
this.source_photo = source_photo;
set_embed_page_setup (true);
double photo_aspect_ratio = source_photo.get_dimensions().get_aspect_ratio();
if (photo_aspect_ratio < 1.0)
photo_aspect_ratio = 1.0 / photo_aspect_ratio;
......@@ -833,18 +834,15 @@ public class PrintManager {
try {
job_result = job.run(Gtk.PrintOperationAction.PRINT_DIALOG,
AppWindow.get_instance());
if (job_result == Gtk.PrintOperationResult.APPLY) {
user_page_setup = job.get_default_page_setup();
}
} catch (Error e) {
job.cancel();
AppWindow.error_message(_("Unable to print photo:\n\n%s").printf(e.message));
}
}
public void do_page_setup() {
Gtk.PrintSettings dummy_settings = new Gtk.PrintSettings();
user_page_setup = Gtk.print_run_page_setup_dialog(AppWindow.get_instance(),
user_page_setup, dummy_settings);
}
private void on_draw_page(Gtk.PrintOperation emitting_object,
Gtk.PrintContext job_context, int page_num) {
PrintJob job = (PrintJob) emitting_object;
......
......@@ -221,9 +221,6 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
public const string EXPORT_MENU = _("_Export...");
public const string EXPORT_TOOLTIP = _("Export to disk");
public const string PAGE_SETUP_MENU = _("Page _Setup...");
public const string PAGE_SETUP_TOOLTIP = _("View and change page setup printing");
public const string PRINT_MENU = _("_Print...");
public const string PRINT_TOOLTIP = _("Print the photo to a printer connected to your computer");
......
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="dialog1">
<property name="width_request">400</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Set as Desktop Slideshow</property>
<property name="type_hint">normal</property>
<property name="skip_taskbar_hint">True</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">Show each photo for</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="delay_value_label">
<property name="visible">True</property>
<property name="label" translatable="yes">period of time</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHScale" id="delay_scale">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">How long each photo is shown on the desktop background</property>
<property name="adjustment">adjustment1</property>
<property name="draw_value">False</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="cancel_button">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ok_button">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Generate desktop background slideshow</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-6">cancel_button</action-widget>
<action-widget response="-5">ok_button</action-widget>
</action-widgets>
</object>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">100</property>
<property name="step_increment">10</property>
<property name="page_increment">10</property>
<property name="page_size">10</property>
</object>
</interface>
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