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 742698 - closing an untitled document doesn't seem to close it
closing an untitled document doesn't seem to close it
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: editor
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-10 11:42 UTC by Lasse Schuirmann
Modified: 2016-02-22 00:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Closing an untitled document doesn't close it (6.02 KB, patch)
2015-01-11 15:12 UTC, Dimitris Zenios
committed Details | Review

Description Lasse Schuirmann 2015-01-10 11:42:20 UTC
Steps:
* open builder
* create new document
* enter a char
* press Ctrl+W or find the close document button and click it

Actual result: editor switches to the first untitled document
Expected result: editor should ask if I want to save that thing, then save/throwaway it and close it.
Comment 1 Christian Hergert 2015-01-11 07:32:26 UTC
I think this makes sense. When Builder is closed, I think we'll start saving the modified contents in ~/.local/gnome-builder/drafts instead of asking. So we'll need a way to directly close them.

I'd also like to change order of items in the popover, but that will be a different bug. (And maybe a close button). All requires more thought...
Comment 2 Dimitris Zenios 2015-01-11 15:12:38 UTC
Created attachment 294276 [details] [review]
Closing an untitled document doesn't close it

A request close signal has been implemented in order for
the document grid to decide whether it should close the document.

The signal is catched and if the document has no changes
we close the view else we popup a save / cancel dialog.
Comment 3 Christian Hergert 2015-01-12 01:46:55 UTC
I like it, nice work!

Attachment 294276 [details] pushed as af5e873 - Closing an untitled document doesn't close it
Comment 4 Christian Hergert 2015-01-14 23:43:10 UTC
We need to do a bit more work on this, since it caused a minor annoyance with split views.

When splitting a document that is open, the close signal is called and a new view is opened up (in the new location).

That is causing this to trigger.
Comment 5 Dimitris Zenios 2015-01-15 00:28:48 UTC
Is there a chance instead of closing and creating a new view to just move the current view to its new location?
Comment 6 Christian Hergert 2015-01-15 09:28:52 UTC
It's certainly doable. It just requires being a bit more careful with unrealizing/realizing new widgets. The current implementation was certainly out of convenience.
Comment 7 Christian Hergert 2016-02-22 00:20:58 UTC
This shouldn't be an issue anymore.