summaryrefslogtreecommitdiff
path: root/source4/gtk/common
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-10-11 20:06:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:48 -0500
commit8e1ffff226e3016a38301a773ed8aa55bad5b710 (patch)
tree1cc15a9ac0c6f2f8a5dd56d1722347b151e99039 /source4/gtk/common
parent4d69d2d52b273359b481e1a7b99b9db3711d2768 (diff)
downloadsamba-8e1ffff226e3016a38301a773ed8aa55bad5b710.tar.gz
samba-8e1ffff226e3016a38301a773ed8aa55bad5b710.tar.bz2
samba-8e1ffff226e3016a38301a773ed8aa55bad5b710.zip
r2920: Support passing a handle to a SAMR pipe to a RPC Binding or Select
Host dialog so that one can select a domain from the list of known domains. (This used to be commit 5e0bab891199c888bdf87faa29acc38d9ca5151b)
Diffstat (limited to 'source4/gtk/common')
-rw-r--r--source4/gtk/common/gtk-smb.c23
-rw-r--r--source4/gtk/common/gtk-smb.h1
-rw-r--r--source4/gtk/common/select.c3
-rw-r--r--source4/gtk/common/select.h12
4 files changed, 22 insertions, 17 deletions
diff --git a/source4/gtk/common/gtk-smb.c b/source4/gtk/common/gtk-smb.c
index cb7a804866..f149775996 100644
--- a/source4/gtk/common/gtk-smb.c
+++ b/source4/gtk/common/gtk-smb.c
@@ -47,7 +47,7 @@ void gtk_show_ntstatus(GtkWidget *win, NTSTATUS status)
static void on_browse_activate (GtkButton *button, gpointer user_data)
{
GtkRpcBindingDialog *rbd = user_data;
- GtkWidget *shd = gtk_select_host_dialog_new(TRUE);
+ GtkWidget *shd = gtk_select_host_dialog_new(rbd->sam_pipe, TRUE);
if(gtk_dialog_run(GTK_DIALOG(shd)) == GTK_RESPONSE_ACCEPT) {
gtk_entry_set_text(GTK_ENTRY(rbd->entry_host), gtk_select_host_dialog_get_host(GTK_SELECT_HOST_DIALOG(shd)));
}
@@ -138,13 +138,16 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di
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);
- 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);
+ 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",
- G_CALLBACK (on_browse_activate),
- gtk_rpc_binding_dialog);
+ g_signal_connect ((gpointer) btn_browse, "pressed",
+ G_CALLBACK (on_browse_activate),
+ gtk_rpc_binding_dialog);
+ }
label2 = gtk_label_new ("Host");
gtk_widget_show (label2);
@@ -278,9 +281,11 @@ GType gtk_rpc_binding_dialog_get_type (void)
return mytype;
}
-GtkWidget *gtk_rpc_binding_dialog_new (BOOL nocredentials)
+GtkWidget *gtk_rpc_binding_dialog_new (BOOL nocredentials, struct sam_pipe *sam_pipe)
{
- return GTK_WIDGET ( gtk_type_new (gtk_rpc_binding_dialog_get_type ()));
+ GtkRpcBindingDialog *d = GTK_RPC_BINDING_DIALOG ( gtk_type_new (gtk_rpc_binding_dialog_get_type ()));
+ d->sam_pipe = sam_pipe;
+ return GTK_WIDGET(d);
}
const char *gtk_rpc_binding_dialog_get_username(GtkRpcBindingDialog *d)
diff --git a/source4/gtk/common/gtk-smb.h b/source4/gtk/common/gtk-smb.h
index 0f34bb3249..09e5d0aa8d 100644
--- a/source4/gtk/common/gtk-smb.h
+++ b/source4/gtk/common/gtk-smb.h
@@ -40,6 +40,7 @@ struct _GtkRpcBindingDialog
GtkWidget *entry_password;
GtkWidget *krb5_chk_button;
TALLOC_CTX *mem_ctx;
+ struct sam_pipe *sam_pipe;
};
typedef struct _GtkRpcBindingDialogClass GtkRpcBindingDialogClass;
diff --git a/source4/gtk/common/select.c b/source4/gtk/common/select.c
index 653256c37e..3b29d0ed31 100644
--- a/source4/gtk/common/select.c
+++ b/source4/gtk/common/select.c
@@ -163,7 +163,6 @@ GtkWidget *gtk_select_domain_dialog_new (struct dcerpc_pipe *sam_pipe)
} else if (r.out.sam) {
for (i=0;i<r.out.sam->count;i++) {
GtkTreeIter iter;
- printf("- %s\n", r.out.sam->entries[i].name.name);
gtk_list_store_append(d->store_domains, &iter);
gtk_list_store_set (d->store_domains, &iter, 0, r.out.sam->entries[i].name.name, -1);
}
@@ -271,7 +270,7 @@ GType gtk_select_host_dialog_get_type (void)
return mytype;
}
-GtkWidget *gtk_select_host_dialog_new (BOOL nocredentials)
+GtkWidget *gtk_select_host_dialog_new (struct sam_pipe *sam_pipe, BOOL nocredentials)
{
return GTK_WIDGET ( gtk_type_new (gtk_select_host_dialog_get_type ()));
}
diff --git a/source4/gtk/common/select.h b/source4/gtk/common/select.h
index b89712ffe0..3b3d09a99b 100644
--- a/source4/gtk/common/select.h
+++ b/source4/gtk/common/select.h
@@ -45,9 +45,9 @@ struct _GtkSelectDomainDialogClass
GtkDialogClass parent_class;
};
-#define GTK_SELECT_DOMAIN_DIALOG(obj) GTK_CHECK_CAST (obj, gtk_rpc_binding_dialog_get_type (), GtkSelectDomainDialog)
-#define GTK_SELECT_DOMAIN_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_rpc_binding_dialog_class_get_type (), GtkSelectDomainDialogClass)
-#define IS_GTK_SELECT_DOMAIN_DIALOG(obj) GTK_CHECK_TYPE (obj, gtk_rpc_binding_dialog_get_type ())
+#define GTK_SELECT_DOMAIN_DIALOG(obj) GTK_CHECK_CAST (obj, gtk_select_domain_dialog_get_type (), GtkSelectDomainDialog)
+#define GTK_SELECT_DOMAIN_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_select_domain_dialog_class_get_type (), GtkSelectDomainDialogClass)
+#define IS_GTK_SELECT_DOMAIN_DIALOG(obj) GTK_CHECK_TYPE (obj, gtk_select_domain_dialog_get_type ())
typedef struct _GtkSelectHostDialog GtkSelectHostDialog;
@@ -68,9 +68,9 @@ struct _GtkSelectHostDialogClass
GtkDialogClass parent_class;
};
-#define GTK_SELECT_HOST_DIALOG(obj) GTK_CHECK_CAST (obj, gtk_rpc_binding_dialog_get_type (), GtkSelectHostDialog)
-#define GTK_SELECT_HOST_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_rpc_binding_dialog_class_get_type (), GtkSelectHostDialogClass)
-#define IS_GTK_SELECT_HOST_DIALOG(obj) GTK_CHECK_TYPE (obj, gtk_rpc_binding_dialog_get_type ())
+#define GTK_SELECT_HOST_DIALOG(obj) GTK_CHECK_CAST (obj, gtk_select_host_dialog_get_type (), GtkSelectHostDialog)
+#define GTK_SELECT_HOST_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_select_host_dialog_class_get_type (), GtkSelectHostDialogClass)
+#define IS_GTK_SELECT_HOST_DIALOG(obj) GTK_CHECK_TYPE (obj, gtk_select_host_dialog_get_type ())
#endif