Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ported treebrowser plugin to GTK+ >= 3.10.0 #278

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,13 @@ W: http://plugins.geany.org/geanynumberedbookmarks.html
S: Maintained

geanypg
P: Hans Alves <alves.h88@gmail.com>
M: Hans Alves <alves.h88@gmail.com>
P1: Hans Alves <alves.h88@gmail.com>
P2: Paolo Stivanin <info@paolostivanin.com>
M1: Hans Alves <alves.h88@gmail.com>
M2: Paolo Stivanin <info@paolostivanin.com>
W: http://plugins.geany.org/geanypg.html
S: Odd Fixes
S1: Odd Fixes
S2: Maintained

geanyprj
P: Yura Siamashka <yurand2@gmail.com>
Expand Down Expand Up @@ -235,10 +238,10 @@ W: http://plugins.geany.org/tableconvert.html
S: Maintained

treebrowser
P:
M:
W:
S: Orphaned
P: Paolo Stivanin
M: Paolo Stivanin <info@paolostivanin.com>
W: http://plugins.geany.org/treebrowser.html
S: Maintained

updatechecker
P: Frank Lanitz <frank@frank.uvena.de>
Expand Down
10 changes: 5 additions & 5 deletions addons/src/addons.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@ static void ao_document_reload_cb(GObject *obj, GeanyDocument *doc, gpointer dat
}


GtkWidget *ao_image_menu_item_new(const gchar *stock_id, const gchar *label)
GtkWidget *ao_image_menu_item_new(const gchar *icon_name, const gchar *label)
{
GtkWidget *item = gtk_image_menu_item_new_with_label(label);
GtkWidget *image = gtk_image_new_from_icon_name(stock_id, GTK_ICON_SIZE_MENU);

gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
GtkWidget *item = gtk_menu_item_new_with_label(label);
GtkWidget *image = gtk_image_new_from_icon_name(icon_name, GTK_ICON_SIZE_MENU);
gtk_container_add(GTK_CONTAINER(item), image);
gtk_widget_show(image);
return item;
}
Expand Down
14 changes: 13 additions & 1 deletion addons/src/ao_bookmarklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,25 @@ static void popup_item_click_cb(GtkWidget *button, gpointer data)
}


static GtkWidget *
gtk3_ui_image_menu_item_new(const gchar *icon_name, const gchar *label)
{
GtkWidget *item = gtk_menu_item_new_with_mnemonic(label);
GtkWidget *image = gtk_image_new_from_icon_name(icon_name, GTK_ICON_SIZE_MENU);

gtk_container_add(GTK_CONTAINER(item), image);
gtk_widget_show(image);
return item;
}


static GtkWidget *create_popup_menu(AoBookmarkList *bm)
{
GtkWidget *item, *menu;

menu = gtk_menu_new();

item = ui_image_menu_item_new(GTK_STOCK_DELETE, _("_Remove Bookmark"));
item = gtk3_ui_image_menu_item_new("edit-delete", _("_Remove Bookmark"));
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
g_signal_connect(item, "activate", G_CALLBACK(popup_item_click_cb), bm);
Expand Down
20 changes: 17 additions & 3 deletions addons/src/ao_doclist.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ static void ao_doclist_menu_item_activate_cb(GtkMenuItem *menuitem, gpointer dat
}


static GtkWidget *
gtk3_ui_image_menu_item_new(const gchar *icon_name, const gchar *label)
{
GtkWidget *item = gtk_menu_item_new_with_mnemonic(label);
GtkWidget *image = gtk_image_new_from_icon_name(icon_name, GTK_ICON_SIZE_MENU);

gtk_container_add(GTK_CONTAINER(item), image);
gtk_widget_show(image);
return item;
}


static void ao_toolbar_item_doclist_clicked_cb(GtkWidget *button, gpointer data)
{
static GtkWidget *menu = NULL;
Expand Down Expand Up @@ -211,12 +223,12 @@ static void ao_toolbar_item_doclist_clicked_cb(GtkWidget *button, gpointer data)
gtk_widget_show(menu_item);
gtk_container_add(GTK_CONTAINER(menu), menu_item);

menu_item = ui_image_menu_item_new(GTK_STOCK_CLOSE, _("Close Ot_her Documents"));
menu_item = gtk3_ui_image_menu_item_new("window-close", _("Close Ot_her Documents"));
gtk_widget_show(menu_item);
gtk_container_add(GTK_CONTAINER(menu), menu_item);
g_signal_connect(menu_item, "activate", G_CALLBACK(ao_doclist_menu_item_activate_cb),
GINT_TO_POINTER(ACTION_CLOSE_OTHER));
menu_item = ui_image_menu_item_new(GTK_STOCK_CLOSE, _("C_lose All"));
menu_item = gtk3_ui_image_menu_item_new("window-close", _("C_lose All"));
gtk_widget_show(menu_item);
gtk_container_add(GTK_CONTAINER(menu), menu_item);
g_signal_connect(menu_item, "activate", G_CALLBACK(ao_doclist_menu_item_activate_cb),
Expand All @@ -243,7 +255,9 @@ static void ao_toolbar_update(AoDocList *self)
{
if (priv->toolbar_doclist_button == NULL)
{
priv->toolbar_doclist_button = gtk_tool_button_new_from_stock(GTK_STOCK_INDEX);
GtkWidget *image = gtk_image_new_from_icon_name("system-file-mangager", GTK_ICON_SIZE_MENU);
gtk_widget_show(image);
priv->toolbar_doclist_button = gtk_tool_button_new(image, "_Index");
#if GTK_CHECK_VERSION(2, 12, 0)
gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(priv->toolbar_doclist_button),
_("Show Document List"));
Expand Down
4 changes: 2 additions & 2 deletions addons/src/ao_openuri.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ static void ao_open_uri_init(AoOpenUri *self)
priv->uri = NULL;

priv->menu_item_open = ao_image_menu_item_new(
ao_find_icon_name("text-html", GTK_STOCK_NEW), _("Open URI"));
ao_find_icon_name("text-html", "document-new"), _("Open URI"));
gtk_container_add(GTK_CONTAINER(geany->main_widgets->editor_menu), priv->menu_item_open);
gtk_menu_reorder_child(GTK_MENU(geany->main_widgets->editor_menu), priv->menu_item_open, 0);
gtk_widget_hide(priv->menu_item_open);
g_signal_connect(priv->menu_item_open, "activate", G_CALLBACK(ao_menu_open_activate_cb), self);

priv->menu_item_copy = ao_image_menu_item_new(GTK_STOCK_COPY, _("Copy URI"));
priv->menu_item_copy = ao_image_menu_item_new("edit-copy", _("Copy URI"));
gtk_container_add(GTK_CONTAINER(geany->main_widgets->editor_menu), priv->menu_item_copy);
gtk_menu_reorder_child(GTK_MENU(geany->main_widgets->editor_menu), priv->menu_item_copy, 1);
gtk_widget_hide(priv->menu_item_copy);
Expand Down
8 changes: 4 additions & 4 deletions addons/src/ao_systray.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ static void ao_systray_init(AoSystray *self)
priv->popup_menu = gtk_menu_new();
g_object_ref_sink(priv->popup_menu);

item = gtk_image_menu_item_new_from_stock(GTK_STOCK_OPEN, NULL);
item = gtk_menu_item_new_with_mnemonic(_("_Open"));
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(priv->popup_menu), item);
g_signal_connect(item, "activate",
G_CALLBACK(icon_popup_menu_cmd_clicked_cb), GINT_TO_POINTER(WIDGET_OPEN));

item = gtk_image_menu_item_new_from_stock(GEANY_STOCK_SAVE_ALL, NULL);
item = gtk_menu_item_new_with_mnemonic(GEANY_STOCK_SAVE_ALL);
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(priv->popup_menu), item);
g_signal_connect(item, "activate",
Expand All @@ -221,7 +221,7 @@ static void ao_systray_init(AoSystray *self)
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(priv->popup_menu), item);

item = gtk_image_menu_item_new_from_stock(GTK_STOCK_PREFERENCES, NULL);
item = gtk_menu_item_new_with_mnemonic("_Preferences");
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(priv->popup_menu), item);
g_signal_connect(item, "activate",
Expand All @@ -231,7 +231,7 @@ static void ao_systray_init(AoSystray *self)
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(priv->popup_menu), item);

item = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, NULL);
item = gtk_menu_item_new_with_mnemonic("_Quit");
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(priv->popup_menu), item);
g_signal_connect(item, "activate", G_CALLBACK(icon_popup_quit_clicked_cb), NULL);
Expand Down
16 changes: 14 additions & 2 deletions addons/src/ao_tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,26 @@ static void popup_hide_item_click_cb(GtkWidget *button, AoTasks *t)
}


static GtkWidget *
gtk3_ui_image_menu_item_new(const gchar *icon_name, const gchar *label)
{
GtkWidget *item = gtk_menu_item_new_with_mnemonic(label);
GtkWidget *image = gtk_image_new_from_icon_name(icon_name, GTK_ICON_SIZE_MENU);

gtk_container_add(GTK_CONTAINER(item), image);
gtk_widget_show(image);
return item;
}


static GtkWidget *create_popup_menu(AoTasks *t)
{
GtkWidget *item, *menu;
AoTasksPrivate *priv = AO_TASKS_GET_PRIVATE(t);

menu = gtk_menu_new();

item = gtk_image_menu_item_new_from_stock(GTK_STOCK_DELETE, NULL);
item = gtk_menu_item_new_with_mnemonic("_Delete");
priv->popup_menu_delete_button = item;
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
Expand All @@ -370,7 +382,7 @@ static GtkWidget *create_popup_menu(AoTasks *t)
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);

item = ui_image_menu_item_new(GTK_STOCK_REFRESH, _("_Update"));
item = gtk3_ui_image_menu_item_new("view-refresh", _("_Update"));
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
g_signal_connect(item, "activate", G_CALLBACK(popup_update_item_click_cb), t);
Expand Down
7 changes: 4 additions & 3 deletions addons/src/ao_xmltagging.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ void ao_xmltagging(void)

dialog = gtk_dialog_new_with_buttons(_("XML tagging"),
GTK_WINDOW(geany->main_widgets->window),
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
GTK_DIALOG_DESTROY_WITH_PARENT, "_Cancel",
GTK_RESPONSE_CANCEL, "_OK", GTK_RESPONSE_ACCEPT,
NULL);
vbox = ui_dialog_vbox_new(GTK_DIALOG(dialog));
gtk_widget_set_name(dialog, "GeanyDialog");
Expand All @@ -70,7 +70,8 @@ void ao_xmltagging(void)

gtk_container_add(GTK_CONTAINER(hbox), label);
gtk_container_add(GTK_CONTAINER(hbox), textbox);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
g_object_set(label, "xalign", 0.0, NULL);
g_object_set(label, "yalign", 0.5, NULL);

gtk_container_add(GTK_CONTAINER(vbox), hbox);
gtk_container_add(GTK_CONTAINER(vbox), textline);
Expand Down
2 changes: 2 additions & 0 deletions geanypg/AUTHORS
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Hans Alves <alves(dot)h88(at)gmail(dot)com>

Paolo Stivanin <info(at)paolostivanin(dot)com>
4 changes: 4 additions & 0 deletions geanypg/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2015-08-26 Paolo Stivanin <info(at)paolostivanin(dot)com>

* Plugin ported to GTK+ v3.10.0 and above

2012-08-24 Hans Alves <alves(dot)h88(at)gmail(dot)com>

* Fixed bug 3557458 which caused a 0 byte to be added to the text
Expand Down
3 changes: 1 addition & 2 deletions geanypg/README
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,4 @@ able to get a copy by contacting the Free Software Foundation, Inc.,
Bugs, questions
---------------

If you found any bugs or want to provide a patch, please contact Hans
Alves (alves(dot)h88(at)gmail(dot)com).
If you found any bugs or want to provide a patch, please contact Paolo Stivanin <info(at)paolostivanin(dot)com>
4 changes: 2 additions & 2 deletions geanypg/configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([geanypg], [0.1], [alves.h88@gmail.com])
AC_INIT([geanypg], [0.2], [alves.h88@gmail.com])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC
AC_DISABLE_STATIC
Expand All @@ -8,7 +8,7 @@ AC_PROG_LIBTOOL
AM_PATH_GPGME()

# checking for Geany
PKG_CHECK_MODULES(GEANY, [geany >= 0.20])
PKG_CHECK_MODULES(GEANY, [geany >= 1.24])
AC_SUBST(GEANY_CFLAGS)
AC_SUBST(GEANY_LIBS)

Expand Down
11 changes: 5 additions & 6 deletions geanypg/src/key_selection_dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ int geanypg_encrypt_selection_dialog(encrypt_data * ed, gpgme_key_t ** selected,
list = geanypg_makelist(ed->key_array, ed->nkeys, 0);
listview = geanypg_listview(list, &data);
scrollwin = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrollwin),
listview);
gtk_container_add(GTK_CONTAINER(scrollwin), listview);
gtk_widget_set_size_request(scrollwin, 500, 160);
combobox = geanypg_combobox(geanypg_makelist(ed->skey_array, ed->nskeys, 1));

Expand All @@ -156,8 +155,8 @@ int geanypg_encrypt_selection_dialog(encrypt_data * ed, gpgme_key_t ** selected,


/* add ok and cancel buttons */
gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_OK, GTK_RESPONSE_OK);
gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
gtk_dialog_add_button(GTK_DIALOG(dialog), _("_OK"), GTK_RESPONSE_OK);
gtk_dialog_add_button(GTK_DIALOG(dialog), _("_Cancel"), GTK_RESPONSE_CANCEL);

gtk_window_set_title(GTK_WINDOW(dialog), _("Select recipients"));
gtk_widget_show_all(dialog);
Expand Down Expand Up @@ -225,8 +224,8 @@ int geanypg_sign_selection_dialog(encrypt_data * ed)
gtk_box_pack_start(GTK_BOX(contentarea), combobox, TRUE, TRUE, 0);

/* add ok and cancel buttons */
gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_OK, GTK_RESPONSE_OK);
gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
gtk_dialog_add_button(GTK_DIALOG(dialog), "_OK", GTK_RESPONSE_OK);
gtk_dialog_add_button(GTK_DIALOG(dialog), "_Cancel", GTK_RESPONSE_CANCEL);

gtk_widget_show_all(dialog);
gtk_window_set_title(GTK_WINDOW(dialog), _("Select signer"));
Expand Down
4 changes: 2 additions & 2 deletions geanypg/src/verify_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ static char * geanypg_choose_sig(void)
GtkWidget * dialog = gtk_file_chooser_dialog_new(_("Open a signature file"),
GTK_WINDOW(geany->main_widgets->window),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
"_Open", GTK_RESPONSE_OK,
"_Cancel", GTK_RESPONSE_CANCEL,
NULL);
gtk_widget_show_all(dialog);
response = gtk_dialog_run(GTK_DIALOG(dialog));
Expand Down
1 change: 1 addition & 0 deletions treebrowser/AUTHORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Adrian Dimitrov <dimitrov.adrian@gmail.com>
Paolo Stivanin <info@paolostivanin.com>

And THANKS to all in #geany for support and help
4 changes: 4 additions & 0 deletions treebrowser/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
| Development release ChangeLog |
+-------------------------------+

08-02-2011 Adrian Dimitrov <info@paolostivanin.com>

* src/treebrowser.c
ported to GTK+ > 3.10.0

08-02-2011 Adrian Dimitrov <dimitrov.adrian@gmail.com>

Expand Down
3 changes: 3 additions & 0 deletions treebrowser/NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Most important changes in 0.30:
* required version of GTK+ is now 3.10.0

Most important changes in 0.20:

* Added bookmarks support
Expand Down
11 changes: 7 additions & 4 deletions treebrowser/README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. |(version)| replace:: 0.20
.. |(version)| replace:: 0.30

TreeBrowser plugin
==================
Expand Down Expand Up @@ -33,7 +33,7 @@ Features

Requirements
============
* GTK >= 2.8.0
* GTK >= 3.10.0
* GIO >= 2.0 (optional)
* Geany >= 0.17

Expand All @@ -49,7 +49,7 @@ FAQ
===

* My base directory is not remember
Yes it isn`t saved, and I don`t think that it have to be saved while We have in Geany "Startup path", and "Load from the last session"
Yes it isn't saved, and I don't think that it have to be saved while we have in Geany "Startup path", and "Load from the last session"
These settings are useful and the plugin take care about them, use them and the problem with the last directory remembering will be solved.


Expand All @@ -64,7 +64,7 @@ TreeBrowser is part of the combined Geany Plugins release. For more information
Installation
============

The plugin is part from the geany-plugins projects, you can see the plugin`s install page at http://plugins.geany.org/install.html
The plugin is part from the geany-plugins projects, you can see the plugin's install page at http://plugins.geany.org/install.html


License
Expand All @@ -79,5 +79,8 @@ Ideas, questions, patches and bug reports
Report them at https://github.com/geany/geany-plugins/issues

--
2015 Paolo Stivanin
info(at)paolostivanin(dot)com

2010 Adrian Dimitrov
dimitrov(dot)adrian(at)gmail(dot)com
Loading