Commit Graph

231 Commits

Author SHA1 Message Date
Philip Withnall
ac4da770e1 gtkprintunixdialog: Fix a potential g_object_unref(NULL) call
The code above checks whether (printer == NULL), so we’d better do so
here as well.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-10 07:32:19 +00:00
Philip Withnall
af36220bca gtkprintcontext: Fix several potential g_object_[un]ref(NULL) calls
The page_setup of a GtkPrintContext or GtkPrintUnixDialog is nullable,
so all reference count changes to it have to be guarded against NULL
values.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Matthias Clasen
768e6a4579 Ensure print-related types are registered
These types are not covered by g_test_register_all_types,
and having the types registered when a print dialog is used
helps in cases where GTK+ is dlopened.

https://bugzilla.gnome.org/show_bug.cgi?id=745065
2015-03-04 20:37:01 -05:00
Matthias Clasen
a03583d14f printing: Avoid missing icons
I've noticed a missing image show up in my print dialog, where
the printer reported "printer-paused" as icon. Rearrange things
so we always fall back to "printer" for printer icons.
2014-10-04 12:20:23 -04:00
Matthias Clasen
f634684eeb printing: Another tweak to sheet drawing
After consultation, revisit the vertical centering to center
the first 'stack', and put the second one behind it.
2014-10-04 11:56:44 -04:00
Benjamin Otte
82b7d21f6e print: Add a .paper style class
... and use it in the print preview.
2014-10-04 17:18:50 +02:00
Matthias Clasen
4bc09a6a17 printing: Simplify sheet drawing
We don't need the scaling support anymore - icon sizes are
no longer settable.
2014-10-04 11:00:10 -04:00
Matthias Clasen
10d0dad2cf print: Center sheet drawing horizontally
Center the page ordering indicator horizontally, relative to the
spinbutton above it.
2014-10-04 10:55:13 -04:00
Matthias Clasen
99c65b1587 print: Center sheet drawing vertically
Center the page ordering indicator vertically, relative to the
checkboxes next to it.
2014-10-04 10:55:06 -04:00
Benjamin Otte
39453478ab print: Improve sheet drawing a bit
This is only one step in the right direction. Long term this code should
probably be replaced by real widgets.
2014-10-03 06:18:06 +02:00
Jasper St. Pierre
9c37b3de74 gtk: Don't use GObjectClass.constructor
Use the newer constructed instead, which has a fast path in GObject.
2014-06-26 19:06:43 -04:00
Matthias Clasen
eec1bc7ed1 GtkPrintUnixDialog: Remove some dead code
Automatic template children get cleaned up and NULLed out in destroy,
the g_clear_pointer() calls in finalize never do anything.
2014-05-30 19:33:11 -04:00
Bastien Nocera
f71f7215ab all: Name more idles and timeouts
Following up from 438cd857c4,
name more timeouts and idles.

The original grep was missing checking for gdk_threads_add_*()
functions (at least for some of the files).

https://bugzilla.gnome.org/show_bug.cgi?id=726870
2014-03-26 20:09:30 -04:00
Marek Kasik
b95ce71b89 printing: Fail nicely when /tmp is not writable
Don't crash when /tmp is not writable when printing to file.
Show that getting of printer details failed for CUPS printers.

https://bugzilla.gnome.org/show_bug.cgi?id=693200
2014-03-17 14:37:34 -04:00
Marek Kasik
31748fa5c0 printing: Fix sensitivity of the Print button
Don't make Print button sensitive until a printer is selected.

https://bugzilla.gnome.org/show_bug.cgi?id=724895
2014-02-21 16:04:49 +01:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
7fbf6a67a2 Fix a small memory leak
GtkPrintUnixDialog was leaking a GFile.
Spotted by Christian Persch in
https://bugzilla.gnome.org/show_bug.cgi?id=724631
2014-02-19 00:31:40 -05:00
Matthias Clasen
2392b1e534 Make print dialog destruction work
This was also causing the templates test to fail.
2014-02-17 21:40:36 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
0ce016650b docs: Use markup for links 2014-02-07 09:42:12 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
William Jon McCann
3b3d8ca456 docs: Use "#" for refsect2 instead of ## 2014-02-04 21:00:58 -05:00
Matthias Clasen
09d1b28249 docs: Convert to markdown
Specifically, switch to using markdown syntax for sections.
2014-02-02 00:30:27 -05:00
William Jon McCann
768bc44081 docs: use |[ ]| instead of <programlisting></programlisting>
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
2d003553e8 docs: don't use <emphasis>
It is a little heavy handed. The text can speak for itself.
2014-01-28 02:02:05 -05:00
William Jon McCann
22586ea7c2 docs: use #*-struct instead of <structname> 2014-01-27 19:59:55 -05:00
Marek Kasik
8418e6422f printing: Enable search through locations in printers list
Add printer_compare() function for comparing printers according
to their names and locations. It is possible to search by multiple
keys separated by space or tabulator using logical conjunction.

Based on patch by William Hua.

https://bugzilla.gnome.org/show_bug.cgi?id=692931
2014-01-27 16:40:43 +01:00
Marek Kasik
f17b36dc02 printing: Show "Replace" button when printing to existing file
Use gtk_dialog_add_button() which adds the button to
the message dialog correctly and uses gtk_widget_show() on it.
2014-01-27 11:12:48 +01:00
William Jon McCann
4a11acdc8c resources: move resources into a subdirectory 2014-01-23 21:04:59 -05:00
William Jon McCann
0a16518bcf docs: fix links to print api 2014-01-21 18:57:38 -05:00
William Jon McCann
bb951fe783 print dialog: Use headerbar
Make the print dialog use a headerbar when desired.

https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:08 -05:00
Matthias Clasen
25e6ba48e7 Update all internal users of alternative button order
We'll keep this code around for now to not regress
on Windows, but avoid deprecation warnings.
2014-01-17 17:52:07 -05:00
Philip Withnall
b37f8b80b4 gtkprintunixdialog: Remove a redundant (GFile != NULL) check
g_file_new_for_uri() is guaranteed to return a non-NULL value, so this
check was redundant, and was confusing the static analyser into
returning a false positive, where it thought the file could be NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-12-02 10:36:26 +00:00
Matthias Clasen
56719c6363 Don't use depeprecated api
GtkPrintUnixDialog and testtitlebar were still using
gtk_widget_set_margin_left/right. Switch them over to
gtk_widget_set_margin_start/end.
2013-12-01 16:55:57 -05:00
Chenthill Palanisamy
1fd74de214 Do not reset the waiting_for_printer on status change
* gtk/gtkprintunixdialog.c (printer_status_cb): Do not reset the
waiting_for_printer on status change as the default printer might
get added later.

https://bugzilla.gnome.org/show_bug.cgi?id=577642
2013-11-05 13:33:40 +01:00
Matthias Clasen
66445fec1d Fix dark theme issues in the print dialog
The dimensions in the n-up illustration were not using the
color of the style for drawing.

https://bugzilla.gnome.org/show_bug.cgi?id=709420
2013-10-05 23:02:54 -04:00
Matthias Clasen
cda60c3c40 Another round of template binding api changes
We rename the gtk_widget_class_bind_template_child{_internal}
macros by appending a _private to their name. Otherwise, it
would be too magic to pass the 'public' names as arguments,
but affect a member of the Private struct. At the same time,

Add two new macros with the old names,
gtk_widget_class_bind_template_child{_internal} that operate
on members of the instance struct.
2013-07-26 16:29:12 -04:00
Emmanuele Bassi
89ae3524a3 Rename the widget template API
The macros and functions are inconsistently named, and are not tied to
the "template" concept - to the point that it seems plausible to use
them without setting the template.

The new naming scheme is as follows:

  gtk_widget_class_bind_template_child_full
  gtk_widget_class_bind_template_callback_full

With the convenience macros:

  gtk_widget_class_bind_template_child
  gtk_widget_class_bind_template_child_internal
  gtk_widget_class_bind_template_callback

https://bugzilla.gnome.org/show_bug.cgi?id=700898
https://bugzilla.gnome.org/show_bug.cgi?id=700896
2013-07-26 13:52:15 -04:00
Alexander Larsson
a8e84545d1 widget: Use a real offset in gtk_widget_class_automate_child
Using an offset from the struct means you can have children in
both the public and private (via G_PRIVATE_OFFSET) parts of the
instance. It also matches the new private macros nicer.

https://bugzilla.gnome.org/show_bug.cgi?id=702563

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2013-07-26 08:41:09 -04:00
Matthias Clasen
2f1fa7cdc3 Drop some unnecessary includes
Drop includes of deprecated headers where they are
no longer needed.
2013-07-19 22:32:23 -04:00
Matthias Clasen
0aa57d26b5 Move wholly deprecated classes to gtk/deprecated/
We've recently a number of classes wholly. For these cases,
move the headers and sources to gtk/deprecated/ and adjust
Makefiles and includes accordingly.

Affected classes:
GtkAction
GtkActionGroup
GtkActivatable
GtkIconFactory
GtkImageMenuItem
GtkRadioAction
GtkRecentAction
GtkStock
GtkToggleAction
GtkUIManager
2013-07-19 21:39:47 -04:00
William Jon McCann
2378bff415 Use proper quotation marks
As per https://wiki.gnome.org/GnomeOS/Design/Whiteboards/Typography
2013-07-17 22:37:50 -04:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
William Jon McCann
aef9dca9d5 Deprecate GtkIconFactory, GtkIconSet, GtkIconSource
We want to use GtkIconTheme instead. It is worth noting that
the parts that remain undeprecated are GtkIconSize and gtk_icon_size_lookup.
2013-06-26 20:02:27 -04:00
William Jon McCann
02c793f24a Start migrating internals away from GtkStock 2013-06-24 22:20:49 -04:00
Tristan Van Berkom
9accb95b9f GtkPrintUnixDialog: Define children with a GtkBuilder template 2013-04-08 21:19:29 +09:00
Cosimo Cecchi
7c1c7cb728 Don't use gtk_scrolled_window_add_with_viewport() internally
Just use gtk_container_add() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=693015
2013-02-01 22:58:54 -05:00
Philip Withnall
ceb866dfe6 Bug 595615 — Use proper ellipses
Use ‘…’ instead of ‘...’ in translatable strings.

Closes: https://bugzilla.gnome.org/show_bug.cgi?id=595615
2012-11-26 08:59:27 +00:00
Matthias Clasen
adcd3a039e Fix positioning of file format radios
When the file name changes, the file format radios were dancing
around. This commit keeps them flush right.
2012-08-31 22:50:29 -04:00
Cosimo Cecchi
f70fc49ebc docs: fix a number of typos and obsolete references 2012-07-02 10:41:11 -04:00
Matthias Clasen
a84effadc2 Cosmetics 2012-06-23 13:08:03 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Murray Cumming
a0b4ab109d Documentation: Correct references to properties.
These should use :, not ::, though signals would use ::.
See
http://developer.gnome.org/gtk-doc-manual/unstable/documenting_syntax.html.en
and
http://developer.gnome.org/gtk-doc-manual/unstable/documenting_symbols.html.en
2012-02-15 11:43:33 +01:00
Marek Kasik
f1995f80e7 GtkPrintUnixDialog: Hide unused tabs
Don't show tabs which are empty. This is related to
the recent GtkTable -> GtkGrid conversion. (#663479)
2012-01-05 13:17:46 +01:00
Javier Jardón
d005b01319 gtk/*: Use g_list_free_full() convenience function 2012-01-05 04:22:43 +01:00
Matthias Clasen
701c00e8cf Print dialog: small keynav improvement
Mark the page range entry and the copies spin button as
activates-default.

https://bugzilla.gnome.org/show_bug.cgi?id=662670
2011-10-26 22:11:17 -04:00
Cosimo Cecchi
99266c4ceb printunixdialog: fix a GtkTable->GtkGrid typo
Code was treating the GtkScrolledWindow as a grid, not the grid itself.
2011-10-24 16:33:00 -04:00
Matthias Clasen
227fafb93f GtkPrintUnixDialog: Replace GtkTable by GtkGrid 2011-08-28 01:34:17 -04:00
Diego Celix
0a75ffd4a3 gtkprintunixdialog: gtk_misc_set_alignment replace
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkprintunixdialog.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:54 -04:00
Matthias Clasen
310c0d440b GtkPrintUnixDialog: remove an unneeded include 2011-06-07 13:14:42 -04:00
Matthias Clasen
2f7e13067e GtkUnixPrintDialog: Don't use GtkAlignment
It is going to be deprecated soon. Instead, use
widget align and margin properties.
2011-06-06 22:36:39 -04:00
Javier Jardón
138409faae Move documentation to inline comments: GtkPrintUnixDialog 2011-04-18 02:08:36 +01:00
Matthias Clasen
32358a58f4 Avoid a warning out of the print dialog
Reported in https://bugzilla.gnome.org/show_bug.cgi?id=647152
2011-04-08 20:49:29 -04:00
Matthias Clasen
315bb30220 Fix some refcounting issues in the print dialog
gtk_tree_model_get returns a reference for objects, but the
printers in the model can be NULL,
https://bugzilla.gnome.org/show_bug.cgi?id=646446
2011-04-01 22:05:02 -04:00
Pavel Holejsovsky
2f0d40335b [GI] Add missing (transfer) annotations 2011-01-20 13:57:18 +01:00
Carlos Garnacho
4e73267325 Make GtkPrintUnixDialog use GtkStyleContext. 2011-01-10 03:50:00 +01:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Frederic Crozat
b673e5b1ee Scale down print dialog size
Shrink the preview display a little to make the print dialog
fit on a typical netbook screen.

https://bugzilla.gnome.org/show_bug.cgi?id=637958
2011-01-03 12:51:22 -05:00
Benjamin Otte
8f1f743903 gtk: Use g_object_unref instead of gdk_cursor_unref 2010-12-21 12:07:05 -05:00
Marek Kasik
da85312097 Mark conflicts when printer has changed
Schedule marking of conflicts when printer has changed.
Map conflict warning immediately. (#635401)
2010-12-08 17:37:27 +01:00
Michael Natterer
3a0afce509 gtk: remove "gboolean homogeneous" from gtk_box_new()
Because it's FALSE in virtually all use cases.
2010-10-31 19:22:28 +01:00
Javier Jardón
a9894d4cf4 Use gtk_box_new() instead gtk_[v|h]box_new() 2010-10-30 05:22:58 +02:00
Alberto Garcia
d6a73fd5b0 Assign all g_signal_connect() and friends to gulong variables
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=87821
2010-10-22 18:58:47 +02:00
Marek Kasik
95e69afea8 Parse lpoptions correctly
Parse options job-sheets, job-hold-until and sides correctly.
Add get_lpoption_name() for translation of lpoption names to
gtk option names. Usable for options which values don't need
conversion (e.g. number-up, number-up-layout, job-billing
and job-priority).
Rename array option_names to ppd_option_names to reflect its
purpose better. Rename get_option_name() to get_ppd_option_name()
because of the same reason.
2010-10-15 17:01:16 -04:00
Javier Jardón
e7f51ef6a4 Use the new GtkComboBoxText API
Also remove mentions of the old text convenience API from the docs,
and point to GtkComboBoxText instead.
2010-10-15 16:58:27 -04:00
Benjamin Otte
3f10e45ea1 printunixdialog: Connect to draw vfunc 2010-09-26 15:11:40 +02:00
Benjamin Otte
d207fd05e5 printunixdialog: Connect to draw signal for collate callback 2010-09-26 15:11:40 +02:00
Matthias Clasen
3c5f9fd1a2 Remove use of ::has-separator property 2010-09-06 00:26:17 -04:00
Matthias Clasen
d433a60611 Remove separators from dialogs
It seems more reasonable to remove this feature than to keep fighting
off every separator that pops up by accident in a dialog.
2010-09-02 09:14:20 -04:00
Javier Jardón
c05f344c0a Use gtk_window_has_group() to know if the window has an explicit window group.
gtk_window_get_group() never returns NULL; if the window isn't in a group,
a default window group is returned instead. Use gtk_window_has_group() instead.
This fixes some previous commits to use accessors to access GtkWindow.

Reported by Philip Withnall in bug
https://bugzilla.gnome.org/show_bug.cgi?id=627828
2010-08-24 16:16:42 +02:00
Javier Jardón
65a28efc15 gtk/gtkprintunixdialog.c: Use accessor functions to access GtkWindow 2010-08-23 20:19:44 +02:00
Javier Jardón
0a1130dcb9 gtk/gtkprintunixdialog.c: Use accessor functions to access GtkWidget 2010-08-22 22:56:17 +02:00
Philip Withnall
3eb197b51f Bug 596125 — Property string fixes 2010-08-10 09:23:49 +01:00
Javier Jardón
87b0f02403 GtkPrintUnixDialog: unseal private pointer 2010-07-14 02:11:00 +02:00
Javier Jardón
1af22acbf7 Use accessor functions to access GtkTable 2010-07-13 19:40:50 +02:00
Javier Jardón
7f2cc85db9 Use accessor functions to access GtkDialog 2010-07-13 19:40:47 +02:00
Javier Jardón
4427760bcc Use GtkBin accessors 2010-07-13 19:40:47 +02:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Javier Jardón
24bafd8693 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_NO_WINDOW)
Use new API instead: gtk_widget_set_has_window ()

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-06 11:37:06 +01:00
Javier Jardón
16a59ad912 Deprecate widget flag: GTK_WIDGET_REALIZED
Use gtk_widget_get_realized() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-03 20:41:05 +01:00
Javier Jardón
e8e95d4c5e Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_CAN_DEFAULT)
Use new API instead: gtk_widget_set_can_default ()
2010-03-02 07:58:05 +01:00
Javier Jardón
a27d5a2c9e Deprecate widget flag: GTK_WIDGET_IS_SENSITIVE
Use gtk_widget_is_sensitive() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 05:32:51 +01:00
Johan Dahlin
fe85272112 [annotations] Add allow-none
This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API

https://bugzilla.gnome.org/show_bug.cgi?id=610474
2010-02-19 17:57:51 -02:00
Christian Dywan
bb1824c131 Deprecate flag macros for toplevel, state, no window and composite child
Deprecate widget flag macros GTK_WIDGET_STATE, GTK_WIDGET_SAVED_STATE,
GTK_WIDGET_FLAGS, GTK_WIDGET_TOPLEVEL, GTK_WIDGET_NO_WINDOW and
GTK_WIDGET_COMPOSITE_CHILD.

Also deprecate the type macros GTK_WIDGET_TYPE, GTK_OBJECT_TYPE_NAME and
GTK_OBJECT_TYPE which have become redundant.

Instances of GTK_WIDGET_TOPLEVEL are replaced with gtk_widget_is_toplevel,
GTK_WIDGET_TYPE is replaced with G_OBJECT_TYPE, GTK_WIDGET_COMPOSITE_CHILD
is replaced with use of the "composite-child" property and uses of
GTK_WIDGET_NO_WINDOW are adjusted to use gtk_widget_get_has_window.

Uses of GTK_WIDGET_SAVED_STATE and GTK_WIDGET_FLAGS inside GtkWidget are
changed to direct flag usage.

Documentation is updated to refer to gtk_widget_set_has_window and
gtk_widget_get_has_window.

Gail and tests are updated as well.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-01-04 07:57:05 +01:00
Luca Ferretti
af6f5c1349 Add translators comments for tab labels (closes 599118) 2009-10-21 22:06:31 +02:00
Javier Jardón
6f6746389c Fix a compilation warning
Use switch instead if's to get a default value
2009-10-21 02:57:19 +02:00
Marek Kasik
5f4915f624 Don't hang print dialog when remote CUPS printer is not available
This patch tests availability of remote host before getting ppd file
for selected printer (#586207). It also adds a state message for
failure of getting details.
2009-09-23 14:35:26 +02:00
Marek Kasik
c44b0d2f7a Check for details request before print
Checks for details request before sending a job to a printer.
Shows busy state indication (cursor + status field).
This avoids printing to wrong printer (bug #576601).
2009-08-06 09:11:31 +02:00
Marek Kasik
98cdcce349 Change position of paper's dimensions according to reading direction
Change position of paper's dimensions in GtkPrintUnixDialog according
to reading direction.
2009-07-17 16:33:16 +02:00
Marek Kasik
0ef74c936f Add paper size combo and orientation combo to print dialog
Paper size combo and orientation combo can be added by
gtk_print_operation_set_embed_page_setup_dialog() to GtkPrinUnixDialog
now. This function induce calling of
gtk_print_unix_dailog_set_embed_page_setup_dialog() after creation of
dialog. These two functions control embed-page-setup-dialog properties
in GtkPrintOperation and in GtkPrintUnixDialog.
There is also new function gtk_print_unix_dialog_get_page_setup_set()
which says whether page setup was set by user.
Selected page setup is stored as default page setup in
GtkPrintOperation.
New class is added, its name is GtkCustomPaperUnixDialog. The class
manages custom sizes. It is derived from GtkPageSetupUnixDialog's
CustomPaperDialog structure.
Page layout preview is modified, so, it shows dimensions of current
page setup (mm or inch - depends on locale). It also shows the name of
actual paper if page setup dialog is not embedded (paper size combo is
not visible).
gtk-demo is actualized to include this new feature.
2009-07-10 11:28:31 +02:00