summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/tb/source.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/gui/tb/source.c b/src/gui/tb/source.c
index 109cbfa..1c67cc6 100644
--- a/src/gui/tb/source.c
+++ b/src/gui/tb/source.c
@@ -85,7 +85,7 @@ static GtkWidget *build_source_tb_widget(GObject *ref)
label = qck_create_label(G_OBJECT(result), "label", _(" Source: "));
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
- comboboxentry = qck_create_combobox(G_OBJECT(result), "combo",
+ comboboxentry = qck_create_combobox2(G_OBJECT(result), "combo",
G_CALLBACK(change_selected_source), ref);
gtk_box_pack_start(GTK_BOX(hbox), comboboxentry, TRUE, TRUE, 0);
@@ -138,7 +138,7 @@ GEditorItem *create_source_tb_item(GObject *ref)
static void update_source_item_binary(GEditorItem *item, GLoadedBinary *binary)
{
- GtkComboBox *combo; /* Liste de sélection */
+ GtkComboBoxText *combo; /* Liste de sélection */
GtkTreeModel *model; /* Gestionnaire d'éléments */
GtkTreeIter iter; /* Boucle de parcours #2 */
GExeFormat *format; /* Format d'exécutable associé */
@@ -146,17 +146,20 @@ static void update_source_item_binary(GEditorItem *item, GLoadedBinary *binary)
size_t defsrc; /* Fichier source principal */
const char * const *files; /* Liste de fichiers source */
size_t i; /* Boucle de parcours #2 */
- return; /* FIXME */
+
+ combo = GTK_COMBO_BOX_TEXT(g_object_get_data(G_OBJECT(item->widget), "combo"));
+
/* Réinitialisation */
- combo = GTK_COMBO_BOX(g_object_get_data(G_OBJECT(item->widget), "combo"));
+ g_signal_handlers_block_by_func(combo, G_CALLBACK(change_selected_source), item->ref);
- /* TODO : signal */
+ /* FIXME : 3.0 */
+ //gtk_combo_box_text_remove_all(combo);
- model = gtk_combo_box_get_model(combo);
+ model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo));
while (gtk_tree_model_get_iter_first(model, &iter))
- gtk_combo_box_remove_text(combo, 0);
+ gtk_combo_box_text_remove(combo, 0);
/* Inscriptions */
@@ -164,13 +167,13 @@ static void update_source_item_binary(GEditorItem *item, GLoadedBinary *binary)
files = g_binary_format_get_source_files(G_BIN_FORMAT(format), &count, &defsrc);
for (i = 0; i < count; i++)
- gtk_combo_box_append_text(combo, files[i]);
+ gtk_combo_box_text_append_text(combo, files[i]);
/* Réactivation */
- /* TODO : signal */
+ g_signal_handlers_unblock_by_func(combo, G_CALLBACK(change_selected_source), item->ref);
- gtk_combo_box_set_active(combo, defsrc);
+ //gtk_combo_box_set_active(combo, defsrc);
}
@@ -210,6 +213,7 @@ static void update_source_item_view(GEditorItem *item, GtkViewPanel *view)
static void change_selected_source(GtkComboBox *widget, GObject *ref)
{
+#if 0
gint index; /* Nouvelle source ciblée */
GLoadedBinary *binary; /* Binaire chargé courant */
GCodeBuffer *buffer; /* Nouveau tampon à présenter */
@@ -224,5 +228,5 @@ static void change_selected_source(GtkComboBox *widget, GObject *ref)
if (GTK_IS_BUFFER_VIEW(view))
gtk_buffer_view_attach_buffer(view, buffer,
g_loaded_binary_display_decomp_lines(binary), NULL);
-
+#endif
}