You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1140
-- Commit Summary --
* Added 'Rename' option to right-click menu for Documents tab
-- File Changes --
M src/document.c (7) M src/document.h (1) M src/sidebar.c (18)
-- Patch Links --
https://github.com/geany/geany/pull/1140.patch https://github.com/geany/geany/pull/1140.diff
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1140
@@ -1273,7 +1273,6 @@ void document_show_tab(GeanyDocument *doc) document_get_notebook_page(doc)); }
don't remove this line (it's part of the style -- and in any case, don't introduce style-only changes in the middle of a commit)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1140/files/88f6ad8bebb4a6ef583d1e061ae2f...
@@ -1656,6 +1655,12 @@ gboolean document_reload_prompt(GeanyDocument *doc, const gchar *forced_enc) g_free(base_name); return result; } +/* also used for reloading when forced_enc is NULL */ +gboolean document_rename_prompt(GeanyDocument *doc) {
I don't think this convenience function should be added. Not only it's very simple and only use "public" API, but it's also only used in one place.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1140/files/88f6ad8bebb4a6ef583d1e061ae2f...
@@ -1656,6 +1655,12 @@ gboolean document_reload_prompt(GeanyDocument *doc, const gchar *forced_enc) g_free(base_name); return result; } +/* also used for reloading when forced_enc is NULL */ +gboolean document_rename_prompt(GeanyDocument *doc) {
- document_show_tab(doc);
- dialogs_show_save_as();
- return FALSE;
why return something if it's always `FALSE`? if anything, it should be `return dialogs_show_save_as();`
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1140/files/88f6ad8bebb4a6ef583d1e061ae2f...
@@ -1656,6 +1655,12 @@ gboolean document_reload_prompt(GeanyDocument *doc, const gchar *forced_enc) g_free(base_name); return result; } +/* also used for reloading when forced_enc is NULL */ +gboolean document_rename_prompt(GeanyDocument *doc) {
Also the name is partially misleading, it's the same for save as/rename
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1140/files/88f6ad8bebb4a6ef583d1e061ae2f...
@@ -724,6 +725,16 @@ static void create_openfiles_popup_menu(void) G_CALLBACK(on_openfiles_document_action), GINT_TO_POINTER(OPENFILES_ACTION_RELOAD)); doc_items.reload = item;
- item = gtk_image_menu_item_new_with_mnemonic(_("R_ename or Save As..."));
We use *Save As* alone in the rest of the UI, should we introduce *Rename* here?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1140/files/88f6ad8bebb4a6ef583d1e061ae2f...
@@ -724,6 +725,16 @@ static void create_openfiles_popup_menu(void) G_CALLBACK(on_openfiles_document_action), GINT_TO_POINTER(OPENFILES_ACTION_RELOAD)); doc_items.reload = item;
- item = gtk_image_menu_item_new_with_mnemonic(_("R_ename or Save As..."));
- gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item),
gtk_image_new_from_stock(GTK_STOCK_EDIT, GTK_ICON_SIZE_MENU));
…and it affects the icon too
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1140/files/88f6ad8bebb4a6ef583d1e061ae2f...
Although I made a lot of comments, it looks mostly fine.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1140#issuecomment-232776430
This was just a spike with reference to the ticket (#1138) to provide a quick implementation; I didn't vet it fully; the impl was to add it for my local machine, and I floated it just to see if you guys would want it for 1138.
Initially the idea was to shove an in-place `Rename` text box in the Documents list when you click rename - that's why the edit is a bit more complex / inconsistent than it needs to be - but when I noticed you could do it from the `Save As...` dialog, I went the lazy route (I had non-voluntary work to get finished) instead.
Anyway, I'll close the PR if y'all don't want it.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1140#issuecomment-232791932
No, it makes sense to have it next to *Save* if people want it, so after a few fixes this PR would be fine.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1140#issuecomment-232792696
It doesn't look like the requested changes will be made. I suggest closing this.
Closed #1140.
github-comments@lists.geany.org