diff options
author | Yaakov Selkowitz <yselkowi@redhat.com> | 2015-01-11 16:03:58 -0600 |
---|---|---|
committer | Yaakov Selkowitz <yselkowi@redhat.com> | 2015-01-11 16:03:58 -0600 |
commit | e19f5d68e5835eb93ae8e7b9e5de701a860987f8 (patch) | |
tree | f1aab77d1f1bfff01a115edf37cbc0adaf291768 /launcher-desktop-files.patch | |
parent | 26ea386096c0cd7de55cc2226c46b63338c0ef39 (diff) | |
download | gnome-panel-f20.tar.gz gnome-panel-f20.tar.xz gnome-panel-f20.zip |
Revert "Package is retired, replaced by the GNOME Classic session in F19"f20
This reverts commit 26ea386096c0cd7de55cc2226c46b63338c0ef39.
Diffstat (limited to 'launcher-desktop-files.patch')
-rw-r--r-- | launcher-desktop-files.patch | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/launcher-desktop-files.patch b/launcher-desktop-files.patch new file mode 100644 index 0000000..ab2d715 --- /dev/null +++ b/launcher-desktop-files.patch @@ -0,0 +1,80 @@ +diff -up gnome-panel-2.29.5.1/gnome-panel/panel-ditem-editor.c.launcher-desktop-files gnome-panel-2.29.5.1/gnome-panel/panel-ditem-editor.c +--- gnome-panel-2.29.5.1/gnome-panel/panel-ditem-editor.c.launcher-desktop-files 2010-01-13 22:26:27.000000000 -0500 ++++ gnome-panel-2.29.5.1/gnome-panel/panel-ditem-editor.c 2010-01-17 18:05:34.492279538 -0500 +@@ -960,6 +960,51 @@ panel_ditem_editor_icon_changed (PanelDI + icon); + } + ++static gboolean ++update_editor_from_desktop_file (PanelDItemEditor *dialog, ++ const gchar *uri) ++{ ++ GKeyFile *key_file; ++ char *name; ++ char *comment; ++ char *exec; ++ char *icon; ++ gboolean retval = FALSE; ++ ++ key_file = g_key_file_new (); ++ if (g_key_file_load_from_file (key_file, uri, 0, NULL)) { ++ if (panel_key_file_get_boolean (key_file, "Terminal", FALSE)) ++ gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->type_combo), 1); ++ else ++ gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->type_combo), 0); ++ ++ name = panel_key_file_get_locale_string (key_file, "Name"); ++ comment = panel_key_file_get_locale_string (key_file, "Comment"); ++ icon = panel_key_file_get_locale_string (key_file, "Icon"); ++ exec = panel_key_file_get_string (key_file, "Exec"); ++ ++ gtk_entry_set_text (GTK_ENTRY (dialog->priv->name_entry), name ? name : ""); ++ gtk_entry_set_text (GTK_ENTRY (dialog->priv->comment_entry), comment ? comment : ""); ++ gtk_entry_set_text (GTK_ENTRY (dialog->priv->command_entry), exec ? exec : ""); ++ ++ /* Note: we need to set the icon last, since the editor ++ * tries to guess the icon when the command is modified ++ */ ++ setup_icon_chooser (dialog, icon); ++ ++ g_free (name); ++ g_free (comment); ++ g_free (icon); ++ g_free (exec); ++ ++ retval = TRUE; ++ } ++ ++ g_key_file_free (key_file); ++ ++ return retval; ++} ++ + static void + command_browse_chooser_response (GtkFileChooser *chooser, + gint response_id, +@@ -973,7 +1018,11 @@ command_browse_chooser_response (GtkFile + case PANEL_DITEM_EDITOR_TYPE_APPLICATION: + case PANEL_DITEM_EDITOR_TYPE_TERMINAL_APPLICATION: + text = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); +- uri = panel_util_make_exec_uri_for_desktop (text); ++ if (g_str_has_suffix (text, ".desktop") && ++ update_editor_from_desktop_file (dialog, text)) ++ uri = NULL; ++ else ++ uri = panel_util_make_exec_uri_for_desktop (text); + g_free (text); + break; + case PANEL_DITEM_EDITOR_TYPE_LINK: +@@ -983,8 +1032,9 @@ command_browse_chooser_response (GtkFile + g_assert_not_reached (); + } + +- gtk_entry_set_text (GTK_ENTRY (dialog->priv->command_entry), +- uri); ++ if (uri) ++ gtk_entry_set_text (GTK_ENTRY (dialog->priv->command_entry), ++ uri); + g_free (uri); + } + |