Merge lp:~hunternet93/midori/print-without-dialog into lp:midori

Proposed by Isaac Smith
Status: Superseded
Proposed branch: lp:~hunternet93/midori/print-without-dialog
Merge into: lp:midori
Diff against target: 107 lines (+38/-5)
2 files modified
midori/midori-view.c (+19/-4)
midori/midori-websettings.c (+19/-1)
To merge this branch: bzr merge lp:~hunternet93/midori/print-without-dialog
Reviewer Review Type Date Requested Status
Cris Dywan commit-after-freeze Approve
Review via email: mp+194786@code.launchpad.net

This proposal has been superseded by a proposal from 2013-11-14.

Description of the change

This branch adds a setting to allow printing directly to the default printer without showing a dialog box, useful for kiosks and other situations where immediate printing is desired. When the setting print-without dialog is set to true, then the dialog box is not shown, if print-without-dialog is false or unset then printing functions normally.

Please note I'm new to C, GTK/Glib, and Midori, so while the feature works fine it probably isn't implemented exactly as it should be.

To post a comment you must log in.
6468. By Launchpad Translations on behalf of midori

Launchpad automatic translations update.

Revision history for this message
Cris Dywan (kalikiana) wrote :

There's no need to put disclaimers around your code as this is version-controlled and all changes can be traced back to you line by line after merging. Instead you can add your name at the very top of the file with an email address.

Your code works fine. Me thinks this should be documented in the FAQ (wiki.xfce.org/midori/faq) after merging.

review: Approve
Revision history for this message
Cris Dywan (kalikiana) wrote :

A little clearer: when I say "no need" above, please remove the inline disclaimers before this can get in.

review: Needs Fixing
6469. By Paweł Forysiuk

Fix building on Ubuntu 12.04

6470. By Cris Dywan

Don't use context-menu signal in WebKitGTK+ < 1.10.0

6471. By Launchpad Translations on behalf of midori

Launchpad automatic translations update.

6472. By gue5t <email address hidden>

Fix autoscrolling if page contains a frame with our custom error page

Revision history for this message
Cris Dywan (kalikiana) wrote :

Nice! Note we're in freeze and close to release so this branch will need to wait a few days before it can land since it's considered a feature.

review: Approve (commit-after-freeze)
6473. By Cris Dywan

Fix check for found valac and mention VALAC variable

6474. By Paweł Forysiuk

Provide sensible default font suggestions on Win32

6475. By André Stösel

removed unused preference dialog and related code

6476. By André Stösel

Check all browsers for opened sessions and whether they're popups

6477. By André Stösel

Remove stored popup sessions from the database

6478. By Cris Dywan

Hide WEbGL preference if it is unavailable

6479. By gue5t <email address hidden>

Use correct signal when clearing the trash

6480. By Cris Dywan

Swap NULL-check with main frame check

6481. By Launchpad Translations on behalf of midori

Launchpad automatic translations update.

6482. By gue5t <email address hidden>

Tweak searching for resources when running from build folder

6483. By Paweł Forysiuk

Add copyright note to appdata file

6484. By Launchpad Translations on behalf of midori

Launchpad automatic translations update.

6485. By André Stösel

handle tab duplication

6486. By André Stösel

Open speed dial or homepage according to preference

6487. By Paweł Forysiuk

makedist: Try to use system defaults

6488. By André Stösel

instead of creating devpet status icon on extension load, create it only to show new messages

6489. By Cris Dywan

Bump version to 0.5.6

6490. By Launchpad Translations on behalf of midori

Launchpad automatic translations update.

6491. By Isaac Smith

Allow printing without confirmation dialog on kiosk setups

6492. By Matthew Boevink <email address hidden>

Add close tabs to right feature

6493. By Isaac Smith

Fixed bug in Webkit2-specific code

modified:
  midori/midori-view.c
unknown:
  HACKING.save

Unmerged revisions

6493. By Isaac Smith

Fixed bug in Webkit2-specific code

modified:
  midori/midori-view.c
unknown:
  HACKING.save

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-view.c'
2--- midori/midori-view.c 2013-11-12 22:20:34 +0000
3+++ midori/midori-view.c 2013-11-13 04:56:32 +0000
4@@ -5226,9 +5226,17 @@
5 GtkPrintSettings* settings = gtk_print_settings_new ();
6 webkit_print_operation_set_print_settings (operation, settings);
7 g_object_unref (settings);
8- webkit_print_operation_run_dialog (operation,
9- GTK_WINDOW (midori_browser_get_for_widget (view->web_view)));
10+
11+ if (katze_object_get_boolean (view->settings, "print-without-dialog")) {
12+ webkit_print_operation_run (operation);
13+ }
14+ else {
15+ webkit_print_operation_run_dialog (operation,
16+ GTK_WINDOW (midori_browser_get_for_widget (view->web_view)));
17+ }
18 g_object_unref (operation);
19+
20+
21 #else
22 WebKitWebFrame* frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view->web_view));
23 GtkPrintOperation* operation = gtk_print_operation_new ();
24@@ -5237,8 +5245,15 @@
25 g_signal_connect (operation, "create-custom-widget",
26 G_CALLBACK (midori_view_print_create_custom_widget_cb), view);
27 GError* error = NULL;
28- webkit_web_frame_print_full (frame, operation,
29- GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, &error);
30+
31+ if (katze_object_get_boolean (view->settings, "print-without-dialog")) {
32+ webkit_web_frame_print_full (frame, operation,
33+ GTK_PRINT_OPERATION_ACTION_PRINT, &error);
34+ }
35+ else {
36+ webkit_web_frame_print_full (frame, operation,
37+ GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, &error);
38+ }
39 g_object_unref (operation);
40
41 if (error)
42
43=== modified file 'midori/midori-websettings.c'
44--- midori/midori-websettings.c 2013-11-04 20:59:15 +0000
45+++ midori/midori-websettings.c 2013-11-13 04:56:32 +0000
46@@ -64,6 +64,7 @@
47 gchar* user_stylesheet_uri;
48 gchar* user_stylesheet_uri_cached;
49 GHashTable* user_stylesheets;
50+ gboolean print_without_dialog;
51 };
52
53 struct _MidoriWebSettingsClass
54@@ -99,6 +100,7 @@
55 PROP_ENABLE_DNS_PREFETCHING,
56 PROP_ENFORCE_FONT_FAMILY,
57 PROP_USER_STYLESHEET_URI,
58+ PROP_PRINT_WITHOUT_DIALOG,
59 };
60
61 GType
62@@ -492,6 +494,16 @@
63 flags));
64
65 g_object_class_install_property (gobject_class,
66+ PROP_PRINT_WITHOUT_DIALOG,
67+ g_param_spec_boolean (
68+ "print-without-dialog",
69+ "Print without dialog",
70+ "Print without showing a dialog box",
71+ FALSE,
72+ flags));
73+
74+
75+ g_object_class_install_property (gobject_class,
76 PROP_USER_STYLESHEET_URI,
77 g_param_spec_string (
78 "user-stylesheet-uri",
79@@ -1017,7 +1029,7 @@
80
81 case PROP_PROXY_TYPE:
82 web_settings->proxy_type = g_value_get_enum (value);
83- break;
84+ break;
85 case PROP_IDENTIFY_AS:
86 web_settings->identify_as = g_value_get_enum (value);
87 if (web_settings->identify_as != MIDORI_IDENT_CUSTOM)
88@@ -1101,6 +1113,9 @@
89 midori_web_settings_process_stylesheets (web_settings, new_len - old_len);
90 }
91 break;
92+ case PROP_PRINT_WITHOUT_DIALOG:
93+ web_settings->print_without_dialog = g_value_get_boolean(value);
94+ break;
95 default:
96 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
97 break;
98@@ -1217,6 +1232,9 @@
99 WEB_SETTINGS_STRING ("user-stylesheet-uri")));
100 #endif
101 break;
102+ case PROP_PRINT_WITHOUT_DIALOG:
103+ g_value_set_boolean (value, web_settings->print_without_dialog);
104+ break;
105 default:
106 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
107 break;

Subscribers

People subscribed via source and target branches

to all changes: