aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-account-gui.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-11-13 12:40:07 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-11-13 12:40:07 +0800
commit9e4f25d532f59d85034cbef768bb941f748fb1f2 (patch)
treea255e1471c9723e60590d85c32f1f0ba4ce834f0 /mail/mail-account-gui.c
parent4dece891604244df7d9dea34b9f1e18efe27f09a (diff)
downloadgsoc2013-evolution-9e4f25d532f59d85034cbef768bb941f748fb1f2.tar.gz
gsoc2013-evolution-9e4f25d532f59d85034cbef768bb941f748fb1f2.tar.zst
gsoc2013-evolution-9e4f25d532f59d85034cbef768bb941f748fb1f2.zip
Added to cvs. Currently contains no configurable stuff, but maybe it will
2002-11-13 Not Zed <NotZed@Ximian.com> * GNOME_Evolution_Mail.server.in.in: Added to cvs. Currently contains no configurable stuff, but maybe it will one day. * Makefile.am (server_DATA): change oaf stuff to server stuff for bonobo activation. * mail-preferences.c (mail_preferences_apply): handle const entry text. * mail-composer-prefs.c (url_requested): Fixed typo. (mail_composer_prefs_construct): gnomepixmap->gtkimage. * mail-callbacks.c (configure_mail): destroy dialogue before dealing with response. (mail_generate_reply): Fix a typo. (popup_listener_cb): fix prototype. (tag_editor_response): Handle gtk dialog response. (flag_for_followup): Change gnome dialog to gtk dialog stuff. (tag_editor_destroy_cb): (tag_editor_cancel): (tag_editor_ok): Removed, handled in _response(). (filter_editor_response): renamed from _clicked, handle gtk dialogue signal. (filter_editor_destroy): Removed. (footer_info_new): gnome font api changes. (do_mail_print): port to gnome print 2. * mail-autofilter.c (mail_filter_delete_uri): message_dialog uses a specific button enum, not the stock ones. * mail-accounts.c (mail_accounts_tab_get_type): gobjectify. (account_delete_clicked): gdkdialogise. * mail-account-gui.c (mail_account_gui_setup): Hack around font metric determination code. * mail-account-editor.c (mail_account_editor_get_type): gobjectise. (mail_account_editor_new): "" * folder-info.c (evolution_folder_info_notify_ready): use pbclient interface. * folder-browser-factory.c (control_destroy_cb): fix a typo. (folder_browser_factory_new_control): More typos. * folder-browser.c (on_right_click): cast around const warning. (context_menu_position_func): fix for api change. * e-searching-tokenizer.c (e_searching_tokenizer_finalise): Changed from destroy since it only frees memory. (e_searching_tokenizer_get_type): glibify. * component-factory.c (request_quit): gtkdialogise. (send_receive_cb): " (create_component): gdk_pixbuf api. (component_factory_init): bonobo activation stuff. (warning_response): renamed from warning_clicked. (owner_set_cb): gtkdialogise. svn path=/trunk/; revision=18731
Diffstat (limited to 'mail/mail-account-gui.c')
-rw-r--r--mail/mail-account-gui.c98
1 files changed, 51 insertions, 47 deletions
diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c
index da01920567..935f95585a 100644
--- a/mail/mail-account-gui.c
+++ b/mail/mail-account-gui.c
@@ -103,7 +103,7 @@ get_focused_widget (GtkWidget *def, ...)
gboolean
mail_account_gui_identity_complete (MailAccountGui *gui, GtkWidget **incomplete)
{
- char *text;
+ const char *text;
text = gtk_entry_get_text (gui->full_name);
if (!text || !*text) {
@@ -151,7 +151,7 @@ service_complete (MailAccountGuiService *service, GHashTable *extra_config, GtkW
{
const CamelProvider *prov = service->provider;
GtkWidget *path;
- char *text;
+ const char *text;
if (!prov)
return TRUE;
@@ -221,7 +221,8 @@ mail_account_gui_auto_detect_extra_conf (MailAccountGui *gui)
GtkWidget *path;
CamelURL *url;
char *text;
-
+ const char *tmp;
+
if (!prov)
return;
@@ -258,9 +259,9 @@ mail_account_gui_auto_detect_extra_conf (MailAccountGui *gui)
}
if (path && CAMEL_PROVIDER_ALLOWS (prov, CAMEL_URL_PART_PATH)) {
- text = gtk_entry_get_text (service->path);
- if (text && *text)
- camel_url_set_path (url, text);
+ tmp = gtk_entry_get_text (service->path);
+ if (tmp && *tmp)
+ camel_url_set_path (url, tmp);
}
camel_provider_auto_detect (prov, url, &auto_detected, NULL);
@@ -344,7 +345,7 @@ mail_account_gui_transport_complete (MailAccountGui *gui, GtkWidget **incomplete
/* FIXME? */
if (gtk_toggle_button_get_active (gui->transport_needs_auth) &&
CAMEL_PROVIDER_ALLOWS (gui->transport.provider, CAMEL_URL_PART_USER)) {
- char *text = gtk_entry_get_text (gui->transport.username);
+ const char *text = gtk_entry_get_text (gui->transport.username);
if (!text || !*text) {
if (incomplete)
@@ -361,7 +362,7 @@ mail_account_gui_transport_complete (MailAccountGui *gui, GtkWidget **incomplete
gboolean
mail_account_gui_management_complete (MailAccountGui *gui, GtkWidget **incomplete)
{
- char *text;
+ const char *text;
text = gtk_entry_get_text (gui->account_name);
if (text && *text)
@@ -425,9 +426,9 @@ build_auth_menu (MailAccountGuiService *service, GList *all_authtypes,
}
g_object_set_data ((GObject *) item, "authtype", authtype);
- g_signal_connect (item, "activate", GTK_SIGNAL_FUNC (service_authtype_changed), service);
+ g_signal_connect (item, "activate", G_CALLBACK (service_authtype_changed), service);
- gtk_menu_append (GTK_MENU (menu), item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
gtk_widget_show (item);
}
@@ -713,7 +714,7 @@ setup_toggle (GtkWidget *widget, const char *depname, MailAccountGui *gui)
}
toggle = g_hash_table_lookup (gui->extra_config, depname);
- g_signal_connect (toggle, "toggled", GTK_SIGNAL_FUNC (toggle_sensitivity), widget);
+ g_signal_connect (toggle, "toggled", G_CALLBACK (toggle_sensitivity), widget);
toggle_sensitivity (toggle, widget);
}
@@ -1173,9 +1174,9 @@ construct_ssl_menu (MailAccountGuiService *service)
for (i = 0; i < num_ssl_options; i++) {
item = gtk_menu_item_new_with_label (_(ssl_options[i].label));
g_object_set_data ((GObject *) item, "use_ssl", ssl_options[i].value);
- g_signal_connect (item, "activate", GTK_SIGNAL_FUNC (ssl_option_activate), service);
+ g_signal_connect (item, "activate", G_CALLBACK (ssl_option_activate), service);
gtk_widget_show (item);
- gtk_menu_append (GTK_MENU (menu), item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
}
gtk_option_menu_remove_menu (service->use_ssl);
@@ -1221,16 +1222,16 @@ sig_fill_options (MailAccountGui *gui)
else
menu = gtk_menu_new ();
- gtk_menu_append (GTK_MENU (menu), gtk_menu_item_new_with_label (_("None")));
- gtk_menu_append (GTK_MENU (menu), gtk_menu_item_new_with_label (_("Autogenerated")));
- /* gtk_menu_append (GTK_MENU (menu), gtk_menu_item_new_with_label (_("Random"))); */
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), gtk_menu_item_new_with_label (_("None")));
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), gtk_menu_item_new_with_label (_("Autogenerated")));
+ /* gtk_menu_shell_append(GTK_MENU_SHELL(menu), gtk_menu_item_new_with_label (_("Random"))); */
for (l = mail_config_get_signature_list (); l; l = l->next) {
sig = l->data;
mi = gtk_menu_item_new_with_label (sig->name);
g_object_set_data ((GObject *) mi, "sig", sig);
gtk_widget_show (mi);
- gtk_menu_append (GTK_MENU (menu), mi);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
}
}
@@ -1243,7 +1244,7 @@ sig_changed (GtkWidget *w, MailAccountGui *gui)
active = gtk_menu_get_active (GTK_MENU (w));
index = g_list_index (GTK_MENU_SHELL (w)->children, active);
- gui->def_signature = (MailConfigSignature *) gtk_object_get_data (GTK_OBJECT (active), "sig");
+ gui->def_signature = (MailConfigSignature *) g_object_get_data(G_OBJECT(active), "sig");
gui->auto_signature = index == 1 ? TRUE : FALSE;
}
@@ -1290,7 +1291,7 @@ sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailAccoun
g_object_set_data ((GObject *) mi, "sig", sig);
gtk_widget_show (mi);
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu));
- gtk_menu_append (GTK_MENU (menu), mi);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
break;
}
@@ -1341,10 +1342,10 @@ prepare_signatures (MailAccountGui *gui)
gui->sig_option_menu = glade_xml_get_widget (gui->xml, "sigOption");
sig_fill_options (gui);
g_signal_connect (gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu)),
- "selection-done", sig_changed, gui);
+ "selection-done", G_CALLBACK(sig_changed), gui);
glade_xml_signal_connect_data (gui->xml, "sigAddNewClicked",
- GTK_SIGNAL_FUNC (sig_add_new_signature), gui);
+ G_CALLBACK (sig_add_new_signature), gui);
if (!gui->dialog) {
gtk_widget_hide (glade_xml_get_widget (gui->xml, "sigLabel"));
@@ -1365,7 +1366,7 @@ mail_account_gui_new (MailConfigAccount *account, MailAccountsTab *dialog)
gui = g_new0 (MailAccountGui, 1);
gui->account = account;
gui->dialog = dialog;
- gui->xml = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", NULL);
+ gui->xml = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", NULL, NULL);
/* Management */
gui->account_name = GTK_ENTRY (glade_xml_get_widget (gui->xml, "management_name"));
@@ -1403,13 +1404,13 @@ mail_account_gui_new (MailConfigAccount *account, MailAccountsTab *dialog)
gui->source.description = GTK_LABEL (glade_xml_get_widget (gui->xml, "source_description"));
gui->source.hostname = GTK_ENTRY (glade_xml_get_widget (gui->xml, "source_host"));
g_signal_connect (gui->source.hostname, "changed",
- GTK_SIGNAL_FUNC (service_changed), &gui->source);
+ G_CALLBACK (service_changed), &gui->source);
gui->source.username = GTK_ENTRY (glade_xml_get_widget (gui->xml, "source_user"));
g_signal_connect (gui->source.username, "changed",
- GTK_SIGNAL_FUNC (service_changed), &gui->source);
+ G_CALLBACK (service_changed), &gui->source);
gui->source.path = GTK_ENTRY (glade_xml_get_widget (gui->xml, "source_path"));
g_signal_connect (gui->source.path, "changed",
- GTK_SIGNAL_FUNC (service_changed), &gui->source);
+ G_CALLBACK (service_changed), &gui->source);
gui->source.ssl_hbox = glade_xml_get_widget (gui->xml, "source_ssl_hbox");
gui->source.use_ssl = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "source_use_ssl"));
construct_ssl_menu (&gui->source);
@@ -1418,7 +1419,7 @@ mail_account_gui_new (MailConfigAccount *account, MailAccountsTab *dialog)
gui->source.remember = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "source_remember_password"));
gui->source.check_supported = GTK_BUTTON (glade_xml_get_widget (gui->xml, "source_check_supported"));
g_signal_connect (gui->source.check_supported, "clicked",
- GTK_SIGNAL_FUNC (service_check_supported), &gui->source);
+ G_CALLBACK (service_check_supported), &gui->source);
gui->source_auto_check = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "extra_auto_check"));
gui->source_auto_check_min = GTK_SPIN_BUTTON (glade_xml_get_widget (gui->xml, "extra_auto_check_min"));
@@ -1428,27 +1429,27 @@ mail_account_gui_new (MailConfigAccount *account, MailAccountsTab *dialog)
gui->transport.description = GTK_LABEL (glade_xml_get_widget (gui->xml, "transport_description"));
gui->transport.hostname = GTK_ENTRY (glade_xml_get_widget (gui->xml, "transport_host"));
g_signal_connect (gui->transport.hostname, "changed",
- GTK_SIGNAL_FUNC (service_changed), &gui->transport);
+ G_CALLBACK (service_changed), &gui->transport);
gui->transport.username = GTK_ENTRY (glade_xml_get_widget (gui->xml, "transport_user"));
g_signal_connect (gui->transport.username, "changed",
- GTK_SIGNAL_FUNC (service_changed), &gui->transport);
+ G_CALLBACK (service_changed), &gui->transport);
gui->transport.ssl_hbox = glade_xml_get_widget (gui->xml, "transport_ssl_hbox");
gui->transport.use_ssl = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "transport_use_ssl"));
construct_ssl_menu (&gui->transport);
gui->transport.no_ssl = glade_xml_get_widget (gui->xml, "transport_ssl_disabled");
gui->transport_needs_auth = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "transport_needs_auth"));
g_signal_connect (gui->transport_needs_auth, "toggled",
- GTK_SIGNAL_FUNC (transport_needs_auth_toggled), gui);
+ G_CALLBACK (transport_needs_auth_toggled), gui);
gui->transport.authtype = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "transport_auth_omenu"));
gui->transport.remember = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "transport_remember_password"));
gui->transport.check_supported = GTK_BUTTON (glade_xml_get_widget (gui->xml, "transport_check_supported"));
g_signal_connect (gui->transport.check_supported, "clicked",
- GTK_SIGNAL_FUNC (service_check_supported), &gui->transport);
+ G_CALLBACK (service_check_supported), &gui->transport);
/* Drafts folder */
gui->drafts_folder_button = GTK_BUTTON (glade_xml_get_widget (gui->xml, "drafts_button"));
g_signal_connect (gui->drafts_folder_button, "selected",
- GTK_SIGNAL_FUNC (folder_selected), &gui->drafts_folder_uri);
+ G_CALLBACK (folder_selected), &gui->drafts_folder_uri);
if (account->drafts_folder_uri)
gui->drafts_folder_uri = g_strdup (account->drafts_folder_uri);
else
@@ -1462,7 +1463,7 @@ mail_account_gui_new (MailConfigAccount *account, MailAccountsTab *dialog)
/* Sent folder */
gui->sent_folder_button = GTK_BUTTON (glade_xml_get_widget (gui->xml, "sent_button"));
g_signal_connect (gui->sent_folder_button, "selected",
- GTK_SIGNAL_FUNC (folder_selected), &gui->sent_folder_uri);
+ G_CALLBACK (folder_selected), &gui->sent_folder_uri);
if (account->sent_folder_uri)
gui->sent_folder_uri = g_strdup (account->sent_folder_uri);
else
@@ -1475,7 +1476,7 @@ mail_account_gui_new (MailConfigAccount *account, MailAccountsTab *dialog)
/* Special Folders "Reset Defaults" button */
button = glade_xml_get_widget (gui->xml, "default_folders_button");
- g_signal_connect (button, "clicked", GTK_SIGNAL_FUNC (default_folders_clicked), gui);
+ g_signal_connect (button, "clicked", G_CALLBACK (default_folders_clicked), gui);
/* Always Cc */
gui->always_cc = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "always_cc"));
@@ -1566,9 +1567,9 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
g_object_set_data ((GObject *) gui->source.type, provider->protocol, item);
g_object_set_data ((GObject *) item, "provider", provider);
g_object_set_data ((GObject *) item, "number", GUINT_TO_POINTER (si));
- g_signal_connect (item, "activate", GTK_SIGNAL_FUNC (source_type_changed), gui);
+ g_signal_connect (item, "activate", G_CALLBACK (source_type_changed), gui);
- gtk_menu_append (GTK_MENU (stores), item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(stores), item);
gtk_widget_show (item);
@@ -1590,9 +1591,9 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
g_object_set_data ((GObject *) gui->transport.type, provider->protocol, item);
g_object_set_data ((GObject *) item, "provider", provider);
g_object_set_data ((GObject *) item, "number", GUINT_TO_POINTER (ti));
- g_signal_connect (item, "activate", GTK_SIGNAL_FUNC (transport_type_changed), gui);
+ g_signal_connect (item, "activate", G_CALLBACK (transport_type_changed), gui);
- gtk_menu_append (GTK_MENU (transports), item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(transports), item);
gtk_widget_show (item);
@@ -1613,7 +1614,7 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
}
if (item && provider->authtypes) {
- GdkFont *font = GTK_WIDGET (item)->style->font;
+ /*GdkFont *font = GTK_WIDGET (item)->style->font;*/
CamelServiceAuthType *at;
int width;
GList *a;
@@ -1621,7 +1622,10 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
for (a = provider->authtypes; a; a = a->next) {
at = a->data;
- width = gdk_string_width (font, at->name);
+ /* Just using string length is probably good enough,
+ as we only use the width of the widget, not the string */
+ /*width = gdk_string_width (font, at->name);*/
+ width = strlen(at->name) * 14;
if (width > max_width) {
max_authname = at->name;
max_width = width;
@@ -1634,9 +1638,9 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
/* add a "None" option to the stores menu */
item = gtk_menu_item_new_with_label (_("None"));
g_object_set_data ((GObject *) item, "provider", NULL);
- g_signal_connect (item, "activate", GTK_SIGNAL_FUNC (source_type_changed), gui);
+ g_signal_connect (item, "activate", G_CALLBACK (source_type_changed), gui);
- gtk_menu_append (GTK_MENU (stores), item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(stores), item);
gtk_widget_show (item);
@@ -1659,16 +1663,16 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
menu = gtk_menu_new ();
item = gtk_menu_item_new_with_label (max_authname);
- gtk_menu_append (GTK_MENU (menu), item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
gtk_widget_show_all (menu);
gtk_option_menu_set_menu (gui->source.authtype, menu);
gtk_widget_show (GTK_WIDGET (gui->source.authtype));
gtk_widget_size_request (GTK_WIDGET (gui->source.authtype),
&size_req);
- gtk_widget_set_usize (GTK_WIDGET (gui->source.authtype),
+ gtk_widget_set_size_request (GTK_WIDGET (gui->source.authtype),
size_req.width, -1);
- gtk_widget_set_usize (GTK_WIDGET (gui->transport.authtype),
+ gtk_widget_set_size_request (GTK_WIDGET (gui->transport.authtype),
size_req.width, -1);
}
@@ -1710,7 +1714,7 @@ save_service (MailAccountGuiService *gsvc, GHashTable *extra_config,
MailConfigService *service)
{
CamelURL *url;
- char *str;
+ const char *str;
if (!gsvc->provider) {
g_free (service->url);
@@ -1731,7 +1735,7 @@ save_service (MailAccountGuiService *gsvc, GHashTable *extra_config,
GTK_WIDGET_IS_SENSITIVE (gsvc->authtype) && gsvc->authitem && url->user) {
CamelServiceAuthType *authtype;
- authtype = gtk_object_get_data (GTK_OBJECT (gsvc->authitem), "authtype");
+ authtype = g_object_get_data(G_OBJECT(gsvc->authitem), "authtype");
if (authtype && authtype->authproto && *authtype->authproto)
url->authmech = g_strdup (authtype->authproto);
@@ -1761,7 +1765,7 @@ save_service (MailAccountGuiService *gsvc, GHashTable *extra_config,
if (gsvc->provider->flags & CAMEL_PROVIDER_SUPPORTS_SSL) {
const char *use_ssl;
- use_ssl = gtk_object_get_data (GTK_OBJECT (gsvc->ssl_selected), "use_ssl");
+ use_ssl = g_object_get_data(G_OBJECT(gsvc->ssl_selected), "use_ssl");
/* set the value to either "always" or "when-possible"
but don't bother setting it for "never" */