2
* This file is part of libtile.
4
* Copyright (c) 2006, 2007 Novell, Inc.
6
* Libtile is free software; you can redistribute it and/or modify it under the
7
* terms of the GNU Lesser General Public License as published by the Free
8
* Software Foundation; either version 2 of the License, or (at your option)
11
* Libtile is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with libslab; if not, write to the Free Software Foundation, Inc., 51
18
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
#include "application-tile.h"
26
#include <glib/gi18n-lib.h>
27
#include <glib/gstdio.h>
28
#include <gconf/gconf-client.h>
31
#include "slab-gnome-util.h"
32
#include "libslab-utils.h"
33
#include "bookmark-agent.h"
34
#include "themed-icon.h"
36
G_DEFINE_TYPE (ApplicationTile, application_tile, NAMEPLATE_TILE_TYPE)
39
APP_IN_USER_STARTUP_DIR,
40
APP_NOT_IN_STARTUP_DIR,
44
static void application_tile_get_property (GObject *, guint, GValue *, GParamSpec *);
45
static void application_tile_set_property (GObject *, guint, const GValue *, GParamSpec *);
46
static void application_tile_finalize (GObject *);
48
static void application_tile_setup (ApplicationTile *, const gchar *);
50
static GtkWidget *create_header (const gchar *);
51
static GtkWidget *create_subheader (const gchar *);
53
static void header_size_allocate_cb (GtkWidget *, GtkAllocation *, gpointer);
55
static void start_trigger (Tile *, TileEvent *, TileAction *);
56
static void help_trigger (Tile *, TileEvent *, TileAction *);
57
static void user_apps_trigger (Tile *, TileEvent *, TileAction *);
58
static void startup_trigger (Tile *, TileEvent *, TileAction *);
59
static void upgrade_trigger (Tile *, TileEvent *, TileAction *);
60
static void uninstall_trigger (Tile *, TileEvent *, TileAction *);
62
static void add_to_user_list (ApplicationTile *);
63
static void remove_from_user_list (ApplicationTile *);
64
static void add_to_startup_list (ApplicationTile *);
65
static void remove_from_startup_list (ApplicationTile *);
67
static gboolean verify_package_management_command (const gchar *);
68
static void run_package_management_command (ApplicationTile *, gchar *);
70
static void update_user_list_menu_item (ApplicationTile *);
71
static void agent_notify_cb (GObject *, GParamSpec *, gpointer);
73
static StartupStatus get_desktop_item_startup_status (GnomeDesktopItem *);
74
static void update_startup_menu_item (ApplicationTile *);
77
GnomeDesktopItem *desktop_item;
80
gboolean image_is_broken;
81
GtkIconSize image_size;
83
gboolean show_generic_name;
84
StartupStatus startup_status;
87
BookmarkStoreStatus agent_status;
88
gboolean is_bookmarked;
89
gulong notify_signal_id;
90
} ApplicationTilePrivate;
92
#define APPLICATION_TILE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), APPLICATION_TILE_TYPE, ApplicationTilePrivate))
96
PROP_APPLICATION_NAME,
97
PROP_APPLICATION_DESCRIPTION,
98
PROP_APPLICATION_GCONF_PREFIX
102
application_tile_class_init (ApplicationTileClass *app_tile_class)
104
GObjectClass *g_obj_class = G_OBJECT_CLASS (app_tile_class);
106
g_obj_class->get_property = application_tile_get_property;
107
g_obj_class->set_property = application_tile_set_property;
108
g_obj_class->finalize = application_tile_finalize;
110
g_type_class_add_private (app_tile_class, sizeof (ApplicationTilePrivate));
112
g_object_class_install_property (
113
g_obj_class, PROP_APPLICATION_NAME,
114
g_param_spec_string (
115
"application-name", "application-name",
116
"the name of the application", NULL,
117
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
119
g_object_class_install_property (
120
g_obj_class, PROP_APPLICATION_DESCRIPTION,
121
g_param_spec_string (
122
"application-description", "application-description",
123
"the name of the application", NULL,
124
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
126
g_object_class_install_property (
127
g_obj_class, PROP_APPLICATION_GCONF_PREFIX,
128
g_param_spec_string (
129
"gconf-prefix", "gconf-prefix",
130
"configuration prefix", NULL,
131
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
135
application_tile_new (const gchar *desktop_item_id)
137
return application_tile_new_full (desktop_item_id, GTK_ICON_SIZE_DND, TRUE, NULL);
141
application_tile_new_full (const gchar *desktop_item_id,
142
GtkIconSize image_size, gboolean show_generic_name, const gchar *gconf_prefix)
144
ApplicationTile *this;
145
ApplicationTilePrivate *priv;
147
const gchar *uri = NULL;
149
GnomeDesktopItem *desktop_item;
152
desktop_item = load_desktop_item_from_unknown (desktop_item_id);
156
gnome_desktop_item_get_entry_type (desktop_item) == GNOME_DESKTOP_ITEM_TYPE_APPLICATION
158
uri = gnome_desktop_item_get_location (desktop_item);
162
gnome_desktop_item_unref (desktop_item);
167
this = g_object_new (APPLICATION_TILE_TYPE, "tile-uri", uri, NULL);
168
priv = APPLICATION_TILE_GET_PRIVATE (this);
170
priv->image_size = image_size;
171
priv->desktop_item = desktop_item;
172
priv->show_generic_name = show_generic_name;
174
application_tile_setup (this, gconf_prefix);
176
return GTK_WIDGET (this);
180
application_tile_init (ApplicationTile *tile)
182
ApplicationTilePrivate *priv = APPLICATION_TILE_GET_PRIVATE (tile);
184
priv->desktop_item = NULL;
185
priv->image_id = NULL;
186
priv->image_is_broken = TRUE;
189
priv->agent_status = BOOKMARK_STORE_ABSENT;
190
priv->is_bookmarked = FALSE;
191
priv->notify_signal_id = 0;
193
tile->name = tile->description = tile->gconf_prefix = NULL;
197
application_tile_finalize (GObject *g_object)
199
ApplicationTile *tile = APPLICATION_TILE (g_object);
200
ApplicationTilePrivate *priv = APPLICATION_TILE_GET_PRIVATE (g_object);
206
if (tile->description) {
207
g_free (tile->description);
208
tile->description = NULL;
210
if (tile->gconf_prefix) {
211
g_free (tile->gconf_prefix);
212
tile->gconf_prefix = NULL;
215
if (priv->desktop_item) {
216
gnome_desktop_item_unref (priv->desktop_item);
217
priv->desktop_item = NULL;
219
if (priv->image_id) {
220
g_free (priv->image_id);
221
priv->image_id = NULL;
224
if (priv->notify_signal_id)
225
g_signal_handler_disconnect (priv->agent, priv->notify_signal_id);
227
g_object_unref (G_OBJECT (priv->agent));
229
G_OBJECT_CLASS (application_tile_parent_class)->finalize (g_object);
233
application_tile_get_property (GObject *g_obj, guint prop_id, GValue *value, GParamSpec *param_spec)
235
ApplicationTile *tile = APPLICATION_TILE (g_obj);
238
case PROP_APPLICATION_NAME:
239
g_value_set_string (value, tile->name);
242
case PROP_APPLICATION_DESCRIPTION:
243
g_value_set_string (value, tile->description);
246
case PROP_APPLICATION_GCONF_PREFIX:
247
g_value_set_string (value, tile->gconf_prefix);
256
application_tile_set_property (GObject *g_obj, guint prop_id, const GValue *value, GParamSpec *param_spec)
258
ApplicationTile *tile = APPLICATION_TILE (g_obj);
261
case PROP_APPLICATION_NAME:
264
tile->name = g_strdup (g_value_get_string (value));
267
case PROP_APPLICATION_DESCRIPTION:
268
if (tile->description)
269
g_free (tile->description);
270
tile->description = g_strdup (g_value_get_string (value));
273
case PROP_APPLICATION_GCONF_PREFIX:
274
if (tile->gconf_prefix)
275
g_free (tile->gconf_prefix);
276
tile->gconf_prefix = g_strdup (g_value_get_string (value));
285
application_tile_setup (ApplicationTile *this, const gchar *gconf_prefix)
287
ApplicationTilePrivate *priv = APPLICATION_TILE_GET_PRIVATE (this);
291
GtkWidget *subheader;
292
GtkMenu *context_menu;
293
AtkObject *accessible;
295
TileAction **actions;
297
GtkWidget *menu_item;
298
GtkContainer *menu_ctnr;
303
const gchar *comment;
309
/*Fixme - need to address the entire gconf key location issue */
310
/*Fixme - this is just a temporary stop gap */
311
gboolean use_new_prefix;
314
if (! priv->desktop_item) {
315
priv->desktop_item = load_desktop_item_from_unknown (TILE (this)->uri);
317
if (! priv->desktop_item)
321
priv->image_id = g_strdup (gnome_desktop_item_get_localestring (priv->desktop_item, "Icon"));
322
image = themed_icon_new (priv->image_id, priv->image_size);
324
name = gnome_desktop_item_get_localestring (priv->desktop_item, "Name");
325
desc = gnome_desktop_item_get_localestring (priv->desktop_item, "GenericName");
326
comment = gnome_desktop_item_get_localestring (priv->desktop_item, "Comment");
328
accessible = gtk_widget_get_accessible (GTK_WIDGET (this));
330
atk_object_set_name (accessible, name);
332
atk_object_set_description (accessible, desc);
334
header = create_header (name);
336
/*if no GenericName then just show and center the Name */
337
if (desc && priv->show_generic_name
338
&& (!name || strcmp(name, desc) != 0))
339
subheader = create_subheader (desc);
343
context_menu = GTK_MENU (gtk_menu_new ());
347
"nameplate-image", image,
348
"nameplate-header", header,
349
"nameplate-subheader", subheader,
350
"context-menu", context_menu,
351
"application-name", name,
352
"application-description", desc,
353
"gconf-prefix", gconf_prefix,
355
gtk_widget_set_tooltip_text (GTK_WIDGET (this), comment);
357
priv->agent = bookmark_agent_get_instance (BOOKMARK_STORE_USER_APPS);
358
g_object_get (G_OBJECT (priv->agent), BOOKMARK_AGENT_STORE_STATUS_PROP, & priv->agent_status, NULL);
360
priv->notify_signal_id = g_signal_connect (
361
G_OBJECT (priv->agent), "notify", G_CALLBACK (agent_notify_cb), this);
363
priv->startup_status = get_desktop_item_startup_status (priv->desktop_item);
365
actions = g_new0 (TileAction *, 6);
367
TILE (this)->actions = actions;
368
TILE (this)->n_actions = 6;
370
menu_ctnr = GTK_CONTAINER (TILE (this)->context_menu);
372
/* make start action */
374
str = g_strdup_printf (_("Start %s"), this->name);
375
markup = g_markup_printf_escaped ("<b>%s</b>", str);
376
action = tile_action_new (TILE (this), start_trigger, markup, TILE_ACTION_OPENS_NEW_WINDOW);
377
actions [APPLICATION_TILE_ACTION_START] = action;
381
menu_item = GTK_WIDGET (tile_action_get_menu_item (action));
383
gtk_container_add (menu_ctnr, menu_item);
385
TILE (this)->default_action = action;
387
/* insert separator */
389
gtk_container_add (menu_ctnr, gtk_separator_menu_item_new ());
391
/* make help action */
393
if (gnome_desktop_item_get_string (priv->desktop_item, "DocPath")) {
394
action = tile_action_new (
395
TILE (this), help_trigger, _("Help"),
396
TILE_ACTION_OPENS_NEW_WINDOW | TILE_ACTION_OPENS_HELP);
398
menu_item = GTK_WIDGET (tile_action_get_menu_item (action));
399
gtk_container_add (menu_ctnr, menu_item);
405
actions [APPLICATION_TILE_ACTION_HELP] = action;
407
/* insert separator */
410
gtk_container_add (menu_ctnr, gtk_separator_menu_item_new ());
412
/* make "add/remove to favorites" action */
414
update_user_list_menu_item (this);
416
/* make "add/remove to startup" action */
418
if (priv->startup_status != APP_NOT_ELIGIBLE) {
419
action = tile_action_new (TILE (this), startup_trigger, NULL, 0);
420
actions [APPLICATION_TILE_ACTION_UPDATE_STARTUP] = action;
422
update_startup_menu_item (this);
424
menu_item = GTK_WIDGET (tile_action_get_menu_item (action));
426
gtk_container_add (menu_ctnr, menu_item);
429
/* make upgrade action */
431
if (this->gconf_prefix && ! g_str_has_prefix (this->gconf_prefix, "/desktop/"))
432
use_new_prefix = TRUE;
434
use_new_prefix = FALSE;
437
key = SLAB_UPGRADE_PACKAGE_KEY;
439
key = "/apps/main-menu/upgrade_package_command";
441
if (verify_package_management_command (key)) {
442
action = tile_action_new (TILE (this), upgrade_trigger, _("Upgrade"), TILE_ACTION_OPENS_NEW_WINDOW);
443
actions [APPLICATION_TILE_ACTION_UPGRADE_PACKAGE] = action;
444
menu_item = GTK_WIDGET (tile_action_get_menu_item (action));
445
gtk_container_add (menu_ctnr, menu_item);
447
actions [APPLICATION_TILE_ACTION_UPGRADE_PACKAGE] = NULL;
449
/* make uninstall action */
452
key = SLAB_UNINSTALL_PACKAGE_KEY;
454
key = "/apps/main-menu/uninstall_package_command";
456
if (verify_package_management_command (key)) {
457
action = tile_action_new (TILE (this), uninstall_trigger, _("Uninstall"), TILE_ACTION_OPENS_NEW_WINDOW);
458
actions [APPLICATION_TILE_ACTION_UNINSTALL_PACKAGE] = action;
459
menu_item = GTK_WIDGET (tile_action_get_menu_item (action));
460
gtk_container_add (menu_ctnr, menu_item);
462
actions [APPLICATION_TILE_ACTION_UNINSTALL_PACKAGE] = NULL;
464
gtk_widget_show_all (GTK_WIDGET (TILE (this)->context_menu));
468
create_header (const gchar *name)
473
header = gtk_label_new (name);
474
gtk_label_set_line_wrap (GTK_LABEL (header), TRUE);
475
gtk_misc_set_alignment (GTK_MISC (header), 0.0, 0.5);
480
G_CALLBACK (header_size_allocate_cb),
487
create_subheader (const gchar *desc)
489
GtkWidget *subheader;
492
subheader = gtk_label_new (desc);
493
gtk_label_set_ellipsize (GTK_LABEL (subheader), PANGO_ELLIPSIZE_END);
494
gtk_misc_set_alignment (GTK_MISC (subheader), 0.0, 0.5);
495
gtk_widget_modify_fg (
498
& subheader->style->fg [GTK_STATE_INSENSITIVE]);
504
start_trigger (Tile *tile, TileEvent *event, TileAction *action)
506
open_desktop_item_exec (APPLICATION_TILE_GET_PRIVATE (tile)->desktop_item);
510
help_trigger (Tile *tile, TileEvent *event, TileAction *action)
512
open_desktop_item_help (APPLICATION_TILE_GET_PRIVATE (tile)->desktop_item);
516
user_apps_trigger (Tile *tile, TileEvent *event, TileAction *action)
518
ApplicationTile *this = APPLICATION_TILE (tile);
519
ApplicationTilePrivate *priv = APPLICATION_TILE_GET_PRIVATE (this);
521
if (priv->is_bookmarked)
522
remove_from_user_list (this);
524
add_to_user_list (this);
526
update_user_list_menu_item (this);
530
add_to_user_list (ApplicationTile *this)
532
ApplicationTilePrivate *priv = APPLICATION_TILE_GET_PRIVATE (this);
537
item = g_new0 (BookmarkItem, 1);
538
item->uri = TILE (this)->uri;
539
item->mime_type = "application/x-desktop";
541
bookmark_agent_add_item (priv->agent, item);
544
priv->is_bookmarked = TRUE;
548
remove_from_user_list (ApplicationTile *this)
550
ApplicationTilePrivate *priv = APPLICATION_TILE_GET_PRIVATE (this);
552
bookmark_agent_remove_item (priv->agent, TILE (this)->uri);
554
priv->is_bookmarked = FALSE;
558
upgrade_trigger (Tile *tile, TileEvent *event, TileAction *action)
560
run_package_management_command (APPLICATION_TILE (tile), SLAB_UPGRADE_PACKAGE_KEY);
564
uninstall_trigger (Tile *tile, TileEvent *event, TileAction *action)
566
run_package_management_command (APPLICATION_TILE (tile), SLAB_UNINSTALL_PACKAGE_KEY);
570
verify_package_management_command (const gchar *gconf_key)
578
cmd = get_slab_gconf_string (gconf_key);
582
args = strchr (cmd, ' ');
587
path = g_find_program_in_path (cmd);
589
retval = (path != NULL);
598
run_package_management_command (ApplicationTile *tile, gchar *gconf_key)
600
ApplicationTilePrivate *priv = APPLICATION_TILE_GET_PRIVATE (tile);
609
GError *error = NULL;
611
package_name = get_package_name_from_desktop_item (priv->desktop_item);
616
cmd_precis = get_slab_gconf_string (gconf_key);
618
g_assert (cmd_precis);
620
pivot = strstr (cmd_precis, "PACKAGE_NAME") - cmd_precis;
622
cmd = g_string_new_len (cmd_precis, pivot);
623
g_string_append (cmd, package_name);
624
g_string_append (cmd, & cmd_precis [pivot + 12]);
626
argv = g_strsplit (cmd->str, " ", -1);
628
g_string_free (cmd, TRUE);
630
g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error);
633
g_warning ("error: [%s]\n", error->message);
635
g_error_free (error);
639
g_free (package_name);
644
startup_trigger (Tile *tile, TileEvent *event, TileAction *action)
646
ApplicationTile *this = APPLICATION_TILE (tile);
647
ApplicationTilePrivate *priv = APPLICATION_TILE_GET_PRIVATE (this);
649
switch (priv->startup_status) {
650
case APP_IN_USER_STARTUP_DIR:
651
remove_from_startup_list (this);
654
case APP_NOT_IN_STARTUP_DIR:
655
add_to_startup_list (this);
662
update_startup_menu_item (this);
666
add_to_startup_list (ApplicationTile *this)
668
ApplicationTilePrivate *priv = APPLICATION_TILE_GET_PRIVATE (this);
670
gchar *desktop_item_filename;
671
gchar *desktop_item_basename;
676
const gchar *src_uri;
679
desktop_item_filename =
680
g_filename_from_uri (gnome_desktop_item_get_location (priv->desktop_item), NULL,
683
g_return_if_fail (desktop_item_filename != NULL);
685
desktop_item_basename = g_path_get_basename (desktop_item_filename);
687
startup_dir = g_build_filename (g_get_user_config_dir (), "autostart", NULL);
689
if (! g_file_test (startup_dir, G_FILE_TEST_EXISTS))
690
g_mkdir_with_parents (startup_dir, 0700);
692
dst_filename = g_build_filename (startup_dir, desktop_item_basename, NULL);
694
src_uri = gnome_desktop_item_get_location (priv->desktop_item);
695
dst_uri = g_filename_to_uri (dst_filename, NULL, NULL);
697
copy_file (src_uri, dst_uri);
698
priv->startup_status = APP_IN_USER_STARTUP_DIR;
700
g_free (desktop_item_filename);
701
g_free (desktop_item_basename);
702
g_free (startup_dir);
703
g_free (dst_filename);
708
remove_from_startup_list (ApplicationTile *this)
710
ApplicationTilePrivate *priv = APPLICATION_TILE_GET_PRIVATE (this);
712
gchar *ditem_filename;
713
gchar *ditem_basename;
717
g_filename_from_uri (gnome_desktop_item_get_location (priv->desktop_item), NULL,
720
g_return_if_fail (ditem_filename != NULL);
722
ditem_basename = g_path_get_basename (ditem_filename);
724
src_filename = g_build_filename (g_get_user_config_dir (), "autostart", ditem_basename, NULL);
726
priv->startup_status = APP_NOT_IN_STARTUP_DIR;
727
if (g_file_test (src_filename, G_FILE_TEST_EXISTS))
729
if(g_file_test (src_filename, G_FILE_TEST_IS_DIR))
730
g_assert_not_reached ();
731
g_unlink (src_filename);
734
g_free (ditem_filename);
735
g_free (ditem_basename);
736
g_free (src_filename);
740
application_tile_get_desktop_item (ApplicationTile *tile)
742
return APPLICATION_TILE_GET_PRIVATE (tile)->desktop_item;
746
update_user_list_menu_item (ApplicationTile *this)
748
ApplicationTilePrivate *priv = APPLICATION_TILE_GET_PRIVATE (this);
754
if (priv->agent_status == BOOKMARK_STORE_ABSENT) {
755
if (TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU])
756
g_object_unref (TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU]);
758
TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU] = NULL;
760
else if (! TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU]) {
761
TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU] =
762
tile_action_new (TILE (this), user_apps_trigger, NULL, 0);
764
tile_action_set_menu_item_label (
765
TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU], "blah");
767
item = GTK_WIDGET (tile_action_get_menu_item (
768
TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU]));
769
gtk_menu_shell_insert (GTK_MENU_SHELL (TILE (this)->context_menu), item, 4);
771
gtk_widget_show_all (item);
776
action = TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU];
781
priv->is_bookmarked = bookmark_agent_has_item (priv->agent, TILE (this)->uri);
783
if (priv->is_bookmarked)
784
tile_action_set_menu_item_label (action, _("Remove from Favorites"));
786
tile_action_set_menu_item_label (action, _("Add to Favorites"));
788
item = GTK_WIDGET (tile_action_get_menu_item (action));
790
if (! GTK_IS_MENU_ITEM (item))
793
g_object_get (G_OBJECT (priv->agent), BOOKMARK_AGENT_STORE_STATUS_PROP, & priv->agent_status, NULL);
795
gtk_widget_set_sensitive (item, (priv->agent_status != BOOKMARK_STORE_DEFAULT_ONLY));
799
get_desktop_item_startup_status (GnomeDesktopItem *desktop_item)
804
const gchar * const * global_dirs;
805
gchar *global_target;
808
StartupStatus retval;
811
filename = g_filename_from_uri (gnome_desktop_item_get_location (desktop_item), NULL, NULL);
813
return APP_NOT_ELIGIBLE;
814
basename = g_path_get_basename (filename);
816
retval = APP_NOT_IN_STARTUP_DIR;
817
global_dirs = g_get_system_config_dirs();
818
for(x=0; global_dirs[x]; x++)
820
global_target = g_build_filename (global_dirs[x], "autostart", basename, NULL);
821
if (g_file_test (global_target, G_FILE_TEST_EXISTS))
823
retval = APP_NOT_ELIGIBLE;
824
g_free (global_target);
827
g_free (global_target);
830
/* gnome-session currently checks these dirs also. see startup-programs.c */
831
if (retval != APP_NOT_ELIGIBLE)
833
global_dirs = g_get_system_data_dirs();
834
for(x=0; global_dirs[x]; x++)
836
global_target = g_build_filename (global_dirs[x], "gnome", "autostart", basename, NULL);
837
if (g_file_test (global_target, G_FILE_TEST_EXISTS))
839
retval = APP_NOT_ELIGIBLE;
840
g_free (global_target);
843
g_free (global_target);
847
if (retval != APP_NOT_ELIGIBLE)
849
user_target = g_build_filename (g_get_user_config_dir (), "autostart", basename, NULL);
850
if (g_file_test (user_target, G_FILE_TEST_EXISTS))
851
retval = APP_IN_USER_STARTUP_DIR;
852
g_free (user_target);
862
update_startup_menu_item (ApplicationTile *this)
864
TileAction *action = TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_STARTUP];
865
ApplicationTilePrivate *priv = APPLICATION_TILE_GET_PRIVATE (this);
870
if (priv->startup_status == APP_IN_USER_STARTUP_DIR)
871
tile_action_set_menu_item_label (action, _("Remove from Startup Programs"));
873
tile_action_set_menu_item_label (action, _("Add to Startup Programs"));
877
header_size_allocate_cb (GtkWidget *widget, GtkAllocation *alloc, gpointer user_data)
879
gtk_widget_set_size_request (widget, alloc->width, -1);
883
agent_notify_cb (GObject *g_obj, GParamSpec *pspec, gpointer user_data)
885
update_user_list_menu_item (APPLICATION_TILE (user_data));