Finish conversion to a GtkDialog. Redo dialog as a table instead of

boxes in boxes.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@12011 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2005-11-22 01:36:20 +00:00
parent 51dbc58b59
commit 154bfc33c2
3 changed files with 111 additions and 123 deletions

View File

@ -1,3 +1,9 @@
2005-11-21 David Hampton <hampton@employees.org>
* src/gnome/glade/userpass.glade:
* src/gnome/dialog-userpass.c: Finish conversion to a
GtkDialog. Redo dialog as a table instead of boxes in boxes.
2005-11-21 Derek Atkins <derek@ihtfp.com> 2005-11-21 Derek Atkins <derek@ihtfp.com>
* src/gnome-utils/Makefile.am: exit if "svn info" fails. * src/gnome-utils/Makefile.am: exit if "svn info" fails.

View File

@ -52,37 +52,37 @@ gnc_get_username_password (GtkWidget *parent,
dialog = glade_xml_get_widget (xml, "Username Password Dialog"); dialog = glade_xml_get_widget (xml, "Username Password Dialog");
if (parent) if (parent)
gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (parent)); gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
heading_label = glade_xml_get_widget (xml, "heading_label"); heading_label = glade_xml_get_widget (xml, "heading_label");
username_entry = glade_xml_get_widget (xml, "username_entry"); username_entry = glade_xml_get_widget (xml, "username_entry");
password_entry = glade_xml_get_widget (xml, "password_entry"); password_entry = glade_xml_get_widget (xml, "password_entry");
gnome_dialog_set_default (GNOME_DIALOG (dialog), 0);
if (heading) if (heading)
gtk_label_set_text (GTK_LABEL (heading_label), heading); gtk_label_set_text (GTK_LABEL (heading_label), heading);
if (initial_username) if (initial_username)
gtk_entry_set_text (GTK_ENTRY (username_entry), initial_username); gtk_entry_set_text (GTK_ENTRY (username_entry), initial_username);
gtk_editable_select_region (GTK_EDITABLE (username_entry), 0, -1);
if (initial_password) if (initial_password)
gtk_entry_set_text (GTK_ENTRY (password_entry), initial_password); gtk_entry_set_text (GTK_ENTRY (password_entry), initial_password);
gtk_widget_grab_focus (username_entry); result = gtk_dialog_run(GTK_DIALOG (dialog));
gtk_widget_hide(dialog);
result = gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); if (result == GTK_RESPONSE_OK)
if (result == 0)
{ {
*username = gtk_editable_get_chars (GTK_EDITABLE (username_entry), 0, -1); *username = gtk_editable_get_chars (GTK_EDITABLE (username_entry), 0, -1);
*password = gtk_editable_get_chars (GTK_EDITABLE (password_entry), 0, -1); *password = gtk_editable_get_chars (GTK_EDITABLE (password_entry), 0, -1);
gtk_widget_destroy(dialog);
return TRUE; return TRUE;
} }
*username = NULL; *username = NULL;
*password = NULL; *password = NULL;
gtk_widget_destroy(dialog);
return FALSE; return FALSE;
} }

View File

@ -39,7 +39,7 @@
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property> <property name="focus_on_click">True</property>
<property name="response_id">0</property> <property name="response_id">-6</property>
</widget> </widget>
</child> </child>
@ -47,12 +47,13 @@
<widget class="GtkButton" id="okbutton"> <widget class="GtkButton" id="okbutton">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="has_default">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="label">gtk-ok</property> <property name="label">gtk-ok</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property> <property name="focus_on_click">True</property>
<property name="response_id">0</property> <property name="response_id">-5</property>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -86,125 +87,106 @@
</child> </child>
<child> <child>
<widget class="GtkFrame" id="frame47"> <widget class="GtkTable" id="table1">
<property name="border_width">6</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="label_xalign">0</property> <property name="n_rows">2</property>
<property name="label_yalign">0.5</property> <property name="n_columns">2</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> <property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child> <child>
<widget class="GtkHBox" id="hbox95"> <widget class="GtkLabel" id="label847713">
<property name="border_width">10</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="label" translatable="yes">_Username:</property>
<property name="spacing">2</property> <property name="use_underline">True</property>
<property name="use_markup">False</property>
<child> <property name="justify">GTK_JUSTIFY_CENTER</property>
<widget class="GtkVBox" id="vbox105"> <property name="wrap">False</property>
<property name="visible">True</property> <property name="selectable">False</property>
<property name="homogeneous">True</property> <property name="xalign">0.5</property>
<property name="spacing">5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property>
<child> <property name="ypad">0</property>
<widget class="GtkLabel" id="label847713"> <property name="mnemonic_widget">username_entry</property>
<property name="visible">True</property>
<property name="label" translatable="yes">Username:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label847714">
<property name="visible">True</property>
<property name="label" translatable="yes">Password:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox106">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<property name="spacing">5</property>
<child>
<widget class="GtkEntry" id="username_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="password_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">False</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget> </widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label847714">
<property name="visible">True</property>
<property name="label" translatable="yes">_Password:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">password_entry</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="username_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="password_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">False</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child> </child>
</widget> </widget>
<packing> <packing>