Commit 7a0777b3 authored by Paolo Maggi's avatar Paolo Maggi Committed by Paolo Maggi

added gconf_key and help_id parameters.

2003-09-25  Paolo Maggi  <paolo.maggi@polito.it>

 	* gedit-plugin.[ch](gedit_plugin_locate_program): added gconf_key and
 	  help_id parameters.

 	* dialogs/gedit-dialogs.h (gedit_plugin_program_location_dialog):
 	* dialogs/gedit-plugin-program-location-dialog.c (gedit_plugin_program_location_dialog):
 	  added gconf_key and help_id parameters.

 	This patch is needed to fix bugs #117365 and #117443.

 	Thanks to Balamurali Viswanathan <balamurali.viswanathan@wipro.com> for
 	the initial patch.


 2003-09-23 Leena Gunda  <leena.gunda@wipro.com>

        * time/time.c (help_button_pressed):
        Pass correct section-id for displaying help.
        Fixes bug #123007.
parent f4a5bae1
......@@ -16,7 +16,7 @@
2003-09-09 Paolo Maggi <paolo.maggi@polito.it>
* configure.in: bump version to 2.4.1
* configure.in: bump version to 2.4.0
* README: bump version to 2.4.0, updated requirements
......
2003-09-25 Paolo Maggi <paolo.maggi@polito.it>
* gedit-plugin.[ch](gedit_plugin_locate_program): added gconf_key and
help_id parameters.
* dialogs/gedit-dialogs.h (gedit_plugin_program_location_dialog):
* dialogs/gedit-plugin-program-location-dialog.c (gedit_plugin_program_location_dialog):
added gconf_key and help_id parameters.
This patch is needed to fix bugs #117365 and #117443.
Thanks to Balamurali Viswanathan <balamurali.viswanathan@wipro.com> for
the initial patch.
2003-09-18 Paolo Maggi <paolo.maggi@polito.it>
* dialogs/gedit-preferences.glade2:
......
......@@ -44,6 +44,8 @@ void gedit_dialog_open_uri (void);
gchar *gedit_plugin_program_location_dialog (const gchar *program_name,
const gchar *plugin_name,
GtkWindow *parent);
GtkWindow *parent,
const gchar *gconf_key,
const gchar *help_id);
#endif /* __GEDIT_DIALOGS_H__ */
......@@ -3,7 +3,7 @@
* gedit-plugin-program-location-dialog.c
* This file is part of gedit
*
* Copyright (C) 2002 Paolo Maggi
* Copyright (C) 2002-2003 Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -22,7 +22,7 @@
*/
/*
* Modified by the gedit Team, 2002. See the AUTHORS file for a
* Modified by the gedit Team, 2002-2003. See the AUTHORS file for a
* list of people on the gedit Team.
* See the ChangeLog files for a list of changes.
*/
......@@ -35,9 +35,11 @@
#include <libgnomeui/libgnomeui.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-help.h>
#include <gconf/gconf-client.h>
#include "gedit-dialogs.h"
#include "gedit-debug.h"
#include "gedit-utils.h"
#define PLUGIN_MANAGER_LOGO "/gedit-plugin-manager.png"
......@@ -48,7 +50,7 @@ static void error_dialog (const gchar* str, GtkWindow *parent);
*/
gchar *
gedit_plugin_program_location_dialog (const gchar *program_name, const gchar *plugin_name,
GtkWindow *parent)
GtkWindow *parent, const gchar *gconf_key, const gchar *help_id)
{
GladeXML *gui;
......@@ -57,6 +59,7 @@ gedit_plugin_program_location_dialog (const gchar *program_name, const gchar *pl
GtkWidget *label;
GtkWidget *logo;
GtkWidget *program_location_entry;
GConfClient *gconf_client;
gchar *str_label;
gchar *program_location;
......@@ -65,13 +68,18 @@ gedit_plugin_program_location_dialog (const gchar *program_name, const gchar *pl
gedit_debug (DEBUG_PLUGINS, "");
g_return_val_if_fail (program_name != NULL, NULL);
g_return_val_if_fail (plugin_name != NULL, NULL);
g_return_val_if_fail (gconf_key != NULL, NULL);
gconf_client = gconf_client_get_default ();
gui = glade_xml_new (GEDIT_GLADEDIR "program-location-dialog.glade2",
"dialog_content", NULL);
if (!gui) {
g_warning
("Could not find program-location-dialog.glade2, reinstall gedit.\n");
gedit_warning (
"Could not find program-location-dialog.glade2, reinstall gedit.", parent);
return NULL;
}
......@@ -101,6 +109,7 @@ gedit_plugin_program_location_dialog (const gchar *program_name, const gchar *pl
"program-location-dialog.glade2");
return NULL;
}
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
str_label = g_strdup_printf(_("The %s plugin uses an external program, "
......@@ -114,7 +123,13 @@ gedit_plugin_program_location_dialog (const gchar *program_name, const gchar *pl
/* stick the plugin manager logo in there */
gtk_image_set_from_file (GTK_IMAGE (logo), GNOME_ICONDIR PLUGIN_MANAGER_LOGO);
program_location = g_find_program_in_path (program_name);
program_location = gconf_client_get_string (gconf_client,
gconf_key,
NULL);
if (program_location == NULL)
program_location = g_find_program_in_path (program_name);
if (program_location != NULL)
{
gnome_file_entry_set_filename (GNOME_FILE_ENTRY (program_location_entry),
......@@ -158,11 +173,18 @@ gedit_plugin_program_location_dialog (const gchar *program_name, const gchar *pl
break;
case GTK_RESPONSE_HELP:
gnome_help_display ("gedit.xml", "gedit-use-plugins", &error);
if (help_id == NULL)
{
gnome_help_display ("gedit.xml", "gedit-plugins", &error);
}
else
{
gnome_help_display ("gedit.xml", help_id, &error);
}
if (error != NULL)
{
g_warning (error->message);
gedit_warning (error->message, GTK_WINDOW (dialog));
g_error_free (error);
}
......@@ -178,6 +200,16 @@ gedit_plugin_program_location_dialog (const gchar *program_name, const gchar *pl
gtk_widget_destroy (dialog);
if (program_location != NULL)
{
gconf_client_set_string (gconf_client,
gconf_key,
program_location,
NULL);
}
g_object_unref (gconf_client);
return program_location;
}
......
......@@ -35,8 +35,16 @@
#include "dialogs/gedit-dialogs.h"
gchar*
gedit_plugin_locate_program (const gchar *program_name, const gchar *plugin_name, GtkWindow *parent)
gedit_plugin_locate_program (const gchar *program_name,
const gchar *plugin_name,
GtkWindow *parent,
const gchar *gconf_key,
const gchar *help_id)
{
return gedit_plugin_program_location_dialog (program_name, plugin_name, parent);
return gedit_plugin_program_location_dialog (program_name,
plugin_name,
parent,
gconf_key,
help_id);
}
......@@ -72,7 +72,9 @@ struct _GeditPlugin
gchar* gedit_plugin_locate_program (const gchar *program_name,
const gchar *plugin_name,
GtkWindow *parent);
GtkWindow *parent,
const gchar *gconf_key,
const gchar *help_id);
#endif /* __GEDIT_PLUGIN_H__ */
......
2003-09-23 Leena Gunda <leena.gunda@wipro.com>
* time/time.c (help_button_pressed):
Pass correct section-id for displaying help.
Fixes bug #123007.
2003-09-09 Paolo Maggi <paolo.maggi@polito.it>
[ gedit 2.4.0 released ]
......
......@@ -44,6 +44,8 @@
#include <gedit/gedit-plugin.h>
#include <gedit/gedit-debug.h>
#include <gedit/gedit-menus.h>
#include <gedit/gedit-utils.h>
#define MENU_ITEM_LABEL N_("In_sert Date and Time...")
#define MENU_ITEM_PATH "/menu/Edit/EditOps_4/"
......@@ -945,11 +947,11 @@ help_button_pressed (TimeConfigureDialog *dialog)
gedit_debug (DEBUG_PLUGINS, "");
gnome_help_display ("gedit.xml", "gedit-use-plugins", &error);
gnome_help_display ("gedit.xml", "gedit-date-time-configure", &error);
if (error != NULL)
{
g_warning (error->message);
gedit_warning (error->message, GTK_WINDOW (dialog->dialog));
g_error_free (error);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment