diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-10-27 22:41:14 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:04:51 -0500 |
commit | 4eda9e51b3759a40b1c39d36185b5db9b8b8017e (patch) | |
tree | 1b851e6886bbb43bd9a13644740dd7af5b0b4181 /source4/gtk/common | |
parent | 93c32f81e2613c111d69ae6bcc37eb9e58788e28 (diff) | |
download | samba-4eda9e51b3759a40b1c39d36185b5db9b8b8017e.tar.gz samba-4eda9e51b3759a40b1c39d36185b5db9b8b8017e.tar.bz2 samba-4eda9e51b3759a40b1c39d36185b5db9b8b8017e.zip |
r3301: Simplify code
(This used to be commit dcdc6666d55c1ad006a5a4e58b337874478a66a4)
Diffstat (limited to 'source4/gtk/common')
-rw-r--r-- | source4/gtk/common/gtk-smb.c | 106 | ||||
-rw-r--r-- | source4/gtk/common/select.c | 20 |
2 files changed, 37 insertions, 89 deletions
diff --git a/source4/gtk/common/gtk-smb.c b/source4/gtk/common/gtk-smb.c index 016b162aa8..9553827cd0 100644 --- a/source4/gtk/common/gtk-smb.c +++ b/source4/gtk/common/gtk-smb.c @@ -94,36 +94,29 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di gtk_window_set_title (GTK_WINDOW (gtk_rpc_binding_dialog), "Connect"); dialog_vbox1 = GTK_DIALOG (gtk_rpc_binding_dialog)->vbox; - gtk_widget_show (dialog_vbox1); vbox1 = gtk_vbox_new (FALSE, 0); - gtk_widget_show (vbox1); gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox1, TRUE, TRUE, 0); frame_transport = gtk_frame_new (NULL); - gtk_widget_show (frame_transport); gtk_box_pack_start (GTK_BOX (vbox1), frame_transport, TRUE, TRUE, 0); vbox6 = gtk_vbox_new (FALSE, 0); - gtk_widget_show (vbox6); gtk_container_add (GTK_CONTAINER (frame_transport), vbox6); gtk_rpc_binding_dialog->transport_ncalrpc = gtk_radio_button_new_with_mnemonic (NULL, "Local Host"); - gtk_widget_show (gtk_rpc_binding_dialog->transport_ncalrpc); gtk_box_pack_start (GTK_BOX (vbox6), gtk_rpc_binding_dialog->transport_ncalrpc, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (gtk_rpc_binding_dialog->transport_ncalrpc), transport_smb_group); transport_smb_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (gtk_rpc_binding_dialog->transport_ncalrpc)); gtk_rpc_binding_dialog->transport_smb = gtk_radio_button_new_with_mnemonic (NULL, "RPC over SMB over TCP/IP"); - gtk_widget_show (gtk_rpc_binding_dialog->transport_smb); gtk_box_pack_start (GTK_BOX (vbox6), gtk_rpc_binding_dialog->transport_smb, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (gtk_rpc_binding_dialog->transport_smb), transport_smb_group); transport_smb_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (gtk_rpc_binding_dialog->transport_smb)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_rpc_binding_dialog->transport_smb), TRUE); gtk_rpc_binding_dialog->transport_tcp_ip = gtk_radio_button_new_with_mnemonic (NULL, "RPC over TCP/IP"); - gtk_widget_show (gtk_rpc_binding_dialog->transport_tcp_ip); gtk_box_pack_start (GTK_BOX (vbox6), gtk_rpc_binding_dialog->transport_tcp_ip, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (gtk_rpc_binding_dialog->transport_tcp_ip), transport_smb_group); transport_smb_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (gtk_rpc_binding_dialog->transport_tcp_ip)); @@ -131,29 +124,23 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di label1 = gtk_label_new ("Transport"); - gtk_widget_show (label1); gtk_frame_set_label_widget (GTK_FRAME (frame_transport), label1); gtk_rpc_binding_dialog->frame_host = gtk_frame_new (NULL); - gtk_widget_show (gtk_rpc_binding_dialog->frame_host); gtk_box_pack_start (GTK_BOX (vbox1), gtk_rpc_binding_dialog->frame_host, TRUE, TRUE, 0); hbox1 = gtk_hbox_new (FALSE, 0); - gtk_widget_show (hbox1); gtk_container_add (GTK_CONTAINER (gtk_rpc_binding_dialog->frame_host), hbox1); lbl_name = gtk_label_new ("Name"); - gtk_widget_show (lbl_name); gtk_box_pack_start (GTK_BOX (hbox1), lbl_name, TRUE, TRUE, 0); gtk_rpc_binding_dialog->entry_host = gtk_entry_new (); - gtk_widget_show (gtk_rpc_binding_dialog->entry_host); gtk_box_pack_start (GTK_BOX (hbox1), gtk_rpc_binding_dialog->entry_host, TRUE, TRUE, 0); if(gtk_rpc_binding_dialog->sam_pipe) { btn_browse = gtk_button_new_with_label ("Browse"); - gtk_widget_show (btn_browse); gtk_box_pack_start (GTK_BOX (hbox1), btn_browse, TRUE, TRUE, 0); g_signal_connect ((gpointer) btn_browse, "pressed", @@ -162,53 +149,42 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di } label2 = gtk_label_new ("Host"); - gtk_widget_show (label2); gtk_frame_set_label_widget (GTK_FRAME (gtk_rpc_binding_dialog->frame_host), label2); frame_security = gtk_frame_new (NULL); - gtk_widget_show (frame_security); gtk_box_pack_start (GTK_BOX (vbox1), frame_security, TRUE, TRUE, 0); vbox2 = gtk_vbox_new (FALSE, 0); - gtk_widget_show (vbox2); gtk_container_add (GTK_CONTAINER (frame_security), vbox2); gtk_rpc_binding_dialog->chk_sign = gtk_check_button_new_with_mnemonic ("S_ign"); - gtk_widget_show (gtk_rpc_binding_dialog->chk_sign); gtk_box_pack_start (GTK_BOX (vbox2), gtk_rpc_binding_dialog->chk_sign, FALSE, FALSE, 0); gtk_rpc_binding_dialog->chk_seal = gtk_check_button_new_with_mnemonic ("_Seal"); - gtk_widget_show (gtk_rpc_binding_dialog->chk_seal); gtk_box_pack_start (GTK_BOX (vbox2), gtk_rpc_binding_dialog->chk_seal, FALSE, FALSE, 0); label3 = gtk_label_new ("Security"); - gtk_widget_show (label3); gtk_frame_set_label_widget (GTK_FRAME (frame_security), label3); gtk_rpc_binding_dialog->frame_credentials = gtk_frame_new (NULL); - gtk_widget_show (gtk_rpc_binding_dialog->frame_credentials); gtk_box_pack_start (GTK_BOX (dialog_vbox1), gtk_rpc_binding_dialog->frame_credentials, TRUE, TRUE, 0); table1 = gtk_table_new (3, 2, FALSE); - gtk_widget_show (table1); gtk_container_add (GTK_CONTAINER (gtk_rpc_binding_dialog->frame_credentials), table1); lbl_username = gtk_label_new ("Username:"); - gtk_widget_show (lbl_username); gtk_table_attach (GTK_TABLE (table1), lbl_username, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (lbl_username), 0, 0.5); lbl_password = gtk_label_new ("Password:"); - gtk_widget_show (lbl_password); gtk_table_attach (GTK_TABLE (table1), lbl_password, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (lbl_password), 0, 0.5); label9 = gtk_label_new (""); - gtk_widget_show (label9); gtk_table_attach (GTK_TABLE (table1), label9, 0, 1, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); @@ -216,13 +192,11 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di gtk_rpc_binding_dialog->entry_password = gtk_entry_new (); gtk_entry_set_visibility (GTK_ENTRY (gtk_rpc_binding_dialog->entry_password), FALSE); - gtk_widget_show (gtk_rpc_binding_dialog->entry_password); gtk_table_attach (GTK_TABLE (table1), gtk_rpc_binding_dialog->entry_password, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_rpc_binding_dialog->entry_username = gtk_entry_new (); - gtk_widget_show (gtk_rpc_binding_dialog->entry_username); gtk_table_attach (GTK_TABLE (table1), gtk_rpc_binding_dialog->entry_username, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); @@ -230,7 +204,6 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di gtk_entry_set_text(GTK_ENTRY(gtk_rpc_binding_dialog->entry_username), getenv("LOGNAME")); gtk_rpc_binding_dialog->krb5_chk_button = gtk_check_button_new_with_mnemonic ("_Use kerberos"); - gtk_widget_show (gtk_rpc_binding_dialog->krb5_chk_button); gtk_table_attach (GTK_TABLE (table1), gtk_rpc_binding_dialog->krb5_chk_button, 1, 2, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); @@ -245,20 +218,16 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di } lbl_credentials = gtk_label_new ("Credentials"); - gtk_widget_show (lbl_credentials); gtk_frame_set_label_widget (GTK_FRAME (gtk_rpc_binding_dialog->frame_credentials), lbl_credentials); dialog_action_area1 = GTK_DIALOG (gtk_rpc_binding_dialog)->action_area; - gtk_widget_show (dialog_action_area1); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); btn_cancel = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_show (btn_cancel); gtk_dialog_add_action_widget (GTK_DIALOG (gtk_rpc_binding_dialog), btn_cancel, GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS (btn_cancel, GTK_CAN_DEFAULT); btn_connect = gtk_button_new_with_mnemonic ("_Connect"); - gtk_widget_show (btn_connect); gtk_dialog_add_action_widget (GTK_DIALOG (gtk_rpc_binding_dialog), btn_connect, GTK_RESPONSE_ACCEPT); gtk_container_set_border_width (GTK_CONTAINER (btn_connect), 1); GTK_WIDGET_SET_FLAGS (btn_connect, GTK_CAN_DEFAULT); @@ -269,6 +238,7 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(gtk_rpc_binding_dialog->transport_ncalrpc), TRUE); + gtk_widget_show_all(dialog_vbox1); gtk_widget_grab_focus (btn_connect); gtk_widget_grab_default (btn_connect); @@ -365,44 +335,38 @@ const char *gtk_rpc_binding_dialog_get_binding_string(GtkRpcBindingDialog *d, TA GtkWidget *create_gtk_samba_about_dialog (const char *appname) { - GtkWidget *samba_about_dialog; - GtkWidget *dialog_vbox1; - GtkWidget *label1; - GtkWidget *label3; - GtkWidget *label2; - GtkWidget *dialog_action_area1; - GtkWidget *okbutton1; - - samba_about_dialog = gtk_dialog_new (); - gtk_window_set_title (GTK_WINDOW (samba_about_dialog), "About"); - - dialog_vbox1 = GTK_DIALOG (samba_about_dialog)->vbox; - gtk_widget_show (dialog_vbox1); - -/* FIXME image1 = create_pixmap (samba_about_dialog, "slmed.png"); - gtk_widget_show (image1); - gtk_box_pack_start (GTK_BOX (dialog_vbox1), image1, TRUE, TRUE, 0);*/ - - label1 = gtk_label_new (appname); - gtk_widget_show (label1); - gtk_box_pack_start (GTK_BOX (dialog_vbox1), label1, FALSE, FALSE, 0); - - label3 = gtk_label_new_with_mnemonic ("Part of Samba <http://www.samba.org/>"); - gtk_widget_show (label3); - gtk_box_pack_start (GTK_BOX (dialog_vbox1), label3, FALSE, FALSE, 0); - - label2 = gtk_label_new ("\302\251 1992-2004 The Samba Team"); - gtk_widget_show (label2); - gtk_box_pack_start (GTK_BOX (dialog_vbox1), label2, FALSE, FALSE, 0); - - dialog_action_area1 = GTK_DIALOG (samba_about_dialog)->action_area; - gtk_widget_show (dialog_action_area1); - gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); - - okbutton1 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_show (okbutton1); - gtk_dialog_add_action_widget (GTK_DIALOG (samba_about_dialog), okbutton1, GTK_RESPONSE_OK); - GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT); - - return samba_about_dialog; + GtkWidget *samba_about_dialog; + GtkWidget *dialog_vbox1; + GtkWidget *label1; + GtkWidget *label3; + GtkWidget *label2; + GtkWidget *dialog_action_area1; + GtkWidget *okbutton1; + + samba_about_dialog = gtk_dialog_new (); + gtk_window_set_title (GTK_WINDOW (samba_about_dialog), "About"); + + dialog_vbox1 = GTK_DIALOG (samba_about_dialog)->vbox; + + /* FIXME image1 = create_pixmap (samba_about_dialog, "slmed.png"); + gtk_box_pack_start (GTK_BOX (dialog_vbox1), image1, TRUE, TRUE, 0);*/ + + label1 = gtk_label_new (appname); + gtk_box_pack_start (GTK_BOX (dialog_vbox1), label1, FALSE, FALSE, 0); + + label3 = gtk_label_new_with_mnemonic ("Part of Samba <http://www.samba.org/>"); + gtk_box_pack_start (GTK_BOX (dialog_vbox1), label3, FALSE, FALSE, 0); + + label2 = gtk_label_new ("\302\251 1992-2004 The Samba Team"); + gtk_box_pack_start (GTK_BOX (dialog_vbox1), label2, FALSE, FALSE, 0); + + dialog_action_area1 = GTK_DIALOG (samba_about_dialog)->action_area; + gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); + + okbutton1 = gtk_button_new_from_stock ("gtk-ok"); + gtk_dialog_add_action_widget (GTK_DIALOG (samba_about_dialog), okbutton1, GTK_RESPONSE_OK); + GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT); + gtk_widget_show_all(dialog_vbox1); + + return samba_about_dialog; } diff --git a/source4/gtk/common/select.c b/source4/gtk/common/select.c index 3b29d0ed31..ba17092cb9 100644 --- a/source4/gtk/common/select.c +++ b/source4/gtk/common/select.c @@ -44,26 +44,20 @@ void gtk_select_domain_dialog_init (GtkSelectDomainDialog *select_domain_dialog) gtk_window_set_title (GTK_WINDOW (select_domain_dialog), "Select Domain"); dialog_vbox1 = GTK_DIALOG (select_domain_dialog)->vbox; - gtk_widget_show (dialog_vbox1); hbox1 = gtk_hbox_new (FALSE, 0); - gtk_widget_show (hbox1); gtk_box_pack_start (GTK_BOX (dialog_vbox1), hbox1, TRUE, TRUE, 0); label1 = gtk_label_new ("Domain:"); - gtk_widget_show (label1); gtk_box_pack_start (GTK_BOX (hbox1), label1, FALSE, FALSE, 0); select_domain_dialog->entry_domain = gtk_entry_new (); - gtk_widget_show (select_domain_dialog->entry_domain); gtk_box_pack_start (GTK_BOX (hbox1), select_domain_dialog->entry_domain, TRUE, TRUE, 0); scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_show (scrolledwindow1); gtk_box_pack_start (GTK_BOX (dialog_vbox1), scrolledwindow1, TRUE, TRUE, 0); select_domain_dialog->list_domains = gtk_tree_view_new (); - gtk_widget_show (select_domain_dialog->list_domains); gtk_container_add (GTK_CONTAINER (scrolledwindow1), select_domain_dialog->list_domains); curcol = gtk_tree_view_column_new (); @@ -78,17 +72,15 @@ void gtk_select_domain_dialog_init (GtkSelectDomainDialog *select_domain_dialog) g_object_unref(select_domain_dialog->store_domains); dialog_action_area1 = GTK_DIALOG (select_domain_dialog)->action_area; - gtk_widget_show (dialog_action_area1); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_show (cancelbutton1); gtk_dialog_add_action_widget (GTK_DIALOG (select_domain_dialog), cancelbutton1, GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT); okbutton1 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_show (okbutton1); gtk_dialog_add_action_widget (GTK_DIALOG (select_domain_dialog), okbutton1, GTK_RESPONSE_OK); + gtk_widget_show_all(dialog_vbox1); GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT); } @@ -203,26 +195,20 @@ void gtk_select_host_dialog_init (GtkSelectHostDialog *select_host_dialog) gtk_window_set_title (GTK_WINDOW (select_host_dialog), "Select Host"); dialog_vbox2 = GTK_DIALOG (select_host_dialog)->vbox; - gtk_widget_show (dialog_vbox2); hbox2 = gtk_hbox_new (FALSE, 0); - gtk_widget_show (hbox2); gtk_box_pack_start (GTK_BOX (dialog_vbox2), hbox2, TRUE, TRUE, 0); label2 = gtk_label_new ("Host"); - gtk_widget_show (label2); gtk_box_pack_start (GTK_BOX (hbox2), label2, FALSE, FALSE, 0); select_host_dialog->entry_host = gtk_entry_new (); - gtk_widget_show (select_host_dialog->entry_host); gtk_box_pack_start (GTK_BOX (hbox2), select_host_dialog->entry_host, TRUE, TRUE, 0); scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_show (scrolledwindow2); gtk_box_pack_start (GTK_BOX (dialog_vbox2), scrolledwindow2, TRUE, TRUE, 0); select_host_dialog->tree_host = gtk_tree_view_new (); - gtk_widget_show (select_host_dialog->tree_host); gtk_container_add (GTK_CONTAINER (scrolledwindow2), select_host_dialog->tree_host); select_host_dialog->store_host = gtk_tree_store_new(1, G_TYPE_STRING); @@ -230,16 +216,14 @@ void gtk_select_host_dialog_init (GtkSelectHostDialog *select_host_dialog) g_object_unref(select_host_dialog->store_host); dialog_action_area2 = GTK_DIALOG (select_host_dialog)->action_area; - gtk_widget_show (dialog_action_area2); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area2), GTK_BUTTONBOX_END); cancelbutton2 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_show (cancelbutton2); gtk_dialog_add_action_widget (GTK_DIALOG (select_host_dialog), cancelbutton2, GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS (cancelbutton2, GTK_CAN_DEFAULT); okbutton2 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_show (okbutton2); + gtk_widget_show_all (dialog_vbox2); gtk_dialog_add_action_widget (GTK_DIALOG (select_host_dialog), okbutton2, GTK_RESPONSE_OK); GTK_WIDGET_SET_FLAGS (okbutton2, GTK_CAN_DEFAULT); } |