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 128810 - [ui-review] - HIGgify close confirmation dialog
[ui-review] - HIGgify close confirmation dialog
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
2.4.x
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
gedit QA volunteers
Depends on:
Blocks: 115437
 
 
Reported: 2003-12-08 13:58 UTC by Paolo Borelli
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (2.29 KB, patch)
2003-12-08 13:59 UTC, Paolo Borelli
none Details | Review
updated patch (3.65 KB, patch)
2003-12-21 17:37 UTC, Paolo Borelli
committed Details | Review
JBuilder screenshot (5.58 KB, image/png)
2003-12-30 17:06 UTC, Paolo Maggi
  Details
factor out gedit_document_get_deleted (2.60 KB, patch)
2004-01-06 13:55 UTC, Paolo Borelli
none Details | Review
sshot (64.08 KB, image/png)
2004-01-06 15:39 UTC, Paolo Borelli
  Details
Close All dialog mockup (17.32 KB, image/png)
2004-01-06 15:44 UTC, Paolo Maggi
  Details
discussion on ui and implementation (6.71 KB, text/plain)
2004-01-06 16:36 UTC, Paolo Borelli
  Details
Glade2 file of the mockup (11.57 KB, text/plain)
2004-01-06 16:37 UTC, Paolo Maggi
  Details
to put in gedit/dialogs (3.98 KB, text/plain)
2004-01-07 11:45 UTC, Paolo Borelli
  Details
right file hopefully (5.76 KB, text/plain)
2004-01-07 12:02 UTC, Paolo Borelli
  Details
some glue (4.62 KB, patch)
2004-01-07 12:03 UTC, Paolo Borelli
none Details | Review
.c file to put in dialogs (7.85 KB, text/plain)
2004-01-07 23:03 UTC, Paolo Borelli
  Details
glade file (10.14 KB, patch)
2004-01-07 23:04 UTC, Paolo Borelli
none Details | Review
glue patch (7.76 KB, patch)
2004-01-07 23:05 UTC, Paolo Borelli
none Details | Review
ui review irc log (6.12 KB, text/plain)
2004-01-12 22:42 UTC, Paolo Borelli
  Details

Description Paolo Borelli 2003-12-08 13:58:21 UTC
The attached patch higgifies the confirmation dialog you get when closing
an edited file. Behaviour is unchanged.
Comment 1 Paolo Borelli 2003-12-08 13:59:20 UTC
Created attachment 22217 [details] [review]
proposed patch
Comment 2 Paolo Borelli 2003-12-21 17:35:34 UTC
I noticed that the above patch is not good for translators since I
used the markup in the translatable strings.

Here is an updated patch: since gedit already depends on eel I used
the recently introduced eel_alert_dialog.
Comment 3 Paolo Borelli 2003-12-21 17:37:01 UTC
Created attachment 22617 [details] [review]
updated patch
Comment 4 Paolo Maggi 2003-12-29 22:57:10 UTC
Thanks for the patch.
I have just committed it to CVS HEAD.
Comment 5 Paolo Maggi 2003-12-30 17:05:15 UTC
<paolo> La stringa per la "close-confirmation dialog" forse contiene
un errore di inglese, l'ho notato ieri facendo il commit della tua patch
<pbor> dove? Cmq c'e' un paragrafo del' HIG che contiene la frase
esatta da usare
<paolo> Si dice: "to the document "Untitled 1"" o "to document
"Untitled 1"" ?
<pbor> con il "the" mi suonava bene, ma non sono sicuro al 100%
<pbor> cmq qui c'e' l'hig :)
http://developer.gnome.org/projects/gup/hig/draft_hig_new/windows-alert.html#alerts-confirmation
<pbor> hai ragione, niente "the"
<paolo> hmmm... potremmo rendere la confirmation dialog più HIG
compliant ancora :-)
<paolo> non dovrebbe essere difficile... hai voglia?
<paolo> Nel cose si stia chiudendo gedit potremmo usare "Quit without
saving"? Cosa ne pensi
<pbor> ok
<paolo> A dire il vero nel caso di "Close All" e "Quit" mi piacerebbe
avere una dialog completamente nuova con la lista di tutti i documenti
da salvare
<paolo> al posto di dover rispondere file per file
<pbor> "The following documents were not saved"
<pbor> lista
<pbor> "Save all" come bottone?
<paolo> qualcosa del genere, in cui e' possibile selzionare i
documenti da salvare come in JBuilder
<paolo> ma un po' più gnome-like
<pbor> una treeview con check buttons?
<paolo> esatto
* pbor provera'
<paolo> con un bottone per selezionare o deselezionare tutti
<pbor> tanto ogni scusa e' buona per non studiare ;)
<paolo> ti faccio uno screen-shot di JBuilder?
* paolo dovrebbe lavorare, ma anche per lui ogni scusa e' buona :-)
<pbor> ok grazie, allegalo al bugreport della vecchia patch
eventualmente riaprendo il bug
<paolo> ok
<paolo> attacco anche il log IRC
<pbor> ok
Comment 6 Paolo Maggi 2003-12-30 17:06:23 UTC
Created attachment 22772 [details]
JBuilder screenshot
Comment 7 Paolo Maggi 2004-01-02 00:37:34 UTC
See also bug #130237
Comment 8 Paolo Borelli 2004-01-06 13:53:39 UTC
still not done (sorry)... in the mean time it would be ok to factor
out a gedit_document_get_deleted() function like in the following
patch, since it should be used also in the yet-to-be-written multi-doc
dialog?

While at it I'd like also to ask why the logic for a readonly file is
different... I'm probably missing something... Even if it was
readonly, what happens if the file was removed anyway?


-		if (gedit_document_is_readonly (doc))
-			deleted = FALSE;
-		else
-			deleted = !gedit_utils_uri_exists (raw_uri);

Comment 9 Paolo Borelli 2004-01-06 13:55:10 UTC
Created attachment 23015 [details] [review]
factor out gedit_document_get_deleted
Comment 10 Paolo Borelli 2004-01-06 15:36:37 UTC
I have done a preliminary version of the dialog... but the hard thing
is hookin it up at the right place doing the right thing.

Btw, is quitting the only way to trigger this? Was there a "close all"
menu/keyboard shortcut before?

Is it only my impression or are the codepaths for quitting pressing
the "X" button and quitting using the "Quit" menu separate? Why?

Anyway here is a preliminary screenshot: note I didn't include a
general toggle button as IMHO is not necessary since all files
defaults to "save" and there is a "Save None" button...
Comment 11 Paolo Borelli 2004-01-06 15:39:12 UTC
Created attachment 23018 [details]
sshot
Comment 12 Paolo Maggi 2004-01-06 15:39:30 UTC
Please, commit your last patch.

Well, I can think about a couple of reson why in the current code the
logic for readonly files is different, but they are all due to the
weird way gedit manages them.
Since I will rewrite the way gedit manages readonly files in the next
major release (2.8), I think we should not change the current code for
the moment.
Comment 13 Paolo Maggi 2004-01-06 15:44:17 UTC
Created attachment 23019 [details]
Close All dialog mockup
Comment 14 Paolo Maggi 2004-01-06 15:47:14 UTC
> is quitting the only way to trigger this? Was there a "close all"
> menu/keyboard shortcut before?

No, you can trigger it by using View->Close All or by closing a single
gedit toplevel window. In the last case you will only close the
document managed by the window you are closing.

> Is it only my impression or are the codepaths for quitting pressing
> the "X" button and quitting using the "Quit" menu separate? Why?

Yes, they are different due to the way bonobo-mdi works.

Comment 15 Paolo Borelli 2004-01-06 16:35:53 UTC
Attached is another irc log discussing details of both the
implementation and the UI.

This time in english for the happiness of the audience :-)


I'm also CC'ing usability paeople to get opinins both on the whole
concept of the new dialog and (in the case it's ok) on the details.
Comment 16 Paolo Borelli 2004-01-06 16:36:40 UTC
Created attachment 23020 [details]
discussion on ui and implementation
Comment 17 Paolo Maggi 2004-01-06 16:37:30 UTC
Created attachment 23021 [details]
Glade2 file of the mockup
Comment 18 Paolo Borelli 2004-01-07 11:36:29 UTC
attaching a quick and dirty patch to show a proposed api... it still
uses my dialog instead of the proper libgladified dialog, puts the
declarations in gedit-dialogs.h instead of a proper .h file and saving
doesn't work.

The dialog is hooked up in gedit_file_close_all just to trigger it for
display, not because it's the right place.
Comment 19 Paolo Borelli 2004-01-07 11:45:07 UTC
Created attachment 23061 [details]
to put in gedit/dialogs
Comment 20 Paolo Borelli 2004-01-07 12:01:23 UTC
doh not a good day... wrong file...
right file and glue patch follow
Comment 21 Paolo Borelli 2004-01-07 12:02:26 UTC
Created attachment 23062 [details]
right file hopefully
Comment 22 Paolo Borelli 2004-01-07 12:03:30 UTC
Created attachment 23063 [details] [review]
some glue
Comment 23 Paolo Borelli 2004-01-07 23:01:33 UTC
Here it is an updated patch. This time it uses libglade, toggling in
the "save?" column works and it actually saves files.

Note that the glade file is slightly simpler than the one by Paolo
(e.g.  the string doesn't contain the number of unsaved files) to make
my life easier. It can be tweaked later.

I also added a gedit_mdi_get_unsaved_children function.

The .c , .glade and patch follow. as above the patch contains some
cruft just intended to test the dialog using close all.
Comment 24 Paolo Borelli 2004-01-07 23:03:53 UTC
Created attachment 23097 [details]
.c file to put in dialogs
Comment 25 Paolo Borelli 2004-01-07 23:04:41 UTC
Created attachment 23098 [details] [review]
glade file
Comment 26 Paolo Borelli 2004-01-07 23:05:32 UTC
Created attachment 23099 [details] [review]
glue patch
Comment 27 Paolo Maggi 2004-01-08 10:17:13 UTC
Hi Paolo,
 thanks for the patch.

I have some concerns about the interface you are using since it adds a
circular dependency (dialog <--> GeditMDI).

I'd really prefer to have a dependency graph like GeditMDI <-- dialog.
This means that the dialog should not know anything about GeditMDI.

To do this I still think that the best interface is the one I proposed
on IRC a few days ago.

GtkWidget *gedit_close_confirmation_dialog_new (const GSList
*usaved_docs);
gboolean gedit_close_confirmation_dialog_run (GtkWidget *dialog);
GSList *gedit_close_confirmation_dialog_get_selected_documents
(GtkWidget *dialog);

Where gedit_close_confirmation_dialog_run is only an utility function
that returns TRUE if "Save" or "Save None" is pressed and FALSE if
"Cancel" is pressed.

So the normal use case will be:

dialog = gedit_close_confirmation_dialog_new (usaved_docs);
save = gedit_close_confirmation_dialog_run (dialog);

if (save)
{
  list = gedit_close_confirmation_dialog_get_selected_documents (diallog);
  while (list != NULL)
  {
     save (list->data);
  }
}

gtk_widget_detroy (dialog);


Ciao,
Paolo 
Comment 28 Paolo Borelli 2004-01-08 23:19:35 UTC
I was looking at removung the dep on gedit-mdi.h

Removing it from close_all_confirmation_dialog is simply done (and for
what is worth is orthogonal to the interface), the problem comes from
the following code in the confirmation dialog for a single document:

	view = GTK_WIDGET (g_list_nth_data (bonobo_mdi_child_get_views
(BONOBO_MDI_CHILD (child)), 0));
	if (view)
	{
		GtkWindow *window;

		window = GTK_WINDOW (bonobo_mdi_get_window_from_view (view));
		gtk_window_present (window);
			
		bonobo_mdi_set_active_view (BONOBO_MDI (mdi), view);
	}

passing only the GeditDocument to the function, how can I retrieve the
child/view/window?

In particular note that the single-doc dialog may be called from
inside the multi-doc dialog function, so I can't simply add a "view"
argument, because when calling it from the multi-doc dialog (which
only knows a list of unsaved GeditDocuments) I can't know the view
corresponding to the unsaved doc.


Probably I'm missing something supersimple... I should not fill
bugzilla stuff after midnight :) bear with me...
Comment 29 Paolo Maggi 2004-01-09 00:17:24 UTC
This piece of code well be used by the caller, not by the dialog
itself, so it is not a problem.
It was useful to change the current active window before displaying
the dialog so that the user could see document document she is closing.
It the new code it will probably unuseful and I will probably remove it.
Comment 30 Paolo Maggi 2004-01-12 17:01:42 UTC
Fixed in CVS HEAD.

Usability guys: could you please review the new close all dialog?

You can see it at
http://www.gnome.org/~paolo/screenshots/close_all_dlg.png

Thanks.
Comment 31 Paolo Borelli 2004-01-12 22:40:53 UTC
We discussed a bit on this dialog during ui-review, the log follows.

The discussion was in particular about:

* what happens when you have more than 1 file never saved? How does
the user know which of the unsaved docs he is Saving As?

* the buttons: maybe "Discard All" (and to a less extent "Save
Selected") are clearer

bottom line: we still need review from the "experts".
Comment 32 Paolo Borelli 2004-01-12 22:42:52 UTC
Created attachment 23288 [details]
ui review irc log
Comment 33 Paolo Maggi 2004-07-13 12:12:48 UTC
pbor: Any concrete plans about this bug? Can we close it?
Comment 34 Paolo Borelli 2004-07-13 12:25:55 UTC
We didn't receive any complaints with the new close confirmation dialog afaik,
so I think this can be closed.
Comment 35 Paolo Borelli 2004-08-05 09:18:37 UTC
Umh... I noticed now that we still use "definitively lost": I'm pretty sure that
we discussed with some english speaker that "permanently lost" was a lot better,
but we missed the string freeze for 2.6.

I'm changing it now before we miss the freeze again, I hope that's ok.
Comment 36 Bryan W Clark 2004-08-05 16:42:00 UTC
That sounds fine, thanks for catching that.