Re: [Geany-devel] public ui_setup_open_button_callback

2012-04-05 Thread Lex Trotman
On 6 April 2012 06:03, Matthew Brush  wrote:
> On 12-04-05 11:56 AM, Dimitar Zhekov wrote:
>>
>> Hi,
>>
>> Currently UIUtilsFuncs contain ui_path_box_new(), so a
>> file-chooser-dialog button can be created programatically in a plugin.
>> But there's no ui_setup_open_button_callback(), so it's impossible to
>> load such a button from a .glade file and setup it, as in Geany.
>>
>> geanyprj uses ui_path_box_new(), and other plugins (saveactions,
>> spellcheck, debugger, ...) create file-chooser-dialog buttons manually,
>> so they seem common. I'm writing a new plugin, and would prefer to
>> use .glade for the interface as much as possible (and practical).
>>
>
> IMO, all this path box stuff should be deprecated in favour of the widget
> provided by the toolkit (GtkFileChooserButton). Using custom stuff like this
> makes Geany "non-standard" amongst other GTK+ programs and it doesn't
> provide the flexibility of the already provided widget, namely being a real
> GtkWidget and integration with Glade.
>
> On the other hand, I also wouldn't be opposed to a proper implementation of
> a real custom GtkWidget subclass (ex. GeanyPathBox) that can be used in
> Glade and otherwise conveniently, since I tend to find the text box next to
> the button to be more user-friendly than the widget currently provided by
> the toolkit for this purpose.

It would be fine to clean up, so long as the new version works on the
oldest GTK we support.

Cheers
Lex


>
> My $0.02, having thought about this before while porting to Glade and having
> previously written a GeanyPathBox widget for this use.
>
> Cheers,
> Matthew Brush
> ___
> Geany-devel mailing list
> Geany-devel@uvena.de
> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


Re: [Geany-devel] public ui_setup_open_button_callback

2012-04-05 Thread Matthew Brush

On 12-04-05 11:56 AM, Dimitar Zhekov wrote:

Hi,

Currently UIUtilsFuncs contain ui_path_box_new(), so a
file-chooser-dialog button can be created programatically in a plugin.
But there's no ui_setup_open_button_callback(), so it's impossible to
load such a button from a .glade file and setup it, as in Geany.

geanyprj uses ui_path_box_new(), and other plugins (saveactions,
spellcheck, debugger, ...) create file-chooser-dialog buttons manually,
so they seem common. I'm writing a new plugin, and would prefer to
use .glade for the interface as much as possible (and practical).



IMO, all this path box stuff should be deprecated in favour of the 
widget provided by the toolkit (GtkFileChooserButton). Using custom 
stuff like this makes Geany "non-standard" amongst other GTK+ programs 
and it doesn't provide the flexibility of the already provided widget, 
namely being a real GtkWidget and integration with Glade.


On the other hand, I also wouldn't be opposed to a proper implementation 
of a real custom GtkWidget subclass (ex. GeanyPathBox) that can be used 
in Glade and otherwise conveniently, since I tend to find the text box 
next to the button to be more user-friendly than the widget currently 
provided by the toolkit for this purpose.


My $0.02, having thought about this before while porting to Glade and 
having previously written a GeanyPathBox widget for this use.


Cheers,
Matthew Brush
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


[Geany-devel] public ui_setup_open_button_callback

2012-04-05 Thread Dimitar Zhekov
Hi,

Currently UIUtilsFuncs contain ui_path_box_new(), so a
file-chooser-dialog button can be created programatically in a plugin.
But there's no ui_setup_open_button_callback(), so it's impossible to
load such a button from a .glade file and setup it, as in Geany.

geanyprj uses ui_path_box_new(), and other plugins (saveactions,
spellcheck, debugger, ...) create file-chooser-dialog buttons manually,
so they seem common. I'm writing a new plugin, and would prefer to
use .glade for the interface as much as possible (and practical).

-- 
E-gards: Jimmy
>From 3a2ffc4931342c193eeb69e2960c11eb6b5fdf06 Mon Sep 17 00:00:00 2001
From: Dimitar Zhekov 
Date: Thu, 5 Apr 2012 21:51:15 +0300
Subject: [PATCH] public ui_setup_open_button_callback()

---
 plugins/geanyfunctions.h |2 ++
 src/plugindata.h |2 ++
 src/plugins.c|3 ++-
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/plugins/geanyfunctions.h b/plugins/geanyfunctions.h
index d41d77e..7ef54df 100644
--- a/plugins/geanyfunctions.h
+++ b/plugins/geanyfunctions.h
@@ -304,6 +304,8 @@
 	geany_functions->p_ui->ui_menu_add_document_items_sorted
 #define ui_lookup_stock_label \
 	geany_functions->p_ui->ui_lookup_stock_label
+#define ui_setup_open_button_callback \
+	geany_functions->p_ui->ui_setup_open_button_callback
 #define dialogs_show_question \
 	geany_functions->p_dialogs->dialogs_show_question
 #define dialogs_show_msgbox \
diff --git a/src/plugindata.h b/src/plugindata.h
index 77d6964..a5120a3 100644
--- a/src/plugindata.h
+++ b/src/plugindata.h
@@ -482,6 +482,8 @@ typedef struct UIUtilsFuncs
 	void		(*ui_menu_add_document_items_sorted) (GtkMenu *menu, struct GeanyDocument *active,
 GCallback callback, GCompareFunc compare_func);
 	const gchar* (*ui_lookup_stock_label)(const gchar *stock_id);
+	void		(*ui_setup_open_button_callback)(GtkWidget *open_btn, const gchar *title,
+GtkFileChooserAction action, GtkEntry *entry);
 }
 UIUtilsFuncs;
 
diff --git a/src/plugins.c b/src/plugins.c
index 42bec5d..6e02984 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -248,7 +248,8 @@ static UIUtilsFuncs uiutils_funcs = {
 	&ui_get_gtk_settings_integer,
 	&ui_combo_box_add_to_history,
 	&ui_menu_add_document_items_sorted,
-	&ui_lookup_stock_label
+	&ui_lookup_stock_label,
+	&ui_setup_open_button_callback
 };
 
 static DialogFuncs dialog_funcs = {
-- 
1.7.9.1

___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


Re: [Geany-devel] Small additions to stash

2012-04-05 Thread Dimitar Zhekov
On Thu, 05 Apr 2012 17:20:44 +0100
Nick Treleaven  wrote:

> On 04/04/2012 19:58, Dimitar Zhekov wrote:
> > Hi,
> >
> > How about some $subject? Namely:
> >
> > Include stash_group_set_use_defaults() in plugin StashFuncs. I'm not
> > using it any more, but it's a nice thing to have.
> 
> I'm not convinced we should support that publicly. It puts a burden on 
> the implementation for an unusual use case.

ACK.

> > New stash_group_free_strings(), which frees any strings and string
> > arrays in a group. Much easier than to track them individually, as
> > in Geany (though if someone is willing to track the keyfile_groups
> > prefs free-s and remove them, a call may be included in
> > configuration_finalize).
> 
> Probably it should be named more generally, in case we support e.g. 
> null-terminated integer lists. Maybe stash_group_free_settings().

Renamed and changed the description. Updated patch attached.

-- 
E-gards: Jimmy
>From b86a3942379cbca63d11ad4120239db4615f13d0 Mon Sep 17 00:00:00 2001
From: Dimitar Zhekov 
Date: Thu, 5 Apr 2012 20:59:57 +0300
Subject: [PATCH] A stash_group_free_settings() function Frees the memory
 allocated for setting values in a group

---
 plugins/geanyfunctions.h |2 ++
 src/plugindata.h |1 +
 src/plugins.c|3 ++-
 src/stash.c  |   21 +
 src/stash.h  |2 ++
 5 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/plugins/geanyfunctions.h b/plugins/geanyfunctions.h
index d41d77e..beaf6fb 100644
--- a/plugins/geanyfunctions.h
+++ b/plugins/geanyfunctions.h
@@ -418,6 +418,8 @@
 	geany_functions->p_stash->stash_group_display
 #define stash_group_update \
 	geany_functions->p_stash->stash_group_update
+#define stash_group_free_settings \
+	geany_functions->p_stash->stash_group_free_settings
 #define symbols_get_context_separator \
 	geany_functions->p_symbols->symbols_get_context_separator
 #define build_activate_menu_item \
diff --git a/src/plugindata.h b/src/plugindata.h
index 77d6964..9e5e7f5 100644
--- a/src/plugindata.h
+++ b/src/plugindata.h
@@ -701,6 +701,7 @@ typedef struct StashFuncs
 			const gchar *property_name, GType type);
 	void (*stash_group_display)(struct StashGroup *group, GtkWidget *owner);
 	void (*stash_group_update)(struct StashGroup *group, GtkWidget *owner);
+	void (*stash_group_free_settings)(struct StashGroup *group);
 }
 StashFuncs;
 
diff --git a/src/plugins.c b/src/plugins.c
index 42bec5d..65b229f 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -346,7 +346,8 @@ static StashFuncs stash_funcs = {
 	&stash_group_add_entry,
 	&stash_group_add_widget_property,
 	&stash_group_display,
-	&stash_group_update
+	&stash_group_update,
+	&stash_group_free_settings
 };
 
 static SymbolsFuncs symbols_funcs = {
diff --git a/src/stash.c b/src/stash.c
index 0427af3..530c11e 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -335,6 +335,27 @@ StashGroup *stash_group_new(const gchar *name)
 }
 
 
+/** Frees the memory allocated for setting values in a group.
+ * @param group . */
+void stash_group_free_settings(StashGroup *group)
+{
+	StashPref *entry;
+	guint i;
+
+	foreach_ptr_array(entry, i, group->entries)
+	{
+		if (entry->setting_type == G_TYPE_STRING)
+			g_free(*(gchararray *) entry->setting);
+		else if (entry->setting_type == G_TYPE_STRV)
+			g_strfreev(*(gchararray **) entry->setting);
+		else
+			continue;
+
+		*(gpointer**) entry->setting = NULL;
+	}
+}
+
+
 /** Frees a group.
  * @param group . */
 void stash_group_free(StashGroup *group)
diff --git a/src/stash.h b/src/stash.h
index 949fb2d..7391e71 100644
--- a/src/stash.h
+++ b/src/stash.h
@@ -60,6 +60,8 @@ gboolean stash_group_load_from_file(StashGroup *group, const gchar *filename);
 gint stash_group_save_to_file(StashGroup *group, const gchar *filename,
 		GKeyFileFlags flags);
 
+void stash_group_free_settings(StashGroup *group);
+
 void stash_group_free(StashGroup *group);
 
 
-- 
1.7.9.1

___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


Re: [Geany-devel] Small additions to stash

2012-04-05 Thread Nick Treleaven

On 04/04/2012 19:58, Dimitar Zhekov wrote:

Hi,

How about some $subject? Namely:

Include stash_group_set_use_defaults() in plugin StashFuncs. I'm not
using it any more, but it's a nice thing to have.


I'm not convinced we should support that publicly. It puts a burden on 
the implementation for an unusual use case.



New stash_group_free_strings(), which frees any strings and string
arrays in a group. Much easier than to track them individually, as
in Geany (though if someone is willing to track the keyfile_groups
prefs free-s and remove them, a call may be included in
configuration_finalize).


Probably it should be named more generally, in case we support e.g. 
null-terminated integer lists. Maybe stash_group_free_settings().


Regards,
Nick
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


[Geany-devel] Hi!

2012-04-05 Thread David Gomes
Hi,

I'm David, and I want to start helping out with Geany development.

https://github.com/geany/geany/pull/36

I started by simplifying rstrip-whitespace.py. It seemed really complex.
However, I'm not sure if you were doing anything special when removing
trailing white space, because the code I made does simply that, not
anything else.

Whether or not this patch gets approved, I'll keep on working and see how I
can help. I know some Gtk, and even though I'm more used to its Vala
bindings, I think I can do just fine with C and C++.

-- 
David Gomes
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


Re: [Geany-devel] file attributes on a linux system

2012-04-05 Thread worthspending
I know.  It is just one of those things.  I didn't even think about it
until I read "save as" didn't apply the +x attribute.  Quite frankly, I
simply forgot that the Tree Browser was a plugin.

Sorry.

On Thu, Apr 5, 2012 at 4:53 AM, Lex Trotman  wrote:

> On 5 April 2012 19:40, worthspending  wrote:
> > The question of how new files don't have +x using "save as" and do have
> +x
> > might be answered with the following observation.
> >
> > - Create a new file File->New, then, File->Save, then, check the
> attribute:
> >  No +x on the new file
> > - Create a new file File->New, then, File->Save As, then, check the
> > attribute: No +x on the new file
> >
> > I'm using the Tree Browser plugin, so...
> > - Create a new file by right mouse click on the directory in the tree
> > browser and enter the name of the new file directly into the text field
> in
> > the list.  Hit enter to finish and create the file.  Check the attribute
> and
> > it has +x on the new file.
>
> It would have been worthwhile to mention this.
>
> >
> > I wonder if this is worthy of filing an issue report for the tree browser
> > plugin.
>
> Yes, on the correct place.
>
> Cheers
> Lex
>
> >
> >
> >
> > On Wed, Apr 4, 2012 at 4:49 AM, Lex Trotman  wrote:
> >>
> >> On 4 April 2012 19:42, Lex Trotman  wrote:
> >> > On 4 April 2012 18:52, worthspending  wrote:
> >> >> Ya know, I really don't even want to ask as I don't want to be a
> pest,
> >> >> but,
> >> >> I haven't found a good example of setting the umask prior to
> launching
> >> >> geany.  I would like to set the umask and  have it tied to geany
> only.
> >> >>  I
> >> >> run a lot of unattended processes, so, the line of thinking is if I
> >> >> make
> >> >> some type of global change I could introduce a problem to another
> >> >> program.
> >> >>
> >> >> I can confirm that the "save as" feature works as described in this
> >> >> thread.
> >> >>  No +x attribute on the saved file.
> >> >
> >> > Hi,
> >> >
> >> > In relation to your question, just do:
> >> >
> >> > umask 666; geany
> >>
> >>
> >> Ahhh, make that
> >>
> >> umask 111; geany
> >>
> >> because umask is the bits you *don't* want, allways got that wrong.
> >>
> >> Cheers
> >> Lex
> >>
> >> ___
> >> Geany-devel mailing list
> >> Geany-devel@uvena.de
> >> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
> >
> >
> >
> > ___
> > Geany-devel mailing list
> > Geany-devel@uvena.de
> > https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
> >
> ___
> Geany-devel mailing list
> Geany-devel@uvena.de
> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


Re: [Geany-devel] file attributes on a linux system

2012-04-05 Thread Lex Trotman
On 5 April 2012 19:40, worthspending  wrote:
> The question of how new files don't have +x using "save as" and do have +x
> might be answered with the following observation.
>
> - Create a new file File->New, then, File->Save, then, check the attribute:
>  No +x on the new file
> - Create a new file File->New, then, File->Save As, then, check the
> attribute: No +x on the new file
>
> I'm using the Tree Browser plugin, so...
> - Create a new file by right mouse click on the directory in the tree
> browser and enter the name of the new file directly into the text field in
> the list.  Hit enter to finish and create the file.  Check the attribute and
> it has +x on the new file.

It would have been worthwhile to mention this.

>
> I wonder if this is worthy of filing an issue report for the tree browser
> plugin.

Yes, on the correct place.

Cheers
Lex

>
>
>
> On Wed, Apr 4, 2012 at 4:49 AM, Lex Trotman  wrote:
>>
>> On 4 April 2012 19:42, Lex Trotman  wrote:
>> > On 4 April 2012 18:52, worthspending  wrote:
>> >> Ya know, I really don't even want to ask as I don't want to be a pest,
>> >> but,
>> >> I haven't found a good example of setting the umask prior to launching
>> >> geany.  I would like to set the umask and  have it tied to geany only.
>> >>  I
>> >> run a lot of unattended processes, so, the line of thinking is if I
>> >> make
>> >> some type of global change I could introduce a problem to another
>> >> program.
>> >>
>> >> I can confirm that the "save as" feature works as described in this
>> >> thread.
>> >>  No +x attribute on the saved file.
>> >
>> > Hi,
>> >
>> > In relation to your question, just do:
>> >
>> > umask 666; geany
>>
>>
>> Ahhh, make that
>>
>> umask 111; geany
>>
>> because umask is the bits you *don't* want, allways got that wrong.
>>
>> Cheers
>> Lex
>>
>> ___
>> Geany-devel mailing list
>> Geany-devel@uvena.de
>> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
>
>
> ___
> Geany-devel mailing list
> Geany-devel@uvena.de
> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


Re: [Geany-devel] file attributes on a linux system

2012-04-05 Thread worthspending
The question of how new files don't have +x using "save as" and do have +x
might be answered with the following observation.

- Create a new file File->New, then, File->Save, then, check the attribute:
 No +x on the new file
- Create a new file File->New, then, File->Save As, then, check the
attribute: No +x on the new file

I'm using the Tree Browser plugin, so...
- Create a new file by right mouse click on the directory in the tree
browser and enter the name of the new file directly into the text field in
the list.  Hit enter to finish and create the file.  Check the attribute
and it has +x on the new file.

I wonder if this is worthy of filing an issue report for the tree browser
plugin.



On Wed, Apr 4, 2012 at 4:49 AM, Lex Trotman  wrote:

> On 4 April 2012 19:42, Lex Trotman  wrote:
> > On 4 April 2012 18:52, worthspending  wrote:
> >> Ya know, I really don't even want to ask as I don't want to be a pest,
> but,
> >> I haven't found a good example of setting the umask prior to launching
> >> geany.  I would like to set the umask and  have it tied to geany only.
>  I
> >> run a lot of unattended processes, so, the line of thinking is if I make
> >> some type of global change I could introduce a problem to another
> program.
> >>
> >> I can confirm that the "save as" feature works as described in this
> thread.
> >>  No +x attribute on the saved file.
> >
> > Hi,
> >
> > In relation to your question, just do:
> >
> > umask 666; geany
>
>
> Ahhh, make that
>
> umask 111; geany
>
> because umask is the bits you *don't* want, allways got that wrong.
>
> Cheers
> Lex
> ___
> Geany-devel mailing list
> Geany-devel@uvena.de
> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


Re: [Geany-devel] [geany-plugins] SCN_DWELLEND when cursor leaves an editor window

2012-04-05 Thread Lex Trotman
On 5 April 2012 16:03, Alexander Petukhov  wrote:
> If a mouse pointer dwells in editor and then leaves an editor window quickly
> then in editor-notify
> I receive SCN_DWELLSTART and no SCN_DWELLEND after, and it turns out that I
> show a calltip
> even if a mouse is no longer in a scintilla window.
> Looks like scintilla does not allow to retrieve a mouse position and so does
> geany.
> Does anybody have any ideas how to handle this?

Hi Alexander,

I can't tell you how to solve the problem, but I think I can suggest
why it happens.

Scintilla uses the GDK_POINTER_MOTION_HINT_MASK setting to reduce the
number of motion events it receives.

If you are moving the pointer out of Geany fast enough it is possible
that Scintilla (and therefore you) is not getting a motion event from
GTK before the leave event.

Maybe you can connect to the leave event (and other relevant ones) to
decide to hide the tooltip.

Cheers
Lex


>
> Regards,
> Alexander
> ___
> Geany-devel mailing list
> Geany-devel@uvena.de
> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel