summaryrefslogtreecommitdiff
path: root/src/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialogs')
-rw-r--r--src/dialogs/goto.c41
-rw-r--r--src/dialogs/goto.h4
2 files changed, 35 insertions, 10 deletions
diff --git a/src/dialogs/goto.c b/src/dialogs/goto.c
index 42c032d..5322260 100644
--- a/src/dialogs/goto.c
+++ b/src/dialogs/goto.c
@@ -144,11 +144,13 @@ GtkWidget *create_goto_dialog(GtkWindow *parent)
{
GtkWidget *result; /* Fenêtre à renvoyer */
GtkWidget *dlgvbox; /* Zone principale de la boîte */
- GtkWidget *vbox; /* Support à construire */
+ GtkWidget *vbox; /* Support à construire #1 */
GtkWidget *label; /* Message d'introduction */
GtkWidget *combobox; /* Liste de sélection */
GtkWidget *entry; /* Zone de saisie principale */
- GtkWidget *dialog_action_area1;
+ GtkWidget *hbox; /* Support à construire #2 */
+ GtkWidget *radio; /* Définition de localisation */
+ GtkWidget *action_area; /* Zone de contrôle */
GtkWidget *button; /* Bouton de contrôle */
result = gtk_dialog_new();
@@ -165,6 +167,8 @@ GtkWidget *create_goto_dialog(GtkWindow *parent)
gtk_box_pack_start(GTK_BOX(dlgvbox), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
+ /* Zone de saisie principale */
+
label = qck_create_label(NULL, NULL, _("Enter the value of the target address:"));
gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);
@@ -183,11 +187,26 @@ GtkWidget *create_goto_dialog(GtkWindow *parent)
//gtk_combo_box_append_text(combobox, "test");
+ /* Propriétés de la localisation */
+
+ hbox = gtk_hbox_new(FALSE, 8);
+ gtk_widget_show(hbox);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 8);
+
+ radio = qck_create_radio_button(G_OBJECT(result), "phy", _("Address is physical"),
+ NULL, NULL, NULL);
+ gtk_box_pack_start(GTK_BOX(hbox), radio, TRUE, TRUE, 0);
- dialog_action_area1 = gtk_dialog_get_action_area(GTK_DIALOG(result));
- gtk_widget_show(dialog_action_area1);
- gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area1), GTK_BUTTONBOX_END);
+ radio = qck_create_radio_button(G_OBJECT(result), "virt", _("Address is virtual"),
+ GTK_RADIO_BUTTON(radio), NULL, NULL);
+ gtk_box_pack_start(GTK_BOX(hbox), radio, TRUE, TRUE, 0);
+ /* Zone de validation */
+
+ action_area = gtk_dialog_get_action_area(GTK_DIALOG(result));
+ gtk_widget_show(action_area);
+ gtk_button_box_set_layout(GTK_BUTTON_BOX(action_area), GTK_BUTTONBOX_END);
button = qck_create_button_from_stock(NULL, NULL, "gtk-cancel", NULL, NULL);
gtk_dialog_add_action_widget(GTK_DIALOG(result), button, GTK_RESPONSE_CANCEL);
@@ -216,11 +235,12 @@ GtkWidget *create_goto_dialog(GtkWindow *parent)
* *
******************************************************************************/
-vmpa_t get_address_from_goto_dialog(GtkWidget *dialog)
+vmpa2t *get_address_from_goto_dialog(GtkWidget *dialog)
{
- vmpa_t result; /* Adresse à retourner */
+ vmpa2t *result; /* Adresse à retourner */
GtkWidget *combobox; /* Liste de sélection */
GtkWidget *entry; /* Zone de saisie principale */
+ GtkToggleButton *radio; /* Définition de localisation */
const gchar *text; /* Adresse en version texte */
combobox = GTK_WIDGET(g_object_get_data(G_OBJECT(dialog), "combobox"));
@@ -228,7 +248,12 @@ vmpa_t get_address_from_goto_dialog(GtkWidget *dialog)
text = gtk_entry_get_text(GTK_ENTRY(entry));
- result = string_to_vmpa(text);
+ radio = GTK_TOGGLE_BUTTON(g_object_get_data(G_OBJECT(dialog), "phy"));
+
+ if (gtk_toggle_button_get_active(radio))
+ result = string_to_vmpa_phy(text);
+ else
+ result = string_to_vmpa_virt(text);
return result;
diff --git a/src/dialogs/goto.h b/src/dialogs/goto.h
index 549516f..7bb57b5 100644
--- a/src/dialogs/goto.h
+++ b/src/dialogs/goto.h
@@ -28,7 +28,7 @@
#include <gtk/gtk.h>
-#include "../arch/archbase.h"
+#include "../arch/vmpa.h"
@@ -36,7 +36,7 @@
GtkWidget *create_goto_dialog(GtkWindow *);
/* Fournit l'adresse obtenue par la saisie de l'utilisateur. */
-vmpa_t get_address_from_goto_dialog(GtkWidget *);
+vmpa2t *get_address_from_goto_dialog(GtkWidget *);