Ok I found it, the code which I am talking about is in [1]:
In line 818 (see grep [3]):
case GTK_PRINTER_OPTION_TYPE_FILESAVE:
and in line 828:
priv->combo = gtk_file_chooser_button_new (_("Select a folder"),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
and in line 835 following:
label = gtk_label_new_with_mnemonic (_("_Name:"));
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->entry);
gtk_grid_attach (GTK_GRID (priv->filechooser), label, 0, 0, 1, 1);
gtk_grid_attach (GTK_GRID (priv->filechooser), priv->entry, 1, 0, 1, 1);
label = gtk_label_new_with_mnemonic (_("_Save in folder:"));
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->combo);
The config option seems to be activated in [2]:
option = gtk_printer_option_new ("gtk-main-page-custom-input", _("File"),
GTK_PRINTER_OPTION_TYPE_FILESAVE);
So I believe it would be enough to change the
gtkprinteroptionwidget.c at line 828 following to
GTK_FILE_CHOOSER_ACTION_OPEN, and instead of creating the two
widgets (entry and filechooser), we could just use the file choose.
Of course the callback
filesave_changed_cb
would need to be modified too.
Does anyone like my proposal?
Regards
Lanoxx
[1] http://git.gnome.org/browse/gtk+/tree/gtk/gtkprinteroptionwidget.c
[2]
http://git.gnome.org/browse/gtk+/tree/modules/printbackends/file/gtkprintbackendfile.c
[3] grep -rn GTK_PRINTER_OPTION_TYPE_FILESAVE *
gtk/gtkprinteroption.h:54: GTK_PRINTER_OPTION_TYPE_FILESAVE,
gtk/gtkprinteroptionwidget.c:818: case
GTK_PRINTER_OPTION_TYPE_FILESAVE:
gtk/gtkprinteroptionwidget.c:928: case
GTK_PRINTER_OPTION_TYPE_FILESAVE:
gtk/gtkprintunixdialog.c:531: option->type
== GTK_PRINTER_OPTION_TYPE_FILESAVE)
modules/printbackends/file/gtkprintbackendfile.c:720:
GTK_PRINTER_OPTION_TYPE_FILESAVE);
On 15/08/12 22:38, Lanoxx wrote:
On 15/08/12 20:27, Javier Jardón wrote:
On 15 August 2012 23:08, Lanoxx
<lanoxx gmx net> wrote:
Hi,
Hello,
Then the filename says output.pdf which
any sane person will probably want
to change. So I have to type the file name and then also add
.pdf again and
finally I can click "Print".
FYI, There is a GnomeGoal proposed related to this [1]
[1] https://live.gnome.org/GnomeGoals/PrintToFile
Thats a great goal, and should definitely be implemented. But
still it does not solve the actual problem which I described. I
also looked here:
http://git.gnome.org/browse/gtk+/tree/modules/printbackends/file/gtkprintbackendfile.c
but I can't find any GtkWidget being created, so I guess thats not
it.
_______________________________________________
desktop-devel-list mailing list
desktop-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/desktop-devel-list
|