Revision: 5841 http://geany.svn.sourceforge.net/geany/?rev=5841&view=rev Author: colombanw Date: 2011-06-13 20:42:31 +0000 (Mon, 13 Jun 2011)
Log Message: ----------- Enable GTK printing support unconditionally
Modified Paths: -------------- trunk/ChangeLog trunk/configure.ac trunk/doc/geany.html trunk/doc/geany.txt trunk/src/callbacks.c trunk/src/keyfile.c trunk/src/main.c trunk/src/prefs.c trunk/src/printing.c trunk/src/printing.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-06-13 18:41:50 UTC (rev 5840) +++ trunk/ChangeLog 2011-06-13 20:42:31 UTC (rev 5841) @@ -8,6 +8,10 @@ src/vte.c: Deprecate ui_widget_set_tooltip_text() in favor of gtk_widget_set_tooltip_text(). + * configure.ac, doc/geany.html, doc/geany.txt, src/callbacks.c, + src/keyfile.c, src/main.c, src/prefs.c, src/printing.c, + src/printing.h: + Enable GTK printing support unconditionally.
2011-06-11 Colomban Wendling <colomban(at)geany(dot)org>
Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2011-06-13 18:41:50 UTC (rev 5840) +++ trunk/configure.ac 2011-06-13 20:42:31 UTC (rev 5841) @@ -221,15 +221,6 @@ GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
-# GTK 2.10 printing support -$PKG_CONFIG --exists 'gtk+-2.0 >= 2.10.0' -if test "x$?" = "x0" ; then - enable_printing="yes" -else - enable_printing="no (GTK >= 2.10 necessary)" -fi - - # just for a laugh (it has absolutely no effect) AC_ARG_ENABLE(the-force, AC_HELP_STRING([--enable-the-force], [enable if you are Luke Skywalker and the force is with you [[default=no]]]), [be_luke="$enableval"], [be_luke="no"]) @@ -313,7 +304,6 @@ echo "Building Geany for : ${target}" fi echo "Using GTK version : ${GTK_VERSION}" -echo "Build with GTK printing support : ${enable_printing}" echo "Build with plugin support : ${enable_plugins}" echo "Use virtual terminal support : ${want_vte}" echo "Use (UNIX domain) socket support : ${want_socket}"
Modified: trunk/doc/geany.html =================================================================== --- trunk/doc/geany.html 2011-06-13 18:41:50 UTC (rev 5840) +++ trunk/doc/geany.html 2011-06-13 20:42:31 UTC (rev 5841) @@ -6,7 +6,7 @@ <meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" /> <title>Geany</title> <meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz" /> -<meta name="date" content="2011-05-03" /> +<meta name="date" content="$Date$" /> <style type="text/css">
/* @@ -139,7 +139,7 @@ <br />Nick Treleaven <br />Frank Lanitz</td></tr> <tr><th class="docinfo-name">Date:</th> -<td>2011-05-03</td></tr> +<td>$Date$</td></tr> <tr><th class="docinfo-name">Version:</th> <td>0.21</td></tr> </tbody> @@ -3243,13 +3243,10 @@ </pre> <p>at the end of the file. Of course, you can also use xpdf, kpdf or whatever as the print preview command.</p> -<p>Unfortunately, native GTK printing support is only available if Geany was -built against GTK 2.10 (or above) <strong>and</strong> is running with GTK 2.10 (or above). -If not, Geany provides basic printing support. This means you can print a -file by passing the filename of the current file to a command which -actually prints the file. However, the printed document contains no syntax -highlighting. You can adjust the command to which the filename is -passed in the preferences dialog. The default command is:</p> +<p>Geany also provides an alternative basic printing support using a custom +print command. However, the printed document contains no syntax highlighting. +You can adjust the command to which the filename is passed in the preferences +dialog. The default command is:</p> <pre class="literal-block"> % lpr %f </pre> @@ -6580,7 +6577,7 @@ <div class="footer"> <hr class="footer" /> <a class="reference external" href="geany.txt">View document source</a>. -Generated on: 2011-05-22 10:30 UTC. +Generated on: 2011-06-13 20:12 UTC. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
Modified: trunk/doc/geany.txt =================================================================== --- trunk/doc/geany.txt 2011-06-13 18:41:50 UTC (rev 5840) +++ trunk/doc/geany.txt 2011-06-13 20:42:31 UTC (rev 5841) @@ -2955,13 +2955,10 @@ at the end of the file. Of course, you can also use xpdf, kpdf or whatever as the print preview command.
-Unfortunately, native GTK printing support is only available if Geany was -built against GTK 2.10 (or above) **and** is running with GTK 2.10 (or above). -If not, Geany provides basic printing support. This means you can print a -file by passing the filename of the current file to a command which -actually prints the file. However, the printed document contains no syntax -highlighting. You can adjust the command to which the filename is -passed in the preferences dialog. The default command is:: +Geany also provides an alternative basic printing support using a custom +print command. However, the printed document contains no syntax highlighting. +You can adjust the command to which the filename is passed in the preferences +dialog. The default command is::
% lpr %f
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2011-06-13 18:41:50 UTC (rev 5840) +++ trunk/src/callbacks.c 2011-06-13 20:42:31 UTC (rev 5841) @@ -266,12 +266,8 @@ { gtk_widget_set_sensitive(ui_widgets.recent_files_menuitem, g_queue_get_length(ui_prefs.recent_queue) > 0); -#if GTK_CHECK_VERSION(2, 10, 0) - /* hide Page setup when GTK printing is not used - * (on GTK < 2.10 the menu item is hidden completely) */ - ui_widget_show_hide(ui_widgets.print_page_setup, - printing_prefs.use_gtk_printing || gtk_check_version(2, 10, 0) != NULL); -#endif + /* hide Page setup when GTK printing is not used */ + ui_widget_show_hide(ui_widgets.print_page_setup, printing_prefs.use_gtk_printing); }
@@ -2087,9 +2083,7 @@ on_page_setup1_activate (GtkMenuItem *menuitem, gpointer user_data) { -#if GTK_CHECK_VERSION(2, 10, 0) printing_page_setup_gtk(); -#endif }
Modified: trunk/src/keyfile.c =================================================================== --- trunk/src/keyfile.c 2011-06-13 18:41:50 UTC (rev 5840) +++ trunk/src/keyfile.c 2011-06-13 20:42:31 UTC (rev 5841) @@ -855,11 +855,7 @@ g_free(tmp_string); g_free(tmp_string2);
-#if GTK_CHECK_VERSION(2, 10, 0) printing_prefs.use_gtk_printing = utils_get_setting_boolean(config, "printing", "use_gtk_printing", TRUE); -#else - printing_prefs.use_gtk_printing = utils_get_setting_boolean(config, "printing", "use_gtk_printing", FALSE); -#endif printing_prefs.print_line_numbers = utils_get_setting_boolean(config, "printing", "print_line_numbers", TRUE); printing_prefs.print_page_numbers = utils_get_setting_boolean(config, "printing", "print_page_numbers", TRUE); printing_prefs.print_page_header = utils_get_setting_boolean(config, "printing", "print_page_header", TRUE);
Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2011-06-13 18:41:50 UTC (rev 5840) +++ trunk/src/main.c 2011-06-13 20:42:31 UTC (rev 5841) @@ -272,11 +272,6 @@ gtk_widget_set_name(ui_lookup_widget(main_widgets.window, "menubar1"), "GeanyMenubar"); gtk_widget_set_name(main_widgets.toolbar, "GeanyToolbar");
-#if ! GTK_CHECK_VERSION(2, 10, 0) - /* hide Page setup menu item, it isn't supported with non-GTK printing */ - gtk_widget_hide(ui_widgets.print_page_setup); -#endif - /* for some reason we need to set the initial size request, * otherwise the main window gets crazy dimensions */ gtk_widget_set_size_request(main_widgets.window, 10, 10);
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2011-06-13 18:41:50 UTC (rev 5840) +++ trunk/src/prefs.c 2011-06-13 20:42:31 UTC (rev 5841) @@ -655,13 +655,6 @@ else widget = ui_lookup_widget(ui_widgets.prefs_dialog, "radio_print_external");
-#if GTK_CHECK_VERSION(2, 10, 0) - if (gtk_check_version(2, 10, 0) != NULL) -#endif - { - gtk_widget_set_sensitive(widget_gtk, FALSE); /* disable the whole option block */ - widget = ui_lookup_widget(ui_widgets.prefs_dialog, "radio_print_external"); - } gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
on_prefs_print_radio_button_toggled(GTK_TOGGLE_BUTTON(widget_gtk), NULL); @@ -1649,12 +1642,6 @@ gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(ui_lookup_widget(ui_widgets.prefs_dialog, "vbox32")), label, FALSE, TRUE, 5); - /* page Printing */ - label = geany_wrap_label_new(_("<i>Notice: Native GTK printing is only available if Geany was built against GTK 2.10 (or above) <b>and</b> Geany is running with GTK 2.10 (or above).</i>")); - gtk_widget_show(label); - gtk_label_set_use_markup(GTK_LABEL(label), TRUE); - gtk_box_pack_start(GTK_BOX(ui_lookup_widget(ui_widgets.prefs_dialog, "vbox27")), - label, FALSE, TRUE, 5); /* page Editor->Indentation */ label = geany_wrap_label_new(_("<i>Warning: these settings are overridden by the current project. See <b>Project->Properties</b>.</i>")); gtk_widget_show(label);
Modified: trunk/src/printing.c =================================================================== --- trunk/src/printing.c 2011-06-13 18:41:50 UTC (rev 5840) +++ trunk/src/printing.c 2011-06-13 20:42:31 UTC (rev 5841) @@ -23,7 +23,7 @@
/* - * GTK 2.10 printing support + * GTK printing support * (basic code layout were adopted from Sylpheed's printing implementation, thanks) */
@@ -48,9 +48,6 @@ PrintingPrefs printing_prefs;
-#if GTK_CHECK_VERSION(2, 10, 0) - - #define ROTATE_RGB(color) \ (((color) & 0xFF0000) >> 16) + ((color) & 0x00FF00) + (((color) & 0x0000FF) << 16) #define ADD_ATTR(l, a) \ @@ -861,7 +858,6 @@
page_setup = new_page_setup; } -#endif /* GTK 2.10 */
/* simple file print using an external tool */ @@ -918,11 +914,9 @@ if (doc == NULL) return;
-#if GTK_CHECK_VERSION(2, 10, 0) - if (gtk_check_version(2, 10, 0) == NULL && printing_prefs.use_gtk_printing) + if (printing_prefs.use_gtk_printing) printing_print_gtk(doc); else -#endif print_external(doc); }
Modified: trunk/src/printing.h =================================================================== --- trunk/src/printing.h 2011-06-13 18:41:50 UTC (rev 5840) +++ trunk/src/printing.h 2011-06-13 20:42:31 UTC (rev 5841) @@ -41,9 +41,7 @@ extern PrintingPrefs printing_prefs;
-#if GTK_CHECK_VERSION(2, 10, 0) void printing_page_setup_gtk(void); -#endif
void printing_print_doc(GeanyDocument *doc);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.