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 687327 - Support showing open documents in a combobox instead of in tabs.
Support showing open documents in a combobox instead of in tabs.
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: document-manager
unspecified
Other All
: Normal normal
: ---
Assigned To: Anjuta maintainers
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-01 09:56 UTC by Carl-Anton Ingmarsson
Modified: 2012-11-18 09:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
document-manager: Fix various compile warnings. (5.83 KB, patch)
2012-11-01 09:56 UTC, Carl-Anton Ingmarsson
accepted-commit_now Details | Review
document-manager: Support showing open documents in a combobox. (46.58 KB, patch)
2012-11-01 09:56 UTC, Carl-Anton Ingmarsson
needs-work Details | Review
document-manager: Remove obsolete code for tabbing between documents. (5.34 KB, patch)
2012-11-01 09:56 UTC, Carl-Anton Ingmarsson
none Details | Review
anjuta-window: Don't call gtk_widget_show_all when setting up widget. (3.10 KB, patch)
2012-11-11 20:43 UTC, Carl-Anton Ingmarsson
accepted-commit_now Details | Review
document-manager: Support showing open documents in a combobox. (46.56 KB, patch)
2012-11-11 20:46 UTC, Carl-Anton Ingmarsson
accepted-commit_now Details | Review
document-manager: Remove obsolete code for tabbing between documents. (5.34 KB, patch)
2012-11-11 20:46 UTC, Carl-Anton Ingmarsson
accepted-commit_now Details | Review

Description Carl-Anton Ingmarsson 2012-11-01 09:56:26 UTC
I find showing the open documents in tabs to be quite bad for a number of reasons.

1) In many projects multiple files have the same name so it's impossible to distinguish which tab corresponds to the correct file.

2) It's hard to visually scan over a large number of tabs.

The following patches add support for showing the open documents in a drop-down list. The documents is shown using their path relative to the project root.

e5e95de document-manager: Fix various compile warnings.
b8d6930 document-manager: Support showing open documents in a combobox.
5766c63 document-manager: Remove obsolete code for tabbing between documents.
Comment 1 Carl-Anton Ingmarsson 2012-11-01 09:56:29 UTC
Created attachment 227784 [details] [review]
document-manager: Fix various compile warnings.

Remove some instances of unused variables and usage of deprecated functions.
Completely remove the custom styling of the tab close button since it looks good without it
anyway.
Comment 2 Carl-Anton Ingmarsson 2012-11-01 09:56:32 UTC
Created attachment 227785 [details] [review]
document-manager: Support showing open documents in a combobox.
Comment 3 Carl-Anton Ingmarsson 2012-11-01 09:56:34 UTC
Created attachment 227786 [details] [review]
document-manager: Remove obsolete code for tabbing between documents.

The code was never used since we didn't set any keybindings for the next and previous
buffers. It also relied on AnjutaDocman being a GtkNoteBook which is no longer the case.
Comment 4 Sébastien Granjoux 2012-11-10 20:53:36 UTC
Review of attachment 227785 [details] [review]:

Thanks for your work, but I think there are a few memory leaks.

* in on_combo_changed in anjuta-docman.c
I think gtk_tree_model_get increase the reference count of the object so you need to call g_object_unref.

* in combo_sort_func in anjuta-docman.c
In a similar way, I think gtk_tree_model_get return a newly allocated string, so you have to free it when you don't need it anymore.

* in anjuta_docman_add_document_to_combo in anjuta-docman.c
Instead of '/', it's a bit better to use G_DIR_SEPARATOR.

* in anjuta_docman_get_iter_for_document in anjuta-docman.c
I think gtk_tree_model_get increase the reference count of the object so you need to call g_object_unref.
Comment 5 Sébastien Granjoux 2012-11-10 21:00:19 UTC
Review of attachment 227784 [details] [review]:

Thank for your patch. I have just committed it without changes.
Comment 6 Carl-Anton Ingmarsson 2012-11-11 20:43:50 UTC
Created attachment 228728 [details] [review]
anjuta-window: Don't call gtk_widget_show_all when setting up widget.

Just call gtk_widget_show instead. Calling gtk_widget_show_all breaks widgets that
not always want to show all children.

Also fixup the document-manager, git and snippets-manager plugins which relied on
gtk_widget_show_all to be called by anjuta-window.c.
Comment 7 Carl-Anton Ingmarsson 2012-11-11 20:46:16 UTC
Created attachment 228729 [details] [review]
document-manager: Support showing open documents in a combobox.
Comment 8 Carl-Anton Ingmarsson 2012-11-11 20:46:23 UTC
Created attachment 228730 [details] [review]
document-manager: Remove obsolete code for tabbing between documents.

The code was never used since we didn't set any keybindings for the next and previous
buffers. It also relied on AnjutaDocman being a GtkNoteBook which is no longer the case.
Comment 9 Sébastien Granjoux 2012-11-11 21:53:17 UTC
Review of attachment 228728 [details] [review]:

Thank for you patch. It looks fine, I have comitted it.
Comment 10 Sébastien Granjoux 2012-11-11 21:58:04 UTC
Review of attachment 228729 [details] [review]:

Thank for this patch. I think it's fine now, I have committed it. I have just fixed some whitespace errors reported by git.

I have only a small remark. The combo box is at the top of the document near the top of the screen. Quite often it doesn't fit on the screen and Gtk moves it below but it doesn't move its content. Have you seen it too? Do you know if it's possible to fix it in Anjuta?
Comment 11 Sébastien Granjoux 2012-11-11 21:58:39 UTC
Review of attachment 228730 [details] [review]:

Thank for your patch. I have committed it.