diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-09-11 21:37:36 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-09-11 21:37:36 (GMT) |
commit | 0f1473cba267ad809c8e7d207b5ff5e3998745fc (patch) | |
tree | 8aea43688d78c10ee7758e2feed80be9abbfaaf6 /src/format/dex/pool.c | |
parent | fe39a487b4db5564036a436bfcb7cf3561889fb5 (diff) |
Displayed more details about the loading process in the status bar.
Diffstat (limited to 'src/format/dex/pool.c')
-rw-r--r-- | src/format/dex/pool.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/src/format/dex/pool.c b/src/format/dex/pool.c index 3842aa9..f624ff3 100644 --- a/src/format/dex/pool.c +++ b/src/format/dex/pool.c @@ -28,6 +28,9 @@ #include <string.h> +#include <i18n.h> + + #include "dex-int.h" #include "../mangling/demangler.h" #include "../mangling/dex/context.h" @@ -122,6 +125,7 @@ const char *get_string_from_dex_pool(const GDexFormat *format, uint32_t index) /****************************************************************************** * * * Paramètres : format = description de l'exécutable à compléter. * + status = barre de statut à tenir informée. * * * * Description : Charge en mémoire l'ensemble des types du format DEX. * * * @@ -131,9 +135,10 @@ const char *get_string_from_dex_pool(const GDexFormat *format, uint32_t index) * * ******************************************************************************/ -bool load_all_dex_types(GDexFormat *format) +bool load_all_dex_types(GDexFormat *format, GtkStatusStack *status) { bool result; /* Bilan à retourner */ + activity_id_t msg; /* Message de progression */ uint32_t i; /* Boucle de parcours */ GDataType *type; /* Type récupéré */ @@ -141,6 +146,9 @@ bool load_all_dex_types(GDexFormat *format) format->types = (GDataType **)calloc(format->header.type_ids_size, sizeof(GDataType *)); + msg = gtk_status_stack_add_activity(status, _("Loading all types from the Dex pool..."), + format->header.type_ids_size); + for (i = 0; i < format->header.type_ids_size && result; i++) { type = get_type_from_dex_pool(format, i); @@ -150,8 +158,12 @@ bool load_all_dex_types(GDexFormat *format) else result = false; + gtk_status_stack_update_activity_value(status, msg, 1); + } + gtk_status_stack_remove_activity(status, msg); + return result; } @@ -223,6 +235,7 @@ GDataType *get_type_from_dex_pool(GDexFormat *format, uint32_t index) /****************************************************************************** * * * Paramètres : format = description de l'exécutable à compléter. * +* status = barre de statut à tenir informée. * * * * Description : Charge en mémoire l'ensemble des champs du format DEX. * * * @@ -232,9 +245,10 @@ GDataType *get_type_from_dex_pool(GDexFormat *format, uint32_t index) * * ******************************************************************************/ -bool load_all_dex_fields(GDexFormat *format) +bool load_all_dex_fields(GDexFormat *format, GtkStatusStack *status) { bool result; /* Bilan à retourner */ + activity_id_t msg; /* Message de progression */ uint32_t i; /* Boucle de parcours */ GBinVariable *field; /* Champ récupéré */ @@ -242,6 +256,9 @@ bool load_all_dex_fields(GDexFormat *format) format->fields = (GBinVariable **)calloc(format->header.field_ids_size, sizeof(GBinVariable *)); + msg = gtk_status_stack_add_activity(status, _("Loading all fields from the Dex pool..."), + format->header.field_ids_size); + for (i = 0; i < format->header.field_ids_size && result; i++) { field = get_field_from_dex_pool(format, i); @@ -251,8 +268,12 @@ bool load_all_dex_fields(GDexFormat *format) else result = false; + gtk_status_stack_update_activity_value(status, msg, 1); + } + gtk_status_stack_remove_activity(status, msg); + return result; } @@ -495,6 +516,7 @@ GDexMethod *get_method_from_dex_pool(GDexFormat *format, uint32_t index) /****************************************************************************** * * * Paramètres : format = représentation interne du format DEX à compléter. * +* status = barre de statut à tenir informée. * * * * Description : Charge toutes les classes listées dans le contenu binaire. * * * @@ -504,9 +526,10 @@ GDexMethod *get_method_from_dex_pool(GDexFormat *format, uint32_t index) * * ******************************************************************************/ -bool load_all_dex_classes(GDexFormat *format) +bool load_all_dex_classes(GDexFormat *format, GtkStatusStack *status) { bool result; /* Bilan à retourner */ + activity_id_t msg; /* Message de progression */ uint32_t i; /* Boucle de parcours */ GDexClass *class; /* Classe récupérée */ @@ -514,6 +537,9 @@ bool load_all_dex_classes(GDexFormat *format) format->classes = (GDexClass **)calloc(format->header.class_defs_size, sizeof(GDexClass *)); + msg = gtk_status_stack_add_activity(status, _("Loading all classes from the Dex pool..."), + format->header.class_defs_size); + for (i = 0; i < format->header.class_defs_size && result; i++) { class = get_class_from_dex_pool(format, i); @@ -523,8 +549,12 @@ bool load_all_dex_classes(GDexFormat *format) else result = false; + gtk_status_stack_update_activity_value(status, msg, 1); + } + gtk_status_stack_remove_activity(status, msg); + return result; } |