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 727073 - "Close all" and "Save All" should be enabled according to tabs status.
"Close all" and "Save All" should be enabled according to tabs status.
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2014-03-26 05:57 UTC by Sagar Ghuge
Modified: 2014-03-28 20:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Bug 727073 "Close all" and "Save All" should be enabled according to tabs status. (2.74 KB, patch)
2014-03-26 05:58 UTC, Sagar Ghuge
none Details | Review
Bug 727073 "Close all" and "Save All" should be enabled according to tabs status. (4.90 KB, patch)
2014-03-27 12:56 UTC, Sagar Ghuge
none Details | Review
Bug 727073 "Close all" and "Save All" should be enabled according to tabs status. (3.42 KB, patch)
2014-03-28 10:02 UTC, Sagar Ghuge
none Details | Review
Bug 727073 "Close all" and "Save All" should be enabled according to tabs status. (2.88 KB, patch)
2014-03-28 11:25 UTC, Sagar Ghuge
none Details | Review
Bug 727073 "Close all" and "Save All" should be enabled according to tabs status. (2.88 KB, patch)
2014-03-28 11:55 UTC, Sagar Ghuge
committed Details | Review

Description Sagar Ghuge 2014-03-26 05:57:25 UTC
If we don't have tabs > 1 , then "close all" should be disabled. and if tabs > 0 then only "save all" is enabled.
Comment 1 Sagar Ghuge 2014-03-26 05:58:42 UTC
Created attachment 272957 [details] [review]
 Bug 727073 "Close all" and "Save All" should be enabled according to tabs status.
Comment 2 Sagar Ghuge 2014-03-27 12:56:05 UTC
Created attachment 273082 [details] [review]
Bug 727073 "Close all" and "Save All" should be enabled according to tabs status.

check added for "save all" option. If files are not changed then "save all " wont be enable.
Comment 3 sébastien lafargue 2014-03-27 18:17:56 UTC
I don't like the get_is_modified name.

I was thinking more about _gedit_window_tabs_need_saving :

 - it's more expressive
 - it's callable from other gedit code
 - it's in part with _gedit_document_needs_saving name

Maybe we can outsource the tabs = _gedit_window_get_all_tabs (window); part
and use _gedit_window_tabs_need_saving (GeditWindow *window, GSlist *Tabs)
so we this function can serve for another list of tabs, let say notebooks one.

One more problem and not your fault :

- load a file in gedit
- change it from another editor

Gedit show you an info bar with reload or cancel

- choose cancel

From this point my file and gedit buffer are different but i have no acces to save-all.
Comment 4 Paolo Borelli 2014-03-28 07:43:00 UTC
Uhm, actually I'd prefer to not check the modified state at all for save realated functions. Even if a document is not modified I still want to be able to save it ("just to be sure") and save-all should be consistent too.

So for now I'd just remove that part from the patch
Comment 5 Sagar Ghuge 2014-03-28 10:02:28 UTC
Created attachment 273157 [details] [review]
Bug 727073 "Close all" and "Save All" should be enabled according to tabs status.

Removed the check and also added check for "Reload" option.
Comment 6 Sagar Ghuge 2014-03-28 11:25:45 UTC
Created attachment 273160 [details] [review]
Bug 727073 "Close all" and "Save All" should be enabled according to tabs status.

Removed Unnecessary code.
Comment 7 Sagar Ghuge 2014-03-28 11:55:34 UTC
Created attachment 273164 [details] [review]
Bug 727073 "Close all" and "Save All" should be enabled according to tabs status.

num_tabs > 0 check made for the "close-all" option.
Comment 8 Paolo Borelli 2014-03-28 20:05:56 UTC
pushed!
Comment 9 Paolo Borelli 2014-03-28 20:06:32 UTC
Review of attachment 273164 [details] [review]:

thank you!