(minput_get_command \
(current_lang, current_name, current_command))))))
+#define CURRENT_DESCRIPTION \
+ (mtext_data \
+ (mplist_value \
+ (mplist_next \
+ (mplist_value \
+ (minput_get_command \
+ (current_lang, current_name, current_command)))), \
+ NULL, NULL, NULL, NULL))
+
#define CONFIG_COMMAND(plist) \
minput_config_command (current_lang, current_name, current_command, \
(plist))
struct BindingWidgets
{
- GtkWidget *entry;
- GtkWidget *clear;
- GtkWidget *add;
GtkWidget *view;
GtkWidget *default_;
GtkWidget *revert;
GtkWidget *delete;
+ GtkWidget *entry;
+ GtkWidget *clear;
+ GtkWidget *add;
GtkWidget *status;
};
return vbox;
}
+static void *
+help_cb (GtkButton *button, gpointer data)
+{
+ struct BindingWidgets *bw = data;
+ GtkWidget *msg;
+
+ msg = gtk_message_dialog_new (GTK_WINDOW
+ (gtk_widget_get_toplevel (bw->view)),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_CLOSE,
+ CURRENT_DESCRIPTION);
+ gtk_dialog_run (GTK_DIALOG (msg));
+ gtk_widget_destroy (msg);
+}
+
static void
set_status (GtkListStore *store, GtkTreeIter *iter)
{
{
GtkTreeModel *model;
GtkTreeIter iter;
- GtkWidget *dialog, *label, *vbox, *hbox;
+ GtkWidget *dialog, *label, *help, *vbox, *hbox;
MSymbol status;
struct BindingWidgets bw;
gchar *command;
gtk_tree_model_get (model, &iter, 0, &command, -1);
current_command = msymbol (command);
+ /*
dialog = (gtk_dialog_new_with_buttons
(command,
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (parent))),
- GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL));
+ */
+ dialog = gtk_dialog_new ();
+ gtk_window_set_title (GTK_WINDOW (dialog), command);
+ gtk_window_set_transient_for
+ (GTK_WINDOW (dialog),
+ GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (parent))));
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (GTK_DIALOG (dialog)->action_area),
+ GTK_BUTTONBOX_EDGE);
+
+ help = gtk_button_new_from_stock (GTK_STOCK_HELP);
+ g_signal_connect (G_OBJECT (help), "clicked",
+ G_CALLBACK (help_cb), &bw);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area),
+ help, FALSE, FALSE, 0);
+
+ gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_OK, GTK_RESPONSE_OK);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
create_deleting_section (&bw));
(minput_get_variable \
(current_lang, current_name, current_variable))))))
-#define CURRENT_STATUS \
+#define CURRENT_STATUS \
(mplist_value \
(mplist_next \
(mplist_next \
(minput_get_variable \
(current_lang, current_name, current_variable))))))
+#define CURRENT_DESCRIPTION \
+ (mtext_data \
+ (mplist_value \
+ (mplist_next \
+ (mplist_value \
+ (minput_get_variable \
+ (current_lang, current_name, current_variable)))), \
+ NULL, NULL, NULL, NULL))
+
#define CONFIG_VARIABLE(plist) \
minput_config_variable (current_lang, current_name, current_variable, \
(plist))
/* status label */
GtkWidget *status;
- /* ok button */
- GtkWidget *ok;
-
/* dialog itself */
GtkWidget *dialog;
};
GtkWidget *msg;
msg = gtk_message_dialog_new (GTK_WINDOW
- (gtk_widget_get_toplevel (ci->widget)),
+ (gtk_widget_get_toplevel (ci->dialog)),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
ci->widget = gtk_entry_new ();
g_signal_connect (GTK_OBJECT (ci->widget), "changed",
G_CALLBACK (changed_cb), ci);
+ g_signal_connect (GTK_OBJECT (ci->widget), "activate",
+ G_CALLBACK (ok_cb), ci);
ci->wtype = ENTRY_WIDGET;
gtk_entry_set_text (GTK_ENTRY (ci->widget), msymbol_name (value));
gtk_editable_set_editable (GTK_EDITABLE (ci->widget), TRUE);
ci->widget = gtk_entry_new ();
g_signal_connect (GTK_OBJECT (ci->widget), "changed",
G_CALLBACK (changed_cb), ci);
+ g_signal_connect (GTK_OBJECT (ci->widget), "activate",
+ G_CALLBACK (ok_cb), ci);
ci->wtype = ENTRY_WIDGET;
/* Fixme : Assuming the return value is in UTF-8 */
gtk_entry_set_text (GTK_ENTRY (ci->widget),
ci->widget = gtk_entry_new ();
g_signal_connect (GTK_OBJECT (ci->widget), "changed",
G_CALLBACK (changed_cb), ci);
+ g_signal_connect (GTK_OBJECT (ci->widget), "activate",
+ G_CALLBACK (ok_cb), ci);
ci->wtype = ENTRY_WIDGET;
g_snprintf (buf, sizeof (buf), "%d", (gint) value);
gtk_entry_set_text (GTK_ENTRY (ci->widget), buf);
return ci->widget;
}
+
+static void *
+help_cb (GtkButton *button, gpointer data)
+{
+ struct ControllerInfo *ci = data;
+ GtkWidget *msg;
+
+ msg = gtk_message_dialog_new (GTK_WINDOW
+ (gtk_widget_get_toplevel (ci->dialog)),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_CLOSE,
+ CURRENT_DESCRIPTION);
+ gtk_dialog_run (GTK_DIALOG (msg));
+ gtk_widget_destroy (msg);
+}
static void
-activated_cb (GtkTreeView *parent, GtkTreePath *path,
- GtkTreeViewColumn *col, gpointer data)
+row_activated_cb (GtkTreeView *parent, GtkTreePath *path,
+ GtkTreeViewColumn *col, gpointer data)
{
GtkTreeModel *model;
GtkTreeIter iter;
- GtkWidget *label, *hbox, *vbox;
+ GtkWidget *label, *ok, *help, *hbox, *vbox;
MSymbol status;
struct ControllerInfo ci;
gchar *variable;
ci.dialog = (gtk_dialog_new_with_buttons
(variable,
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (parent))),
- GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
NULL));
ci.default_ = gtk_button_new_from_stock (_("_Default"));
label = gtk_label_new (_("Status : "));
ci.status = gtk_label_new (NULL);
- ci.ok = gtk_button_new_from_stock (GTK_STOCK_OK);
- g_signal_connect (G_OBJECT (ci.ok), "clicked",
+ ok = gtk_button_new_from_stock (GTK_STOCK_OK);
+ g_signal_connect (G_OBJECT (ok), "clicked",
G_CALLBACK (ok_cb), &ci);
+ help = gtk_button_new_from_stock (GTK_STOCK_HELP);
+ g_signal_connect (G_OBJECT (help), "clicked",
+ G_CALLBACK (help_cb), &ci);
+
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (ci.dialog)->vbox), vbox);
gtk_container_add (GTK_CONTAINER (vbox), create_widget (&ci));
hbox = gtk_hbutton_box_new ();
- gtk_button_box_set_layout (GTK_BUTTON_BOX (hbox), GTK_BUTTONBOX_END);
gtk_box_set_spacing (GTK_BOX (hbox), 6);
gtk_container_add (GTK_CONTAINER (hbox), ci.default_);
gtk_container_add (GTK_CONTAINER (hbox), ci.revert);
gtk_box_pack_start (GTK_BOX (hbox), ci.status, FALSE, FALSE, 0);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
+ gtk_button_box_set_layout
+ (GTK_BUTTON_BOX (GTK_DIALOG (ci.dialog)->action_area),
+ GTK_BUTTONBOX_EDGE);
+ gtk_container_add (GTK_CONTAINER (GTK_DIALOG (ci.dialog)->action_area),
+ help);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (ci.dialog)->action_area),
- ci.ok);
+ ok);
status = CURRENT_STATUS;
if (status == Mconfigured)
VCOL_STATUS,
NULL);
g_signal_connect (G_OBJECT (view), "row-activated",
- G_CALLBACK (activated_cb), NULL);
+ G_CALLBACK (row_activated_cb), NULL);
return view;
}