GNOME Bugzilla – Bug 336507
"export to html" save dialog is an old style gtk file chooser
Last modified: 2008-02-26 20:52:47 UTC
when the "export to html" feature ask where save the html file, tomboy shows an old style gtk file chooser (maybe from gtk-1.0?)
Created attachment 73087 [details] [review] Possible fix that uses Gtk.FileChooserDialog Unfortunately, this patch does not work. For some reason, I get the following: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object in <0x0019c> Gtk.FileChooserDialog:.ctor (System.String title, Gtk.Window parent, FileChooserAction action, System.Object[] button_data) in <0x00029> ExportToHTMLDialog:.ctor (System.String default_file) in <0x00094> ExportToHTMLPlugin:ExportButtonClicked (System.Object sender, System.EventArgs args) in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs) in <0x00093> GLib.Signal:voidObjectCallback (IntPtr handle, IntPtr gch) in (wrapper native-to-managed) GLib.Signal:voidObjectCallback (intptr,intptr) in <0x00000> <unknown method> in (wrapper managed-to-native) Gtk.Application:gtk_main () in <0x00007> Gtk.Application:Run () in <0x00007> Gnome.Program:Run () in <0x00011> Tomboy.Application:StartMainLoop () in <0x0003a> Tomboy.Tomboy:StartTrayIcon () in <0x00126> Tomboy.Tomboy:Main (System.String[] args) I'm not sure exactly why. Perhaps the Gtk# bindings are broken? The patch included in openSUSE includes custom bindings. I'll rework the patch to include that and post it here shortly.
Looks like this bug really ought to be a duplicate of http://bugzilla.gnome.org/show_bug.cgi?id=320967. In any case, since that one is closed, I'll rework the patch that was already included there and include it here.
Created attachment 73093 [details] [review] Working patch that uses Gtk.FileChooserDialog This patch uses custom C# bindings and works.
I'd really prefer not to perpetuate more broken bindings patches. This was the point behind moving to Gtk#2. With your original patch, which looks good, have you tried passing the button data in the constructor? If that doesn't work, passing just an empty "new object[] { }" may fix the problem.
*** Bug 320967 has been marked as a duplicate of this bug. ***
Created attachment 73100 [details] [review] Working patch w/o using custom bindings Alex, good call on passing in an empty object array. This patch works now. I'll attach a screenshot.
Created attachment 73101 [details] Screenshot of new HTML Export save dialog
Awesome. Please test that trying to overwrite an existing file warns the user and that if accepted, the save actually overwrites it. And feel free to commit when you're ready.
Tested the overwrite notification, verified that overwriting actually works, and made a couple last-minute fixes. Checked-in to CVS HEAD.