/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2006-2007 Imendio AB
- * Copyright (C) 2007 Collabora Ltd.
+ * Copyright (C) 2007-2008 Collabora Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
* Authors: Xavier Claessens <xclaesse@gmail.com>
* Martyn Russell <martyn@imendio.com>
*/
#include <string.h>
#include <gtk/gtk.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
-#include <libmissioncontrol/mc-account.h>
#include <libmissioncontrol/mc-protocol.h>
-#include <libempathy/empathy-debug.h>
+#include <libempathy/empathy-utils.h>
+#include <libempathy/empathy-account.h>
#include "empathy-account-widget.h"
#include "empathy-ui-utils.h"
-#define DEBUG_DOMAIN "AccountWidget"
+#define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT
+#include <libempathy/empathy-debug.h>
-static gboolean
+static gboolean
account_widget_entry_focus_cb (GtkWidget *widget,
GdkEventFocus *event,
- McAccount *account)
+ EmpathyAccount *account)
{
const gchar *str;
const gchar *param_name;
str = gtk_entry_get_text (GTK_ENTRY (widget));
param_name = g_object_get_data (G_OBJECT (widget), "param_name");
- if (G_STR_EMPTY (str)) {
+ if (EMP_STR_EMPTY (str)) {
gchar *value = NULL;
- mc_account_unset_param (account, param_name);
- mc_account_get_param_string (account, param_name, &value);
- empathy_debug (DEBUG_DOMAIN, "Unset %s and restore to %s", param_name, value);
+ empathy_account_unset_param (account, param_name);
+ value = empathy_account_get_param_string (account, param_name);
+ DEBUG ("Unset %s and restore to %s", param_name, value);
gtk_entry_set_text (GTK_ENTRY (widget), value ? value : "");
g_free (value);
} else {
- empathy_debug (DEBUG_DOMAIN, "Setting %s to %s", param_name, str);
- mc_account_set_param_string (account, param_name, str);
+ McProfile *profile;
+ const gchar *domain = NULL;
+ gchar *dup_str = NULL;
+
+ profile = empathy_account_get_profile (account);
+ if (mc_profile_get_capabilities (profile) &
+ MC_PROFILE_CAPABILITY_SPLIT_ACCOUNT) {
+ domain = mc_profile_get_default_account_domain (profile);
+ }
+
+ if (domain && !strstr (str, "@") &&
+ strcmp (param_name, "account") == 0) {
+ DEBUG ("Adding @%s suffix to account", domain);
+ str = dup_str = g_strconcat (str, "@", domain, NULL);
+ gtk_entry_set_text (GTK_ENTRY (widget), str);
+ }
+ DEBUG ("Setting %s to %s", param_name,
+ strstr (param_name, "password") ? "***" : str);
+ empathy_account_set_param_string (account, param_name, str);
+ g_free (dup_str);
+ g_object_unref (profile);
}
return FALSE;
static void
account_widget_int_changed_cb (GtkWidget *widget,
- McAccount *account)
+ EmpathyAccount *account)
{
const gchar *param_name;
gint value;
param_name = g_object_get_data (G_OBJECT (widget), "param_name");
if (value == 0) {
- mc_account_unset_param (account, param_name);
- mc_account_get_param_int (account, param_name, &value);
- empathy_debug (DEBUG_DOMAIN, "Unset %s and restore to %d", param_name, value);
+ empathy_account_unset_param (account, param_name);
+ value = empathy_account_get_param_int (account, param_name);
+ DEBUG ("Unset %s and restore to %d", param_name, value);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), value);
} else {
- empathy_debug (DEBUG_DOMAIN, "Setting %s to %d", param_name, value);
- mc_account_set_param_int (account, param_name, value);
+ DEBUG ("Setting %s to %d", param_name, value);
+ empathy_account_set_param_int (account, param_name, value);
}
}
-static void
+static void
account_widget_checkbutton_toggled_cb (GtkWidget *widget,
- McAccount *account)
+ EmpathyAccount *account)
{
gboolean value;
gboolean default_value;
/* FIXME: This is ugly! checkbox don't have a "not-set" value so we
* always unset the param and set the value if different from the
* default value. */
- mc_account_unset_param (account, param_name);
- mc_account_get_param_boolean (account, param_name, &default_value);
+ empathy_account_unset_param (account, param_name);
+ default_value = empathy_account_get_param_boolean (account, param_name);
if (default_value == value) {
- empathy_debug (DEBUG_DOMAIN, "Unset %s and restore to %d", param_name, default_value);
+ DEBUG ("Unset %s and restore to %d", param_name, default_value);
} else {
- empathy_debug (DEBUG_DOMAIN, "Setting %s to %d", param_name, value);
- mc_account_set_param_boolean (account, param_name, value);
+ DEBUG ("Setting %s to %d", param_name, value);
+ empathy_account_set_param_boolean (account, param_name, value);
}
}
account_widget_forget_clicked_cb (GtkWidget *button,
GtkWidget *entry)
{
- McAccount *account;
+ EmpathyAccount *account;
const gchar *param_name;
param_name = g_object_get_data (G_OBJECT (entry), "param_name");
account = g_object_get_data (G_OBJECT (entry), "account");
- empathy_debug (DEBUG_DOMAIN, "Unset %s", param_name);
- mc_account_unset_param (account, param_name);
+ DEBUG ("Unset %s", param_name);
+ empathy_account_unset_param (account, param_name);
gtk_entry_set_text (GTK_ENTRY (entry), "");
}
const gchar *str;
str = gtk_entry_get_text (GTK_ENTRY (entry));
- gtk_widget_set_sensitive (button, !G_STR_EMPTY (str));
+ gtk_widget_set_sensitive (button, !EMP_STR_EMPTY (str));
}
-static void
+static void
account_widget_jabber_ssl_toggled_cb (GtkWidget *checkbutton_ssl,
GtkWidget *spinbutton_port)
{
- McAccount *account;
+ EmpathyAccount *account;
gboolean value;
gint port = 0;
value = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton_ssl));
account = g_object_get_data (G_OBJECT (spinbutton_port), "account");
- mc_account_get_param_int (account, "port", &port);
+ port = empathy_account_get_param_int (account, "port");
if (value) {
if (port == 5222 || port == 0) {
static void
account_widget_setup_widget (GtkWidget *widget,
- McAccount *account,
+ EmpathyAccount *account,
const gchar *param_name)
{
- g_object_set_data_full (G_OBJECT (widget), "param_name",
+ g_object_set_data_full (G_OBJECT (widget), "param_name",
g_strdup (param_name), g_free);
- g_object_set_data_full (G_OBJECT (widget), "account",
+ g_object_set_data_full (G_OBJECT (widget), "account",
g_object_ref (account), g_object_unref);
if (GTK_IS_SPIN_BUTTON (widget)) {
gint value = 0;
- mc_account_get_param_int (account, param_name, &value);
+ value = empathy_account_get_param_int (account, param_name);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), value);
g_signal_connect (widget, "value-changed",
else if (GTK_IS_ENTRY (widget)) {
gchar *str = NULL;
- mc_account_get_param_string (account, param_name, &str);
+ str = empathy_account_get_param_string (account, param_name);
gtk_entry_set_text (GTK_ENTRY (widget), str ? str : "");
g_free (str);
else if (GTK_IS_TOGGLE_BUTTON (widget)) {
gboolean value = FALSE;
- mc_account_get_param_boolean (account, param_name, &value);
+ value = empathy_account_get_param_boolean (account, param_name);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), value);
g_signal_connect (widget, "toggled",
G_CALLBACK (account_widget_checkbutton_toggled_cb),
account);
} else {
- empathy_debug (DEBUG_DOMAIN,
- "Unknown type of widget for param %s",
- param_name);
+ DEBUG ("Unknown type of widget for param %s", param_name);
}
}
gchar *p;
str = g_strdup (param_name);
-
+
if (str && g_ascii_isalpha (str[0])) {
str[0] = g_ascii_toupper (str[0]);
}
-
+
while ((p = strchr (str, '-')) != NULL) {
if (p[1] != '\0' && g_ascii_isalpha (p[1])) {
p[0] = ' ';
p++;
}
-
+
return str;
}
static void
-accounts_widget_generic_setup (McAccount *account,
- GtkWidget *table_settings)
+accounts_widget_generic_setup (EmpathyAccount *account,
+ GtkWidget *table_common_settings,
+ GtkWidget *table_advanced_settings)
{
McProtocol *protocol;
McProfile *profile;
GSList *params, *l;
- guint n_rows = 0;
- profile = mc_account_get_profile (account);
+ profile = empathy_account_get_profile (account);
protocol = mc_profile_get_protocol (profile);
if (!protocol) {
/* The CM is not installed, MC shouldn't list them
* see SF bug #1688779
- * FIXME: We should display something asking the user to
+ * FIXME: We should display something asking the user to
* install the CM
*/
g_object_unref (profile);
for (l = params; l; l = l->next) {
McProtocolParam *param;
+ GtkWidget *table_settings;
+ guint n_rows = 0;
GtkWidget *widget = NULL;
gchar *param_name_formatted;
param = l->data;
+ if (param->flags & MC_PROTOCOL_PARAM_REQUIRED) {
+ table_settings = table_common_settings;
+ } else {
+ table_settings = table_advanced_settings;
+ }
param_name_formatted = account_widget_generic_format_param_name (param->name);
+ g_object_get (table_settings, "n-rows", &n_rows, NULL);
gtk_table_resize (GTK_TABLE (table_settings), ++n_rows, 2);
if (param->signature[0] == 's') {
n_rows - 1, n_rows,
GTK_FILL, 0,
0, 0);
+ gtk_widget_show (widget);
widget = gtk_entry_new ();
+ if (strcmp (param->name, "account") == 0) {
+ g_signal_connect (widget, "realize",
+ G_CALLBACK (gtk_widget_grab_focus),
+ NULL);
+ }
gtk_table_attach (GTK_TABLE (table_settings),
widget,
1, 2,
n_rows - 1, n_rows,
GTK_FILL | GTK_EXPAND, 0,
0, 0);
+ gtk_widget_show (widget);
}
/* int types: ynqiuxt. double type is 'd' */
else if (param->signature[0] == 'y' ||
n_rows - 1, n_rows,
GTK_FILL, 0,
0, 0);
+ gtk_widget_show (widget);
widget = gtk_spin_button_new_with_range (minint, maxint, step);
gtk_table_attach (GTK_TABLE (table_settings),
n_rows - 1, n_rows,
GTK_FILL | GTK_EXPAND, 0,
0, 0);
+ gtk_widget_show (widget);
}
else if (param->signature[0] == 'b') {
widget = gtk_check_button_new_with_label (param_name_formatted);
n_rows - 1, n_rows,
GTK_FILL | GTK_EXPAND, 0,
0, 0);
+ gtk_widget_show (widget);
} else {
- empathy_debug (DEBUG_DOMAIN,
- "Unknown signature for param %s: %s",
- param_name_formatted, param->signature);
+ DEBUG ("Unknown signature for param %s: %s",
+ param_name_formatted, param->signature);
}
if (widget) {
g_free (param_name_formatted);
}
- g_slist_free (params);
+ mc_protocol_free_params_list (params);
g_object_unref (profile);
g_object_unref (protocol);
}
static void
-account_widget_handle_params_valist (McAccount *account,
- GladeXML *gui,
- const gchar *first_widget_name,
+account_widget_handle_params_valist (EmpathyAccount *account,
+ GtkBuilder *gui,
+ const gchar *first_widget,
va_list args)
{
- GtkWidget *widget;
- const gchar *widget_name;
+ GObject *object;
+ const gchar *name;
- for (widget_name = first_widget_name; widget_name; widget_name = va_arg (args, gchar*)) {
+ for (name = first_widget; name; name = va_arg (args, const gchar *)) {
const gchar *param_name;
- param_name = va_arg (args, gchar*);
-
- widget = glade_xml_get_widget (gui, widget_name);
+ param_name = va_arg (args, const gchar *);
+ object = gtk_builder_get_object (gui, name);
- if (!widget) {
- g_warning ("Glade is missing widget '%s'.", widget_name);
+ if (!object) {
+ g_warning ("Builder is missing object '%s'.", name);
continue;
}
- account_widget_setup_widget (widget, account, param_name);
+ account_widget_setup_widget (GTK_WIDGET (object), account, param_name);
}
}
void
-empathy_account_widget_handle_params (McAccount *account,
- GladeXML *gui,
- const gchar *first_widget_name,
+empathy_account_widget_handle_params (EmpathyAccount *account,
+ GtkBuilder *gui,
+ const gchar *first_widget,
...)
{
va_list args;
- g_return_if_fail (MC_IS_ACCOUNT (account));
+ g_return_if_fail (GTK_IS_BUILDER (gui));
- va_start (args, first_widget_name);
- account_widget_handle_params_valist (account, gui,
- first_widget_name,
- args);
+ va_start (args, first_widget);
+ account_widget_handle_params_valist (account, gui, first_widget, args);
va_end (args);
}
void
-emapthy_account_widget_add_forget_button (McAccount *account,
- GladeXML *glade,
+empathy_account_widget_add_forget_button (EmpathyAccount *account,
+ GtkBuilder *gui,
const gchar *button,
const gchar *entry)
{
GtkWidget *button_forget;
GtkWidget *entry_password;
- gchar *password = NULL;
-
- button_forget = glade_xml_get_widget (glade, button);
- entry_password = glade_xml_get_widget (glade, entry);
+ gchar *password = NULL;
- mc_account_get_param_string (account, "password", &password);
- gtk_widget_set_sensitive (button_forget, !G_STR_EMPTY (password));
+ button_forget = GTK_WIDGET (gtk_builder_get_object (gui, button));
+ entry_password = GTK_WIDGET (gtk_builder_get_object (gui, entry));
+
+ password = empathy_account_get_param_string (account, "password");
+ gtk_widget_set_sensitive (button_forget, !EMP_STR_EMPTY (password));
g_free (password);
g_signal_connect (button_forget, "clicked",
button_forget);
}
+void
+empathy_account_widget_set_default_focus (GtkBuilder *gui,
+ const gchar *entry)
+{
+ GObject *default_focus_entry;
+
+ default_focus_entry = gtk_builder_get_object (gui, entry);
+ g_signal_connect (default_focus_entry, "realize",
+ G_CALLBACK (gtk_widget_grab_focus),
+ NULL);
+}
+
GtkWidget *
-empathy_account_widget_generic_new (McAccount *account)
+empathy_account_widget_generic_new (EmpathyAccount *account)
{
- GtkWidget *table_settings;
- GtkWidget *sw;
-
- g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
-
- table_settings = gtk_table_new (0, 2, FALSE);
- gtk_table_set_row_spacings (GTK_TABLE (table_settings), 6);
- gtk_table_set_col_spacings (GTK_TABLE (table_settings), 6);
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw),
- table_settings);
-
- accounts_widget_generic_setup (account, table_settings);
-
- gtk_widget_show_all (sw);
-
- return sw;
+ GtkBuilder *gui;
+ GtkWidget *widget;
+ GtkWidget *table_common_settings;
+ GtkWidget *table_advanced_settings;
+ gchar *filename;
+
+ filename = empathy_file_lookup ("empathy-account-widget-generic.ui",
+ "libempathy-gtk");
+ gui = empathy_builder_get_file (filename,
+ "vbox_generic_settings", &widget,
+ "table_common_settings", &table_common_settings,
+ "table_advanced_settings", &table_advanced_settings,
+ NULL);
+ g_free (filename);
+
+ accounts_widget_generic_setup (account, table_common_settings, table_advanced_settings);
+
+ return empathy_builder_unref_and_keep_widget (gui, widget);
}
GtkWidget *
-empathy_account_widget_salut_new (McAccount *account)
+empathy_account_widget_salut_new (EmpathyAccount *account)
{
- GladeXML *glade;
+ GtkBuilder *gui;
GtkWidget *widget;
+ gchar *filename;
- glade = empathy_glade_get_file ("empathy-account-widget-salut.glade",
- "vbox_salut_settings",
- NULL,
+ filename = empathy_file_lookup ("empathy-account-widget-salut.ui",
+ "libempathy-gtk");
+ gui = empathy_builder_get_file (filename,
"vbox_salut_settings", &widget,
NULL);
+ g_free (filename);
- empathy_account_widget_handle_params (account, glade,
+ empathy_account_widget_handle_params (account, gui,
"entry_published", "published-name",
"entry_nickname", "nickname",
"entry_first_name", "first-name",
"entry_jid", "jid",
NULL);
- g_object_unref (glade);
+ empathy_account_widget_set_default_focus (gui, "entry_nickname");
- gtk_widget_show (widget);
-
- return widget;
+ return empathy_builder_unref_and_keep_widget (gui, widget);
}
GtkWidget *
-empathy_account_widget_msn_new (McAccount *account)
+empathy_account_widget_msn_new (EmpathyAccount *account)
{
- GladeXML *glade;
+ GtkBuilder *gui;
GtkWidget *widget;
+ gchar *filename;
- glade = empathy_glade_get_file ("empathy-account-widget-msn.glade",
- "vbox_msn_settings",
- NULL,
+ filename = empathy_file_lookup ("empathy-account-widget-msn.ui",
+ "libempathy-gtk");
+ gui = empathy_builder_get_file (filename,
"vbox_msn_settings", &widget,
NULL);
+ g_free (filename);
- empathy_account_widget_handle_params (account, glade,
+ empathy_account_widget_handle_params (account, gui,
"entry_id", "account",
"entry_password", "password",
"entry_server", "server",
"spinbutton_port", "port",
NULL);
- emapthy_account_widget_add_forget_button (account, glade,
+ empathy_account_widget_add_forget_button (account, gui,
"button_forget",
"entry_password");
- g_object_unref (glade);
-
- gtk_widget_show (widget);
+ empathy_account_widget_set_default_focus (gui, "entry_id");
- return widget;
+ return empathy_builder_unref_and_keep_widget (gui, widget);
}
GtkWidget *
-empathy_account_widget_jabber_new (McAccount *account)
+empathy_account_widget_jabber_new (EmpathyAccount *account)
{
- GladeXML *glade;
+ GtkBuilder *gui;
GtkWidget *widget;
GtkWidget *spinbutton_port;
GtkWidget *checkbutton_ssl;
+ gchar *filename;
- glade = empathy_glade_get_file ("empathy-account-widget-jabber.glade",
- "vbox_jabber_settings",
- NULL,
+ filename = empathy_file_lookup ("empathy-account-widget-jabber.ui",
+ "libempathy-gtk");
+ gui = empathy_builder_get_file (filename,
"vbox_jabber_settings", &widget,
"spinbutton_port", &spinbutton_port,
"checkbutton_ssl", &checkbutton_ssl,
NULL);
+ g_free (filename);
- empathy_account_widget_handle_params (account, glade,
+ empathy_account_widget_handle_params (account, gui,
"entry_id", "account",
"entry_password", "password",
"entry_resource", "resource",
"checkbutton_encryption", "require-encryption",
NULL);
- emapthy_account_widget_add_forget_button (account, glade,
+ empathy_account_widget_add_forget_button (account, gui,
"button_forget",
"entry_password");
+ empathy_account_widget_set_default_focus (gui, "entry_id");
+
g_signal_connect (checkbutton_ssl, "toggled",
G_CALLBACK (account_widget_jabber_ssl_toggled_cb),
spinbutton_port);
- g_object_unref (glade);
+ return empathy_builder_unref_and_keep_widget (gui, widget);
+}
+
+GtkWidget *
+empathy_account_widget_icq_new (EmpathyAccount *account)
+{
+ GtkBuilder *gui;
+ GtkWidget *widget;
+ GtkWidget *spinbutton_port;
+ gchar *filename;
+
+ filename = empathy_file_lookup ("empathy-account-widget-icq.ui",
+ "libempathy-gtk");
+ gui = empathy_builder_get_file (filename,
+ "vbox_icq_settings", &widget,
+ "spinbutton_port", &spinbutton_port,
+ NULL);
+ g_free (filename);
+
+ empathy_account_widget_handle_params (account, gui,
+ "entry_uin", "account",
+ "entry_password", "password",
+ "entry_server", "server",
+ "spinbutton_port", "port",
+ "entry_charset", "charset",
+ NULL);
+
+ empathy_account_widget_add_forget_button (account, gui,
+ "button_forget",
+ "entry_password");
+
+ empathy_account_widget_set_default_focus (gui, "entry_uin");
+
+ return empathy_builder_unref_and_keep_widget (gui, widget);
+}
+
+GtkWidget *
+empathy_account_widget_aim_new (EmpathyAccount *account)
+{
+ GtkBuilder *gui;
+ GtkWidget *widget;
+ GtkWidget *spinbutton_port;
+ gchar *filename;
+
+ filename = empathy_file_lookup ("empathy-account-widget-aim.ui",
+ "libempathy-gtk");
+ gui = empathy_builder_get_file (filename,
+ "vbox_aim_settings", &widget,
+ "spinbutton_port", &spinbutton_port,
+ NULL);
+ g_free (filename);
+
+ empathy_account_widget_handle_params (account, gui,
+ "entry_screenname", "account",
+ "entry_password", "password",
+ "entry_server", "server",
+ "spinbutton_port", "port",
+ NULL);
+
+ empathy_account_widget_add_forget_button (account, gui,
+ "button_forget",
+ "entry_password");
+
+ empathy_account_widget_set_default_focus (gui, "entry_screenname");
+
+ return empathy_builder_unref_and_keep_widget (gui, widget);
+}
+
+GtkWidget *
+empathy_account_widget_yahoo_new (EmpathyAccount *account)
+{
+ GtkBuilder *gui;
+ GtkWidget *widget;
+ gchar *filename;
+
+ filename = empathy_file_lookup ("empathy-account-widget-yahoo.ui",
+ "libempathy-gtk");
+ gui = empathy_builder_get_file (filename,
+ "vbox_yahoo_settings", &widget,
+ NULL);
+ g_free (filename);
+
+ empathy_account_widget_handle_params (account, gui,
+ "entry_id", "account",
+ "entry_password", "password",
+ "entry_server", "server",
+ "entry_locale", "room-list-locale",
+ "entry_charset", "charset",
+ "spinbutton_port", "port",
+ "checkbutton_yahoojp", "yahoojp",
+ "checkbutton_ignore_invites", "ignore-invites",
+ NULL);
+
+ empathy_account_widget_add_forget_button (account, gui,
+ "button_forget",
+ "entry_password");
+
+ empathy_account_widget_set_default_focus (gui, "entry_id");
+
+ return empathy_builder_unref_and_keep_widget (gui, widget);
+}
+
+GtkWidget *
+empathy_account_widget_groupwise_new (EmpathyAccount *account)
+{
+ GtkBuilder *gui;
+ GtkWidget *widget;
+ gchar *filename;
+
+ filename = empathy_file_lookup ("empathy-account-widget-groupwise.ui",
+ "libempathy-gtk");
+ gui = empathy_builder_get_file (filename,
+ "vbox_groupwise_settings", &widget,
+ NULL);
+ g_free (filename);
+
+ empathy_account_widget_handle_params (account, gui,
+ "entry_id", "account",
+ "entry_password", "password",
+ "entry_server", "server",
+ "spinbutton_port", "port",
+ NULL);
+
+ empathy_account_widget_add_forget_button (account, gui,
+ "button_forget",
+ "entry_password");
- gtk_widget_show (widget);
+ empathy_account_widget_set_default_focus (gui, "entry_id");
- return widget;
+ return empathy_builder_unref_and_keep_widget (gui, widget);
}