Commit c459feaa authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Fix build errors.

2006-05-12  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtkrecentmanager.c:
	Fix build errors.

	* gtk/gtk.symbols:
	* demos/gtk-demo/printing.c:
	* gtk/gtkprintoperation-win32.c:
	* gtk/gtkprintoperation.[ch]:
	* gtk/gtkprintsettings.[ch]:
	* modules/printbackends/cups/gtkprintbackendcups.c:
	* modules/printbackends/lpr/gtkprintbackendlpr.c:
	* modules/printbackends/pdf/gtkprintbackendpdf.c:
	* tests/print-editor.c:
	* tests/testnouiprint.c:
	* tests/testprint.c:
	* tests/testprintfileoperation.c:
	Rename functions from nr_of_pages to n_pages, and num_copies to
	n_copies to match other gtk+ names.

	* gtk/gtkmenu.c: (gtk_menu_popdown):
	Only re-set window group on popdown if we set it on popup (i.e.
	if there is a parent menu shell).
	Fixed part of bug #340401

	* gtk/gtkwindow.c:
	Add (contruct) property "transient-for" to GtkWindow. This
	is needed for the fix to bug #340401.

	* gtk/gtkprintunixdialog.c:
	Use the transient-for property on construction and populate the dialog
	with widgets after that. This fixes bug #340401.
	More n_pages renames.
parent dc918cbf
2006-05-12 Alexander Larsson <alexl@redhat.com>
* gtk/gtkrecentmanager.c:
Fix build errors.
* gtk/gtk.symbols:
* demos/gtk-demo/printing.c:
* gtk/gtkprintoperation-win32.c:
* gtk/gtkprintoperation.[ch]:
* gtk/gtkprintsettings.[ch]:
* modules/printbackends/cups/gtkprintbackendcups.c:
* modules/printbackends/lpr/gtkprintbackendlpr.c:
* modules/printbackends/pdf/gtkprintbackendpdf.c:
* tests/print-editor.c:
* tests/testnouiprint.c:
* tests/testprint.c:
* tests/testprintfileoperation.c:
Rename functions from nr_of_pages to n_pages, and num_copies to
n_copies to match other gtk+ names.
* gtk/gtkmenu.c: (gtk_menu_popdown):
Only re-set window group on popdown if we set it on popup (i.e.
if there is a parent menu shell).
Fixed part of bug #340401
* gtk/gtkwindow.c:
Add (contruct) property "transient-for" to GtkWindow. This
is needed for the fix to bug #340401.
* gtk/gtkprintunixdialog.c:
Use the transient-for property on construction and populate the dialog
with widgets after that. This fixes bug #340401.
More n_pages renames.
2006-05-11 Emmanuele Bassi <ebassi@cvs.gnome.org>
* gtk/gtkrecentmanager.h: Remove the error parameter to the
......
2006-05-12 Alexander Larsson <alexl@redhat.com>
* gtk/gtkrecentmanager.c:
Fix build errors.
* gtk/gtk.symbols:
* demos/gtk-demo/printing.c:
* gtk/gtkprintoperation-win32.c:
* gtk/gtkprintoperation.[ch]:
* gtk/gtkprintsettings.[ch]:
* modules/printbackends/cups/gtkprintbackendcups.c:
* modules/printbackends/lpr/gtkprintbackendlpr.c:
* modules/printbackends/pdf/gtkprintbackendpdf.c:
* tests/print-editor.c:
* tests/testnouiprint.c:
* tests/testprint.c:
* tests/testprintfileoperation.c:
Rename functions from nr_of_pages to n_pages, and num_copies to
n_copies to match other gtk+ names.
* gtk/gtkmenu.c: (gtk_menu_popdown):
Only re-set window group on popdown if we set it on popup (i.e.
if there is a parent menu shell).
Fixed part of bug #340401
* gtk/gtkwindow.c:
Add (contruct) property "transient-for" to GtkWindow. This
is needed for the fix to bug #340401.
* gtk/gtkprintunixdialog.c:
Use the transient-for property on construction and populate the dialog
with widgets after that. This fixes bug #340401.
More n_pages renames.
2006-05-11 Emmanuele Bassi <ebassi@cvs.gnome.org>
* gtk/gtkrecentmanager.h: Remove the error parameter to the
......
......@@ -49,7 +49,7 @@ begin_print (GtkPrintOperation *operation,
data->num_lines = i;
data->num_pages = (data->num_lines - 1) / data->lines_per_page + 1;
gtk_print_operation_set_nr_of_pages (operation, data->num_pages);
gtk_print_operation_set_n_pages (operation, data->num_pages);
}
static void
......
......@@ -2688,7 +2688,7 @@ gtk_print_operation_get_default_page_setup
gtk_print_operation_set_print_settings
gtk_print_operation_get_print_settings
gtk_print_operation_set_job_name
gtk_print_operation_set_nr_of_pages
gtk_print_operation_set_n_pages
gtk_print_operation_set_current_page
gtk_print_operation_set_use_full_page
gtk_print_operation_set_unit
......@@ -2760,8 +2760,8 @@ gtk_print_settings_get_duplex
gtk_print_settings_set_duplex
gtk_print_settings_get_quality
gtk_print_settings_set_quality
gtk_print_settings_get_num_copies
gtk_print_settings_set_num_copies
gtk_print_settings_get_n_copies
gtk_print_settings_set_n_copies
gtk_print_settings_get_number_up
gtk_print_settings_set_number_up
gtk_print_settings_get_resolution
......
......@@ -1473,12 +1473,14 @@ gtk_menu_popdown (GtkMenu *menu)
{
GtkMenuPrivate *private;
GtkMenuShell *menu_shell;
gboolean had_parent;
g_return_if_fail (GTK_IS_MENU (menu));
menu_shell = GTK_MENU_SHELL (menu);
private = gtk_menu_get_private (menu);
had_parent = menu_shell->parent_menu_shell != NULL;
menu_shell->parent_menu_shell = NULL;
menu_shell->active = FALSE;
menu_shell->ignore_enter = FALSE;
......@@ -1502,7 +1504,8 @@ gtk_menu_popdown (GtkMenu *menu)
/* The X Grab, if present, will automatically be removed when we hide
* the window */
gtk_widget_hide (menu->toplevel);
gtk_window_group_add_window (gtk_window_get_group (NULL), GTK_WINDOW (menu->toplevel));
if (had_parent)
gtk_window_group_add_window (gtk_window_get_group (NULL), GTK_WINDOW (menu->toplevel));
if (menu->torn_off)
{
......
......@@ -660,8 +660,8 @@ devmode_to_settings (GtkPrintSettings *settings,
devmode->dmScale / 100.0);
if (devmode->dmFields & DM_COPIES)
gtk_print_settings_set_num_copies (settings,
devmode->dmCopies);
gtk_print_settings_set_n_copies (settings,
devmode->dmCopies);
if (devmode->dmFields & DM_DEFAULTSOURCE)
{
......@@ -941,10 +941,10 @@ devmode_from_settings (GtkPrintSettings *settings,
devmode->dmScale = gtk_print_settings_get_scale (settings) * 100;
}
if (gtk_print_settings_has_key (settings, GTK_PRINT_SETTINGS_NUM_COPIES))
if (gtk_print_settings_has_key (settings, GTK_PRINT_SETTINGS_N_COPIES))
{
devmode->dmFields |= DM_COPIES;
devmode->dmCopies = gtk_print_settings_get_num_copies (settings);
devmode->dmCopies = gtk_print_settings_get_n_copies (settings);
}
if (gtk_print_settings_has_key (settings, "win32-default-source"))
......
......@@ -43,7 +43,7 @@ enum {
PROP_DEFAULT_PAGE_SETUP,
PROP_PRINT_SETTINGS,
PROP_JOB_NAME,
PROP_NR_OF_PAGES,
PROP_N_PAGES,
PROP_CURRENT_PAGE,
PROP_USE_FULL_PAGE,
PROP_UNIT,
......@@ -144,8 +144,8 @@ gtk_print_operation_set_property (GObject *object,
case PROP_JOB_NAME:
gtk_print_operation_set_job_name (op, g_value_get_string (value));
break;
case PROP_NR_OF_PAGES:
gtk_print_operation_set_nr_of_pages (op, g_value_get_int (value));
case PROP_N_PAGES:
gtk_print_operation_set_n_pages (op, g_value_get_int (value));
break;
case PROP_CURRENT_PAGE:
gtk_print_operation_set_current_page (op, g_value_get_int (value));
......@@ -188,7 +188,7 @@ gtk_print_operation_get_property (GObject *object,
case PROP_JOB_NAME:
g_value_set_string (value, priv->job_name);
break;
case PROP_NR_OF_PAGES:
case PROP_N_PAGES:
g_value_set_int (value, priv->nr_of_pages);
break;
case PROP_CURRENT_PAGE:
......@@ -239,7 +239,7 @@ gtk_print_operation_class_init (GtkPrintOperationClass *class)
*
* A typical use for this signal is to use the parameters from the
* #GtkPrintContext and paginate the document accordingly, and then
* set the number of pages with gtk_print_operation_set_nr_of_pages().
* set the number of pages with gtk_print_operation_set_n_pages().
*
* Since: 2.10
*/
......@@ -405,7 +405,7 @@ gtk_print_operation_class_init (GtkPrintOperationClass *class)
GTK_PARAM_READWRITE));
/**
* GtkPrintOperation:number-of-pages:
* GtkPrintOperation:n-pages:
*
* The number of pages in the document.
*
......@@ -419,8 +419,8 @@ gtk_print_operation_class_init (GtkPrintOperationClass *class)
* Since: 2.10
*/
g_object_class_install_property (gobject_class,
PROP_NR_OF_PAGES,
g_param_spec_int ("number-of-pages",
PROP_N_PAGES,
g_param_spec_int ("n-pages",
P_("Number of Pages"),
P_("The number of pages in the document."),
-1,
......@@ -734,7 +734,7 @@ gtk_print_operation_set_job_name (GtkPrintOperation *op,
}
/**
* gtk_print_operation_set_nr_of_pages:
* gtk_print_operation_set_n_pages:
* @op: a #GtkPrintOperation
* @n_pages: the number of pages
*
......@@ -752,8 +752,8 @@ gtk_print_operation_set_job_name (GtkPrintOperation *op,
* Since: 2.10
**/
void
gtk_print_operation_set_nr_of_pages (GtkPrintOperation *op,
gint n_pages)
gtk_print_operation_set_n_pages (GtkPrintOperation *op,
gint n_pages)
{
GtkPrintOperationPrivate *priv;
......
......@@ -116,7 +116,7 @@ void gtk_print_operation_set_print_settings (GtkPrintOper
GtkPrintSettings * gtk_print_operation_get_print_settings (GtkPrintOperation *op);
void gtk_print_operation_set_job_name (GtkPrintOperation *op,
const gchar *job_name);
void gtk_print_operation_set_nr_of_pages (GtkPrintOperation *op,
void gtk_print_operation_set_n_pages (GtkPrintOperation *op,
gint n_pages);
void gtk_print_operation_set_current_page (GtkPrintOperation *op,
gint current_page);
......
......@@ -1037,35 +1037,35 @@ gtk_print_settings_set_page_set (GtkPrintSettings *settings,
}
/**
* gtk_print_settings_get_num_copies:
* gtk_print_settings_get_n_copies:
* @settings: a #GtkPrintSettings
*
* Gets the value of %GTK_PRINT_SETTINGS_NUM_COPIES.
* Gets the value of %GTK_PRINT_SETTINGS_N_COPIES.
*
* Return value: the number of copies to print
*
* Since: 2.10
*/
gint
gtk_print_settings_get_num_copies (GtkPrintSettings *settings)
gtk_print_settings_get_n_copies (GtkPrintSettings *settings)
{
return gtk_print_settings_get_int_with_default (settings, GTK_PRINT_SETTINGS_NUM_COPIES, 1);
return gtk_print_settings_get_int_with_default (settings, GTK_PRINT_SETTINGS_N_COPIES, 1);
}
/**
* gtk_print_settings_set_num_copies:
* gtk_print_settings_set_n_copies:
* @settings: a #GtkPrintSettings
* @num_copies: the number of copies
*
* Sets the value of %GTK_PRINT_SETTINGS_NUM_COPIES.
* Sets the value of %GTK_PRINT_SETTINGS_N_COPIES.
*
* Since: 2.10
*/
void
gtk_print_settings_set_num_copies (GtkPrintSettings *settings,
gint num_copies)
gtk_print_settings_set_n_copies (GtkPrintSettings *settings,
gint num_copies)
{
gtk_print_settings_set_int (settings, GTK_PRINT_SETTINGS_NUM_COPIES,
gtk_print_settings_set_int (settings, GTK_PRINT_SETTINGS_N_COPIES,
num_copies);
}
......
......@@ -92,7 +92,7 @@ void gtk_print_settings_set_int (GtkPrintSettings
#define GTK_PRINT_SETTINGS_PAPER_FORMAT "paper-format"
#define GTK_PRINT_SETTINGS_PAPER_WIDTH "paper-width"
#define GTK_PRINT_SETTINGS_PAPER_HEIGHT "paper-height"
#define GTK_PRINT_SETTINGS_NUM_COPIES "num-copies"
#define GTK_PRINT_SETTINGS_N_COPIES "n-copies"
#define GTK_PRINT_SETTINGS_DEFAULT_SOURCE "default-source"
#define GTK_PRINT_SETTINGS_QUALITY "quality"
#define GTK_PRINT_SETTINGS_RESOLUTION "resolution"
......@@ -150,8 +150,8 @@ void gtk_print_settings_set_duplex (GtkPrintSettings *se
GtkPrintQuality gtk_print_settings_get_quality (GtkPrintSettings *settings);
void gtk_print_settings_set_quality (GtkPrintSettings *settings,
GtkPrintQuality quality);
gint gtk_print_settings_get_num_copies (GtkPrintSettings *settings);
void gtk_print_settings_set_num_copies (GtkPrintSettings *settings,
gint gtk_print_settings_get_n_copies (GtkPrintSettings *settings);
void gtk_print_settings_set_n_copies (GtkPrintSettings *settings,
gint num_copies);
gint gtk_print_settings_get_number_up (GtkPrintSettings *settings);
void gtk_print_settings_set_number_up (GtkPrintSettings *settings,
......
......@@ -58,6 +58,9 @@
static void gtk_print_unix_dialog_destroy (GtkPrintUnixDialog *dialog);
static void gtk_print_unix_dialog_finalize (GObject *object);
static GObject* gtk_print_unix_dialog_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_params);
static void gtk_print_unix_dialog_set_property (GObject *object,
guint prop_id,
const GValue *value,
......@@ -206,6 +209,7 @@ gtk_print_unix_dialog_class_init (GtkPrintUnixDialogClass *class)
widget_class = (GtkWidgetClass *) class;
object_class->finalize = gtk_print_unix_dialog_finalize;
object_class->constructor = gtk_print_unix_dialog_constructor;
object_class->set_property = gtk_print_unix_dialog_set_property;
object_class->get_property = gtk_print_unix_dialog_get_property;
......@@ -245,6 +249,7 @@ gtk_print_unix_dialog_class_init (GtkPrintUnixDialogClass *class)
GTK_TYPE_PRINTER,
GTK_PARAM_READABLE));
g_type_class_add_private (class, sizeof (GtkPrintUnixDialogPrivate));
}
......@@ -262,8 +267,6 @@ gtk_print_unix_dialog_init (GtkPrintUnixDialog *dialog)
priv->page_setup = gtk_page_setup_new ();
populate_dialog (dialog);
g_signal_connect (dialog,
"destroy",
(GCallback) gtk_print_unix_dialog_destroy,
......@@ -278,6 +281,29 @@ gtk_print_unix_dialog_init (GtkPrintUnixDialog *dialog)
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE);
}
static GObject *
gtk_print_unix_dialog_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_params)
{
GtkPrintUnixDialog *dialog;
GObject *object;
object =
G_OBJECT_CLASS (gtk_print_unix_dialog_parent_class)->constructor (type,
n_construct_properties,
construct_params);
/* We need to populate the dialog after the transient-to has been set.
* See bug #340401.
*/
dialog = GTK_PRINT_UNIX_DIALOG (object);
populate_dialog (dialog);
return object;
}
static void
gtk_print_unix_dialog_destroy (GtkPrintUnixDialog *dialog)
{
......@@ -2334,15 +2360,13 @@ gtk_print_unix_dialog_new (const gchar *title,
if (title)
_title = title;
result = g_object_new (GTK_TYPE_PRINT_UNIX_DIALOG,
"transient-for", parent,
"title", _title,
"has-separator", FALSE,
NULL);
if (parent)
gtk_window_set_transient_for (GTK_WINDOW (result), parent);
return result;
}
......@@ -2534,7 +2558,7 @@ gtk_print_unix_dialog_set_settings (GtkPrintUnixDialog *dialog,
{
dialog_set_collate (dialog, gtk_print_settings_get_collate (settings));
dialog_set_reverse (dialog, gtk_print_settings_get_reverse (settings));
dialog_set_n_copies (dialog, gtk_print_settings_get_num_copies (settings));
dialog_set_n_copies (dialog, gtk_print_settings_get_n_copies (settings));
dialog_set_scale (dialog, gtk_print_settings_get_scale (settings));
dialog_set_page_set (dialog, gtk_print_settings_get_page_set (settings));
dialog_set_print_pages (dialog, gtk_print_settings_get_print_pages (settings));
......@@ -2610,8 +2634,8 @@ gtk_print_unix_dialog_get_settings (GtkPrintUnixDialog *dialog)
gtk_print_settings_set_reverse (settings,
dialog_get_reverse (dialog));
gtk_print_settings_set_num_copies (settings,
dialog_get_n_copies (dialog));
gtk_print_settings_set_n_copies (settings,
dialog_get_n_copies (dialog));
gtk_print_settings_set_scale (settings,
dialog_get_scale (dialog));
......
......@@ -830,7 +830,7 @@ gtk_recent_manager_get_limit (GtkRecentManager *manager)
*/
gboolean
gtk_recent_manager_add_item (GtkRecentManager *manager,
const gchar *uri);
const gchar *uri)
{
GtkRecentData *recent_data;
GError *add_error;
......@@ -916,8 +916,7 @@ gtk_recent_manager_add_item (GtkRecentManager *manager,
gboolean
gtk_recent_manager_add_full (GtkRecentManager *manager,
const gchar *uri,
const GtkRecentData *data,
GError **error)
const GtkRecentData *data)
{
GtkRecentManagerPrivate *priv;
......@@ -959,7 +958,7 @@ gtk_recent_manager_add_full (GtkRecentManager *manager,
{
g_warning ("Attempting to add `%s' to the list of recently used "
"resources, but no name of the application that is "
"registering it was defined"
"registering it was defined",
uri);
return FALSE;
}
......
......@@ -89,6 +89,7 @@ enum {
PROP_DECORATED,
PROP_DELETABLE,
PROP_GRAVITY,
PROP_TRANSIENT_FOR,
/* Readonly properties */
PROP_IS_ACTIVE,
......@@ -657,6 +658,23 @@ gtk_window_class_init (GtkWindowClass *klass)
GDK_GRAVITY_NORTH_WEST,
GTK_PARAM_READWRITE));
/**
* GtkWindow:transient-for:
*
* The transient parent of the window. See gtk_window_set_transient_for() for
* more details about transient windows.
*
* Since: 2.10
*/
g_object_class_install_property (gobject_class,
PROP_TRANSIENT_FOR,
g_param_spec_object ("transient-for",
P_("Transient for Window"),
P_("The transient parent of the dialog"),
GTK_TYPE_WINDOW,
GTK_PARAM_READWRITE| G_PARAM_CONSTRUCT));
window_signals[SET_FOCUS] =
g_signal_new (I_("set_focus"),
G_TYPE_FROM_CLASS (gobject_class),
......@@ -903,6 +921,9 @@ gtk_window_set_property (GObject *object,
case PROP_GRAVITY:
gtk_window_set_gravity (window, g_value_get_enum (value));
break;
case PROP_TRANSIENT_FOR:
gtk_window_set_transient_for (window, g_value_get_object (value));
break;
default:
break;
}
......@@ -1011,6 +1032,9 @@ gtk_window_get_property (GObject *object,
case PROP_GRAVITY:
g_value_set_enum (value, gtk_window_get_gravity (window));
break;
case PROP_TRANSIENT_FOR:
g_value_set_object (value, gtk_window_get_transient_for (window));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -1878,7 +1902,6 @@ gtk_window_set_transient_for (GtkWindow *window,
g_return_if_fail (parent == NULL || GTK_IS_WINDOW (parent));
g_return_if_fail (window != parent);
if (window->transient_parent)
{
if (GTK_WIDGET_REALIZED (window) &&
......
......@@ -2483,9 +2483,9 @@ cups_printer_prepare_for_print (GtkPrinter *printer,
gtk_print_settings_set (settings, "cups-OutputOrder", "Reverse");
print_job->reverse = FALSE;
if (gtk_print_settings_get_num_copies (settings) > 1)
if (gtk_print_settings_get_n_copies (settings) > 1)
gtk_print_settings_set_int (settings, "cups-copies",
gtk_print_settings_get_num_copies (settings));
gtk_print_settings_get_n_copies (settings));
print_job->num_copies = 1;
scale = gtk_print_settings_get_scale (settings);
......
......@@ -468,7 +468,7 @@ lpr_printer_prepare_for_print (GtkPrinter *printer,
print_job->collate = gtk_print_settings_get_collate (settings);
print_job->reverse = gtk_print_settings_get_reverse (settings);
print_job->num_copies = gtk_print_settings_get_num_copies (settings);
print_job->num_copies = gtk_print_settings_get_n_copies (settings);
scale = gtk_print_settings_get_scale (settings);
if (scale != 100.0)
......
......@@ -438,7 +438,7 @@ pdf_printer_prepare_for_print (GtkPrinter *printer,
print_job->collate = gtk_print_settings_get_collate (settings);
print_job->reverse = gtk_print_settings_get_reverse (settings);
print_job->num_copies = gtk_print_settings_get_num_copies (settings);
print_job->num_copies = gtk_print_settings_get_n_copies (settings);
scale = gtk_print_settings_get_scale (settings);
if (scale != 100.0)
......
......@@ -298,7 +298,7 @@ begin_print (GtkPrintOperation *operation,
}
page_breaks = g_list_reverse (page_breaks);
gtk_print_operation_set_nr_of_pages (operation, g_list_length (page_breaks) + 1);
gtk_print_operation_set_n_pages (operation, g_list_length (page_breaks) + 1);
print_data->page_breaks = page_breaks;
......
......@@ -97,7 +97,7 @@ main (int argc, char **argv)
print = gtk_print_operation_new ();
gtk_print_operation_set_print_settings (print, settings);
gtk_print_operation_set_nr_of_pages (print, 1);
gtk_print_operation_set_n_pages (print, 1);
gtk_print_operation_set_unit (print, GTK_UNIT_MM);
gtk_print_operation_set_show_dialog (print, FALSE);
g_signal_connect (print, "draw_page", G_CALLBACK (draw_page), NULL);
......
......@@ -106,7 +106,7 @@ main (int argc, char **argv)
/* Test some random drawing, with per-page paper settings */
print = gtk_print_operation_new ();
gtk_print_operation_set_nr_of_pages (print, 2);
gtk_print_operation_set_n_pages (print, 2);
gtk_print_operation_set_unit (print, GTK_UNIT_MM);
gtk_print_operation_set_pdf_target (print, "test.pdf");
g_signal_connect (print, "draw_page", G_CALLBACK (draw_page), NULL);
......
......@@ -70,7 +70,7 @@ test_print_file_operation_begin_print (GtkPrintOperation *operation, GtkPrintCon
op->num_lines = i;
op->num_pages = (op->num_lines - 1) / op->lines_per_page + 1;
gtk_print_operation_set_nr_of_pages (operation, op->num_pages);
gtk_print_operation_set_n_pages (operation, op->num_pages);
}
static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment