diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-12-07 18:23:31 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-12-07 18:23:31 +0800 |
commit | ec22aa6d6229b0e3405e5fca4be0662f41946b77 (patch) | |
tree | 2fa06838674189651e1cdfd5a03a2c3a021af94e | |
parent | 83bcb61ae1b7790c9d483d3706641dcc61686c67 (diff) | |
download | gsoc2013-epiphany-ec22aa6d6229b0e3405e5fca4be0662f41946b77.tar gsoc2013-epiphany-ec22aa6d6229b0e3405e5fca4be0662f41946b77.tar.gz gsoc2013-epiphany-ec22aa6d6229b0e3405e5fca4be0662f41946b77.tar.bz2 gsoc2013-epiphany-ec22aa6d6229b0e3405e5fca4be0662f41946b77.tar.lz gsoc2013-epiphany-ec22aa6d6229b0e3405e5fca4be0662f41946b77.tar.xz gsoc2013-epiphany-ec22aa6d6229b0e3405e5fca4be0662f41946b77.tar.zst gsoc2013-epiphany-ec22aa6d6229b0e3405e5fca4be0662f41946b77.zip |
Split print dialogue in print setup and actual print, and move print
2003-12-07 Christian Persch <chpe@cvs.gnome.org>
* data/glade/print.glade:
* data/ui/epiphany-ui.xml:
* embed/mozilla/PrintingPromptService.cpp:
* embed/mozilla/mozilla-embed.cpp:
* embed/print-dialog.c: (ephy_print_info_free),
(ephy_print_get_print_info), (ephy_print_dialog_response_cb),
(print_filechooser_response_cb),
(ephy_print_dialog_browse_button_cb),
(ephy_print_setup_dialog_close_button_cb), (ephy_print_dialog_new),
(ephy_print_setup_dialog_new):
* embed/print-dialog.h:
* src/ephy-nautilus-view.c: (ephy_nautilus_view_new_component),
(gnv_cmd_file_print):
* src/ephy-nautilus-view.h:
* src/ephy-shell.c: (ephy_shell_get_type), (ephy_shell_class_init),
(ephy_automation_factory_cb), (ephy_automation_factory_new),
(ephy_shell_init), (server_timeout), (ephy_shell_startup),
(ephy_shell_finalize), (ephy_shell_new_tab),
(ephy_shell_get_session), (ephy_shell_get_bookmarks),
(ephy_shell_get_toolbars_model), (ephy_shell_get_bookmarks_editor),
(ephy_shell_get_history_window),
(ephy_shell_get_print_setup_dialog), (ephy_shell_delete_on_exit):
* src/ephy-shell.h:
* src/ephy-window.c: (ephy_window_set_print_preview),
(ephy_window_print):
* src/ephy-window.h:
* src/window-commands.c: (window_cmd_file_print_setup),
(window_cmd_file_print_preview):
* src/window-commands.h:
Split print dialogue in print setup and actual print, and move
print preview into the menus too. Made print setup a global dialogue,
print a per-window dialogue.
* lib/ephy-dialog.c: (set_value_from_pref), (set_pref_from_value),
(set_value_from_combobox), (set_combo_box_from_value),
(set_radiobuttongroup_from_value), (set_pref_from_info_and_emit),
(togglebutton_clicked_cb), (radiobutton_clicked_cb),
(spinbutton_timeout_cb), (changed_cb), (init_props), (load_info),
(save_info), (impl_show), (ephy_dialog_set_size_group),
(ephy_dialog_construct), (run_response_cb), (ephy_dialog_run),
(ephy_dialog_set_parent), (ephy_dialog_class_init),
(ephy_dialog_new_with_parent):
* lib/ephy-dialog.h:
* src/language-editor.c: (language_editor_class_init):
* src/language-editor.h:
* src/pdm-dialog.c: (pdm_dialog_init):
* src/prefs-dialog.c: (fonts_language_changed_cb),
(create_fonts_language_menu), (prefs_dialog_init),
(prefs_language_more_button_clicked_cb):
Slight api change; port callers.
-rw-r--r-- | ChangeLog | 55 | ||||
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | data/glade/print.glade | 1356 | ||||
-rw-r--r-- | data/ui/epiphany-ui.xml | 2 | ||||
-rw-r--r-- | embed/mozilla/PrintingPromptService.cpp | 33 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed.cpp | 9 | ||||
-rwxr-xr-x | embed/print-dialog.c | 590 | ||||
-rw-r--r-- | embed/print-dialog.h | 54 | ||||
-rw-r--r-- | lib/ephy-dialog.c | 226 | ||||
-rw-r--r-- | lib/ephy-dialog.h | 20 | ||||
-rw-r--r-- | src/ephy-nautilus-view.c | 16 | ||||
-rw-r--r-- | src/ephy-nautilus-view.h | 37 | ||||
-rw-r--r-- | src/ephy-shell.c | 294 | ||||
-rw-r--r-- | src/ephy-shell.h | 47 | ||||
-rw-r--r-- | src/ephy-window.c | 52 | ||||
-rw-r--r-- | src/ephy-window.h | 6 | ||||
-rw-r--r-- | src/language-editor.c | 4 | ||||
-rw-r--r-- | src/language-editor.h | 2 | ||||
-rwxr-xr-x | src/pdm-dialog.c | 15 | ||||
-rw-r--r-- | src/prefs-dialog.c | 41 | ||||
-rw-r--r-- | src/window-commands.c | 29 | ||||
-rw-r--r-- | src/window-commands.h | 16 |
22 files changed, 1457 insertions, 1448 deletions
@@ -1,3 +1,58 @@ +2003-12-07 Christian Persch <chpe@cvs.gnome.org> + + * data/glade/print.glade: + * data/ui/epiphany-ui.xml: + * embed/mozilla/PrintingPromptService.cpp: + * embed/mozilla/mozilla-embed.cpp: + * embed/print-dialog.c: (ephy_print_info_free), + (ephy_print_get_print_info), (ephy_print_dialog_response_cb), + (print_filechooser_response_cb), + (ephy_print_dialog_browse_button_cb), + (ephy_print_setup_dialog_close_button_cb), (ephy_print_dialog_new), + (ephy_print_setup_dialog_new): + * embed/print-dialog.h: + * src/ephy-nautilus-view.c: (ephy_nautilus_view_new_component), + (gnv_cmd_file_print): + * src/ephy-nautilus-view.h: + * src/ephy-shell.c: (ephy_shell_get_type), (ephy_shell_class_init), + (ephy_automation_factory_cb), (ephy_automation_factory_new), + (ephy_shell_init), (server_timeout), (ephy_shell_startup), + (ephy_shell_finalize), (ephy_shell_new_tab), + (ephy_shell_get_session), (ephy_shell_get_bookmarks), + (ephy_shell_get_toolbars_model), (ephy_shell_get_bookmarks_editor), + (ephy_shell_get_history_window), + (ephy_shell_get_print_setup_dialog), (ephy_shell_delete_on_exit): + * src/ephy-shell.h: + * src/ephy-window.c: (ephy_window_set_print_preview), + (ephy_window_print): + * src/ephy-window.h: + * src/window-commands.c: (window_cmd_file_print_setup), + (window_cmd_file_print_preview): + * src/window-commands.h: + + Split print dialogue in print setup and actual print, and move + print preview into the menus too. Made print setup a global dialogue, + print a per-window dialogue. + + * lib/ephy-dialog.c: (set_value_from_pref), (set_pref_from_value), + (set_value_from_combobox), (set_combo_box_from_value), + (set_radiobuttongroup_from_value), (set_pref_from_info_and_emit), + (togglebutton_clicked_cb), (radiobutton_clicked_cb), + (spinbutton_timeout_cb), (changed_cb), (init_props), (load_info), + (save_info), (impl_show), (ephy_dialog_set_size_group), + (ephy_dialog_construct), (run_response_cb), (ephy_dialog_run), + (ephy_dialog_set_parent), (ephy_dialog_class_init), + (ephy_dialog_new_with_parent): + * lib/ephy-dialog.h: + * src/language-editor.c: (language_editor_class_init): + * src/language-editor.h: + * src/pdm-dialog.c: (pdm_dialog_init): + * src/prefs-dialog.c: (fonts_language_changed_cb), + (create_fonts_language_menu), (prefs_dialog_init), + (prefs_language_more_button_clicked_cb): + + Slight api change; port callers. + 2003-12-02 David Bordoley <bordoley@msu.edu> * help/C/epiphany.xml: @@ -96,6 +96,7 @@ Interface improvements * New layout for downloader (Marco) * Make prefs and PDM dialogues global (Christian) * Improved cookie properties dialogue (Piers Cornwell) + * Split print into print setup and print (Christian) Bugfixes diff --git a/data/glade/print.glade b/data/glade/print.glade index c28975d01..573b4af1e 100644 --- a/data/glade/print.glade +++ b/data/glade/print.glade @@ -4,14 +4,19 @@ <glade-interface> <requires lib="gnome"/> -<widget class="GtkDialog" id="print_dialog"> +<widget class="GtkDialog" id="print_setup_dialog"> <property name="border_width">5</property> - <property name="title" translatable="yes">Print</property> + <property name="title" translatable="yes">Print Setup</property> <property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="window_position">GTK_WIN_POS_NONE</property> <property name="modal">False</property> - <property name="resizable">True</property> + <property name="resizable">False</property> <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> <property name="has_separator">False</property> <child internal-child="vbox"> @@ -26,42 +31,17 @@ <property name="layout_style">GTK_BUTTONBOX_END</property> <child> - <widget class="GtkButton" id="preview_button"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-print-preview</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="response_id">50</property> - <signal name="clicked" handler="print_preview_button_cb"/> - </widget> - </child> - - <child> - <widget class="GtkButton" id="cancel_button"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="response_id">-6</property> - <signal name="clicked" handler="print_cancel_button_cb"/> - </widget> - </child> - - <child> <widget class="GtkButton" id="print_button"> <property name="visible">True</property> <property name="can_default">True</property> <property name="has_default">True</property> <property name="can_focus">True</property> - <property name="label">gtk-print</property> + <property name="label">gtk-close</property> <property name="use_stock">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="response_id">-5</property> - <signal name="clicked" handler="print_ok_button_cb"/> + <property name="focus_on_click">True</property> + <property name="response_id">-7</property> + <signal name="clicked" handler="ephy_print_setup_dialog_close_button_cb" last_modification_time="Sat, 06 Dec 2003 10:22:18 GMT"/> </widget> </child> </widget> @@ -85,22 +65,25 @@ <property name="enable_popup">False</property> <child> - <widget class="GtkVBox" id="vbox127"> + <widget class="GtkTable" id="table50"> <property name="border_width">12</property> <property name="visible">True</property> + <property name="n_rows">2</property> + <property name="n_columns">2</property> <property name="homogeneous">False</property> - <property name="spacing">18</property> + <property name="row_spacing">18</property> + <property name="column_spacing">36</property> <child> - <widget class="GtkVBox" id="vbox128"> + <widget class="GtkVBox" id="vbox141"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">6</property> <child> - <widget class="GtkLabel" id="label251"> + <widget class="GtkLabel" id="label272"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Print To</b></property> + <property name="label" translatable="yes"><b>Colors</b></property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -119,13 +102,13 @@ </child> <child> - <widget class="GtkHBox" id="hbox70"> + <widget class="GtkHBox" id="hbox80"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">0</property> <child> - <widget class="GtkLabel" id="label252"> + <widget class="GtkLabel" id="label273"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> <property name="use_underline">False</property> @@ -146,106 +129,82 @@ </child> <child> - <widget class="GtkTable" id="table47"> + <widget class="GtkVBox" id="vbox142"> <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> <property name="homogeneous">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> + <property name="spacing">6</property> <child> - <widget class="GtkRadioButton" id="printer_radiobutton"> + <widget class="GtkRadioButton" id="print_color_radiobutton"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">P_rinter:</property> + <property name="label" translatable="yes">C_olor</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> <property name="active">False</property> <property name="inconsistent">False</property> <property name="draw_indicator">True</property> </widget> <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> </packing> </child> <child> - <widget class="GtkRadioButton" id="file_radiobutton"> + <widget class="GtkRadioButton" id="print_grayscale_radiobutton"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">_File:</property> + <property name="label" translatable="yes">_Grayscale</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> <property name="active">False</property> <property name="inconsistent">False</property> <property name="draw_indicator">True</property> - <property name="group">printer_radiobutton</property> + <property name="group">print_color_radiobutton</property> </widget> <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> </packing> </child> <child> - <widget class="GnomeFileEntry" id="fileentry1"> + <widget class="GtkHBox" id="hbox86"> <property name="visible">True</property> - <property name="max_saved">10</property> - <property name="browse_dialog_title" translatable="yes">Choose a file to print to</property> - <property name="directory_entry">False</property> - <property name="modal">False</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> - <child internal-child="entry"> - <widget class="GtkEntry" id="file_entry"> + <child> + <widget class="GtkLabel" id="label277"> + <property name="width_request">18</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> </child> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="printer_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes">lpr</property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> </packing> </child> </widget> @@ -264,22 +223,25 @@ </child> </widget> <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> </packing> </child> <child> - <widget class="GtkVBox" id="vbox129"> + <widget class="GtkVBox" id="vbox137"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">6</property> <child> - <widget class="GtkLabel" id="label253"> + <widget class="GtkLabel" id="label261"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Page Range</b></property> + <property name="label" translatable="yes"><b>Margins (in mm)</b></property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -298,13 +260,13 @@ </child> <child> - <widget class="GtkHBox" id="hbox71"> + <widget class="GtkHBox" id="hbox78"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">0</property> <child> - <widget class="GtkLabel" id="label254"> + <widget class="GtkLabel" id="label271"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> <property name="use_underline">False</property> @@ -325,46 +287,53 @@ </child> <child> - <widget class="GtkTable" id="table49"> + <widget class="GtkTable" id="table48"> <property name="visible">True</property> - <property name="n_rows">3</property> + <property name="n_rows">4</property> <property name="n_columns">2</property> <property name="homogeneous">False</property> <property name="row_spacing">6</property> - <property name="column_spacing">6</property> + <property name="column_spacing">12</property> <child> - <widget class="GtkRadioButton" id="all_pages_radiobutton"> + <widget class="GtkLabel" id="label238"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_All pages</property> + <property name="label" translatable="yes">_Bottom:</property> <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">bottom_spinbutton</property> </widget> <packing> <property name="left_attach">0</property> <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkRadioButton" id="pages_radiobutton"> + <widget class="GtkLabel" id="label239"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Pa_ges</property> + <property name="label" translatable="yes">_Left:</property> <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">all_pages_radiobutton</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">left_spinbutton</property> </widget> <packing> <property name="left_attach">0</property> @@ -377,128 +346,143 @@ </child> <child> - <widget class="GtkHBox" id="hbox49"> + <widget class="GtkLabel" id="label240"> <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkLabel" id="label241"> - <property name="visible">True</property> - <property name="label" translatable="yes">fr_om:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">from_spinbutton</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> + <property name="label" translatable="yes">_Right:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">right_spinbutton</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> - <child> - <widget class="GtkSpinButton" id="from_spinbutton"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">False</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">1 1 9999 1 10 10</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> + <child> + <widget class="GtkLabel" id="label237"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Top:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">top_spinbutton</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> - <child> - <widget class="GtkLabel" id="label242"> - <property name="visible">True</property> - <property name="label" translatable="yes">_to:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">to_spinbutton</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> + <child> + <widget class="GtkSpinButton" id="bottom_spinbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">10 0 100 1 10 10</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> - <child> - <widget class="GtkSpinButton" id="to_spinbutton"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">False</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">1 1 9999 1 10 10</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> + <child> + <widget class="GtkSpinButton" id="left_spinbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">10 0 100 1 10 10</property> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> <property name="top_attach">2</property> <property name="bottom_attach">3</property> - <property name="y_options">fill</property> + <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkRadioButton" id="selection_radiobutton"> + <widget class="GtkSpinButton" id="top_spinbutton"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">_Selection</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">all_pages_radiobutton</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">10 0 100 1 10 10</property> </widget> <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="right_spinbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">10 0 100 1 10 10</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> <property name="y_options"></property> </packing> </child> </widget> <packing> <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> + <property name="expand">False</property> + <property name="fill">False</property> </packing> </child> </widget> @@ -510,54 +494,25 @@ </child> </widget> <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> </packing> </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label249"> - <property name="visible">True</property> - <property name="label" translatable="yes">General</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox131"> - <property name="border_width">12</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">18</property> <child> - <widget class="GtkVBox" id="vbox132"> + <widget class="GtkVBox" id="vbox138"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">6</property> <child> - <widget class="GtkLabel" id="label257"> + <widget class="GtkLabel" id="label267"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Size</b></property> + <property name="label" translatable="yes"><b>Headers</b></property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -576,13 +531,13 @@ </child> <child> - <widget class="GtkHBox" id="hbox73"> + <widget class="GtkHBox" id="hbox76"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">0</property> <child> - <widget class="GtkLabel" id="label259"> + <widget class="GtkLabel" id="label268"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> <property name="use_underline">False</property> @@ -603,59 +558,22 @@ </child> <child> - <widget class="GtkVBox" id="vbox84"> + <widget class="GtkVBox" id="vbox124"> <property name="visible">True</property> - <property name="homogeneous">True</property> + <property name="homogeneous">False</property> <property name="spacing">6</property> <child> - <widget class="GtkRadioButton" id="A4_radiobutton"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">A_4</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">True</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="letter_radiobutton"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Letter</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">A4_radiobutton</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="legal_radiobutton"> + <widget class="GtkCheckButton" id="print_page_title_checkbutton"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">L_egal</property> + <property name="label" translatable="yes">P_age title</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> <property name="active">False</property> <property name="inconsistent">False</property> <property name="draw_indicator">True</property> - <property name="group">A4_radiobutton</property> </widget> <packing> <property name="padding">0</property> @@ -665,16 +583,16 @@ </child> <child> - <widget class="GtkRadioButton" id="executive_radiobutton"> + <widget class="GtkCheckButton" id="print_page_url_checkbutton"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">E_xecutive</property> + <property name="label" translatable="yes">Page a_ddress</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> <property name="active">False</property> <property name="inconsistent">False</property> <property name="draw_indicator">True</property> - <property name="group">A4_radiobutton</property> </widget> <packing> <property name="padding">0</property> @@ -698,22 +616,25 @@ </child> </widget> <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> </packing> </child> <child> - <widget class="GtkVBox" id="vbox133"> + <widget class="GtkVBox" id="vbox140"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">6</property> <child> - <widget class="GtkLabel" id="label258"> + <widget class="GtkLabel" id="label269"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Orientation</b></property> + <property name="label" translatable="yes"><b>Footers</b></property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -732,13 +653,13 @@ </child> <child> - <widget class="GtkHBox" id="hbox74"> + <widget class="GtkHBox" id="hbox77"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">0</property> <child> - <widget class="GtkLabel" id="label260"> + <widget class="GtkLabel" id="label270"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> <property name="use_underline">False</property> @@ -759,18 +680,19 @@ </child> <child> - <widget class="GtkVBox" id="vbox135"> + <widget class="GtkVBox" id="vbox125"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">6</property> <child> - <widget class="GtkRadioButton" id="orient_p_radiobutton"> + <widget class="GtkCheckButton" id="print_page_numbers_checkbutton"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">P_ortrait</property> + <property name="label" translatable="yes">Page _numbers</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> <property name="active">False</property> <property name="inconsistent">False</property> <property name="draw_indicator">True</property> @@ -783,16 +705,16 @@ </child> <child> - <widget class="GtkRadioButton" id="orient_l_radiobutton"> + <widget class="GtkCheckButton" id="print_date_checkbutton"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Lan_dscape</property> + <property name="label" translatable="yes">_Date</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> <property name="active">False</property> <property name="inconsistent">False</property> <property name="draw_indicator">True</property> - <property name="group">orient_p_radiobutton</property> </widget> <packing> <property name="padding">0</property> @@ -810,15 +732,18 @@ </widget> <packing> <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> + <property name="expand">False</property> + <property name="fill">False</property> </packing> </child> </widget> <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> </packing> </child> </widget> @@ -829,9 +754,9 @@ </child> <child> - <widget class="GtkLabel" id="label250"> + <widget class="GtkLabel" id="label284"> <property name="visible">True</property> - <property name="label" translatable="yes">Paper</property> + <property name="label" translatable="yes">Appearance</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -848,25 +773,22 @@ </child> <child> - <widget class="GtkTable" id="table50"> + <widget class="GtkVBox" id="vbox147"> <property name="border_width">12</property> <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> <property name="homogeneous">False</property> - <property name="row_spacing">18</property> - <property name="column_spacing">36</property> + <property name="spacing">18</property> <child> - <widget class="GtkVBox" id="vbox141"> + <widget class="GtkVBox" id="vbox148"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">6</property> <child> - <widget class="GtkLabel" id="label272"> + <widget class="GtkLabel" id="label285"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Colors</b></property> + <property name="label" translatable="yes"><b>Size</b></property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -885,13 +807,13 @@ </child> <child> - <widget class="GtkHBox" id="hbox80"> + <widget class="GtkHBox" id="hbox90"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">0</property> <child> - <widget class="GtkLabel" id="label273"> + <widget class="GtkLabel" id="label286"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> <property name="use_underline">False</property> @@ -912,19 +834,20 @@ </child> <child> - <widget class="GtkVBox" id="vbox142"> + <widget class="GtkVBox" id="vbox149"> <property name="visible">True</property> - <property name="homogeneous">False</property> + <property name="homogeneous">True</property> <property name="spacing">6</property> <child> - <widget class="GtkRadioButton" id="print_color_radiobutton"> + <widget class="GtkRadioButton" id="A4_radiobutton"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">C_olor</property> + <property name="label" translatable="yes">A_4</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> + <property name="focus_on_click">True</property> + <property name="active">True</property> <property name="inconsistent">False</property> <property name="draw_indicator">True</property> </widget> @@ -936,16 +859,17 @@ </child> <child> - <widget class="GtkRadioButton" id="print_grayscale_radiobutton"> + <widget class="GtkRadioButton" id="radiobutton7"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">_Grayscale</property> + <property name="label" translatable="yes">_Letter</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> <property name="active">False</property> <property name="inconsistent">False</property> <property name="draw_indicator">True</property> - <property name="group">print_color_radiobutton</property> + <property name="group">A4_radiobutton</property> </widget> <packing> <property name="padding">0</property> @@ -955,37 +879,42 @@ </child> <child> - <widget class="GtkHBox" id="hbox86"> + <widget class="GtkRadioButton" id="radiobutton8"> <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">L_egal</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">A4_radiobutton</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> - <child> - <widget class="GtkLabel" id="label277"> - <property name="width_request">18</property> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> + <child> + <widget class="GtkRadioButton" id="radiobutton9"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">E_xecutive</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">A4_radiobutton</property> </widget> <packing> <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> + <property name="expand">False</property> + <property name="fill">False</property> </packing> </child> </widget> @@ -1004,25 +933,22 @@ </child> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> </packing> </child> <child> - <widget class="GtkVBox" id="vbox137"> + <widget class="GtkVBox" id="vbox150"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">6</property> <child> - <widget class="GtkLabel" id="label261"> + <widget class="GtkLabel" id="label287"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Margins (in mm)</b></property> + <property name="label" translatable="yes"><b>Orientation</b></property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -1041,13 +967,13 @@ </child> <child> - <widget class="GtkHBox" id="hbox78"> + <widget class="GtkHBox" id="hbox91"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">0</property> <child> - <widget class="GtkLabel" id="label271"> + <widget class="GtkLabel" id="label288"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> <property name="use_underline">False</property> @@ -1068,202 +994,54 @@ </child> <child> - <widget class="GtkTable" id="table48"> + <widget class="GtkVBox" id="vbox151"> <property name="visible">True</property> - <property name="n_rows">4</property> - <property name="n_columns">2</property> <property name="homogeneous">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> - - <child> - <widget class="GtkLabel" id="label238"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Bottom:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">bottom_spinbutton</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label239"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Left:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">left_spinbutton</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label240"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Right:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">right_spinbutton</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label237"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Top:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">top_spinbutton</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkSpinButton" id="bottom_spinbutton"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">True</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">10 0 100 1 10 10</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkSpinButton" id="left_spinbutton"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">True</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">10 0 100 1 10 10</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options"></property> - </packing> - </child> + <property name="spacing">6</property> <child> - <widget class="GtkSpinButton" id="top_spinbutton"> + <widget class="GtkRadioButton" id="orient_p_radiobutton"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">True</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">10 0 100 1 10 10</property> + <property name="label" translatable="yes">P_ortrait</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> </packing> </child> <child> - <widget class="GtkSpinButton" id="right_spinbutton"> + <widget class="GtkRadioButton" id="radiobutton11"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">True</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">10 0 100 1 10 10</property> + <property name="label" translatable="yes">Lan_dscape</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">orient_p_radiobutton</property> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="y_options"></property> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> </packing> </child> </widget> <packing> <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> + <property name="expand">True</property> + <property name="fill">True</property> </packing> </child> </widget> @@ -1275,25 +1053,132 @@ </child> </widget> <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> </packing> </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label289"> + <property name="visible">True</property> + <property name="label" translatable="yes">Paper</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + +<widget class="GtkDialog" id="print_dialog"> + <property name="border_width">5</property> + <property name="title" translatable="yes">Print</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="has_separator">False</property> + <signal name="response" handler="ephy_print_dialog_response_cb" last_modification_time="Sat, 06 Dec 2003 10:24:34 GMT"/> + + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox9"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="hbuttonbox1"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + + <child> + <widget class="GtkButton" id="button2"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-6</property> + </widget> + </child> + + <child> + <widget class="GtkButton" id="button3"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-print</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-5</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox143"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkVBox" id="vbox144"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">18</property> <child> - <widget class="GtkVBox" id="vbox138"> + <widget class="GtkVBox" id="vbox145"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">6</property> <child> - <widget class="GtkLabel" id="label267"> + <widget class="GtkLabel" id="label278"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Headers</b></property> + <property name="label" translatable="yes"><b>Print To</b></property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -1312,13 +1197,13 @@ </child> <child> - <widget class="GtkHBox" id="hbox76"> + <widget class="GtkHBox" id="hbox87"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">0</property> <child> - <widget class="GtkLabel" id="label268"> + <widget class="GtkLabel" id="label279"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> <property name="use_underline">False</property> @@ -1339,44 +1224,129 @@ </child> <child> - <widget class="GtkVBox" id="vbox124"> + <widget class="GtkTable" id="table51"> <property name="visible">True</property> + <property name="n_rows">2</property> + <property name="n_columns">2</property> <property name="homogeneous">False</property> - <property name="spacing">6</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> <child> - <widget class="GtkCheckButton" id="print_page_title_checkbutton"> + <widget class="GtkRadioButton" id="printer_radiobutton"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">P_age title</property> + <property name="label" translatable="yes">P_rinter:</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> <property name="active">False</property> <property name="inconsistent">False</property> <property name="draw_indicator">True</property> </widget> <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkCheckButton" id="print_page_url_checkbutton"> + <widget class="GtkRadioButton" id="radiobutton2"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Page a_ddress</property> + <property name="label" translatable="yes">_File:</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> <property name="active">False</property> <property name="inconsistent">False</property> <property name="draw_indicator">True</property> + <property name="group">printer_radiobutton</property> </widget> <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="printer_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes">lpr</property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox92"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkEntry" id="file_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="browse_button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">_Browse...</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="ephy_print_dialog_browse_button_cb" last_modification_time="Sat, 06 Dec 2003 14:17:08 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> </packing> </child> </widget> @@ -1395,25 +1365,22 @@ </child> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> </packing> </child> <child> - <widget class="GtkVBox" id="vbox140"> + <widget class="GtkVBox" id="vbox146"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">6</property> <child> - <widget class="GtkLabel" id="label269"> + <widget class="GtkLabel" id="label280"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Footers</b></property> + <property name="label" translatable="yes"><b>Page Range</b></property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -1432,13 +1399,13 @@ </child> <child> - <widget class="GtkHBox" id="hbox77"> + <widget class="GtkHBox" id="hbox88"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">0</property> <child> - <widget class="GtkLabel" id="label270"> + <widget class="GtkLabel" id="label281"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> <property name="use_underline">False</property> @@ -1459,44 +1426,176 @@ </child> <child> - <widget class="GtkVBox" id="vbox125"> + <widget class="GtkTable" id="table52"> <property name="visible">True</property> + <property name="n_rows">3</property> + <property name="n_columns">2</property> <property name="homogeneous">False</property> - <property name="spacing">6</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> <child> - <widget class="GtkCheckButton" id="print_page_numbers_checkbutton"> + <widget class="GtkRadioButton" id="all_pages_radiobutton"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Page _numbers</property> + <property name="label" translatable="yes">_All pages</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> <property name="active">False</property> <property name="inconsistent">False</property> <property name="draw_indicator">True</property> </widget> <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkCheckButton" id="print_date_checkbutton"> + <widget class="GtkRadioButton" id="page_range_radiobutton"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">_Date</property> + <property name="label" translatable="yes">Pa_ges</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> <property name="active">False</property> <property name="inconsistent">False</property> <property name="draw_indicator">True</property> + <property name="group">all_pages_radiobutton</property> </widget> <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox89"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">12</property> + + <child> + <widget class="GtkLabel" id="label282"> + <property name="visible">True</property> + <property name="label" translatable="yes">fr_om:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">from_spinbutton</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="from_spinbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">1 1 9999 1 10 10</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label283"> + <property name="visible">True</property> + <property name="label" translatable="yes">_to:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">to_spinbutton</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="to_spinbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">1 1 9999 1 10 10</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="selection_radiobutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">_Selection</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">all_pages_radiobutton</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> </packing> </child> </widget> @@ -1509,43 +1608,22 @@ </widget> <packing> <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> + <property name="expand">True</property> + <property name="fill">True</property> </packing> </child> </widget> <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> </packing> </child> </widget> <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label276"> - <property name="visible">True</property> - <property name="label" translatable="yes">Appearance</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> </packing> </child> </widget> diff --git a/data/ui/epiphany-ui.xml b/data/ui/epiphany-ui.xml index 60f9de706..6fd3f4ee1 100644 --- a/data/ui/epiphany-ui.xml +++ b/data/ui/epiphany-ui.xml @@ -7,6 +7,8 @@ <separator name="FileSep1"/> <menuitem name="FileSaveAsMenu" action="FileSaveAs"/> <separator name="FileSep2"/> + <menuitem name="FilePrintSetupMenu" action="FilePrintSetup"/> + <menuitem name="FilePrintPreviewMenu" action="FilePrintPreview"/> <menuitem name="FilePrintMenu" action="FilePrint"/> <menuitem name="FileSendToMenu" action="FileSendTo"/> <separator name="FileSep3"/> diff --git a/embed/mozilla/PrintingPromptService.cpp b/embed/mozilla/PrintingPromptService.cpp index cab6b9b22..3a2bd63ae 100644 --- a/embed/mozilla/PrintingPromptService.cpp +++ b/embed/mozilla/PrintingPromptService.cpp @@ -26,6 +26,7 @@ #include "print-dialog.h" #include "ephy-embed.h" +#include "ephy-command-manager.h" #include "MozillaPrivate.h" #include "PrintingPromptService.h" @@ -49,27 +50,37 @@ GPrintingPromptService::~GPrintingPromptService() NS_IMETHODIMP GPrintingPromptService::ShowPrintDialog(nsIDOMWindow *parent, nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings) { EphyDialog *dialog; - EmbedPrintInfo *info; - nsresult rv = NS_OK; + nsresult rv = NS_ERROR_ABORT; GtkWidget *gtkParent = MozillaFindGtkParent(parent); + if (!gtkParent) return NS_ERROR_ABORT; + EphyEmbed *embed = EPHY_EMBED (MozillaFindEmbed (parent)); + if (!embed) return NS_ERROR_ABORT; - dialog = print_dialog_new_with_parent (gtkParent, embed, &info); + dialog = ephy_print_dialog_new (gtkParent, embed, TRUE); ephy_dialog_set_modal (dialog, TRUE); - gint ret = ephy_dialog_run (dialog); - if(ret == GTK_RESPONSE_OK) + int ret = ephy_dialog_run (dialog); + if (ret == GTK_RESPONSE_OK) { - MozillaCollatePrintSettings(info, printSettings); - print_free_info(info); + EmbedPrintInfo *info; + + info = ephy_print_get_print_info (); + + /* work around mozilla bug which borks when printing selection without having one */ + if (info->pages == 2 && ephy_command_manager_can_do_command + (EPHY_COMMAND_MANAGER (embed), "cmd_copy") == FALSE) + { + info->pages = 0; + } + + MozillaCollatePrintSettings (info, printSettings); + + ephy_print_info_free (info); rv = NS_OK; } - else - { - rv = NS_ERROR_ABORT; - } g_object_unref (dialog); diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index c031664af..297b64747 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -703,7 +703,14 @@ impl_print (EphyEmbed *embed, nsCOMPtr<nsIPrintSettings> options; result = mpriv->browser->GetPrintSettings(getter_AddRefs(options)); - if (!NS_SUCCEEDED (result)) return; + if (NS_FAILED (result) || !options) return; + + /* work around mozilla bug which borks when printing selection without having one */ + if (info->pages == 2 && ephy_command_manager_can_do_command + (EPHY_COMMAND_MANAGER (embed), "cmd_copy") == FALSE) + { + info->pages = 0; + } MozillaCollatePrintSettings(info, options); diff --git a/embed/print-dialog.c b/embed/print-dialog.c index e09b1a6c9..fed912b78 100755 --- a/embed/print-dialog.c +++ b/embed/print-dialog.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2002 Jorn Baayen + * Copyright (C) 2003 Christian Persch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,53 +20,37 @@ */ #include "print-dialog.h" +#include "ephy-embed-dialog.h" +#include "ephy-file-chooser.h" +#include "eel-gconf-extensions.h" +#include "ephy-debug.h" -#include "ephy-command-manager.h" -#include "ephy-prefs.h" - -#include <gtk/gtktogglebutton.h> +#include <gtk/gtkwindow.h> #include <gtk/gtkdialog.h> +#include <gtk/gtkentry.h> #include <gtk/gtkstock.h> #include <libgnomevfs/gnome-vfs-utils.h> - -#define CONF_PRINT_BOTTOM_MARGIN "/apps/epiphany/dialogs/print_bottom_margin" -#define CONF_PRINT_TOP_MARGIN "/apps/epiphany/dialogs/print_top_margin" -#define CONF_PRINT_LEFT_MARGIN "/apps/epiphany/dialogs/print_left_margin" -#define CONF_PRINT_RIGHT_MARGIN "/apps/epiphany/dialogs/print_right_margin" -#define CONF_PRINT_PAGE_TITLE "/apps/epiphany/dialogs/print_page_title" -#define CONF_PRINT_PAGE_URL "/apps/epiphany/dialogs/print_page_url" -#define CONF_PRINT_DATE "/apps/epiphany/dialogs/print_date" -#define CONF_PRINT_PAGE_NUMBERS "/apps/epiphany/dialogs/print_page_numbers" -#define CONF_PRINT_PRINTER "/apps/epiphany/dialogs/print_printer" -#define CONF_PRINT_FILE "/apps/epiphany/dialogs/print_file" -#define CONF_PRINT_PRINTON "/apps/epiphany/dialogs/print_on" -#define CONF_PRINT_PAPER "/apps/epiphany/dialogs/print_paper" -#define CONF_PRINT_ALL_PAGES "/apps/epiphany/dialogs/print_all_pages" -#define CONF_PRINT_COLOR "/apps/epiphany/dialogs/print_color" -#define CONF_PRINT_ORIENTATION "/apps/epiphany/dialogs/print_orientation" - -static void print_dialog_class_init (PrintDialogClass *klass); -static void print_dialog_init (PrintDialog *dialog); - -/* Glade callbacks */ -void -print_cancel_button_cb (GtkWidget *widget, - EphyDialog *dialog); -void -print_ok_button_cb (GtkWidget *widget, - EphyDialog *dialog); -void -print_preview_button_cb (GtkWidget *widget, - EphyDialog *dialog); - -static GObjectClass *parent_class = NULL; - -#define EPHY_PRINT_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_PRINT_DIALOG, PrintDialogPrivate)) - -struct PrintDialogPrivate -{ - GtkWidget *window; -}; +#include <glib/gi18n.h> + +#define CONF_PRINT_PRINTER "/apps/epiphany/dialogs/print_printer" +#define CONF_PRINT_FILE "/apps/epiphany/dialogs/print_file" +#define CONF_PRINT_DIR "/apps/epiphany/directories/print_to_file" +#define CONF_PRINT_PRINTON "/apps/epiphany/dialogs/print_on" +#define CONF_PRINT_ALL_PAGES "/apps/epiphany/dialogs/print_all_pages" +#define CONF_PRINT_FROM_PAGE "/apps/epiphany/dialogs/print_from_page" +#define CONF_PRINT_TO_PAGE "/apps/epiphany/dialogs/print_to_page" + +#define CONF_PRINT_BOTTOM_MARGIN "/apps/epiphany/dialogs/print_bottom_margin" +#define CONF_PRINT_TOP_MARGIN "/apps/epiphany/dialogs/print_top_margin" +#define CONF_PRINT_LEFT_MARGIN "/apps/epiphany/dialogs/print_left_margin" +#define CONF_PRINT_RIGHT_MARGIN "/apps/epiphany/dialogs/print_right_margin" +#define CONF_PRINT_PAGE_TITLE "/apps/epiphany/dialogs/print_page_title" +#define CONF_PRINT_PAGE_URL "/apps/epiphany/dialogs/print_page_url" +#define CONF_PRINT_DATE "/apps/epiphany/dialogs/print_date" +#define CONF_PRINT_PAGE_NUMBERS "/apps/epiphany/dialogs/print_page_numbers" +#define CONF_PRINT_PAPER "/apps/epiphany/dialogs/print_paper" +#define CONF_PRINT_COLOR "/apps/epiphany/dialogs/print_color" +#define CONF_PRINT_ORIENTATION "/apps/epiphany/dialogs/print_orientation" enum { @@ -73,6 +58,30 @@ enum PRINTON_PROP, PRINTER_PROP, FILE_PROP, + ALL_PAGES_PROP, + SELECTION_PROP, + TO_PROP, + FROM_PROP +}; + +static const +EphyDialogProperty print_props [] = +{ + { "print_dialog", NULL, PT_NORMAL, 0 }, + { "printer_radiobutton", CONF_PRINT_PRINTON, PT_AUTOAPPLY, 0 }, + { "printer_entry", CONF_PRINT_PRINTER, PT_AUTOAPPLY, 0 }, + { "file_entry", CONF_PRINT_FILE, PT_AUTOAPPLY, 0 }, + { "all_pages_radiobutton", CONF_PRINT_ALL_PAGES, PT_AUTOAPPLY, 0 }, + { "selection_radiobutton", NULL, PT_NORMAL, 0 }, + { "to_spinbutton", CONF_PRINT_FROM_PAGE, PT_AUTOAPPLY, G_TYPE_INT }, + { "from_spinbutton", CONF_PRINT_TO_PAGE, PT_AUTOAPPLY, G_TYPE_INT }, + + { NULL } +}; + +enum +{ + SETUP_WINDOW_PROP, PAPER_PROP, TOP_PROP, BOTTOM_PROP, @@ -82,44 +91,25 @@ enum PAGE_URL_PROP, PAGE_NUMBERS_PROP, DATE_PROP, - ALL_PAGES_PROP, - TO_PROP, - FROM_PROP, COLOR_PROP, ORIENTATION_PROP, - PREVIEW_PROP, - SELECTION_PROP -}; - -enum -{ - PREVIEW, - LAST_SIGNAL }; static const -EphyDialogProperty properties [] = +EphyDialogProperty setup_props [] = { - { "print_dialog", NULL, PT_NORMAL, 0 }, - { "printer_radiobutton", CONF_PRINT_PRINTON, PT_NORMAL, 0 }, - { "printer_entry", CONF_PRINT_PRINTER, PT_NORMAL, 0 }, - { "file_entry", CONF_PRINT_FILE, PT_NORMAL, 0 }, - { "A4_radiobutton", CONF_PRINT_PAPER, PT_NORMAL, G_TYPE_STRING }, - { "top_spinbutton", CONF_PRINT_TOP_MARGIN, PT_NORMAL, 0 }, - { "bottom_spinbutton", CONF_PRINT_BOTTOM_MARGIN, PT_NORMAL, 0 }, - { "left_spinbutton", CONF_PRINT_LEFT_MARGIN, PT_NORMAL, 0 }, - { "right_spinbutton", CONF_PRINT_RIGHT_MARGIN, PT_NORMAL, 0 }, - { "print_page_title_checkbutton", CONF_PRINT_PAGE_TITLE, PT_NORMAL, 0 }, - { "print_page_url_checkbutton", CONF_PRINT_PAGE_URL, PT_NORMAL, 0 }, - { "print_page_numbers_checkbutton", CONF_PRINT_PAGE_NUMBERS, PT_NORMAL, 0 }, - { "print_date_checkbutton", CONF_PRINT_DATE, PT_NORMAL, 0 }, - { "all_pages_radiobutton", CONF_PRINT_ALL_PAGES, PT_NORMAL, 0 }, - { "to_spinbutton", NULL, PT_NORMAL, 0 }, - { "from_spinbutton", NULL, PT_NORMAL, 0 }, - { "print_color_radiobutton", CONF_PRINT_COLOR, PT_NORMAL, 0 }, - { "orient_p_radiobutton", CONF_PRINT_ORIENTATION, PT_NORMAL, 0 }, - { "preview_button", NULL, PT_NORMAL, 0 }, - { "selection_radiobutton", NULL, PT_NORMAL, 0 }, + { "print_setup_dialog", NULL, PT_NORMAL, 0 }, + { "A4_radiobutton", CONF_PRINT_PAPER, PT_AUTOAPPLY, G_TYPE_STRING }, + { "top_spinbutton", CONF_PRINT_TOP_MARGIN, PT_AUTOAPPLY, G_TYPE_INT }, + { "bottom_spinbutton", CONF_PRINT_BOTTOM_MARGIN, PT_AUTOAPPLY, G_TYPE_INT }, + { "left_spinbutton", CONF_PRINT_LEFT_MARGIN, PT_AUTOAPPLY, G_TYPE_INT }, + { "right_spinbutton", CONF_PRINT_RIGHT_MARGIN, PT_AUTOAPPLY, G_TYPE_INT }, + { "print_page_title_checkbutton", CONF_PRINT_PAGE_TITLE, PT_AUTOAPPLY, 0 }, + { "print_page_url_checkbutton", CONF_PRINT_PAGE_URL, PT_AUTOAPPLY, 0 }, + { "print_page_numbers_checkbutton", CONF_PRINT_PAGE_NUMBERS, PT_AUTOAPPLY, 0 }, + { "print_date_checkbutton", CONF_PRINT_DATE, PT_AUTOAPPLY, 0 }, + { "print_color_radiobutton", CONF_PRINT_COLOR, PT_AUTOAPPLY, 0 }, + { "orient_p_radiobutton", CONF_PRINT_ORIENTATION, PT_AUTOAPPLY, 0 }, { NULL } }; @@ -131,169 +121,19 @@ char *paper_format_enum [] = }; static guint n_paper_format_enum = G_N_ELEMENTS (paper_format_enum); -static guint print_dialog_signals[LAST_SIGNAL] = { 0 }; - -GType -print_dialog_get_type (void) -{ - static GType print_dialog_type = 0; - - if (print_dialog_type == 0) - { - static const GTypeInfo our_info = - { - sizeof (PrintDialogClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) print_dialog_class_init, - NULL, - NULL, /* class_data */ - sizeof (PrintDialog), - 0, /* n_preallocs */ - (GInstanceInitFunc) print_dialog_init - }; - - print_dialog_type = g_type_register_static (EPHY_TYPE_EMBED_DIALOG, - "PrintDialog", - &our_info, 0); - } - - return print_dialog_type; - -} - -static void -impl_show (EphyDialog *dialog) -{ - PrintDialog *print_dialog = EPHY_PRINT_DIALOG (dialog); - EphyEmbed *embed = ephy_embed_dialog_get_embed (EPHY_EMBED_DIALOG (dialog)); - - EPHY_DIALOG_CLASS (parent_class)->show (dialog); - - if (print_dialog->only_collect_info) - { - GtkWidget *button; - - /* disappear preview button */ - button = ephy_dialog_get_control (EPHY_DIALOG (dialog), - properties[PREVIEW_PROP].id); - gtk_widget_hide (button); - } - - if (ephy_command_manager_can_do_command - (EPHY_COMMAND_MANAGER (embed), "cmd_copy") == FALSE) - { - GtkWidget *widget; - - /* Make selection button disabled */ - widget = ephy_dialog_get_control (EPHY_DIALOG (dialog), - properties[SELECTION_PROP].id); - - gtk_widget_set_sensitive (widget, FALSE); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) - { - GtkWidget *all_pages; - all_pages = ephy_dialog_get_control (EPHY_DIALOG (dialog), - properties[ALL_PAGES_PROP].id); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (all_pages), TRUE); - } - } -} - -static void -print_dialog_class_init (PrintDialogClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - EphyDialogClass *dialog_class = EPHY_DIALOG_CLASS (klass); - - parent_class = g_type_class_peek_parent (klass); - - dialog_class->show = impl_show; - - print_dialog_signals[PREVIEW] = - g_signal_new ("preview", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (PrintDialogClass, preview), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - g_type_class_add_private (object_class, sizeof(PrintDialogPrivate)); -} - -static void -print_dialog_init (PrintDialog *dialog) -{ - GdkPixbuf *icon; - dialog->priv = EPHY_PRINT_DIALOG_GET_PRIVATE (dialog); - - dialog->only_collect_info = FALSE; - dialog->ret_info = NULL; - - ephy_dialog_construct (EPHY_DIALOG(dialog), - properties, - "print.glade", "print_dialog"); - - dialog->priv->window = ephy_dialog_get_control (EPHY_DIALOG(dialog), - properties[WINDOW_PROP].id); - - ephy_dialog_add_enum (EPHY_DIALOG (dialog), properties[PAPER_PROP].id, - n_paper_format_enum, paper_format_enum); - - icon = gtk_widget_render_icon (dialog->priv->window, - GTK_STOCK_PRINT, - GTK_ICON_SIZE_MENU, - "print_dialog"); - gtk_window_set_icon (GTK_WINDOW(dialog->priv->window), icon); - g_object_unref (icon); -} - -EphyDialog * -print_dialog_new (EphyEmbed *embed, - EmbedPrintInfo **ret_info) -{ - PrintDialog *dialog; - - dialog = EPHY_PRINT_DIALOG (g_object_new (EPHY_TYPE_PRINT_DIALOG, - "embed", embed, - NULL)); - - if (ret_info != NULL) - { - dialog->only_collect_info = TRUE; - dialog->ret_info = ret_info; - } - - return EPHY_DIALOG(dialog); -} - -EphyDialog * -print_dialog_new_with_parent (GtkWidget *window, - EphyEmbed *embed, - EmbedPrintInfo **ret_info) -{ - PrintDialog *dialog; - - dialog = EPHY_PRINT_DIALOG (g_object_new (EPHY_TYPE_PRINT_DIALOG, - "embed", embed, - "parent-window", window, - NULL)); - - if (ret_info != NULL) - { - dialog->only_collect_info = TRUE; - dialog->ret_info = ret_info; - } - - return EPHY_DIALOG(dialog); -} +void ephy_print_dialog_response_cb (GtkWidget *widget, + int response, + EphyDialog *dialog); +void ephy_print_dialog_browse_button_cb (GtkWidget *widget, + EphyDialog *dialog); +void ephy_print_setup_dialog_close_button_cb (GtkWidget *widget, + EphyDialog *dialog); void -print_free_info (EmbedPrintInfo *info) +ephy_print_info_free (EmbedPrintInfo *info) { + g_return_if_fail (info != NULL); + g_free (info->printer); g_free (info->file); g_free (info->paper); @@ -306,196 +146,208 @@ print_free_info (EmbedPrintInfo *info) g_free (info); } -static EmbedPrintInfo * -print_get_info (EphyDialog *dialog) +EmbedPrintInfo * +ephy_print_get_print_info (void) { EmbedPrintInfo *info; - GValue print_to_file = {0, }; - GValue printer = {0, }; - GValue file = {0, }; - GValue top_margin = {0, }; - GValue bottom_margin = {0, }; - GValue left_margin = {0, }; - GValue right_margin = {0, }; - GValue from_page = {0, }; - GValue to_page = {0, }; - GValue paper = {0, }; - GValue pages = {0, }; - GValue print_color = {0, }; - GValue orientation = {0, }; - GValue page_title = {0, }; - GValue page_url = {0, }; - GValue date = {0, }; - GValue page_numbers = {0, }; - const char *filename; + char *filename; info = g_new0 (EmbedPrintInfo, 1); - ephy_dialog_get_value (dialog, properties[PRINTON_PROP].id, &print_to_file); - info->print_to_file = g_value_get_int (&print_to_file); - g_value_unset (&print_to_file); - - ephy_dialog_get_value (dialog, properties[PRINTER_PROP].id, &printer); - info->printer = g_strdup (g_value_get_string (&printer)); - g_value_unset (&printer); - - ephy_dialog_get_value (dialog, properties[FILE_PROP].id, &file); - filename = g_value_get_string (&file); + filename = eel_gconf_get_string (print_props[FILE_PROP].pref); if (filename != NULL) { - info->file = gnome_vfs_expand_initial_tilde (g_value_get_string (&file)); + char *expanded; + + expanded = gnome_vfs_expand_initial_tilde (filename); + info->file = g_filename_to_utf8 (expanded, -1, NULL, NULL, NULL); } else { info->file = NULL; } - g_value_unset (&file); - - ephy_dialog_get_value (dialog, properties[BOTTOM_PROP].id, &bottom_margin); - info->bottom_margin = g_value_get_float (&bottom_margin); - g_value_unset (&bottom_margin); - - ephy_dialog_get_value (dialog, properties[LEFT_PROP].id, &left_margin); - info->left_margin = g_value_get_float (&left_margin); - g_value_unset (&left_margin); - - ephy_dialog_get_value (dialog, properties[TOP_PROP].id, &top_margin); - info->top_margin = g_value_get_float (&top_margin); - g_value_unset (&top_margin); + g_free (filename); - ephy_dialog_get_value (dialog, properties[RIGHT_PROP].id, &right_margin); - info->right_margin = g_value_get_float (&right_margin); - g_value_unset (&right_margin); + info->print_to_file = eel_gconf_get_integer (print_props[PRINTON_PROP].pref) == 1; + info->printer = eel_gconf_get_string (print_props[PRINTER_PROP].pref); - ephy_dialog_get_value (dialog, properties[FROM_PROP].id, &from_page); - info->from_page = g_value_get_float (&from_page); - g_value_unset (&from_page); + info->pages = eel_gconf_get_integer (print_props[ALL_PAGES_PROP].pref); + info->from_page = eel_gconf_get_integer (print_props[FROM_PROP].pref); + info->to_page = eel_gconf_get_integer (print_props[TO_PROP].pref); - ephy_dialog_get_value (dialog, properties[TO_PROP].id, &to_page); - info->to_page = g_value_get_float (&to_page); - g_value_unset (&to_page); + info->paper = eel_gconf_get_string (setup_props[PAPER_PROP].pref); + info->orientation = eel_gconf_get_integer (setup_props[ORIENTATION_PROP].pref); + info->print_color = ! eel_gconf_get_integer (setup_props[COLOR_PROP].pref); - ephy_dialog_get_value (dialog, properties[PAPER_PROP].id, &paper); - info->paper = g_strdup (paper_format_enum[g_value_get_int (&paper)]); - g_value_unset (&paper); - - ephy_dialog_get_value (dialog, properties[ALL_PAGES_PROP].id, &pages); - info->pages = g_value_get_int (&pages); - g_value_unset (&pages); - - ephy_dialog_get_value (dialog, properties[COLOR_PROP].id, &print_color); - info->print_color = !g_value_get_int (&print_color); - g_value_unset (&print_color); - - ephy_dialog_get_value (dialog, properties[ORIENTATION_PROP].id, &orientation); - info->orientation = g_value_get_int (&orientation); - g_value_unset (&orientation); - - info->frame_type = 0; + info->bottom_margin = eel_gconf_get_integer (setup_props[BOTTOM_PROP].pref); + info->top_margin = eel_gconf_get_integer (setup_props[TOP_PROP].pref); + info->left_margin = eel_gconf_get_integer (setup_props[LEFT_PROP].pref); + info->right_margin = eel_gconf_get_integer (setup_props[RIGHT_PROP].pref); - ephy_dialog_get_value (dialog, properties[PAGE_TITLE_PROP].id, &page_title); - info->header_left_string = g_value_get_boolean (&page_title) ? + info->header_left_string = eel_gconf_get_boolean (setup_props[PAGE_TITLE_PROP].pref) ? g_strdup ("&T") : g_strdup (""); - g_value_unset (&page_title); - - ephy_dialog_get_value (dialog, properties[PAGE_URL_PROP].id, &page_url); - info->header_right_string = g_value_get_boolean (&page_url) ? + info->header_right_string = eel_gconf_get_boolean (setup_props[PAGE_URL_PROP].pref) ? g_strdup ("&U") : g_strdup (""); - g_value_unset (&page_url); - - ephy_dialog_get_value (dialog, properties[PAGE_NUMBERS_PROP].id, &page_numbers); - info->footer_left_string = g_value_get_boolean (&page_numbers) ? + info->footer_left_string = eel_gconf_get_boolean (setup_props[PAGE_NUMBERS_PROP].pref) ? g_strdup ("&PT") : g_strdup (""); - g_value_unset (&page_numbers); - - ephy_dialog_get_value (dialog, properties[DATE_PROP].id, &date); - info->footer_right_string = g_value_get_boolean (&date) ? + info->footer_right_string = eel_gconf_get_boolean (setup_props[DATE_PROP].pref) ? g_strdup ("&D") : g_strdup (""); - g_value_unset (&date); - info->header_center_string = g_strdup(""); info->footer_center_string = g_strdup(""); + info->frame_type = 0; + info->preview = FALSE; + return info; } -static void -print_dialog_print (EphyDialog *dialog) +void +ephy_print_dialog_response_cb (GtkWidget *widget, + int response, + EphyDialog *dialog) { - EmbedPrintInfo *info; EphyEmbed *embed; + EmbedPrintInfo *info; + gboolean only_collect_info; - info = print_get_info (dialog); + only_collect_info = GPOINTER_TO_INT + (g_object_get_data (G_OBJECT (dialog), "only-collect-info")); - if(EPHY_PRINT_DIALOG(dialog)->only_collect_info && EPHY_PRINT_DIALOG(dialog)->ret_info) + if (only_collect_info) { - *(EPHY_PRINT_DIALOG(dialog)->ret_info) = info; - - /* When in collect_info mode the caller owns the reference */ return; } - embed = ephy_embed_dialog_get_embed - (EPHY_EMBED_DIALOG(dialog)); - g_return_if_fail (embed != NULL); - - info->preview = FALSE; - ephy_embed_print (embed, info); - print_free_info (info); + if (response == GTK_RESPONSE_OK) + { + info = ephy_print_get_print_info (); + + embed = ephy_embed_dialog_get_embed (EPHY_EMBED_DIALOG (dialog)); + g_return_if_fail (EPHY_IS_EMBED (embed)); + + ephy_embed_print (embed, info); + + ephy_print_info_free (info); + } - g_object_unref (G_OBJECT(dialog)); + g_object_unref (dialog); } static void -print_dialog_preview (EphyDialog *dialog) +print_filechooser_response_cb (GtkDialog *fc, + int response, + EphyDialog *dialog) { - EmbedPrintInfo *info; - EphyEmbed *embed; - - /* Should not be called in collect_info mode */ - if(EPHY_PRINT_DIALOG(dialog)->only_collect_info && EPHY_PRINT_DIALOG(dialog)->ret_info) + if (response == EPHY_RESPONSE_SAVE) { - g_return_if_reached (); - } + char *filename; - info = print_get_info (dialog); + filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (fc)); + if (filename != NULL) + { + GtkWidget *entry; + char *converted; - embed = ephy_embed_dialog_get_embed - (EPHY_EMBED_DIALOG(dialog)); - g_return_if_fail (embed != NULL); + converted = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL); - info->preview = TRUE; - ephy_embed_print (embed, info); - print_free_info (info); + entry = ephy_dialog_get_control (dialog, print_props[FILE_PROP].id); + gtk_entry_set_text (GTK_ENTRY (entry), converted); - g_signal_emit (G_OBJECT (dialog), print_dialog_signals[PREVIEW], 0); + g_free (converted); + g_free (filename); + } + } - g_object_unref (G_OBJECT(dialog)); + gtk_widget_destroy (GTK_WIDGET (fc)); } void -print_cancel_button_cb (GtkWidget *widget, - EphyDialog *dialog) +ephy_print_dialog_browse_button_cb (GtkWidget *widget, + EphyDialog *dialog) { - if (EPHY_PRINT_DIALOG (dialog)->only_collect_info) - { - /* When in collect_info mode the caller owns the reference */ - return; - } + GtkWidget *parent; + EphyFileChooser *fc; + + parent = ephy_dialog_get_control (dialog, print_props[WINDOW_PROP].id); - g_object_unref (G_OBJECT(dialog)); + fc = ephy_file_chooser_new (_("Print to"), + GTK_WIDGET (parent), + GTK_FILE_CHOOSER_ACTION_SAVE, + CONF_PRINT_DIR); + + gtk_window_set_destroy_with_parent (GTK_WINDOW (fc), TRUE); + + g_signal_connect (GTK_DIALOG (fc), "response", + G_CALLBACK (print_filechooser_response_cb), + dialog); + + gtk_widget_show (GTK_WIDGET (fc)); } void -print_ok_button_cb (GtkWidget *widget, - EphyDialog *dialog) +ephy_print_setup_dialog_close_button_cb (GtkWidget *widget, + EphyDialog *dialog) { - print_dialog_print (dialog); + g_object_unref (dialog); } -void -print_preview_button_cb (GtkWidget *widget, - EphyDialog *dialog) +EphyDialog * +ephy_print_dialog_new (GtkWidget *parent, + EphyEmbed *embed, + gboolean only_collect_info) { - print_dialog_preview (dialog); + EphyDialog *dialog; + GtkWidget *window; + GdkPixbuf *icon; + + dialog = EPHY_DIALOG (g_object_new (EPHY_TYPE_EMBED_DIALOG, + "embed", embed, + NULL)); + + if (parent != NULL) + { + g_object_set (G_OBJECT (dialog), "parent-window", parent, NULL); + } + + ephy_dialog_construct (dialog, print_props, + "print.glade", "print_dialog"); + + window = ephy_dialog_get_control (dialog, print_props[WINDOW_PROP].id); + icon = gtk_widget_render_icon (window, + GTK_STOCK_PRINT, + GTK_ICON_SIZE_MENU, + "print_dialog"); + gtk_window_set_icon (GTK_WINDOW (window), icon); + g_object_unref (icon); + + g_object_set_data (G_OBJECT (dialog), "only-collect-info", + GINT_TO_POINTER (only_collect_info)); + + return dialog; +} + +EphyDialog * +ephy_print_setup_dialog_new (void) +{ + EphyDialog *dialog; + GtkWidget *window; + GdkPixbuf *icon; + + dialog = EPHY_DIALOG (g_object_new (EPHY_TYPE_DIALOG, NULL)); + + ephy_dialog_construct (dialog, setup_props, + "print.glade", "print_setup_dialog"); + + ephy_dialog_add_enum (dialog, setup_props[PAPER_PROP].id, + n_paper_format_enum, paper_format_enum); + + window = ephy_dialog_get_control (dialog, setup_props[SETUP_WINDOW_PROP].id); + icon = gtk_widget_render_icon (window, + GTK_STOCK_PROPERTIES, + GTK_ICON_SIZE_MENU, + "print_setup_dialog"); + gtk_window_set_icon (GTK_WINDOW (window), icon); + g_object_unref (icon); + + return dialog; } diff --git a/embed/print-dialog.h b/embed/print-dialog.h index 3ca150172..f7801d8f5 100644 --- a/embed/print-dialog.h +++ b/embed/print-dialog.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2002 Jorn Baayen + * Copyright (C) 2003 Christian Persch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,61 +19,28 @@ * $Id$ */ -#ifndef PRINT_DIALOG_H -#define PRINT_DIALOG_H +#ifndef EPHY_PRINT_DIALOG_H +#define EPHY_PRINT_DIALOG_H -#include "ephy-embed-dialog.h" +#include "ephy-dialog.h" #include "ephy-embed.h" #include <glib-object.h> #include <glib.h> +#include <gtk/gtkwidget.h> G_BEGIN_DECLS -#define EPHY_TYPE_PRINT_DIALOG (print_dialog_get_type ()) -#define EPHY_PRINT_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EPHY_TYPE_PRINT_DIALOG, PrintDialog)) -#define EPHY_PRINT_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EPHY_TYPE_PRINT_DIALOG, PrintDialogClass)) -#define EPHY_IS_PRINT_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EPHY_TYPE_PRINT_DIALOG)) -#define EPHY_IS_PRINT_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_PRINT_DIALOG)) -#define EPHY_PRINT_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EPHY_TYPE_PRINT_DIALOG, PrintDialogClass)) - -typedef struct PrintDialog PrintDialog; -typedef struct PrintDialogClass PrintDialogClass; -typedef struct PrintDialogPrivate PrintDialogPrivate; - -struct PrintDialog -{ - EphyEmbedDialog parent; - - /*< private >*/ - PrintDialogPrivate *priv; - - //FIXME: These should be gobject properties - gboolean only_collect_info; - EmbedPrintInfo **ret_info; -}; - -struct PrintDialogClass -{ - EphyEmbedDialogClass parent_class; - - void (* preview) (PrintDialog *dialog); -}; - -GType print_dialog_get_type (void); - -EphyDialog *print_dialog_new (EphyEmbed *embed, - EmbedPrintInfo **ret_info); - -EphyDialog *print_dialog_new_with_parent (GtkWidget *window, +EphyDialog *ephy_print_dialog_new (GtkWidget *parent, EphyEmbed *embed, - EmbedPrintInfo **ret_info); + gboolean only_collect_info); -gboolean print_dialog_is_preview (PrintDialog *dialog); +EphyDialog *ephy_print_setup_dialog_new (void); -void print_free_info (EmbedPrintInfo *info); +EmbedPrintInfo *ephy_print_get_print_info (void); + +void ephy_print_info_free (EmbedPrintInfo *info); G_END_DECLS #endif - diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c index 0c5aa4024..60a8d3fa0 100644 --- a/lib/ephy-dialog.c +++ b/lib/ephy-dialog.c @@ -59,6 +59,7 @@ typedef enum typedef struct { const char *id; + EphyDialog *dialog; char *pref; EphyDialogApplyType apply_type; GtkWidget *widget; @@ -87,6 +88,14 @@ struct EphyDialogPrivate #define SPIN_DELAY 0.20 +enum +{ + CHANGED, + LAST_SIGNAL +}; + +static guint signals [LAST_SIGNAL] = { 0, }; + static void ephy_dialog_class_init (EphyDialogClass *klass); static void ephy_dialog_init (EphyDialog *window); @@ -151,40 +160,24 @@ set_sensitivity (PropertyInfo *info, gboolean sensitive) static void set_value_from_pref (PropertyInfo *info, GValue *value) { - GConfValue *gcvalue; - GConfValueType value_type; char *text; - gcvalue = eel_gconf_get_value (info->pref); - if (gcvalue == NULL) - { - /* ugly hack around what appears to be a gconf bug - * it returns a NULL GConfValue for a valid string pref - * which is "" by default */ - value_type = GCONF_VALUE_STRING; - } - else - { - value_type = gcvalue->type; - gconf_value_free (gcvalue); - } - - switch (value_type) + switch (info->data_type) { - case GCONF_VALUE_STRING: + case G_TYPE_STRING: g_value_init (value, G_TYPE_STRING); text = eel_gconf_get_string (info->pref); g_value_take_string (value, text ? text : g_strdup ("")); break; - case GCONF_VALUE_INT: + case G_TYPE_INT: g_value_init (value, G_TYPE_INT); g_value_set_int (value, eel_gconf_get_integer (info->pref)); break; - case GCONF_VALUE_FLOAT: + case G_TYPE_FLOAT: g_value_init (value, G_TYPE_FLOAT); g_value_set_float (value, eel_gconf_get_float (info->pref)); break; - case GCONF_VALUE_BOOL: + case G_TYPE_BOOLEAN: g_value_init (value, G_TYPE_BOOLEAN); g_value_set_boolean (value, eel_gconf_get_boolean (info->pref)); break; @@ -193,19 +186,19 @@ set_value_from_pref (PropertyInfo *info, GValue *value) break; } - if (!G_VALUE_HOLDS (value, info->data_type)) - { - g_warning ("Pref %s has wrong value type for id %s!\n", info->pref, info->id); - } - - LOG ("id[%s], pref[%s]: %s", info->id, info->pref, g_strdup_value_contents (value)) + LOG ("id[%s], pref[%s] = %s", info->id, info->pref, g_strdup_value_contents (value)) } static void set_pref_from_value (PropertyInfo *info, GValue *value) { const char *pref = info->pref; - g_return_if_fail (G_VALUE_HOLDS (value, info->data_type)); + + if (!G_VALUE_HOLDS (value, info->data_type)) + { + g_warning ("Value type mismatch for id[%s], pref[%s]", info->id, info->pref); + return; + } switch (info->data_type) { @@ -278,8 +271,6 @@ set_value_from_combobox (PropertyInfo *info, GValue *value) model = gtk_combo_box_get_model (GTK_COMBO_BOX (info->widget)); - g_return_if_fail (gtk_tree_model_get_column_type (model, info->data_col) == info->data_type); - if (gtk_tree_model_iter_nth_child (model, &iter, NULL, index)) { gtk_tree_model_get_value (model, &iter, info->data_col, value); @@ -544,8 +535,6 @@ set_combo_box_from_value (PropertyInfo *info, const GValue *value) model = gtk_combo_box_get_model (GTK_COMBO_BOX (info->widget)); - g_return_if_fail (gtk_tree_model_get_column_type (model, info->data_col) == info->data_type); - valid = gtk_tree_model_get_iter_first (model, &iter); while (valid) { @@ -582,6 +571,7 @@ set_combo_box_from_value (PropertyInfo *info, const GValue *value) info->sane_state = FALSE; g_return_if_fail (index >= 0); + return; } LOG ("index[%s] is %d", info->id, index) @@ -615,6 +605,7 @@ set_radiobuttongroup_from_value (PropertyInfo *info, const GValue *value) { info->sane_state = FALSE; g_return_if_fail (index >= 0 && index < length); + return; } button = GTK_TOGGLE_BUTTON (g_slist_nth_data (list, index)); @@ -708,30 +699,32 @@ set_info_from_value (PropertyInfo *info, const GValue *value) /* widget changed callbacks */ static void -set_pref_from_info (PropertyInfo *info) +set_pref_from_info_and_emit (PropertyInfo *info) { GValue value = { 0, }; - if (info->pref != NULL && info->sane_state) + if (!info->sane_state) { - set_value_from_info (info, &value); - set_pref_from_value (info, &value); - g_value_unset (&value); + g_warning ("Not emitting/persisting insane state of id[%s]", info->id); + return; } - if (info->pref != NULL && !info->sane_state) + set_value_from_info (info, &value); + + g_signal_emit (info->dialog, signals[CHANGED], g_quark_from_string (info->id), &value); + + if (info->apply_type == PT_AUTOAPPLY && info->pref != NULL) { - g_warning ("Not persisting insane state of id[%s] to pref %s!\n", info->id, info->pref); + set_pref_from_value (info, &value); } + + g_value_unset (&value); } static void togglebutton_clicked_cb (GtkWidget *widget, PropertyInfo *info) { - if (info->apply_type == PT_AUTOAPPLY) - { - set_pref_from_info (info); - } + set_pref_from_info_and_emit (info); } static void @@ -742,10 +735,7 @@ radiobutton_clicked_cb (GtkWidget *widget, PropertyInfo *info) return; } - if (info->apply_type == PT_AUTOAPPLY) - { - set_pref_from_info (info); - } + set_pref_from_info_and_emit (info); } static gboolean @@ -774,7 +764,7 @@ spinbutton_timeout_cb (PropertyInfo *info) * and set in the pref. Otherwise the old value is used */ gtk_spin_button_update (GTK_SPIN_BUTTON (info->widget)); - set_pref_from_info (info); + set_pref_from_info_and_emit (info); /* done, don't run again */ return FALSE; @@ -810,27 +800,7 @@ spinbutton_changed_cb (GtkWidget *widget, PropertyInfo *info) static void changed_cb (GtkWidget *widget, PropertyInfo *info) { - if (info->apply_type == PT_AUTOAPPLY) - { - set_pref_from_info (info); - } -} - -static void -set_info_from_pref (PropertyInfo *info) -{ - GValue value = { 0, }; - - g_return_if_fail (info->widget != NULL); - - if (info->pref != NULL) - { - set_value_from_pref (info, &value); - set_info_from_value (info, &value); - g_value_unset (&value); - - set_sensitivity (info, eel_gconf_key_is_writable (info->pref)); - } + set_pref_from_info_and_emit (info); } static void @@ -895,8 +865,9 @@ init_props (EphyDialog *dialog, const EphyDialogProperty *properties, GladeXML * for (i = 0 ; properties[i].id != NULL; i++) { PropertyInfo *info = g_new0 (PropertyInfo, 1); - + info->id = properties[i].id; + info->dialog = dialog; info->pref = g_strdup (properties[i].pref); info->apply_type = properties[i].apply_type; info->string_enum = NULL; @@ -950,7 +921,21 @@ init_props (EphyDialog *dialog, const EphyDialogProperty *properties, GladeXML * static void load_info (gpointer key, PropertyInfo *info, EphyDialog *dialog) { - set_info_from_pref (info); + GValue value = { 0, }; + + g_return_if_fail (info->widget != NULL); + + if (info->pref != NULL) + { + set_value_from_pref (info, &value); + set_info_from_value (info, &value); + + g_signal_emit (info->dialog, signals[CHANGED], g_quark_from_string (info->id), &value); + + g_value_unset (&value); + + set_sensitivity (info, eel_gconf_key_is_writable (info->pref)); + } info->loaded = TRUE; } @@ -958,10 +943,22 @@ load_info (gpointer key, PropertyInfo *info, EphyDialog *dialog) static void save_info (gpointer key, PropertyInfo *info, EphyDialog *dialog) { - if (info->apply_type == PT_NORMAL) + GValue value = { 0, }; + + if (info->pref == NULL || info->apply_type != PT_NORMAL) + { + return; + } + + if (!info->sane_state) { - set_pref_from_info (info); + g_warning ("Not persisting insane state of id[%s]", info->id); + return; } + + set_value_from_info (info, &value); + set_pref_from_value (info, &value); + g_value_unset (&value); } static void @@ -1029,7 +1026,7 @@ impl_show (EphyDialog *dialog) setup_default_size (dialog); - if (dialog->priv->parent) + if (dialog->priv->parent != NULL) { /* make the dialog transient again, because it seems to get * forgotten after gtk_widget_hide @@ -1111,32 +1108,38 @@ ephy_dialog_set_pref (EphyDialog *dialog, void ephy_dialog_set_size_group (EphyDialog *dialog, - const char **controls_id, - guint n_controls) + const char *first_id, + ...) { GtkSizeGroup *size_group; - int i; + va_list vl; size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); - for (i = 0; i < n_controls; i++) + va_start (vl, first_id); + + while (first_id != NULL) { PropertyInfo *info; - info = lookup_info (dialog, controls_id[i]); + info = lookup_info (dialog, first_id); g_return_if_fail (info != NULL); g_return_if_fail (info->widget != NULL); gtk_size_group_add_widget (size_group, info->widget); + + first_id = va_arg (vl, const char*); } + + va_end (vl); } void ephy_dialog_construct (EphyDialog *dialog, - const EphyDialogProperty *properties, - const char *file, - const char *name) + const EphyDialogProperty *properties, + const char *file, + const char *name) { EphyDialogClass *klass = EPHY_DIALOG_GET_CLASS (dialog); return klass->construct (dialog, properties, file, name); @@ -1149,11 +1152,50 @@ ephy_dialog_show (EphyDialog *dialog) klass->show (dialog); } +#if 0 +static void +run_response_cb (GtkWidget *dialog, + int response, + int *result) +{ + *result = response; + + gtk_grab_remove (dialog); + LOG ("run_response_cb: leaving gtk level %d", gtk_main_level()) + gtk_main_quit(); +} +#endif + int ephy_dialog_run (EphyDialog *dialog) { ephy_dialog_show (dialog); +#if 0 + if (dialog->priv->parent != NULL && dialog->priv->modal == FALSE) + { + GtkWindowGroup *group; + int response = 0; + + group = GTK_WINDOW (dialog->priv->parent)->group; + if (group == NULL) + { + group = gtk_window_group_new (); + gtk_window_group_add_window (group, GTK_WINDOW (dialog->priv->parent)); + g_object_unref (group); + } + + gtk_window_group_add_window (group, GTK_WINDOW (dialog->priv->dialog)); + g_signal_connect(dialog->priv->dialog, "response", + G_CALLBACK (run_response_cb), &response); + gtk_grab_add (dialog->priv->dialog); + LOG ("ephy_dialog_run before main(): level %d", gtk_main_level()) + gtk_main (); + LOG ("ephy_dialog_run after main(): level %d", gtk_main_level()) + + return response; + } +#endif return gtk_dialog_run (GTK_DIALOG (dialog->priv->dialog)); } @@ -1254,15 +1296,8 @@ static void ephy_dialog_set_parent (EphyDialog *dialog, GtkWidget *parent) { - g_return_if_fail (dialog->priv->parent == NULL); - g_return_if_fail (GTK_IS_WINDOW (parent)); - g_return_if_fail (GTK_IS_WINDOW (dialog->priv->dialog)); - dialog->priv->parent = parent; - gtk_window_set_transient_for (GTK_WINDOW (dialog->priv->dialog), - GTK_WINDOW (parent)); - g_object_notify (G_OBJECT (dialog), "parent-window"); } @@ -1318,6 +1353,17 @@ ephy_dialog_class_init (EphyDialogClass *klass) klass->construct = impl_construct; klass->show = impl_show; + signals[CHANGED] = + g_signal_new ("changed", + EPHY_TYPE_DIALOG, + G_SIGNAL_RUN_FIRST | G_SIGNAL_DETAILED, + G_STRUCT_OFFSET (EphyDialogClass, changed), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, + 1, + G_TYPE_POINTER); + g_object_class_install_property (object_class, PROP_PARENT_WINDOW, g_param_spec_object ("parent-window", @@ -1346,6 +1392,8 @@ ephy_dialog_new (void) EphyDialog * ephy_dialog_new_with_parent (GtkWidget *parent_window) { + g_return_val_if_fail (parent_window != NULL, NULL); + return EPHY_DIALOG (g_object_new (EPHY_TYPE_DIALOG, "parent-window", parent_window, NULL)); diff --git a/lib/ephy-dialog.h b/lib/ephy-dialog.h index a1ed97f1f..40c88f57c 100644 --- a/lib/ephy-dialog.h +++ b/lib/ephy-dialog.h @@ -57,11 +57,17 @@ struct EphyDialogClass { GObjectClass parent_class; - void (* construct) (EphyDialog *dialog, - const EphyDialogProperty *properties, - const char *file, - const char *name); - void (* show) (EphyDialog *dialog); + /* Signals */ + + void (* changed) (EphyDialog *dialog, + const GValue *value); + + /* Methods */ + void (* construct) (EphyDialog *dialog, + const EphyDialogProperty *properties, + const char *file, + const char *name); + void (* show) (EphyDialog *dialog); }; struct EphyDialog @@ -93,8 +99,8 @@ void ephy_dialog_set_data_column (EphyDialog *dialog, int col); void ephy_dialog_set_size_group (EphyDialog *dialog, - const char **controls_id, - guint n_controls); + const char *first_id, + ...); int ephy_dialog_run (EphyDialog *dialog); diff --git a/src/ephy-nautilus-view.c b/src/ephy-nautilus-view.c index 84351e0eb..191e9fccb 100644 --- a/src/ephy-nautilus-view.c +++ b/src/ephy-nautilus-view.c @@ -20,8 +20,10 @@ * $Id$ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include <config.h> #include <libgnome/gnome-macros.h> #include <bonobo/bonobo-zoomable.h> #include <bonobo/bonobo-ui-util.h> @@ -264,15 +266,10 @@ ephy_nautilus_view_instance_init (EphyNautilusView *view) bonobo_ui_component_add_verb_list_with_data (p->popup_ui, ephy_popup_verbs, p->popup); } -/** - * Returns a new EphyNautilusView as a BonoboObject - **/ BonoboObject * -ephy_nautilus_view_new_component (EphyShell *gs) +ephy_nautilus_view_new_component (EphyShell *shell) { - EphyNautilusView *view; - view = EPHY_NAUTILUS_VIEW (g_object_new (EPHY_TYPE_NAUTILUS_VIEW, NULL)); - return BONOBO_OBJECT (view); + return BONOBO_OBJECT (g_object_new (EPHY_TYPE_NAUTILUS_VIEW, NULL)); } static void @@ -545,11 +542,10 @@ gnv_cmd_file_print (BonoboUIComponent *uic, EphyDialog *dialog; EphyNautilusViewPrivate *p = view->priv; - dialog = print_dialog_new (p->embed, NULL); + dialog = ephy_print_dialog_new (NULL, p->embed, FALSE); ephy_dialog_set_modal (dialog, TRUE); ephy_dialog_show (dialog); - } static void diff --git a/src/ephy-nautilus-view.h b/src/ephy-nautilus-view.h index 0a9fa5637..c8139b931 100644 --- a/src/ephy-nautilus-view.h +++ b/src/ephy-nautilus-view.h @@ -33,9 +33,9 @@ G_BEGIN_DECLS #define EPHY_IS_NAUTILUS_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_NAUTILUS_VIEW)) #define EPHY_NAUTILUS_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EPHY_TYPE_NAUTILUS_VIEW, EphyNautilusViewClass)) -typedef struct EphyNautilusView EphyNautilusView; -typedef struct EphyNautilusViewClass EphyNautilusViewClass; -typedef struct EphyNautilusViewPrivate EphyNautilusViewPrivate; +typedef struct EphyNautilusView EphyNautilusView; +typedef struct EphyNautilusViewClass EphyNautilusViewClass; +typedef struct EphyNautilusViewPrivate EphyNautilusViewPrivate; struct EphyNautilusView { @@ -50,36 +50,9 @@ struct EphyNautilusViewClass NautilusViewClass parent_class; }; +GType ephy_nautilus_view_get_type (void); -GType ephy_nautilus_view_get_type (void); -BonoboObject * ephy_nautilus_view_new_component (EphyShell *gs); - -/* old public methods, probably all of them are going to be killed */ - -void -ephy_nautilus_view_set_title (EphyNautilusView *view, - const gchar *title); -void -ephy_nautilus_view_set_location (EphyNautilusView *view, - const gchar *uri); -void -ephy_nautilus_view_set_statusbar (EphyNautilusView *view, - const gchar *message); -void -ephy_nautilus_view_report_load_underway (EphyNautilusView *view); - -void -ephy_nautilus_view_report_load_complete (EphyNautilusView *view); - -void -ephy_nautilus_view_report_load_progress (EphyNautilusView *view, - double value); -void -ephy_nautilus_view_report_zoom (EphyNautilusView *view, - gint level); - -void ephy_nautilus_view_open_in_new_window (EphyNautilusView *view, - const gchar *url); +BonoboObject *ephy_nautilus_view_new_component (EphyShell *shell); G_END_DECLS diff --git a/src/ephy-shell.c b/src/ephy-shell.c index abe7fb5bc..12a23dbc8 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -41,6 +41,7 @@ #include "downloader-view.h" #include "ephy-toolbars-model.h" #include "ephy-automation.h" +#include "print-dialog.h" #include <string.h> #include <bonobo/bonobo-main.h> @@ -75,20 +76,18 @@ struct EphyShellPrivate GtkWidget *history_window; GObject *pdm_dialog; GObject *prefs_dialog; + GObject *print_setup_dialog; GList *del_on_exit; guint server_timeout; }; -static void -ephy_shell_class_init (EphyShellClass *klass); -static void -ephy_shell_init (EphyShell *gs); -static void -ephy_shell_finalize (GObject *object); +EphyShell *ephy_shell = NULL; -static GObjectClass *parent_class = NULL; +static void ephy_shell_class_init (EphyShellClass *klass); +static void ephy_shell_init (EphyShell *shell); +static void ephy_shell_finalize (GObject *object); -EphyShell *ephy_shell; +static GObjectClass *parent_class = NULL; GQuark ephy_shell_error_quark (void) @@ -106,63 +105,47 @@ ephy_shell_error_quark (void) GType ephy_shell_get_type (void) { - static GType ephy_shell_type = 0; - - if (ephy_shell_type == 0) - { - static const GTypeInfo our_info = - { - sizeof (EphyShellClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) ephy_shell_class_init, - NULL, - NULL, /* class_data */ - sizeof (EphyShell), - 0, /* n_preallocs */ - (GInstanceInitFunc) ephy_shell_init - }; - - ephy_shell_type = g_type_register_static (EPHY_TYPE_EMBED_SHELL, - "EphyShell", - &our_info, 0); - } - - return ephy_shell_type; + static GType type = 0; + if (type == 0) + { + static const GTypeInfo our_info = + { + sizeof (EphyShellClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) ephy_shell_class_init, + NULL, + NULL, /* class_data */ + sizeof (EphyShell), + 0, /* n_preallocs */ + (GInstanceInitFunc) ephy_shell_init + }; + + type = g_type_register_static (EPHY_TYPE_EMBED_SHELL, + "EphyShell", + &our_info, 0); + } + + return type; } static void ephy_shell_class_init (EphyShellClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); + parent_class = g_type_class_peek_parent (klass); - object_class->finalize = ephy_shell_finalize; + object_class->finalize = ephy_shell_finalize; g_type_class_add_private (object_class, sizeof(EphyShellPrivate)); } -#ifdef ENABLE_NAUTILUS_VIEW - -static BonoboObject * -ephy_nautilus_view_new (EphyShell *gs) -{ - EphyNautilusView *view; - - view = EPHY_NAUTILUS_VIEW - (ephy_nautilus_view_new_component (gs)); - - return BONOBO_OBJECT (view); -} - -#endif - static BonoboObject * ephy_automation_factory_cb (BonoboGenericFactory *this_factory, const char *iid, - EphyShell *es) + EphyShell *shell) { if (strcmp (iid, AUTOMATION_IID) == 0) { @@ -171,7 +154,7 @@ ephy_automation_factory_cb (BonoboGenericFactory *this_factory, #ifdef ENABLE_NAUTILUS_VIEW else if (strcmp (iid, EPHY_NAUTILUS_VIEW_IID) == 0) { - return ephy_nautilus_view_new (es); + return BONOBO_OBJECT (ephy_nautilus_view_new_component (shell)); } #endif @@ -180,9 +163,8 @@ ephy_automation_factory_cb (BonoboGenericFactory *this_factory, return NULL; } - static BonoboGenericFactory * -ephy_automation_factory_new (EphyShell *es) +ephy_automation_factory_new (EphyShell *shell) { BonoboGenericFactory *factory; GClosure *factory_closure; @@ -190,7 +172,7 @@ ephy_automation_factory_new (EphyShell *es) factory = g_object_new (bonobo_generic_factory_get_type (), NULL); factory_closure = g_cclosure_new - (G_CALLBACK (ephy_automation_factory_cb), es, NULL); + (G_CALLBACK (ephy_automation_factory_cb), shell, NULL); bonobo_generic_factory_construct_noreg (factory, AUTOMATION_FACTORY_IID, factory_closure); @@ -199,28 +181,31 @@ ephy_automation_factory_new (EphyShell *es) } static void -ephy_shell_init (EphyShell *gs) +ephy_shell_init (EphyShell *shell) { EphyShell **ptr = &ephy_shell; - gs->priv = EPHY_SHELL_GET_PRIVATE (gs); + shell->priv = EPHY_SHELL_GET_PRIVATE (shell); - gs->priv->session = NULL; - gs->priv->bookmarks = NULL; - gs->priv->bme = NULL; - gs->priv->history_window = NULL; - gs->priv->pdm_dialog = NULL; - gs->priv->toolbars_model = NULL; - gs->priv->fs_toolbars_model = NULL; - gs->priv->extensions_manager = NULL; - gs->priv->server_timeout = 0; + shell->priv->session = NULL; + shell->priv->bookmarks = NULL; + shell->priv->bme = NULL; + shell->priv->history_window = NULL; + shell->priv->pdm_dialog = NULL; + shell->priv->print_setup_dialog = NULL; + shell->priv->toolbars_model = NULL; + shell->priv->fs_toolbars_model = NULL; + shell->priv->extensions_manager = NULL; + shell->priv->server_timeout = 0; - ephy_shell = gs; + /* globally accessible singleton */ + g_assert (ephy_shell == NULL); + ephy_shell = shell; g_object_add_weak_pointer (G_OBJECT(ephy_shell), (gpointer *)ptr); /* Instantiate the automation factory */ - gs->priv->automation_factory = ephy_automation_factory_new (gs); + shell->priv->automation_factory = ephy_automation_factory_new (shell); } static char * @@ -271,9 +256,9 @@ open_urls (GNOME_EphyAutomation automation, } static gboolean -server_timeout (EphyShell *gs) +server_timeout (EphyShell *shell) { - g_object_unref (gs); + g_object_unref (shell); return FALSE; } @@ -343,7 +328,7 @@ gnome_session_init (EphyShell *shell) } gboolean -ephy_shell_startup (EphyShell *gs, +ephy_shell_startup (EphyShell *shell, EphyShellStartupFlags flags, const char **args, const char *string_arg, @@ -358,7 +343,7 @@ ephy_shell_startup (EphyShell *gs, CORBA_exception_init (&ev); result = bonobo_activation_register_active_server - (AUTOMATION_FACTORY_IID, BONOBO_OBJREF (gs->priv->automation_factory), NULL); + (AUTOMATION_FACTORY_IID, BONOBO_OBJREF (shell->priv->automation_factory), NULL); switch (result) { @@ -386,15 +371,15 @@ ephy_shell_startup (EphyShell *gs, if (flags & EPHY_SHELL_STARTUP_SERVER) { - g_object_ref (gs); - gs->priv->server_timeout = g_timeout_add - (SERVER_TIMEOUT, (GSourceFunc)server_timeout, gs); + g_object_ref (shell); + shell->priv->server_timeout = g_timeout_add + (SERVER_TIMEOUT, (GSourceFunc)server_timeout, shell); } else if (result == Bonobo_ACTIVATION_REG_SUCCESS || - result == Bonobo_ACTIVATION_REG_ALREADY_ACTIVE) + result == Bonobo_ACTIVATION_REG_ALREADY_ACTIVE) { automation = bonobo_activation_activate_from_id (AUTOMATION_IID, - 0, NULL, &ev); + 0, NULL, &ev); if (CORBA_Object_is_nil (automation, &ev)) { g_set_error (error, EPHY_SHELL_ERROR, @@ -437,7 +422,7 @@ ephy_shell_startup (EphyShell *gs, bonobo_object_release_unref (automation, &ev); } - gnome_session_init (gs); + gnome_session_init (shell); } CORBA_exception_free (&ev); @@ -458,73 +443,79 @@ delete_files (GList *l) static void ephy_shell_finalize (GObject *object) { - EphyShell *gs = EPHY_SHELL (object); + EphyShell *shell = EPHY_SHELL (object); g_assert (ephy_shell == NULL); - if (gs->priv->server_timeout > 0) + if (shell->priv->server_timeout > 0) { - g_source_remove (gs->priv->server_timeout); + g_source_remove (shell->priv->server_timeout); } /* this will unload the extensions */ LOG ("Unref extension manager") - g_object_unref (gs->priv->extensions_manager); + g_object_unref (shell->priv->extensions_manager); - delete_files (gs->priv->del_on_exit); - g_list_foreach (gs->priv->del_on_exit, (GFunc)g_free, NULL); - g_list_free (gs->priv->del_on_exit); + delete_files (shell->priv->del_on_exit); + g_list_foreach (shell->priv->del_on_exit, (GFunc)g_free, NULL); + g_list_free (shell->priv->del_on_exit); LOG ("Unref toolbars model") - if (gs->priv->toolbars_model) + if (shell->priv->toolbars_model) { - g_object_unref (G_OBJECT (gs->priv->toolbars_model)); + g_object_unref (G_OBJECT (shell->priv->toolbars_model)); } LOG ("Unref fullscreen toolbars model") - if (gs->priv->fs_toolbars_model) + if (shell->priv->fs_toolbars_model) { - g_object_unref (G_OBJECT (gs->priv->fs_toolbars_model)); + g_object_unref (G_OBJECT (shell->priv->fs_toolbars_model)); } LOG ("Unref Bookmarks Editor"); - if (gs->priv->bme) + if (shell->priv->bme) { - gtk_widget_destroy (GTK_WIDGET (gs->priv->bme)); + gtk_widget_destroy (GTK_WIDGET (shell->priv->bme)); } LOG ("Unref History Window"); - if (gs->priv->history_window) + if (shell->priv->history_window) { - gtk_widget_destroy (GTK_WIDGET (gs->priv->history_window)); + gtk_widget_destroy (GTK_WIDGET (shell->priv->history_window)); } LOG ("Unref PDM Dialog") - if (gs->priv->pdm_dialog) + if (shell->priv->pdm_dialog) { - g_object_unref (gs->priv->pdm_dialog); + g_object_unref (shell->priv->pdm_dialog); } LOG ("Unref prefs dialog") - if (gs->priv->prefs_dialog) + if (shell->priv->prefs_dialog) + { + g_object_unref (shell->priv->prefs_dialog); + } + + LOG ("Unref print setup dialog") + if (shell->priv->print_setup_dialog) { - g_object_unref (gs->priv->prefs_dialog); + g_object_unref (shell->priv->print_setup_dialog); } LOG ("Unref bookmarks") - if (gs->priv->bookmarks) + if (shell->priv->bookmarks) { - g_object_unref (gs->priv->bookmarks); + g_object_unref (shell->priv->bookmarks); } - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (parent_class)->finalize (object); - if (gs->priv->automation_factory) + if (shell->priv->automation_factory) { bonobo_activation_unregister_active_server - (AUTOMATION_FACTORY_IID, BONOBO_OBJREF (gs->priv->automation_factory)); + (AUTOMATION_FACTORY_IID, BONOBO_OBJREF (shell->priv->automation_factory)); - bonobo_object_unref (gs->priv->automation_factory); + bonobo_object_unref (shell->priv->automation_factory); } LOG ("Ephy shell finalized") @@ -607,7 +598,7 @@ ephy_shell_new_tab (EphyShell *shell, } grouped = ((flags & EPHY_NEW_TAB_OPEN_PAGE || - flags & EPHY_NEW_TAB_APPEND_GROUPED)) && + flags & EPHY_NEW_TAB_APPEND_GROUPED)) && !(flags & EPHY_NEW_TAB_APPEND_LAST); if ((flags & EPHY_NEW_TAB_APPEND_AFTER) && previous_embed != NULL) @@ -647,81 +638,81 @@ ephy_shell_new_tab (EphyShell *shell, gtk_window_fullscreen (GTK_WINDOW (window)); } - return tab; + return tab; } /** * ephy_shell_get_session: - * @gs: a #EphyShell + * @shell: the #EphyShell * * Returns current session. * * Return value: the current session. **/ GObject * -ephy_shell_get_session (EphyShell *gs) +ephy_shell_get_session (EphyShell *shell) { - g_return_val_if_fail (EPHY_IS_SHELL (gs), NULL); + g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL); - if (gs->priv->session == NULL) + if (shell->priv->session == NULL) { EphyExtensionsManager *manager; manager = EPHY_EXTENSIONS_MANAGER - (ephy_shell_get_extensions_manager (gs)); + (ephy_shell_get_extensions_manager (shell)); /* Instantiate internal extensions */ - gs->priv->session = + shell->priv->session = EPHY_SESSION (ephy_extensions_manager_add (manager, EPHY_TYPE_SESSION)); } - return G_OBJECT (gs->priv->session); + return G_OBJECT (shell->priv->session); } EphyBookmarks * -ephy_shell_get_bookmarks (EphyShell *gs) +ephy_shell_get_bookmarks (EphyShell *shell) { - if (gs->priv->bookmarks == NULL) + if (shell->priv->bookmarks == NULL) { - gs->priv->bookmarks = ephy_bookmarks_new (); + shell->priv->bookmarks = ephy_bookmarks_new (); } - return gs->priv->bookmarks; + return shell->priv->bookmarks; } GObject * -ephy_shell_get_toolbars_model (EphyShell *gs, gboolean fullscreen) +ephy_shell_get_toolbars_model (EphyShell *shell, gboolean fullscreen) { if (fullscreen) { - if (gs->priv->fs_toolbars_model == NULL) + if (shell->priv->fs_toolbars_model == NULL) { const char *xml; - gs->priv->fs_toolbars_model = egg_toolbars_model_new (); + shell->priv->fs_toolbars_model = egg_toolbars_model_new (); xml = ephy_file ("epiphany-fs-toolbar.xml"); - egg_toolbars_model_load (gs->priv->fs_toolbars_model, xml); + egg_toolbars_model_load (shell->priv->fs_toolbars_model, xml); } - return G_OBJECT (gs->priv->fs_toolbars_model); + return G_OBJECT (shell->priv->fs_toolbars_model); } else { - if (gs->priv->toolbars_model == NULL) + if (shell->priv->toolbars_model == NULL) { EphyBookmarks *bookmarks; - bookmarks = ephy_shell_get_bookmarks (gs); + bookmarks = ephy_shell_get_bookmarks (shell); - gs->priv->toolbars_model = ephy_toolbars_model_new (bookmarks); + shell->priv->toolbars_model = ephy_toolbars_model_new (bookmarks); g_object_set (bookmarks, "toolbars_model", - gs->priv->toolbars_model, NULL); + shell->priv->toolbars_model, NULL); } - return G_OBJECT (gs->priv->toolbars_model); + return G_OBJECT (shell->priv->toolbars_model); } } @@ -764,44 +755,44 @@ toolwindow_hide_cb (GtkWidget *widget, EphyShell *es) } GtkWidget * -ephy_shell_get_bookmarks_editor (EphyShell *gs) +ephy_shell_get_bookmarks_editor (EphyShell *shell) { EphyBookmarks *bookmarks; - if (gs->priv->bme == NULL) + if (shell->priv->bme == NULL) { bookmarks = ephy_shell_get_bookmarks (ephy_shell); g_assert (bookmarks != NULL); - gs->priv->bme = ephy_bookmarks_editor_new (bookmarks); + shell->priv->bme = ephy_bookmarks_editor_new (bookmarks); - g_signal_connect (gs->priv->bme, "show", - G_CALLBACK (toolwindow_show_cb), gs); - g_signal_connect (gs->priv->bme, "hide", - G_CALLBACK (toolwindow_hide_cb), gs); + g_signal_connect (shell->priv->bme, "show", + G_CALLBACK (toolwindow_show_cb), shell); + g_signal_connect (shell->priv->bme, "hide", + G_CALLBACK (toolwindow_hide_cb), shell); } - return gs->priv->bme; + return shell->priv->bme; } GtkWidget * -ephy_shell_get_history_window (EphyShell *gs) +ephy_shell_get_history_window (EphyShell *shell) { EphyHistory *history; - if (gs->priv->history_window == NULL) + if (shell->priv->history_window == NULL) { history = ephy_embed_shell_get_global_history (EPHY_EMBED_SHELL (ephy_shell)); g_assert (history != NULL); - gs->priv->history_window = ephy_history_window_new (history); + shell->priv->history_window = ephy_history_window_new (history); - g_signal_connect (gs->priv->history_window, "show", - G_CALLBACK (toolwindow_show_cb), gs); - g_signal_connect (gs->priv->history_window, "hide", - G_CALLBACK (toolwindow_hide_cb), gs); + g_signal_connect (shell->priv->history_window, "show", + G_CALLBACK (toolwindow_show_cb), shell); + g_signal_connect (shell->priv->history_window, "hide", + G_CALLBACK (toolwindow_hide_cb), shell); } - return gs->priv->history_window; + return shell->priv->history_window; } GObject * @@ -832,10 +823,23 @@ ephy_shell_get_prefs_dialog (EphyShell *shell) return shell->priv->prefs_dialog; } -void -ephy_shell_delete_on_exit (EphyShell *gs, const char *path) +GObject * +ephy_shell_get_print_setup_dialog (EphyShell *shell) { - gs->priv->del_on_exit = g_list_append (gs->priv->del_on_exit, - g_strdup (path)); + if (shell->priv->print_setup_dialog == NULL) + { + shell->priv->print_setup_dialog = G_OBJECT (ephy_print_setup_dialog_new ()); + + g_object_add_weak_pointer (shell->priv->print_setup_dialog, + (gpointer *) &shell->priv->print_setup_dialog); + } + + return shell->priv->print_setup_dialog; } +void +ephy_shell_delete_on_exit (EphyShell *shell, const char *path) +{ + shell->priv->del_on_exit = g_list_append (shell->priv->del_on_exit, + g_strdup (path)); +} diff --git a/src/ephy-shell.h b/src/ephy-shell.h index c114d415f..a93d318c7 100644 --- a/src/ephy-shell.h +++ b/src/ephy-shell.h @@ -38,12 +38,7 @@ G_BEGIN_DECLS #define EPHY_IS_SHELL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_SHELL)) #define EPHY_SHELL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EPHY_TYPE_SHELL, EphyShellClass)) -/* FIXME: huh? */ -#ifndef EPHY_SHELL_TYPE_DEF typedef struct EphyShell EphyShell; -#define EPHY_SHELL_TYPE_DEF -#endif - typedef struct EphyShellClass EphyShellClass; typedef struct EphyShellPrivate EphyShellPrivate; @@ -60,14 +55,14 @@ typedef enum typedef enum { - EPHY_SHELL_STARTUP_TABS = 1 << 0, - EPHY_SHELL_STARTUP_EXISTING_WINDOW = 1 << 2, - EPHY_SHELL_STARTUP_FULLSCREEN = 1 << 3, - EPHY_SHELL_STARTUP_BOOKMARKS_EDITOR = 1 << 4, - EPHY_SHELL_STARTUP_SESSION = 1 << 5, - EPHY_SHELL_STARTUP_IMPORT_BOOKMARKS = 1 << 6, - EPHY_SHELL_STARTUP_ADD_BOOKMARK = 1 << 7, - EPHY_SHELL_STARTUP_SERVER = 1 << 8 + EPHY_SHELL_STARTUP_TABS = 1 << 0, + EPHY_SHELL_STARTUP_EXISTING_WINDOW = 1 << 2, + EPHY_SHELL_STARTUP_FULLSCREEN = 1 << 3, + EPHY_SHELL_STARTUP_BOOKMARKS_EDITOR = 1 << 4, + EPHY_SHELL_STARTUP_SESSION = 1 << 5, + EPHY_SHELL_STARTUP_IMPORT_BOOKMARKS = 1 << 6, + EPHY_SHELL_STARTUP_ADD_BOOKMARK = 1 << 7, + EPHY_SHELL_STARTUP_SERVER = 1 << 8 } EphyShellStartupFlags; typedef enum @@ -102,44 +97,46 @@ struct EphyShellClass EphyEmbedShellClass parent_class; }; -GQuark ephy_shell_error_quark (void); - GType ephy_shell_get_type (void); +GQuark ephy_shell_error_quark (void); + EphyShell *ephy_shell_new (void); -gboolean ephy_shell_startup (EphyShell *gs, +gboolean ephy_shell_startup (EphyShell *shell, EphyShellStartupFlags flags, const char **args, const char *string_arg, GError **error); -EphyWindow *ephy_shell_get_active_window (EphyShell *gs); +EphyWindow *ephy_shell_get_active_window (EphyShell *shell); -EphyTab *ephy_shell_new_tab (EphyShell *shell, +EphyTab *ephy_shell_new_tab (EphyShell *shell, EphyWindow *parent_window, EphyTab *previous_tab, const char *url, EphyNewTabFlags flags); -GObject *ephy_shell_get_session (EphyShell *gs); +GObject *ephy_shell_get_session (EphyShell *shell); -EphyBookmarks *ephy_shell_get_bookmarks (EphyShell *gs); +EphyBookmarks *ephy_shell_get_bookmarks (EphyShell *shell); -GObject *ephy_shell_get_toolbars_model (EphyShell *gs, +GObject *ephy_shell_get_toolbars_model (EphyShell *shell, gboolean fullscreen); -GObject *ephy_shell_get_extensions_manager (EphyShell *es); +GObject *ephy_shell_get_extensions_manager (EphyShell *shell); -GtkWidget *ephy_shell_get_bookmarks_editor (EphyShell *gs); +GtkWidget *ephy_shell_get_bookmarks_editor (EphyShell *shell); -GtkWidget *ephy_shell_get_history_window (EphyShell *gs); +GtkWidget *ephy_shell_get_history_window (EphyShell *shell); GObject *ephy_shell_get_pdm_dialog (EphyShell *shell); GObject *ephy_shell_get_prefs_dialog (EphyShell *shell); -void ephy_shell_delete_on_exit (EphyShell *gs, +GObject *ephy_shell_get_print_setup_dialog (EphyShell *shell); + +void ephy_shell_delete_on_exit (EphyShell *shell, const char *path); G_END_DECLS diff --git a/src/ephy-window.c b/src/ephy-window.c index 7d02e98af..073a20e4e 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -58,19 +58,14 @@ #include <gtk/gtkuimanager.h> #include <gtk/gtktoggleaction.h> -static void -ephy_window_class_init (EphyWindowClass *klass); -static void -ephy_window_init (EphyWindow *gs); -static void -ephy_window_finalize (GObject *object); -static void -ephy_window_show (GtkWidget *widget); -static void -ephy_window_notebook_switch_page_cb (GtkNotebook *notebook, - GtkNotebookPage *page, - guint page_num, - EphyWindow *window); +static void ephy_window_class_init (EphyWindowClass *klass); +static void ephy_window_init (EphyWindow *gs); +static void ephy_window_finalize (GObject *object); +static void ephy_window_show (GtkWidget *widget); +static void ephy_window_notebook_switch_page_cb (GtkNotebook *notebook, + GtkNotebookPage *page, + guint page_num, + EphyWindow *window); static GtkActionEntry ephy_menu_entries [] = { @@ -97,6 +92,12 @@ static GtkActionEntry ephy_menu_entries [] = { { "FileSaveAs", GTK_STOCK_SAVE_AS, N_("Save _As..."), "<shift><control>S", N_("Save the current page"), G_CALLBACK (window_cmd_file_save_as) }, + { "FilePrintSetup", NULL, N_("Print Set_up..."), NULL, + N_("Setup the page settings for printing"), + G_CALLBACK (window_cmd_file_print_setup) }, + { "FilePrintPreview", GTK_STOCK_PRINT_PREVIEW, N_("Print Pre_view"),"<control><shift>P", + N_("Print preview"), + G_CALLBACK (window_cmd_file_print_preview) }, { "FilePrint", GTK_STOCK_PRINT, N_("_Print..."), "<control>P", N_("Print the current page"), G_CALLBACK (window_cmd_file_print) }, @@ -1707,7 +1708,7 @@ ephy_window_set_print_preview (EphyWindow *window, gboolean enabled) { window->priv->is_ppview = enabled; update_chrome (window); - ephy_notebook_set_show_tabs (EPHY_NOTEBOOK (window->priv->notebook), enabled); + ephy_notebook_set_show_tabs (EPHY_NOTEBOOK (window->priv->notebook), !enabled); } GtkWidget * @@ -1971,30 +1972,17 @@ ephy_window_find (EphyWindow *window) ephy_dialog_show (window->priv->find_dialog); } -static void -print_dialog_preview_cb (EphyDialog *dialog, - EphyWindow *window) -{ - window->priv->is_ppview = TRUE; - update_chrome(window); - ephy_notebook_set_show_tabs (EPHY_NOTEBOOK (window->priv->notebook), FALSE); -} - void ephy_window_print (EphyWindow *window) { - EphyDialog *dialog; - EphyEmbed *embed; - if (window->priv->print_dialog == NULL) { + EphyDialog *dialog; + EphyEmbed *embed; + embed = ephy_window_get_active_embed (window); - dialog = print_dialog_new_with_parent - (GTK_WIDGET(window), embed, NULL); - g_signal_connect (G_OBJECT (dialog), - "preview", - G_CALLBACK (print_dialog_preview_cb), - window); + dialog = ephy_print_dialog_new (GTK_WIDGET (window), embed, FALSE); + window->priv->print_dialog = dialog; g_object_add_weak_pointer(G_OBJECT (dialog), (gpointer *) &window->priv->print_dialog); diff --git a/src/ephy-window.h b/src/ephy-window.h index 40a728fc4..e7fbf1ca5 100644 --- a/src/ephy-window.h +++ b/src/ephy-window.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2002 Marco Pesenti Gritti + * Copyright (C) 2000-2003 Marco Pesenti Gritti * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ */ #ifndef EPHY_WINDOW_H @@ -105,8 +107,6 @@ GList *ephy_window_get_tabs (EphyWindow *window); Toolbar *ephy_window_get_toolbar (EphyWindow *window); -/* Dialogs */ - void ephy_window_find (EphyWindow *window); void ephy_window_print (EphyWindow *window); diff --git a/src/language-editor.c b/src/language-editor.c index ba8ee0f03..bb12d7264 100644 --- a/src/language-editor.c +++ b/src/language-editor.c @@ -122,10 +122,10 @@ language_editor_class_init (LanguageEditorClass *klass) parent_class = g_type_class_peek_parent (klass); signals[CHANGED] = - g_signal_new ("changed", + g_signal_new ("list-changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (LanguageEditorClass, changed), + G_STRUCT_OFFSET (LanguageEditorClass, list_changed), NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, diff --git a/src/language-editor.h b/src/language-editor.h index ee5a62193..9b641914b 100644 --- a/src/language-editor.h +++ b/src/language-editor.h @@ -51,7 +51,7 @@ struct LanguageEditorClass { EphyDialogClass parent_class; - void (* changed) (GSList *codes); + void (* list_changed) (GSList *codes); }; GType language_editor_get_type (void); diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c index 69c63b4ae..4a1a2b118 100755 --- a/src/pdm-dialog.c +++ b/src/pdm-dialog.c @@ -114,15 +114,6 @@ EphyDialogProperty properties [] = { NULL } }; -static const -char *size_group [] = -{ - "cookies_remove_button", - "cookies_properties_button", - "passwords_remove_button" -}; -const guint n_size_group = G_N_ELEMENTS (size_group); - static void pdm_dialog_class_init (PdmDialogClass *klass); static void pdm_dialog_init (PdmDialog *dialog); static void pdm_dialog_finalize (GObject *object); @@ -804,7 +795,11 @@ pdm_dialog_init (PdmDialog *dialog) * avoid the little jerk you get otherwise when switching pages because * one set of buttons is wider than another. */ - ephy_dialog_set_size_group (EPHY_DIALOG (dialog), size_group, n_size_group); + ephy_dialog_set_size_group (EPHY_DIALOG (dialog), + properties[PROP_COOKIES_REMOVE].id, + properties[PROP_COOKIES_PROPERTIES].id, + properties[PROP_PASSWORDS_REMOVE].id, + NULL); cookies = g_new0 (PdmActionInfo, 1); cookies->construct = pdm_dialog_cookies_construct; diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index d276753ac..0b4fcf45e 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -70,8 +70,6 @@ void prefs_clear_cache_button_clicked_cb (GtkWidget *button, void prefs_dialog_response_cb (GtkDialog *widget, gint response_id, EphyDialog *dialog); -void fonts_language_combo_changed_cb (GtkComboBox *combo, - EphyDialog *dialog); void prefs_homepage_current_button_clicked_cb (GtkWidget *button, EphyDialog *dialog); void prefs_homepage_blank_button_clicked_cb (GtkWidget *button, @@ -274,15 +272,6 @@ EphyDialogProperty properties [] = { NULL } }; -static const -char *lang_size_group [] = -{ - "language_label", - "default_encoding_label", - "auto_encoding_label" -}; - -static guint n_lang_size_group = G_N_ELEMENTS (lang_size_group); enum { COL_FONTS_LANG_NAME, @@ -426,17 +415,18 @@ setup_font_combo (EphyDialog *dialog, ephy_dialog_set_pref (dialog, properties[prop].id, key); } -void -fonts_language_combo_changed_cb (GtkComboBox *combo, - EphyDialog *dialog) +static void +fonts_language_changed_cb (EphyDialog *dialog, + const GValue *value, + gpointer data) { - GValue value = { 0, }; const char *code; char key[128]; int size; - ephy_dialog_get_value (dialog, properties[FONTS_LANGUAGE_PROP].id, &value); - code = g_value_get_string (&value); + code = g_value_get_string (value); + + LOG ("fonts language combo changed, new code '%s'", code) setup_font_combo (dialog, "variable", code, VARIABLE_PROP); setup_font_combo (dialog, "monospace", code, MONOSPACE_PROP); @@ -464,8 +454,6 @@ fonts_language_combo_changed_cb (GtkComboBox *combo, eel_gconf_set_integer (key, default_size[FONT_SIZE_MIN]); } ephy_dialog_set_pref (dialog, properties[MIN_SIZE_PROP].id, key); - - g_value_unset (&value); } static void @@ -509,9 +497,9 @@ create_fonts_language_menu (EphyDialog *dialog) ephy_dialog_set_data_column (dialog, properties[FONTS_LANGUAGE_PROP].id, COL_FONTS_LANG_CODE); - g_signal_connect (combo, "changed", - G_CALLBACK (fonts_language_combo_changed_cb), - dialog); + g_signal_connect (dialog, "changed::fonts_language_combo", + G_CALLBACK (fonts_language_changed_cb), + NULL); } static void @@ -752,8 +740,11 @@ prefs_dialog_init (PrefsDialog *pd) ephy_dialog_add_enum (dialog, properties[ACCEPT_COOKIES_PROP].id, n_cookies_accept_enum, cookies_accept_enum); - ephy_dialog_set_size_group (dialog, lang_size_group, - n_lang_size_group); + ephy_dialog_set_size_group (dialog, + properties[LANGUAGE_LABEL_PROP].id, + properties[DEFAULT_ENCODING_LABEL_PROP].id, + properties[AUTO_ENCODING_LABEL_PROP].id, + NULL); window = ephy_dialog_get_control (dialog, properties[WINDOW_PROP].id); @@ -929,7 +920,7 @@ prefs_language_more_button_clicked_cb (GtkWidget *button, /* FIXME: make it only modal to prefs dialogue, not to all windows */ ephy_dialog_set_modal (EPHY_DIALOG (editor), TRUE); - g_signal_connect (editor, "changed", + g_signal_connect (editor, "list-changed", G_CALLBACK (language_dialog_changed_cb), dialog); diff --git a/src/window-commands.c b/src/window-commands.c index b70ca5b8f..a6975d843 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -69,6 +69,35 @@ window_cmd_edit_find (GtkAction *action, } void +window_cmd_file_print_setup (GtkAction *action, + EphyWindow *window) +{ + EphyDialog *dialog; + + dialog = EPHY_DIALOG (ephy_shell_get_print_setup_dialog (ephy_shell)); + + ephy_dialog_show (dialog); +} + +void +window_cmd_file_print_preview (GtkAction *action, + EphyWindow *window) +{ + EphyEmbed *embed; + EmbedPrintInfo *info; + + embed = ephy_window_get_active_embed (window); + g_return_if_fail (EPHY_IS_EMBED (embed)); + + info = ephy_print_get_print_info (); + info->preview = TRUE; + + ephy_embed_print (embed, info); + + ephy_window_set_print_preview (window, TRUE); +} + +void window_cmd_file_print (GtkAction *action, EphyWindow *window) { diff --git a/src/window-commands.h b/src/window-commands.h index 63640abbe..228434c27 100644 --- a/src/window-commands.h +++ b/src/window-commands.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2002 Marco Pesenti Gritti + * Copyright (C) 2000-2003 Marco Pesenti Gritti * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ */ #include <gtk/gtkaction.h> @@ -23,9 +25,6 @@ void window_cmd_edit_find (GtkAction *action, EphyWindow *window); -void window_cmd_file_print (GtkAction *action, - EphyWindow *window); - void window_cmd_view_stop (GtkAction *action, EphyWindow *window); @@ -74,6 +73,15 @@ void window_cmd_file_open (GtkAction *action, void window_cmd_file_save_as (GtkAction *action, EphyWindow *window); +void window_cmd_file_print_setup (GtkAction *action, + EphyWindow *window); + +void window_cmd_file_print_preview (GtkAction *action, + EphyWindow *window); + +void window_cmd_file_print (GtkAction *action, + EphyWindow *window); + void window_cmd_file_send_to (GtkAction *action, EphyWindow *window); |