Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 299550

Summary: [GTK] Make "Print Selection" work
Product: [Eclipse Project] Platform Reporter: Carolyn MacLeod <carolynmacleod4>
Component: SWTAssignee: Eric Williams <ericwill>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe, ericwill, kalle, pinnamur, thomas.koehler.rovema
Version: 3.5Keywords: triaged
Target Milestone: 4.14 M1   
Hardware: PC   
OS: Linux-GTK   
See Also: https://git.eclipse.org/r/149080
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=a323d29b464742ac12e5cb42948bc0d6f843f3c7
Whiteboard: RHT

Description Carolyn MacLeod CLA 2010-01-13 14:58:28 EST
Since gtk bug http://bugzilla.gnome.org/show_bug.cgi?id=344519
has now been fixed, we should use this feature in the GTK print dialog.

We need to show the "Selection" radio by default when the dialog is opened, and then we need to set and get the value of the radio before and after the PrintDialog is opened.

I believe the new radio will show up if you set gtk_print_unix_dialog_set_support_selection(true)

Then, if the scope in our PrinterData is set to PrinterData.SELECTION, we need to set (and get) GTK_PRINT_PAGES_SELECTION in the gtk_print_settings_print_pages field of the gtk_print_settings struct.
Comment 1 Carolyn MacLeod CLA 2010-01-13 15:01:02 EST
See also bug 25554 which asks for the ability to hide the "print selection" radio in the dialog.
Comment 2 Carolyn MacLeod CLA 2010-01-13 15:02:10 EST
Also, please make sure that this feature is only called if the gtk version is > 2.18.
Comment 3 Carolyn MacLeod CLA 2010-02-11 10:52:49 EST
while you are in the area...   :)
Comment 4 Thomas Köhler CLA 2014-03-24 12:16:05 EDT
Isn't there any progress on this topic ? Now we are in 2014, eclipse-version 4.3.2 and still no possibility to print only a selection of code without copy/paste and an external editor !
Is this such a complicated issue or is it only a matter of importance/resources ?
Comment 5 Eric Williams CLA 2019-01-18 11:44:03 EST
Still valid.
Comment 6 Kalle Tuulos CLA 2019-09-03 04:18:59 EDT
Added myself to Cc list.

Nowadays I need to have two Eclipse installations - one on Linux for daily work and another on Windows to be able to print some snippets of code, as the "print selection" works only on Windows version.

The Eclipse version is 4.12.0 on both Windows and Linux.
Comment 7 Eric Williams CLA 2019-09-06 09:39:26 EDT
I think this merits investigation for 4.14.
Comment 8 Eric Williams CLA 2019-09-06 13:28:05 EDT
(In reply to Eric Williams from comment #7)
> I think this merits investigation for 4.14.

I believe I've managed to get a proof of concept working, so I'll take this one for M1.
Comment 9 Eclipse Genie CLA 2019-09-06 14:03:07 EDT
New Gerrit change created: https://git.eclipse.org/r/149080
Comment 11 Eric Williams CLA 2019-09-11 15:07:40 EDT
(In reply to Eclipse Genie from comment #10)
> Gerrit change https://git.eclipse.org/r/149080 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=a323d29b464742ac12e5cb42948bc0d6f843f3c7

In master now.
Comment 12 Eric Williams CLA 2019-10-08 13:30:43 EDT
Verified in I20191008-0600.