25
25
#include "data/gwdata.h"
26
26
#include "tools/gwtools.h"
28
#include "gwapplicationmanager.h"
28
30
#include "gwstatusbar.h"
31
gint gw_status_bar_put_msg_catalog ( GtkWindow *w, GtkCTree *ctree, GtkCTreeNode *root, gint num, gdouble size)
33
gint gw_status_bar_put_msg_catalog ( GtkWindow *w, GtkCTree *ctree, GtkCTreeNode *root, gint num, gdouble size) {
34
GWDBContext *context = gw_am_get_current_catalog_context ( );
35
GWCatalogPlugin *plugin = (GWCatalogPlugin*)gw_db_context_get_plugin ( context);
36
GWDBCatalog *catalog = NULL;
34
37
gchar *msg1, *msg2;
39
42
#ifdef GW_DEBUG_GUI_CALLBACK_COMPONENT
40
43
g_print ( "*** GW - %s (%d) :: %s() : total size is %e\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, size);
45
if ( catalog_file_info_get_title ( gtk_ctree_node_get_row_data ( ctree, root))!=NULL && strlen ( catalog_file_info_get_title ( gtk_ctree_node_get_row_data ( ctree, root))) > 0 ) {
46
catalog_name = catalog_file_info_get_title ( gtk_ctree_node_get_row_data ( ctree, root));
48
catalog_name = catalog_file_info_get_name ( gtk_ctree_node_get_row_data ( ctree, root));
52
msg1 = g_strdup_printf ( _( " %s [ %s ], total disks : %d"), catalog_name, catalog_file_info_get_full_name ( gtk_ctree_node_get_row_data ( ctree, root)), num);
53
msg2 = g_strdup_printf ( _( " Listed Items : %d (total size : %s)"), num, (text_utf8[0] = gw_d_byte_to_str_format ( size)));
55
if ( text_utf8[0] != NULL ) {
56
g_free ( text_utf8[0]);
47
catalog = plugin->gw_db_catalog_get_db_catalog ( context);
49
msg1 = g_strdup_printf ( _( " %s [ %s ], total disks : %d"), gw_helper_db_catalog_get_usefull_name ( catalog), gw_helper_db_catalog_get_full_name ( catalog), num);
50
msg2 = g_strdup_printf ( _( " Listed Items : %d (total size : %s)"), num, (tmp = gw_d_byte_to_str_format ( size)));
51
if ( tmp != NULL ) g_free ( tmp);
59
53
result = gw_status_bar_put_messages ( w, msg1, msg2);
57
gw_db_catalog_free ( catalog);
69
gint gw_status_bar_put_msg_disk ( GtkWindow *w, gchar *name, gchar *type, guint64 capacity, guint64 free, gdouble size, gint num)
67
gint gw_status_bar_put_msg_disk ( GtkWindow *w, gchar *name, gchar *type, guint64 capacity, guint64 free, gdouble size, gint num) {
71
68
gchar *msg1, *msg2;
73
70
gchar *text_utf8[2];
77
74
g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
82
78
if ( name != NULL && type != NULL) {
83
79
text_utf8[0] = NULL;
84
80
text_utf8[1] = NULL;
85
81
msg1 = g_strdup_printf ( _( " %s [ %s ], capacity : %s, free : %s"), name, type, (text_utf8[0] = gw_ui64_byte_to_str_format ( capacity)), (text_utf8[1] = gw_ui64_byte_to_str_format ( free)));
86
if ( text_utf8[0] != NULL )
82
if ( text_utf8[0] != NULL ) {
88
83
g_free ( text_utf8[0]);
90
if ( text_utf8[1] != NULL )
86
if ( text_utf8[1] != NULL ) {
92
87
g_free ( text_utf8[1]);
97
91
msg2 = g_strdup ( _( " Empty disk"));
92
} else if ( num == 0 ) {
101
93
text_utf8[0] = NULL;
102
94
msg2 = g_strdup_printf ( _( " Selected Item : %d (total size : %s)"), 1, (text_utf8[0] = gw_d_byte_to_str_format ( size)));
103
if ( text_utf8[0] != NULL )
95
if ( text_utf8[0] != NULL ) {
105
96
g_free ( text_utf8[0]);
110
99
text_utf8[0] = NULL;
111
100
msg2 = g_strdup_printf ( _( " Listed Items : %d (total size : %s)"), num, (text_utf8[0] = gw_d_byte_to_str_format ( size)));
112
101
if ( text_utf8[0] != NULL )
137
gint gw_status_bar_put_msg_dir ( GtkWindow *w, gchar *name, gdouble size, gint nb_files, gint nb_subfolders, gint num)
126
gint gw_status_bar_put_msg_dir ( GtkWindow *w, gchar *name, gdouble size, gint nb_files, gint nb_subfolders, gint num) {
139
127
gchar *msg1, *msg2;
140
128
gint result = -1;
141
129
gchar *text_utf8[2];
145
133
g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
150
137
text_utf8[0] = NULL;
151
138
msg1 = g_strdup_printf ( _( " Folder \"%s\", %s (files %d, subfolders %d)"), name, (text_utf8[0] = gw_d_byte_to_str_format ( size)), nb_files, nb_subfolders);
152
if ( text_utf8[0] != NULL )
139
if ( text_utf8[0] != NULL ) {
154
140
g_free ( text_utf8[0]);
159
144
text_utf8[0] = NULL;
160
145
msg2 = g_strdup_printf ( _( " Selected Item : %d (total size : %s)"), 1, (text_utf8[0] = gw_d_byte_to_str_format ( size)));
161
if ( text_utf8[0] != NULL )
146
if ( text_utf8[0] != NULL ) {
163
147
g_free ( text_utf8[0]);
168
150
text_utf8[0] = NULL;
169
151
msg2 = g_strdup_printf ( _( " Listed Items : %d (total size : %s)"), num, (text_utf8[0] = gw_d_byte_to_str_format ( size)));
170
if ( text_utf8[0] != NULL )
152
if ( text_utf8[0] != NULL ) {
172
153
g_free ( text_utf8[0]);
186
gint gw_status_bar_put_msg_file ( GtkWindow *w, gchar *name, gdouble size, gchar *date, gint num)
167
gint gw_status_bar_put_msg_file ( GtkWindow *w, gchar *name, gdouble size, gchar *date, gint num) {
188
168
gchar *msg1, *msg2;
189
169
gint result = -1;
190
170
gchar *text_utf8[2];
194
174
g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
199
178
text_utf8[0] = NULL;
200
179
msg1 = g_strdup_printf ( _( " %s, %s, %s"), name, (text_utf8[0] = gw_d_byte_to_str_format ( size)), date);
201
if ( text_utf8[0] != NULL )
180
if ( text_utf8[0] != NULL ) {
203
181
g_free ( text_utf8[0]);
205
184
text_utf8[0] = NULL;
206
185
msg2 = g_strdup_printf ( _( " Selected Item : %d (total size : %s)"), num, (text_utf8[0] = gw_d_byte_to_str_format ( size)));
207
if ( text_utf8[0] != NULL )
186
if ( text_utf8[0] != NULL ) {
209
187
g_free ( text_utf8[0]);
228
205
g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
233
209
msg = g_strdup_printf ( _( " Selected Item : %d"), n);
234
210
result = gw_status_bar_put_messages ( w, _( " Catalog explorer"), msg);
249
224
g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
254
228
msg = g_strdup_printf ( _( " Selected Item : %d"), n);
255
229
result = gw_status_bar_put_messages ( w, _( " Search engine"), msg);