Re: Fw: new release
John Ellis <[email protected]> Sat, 14 Oct 2006 15:57:09 -0400
| Newsgroups | gmane.comp.gnome.apps.gqview.devel |
|---|---|
| Message-ID | <[email protected]> |
Frédéric wrote:
> On Saturday 14 October 2006 10:58, John Ellis wrote:
>
>>> 4) I would like to have more than 10 external editors, even if only
>>> the firsts have shortcuts (Ctrl+<num> )...
>> Change the #define in gqview.h:
>>
>> #define GQVIEW_EDITOR_SLOTS 10
>>
>> and recompile, it should work as you request.
>
> It doesn't :o( I get a segmentation fault. It fails in
> editor_reset_defaults() (from file editors.c), line 81:
>
> editor_name[i] = g_strdup(_(editor_slot_defaults[i * 2]));
>
> when 'i' reach 11... The problem comes from editor_slot_defaults struct,
> which needs to be initialized with enought slots:
>
> static gchar *editor_slot_defaults[] = {
> N_("The Gimp"), "gimp-remote -n %f",
> N_("XV"), "xv %f",
> N_("Xpaint"), "xpaint %f",
> NULL, NULL,
> NULL, NULL,
> NULL, NULL,
> NULL, NULL,
> NULL, NULL,
> N_("Rotate jpeg clockwise"), "%vif jpegtran -rotate 90 -copy
> all -outfile %p_tmp %p; then mv %p_tmp %p;else rm %p_tmp;fi",
> N_("Rotate jpeg counterclockwise"), "%vif jpegtran -rotate 270 -copy
> all -outfile %p_tmp %p; then mv %p_tmp %p;else rm %p_tmp;fi",
> NULL, NULL
> };
>
> I added some NULL, NULL, and it does not crash anymore.
Sorry, I forgot about that. You could also change the function:
void editor_reset_defaults(void)
{
gint i;
for (i = 0; i < GQVIEW_EDITOR_SLOTS; i++)
{
g_free(editor_name[i]);
g_free(editor_command[i]);
if (i < sizeof(editor_slot_defaults) / 2)
{
editor_name[i] = g_strdup(_(editor_slot_defaults[i * 2]));
editor_command[i] = g_strdup(editor_slot_defaults[i * 2 + 1]);
}
else
{
editor_name[i] = NULL;
editor_command[i] = NULL;
}
}
> But if all entries appears in the preference dialog, and in the context
> popup menu, I don't see them under the Edit menu. Where is this menu
> defined?
The main menu is in layout_util.c as menu_entries[] and
menu_ui_description[]. If you look you can see that the top level branches
of the main menu are fixed, the only dynamic portion is the recent files
submenu.
To add editor slots above 10, it would be easiest to create a submenu built
in the same way as recent files for the remaining editor slots.
Greetings,
John
--
John Ellis <[email protected]>
http://gqview.sourceforge.net <GQview> | http://hideseek.sourceforge.net
http://gqmpeg.sourceforge.net <GQmpeg> | <Preferences Hide and Seek>
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642