Commit 3ceaedc510455d8945bb65497740cd5d8ae782cb
1 parent
80464a35
Exists in
master
and in
1 other branch
Adding convenience method for GtkEntry.
Showing
4 changed files
with
9 additions
and
7 deletions
Show diff stats
src/dialogs/tools.c
src/filetransfer/worker.c
| ... | ... | @@ -344,7 +344,7 @@ |
| 344 | 344 | |
| 345 | 345 | if(cfg->length) |
| 346 | 346 | { |
| 347 | - gtk_entry_set_text_printf(cfg->worker->field[PROGRESS_FIELD_TOTAL],"%lu",cfg->length); | |
| 347 | + gtk_entry_set_printf(cfg->worker->field[PROGRESS_FIELD_TOTAL],"%lu",cfg->length); | |
| 348 | 348 | } |
| 349 | 349 | else |
| 350 | 350 | { |
| ... | ... | @@ -432,8 +432,8 @@ |
| 432 | 432 | static gboolean bg_emit_update(struct bg_update * update) |
| 433 | 433 | { |
| 434 | 434 | // Update values |
| 435 | - gtk_entry_set_text_printf(update->worker->field[PROGRESS_FIELD_CURRENT],"%lu",update->current); | |
| 436 | - gtk_entry_set_text_printf(update->worker->field[PROGRESS_FIELD_TOTAL],"%lu",update->total); | |
| 435 | + gtk_entry_set_printf(update->worker->field[PROGRESS_FIELD_CURRENT],"%lu",update->current); | |
| 436 | + gtk_entry_set_printf(update->worker->field[PROGRESS_FIELD_TOTAL],"%lu",update->total); | |
| 437 | 437 | |
| 438 | 438 | if(update->total) |
| 439 | 439 | { |
| ... | ... | @@ -462,7 +462,7 @@ |
| 462 | 462 | gtk_progress_bar_set_fraction(update->worker->pbar, ((gdouble) update->current) / ((gdouble) update->total)); |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | - gtk_entry_set_text_printf(update->worker->field[PROGRESS_FIELD_ETA],"%lu",update->total); | |
| 465 | + gtk_entry_set_printf(update->worker->field[PROGRESS_FIELD_ETA],"%lu",update->total); | |
| 466 | 466 | |
| 467 | 467 | } |
| 468 | 468 | ... | ... |
src/include/internals.h
| ... | ... | @@ -73,8 +73,6 @@ |
| 73 | 73 | G_GNUC_INTERNAL void v3270_activity_list_save(GtkWidget *widget); |
| 74 | 74 | G_GNUC_INTERNAL void v3270_activity_list_save_as(GtkWidget *widget); |
| 75 | 75 | |
| 76 | - G_GNUC_INTERNAL void gtk_entry_set_text_printf(GtkEntry *entry, const gchar *fmt, ...); | |
| 77 | - | |
| 78 | 76 | G_END_DECLS |
| 79 | 77 | |
| 80 | 78 | #endif // V3270_INTERNALS_H_INCLUDED | ... | ... |
src/include/v3270.h
| ... | ... | @@ -291,6 +291,10 @@ |
| 291 | 291 | |
| 292 | 292 | LIB3270_EXPORT GtkWidget * v3270_dialog_new(GtkWidget *widget, const gchar *title, const gchar *apply); |
| 293 | 293 | |
| 294 | + // Convenience | |
| 295 | + LIB3270_EXPORT void gtk_entry_set_printf(GtkEntry *entry, const gchar *fmt, ...) G_GNUC_PRINTF(2,3); | |
| 296 | + | |
| 297 | + | |
| 294 | 298 | G_END_DECLS |
| 295 | 299 | |
| 296 | 300 | #endif // V3270_H_INCLUDED | ... | ... |