summaryrefslogtreecommitdiff
path: root/source4/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'source4/gtk')
-rw-r--r--source4/gtk/common/gtk-smb.c22
-rw-r--r--source4/gtk/tools/gwcrontab.c8
-rw-r--r--source4/gtk/tools/gwsam.c12
3 files changed, 31 insertions, 11 deletions
diff --git a/source4/gtk/common/gtk-smb.c b/source4/gtk/common/gtk-smb.c
index 3a231ca6e7..2bc14d93bf 100644
--- a/source4/gtk/common/gtk-smb.c
+++ b/source4/gtk/common/gtk-smb.c
@@ -109,6 +109,13 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di
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);
@@ -122,15 +129,7 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di
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));
- 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));
- g_signal_connect ((gpointer) gtk_rpc_binding_dialog->transport_ncalrpc, "toggled",
- G_CALLBACK (on_ncalrpc_toggled),
- gtk_rpc_binding_dialog);
label1 = gtk_label_new ("Transport");
gtk_widget_show (label1);
@@ -265,6 +264,13 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di
gtk_container_set_border_width (GTK_CONTAINER (btn_connect), 1);
GTK_WIDGET_SET_FLAGS (btn_connect, GTK_CAN_DEFAULT);
+ g_signal_connect ((gpointer) gtk_rpc_binding_dialog->transport_ncalrpc, "toggled",
+ G_CALLBACK (on_ncalrpc_toggled),
+ gtk_rpc_binding_dialog);
+
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(gtk_rpc_binding_dialog->transport_ncalrpc), TRUE);
+
gtk_widget_grab_focus (btn_connect);
gtk_widget_grab_default (btn_connect);
}
diff --git a/source4/gtk/tools/gwcrontab.c b/source4/gtk/tools/gwcrontab.c
index b3137a9a19..97660c9225 100644
--- a/source4/gtk/tools/gwcrontab.c
+++ b/source4/gtk/tools/gwcrontab.c
@@ -85,6 +85,7 @@ on_connect_activate (GtkMenuItem *menuitem,
GtkRpcBindingDialog *d;
NTSTATUS status;
gint result;
+ TALLOC_CTX *mem_ctx;
d = GTK_RPC_BINDING_DIALOG(gtk_rpc_binding_dialog_new(FALSE, NULL));
result = gtk_dialog_run(GTK_DIALOG(d));
@@ -96,16 +97,21 @@ on_connect_activate (GtkMenuItem *menuitem,
return;
}
+ mem_ctx = talloc_init("gwcrontab_connect");
/* If connected, get list of jobs */
- status = dcerpc_pipe_connect(&at_pipe, gtk_rpc_binding_dialog_get_binding(d, DCERPC_ATSVC_NAME), DCERPC_ATSVC_UUID, DCERPC_ATSVC_VERSION, lp_workgroup(), gtk_rpc_binding_dialog_get_username(d), gtk_rpc_binding_dialog_get_password(d));
+
+ status = dcerpc_pipe_connect_b(&at_pipe, gtk_rpc_binding_dialog_get_binding(d, mem_ctx), DCERPC_ATSVC_UUID, DCERPC_ATSVC_VERSION, lp_workgroup(), gtk_rpc_binding_dialog_get_username(d), gtk_rpc_binding_dialog_get_password(d));
+
if(!NT_STATUS_IS_OK(status)) {
gtk_show_ntstatus(mainwin, status);
at_pipe = NULL;
gtk_widget_destroy(GTK_WIDGET(d));
+ talloc_destroy(mem_ctx);
return;
}
gtk_widget_destroy(GTK_WIDGET(d));
+ talloc_destroy(mem_ctx);
update_joblist();
}
diff --git a/source4/gtk/tools/gwsam.c b/source4/gtk/tools/gwsam.c
index c6b68c5e3c..e31f9344e8 100644
--- a/source4/gtk/tools/gwsam.c
+++ b/source4/gtk/tools/gwsam.c
@@ -91,7 +91,7 @@ on_select_domain_activate (GtkMenuItem *menuitem,
d = GTK_SELECT_DOMAIN_DIALOG(gtk_select_domain_dialog_new(sam_pipe));
result = gtk_dialog_run(GTK_DIALOG(d));
switch(result) {
- case GTK_RESPONSE_ACCEPT:
+ case GTK_RESPONSE_OK:
break;
default:
gtk_widget_destroy(GTK_WIDGET(d));
@@ -105,7 +105,7 @@ on_select_domain_activate (GtkMenuItem *menuitem,
gtk_widget_destroy(GTK_WIDGET(d));
}
-void on_connect_activate (GtkMenuItem *menuitem, gpointer user_data)
+static void connect_sam(void)
{
GtkRpcBindingDialog *d;
NTSTATUS status;
@@ -153,6 +153,12 @@ void on_connect_activate (GtkMenuItem *menuitem, gpointer user_data)
gtk_window_set_title (GTK_WINDOW (mainwin), talloc_asprintf(mem_ctx, "User Manager - Connected to %s", gtk_rpc_binding_dialog_get_host(d)));
gtk_widget_destroy(GTK_WIDGET(d));
talloc_destroy(mem_ctx);
+
+}
+
+void on_connect_activate (GtkMenuItem *menuitem, gpointer user_data)
+{
+ connect_sam();
}
void on_disconnect_activate (GtkMenuItem *menuitem, gpointer user_data)
@@ -431,9 +437,11 @@ create_mainwindow (void)
{
lp_load(dyn_CONFIGFILE,True,False,False);
load_interfaces();
+ setup_logging("gwsam", True);
gtk_init(&argc, &argv);
mainwin = create_mainwindow();
+ connect_sam();
gtk_widget_show(mainwin);
gtk_main();