Commit 22d00c42 authored by Vincent Untz's avatar Vincent Untz Committed by Vincent Untz
Browse files

New dialog to edit the launchers! (and my biggest ChangeLog entry ever!

2006-08-06  Vincent Untz  <vuntz@gnome.org>

	New dialog to edit the launchers!
	(and my biggest ChangeLog entry ever! awesome!)

	* Makefile.am: add panel-ditem-editor.[ch] and remove menu-ditem.[ch]
	* panel-ditem-editor.[ch]: new, with all the magic :-)
	* menu-ditem.[ch]: killed
	* gnome-desktop-item-edit.c: mark string for translation,
	(validate_for_filename): copied from menu-ditem.c
	(get_unique_name): ditto
	(find_uri_on_save_directory): new, to get the name when creating a
	.directory file
	(find_uri_on_save): new, ditto for .desktop files
	(error_reported): new, to report errors from the editor
	(main): mark string for translation, update with PanelDItemEditor love
	* launcher.[ch]: (panel_launcher_get_filename): updated so that we
	don't consider non-local files as okay
	(panel_launcher_save_ditem): kill
	(launch_url): moved to GKeyFile, updated for panel_error_dialog()
	change
	(launcher_launch): ditto
	(drag_data_received_cb): updated to use
	panel_util_launch_from_key_file(), updated for panel_error_dialog()
	change
	(free_launcher): updated
	(panel_launcher_delete): updated for location change
	(drag_data_get_cb): updated for location change
	(create_launcher): moved to GKeyFile, make sure that if the user edits
	a desktop file from a datadir, the desktop file will get a random name
	(guess_icon_from_exec): moved to GKeyFile
	(setup_button): ditto
	(panel_launcher_hoard): renamed to panel_launcher_find_writable_uri()
	and...
	(panel_launcher_find_writable_uri): ... change the function to only
	get a filename (without saving), also, make it more understandable :-)
	(properties_apply): kill
	(launcher_changed): rewrote, update button look
	(properties_close_callback): kill
	(launcher_command_changed): do what we did in previous
	launcher_changed(), ie: reset StartupNotify
	(launcher_save_uri): function to get uri where the PanelDItemEditor
	will save the file
	(set_revert_insensitive): kill
	(set_revert_sensitive): kill
	(window_response): kill
	(launcher_saved): update location gconf key if we had to change the
	uri of the file
	(create_properties_dialog): kill
	(launcher_error_reported): report error
	(launcher_properties): move to PanelDItemEditor
	(load_launcher_applet): fix leak in case of error
	(launcher_load_from_gconf): update string
	(ensure_item_localefiled): kill
	(launcher_new_saved): add the launcher to the profile
	(really_add_launcher): kill
	(ask_about_launcher): move to PanelDItemEditor
	(panel_launcher_create_from_info): move to panel_util_key_file*
	(panel_launcher_create_with_id): updated since panel_launcher_hoard()
	is killed
	(launcher_save): kill
	(find_launcher): updated
	* panel-util.[ch]: (panel_ditem_launch): make this private
	(panel_util_launch_from_key_file): new, to use gnome-desktop to launch
	a .desktop file in a GKeyFile
	(panel_launch_desktop_file): updated for panel_ditem_launch() change
	(panel_dialog): kill (well, integrated in panel_error_dialog())
	(panel_error_dialog): use GtkMessageDialog API to set the secondary
	text, make it possible to provide a parent window
	(panel_show_help): updated for panel_error_dialog() change
	(panel_lock_screen_action): ditto
	(panel_util_key_file_to_file): handle both URI and paths
	(panel_util_key_file_load_from_uri): new
	(panel_util_key_file_get_boolean): new
	(panel_util_key_file_set_locale_string): new
	(panel_util_key_file_remove_locale_key): new
	(and some other panel_util_key_file* macros): new

	* applet.c: updated for launcher_properties() change
	(panel_applet_register): update string
	* panel-applet-frame.c: (panel_applet_frame_activated): ditto
	* button-widget.c: (button_widget_reload_pixbuf): updated for
	panel_error_dialog() change
	* panel-action-button.c: (panel_action_search): ditto
	(panel_action_connect_server): ditto
	* panel-context-menu.c: (panel_context_menu_remove_panel): ditto
	(panel_context_menu_setup_remove_panel_it...): update string
	* panel-marshal.list: updated, and removed useless stuff
	* panel-menu-bar.c: (panel_menu_bar_invoke_menu): updated for
	panel_error_dialog() change
	* panel-menu-button.c: (panel_menu_button_invoke_menu): ditto
	* panel-menu-items.c: (activate_uri): ditto
	(panel_menu_item_activate_desktop_file): dittp
	(panel_menu_items_append_from_desktop): use panel_key_file* functions
	* panel-properties-dialog.c: (panel_properties_dialog_present):
	updated for panel_error_dialog() change
	* panel-recent.c: (recent_documents_activate_cb): ditto
	* panel-run-dialog.c: (panel_run_dialog_launch_command): ditto
	(panel_run_dialog_show_url): ditto
	(panel_run_dialog_execute): ditto
	(program_list_selection_changed): use panel_key_file* functions
	(panel_run_dialog_create_desktop_file): ditto
	(panel_run_dialog_present): updated for panel_error_dialog() change
	* panel-shell.c: (panel_shell_register): ditto
	* panel-widget.c: (panel_widget_class_init): use glib marshal
	functions
parent ff56ff9c
2006-08-06 Vincent Untz <vuntz@gnome.org>
New dialog to edit the launchers!
(and my biggest ChangeLog entry ever! awesome!)
* Makefile.am: add panel-ditem-editor.[ch] and remove menu-ditem.[ch]
* panel-ditem-editor.[ch]: new, with all the magic :-)
* menu-ditem.[ch]: killed
* gnome-desktop-item-edit.c: mark string for translation,
(validate_for_filename): copied from menu-ditem.c
(get_unique_name): ditto
(find_uri_on_save_directory): new, to get the name when creating a
.directory file
(find_uri_on_save): new, ditto for .desktop files
(error_reported): new, to report errors from the editor
(main): mark string for translation, update with PanelDItemEditor love
* launcher.[ch]: (panel_launcher_get_filename): updated so that we
don't consider non-local files as okay
(panel_launcher_save_ditem): kill
(launch_url): moved to GKeyFile, updated for panel_error_dialog()
change
(launcher_launch): ditto
(drag_data_received_cb): updated to use
panel_util_launch_from_key_file(), updated for panel_error_dialog()
change
(free_launcher): updated
(panel_launcher_delete): updated for location change
(drag_data_get_cb): updated for location change
(create_launcher): moved to GKeyFile, make sure that if the user edits
a desktop file from a datadir, the desktop file will get a random name
(guess_icon_from_exec): moved to GKeyFile
(setup_button): ditto
(panel_launcher_hoard): renamed to panel_launcher_find_writable_uri()
and...
(panel_launcher_find_writable_uri): ... change the function to only
get a filename (without saving), also, make it more understandable :-)
(properties_apply): kill
(launcher_changed): rewrote, update button look
(properties_close_callback): kill
(launcher_command_changed): do what we did in previous
launcher_changed(), ie: reset StartupNotify
(launcher_save_uri): function to get uri where the PanelDItemEditor
will save the file
(set_revert_insensitive): kill
(set_revert_sensitive): kill
(window_response): kill
(launcher_saved): update location gconf key if we had to change the
uri of the file
(create_properties_dialog): kill
(launcher_error_reported): report error
(launcher_properties): move to PanelDItemEditor
(load_launcher_applet): fix leak in case of error
(launcher_load_from_gconf): update string
(ensure_item_localefiled): kill
(launcher_new_saved): add the launcher to the profile
(really_add_launcher): kill
(ask_about_launcher): move to PanelDItemEditor
(panel_launcher_create_from_info): move to panel_util_key_file*
(panel_launcher_create_with_id): updated since panel_launcher_hoard()
is killed
(launcher_save): kill
(find_launcher): updated
* panel-util.[ch]: (panel_ditem_launch): make this private
(panel_util_launch_from_key_file): new, to use gnome-desktop to launch
a .desktop file in a GKeyFile
(panel_launch_desktop_file): updated for panel_ditem_launch() change
(panel_dialog): kill (well, integrated in panel_error_dialog())
(panel_error_dialog): use GtkMessageDialog API to set the secondary
text, make it possible to provide a parent window
(panel_show_help): updated for panel_error_dialog() change
(panel_lock_screen_action): ditto
(panel_util_key_file_to_file): handle both URI and paths
(panel_util_key_file_load_from_uri): new
(panel_util_key_file_get_boolean): new
(panel_util_key_file_set_locale_string): new
(panel_util_key_file_remove_locale_key): new
(and some other panel_util_key_file* macros): new
* applet.c: updated for launcher_properties() change
(panel_applet_register): update string
* panel-applet-frame.c: (panel_applet_frame_activated): ditto
* button-widget.c: (button_widget_reload_pixbuf): updated for
panel_error_dialog() change
* panel-action-button.c: (panel_action_search): ditto
(panel_action_connect_server): ditto
* panel-context-menu.c: (panel_context_menu_remove_panel): ditto
(panel_context_menu_setup_remove_panel_it...): update string
* panel-marshal.list: updated, and removed useless stuff
* panel-menu-bar.c: (panel_menu_bar_invoke_menu): updated for
panel_error_dialog() change
* panel-menu-button.c: (panel_menu_button_invoke_menu): ditto
* panel-menu-items.c: (activate_uri): ditto
(panel_menu_item_activate_desktop_file): dittp
(panel_menu_items_append_from_desktop): use panel_key_file* functions
* panel-properties-dialog.c: (panel_properties_dialog_present):
updated for panel_error_dialog() change
* panel-recent.c: (recent_documents_activate_cb): ditto
* panel-run-dialog.c: (panel_run_dialog_launch_command): ditto
(panel_run_dialog_show_url): ditto
(panel_run_dialog_execute): ditto
(program_list_selection_changed): use panel_key_file* functions
(panel_run_dialog_create_desktop_file): ditto
(panel_run_dialog_present): updated for panel_error_dialog() change
* panel-shell.c: (panel_shell_register): ditto
* panel-widget.c: (panel_widget_class_init): use glib marshal
functions
2006-08-05 Vincent Untz <vuntz@gnome.org>
 
* panel-run-dialog.c: (panel-run-dialog.c):
......
......@@ -98,6 +98,7 @@ panel_sources = \
panel-logout.c \
panel-gdm.c \
panel-power-manager.c \
panel-ditem-editor.c \
$(NULL)
panel_headers = \
......@@ -146,6 +147,7 @@ panel_headers = \
panel-logout.h \
panel-gdm.h \
panel-power-manager.h \
panel-ditem-editor.h \
$(NULL)
gnome_panel_SOURCES = \
......@@ -162,8 +164,8 @@ gnome_panel_LDFLAGS = -export-dynamic
gnome_desktop_item_edit_SOURCES = \
gnome-desktop-item-edit.c \
menu-ditem.c \
menu-ditem.h \
panel-ditem-editor.c \
panel-marshal.c \
panel-util.c \
xstuff.c
......
......@@ -235,7 +235,7 @@ applet_callback_callback (GtkWidget *widget,
if (!strcmp (menu->name, "launch"))
launcher_launch (menu->info->data, widget);
else if (!strcmp (menu->name, "properties"))
launcher_properties (menu->info->data, screen);
launcher_properties (menu->info->data);
break;
case PANEL_OBJECT_DRAWER:
if (strcmp (menu->name, "add") == 0) {
......@@ -1223,7 +1223,7 @@ panel_applet_register (GtkWidget *applet,
}
if (!l) {
g_warning (_("Can't find an empty spot"));
g_warning (_("Cannot find an empty spot"));
panel_profile_delete_object (info);
return NULL;
}
......
......@@ -193,11 +193,9 @@ button_widget_reload_pixbuf (ButtonWidget *button)
button->orientation & PANEL_HORIZONTAL_MASK ? button->size : -1,
&error);
if (error) {
panel_error_dialog (gdk_screen_get_default (),
panel_error_dialog (NULL, gdk_screen_get_default (),
"cannot_load_pixbuf", TRUE,
_("Could not load icon"),
"%s",
error);
_("Could not load icon"), error);
g_free (error);
}
}
......
......@@ -7,12 +7,12 @@
#include <libgnomevfs/gnome-vfs-ops.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include "menu-ditem.h"
#include "panel-ditem-editor.h"
#include "panel-util.h"
#include "nothing.cP"
/* Symbol needed by panel-util.c - sucky */
/* FIXME Symbol needed by panel-util.c - sucky */
#include "applet.h"
GSList *panel_applet_list_applets (void) { return NULL; }
......@@ -22,11 +22,10 @@ static char **desktops = NULL;
static const GOptionEntry options[] = {
{ "create-new", 0, 0, G_OPTION_ARG_NONE, &create_new, N_("Create new file in the given directory"), NULL },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &desktops, NULL, "[FILE...]" }, //FIXME 2.16 mark for translation
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &desktops, NULL, N_("[FILE...]") },
{ NULL }
};
static void
dialog_destroyed (GtkWidget *dialog, gpointer data)
{
......@@ -67,6 +66,104 @@ get_uri (const char *arg)
return uri;
}
static void
validate_for_filename (char *file)
{
char *ptr;
g_return_if_fail (file != NULL);
ptr = file;
while (*ptr != '\0') {
if (*ptr == '/')
*ptr = '_';
ptr++;
}
}
static char *
get_unique_name (const char *dir,
const char *name)
{
int i;
char *full;
char *nameext = g_strdup_printf ("%s.desktop", name);
full = g_build_path ("/", dir, nameext, NULL);
if (!panel_uri_exists (full)) {
g_free (nameext);
return full;
}
g_free (full);
i = 2;
for (;;) {
g_free (nameext);
nameext = g_strdup_printf ("%s%d.desktop", name, i++);
/* randomize further same name desktops */
if (i > 5)
i = g_random_int ();
full = g_build_path ("/", dir, nameext, NULL);
if (!panel_uri_exists (full)) {
g_free (nameext);
return full;
}
g_free (full);
}
}
static char *
find_uri_on_save_directory (PanelDItemEditor *dialog,
gpointer data)
{
char *filename;
filename = g_object_get_data (G_OBJECT (dialog), "filename");
return g_strdup (filename);
}
static char *
find_uri_on_save (PanelDItemEditor *dialog,
gpointer data)
{
GKeyFile *keyfile;
char *name;
char *filename;
char *uri;
char *dir;
keyfile = panel_ditem_editor_get_key_file (dialog);
name = panel_util_key_file_get_string (keyfile, "Name");
validate_for_filename (name);
filename = g_filename_from_utf8 (name, -1, NULL, NULL, NULL);
g_free (name);
if (filename == NULL)
filename = g_strdup ("foo");
dir = g_object_get_data (G_OBJECT (dialog), "dir");
uri = get_unique_name (dir, filename);
g_free (filename);
return uri;
}
static void
error_reported (GtkWidget *dialog,
const char *primary,
const char *secondary,
gpointer data)
{
panel_error_dialog (GTK_WINDOW (dialog), NULL,
"error_editing_launcher", TRUE,
primary, secondary);
}
int
main (int argc, char * argv[])
{
......@@ -79,7 +176,7 @@ main (int argc, char * argv[])
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
context = g_option_context_new (""); //FIXME 2.16 "- Edit .desktop files"
context = g_option_context_new (_("- Edit .desktop files"));
g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
......@@ -109,37 +206,37 @@ main (int argc, char * argv[])
(uri, info, GNOME_VFS_FILE_INFO_DEFAULT) == GNOME_VFS_OK) {
if (info->type == GNOME_VFS_FILE_TYPE_DIRECTORY && create_new) {
dlg = panel_new_launcher (
uri, gdk_screen_get_default ());
dlg = panel_ditem_editor_new (NULL, NULL, NULL,
_("Create Launcher"));
g_object_set_data_full (G_OBJECT (dlg), "dir",
g_strdup (uri),
(GDestroyNotify)g_free);
panel_ditem_register_save_uri_func (PANEL_DITEM_EDITOR (dlg),
find_uri_on_save,
NULL);
} else if (info->type == GNOME_VFS_FILE_TYPE_DIRECTORY) {
/* rerun this iteration with the .directory file */
/* Note: No need to free, for one we can't free an
* individual member of desktops and secondly we
* will soon exit */
desktops[i] =
g_build_path ("/", uri,
".directory", NULL);
/* Rerun this iteration with the .directory
* file
* Note: No need to free, for one we can't free
* an individual member of desktops and
* secondly we will soon exit */
desktops[i] = g_build_path ("/", uri,
".directory", NULL);
g_free (uri);
i--;
continue;
} else if (info->type == GNOME_VFS_FILE_TYPE_REGULAR
&& g_str_has_suffix (desktops [i], ".directory")
&& !create_new) {
char *dirname = g_path_get_dirname (uri);
dlg = panel_edit_direntry (dirname, NULL,
gdk_screen_get_default ());
g_free (dirname);
dlg = panel_ditem_editor_new (NULL, NULL, uri,
_("Directory Properties"));
} else if (info->type == GNOME_VFS_FILE_TYPE_REGULAR
&& g_str_has_suffix (desktops [i], ".desktop")
&& !create_new) {
char *dirname = g_path_get_dirname (uri);
dlg = panel_edit_dentry (uri, dirname,
gdk_screen_get_default ());
g_free (dirname);
dlg = panel_ditem_editor_new (NULL, NULL, uri,
_("Launcher Properties"));
} else {
g_printerr ("gnome-desktop-item-edit: %s "
"doesn't seem like a desktop "
......@@ -148,23 +245,37 @@ main (int argc, char * argv[])
} else if (g_str_has_suffix (desktops [i], ".directory")
&& !create_new) {
/* a non-existant file. Well we can still edit that sort
* of. We will just create it new */
char *dirname = g_path_get_dirname (uri);
dlg = panel_edit_direntry (dirname, NULL,
gdk_screen_get_default ());
/* a non-existant file. Well we can still edit that
* sort of. We will just create it new */
GKeyFile *key_file;
char *dirname;
char *filename;
dirname = g_path_get_dirname (uri);
filename = g_strconcat (dirname, "/", ".directory",
NULL);
g_free (dirname);
key_file = panel_util_key_file_new_desktop ();
panel_util_key_file_set_string (key_file,
"Type", "Directory");
dlg = panel_ditem_editor_new (NULL, key_file, NULL,
_("Directory Properties"));
g_object_set_data_full (G_OBJECT (dlg), "filename",
filename,
(GDestroyNotify)g_free);
panel_ditem_register_save_uri_func (PANEL_DITEM_EDITOR (dlg),
find_uri_on_save_directory,
NULL);
} else if (g_str_has_suffix (desktops [i], ".desktop")
&& !create_new) {
/* a non-existant file. Well we can still edit that sort
* of. We will just create it new */
/* FIXME: deal with issues of item existing in
* another vfolder! */
char *dirname = g_path_get_dirname (uri);
dlg = panel_edit_dentry (uri, dirname,
gdk_screen_get_default ());
g_free (dirname);
/* a non-existant file. Well we can still edit that
* sort of. We will just create it new */
dlg = panel_ditem_editor_new (NULL, NULL, uri,
_("Create Launcher"));
} else {
g_printerr ("gnome-desktop-item-edit: %s does "
......@@ -174,8 +285,10 @@ main (int argc, char * argv[])
if (dlg != NULL) {
dialogs ++;
g_signal_connect (G_OBJECT (dlg), "destroy",
G_CALLBACK (dialog_destroyed),
NULL);
G_CALLBACK (dialog_destroyed), NULL);
g_signal_connect (G_OBJECT (dlg), "error_reported",
G_CALLBACK (error_reported), NULL);
gtk_widget_show (dlg);
}
g_free (uri);
......
This diff is collapsed.
......@@ -14,8 +14,6 @@
#include "applet.h"
#include "panel-widget.h"
#include <libgnome/gnome-desktop-item.h>
G_BEGIN_DECLS
#define PANEL_LAUNCHERS_PATH "panel2.d/default/launchers"
......@@ -23,18 +21,14 @@ G_BEGIN_DECLS
typedef struct {
AppletInfo *info;
GtkWidget *button;
GtkWidget *dedit;
GnomeDesktopItem *ditem;
GnomeDesktopItem *revert_ditem;
char *location;
GKeyFile *key_file;
GtkWidget *prop_dialog;
GSList *error_dialogs;
gulong destroy_handler;
/* If we can't hoard, and it's not hoarded
already, then we can't write this launcher */
gboolean non_writable;
} Launcher;
void panel_launcher_create (PanelToplevel *toplevel,
......@@ -57,8 +51,7 @@ void panel_launcher_create_from_info (PanelToplevel *toplevel,
void launcher_launch (Launcher *launcher,
GtkWidget *widget);
void launcher_properties (Launcher *launcher,
GdkScreen *screen);
void launcher_properties (Launcher *launcher);
void launcher_load_from_gconf (PanelWidget *panel_widget,
gboolean locked,
......
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n.h>
#include <libgnomeui/gnome-ditem-edit.h>
#include "menu-ditem.h"
#include "panel-util.h"
enum {
REVERT_BUTTON
};
static void
ditem_properties_clicked (GtkWidget *w, int response, gpointer data)
{
GnomeDItemEdit *dee = g_object_get_data (G_OBJECT (w), "GnomeDItemEdit");
GnomeDesktopItem *ditem = data;
if (response == GTK_RESPONSE_HELP) {
panel_show_help (
gtk_window_get_screen (GTK_WINDOW (w)),
"user-guide.xml", "gospanel-52");
} else if (response == REVERT_BUTTON) {
if (ditem != NULL)
gnome_ditem_edit_set_ditem (dee, ditem);
else
gnome_ditem_edit_clear (dee);
gtk_dialog_set_response_sensitive (GTK_DIALOG (w),
REVERT_BUTTON,
FALSE);
} else {
gtk_widget_destroy (w);
}
}
static gboolean
ditem_properties_apply_timeout (gpointer data)
{
GtkWidget *dedit = data;
GnomeDesktopItem *ditem;
const char *loc;
GError *error = NULL;
g_object_set_data (G_OBJECT (dedit), "apply_timeout", NULL);
ditem = gnome_ditem_edit_get_ditem (GNOME_DITEM_EDIT (dedit));
loc = g_object_get_data (G_OBJECT (dedit), "location");
gnome_desktop_item_save (ditem,
loc /* under */,
TRUE /* force */,
&error);
/* save the error for later */
if (error != NULL) {
g_object_set_data_full (G_OBJECT (dedit), "SavingError",
g_strdup (error->message),
(GDestroyNotify) g_free);
g_clear_error (&error);
} else {
g_object_set_data (G_OBJECT (dedit), "SavingError", NULL);
}
return FALSE;
}
/*
* Will save after 5 seconds of no changes. If something is changed, the save
* is postponed to another 5 seconds. This seems to be a saner behaviour,
* then just saving every N seconds.
* And update the sensitivity of the Revert button.
*/
static void
ditem_properties_changed (GtkWidget *dedit,
GtkWidget *dialog)
{
gpointer timeout_data = g_object_get_data (G_OBJECT (dedit),
"apply_timeout");
guint timeout = GPOINTER_TO_UINT (timeout_data);
g_object_set_data (G_OBJECT (dedit), "apply_timeout", NULL);
if (timeout != 0)
g_source_remove (timeout);
/* Will delay save for after 2 seconds */
timeout = g_timeout_add (2 * 1000,
ditem_properties_apply_timeout,
dedit);
g_object_set_data (G_OBJECT (dedit), "apply_timeout",
GUINT_TO_POINTER (timeout));
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
REVERT_BUTTON,
TRUE);
}
static void
ditem_properties_close (GtkWidget *dialog,
GtkWidget *dedit)
{
const char *saving_error;
gpointer timeout_data = g_object_get_data (G_OBJECT (dedit),
"apply_timeout");
guint timeout = GPOINTER_TO_UINT (timeout_data);
g_object_set_data (G_OBJECT (dedit), "apply_timeout", NULL);
/* If there was a timeout, then something changed after last save,
* so we must save again now */
if (timeout != 0) {
g_source_remove (timeout);
ditem_properties_apply_timeout (dedit);
}
saving_error = g_object_get_data (G_OBJECT (dedit), "SavingError");
if (saving_error)
panel_error_dialog (gtk_window_get_screen (GTK_WINDOW (dialog)),
"cannot_save_entry", TRUE,
_("Could not save changes to launcher"),
"%s",
saving_error);
}
static gboolean
is_item_writable (const char *loc, const char *dir)
{
if (loc != NULL) {
/* if old style kde link file, don't allow editing */
if (g_str_has_suffix (loc, ".kdelnk"))
return FALSE;
if (panel_is_uri_writable (loc))
return TRUE;
else
return FALSE;
}
if (dir != NULL) {