Changeset 2304
- Timestamp:
- Jul 8, 2007, 5:51:55 AM (16 years ago)
- Location:
- trunk/gtk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/actions.c
r2149 r2304 60 60 { "help-menu", NULL, N_("_Help"), NULL, NULL, NULL }, 61 61 { "priority-menu", NULL, N_("_Priority"), NULL, NULL, NULL }, 62 { "add-torrent", GTK_STOCK_ADD, 63 N_("_Add"), "<control>A", NULL, G_CALLBACK(action_cb) }, 62 { "add-torrent", GTK_STOCK_OPEN, NULL, NULL, NULL, G_CALLBACK(action_cb) }, 64 63 { "start-torrent", GTK_STOCK_EXECUTE, 65 64 N_("_Start"), "<control>S", NULL, G_CALLBACK(action_cb) }, -
trunk/gtk/tr_torrent.c
r2247 r2304 625 625 else { 626 626 char * timestr = readabletime(eta); 627 top = g_strdup_printf( _(" Finishing in %s(%.1f%%)"), timestr, prog );627 top = g_strdup_printf( _("%s remaining (%.1f%%)"), timestr, prog ); 628 628 g_free(timestr); 629 629 } … … 639 639 case TR_STATUS_SEED: 640 640 top = g_strdup_printf( 641 ngettext( "Seeding , uploadingto %d of %d peer",642 "Seeding , uploadingto %d of %d peers", tpeers ),641 ngettext( "Seeding to %d of %d peer", 642 "Seeding to %d of %d peers", tpeers ), 643 643 upeers, tpeers ); 644 644 break; -
trunk/gtk/tr_window.c
r2256 r2304 43 43 GtkWidget * view; 44 44 GtkWidget * status; 45 GtkWidget * ul_lb; 46 GtkWidget * dl_lb; 45 47 GtkTreeSelection * selection; 46 48 GtkCellRenderer * namerend; … … 111 113 } 112 114 113 str = g_markup_printf_escaped( "<b ig>%s (%s)</big>\n<small>%s\n%s</small>",115 str = g_markup_printf_escaped( "<b>%s (%s)</b>\n<small>%s\n%s</small>", 114 116 name, mb, top, 115 117 ( NULL == bottom ? "" : bottom ) ); … … 246 248 { 247 249 PrivateData * p = g_new( PrivateData, 1 ); 248 GtkWidget *vbox, *w, *self ;250 GtkWidget *vbox, *w, *self, *h; 249 251 250 252 /* make the window */ … … 276 278 gtk_container_set_focus_child( GTK_CONTAINER( vbox ), w ); 277 279 280 /* spacer */ 281 w = gtk_alignment_new (0.0f, 0.0f, 0.0f, 0.0f); 282 gtk_widget_set_usize (w, 0u, 6u); 283 gtk_box_pack_start( GTK_BOX(vbox), w, FALSE, FALSE, 0 ); 284 285 278 286 /* statusbar */ 279 w = p->status = gtk_statusbar_new (); 280 gtk_statusbar_push( GTK_STATUSBAR(w), 0, "" ); 281 gtk_box_pack_start( GTK_BOX(vbox), w, FALSE, FALSE, 0 ); 287 h = gtk_hbox_new( FALSE, 0 ); 288 w = p->ul_lb = gtk_label_new( NULL ); 289 gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, GUI_PAD ); 290 w = gtk_vseparator_new( ); 291 gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, GUI_PAD ); 292 w = p->dl_lb = gtk_label_new( NULL ); 293 gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, GUI_PAD ); 294 gtk_box_pack_start( GTK_BOX(vbox), h, FALSE, FALSE, 0 ); 282 295 283 296 /* show all but the window */ … … 291 304 { 292 305 PrivateData * p = get_private_data( self ); 293 GtkStatusbar * status = GTK_STATUSBAR( p->status ); 294 295 /* update the status bar */ 296 char * downstr = readablespeed ( downspeed ); 297 char * upstr = readablespeed ( upspeed ); 298 char * str = g_strdup_printf( _(" Total DL: %s Total UL: %s"), 299 downstr, upstr ); 300 g_free( downstr ); 301 g_free( upstr ); 302 gtk_statusbar_pop( status, 0 ); 303 gtk_statusbar_push( status, 0, str ); 304 g_free( str ); 306 char *tmp1, *tmp2; 307 308 tmp1 = readablespeed( downspeed ); 309 tmp2 = g_strdup_printf( _("Total DL: %s"), tmp1 ); 310 gtk_label_set_text( GTK_LABEL(p->dl_lb), tmp2 ); 311 g_free( tmp2 ); 312 g_free( tmp1 ); 313 314 tmp1 = readablespeed( upspeed ); 315 tmp2 = g_strdup_printf( _("Total UL: %s"), tmp1 ); 316 gtk_label_set_text( GTK_LABEL(p->ul_lb), tmp2 ); 317 g_free( tmp2 ); 318 g_free( tmp1 ); 305 319 } 306 320 -
trunk/gtk/util.c
r2298 r2304 110 110 #define HOURS(s) ((s) / 60 / 60 % 24) 111 111 #define DAYS(s) ((s) / 60 / 60 / 24 % 7) 112 #define WEEKS(s) ((s) / 60 / 60 / 24 / 7)113 112 114 113 char * … … 116 115 if(60 > secs) 117 116 return g_strdup_printf(_("%i %s"), 118 SECONDS(secs), ngettext("sec ond", "seconds", SECONDS(secs)));117 SECONDS(secs), ngettext("sec", "secs", SECONDS(secs))); 119 118 else if(60 * 60 > secs) 120 119 return g_strdup_printf(_("%i %s %i %s"), 121 MINUTES(secs), ngettext("min ute", "minutes", MINUTES(secs)),122 SECONDS(secs), ngettext("sec ond", "seconds", SECONDS(secs)));120 MINUTES(secs), ngettext("min", "mins", MINUTES(secs)), 121 SECONDS(secs), ngettext("sec", "secs", SECONDS(secs))); 123 122 else if(60 * 60 * 24 > secs) 124 123 return g_strdup_printf(_("%i %s %i %s"), 125 HOURS(secs), ngettext("h our", "hours", HOURS(secs)),126 MINUTES(secs), ngettext("min ute", "minutes", MINUTES(secs)));127 else if(60 * 60 * 24 * 7 > secs)124 HOURS(secs), ngettext("hr", "hrs", HOURS(secs)), 125 MINUTES(secs), ngettext("min", "mins", MINUTES(secs))); 126 else 128 127 return g_strdup_printf(_("%i %s %i %s"), 129 128 DAYS(secs), ngettext("day", "days", DAYS(secs)), 130 HOURS(secs), ngettext("hour", "hours", HOURS(secs))); 131 else 132 return g_strdup_printf(_("%i %s %i %s"), 133 WEEKS(secs), ngettext("week", "weeks", WEEKS(secs)), 134 DAYS(secs), ngettext("hour", "hours", DAYS(secs))); 129 HOURS(secs), ngettext("hr", "hrs", HOURS(secs))); 135 130 } 136 131
Note: See TracChangeset
for help on using the changeset viewer.