~gloobus-dev/gloobus/swfdec

« back to all changes in this revision

Viewing changes to src/plugin-folder/plugin-folder.cpp

  • Committer: Jordi Hernandez
  • Date: 2010-01-18 19:23:52 UTC
  • Revision ID: j.hernandezp@gmail.com-20100118192352-5hroxhqdr1iaiweo
Just load icon to show it in the treeview

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
                        files.push_back         (g_file_info_get_name(info));
50
50
                        m_size.push_back        (get_file_size_string(m_filename + "/"+files[files.size()-1])); //FIxme use gfile size
51
 
                        m_icons.push_back       (g_file_info_get_icon (info));
52
 
 
53
 
                        
 
51
                        m_icons.push_back       (g_file_info_get_icon (info));                  
54
52
                }
55
53
        
56
54
 
63
61
//========================= GET LIST STORE ================== //
64
62
GtkListStore*   iFolder::get_list_store         ( void )
65
63
{
66
 
        return gtk_list_store_new  (2,G_TYPE_STRING,G_TYPE_STRING);
 
64
        return gtk_list_store_new  (3,/*GDK_TYPE_PIXBUF,*/G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING);
67
65
}
68
66
//============================ GET N ITEMS ================== //
69
67
int iFolder::get_n_items ( ) 
74
72
//============================ GET ITEM ================== //
75
73
string iFolder::get_item (int i, int j)
76
74
{
77
 
        if(j==0) return m_files[i];
78
 
        else     return m_size[i];
 
75
        if(j==0) return "sfasdfa";
 
76
        if(j==1) return m_files[i];
 
77
        if(j==2) return m_size[i];
 
78
}
 
79
//============================ IS COLUMN PIXBUF ================== //
 
80
bool iFolder::is_column_pixbuf(int i) 
 
81
{
 
82
         if(i==0) 
 
83
                return true;
 
84
         else
 
85
                return false;
 
86
}
 
87
//============================ GET ITEM PIXBUF ================== //
 
88
GdkPixbuf* iFolder::get_item_pixbuf             ( int i, int j)
 
89
{
 
90
        g_debug("FOLDER: Getting icon %i",i);
 
91
    GtkIconInfo *icon_info;
 
92
    GtkIconTheme *icon_theme;
 
93
 
 
94
    icon_theme = gtk_icon_theme_get_default();
 
95
    icon_info = gtk_icon_theme_lookup_by_gicon(
 
96
                    icon_theme,
 
97
                    m_icons[i],
 
98
                    32,    /* icon size */
 
99
                   GtkIconLookupFlags(GTK_ICON_LOOKUP_USE_BUILTIN | 
 
100
                                                          GTK_ICON_LOOKUP_GENERIC_FALLBACK | 
 
101
                                                          GTK_ICON_LOOKUP_FORCE_SIZE));
 
102
 
 
103
   return gtk_icon_info_load_icon(icon_info, NULL);
79
104
}
80
105
//============================ GET N COLUMNS ================== //
81
106
int iFolder::get_n_columns ( void )
82
107
{
83
 
        return 2;
 
108
        return 3;
84
109
}
85
110
//========================= GET COLUMN TITLE ================== //
86
111
string  iFolder::get_column_title       ( int i )
87
112
{
88
 
        if (i==0) return _("Filename");
89
 
        if (i==1) return _("Size");
 
113
        if (i==0) return _("Icon");
 
114
        if (i==1) return _("Filename");
 
115
        if (i==2) return _("Size");
90
116
        
91
117
        g_error("No more than 2 columns");
92
118
}