[Geany-Devel] [RFC] Document Messages and File Notification Behaviour (was: buried down deep somewhere)

Nick Treleaven nick.treleaven at btinternet.com
Tue Dec 4 14:00:44 UTC 2012


On 03/12/2012 21:48, Matthew Brush wrote:
> On 12-12-03 09:05 AM, Nick Treleaven wrote:
> On 03/12/2012 14:18,
> Colomban Wendling wrote:
>  >> Le 03/12/2012 14:35, Nick Treleaven a écrit :
>  >>> I don't think we need a Close button. Closing the document can be done
>  >>> in the normal way. Or were you planning on disabling normal closing?
>  >>> That would complicate the UI code.
>  >>
>  >> IIUC, the idea was that closing the document "the normal way" would ask
>  >> again if the user didn't make a choice yet.  And although it might
>  >> indeed look duplicate, I think it's important to make it a clearly
>  >> visible option as an answer to the question.  It being a button or
>  >> something else I don't have an opinion yet.
>  >
>  > OK. Presumably 'normal' save or reload would also ask the user for
>  > confirmation. Are there any other use cases like these, maybe from
> plugins?
>  >
>
> I've done some experimenting on ways to do this. I propose documents get
> a new "flag" called "doc->priv->notifications_pending" (or whatever).
> When a document message is posted, the flag is set to TRUE, the infobar
> is shown within the tab page and tab's close icon changes to the
> stock-id of the last (or most "important", see below) message. While the
> tab's icon is not close (when notifications are pending) and the button
> is clicked, it simply focuses the document (document_show_tab() or
> whatever), or puts up a modal dialog saying "The tab you are closing has
> notifications pending, are you sure you want to close it without
> reviewing them?" before it lets you close it (also for save/save all?).
> One question is what should clear the "notifications_pending" flag, be
> it simply having shown the user the tab, confirming a modal dialog, or
> using the equivalent of a "Dismiss" button in the info bar. For easier
> inline discussion, I'll itemize the concepts I just discussed:
>
> * Notion that documents have "notifications" and they can be "pending"
> (not yet seen/acknowledged)
>
> * Whether we want to use the tab "close" button icon to indicate the
> type of the last notification that is pending. Alternatives are
> (existing orange) different color tab label or an additional icon in the
> tab to the left of the label.
>
> * What happens when you click the "close" button in the tab (or file
> menu, etc), and there are notifications pending? Does it just focus the
> document/tab or show a special modal warning dialog or something else?
>
> * What clears the "notifications pending" status of a document? Should
> it be the modal dialog from last item, or a "Dismiss" (name TBD) button
> in the infobar itself or something else?
>
> * What actions are "dangerous" to perform while notifications are
> pending? It seems like these might only be ones that don't work on the
> "current document" since it's visible and the user will be looking at
> the notification at the time of the action.
>
>    - File Menu and Toolbar:
>      - Close All
>      - Save All
>    - Tab Context/RightClick Menu
>      - Close/Close All
>      - Tab "Close" button
>
> One problem I noticed with my document-messages branch is that it treats
> all notifications the same, be it important disk-change events or from
> other parts of the code (or eventually plugins maybe). From trial and
> error, I believe the best approach for this is to have a special
> top-most notification place where important messages can go, and when
> one of those is posted, it's stock-id overrides any of the normal
> notification's stock-id in the tab "close" button. Here's an ASCII
> digram of the widget layout inside the notebook page:

I'm now having serious doubts about whether this complexity is worth it. 
I really have no issues personally with the current modal dialogs. Modal 
dialogs are a good fit for important information that needs immediate 
consideration, like potential data loss.

This extra complexity doesn't seem to provide much benefit over the 
status quo IMO.

>  >> Also, as I discussed a bit on IRC (without much success though :D), I'm
>  >> not completely sure if the "dismiss" button (we agreed this probably
>  >> wasn't the best name for it BTW) is useful: I personally don't really
>  >> see why somebody would like to hide the warning while not making a
>  >> decision on what to do with the file.
>  >> Though, that's no big deal.
>  >
>  > Agree, we probably shouldn't allow 'Dismiss'.

BTW what I meant here was not allowing removal of the message, whatever 
it's called, so forcing a response.

> Thomas also mentioned on IRC that Gedit makes a document "read-only"
> when it detects disk-changes, which seems like a completely sane and
> safe thing to do, although potentially also annoying. Do we want to do
> this as well, in addition to the stuff being discussed above?

Might be good, except when the document has modifications already.


More information about the Devel mailing list