|
Lines 55-60
static void open_with_default_trigger
Link Here
|
| 55 |
static void open_in_file_manager_trigger (Tile *, TileEvent *, TileAction *); |
55 |
static void open_in_file_manager_trigger (Tile *, TileEvent *, TileAction *); |
| 56 |
static void rename_trigger (Tile *, TileEvent *, TileAction *); |
56 |
static void rename_trigger (Tile *, TileEvent *, TileAction *); |
| 57 |
static void move_to_trash_trigger (Tile *, TileEvent *, TileAction *); |
57 |
static void move_to_trash_trigger (Tile *, TileEvent *, TileAction *); |
|
|
58 |
static void remove_recent_item (Tile *, TileEvent *, TileAction *); |
| 59 |
static void purge_recent_items (Tile *, TileEvent *, TileAction *); |
| 58 |
static void delete_trigger (Tile *, TileEvent *, TileAction *); |
60 |
static void delete_trigger (Tile *, TileEvent *, TileAction *); |
| 59 |
static void user_docs_trigger (Tile *, TileEvent *, TileAction *); |
61 |
static void user_docs_trigger (Tile *, TileEvent *, TileAction *); |
| 60 |
static void send_to_trigger (Tile *, TileEvent *, TileAction *); |
62 |
static void send_to_trigger (Tile *, TileEvent *, TileAction *); |
|
Lines 109-122
document_tile_new_force_icon (const gcha
Link Here
|
| 109 |
DocumentTile *this; |
111 |
DocumentTile *this; |
| 110 |
DocumentTilePrivate *priv; |
112 |
DocumentTilePrivate *priv; |
| 111 |
|
113 |
|
| 112 |
this = (DocumentTile *) document_tile_new (in_uri, mime_type, modified); |
114 |
this = (DocumentTile *) document_tile_new (BOOKMARK_STORE_USER_DOCS, in_uri, mime_type, modified); |
| 113 |
priv = DOCUMENT_TILE_GET_PRIVATE (this); |
115 |
priv = DOCUMENT_TILE_GET_PRIVATE (this); |
| 114 |
priv->force_icon_name = g_strdup (icon); |
116 |
priv->force_icon_name = g_strdup (icon); |
| 115 |
return GTK_WIDGET (this); |
117 |
return GTK_WIDGET (this); |
| 116 |
} |
118 |
} |
| 117 |
|
119 |
|
| 118 |
GtkWidget * |
120 |
GtkWidget * |
| 119 |
document_tile_new (const gchar *in_uri, const gchar *mime_type, time_t modified) |
121 |
document_tile_new (BookmarkStoreType bookmark_store_type, const gchar *in_uri, const gchar *mime_type, time_t modified) |
| 120 |
{ |
122 |
{ |
| 121 |
DocumentTile *this; |
123 |
DocumentTile *this; |
| 122 |
DocumentTilePrivate *priv; |
124 |
DocumentTilePrivate *priv; |
|
Lines 177-187
document_tile_new (const gchar *in_uri,
Link Here
|
| 177 |
priv->mime_type = g_strdup (mime_type); |
179 |
priv->mime_type = g_strdup (mime_type); |
| 178 |
priv->modified = modified; |
180 |
priv->modified = modified; |
| 179 |
priv->header_bin = GTK_BIN (header); |
181 |
priv->header_bin = GTK_BIN (header); |
|
|
182 |
priv->agent = bookmark_agent_get_instance (bookmark_store_type); |
| 180 |
|
183 |
|
| 181 |
document_tile_private_setup (this); |
184 |
document_tile_private_setup (this); |
| 182 |
|
185 |
TILE (this)->actions = g_new0 (TileAction *, DOCUMENT_TILE_ACTION_NUM_OF_ACTIONS); |
| 183 |
TILE (this)->actions = g_new0 (TileAction *, 7); |
186 |
TILE (this)->n_actions = DOCUMENT_TILE_ACTION_NUM_OF_ACTIONS; |
| 184 |
TILE (this)->n_actions = 7; |
|
|
| 185 |
|
187 |
|
| 186 |
menu_ctnr = GTK_CONTAINER (TILE (this)->context_menu); |
188 |
menu_ctnr = GTK_CONTAINER (TILE (this)->context_menu); |
| 187 |
|
189 |
|
|
Lines 293-298
document_tile_new (const gchar *in_uri,
Link Here
|
| 293 |
gtk_container_add (menu_ctnr, menu_item); |
295 |
gtk_container_add (menu_ctnr, menu_item); |
| 294 |
} |
296 |
} |
| 295 |
|
297 |
|
|
|
298 |
if (!priv->is_bookmarked) { |
| 299 |
/* clean item from menu */ |
| 300 |
action = tile_action_new (TILE (this), remove_recent_item, _("Remove from recent menu"), 0); |
| 301 |
TILE (this)->actions[DOCUMENT_TILE_ACTION_CLEAN_ITEM] = action; |
| 302 |
|
| 303 |
menu_item = GTK_WIDGET (tile_action_get_menu_item (action)); |
| 304 |
gtk_container_add (menu_ctnr, menu_item); |
| 305 |
|
| 306 |
/* clean all the items from menu */ |
| 307 |
|
| 308 |
action = tile_action_new (TILE (this), purge_recent_items, _("Purge all the recent items"), 0); |
| 309 |
TILE (this)->actions[DOCUMENT_TILE_ACTION_CLEAN_ALL] = action; |
| 310 |
|
| 311 |
menu_item = GTK_WIDGET (tile_action_get_menu_item (action)); |
| 312 |
gtk_container_add (menu_ctnr, menu_item); |
| 313 |
} |
| 314 |
|
| 296 |
gtk_widget_show_all (GTK_WIDGET (TILE (this)->context_menu)); |
315 |
gtk_widget_show_all (GTK_WIDGET (TILE (this)->context_menu)); |
| 297 |
|
316 |
|
| 298 |
accessible = gtk_widget_get_accessible (GTK_WIDGET (this)); |
317 |
accessible = gtk_widget_get_accessible (GTK_WIDGET (this)); |
|
Lines 339-346
document_tile_private_setup (DocumentTil
Link Here
|
| 339 |
|
358 |
|
| 340 |
g_object_unref (client); |
359 |
g_object_unref (client); |
| 341 |
|
360 |
|
| 342 |
priv->agent = bookmark_agent_get_instance (BOOKMARK_STORE_USER_DOCS); |
|
|
| 343 |
|
| 344 |
priv->notify_signal_id = g_signal_connect ( |
361 |
priv->notify_signal_id = g_signal_connect ( |
| 345 |
G_OBJECT (priv->agent), "notify", G_CALLBACK (agent_notify_cb), this); |
362 |
G_OBJECT (priv->agent), "notify", G_CALLBACK (agent_notify_cb), this); |
| 346 |
} |
363 |
} |
|
Lines 708-714
update_user_list_menu_item (DocumentTile
Link Here
|
| 708 |
if (! action) |
725 |
if (! action) |
| 709 |
return; |
726 |
return; |
| 710 |
|
727 |
|
| 711 |
priv->is_bookmarked = bookmark_agent_has_item (priv->agent, TILE (this)->uri); |
728 |
priv->is_bookmarked = bookmark_agent_has_item (bookmark_agent_get_instance (BOOKMARK_STORE_USER_DOCS), TILE (this)->uri); |
| 712 |
|
729 |
|
| 713 |
if (priv->is_bookmarked) |
730 |
if (priv->is_bookmarked) |
| 714 |
tile_action_set_menu_item_label (action, _("Remove from Favorites")); |
731 |
tile_action_set_menu_item_label (action, _("Remove from Favorites")); |
|
Lines 936-941
rename_trigger (Tile *tile, TileEvent *e
Link Here
|
| 936 |
} |
953 |
} |
| 937 |
|
954 |
|
| 938 |
static void |
955 |
static void |
|
|
956 |
remove_recent_item (Tile *tile, TileEvent *event, TileAction *action) |
| 957 |
{ |
| 958 |
DocumentTilePrivate *priv = DOCUMENT_TILE_GET_PRIVATE (tile); |
| 959 |
bookmark_agent_remove_item (priv->agent, TILE (tile)->uri); |
| 960 |
} |
| 961 |
|
| 962 |
static void |
| 963 |
purge_recent_items (Tile *tile, TileEvent *event, TileAction *action) |
| 964 |
{ |
| 965 |
DocumentTilePrivate *priv = DOCUMENT_TILE_GET_PRIVATE (tile); |
| 966 |
bookmark_agent_purge_items (priv->agent); |
| 967 |
} |
| 968 |
|
| 969 |
static void |
| 939 |
move_to_trash_trigger (Tile *tile, TileEvent *event, TileAction *action) |
970 |
move_to_trash_trigger (Tile *tile, TileEvent *event, TileAction *action) |
| 940 |
{ |
971 |
{ |
| 941 |
DocumentTilePrivate *priv = DOCUMENT_TILE_GET_PRIVATE (tile); |
972 |
DocumentTilePrivate *priv = DOCUMENT_TILE_GET_PRIVATE (tile); |