<paolo> hi guys
<paolo> pbor: this night I was bored, actually my little baby didn't want to sleep, so I worked a bit on the close_all stuff
<paolo> pbor: I made a glade file with a mockup for the dialog and I have written all the missing code in bonobo-mdi and gedit-mdi to implement the feature
<paolo> I still need to write the code to manage the dialog
<pbor> I've actuall done a bit of that stuff too... I was just putting a screenshot on the bug :)
<paolo> great
<paolo> we can share our work then
<paolo> I'm willing to make you finish it
<paolo> a part from the bonobo-mdi/gedit-mdi part that needed some architectural change
<pbor> I must admit that mine is mostly a hack (no glade) and beside doing the dialog is one thing but hookin it up is another
<paolo> I'm attaching my dialog too to the bug report
<pbor> ok I've attached a screenshot too
<pbor> and also some questions/doubts
<paolo> I have just attached my sshot and the reply to your questions
<paolo> I think we could procede in the following way:
<paolo> - finish the UI design
<paolo> s/finish/finishing
* pbor wonders how he missied view->close all, after having used it many times...
<paolo> - I will implement the code needed to hook the dialog in gedit
<pbor> ok
<paolo> - you will implement the code needed to manage the dialog
<paolo> i.e. a simple interface:
<pbor> sounds good
<paolo> GList *gedit_close_all_dialog_show (const GList *unsaved_documents)
<paolo> it will returns the list of selected documents
<paolo> hmm... probably it also need the parent window
<paolo> and a better name
<paolo> is it ok?
<pbor> not sure if that will work... how do you distinguish save none and exit from cance?
<pbor> cancel even
<pbor> I made mine return a gboolean
<paolo> right
<pbor> and either, return the list by reference or save direcltly in the dialog func (as is currently done for the single doc)
<paolo> we need a more complex interface
<paolo> we need to write a GeditCloseAllDialog widget that extends GtkDialog
<paolo> with two functions
<paolo> GtkWidget *gedit_close_all_dialog_new (const GList *unsaved_documents);
<paolo> GList *gedit_close_all_dialog_get_selected_documents (dialog);
<paolo> when Save is pressed GEDIT_RESPONSE_SAVE is returned as response
<paolo> when Cancel is pressed -> GTK_RESPONSE_CANCEL
<paolo> it is ok?
<pbor> that would work for sure, but maybe we can do with a simpler function...
<pbor> where are you going to hook up the test?
<paolo> in gedit-mdi.c
<pbor> ie, are you adding another signal for close all?
<pbor> btw, not strictly related but note that if only one doc is open the usual dialog should be displayed
<paolo> yep, I have added a remove_views signal to BonoboMDI
<paolo> pbor: yep
<paolo> it is emitted before closing a window (it does not matter in which way)
<pbor> then is it's something similar to the api for the current one-doc dialog, my current interface is simply
<paolo> if tha signal handler return TRUE the window will be close
<paolo> otherwise no
<pbor> gboolean gedit_whatever_confirm_close_all (BonoboMDI)
<paolo> in the signal handler I look for unsaved documents in the window
<paolo> display the dialog
<paolo> actually save the documents
--> Taeko_ (irotas@146-115-126-186.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com) has joined #gedit
<paolo> and let the window close in the normal way
<pbor> runs the dialog internally and if needed save requested docs, returns FALSE on cancel, true on save{selected|none}
--> irotas (~irotas@146-115-126-186.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com) has joined #gedit
<paolo> where is it called?
<pbor> in my hack it was simply called in gedit_file_close_all, but was just to make it dispaly I think that in gedit-mdi should work fine since it's really similar to the current one-doc func (also that one runs the dialog internally and takes care of saving the doc)
<paolo> hmm... I prefer to have the UI somewhat splitted by the real logic
<paolo> I think the solution I proposed (the widget + 2 functions) is more elegant
<paolo> you should consider that part of the gedit code is old and crappy
<-- Taeko has quit (Ping timeout: 600 seconds)
--- Taeko_ is now known as Taeko
<paolo> I rewrote it when I ported it to gnome 2 but it still use part of the code of the old gedit
<-- irotas_ has quit (Ping timeout: 600 seconds)
<pbor> yeah,that makes lot of sense as I said I only followed what was already done for the current dialog...
<paolo> can you write the dialog part then?
<pbor> (the pro is that it's simply a 100 lines func without all the boilerplate gobject code)
<paolo> hehe... you can use the BOILERPLATE macros
<paolo> which mockup do you prefer?
<pbor> I think so (the only problem I have still to investigate is how to get the list of file to save from the treeview)... on the other hand if you already have the dialog half-done you probably can get it done faster, I don't want to be a blocker...
<pbor> about the ui: I'm biased ;-) but I think we cam do without the "All" "None" buttons on the side (not very Gnomish), as a said having "Save None" and "save Selected" removes the need for them
<paolo> look at the gedit-plugin-manager code
<pbor> ok
<paolo> yeah, I agree
<paolo> I'm going to modify the glade file and attach it to the bug report
<pbor> about the messages and their placement I don't have a strong opnion
<paolo> Do you prefer "Save None" of "Don't Save"?
<pbor> Save None is clearer IMHO
<paolo> For the messages I made a mix using the Aqua HIG document and the GNOME HIG
<pbor> <nitpicking> the treeview should also span under the alert icon</> :-)
<pbor> and the current one doc dialog has a "question" icon not an alert...
<paolo> the Aqua HIG use "Discard Changes" or "Don't Save"
<paolo> The current dialog should use a "alert" icon (I will rewrite it to be more HIG compliant)
<paolo> about the treeview, I don't know
<pbor> dunno... asking in usability probably... I still think that Save None is more clear for multiple docs
<paolo> ok
<pbor> I checked the HIG and the right icon is the one with the "!", however note that example dialogs word the messages as questions e.g "Save the following files?" -> response: "Save Selected", "Save None" looks good to me
<pbor> actually I was thinking that even if both of us like this kind of dialog, we may want to ping usabilty crew before changing
<pbor> btw can you attach this IRC log to the bug?
<pbor> (I have no idea how to grab it)
<paolo> select it and copy with the middle mouse button 
<paolo> or Window->Save Text
<paolo> hmm... my dialog has "Select documents you want to save" -> "Don't Save" and "Save" look better
<paolo> but it is not a big proble we can change it later
<pbor> ok I'll add this log and cc usabilty
<paolo> I think we should implement the dialog and the ask comments... you know the usability guys are looooooong
<pbor> eheh
<paolo> and feature freeze is in a few days
