Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Tue, 08 Sep 2015 14:23:57 UTC
Commit: 6db80a247f6969ffc14272189da449d566a745c0
https://github.com/geany/geany/commit/6db80a247f6969ffc14272189da449d566a74…
Log Message:
-----------
Don't open more than one document for non-existing paths from the CLI
When creating a new document for a non-existing file from the command
line, check if we don't already have opened it and simply show the
existing one if we do. This avoids creating new documents that will be
saved to the same location again and again.
Closes https://bugs.launchpad.net/linuxmint/+bug/1482558
Modified Paths:
--------------
src/libmain.c
Modified: src/libmain.c
6 lines changed, 5 insertions(+), 1 deletions(-)
===================================================================
@@ -804,7 +804,11 @@ gboolean main_handle_filename(const gchar *locale_filename)
{ /* create new file with the given filename */
gchar *utf8_filename = utils_get_utf8_from_locale(filename);
- doc = document_new_file(utf8_filename, NULL, NULL);
+ doc = document_find_by_filename(utf8_filename);
+ if (doc)
+ document_show_tab(doc);
+ else
+ doc = document_new_file(utf8_filename, NULL, NULL);
if (doc != NULL)
ui_add_recent_document(doc);
g_free(utf8_filename);
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Thomas Martitz <kugel(a)rockbox.org>
Committer: Thomas Martitz <kugel(a)rockbox.org>
Date: Wed, 26 Aug 2015 21:51:33 UTC
Commit: d4f26fdb13ff7e76728397c19b6dc8677ce7efaa
https://github.com/geany/geany/commit/d4f26fdb13ff7e76728397c19b6dc8677ce7e…
Log Message:
-----------
plugin api: bump API number for new keybindings APIs
Modified Paths:
--------------
src/plugindata.h
Modified: src/plugindata.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -58,7 +58,7 @@ G_BEGIN_DECLS
* @warning You should not test for values below 200 as previously
* @c GEANY_API_VERSION was defined as an enum value, not a macro.
*/
-#define GEANY_API_VERSION 225
+#define GEANY_API_VERSION 226
/* hack to have a different ABI when built with GTK3 because loading GTK2-linked plugins
* with GTK3-linked Geany leads to crash */
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Thomas Martitz <kugel(a)rockbox.org>
Committer: Thomas Martitz <kugel(a)rockbox.org>
Date: Wed, 26 Aug 2015 21:49:37 UTC
Commit: d3f6237505f1627d5b12c9ae5bed6dc736249878
https://github.com/geany/geany/commit/d3f6237505f1627d5b12c9ae5bed6dc736249…
Log Message:
-----------
plugin api: introduce keybindings_set_item_full and plugin_set_key_group_full
These function actually set the new GeanyKeyGroupFunc and
GeanyKeyBindingFunc and are exported for plugins
Modified Paths:
--------------
src/keybindings.c
src/keybindings.h
src/pluginutils.c
src/pluginutils.h
Modified: src/keybindings.c
39 lines changed, 39 insertions(+), 0 deletions(-)
===================================================================
@@ -202,6 +202,45 @@ GeanyKeyBinding *keybindings_set_item(GeanyKeyGroup *group, gsize key_id,
}
+/** Creates a new keybinding using a GeanyKeyBindingFunc and attaches is to a keybinding group
+ *
+ * If given the callback should return @c TRUE if the keybinding was handled, otherwise @c FALSE
+ * to allow other callbacks to be run. This allows for multiplexing keybindings on the same keys,
+ * depending on the focused widget (or context). If the callback is NULL the group's callback will
+ * be invoked, but the same rule applies.
+ *
+ * @param group Group.
+ * @param key_id Keybinding index for the group.
+ * @param cb New-style callback to be called when activated, or @c NULL to use the group callback.
+ * @param pdata Plugin-specific data passed back to the callback.
+ * @param key (Lower case) default key, e.g. @c GDK_j, but usually 0 for unset.
+ * @param mod Default modifier, e.g. @c GDK_CONTROL_MASK, but usually 0 for unset.
+ * @param kf_name Key name for the configuration file, such as @c "menu_new".
+ * @param label Label used in the preferences dialog keybindings tab. May contain
+ * underscores - these won't be displayed.
+ * @param menu_item Optional widget to set an accelerator for, or @c NULL.
+ * @return The keybinding - normally this is ignored.
+ *
+ * @since 1.26 (API 226)
+ * @see See plugin_set_key_group_full
+ **/
+GEANY_API_SYMBOL
+GeanyKeyBinding *keybindings_set_item_full(GeanyKeyGroup *group, gsize key_id,
+ GeanyKeyBindingFunc cb, gpointer pdata, guint key, GdkModifierType mod,
+ const gchar *kf_name, const gchar *label, GtkWidget *menu_item)
+{
+ GeanyKeyBinding *kb;
+
+ /* For now, this is intended for plugins only */
+ g_assert(group->plugin);
+
+ kb = keybindings_set_item(group, key_id, NULL, key, mod, kf_name, label, menu_item);
+ kb->cb_func = cb;
+ kb->cb_data = pdata;
+ return kb;
+}
+
+
static void add_kb_group(GeanyKeyGroup *group,
const gchar *name, const gchar *label, GeanyKeyGroupCallback callback, gboolean plugin)
{
Modified: src/keybindings.h
4 lines changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -275,6 +275,10 @@ GeanyKeyBinding *keybindings_set_item(GeanyKeyGroup *group, gsize key_id,
GeanyKeyCallback callback, guint key, GdkModifierType mod,
const gchar *name, const gchar *label, GtkWidget *menu_item);
+GeanyKeyBinding *keybindings_set_item_full(GeanyKeyGroup *group, gsize key_id,
+ GeanyKeyBindingFunc cb, gpointer pdata, guint key, GdkModifierType mod,
+ const gchar *kf_name, const gchar *label, GtkWidget *menu_item);
+
GeanyKeyBinding *keybindings_get_item(GeanyKeyGroup *group, gsize key_id);
GdkModifierType keybindings_get_modifiers(GdkModifierType mods);
Modified: src/pluginutils.c
30 lines changed, 30 insertions(+), 0 deletions(-)
===================================================================
@@ -33,6 +33,8 @@
#include "app.h"
#include "geanyobject.h"
+#include "keybindings.h"
+#include "keybindingsprivate.h"
#include "plugindata.h"
#include "pluginprivate.h"
#include "plugins.h"
@@ -307,6 +309,34 @@ GeanyKeyGroup *plugin_set_key_group(GeanyPlugin *plugin,
return priv->key_group;
}
+/** Sets up or resizes a keybinding group for the plugin
+ *
+ * You should then call keybindings_set_item() or keybindings_set_item_full() for each
+ * keybinding in the group.
+ * @param plugin Must be @ref geany_plugin.
+ * @param section_name Name used in the configuration file, such as @c "html_chars".
+ * @param count Number of keybindings for the group.
+ * @param cb New-style group callback, or @c NULL if you only want individual keybinding callbacks.
+ * @param pdata Plugin specific data, passed to the group callback.
+ * @return The plugin's keybinding group.
+ *
+ * @since 1.26 (API 226)
+ * @see See keybindings_set_item
+ * @see See keybindings_set_item_full
+ **/
+GEANY_API_SYMBOL
+GeanyKeyGroup *plugin_set_key_group_full(GeanyPlugin *plugin,
+ const gchar *section_name, gsize count, GeanyKeyGroupFunc cb, gpointer pdata)
+{
+ GeanyKeyGroup *group;
+
+ group = plugin_set_key_group(plugin, section_name, count, NULL);
+ group->cb_func = cb;
+ group->cb_data = pdata;
+
+ return group;
+}
+
static void on_pref_btn_clicked(gpointer btn, Plugin *p)
{
Modified: src/pluginutils.h
3 lines changed, 3 insertions(+), 0 deletions(-)
===================================================================
@@ -54,6 +54,9 @@ guint plugin_idle_add(struct GeanyPlugin *plugin, GSourceFunc function, gpointer
struct GeanyKeyGroup *plugin_set_key_group(struct GeanyPlugin *plugin,
const gchar *section_name, gsize count, GeanyKeyGroupCallback callback);
+GeanyKeyGroup *plugin_set_key_group_full(struct GeanyPlugin *plugin,
+ const gchar *section_name, gsize count, GeanyKeyGroupFunc cb, gpointer pdata);
+
void plugin_show_configure(struct GeanyPlugin *plugin);
void plugin_builder_connect_signals(struct GeanyPlugin *plugin,
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).