Commit 42a40b86 authored by Scott Reeves's avatar Scott Reeves

show an icon when thumbnail is blank - BNC#381617

svn path=/trunk/; revision=459
parent 52588cc0
2008-05-13 Scott Reeves <sreeves@novell.com>
* main-menu/src/main-menu-ui.c
* libslab/bookmark-agent.c
* libslab/document-tile.c
* libslab/document-tile.h:
Show icon when thumbnail is blank - BNC#381617, BNC#373783
2008-05-13 Scott Reeves <sreeves@novell.com>
* main-menu/src/network-status-agent.c (nm_get_device_info):
Finish the fix for NM API breakage. (remove old calls)
......
......@@ -1086,10 +1086,12 @@ create_doc_item (BookmarkAgent *this, const gchar *uri)
dir = g_build_filename (g_get_home_dir (), "Documents", NULL);
if (! strcmp (uri, "BLANK_SPREADSHEET")) {
g_bookmark_file_set_title (priv->store, uri, "BLANK_SPREADSHEET");
file = g_strconcat (_("New Spreadsheet"), ".ots", NULL);
template = find_package_data_file (CALC_TEMPLATE_FILE_NAME);
}
else {
g_bookmark_file_set_title (priv->store, uri, "BLANK_DOCUMENT");
file = g_strconcat (_("New Document"), ".ott", NULL);
template = find_package_data_file (WRITER_TEMPLATE_FILE_NAME);
}
......
......@@ -84,6 +84,7 @@ typedef struct
gboolean renaming;
gboolean image_is_broken;
gchar * force_icon_name; //show an icon instead of a thumbnail
gboolean delete_enabled;
guint gconf_conn_id;
......@@ -108,6 +109,19 @@ static void document_tile_class_init (DocumentTileClass *this_class)
g_type_class_add_private (this_class, sizeof (DocumentTilePrivate));
}
//Use a specific icon instead of a thumbnail.
GtkWidget *
document_tile_new_force_icon (const gchar *in_uri, const gchar *mime_type, time_t modified, const gchar *icon)
{
DocumentTile *this;
DocumentTilePrivate *priv;
this = (DocumentTile *) document_tile_new (in_uri, mime_type, modified);
priv = DOCUMENT_TILE_GET_PRIVATE (this);
priv->force_icon_name = g_strdup (icon);
return GTK_WIDGET (this);
}
GtkWidget *
document_tile_new (const gchar *in_uri, const gchar *mime_type, time_t modified)
{
......@@ -364,6 +378,7 @@ document_tile_init (DocumentTile *tile)
priv->renaming = FALSE;
priv->image_is_broken = TRUE;
priv->force_icon_name = NULL;
priv->delete_enabled = FALSE;
priv->gconf_conn_id = 0;
......@@ -383,6 +398,7 @@ document_tile_finalize (GObject *g_object)
g_free (priv->basename);
g_free (priv->mime_type);
g_free (priv->force_icon_name);
gnome_vfs_mime_application_free (priv->default_app);
......@@ -421,8 +437,11 @@ load_image (DocumentTile *tile)
libslab_checkpoint ("document-tile.c: load_image(): start for %s", TILE (tile)->uri);
if (! priv->mime_type || ! strstr (TILE (tile)->uri, "file://")) {
icon_id = "gnome-fs-regular";
if (priv->force_icon_name || ! priv->mime_type || ! strstr (TILE (tile)->uri, "file://")) {
if (priv->force_icon_name)
icon_id = priv->force_icon_name;
else
icon_id = "gnome-fs-regular";
free_icon_id = FALSE;
goto exit;
......
......@@ -55,6 +55,9 @@ GType document_tile_get_type (void);
GtkWidget *document_tile_new (const gchar *uri, const gchar *mime_type, time_t modified);
//If you want to show a icon instead of a thumbnail
GtkWidget *document_tile_new_force_icon (const gchar *uri, const gchar *mime_type, time_t modified, const gchar *icon);
G_END_DECLS
#endif
......@@ -1090,6 +1090,16 @@ item_to_recent_app_tile (BookmarkItem *item, gpointer data)
static Tile *
item_to_user_doc_tile (BookmarkItem *item, gpointer data)
{
//force an icon since the thumbnail is basically blank - BNC#373783
if (!strcmp (item->title, "BLANK_SPREADSHEET") || !strcmp (item->title, "BLANK_DOCUMENT"))
{
if (! strcmp (item->title, "BLANK_SPREADSHEET"))
return TILE (document_tile_new_force_icon (item->uri, item->mime_type,
item->mtime, "gnome-mime-application-vnd.oasis.opendocument.spreadsheet-template"));
else
return TILE (document_tile_new_force_icon (item->uri, item->mime_type,
item->mtime, "gnome-mime-application-vnd.oasis.opendocument.text-template"));
}
return TILE (document_tile_new (item->uri, item->mime_type, item->mtime));
}
......
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