* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
GTK_PARAM_READWRITE));
g_object_class_install_property (object_class,
- PROP_EMBED_PAGE_SETUP,
- g_param_spec_boolean ("embed-page-setup",
- P_("Embed Page Setup"),
- P_("TRUE if page setup combos are embedded in GtkPrintUnixDialog"),
- FALSE,
- GTK_PARAM_READWRITE));
+ PROP_EMBED_PAGE_SETUP,
+ g_param_spec_boolean ("embed-page-setup",
+ P_("Embed Page Setup"),
+ P_("TRUE if page setup combos are embedded in GtkPrintUnixDialog"),
+ FALSE,
+ GTK_PARAM_READWRITE));
g_type_class_add_private (class, sizeof (GtkPrintUnixDialogPrivate));
}
static void
set_busy_cursor (GtkPrintUnixDialog *dialog,
- gboolean busy)
+ gboolean busy)
{
GtkWidget *widget;
GtkWindow *toplevel;
else
cursor = NULL;
- gdk_window_set_cursor (gtk_widget_get_window (widget),
- cursor);
+ gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
gdk_display_flush (display);
if (cursor)
return TRUE;
}
- /* Shows overwrite confirmation dialog in the case of printing to file which
- * already exists. */
+ /* Shows overwrite confirmation dialog in the case of printing
+ * to file which already exists.
+ */
if (gtk_printer_is_virtual (printer))
{
option = gtk_printer_option_set_lookup (priv->options,
priv->support_selection = FALSE;
priv->has_selection = FALSE;
- g_signal_connect (dialog,
- "destroy",
- (GCallback) gtk_print_unix_dialog_destroy,
- NULL);
+ g_signal_connect (dialog, "destroy",
+ (GCallback) gtk_print_unix_dialog_destroy, NULL);
- g_signal_connect (dialog,
- "response",
- (GCallback) error_dialogs,
- NULL);
+ g_signal_connect (dialog, "response",
+ (GCallback) error_dialogs, NULL);
- g_signal_connect (dialog,
- "notify::page-setup",
- (GCallback) redraw_page_layout_preview,
- NULL);
+ g_signal_connect (dialog, "notify::page-setup",
+ (GCallback) redraw_page_layout_preview, NULL);
priv->preview_button = gtk_button_new_from_stock (GTK_STOCK_PRINT_PREVIEW);
gtk_widget_show (priv->preview_button);
}
static void
-disconnect_printer_details_request (GtkPrintUnixDialog *dialog, gboolean details_failed)
+disconnect_printer_details_request (GtkPrintUnixDialog *dialog,
+ gboolean details_failed)
{
GtkPrintUnixDialogPrivate *priv = dialog->priv;
unschedule_idle_mark_conflicts (dialog);
disconnect_printer_details_request (dialog, FALSE);
- if (priv->current_printer)
- {
- g_object_unref (priv->current_printer);
- priv->current_printer = NULL;
- }
-
- if (priv->printer_list)
- {
- g_object_unref (priv->printer_list);
- priv->printer_list = NULL;
- }
-
- if (priv->custom_paper_list)
- {
- g_object_unref (priv->custom_paper_list);
- priv->custom_paper_list = NULL;
- }
-
- if (priv->printer_list_filter)
- {
- g_object_unref (priv->printer_list_filter);
- priv->printer_list_filter = NULL;
- }
-
- if (priv->options)
- {
- g_object_unref (priv->options);
- priv->options = NULL;
- }
+ g_clear_object (&priv->current_printer);
+ g_clear_object (&priv->printer_list);
+ g_clear_object (&priv->custom_paper_list);
+ g_clear_object (&priv->printer_list_filter);
+ g_clear_object (&priv->options);
if (priv->number_up_layout_2_option)
{
priv->number_up_layout_2_option = NULL;
}
- if (priv->number_up_layout_n_option)
- {
- g_object_unref (priv->number_up_layout_n_option);
- priv->number_up_layout_n_option = NULL;
- }
-
- if (priv->page_setup)
- {
- g_object_unref (priv->page_setup);
- priv->page_setup = NULL;
- }
-
- if (priv->initial_settings)
- {
- g_object_unref (priv->initial_settings);
- priv->initial_settings = NULL;
- }
-
- g_free (priv->waiting_for_printer);
- priv->waiting_for_printer = NULL;
-
- g_free (priv->format_for_printer);
- priv->format_for_printer = NULL;
+ g_clear_object (&priv->number_up_layout_n_option);
+ g_clear_object (&priv->page_setup);
+ g_clear_object (&priv->initial_settings);
+ g_clear_pointer (&priv->waiting_for_printer, (GDestroyNotify)g_free);
+ g_clear_pointer (&priv->format_for_printer, (GDestroyNotify)g_free);
for (node = priv->print_backends; node != NULL; node = node->next)
{
g_list_free (priv->print_backends);
priv->print_backends = NULL;
- if (priv->page_setup_list)
- {
- g_object_unref (priv->page_setup_list);
- priv->page_setup_list = NULL;
- }
+ g_clear_object (&priv->page_setup_list);
G_OBJECT_CLASS (gtk_print_unix_dialog_parent_class)->finalize (object);
}
return parent_buildable_iface->get_internal_child (buildable, builder, childname);
}
-/* This function controls "sensitive" property of GtkCellRenderer based on pause
- * state of printers. */
+/* This function controls "sensitive" property of GtkCellRenderer
+ * based on pause state of printers.
+ */
void set_cell_sensitivity_func (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
GtkTreeModel *tree_model,
{
GtkPrinter *printer;
- gtk_tree_model_get (tree_model, iter, PRINTER_LIST_COL_PRINTER_OBJ, &printer, -1);
+ gtk_tree_model_get (tree_model, iter,
+ PRINTER_LIST_COL_PRINTER_OBJ, &printer,
+ -1);
if (printer != NULL && !gtk_printer_is_accepting_jobs (printer))
g_object_set (cell, "sensitive", FALSE, NULL);
-1);
/* When the pause state change then we need to update sensitive property
- * of GTK_RESPONSE_OK button inside of selected_printer_changed function. */
+ * of GTK_RESPONSE_OK button inside of selected_printer_changed function.
+ */
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->printer_treeview));
selected_printer_changed (selection, dialog);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->printer_treeview));
if (priv->waiting_for_printer != NULL &&
- strcmp (gtk_printer_get_name (printer),
- priv->waiting_for_printer) == 0)
+ strcmp (gtk_printer_get_name (printer), priv->waiting_for_printer) == 0)
{
priv->internal_printer_change = TRUE;
gtk_tree_selection_select_iter (selection, &filter_iter);
g_return_if_fail (print_backend != NULL);
- g_signal_connect_object (print_backend,
- "printer-added",
- (GCallback) printer_added_cb,
- G_OBJECT (dialog), 0);
+ g_signal_connect_object (print_backend, "printer-added",
+ (GCallback) printer_added_cb, G_OBJECT (dialog), 0);
- g_signal_connect_object (print_backend,
- "printer-removed",
- (GCallback) printer_removed_cb,
- G_OBJECT (dialog), 0);
+ g_signal_connect_object (print_backend, "printer-removed",
+ (GCallback) printer_removed_cb, G_OBJECT (dialog), 0);
- g_signal_connect_object (print_backend,
- "printer-status-changed",
- (GCallback) printer_status_cb,
- G_OBJECT (dialog), 0);
+ g_signal_connect_object (print_backend, "printer-status-changed",
+ (GCallback) printer_status_cb, G_OBJECT (dialog), 0);
list = gtk_print_backend_get_printer_list (print_backend);
gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
gtk_widget_show (hbox);
- gtk_box_pack_start (GTK_BOX (extension_point), hbox, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (extension_point), hbox, TRUE, TRUE, 0);
}
else
- gtk_box_pack_start (GTK_BOX (extension_point), widget, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (extension_point), widget, TRUE, TRUE, 0);
}
static gint
table);
nrows = grid_rows (GTK_GRID (table));
- if (nrows == 1)
+ if (nrows == 0)
gtk_widget_hide (page);
else
gtk_widget_show (page);
option = gtk_printer_option_set_lookup (priv->options, "gtk-print-time-text");
if (option != NULL)
{
- const char *text = gtk_entry_get_text (GTK_ENTRY (priv->print_at_entry));
+ const gchar *text;
+
+ text = gtk_entry_get_text (GTK_ENTRY (priv->print_at_entry));
gtk_printer_option_set (option, text);
}
}
GtkWidget *table, *frame;
gboolean has_advanced, has_job;
guint nrows;
+ GList *children;
if (priv->current_printer == NULL)
{
add_option_to_extension_point,
priv->extension_point);
+ /* A bit of a hack, keep the last option flush right.
+ * This keeps the file format radios from moving as the
+ * filename changes.
+ */
+ children = gtk_container_get_children (GTK_CONTAINER (priv->extension_point));
+ l = g_list_last (children);
+ if (l && l != children)
+ gtk_widget_set_halign (GTK_WIDGET (l->data), GTK_ALIGN_END);
+ g_list_free (children);
+
/* Put the rest of the groups in the advanced page */
groups = gtk_printer_option_set_get_groups (priv->options);
table);
nrows = grid_rows (GTK_GRID (table));
- if (nrows == 1)
+ if (nrows == 0)
gtk_widget_destroy (table);
else
{
else
gtk_widget_hide (priv->advanced_page);
- g_list_foreach (groups, (GFunc) g_free, NULL);
- g_list_free (groups);
+ g_list_free_full (groups, g_free);
}
static void
}
static gboolean
-page_setup_is_equal (GtkPageSetup *a,
- GtkPageSetup *b)
+page_setup_is_equal (GtkPageSetup *a,
+ GtkPageSetup *b)
{
return
gtk_paper_size_is_equal (gtk_page_setup_get_paper_size (a),
- gtk_page_setup_get_paper_size (b)) &&
+ gtk_page_setup_get_paper_size (b)) &&
gtk_page_setup_get_top_margin (a, GTK_UNIT_MM) == gtk_page_setup_get_top_margin (b, GTK_UNIT_MM) &&
gtk_page_setup_get_bottom_margin (a, GTK_UNIT_MM) == gtk_page_setup_get_bottom_margin (b, GTK_UNIT_MM) &&
gtk_page_setup_get_left_margin (a, GTK_UNIT_MM) == gtk_page_setup_get_left_margin (b, GTK_UNIT_MM) &&
static gboolean
page_setup_is_same_size (GtkPageSetup *a,
- GtkPageSetup *b)
+ GtkPageSetup *b)
{
return gtk_paper_size_is_equal (gtk_page_setup_get_paper_size (a),
- gtk_page_setup_get_paper_size (b));
+ gtk_page_setup_get_paper_size (b));
}
static gboolean
set_paper_size (GtkPrintUnixDialog *dialog,
- GtkPageSetup *page_setup,
- gboolean size_only,
- gboolean add_item)
+ GtkPageSetup *page_setup,
+ gboolean size_only,
+ gboolean add_item)
{
GtkPrintUnixDialogPrivate *priv = dialog->priv;
GtkTreeModel *model;
if (gtk_tree_model_get_iter_first (model, &iter))
{
do
- {
- gtk_tree_model_get (GTK_TREE_MODEL (priv->page_setup_list), &iter,
- PAGE_SETUP_LIST_COL_PAGE_SETUP, &list_page_setup, -1);
- if (list_page_setup == NULL)
- continue;
-
- if ((size_only && page_setup_is_same_size (page_setup, list_page_setup)) ||
- (!size_only && page_setup_is_equal (page_setup, list_page_setup)))
- {
- gtk_combo_box_set_active_iter (GTK_COMBO_BOX (priv->paper_size_combo),
- &iter);
- gtk_combo_box_set_active (GTK_COMBO_BOX (priv->orientation_combo),
- gtk_page_setup_get_orientation (page_setup));
- g_object_unref (list_page_setup);
- return TRUE;
- }
-
- g_object_unref (list_page_setup);
-
- } while (gtk_tree_model_iter_next (model, &iter));
+ {
+ gtk_tree_model_get (GTK_TREE_MODEL (priv->page_setup_list), &iter,
+ PAGE_SETUP_LIST_COL_PAGE_SETUP, &list_page_setup,
+ -1);
+ if (list_page_setup == NULL)
+ continue;
+
+ if ((size_only && page_setup_is_same_size (page_setup, list_page_setup)) ||
+ (!size_only && page_setup_is_equal (page_setup, list_page_setup)))
+ {
+ gtk_combo_box_set_active_iter (GTK_COMBO_BOX (priv->paper_size_combo),
+ &iter);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (priv->orientation_combo),
+ gtk_page_setup_get_orientation (page_setup));
+ g_object_unref (list_page_setup);
+ return TRUE;
+ }
+
+ g_object_unref (list_page_setup);
+
+ } while (gtk_tree_model_iter_next (model, &iter));
}
if (add_item)
{
gtk_list_store_append (priv->page_setup_list, &iter);
gtk_list_store_set (priv->page_setup_list, &iter,
- PAGE_SETUP_LIST_COL_IS_SEPARATOR, TRUE,
- -1);
+ PAGE_SETUP_LIST_COL_IS_SEPARATOR, TRUE,
+ -1);
gtk_list_store_append (priv->page_setup_list, &iter);
gtk_list_store_set (priv->page_setup_list, &iter,
- PAGE_SETUP_LIST_COL_PAGE_SETUP, page_setup,
- -1);
+ PAGE_SETUP_LIST_COL_PAGE_SETUP, page_setup,
+ -1);
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (priv->paper_size_combo),
- &iter);
+ &iter);
gtk_combo_box_set_active (GTK_COMBO_BOX (priv->orientation_combo),
- gtk_page_setup_get_orientation (page_setup));
+ gtk_page_setup_get_orientation (page_setup));
return TRUE;
}
{
gtk_list_store_append (priv->page_setup_list, &paper_iter);
gtk_list_store_set (priv->page_setup_list, &paper_iter,
- PAGE_SETUP_LIST_COL_IS_SEPARATOR, TRUE,
- -1);
+ PAGE_SETUP_LIST_COL_IS_SEPARATOR, TRUE,
+ -1);
do
- {
- GtkPageSetup *page_setup;
- gtk_tree_model_get (model, &iter, 0, &page_setup, -1);
+ {
+ GtkPageSetup *page_setup;
+ gtk_tree_model_get (model, &iter, 0, &page_setup, -1);
- gtk_list_store_append (priv->page_setup_list, &paper_iter);
- gtk_list_store_set (priv->page_setup_list, &paper_iter,
- PAGE_SETUP_LIST_COL_PAGE_SETUP, page_setup,
- -1);
+ gtk_list_store_append (priv->page_setup_list, &paper_iter);
+ gtk_list_store_set (priv->page_setup_list, &paper_iter,
+ PAGE_SETUP_LIST_COL_PAGE_SETUP, page_setup,
+ -1);
- g_object_unref (page_setup);
- } while (gtk_tree_model_iter_next (model, &iter));
+ g_object_unref (page_setup);
+ } while (gtk_tree_model_iter_next (model, &iter));
}
-
+
gtk_list_store_append (priv->page_setup_list, &paper_iter);
gtk_list_store_set (priv->page_setup_list, &paper_iter,
PAGE_SETUP_LIST_COL_IS_SEPARATOR, TRUE,
if (printer == NULL || (list = gtk_printer_list_papers (printer)) == NULL)
{
for (i = 0; i < G_N_ELEMENTS (common_paper_sizes); i++)
- {
- page_setup = gtk_page_setup_new ();
- paper_size = gtk_paper_size_new (common_paper_sizes[i]);
- gtk_page_setup_set_paper_size_and_default_margins (page_setup, paper_size);
- gtk_paper_size_free (paper_size);
-
- gtk_list_store_append (priv->page_setup_list, &iter);
- gtk_list_store_set (priv->page_setup_list, &iter,
- PAGE_SETUP_LIST_COL_PAGE_SETUP, page_setup,
- -1);
- g_object_unref (page_setup);
- }
+ {
+ page_setup = gtk_page_setup_new ();
+ paper_size = gtk_paper_size_new (common_paper_sizes[i]);
+ gtk_page_setup_set_paper_size_and_default_margins (page_setup, paper_size);
+ gtk_paper_size_free (paper_size);
+
+ gtk_list_store_append (priv->page_setup_list, &iter);
+ gtk_list_store_set (priv->page_setup_list, &iter,
+ PAGE_SETUP_LIST_COL_PAGE_SETUP, page_setup,
+ -1);
+ g_object_unref (page_setup);
+ }
}
else
{
for (l = list; l != NULL; l = l->next)
- {
- page_setup = l->data;
- gtk_list_store_append (priv->page_setup_list, &iter);
- gtk_list_store_set (priv->page_setup_list, &iter,
- PAGE_SETUP_LIST_COL_PAGE_SETUP, page_setup,
- -1);
- g_object_unref (page_setup);
- }
+ {
+ page_setup = l->data;
+ gtk_list_store_append (priv->page_setup_list, &iter);
+ gtk_list_store_set (priv->page_setup_list, &iter,
+ PAGE_SETUP_LIST_COL_PAGE_SETUP, page_setup,
+ -1);
+ g_object_unref (page_setup);
+ }
g_list_free (list);
}
GtkTreeIter iter, filter_iter;
/* Whenever the user selects a printer we stop looking for
- the printer specified in the initial settings */
+ * the printer specified in the initial settings
+ */
if (priv->waiting_for_printer &&
!priv->internal_printer_change)
{
if (printer != NULL)
{
if (!gtk_printer_is_accepting_jobs (printer))
- {
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE);
- }
- else
- {
- if (priv->current_printer == printer && gtk_printer_has_details (printer))
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, TRUE);
- }
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE);
+ else if (priv->current_printer == printer && gtk_printer_has_details (printer))
+
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, TRUE);
}
if (printer != NULL && !gtk_printer_has_details (printer))
set_busy_cursor (dialog, TRUE);
gtk_list_store_set (GTK_LIST_STORE (priv->printer_list),
g_object_get_data (G_OBJECT (printer), "gtk-print-tree-iter"),
- PRINTER_LIST_COL_STATE, _("Getting printer information..."),
+ PRINTER_LIST_COL_STATE, _("Getting printer information…"),
-1);
return;
}
if (priv->options)
{
- g_object_unref (priv->options);
- priv->options = NULL;
-
+ g_clear_object (&priv->options);
clear_per_printer_ui (dialog);
}
- if (priv->current_printer)
- {
- g_object_unref (priv->current_printer);
- }
-
+ g_clear_object (&priv->current_printer);
priv->printer_capabilities = 0;
if (printer != NULL && gtk_printer_is_accepting_jobs (printer))
gtk_grid_attach (GTK_GRID (table), radio, 0, 3, 1, 1);
entry = gtk_entry_new ();
gtk_widget_set_tooltip_text (entry, range_tooltip);
+ gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
atk_object_set_name (gtk_widget_get_accessible (entry), _("Pages"));
atk_object_set_description (gtk_widget_get_accessible (entry), range_tooltip);
priv->page_range_entry = entry;
gtk_widget_show (label);
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
spinbutton = gtk_spin_button_new_with_range (1.0, 100.0, 1.0);
+ gtk_entry_set_activates_default (GTK_ENTRY (spinbutton), TRUE);
priv->copies_spin = spinbutton;
gtk_widget_show (spinbutton);
gtk_grid_attach (GTK_GRID (table), spinbutton, 1, 0, 1, 1);
cairo_save (cr);
- page_setup = gtk_print_unix_dialog_get_page_setup (dialog);
+ page_setup = gtk_print_unix_dialog_get_page_setup (dialog);
if (page_setup != NULL)
{
i = 1;
- page_width = (double)w / pages_x;
- page_height = (double)h / pages_y;
+ page_width = (gdouble)w / pages_x;
+ page_height = (gdouble)h / pages_y;
layout = pango_cairo_create_layout (cr);
static void
custom_paper_dialog_response_cb (GtkDialog *custom_paper_dialog,
- gint response_id,
- gpointer user_data)
+ gint response_id,
+ gpointer user_data)
{
GtkPrintUnixDialog *print_dialog = GTK_PRINT_UNIX_DIALOG (user_data);
GtkPrintUnixDialogPrivate *priv = print_dialog->priv;
if (gtk_combo_box_get_active_iter (combo_box, &iter))
{
gtk_tree_model_get (gtk_combo_box_get_model (combo_box),
- &iter, PAGE_SETUP_LIST_COL_PAGE_SETUP, &page_setup, -1);
+ &iter, PAGE_SETUP_LIST_COL_PAGE_SETUP, &page_setup,
+ -1);
if (page_setup == NULL)
{
{
gboolean separator;
- gtk_tree_model_get (model, iter, PAGE_SETUP_LIST_COL_IS_SEPARATOR, &separator, -1);
+ gtk_tree_model_get (model, iter,
+ PAGE_SETUP_LIST_COL_IS_SEPARATOR, &separator,
+ -1);
return separator;
}
GtkPaperSize *paper_size;
gtk_tree_model_get (tree_model, iter,
- PAGE_SETUP_LIST_COL_PAGE_SETUP, &page_setup, -1);
+ PAGE_SETUP_LIST_COL_PAGE_SETUP, &page_setup,
+ -1);
if (page_setup)
{
paper_size = gtk_page_setup_get_paper_size (page_setup);
g_object_unref (page_setup);
}
else
- g_object_set (cell, "text", _("Manage Custom Sizes..."), NULL);
+ g_object_set (cell, "text", _("Manage Custom Sizes…"), NULL);
}
static void
gtk_widget_set_sensitive (combo, FALSE);
gtk_widget_show (combo);
-
/* Add the page layout preview */
hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (hbox2);
gtk_container_set_border_width (GTK_CONTAINER (table), 12);
gtk_widget_show (table);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled),
- table);
+ gtk_container_add (GTK_CONTAINER (scrolled), table);
gtk_viewport_set_shadow_type (GTK_VIEWPORT (gtk_bin_get_child (GTK_BIN (scrolled))),
GTK_SHADOW_NONE);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
gtk_widget_show (main_vbox);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled),
- main_vbox);
+ gtk_container_add (GTK_CONTAINER (scrolled), main_vbox);
gtk_viewport_set_shadow_type (GTK_VIEWPORT (gtk_bin_get_child (GTK_BIN (scrolled))),
GTK_SHADOW_NONE);
* Return value: a new #GtkPrintUnixDialog
*
* Since: 2.10
- **/
+ */
GtkWidget *
gtk_print_unix_dialog_new (const gchar *title,
GtkWindow *parent)
{
GtkWidget *result;
- const gchar *_title = _("Print");
-
- if (title)
- _title = title;
result = g_object_new (GTK_TYPE_PRINT_UNIX_DIALOG,
"transient-for", parent,
- "title", _title,
+ "title", title ? title : _("Print"),
NULL);
return result;
* gtk_print_unix_dialog_get_current_page:
* @dialog: a #GtkPrintUnixDialog
*
- * Gets the current page of the #GtkPrintDialog.
+ * Gets the current page of the #GtkPrintUnixDialog.
*
* Returns: the current page of @dialog
*
do
{
gtk_tree_model_get (GTK_TREE_MODEL (priv->printer_list), &iter,
- PRINTER_LIST_COL_PRINTER_OBJ, &printer, -1);
+ PRINTER_LIST_COL_PRINTER_OBJ, &printer,
+ -1);
if (printer == NULL)
continue;
ranges = dialog_get_page_ranges (dialog, &n_ranges);
if (ranges)
{
- gtk_print_settings_set_page_ranges (settings, ranges, n_ranges);
+ gtk_print_settings_set_page_ranges (settings, ranges, n_ranges);
g_free (ranges);
}
GtkTreeSelection *selection;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->printer_treeview));
-
- g_object_unref (priv->current_printer);
- priv->current_printer = NULL;
+ g_clear_object (&priv->current_printer);
priv->internal_printer_change = TRUE;
selected_printer_changed (selection, dialog);
priv->internal_printer_change = FALSE;
* gtk_print_unix_dialog_get_manual_capabilities:
* @dialog: a #GtkPrintUnixDialog
*
- * Gets the value of #GtkPrintUnixDialog::manual-capabilities property.
+ * Gets the value of #GtkPrintUnixDialog:manual-capabilities property.
*
* Returns: the printing capabilities
*
* gtk_print_unix_dialog_get_support_selection:
* @dialog: a #GtkPrintUnixDialog
*
- * Gets the value of #GtkPrintUnixDialog::support-selection property.
+ * Gets the value of #GtkPrintUnixDialog:support-selection property.
*
* Returns: whether the application supports print of selection
*
* gtk_print_unix_dialog_get_has_selection:
* @dialog: a #GtkPrintUnixDialog
*
- * Gets the value of #GtkPrintUnixDialog::has-selection property.
+ * Gets the value of #GtkPrintUnixDialog:has-selection property.
*
* Returns: whether there is a selection
*
* gtk_print_unix_dialog_get_embed_page_setup:
* @dialog: a #GtkPrintUnixDialog
*
- * Gets the value of #GtkPrintUnixDialog::embed-page-setup property.
+ * Gets the value of #GtkPrintUnixDialog:embed-page-setup property.
*
* Returns: whether there is a selection
*