After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 587053 - set print to file filename
set print to file filename
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on: 587086 657322
Blocks:
 
 
Reported: 2009-06-26 14:24 UTC by Matthias Clasen
Modified: 2013-04-06 05:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
this does it (1.08 KB, patch)
2009-06-26 14:24 UTC, Matthias Clasen
none Details | Review
handle NULL dir (1.20 KB, patch)
2009-06-26 15:04 UTC, Matthias Clasen
none Details | Review
last version of the patch (1.30 KB, patch)
2009-06-26 21:10 UTC, Matthias Clasen
none Details | Review
Set default print to file filename to short document name (1.34 KB, patch)
2012-05-25 05:34 UTC, Timothy Arceri
accepted-commit_now Details | Review

Description Matthias Clasen 2009-06-26 14:24:19 UTC
It is a nice little touch to set a meaningful name for print-to-file when showing the print dialog.
Comment 1 Matthias Clasen 2009-06-26 14:24:55 UTC
Created attachment 137421 [details] [review]
this does it
Comment 2 Paolo Borelli 2009-06-26 14:31:20 UTC
is g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS) always guaranteed to not return null?

Also, the patch hardcodes .pdf, what happens if ps is selected instead in the print dialog? can we inspect that setting and figure out the rigth extension?


(patch looks good apart from the above comments)
Comment 3 Matthias Clasen 2009-06-26 14:37:02 UTC
Oh,  you are right about g_get_user_special_dir possibly returning NULL. Need to handle that.

Wrt to .pdf, the print dialog replaces the extension when you change to ps, afair. Quick testing seems to confirm that.
Comment 4 Matthias Clasen 2009-06-26 15:04:20 UTC
Created attachment 137425 [details] [review]
handle NULL dir
Comment 5 Paolo Borelli 2009-06-26 15:13:30 UTC
well, what I meant is the case when the dialog comes up set to ps in the first place (it happens here if you set ps the last time you used it)
Comment 6 jessevdk@gmail.com 2009-06-26 15:14:57 UTC
Also, the second patch doesn't actually use the dir variable when constructing the uri.
Comment 7 Matthias Clasen 2009-06-26 18:49:49 UTC
Yeah, but hold on anyway. I just discovered that this doesn't work correctly when switching between cups and file printers anyway. Switching back and force replaces the nice name by the default output.pdf. Something to fix in GTK+ first, I guess
Comment 8 Matthias Clasen 2009-06-26 21:10:28 UTC
Created attachment 137441 [details] [review]
last version of the patch
Comment 9 Paolo Borelli 2009-06-27 10:48:00 UTC
Thinking again about it, maybe we should get the dirname of the file instead of using documents dir?
I have to admit I am not a user of the "Documents" directory etc, so I am biased, but putting it alongside the actual file seems a better idea to me.

apart from that the patch looks good to me... it is not clear to me if we should wait for the gtk bug to be fixed or if it is safe to apply with older gtk.
Comment 10 Javier Jardón (IRC: jjardon) 2010-10-11 04:06:59 UTC
Hello Paolo,

Could you take a second look, now that the blocker bug is fixed?
Comment 11 Paolo Borelli 2010-10-11 11:23:05 UTC
As said in the previous comment, I am not a big fan of the "Documents" xdg dir, I never find stuff in it.

That said, the patch is better than what we have now so I am not opposed to including it.

However I wonder if we should not improve the gtk api instead: it is a bit lame to have to do "if (ps) ext=.ps else ext=.pdf" in all the apps: maybe gtk could have print settings for OUTPUT_DIR_URI and OUTPUT_BASENAME and figure out the extension itself
Comment 12 Timothy Arceri 2011-08-25 11:30:34 UTC
I have filed a blocker bug here: https://bugzilla.gnome.org/show_bug.cgi?id=657322
Comment 13 André Klapper 2011-08-25 11:33:55 UTC
(In reply to comment #12)
> I have filed a blocker bug

...adding it to Dependency list.
Comment 14 Timothy Arceri 2012-01-27 08:40:07 UTC
I have submitted a patch to support the new GTK settings in bug 657322
Comment 15 Timothy Arceri 2012-05-25 05:34:36 UTC
Created attachment 214914 [details] [review]
Set default print to file filename to short document name

Updated patch to use new print settings currently in gtk master
Comment 16 André Klapper 2012-07-30 17:21:46 UTC
ping - can Timothy's patch get a review?
Comment 17 Sebastian 2012-08-20 13:40:51 UTC
I think we should set GTK_PRINT_SETTINGS_OUTPUT_URI instead of BASENAME, or maybe both? Besides that the patch looks good.
Comment 18 Sebastian 2012-08-22 09:53:48 UTC
Review of attachment 214914 [details] [review]:

The patch is great. It would be really nice if this could get commited. Despite what i wrote in Comment #17, the BASENAME is just fine.
Comment 19 Paolo Borelli 2012-09-05 17:43:21 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

Sorry for the loooong delay and thanks for the persistence in getting this issue fixed.
Comment 20 Redsandro 2013-03-28 14:56:27 UTC
Just curious here: I found this report while searching before almost submitting a similar report on the six year anniversary of this annoyance, because I haven't seen this fixed in the latest fully updated Ubuntu or Linux Mint. 

But as stated above, the issue was patched nearly a year and merged over half a year ago. Is this fix still 'too new' or do they need to actively implement or backport this fix before 'we' (end users) can throw a party over this?
Comment 21 Timothy Arceri 2013-04-06 05:52:36 UTC
The fix hit the development version of gedit only a month before the last Ubuntu release so its most likely not in there yet. The 13.04 release of Ubuntu should have it though which is due out this month (April 25th)