HIG changes for the "radio option" query dialog.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13034 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2006-01-29 19:23:25 +00:00
parent 0cc98d9ba4
commit 6bd55f970d
8 changed files with 43 additions and 21 deletions

View File

@ -1,5 +1,16 @@
2006-01-29 David Hampton <hampton@employees.org> 2006-01-29 David Hampton <hampton@employees.org>
* src/register/ledger-core/split-register.c:
* src/register/ledger-core/split-register-control.c:
* src/import-export/hbci/druid-hbci-initial.c:
* src/report/report-gnome/gnc-plugin-page-report.c:
* src/gnome-utils/gw-gnome-utils-spec.scm:
* src/gnome-utils/gnc-gui-query.c:
* src/gnc-ui.h: HIG changes for the "radio option" query dialog.
* src/engine/gnc-engine.c: Restore reasonable default logging
levels.
* README: Michael Wahlbrink's cvs to svn changes. * README: Michael Wahlbrink's cvs to svn changes.
* src/import-export/qif-import/dialog-account-picker.c: * src/import-export/qif-import/dialog-account-picker.c:

View File

@ -92,6 +92,7 @@ gnc_gnome_help (const char *file_name, const char *target_link);
int gnc_choose_radio_option_dialog (gncUIWidget parent, int gnc_choose_radio_option_dialog (gncUIWidget parent,
const char *title, const char *title,
const char *msg, const char *msg,
const char *button_name,
int default_value, int default_value,
GList *radio_list); GList *radio_list);

View File

@ -272,6 +272,7 @@ int
gnc_choose_radio_option_dialog(gncUIWidget parent, gnc_choose_radio_option_dialog(gncUIWidget parent,
const char *title, const char *title,
const char *msg, const char *msg,
const char *button_name,
int default_value, int default_value,
GList *radio_list) GList *radio_list)
{ {
@ -279,7 +280,7 @@ gnc_choose_radio_option_dialog(gncUIWidget parent,
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *main_vbox; GtkWidget *main_vbox;
GtkWidget *label; GtkWidget *label;
GtkWidget *frame; GtkWidget *alignment;
GtkWidget *radio_button; GtkWidget *radio_button;
GtkWidget *dialog; GtkWidget *dialog;
GtkWidget *dvbox; GtkWidget *dvbox;
@ -288,7 +289,7 @@ gnc_choose_radio_option_dialog(gncUIWidget parent,
int i; int i;
main_vbox = gtk_vbox_new(FALSE, 3); main_vbox = gtk_vbox_new(FALSE, 3);
gtk_container_set_border_width(GTK_CONTAINER(main_vbox), 5); gtk_container_set_border_width(GTK_CONTAINER(main_vbox), 6);
gtk_widget_show(main_vbox); gtk_widget_show(main_vbox);
label = gtk_label_new(msg); label = gtk_label_new(msg);
@ -296,19 +297,19 @@ gnc_choose_radio_option_dialog(gncUIWidget parent,
gtk_box_pack_start(GTK_BOX(main_vbox), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(main_vbox), label, FALSE, FALSE, 0);
gtk_widget_show(label); gtk_widget_show(label);
frame = gtk_frame_new(NULL); alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
gtk_container_set_border_width(GTK_CONTAINER(frame), 5); gtk_alignment_set_padding (GTK_ALIGNMENT(alignment), 0, 0, 12, 0);
gtk_box_pack_start(GTK_BOX(main_vbox), frame, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(main_vbox), alignment, FALSE, FALSE, 0);
gtk_widget_show(frame); gtk_widget_show(alignment);
vbox = gtk_vbox_new(TRUE, 3); vbox = gtk_vbox_new(TRUE, 3);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
gtk_container_add(GTK_CONTAINER(frame), vbox); gtk_container_add(GTK_CONTAINER(alignment), vbox);
gtk_widget_show(vbox); gtk_widget_show(vbox);
for (node = radio_list, i = 0; node; node = node->next, i++) for (node = radio_list, i = 0; node; node = node->next, i++)
{ {
radio_button = gtk_radio_button_new_with_label(group, node->data); radio_button = gtk_radio_button_new_with_mnemonic(group, node->data);
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button)); group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button));
if (i == default_value) /* default is first radio button */ if (i == default_value) /* default is first radio button */
@ -325,11 +326,14 @@ gnc_choose_radio_option_dialog(gncUIWidget parent,
&radio_result); &radio_result);
} }
if (!button_name)
button_name = GTK_STOCK_OK;
dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW(parent), dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW(parent),
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK, button_name, GTK_RESPONSE_OK,
NULL); NULL);
gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE);
/* default to ok */ /* default to ok */
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK); gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);

View File

@ -238,6 +238,7 @@
'((<gnc:UIWidget> parent) '((<gnc:UIWidget> parent)
((<gw:mchars> caller-owned const) title) ((<gw:mchars> caller-owned const) title)
((<gw:mchars> caller-owned const) msg) ((<gw:mchars> caller-owned const) msg)
((<gw:mchars> caller-owned const) button-name)
(<gw:int> default-choice) (<gw:int> default-choice)
((gw:glist-of (<gw:mchars> callee-owned) callee-owned) choices)) ((gw:glist-of (<gw:mchars> callee-owned) callee-owned) choices))
"Show a dialog offering different mutually exclusive choices "Show a dialog offering different mutually exclusive choices

View File

@ -505,6 +505,7 @@ on_aqhbci_button (GtkButton *button,
(GTK_WIDGET(info->window), (GTK_WIDGET(info->window),
_("Choose AqBanking Backend"), _("Choose AqBanking Backend"),
_("Please choose an AqBanking backend to be configured"), _("Please choose an AqBanking backend to be configured"),
_("Co_nfigure"),
0, 0,
radio_list); radio_list);
g_list_free(radio_list); g_list_free(radio_list);

View File

@ -29,6 +29,7 @@
#include "Scrub.h" #include "Scrub.h"
#include "combocell.h" #include "combocell.h"
#include "gnc-component-manager.h" #include "gnc-component-manager.h"
#include "gnc-gconf-utils.h"
#include "gnc-ui.h" #include "gnc-ui.h"
#include "pricecell.h" #include "pricecell.h"
#include "datecell.h" #include "datecell.h"
@ -101,20 +102,20 @@ gnc_split_register_balance_trans (SplitRegister *reg, Transaction *trans)
two_accounts = FALSE; two_accounts = FALSE;
radio_list = g_list_append (radio_list, radio_list = g_list_append (radio_list,
_("Balance it manually")); _("Balance it _manually"));
radio_list = g_list_append (radio_list, radio_list = g_list_append (radio_list,
_("Let GnuCash add an adjusting split")); _("Let GnuCash _add an adjusting split"));
if (reg->type < NUM_SINGLE_REGISTER_TYPES) if (reg->type < NUM_SINGLE_REGISTER_TYPES)
{ {
radio_list = g_list_append (radio_list, radio_list = g_list_append (radio_list,
_("Adjust current account split total")); _("Adjust current account _split total"));
default_value = 2; default_value = 2;
if (two_accounts) if (two_accounts)
{ {
radio_list = g_list_append (radio_list, radio_list = g_list_append (radio_list,
_("Adjust other account split total")); _("Adjust _other account split total"));
default_value = 3; default_value = 3;
} }
} }
@ -125,6 +126,7 @@ gnc_split_register_balance_trans (SplitRegister *reg, Transaction *trans)
(gnc_split_register_get_parent (reg), (gnc_split_register_get_parent (reg),
title, title,
message, message,
_("_Rebalance"),
default_value, default_value,
radio_list); radio_list);

View File

@ -1735,23 +1735,23 @@ gnc_split_register_auto_calc (SplitRegister *reg, Split *split)
if (shares_changed) if (shares_changed)
radio_list = g_list_append (radio_list, radio_list = g_list_append (radio_list,
g_strdup_printf ("%s (%s)", g_strdup_printf ("%s (%s)",
_("Shares"), _("Changed"))); _("_Shares"), _("Changed")));
else else
radio_list = g_list_append (radio_list, g_strdup (_("Shares"))); radio_list = g_list_append (radio_list, g_strdup (_("_Shares")));
if (price_changed) if (price_changed)
radio_list = g_list_append (radio_list, radio_list = g_list_append (radio_list,
g_strdup_printf ("%s (%s)", g_strdup_printf ("%s (%s)",
_("Price"), _("Changed"))); _("_Price"), _("Changed")));
else else
radio_list = g_list_append (radio_list, g_strdup (_("Price"))); radio_list = g_list_append (radio_list, g_strdup (_("_Price")));
if (amount_changed) if (amount_changed)
radio_list = g_list_append (radio_list, radio_list = g_list_append (radio_list,
g_strdup_printf ("%s (%s)", g_strdup_printf ("%s (%s)",
_("Value"), _("Changed"))); _("_Value"), _("Changed")));
else else
radio_list = g_list_append (radio_list, g_strdup (_("Value"))); radio_list = g_list_append (radio_list, g_strdup (_("_Value")));
if (price_changed) default_value = 2; /* change the value */ if (price_changed) default_value = 2; /* change the value */
else default_value = 1; /* change the value */ else default_value = 1; /* change the value */
@ -1760,6 +1760,7 @@ gnc_split_register_auto_calc (SplitRegister *reg, Split *split)
(gnc_split_register_get_parent (reg), (gnc_split_register_get_parent (reg),
title, title,
message, message,
_("_Recalculate"),
default_value, default_value,
radio_list); radio_list);

View File

@ -1132,7 +1132,8 @@ gnc_get_export_type_choice (SCM export_types)
choice = gnc_choose_radio_option_dialog choice = gnc_choose_radio_option_dialog
(NULL, _("Choose export format"), (NULL, _("Choose export format"),
_("Choose the export format for this report:"), 0, choices); _("Choose the export format for this report:"),
NULL, 0, choices);
} }
else else
choice = -1; choice = -1;