+ object_class->set_property = aui_service_dialog_set_property;
+ object_class->get_property = aui_service_dialog_get_property;
+
+ g_object_class_install_property(
+ object_class,
+ PROP_BROWSE_SERVICE_TYPES,
+ g_param_spec_pointer("browse_service_types", _("Browse Service Types"), _("A NULL terminated list of service types to browse for"),
+ G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property(
+ object_class,
+ PROP_DOMAIN,
+ g_param_spec_string("domain", _("Domain"), _("The domain to browse in, or NULL for the default domain"),
+ NULL,
+ G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property(
+ object_class,
+ PROP_SERVICE_TYPE,
+ g_param_spec_string("service_type", _("Service Type"), _("The service type of the selected service"),
+ NULL,
+ G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property(
+ object_class,
+ PROP_SERVICE_NAME,
+ g_param_spec_string("service_name", _("Service Name"), _("The service name of the selected service"),
+ NULL,
+ G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property(
+ object_class,
+ PROP_ADDRESS,
+ g_param_spec_pointer("address", _("Address"), _("The address of the resolved service"),
+ G_PARAM_READABLE));
+ g_object_class_install_property(
+ object_class,
+ PROP_PORT,
+ g_param_spec_uint("port", _("Port"), _("The IP port number of the resolved service"),
+ 0, 0xFFFF, 0,
+ G_PARAM_READABLE));
+ g_object_class_install_property(
+ object_class,
+ PROP_HOST_NAME,
+ g_param_spec_string("host_name", _("Host Name"), _("The host name of the resolved service"),
+ NULL,
+ G_PARAM_READABLE));
+ g_object_class_install_property(
+ object_class,
+ PROP_TXT_DATA,
+ g_param_spec_pointer("txt_data", _("TXT Data"), _("The TXT data of the resolved service"),
+ G_PARAM_READABLE));
+ g_object_class_install_property(
+ object_class,
+ PROP_RESOLVE_SERVICE,
+ g_param_spec_boolean("resolve_service", _("Resolve Service"), _("Resolve the selected service automatically before returning"),
+ TRUE,
+ G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property(
+ object_class,
+ PROP_RESOLVE_HOST_NAME,
+ g_param_spec_boolean("resolve_host_name", _("Resolve Service Host Name"), _("Resolve the host name of the selected service automatically before returning"),
+ TRUE,
+ G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property(
+ object_class,
+ PROP_ADDRESS_FAMILY,
+ g_param_spec_int("address_family", _("Address family"), _("The address family for host name resolution"),
+ AVAHI_PROTO_UNSPEC, AVAHI_PROTO_INET6, AVAHI_PROTO_UNSPEC,
+ G_PARAM_READABLE | G_PARAM_WRITABLE));
+}
+
+
+GtkWidget *aui_service_dialog_new_valist(
+ const gchar *title,
+ GtkWindow *parent,
+ const gchar *first_button_text,
+ va_list varargs) {
+
+ const gchar *button_text;
+ gint dr;
+
+ GtkWidget *w = (GtkWidget*)g_object_new(
+ AUI_TYPE_SERVICE_DIALOG,
+#if !GTK_CHECK_VERSION (2,21,8)
+ "has-separator", FALSE,
+#endif
+ "title", title,
+ NULL);
+
+ if (parent)
+ gtk_window_set_transient_for(GTK_WINDOW(w), parent);
+
+ button_text = first_button_text;
+ while (button_text) {
+ gint response_id;
+
+ response_id = va_arg(varargs, gint);
+ gtk_dialog_add_button(GTK_DIALOG(w), button_text, response_id);
+ button_text = va_arg(varargs, const gchar *);
+ }
+
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(w), GTK_RESPONSE_ACCEPT, FALSE);
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(w), GTK_RESPONSE_OK, FALSE);
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(w), GTK_RESPONSE_YES, FALSE);
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(w), GTK_RESPONSE_APPLY, FALSE);
+
+ if ((dr = get_default_response(GTK_DIALOG(w))) != GTK_RESPONSE_NONE)
+ gtk_dialog_set_default_response(GTK_DIALOG(w), dr);
+
+ return w;