diff options
79 files changed, 5689 insertions, 5097 deletions
diff --git a/Makefile.am b/Makefile.am index 3f0d4b87b..5f03746f2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,13 +1,9 @@ -SUBDIRS = tools extensions po data libempathy libempathy-gtk src help +SUBDIRS = tools extensions po data libempathy libempathy-gtk src help tests if HAVE_NST SUBDIRS += nautilus-sendto-plugin endif -if HAVE_TESTS -SUBDIRS += tests -endif - ACLOCAL_AMFLAGS = -I m4 DISTCHECK_CONFIGURE_FLAGS = \ diff --git a/configure.ac b/configure.ac index 67b2d2e4f..df9b16cc7 100644 --- a/configure.ac +++ b/configure.ac @@ -32,8 +32,7 @@ AC_COPYRIGHT([ GLIB_REQUIRED=2.22.0 GTK_REQUIRED=2.16.0 GCONF_REQUIRED=1.2.0 -LIBPANELAPPLET_REQUIRED=2.10.0 -TELEPATHY_GLIB_REQUIRED=0.7.35 +TELEPATHY_GLIB_REQUIRED=0.9.0 ENCHANT_REQUIRED=1.2.0 ISO_CODES_REQUIRED=0.35 LIBNOTIFY_REQUIRED=0.4.4 @@ -422,29 +421,6 @@ fi AM_CONDITIONAL(HAVE_NST, test "x$have_nst" = "xyes") # ----------------------------------------------------------- -# Tests -# ----------------------------------------------------------- -AC_ARG_ENABLE(tests, - AS_HELP_STRING([--enable-tests=@<:@no/yes/auto@:>@], - [build tests]), , - enable_tests=auto) - -if test "x$enable_tests" != "xno"; then - PKG_CHECK_MODULES(CHECK, - [ - check >= 0.9.4 - ], have_check="yes", have_check="no") -else - have_check=no -fi - -if test "x$enable_tests" = "xyes" -a "x$have_check" != "xyes"; then - AC_MSG_ERROR([Couldn't find check dependencies.]) -fi - -AM_CONDITIONAL(HAVE_TESTS, test "x$have_check" = "xyes") - -# ----------------------------------------------------------- # Coding style checks # ----------------------------------------------------------- AC_ARG_ENABLE(coding-style-checks, @@ -484,7 +460,6 @@ Configure summary: Compiler Flags..............: ${CFLAGS} ${ERROR_CFLAGS} Prefix......................: ${prefix} Shaved build................: ${enable_shave} - Tests.......................: ${have_check} Coding style checks.........: ${ENABLE_CODING_STYLE_CHECKS} Features: diff --git a/help/it/figures/empathy-main-window.png b/help/it/figures/empathy-main-window.png Binary files differindex 2b254943e..0752030eb 100644 --- a/help/it/figures/empathy-main-window.png +++ b/help/it/figures/empathy-main-window.png diff --git a/help/it/it.po b/help/it/it.po index edf9a4013..54a145452 100644 --- a/help/it/it.po +++ b/help/it/it.po @@ -1,1389 +1,4316 @@ # Italian translation of empathy documentation. # Copyright (C) 2008, 2009 Free Software Foundation, Inc. # This package is distributed under the same license as the empathy package. -# Milo Casagrande <milo@ubuntu.com>, 2008, 2009 # +# Milo Casagrande <milo@ubuntu.com>, 2008, 2009. msgid "" msgstr "" "Project-Id-Version: empathy manual\n" -"POT-Creation-Date: 2009-03-10 20:31+0000\n" -"PO-Revision-Date: 2009-03-10 21:34+0100\n" +"POT-Creation-Date: 2009-09-24 18:22+0000\n" +"PO-Revision-Date: 2009-11-01 21:21+0100\n" "Last-Translator: Milo Casagrande <milo@ubuntu.com>\n" "Language-Team: Italian <tp@lists.linux.it>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Report-Msgid-Bugs-To: \n" -#. When image changes, this message will be marked fuzzy or untranslated for you. -#. It doesn't matter what you translate it to: it's not used at all. -#: C/empathy.xml:238(None) +#: C/legal.xml:3(p) msgid "" -"@@image: 'figures/empathy-main-window.png'; " -"md5=38259a866f38ff1f754828e46d2b0e5c" -msgstr "fatto" +"This work is licensed under a <link href=\"http://creativecommons.org/" +"licenses/by-sa/3.0/\">Creative Commons Attribution-Share Alike 3.0 Unported " +"License</link>." +msgstr "" +"Questo lavoro è disponibile nei termini della licenza <link href=\"http://" +"creativecommons.org/licenses/by-sa/3.0/\">Creative Commons Attribution-Share " +"Alike 3.0 Unported</link>." + +#: C/legal.xml:6(p) +msgid "" +"As a special exception, the copyright holders give you permission to copy, " +"modify, and distribute the example code contained in this document under the " +"terms of your choosing, without restriction." +msgstr "" +"Come speciale eccezione, i detentori del copyright concedono di copiare, " +"modificare e distribuire il codice sorgente di esempio contenuto in questo " +"documento nei termini di propria scelta, senza restrizione alcuna." -#: C/empathy.xml:27(title) -msgid "<application>Empathy</application> Manual V2.1" -msgstr "Manuale V2.1 di <application>Empathy</application>" - -#: C/empathy.xml:30(year) -msgid "2008, 2009" -msgstr "2008, 2009" - -#: C/empathy.xml:31(holder) C/empathy.xml:37(publishername) -#: C/empathy.xml:48(orgname) C/empathy.xml:56(orgname) C/empathy.xml:87(para) -#: C/empathy.xml:101(para) -msgid "Ubuntu Documentation Project" -msgstr "Ubuntu Documentation Project" - -#: C/empathy.xml:2(para) -msgid "" -"Permission is granted to copy, distribute and/or modify this document under " -"the terms of the GNU Free Documentation License (GFDL), Version 1.1 or any " -"later version published by the Free Software Foundation with no Invariant " -"Sections, no Front-Cover Texts, and no Back-Cover Texts. You can find a copy " -"of the GFDL at this <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or " -"in the file COPYING-DOCS distributed with this manual." -msgstr "" -"Questo documento può essere copiato, distribuito o modificato solo in " -"conformità con i termini della GNU Free Documentation License (GFDL) " -"Versione 1.1 o delle versioni successive pubblicate dalla Free Software " -"Foundation senza sezioni invariabili, frontespizi e testi di copertina. Una " -"copia della GFDL è disponibile su questo <ulink type=\"help\" url=\"ghelp:fdl" -"\">collegamento</ulink> o nel file COPYING-DOCS distribuito con questo " -"manuale." - -#: C/empathy.xml:12(para) -msgid "" -"This manual is part of a collection of GNOME manuals distributed under the " -"GFDL. If you want to distribute this manual separately from the collection, " -"you can do so by adding a copy of the license to the manual, as described in " -"section 6 of the license." -msgstr "" -"Questo manuale fa parte di una raccolta di manuali GNOME distribuita in " -"conformità con la GFDL. Per poter distribuire questo manuale separatamente, " -"è necessario inserirvi una copia della licenza, come descritto nella sezione " -"6 della licenza." - -#: C/empathy.xml:19(para) -msgid "" -"Many of the names used by companies to distinguish their products and " -"services are claimed as trademarks. Where those names appear in any GNOME " -"documentation, and the members of the GNOME Documentation Project are made " -"aware of those trademarks, then the names are in capital letters or initial " -"capital letters." -msgstr "" -"Molti dei nomi usati dalle aziende per distinguere i propri prodotti e " -"servizi sono rivendicati come marchi. Quando questi nomi compaiono nella " -"documentazione di GNOME, e i partecipanti al GNOME Documentation Project " -"sono consapevoli del loro utilizzo, essi vengono scritti in lettere " -"maiuscole o con l'iniziale maiuscola." - -#: C/empathy.xml:35(para) -msgid "" -"DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, " -"EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT " -"THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS " -"MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE " -"RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR " -"MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR " -"MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL " -"WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY " -"SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN " -"ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION " -"OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" -msgstr "" -"IL DOCUMENTO VIENE FORNITO SENZA GARANZIE DI ALCUN TIPO, ESPLICITE O " -"IMPLICITE, INCLUSE, MA SENZA LIMITAZIONE, LE GARANZIE ATTESTANTI CHE IL " -"DOCUMENTO O LE SUE VERSIONI MODIFICATE SIANO PRIVI DI DIFETTI, " -"COMMERCIALIZZABILI, IDONEI A UN DETERMINATO SCOPO O CHE NON VIOLINO DIRITTI " -"DI TERZI. SI DECLINA QUALUNQUE RESPONSABILITÀ RIGUARDO AI RISCHI INERENTI LA " -"QUALITÀ, L'ACCURATEZZA E LE PRESTAZIONI DEL DOCUMENTO O DI UNA SUA VERSIONE " -"MODIFICATA. QUALORA UN DOCUMENTO O UNA SUA VERSIONE MODIFICATA DOVESSERO " -"PRESENTARE QUALUNQUE TIPO DI DIFETTO, IL COSTO DI EVENTUALI INTERVENTI DI " -"ASSISTENZA, RIPARAZIONE O CORREZIONE SARÀ A CARICO DELL'UTENTE (NON DEL " -"REDATTORE INIZIALE, DELL'AUTORE O DI ALTRI COLLABORATORI). QUESTA " -"LIMITAZIONE DELLA GARANZIA COSTITUISCE PARTE ESSENZIALE DELLA LICENZA. L'USO " -"DEL DOCUMENTO O DELLE SUE VERSIONI MODIFICATE È CONSENTITO SOLO ENTRO I " -"TERMINI DI QUESTA LIMITAZIONE DELLA GARANZIA;" - -#: C/empathy.xml:55(para) -msgid "" -"UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING " -"NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY " -"CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE " -"DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON " -"FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF " -"ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, " -"WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES " -"OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED " -"VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE " -"POSSIBILITY OF SUCH DAMAGES." -msgstr "" -"IN NESSUNA CIRCOSTANZA E PER NESSUNA RAGIONE LEGALE, INCLUSI I PRINCIPI DI " -"COLPA (INCLUSA LA NEGLIGENZA), ACCORDO CONTRATTUALE O ALTRO, SARÀ POSSIBILE " -"CONSIDERARE L'AUTORE, IL REDATTORE INIZIALE, GLI ALTRI COLLABORATORI, " -"QUALUNQUE DISTRIBUTORE DEL DOCUMENTO O DI UNA SUA VERSIONE MODIFICATA O " -"QUALUNQUE FORNITORE DELLE PERSONE CITATE, RESPONSABILE NEI CONFRONTI DI " -"QUALUNQUE PERSONA PER DANNI DIRETTI, INDIRETTI, SPECIALI, INCIDENTALI O " -"CONSEGUENTI DI QUALUNQUE NATURA, INCLUSI, MA SENZA LIMITAZIONE, I DANNI PER " -"PERDITA DI AVVIAMENTO, INTERRUZIONE DEL LAVORO, GUASTO O MALFUNZIONAMENTO " -"DEL COMPUTER O QUALUNQUE ALTRO DANNO O PERDITA DERIVANTE O CORRELATA ALL'USO " -"DEL DOCUMENTO O DI UNA SUA VERSIONE MODIFICATA, ANCHE QUALORA LE PERSONE " -"CITATE FOSSERO STATE INFORMATE DELLA POSSIBILITÀ DI TALI DANNI." - -#: C/empathy.xml:28(para) -msgid "" -"DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS " -"OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: " -"<placeholder-1/>" -msgstr "" -"QUESTO DOCUMENTO E LE SUE VERSIONI MODIFICATE VENGONO FORNITI IN BASE AI " -"TERMINI DELLA GNU FREE DOCUMENTATION LICENSE, CON L'INTESA CHE: <placeholder-" -"1/>" - -#: C/empathy.xml:45(firstname) -msgid "Milo" -msgstr "Milo" - -#: C/empathy.xml:46(surname) -msgid "Casagrande" -msgstr "Casagrande" - -#: C/empathy.xml:49(email) +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/video-call.page:41(None) C/video-call.page:57(None) +#: C/audio-video.page:66(None) C/audio-call.page:59(None) +#| msgid "" +#| "@@image: 'figures/empathy-main-window.png'; " +#| "md5=38259a866f38ff1f754828e46d2b0e5c" +msgid "@@image: 'figures/camera-web.png'; md5=8166b4372f25b78cbf5a64fe2eac2ce5" +msgstr "non serve" + +#: C/video-call.page:10(desc) +msgid "Start a video conversation with one of your contacts." +msgstr "Avviare una conversazione video con i propri contatti." + +#: C/video-call.page:20(name) C/status-icons.page:16(name) +#: C/share-desktop.page:13(name) C/set-custom-status.page:19(name) +#: C/send-file.page:21(name) C/salut-protocol.page:18(name) +#: C/remove-account.page:17(name) C/prob-conn-neterror.page:17(name) +#: C/prob-conn-name.page:16(name) C/prob-conn-auth.page:20(name) +#: C/prob-conn-acctdisabled.page:18(name) C/prev-conv.page:16(name) +#: C/offline-contacts.page:17(name) C/irc-start-conversation.page:15(name) +#: C/irc-send-file.page:16(name) C/irc-nick-password.page:18(name) +#: C/irc-manage.page:17(name) C/irc-join-room.page:16(name) +#: C/irc-join-pwd.page:16(name) C/introduction.page:13(name) +#: C/index.page:15(name) C/import-account.page:23(name) +#: C/group-conversations.page:19(name) C/geolocation-what-is.page:18(name) +#: C/geolocation-turn.page:18(name) C/geolocation-supported.page:16(name) +#: C/geolocation-privacy.page:17(name) C/geolocation-not-showing.page:17(name) +#: C/geolocation.page:17(name) C/favorite-rooms.page:13(name) +#: C/disable-account.page:19(name) C/create-account.page:17(name) +#: C/audio-video.page:16(name) C/audio-call.page:17(name) +#: C/add-account.page:18(name) +#| msgid "Casagrande" +msgid "Milo Casagrande" +msgstr "Milo Casagrande" + +#: C/video-call.page:21(email) C/status-icons.page:17(email) +#: C/share-desktop.page:14(email) C/set-custom-status.page:20(email) +#: C/send-file.page:22(email) C/salut-protocol.page:19(email) +#: C/remove-account.page:18(email) C/prob-conn-neterror.page:18(email) +#: C/prob-conn-name.page:17(email) C/prob-conn-auth.page:21(email) +#: C/prob-conn-acctdisabled.page:19(email) C/prev-conv.page:17(email) +#: C/offline-contacts.page:18(email) C/irc-start-conversation.page:16(email) +#: C/irc-send-file.page:17(email) C/irc-nick-password.page:19(email) +#: C/irc-manage.page:18(email) C/irc-join-room.page:17(email) +#: C/irc-join-pwd.page:17(email) C/introduction.page:14(email) +#: C/index.page:16(email) C/import-account.page:24(email) +#: C/group-conversations.page:20(email) C/geolocation-what-is.page:19(email) +#: C/geolocation-turn.page:19(email) C/geolocation-supported.page:17(email) +#: C/geolocation-privacy.page:18(email) +#: C/geolocation-not-showing.page:18(email) C/geolocation.page:18(email) +#: C/favorite-rooms.page:14(email) C/disable-account.page:20(email) +#: C/create-account.page:18(email) C/audio-video.page:17(email) +#: C/audio-call.page:18(email) C/add-account.page:19(email) msgid "milo@ubuntu.com" msgstr "milo@ubuntu.com" -#: C/empathy.xml:53(firstname) -msgid "Seth" -msgstr "Seth" +#: C/video-call.page:31(title) +msgid "Start a video conversation" +msgstr "Avviare una conversazione video" -#: C/empathy.xml:54(surname) -msgid "Dudenhofer" -msgstr "Dudenhofer" +#: C/video-call.page:33(p) +msgid "" +"If you have a webcam, you can call your contacts and have an video " +"conversation with them. This features only works with certain types of " +"accounts, and it requires the other person to have an application that " +"supports video calls." +msgstr "" +"Se si dispone di una webcam, è possibile chiamare i propri contatti e tenere " +"una videoconferenza con loro. Questa funzionalità è disponibile solamente " +"con l'utilizzo di alcuni tipi di account e richiede che i propri contatti " +"dispongano di un programma che supporti le conversazioni video." -#: C/empathy.xml:57(email) -msgid "sdudenhofer@gmail.com" -msgstr "sdudenhofer@gmail.com" +#: C/video-call.page:40(p) +msgid "" +"From the <gui>Contact List</gui> window, click the <media type=\"image\" " +"mime=\"image/png\" src=\"figures/camera-web.png\">video call</media> icon " +"next to the name of the contact you wish to call. Alternatively, right click " +"the contact and choose <gui>Video Call</gui>." +msgstr "" +"Dalla finestra <gui>Elenco contatti</gui>, fare clic sull'icona <media type=" +"\"image\" mime=\"image/png\" src=\"figures/camera-web.png\">della chiamata " +"video</media> a fianco del nome del contatto da chiamare. In alternativa, " +"fare clic col pulsante destro del mouse sul contatto e scegliere " +"<gui>Chiamata video</gui>." -#: C/empathy.xml:81(revnumber) -msgid "Empathy Manual V2.1" -msgstr "Manuale V2.1 di Empathy" +#: C/video-call.page:46(p) C/audio-call.page:48(p) +msgid "" +"A new window will open. When the connection is established, you will see " +"<gui>Connected</gui> at the bottom of the window, along with the total " +"conversation time." +msgstr "" +"Viene aperta una nuova finestra. Quando la connessione è stata stabilita, " +"viene visualizzato, in basso nella finestra, il messaggio <gui>Connessi</" +"gui> assieme al tempo tascorso della conversazione." + +#: C/video-call.page:51(p) C/audio-call.page:53(p) +msgid "" +"To end the conversation, choose <guiseq><gui>Call</gui><gui>Hang up</gui></" +"guiseq>." +msgstr "" +"Per terminare la conversazione, scegliere <guiseq><gui>Chiamata</" +"gui><gui>Chiudi</gui></guiseq>." + +#: C/video-call.page:55(p) +msgid "" +"To turn a video conversation into an adio conversation, choose " +"<guiseq><gui>Call</gui><gui>Send video</gui></guiseq>, or click the <media " +"type=\"image\" mime=\"image/png\" src=\"figures/camera-web.png\">video call</" +"media> toolbar button to deselect it." +msgstr "" +"Per convertire una conversazione video in una conversazione audio, scegliere " +"<guiseq><gui>Chiamata</gui><gui>Invia video</gui></guiseq> oppure fare clic " +"sul pulsante <media type=\"image\" mime=\"image/png\" src=\"figures/camera-" +"web.png\">della chiamata video</media> nella barra degli strumenti." -#: C/empathy.xml:82(date) -msgid "January 2009" -msgstr "Gennaio 2009" +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/status-icons.page:36(None) +msgid "@@image: 'figures/available.png'; md5=1952a8952efbe87e84b21e09e0587e71" +msgstr "non serve" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/status-icons.page:42(None) +msgid "@@image: 'figures/busy.png'; md5=6cab57171fb6d732a85ace48f11cf207" +msgstr "non serve" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/status-icons.page:50(None) +msgid "@@image: 'figures/away.png'; md5=9a93ccca527af39cbe11db5c9d915ca0" +msgstr "non serve" -#: C/empathy.xml:84(para) C/empathy.xml:95(para) -msgid "Milo Casagrande <email>milo@ubuntu.com</email>" -msgstr "Milo Casagrande <email>milo@ubuntu.com</email>" +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/status-icons.page:59(None) C/status-icons.page:66(None) +msgid "@@image: 'figures/offline.png'; md5=565ba82fbedd22e4eb5b810750199527" +msgstr "non serve" + +#: C/status-icons.page:7(desc) +msgid "Understanding the various statuses and status icons." +msgstr "Comprendere i vari stati e le icone di stato." + +#: C/status-icons.page:20(name) C/salut-protocol.page:33(cite) +#: C/prev-conv.page:20(name) C/prev-conv.page:35(cite) +#: C/import-account.page:27(name) C/disable-account.page:23(name) +#: C/audio-video.page:105(cite) C/audio-video.page:113(cite) +#: C/audio-call.page:36(cite) C/add-account.page:22(name) +#: C/accounts-window.page:18(name) C/account-jabber.page:13(name) +#: C/account-irc.page:13(name) +msgid "Shaun McCance" +msgstr "Shaun McCance" + +#: C/status-icons.page:21(email) C/prev-conv.page:21(email) +#: C/import-account.page:28(email) C/disable-account.page:24(email) +#: C/add-account.page:23(email) C/accounts-window.page:19(email) +#: C/account-jabber.page:14(email) C/account-irc.page:14(email) +msgid "shaunm@gnome.org" +msgstr "shaunm@gnome.org" + +#: C/status-icons.page:32(title) +msgid "Status Types and Icons" +msgstr "Tipologie e icone di stato" + +#: C/status-icons.page:36(media) +msgid "Available icon" +msgstr "Icona Disponibile" + +#: C/status-icons.page:37(gui) +msgid "Available" +msgstr "Disponibile" + +#: C/status-icons.page:38(p) +msgid "" +"Use the <em>Available</em> status when you are at your computer and able to " +"chat with your contacts. You can set a custom message for this status." +msgstr "" +"Usare lo stato <em>Disponibile</em> quando si è al computer e disponibili ad " +"avere conversazioni con i propri contatti. Per questo stato è possibile " +"impostare un messaggio personalizzato." -#: C/empathy.xml:92(revnumber) -msgid "Empathy Manual V2.0" -msgstr "Manuale V2.0 di Empathy" +#: C/status-icons.page:42(media) +msgid "Busy icon" +msgstr "Icona Non disponibile" -#: C/empathy.xml:93(date) -msgid "April 2008" -msgstr "Aprile 2008" +#: C/status-icons.page:43(gui) +msgid "Busy" +msgstr "Non disponibile" -#: C/empathy.xml:98(para) -msgid "Seth Dudenhofer <email>sdudenhofer@gmail.com</email>" -msgstr "Seth Dudenhofer <email>sdudenhofer@gmail.com</email>" +#: C/status-icons.page:44(p) +msgid "" +"Use the <em>Busy</em> status to let your contacts know that you don’t want " +"to chat right now. They can still contact you, for instance if they have " +"something urgent they need to discuss. By default, <app>Empathy</app> will " +"not use notification bubbles and sounds when you are busy. You can set a " +"custom message for this status." +msgstr "" +"Usare lo stato <em>Non disponibile</em> per far sapere ai propri contatti " +"che non si vuole essere disturbati, a meno di comunicazioni urgenti. Come " +"impostazione predefinita, <app>Empathy</app> non utilizza le notifiche " +"visive e sonore. Per questo stato è possibile impostare un messaggio " +"personalizzato." -#: C/empathy.xml:106(releaseinfo) -msgid "This manual describes version 2.26 of Empathy." -msgstr "Questo manuale descrive la versione 2.26 di Empathy." +#: C/status-icons.page:50(media) +msgid "Away icon" +msgstr "Icona Assente" -#: C/empathy.xml:110(title) -msgid "Feedback" -msgstr "Commenti" +#: C/status-icons.page:51(gui) +msgid "Away" +msgstr "Assente" -#: C/empathy.xml:111(para) +#: C/status-icons.page:52(p) msgid "" -"To report a bug or make a suggestion regarding the <application>Empathy</" -"application> application or this manual, follow the directions in the <ulink " -"url=\"ghelp:gnome-feedback\" type=\"help\">GNOME Feedback Page</ulink>." +"Use the <em>Away</em> status when you are going away from your computer. " +"<app>Empathy</app> automatically sets your status to Away if you do not use " +"your computer for a while, or if your screensaver is on. By default, " +"<app>Empathy</app> will not use notification bubbles and sounds when you are " +"away. You can set a custom message for this status." msgstr "" -"Per segnalare un problema o inviare suggerimenti riguardo " -"<application>Empathy</application> o su questo manuale, seguire le " -"istruzioni presenti alla <ulink url=\"ghelp:gnome-feedback\" type=\"help" -"\">pagina di commenti di GNOME</ulink>." +"Usare lo stato <em>Assente</em> quando ci sia allontana dal computer. " +"<app>Empathy</app> utilizza automaticamente questo stato nel caso in cui non " +"si utilizzi il computer per un po' di tempo o se viene attivato il " +"salvaschermo. Come impostazione predefinita, <app>Empathy</app> non utilizza " +"le notifiche visive e sonore. Per questo stato è possibile impostare un " +"messaggio personalizzato." + +#: C/status-icons.page:59(media) C/status-icons.page:66(media) +msgid "Offline icon" +msgstr "Icona Fuori rete" + +#: C/status-icons.page:60(gui) +msgid "Hidden" +msgstr "Non visibile" + +#: C/status-icons.page:61(p) +msgid "" +"When you set your status to <em>Hidden</em>, you will appear as offline to " +"your contacts. You will still be connected to your accounts, and you still " +"see your contacts’ statuses and start conversations with them." +msgstr "" +"Quando il proprio stato viene impostato a <em>Non visibile</em>, ai propri " +"contatti si appare come fuori rete. È comunque possibile accedere ai propri " +"account, visualizzare lo stato dei propri contatti e avviare delle " +"conversazioni." -#: C/empathy.xml:119(para) -msgid "Empathy is an application for instant messaging." -msgstr "Empathy è un'applicazione per la messaggistica istantanea." +#: C/status-icons.page:67(gui) +msgid "Offline" +msgstr "Fuori rete" -#: C/empathy.xml:127(primary) C/empathy.xml:0(application) -msgid "Empathy" -msgstr "Empathy" +#: C/status-icons.page:68(p) +msgid "" +"Setting your status to <em>Offline</em> disconnects you from all of your " +"accounts." +msgstr "" +"Impostare il proprio stato a <em>Fuori rete</em> disconnette da tutti i " +"propri account." -#: C/empathy.xml:130(primary) -msgid "empathy" -msgstr "empathy" +#: C/share-desktop.page:7(desc) +msgid "Share the desktop with your contacts." +msgstr "Condividere il proprio desktop con i propri contatti." -#: C/empathy.xml:131(secondary) -msgid "istant messaging" -msgstr "messaggistica istantanea" +#: C/share-desktop.page:25(title) +msgid "Share your desktop" +msgstr "Condividere il desktop" -#: C/empathy.xml:135(title) -msgid "Introduction" -msgstr "Introduzione" +#: C/share-desktop.page:27(p) +msgid "" +"It is possible, with some of your contacts, to share your desktop with them, " +"or to start using your contacts desktop. You can use this functionality to " +"show your desktop to your contacts, to ask for help or to help your contacts " +"resolve a problem." +msgstr "" +"Con alcuni dei propri contatti è possibile condividere il proprio desktop o " +"usare il loro desktop da remoto. È possibile usare questa funzionalità per " +"mostrare il desktop ai propri contatti, per richiedere aiuto o per aiutare i " +"propri contatti a risolvere un problema." -#: C/empathy.xml:136(para) +#: C/share-desktop.page:35(p) msgid "" -"<application>Empathy</application> is a multi-protocol instant messaging " -"program for the GNOME Desktop. With <application>Empathy</application> you " -"can keep in touch with all of your friends through lots of supported instant " -"messaging services." +"In order to be able to share your desktop or to remotely use your contacts " +"desktop, it is necessary to have a remote desktop viewer application " +"installed in your system." msgstr "" -"<application>Empathy</application> è un programma di messaggistica " -"istantanea multi-protocollo per lo GNOME Desktop. Con <application>Empathy</" -"application> è possibile mantenere i contatti con tutti i propri amici " -"attraverso diversi servizi di messaggistica istantanea supportati." +"Per poter condividere il desktop con i propri contatti o per poter " +"utilizzare il loro da remoto, è necessario avere installato un programma di " +"visualizzazione di desktop remoti." -#: C/empathy.xml:146(acronym) -msgid "AIM" -msgstr "AIM" +#: C/share-desktop.page:43(p) C/send-message.page:32(p) C/send-file.page:37(p) +#: C/favorite-rooms.page:62(p) +msgid "From the <gui>Contact List</gui> window, perform one of the following:" +msgstr "" +"Dalla finestra <gui>Elenco contatti</gui>, eseguire una delle seguenti " +"azioni:" -#: C/empathy.xml:150(para) -msgid "Google Talk" -msgstr "Google Talk" +#: C/share-desktop.page:48(p) +msgid "" +"Select the contact you want to share your desktop with, and choose " +"<guiseq><gui>Edit</gui><gui>Contact</gui><gui>Share my desktop</gui></" +"guiseq>." +msgstr "" +"Selezionare il contatto con cui condividere il proprio desktop e scegliere " +"<guiseq><gui>Modifica</gui><gui>Contatto</gui><gui>Condividi il desktop</" +"gui></guiseq>." -#: C/empathy.xml:155(para) C/empathy.xml:1090(title) -msgid "ICQ" -msgstr "ICQ" +#: C/share-desktop.page:54(p) +msgid "" +"Right-click on the name of the contact you want to share your desktop with, " +"and select <gui>Share my desktop</gui>." +msgstr "" +"Fare clic col pulsante destro del mouse sul nome del contatto con cui " +"condividere il desktop e selezionare <gui>Condividi il desktop</gui>." -#: C/empathy.xml:161(acronym) -msgid "IRC" -msgstr "IRC" +#: C/share-desktop.page:62(p) +msgid "" +"A request will be sent to the contact you want to share your desktop with. " +"If they accept, the default remote desktop viewer application will be " +"launched in order to permit you to disconnect the user that is controlling " +"your desktop." +msgstr "" +"Viene inviata una richiesta di condivisione al proprio contatto. Se viene " +"accettata, il programma predefinito di visualizzazione di desktop remoti " +"viene avviato affinché sia possibile disconnettere l'utente che sta " +"controllando il proprio desktop." -#: C/empathy.xml:165(para) -msgid "Jabber (or <acronym>XMPP</acronym>)" -msgstr "Jabber (o <acronym>XMPP</acronym>)" +#: C/share-desktop.page:67(p) +msgid "" +"For more information about how to use the remote desktop viewer application, " +"refer to its help." +msgstr "" +"Per maggiori informazioni sull'utilizzo del visualizzatore di desktop " +"remoti, fare riferimento alla sua documentazione." -#: C/empathy.xml:171(acronym) -msgid "MSN" -msgstr "MSN" +#: C/share-desktop.page:74(p) +msgid "" +"When you share your desktop with someone else, it is possible to experience " +"system performance slowdown and low Internet speed." +msgstr "" +"Quando viene condiviso il proprio desktop con un'altra persona è possibile " +"riscontrare dei rallentamenti del sistema e basse velocità di connessione a " +"Internet." -#: C/empathy.xml:175(para) C/empathy.xml:442(para) C/empathy.xml:1050(title) -msgid "Salut" -msgstr "Salut" +#: C/share-desktop.page:80(p) +msgid "" +"Not all your contacts might be able to support this functionality. It is " +"necessary for them to have at least the 2.28 version of <app>Empathy</app> " +"and a remote desktop viewer application installed in their system." +msgstr "" +"Non tutti i propri contatti potrebbero essere in grado di supportare questa " +"funzionalità. È necessario dispongano almeno della versione 2.28 di " +"<app>Empathy</app> e di un'applicazione di visualizzazione di desktop remoti " +"installata." -#: C/empathy.xml:181(acronym) -msgid "SIP" -msgstr "SIP" +#: C/set-custom-status.page:9(desc) +msgid "Add, edit or delete personal messages for your status." +msgstr "Aggiungere, modificare o eliminare messaggi di stato personalizzati." + +#: C/set-custom-status.page:15(name) +msgid "Jim Campbell" +msgstr "Jim Campbell" -#: C/empathy.xml:185(para) C/empathy.xml:920(title) -msgid "Yahoo" -msgstr "Yahoo" +#: C/set-custom-status.page:16(email) +msgid "jwcampbell@gmail.com" +msgstr "jwcampbell@gmail.com" -#: C/empathy.xml:190(para) -msgid "And many others..." -msgstr "E molti altri..." +#: C/set-custom-status.page:31(title) +msgid "Set a custom message" +msgstr "Impostare un messaggio personalizzato" -#: C/empathy.xml:141(para) +#: C/set-custom-status.page:33(p) msgid "" -"<application>Empathy</application> supports the following services: " -"<placeholder-1/>" +"Sometimes you may want to set a custom message for your status, for example " +"to let people know that you will be unavailable for a certain period of time." msgstr "" -"<application>Empathy</application> supporta i seguenti servizi: <placeholder-" -"1/>" +"Alcune volte potrebbe essere necessario impostare un messaggio " +"personalizzato per il proprio stato, per esempio per avvisare i propri " +"contatti che non si sarà disponibili per un determinato periodo di tempo." -#: C/empathy.xml:199(title) -msgid "Getting Started" -msgstr "Per iniziare" +#: C/set-custom-status.page:37(p) +msgid "" +"It is possible to set a custom message based on the different statuses " +"available." +msgstr "" +"È possibile impostare un messaggio personalizzato in base ai diversi stati " +"disponibili." -#: C/empathy.xml:202(title) -msgid "Starting Empathy" -msgstr "Avviare Empathy" +#: C/set-custom-status.page:43(p) C/set-custom-status.page:79(p) +msgid "" +"From the <gui>Contact List</gui> window, click on the drop-down list at the " +"top." +msgstr "" +"Dalla finestra <gui>Elenco contatti</gui>, fare clic sull'elenco a discesa " +"nella parte superiore." -#: C/empathy.xml:203(para) -msgid "You can start <application>Empathy</application> in the following ways:" +#: C/set-custom-status.page:49(p) +msgid "" +"Select the status you want to add a custom message to. You have to select " +"the one identified with the label <gui>Custom Message</gui>." msgstr "" -"È possibile avviare <application>Empathy</application> nei seguenti modi:" +"Selezionare lo stato a cui aggiungere un messaggio personalizzato. È " +"necessario selezionare quello identificato dall'etichetta <gui>Messaggio " +"personalizzato</gui>." -#: C/empathy.xml:207(term) -msgid "<guimenu>Applications</guimenu> menu" -msgstr "Menù <guimenu>Applicazioni</guimenu>" +#: C/set-custom-status.page:55(p) +msgid "" +"Enter your custom message in the text box at the top of the window, and " +"press <key>Enter</key> to set the message." +msgstr "" +"Inserire il proprio messaggio personalizzato nella casella di testo presente " +"nella parte superiore della finestra e quindi premere <key>Invio</key> per " +"impostare il messaggio." + +#: C/set-custom-status.page:61(p) +msgid "" +"If you want to set the custom message as a favorite, saving it in order to " +"use it again, click on the little star on the right of the text box where " +"you wrote your custom message." +msgstr "" +"Per impostare il messaggio personalizzato tra quelli preferiti, salvandolo " +"affinché possa essere utilizzato ancora, fare clic sulla piccola stella " +"sulla destra della casella di testo dove è stato scritto il messaggio " +"personalizzato." -#: C/empathy.xml:209(para) +#: C/set-custom-status.page:66(p) msgid "" -"Choose <menuchoice><guisubmenu>Internet</guisubmenu><guimenuitem>Empathy " -"Instant Messenger</guimenuitem></menuchoice>." +"If you do not do it, the custom message will not be available the next time " +"you use <app>Empathy</app>. It will be saved only for the current session." msgstr "" -"Scegliere <menuchoice><guisubmenu>Internet</guisubmenu><guimenuitem>Empathy " -"- Messaggistica istantanea</guimenuitem></menuchoice>." +"Se non viene impostato come preferito, il messaggio personalizzato non sarà " +"disponibili al successivo avvio di <app>Empathy</app>. Viene salvato " +"solamente per la sessione attuale." + +#: C/set-custom-status.page:75(title) +msgid "Edit, remove and add a custom message" +msgstr "Modificare, rimuovere e aggiungere un messaggio personalizzato" + +#: C/set-custom-status.page:85(p) +msgid "Select <gui>Edit Custom Message</gui>." +msgstr "Selezionare <gui>Modifica messaggi personalizzati</gui>." + +#: C/set-custom-status.page:92(p) +msgid "To edit a custom message:" +msgstr "Per modificare un messaggio personalizzato:" + +#: C/set-custom-status.page:97(p) +#| msgid "" +#| "From the <guilabel>Groups</guilabel> section, select the group, or " +#| "groups, you want to add the contact to." +msgid "" +"From the <gui>Saved Presets</gui> box, select the status message you want to " +"edit and double-click on it." +msgstr "" +"Dalla casella <gui>Prestabiliti salvati</gui>, selezionare il messaggio da " +"modificare e fare doppio-clic su di esso." -#: C/empathy.xml:218(term) -msgid "Command line" -msgstr "Riga di comando" +#: C/set-custom-status.page:103(p) +msgid "Type the new custom message and press <key>Enter</key> to modify it." +msgstr "" +"Digitare il nuovo messaggio personalizzato e premere <key>Invio</key> per " +"modificarlo." -#: C/empathy.xml:220(para) -msgid "Type <command>empathy</command> and then press <keycap>Enter</keycap>." -msgstr "Digitare <command>empathy</command> e premere <keycap>Invio</keycap>." +#: C/set-custom-status.page:110(p) +msgid "To remove a custom message:" +msgstr "Per rimuovere un messaggio personalizzato:" -#: C/empathy.xml:229(title) -msgid "When You Start Empathy" -msgstr "Quando si avvia Empathy" +#: C/set-custom-status.page:115(p) +#| msgid "" +#| "From the <guilabel>Groups</guilabel> section, select the group, or " +#| "groups, you want to add the contact to." +msgid "" +"From the <gui>Saved Presets</gui> box, select the status message you want to " +"remove." +msgstr "" +"Dalla casella <gui>Prestabiliti salvati</gui>, selezionare il messaggio da " +"rimuovere." -#: C/empathy.xml:234(title) -msgid "<application>Empathy</application> Main Window" -msgstr "Finestra principale di <application>Empathy</application>" +#: C/set-custom-status.page:121(p) +#| msgid "Click on the <guibutton>Remove</guibutton> button." +msgid "Click on the <gui>Remove</gui> button." +msgstr "Fare clic sul pulsante <gui>Rimuovi</gui>." -#: C/empathy.xml:241(phrase) +#: C/set-custom-status.page:128(p) msgid "" -"Shows <placeholder-1/> main window. Contains the titlebar, the menubar, " -"contact list, status icon and status arrow button list." +"To add a new custom message, from the <gui>Add New Preset</gui> section:" msgstr "" -"Mostra la finestra principale di <placeholder-1/>. Contiene la barra del " -"titolo, la barra dei menù, l'elenco dei contatti, l'icona di stato e " -"l'elenco degli stati." +"Per aggiungere un nuovo messaggio personalizzato, dalla sezione " +"<gui>Aggiungere nuovo prestabilito</gui>:" -#: C/empathy.xml:230(para) +#: C/set-custom-status.page:133(p) msgid "" -"When you start <application>Empathy</application> the following window is " -"shown. <placeholder-1/>" +"Click on the drop-down list to select the status you want to set a custom " +"message to." +msgstr "" +"Fare clic sull'elenco a discesa per selezionare lo stato a cui associare un " +"messaggio personalizzato." + +#: C/set-custom-status.page:139(p) +msgid "Click on the text box, and type the new custom message." msgstr "" -"Quando si avvia <application>Empathy</application> viene mostrata la " -"seguente finestra. <placeholder-1/>" +"Fare clic sulla casella di testo e digitare il nuovo messaggio " +"personalizzato." -#: C/empathy.xml:256(title) -msgid "<application>Empathy</application> Main Components" -msgstr "Componenti principali di <application>Empathy</application>" +#: C/set-custom-status.page:144(p) +#| msgid "Click on <guibutton>Add</guibutton> to add the new contact." +msgid "Click on <gui>Add</gui> to add the new message to the presets ones." +msgstr "" +"Fare clic su <gui>Aggiungi</gui> per aggiungere il nuovo messaggio tra " +"quelli prestabiliti." -#: C/empathy.xml:263(para) -msgid "Component" -msgstr "Componente" +#: C/set-custom-status.page:153(p) +#| msgid "When done, click <guibutton>Close</guibutton>." +msgid "When finished, click on <gui>Close</gui>." +msgstr "Quando finito, fare clic su <gui>Chiudi</gui>." -#: C/empathy.xml:266(para) -msgid "Description" -msgstr "Descrizione" +#: C/set-custom-status.page:160(p) +msgid "" +"When you edit or add a new custom message, it will not be set as the current " +"status message. You will need to select it from the <gui>Contact List</gui> " +"window." +msgstr "" +"Quanto viene modificato o aggiunto un nuovo messaggio personalizzato, questo " +"non viene impostato come messaggio di stato corrente. È necessario " +"selezionarlo dalla finestra <gui>Elenco contatti</gui>." + +#: C/send-message.page:8(desc) +msgid "Send a message to one of your contacts." +msgstr "Inviare un messaggio a uno dei propri contatti." + +#: C/send-message.page:16(name) C/send-file.page:17(name) +#: C/prob-conn.page:14(name) C/prob-conn-neterror.page:13(name) +#: C/prob-conn-auth.page:16(name) C/prob-conn-acctdisabled.page:14(name) +#: C/change-status.page:19(name) C/add-contact.page:18(name) +msgid "Phil Bull" +msgstr "Phil Bull" + +#: C/send-message.page:17(email) C/send-file.page:18(email) +#: C/prob-conn.page:15(email) C/prob-conn-neterror.page:14(email) +#: C/prob-conn-auth.page:17(email) C/prob-conn-acctdisabled.page:15(email) +#: C/change-status.page:20(email) C/add-contact.page:19(email) +msgid "philbull@gmail.com" +msgstr "philbull@gmail.com" + +#: C/send-message.page:28(title) +msgid "Send a message to someone" +msgstr "Inviare un messaggio" + +#: C/send-message.page:37(p) +msgid "" +"Double click the name of the contact that you want to have a conversation " +"with." +msgstr "" +"Fare doppio-clic sul nome del contatto con cui iniziare una conversazione." -#: C/empathy.xml:273(para) -msgid "Menubar" -msgstr "Barra dei menù" +#: C/send-message.page:43(p) +msgid "" +"Right-click on the name of the contact you want to have a conversation with, " +"and choose <gui>Chat</gui>." +msgstr "" +"Fare clic col pulsante destro del mouse sul contatto con cui iniziare una " +"conversazione e scegliere <gui>Conversazione</gui>." -#: C/empathy.xml:276(para) +#: C/send-message.page:51(p) msgid "" -"Contains menus used to perform actions in <application>Empathy</application>." +"A new window will open. Type a message into the box at the bottom of the " +"window and press <key>Enter</key> to send it." msgstr "" -"Contiene i menù usati per svolgere le azioni in <application>Empathy</" -"application>." +"Viene aperta una nuova finestra. Digitare il messaggio nella casella di " +"testo nella parte inferiore della finestra e premere <key>Invio</key> per " +"inviarlo." -#: C/empathy.xml:283(para) -msgid "Status Drop-Down List" -msgstr "Elenco a discesa degli stati" +#: C/send-file.page:8(desc) +msgid "Send a file from your computer to one of your contacts." +msgstr "Inviare un file dal proprio computer a uno dei propri contatti." -#: C/empathy.xml:286(para) -msgid "Allows to update the status." -msgstr "Consente di aggiornare lo stato." +#: C/send-file.page:33(title) +msgid "Send files" +msgstr "Inviare file" -#: C/empathy.xml:293(para) -msgid "Account Button" -msgstr "Pulsante degli account" +#: C/send-file.page:42(p) +msgid "" +"Right click on the contact you want to send a file to, and choose <gui>Send " +"file</gui>." +msgstr "" +"Fare clic col pulsante destro del mouse sul contatto a cui inviare un file e " +"scegliere <gui>Invia file</gui>." -#: C/empathy.xml:296(para) -msgid "Opens the <guilabel>Accounts</guilabel> dialog." -msgstr "Apre il dialogo <guilabel>Account</guilabel>." +#: C/send-file.page:47(p) +msgid "" +"Click on the contact you want to send a file, and choose <guiseq><gui>Edit</" +"gui><gui>Contact</gui><gui>Send file</gui></guiseq>." +msgstr "" +"Fare clic sul contatto a cui inviare un file e scegliere " +"<guiseq><gui>Modifica</gui><gui>Contatto</gui><gui>Invia file</gui></guiseq>." -#: C/empathy.xml:303(para) -msgid "Contact List" -msgstr "Elenco contatti" +#: C/send-file.page:55(p) +msgid "Select the file to send, and click on <gui>Send</gui>." +msgstr "Selezionare il file da inviare e fare clic su <gui>Invia</gui>." -#: C/empathy.xml:306(para) -msgid "Shows all the available contacts and their associated status." -msgstr "Mostra tutti i contatti disponibili e il loro stato." +#: C/send-file.page:60(p) +msgid "The <gui>File Transfers</gui> window will appear." +msgstr "Viene aperta la finestra <gui>Trasferimenti file</gui>." -#: C/empathy.xml:252(para) +#: C/send-file.page:63(p) msgid "" -"<xref linkend=\"empathy-TBL-1\"/> describes the components of " -"<application>Empathy</application>'s main window. <table frame=\"topbot\" id=" -"\"empathy-TBL-1\"><placeholder-1/><tgroup cols=\"2\" colsep=\"0\" rowsep=\"0" -"\"><colspec colname=\"colspec0\" colwidth=\"29.39*\"/><colspec colname=" -"\"colspec1\" colwidth=\"70.61*\"/><placeholder-2/><placeholder-3/></tgroup></" -"table>" +"Wait for your contact to accept the file transfer, or click <gui>Stop</gui> " +"to halt the transfer." msgstr "" -"<xref linkend=\"empathy-TBL-1\"/> descrive i componenti della finestra " -"principale di <application>Empathy</application>. <table frame=\"topbot\" id=" -"\"empathy-TBL-1\"><placeholder-1/><tgroup cols=\"2\" colsep=\"0\" rowsep=\"0" -"\"><colspec colname=\"colspec0\" colwidth=\"29.39*\"/><colspec colname=" -"\"colspec1\" colwidth=\"70.61*\"/><placeholder-2/><placeholder-3/></tgroup></" -"table>" +"Attendere che il contatto accetti il trasferimento oppure fare clic su " +"<gui>Ferma</gui> per fermarlo." -#: C/empathy.xml:320(title) -msgid "Accounts" -msgstr "Account" +#: C/send-file.page:69(p) +msgid "" +"Once the transfer is finished, it is possible to close the <gui>File " +"Transfers</gui> window." +msgstr "" +"Completato il trasferimento del file, è possibile chiudere la finestra " +"<gui>Trasferimenti file</gui>." -#: C/empathy.xml:321(para) +#: C/send-file.page:77(p) msgid "" -"To use <application>Empathy</application> you need at least one account of " -"the supported services." +"If you have multiple finished transfers listed in the window, click on " +"<gui>Clear</gui> to empty the list. This will only remove the files from the " +"list and will not delete them from your computer." msgstr "" -"Per poter usare <application>Empathy</application> è necessario disporre " -"almeno un account dei servizi supportati." +"Se nella finestra sono elencati più trasferimenti di file completati, fare " +"clic su <gui>Pulisci</gui> per svuotare l'elenco. In questo modo vengono " +"rimossi i file solamente dall'elenco, non dal proprio computer." -#: C/empathy.xml:324(para) +#: C/send-file.page:84(p) msgid "" -"If you don't already have an account and you don't have your <emphasis>user " -"name</emphasis> and <emphasis>password</emphasis>, you need to register a " -"new account (see <xref linkend=\"empathy-register-account\"/>)." +"It is possible to send files only using the following services: <em>Jabber</" +"em>, <em>Google Talk</em> and <em>People Nearby</em>." msgstr "" -"Se ancora non si ha un account e non si dispone del proprio <emphasis>nome " -"utente</emphasis> e della propria <emphasis>password</emphasis>, è " -"necessario registrare un nuovo account (consultare <xref linkend=\"empathy-" -"register-account\"/>)." +"È possibile inviare file utilizzando solo uno dei seguenti servizi: " +"<em>Jabber</em>, <em>Google Talk</em> e <em>Persone nelle vicinanze</em>." -#: C/empathy.xml:329(para) +#: C/send-file.page:90(p) msgid "" -"In order to talk with other users, also called <emphasis>contacts</" -"emphasis>, you need to use the same service they are using. If, for example, " -"one contact is using the <emphasis role=\"strong\">Jabber</emphasis> " -"service, you need to have an account registered with that service." +"In order to send a file to someone, you need to be connected to the " +"Internet, or to a local area network." msgstr "" -"Per poter \"parlare\" con altri utenti (chiamati <emphasis>contatti</" -"emphasis>), è necessario usare lo stesso servizio usato da loro. Se, per " -"esempio, un contatto sta usando il servizio <emphasis role=\"strong" -"\">Jabber</emphasis>, è necessario avere un account registrato con quel " -"servizio." +"Per inviare un file a una persona è necessario essere collegati a Internet o " +"a una rete locale." -#: C/empathy.xml:336(para) +#: C/salut-protocol.page:8(desc) +msgid "Undesrtanding the People Nearby feature." +msgstr "Comprendere la funzionalità «Persone nelle vicinanze»." + +#: C/salut-protocol.page:30(title) +msgid "What is People Nearby?" +msgstr "Cos'è «Persone nelle vicinanze»?" + +# (ndt) non serve tradurre +#: C/salut-protocol.page:34(p) +msgid "I'd like to see this played up a bit more." +msgstr "I'd like to see this played up a bit more." + +#: C/salut-protocol.page:37(p) msgid "" -"<application>Empathy</application> can handle as many accounts on any " -"supported services as you want and you can have them all open at the same " -"time." +"The People Nearby service is a serverless communication service: you do not " +"need to connect and authenticate to a central server in order to use it." msgstr "" -"<application>Empathy</application> è in grado di gestire tutti i contatti " -"che si vogliono su qualsiasi servizio supportato ed è possibile averli tutti " -"aperti allo stesso tempo." +"Il servizio «Persone nelle vicinanze» è un servizio di comunicazione privo di " +"server centrale: non è necessario connettersi e autenticarsi a un server " +"centrale per poterlo utilizzare." -#: C/empathy.xml:342(title) -msgid "Registering an Account" -msgstr "Registrare un account" +#: C/salut-protocol.page:42(p) +msgid "" +"This kind of serverless messaging system is restricted to a local area " +"network and an active Internet connection is not necessary." +msgstr "" +"Questa tipologia di sistema di messaggistica priva di server è ristretta a " +"una rete locale e non è necessario disporre di una connessione a Internet." -#: C/empathy.xml:343(para) +#: C/salut-protocol.page:46(p) msgid "" -"You can freely register an account on any of the following services. Follow " -"the instructions reported on each website on how to register your new " -"account. At the end of the registration process you should have a " -"<emphasis>user name</emphasis> (or an <emphasis>account ID</emphasis>) and a " -"<emphasis>password</emphasis> that you will use to create the account in " -"<application>Empathy</application>." +"The people that use this service inside the same local area network will be " +"auto-discovered, and it will be possible to send them messages and files as " +"with other services." msgstr "" -"È possibile registrare un account gratuitamente con i seguenti servizi. " -"Seguire le istruzioni riportate nei siti web su come registrare un nuovo " -"account. Al termine della registrazione dovrebbero essere disponibili un " -"<emphasis>nome utente</emphasis> (o un <emphasis>ID account</emphasis>) e " -"una <emphasis>password</emphasis> necessari per inserire l'account in " -"<application>Empathy</application>." +"Le persone che utilizzano questo servizio all'interno della stessa rete " +"locale vengono rilevate automaticamente ed è possibile inviare messaggi e " +"file come per gli altri servizi." -#. Translators: try to find a localized version of the -#. registration service website -#: C/empathy.xml:361(para) +#: C/salut-protocol.page:51(p) msgid "" -"The <ulink type=\"http\" url=\"http://dashboard.aim.com/aim\">AIM</ulink> " +"All the modern local area networks should be able to support this kind of " "service." msgstr "" -"Il servizio <ulink type=\"http\" url=\"http://dashboard.aim.com/aim\">AIM</" -"ulink>." +"Tutte le reti locali moderne dovrebbero essere in grado di supportare questo " +"tipo di servizio." + +#: C/remove-account.page:8(desc) +msgid "Completely remove an account from <app>Empathy</app>." +msgstr "Rimuovere completamente un account da <app>Empathy</app>." + +#: C/remove-account.page:29(title) +#| msgid "Registering an Account" +msgid "Remove an account" +msgstr "Rimuovere un account" + +#: C/remove-account.page:31(p) +msgid "" +"You can completely remove an account from <app>Empathy</app> if you no " +"longer wish to use the account. If you wish to use the account in " +"<app>Empathy</app> again in the future, you will have to add your account " +"details again." +msgstr "" +"Se non si desidera più utilizzare un account, è possibile rimuoverlo " +"completamente da <app>Empathy</app>. Se in futuro si vuole utilizzare lo " +"stesso account con <app>Empathy</app>, è necessario aggiungere nuovamente " +"tutti i dettagli." -#. Translators: try to find a localized version of the -#. registration service website -#: C/empathy.xml:368(para) +#: C/remove-account.page:38(p) C/irc-nick-password.page:47(p) +#: C/disable-account.page:44(p) C/add-account.page:43(p) msgid "" -"The <ulink type=\"http\" url=\"http://www.google.com/talk/\">Google Talk</" -"ulink> service." +"From the <gui>Contact List</gui> window, choose <guiseq><gui>Edit</" +"gui><gui>Accounts</gui></guiseq>, or press <key>F4</key>." msgstr "" -"Il servizio <ulink type=\"http\" url=\"http://www.google.com/talk/\">Google " -"Talk</ulink>." +"Dalla finestra <gui>Elenco contatti</gui>, scegliere <guiseq><gui>Modifica</" +"gui><gui>Account</gui></guiseq> o premere <key>F4</key>." -#. Translators: try to find a localized version of the -#. registration service website -#: C/empathy.xml:376(para) +#: C/remove-account.page:42(p) +#| msgid "" +#| "Select the account you wish to disable in the box on the left of the " +#| "dialog." msgid "" -"The <ulink type=\"http\" url=\"https://www.icq.com/register/\">ICQ</ulink> " +"Select the account you wish to remove from the accounts list on the left " +"side of the window." +msgstr "" +"Selezionare l'account da rimuovere dall'elenco degli account nel riquadro a " +"sinistra della finestra." + +#: C/remove-account.page:46(p) +msgid "Click on the trash icon next to the account name to remove the account." +msgstr "" +"Fare clic sull'icona a forma di cestino accanto all'account per rimuoverlo." + +#: C/remove-account.page:49(p) +#| msgid "" +#| "A dialog will be shown asking for confirmation. Click on the " +#| "<guibutton>Remove</guibutton> button to remove the account." +msgid "" +"A dialog will be shown asking for confirmation. Click the <gui>Remove</gui> " +"button to permanently remove the account." +msgstr "" +"Viene mostrato un dialogo per la conferma dell'operazione. Fare clic sul " +"pulsante <gui>Rimuovi</gui> per rimuovere definitivamente l'account." + +#: C/remove-account.page:55(p) +msgid "" +"Even after removing an account, <app>Empathy</app> does not delete your " +"conversation history for that account." +msgstr "" +"Anche dopo aver rimosso un account, <app>Empathy</app> non elimina la " +"cronologia delle conversazioni per quel particolare account." + +#: C/prob-conn.page:7(desc) +msgid "Diagnose common problems connecting to an instant messaging service." +msgstr "" +"Diagnosticare problemi comuni di connessione a un servizio di messaggistica." + +#: C/prob-conn.page:26(title) +msgid "Problems connecting to an instant messaging service" +msgstr "Problemi nel connettersi ai servizi di messaggistica" + +#: C/prob-conn-neterror.page:7(desc) +msgid "" +"An error message which says \"<gui>Network error</gui>\" appears in the main " +"window." +msgstr "" +"Viene visualizzato un messaggio di errore indicante «<gui>Errore di rete</" +"gui>»." + +#: C/prob-conn-neterror.page:29(title) +msgid "I get a message that says \"Network error\"" +msgstr "Si riceve un messaggio indicante «Errore di rete»" + +#: C/prob-conn-neterror.page:32(cite) +msgid "shaunm" +msgstr "shaunm" + +# (ndt) non serve tradurre +#: C/prob-conn-neterror.page:33(p) +msgid "" +"Empathy no longer allows you to create an IRC account without a valid nick. " +"I've removed the guide link. Remove the text." +msgstr "" +"Empathy no longer allows you to create an IRC account without a valid nick. " +"I've removed the guide link. Remove the text." + +#: C/prob-conn-neterror.page:37(p) +msgid "" +"This kind of error happens when <app>Empathy</app> cannot communicate with " +"the instant messaging service for some reason." +msgstr "" +"Questo tipo di errore si verifica quando <app>Empathy</app> non riesce a " +"comunicare, per qualche motivo, con il servizio di messaggistica istantanea." + +#: C/prob-conn-neterror.page:41(p) +msgid "" +"Also, this kind of error happens when you try to use an IRC account without " +"setting a nickname." +msgstr "" +"Inoltre, questo tipo di errore si verifica quando si cerca di usare un " +"account IRC senza aver impostato un soprannome." + +#: C/prob-conn-neterror.page:48(p) C/prob-conn-auth.page:41(p) +#: C/prob-conn-acctdisabled.page:40(p) +msgid "" +"Make sure that you are connected to the Internet, or to a local area network." +msgstr "Assicurarsi di essere connessi a Internet o a una rete locale." + +#: C/prob-conn-neterror.page:53(p) C/prob-conn-name.page:38(p) +#: C/prob-conn-auth.page:53(p) +#| msgid "Click on the <guibutton>Remove</guibutton> button." +msgid "Click on the <gui>Edit Account</gui> button in the error message." +msgstr "" +"Fare clic sul pulsante <gui>Modifica account</gui> nel messaggio di errore." + +#: C/prob-conn-neterror.page:60(p) C/prob-conn-acctdisabled.page:56(p) +msgid "" +"Check in the <gui>Advanced</gui> section that all the details are correct. " +"You should be able to find these details from the website of the messaging " "service." msgstr "" -"Il servizio <ulink type=\"http\" url=\"https://www.icq.com/register/\">ICQ</" -"ulink>." +"Verificare che nella sezione <gui>Avanzate</gui> tutti i dettagli siano " +"corretti. Questi dettagli dovrebbero essere disponibili nel sito web del " +"servizio di messaggistica." -#. Translators: try to find a localized version of the -#. registration service website -#: C/empathy.xml:383(para) +#: C/prob-conn-neterror.page:66(p) msgid "" -"The <ulink type=\"http\" url=\"https://accountservices.passport.net\">MSN</" -"ulink> service." +"In the case of an IRC account, type your nickname in the <gui>Nickname</gui> " +"text box." msgstr "" -"Il servizio <ulink type=\"http\" url=\"https://accountservices.passport.net" -"\">MSN</ulink>." +"Nel caso di un account IRC, digitare il proprio soprannome nella casella di " +"testo <gui>Soprannome</gui>." + +#: C/prob-conn-neterror.page:74(p) C/prob-conn-name.page:59(p) +#: C/prob-conn-auth.page:63(p) +#| msgid "" +#| "To enable the new account, select the <guilabel>Enabled</guilabel> check-" +#| "box next to the name of the account in the box on the left." +msgid "" +"Deselect the <gui>Enabled</gui> check-box next to the name of your account, " +"and then select it again to try to reconnect to the service." +msgstr "" +"Deselezionare la casella di scelta <guilabel>Abilitato</guilabel> a fianco " +"del nome dell'account e selezionarla nuovamente per ritentare la connessione " +"al servizio." -#. Translators: try to find a localized version of the -#. registration service website -#: C/empathy.xml:390(para) +#: C/prob-conn-name.page:9(title) +msgid "“Name in use”" +msgstr "«Nome in uso»" + +#: C/prob-conn-name.page:10(desc) msgid "" -"The <ulink type=\"http\" url=\"https://login.yahoo.com/config/login\">Yahoo</" -"ulink> service." +"An error message which says “<gui>Name in use</gui>” appears in the main " +"window." msgstr "" -"Il servizio <ulink type=\"http\" url=\"https://login.yahoo.com/config/mail?." -"intl=it&.src=ym&.done=http://it.yahoo.com\">Yahoo</ulink>." +"Viene visualizzato un messaggio di errore indicante «<gui>Nome in uso</gui>»." + +#: C/prob-conn-name.page:28(title) +msgid "I get a message that says “Name in use”" +msgstr "Si riceve un messaggio indicante «Nome in uso»" -#: C/empathy.xml:352(para) -msgid "Click on the name of the service to visit its website: <placeholder-1/>" +#: C/prob-conn-name.page:30(p) +msgid "" +"This kind of error happens when you try to connect to your IRC account and " +"you are using a nickname that is already being used by someone else on that " +"particular network." msgstr "" -"Fare clic sul nome del servizio per visitarne il sito web: <placeholder-1/>" +"Questo tipo di errore si verifica quando si cerca di connettersi col proprio " +"account IRC, ma si utilizza un soprannome già usato da qualcun altro " +"all'interno di quella particolare rete." + +#: C/prob-conn-name.page:45(p) +#| msgid "In the <guilabel>Alias</guilabel> text box, write your new alias." +msgid "In the <gui>Nickname</gui> text box, type a new nickname." +msgstr "Nella casella di testo <gui>Soprannome</gui>, digitarne uno nuovo." -#: C/empathy.xml:396(para) +#: C/prob-conn-name.page:50(p) msgid "" -"For registering a <acronym>SIP</acronym> account, you can use one of the " -"following service:" +"If you have registered that nickname within the network you are using, set " +"the password for that nickname. For more information, see <link xref=\"irc-" +"nick-password\"/>." msgstr "" -"Per registrare un account <acronym>SIP</acronym>, è possibile usare uno dei " -"seguenti servizi:" +"Se quel particolare soprannome è stato registrato all'interno di quella " +"rete, impostare la password per tale soprannome. Per maggiori informazioni, " +"consultare <link xref=\"irc-nick-password\"/>." -#. Translators: try to find a localized version of the -#. registration service website -#: C/empathy.xml:405(para) +#: C/prob-conn-auth.page:8(desc) msgid "" -"The <ulink type=\"http\" url=\"https://www.ekiga.net/index.php?page=register" -"\">Ekiga</ulink> service." +"An error message which says \"<gui>Authentication failed</gui>\" appears in " +"the main window." msgstr "" -"Il servizo <ulink type=\"http\" url=\"https://www.ekiga.net/index.php?" -"page=register\">Ekiga</ulink>." +"Viene visualizzato un messaggio di errore indicante «<gui>Autenticazione non " +"riuscita</gui>»." -#. Translators: try to find a localized version of the -#. registration service website -#: C/empathy.xml:412(para) +#: C/prob-conn-auth.page:32(title) +msgid "I get a message that says \"Authentication failed\"" +msgstr "Si riceve un messaggio indicante «Autenticazione non riuscita»." + +#: C/prob-conn-auth.page:34(p) msgid "" -"The <ulink type=\"http\" url=\"http://account2.freeworlddialup.com/index.php?" -"section_id=94\"><acronym>FWD</acronym></ulink> (Free World Dialup) service." +"This kind of error happens when your instant messaging service is not " +"allowing you to connect because it does not recognize your username or " +"password for some reason." msgstr "" -"Il servizio <ulink type=\"http\" url=\"http://account2.freeworlddialup.com/" -"index.php?section_id=94\"><acronym>FWD</acronym></ulink> (Free World Dialup)." +"Questo tipo di errore si verifica quando il servizio di messaggistica " +"istantanea non consente di eseguire la connessione perché non riconosce, per " +"qualche motivo, il nome utente o la password." -#. Translators: try to find a localized version of the -#. registration service website -#: C/empathy.xml:420(para) +#: C/prob-conn-auth.page:46(p) msgid "" -"The <ulink type=\"http\" url=\"https://signup.sipphone.com/new-users/app?" -"class=NewUser;proc=start\">Sipphone</ulink> service." +"Make sure that you have registered an account with the service you are " +"trying to connect to. If you do not have an account, most services will not " +"allow you to connect." msgstr "" -"Il servizio <ulink type=\"http\" url=\"https://signup.sipphone.com/new-users/" -"app?class=NewUser;proc=start\">Sipphone</ulink>." +"Assicurarsi di aver registrato un account con quel particolare servizio. La " +"maggior parte dei servizi di messaggistica non consente di collegarvisi " +"senza un account registrato." -#: C/empathy.xml:426(para) +#: C/prob-conn-auth.page:58(p) C/prob-conn-acctdisabled.page:51(p) msgid "" -"For registering a <emphasis role=\"strong\">Jabber</emphasis> account, you " -"can use the automatic account creation of <application>Empathy</" -"application>. Not all Jabber service providers support the automatic " -"creation of accounts, one service provider known to work with " -"<application>Empathy</application> is <ulink type=\"http\" url=\"http://www." -"jabber.org/web/Jabber.org\">jabber.org</ulink>." +"Type your username and password again to make sure that they are correct." msgstr "" -"Per registrare un account con <emphasis role=\"strong\">Jabber</emphasis>, è " -"possibile utilizzare la creazione automatica degli account di " -"<application>Empathy</application>. Non tutti i fornitori di servizi su " -"Jabber supportano questa funzionalità: un fornitore noto funzionare con " -"<application>Empathy</application> è <ulink type=\"http\" url=\"http://www." -"jabber.org/web/Jabber.org\">jabber.org</ulink>." +"Digitare nuovamente il proprio nome utente e la password per assicurarsi che " +"siano corretti." -#: C/empathy.xml:434(para) +#: C/prob-conn-acctdisabled.page:7(desc) msgid "" -"If you already have a <emphasis role=\"strong\">Jabber</emphasis> account, " -"you can use one of the following services:" +"The instant messaging account that you want to use is not enabled in the " +"list of accounts." msgstr "" -"Si si dispone già di un account <emphasis role=\"strong\">Jabber</emphasis>, " -"è possibile usare uno dei seguenti servizi:" +"L'account di messaggistica istantanea da usare non è abilitato nell'elenco " +"degli account." -#: C/empathy.xml:451(title) -msgid "Adding your Account to <application>Empathy</application>" -msgstr "Aggiungere il proprio account in <application>Empathy</application>" +#: C/prob-conn-acctdisabled.page:30(title) +msgid "My account is not enabled" +msgstr "L'account non è abilitato" -#: C/empathy.xml:456(para) C/empathy.xml:534(para) C/empathy.xml:586(para) -#: C/empathy.xml:619(para) C/empathy.xml:649(para) C/empathy.xml:672(para) +#: C/prob-conn-acctdisabled.page:32(p) msgid "" -"From the <link linkend=\"empathy-FIG-mainwindow\">main window </link> " -"(<guilabel>Contact List</guilabel>) click on the account button or press " -"<keycap>F4</keycap> to open the <guilabel>Accounts</guilabel> dialog." +"If the instant messaging account that you want to use is not enabled in the " +"drop-down account list when you try to start a new conversation or join a " +"room, your account details may not be correct." msgstr "" -"Dalla <link linkend=\"empathy-FIG-mainwindow\">finestra principale</link> " -"(<guilabel>Elenco contatti</guilabel>) fare clic sul pulsante degli account, " -"o premere <keycap>F4</keycap>, per aprire il dialogo <guilabel>Account</" -"guilabel>." +"Se l'account di messaggistica istantanea da usare non è abilitato " +"nell'elenco a discesa degli account quando si avvia una nuova conversazione " +"o quando si entra in una stanza, i dettagli dell'account potrebbero non " +"essere corretti." -#: C/empathy.xml:468(para) C/empathy.xml:485(para) +#: C/prob-conn-acctdisabled.page:45(p) msgid "" -"From the <guilabel>Type</guilabel> drop-down list choose the service you " -"wish to add an account for, then click on the <guibutton>Create</guibutton> " -"button." +"Choose <guiseq><gui>Edit</gui><gui>Accounts</gui></guiseq> and select the " +"account that is not working." msgstr "" -"Dall'elenco a discesa <guilabel>Tipo</guilabel> scegliere il servizio per " -"cui si vuole creare l'account, quindi fare clic sul pulsante " -"<guibutton>Crea</guibutton>." +"Scegliere <guiseq><gui>Modifica</gui><gui>Account</gui></guiseq> e " +"selezionare l'account che non funziona." -#: C/empathy.xml:464(para) +#: C/prob-conn-acctdisabled.page:62(p) +#| msgid "" +#| "To enable the new account, select the <guilabel>Enabled</guilabel> check-" +#| "box next to the name of the account in the box on the left." msgid "" -"If it is the first time you launch <application>Empathy</application>: " -"<placeholder-1/>" +"Check that the <gui>Enabled</gui> check-box next to the name of your account " +"is selected. If it is not, select the check-box to enalbe the account." msgstr "" -"Se è la prima volta che viene avviato <application>Empathy</application>: " -"<placeholder-1/>" +"Verificare che la casella di scelta <gui>Abilitato</gui> a fianco del nome " +"dell'account sia selezionata. Se non lo è, selezionarla per abilitare " +"l'account." -#: C/empathy.xml:480(para) -msgid "Click on the <guilabel>Add</guilabel> button." -msgstr "Fare clic sul pulsante <guibutton>Aggiungi</guibutton>." +#: C/prev-conv.page:8(desc) +msgid "Browse or search your previous conversations." +msgstr "Esplorare o cercare conversazioni precedenti." -#: C/empathy.xml:476(para) -msgid "Otherwise: <placeholder-1/>" -msgstr "Altrimenti: <placeholder-1/>" +#: C/prev-conv.page:32(title) +msgid "View previous conversations" +msgstr "Visualizzare le conversazioni precedenti" -#: C/empathy.xml:495(para) +# (ndt) non serve tradurre +#: C/prev-conv.page:36(p) msgid "" -"Fill the required fields with your <emphasis>user name</emphasis> and " -"<emphasis>password</emphasis>. Optionally, you can modify some advanced " -"options. For more information, see <xref linkend=\"empathy-advanced-options" -"\"/>." +"Highlighting text is quirky: <link href=\"http://bugzilla.gnome.org/show_bug." +"cgi?id=593733\">#593733</link>. If there's an actual highlighting going on, " +"independent of the selection (like in yellow or something), we can use the " +"term \"highlight\". Otherwise we need to use the term \"select\". Watch that " +"bug." msgstr "" -"Riempire i campi richiesti con il proprio <emphasis>nome utente</emphasis> e " -"la propria <emphasis>password</emphasis>, inoltre, è anche possibile " -"modificare delle opzioni avanzate. Per maggiori informazioni, consultare " -"<xref linkend=\"empathy-advanced-options\"/>." +"Highlighting text is quirky: <link href=\"http://bugzilla.gnome.org/show_bug." +"cgi?id=593733\">#593733</link>. If there's an actual highlighting going on, " +"independent of the selection (like in yellow or something), we can use the " +"term \"highlight\". Otherwise we need to use the term \"select\". Watch that " +"bug." -#: C/empathy.xml:504(para) C/empathy.xml:567(para) +#: C/prev-conv.page:43(p) msgid "" -"To enable the new account, select the <guilabel>Enabled</guilabel> check-box " -"next to the name of the account in the box on the left." +"<app>Empathy</app> automatically saves all your text conversations you have " +"with your contacts. You can <link xref=\"#search\">search through all of " +"your previous conversations</link> or <link xref=\"#browse\">browse previous " +"conversations</link> by contact and date." msgstr "" -"Per abilitare il nuovo account, selezionare la casella di scelta " -"<guilabel>Abilitato</guilabel> a fianco del nome dell'account ne riquadro " -"sulla sinistra." +"<app>Empathy</app> salva automaticamente tutte le conversazioni testuali con " +"i propri contatti, consentendo di <link xref=\"#search\">eseguire ricerche " +"tra tutte le conversazioni avute</link> o di <link xref=\"#browse" +"\">esplorarle </link> in base al contatto e alla data." -#: C/empathy.xml:452(para) +#: C/prev-conv.page:51(p) msgid "" -"To add your account to <application>Empathy</application>, proceed as " -"follows: <placeholder-1/>" +"You do not need to be connected to the Internet to view and search your " +"previous conversations." msgstr "" -"Per aggiungere il proprio account a <application>Empathy</application>, " -"procedere come segue: <placeholder-1/>" +"Non è necessario essere collegati a Internet per visualizzare e cercare le " +"conversazioni precedenti." -#: C/empathy.xml:514(title) -msgid "Importing Accounts" -msgstr "Importare gli account" +#: C/prev-conv.page:58(title) +msgid "Search previous conversations" +msgstr "Eseguire ricerche nelle conversazioni precedenti" -#: C/empathy.xml:515(para) +#: C/prev-conv.page:60(p) msgid "" -"If you use another instant messaging program, you can import the accounts " -"from that program into <application>Empathy</application>" +"You can perform a full-text search through all of your previous " +"conversations." msgstr "" -"Se si usa un altro programma di messaggistica istantanea, è possibile " -"importare gli account da quel programma in <application>Empathy</application>" +"È possibile eseguire delle ricerche per testo in tutte le proprie " +"conversazioni precedenti." -#: C/empathy.xml:521(para) +#: C/prev-conv.page:64(p) C/prev-conv.page:93(p) msgid "" -"At the moment <application>Empathy</application> can import the accounts " -"only from the instant messaging program <application>Pidgin</application>. " -"For more information about <application>Pidgin</application>, see the <ulink " -"type=\"http\" url=\"http://www.pidgin.im/\">Pidgin website</ulink>." +"From the <gui>Contact List</gui> window, choose <guiseq><gui>View</" +"gui><gui>Previous Conversations</gui></guiseq>. Alternatively, press " +"<key>F3</key>." msgstr "" -"Attualmente <application>Empathy</application> è in grado di importare gli " -"account solamente dal programma di messaggistica istantanea " -"<application>Pidgin</application>. Per maggiori informazioni riguardo " -"<application>Pidgin</application>, consultarne il <ulink type=\"http\" url=" -"\"http://www.pidgin.im/\">sito web</ulink>." +"Dalla finestra <gui>Elenco contatti</gui>, scegliere " +"<guiseq><gui>Visualizza</gui><gui>Conversazioni precedenti</gui></guiseq>. " +"In alternativa, premere <key>F3</key>." -#: C/empathy.xml:542(para) +#: C/prev-conv.page:68(p) +msgid "Select the <gui>Search</gui> tab." +msgstr "Selezionare la scheda <gui>Cerca</gui>." + +#: C/prev-conv.page:71(p) msgid "" -"Click on the <guibutton>Import Accounts...</guibutton> button to open the " -"<guilabel>Import Accounts</guilabel> dialog." +"In the <gui>For</gui> field, type the text you want to search for. Click " +"<gui>Find</gui> or press <key>Enter</key>." msgstr "" -"Fare clic sul pulsante <guibutton>Importa account...</guibutton> per aprire " -"il dialogo <guilabel>Importa account</guilabel>." +"Nel campo <gui>For</gui>, digitare il testo da cercare quindi fare clic su " +"<gui>Trova</gui> o premere <key>Invio</key>." -#: C/empathy.xml:549(para) +#: C/prev-conv.page:75(p) msgid "" -"Select the accounts you would like to import by clicking on the " -"<guilabel>Import</guilabel> check-box." +"Any conversations that matched your search terms will be shown in the list " +"below the search field. By default, conversations are ordered by date." msgstr "" -"Selezionare gli account da importare facendo clic sulla casella di scelta " -"<guilabel>Importa</guilabel>." +"Qualsiasi conversazione corrispondente ai termini cercati viene visualizzata " +"nel riquadro sottostante il campo di ricerca. Come impostazione predefinita, " +"le conversazioni sono ordinate per data." -#: C/empathy.xml:555(para) +#: C/prev-conv.page:79(p) msgid "" -"When you have selected all the desired accounts, click <guibutton>OK</" -"guibutton> to import them. If you don't want to import the accounts, click " -"<guibutton>Cancel</guibutton>." +"Click on a conversation to view it. <app>Empathy</app> will select the text " +"in the conversation that matched your search terms." msgstr "" -"Selezionati tutti gli account da importare, fare clic su <guibutton>OK</" -"guibutton> per importarli. Per annullare l'importazione degli account, fare " -"clic su <guibutton>Cancel</guibutton>." +"Fare clic su una conversazione per visualizzarla. <app>Empathy</app> " +"seleziona, nella conversazione, il testo corrispondente ai termini di " +"ricerca." + +#: C/prev-conv.page:86(title) +msgid "Browse previous conversations" +msgstr "Esplorare le conversazioni precedenti" -#: C/empathy.xml:563(para) +#: C/prev-conv.page:88(p) msgid "" -"When you import a new account into <application>Empathy</application>, it " -"will not be enabled by default." +"You can browse your previous conversations with your contacts or in chat " +"rooms by date." msgstr "" -"Quando viene importato un nuovo account in <application>Empathy</" -"application>, questo non viene abilitato in modo predefinito." +"È possibile esplorare per data le conversazioni precedenti con i propri " +"contatti o in una stanza di conversazione." -#: C/empathy.xml:530(para) +#: C/prev-conv.page:97(p) +msgid "Select the <gui>Conversations</gui> tab." +msgstr "Selezionare la scheda <gui>Conversazioni</gui>." + +#: C/prev-conv.page:100(p) msgid "" -"To import the accounts into <application>Empathy</application>, proceed as " -"follows: <placeholder-1/>" +"Select an account from the drop-down list in the top left. A list of " +"contacts and chat room for that account will be shown below." msgstr "" -"Per importare gli account in <application>Empathy</application>, procedere " -"come segue: <placeholder-1/>" +"Selezionare un account dall'elenco a discesa in alto a sinistra. Un elenco " +"dei contatti e delle stanze di conversazione per quel account viene mostrato " +"nel riquadro sottostante." -#: C/empathy.xml:579(title) -msgid "Editing an Account" -msgstr "Modificare un account" +#: C/prev-conv.page:104(p) +msgid "" +"Select a contact or chat room to view your previous conversations from. By " +"default the most recent conversation will be shown." +msgstr "" +"Selezionare un contatto o una stanza di conversazione per visualizzarne le " +"conversazioni avute. Vengono mostrate, in modo predefinito, le conversazioni " +"più recenti." -#: C/empathy.xml:594(para) -msgid "Select the account you wish to edit in the box on the left." -msgstr "Selezionare l'account da modificare nel riquadro a sinistra." +#: C/prev-conv.page:108(p) +msgid "" +"You can browse your conversations by date. Days on which you had a " +"conversation with the selected contact will be shown in bold text. Click a " +"date to select it. Click the arrows next to the month and year to browse " +"earlier dates." +msgstr "" +"È possibile esplorare le conversazioni per data. I giorni in cui si è avuta " +"una conversazione con il contatto selezionato sono mostrati in grassetto. " +"Fare clic su una data per selezionarla, quindi fare clic sulle frecce a " +"fianco del mese e dell'anno per visualizzare date precedenti." -#: C/empathy.xml:600(para) -msgid "Modify the desired data." -msgstr "Modificare i dati desiderati." +#: C/prev-conv.page:114(p) +msgid "" +"You can search for text in the displayed conversation by typing into the " +"search field at the top. The matching text will be highlighted." +msgstr "" +"È possibile eseguire delle ricerche per testo nelle conversazioni " +"visualizzate. È sufficiente digitare i termini di ricerca nel campo di " +"ricerca in alto, le corrispondenza trovate verranno evidenziate." -#: C/empathy.xml:580(para) +#: C/prev-conv.page:118(p) msgid "" -"To edit one of your accounts, i.e. to change the <emphasis>password</" -"emphasis> or your <emphasis>user name</emphasis>, proceed as follows: " -"<placeholder-1/>" +"You can quickly view the previous conversations with one of your contacts " +"from the <gui>Contact List</gui> window. Simply right click the contact and " +"choose <gui>View Previous Conversations</gui>. The <gui>Previous " +"Conversations</gui> window will open with that contact already selected." msgstr "" -"Per modificare uno dei propri account, per cambiarne la <emphasis>password</" -"emphasis> o il <emphasis>nome utente</emphasis>, procedere come segue: " -"<placeholder-1/>" +"È possibile visualizzare velocemente le conversazioni precedenti avute con " +"un contatto dalla finestra <gui>Elenco contatti</gui>. Basta fare clic col " +"pulsante destro del mouse sul contatto e scegliere <gui>Conversazioni " +"precedenti</gui>. La finestra <gui>Conversazioni precedenti</gui> viene " +"aperta con quel contatto già selezionato." + +#: C/offline-contacts.page:8(desc) +msgid "See all of your contacts, even those that are not online." +msgstr "Visualizzare tutti i propri contatti, anche quelli non in rete" + +#: C/offline-contacts.page:29(title) +msgid "Show offline contacts" +msgstr "Mostrare i contatti fuori rete" -#: C/empathy.xml:608(para) +#: C/offline-contacts.page:31(p) msgid "" -"Based on the type of the account, it is possibile to edit different settings." +"Normally, <app>Empathy</app> only shows your contacts that are currently " +"online. You can show all of your contacts instead, including those that are " +"offline." msgstr "" -"In base al tipo di account è possibile modificare diverse impostazioni." +"Normalmente <app>Empathy</app> mostra solo i contatti che sono collegati in " +"rete. È comunque possibile visualizzare tutti i contatti, anche quelli fuori " +"rete." -#: C/empathy.xml:627(para) +#: C/offline-contacts.page:37(p) msgid "" -"Select the account you wish to edit in the box on the left and double-click " -"on its name." +"From the <gui>Contact List</gui> window, choose <guiseq><gui>View</" +"gui><gui>Offline Contacts</gui></guiseq>, or press <keyseq><key>Ctrl</" +"key><key>H</key></keyseq>." msgstr "" -"Selezionare l'account da modificare nel riquadro a sinistra e fare doppio-" -"clic sul suo nome." +"Dalla finestra <gui>Elenco contatti</gui>, scegliere " +"<guiseq><gui>Visualizza</gui><gui>Contatti fuori rete</gui></guiseq> o " +"premere <keyseq><key>Ctrl</key><key>H</key></keyseq>." + +#: C/offline-contacts.page:42(p) +msgid "To hide the offline contacts again, repeat the same procedure above." +msgstr "" +"Per nascondere nuovamente i contatti fuori rete, ripetere la procedura " +"precedente." + +#: C/irc-start-conversation.page:8(desc) +msgid "Start a conversation witn an IRC contact." +msgstr "Avviare una conversazione con un contatto IRC." -#: C/empathy.xml:633(para) -msgid "Change the name of the account as you desire." -msgstr "Modificare il nome dell'account come preferito." +#: C/irc-start-conversation.page:27(title) +msgid "Chat with somebody on IRC" +msgstr "Parlare con qualcuno via IRC" -#: C/empathy.xml:614(para) +#: C/irc-start-conversation.page:29(p) msgid "" -"To modify the identifier of an account, how <application>Empathy</" -"application> identifies an account, proceed as follows: <placeholder-1/>" +"You can hold private conversations with other IRC users, outside of the " +"public IRC chat rooms. To start a conversation with another IRC user:" msgstr "" -"Per modificare l'identificativo di un account, in che modo " -"<application>Empathy</application> identifica un account, procedere come " -"segue: <placeholder-1/>" +"Con gli utenti IRC è possibile avere delle conversazioni privare, al di " +"fuori delle stanze di conversazione pubbliche. Per avviare una conversazione " +"con un altro utente IRC:" -#: C/empathy.xml:642(title) -msgid "Disabling and Removing an Account" -msgstr "Disabilitare e rimuovere un account" +#: C/irc-start-conversation.page:34(p) +msgid "" +"In the contact list for an IRC chat room, double click the name of the user " +"you want to chat with. Alternatively, right click the name of the user and " +"choose <gui>Chat</gui>." +msgstr "" +"Nell'elenco contatti di una stanza di conversazione IRC, fare doppio-clic " +"sul nome dell'utente con cui avviare la conversazione. In alternativa, fare " +"clic col pulsante destro del mouse sul nome e scegliere <gui>Conversazione</" +"gui>." -#: C/empathy.xml:643(para) -msgid "To disable an account, proceed as follows:" -msgstr "Per disabilitare un account, procedere come segue:" +#: C/irc-start-conversation.page:42(p) +msgid "" +"The IRC room contact list is not the same as <app>Empathy</app> contact " +"list. It contains a list of users in the IRC chat room you joined. Different " +"rooms can have different contacts listed." +msgstr "" +"L'elenco contatti di una stanza IRC non è lo stesso dell'elenco contatti di " +"<app>Empathy</app>. Questo contiene un elenco di tutti gli utenti presenti " +"in quella particolare stanza di conversazione IRC. Stanze diverse possono " +"avere contatti diverse elencati." -#: C/empathy.xml:658(para) +#: C/irc-start-conversation.page:49(p) msgid "" -"Select the account you wish to disable in the box on the left of the dialog " -"and deselect the <guilabel>Enabled</guilabel> check-box." +"The IRC room contact list is usually on the right side of the IRC room " +"window. If you do not see it, choose <guiseq><gui>Conversation</" +"gui><gui>Show Contact List</gui></guiseq>." msgstr "" -"Seleziona l'account da disabilitare nel riquadro a sinistra del dialogo e " -"deselezionare la casella di scelta <guilabel>Abilitato</guilabel>." +"L'elenco contatti di una stanza IRC è solitamente posizionata nella parte " +"destra della finestra della stanza di conversazione. Se non è visualizzato, " +"scegliere <guiseq><gui>Conversazione</gui><gui>Mostra elenco contatti</gui></" +"guiseq>." + +#: C/irc-send-file.page:9(desc) +msgid "<app>Empathy</app> does not currently support sending files using IRC." +msgstr "" +"Attualmente <app>Empathy</app> non supporta l'invio di file utilizzando IRC." + +#: C/irc-send-file.page:28(title) +msgid "Send files over IRC" +msgstr "Inviare file via IRC" -#: C/empathy.xml:666(para) -msgid "To remove an account, proceed as follows:" -msgstr "Per rimuovere un account, procedere come segue:" +#: C/irc-send-file.page:30(p) +msgid "It is not currently possible to send files using IRC." +msgstr "Al momento non è possibile inviare file utilizzando IRC." -#: C/empathy.xml:681(para) +#: C/irc-nick-password.page:10(desc) +msgid "Protect your nickname to prevent other IRC users from using it." +msgstr "" +"Proteggere su IRC il proprio soprannome affinché non venga usato da altri." + +#: C/irc-nick-password.page:30(title) +msgid "Use a nickname password on IRC" +msgstr "Usare una password per il soprannome" + +#: C/irc-nick-password.page:32(p) msgid "" -"Select the account you wish to disable in the box on the left of the dialog." +"On some IRC networks, you can register your nickname with a service called " +"NickServ. By sending special messages to NickServ, you can set your password " +"and identify yourself. Some IRC chat rooms may not allow you to join without " +"a registered nickname." msgstr "" -"Selezionare l'account da disabilitare nel riquadro a sinistra del dialogo." +"Con alcune reti IRC è possibile registrare il proprio soprannome attraverso " +"un servizio chiamato «NickServ». Attraverso l'invio di speciali messaggi al " +"NickServ è possibile impostare una password con cui identificarsi. Alcune " +"stanze di conversazione IRC potrebbero non consentire l'accesso a persone " +"prive di un soprannome registrato." -#: C/empathy.xml:687(para) -msgid "Click on the <guibutton>Remove</guibutton> button." -msgstr "Fare clic sul pulsante <guibutton>Rimuovi</guibutton>." +#: C/irc-nick-password.page:37(p) +msgid "" +"<app>Empathy</app> does not currently support nickname registration. Some " +"IRC networks, however, will automatically forward a <em>server password</em> " +"to NickServ. On these networks, you can use the IRC password in " +"<app>Empathy</app> to identify yourself to NickServ. The popular FreeNode " +"network is known to have this feature." +msgstr "" +"Attualmente <app>Empathy</app> non supporta la registrazione del soprannome. " +"Alcune reti IRC, comunque, inoltrano automaticamente una <em>server " +"password</em> al NickServ ed è quindi possibile utilizzare la password " +"impostata nei dettagli dell'account IRC di <app>Empathy</app> per " +"identificarsi al NickServ. La rete FreeNode sfrutta questa funzionalità." + +#: C/irc-nick-password.page:43(p) +msgid "To set an IRC server password:" +msgstr "Per impostare una password per il server IRC:" + +#: C/irc-nick-password.page:51(p) +#| msgid "" +#| "Select the account you wish to disable in the box on the left of the " +#| "dialog." +msgid "Select the IRC account from the list on the left of the dialog." +msgstr "" +"Selezionare l'account IRC da disabilitare dall'elenco a sinistra del dialogo." -#: C/empathy.xml:692(para) +#: C/irc-nick-password.page:54(p) msgid "" -"A dialog will be shown asking for confirmation. Click on the " -"<guibutton>Remove</guibutton> button to remove the account." +"In the <gui>Password</gui> field, type the password you used to register " +"your nikcname." msgstr "" -"Viene mostrato un dialogo per la conferma dell'operazione. Fare clic sul " -"pulsante <guibutton>Rimuovi</guibutton> per rimuovere l'account." +"Nel campo <gui>Password</gui>, digitare la password usate per registrare il " +"proprio soprannome." -#: C/empathy.xml:702(title) -msgid "Editing Personal Information" -msgstr "Modificare le informazioni personali" +#: C/irc-nick-password.page:60(p) C/import-account.page:58(p) +msgid "Click <gui>Apply</gui>." +msgstr "Fare clic su <gui>Applica</gui>." -#: C/empathy.xml:703(para) +#: C/irc-nick-password.page:66(p) msgid "" -"To change your personal information, your alias and your icon (the image " -"that other contacts will see of you), for each of your accounts, proceed as " -"follows:" +"These instructions only allow you to use a password-protected nickname on " +"certain IRC networks. It is not currently possible to register an IRC " +"nickname or change your nickname password using <app>Empathy</app>." msgstr "" -"Per modificare le proprie informazioni personali, il proprio pseudonomio o " -"l'icona (l'immagine che altri contatti vedono relativamente al proprio " -"profilo), per ognuno degli account disponibile, procedere come segue:" +"Queste istruzioni consentono di usare un soprannome protetto da password " +"solo su alcune tipologie di reti IRC. Al momento non è possibile registrare " +"un soprannome IRC o modificare la password utilizzando <app>Empathy</app>." + +#: C/irc-manage.page:8(desc) +msgid "How to use IRC with <app>Empathy</app>." +msgstr "Come usare IRC con <app>Empathy</app>." + +#: C/irc-manage.page:29(title) +msgid "Internet Relay Chat (IRC)" +msgstr "Internet Relay Chat (IRC)" + +#: C/irc-manage.page:33(title) +msgid "IRC Chat Rooms and Conversations" +msgstr "Stanze di conversazione e conversazioni IRC" + +#: C/irc-manage.page:35(title) +msgid "Chat Rooms and Conversations" +msgstr "Stanze di conversazione e conversazioni" + +#: C/irc-manage.page:40(title) +msgid "Common IRC Problems" +msgstr "Problemi comuni con IRC" + +#: C/irc-manage.page:42(title) C/index.page:50(title) +msgid "Common Problems" +msgstr "Problemi comuni" + +#: C/irc-join-room.page:8(desc) +msgid "Join an IRC channel." +msgstr "Entrare in un canale IRC." + +#: C/irc-join-room.page:28(title) +msgid "Join an IRC chat room" +msgstr "Entrare in una stanza di conversazione" -#: C/empathy.xml:711(para) +#: C/irc-join-room.page:30(p) msgid "" -"From the <link linkend=\"empathy-FIG-mainwindow\">main window</link>, select " -"<menuchoice><guimenu>Edit</guimenu><guimenuitem>Personal Information</" -"guimenuitem></menuchoice>." +"You can join IRC chat rooms (also known as IRC channels) on any IRC network " +"you’re connected to. To connect to an IRC network, see <link xref=\"add-" +"account\"/> and <link xref=\"account-irc\"/>." msgstr "" -"Dalla <link linkend=\"empathy-FIG-mainwindow\">finestra principale</link>, " -"scegliere <menuchoice><guimenu>Modifica</guimenu><guimenuitem>Informazioni " -"personali...</guimenuitem></menuchoice>." +"È possibile entrare in stanze di conversazione IRC (note anche come canali " +"IRC) su qualisiasi rete IRC si sia connessi. Per connettersi a una rete IRC, " +"consultare <link xref=\"add-account\"/> e <link xref=\"account-irc\"/>." -#: C/empathy.xml:720(para) +#: C/irc-join-room.page:36(p) C/group-conversations.page:55(p) +#: C/group-conversations.page:119(p) msgid "" -"From the <guilabel>Account</guilabel> drop-down list, choose the account you " -"want to edit." +"From the <gui>Contact List</gui> window, choose <guiseq><gui>Room</" +"gui><gui>Join</gui></guiseq>." msgstr "" -"Dall'elenco a discesa <guilabel>Account</guilabel>, scegliere l'account da " -"modificare." +"Dalla finestra <gui>Elenco contatti</gui>, scegliere <guiseq><gui>Stanza</" +"gui><gui>Entra</gui></guiseq>." -#: C/empathy.xml:726(para) -msgid "In the <guilabel>Alias</guilabel> text box, write your new alias." +#: C/irc-join-room.page:42(p) +#| msgid "" +#| "From the <guilabel>Account</guilabel> drop-down list, choose the account " +#| "you want to edit." +msgid "" +"From the <gui>Account</gui> drop-down list, select the IRC account that " +"corresponds to the network you want to use." msgstr "" -"Nella casella di testo <guilabel>Pseudonimo</guilabel>, digitare uno " -"pseudonimo con cui indentificare il proprio account." +"Dall'elenco a discesa <gui>Account</gui>, selezionare l'account IRC che " +"corrisponde alla rete da usare." -#: C/empathy.xml:732(para) +#: C/irc-join-room.page:48(p) +#| msgid "" +#| "In the <guilabel>Alias</guilabel> text box type the name you want to give " +#| "at the the new contact." msgid "" -"To change your icon, click on the person-looking button and choose an image " -"file." +"In the <gui>Room</gui> text box, type the name of the channel you want to " +"join. IRC channel names start with the hash character (<sys>#</sys>)." msgstr "" -"Per modificare la propria immagine, fare clic sul pulsante che raffigura una " -"persona e scegliere una nuova immagine." +"Nella casella di testo <gui>Stanza</gui>, digitare il nome del canale in cui " +"entrare. I nomi dei canali IRC iniziano tutti col carattere cancelletto " +"(<sys>#</sys>)." + +#: C/irc-join-room.page:54(p) +msgid "Click <gui>Join</gui> to enter the room." +msgstr "Fare clic su <gui>Entra</gui> per entrare nella stanza." -#: C/empathy.xml:738(para) C/empathy.xml:1319(para) C/empathy.xml:1353(para) -msgid "When done, click <guibutton>Close</guibutton>." -msgstr "Quando finito, fare clic su <guibutton>Chiudi</guibutton>." +#: C/irc-join-room.page:61(p) +msgid "" +"To join multiple rooms, you need to repeat the steps above for each room." +msgstr "" +"Per poter entrare in più stanze di conversazione, è necessario ripetere i " +"passi precedenti per ciascuna stanza." -#: C/empathy.xml:746(para) +#: C/irc-join-pwd.page:9(desc) msgid "" -"An <emphasis>alias</emphasis> is an alternative way you can identify " -"yourself. You can use your real name or a nickname." +"<app>Empathy</app> does not currently support password-protected IRC chat " +"rooms." msgstr "" -"Uno <emphasis>pseudonimo</emphasis> è un modo alternativo con cui è " -"possibile identificarsi. È possibile usare il proprio vero nome oppure un " -"soprannome." +"Attualmente <app>Empathy</app> non supporta stanze di conversazione protette " +"da password." -#: C/empathy.xml:756(title) -msgid "Advanced Options" -msgstr "Opzioni avanzate" +#: C/irc-join-pwd.page:28(title) +msgid "Join a protected IRC chat room" +msgstr "Entrare in una stanza di conversazione IRC protetta" -#: C/empathy.xml:757(para) +#: C/irc-join-pwd.page:30(p) msgid "" -"Based on the service you are using, it is possible to configure more " -"advanced options to modify the normal behavior of <application>Empathy</" -"application>." +"It is not currently possible to join a password-protected IRC chat room." msgstr "" -"In base ai servizi di messaggistica che si usano, è possibile configurare " -"deiverse opzioni avanzate per modificare il funzionamento predefinito di " -"<application>Empathy</application>." +"Al momento non è possibile entrare in una stanza di conversazione IRC " +"protetta da password." -#: C/empathy.xml:762(para) +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/introduction.page:45(None) +#| msgid "" +#| "@@image: 'figures/empathy-main-window.png'; " +#| "md5=38259a866f38ff1f754828e46d2b0e5c" msgid "" -"To configure these options, when you are <link linkend=\"empathy-create-" -"account\">adding a new account</link>, click on the drop-down section " -"<guilabel>Advanced</guilabel>." +"@@image: 'figures/empathy-main-window.png'; " +"md5=489ba00b0fc377aba4c691210b6e0650" +msgstr "fatto" + +#: C/introduction.page:9(desc) +msgid "Introduction to the <app>Empathy</app> instant messenger." msgstr "" -"Per configurare queste opzioni, quando si sta <link linkend=\"empathy-create-" -"account\">aggiungendo un nuovo account</link>, fare clic sulla sezione a " -"discesa <guilabel>Avanzato</guilabel>." +"Introduzione al programma di messaggistica istantanea <app>Empathy</app>." -#: C/empathy.xml:770(title) -msgid "Jabber (or <acronym>XMPP</acronym>) and Google Talk" -msgstr "Jabber (o <acronym>XMPP</acronym>) e Google Talk" +#: C/introduction.page:25(title) +msgid "Introduction" +msgstr "Introduzione" -#: C/empathy.xml:777(guilabel) -msgid "Encryption required (TLS/SSL)" -msgstr "Richiesta cifratura (TLS/SSL)" +#: C/introduction.page:27(p) +msgid "" +"<app>Empathy</app> is an instant messaging application for the GNOME " +"Desktop. It supports text messaging, voice & video call, file transfers " +"and all the most used messaging systems such as MSN and Google Talk." +msgstr "" +"<app>Empathy</app> è un'applicazione per la messaggistica istantanea per lo " +"GNOME Desktop. Supporta messaggi testuali, chiamate audio e video, invio di " +"file e tutti i più usati sistemi di messaggistica come MSN e Google Talk." -#: C/empathy.xml:780(para) +#: C/introduction.page:32(p) msgid "" -"Select this option in order to use some sort of encryption during your " -"conversations." +"<app>Empathy</app> includes features that help you better collaborate while " +"at work, and that let you easily keep in touch with your friends." msgstr "" -"Selezionare questa opzione per utilizzare una qualche sorta di cifratura " -"durante le proprie conversazioni." +"<app>Empathy</app> è dotato di funzionalità che consentono di collaborare al " +"meglio quando si è al lavoro e di mantenere facilmente i contatti con i " +"propri amici." -#: C/empathy.xml:788(guilabel) -msgid "Ignore SSL certificate errors" -msgstr "Ignorare errori certificati SSL" +#: C/introduction.page:36(p) +msgid "" +"You can group all the conversations in a single window, or have multiple " +"windows for different kind of conversations; easily search through your " +"previous conversations, and share your desktop in just two clicks." +msgstr "" +"È possibile raggruppare le conversazioni in una singola finestra o avere " +"diverse finestre in base al tipo di conversazione; è possibile eseguire " +"ricerche tra le conversazioni precedenti e condividere il proprio desktop in " +"pochi clic." + +#: C/introduction.page:43(title) +msgid "<gui>Contact List</gui> window" +msgstr "Finestra <gui>Elenco contatti</gui>" + +#: C/introduction.page:44(desc) +#| msgid "<application>Empathy</application> Main Window" +msgid "<app>Empathy</app> main window" +msgstr "La finestra principale di <app>Empathy</app>" + +#: C/introduction.page:46(p) +#| msgid "<application>Empathy</application> Main Window" +msgid "<app>Empathy</app> main window." +msgstr "Finestra principale di <app>Empathy</app>." + +#: C/index.page:27(title) +msgid "Empathy Instant Messenger" +msgstr "Messaggistica istantanea Empathy" + +#: C/index.page:30(title) +msgid "Text Conversations" +msgstr "Conversazioni testuali" + +#: C/index.page:34(title) +msgid "Audio and Video Conversations" +msgstr "Conversazioni audio e video" + +#: C/index.page:38(title) +#| msgid "Contact List" +msgid "Contact Management" +msgstr "Gestione dei contatti" + +#: C/index.page:42(title) +msgid "Account Management" +msgstr "Gestione degli account" + +#: C/index.page:46(title) +#| msgid "Advanced Options" +msgid "Advanced Actions" +msgstr "Operazioni avanzate" + +#: C/import-account.page:10(desc) +#| msgid "Empathy is an application for instant messaging." +msgid "Import an account from another instant messaging application." +msgstr "Importare un account da un'altra applicazioni di messaggistica." + +#: C/import-account.page:19(name) +msgid "Peter Haslam" +msgstr "Peter Haslam" + +#: C/import-account.page:20(email) +msgid "peter.haslam@freenet.de" +msgstr "peter.haslam@freenet.de" + +#: C/import-account.page:39(title) +#| msgid "Importing Accounts" +msgid "Import an existing account" +msgstr "Importare un account esistente" + +#: C/import-account.page:41(p) +msgid "" +"The first time you run <app>Empathy</app>, it will offer to import your " +"accounts from other instant messaging applications. Currently, the only " +"supported application is <app>Pidgin</app>." +msgstr "" +"La prima volta che viene avviato <app>Empathy</app>, è possibile importare i " +"propri account da altre applicazioni di messaggistica istantanea. Al " +"momento, la sola applicazione supportata è <app>Pidgin</app>." -#: C/empathy.xml:791(para) +#: C/import-account.page:47(p) msgid "" -"Select this option in order to ignore the errors that can be generated by " -"some types of security certificates. Usually these certificates are called " -"auto-signed." +"Run <app>Empathy</app> for the first time. An assistant will offer you a " +"number of options to create new accounts." msgstr "" -"Selezionare questa opzione per ignorare gli errori che possono venir " -"generati da alcune tipologie di certificati di sicurezza. Solitamente questi " -"certificati sono chiamati auto-firmati." +"Avviare <app>Empathy</app> per la prima volta. Viene presentato un " +"assistente con diverse opzioni per creare nuovi account." -#: C/empathy.xml:799(para) +#: C/import-account.page:51(p) msgid "" -"Select this option only if you are sure the certificate is secure and you " -"can trust it." +"Select <gui>Yes, import my account details from</gui> and click " +"<gui>Forward</gui>." msgstr "" -"Selezionare questa opzione solo se si è sicuri che il certificato è sicuro e " -"ci si possa fidare." +"Scegliere <gui>Sì, importare gli account da</gui> e fare clic su " +"<gui>Avanti</gui>." -#: C/empathy.xml:809(guilabel) -msgid "Resource" -msgstr "Risorsa" +#: C/import-account.page:55(p) +msgid "Select the check box next to each account you wish to import." +msgstr "" +"Selezionare la casella di testo a fianco di ciascun account da importare." -#: C/empathy.xml:812(para) -msgid "" -"Use this text box to set a name with which you can identify the running " -"program based on where you are running it. With this option, and the " -"<guilabel>Priority</guilabel> one, you can use your account simultaneously " -"in two different devices. For example, if you set one device to " -"<replaceable>desktop</replaceable> and the other one to <replaceable>mobile</" -"replaceable>, you can connect with both of them and based on the " -"<guilabel>Priority</guilabel> value you will receive messages on one of the " -"two devices or both." -msgstr "" -"Usare questa casella di testo per impostare un nome con cui identificare il " -"programma in esecuzione in base a dove viene eseguito. Tramite questa " -"opzione, e la <guilabel>Priorità</guilabel>, è possibile usare il proprio " -"account contemporaneamente in due dispositivi diversi. Per esempio, se un " -"dispositivo viene impostato come <replaceable>desktop</replaceable> e " -"l'altro come <replaceable>portatile</replaceable>, è possibile collegarsi " -"con entrambi e in base al valore di <guilabel>Priorità</guilabel> si " -"riceveranno i messaggi su uno dei due dispositivi o su entrambi." - -#: C/empathy.xml:825(para) -msgid "" -"This can be useful if you have two devices, a main one and a portable one, " -"and you move away from the main one bringing with you the other: you can " -"still receive messages from your account with the portable device even if " -"you do not disconnet from the main one." -msgstr "" -"Questo può essere particolarmente utile se si disponde di due dispositivi, " -"uno principale e uno portatile, e ci si sposta da quello principale portando " -"con sè il portatile: è possibile ricevere i messaggi inviati al proprio " -"account con il dispositivo portatile anche se non ci si disconnette da " -"quello principale." - -#: C/empathy.xml:834(para) -msgid "" -"If you set the same value for this text box on both the devices, when you " -"connect with one of them, the other one will be disconnected, even if you " -"set a different value with the <guilabel>Priority</guilabel> spin box." -msgstr "" -"Se questa casella di testo viene impostata con lo stesso valore su entrambi " -"i dispositivi, quando ci si connette con uno dei due, l'altro verrà " -"disconnesso, anche se viene impostato un valore diverso con il controllo di " -"selezione <guilabel>Priorità</guilabel>." - -#: C/empathy.xml:847(guilabel) -msgid "Priority" -msgstr "Priorità" +#: C/import-account.page:63(p) +msgid "" +"It is not currently possible to import accounts after you have completed the " +"first-run assistant." +msgstr "" +"Al momento non è possibile importare gli account una volta completati i " +"passi dell'assistente dopo il primo avvio dell'applicazione." + +#: C/group-conversations.page:8(desc) +msgid "Start or join a group conversation with your contacts." +msgstr "" +"Avviare o entrare in una conversazione di gruppo con i propri contatti." + +#: C/group-conversations.page:31(title) +msgid "Group conversations" +msgstr "Conversazioni di gruppo" -#: C/empathy.xml:850(para) +#: C/group-conversations.page:33(p) msgid "" -"Use this spin box to indicate wich device, set in the <guilabel>Resource</" -"guilabel> text box, will receive the new messages. The higher the number, " -"the higher the priority: you will receive the new messages on the device " -"with the highest number." +"Group conversations permits you to have text conversations with more than " +"one contact at the same time." msgstr "" -"Usare questo controllo di selezione per indicare quale dispositivo, " -"impostato tramite la casella di testo <guilabel>Risorsa</guilabel>, riceverà " -"i nuovi messaggi. Maggiore il valore, più alta è la priorità: i messaggi " -"verranno ricevuti dal dispositivo con priorità maggiore." +"Le conversazioni di gruppo consentono di tenere conversazioni testuali con " +"più di un contatto." -#: C/empathy.xml:857(para) +#: C/group-conversations.page:37(p) msgid "" -"You can set values in the range from <literal>-128</literal> to " -"<literal>127</literal>." +"To have a group conversation you need to have a registered account with " +"either Jabber or Google Talk, or a People Nearby account." msgstr "" -"È possibile impostare questo valore nell'intervallo tra <literal>-128</" -"literal> e <literal>127</literal>." +"Per tenere una conversazione di gruppo è necessario avere un account " +"registrato con Jabber o con Google Talk oppure un account «Persone nelle " +"vicinanze»." -#: C/empathy.xml:863(para) +#: C/group-conversations.page:43(p) msgid "" -"If you set the same value of this spin box in both the devices, you will " -"receive messages on both of them." +"You can have a group conversation only with the contacts that are using the " +"same service as yours." msgstr "" -"Se viene impostato lo stesso valore per questo controllo di selezione su " -"entrambi i dispositivi, si riceveranno i messaggi su entrambi." +"È possibile tenere una conversazione di gruppo solo con i contatti che " +"utilizzano lo stesso servizio." -#: C/empathy.xml:880(guilabel) C/empathy.xml:973(guilabel) -#: C/empathy.xml:1021(guilabel) C/empathy.xml:1115(guilabel) -msgid "Server" -msgstr "Server" +#: C/group-conversations.page:51(title) +msgid "Start a group conversation" +msgstr "Avviare una conversazione di gruppo" -#: C/empathy.xml:883(para) C/empathy.xml:976(para) C/empathy.xml:1024(para) -#: C/empathy.xml:1118(para) +#: C/group-conversations.page:60(p) +#| msgid "" +#| "From the <guilabel>Account</guilabel> drop-down list, choose the account " +#| "you want to edit." msgid "" -"Use this text box to write the name of the server you want to use for this " -"service." +"From the <gui>Account</gui> drop-down list, select the account you want to " +"use for the group conversation." +msgstr "" +"Dall'elenco a discesa <gui>Account</gui>, scegliere l'account da usare per " +"la conversazione di gruppo." + +#: C/group-conversations.page:66(p) +#| msgid "" +#| "In the <guilabel>Alias</guilabel> text box type the name you want to give " +#| "at the the new contact." +msgid "" +"In the <gui>Server</gui> text box, type the name of server in which the " +"conversation will be hosted." msgstr "" -"Usare questa casella di testo per indicare il nome del server da usare per " -"questo servizio." +"Nella casella di testo <gui>Server</gui> digitare il nome del server in cui " +"verrà ospitata la conversazione." -#: C/empathy.xml:891(guilabel) C/empathy.xml:984(guilabel) -#: C/empathy.xml:1032(guilabel) C/empathy.xml:1126(guilabel) -msgid "Port" -msgstr "Porta" +#: C/group-conversations.page:70(p) +msgid "Leave it empty if it will be on the current server." +msgstr "Lasciare vuoto se si trova sul server attuale." -#: C/empathy.xml:894(para) C/empathy.xml:987(para) C/empathy.xml:1035(para) -#: C/empathy.xml:1129(para) -msgid "Use this spin box to set the number of the port of the server to use." +#: C/group-conversations.page:75(p) +#| msgid "" +#| "In the <guilabel>Alias</guilabel> text box type the name you want to give " +#| "at the the new contact." +msgid "" +"In the <gui>Room</gui> text box, type the name you want to give to the " +"conversation." msgstr "" -"Usare questo controllo di selezione per impostare il numero della porta da " -"usare con il server." +"Nella casella di testo <gui>Stanza</gui> digitare il nome da dare alla " +"conversazione." -#: C/empathy.xml:898(para) C/empathy.xml:991(para) C/empathy.xml:1039(para) -#: C/empathy.xml:1133(para) +#: C/group-conversations.page:79(p) msgid "" -"You can set values in the range from <literal>0</literal> to " -"<literal>65,555</literal>." +"This will be the name of the room you are going to have a conversation. This " +"name will be publicly available for other people to join. It is not possible " +"to create a private room." msgstr "" -"È possibile impostare questo valore nell'intervallo tra <literal>0</literal> " -"e <literal>65.555</literal>." +"Questo sarà il nome della stanza in cui sarà tenuta la conversazione di " +"gruppo e sarà pubblicamente visibile affinché altre persone possano " +"entrarvi. Non è possibile creare una stanza privata." -#: C/empathy.xml:906(guilabel) -msgid "Use old SSL" -msgstr "Usare vecchio SSL" +#: C/group-conversations.page:87(p) +msgid "" +"To invite other contacts to join the group conversation, from the " +"<gui>Contact List</gui> window, select the contact you want to invite, and " +"perform one of the following:" +msgstr "" +"Per invitare altri contatti a entrare nella conversazione, dalla finestra " +"<gui>Elenco contatti</gui>, selezionare il contatto da inviare ed eseguire " +"una delle seguenti azioni:" + +#: C/group-conversations.page:94(p) +msgid "Right-click on the contact and choose <gui>Invite to chatroom</gui>." +msgstr "" +"Fare clic sul nome del contatto e scegliere <gui>Invita nella stanza</gui>." -#: C/empathy.xml:909(para) +#: C/group-conversations.page:99(p) msgid "" -"Select this option to use the old version of the secure protocol for " -"encrypting your connection." +"Choose <guiseq><gui>Edit</gui><gui>Contact</gui><gui>Invite to chatroom</" +"gui></guiseq>." msgstr "" -"Selezionare questa opzione per utilizzare la vecchia versione del protocollo " -"di sicurezza nel cifrare la connessione." +"Scegliere <guiseq><gui>Modifica</gui><gui>Contatto</gui><gui>Invita nella " +"stanza</gui></guiseq>." -#: C/empathy.xml:874(para) +#: C/group-conversations.page:104(p) msgid "" -"In the <guilabel>Override server settings</guilabel> section you can set " -"options that take precedence over the default settings. <placeholder-1/>" +"If you have more than one group conversation open, select the one you want " +"to invite your contacts." msgstr "" -"Nella sezione <guilabel>Scavalcare impostazioni server</guilabel> è " -"possibile impostare delle opzioni che hanno la precedenza rispetto le " -"impostazioni predefinite. <placeholder-1/>" +"Se sono aperte più conversazioni di gruppo, selezionare quella in cui " +"invitare i propri contatti." -#: C/empathy.xml:925(guilabel) -msgid "Ignore conference and chatrooms invitations" -msgstr "Ignorare conferenze e inviti per canali" +#: C/group-conversations.page:115(title) +msgid "Join a group conversation" +msgstr "Entrare in una conversazione di gruppo" -#: C/empathy.xml:929(para) +#: C/group-conversations.page:125(p) +msgid "Expand the <gui>Room List</gui> section to see all the existing rooms." +msgstr "" +"Espandere la sezione <gui>Elenco stanze</gui> per visualizzare tutte le " +"stanze esistenti." + +#: C/group-conversations.page:130(p) +msgid "Double-click on the name of a room to join it." +msgstr "Fare doppio-clic sul nome della stanza in cui entrare." + +#: C/group-conversations.page:136(p) msgid "" -"Select this option to ignore the invitations that other people may send you." +"It is not possible to join all existing rooms. Some of the rooms might " +"require a password, or might be invitation only. <app>Empathy</app> does not " +"support these kind of rooms." msgstr "" -"Selezionare questa opzione per ignorare gli inviti che altri contatti " -"potrebbero inviare." +"Non è possibile entrare in tutte le stanze esistenti. Alcune di queste " +"potrebbero richiedere una password o essere a invito. <app>Empathy</app> non " +"supporta questo tipo di stanze." + +#: C/geolocation-what-is.page:9(desc) +msgid "Understanding geolocation." +msgstr "Comprendere la geo-localizzazione." -#: C/empathy.xml:937(guilabel) -msgid "Room List locale" -msgstr "Nazione elenco canali" +#: C/geolocation-what-is.page:30(title) +msgid "What is geolocation" +msgstr "Cos'è la geo-localizzazione" -#: C/empathy.xml:940(para) +#: C/geolocation-what-is.page:32(p) msgid "" -"The value of this text box identifies the language used to retrieve the room " -"list when connecting to the Yahoo service." +"Geolocation allows you to identify the real geographical location of a " +"computer or a device connected to the Internet." msgstr "" -"Il valore indicato in questa casella di testo identifica la lingua usata per " -"recupeare l'elenco delle stanze nella connessione al servizio Yahoo." +"La geo-localizzazione consente di identificare la vera posizione geografica " +"di un computer o di un dispositivo collegato a Internet." -#: C/empathy.xml:945(para) +#: C/geolocation-what-is.page:34(p) +msgid "With geolocation in <app>Empathy</app> you can:" +msgstr "" +"Attraverso l'uso della geo-localizzazione in <app>Empathy</app> è possibile:" + +#: C/geolocation-what-is.page:39(p) +msgid "Publish your geographical location to your contacts." +msgstr "Pubblicare la posizione geografica ai propri contatti." + +#: C/geolocation-what-is.page:44(p) +msgid "See your contacts’ geographical location and quickly contact them." +msgstr "" +"Visualizzare la posizione geografica dei propri contatti e avviare " +"rapidamente una conversazione con loro" + +#: C/geolocation-what-is.page:49(p) msgid "" -"If you need to change this value, use the two letter code of your language." +"Set the accuracy of your location and the device used to discover your " +"location." msgstr "" -"Nel caso sia necessario modificare questo valore, usare il codice a due " -"lettere della propria lingua." +"Impostare la precisione della propria posizione e il dispositivo usato per " +"determinare tale posizione." -#: C/empathy.xml:953(guilabel) C/empathy.xml:1095(guilabel) -msgid "Charset" -msgstr "Codifica caratteri" +#: C/geolocation-what-is.page:57(p) +msgid "" +"In order to see your contacts’ geographical locations, they need to use a " +"service and an application that supports geolocation." +msgstr "" +"Per poter visualizzare la posizione geografica dei propri contatti è " +"necessario loro utilizzino un servizio e un programma che supportino la geo-" +"localizzazione." + +#: C/geolocation-turn.page:9(desc) +msgid "How to activate and deactivate geolocation in <app>Empathy</app>." +msgstr "" +"Come attivare e disattivare la geo-localizzazione in <app>Empathy</app>." -#: C/empathy.xml:956(para) C/empathy.xml:1098(para) +#: C/geolocation-turn.page:30(title) +msgid "Activate/Deactivate geolocation" +msgstr "Attivare/Disattivare la geo-localizzazione" + +#: C/geolocation-turn.page:34(p) +msgid "Choose <guiseq><gui>Edit</gui><gui>Preferences</gui></guiseq>." +msgstr "Scegliere <guiseq><gui>Modifica</gui><gui>Preferenze</gui></guiseq>." + +#: C/geolocation-turn.page:39(p) +msgid "Select the <gui>Location</gui> tab." +msgstr "Selezionare la scheda <gui>Posizione geografica</gui>." + +#: C/geolocation-turn.page:44(p) +msgid "" +"Select <gui>Publish location to my contacts</gui> to activate geolocation." +msgstr "" +"Selezionare <gui>Pubblicare la posizione geografica ai propri contatti</gui> " +"per attivare la geo-localizzazione." + +#: C/geolocation-turn.page:47(p) +msgid "To deactivate geolocation, deselect it." +msgstr "Per disattivare la geo-localizzazione, deselezionarlo." + +#: C/geolocation-turn.page:52(p) msgid "" -"The value of this text box identifies the set of the characters used by " -"<application>Empathy</application>." +"To increase the accuracy of your position, deselect <gui>Reduce location " +"accuracy</gui>." msgstr "" -"Il valore di questa casella di testo identifica il set di caratteri usato da " -"<application>Empathy</application>." +"Per aumentare la precisione della propria posizione, deselezionare " +"<gui>Ridurre la precisione della posizione geografica</gui>." -#: C/empathy.xml:962(para) C/empathy.xml:1104(para) +#: C/geolocation-turn.page:58(p) msgid "" -"It is advise to leave this value to <literal>UTF-8</literal>. Change it only " -"if that charset does not cover your language." +"If you have an external device like a GPS or want to send a more accurate " +"position, select the appropriate option in the <gui>Geoclue Settings</gui> " +"section." msgstr "" -"È consigliato lasciare questo valore impostato a <literal>UTF-8</literal>. " -"Modificarlo solo se tale set di caratteri non include la propria lingua." +"Se si dispone di un dispositivo esterno come un GPS o per inviare " +"informazioni più precise sulla posizione, selezionare le opzioni appropriate " +"nella sezione <gui>Impostazioni Geoclue</gui> section." -#: C/empathy.xml:999(guilabel) -msgid "Use Yahoo Japan" -msgstr "Usare Yahoo Giappone" +#: C/geolocation-supported.page:7(desc) +msgid "Services that supports geolocation and compatibility." +msgstr "Servizi che supportano la geo-localizzazione e compatibilità." -#: C/empathy.xml:1002(para) +#: C/geolocation-supported.page:28(title) +msgid "Supported services" +msgstr "Servizi supportati" + +#: C/geolocation-supported.page:30(p) msgid "" -"Select this option only if you have a Yahoo! Japan account. With the Yahoo! " -"Japan service you can only use a Yahoo! Japan account: if you have " -"registered an account with the English version of the service, that account " -"will not work." +"The geolocation feature at the moment is compatible only with the Jabber " +"service. In order to use it, you and your contacts need to have a Jabber " +"account." msgstr "" -"Selezionare questa opzione solo se si possiede un account Yahoo! Giappone. " -"Con il servizio Yahoo! Giappone è possibile usare un account Yahoo! " -"Giappone: se è stato registrato un account con la versione italiana del " -"servizio, tale account non funziona." +"Al momento, la funzionalità di geo-localizzazione è compatibile solo con il " +"servizio Jabber. Affinché sia possibile usarla, è necessario disporre di un " +"account Jabber e che anche i propri contatti ne abbiano uno." -#: C/empathy.xml:1016(title) -msgid "<acronym>AIM</acronym>, GroupWise and <acronym>MSN</acronym>" -msgstr "<acronym>AIM</acronym>, GroupWise e <acronym>MSN</acronym>" +#: C/geolocation-supported.page:36(p) +msgid "" +"It is necessary that also the server you are using supports the geolocation " +"feature. Most of the Jabber servers support it. See your service website " +"documentation for more information." +msgstr "" +"È necessario anche che il server utilizzato supporti la geo-localizzazione. " +"La maggior parte dei server Jabber la supporta. Per maggiori informazioni, " +"consultare la documentazione presente nel sito web del proprio servizio." -#: C/empathy.xml:1055(guilabel) -msgid "Published Name" -msgstr "Nome visibile" +#: C/geolocation-supported.page:44(title) +msgid "Compatibility" +msgstr "Compatibilità" -#: C/empathy.xml:1058(para) +#: C/geolocation-supported.page:46(p) msgid "" -"Use this text box to write the name that will be visible to the other users " -"of the network." +"<app>Empathy</app> geolocation feature is not compatible with other " +"geographical position services such as <em>Google Latitude</em>, <em>Yahoo " +"Fire Eagle</em> or <em>Brightkite</em>." msgstr "" -"Usare questa casella di testo per indicare il nome che gli altri utenti " -"della rete visualizzeranno." +"La funzionalità di geo-localizzazione di <app>Empathy</app> non è " +"compatibile con altri servizi di posizionamento geografico come <em>Google " +"Latitude</em>, <em>Yahoo Fire Eagle</em> o <em>Brightkite</em>." -#: C/empathy.xml:1066(guilabel) -msgid "Email" -msgstr "Email" +#: C/geolocation-privacy.page:8(desc) +msgid "What information are sent and to who." +msgstr "Quali informazioni sono inviate e a chi." -#: C/empathy.xml:1069(para) -msgid "Use this text box to write your email." -msgstr "Usare questa casella di testo per scrivere il proprio indirizzo email." +#: C/geolocation-privacy.page:29(title) +msgid "Geolocation Privacy" +msgstr "Privacy della geo-localizzazione" -#: C/empathy.xml:1076(guilabel) -msgid "Jabber ID" -msgstr "ID Jabber" +#: C/geolocation-privacy.page:32(title) +msgid "What information is sent" +msgstr "Informazioni inviate" -#: C/empathy.xml:1079(para) -msgid "Use this text box to write your Jabber ID, if you have one." +#: C/geolocation-privacy.page:33(p) +msgid "" +"What is possible to send is: your country, region, locality, area, street, " +"building, floor, room, and postal code, longitude, latitude and altitude, " +"speed and bearing." msgstr "" -"Usare questa casella di testo per indicare il proprio ID di Jabber nel caso " -"se ne abbia uno." +"Le informazioni che è possibile inviare sono: il proprio Paese, regione, " +"località, area, via, palazzo, piano, stanza e codice postale, longitudine, " +"latitudine a altitudine, velocità e orientamento." -#: C/empathy.xml:1144(title) -msgid "Gadu Gadu" -msgstr "Gadu Gadu" +#: C/geolocation-privacy.page:37(p) +msgid "" +"The accuracy and the quantity of information about your geographical " +"position are based on the software or on the infrastructure used to discover " +"your position." +msgstr "" +"La precisione e la quantità di informazioni della propria posizione " +"geografica sono basate sul software o sull'infrastruttura utilizzata per " +"scoprirla." -#: C/empathy.xml:1148(guilabel) -msgid "Nick" -msgstr "Soprannome" +#: C/geolocation-privacy.page:41(p) +msgid "" +"Different kind of networks may have different accuracy settings, and may " +"send different information. The use of external devices such as GPS or " +"mobile phone will increase the accuracy of the information sent." +msgstr "" +"Diversi tipi di rete possono avere diverse impostazioni relative alla " +"precisione e possono inviare diverse informazioni. L'utilizzo di dispositivi " +"come GPS e telefoni cellulari aumenta la precisione delle informazioni " +"inviate." + +#: C/geolocation-privacy.page:46(p) +msgid "" +"When the privacy mode is enabled, nothing more precise than your city will " +"be sent, even if you are using an external device." +msgstr "" +"Quando la modalità privacy è abilitata, non viene inviato niente di più " +"preciso della propria città, anche se viene utilizzato un dispositivo " +"esterno." + +#: C/geolocation-privacy.page:53(title) +msgid "Who can see the information sent" +msgstr "Chi può visualizzare le informazioni inviate" + +#: C/geolocation-privacy.page:54(p) +msgid "Only your contacts can see your geographical position." +msgstr "" +"Solo i propri contatti possono visualizzare la posizione geografica " +"personale." + +#: C/geolocation-privacy.page:60(title) +msgid "What is the privacy mode" +msgstr "Cos'è la modalità privacy" + +#: C/geolocation-privacy.page:61(p) +msgid "" +"The privacy mode, enabled by default, is a reduced accuracy mode that will " +"decrease the accuracy of the geographical position sent to your contacts." +msgstr "" +"La modalità privacy, abilitata in modo predefinito, è una modalità a " +"precisione ridotta che riduce la precisione della posizione geografica " +"inviata ai propri contatti." + +#: C/geolocation-privacy.page:68(title) +msgid "Privacy overview" +msgstr "Panoramica della privacy" + +#: C/geolocation-privacy.page:69(p) +msgid "" +"Overview of the various geolocation privacy settings in <app>Empathy</app>." +msgstr "" +"Panoramica delle varie impostazioni in <app>Empathy</app> per preservare la " +"privacy." + +#: C/geolocation-privacy.page:74(p) +msgid "Geolocation is not enabled by default." +msgstr "La geo-localizzazione non è abilitata in modo predefinito." + +#: C/geolocation-privacy.page:79(p) +msgid "Privacy mode is enabled by default." +msgstr "La modalità privacy è abilitata in modo predefinito." + +#: C/geolocation-privacy.page:84(p) +msgid "" +"Privacy mode prevails even when using external and more precise devices." +msgstr "" +"La modalità privacy prevale anche quando sono in uso dispositivi esterni e " +"più precisi." + +#: C/geolocation-privacy.page:89(p) +msgid "Only your contacts can see your position." +msgstr "" +"Solo i propri contatti possono visualizzare la posizione geografica " +"personale." + +#: C/geolocation-not-showing.page:8(desc) +msgid "<app>Empathy</app> does not publish my geographical position." +msgstr "<app>Empathy</app> non pubblica la propria posizione geografica." + +#: C/geolocation-not-showing.page:29(title) +msgid "Geographical position not published" +msgstr "La posizione geografica non viene pubblicata" + +#: C/geolocation-not-showing.page:31(p) +msgid "" +"If your contacts cannot see your location, <app>Empathy</app> might not be " +"able to discover with a good margin of precision your geographical position." +msgstr "" +"Se i propri contatti non possono visualizzare la posizione geografica " +"personale, <app>Empathy</app> potrebbe non essere in grado di scoprirla con " +"una sufficiente precisione." + +#: C/geolocation-not-showing.page:35(p) +msgid "" +"In this case, your position will not be published, but you are still able to " +"see the location of your contacts." +msgstr "" +"In questo caso, la propria posizione geografica non viene pubblicata, ma è " +"ancora possibile visualizzare quella dei propri contatti." + +#: C/geolocation-not-showing.page:39(p) +msgid "" +"If you want to publish your geographical position, you can try to use an " +"external device such as a GPS." +msgstr "" +"Per pubblicare la propria posizione geografica, è possibile provare a " +"utilizzare un dispositivo esterno come un GPS." + +#: C/geolocation-not-showing.page:45(p) +msgid "" +"In order to publish your geographical location, your Jabber server needs to " +"support the Personal Eventing Protocal (PEP). A list of <link href=\"http://" +"coccinella.im/servers/servers_by_pubsub_pep.html\">servers which support " +"PEP</link> is maintained online. Google Talk does not support this feature " +"at this time." +msgstr "" +"Per poter pubblicare la propria posizione geografica, il server Jabber in " +"uso deve supportare il protocollo PEP (Personal Eventing Protocal). Un " +"elenco di <link href=\"http://coccinella.im/servers/servers_by_pubsub_pep." +"html\">server che supportano questo protocollo</link> viene mantenuto su " +"Internet. Google Talk al momento non supporta questa funzionalità." + +#: C/geolocation.page:8(desc) +msgid "Use and understand geolocation in <app>Empathy</app>." +msgstr "Usare e comprendere la geo-localizzazione in <app>Empathy</app>." + +#: C/geolocation.page:29(title) +msgid "Geographical position" +msgstr "Posizione geografica" + +#: C/geolocation.page:32(title) +msgid "Geolocation" +msgstr "Geo-localizzazione" + +#: C/geolocation.page:36(title) +msgid "Fix common problems" +msgstr "Risolvere problemi comuni" + +#: C/favorite-rooms.page:10(desc) +msgid "Set, join and manage favorite rooms." +msgstr "Impostare, gestire ed entrare in stanze preferite." + +#: C/favorite-rooms.page:25(title) +msgid "Favorite rooms" +msgstr "Stanze preferite" + +#: C/favorite-rooms.page:28(title) +msgid "Set a room as a favorite" +msgstr "Impostare una stanza come preferita" + +#: C/favorite-rooms.page:31(p) +msgid "Join a room." +msgstr "Entrare in una stanza." + +#: C/favorite-rooms.page:36(p) +msgid "" +"See <link xref=\"irc-join-room\"/> for more information on how to join an " +"IRC room." +msgstr "" +"Per maggiori informazioni su come entrare in una stanza IRC, consultare " +"<link xref=\"irc-join-room\"/>." + +#: C/favorite-rooms.page:42(p) +msgid "" +"See <link xref=\"group-conversations\"/> for more information on how to " +"start or join a group conversation." +msgstr "" +"Per maggiori informazioni su come entrare in una conversazione di gruppo, " +"consultare <link xref=\"group-conversations\"/>." + +#: C/favorite-rooms.page:50(p) +msgid "" +"From the conversation window, choose <guiseq><gui>Conversation</" +"gui><gui>Favorite Chatroom</gui></guiseq>." +msgstr "" +"Dalla finestra di conversazione, scegliere <guiseq><gui>Conversazione</" +"gui><gui>Stanza preferita</gui></guiseq>." + +#: C/favorite-rooms.page:59(title) +msgid "Join favorite rooms" +msgstr "Entrare nelle stanze preferite." + +#: C/favorite-rooms.page:67(p) +msgid "Press <key>F5</key>." +msgstr "Premere <key>F5</key>." + +#: C/favorite-rooms.page:72(p) +msgid "" +"Choose <guiseq><gui>Room</gui><gui>Join Favorites</gui></guiseq>, to join " +"all your favorite rooms." +msgstr "" +"Scegliere <guiseq><gui>Stanza</gui><gui>Entra nei preferiti</gui></guiseq>, " +"per entrare in tutte le stanze preferite." + +#: C/favorite-rooms.page:78(p) +msgid "Choose <gui>Room</gui>, and select the favorite room you want to join." +msgstr "" +"Scegliere <gui>Room</gui> e selezionare la stanza preferita in cui entrare." + +#: C/favorite-rooms.page:86(p) +msgid "" +"To join a favorite room, you need to be connected to the Internet and to " +"your account." +msgstr "" +"Per poter entrare in una stanza preferita è necessario essere connessi a " +"Internet e al proprio account." + +#: C/favorite-rooms.page:94(title) +msgid "Manage favorite rooms" +msgstr "Gestire le stanze preferite" + +#: C/favorite-rooms.page:97(p) +msgid "" +"From the <gui>Contact List</gui> window, choose <guiseq><gui>Room</" +"gui><gui>Manage Favorites</gui></guiseq>." +msgstr "" +"Dalla finestra <gui>Elenco contatti</gui> scegliere <guiseq><gui>Stanza</" +"gui><gui>Gestisci preferiti</gui></guiseq>." + +#: C/favorite-rooms.page:103(p) +#| msgid "" +#| "From the <guilabel>Account</guilabel> drop-down list, choose the account " +#| "you want to edit." +msgid "" +"From the <gui>Account</gui> drop-down list, select the account you want to " +"manage the favorite rooms of." +msgstr "" +"Dall'elenco a discesa <gui>Account</gui>, selezionare l'account di cui " +"gestire le stanze preferite." + +#: C/favorite-rooms.page:107(p) +msgid "Select <gui>All</gui> to see all you favorite rooms." +msgstr "Selezionare <gui>Tutti</gui> per visualizzare tutti i preferiti." + +#: C/favorite-rooms.page:112(p) +msgid "Select the favorite room you want to manage:" +msgstr "Selezionare la stanza preferita da gestire:" + +#: C/favorite-rooms.page:117(p) +msgid "" +"Select the <gui>Auto-Connect</gui> check-box in order to automatically join " +"that room when you connect to your account." +msgstr "" +"Selezionare la casella di scelta <gui>Connessione automatica</gui> per " +"entrare automaticamente in quella stanza ogni volta che ci si collega col " +"proprio account." + +#: C/favorite-rooms.page:123(p) +msgid "Click on <gui>Remove</gui> to remove the room from your favorites." +msgstr "Fare clic su <gui>Rimuovi</gui> per rimuovere la stanza dai preferiti." + +#: C/favorite-rooms.page:130(p) +#| msgid "When done, click <guibutton>Close</guibutton>." +msgid "When done, click <gui>Close</gui>." +msgstr "Quando finito, fare clic su <gui>Chiudi</gui>." + +#: C/disable-account.page:9(desc) +msgid "Prevent <app>Empathy</app> from automatically logging in to an account." +msgstr "" +"Evitare che <app>Empathy</app> si colleghi automaticamente a un account." + +#: C/disable-account.page:35(title) +#| msgid "Disabling and Removing an Account" +msgid "Disable an account" +msgstr "Disabilitare un account" + +#: C/disable-account.page:37(p) +msgid "" +"You can disable an account to prevent <app>Empathy</app> from logging in to " +"it without removing the account entirely. You may wish to disable and re-" +"enable an account if you only want to be logged in to the account at certain " +"times, but you still want to use <app>Empathy</app> for other accounts." +msgstr "" +"È possibile disabilitare un account per evitare che <app>Empathy</app> vi si " +"colleghi senza dover rimuovere completamente quell'account. Potrebbe essere " +"necessario disabilitare e riabilitare un account per esservi connessi a " +"determinati orari, ma continuando a usare <app>Empathy</app> con altri " +"account." + +#: C/disable-account.page:48(p) +#| msgid "" +#| "Select the account you wish to disable in the box on the left of the " +#| "dialog." +msgid "" +"Select the account you wish to disable from the accounts list on the left " +"side of the window." +msgstr "" +"Selezionare l'account da disabilitare dall'elenco degli account nella parte " +"sinistra della finestra." + +#: C/disable-account.page:52(p) +msgid "" +"Deselect <gui style=\"checkbox\">Enabled</gui> on the right side of the " +"window. This option is after your primary account details, but before any " +"advanced settings." +msgstr "" +"Deselezionare la casella di scelta <gui style=\"checkbox\">Abilitato</gui> " +"nella parte destra della finestra. Questa opzione è situata dopo i dettagli " +"principali dell'account, ma prima delle opzioni avanzate." + +#: C/disable-account.page:57(p) +msgid "Click <gui style=\"button\">Apply</gui>." +msgstr "Fare clic su <gui style=\"button\">Applica</gui>." + +#: C/disable-account.page:63(p) +msgid "" +"To re-enable the account, simply select <gui style=\"checkbox\">Enabled</" +"gui> and click <gui>Apply</gui>." +msgstr "" +"Per riabilitare l'account, selezionare <gui style=\"checkbox\">Abilitato</" +"gui> e fare clic su <gui>Applica</gui>." + +#: C/create-account.page:9(desc) +msgid "Register for an account with one of the supported messaging services." +msgstr "Registrare un account con uno dei servizi di messaggistica supportati." + +#: C/create-account.page:29(title) +#| msgid "Registering an Account" +msgid "Register for a new account" +msgstr "Registrare un nuovo account" + +#: C/create-account.page:31(p) +msgid "" +"Most account types require you to create an account with a account provider " +"before you can connect using instant messaging applications like " +"<app>Empathy</app>. With some account providers, you can use <app>Empathy</" +"app> to register for a new account, using the same steps as you would to " +"<link xref=\"add-account\">add an account</link>." +msgstr "" +"La maggior parte degli account richiede la registrazione con un fornitore " +"del servizio prima di potersi collegare e usare applicazioni di " +"messaggistica come <app>Empathy</app>. Con alcuni fornitori di servizi di " +"messaggistica e possibile usare <app>Empathy</app> per registrare un nuovo " +"account utilizzando gli stessi passi per <link xref=\"add-account" +"\">aggiungere un account</link>." + +#: C/create-account.page:37(p) +msgid "" +"This page provides information on creating a new account for various types " +"of accounts. Your account provider should give you a login ID and a " +"password, as well as any additional information you need to connect with " +"<app>Empathy</app>." +msgstr "" +"Questa pagina fornisce informazioni su come creare un nuovo account per " +"diversi tipi di account. Il fornitore del servizio dovrebbe fornire un " +"identificativo di accesso e una password, oltre a tutte le altre " +"informazioni necessarie per potersi collegare utilizzando <app>Empathy</app>." + +#: C/create-account.page:42(title) C/audio-video.page:161(p) +#| msgid "Jabber ID" +msgid "Jabber" +msgstr "Jabber" + +#: C/create-account.page:44(p) +msgid "" +"Jabber is an open instant messaging system. Like email, Jabber allows you to " +"choose your account provider and communicate with all other Jabber users, " +"regardless of their account provider." +msgstr "" +"Jabber è un sistema di messaggistica aperto. Come l'email, Jabber consente " +"di scegliere il proprio fornitore di servizio e di comunicare con tutti gli " +"altri utenti Jabber, indipendentemente dal loro fornitore." + +#: C/create-account.page:48(p) +msgid "" +"You will need to create a new account with a Jabber provider. There are many " +"free providers; one popular provider is <link href=\"http://register.jabber." +"org/\">Jabber.org</link>." +msgstr "" +"È necessario creare una nuovo account con un fornitore del servizio. Sono " +"disponibili molti fornitori, uno molto diffuso è <link href=\"http://" +"register.jabber.org/\">Jabber.org</link>." + +#: C/create-account.page:53(p) +msgid "" +"If you use Google Mail or Google Talk, you already have a Jabber account. " +"Google Talk is a Jabber service. Simply use your Google Mail address and " +"password in <app>Empathy</app> to connect." +msgstr "" +"Se si usa Google Mail o Google Talk, si dispone già di un account Jabber: " +"Google Talk è un servizio Jabber. Basta semplicemente usare l'indirizzo " +"email e la password di Google in <app>Empathy</app>." + +#: C/create-account.page:60(title) C/audio-video.page:181(p) +msgid "People Nearby" +msgstr "Persone nelle vicinanze" + +#: C/create-account.page:62(p) +msgid "" +"You do not need to create an account with a service provider to use this " +"feature. This service works whenever you are connected to a local network, " +"such as a wireless hotspot. It automatically finds all other users on the " +"network who are also using this service." +msgstr "" +"Non è necessario creare un account con un fornitore di servizio per questo " +"tipo di account. Questo servizio funziona ogni qual volta ci si connette a " +"una rete locale, come un <em>hotspot</em> senza fili. È in grado di rilevare " +"automaticamente tutti gli utenti che utilizzano lo stesso servizio " +"all'interno della rete." + +#: C/create-account.page:67(p) +msgid "For more information, see <link xref=\"salut-protocol\"/>." +msgstr "Per maggiori informazioni, consultare <link xref=\"salut-protocol\"/>." + +#: C/create-account.page:71(title) C/audio-video.page:196(p) +msgid "SIP" +msgstr "SIP" + +#: C/create-account.page:73(p) +msgid "" +"SIP is an open system which allows users to have audio and video " +"conversations over the Internet. You need to create an account with a SIP " +"provider. You can communicate with all other SIP users, regardless of which " +"SIP provider they use." +msgstr "" +"SIP è un sistema aperto che consente di tenere conversazioni audio e video " +"attraverso Internet. È necessario creare un account con un fornitore di " +"servizi SIP. È possibile comunicare con tutti gli utenti SIP " +"indipendentemente dal fornitore SIP utilizzato." + +#: C/create-account.page:78(p) +#| msgid "" +#| "The <ulink type=\"http\" url=\"https://signup.sipphone.com/new-users/app?" +#| "class=NewUser;proc=start\">Sipphone</ulink> service." +msgid "" +"There are a number of popular free SIP account providers; one popular " +"provider is <link href=\"https://signup.sipphone.com/new-users/app?" +"class=NewUser;proc=start\">Sipphone</link>." +msgstr "" +"Esistono molti fornitori di servizi SIP. Uno molto diffuso è <link href=" +"\"https://signup.sipphone.com/new-users/app?class=NewUser;proc=start" +"\">Sipphone</link>." + +#: C/create-account.page:83(p) +#| msgid "" +#| "The <ulink type=\"http\" url=\"https://www.ekiga.net/index.php?" +#| "page=register\">Ekiga</ulink> service." +msgid "" +"Due to technical differences, the free <link href=\"https://www.ekiga.net/" +"index.php?page=register\">Ekiga.net</link> service does not currently work " +"with <app>Empathy</app>." +msgstr "" +"A causa di differenze tecniche, al momento il servizio gratuito e libero " +"<ulink type=\"http\" url=\"https://www.ekiga.net/index.php?page=register" +"\">Ekiga</ulink> non funziona con <app>Empathy</app>." + +#: C/create-account.page:88(p) +msgid "" +"Some SIP providers allow you to call normal phones from your computer. " +"Generally, you will need to subscribe to a paid service for this feature." +msgstr "" +"Alcuni fornitori di servizi SIP consentono di eseguire chiamate ai telefoni " +"normali dal proprio computer. Generalmente è necessario abbonarsi a un " +"servizio a pagamento per poter usufruire di questa possibilità." + +#: C/create-account.page:93(title) C/audio-video.page:156(p) +msgid "IRC" +msgstr "IRC" + +#: C/create-account.page:95(p) +msgid "" +"You do not need to register for an account to use IRC. Although you specify " +"a nickname when you add an IRC account to <app>Empathy</app>, this nickname " +"is only established each time you connect. If another user is using the " +"nickname, you will need to choose a new nickname." +msgstr "" +"Non è necessario registrare un account per usare IRC. Benché venga " +"specificato un soprannome quando viene aggiungo un account IRC in " +"<app>Empathy</app>, questo soprannome viene creato ogni qual volta ci si " +"colleghi. Se un altro utente sta usando quel soprannome, è necessario " +"sceglierne un altro." + +#: C/create-account.page:100(p) +msgid "" +"Some IRC networks use a service called NickServ to allow users to protect " +"thier nicknames. See <link xref=\"irc-nick-password\"/> for more information." +msgstr "" +"Alcune reti IRC mettono a disposizione un servizio chiamato «NickServ» per " +"consentire agli utenti di proteggere il proprio soprannome. Per maggiori " +"informazioni, consultare <link xref=\"irc-nick-password\"/>." + +#: C/create-account.page:103(p) +msgid "" +"Some IRC servers are password protected. You will need to know the password " +"to connect to these servers. Generally, these are private IRC networks." +msgstr "" +"Alcuni server IRC sono protetti da password ed è necessario conoscere la " +"password per potersi collegare. Generalmente queste sono reti IRC private." + +#: C/create-account.page:108(title) +msgid "Proprietary Services" +msgstr "Servizi proprietari" + +#: C/create-account.page:110(p) +msgid "" +"There are many proprietary instant messaging services that have been " +"developed by different companies or organizations. <app>Empathy</app> allows " +"you to connect to an existing account for most popular services. To create a " +"new account with one of these services, you will need to visit the service’s " +"web site and agree to its terms of use." +msgstr "" +"Sono disponibili molti servizi di messaggistica istantanea proprietari, " +"sviluppati da diverse aziende od organizzazioni. <app>Empathy</app> consente " +"di collegarsi a un account esistente della maggior parte di questi servizi. " +"Per creare un nuovo account con uno di questi servizi, è necessario " +"visitarne il sito web e acconsentire ai termini d'uso." + +#: C/create-account.page:119(link) C/audio-video.page:131(p) +msgid "AIM" +msgstr "AIM" + +#: C/create-account.page:124(link) C/audio-video.page:151(p) +msgid "ICQ" +msgstr "ICQ" + +#: C/create-account.page:129(link) C/audio-video.page:166(p) +msgid "MSN" +msgstr "MSN" + +#: C/create-account.page:134(link) C/audio-video.page:201(p) +#| msgid "Yahoo" +msgid "Yahoo!" +msgstr "Yahoo!" + +#: C/change-status.page:9(desc) +msgid "Change your status to advertise your availability to your contacts." +msgstr "" +"Cambiare il proprio stato per indicare la disponibilità ad avere " +"conversazioni." + +#: C/change-status.page:31(title) +msgid "Change your status" +msgstr "Cambiare il proprio stato" + +#: C/change-status.page:33(p) +msgid "" +"You can set your status to indicate your availability to your contacts. " +"<app>Empathy</app> allows you to select from a list of defined statuses." +msgstr "" +"È possibile impostare il proprio stato per indicare la propria disponibilità " +"ai contatti. <app>Empathy</app> consente di selezionare diversi stati " +"predefiniti." + +#: C/change-status.page:38(p) +msgid "" +"Click on the drop-down list at the top of the <gui>Contact List</gui> window." +msgstr "" +"Fare clic sull'elenco a discesa nella parte superiore della finestra " +"<gui>Elenco contatti</gui>." + +#: C/change-status.page:43(p) +msgid "Select a status from the list." +msgstr "Selezionare uno stato dell'elenco." + +#: C/change-status.page:49(p) +msgid "" +"See <link xref=\"status-icons\"/> for a list of the built-in statuses and " +"what they mean. You can also <link xref=\"set-custom-message\">add custom " +"status messages</link> to provide more information about your availability " +"to your contacts." +msgstr "" +"Per maggiori informazioni sugli stati predefiniti e il loro significato, " +"consultare <link xref=\"status-icons\"/>. È anche possibile <link xref=\"set-" +"custom-message\">aggiungere messaggi di stato personalizzati</link> per " +"fornire maggiori informazioni ai contatti riguardo la propria disponibilità." + +#: C/change-status.page:55(p) +msgid "" +"If you do not use your computer for a while, or if the screensaver is on, " +"the status will be automatically set to Away." +msgstr "" +"Se il computer non viene utilizzato per un po' di tempo o se viene attivato " +"il salvaschermo, lo stato viene impostato automaticamente su «Assente»." + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/audio-video.page:54(None) C/audio-call.page:43(None) +msgid "" +"@@image: 'figures/audio-input-microphone.png'; " +"md5=8d89026b66a263a3bc5b1f0665948567" +msgstr "non serve" + +#: C/audio-video.page:8(desc) +msgid "" +"Information on when it is possible to have an audio or video conversation." +msgstr "" +"Informazioni su quando è possibile avere una conversazione audio o video." + +#: C/audio-video.page:28(title) +msgid "Audio and Video Support" +msgstr "Supporto audio e video" + +#: C/audio-video.page:30(p) +msgid "" +"You can only have audio and video conversation with contacts who are using " +"an application which also supports this feature. When your contacts support " +"audio or video conversations, you will see the following icons next to their " +"names in the contact list:" +msgstr "" +"Le conversazioni audio e video sono possibili solamente con i contatti che " +"utilizzano un'applicazione in grado di supportarle. Quando i propri contatti " +"supportano le conversazioni audio o video, è possibile visualizzare le " +"seguenti icone a fianco dei nomi nell'elenco contatti:" + +#: C/audio-video.page:39(p) +msgid "Icon" +msgstr "Icona" + +#: C/audio-video.page:44(p) +msgid "Description" +msgstr "Descrizione" + +#: C/audio-video.page:54(media) +msgid "Icon for audio conversation" +msgstr "Icona per le conversazioni audio" + +#: C/audio-video.page:60(p) +msgid "The contact is able to have an audio conversation." +msgstr "Il contatto è in grado di avere conversazioni audio." + +#: C/audio-video.page:66(media) +msgid "Icon for video conversation" +msgstr "Icona per le conversazioni video" + +#: C/audio-video.page:72(p) +msgid "The contact is able to have a video conversation." +msgstr "Il contatto è in grado di avere conversazioni video." + +#: C/audio-video.page:79(p) +msgid "" +"In order to have an audio conversation, you need to have a sound card that " +"is supported by your operating system, and a working microphone." +msgstr "" +"Per poter avere una conversazione audio è necessario avere una scheda audio " +"supportata dal sistema operativo e un microfono funzionanti." + +#: C/audio-video.page:83(p) +msgid "" +"In order to have a video conversation, you need to have a webcam that is " +"supported by your operating system, and a working microphone." +msgstr "" +"Per poter avere una conversazione video è necessario avere una webcam " +"supportata dal sistema operativo e un microfono funzionanti." + +#: C/audio-video.page:91(title) +#| msgid "Importing Accounts" +msgid "Supported Account Types" +msgstr "Account supportati" + +#: C/audio-video.page:93(p) +msgid "" +"You can only have audio and video conversations using accounts on certain " +"supported services. The following table lists whether audio and video is " +"supported for each type of account." +msgstr "" +"È possibile avere conversazioni audio e video utilizzando solo alcune " +"tipologie di servizi supportati. La tabella seguente indica, per ogni " +"account, se le conversazioni audio e video sono supportate." + +#: C/audio-video.page:98(p) +msgid "" +"Account types are provided by plugins. Your system may not have all of the " +"following types available, or it may have types not listed here. Updated " +"plugins may make audio or video conversations possible on account types that " +"are listed as unsupported here." +msgstr "" +"Le diverse tipologie di account sono fornite attraverso dei plugin. Il " +"proprio sistema operativo potrebbe non avere tutte queste tipologie di " +"account disponibili o potrebbe averne che non sono elencate qui. Dei plugin " +"aggiornati potrebbero anche rendere possibili le conversazioni audio e video " +"su account che qui vengono indicati come non supportati." + +# (ndt) non serve tradurre +#: C/audio-video.page:106(p) +msgid "" +"I'd like to do tables like this using nothing for No and ✔ for Yes, but we " +"need to look at the accessibility impact. I've <link href=\"http://mail." +"gnome.org/archives/gnome-doc-list/2009-September/msg00006.html\">asked the " +"accessibility team</link> for input." +msgstr "" +"I'd like to do tables like this using nothing for No and ✔ for Yes, but we " +"need to look at the accessibility impact. I've <link href=\"http://mail." +"gnome.org/archives/gnome-doc-list/2009-September/msg00006.html\">asked the " +"accessibility team</link> for input." + +# (ndt) non serve tradurre +#: C/audio-video.page:114(p) +msgid "" +"There's recent work on telepathy-butterfly and papyon to support audio and " +"video for MSN. It might be released in time for 2.28, but since it doesn't " +"follow the Gnome release schedule, I can't be sure. If it looks like it's " +"going to ship, let's mark it Yes." +msgstr "" +"There's recent work on telepathy-butterfly and papyon to support audio and " +"video for MSN. It might be released in time for 2.28, but since it doesn't " +"follow the Gnome release schedule, I can't be sure. If it looks like it's " +"going to ship, let's mark it Yes." + +#: C/audio-video.page:124(p) +#| msgid "Server" +msgid "Service" +msgstr "Servizio" + +#: C/audio-video.page:125(p) +msgid "Audio" +msgstr "Audio" + +#: C/audio-video.page:126(p) +msgid "Video" +msgstr "Video" + +#: C/audio-video.page:132(p) C/audio-video.page:133(p) +#: C/audio-video.page:137(p) C/audio-video.page:138(p) +#: C/audio-video.page:147(p) C/audio-video.page:148(p) +#: C/audio-video.page:152(p) C/audio-video.page:153(p) +#: C/audio-video.page:157(p) C/audio-video.page:158(p) +#: C/audio-video.page:172(p) C/audio-video.page:173(p) +#: C/audio-video.page:177(p) C/audio-video.page:178(p) +#: C/audio-video.page:182(p) C/audio-video.page:183(p) +#: C/audio-video.page:187(p) C/audio-video.page:188(p) +#: C/audio-video.page:192(p) C/audio-video.page:193(p) +#: C/audio-video.page:202(p) C/audio-video.page:203(p) +#: C/audio-video.page:207(p) C/audio-video.page:208(p) +msgid "No" +msgstr "No" + +#: C/audio-video.page:136(p) +#| msgid "Gadu Gadu" +msgid "gadugadu" +msgstr "gadugadu" + +#: C/audio-video.page:141(p) +msgid "Google Talk" +msgstr "Google Talk" + +#: C/audio-video.page:142(p) C/audio-video.page:143(p) +#: C/audio-video.page:162(p) C/audio-video.page:163(p) +#: C/audio-video.page:167(p) C/audio-video.page:168(p) +#: C/audio-video.page:197(p) C/audio-video.page:198(p) +msgid "Yes" +msgstr "Sì" + +#: C/audio-video.page:146(p) +msgid "Groupwise" +msgstr "Groupwise" + +#: C/audio-video.page:171(p) +msgid "myspace" +msgstr "myspace" + +#: C/audio-video.page:176(p) +msgid "qq" +msgstr "qq" + +#: C/audio-video.page:186(p) +msgid "sametime" +msgstr "sametime" + +#: C/audio-video.page:191(p) +msgid "silc" +msgstr "silc" + +#: C/audio-video.page:206(p) +#| msgid "empathy" +msgid "zephyr" +msgstr "zephyr" + +#: C/audio-call.page:9(desc) +msgid "Call your contacts over the Internet." +msgstr "Chiamare i propri contatti via Internet." + +#: C/audio-call.page:29(title) +msgid "Start an audio conversation" +msgstr "Avviare una conversazione audio" + +#: C/audio-call.page:31(p) +msgid "" +"You can call your contacts and have an audio conversation with them. This " +"features only works with certain types of accounts, and it requires the " +"other person to have an application that supports audio calls." +msgstr "" +"È possibile chiamare i propri contatti e tenere delle conversazioni audio " +"con loro. Questa funzionalità funziona però solo con alcune tipologie di " +"account ed è necessario che l'altra persona abbia un'applicazione in grado " +"di supportare le chiamate audio." + +# (ndt) non seve tradurre +#: C/audio-call.page:37(p) +msgid "Link to A/V support matrix" +msgstr "Link to A/V support matrix" + +#: C/audio-call.page:42(p) +msgid "" +"From the <gui>Contact List</gui> window, click the <media type=\"image\" " +"mime=\"image/png\" src=\"figures/audio-input-microphone.png\">audio call</" +"media> icon next to the name of the contact you wish to call. Alternatively, " +"right click the contact and choose <gui>Audio Call</gui>." +msgstr "" +"Dalla finestra <gui>Elenco contatti</gui>, fare clic sull'icona <media type=" +"\"image\" mime=\"image/png\" src=\"figures/audio-input-microphone.png" +"\">della conversazione audio</media> a fianco del nome del contatto da " +"chiamare. In alternativa, fare clic col pulsante destro del mouse sul " +"contatto e scegliere <gui>Chiamata audio</gui>." + +#: C/audio-call.page:57(p) +msgid "" +"To turn an audio conversation into a video conversation, choose " +"<guiseq><gui>Call</gui><gui>Send video</gui></guiseq>, or click the <media " +"type=\"image\" mime=\"image/png\" src=\"figures/camera-web.png\">video call</" +"media> toolbar button to select it." +msgstr "" +"Per convertire una conversazione audio in una conversazione video, scegliere " +"<guiseq><gui>Chiamata</gui><gui>Invia video</gui></guiseq> oppure fare clic " +"sul pulsante <media type=\"image\" mime=\"image/png\" src=\"figures/camera-" +"web.png\">della chiamata video</media> nella barra degli strumenti." + +#: C/add-contact.page:9(desc) +msgid "Add someone to the contact list." +msgstr "Aggiungere una persona all'elenco contatti." + +#: C/add-contact.page:30(title) +msgid "Add someone to your list of contacts" +msgstr "Aggiungere una persona al proprio elenco contatti" + +#: C/add-contact.page:34(p) +msgid "Choose <guiseq><gui>Chat</gui><gui>Add Contact</gui></guiseq>." +msgstr "" +"Scegliere <guiseq><gui>Conversazione</gui><gui>Aggiungi contatto</gui></" +"guiseq>." + +#: C/add-contact.page:37(p) +msgid "" +"From the <gui>Account</gui> drop-down list, select the account you wish to " +"use to connect to your contact. Your contact will need to be using the same " +"service as the account you select." +msgstr "" +"Dall'elenco a discesa <gui>Account</gui>, selezionare l'account da usare per " +"poter avere conversazioni col proprio contatto. Il contatto dovrà usare lo " +"stesso servizio dell'account selezionato." + +#: C/add-contact.page:42(p) +msgid "" +"In the <gui>Identifier</gui> field, enter your contact’s login ID, username, " +"screen name, or other appropriate identifier for the service type." +msgstr "" +"Nel campo <gui>Identificatore</gui>, inserire l'ID del contatto: nome " +"utente, nome visibili o qualsiasi altra forma di identificatore che il " +"servizio utilizza." + +#: C/add-contact.page:46(p) +#| msgid "" +#| "In the <guilabel>Alias</guilabel> text box type the name you want to give " +#| "at the the new contact." +msgid "" +"In the <gui>Alias</gui> field, type your contact’s name as you would like it " +"to appear in your contact list." +msgstr "" +"Nella casella di testo <gui>Pseudonimo</gui> digitare il nome da dare al " +"nuovo contatto così come dovrà apparire nell'elenco contatti." + +#: C/add-contact.page:50(p) +#| msgid "Click on <guibutton>Add</guibutton> to add the new contact." +msgid "Click <gui>Add</gui> to add the person to your list of contacts." +msgstr "Fare clic su <gui>Aggiungi</gui> per aggiungere il nuovo contatto." + +#: C/add-contact.page:58(p) +msgid "" +"To add a new person to your list of contacts, you need to be connected to " +"the Internet and to your account." +msgstr "" +"Per aggiungere una nuova persona al proprio elenco contatti, è necessario " +"essere collegati a Internet e al proprio account." + +#: C/add-account.page:9(desc) +#| msgid "Adding your Account to <application>Empathy</application>" +msgid "Add a new account to <app>Empathy</app>." +msgstr "Aggiungere un nuovo account in <application>Empathy</application>" + +#: C/add-account.page:34(title) +#| msgid "Editing an Account" +msgid "Add a new account" +msgstr "Aggiungere un nuovo account" + +#: C/add-account.page:36(p) +msgid "" +"You can add instant messaging accounts from any supported service to " +"communicate with all of your contacts in <app>Empathy</app>. For some " +"account providers, these steps will also allow you to register for a new " +"account. For more details, see <link xref=\"create-account\"/>." +msgstr "" +"È possibile aggiungere account di messaggistica istantanea per comunicare " +"con tutti i propri contatti da qualsiasi servizio supportato da " +"<app>Empathy</app>. Con alcuni fornitori di servizi di messaggistica, i " +"passi qui descritti consentono anche di registrare un nuovo account. Per " +"maggiori informazioni, consultare <link xref=\"create-account\"/>." + +#: C/add-account.page:47(p) +#| msgid "Click on the <guilabel>Add</guilabel> button." +msgid "Click the <gui style=\"button\">Add</gui> button." +msgstr "Fare clic su <gui style=\"button\">Aggiungi</gui>." + +#: C/add-account.page:50(p) +#| msgid "" +#| "From the <guilabel>Account</guilabel> drop-down list, choose the account " +#| "you want to edit." +msgid "" +"From the <gui>Add new</gui> drop-down list, select the type of account you " +"wish to add." +msgstr "" +"Dall'elenco a discesa <gui>Account</gui>, scegliere il tipo di account da " +"aggiungere." + +#: C/add-account.page:54(p) +msgid "" +"If you do not already have a registered account, select <gui>Create a new " +"account</gui>. This feature is not available for all account types, and may " +"not work with some account providers. See <link xref=\"create-account\"/> " +"for more information." +msgstr "" +"Se non si dispone già di un account registrato, selezionare <gui>Creare un " +"nuovo account</gui>. Questa funzionalità non è disponibile con tutte le " +"tipologie di account e potrebbe non funzionare con alcuni fornitori di " +"servizi di messaggistica. Per maggiori informazioni, consultare <link xref=" +"\"create-account\"/>." + +#: C/add-account.page:59(p) +msgid "Click <gui>Create</gui>." +msgstr "Fare clic su <gui>Crea</gui>." + +#: C/add-account.page:62(p) +msgid "" +"Enter the required information. For most accounts, you will only need a " +"login ID and a password. Some accounts may require additional information. " +"See <link xref=\"accounts-window#details\"/> for more information." +msgstr "" +"Inserire le informazioni richieste. Per la maggior parte degli account sono " +"sufficienti un ID di accesso e una password, altri account potrebbero " +"richiedere informazioni aggiuntive. Per maggiori informazioni, consultare " +"<link xref=\"accounts-window#details\"/>." + +#: C/add-account.page:67(p) +#| msgid "Click on <guibutton>Add</guibutton> to add the new contact." +msgid "Click <gui style=\"button\">Connect</gui> to enable the new account." +msgstr "" +"Fare clic su <gui style=\"button\">Connetti</gui> per abilitare il nuovo " +"account." -#: C/empathy.xml:1150(para) +#: C/add-account.page:73(p) msgid "" -"Use this text box to write an alternative name to use with this service." +"If you close the <gui>Accounts</gui> window without clicking <gui>Connect</" +"gui>, the entire account will be lost, and you will need to create it again." msgstr "" -"Usare questa casella di testo per indicare un nome alternativo da usare con " -"questo servizio." +"Se viene chiusa la finestra <gui>Account</gui> senza prima fare clic su " +"<gui>Connetti</gui>, l'account verrà perso e sarà necessario crearlo " +"nuovamente." -#: C/empathy.xml:1165(title) -msgid "Contacts and Groups" -msgstr "Contatti e gruppi" +#: C/add-account.page:76(p) +msgid "" +"If you select another account without clicking <gui>Connect</gui>, any " +"information you have entered will be lost." +msgstr "" +"Se viene selezionato un altro account senza prima fare clic su " +"<gui>Connetti</gui>, qualsiasi informazione inserire verrà persa." -#: C/empathy.xml:1166(para) +#: C/add-account.page:83(p) msgid "" -"All the contacts are handled within <application>Empathy</application>'s " -"<link linkend=\"empathy-FIG-mainwindow\">main window</link>." +"To change the name the identifies the account in the <gui>Accounts</gui> " +"window, select the account from the list on the left and either click on the " +"name or press the space bar. Edit the account name and press <key>Enter</" +"key> when you’re finished." msgstr "" -"Tutti i contatti sono gestiti all'interno della <link linkend=\"empathy-FIG-" -"mainwindow\">finestra principale</link> di <application>Empathy</" -"application>." +"Per modificare il nome che identifica un account nelle finestra " +"<gui>Account</gui>, selezionare l'account dall'elenco sulla sinistra e fare " +"clic sul nome oppure premere la barra spaziatrice. Modificare il nome " +"dell'account e premere <key>Invio</key> quando finito." + +#: C/accounts-window.page:11(desc) +msgid "Add, modify, and delete accounts." +msgstr "Aggiungere, modificare ed eliminare account." + +#: C/accounts-window.page:30(title) +#| msgid "Accounts" +msgid "Accounts Window" +msgstr "Finestra degli account" -#: C/empathy.xml:1170(para) +#: C/accounts-window.page:32(p) msgid "" -"You can add or remove a contact or you can edit the information of a " -"particular contact. It is also possibile to arrange contacts in groups. You " -"can have a group for your work contacts, one for you family contacts, and so " -"on." +"The <gui>Accounts</gui> window allows you to add, modify, and delete " +"accounts." msgstr "" -"È possibile aggiungere o rimuovere un contatto, modificarne le informazioni " -"e organizzare i contatti in gruppi. È possibile avere un gruppo per i propri " -"contatti di lavoro, uno per i familiari, ecc..." +"La finestra <gui>Accounts</gui> consente di aggiungere, modificare ed " +"eliminare account." -#: C/empathy.xml:1177(title) -msgid "Adding and Removing a Contact" -msgstr "Aggiungere e rimuovere un contatto" +#: C/accounts-window.page:40(title) +#| msgid "Accounts" +msgid "Account Details" +msgstr "Dettagli degli account" -#: C/empathy.xml:1178(para) -msgid "To add a new contact, proceed as follows:" -msgstr "Per aggiungere un nuovo contatto, procedere come segue:" +#: C/accounts-window.page:41(p) +msgid "" +"For most types of accounts, you can simply enter a login ID and a password. " +"Certain accounts or account types, however, may require additional " +"information." +msgstr "" +"Per la maggior parte degli account è sufficiente inserire un ID di accesso e " +"una password. Altre tipologie di account potrebbero però richiedere " +"informazioni aggiuntive." + +#. <copyright> +#. <year>2009</year> +#. <name>GNOME Documentation Project</name> +#. </copyright> +#: C/account-jabber.page:22(desc) +msgid "Advanced options for Jabber and Google Talk accounts." +msgstr "Opzioni avanzate degli account Jabber e Google Talk." + +#: C/account-jabber.page:26(title) +msgid "Jabber Account Details" +msgstr "Dettagli dell'account Jabber" + +#: C/account-jabber.page:28(p) +msgid "" +"Most Jabber accounts will require only a login ID and a password to connect. " +"For some accounts or on certain types of networks, you may need to enter " +"additional information in the <gui>Advanced</gui> section. Normally, you " +"will not need to use the advanced options below. For general instructions on " +"adding an account, see <link xref=\"add-account\"/>." +msgstr "" +"La maggior parte degli account Jabber richiede solo un ID di accesso e una " +"password per potersi collegare. Alcune tipologie di account su determinate " +"reti potrebbero richiedere informazioni aggiuntive da inserire nella sezione " +"<gui>Avanzate</gui>. Normalmente non è necessario utilizzare le opzioni " +"avanzate. Per informazioni generali su come aggiungere un account, " +"consultare <link xref=\"add-account\"/>." + +#: C/account-jabber.page:36(p) +msgid "" +"Google Talk is a type of Jabber account. These instructions hold for Google " +"Talk accounts as well." +msgstr "" +"Google Talk è un tipo di account Jabber. Queste istruzioni valgono anche per " +"gli account Google Talk." -#: C/empathy.xml:1184(para) +#: C/account-jabber.page:42(gui) +msgid "Encryption required (TLS/SSL)" +msgstr "Richiesta cifratura (TLS/SSL)" + +#: C/account-jabber.page:43(gui) +msgid "Ignore SSL certificate errors" +msgstr "Ignorare errori certificati SSL" + +#: C/account-jabber.page:44(p) msgid "" -"From the <link linkend=\"empathy-FIG-mainwindow\">main window</link> choose " -"<menuchoice><guimenu>Chat</guimenu><guimenuitem>Add Contact...</" -"guimenuitem></menuchoice>. The <guilabel>New Contact</guilabel> dialog will " -"be shown." -msgstr "Dalla <link linkend=\"empathy-FIG-mainwindow\">finestra principale</link> scegliere <menuchoice><guimenu>Chat</guimenu><guimenuitem>Aggiungi contatto...</guimenuitem></menuchoice>. Viene mostrato il dialogo <guilabel>Nuovo contatto</guilabel>." +"Whenever possible, communication between <app>Empathy</app> and the Jabber " +"server is encrypted. If encrypted communication is not possible, messages " +"may be sent unencrypted. Select <gui>Encryption required</gui> to prevent " +"<app>Empathy</app> from communicating with the Jabber server when encryption " +"is not possible." +msgstr "" +"Quando possibile, le comunicazioni tra <app>Empathy</app> e il server Jabber " +"vengono cifrate. Se le comunicazioni cifrate non sono possibili, i messaggi " +"potrebbero essere inviati non cifrati. Selezionare <gui>Richiesta cifratura</" +"gui> affinché <app>Empathy</app> comunichi con il server Jabber solo quando " +"è disponibile una canale cifrato." -#: C/empathy.xml:1194(para) +#: C/account-jabber.page:49(p) msgid "" -"From the <guilabel>Account</guilabel> drop-down list, choose the service " -"used by the contact you are adding." +"Some Jabber servers may encrypt data using invalid certificates, or using " +"certificates from unknown authorities. If you trust the server you are " +"connecting to, you can select <gui>Ignore SSL certificate errors</gui> to " +"allow encrypted communication with invalid certificates." msgstr "" -"Dall'elenco a discesa <guilabel>Account</guilabel>, scegliere il servizio " -"usato dal contatto che si sta aggiungendo." +"Alcuni server Jabber potrebbero cifrare i dati con certificati non validi o " +"utilizzando certificati di autorità di certificazione non riconosciute. Se " +"ci si può fidare del server a cui ci si connette, selezionare <gui>Ignorare " +"errori certificati SSL</gui> per consentire comunicazioni cifrate anche in " +"presenza di certificati non validi." + +#: C/account-jabber.page:56(gui) +msgid "Resource" +msgstr "Risorsa" + +#: C/account-jabber.page:57(gui) +msgid "Priority" +msgstr "Priorità" -#: C/empathy.xml:1200(para) +#: C/account-jabber.page:58(p) msgid "" -"In the <guilabel>Identifier</guilabel> text box type the <emphasis>address</" -"emphasis> of the contact in the form of <userinput><replaceable>user name</" -"replaceable>@<replaceable>service\n" -"\t domain</replaceable></userinput>." +"If you have multiple applications (for instance, on separate computers) " +"connected to your account at the same time, you can set a resource to " +"uniquely identify each one. By default, <app>Empathy</app> will use " +"<input>Telepathy</input> as the resource." msgstr "" -"Nella casella di testo <guilabel>Identificatore</guilabel> digitare " -"l'<emphasis>indirizzo</emphasis> del contatto nella forma " -"<userinput><replaceable>nome utente</replaceable>@<replaceable>dominio\n" -"\t servizio</replaceable></userinput>." +"Se si dispone di molteplici applicazioni (per esempio su computer diversi) " +"connesse al proprio account nello stesso momento, è possibile impostare una " +"risorsa per identificarle univocamente. Come impostazione predefinita, " +"<app>Empathy</app> usa <input>Telepathy</input> come nome per la risorsa." -#: C/empathy.xml:1209(para) +#: C/account-jabber.page:62(p) msgid "" -"In the <guilabel>Alias</guilabel> text box type the name you want to give at " -"the the new contact." +"You can set the priority to specify which application should receive " +"incoming messages from your contacts. New messages will be sent to the " +"application with the highest priority." msgstr "" -"Nella casella di testo <guilabel>Pseudonimo</guilabel> digitare il nome da " -"dare al nuovo contatto." +"È anche possibile impostare la priorità per specificare quale applicazione " +"deve ricevere i messaggi in arrivo dai propri contatti. I nuovi messaggi " +"vengono inviati all'applicazione con la priorità maggiore." + +#: C/account-jabber.page:67(gui) +msgid "Override server settings" +msgstr "Scavalcare impostazioni server" -#: C/empathy.xml:1215(para) -msgid "Click on <guibutton>Add</guibutton> to add the new contact." +#: C/account-jabber.page:68(p) +msgid "" +"<app>Empathy</app> will use default settings to connect to the Jabber server " +"based on your login ID. For some Jabber servers, you will need to enter " +"custom server settings manually. These settings should be provided for you " +"by your Jabber provider." msgstr "" -"Fare clic su <guibutton>Aggiungi</guibutton> per aggiungere il nuovo " -"contatto." +"<app>Empathy</app> utilizza le impostazioni predefinite per collegarsi al " +"server Jabber in base al proprio ID di accesso. Con alcuni server Jabber " +"potrebbe essere necessario inserire impostazioni personalizzate. Queste " +"impostazioni dovrebbero essere fornite dal fornitore del servizio Jabber." -#: C/empathy.xml:1221(para) -msgid "To remove a contact, proceed as follows:" -msgstr "Per rimuovere un contatto, procedere come segue:" +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/account-irc.page:101(None) +#| msgid "" +#| "@@image: 'figures/empathy-main-window.png'; " +#| "md5=38259a866f38ff1f754828e46d2b0e5c" +msgid "@@image: 'figures/gtk-add.png'; md5=a856b499d8d4681b70b5ce6f25bc5c6d" +msgstr "non serve" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/account-irc.page:104(None) +msgid "@@image: 'figures/gtk-edit.png'; md5=4f21b451732817be0604fe3e2c8da98b" +msgstr "non serve" -#: C/empathy.xml:1227(para) +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/account-irc.page:107(None) +msgid "@@image: 'figures/gtk-remove.png'; md5=215e3a325a3dd619874e35c30a018bb6" +msgstr "non serve" + +#. <copyright> +#. <year>2009</year> +#. <name>GNOME Documentation Project</name> +#. </copyright> +#: C/account-irc.page:22(desc) +msgid "Additional information necessary for connecting to IRC networks." +msgstr "Informazioni necessarie per collegarsi alle reti IRC." + +#: C/account-irc.page:26(title) +msgid "IRC Account Details" +msgstr "Dettagli dell'account IRC" + +#: C/account-irc.page:28(p) msgid "" -"From the <link linkend=\"empathy-FIG-mainwindow\">main window</link>, select " -"the contact you would like to remove and right-click on it." +"IRC accounts require different information than many other types of " +"accounts. To create an IRC account, you must specify at least an IRC network " +"and a nickname. This page details the information you can provide for an IRC " +"account." msgstr "" -"Dalla <link linkend=\"empathy-FIG-mainwindow\">finestra principale</link>, " -"selezionare il contatto da rimuovere e fare clic col pulsante destro del " -"mouse su di esso." +"Gli account IRC necessitano di informazioni diverse rispetto gli altri " +"account. Per creare un account IRC è sufficiente specificare una rete IRC e " +"un soprannome. Questa pagina espone le informazioni che è possibile fornire " +"per un account IRC." -#: C/empathy.xml:1234(para) +#: C/account-irc.page:34(p) msgid "" -"From the popup menu, choose <guilabel>Remove</guilabel> to remove the " -"contact." +"You must have the <sys>telepathy-idle</sys> package installed in order to " +"use IRC in <app>Empathy</app>." msgstr "" -"Dal menù a comparsa, scegliere <guilabel>Rimuovi</guilabel> per rimuovere il " -"contatto." +"Per poter usare IRC con <app>Empathy</app> è necessario avere installato il " +"pacchetto <sys>telepathy-idle</sys>." + +#: C/account-irc.page:40(gui) C/account-irc.page:115(gui) +msgid "Network" +msgstr "Rete" -#: C/empathy.xml:1243(para) C/empathy.xml:1279(para) +#: C/account-irc.page:41(p) msgid "" -"An <emphasis>alias</emphasis> is an alternative way you can identify that " -"particular contact. You can use the real name or the nickname of that person." +"IRC is an open system that allows people to run separate IRC networks. Each " +"network is distinct and has its own users and chat rooms. <app>Empathy</app> " +"lists the most popular networks in the <gui>Network</gui> drop-down list. " +"You can add additional networks. See <link xref=\"#networks\"/> below." msgstr "" -"Uno <emphasis>pseudonimo</emphasis> è un modo alternativo con cui è " -"possibile identificare un contatto. È possibile usare il vero nome oppure un " -"soprannome della persona." +"IRC è un sistema aperto che consente di gestire reti IRC separate. Ogni rete " +"è indipendente e distinta e dispone dei propri utenti e delle proprie stanze " +"di conversazione. <app>Empathy</app> visualizza le reti più diffuse " +"attraverso l'elenco a discesa <gui>Rete</gui>. È comunque possibile " +"aggiungere altre reti. Consultare <link xref=\"#networks\"/> più sotto." + +#: C/account-irc.page:48(gui) +#| msgid "Nick" +msgid "Nickname" +msgstr "Soprannome" -#: C/empathy.xml:1252(title) -msgid "Editing a Contact" -msgstr "Modificare un contatto" +#: C/account-irc.page:49(p) +msgid "" +"Your nickname is your unique name on the IRC network. Only one person on a " +"network may use a given nickname. If you get an error message that says " +"<link xref=\"prob-conn-name\" role=\"error-msg\"/> you will need to change " +"your nickname." +msgstr "" +"Il soprannome è il proprio nome all'interno della rete IRC e solo una " +"persona nella rete può esare un dato soprannome. Se si riceve un messaggio " +"indicante <link xref=\"prob-conn-name\" role=\"error-msg\"/>, è necessario " +"cambiare il proprio soprannome." -#: C/empathy.xml:1253(para) -msgid "To edit a contact, proceed as follows:" -msgstr "Per modificare un contatto, procedere come segue:" +#: C/account-irc.page:55(gui) +msgid "Password" +msgstr "Password" -#: C/empathy.xml:1259(para) C/empathy.xml:1301(para) +#: C/account-irc.page:56(p) msgid "" -"From the <link linkend=\"empathy-FIG-mainwindow\">main window</link>, select " -"the contact you would like to modify and choose <menuchoice><guimenu>Edit</" -"guimenu><guisubmenu>Contact</guisubmenu><guimenuitem>Edit</guimenuitem></" -"menuchoice>, or right-click on it and choose <guilabel>Edit</guilabel>." +"Some servers, particularly those on private networks, require a password to " +"connect. If you are authorized to use the network, the network " +"administrators should provide you with a password." msgstr "" -"Dalla <link linkend=\"empathy-FIG-mainwindow\">finestra principale</link>, " -"selezionare il contatto da modificare e scegliere " -"<menuchoice><guimenu>Modifica</guimenu><guisubmenu>Contatto</" -"guisubmenu><guimenuitem>Modifica</guimenuitem></menuchoice>, oppure fare " -"clic col pulsante destro del mouse su di esso e scegliere " -"<guilabel>Modifica</guilabel>." +"Alcuni server, in particolare quelli su reti private, richiedono una " +"password per potersi collegare. Se si dispone dell'autorizzazione per " +"utilizzare una di queste reti, l'amministratore della rete dovrebbe fornire " +"la password adatta. " + +#: C/account-irc.page:60(title) +msgid "NickServ Passwords" +msgstr "Password del NickServ" -#: C/empathy.xml:1272(para) +#: C/account-irc.page:61(p) msgid "" -"From the <guilabel>Edit Contact Information</guilabel> dialog, you can " -"modify the <emphasis>alias</emphasis> and the <emphasis>group</emphasis> of " -"the contact." +"On some networks, nicknames can be registered using a service known as " +"NickServ. <app>Empathy</app> does not directly support nickname passwords. " +"On some networks, including the popular FreeNode network, server passwords " +"are automatically forwarded to NickServ, allowing you to set this field to " +"identify yourself with NickServ. See <link xref=\"irc-nick-password\"/> for " +"more details." msgstr "" -"Dal dialogo <guilabel>Modifica informazioni contatto</guilabel> è possibile " -"modificare lo <emphasis>pseudonimo</emphasis> e il <emphasis>gruppo</" -"emphasis> associati al contatto." +"All'interno di alcune reti è possibile registrare i soprannomi utilizzando " +"un servizio chiamato «NickServ». <app>Empathy</app> non supporta direttamente " +"le password per i soprannomi, ma alcune reti, compresa la molto diffusa " +"FreeNode, le password relative al server vengono inoltrare al «NickServ», " +"consentendo di usare questo campo per identificarsi con il «NickServ». Per " +"maggiori informazioni, consultare <link xref=\"irc-nick-password\"/>." + +#: C/account-irc.page:71(gui) +msgid "Real name" +msgstr "Nome reale" + +#: C/account-irc.page:72(p) +msgid "" +"You can provide your real name in addition to your nickname. Other users " +"will be able to see this when they view your information." +msgstr "" +"È possibile fornire il proprio nome vero oltre al proprio soprannome. Gli " +"altri utenti lo potranno vedere quando visualizzano le informazioni " +"personali." -#: C/empathy.xml:1286(para) +#: C/account-irc.page:76(gui) +#| msgid "istant messaging" +msgid "Quit message" +msgstr "Messaggio di uscita" + +#: C/account-irc.page:77(p) msgid "" -"For more information about groups, see <xref linkend=\"empathy-add-contact-" -"group\"/> and <xref linkend=\"empathy-add-group\"/>." +"When you go offline, a quit message is sent to all the chat rooms you’re in " +"and to all the users you’re having a private conversation with. Use this " +"field to provide a custom quit message." msgstr "" -"Per maggiori informazioni riguardo i gruppi, consultare <xref linkend=" -"\"empathy-add-contact-group\"/> and <xref linkend=\"empathy-add-group\"/>." +"Quando ci si scollega, un messaggio di uscita viene inviato in tutte le " +"stanze di conversazione in cui si era entrati e a tutti gli utenti con cui " +"si teneva una conversazione privata. Usare questo campo per fornire un " +"messaggio di uscita personalizzato." -#: C/empathy.xml:1294(title) -msgid "Adding a Contact to a Group" -msgstr "Aggiungere un contatto a un gruppo" +#: C/account-irc.page:89(title) +msgid "IRC Networks" +msgstr "Reti IRC" -#: C/empathy.xml:1295(para) -msgid "To add a contact to one or more groups, proceed as follows:" -msgstr "Per aggiungere un contatto a uno a più gruppi, procedere come segue:" +#: C/account-irc.page:92(title) +msgid "Networks" +msgstr "Reti" -#: C/empathy.xml:1313(para) +#: C/account-irc.page:94(p) msgid "" -"From the <guilabel>Groups</guilabel> section, select the group, or groups, " -"you want to add the contact to." +"<app>Empathy</app> includes a list of popular IRC networks. If you wish to " +"another IRC network, you can add it to the list. You can also modify " +"networks and remove them from the list." msgstr "" -"Dalla sezione <guilabel>Gruppi</guilabel>, selezionare il gruppo, o i " -"gruppi, a cui aggiungere il contatto." +"<app>Empathy</app> comprende un elenco delle reti IRC più diffuse. Per " +"aggiungere un'altra rete IRC è sufficiente aggiungerla a questo elenco. È " +"anche possibile modificare le reti presenti e rimuoverle dall'elenco." -#: C/empathy.xml:1328(title) -msgid "Adding a New Group" -msgstr "Aggiungere un nuovo gruppo" +#: C/account-irc.page:99(p) +msgid "" +"To add a network to the list, click <media type=\"image\" mime=\"image/png\" " +"src=\"figures/gtk-add.png\" width=\"16\" height=\"16\">Add</media>." +msgstr "" +"Per aggiungere una rete all'elenco, fare clic su <media type=\"image\" mime=" +"\"image/png\" src=\"figures/gtk-add.png\" width=\"16\" height=\"16" +"\">Aggiungi</media>." -#: C/empathy.xml:1329(para) -msgid "To add a new group, proceed as follows:" -msgstr "Per aggiungere un nuovo gruppo, procedere come segue:" +#: C/account-irc.page:102(p) +msgid "" +"To modify a network in the list, select the network and click <media type=" +"\"image\" mime=\"image/png\" src=\"figures/gtk-edit.png\" width=\"16\" " +"height=\"16\">Edit</media>." +msgstr "" +"Per modificare una rete nell'elenco, selezionare la rete e fare clic su " +"<media type=\"image\" mime=\"image/png\" src=\"figures/gtk-edit.png\" width=" +"\"16\" height=\"16\">Modifica</media>." -#: C/empathy.xml:1335(para) +#: C/account-irc.page:105(p) msgid "" -"From the <link linkend=\"empathy-FIG-mainwindow\">main window</link>, select " -"one contact and choose <menuchoice><guimenu>Edit</" -"guimenu><guisubmenu>Contact</guisubmenu><guimenuitem>Edit</guimenuitem></" -"menuchoice>, or right-click on it and choose <guilabel>Edit</guilabel>." +"To remove a network from the list, select the network and click <media type=" +"\"image\" mime=\"image/png\" src=\"figures/gtk-remove.png\" width=\"16\" " +"height=\"16\">Remove</media>." msgstr "" -"Dalla <link linkend=\"empathy-FIG-mainwindow\">finestra principale</link> " -"selezionare un contatto e scegliere <menuchoice><guimenu>Modifica</" -"guimenu><guisubmenu>Contatto</guisubmenu><guimenuitem>Modifica</" -"guimenuitem></menuchoice> oppure fare clic col pulsante destro su di esso e " -"scegliere <guilabel>Modifica</guilabel>." +"Per rimuovere una rete dall'elenco, selezionare la rete e fare clic su " +"<media type=\"image\" mime=\"image/png\" src=\"figures/gtk-remove.png\" " +"width=\"16\" height=\"16\">Rimuovi</media>." -#: C/empathy.xml:1346(para) +#: C/account-irc.page:110(p) msgid "" -"In the <guilabel>Groups</guilabel> section, write the name of the group you " -"want to add and then click on <guibutton>Add Group</guibutton>." +"When adding or modifying a network, you can enter the following information:" msgstr "" -"Nella sezione <guilabel>Gruppi</guilabel>, scrivere il nome del gruppo da " -"aggiungere e fare clic su <guibutton>Aggiungi gruppo</guibutton>." +"Quando si aggiunge o si modifica una rete, è possibile inserire le seguenti " +"informazioni:" -#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. -#: C/empathy.xml:0(None) +#: C/account-irc.page:116(p) +msgid "" +"This is the name of the network as you want it to appear in the list of " +"networks." +msgstr "" +"Questo è il nome della rete come viene visualizzato nell'elenco di tutte le " +"reti." + +#: C/account-irc.page:120(gui) +msgid "Charset" +msgstr "Codifica caratteri" + +#: C/account-irc.page:121(p) +msgid "" +"This specifies the character encoding that is typically used on this " +"network. A character encoding is a specific way of recording characters " +"internally in a computer. There are many character encodings, and you need " +"to use the same character encoding as other users to see their messages " +"correctly." +msgstr "" +"Questo specifica la codifica dei caratteri utilizzata nella rete. La " +"codifica dei caratteri è un metodo per registrare i caratteri all'interno di " +"un computer. Essendo disponibili diverse codifiche dei caratteri, è " +"necessario utilizzare la stessa codifica degli altri utenti per poter " +"visualizzare i messaggi nel modo corretto." + +#. Translators: Recommend character encodings that are common +#. for your language. +#: C/account-irc.page:130(p) +msgid "" +"By default, <app>Empathy</app> uses UTF-8, a modern character encoding that " +"can handle text from most of the world's languages. Another common encoding " +"for English and some other Western languages is ISO-8859-1." +msgstr "" +"Come impostazione predefinita, <app>Empathy</app> utilizza UTF-8, una " +"codifica dei caratteri moderna in grado di gestire la maggior parte delle " +"lingue del mondo. Una codifica molto diffusa per l'inglese e per alcune " +"lingue occidentali è la ISO-8859-1." + +#: C/account-irc.page:136(gui) +#| msgid "Server" +msgid "Servers" +msgstr "Server" + +#: C/account-irc.page:137(p) +msgid "" +"An IRC network may have many servers you can connect to. When you are " +"connected to a server on a particular network, you can communicate with all " +"users on all other servers on that network. You can add and remove servers " +"for this network using the <gui>Add</gui> and <gui>Remove</gui> buttons." +msgstr "" +"Una rete IRC può disporre di diversi server a cui è possibile collegarsi. " +"Quando ci si collega a uno di questi server, le comunicazioni avvengono con " +"tutti gli utenti presenti negli altri server all'interno della rete. È " +"possibile aggiungere e rimuovere server da questa rete utilizzando i " +"pulsanti <gui>Aggiungi</gui> e <gui>Rimuovi</gui>." + +#: C/account-irc.page:142(p) +msgid "" +"When a server is selected, click the field under <gui>Server</gui> or " +"<gui>Port</gui> to edit it. Alternatively, use the left and right arrow keys " +"to focus the field, and press the space bar to begin editing." +msgstr "" +"Quando è selezionato un server, fare clic sul campo nella colonna " +"<gui>Server</gui> o <gui>Porta</gui> per modificarlo. In alternativa, usare " +"le frecce destra e sinistra per spostare il focus sul campo e premere la " +"barra spaziatrice per avviare la modifica." + +#: C/account-irc.page:146(p) +msgid "" +"Select the check box in the <gui>SSL</gui> column to encrypt all " +"communication with a server. Note that this does not prevent other users on " +"the network from seeing what you write on public chat rooms." +msgstr "" +"Selezionare la casella nella colonna <gui>SSL</gui> per cifrare tutte le " +"comunicazioni col server. Questa opzione non previene che altri utenti " +"all'interno della rete vedano cosa si scrive in una stanza di conversazione " +"pubblica." + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2 +#: C/index.page:0(None) msgid "translator-credits" msgstr "Milo Casagrande <milo@ubuntu.com>" +#~ msgid "<application>Empathy</application> Manual V2.1" +#~ msgstr "Manuale V2.1 di <application>Empathy</application>" + +#~ msgid "2008, 2009" +#~ msgstr "2008, 2009" + +#~ msgid "Ubuntu Documentation Project" +#~ msgstr "Ubuntu Documentation Project" + +#~ msgid "" +#~ "Permission is granted to copy, distribute and/or modify this document " +#~ "under the terms of the GNU Free Documentation License (GFDL), Version 1.1 " +#~ "or any later version published by the Free Software Foundation with no " +#~ "Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. You " +#~ "can find a copy of the GFDL at this <ulink type=\"help\" url=\"ghelp:fdl" +#~ "\">link</ulink> or in the file COPYING-DOCS distributed with this manual." +#~ msgstr "" +#~ "Questo documento può essere copiato, distribuito o modificato solo in " +#~ "conformità con i termini della GNU Free Documentation License (GFDL) " +#~ "Versione 1.1 o delle versioni successive pubblicate dalla Free Software " +#~ "Foundation senza sezioni invariabili, frontespizi e testi di copertina. " +#~ "Una copia della GFDL è disponibile su questo <ulink type=\"help\" url=" +#~ "\"ghelp:fdl\">collegamento</ulink> o nel file COPYING-DOCS distribuito " +#~ "con questo manuale." + +#~ msgid "" +#~ "This manual is part of a collection of GNOME manuals distributed under " +#~ "the GFDL. If you want to distribute this manual separately from the " +#~ "collection, you can do so by adding a copy of the license to the manual, " +#~ "as described in section 6 of the license." +#~ msgstr "" +#~ "Questo manuale fa parte di una raccolta di manuali GNOME distribuita in " +#~ "conformità con la GFDL. Per poter distribuire questo manuale " +#~ "separatamente, è necessario inserirvi una copia della licenza, come " +#~ "descritto nella sezione 6 della licenza." + +#~ msgid "" +#~ "Many of the names used by companies to distinguish their products and " +#~ "services are claimed as trademarks. Where those names appear in any GNOME " +#~ "documentation, and the members of the GNOME Documentation Project are " +#~ "made aware of those trademarks, then the names are in capital letters or " +#~ "initial capital letters." +#~ msgstr "" +#~ "Molti dei nomi usati dalle aziende per distinguere i propri prodotti e " +#~ "servizi sono rivendicati come marchi. Quando questi nomi compaiono nella " +#~ "documentazione di GNOME, e i partecipanti al GNOME Documentation Project " +#~ "sono consapevoli del loro utilizzo, essi vengono scritti in lettere " +#~ "maiuscole o con l'iniziale maiuscola." + +#~ msgid "" +#~ "DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, " +#~ "EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES " +#~ "THAT THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS " +#~ "MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE " +#~ "RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR " +#~ "MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR " +#~ "MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL " +#~ "WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY " +#~ "SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES " +#~ "AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED " +#~ "VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS " +#~ "DISCLAIMER; AND" +#~ msgstr "" +#~ "IL DOCUMENTO VIENE FORNITO SENZA GARANZIE DI ALCUN TIPO, ESPLICITE O " +#~ "IMPLICITE, INCLUSE, MA SENZA LIMITAZIONE, LE GARANZIE ATTESTANTI CHE IL " +#~ "DOCUMENTO O LE SUE VERSIONI MODIFICATE SIANO PRIVI DI DIFETTI, " +#~ "COMMERCIALIZZABILI, IDONEI A UN DETERMINATO SCOPO O CHE NON VIOLINO " +#~ "DIRITTI DI TERZI. SI DECLINA QUALUNQUE RESPONSABILITÀ RIGUARDO AI RISCHI " +#~ "INERENTI LA QUALITÀ, L'ACCURATEZZA E LE PRESTAZIONI DEL DOCUMENTO O DI " +#~ "UNA SUA VERSIONE MODIFICATA. QUALORA UN DOCUMENTO O UNA SUA VERSIONE " +#~ "MODIFICATA DOVESSERO PRESENTARE QUALUNQUE TIPO DI DIFETTO, IL COSTO DI " +#~ "EVENTUALI INTERVENTI DI ASSISTENZA, RIPARAZIONE O CORREZIONE SARÀ A " +#~ "CARICO DELL'UTENTE (NON DEL REDATTORE INIZIALE, DELL'AUTORE O DI ALTRI " +#~ "COLLABORATORI). QUESTA LIMITAZIONE DELLA GARANZIA COSTITUISCE PARTE " +#~ "ESSENZIALE DELLA LICENZA. L'USO DEL DOCUMENTO O DELLE SUE VERSIONI " +#~ "MODIFICATE È CONSENTITO SOLO ENTRO I TERMINI DI QUESTA LIMITAZIONE DELLA " +#~ "GARANZIA;" + +#~ msgid "" +#~ "UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT " +#~ "(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL " +#~ "WRITER, ANY CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED " +#~ "VERSION OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE " +#~ "LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR " +#~ "CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, " +#~ "DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR " +#~ "MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR LOSSES ARISING OUT OF OR " +#~ "RELATING TO USE OF THE DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT, " +#~ "EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH " +#~ "DAMAGES." +#~ msgstr "" +#~ "IN NESSUNA CIRCOSTANZA E PER NESSUNA RAGIONE LEGALE, INCLUSI I PRINCIPI " +#~ "DI COLPA (INCLUSA LA NEGLIGENZA), ACCORDO CONTRATTUALE O ALTRO, SARÀ " +#~ "POSSIBILE CONSIDERARE L'AUTORE, IL REDATTORE INIZIALE, GLI ALTRI " +#~ "COLLABORATORI, QUALUNQUE DISTRIBUTORE DEL DOCUMENTO O DI UNA SUA VERSIONE " +#~ "MODIFICATA O QUALUNQUE FORNITORE DELLE PERSONE CITATE, RESPONSABILE NEI " +#~ "CONFRONTI DI QUALUNQUE PERSONA PER DANNI DIRETTI, INDIRETTI, SPECIALI, " +#~ "INCIDENTALI O CONSEGUENTI DI QUALUNQUE NATURA, INCLUSI, MA SENZA " +#~ "LIMITAZIONE, I DANNI PER PERDITA DI AVVIAMENTO, INTERRUZIONE DEL LAVORO, " +#~ "GUASTO O MALFUNZIONAMENTO DEL COMPUTER O QUALUNQUE ALTRO DANNO O PERDITA " +#~ "DERIVANTE O CORRELATA ALL'USO DEL DOCUMENTO O DI UNA SUA VERSIONE " +#~ "MODIFICATA, ANCHE QUALORA LE PERSONE CITATE FOSSERO STATE INFORMATE DELLA " +#~ "POSSIBILITÀ DI TALI DANNI." + +#~ msgid "" +#~ "DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE " +#~ "TERMS OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER " +#~ "UNDERSTANDING THAT: <placeholder-1/>" +#~ msgstr "" +#~ "QUESTO DOCUMENTO E LE SUE VERSIONI MODIFICATE VENGONO FORNITI IN BASE AI " +#~ "TERMINI DELLA GNU FREE DOCUMENTATION LICENSE, CON L'INTESA CHE: " +#~ "<placeholder-1/>" + +#~ msgid "Milo" +#~ msgstr "Milo" + +#~ msgid "Seth" +#~ msgstr "Seth" + +#~ msgid "Dudenhofer" +#~ msgstr "Dudenhofer" + +#~ msgid "sdudenhofer@gmail.com" +#~ msgstr "sdudenhofer@gmail.com" + +#~ msgid "Empathy Manual V2.1" +#~ msgstr "Manuale V2.1 di Empathy" + +#~ msgid "January 2009" +#~ msgstr "Gennaio 2009" + +#~ msgid "Milo Casagrande <email>milo@ubuntu.com</email>" +#~ msgstr "Milo Casagrande <email>milo@ubuntu.com</email>" + +#~ msgid "Empathy Manual V2.0" +#~ msgstr "Manuale V2.0 di Empathy" + +#~ msgid "April 2008" +#~ msgstr "Aprile 2008" + +#~ msgid "Seth Dudenhofer <email>sdudenhofer@gmail.com</email>" +#~ msgstr "Seth Dudenhofer <email>sdudenhofer@gmail.com</email>" + +#~ msgid "This manual describes version 2.26 of Empathy." +#~ msgstr "Questo manuale descrive la versione 2.26 di Empathy." + +#~ msgid "Feedback" +#~ msgstr "Commenti" + +#~ msgid "" +#~ "To report a bug or make a suggestion regarding the <application>Empathy</" +#~ "application> application or this manual, follow the directions in the " +#~ "<ulink url=\"ghelp:gnome-feedback\" type=\"help\">GNOME Feedback Page</" +#~ "ulink>." +#~ msgstr "" +#~ "Per segnalare un problema o inviare suggerimenti riguardo " +#~ "<application>Empathy</application> o su questo manuale, seguire le " +#~ "istruzioni presenti alla <ulink url=\"ghelp:gnome-feedback\" type=\"help" +#~ "\">pagina di commenti di GNOME</ulink>." + +#~ msgid "Empathy" +#~ msgstr "Empathy" + +#~ msgid "" +#~ "<application>Empathy</application> is a multi-protocol instant messaging " +#~ "program for the GNOME Desktop. With <application>Empathy</application> " +#~ "you can keep in touch with all of your friends through lots of supported " +#~ "instant messaging services." +#~ msgstr "" +#~ "<application>Empathy</application> è un programma di messaggistica " +#~ "istantanea multi-protocollo per lo GNOME Desktop. Con " +#~ "<application>Empathy</application> è possibile mantenere i contatti con " +#~ "tutti i propri amici attraverso diversi servizi di messaggistica " +#~ "istantanea supportati." + +#~ msgid "Jabber (or <acronym>XMPP</acronym>)" +#~ msgstr "Jabber (o <acronym>XMPP</acronym>)" + +#~ msgid "Salut" +#~ msgstr "Salut" + +#~ msgid "And many others..." +#~ msgstr "E molti altri..." + +#~ msgid "" +#~ "<application>Empathy</application> supports the following services: " +#~ "<placeholder-1/>" +#~ msgstr "" +#~ "<application>Empathy</application> supporta i seguenti servizi: " +#~ "<placeholder-1/>" + +#~ msgid "Getting Started" +#~ msgstr "Per iniziare" + +#~ msgid "Starting Empathy" +#~ msgstr "Avviare Empathy" + +#~ msgid "" +#~ "You can start <application>Empathy</application> in the following ways:" +#~ msgstr "" +#~ "È possibile avviare <application>Empathy</application> nei seguenti modi:" + +#~ msgid "<guimenu>Applications</guimenu> menu" +#~ msgstr "Menù <guimenu>Applicazioni</guimenu>" + +#~ msgid "" +#~ "Choose <menuchoice><guisubmenu>Internet</guisubmenu><guimenuitem>Empathy " +#~ "Instant Messenger</guimenuitem></menuchoice>." +#~ msgstr "" +#~ "Scegliere <menuchoice><guisubmenu>Internet</" +#~ "guisubmenu><guimenuitem>Empathy - Messaggistica istantanea</guimenuitem></" +#~ "menuchoice>." + +#~ msgid "Command line" +#~ msgstr "Riga di comando" + +#~ msgid "" +#~ "Type <command>empathy</command> and then press <keycap>Enter</keycap>." +#~ msgstr "" +#~ "Digitare <command>empathy</command> e premere <keycap>Invio</keycap>." + +#~ msgid "When You Start Empathy" +#~ msgstr "Quando si avvia Empathy" + +#~ msgid "" +#~ "Shows <placeholder-1/> main window. Contains the titlebar, the menubar, " +#~ "contact list, status icon and status arrow button list." +#~ msgstr "" +#~ "Mostra la finestra principale di <placeholder-1/>. Contiene la barra del " +#~ "titolo, la barra dei menù, l'elenco dei contatti, l'icona di stato e " +#~ "l'elenco degli stati." + +#~ msgid "" +#~ "When you start <application>Empathy</application> the following window is " +#~ "shown. <placeholder-1/>" +#~ msgstr "" +#~ "Quando si avvia <application>Empathy</application> viene mostrata la " +#~ "seguente finestra. <placeholder-1/>" + +#~ msgid "<application>Empathy</application> Main Components" +#~ msgstr "Componenti principali di <application>Empathy</application>" + +#~ msgid "Component" +#~ msgstr "Componente" + +#~ msgid "Menubar" +#~ msgstr "Barra dei menù" + +#~ msgid "" +#~ "Contains menus used to perform actions in <application>Empathy</" +#~ "application>." +#~ msgstr "" +#~ "Contiene i menù usati per svolgere le azioni in <application>Empathy</" +#~ "application>." + +#~ msgid "Status Drop-Down List" +#~ msgstr "Elenco a discesa degli stati" + +#~ msgid "Allows to update the status." +#~ msgstr "Consente di aggiornare lo stato." + +#~ msgid "Account Button" +#~ msgstr "Pulsante degli account" + +#~ msgid "Opens the <guilabel>Accounts</guilabel> dialog." +#~ msgstr "Apre il dialogo <guilabel>Account</guilabel>." + +#~ msgid "Shows all the available contacts and their associated status." +#~ msgstr "Mostra tutti i contatti disponibili e il loro stato." + +#~ msgid "" +#~ "<xref linkend=\"empathy-TBL-1\"/> describes the components of " +#~ "<application>Empathy</application>'s main window. <table frame=\"topbot\" " +#~ "id=\"empathy-TBL-1\"><placeholder-1/><tgroup cols=\"2\" colsep=\"0\" " +#~ "rowsep=\"0\"><colspec colname=\"colspec0\" colwidth=\"29.39*\"/><colspec " +#~ "colname=\"colspec1\" colwidth=\"70.61*\"/><placeholder-2/><placeholder-3/" +#~ "></tgroup></table>" +#~ msgstr "" +#~ "<xref linkend=\"empathy-TBL-1\"/> descrive i componenti della finestra " +#~ "principale di <application>Empathy</application>. <table frame=\"topbot\" " +#~ "id=\"empathy-TBL-1\"><placeholder-1/><tgroup cols=\"2\" colsep=\"0\" " +#~ "rowsep=\"0\"><colspec colname=\"colspec0\" colwidth=\"29.39*\"/><colspec " +#~ "colname=\"colspec1\" colwidth=\"70.61*\"/><placeholder-2/><placeholder-3/" +#~ "></tgroup></table>" + +#~ msgid "" +#~ "To use <application>Empathy</application> you need at least one account " +#~ "of the supported services." +#~ msgstr "" +#~ "Per poter usare <application>Empathy</application> è necessario disporre " +#~ "almeno un account dei servizi supportati." + +#~ msgid "" +#~ "If you don't already have an account and you don't have your " +#~ "<emphasis>user name</emphasis> and <emphasis>password</emphasis>, you " +#~ "need to register a new account (see <xref linkend=\"empathy-register-" +#~ "account\"/>)." +#~ msgstr "" +#~ "Se ancora non si ha un account e non si dispone del proprio " +#~ "<emphasis>nome utente</emphasis> e della propria <emphasis>password</" +#~ "emphasis>, è necessario registrare un nuovo account (consultare <xref " +#~ "linkend=\"empathy-register-account\"/>)." + +#~ msgid "" +#~ "In order to talk with other users, also called <emphasis>contacts</" +#~ "emphasis>, you need to use the same service they are using. If, for " +#~ "example, one contact is using the <emphasis role=\"strong\">Jabber</" +#~ "emphasis> service, you need to have an account registered with that " +#~ "service." +#~ msgstr "" +#~ "Per poter \"parlare\" con altri utenti (chiamati <emphasis>contatti</" +#~ "emphasis>), è necessario usare lo stesso servizio usato da loro. Se, per " +#~ "esempio, un contatto sta usando il servizio <emphasis role=\"strong" +#~ "\">Jabber</emphasis>, è necessario avere un account registrato con quel " +#~ "servizio." + +#~ msgid "" +#~ "<application>Empathy</application> can handle as many accounts on any " +#~ "supported services as you want and you can have them all open at the same " +#~ "time." +#~ msgstr "" +#~ "<application>Empathy</application> è in grado di gestire tutti i contatti " +#~ "che si vogliono su qualsiasi servizio supportato ed è possibile averli " +#~ "tutti aperti allo stesso tempo." + +#~ msgid "" +#~ "You can freely register an account on any of the following services. " +#~ "Follow the instructions reported on each website on how to register your " +#~ "new account. At the end of the registration process you should have a " +#~ "<emphasis>user name</emphasis> (or an <emphasis>account ID</emphasis>) " +#~ "and a <emphasis>password</emphasis> that you will use to create the " +#~ "account in <application>Empathy</application>." +#~ msgstr "" +#~ "È possibile registrare un account gratuitamente con i seguenti servizi. " +#~ "Seguire le istruzioni riportate nei siti web su come registrare un nuovo " +#~ "account. Al termine della registrazione dovrebbero essere disponibili un " +#~ "<emphasis>nome utente</emphasis> (o un <emphasis>ID account</emphasis>) e " +#~ "una <emphasis>password</emphasis> necessari per inserire l'account in " +#~ "<application>Empathy</application>." + +#~ msgid "" +#~ "The <ulink type=\"http\" url=\"http://dashboard.aim.com/aim\">AIM</ulink> " +#~ "service." +#~ msgstr "" +#~ "Il servizio <ulink type=\"http\" url=\"http://dashboard.aim.com/aim" +#~ "\">AIM</ulink>." + +#~ msgid "" +#~ "The <ulink type=\"http\" url=\"http://www.google.com/talk/\">Google Talk</" +#~ "ulink> service." +#~ msgstr "" +#~ "Il servizio <ulink type=\"http\" url=\"http://www.google.com/talk/" +#~ "\">Google Talk</ulink>." + +#~ msgid "" +#~ "The <ulink type=\"http\" url=\"https://www.icq.com/register/\">ICQ</" +#~ "ulink> service." +#~ msgstr "" +#~ "Il servizio <ulink type=\"http\" url=\"https://www.icq.com/register/" +#~ "\">ICQ</ulink>." + +#~ msgid "" +#~ "The <ulink type=\"http\" url=\"https://accountservices.passport.net" +#~ "\">MSN</ulink> service." +#~ msgstr "" +#~ "Il servizio <ulink type=\"http\" url=\"https://accountservices.passport." +#~ "net\">MSN</ulink>." + +#~ msgid "" +#~ "The <ulink type=\"http\" url=\"https://login.yahoo.com/config/login" +#~ "\">Yahoo</ulink> service." +#~ msgstr "" +#~ "Il servizio <ulink type=\"http\" url=\"https://login.yahoo.com/config/" +#~ "mail?.intl=it&.src=ym&.done=http://it.yahoo.com\">Yahoo</ulink>." + +#~ msgid "" +#~ "Click on the name of the service to visit its website: <placeholder-1/>" +#~ msgstr "" +#~ "Fare clic sul nome del servizio per visitarne il sito web: <placeholder-1/" +#~ ">" + +#~ msgid "" +#~ "For registering a <acronym>SIP</acronym> account, you can use one of the " +#~ "following service:" +#~ msgstr "" +#~ "Per registrare un account <acronym>SIP</acronym>, è possibile usare uno " +#~ "dei seguenti servizi:" + +#~ msgid "" +#~ "The <ulink type=\"http\" url=\"http://account2.freeworlddialup.com/index." +#~ "php?section_id=94\"><acronym>FWD</acronym></ulink> (Free World Dialup) " +#~ "service." +#~ msgstr "" +#~ "Il servizio <ulink type=\"http\" url=\"http://account2.freeworlddialup." +#~ "com/index.php?section_id=94\"><acronym>FWD</acronym></ulink> (Free World " +#~ "Dialup)." + +#~ msgid "" +#~ "For registering a <emphasis role=\"strong\">Jabber</emphasis> account, " +#~ "you can use the automatic account creation of <application>Empathy</" +#~ "application>. Not all Jabber service providers support the automatic " +#~ "creation of accounts, one service provider known to work with " +#~ "<application>Empathy</application> is <ulink type=\"http\" url=\"http://" +#~ "www.jabber.org/web/Jabber.org\">jabber.org</ulink>." +#~ msgstr "" +#~ "Per registrare un account con <emphasis role=\"strong\">Jabber</" +#~ "emphasis>, è possibile utilizzare la creazione automatica degli account " +#~ "di <application>Empathy</application>. Non tutti i fornitori di servizi " +#~ "su Jabber supportano questa funzionalità: un fornitore noto funzionare " +#~ "con <application>Empathy</application> è <ulink type=\"http\" url=" +#~ "\"http://www.jabber.org/web/Jabber.org\">jabber.org</ulink>." + +#~ msgid "" +#~ "If you already have a <emphasis role=\"strong\">Jabber</emphasis> " +#~ "account, you can use one of the following services:" +#~ msgstr "" +#~ "Si si dispone già di un account <emphasis role=\"strong\">Jabber</" +#~ "emphasis>, è possibile usare uno dei seguenti servizi:" + +#~ msgid "" +#~ "From the <link linkend=\"empathy-FIG-mainwindow\">main window </link> " +#~ "(<guilabel>Contact List</guilabel>) click on the account button or press " +#~ "<keycap>F4</keycap> to open the <guilabel>Accounts</guilabel> dialog." +#~ msgstr "" +#~ "Dalla <link linkend=\"empathy-FIG-mainwindow\">finestra principale</link> " +#~ "(<guilabel>Elenco contatti</guilabel>) fare clic sul pulsante degli " +#~ "account, o premere <keycap>F4</keycap>, per aprire il dialogo " +#~ "<guilabel>Account</guilabel>." + +#~ msgid "" +#~ "From the <guilabel>Type</guilabel> drop-down list choose the service you " +#~ "wish to add an account for, then click on the <guibutton>Create</" +#~ "guibutton> button." +#~ msgstr "" +#~ "Dall'elenco a discesa <guilabel>Tipo</guilabel> scegliere il servizio per " +#~ "cui si vuole creare l'account, quindi fare clic sul pulsante " +#~ "<guibutton>Crea</guibutton>." + +#~ msgid "" +#~ "If it is the first time you launch <application>Empathy</application>: " +#~ "<placeholder-1/>" +#~ msgstr "" +#~ "Se è la prima volta che viene avviato <application>Empathy</application>: " +#~ "<placeholder-1/>" + +#~ msgid "Otherwise: <placeholder-1/>" +#~ msgstr "Altrimenti: <placeholder-1/>" + +#~ msgid "" +#~ "Fill the required fields with your <emphasis>user name</emphasis> and " +#~ "<emphasis>password</emphasis>. Optionally, you can modify some advanced " +#~ "options. For more information, see <xref linkend=\"empathy-advanced-" +#~ "options\"/>." +#~ msgstr "" +#~ "Riempire i campi richiesti con il proprio <emphasis>nome utente</" +#~ "emphasis> e la propria <emphasis>password</emphasis>, inoltre, è anche " +#~ "possibile modificare delle opzioni avanzate. Per maggiori informazioni, " +#~ "consultare <xref linkend=\"empathy-advanced-options\"/>." + +#~ msgid "" +#~ "To add your account to <application>Empathy</application>, proceed as " +#~ "follows: <placeholder-1/>" +#~ msgstr "" +#~ "Per aggiungere il proprio account a <application>Empathy</application>, " +#~ "procedere come segue: <placeholder-1/>" + +#~ msgid "" +#~ "If you use another instant messaging program, you can import the accounts " +#~ "from that program into <application>Empathy</application>" +#~ msgstr "" +#~ "Se si usa un altro programma di messaggistica istantanea, è possibile " +#~ "importare gli account da quel programma in <application>Empathy</" +#~ "application>" + +#~ msgid "" +#~ "At the moment <application>Empathy</application> can import the accounts " +#~ "only from the instant messaging program <application>Pidgin</" +#~ "application>. For more information about <application>Pidgin</" +#~ "application>, see the <ulink type=\"http\" url=\"http://www.pidgin.im/" +#~ "\">Pidgin website</ulink>." +#~ msgstr "" +#~ "Attualmente <application>Empathy</application> è in grado di importare " +#~ "gli account solamente dal programma di messaggistica istantanea " +#~ "<application>Pidgin</application>. Per maggiori informazioni riguardo " +#~ "<application>Pidgin</application>, consultarne il <ulink type=\"http\" " +#~ "url=\"http://www.pidgin.im/\">sito web</ulink>." + +#~ msgid "" +#~ "Click on the <guibutton>Import Accounts...</guibutton> button to open the " +#~ "<guilabel>Import Accounts</guilabel> dialog." +#~ msgstr "" +#~ "Fare clic sul pulsante <guibutton>Importa account...</guibutton> per " +#~ "aprire il dialogo <guilabel>Importa account</guilabel>." + +#~ msgid "" +#~ "Select the accounts you would like to import by clicking on the " +#~ "<guilabel>Import</guilabel> check-box." +#~ msgstr "" +#~ "Selezionare gli account da importare facendo clic sulla casella di scelta " +#~ "<guilabel>Importa</guilabel>." + +#~ msgid "" +#~ "When you have selected all the desired accounts, click <guibutton>OK</" +#~ "guibutton> to import them. If you don't want to import the accounts, " +#~ "click <guibutton>Cancel</guibutton>." +#~ msgstr "" +#~ "Selezionati tutti gli account da importare, fare clic su <guibutton>OK</" +#~ "guibutton> per importarli. Per annullare l'importazione degli account, " +#~ "fare clic su <guibutton>Cancel</guibutton>." + +#~ msgid "" +#~ "When you import a new account into <application>Empathy</application>, it " +#~ "will not be enabled by default." +#~ msgstr "" +#~ "Quando viene importato un nuovo account in <application>Empathy</" +#~ "application>, questo non viene abilitato in modo predefinito." + +#~ msgid "" +#~ "To import the accounts into <application>Empathy</application>, proceed " +#~ "as follows: <placeholder-1/>" +#~ msgstr "" +#~ "Per importare gli account in <application>Empathy</application>, " +#~ "procedere come segue: <placeholder-1/>" + +#~ msgid "Select the account you wish to edit in the box on the left." +#~ msgstr "Selezionare l'account da modificare nel riquadro a sinistra." + +#~ msgid "Modify the desired data." +#~ msgstr "Modificare i dati desiderati." + +#~ msgid "" +#~ "To edit one of your accounts, i.e. to change the <emphasis>password</" +#~ "emphasis> or your <emphasis>user name</emphasis>, proceed as follows: " +#~ "<placeholder-1/>" +#~ msgstr "" +#~ "Per modificare uno dei propri account, per cambiarne la " +#~ "<emphasis>password</emphasis> o il <emphasis>nome utente</emphasis>, " +#~ "procedere come segue: <placeholder-1/>" + +#~ msgid "" +#~ "Based on the type of the account, it is possibile to edit different " +#~ "settings." +#~ msgstr "" +#~ "In base al tipo di account è possibile modificare diverse impostazioni." + +#~ msgid "" +#~ "Select the account you wish to edit in the box on the left and double-" +#~ "click on its name." +#~ msgstr "" +#~ "Selezionare l'account da modificare nel riquadro a sinistra e fare doppio-" +#~ "clic sul suo nome." + +#~ msgid "Change the name of the account as you desire." +#~ msgstr "Modificare il nome dell'account come preferito." + +#~ msgid "" +#~ "To modify the identifier of an account, how <application>Empathy</" +#~ "application> identifies an account, proceed as follows: <placeholder-1/>" +#~ msgstr "" +#~ "Per modificare l'identificativo di un account, in che modo " +#~ "<application>Empathy</application> identifica un account, procedere come " +#~ "segue: <placeholder-1/>" + +#~ msgid "To disable an account, proceed as follows:" +#~ msgstr "Per disabilitare un account, procedere come segue:" + +#~ msgid "" +#~ "Select the account you wish to disable in the box on the left of the " +#~ "dialog and deselect the <guilabel>Enabled</guilabel> check-box." +#~ msgstr "" +#~ "Seleziona l'account da disabilitare nel riquadro a sinistra del dialogo e " +#~ "deselezionare la casella di scelta <guilabel>Abilitato</guilabel>." + +#~ msgid "To remove an account, proceed as follows:" +#~ msgstr "Per rimuovere un account, procedere come segue:" + +#~ msgid "Editing Personal Information" +#~ msgstr "Modificare le informazioni personali" + +#~ msgid "" +#~ "To change your personal information, your alias and your icon (the image " +#~ "that other contacts will see of you), for each of your accounts, proceed " +#~ "as follows:" +#~ msgstr "" +#~ "Per modificare le proprie informazioni personali, il proprio pseudonomio " +#~ "o l'icona (l'immagine che altri contatti vedono relativamente al proprio " +#~ "profilo), per ognuno degli account disponibile, procedere come segue:" + +#~ msgid "" +#~ "From the <link linkend=\"empathy-FIG-mainwindow\">main window</link>, " +#~ "select <menuchoice><guimenu>Edit</guimenu><guimenuitem>Personal " +#~ "Information</guimenuitem></menuchoice>." +#~ msgstr "" +#~ "Dalla <link linkend=\"empathy-FIG-mainwindow\">finestra principale</" +#~ "link>, scegliere <menuchoice><guimenu>Modifica</" +#~ "guimenu><guimenuitem>Informazioni personali...</guimenuitem></menuchoice>." + +#~ msgid "" +#~ "To change your icon, click on the person-looking button and choose an " +#~ "image file." +#~ msgstr "" +#~ "Per modificare la propria immagine, fare clic sul pulsante che raffigura " +#~ "una persona e scegliere una nuova immagine." + +#~ msgid "" +#~ "An <emphasis>alias</emphasis> is an alternative way you can identify " +#~ "yourself. You can use your real name or a nickname." +#~ msgstr "" +#~ "Uno <emphasis>pseudonimo</emphasis> è un modo alternativo con cui è " +#~ "possibile identificarsi. È possibile usare il proprio vero nome oppure un " +#~ "soprannome." + +#~ msgid "" +#~ "Based on the service you are using, it is possible to configure more " +#~ "advanced options to modify the normal behavior of <application>Empathy</" +#~ "application>." +#~ msgstr "" +#~ "In base ai servizi di messaggistica che si usano, è possibile configurare " +#~ "deiverse opzioni avanzate per modificare il funzionamento predefinito di " +#~ "<application>Empathy</application>." + +#~ msgid "" +#~ "To configure these options, when you are <link linkend=\"empathy-create-" +#~ "account\">adding a new account</link>, click on the drop-down section " +#~ "<guilabel>Advanced</guilabel>." +#~ msgstr "" +#~ "Per configurare queste opzioni, quando si sta <link linkend=\"empathy-" +#~ "create-account\">aggiungendo un nuovo account</link>, fare clic sulla " +#~ "sezione a discesa <guilabel>Avanzato</guilabel>." + +#~ msgid "Jabber (or <acronym>XMPP</acronym>) and Google Talk" +#~ msgstr "Jabber (o <acronym>XMPP</acronym>) e Google Talk" + +#~ msgid "" +#~ "Select this option in order to use some sort of encryption during your " +#~ "conversations." +#~ msgstr "" +#~ "Selezionare questa opzione per utilizzare una qualche sorta di cifratura " +#~ "durante le proprie conversazioni." + +#~ msgid "" +#~ "Select this option in order to ignore the errors that can be generated by " +#~ "some types of security certificates. Usually these certificates are " +#~ "called auto-signed." +#~ msgstr "" +#~ "Selezionare questa opzione per ignorare gli errori che possono venir " +#~ "generati da alcune tipologie di certificati di sicurezza. Solitamente " +#~ "questi certificati sono chiamati auto-firmati." + +#~ msgid "" +#~ "Select this option only if you are sure the certificate is secure and you " +#~ "can trust it." +#~ msgstr "" +#~ "Selezionare questa opzione solo se si è sicuri che il certificato è " +#~ "sicuro e ci si possa fidare." + +#~ msgid "" +#~ "Use this text box to set a name with which you can identify the running " +#~ "program based on where you are running it. With this option, and the " +#~ "<guilabel>Priority</guilabel> one, you can use your account " +#~ "simultaneously in two different devices. For example, if you set one " +#~ "device to <replaceable>desktop</replaceable> and the other one to " +#~ "<replaceable>mobile</replaceable>, you can connect with both of them and " +#~ "based on the <guilabel>Priority</guilabel> value you will receive " +#~ "messages on one of the two devices or both." +#~ msgstr "" +#~ "Usare questa casella di testo per impostare un nome con cui identificare " +#~ "il programma in esecuzione in base a dove viene eseguito. Tramite questa " +#~ "opzione, e la <guilabel>Priorità</guilabel>, è possibile usare il proprio " +#~ "account contemporaneamente in due dispositivi diversi. Per esempio, se un " +#~ "dispositivo viene impostato come <replaceable>desktop</replaceable> e " +#~ "l'altro come <replaceable>portatile</replaceable>, è possibile collegarsi " +#~ "con entrambi e in base al valore di <guilabel>Priorità</guilabel> si " +#~ "riceveranno i messaggi su uno dei due dispositivi o su entrambi." + +#~ msgid "" +#~ "This can be useful if you have two devices, a main one and a portable " +#~ "one, and you move away from the main one bringing with you the other: you " +#~ "can still receive messages from your account with the portable device " +#~ "even if you do not disconnet from the main one." +#~ msgstr "" +#~ "Questo può essere particolarmente utile se si disponde di due " +#~ "dispositivi, uno principale e uno portatile, e ci si sposta da quello " +#~ "principale portando con sè il portatile: è possibile ricevere i messaggi " +#~ "inviati al proprio account con il dispositivo portatile anche se non ci " +#~ "si disconnette da quello principale." + +#~ msgid "" +#~ "If you set the same value for this text box on both the devices, when you " +#~ "connect with one of them, the other one will be disconnected, even if you " +#~ "set a different value with the <guilabel>Priority</guilabel> spin box." +#~ msgstr "" +#~ "Se questa casella di testo viene impostata con lo stesso valore su " +#~ "entrambi i dispositivi, quando ci si connette con uno dei due, l'altro " +#~ "verrà disconnesso, anche se viene impostato un valore diverso con il " +#~ "controllo di selezione <guilabel>Priorità</guilabel>." + +#~ msgid "" +#~ "Use this spin box to indicate wich device, set in the <guilabel>Resource</" +#~ "guilabel> text box, will receive the new messages. The higher the number, " +#~ "the higher the priority: you will receive the new messages on the device " +#~ "with the highest number." +#~ msgstr "" +#~ "Usare questo controllo di selezione per indicare quale dispositivo, " +#~ "impostato tramite la casella di testo <guilabel>Risorsa</guilabel>, " +#~ "riceverà i nuovi messaggi. Maggiore il valore, più alta è la priorità: i " +#~ "messaggi verranno ricevuti dal dispositivo con priorità maggiore." + +#~ msgid "" +#~ "You can set values in the range from <literal>-128</literal> to " +#~ "<literal>127</literal>." +#~ msgstr "" +#~ "È possibile impostare questo valore nell'intervallo tra <literal>-128</" +#~ "literal> e <literal>127</literal>." + +#~ msgid "" +#~ "If you set the same value of this spin box in both the devices, you will " +#~ "receive messages on both of them." +#~ msgstr "" +#~ "Se viene impostato lo stesso valore per questo controllo di selezione su " +#~ "entrambi i dispositivi, si riceveranno i messaggi su entrambi." + +#~ msgid "" +#~ "Use this text box to write the name of the server you want to use for " +#~ "this service." +#~ msgstr "" +#~ "Usare questa casella di testo per indicare il nome del server da usare " +#~ "per questo servizio." + +#~ msgid "Port" +#~ msgstr "Porta" + +#~ msgid "" +#~ "Use this spin box to set the number of the port of the server to use." +#~ msgstr "" +#~ "Usare questo controllo di selezione per impostare il numero della porta " +#~ "da usare con il server." + +#~ msgid "" +#~ "You can set values in the range from <literal>0</literal> to " +#~ "<literal>65,555</literal>." +#~ msgstr "" +#~ "È possibile impostare questo valore nell'intervallo tra <literal>0</" +#~ "literal> e <literal>65.555</literal>." + +#~ msgid "Use old SSL" +#~ msgstr "Usare vecchio SSL" + +#~ msgid "" +#~ "Select this option to use the old version of the secure protocol for " +#~ "encrypting your connection." +#~ msgstr "" +#~ "Selezionare questa opzione per utilizzare la vecchia versione del " +#~ "protocollo di sicurezza nel cifrare la connessione." + +#~ msgid "" +#~ "In the <guilabel>Override server settings</guilabel> section you can set " +#~ "options that take precedence over the default settings. <placeholder-1/>" +#~ msgstr "" +#~ "Nella sezione <guilabel>Scavalcare impostazioni server</guilabel> è " +#~ "possibile impostare delle opzioni che hanno la precedenza rispetto le " +#~ "impostazioni predefinite. <placeholder-1/>" + +#~ msgid "Ignore conference and chatrooms invitations" +#~ msgstr "Ignorare conferenze e inviti per canali" + +#~ msgid "" +#~ "Select this option to ignore the invitations that other people may send " +#~ "you." +#~ msgstr "" +#~ "Selezionare questa opzione per ignorare gli inviti che altri contatti " +#~ "potrebbero inviare." + +#~ msgid "Room List locale" +#~ msgstr "Nazione elenco canali" + +#~ msgid "" +#~ "The value of this text box identifies the language used to retrieve the " +#~ "room list when connecting to the Yahoo service." +#~ msgstr "" +#~ "Il valore indicato in questa casella di testo identifica la lingua usata " +#~ "per recupeare l'elenco delle stanze nella connessione al servizio Yahoo." + +#~ msgid "" +#~ "If you need to change this value, use the two letter code of your " +#~ "language." +#~ msgstr "" +#~ "Nel caso sia necessario modificare questo valore, usare il codice a due " +#~ "lettere della propria lingua." + +#~ msgid "" +#~ "The value of this text box identifies the set of the characters used by " +#~ "<application>Empathy</application>." +#~ msgstr "" +#~ "Il valore di questa casella di testo identifica il set di caratteri usato " +#~ "da <application>Empathy</application>." + +#~ msgid "" +#~ "It is advise to leave this value to <literal>UTF-8</literal>. Change it " +#~ "only if that charset does not cover your language." +#~ msgstr "" +#~ "È consigliato lasciare questo valore impostato a <literal>UTF-8</" +#~ "literal>. Modificarlo solo se tale set di caratteri non include la " +#~ "propria lingua." + +#~ msgid "Use Yahoo Japan" +#~ msgstr "Usare Yahoo Giappone" + +#~ msgid "" +#~ "Select this option only if you have a Yahoo! Japan account. With the " +#~ "Yahoo! Japan service you can only use a Yahoo! Japan account: if you have " +#~ "registered an account with the English version of the service, that " +#~ "account will not work." +#~ msgstr "" +#~ "Selezionare questa opzione solo se si possiede un account Yahoo! " +#~ "Giappone. Con il servizio Yahoo! Giappone è possibile usare un account " +#~ "Yahoo! Giappone: se è stato registrato un account con la versione " +#~ "italiana del servizio, tale account non funziona." + +#~ msgid "<acronym>AIM</acronym>, GroupWise and <acronym>MSN</acronym>" +#~ msgstr "<acronym>AIM</acronym>, GroupWise e <acronym>MSN</acronym>" + +#~ msgid "Published Name" +#~ msgstr "Nome visibile" + +#~ msgid "" +#~ "Use this text box to write the name that will be visible to the other " +#~ "users of the network." +#~ msgstr "" +#~ "Usare questa casella di testo per indicare il nome che gli altri utenti " +#~ "della rete visualizzeranno." + +#~ msgid "Email" +#~ msgstr "Email" + +#~ msgid "Use this text box to write your email." +#~ msgstr "" +#~ "Usare questa casella di testo per scrivere il proprio indirizzo email." + +#~ msgid "Use this text box to write your Jabber ID, if you have one." +#~ msgstr "" +#~ "Usare questa casella di testo per indicare il proprio ID di Jabber nel " +#~ "caso se ne abbia uno." + +#~ msgid "" +#~ "Use this text box to write an alternative name to use with this service." +#~ msgstr "" +#~ "Usare questa casella di testo per indicare un nome alternativo da usare " +#~ "con questo servizio." + +#~ msgid "Contacts and Groups" +#~ msgstr "Contatti e gruppi" + +#~ msgid "" +#~ "All the contacts are handled within <application>Empathy</application>'s " +#~ "<link linkend=\"empathy-FIG-mainwindow\">main window</link>." +#~ msgstr "" +#~ "Tutti i contatti sono gestiti all'interno della <link linkend=\"empathy-" +#~ "FIG-mainwindow\">finestra principale</link> di <application>Empathy</" +#~ "application>." + +#~ msgid "" +#~ "You can add or remove a contact or you can edit the information of a " +#~ "particular contact. It is also possibile to arrange contacts in groups. " +#~ "You can have a group for your work contacts, one for you family contacts, " +#~ "and so on." +#~ msgstr "" +#~ "È possibile aggiungere o rimuovere un contatto, modificarne le " +#~ "informazioni e organizzare i contatti in gruppi. È possibile avere un " +#~ "gruppo per i propri contatti di lavoro, uno per i familiari, ecc..." + +#~ msgid "Adding and Removing a Contact" +#~ msgstr "Aggiungere e rimuovere un contatto" + +#~ msgid "To add a new contact, proceed as follows:" +#~ msgstr "Per aggiungere un nuovo contatto, procedere come segue:" + +#~ msgid "" +#~ "From the <link linkend=\"empathy-FIG-mainwindow\">main window</link> " +#~ "choose <menuchoice><guimenu>Chat</guimenu><guimenuitem>Add Contact...</" +#~ "guimenuitem></menuchoice>. The <guilabel>New Contact</guilabel> dialog " +#~ "will be shown." +#~ msgstr "" +#~ "Dalla <link linkend=\"empathy-FIG-mainwindow\">finestra principale</link> " +#~ "scegliere <menuchoice><guimenu>Chat</guimenu><guimenuitem>Aggiungi " +#~ "contatto...</guimenuitem></menuchoice>. Viene mostrato il dialogo " +#~ "<guilabel>Nuovo contatto</guilabel>." + +#~ msgid "" +#~ "From the <guilabel>Account</guilabel> drop-down list, choose the service " +#~ "used by the contact you are adding." +#~ msgstr "" +#~ "Dall'elenco a discesa <guilabel>Account</guilabel>, scegliere il servizio " +#~ "usato dal contatto che si sta aggiungendo." + +#~ msgid "" +#~ "In the <guilabel>Identifier</guilabel> text box type the " +#~ "<emphasis>address</emphasis> of the contact in the form of " +#~ "<userinput><replaceable>user name</replaceable>@<replaceable>service\n" +#~ "\t domain</replaceable></userinput>." +#~ msgstr "" +#~ "Nella casella di testo <guilabel>Identificatore</guilabel> digitare " +#~ "l'<emphasis>indirizzo</emphasis> del contatto nella forma " +#~ "<userinput><replaceable>nome utente</replaceable>@<replaceable>dominio\n" +#~ "\t servizio</replaceable></userinput>." + +#~ msgid "To remove a contact, proceed as follows:" +#~ msgstr "Per rimuovere un contatto, procedere come segue:" + +#~ msgid "" +#~ "From the <link linkend=\"empathy-FIG-mainwindow\">main window</link>, " +#~ "select the contact you would like to remove and right-click on it." +#~ msgstr "" +#~ "Dalla <link linkend=\"empathy-FIG-mainwindow\">finestra principale</" +#~ "link>, selezionare il contatto da rimuovere e fare clic col pulsante " +#~ "destro del mouse su di esso." + +#~ msgid "" +#~ "From the popup menu, choose <guilabel>Remove</guilabel> to remove the " +#~ "contact." +#~ msgstr "" +#~ "Dal menù a comparsa, scegliere <guilabel>Rimuovi</guilabel> per rimuovere " +#~ "il contatto." + +#~ msgid "" +#~ "An <emphasis>alias</emphasis> is an alternative way you can identify that " +#~ "particular contact. You can use the real name or the nickname of that " +#~ "person." +#~ msgstr "" +#~ "Uno <emphasis>pseudonimo</emphasis> è un modo alternativo con cui è " +#~ "possibile identificare un contatto. È possibile usare il vero nome oppure " +#~ "un soprannome della persona." + +#~ msgid "Editing a Contact" +#~ msgstr "Modificare un contatto" + +#~ msgid "To edit a contact, proceed as follows:" +#~ msgstr "Per modificare un contatto, procedere come segue:" + +#~ msgid "" +#~ "From the <link linkend=\"empathy-FIG-mainwindow\">main window</link>, " +#~ "select the contact you would like to modify and choose " +#~ "<menuchoice><guimenu>Edit</guimenu><guisubmenu>Contact</" +#~ "guisubmenu><guimenuitem>Edit</guimenuitem></menuchoice>, or right-click " +#~ "on it and choose <guilabel>Edit</guilabel>." +#~ msgstr "" +#~ "Dalla <link linkend=\"empathy-FIG-mainwindow\">finestra principale</" +#~ "link>, selezionare il contatto da modificare e scegliere " +#~ "<menuchoice><guimenu>Modifica</guimenu><guisubmenu>Contatto</" +#~ "guisubmenu><guimenuitem>Modifica</guimenuitem></menuchoice>, oppure fare " +#~ "clic col pulsante destro del mouse su di esso e scegliere " +#~ "<guilabel>Modifica</guilabel>." + +#~ msgid "" +#~ "From the <guilabel>Edit Contact Information</guilabel> dialog, you can " +#~ "modify the <emphasis>alias</emphasis> and the <emphasis>group</emphasis> " +#~ "of the contact." +#~ msgstr "" +#~ "Dal dialogo <guilabel>Modifica informazioni contatto</guilabel> è " +#~ "possibile modificare lo <emphasis>pseudonimo</emphasis> e il " +#~ "<emphasis>gruppo</emphasis> associati al contatto." + +#~ msgid "" +#~ "For more information about groups, see <xref linkend=\"empathy-add-" +#~ "contact-group\"/> and <xref linkend=\"empathy-add-group\"/>." +#~ msgstr "" +#~ "Per maggiori informazioni riguardo i gruppi, consultare <xref linkend=" +#~ "\"empathy-add-contact-group\"/> and <xref linkend=\"empathy-add-group\"/>." + +#~ msgid "Adding a Contact to a Group" +#~ msgstr "Aggiungere un contatto a un gruppo" + +#~ msgid "To add a contact to one or more groups, proceed as follows:" +#~ msgstr "" +#~ "Per aggiungere un contatto a uno a più gruppi, procedere come segue:" + +#~ msgid "Adding a New Group" +#~ msgstr "Aggiungere un nuovo gruppo" + +#~ msgid "To add a new group, proceed as follows:" +#~ msgstr "Per aggiungere un nuovo gruppo, procedere come segue:" + +#~ msgid "" +#~ "From the <link linkend=\"empathy-FIG-mainwindow\">main window</link>, " +#~ "select one contact and choose <menuchoice><guimenu>Edit</" +#~ "guimenu><guisubmenu>Contact</guisubmenu><guimenuitem>Edit</guimenuitem></" +#~ "menuchoice>, or right-click on it and choose <guilabel>Edit</guilabel>." +#~ msgstr "" +#~ "Dalla <link linkend=\"empathy-FIG-mainwindow\">finestra principale</link> " +#~ "selezionare un contatto e scegliere <menuchoice><guimenu>Modifica</" +#~ "guimenu><guisubmenu>Contatto</guisubmenu><guimenuitem>Modifica</" +#~ "guimenuitem></menuchoice> oppure fare clic col pulsante destro su di esso " +#~ "e scegliere <guilabel>Modifica</guilabel>." + +#~ msgid "" +#~ "In the <guilabel>Groups</guilabel> section, write the name of the group " +#~ "you want to add and then click on <guibutton>Add Group</guibutton>." +#~ msgstr "" +#~ "Nella sezione <guilabel>Gruppi</guilabel>, scrivere il nome del gruppo da " +#~ "aggiungere e fare clic su <guibutton>Aggiungi gruppo</guibutton>." + #~ msgid "" #~ "@@image: 'figures/empathy-new-account.png'; " #~ "md5=6c1e0d8c709125d387e975e5738b8c0f" diff --git a/libempathy-gtk/empathy-account-chooser.c b/libempathy-gtk/empathy-account-chooser.c index a91b0eb29..7624c2c13 100644 --- a/libempathy-gtk/empathy-account-chooser.c +++ b/libempathy-gtk/empathy-account-chooser.c @@ -29,12 +29,16 @@ #include <glib/gi18n-lib.h> #include <gtk/gtk.h> -#include <libempathy/empathy-account-manager.h> +#include <telepathy-glib/account-manager.h> + #include <libempathy/empathy-utils.h> #include "empathy-ui-utils.h" #include "empathy-account-chooser.h" +#define DEBUG_FLAG EMPATHY_DEBUG_OTHER +#include <libempathy/empathy-debug.h> + /** * SECTION:empathy-account-chooser * @title:EmpathyAccountChooser @@ -54,7 +58,7 @@ #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyAccountChooser) typedef struct { - EmpathyAccountManager *manager; + TpAccountManager *manager; gboolean set_active_item; gboolean account_manually_set; gboolean has_all_option; @@ -64,7 +68,7 @@ typedef struct { typedef struct { EmpathyAccountChooser *chooser; - EmpathyAccount *account; + TpAccount *account; gboolean set; } SetAccountData; @@ -86,24 +90,26 @@ static void account_chooser_set_property (GObject const GValue *value, GParamSpec *pspec); static void account_chooser_setup (EmpathyAccountChooser *chooser); -static void account_chooser_account_created_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, +static void account_chooser_account_validity_changed_cb (TpAccountManager *manager, + TpAccount *account, + gboolean valid, EmpathyAccountChooser *chooser); -static void account_chooser_account_add_foreach (EmpathyAccount *account, +static void account_chooser_account_add_foreach (TpAccount *account, EmpathyAccountChooser *chooser); -static void account_chooser_account_deleted_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, +static void account_chooser_account_removed_cb (TpAccountManager *manager, + TpAccount *account, EmpathyAccountChooser *chooser); -static void account_chooser_account_remove_foreach (EmpathyAccount *account, +static void account_chooser_account_remove_foreach (TpAccount *account, EmpathyAccountChooser *chooser); static void account_chooser_update_iter (EmpathyAccountChooser *chooser, GtkTreeIter *iter); -static void account_chooser_connection_changed_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, - TpConnectionStatusReason reason, - TpConnectionStatus new_status, - TpConnectionStatus old_status, - EmpathyAccountChooser *chooser); +static void account_chooser_status_changed_cb (TpAccount *account, + guint old_status, + guint new_status, + guint reason, + gchar *dbus_error_name, + GHashTable *details, + gpointer user_data); static gboolean account_chooser_separator_func (GtkTreeModel *model, GtkTreeIter *iter, EmpathyAccountChooser *chooser); @@ -156,16 +162,13 @@ empathy_account_chooser_init (EmpathyAccountChooser *chooser) priv->filter = NULL; priv->filter_data = NULL; - priv->manager = empathy_account_manager_dup_singleton (); + priv->manager = tp_account_manager_dup (); - g_signal_connect (priv->manager, "account-created", - G_CALLBACK (account_chooser_account_created_cb), - chooser); - g_signal_connect (priv->manager, "account-deleted", - G_CALLBACK (account_chooser_account_deleted_cb), + g_signal_connect (priv->manager, "account-validity-changed", + G_CALLBACK (account_chooser_account_validity_changed_cb), chooser); - g_signal_connect (priv->manager, "account-connection-changed", - G_CALLBACK (account_chooser_connection_changed_cb), + g_signal_connect (priv->manager, "account-removed", + G_CALLBACK (account_chooser_account_removed_cb), chooser); account_chooser_setup (EMPATHY_ACCOUNT_CHOOSER (chooser)); @@ -177,13 +180,10 @@ account_chooser_finalize (GObject *object) EmpathyAccountChooserPriv *priv = GET_PRIV (object); g_signal_handlers_disconnect_by_func (priv->manager, - account_chooser_connection_changed_cb, + account_chooser_account_validity_changed_cb, object); g_signal_handlers_disconnect_by_func (priv->manager, - account_chooser_account_created_cb, - object); - g_signal_handlers_disconnect_by_func (priv->manager, - account_chooser_account_deleted_cb, + account_chooser_account_removed_cb, object); g_object_unref (priv->manager); @@ -253,16 +253,16 @@ empathy_account_chooser_new (void) * @chooser: an #EmpathyAccountChooser * * Returns the account which is currently selected in the chooser or %NULL - * if there is no account selected. The #EmpathyAccount returned should be + * if there is no account selected. The #TpAccount returned should be * unrefed with g_object_unref() when finished with. * - * Return value: a new ref to the #EmpathyAccount currently selected, or %NULL. + * Return value: a new ref to the #TpAccount currently selected, or %NULL. */ -EmpathyAccount * +TpAccount * empathy_account_chooser_dup_account (EmpathyAccountChooser *chooser) { EmpathyAccountChooserPriv *priv; - EmpathyAccount *account; + TpAccount *account; GtkTreeModel *model; GtkTreeIter iter; @@ -295,7 +295,7 @@ TpConnection * empathy_account_chooser_get_connection (EmpathyAccountChooser *chooser) { EmpathyAccountChooserPriv *priv; - EmpathyAccount *account; + TpAccount *account; TpConnection *connection; g_return_val_if_fail (EMPATHY_IS_ACCOUNT_CHOOSER (chooser), NULL); @@ -303,7 +303,15 @@ empathy_account_chooser_get_connection (EmpathyAccountChooser *chooser) priv = GET_PRIV (chooser); account = empathy_account_chooser_dup_account (chooser); - connection = empathy_account_get_connection (account); + + /* if the returned account is NULL, then the account manager probably + * hasn't been prepared yet. It should be safe to return NULL here + * though. */ + if (account == NULL) { + return NULL; + } + + connection = tp_account_get_connection (account); g_object_unref (account); return connection; @@ -312,7 +320,7 @@ empathy_account_chooser_get_connection (EmpathyAccountChooser *chooser) /** * empathy_account_chooser_set_account: * @chooser: an #EmpathyAccountChooser - * @account: an #EmpathyAccount + * @account: a #TpAccount * * Sets the currently selected account to @account, if it exists in the list. * @@ -320,7 +328,7 @@ empathy_account_chooser_get_connection (EmpathyAccountChooser *chooser) */ gboolean empathy_account_chooser_set_account (EmpathyAccountChooser *chooser, - EmpathyAccount *account) + TpAccount *account) { EmpathyAccountChooserPriv *priv; GtkComboBox *combobox; @@ -443,10 +451,40 @@ empathy_account_chooser_set_has_all_option (EmpathyAccountChooser *chooser, } static void +account_manager_prepared_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + GList *accounts, *l; + TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object); + EmpathyAccountChooser *chooser = user_data; + GError *error = NULL; + + if (!tp_account_manager_prepare_finish (manager, result, &error)) { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } + + accounts = tp_account_manager_get_valid_accounts (manager); + + for (l = accounts; l != NULL; l = l->next) { + TpAccount *account = l->data; + + account_chooser_account_add_foreach (account, chooser); + + empathy_signal_connect_weak (account, "status-changed", + G_CALLBACK (account_chooser_status_changed_cb), + G_OBJECT (chooser)); + } + + g_list_free (accounts); +} + +static void account_chooser_setup (EmpathyAccountChooser *chooser) { EmpathyAccountChooserPriv *priv; - GList *accounts; GtkListStore *store; GtkCellRenderer *renderer; GtkComboBox *combobox; @@ -462,7 +500,7 @@ account_chooser_setup (EmpathyAccountChooser *chooser) G_TYPE_STRING, /* Image */ G_TYPE_STRING, /* Name */ G_TYPE_BOOLEAN, /* Enabled */ - EMPATHY_TYPE_ACCOUNT); + TP_TYPE_ACCOUNT); gtk_combo_box_set_model (combobox, GTK_TREE_MODEL (store)); @@ -482,25 +520,27 @@ account_chooser_setup (EmpathyAccountChooser *chooser) NULL); /* Populate accounts */ - accounts = empathy_account_manager_dup_accounts (priv->manager); - g_list_foreach (accounts, - (GFunc) account_chooser_account_add_foreach, - chooser); + tp_account_manager_prepare_async (priv->manager, NULL, + account_manager_prepared_cb, chooser); - g_list_free (accounts); g_object_unref (store); } static void -account_chooser_account_created_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, - EmpathyAccountChooser *chooser) +account_chooser_account_validity_changed_cb (TpAccountManager *manager, + TpAccount *account, + gboolean valid, + EmpathyAccountChooser *chooser) { - account_chooser_account_add_foreach (account, chooser); + if (valid) { + account_chooser_account_add_foreach (account, chooser); + } else { + account_chooser_account_remove_foreach (account, chooser); + } } static void -account_chooser_account_add_foreach (EmpathyAccount *account, +account_chooser_account_add_foreach (TpAccount *account, EmpathyAccountChooser *chooser) { GtkListStore *store; @@ -516,20 +556,18 @@ account_chooser_account_add_foreach (EmpathyAccount *account, COL_ACCOUNT_POINTER, account, -1); account_chooser_update_iter (chooser, &iter); - /* We got a reffed account and it was reffed by the liststore as well */ - g_object_unref (account); } static void -account_chooser_account_deleted_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, +account_chooser_account_removed_cb (TpAccountManager *manager, + TpAccount *account, EmpathyAccountChooser *chooser) { account_chooser_account_remove_foreach (account, chooser); } typedef struct { - EmpathyAccount *account; + TpAccount *account; GtkTreeIter *iter; gboolean found; } FindAccountData; @@ -541,7 +579,7 @@ account_chooser_find_account_foreach (GtkTreeModel *model, gpointer user_data) { FindAccountData *data = user_data; - EmpathyAccount *account; + TpAccount *account; gtk_tree_model_get (model, iter, COL_ACCOUNT_POINTER, &account, -1); @@ -560,7 +598,7 @@ account_chooser_find_account_foreach (GtkTreeModel *model, static gboolean account_chooser_find_account (EmpathyAccountChooser *chooser, - EmpathyAccount *account, + TpAccount *account, GtkTreeIter *iter) { GtkListStore *store; @@ -580,7 +618,7 @@ account_chooser_find_account (EmpathyAccountChooser *chooser, } static void -account_chooser_account_remove_foreach (EmpathyAccount *account, +account_chooser_account_remove_foreach (TpAccount *account, EmpathyAccountChooser *chooser) { GtkListStore *store; @@ -602,7 +640,7 @@ account_chooser_update_iter (EmpathyAccountChooser *chooser, EmpathyAccountChooserPriv *priv; GtkListStore *store; GtkComboBox *combobox; - EmpathyAccount *account; + TpAccount *account; const gchar *icon_name; gboolean is_enabled = TRUE; @@ -615,14 +653,14 @@ account_chooser_update_iter (EmpathyAccountChooser *chooser, COL_ACCOUNT_POINTER, &account, -1); - icon_name = empathy_account_get_icon_name (account); + icon_name = tp_account_get_icon_name (account); if (priv->filter) { is_enabled = priv->filter (account, priv->filter_data); } gtk_list_store_set (store, iter, COL_ACCOUNT_IMAGE, icon_name, - COL_ACCOUNT_TEXT, empathy_account_get_display_name (account), + COL_ACCOUNT_TEXT, tp_account_get_display_name (account), COL_ACCOUNT_ENABLED, is_enabled, -1); @@ -637,13 +675,15 @@ account_chooser_update_iter (EmpathyAccountChooser *chooser, } static void -account_chooser_connection_changed_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, - TpConnectionStatusReason reason, - TpConnectionStatus new_status, - TpConnectionStatus old_status, - EmpathyAccountChooser *chooser) +account_chooser_status_changed_cb (TpAccount *account, + guint old_status, + guint new_status, + guint reason, + gchar *dbus_error_name, + GHashTable *details, + gpointer user_data) { + EmpathyAccountChooser *chooser = user_data; GtkTreeIter iter; if (account_chooser_find_account (chooser, account, &iter)) { @@ -679,7 +719,7 @@ account_chooser_set_account_foreach (GtkTreeModel *model, GtkTreeIter *iter, SetAccountData *data) { - EmpathyAccount *account; + TpAccount *account; gboolean equal; gtk_tree_model_get (model, iter, COL_ACCOUNT_POINTER, &account, -1); @@ -750,7 +790,7 @@ empathy_account_chooser_set_filter (EmpathyAccountChooser *chooser, /** * EmpathyAccountChooserFilterFunc: - * @account: an #EmpathyAccount + * @account: a #TpAccount * @user_data: user data, or %NULL * * A function which decides whether the account indicated by @account @@ -761,7 +801,7 @@ empathy_account_chooser_set_filter (EmpathyAccountChooser *chooser, /** * empathy_account_chooser_filter_is_connected: - * @account: an #EmpathyAccount + * @account: a #TpAccount * @user_data: user data or %NULL * * A useful #EmpathyAccountChooserFilterFunc that one could pass into @@ -770,13 +810,10 @@ empathy_account_chooser_set_filter (EmpathyAccountChooser *chooser, * Return value: Whether @account is connected */ gboolean -empathy_account_chooser_filter_is_connected (EmpathyAccount *account, +empathy_account_chooser_filter_is_connected (TpAccount *account, gpointer user_data) { - TpConnectionStatus status; - - g_object_get (account, "connection-status", &status, NULL); - - return status == TP_CONNECTION_STATUS_CONNECTED; + return (tp_account_get_connection_status (account, NULL) + == TP_CONNECTION_STATUS_CONNECTED); } diff --git a/libempathy-gtk/empathy-account-chooser.h b/libempathy-gtk/empathy-account-chooser.h index 255b6841f..075bea81c 100644 --- a/libempathy-gtk/empathy-account-chooser.h +++ b/libempathy-gtk/empathy-account-chooser.h @@ -27,7 +27,7 @@ #include <gtk/gtk.h> -#include <libempathy/empathy-account.h> +#include <telepathy-glib/account.h> G_BEGIN_DECLS @@ -38,7 +38,7 @@ G_BEGIN_DECLS #define EMPATHY_IS_ACCOUNT_CHOOSER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_ACCOUNT_CHOOSER)) #define EMPATHY_ACCOUNT_CHOOSER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_ACCOUNT_CHOOSER, EmpathyAccountChooserClass)) -typedef gboolean (* EmpathyAccountChooserFilterFunc) (EmpathyAccount *account, +typedef gboolean (* EmpathyAccountChooserFilterFunc) (TpAccount *account, gpointer user_data); @@ -58,17 +58,17 @@ struct _EmpathyAccountChooserClass { GType empathy_account_chooser_get_type (void) G_GNUC_CONST; GtkWidget * empathy_account_chooser_new (void); -EmpathyAccount * empathy_account_chooser_dup_account (EmpathyAccountChooser *chooser); +TpAccount * empathy_account_chooser_dup_account (EmpathyAccountChooser *chooser); TpConnection * empathy_account_chooser_get_connection (EmpathyAccountChooser *chooser); gboolean empathy_account_chooser_set_account (EmpathyAccountChooser *chooser, - EmpathyAccount *account); + TpAccount *account); gboolean empathy_account_chooser_get_has_all_option (EmpathyAccountChooser *chooser); void empathy_account_chooser_set_has_all_option (EmpathyAccountChooser *chooser, gboolean has_all_option); void empathy_account_chooser_set_filter (EmpathyAccountChooser *chooser, EmpathyAccountChooserFilterFunc filter, gpointer user_data); -gboolean empathy_account_chooser_filter_is_connected (EmpathyAccount *account, +gboolean empathy_account_chooser_filter_is_connected (TpAccount *account, gpointer user_data); G_END_DECLS diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c index 05911144a..af9fbb026 100644 --- a/libempathy-gtk/empathy-account-widget.c +++ b/libempathy-gtk/empathy-account-widget.c @@ -35,8 +35,9 @@ #endif #include <libempathy/empathy-utils.h> -#include <libempathy/empathy-account.h> +#include <libempathy/empathy-idle.h> +#include <telepathy-glib/account.h> #include <telepathy-glib/connection-manager.h> #include <telepathy-glib/util.h> #include <dbus/dbus-protocol.h> @@ -71,6 +72,8 @@ typedef struct { * modify it. When we are creating an account, this member is set to TRUE */ gboolean creating_account; + EmpathyIdle *idle; + gboolean dispose_run; } EmpathyAccountWidgetPriv; @@ -570,10 +573,10 @@ account_widget_account_enabled_cb (GObject *source_object, gpointer user_data) { GError *error = NULL; - EmpathyAccount *account = EMPATHY_ACCOUNT (source_object); + TpAccount *account = TP_ACCOUNT (source_object); EmpathyAccountWidget *widget = EMPATHY_ACCOUNT_WIDGET (user_data); - empathy_account_set_enabled_finish (account, res, &error); + tp_account_set_enabled_finish (account, res, &error); if (error != NULL) { @@ -592,7 +595,7 @@ account_widget_applied_cb (GObject *source_object, gpointer user_data) { GError *error = NULL; - EmpathyAccount *account; + TpAccount *account; EmpathyAccountSettings *settings = EMPATHY_ACCOUNT_SETTINGS (source_object); EmpathyAccountWidget *widget = EMPATHY_ACCOUNT_WIDGET (user_data); EmpathyAccountWidgetPriv *priv = GET_PRIV (widget); @@ -613,7 +616,7 @@ account_widget_applied_cb (GObject *source_object, if (priv->creating_account) { /* By default, when an account is created, we enable it. */ - empathy_account_set_enabled_async (account, TRUE, + tp_account_set_enabled_async (account, TRUE, account_widget_account_enabled_cb, widget); } else if (priv->enabled_checkbox != NULL) @@ -629,12 +632,12 @@ account_widget_applied_cb (GObject *source_object, NBTK_GTK_LIGHT_SWITCH (priv->enabled_checkbox)); #endif - if (empathy_account_is_enabled (account) && enabled_checked) + if (tp_account_is_enabled (account) && enabled_checked) { /* After having applied changes to a user account, we * automatically reconnect it. This is done so the new * information entered by the user is validated on the server. */ - empathy_account_reconnect_async (account, NULL, NULL); + tp_account_reconnect_async (account, NULL, NULL); } } } @@ -1047,13 +1050,13 @@ account_widget_destroy_cb (GtkWidget *widget, } static void -empathy_account_widget_enabled_cb (EmpathyAccount *account, +empathy_account_widget_enabled_cb (TpAccount *account, GParamSpec *spec, gpointer user_data) { EmpathyAccountWidget *widget = EMPATHY_ACCOUNT_WIDGET (user_data); EmpathyAccountWidgetPriv *priv = GET_PRIV (widget); - gboolean enabled = empathy_account_is_enabled (account); + gboolean enabled = tp_account_is_enabled (account); if (priv->enabled_checkbox != NULL) { @@ -1079,7 +1082,7 @@ account_widget_switch_flipped_cb (NbtkGtkLightSwitch *sw, #endif /* HAVE_MOBLIN */ { EmpathyAccountWidgetPriv *priv = GET_PRIV (user_data); - EmpathyAccount *account; + TpAccount *account; #ifndef HAVE_MOBLIN gboolean state; @@ -1089,7 +1092,7 @@ account_widget_switch_flipped_cb (NbtkGtkLightSwitch *sw, account = empathy_account_settings_get_account (priv->settings); /* Enable the account according to the value of the "Enabled" checkbox */ - empathy_account_set_enabled_async (account, state, NULL, NULL); + tp_account_set_enabled_async (account, state, NULL, NULL); } static void @@ -1144,6 +1147,26 @@ do_get_property (GObject *object, } } +static void +idle_state_change_cb (EmpathyIdle *idle, + GParamSpec *spec, + EmpathyAccountWidget *self) +{ + EmpathyAccountWidgetPriv *priv = GET_PRIV (self); + TpConnectionPresenceType state; + + state = empathy_idle_get_state (priv->idle); + + if (state > TP_CONNECTION_PRESENCE_TYPE_OFFLINE) + { + g_object_set (priv->apply_button, "label", GTK_STOCK_CONNECT, NULL); + } + else + { + g_object_set (priv->apply_button, "label", GTK_STOCK_APPLY, NULL); + } +} + #define WIDGET(cm, proto) \ { #cm, #proto, "empathy-account-widget-"#proto".ui", \ account_widget_build_##proto } @@ -1153,7 +1176,7 @@ do_constructed (GObject *obj) { EmpathyAccountWidget *self = EMPATHY_ACCOUNT_WIDGET (obj); EmpathyAccountWidgetPriv *priv = GET_PRIV (self); - EmpathyAccount *account; + TpAccount *account; const gchar *protocol, *cm_name; guint i = 0; struct { @@ -1240,10 +1263,38 @@ do_constructed (GObject *obj) if (!priv->simple) { GtkWidget *hbox = gtk_hbox_new (TRUE, 3); + const gchar *apply_button_id; priv->cancel_button = gtk_button_new_from_stock (GTK_STOCK_CANCEL); - priv->apply_button = gtk_button_new_from_stock ( - priv->creating_account ? GTK_STOCK_CONNECT : GTK_STOCK_APPLY); + + if (priv->creating_account) + { + TpConnectionPresenceType state; + priv->idle = empathy_idle_dup_singleton (); + + empathy_signal_connect_weak (priv->idle, "notify::state", + G_CALLBACK (idle_state_change_cb), obj); + + state = empathy_idle_get_state (priv->idle); + + if (state > TP_CONNECTION_PRESENCE_TYPE_OFFLINE) + { + /* We are online, display a Connect button */ + apply_button_id = GTK_STOCK_CONNECT; + } + else + { + /* We are offline, display a Save button */ + apply_button_id = GTK_STOCK_SAVE; + } + } + else + { + /* We are editing an existing account, display an Apply button */ + apply_button_id = GTK_STOCK_APPLY; + } + + priv->apply_button = gtk_button_new_from_stock (apply_button_id); #ifdef HAVE_MOBLIN if (priv->creating_account) @@ -1295,7 +1346,7 @@ do_constructed (GObject *obj) guint nb_rows, nb_columns; gboolean is_enabled; - is_enabled = empathy_account_is_enabled (account); + is_enabled = tp_account_is_enabled (account); #ifndef HAVE_MOBLIN priv->enabled_checkbox = @@ -1373,7 +1424,7 @@ do_dispose (GObject *obj) if (priv->settings != NULL) { - EmpathyAccount *account; + TpAccount *account; account = empathy_account_settings_get_account (priv->settings); if (account != NULL) @@ -1386,6 +1437,12 @@ do_dispose (GObject *obj) priv->settings = NULL; } + if (priv->idle != NULL) + { + g_object_unref (priv->idle); + priv->idle = NULL; + } + if (G_OBJECT_CLASS (empathy_account_widget_parent_class)->dispose != NULL) G_OBJECT_CLASS (empathy_account_widget_parent_class)->dispose (obj); } diff --git a/libempathy-gtk/empathy-chat-text-view.c b/libempathy-gtk/empathy-chat-text-view.c index 5822a429d..de777f2fb 100644 --- a/libempathy-gtk/empathy-chat-text-view.c +++ b/libempathy-gtk/empathy-chat-text-view.c @@ -36,7 +36,6 @@ #include <telepathy-glib/util.h> #include <libempathy/empathy-utils.h> -#include <libempathy/empathy-account.h> #include "empathy-chat-text-view.h" #include "empathy-chat.h" diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index b6356f834..b2fefee5f 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -34,9 +34,9 @@ #include <glib/gi18n-lib.h> #include <gtk/gtk.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/util.h> -#include <libempathy/empathy-account-manager.h> #include <libempathy/empathy-log-manager.h> #include <libempathy/empathy-contact-list.h> #include <libempathy/empathy-utils.h> @@ -64,7 +64,7 @@ #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyChat) typedef struct { EmpathyTpChat *tp_chat; - EmpathyAccount *account; + TpAccount *account; gchar *id; gchar *name; gchar *subject; @@ -72,7 +72,7 @@ typedef struct { gboolean show_contacts; EmpathyLogManager *log_manager; - EmpathyAccountManager *account_manager; + TpAccountManager *account_manager; GList *input_history; GList *input_history_current; GList *compositors; @@ -203,15 +203,19 @@ chat_connect_channel_reconnected (EmpathyDispatchOperation *dispatch, } static void -chat_new_connection_cb (EmpathyAccountManager *manager, - TpConnection *connection, +chat_new_connection_cb (TpAccount *account, + guint old_status, + guint new_status, + guint reason, + gchar *dbus_error_name, + GHashTable *details, EmpathyChat *chat) { EmpathyChatPriv *priv = GET_PRIV (chat); - EmpathyAccount *account; + TpConnection *connection; + + connection = tp_account_get_connection (account); - account = empathy_account_manager_get_account_for_connection (manager, - connection); if (!priv->tp_chat && account == priv->account && priv->handle_type != TP_HANDLE_TYPE_NONE && !EMP_STR_EMPTY (priv->id)) { @@ -1741,9 +1745,6 @@ chat_finalize (GObject *object) chat_composing_remove_timeout (chat); - g_signal_handlers_disconnect_by_func (priv->account_manager, - chat_new_connection_cb, object); - g_object_unref (priv->account_manager); g_object_unref (priv->log_manager); @@ -1822,7 +1823,7 @@ empathy_chat_class_init (EmpathyChatClass *klass) g_param_spec_object ("account", "Account of the chat", "The account of the chat", - EMPATHY_TYPE_ACCOUNT, + TP_TYPE_ACCOUNT, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, @@ -1900,6 +1901,34 @@ chat_block_events_timeout_cb (gpointer data) } static void +account_manager_prepared_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + GList *accounts, *l; + TpAccountManager *account_manager = TP_ACCOUNT_MANAGER (source_object); + EmpathyChat *chat = user_data; + GError *error = NULL; + + if (!tp_account_manager_prepare_finish (account_manager, result, &error)) { + DEBUG ("Failed to prepare the account manager: %s", error->message); + g_error_free (error); + return; + } + + accounts = tp_account_manager_get_valid_accounts (account_manager); + + for (l = accounts; l != NULL; l = l->next) { + TpAccount *account = l->data; + empathy_signal_connect_weak (account, "status-changed", + G_CALLBACK (chat_new_connection_cb), + G_OBJECT (chat)); + } + + g_list_free (accounts); +} + +static void empathy_chat_init (EmpathyChat *chat) { EmpathyChatPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chat, @@ -1910,12 +1939,10 @@ empathy_chat_init (EmpathyChat *chat) priv->contacts_width = -1; priv->input_history = NULL; priv->input_history_current = NULL; - priv->account_manager = empathy_account_manager_dup_singleton (); + priv->account_manager = tp_account_manager_dup (); - g_signal_connect (priv->account_manager, - "new-connection", - G_CALLBACK (chat_new_connection_cb), - chat); + tp_account_manager_prepare_async (priv->account_manager, NULL, + account_manager_prepared_cb, chat); empathy_conf_get_bool (empathy_conf_get (), EMPATHY_PREFS_CHAT_SHOW_CONTACTS_IN_ROOMS, @@ -1968,10 +1995,7 @@ empathy_chat_set_tp_chat (EmpathyChat *chat, priv->tp_chat = g_object_ref (tp_chat); connection = empathy_tp_chat_get_connection (priv->tp_chat); - priv->account = empathy_account_manager_get_account_for_connection ( - priv->account_manager, - connection); - g_object_ref (priv->account); + priv->account = g_object_ref (empathy_get_account_for_connection (connection)); g_signal_connect (tp_chat, "destroy", G_CALLBACK (chat_destroy_cb), @@ -2014,7 +2038,7 @@ empathy_chat_set_tp_chat (EmpathyChat *chat, show_pending_messages (chat); } -EmpathyAccount * +TpAccount * empathy_chat_get_account (EmpathyChat *chat) { EmpathyChatPriv *priv = GET_PRIV (chat); diff --git a/libempathy-gtk/empathy-chat.h b/libempathy-gtk/empathy-chat.h index c7158759a..9123d11dd 100644 --- a/libempathy-gtk/empathy-chat.h +++ b/libempathy-gtk/empathy-chat.h @@ -66,7 +66,7 @@ EmpathyChat * empathy_chat_new (EmpathyTpChat *tp_chat); EmpathyTpChat * empathy_chat_get_tp_chat (EmpathyChat *chat); void empathy_chat_set_tp_chat (EmpathyChat *chat, EmpathyTpChat *tp_chat); -EmpathyAccount * empathy_chat_get_account (EmpathyChat *chat); +TpAccount * empathy_chat_get_account (EmpathyChat *chat); const gchar * empathy_chat_get_id (EmpathyChat *chat); const gchar * empathy_chat_get_name (EmpathyChat *chat); const gchar * empathy_chat_get_subject (EmpathyChat *chat); diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c index 6c15dd876..b7108d8f3 100644 --- a/libempathy-gtk/empathy-contact-dialogs.c +++ b/libempathy-gtk/empathy-contact-dialogs.c @@ -27,8 +27,9 @@ #include <gtk/gtk.h> #include <glib/gi18n-lib.h> +#include <telepathy-glib/account-manager.h> + #include <libempathy/empathy-contact-manager.h> -#include <libempathy/empathy-account-manager.h> #include <libempathy/empathy-contact-list.h> #include <libempathy/empathy-utils.h> @@ -327,14 +328,14 @@ empathy_contact_personal_dialog_show (GtkWindow *parent) */ static gboolean -can_add_contact_to_account (EmpathyAccount *account, +can_add_contact_to_account (TpAccount *account, gpointer user_data) { EmpathyContactManager *contact_manager; TpConnection *connection; gboolean result; - connection = empathy_account_get_connection (account); + connection = tp_account_get_connection (account); if (connection == NULL) return FALSE; diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index a6623506b..c19ad32df 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -31,9 +31,9 @@ #include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/util.h> -#include <libempathy/empathy-account-manager.h> #include <libempathy/empathy-call-factory.h> #include <libempathy/empathy-tp-contact-factory.h> #include <libempathy/empathy-contact-list.h> @@ -244,9 +244,9 @@ contact_list_view_drag_data_received (GtkWidget *view, guint time_) { EmpathyContactListViewPriv *priv; - EmpathyAccountManager *account_manager; + TpAccountManager *account_manager; EmpathyTpContactFactory *factory = NULL; - EmpathyAccount *account = NULL; + TpAccount *account = NULL; GtkTreeModel *model; GtkTreeViewDropPosition position; GtkTreePath *path; @@ -298,17 +298,19 @@ contact_list_view_drag_data_received (GtkWidget *view, context->action == GDK_ACTION_COPY ? "copy" : "", id); - account_manager = empathy_account_manager_dup_singleton (); + /* FIXME: should probably make sure the account manager is prepared + * before calling _ensure_account on it. See bug 600115. */ + account_manager = tp_account_manager_dup (); strv = g_strsplit (id, ":", 2); if (g_strv_length (strv) == 2) { account_id = strv[0]; contact_id = strv[1]; - account = empathy_account_manager_get_account (account_manager, account_id); + account = tp_account_manager_ensure_account (account_manager, account_id); } if (account) { TpConnection *connection; - connection = empathy_account_get_connection (account); + connection = tp_account_get_connection (account); if (connection) { factory = empathy_tp_contact_factory_dup_singleton (connection); } @@ -458,7 +460,7 @@ contact_list_view_drag_data_get (GtkWidget *widget, GtkTreeIter iter; GtkTreeModel *model; EmpathyContact *contact; - EmpathyAccount *account; + TpAccount *account; const gchar *contact_id; const gchar *account_id; gchar *str; @@ -488,7 +490,7 @@ contact_list_view_drag_data_get (GtkWidget *widget, } account = empathy_contact_get_account (contact); - account_id = empathy_account_get_unique_name (account); + account_id = tp_proxy_get_object_path (account); contact_id = empathy_contact_get_id (contact); g_object_unref (contact); str = g_strconcat (account_id, ":", contact_id, NULL); diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index 17bed7298..81e01ff0b 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -32,6 +32,7 @@ #include <champlain-gtk/champlain-gtk.h> #endif +#include <telepathy-glib/account.h> #include <telepathy-glib/util.h> #include <libempathy/empathy-tp-contact-factory.h> @@ -40,7 +41,6 @@ #include <libempathy/empathy-location.h> #include <libempathy/empathy-time.h> #include <libempathy/empathy-utils.h> -#include <libempathy/empathy-account.h> #include "empathy-contact-widget.h" #include "empathy-account-chooser.h" @@ -718,7 +718,7 @@ contact_widget_contact_setup (EmpathyContactWidget *information) static void contact_widget_contact_update (EmpathyContactWidget *information) { - EmpathyAccount *account = NULL; + TpAccount *account = NULL; const gchar *id = NULL; /* Connect and get info from new contact */ @@ -758,7 +758,7 @@ contact_widget_contact_update (EmpathyContactWidget *information) { const gchar *name; - name = empathy_account_get_display_name (account); + name = tp_account_get_display_name (account); gtk_label_set_label (GTK_LABEL (information->widget_account), name); } } diff --git a/libempathy-gtk/empathy-irc-network-dialog.c b/libempathy-gtk/empathy-irc-network-dialog.c index 8d4676417..69f83637d 100644 --- a/libempathy-gtk/empathy-irc-network-dialog.c +++ b/libempathy-gtk/empathy-irc-network-dialog.c @@ -28,7 +28,6 @@ #include <gtk/gtk.h> #include <libempathy/empathy-utils.h> -#include <libempathy/empathy-account.h> #include <libempathy/empathy-irc-network-manager.h> #include "empathy-ui-utils.h" diff --git a/libempathy-gtk/empathy-location-manager.c b/libempathy-gtk/empathy-location-manager.c index a00d6cb63..4ef27dba7 100644 --- a/libempathy-gtk/empathy-location-manager.c +++ b/libempathy-gtk/empathy-location-manager.c @@ -26,6 +26,7 @@ #include <glib/gi18n.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/util.h> #include <geoclue/geoclue-master.h> @@ -35,7 +36,6 @@ #include "empathy-location-manager.h" #include "empathy-conf.h" -#include "libempathy/empathy-account-manager.h" #include "libempathy/empathy-enum-types.h" #include "libempathy/empathy-location.h" #include "libempathy/empathy-tp-contact-factory.h" @@ -63,7 +63,7 @@ typedef struct { GeoclueAddress *gc_address; gboolean reduce_accuracy; - EmpathyAccountManager *account_manager; + TpAccountManager *account_manager; /* The idle id for publish_on_idle func */ guint timeout_id; @@ -217,21 +217,57 @@ publish_location (EmpathyLocationManager *self, g_object_unref (factory); } +typedef struct +{ + EmpathyLocationManager *self; + gboolean force_publication; +} PublishToAllData; + +static void +publish_to_all_am_prepared_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object); + PublishToAllData *data = user_data; + GList *accounts, *l; + GError *error = NULL; + + if (!tp_account_manager_prepare_finish (manager, result, &error)) + { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + goto out; + } + + accounts = tp_account_manager_get_valid_accounts (manager); + for (l = accounts; l; l = l->next) + { + TpConnection *conn = tp_account_get_connection (TP_ACCOUNT (l->data)); + + if (conn != NULL) + publish_location (data->self, conn, data->force_publication); + } + g_list_free (accounts); + +out: + g_object_unref (data->self); + g_slice_free (PublishToAllData, data); +} + static void publish_to_all_connections (EmpathyLocationManager *self, gboolean force_publication) { EmpathyLocationManagerPriv *priv = GET_PRIV (self); - GList *connections = NULL, *l; + PublishToAllData *data; - connections = empathy_account_manager_dup_connections (priv->account_manager); - for (l = connections; l; l = l->next) - { - publish_location (self, l->data, force_publication); - g_object_unref (l->data); - } - g_list_free (connections); + data = g_slice_new0 (PublishToAllData); + data->self = g_object_ref (self); + data->force_publication = force_publication; + tp_account_manager_prepare_async (priv->account_manager, NULL, + publish_to_all_am_prepared_cb, data); } static gboolean @@ -246,11 +282,19 @@ publish_on_idle (gpointer user_data) } static void -new_connection_cb (EmpathyAccountManager *manager, - TpConnection *conn, +new_connection_cb (TpAccount *account, + guint old_status, + guint new_status, + guint reason, + gchar *dbus_error_name, + GHashTable *details, gpointer *self) { EmpathyLocationManagerPriv *priv = GET_PRIV (self); + TpConnection *conn; + + conn = tp_account_get_connection (account); + DEBUG ("New connection %p", conn); /* Don't publish if it is already planned (ie startup) */ @@ -626,6 +670,34 @@ accuracy_cb (EmpathyConf *conf, } static void +account_manager_prepared_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + GList *accounts, *l; + TpAccountManager *account_manager = TP_ACCOUNT_MANAGER (source_object); + EmpathyLocationManager *self = user_data; + GError *error = NULL; + + if (!tp_account_manager_prepare_finish (account_manager, result, &error)) + { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } + + accounts = tp_account_manager_get_valid_accounts (account_manager); + for (l = accounts; l != NULL; l = l->next) + { + TpAccount *account = TP_ACCOUNT (l->data); + + empathy_signal_connect_weak (account, "status-changed", + G_CALLBACK (new_connection_cb), G_OBJECT (self)); + } + g_list_free (accounts); +} + +static void empathy_location_manager_init (EmpathyLocationManager *self) { EmpathyConf *conf; @@ -638,10 +710,10 @@ empathy_location_manager_init (EmpathyLocationManager *self) g_free, (GDestroyNotify) tp_g_value_slice_free); /* Setup account status callbacks */ - priv->account_manager = empathy_account_manager_dup_singleton (); - g_signal_connect (priv->account_manager, - "new-connection", - G_CALLBACK (new_connection_cb), self); + priv->account_manager = tp_account_manager_dup (); + + tp_account_manager_prepare_async (priv->account_manager, NULL, + account_manager_prepared_cb, self); /* Setup settings status callbacks */ conf = empathy_conf_get (); diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index 11ddca74b..247a99806 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -30,8 +30,9 @@ #include <glib/gi18n-lib.h> #include <gtk/gtk.h> +#include <telepathy-glib/account-manager.h> + #include <libempathy/empathy-log-manager.h> -#include <libempathy/empathy-account-manager.h> #include <libempathy/empathy-chatroom-manager.h> #include <libempathy/empathy-chatroom.h> #include <libempathy/empathy-message.h> @@ -95,11 +96,11 @@ static void log_window_chats_setup (EmpathyLogWindow *wi static void log_window_chats_accounts_changed_cb (GtkWidget *combobox, EmpathyLogWindow *window); static void log_window_chats_set_selected (EmpathyLogWindow *window, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean is_chatroom); static gboolean log_window_chats_get_selected (EmpathyLogWindow *window, - EmpathyAccount **account, + TpAccount **account, gchar **chat_id, gboolean *is_chatroom); static void log_window_chats_get_messages (EmpathyLogWindow *window, @@ -134,16 +135,45 @@ enum { COL_CHAT_COUNT }; +static void +account_manager_prepared_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + TpAccountManager *account_manager = TP_ACCOUNT_MANAGER (source_object); + EmpathyLogWindow *window = user_data; + guint account_num; + GList *accounts; + GError *error = NULL; + + if (!tp_account_manager_prepare_finish (account_manager, result, &error)) { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } + + accounts = tp_account_manager_get_valid_accounts (account_manager); + account_num = g_list_length (accounts); + g_list_free (accounts); + + if (account_num > 1) { + gtk_widget_show (window->vbox_chats); + gtk_widget_show (window->account_chooser_chats); + } else { + gtk_widget_hide (window->vbox_chats); + gtk_widget_hide (window->account_chooser_chats); + } +} + GtkWidget * -empathy_log_window_show (EmpathyAccount *account, +empathy_log_window_show (TpAccount *account, const gchar *chat_id, gboolean is_chatroom, GtkWindow *parent) { static EmpathyLogWindow *window = NULL; EmpathyAccountChooser *account_chooser; - EmpathyAccountManager *account_manager; - gint account_num; + TpAccountManager *account_manager; GtkBuilder *gui; gchar *filename; @@ -229,18 +259,11 @@ empathy_log_window_show (EmpathyAccount *account, window); /* Populate */ - account_manager = empathy_account_manager_dup_singleton (); - account_num = empathy_account_manager_get_count (account_manager); + account_manager = tp_account_manager_dup (); + tp_account_manager_prepare_async (account_manager, NULL, + account_manager_prepared_cb, window); g_object_unref (account_manager); - if (account_num > 1) { - gtk_widget_show (window->vbox_chats); - gtk_widget_show (window->account_chooser_chats); - } else { - gtk_widget_hide (window->vbox_chats); - gtk_widget_hide (window->account_chooser_chats); - } - /* Search List */ log_window_find_setup (window); @@ -302,7 +325,7 @@ log_window_find_changed_cb (GtkTreeSelection *selection, GtkTreeView *view; GtkTreeModel *model; GtkTreeIter iter; - EmpathyAccount *account; + TpAccount *account; gchar *chat_id; gboolean is_chatroom; gchar *date; @@ -418,8 +441,8 @@ log_window_find_populate (EmpathyLogWindow *window, } date_readable = empathy_log_manager_get_date_readable (hit->date); - account_name = empathy_account_get_display_name (hit->account); - account_icon = empathy_account_get_icon_name (hit->account); + account_name = tp_account_get_display_name (hit->account); + account_icon = tp_account_get_icon_name (hit->account); gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, @@ -465,7 +488,7 @@ log_window_find_setup (EmpathyLogWindow *window) store = gtk_list_store_new (COL_FIND_COUNT, G_TYPE_STRING, /* account icon name */ G_TYPE_STRING, /* account name */ - EMPATHY_TYPE_ACCOUNT, /* account */ + TP_TYPE_ACCOUNT, /* account */ G_TYPE_STRING, /* chat name */ G_TYPE_STRING, /* chat id */ G_TYPE_BOOLEAN, /* is chatroom */ @@ -609,7 +632,7 @@ static void log_window_chats_populate (EmpathyLogWindow *window) { EmpathyAccountChooser *account_chooser; - EmpathyAccount *account; + TpAccount *account; GList *chats, *l; GtkTreeView *view; @@ -687,7 +710,7 @@ log_window_chats_setup (EmpathyLogWindow *window) store = gtk_list_store_new (COL_CHAT_COUNT, G_TYPE_STRING, /* icon */ G_TYPE_STRING, /* name */ - EMPATHY_TYPE_ACCOUNT, /* account */ + TP_TYPE_ACCOUNT, /* account */ G_TYPE_STRING, /* id */ G_TYPE_BOOLEAN); /* is chatroom */ @@ -740,7 +763,7 @@ log_window_chats_accounts_changed_cb (GtkWidget *combobox, static void log_window_chats_set_selected (EmpathyLogWindow *window, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean is_chatroom) { @@ -764,7 +787,7 @@ log_window_chats_set_selected (EmpathyLogWindow *window, } for (ok = TRUE; ok; ok = gtk_tree_model_iter_next (model, &iter)) { - EmpathyAccount *this_account; + TpAccount *this_account; gchar *this_chat_id; gboolean this_is_chatroom; @@ -793,7 +816,7 @@ log_window_chats_set_selected (EmpathyLogWindow *window, static gboolean log_window_chats_get_selected (EmpathyLogWindow *window, - EmpathyAccount **account, + TpAccount **account, gchar **chat_id, gboolean *is_chatroom) { @@ -802,7 +825,7 @@ log_window_chats_get_selected (EmpathyLogWindow *window, GtkTreeSelection *selection; GtkTreeIter iter; gchar *id = NULL; - EmpathyAccount *acc = NULL; + TpAccount *acc = NULL; gboolean room = FALSE; view = GTK_TREE_VIEW (window->treeview_chats); @@ -840,7 +863,7 @@ static void log_window_chats_get_messages (EmpathyLogWindow *window, const gchar *date_to_show) { - EmpathyAccount *account; + TpAccount *account; gchar *chat_id; gboolean is_chatroom; EmpathyMessage *message; @@ -1000,7 +1023,7 @@ static void log_window_calendar_chats_month_changed_cb (GtkWidget *calendar, EmpathyLogWindow *window) { - EmpathyAccount *account; + TpAccount *account; gchar *chat_id; gboolean is_chatroom; guint year_selected; diff --git a/libempathy-gtk/empathy-log-window.h b/libempathy-gtk/empathy-log-window.h index 298d96099..def0d846b 100644 --- a/libempathy-gtk/empathy-log-window.h +++ b/libempathy-gtk/empathy-log-window.h @@ -25,11 +25,11 @@ #ifndef __EMPATHY_LOG_WINDOW_H__ #define __EMPATHY_LOG_WINDOW_H__ -#include <libempathy/empathy-account.h> +#include <telepathy-glib/account.h> G_BEGIN_DECLS -GtkWidget * empathy_log_window_show (EmpathyAccount *account, +GtkWidget * empathy_log_window_show (TpAccount *account, const gchar *chat_id, gboolean chatroom, GtkWindow *parent); diff --git a/libempathy-gtk/empathy-new-message-dialog.c b/libempathy-gtk/empathy-new-message-dialog.c index 66b2adb2d..c1069f879 100644 --- a/libempathy-gtk/empathy-new-message-dialog.c +++ b/libempathy-gtk/empathy-new-message-dialog.c @@ -32,7 +32,6 @@ #include <libempathy/empathy-contact-manager.h> #include <libempathy/empathy-dispatcher.h> #include <libempathy/empathy-utils.h> -#include <libempathy/empathy-account.h> #define DEBUG_FLAG EMPATHY_DEBUG_CONTACT #include <libempathy/empathy-debug.h> @@ -100,23 +99,21 @@ new_message_dialog_account_changed_cb (GtkWidget *widget, while (members) { EmpathyContact *contact = members->data; - if (empathy_contact_is_online (contact)) { - DEBUG ("Adding contact ID %s, Name %s", - empathy_contact_get_id (contact), - empathy_contact_get_name (contact)); + DEBUG ("Adding contact ID %s, Name %s", + empathy_contact_get_id (contact), + empathy_contact_get_name (contact)); - tmpstr = g_strdup_printf ("%s (%s)", - empathy_contact_get_name (contact), - empathy_contact_get_id (contact)); + tmpstr = g_strdup_printf ("%s (%s)", + empathy_contact_get_name (contact), + empathy_contact_get_id (contact)); - gtk_list_store_insert_with_values (store, &iter, -1, - COMPLETION_COL_TEXT, tmpstr, - COMPLETION_COL_ID, empathy_contact_get_id (contact), - COMPLETION_COL_NAME, empathy_contact_get_name (contact), - -1); + gtk_list_store_insert_with_values (store, &iter, -1, + COMPLETION_COL_TEXT, tmpstr, + COMPLETION_COL_ID, empathy_contact_get_id (contact), + COMPLETION_COL_NAME, empathy_contact_get_name (contact), + -1); - g_free (tmpstr); - } + g_free (tmpstr); g_object_unref (contact); members = g_list_delete_link (members, members); diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c index 7113c77fd..678ec835c 100644 --- a/libempathy-gtk/empathy-presence-chooser.c +++ b/libempathy-gtk/empathy-presence-chooser.c @@ -33,13 +33,13 @@ #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/util.h> #include <libempathy/empathy-connectivity.h> #include <libempathy/empathy-idle.h> #include <libempathy/empathy-utils.h> #include <libempathy/empathy-status-presets.h> -#include <libempathy/empathy-account-manager.h> #define DEBUG_FLAG EMPATHY_DEBUG_OTHER #include <libempathy/empathy-debug.h> @@ -114,7 +114,7 @@ typedef struct { TpConnectionPresenceType flash_state_2; guint flash_timeout_id; - EmpathyAccountManager *account_manager; + TpAccountManager *account_manager; } EmpathyPresenceChooserPriv; /* States to be listed in the menu. @@ -715,21 +715,32 @@ presence_chooser_entry_focus_out_cb (EmpathyPresenceChooser *chooser, } static void -presence_chooser_update_sensitivity (EmpathyPresenceChooser *chooser) +update_sensitivity_am_prepared_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { + TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object); + EmpathyPresenceChooser *chooser = user_data; EmpathyPresenceChooserPriv *priv = GET_PRIV (chooser); gboolean sensitive = FALSE; GList *accounts, *l; + GError *error = NULL; + + if (!tp_account_manager_prepare_finish (manager, result, &error)) { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } - accounts = empathy_account_manager_dup_accounts (priv->account_manager); + accounts = tp_account_manager_get_valid_accounts (manager); for (l = accounts ; l != NULL ; l = g_list_next (l)) { - EmpathyAccount *a = EMPATHY_ACCOUNT (l->data); + TpAccount *a = TP_ACCOUNT (l->data); - if (empathy_account_is_enabled (a)) + if (tp_account_is_enabled (a)) { sensitive = TRUE; - - g_object_unref (a); + break; + } } g_list_free (accounts); @@ -741,9 +752,29 @@ presence_chooser_update_sensitivity (EmpathyPresenceChooser *chooser) } static void +presence_chooser_update_sensitivity (EmpathyPresenceChooser *chooser) +{ + EmpathyPresenceChooserPriv *priv = GET_PRIV (chooser); + + tp_account_manager_prepare_async (priv->account_manager, NULL, + update_sensitivity_am_prepared_cb, + chooser); +} + +static void +presence_chooser_account_manager_account_validity_changed_cb ( + TpAccountManager *manager, + TpAccount *account, + gboolean valid, + EmpathyPresenceChooser *chooser) +{ + presence_chooser_update_sensitivity (chooser); +} + +static void presence_chooser_account_manager_account_changed_cb ( - EmpathyAccountManager *manager, - EmpathyAccount *account, + TpAccountManager *manager, + TpAccount *account, EmpathyPresenceChooser *chooser) { presence_chooser_update_sensitivity (chooser); @@ -825,12 +856,12 @@ empathy_presence_chooser_init (EmpathyPresenceChooser *chooser) G_CALLBACK (presence_chooser_presence_changed_cb), chooser); - priv->account_manager = empathy_account_manager_dup_singleton (); + priv->account_manager = tp_account_manager_dup (); - empathy_signal_connect_weak (priv->account_manager, "account-created", - G_CALLBACK (presence_chooser_account_manager_account_changed_cb), + empathy_signal_connect_weak (priv->account_manager, "account-validity-changed", + G_CALLBACK (presence_chooser_account_manager_account_validity_changed_cb), G_OBJECT (chooser)); - empathy_signal_connect_weak (priv->account_manager, "account-deleted", + empathy_signal_connect_weak (priv->account_manager, "account-removed", G_CALLBACK (presence_chooser_account_manager_account_changed_cb), G_OBJECT (chooser)); empathy_signal_connect_weak (priv->account_manager, "account-enabled", diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c index fcf95ca02..a41cbd6c0 100644 --- a/libempathy-gtk/empathy-theme-adium.c +++ b/libempathy-gtk/empathy-theme-adium.c @@ -441,7 +441,7 @@ theme_adium_append_message (EmpathyChatView *view, EmpathyThemeAdium *theme = EMPATHY_THEME_ADIUM (view); EmpathyThemeAdiumPriv *priv = GET_PRIV (theme); EmpathyContact *sender; - EmpathyAccount *account; + TpAccount *account; gchar *dup_body = NULL; const gchar *body; const gchar *name; @@ -467,9 +467,9 @@ theme_adium_append_message (EmpathyChatView *view, sender = empathy_message_get_sender (msg); account = empathy_contact_get_account (sender); service_name = empathy_protocol_name_to_display_name - (empathy_account_get_protocol (account)); + (tp_account_get_protocol (account)); if (service_name == NULL) - service_name = empathy_account_get_protocol (account); + service_name = tp_account_get_protocol (account); timestamp = empathy_message_get_timestamp (msg); body = empathy_message_get_body (msg); dup_body = theme_adium_parse_body (theme, body); diff --git a/libempathy-gtk/empathy-ui-utils.h b/libempathy-gtk/empathy-ui-utils.h index 39baeaf41..486301cb1 100644 --- a/libempathy-gtk/empathy-ui-utils.h +++ b/libempathy-gtk/empathy-ui-utils.h @@ -35,7 +35,6 @@ #include <gtk/gtk.h> #include <libempathy/empathy-contact.h> -#include <libempathy/empathy-account.h> #include <libempathy/empathy-ft-handler.h> #include "empathy-chat-view.h" diff --git a/libempathy/Makefile.am b/libempathy/Makefile.am index 1e7d01ca3..91fdf7ba1 100644 --- a/libempathy/Makefile.am +++ b/libempathy/Makefile.am @@ -27,8 +27,6 @@ noinst_LTLIBRARIES = libempathy.la libempathy_headers = \ empathy-account-settings.h \ - empathy-account.h \ - empathy-account-manager.h \ empathy-chatroom.h \ empathy-chatroom-manager.h \ empathy-call-factory.h \ @@ -70,9 +68,7 @@ libempathy_headers = \ libempathy_la_SOURCES = \ $(libempathy_headers) \ - empathy-account.c \ empathy-account-settings.c \ - empathy-account-manager.c \ empathy-chatroom.c \ empathy-chatroom-manager.c \ empathy-call-factory.c \ diff --git a/libempathy/empathy-account-manager.c b/libempathy/empathy-account-manager.c deleted file mode 100644 index c71439bd4..000000000 --- a/libempathy/empathy-account-manager.c +++ /dev/null @@ -1,1060 +0,0 @@ -/* - * Copyright (C) 2008 Collabora Ltd. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Authors: Cosimo Cecchi <cosimo.cecchi@collabora.co.uk> - * Sjoerd Simons <sjoerd.simons@collabora.co.uk> - */ - -#include "config.h" - -#include <telepathy-glib/util.h> -#include <telepathy-glib/account-manager.h> -#include <telepathy-glib/enums.h> -#include <telepathy-glib/defs.h> -#include <telepathy-glib/dbus.h> -#include <telepathy-glib/interfaces.h> - -#include "empathy-account-manager.h" -#include "empathy-marshal.h" -#include "empathy-utils.h" - -#define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT -#include <libempathy/empathy-debug.h> - -#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyAccountManager) - -#define MC5_BUS_NAME "org.freedesktop.Telepathy.MissionControl5" - -typedef struct { - /* (owned) unique name -> (reffed) EmpathyAccount */ - GHashTable *accounts; - int connected; - int connecting; - gboolean dispose_run; - gboolean ready; - TpAccountManager *tp_manager; - TpDBusDaemon *dbus; - - /* global presence */ - EmpathyAccount *global_account; - - TpConnectionPresenceType global_presence; - gchar *global_status; - gchar *global_status_message; - - /* requested global presence, could be different - * from the actual global one. - */ - TpConnectionPresenceType requested_presence; - gchar *requested_status; - gchar *requested_status_message; - - GHashTable *create_results; -} EmpathyAccountManagerPriv; - -enum { - ACCOUNT_CREATED, - ACCOUNT_DELETED, - ACCOUNT_ENABLED, - ACCOUNT_DISABLED, - ACCOUNT_CHANGED, - ACCOUNT_CONNECTION_CHANGED, - GLOBAL_PRESENCE_CHANGED, - NEW_CONNECTION, - LAST_SIGNAL -}; - -enum { - PROP_READY = 1, -}; - -static guint signals[LAST_SIGNAL]; -static EmpathyAccountManager *manager_singleton = NULL; - -G_DEFINE_TYPE (EmpathyAccountManager, empathy_account_manager, G_TYPE_OBJECT); - -static void -emp_account_connection_cb (EmpathyAccount *account, - GParamSpec *spec, - gpointer manager) -{ - TpConnection *connection = empathy_account_get_connection (account); - - DEBUG ("Signalling connection %p of account %s", - connection, empathy_account_get_unique_name (account)); - - if (connection != NULL) - g_signal_emit (manager, signals[NEW_CONNECTION], 0, connection); -} - -static void -emp_account_enabled_cb (EmpathyAccount *account, - GParamSpec *spec, - gpointer manager) -{ - if (empathy_account_is_enabled (account)) - g_signal_emit (manager, signals[ACCOUNT_ENABLED], 0, account); - else - g_signal_emit (manager, signals[ACCOUNT_DISABLED], 0, account); -} - -static void -emp_account_status_changed_cb (EmpathyAccount *account, - TpConnectionStatus old, - TpConnectionStatus new, - TpConnectionStatusReason reason, - gpointer user_data) -{ - EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (user_data); - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - - switch (old) - { - case TP_CONNECTION_STATUS_CONNECTING: - priv->connecting--; - break; - case TP_CONNECTION_STATUS_CONNECTED: - priv->connected--; - break; - default: - break; - } - - switch (new) - { - case TP_CONNECTION_STATUS_CONNECTING: - priv->connecting++; - break; - case TP_CONNECTION_STATUS_CONNECTED: - priv->connected++; - break; - default: - break; - } - - g_signal_emit (manager, signals[ACCOUNT_CONNECTION_CHANGED], 0, - account, reason, new, old); -} - -static void -emp_account_manager_update_global_presence (EmpathyAccountManager *manager) -{ - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - TpConnectionPresenceType presence = TP_CONNECTION_PRESENCE_TYPE_OFFLINE; - EmpathyAccount *account = NULL; - GHashTableIter iter; - gpointer value; - - /* Make the global presence is equal to the presence of the account with the - * highest availability */ - - g_hash_table_iter_init (&iter, priv->accounts); - while (g_hash_table_iter_next (&iter, NULL, &value)) - { - EmpathyAccount *a = EMPATHY_ACCOUNT (value); - TpConnectionPresenceType p; - - g_object_get (a, "presence", &p, NULL); - - if (tp_connection_presence_type_cmp_availability (p, presence) > 0) - { - account = a; - presence = p; - } - } - - priv->global_account = account; - g_free (priv->global_status); - g_free (priv->global_status_message); - - if (account == NULL) - { - priv->global_presence = presence; - priv->global_status = NULL; - priv->global_status_message = NULL; - return; - } - - g_object_get (account, - "presence", &priv->global_presence, - "status", &priv->global_status, - "status-message", &priv->global_status_message, - NULL); - - DEBUG ("Updated global presence to: %s (%d) \"%s\"", - priv->global_status, priv->global_presence, priv->global_status_message); -} - -static void -emp_account_presence_changed_cb (EmpathyAccount *account, - TpConnectionPresenceType presence, - const gchar *status, - const gchar *status_message, - gpointer user_data) -{ - EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (user_data); - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - - if (tp_connection_presence_type_cmp_availability (presence, - priv->global_presence) > 0) - { - priv->global_account = account; - - priv->global_presence = presence; - - g_free (priv->global_status); - priv->global_status = g_strdup (status); - - g_free (priv->global_status_message); - priv->global_status_message = g_strdup (status_message); - - goto signal; - } - else if (priv->global_account == account) - { - emp_account_manager_update_global_presence (manager); - goto signal; - } - - return; -signal: - g_signal_emit (manager, signals[GLOBAL_PRESENCE_CHANGED], 0, - priv->global_presence, priv->global_status, priv->global_status_message); -} - -static void -emp_account_removed_cb (EmpathyAccount *account, gpointer user_data) -{ - EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (user_data); - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - - g_object_ref (account); - g_hash_table_remove (priv->accounts, - empathy_account_get_unique_name (account)); - - g_signal_emit (manager, signals[ACCOUNT_DELETED], 0, account); - g_object_unref (account); -} - -static void -empathy_account_manager_check_ready (EmpathyAccountManager *manager) -{ - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - GHashTableIter iter; - gpointer value; - - if (priv->ready) - return; - - g_hash_table_iter_init (&iter, priv->accounts); - while (g_hash_table_iter_next (&iter, NULL, &value)) - { - EmpathyAccount *account = EMPATHY_ACCOUNT (value); - gboolean ready; - - g_object_get (account, "ready", &ready, NULL); - - if (!ready) - return; - } - - /* Rerequest global presence on the initial set of accounts for cases where a - * global presence was requested before the manager was ready */ - if (priv->requested_presence != TP_CONNECTION_PRESENCE_TYPE_UNSET) - empathy_account_manager_request_global_presence (manager, - priv->requested_presence, - priv->requested_status, - priv->requested_status_message); - - priv->ready = TRUE; - g_object_notify (G_OBJECT (manager), "ready"); -} - -static void -account_manager_account_ready_cb (GObject *obj, - GParamSpec *spec, - gpointer user_data) -{ - EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (user_data); - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - EmpathyAccount *account = EMPATHY_ACCOUNT (obj); - GSimpleAsyncResult *result; - gboolean ready; - - g_object_get (account, "ready", &ready, NULL); - - if (!ready) - return; - - /* see if there's any pending callbacks for this account */ - result = g_hash_table_lookup (priv->create_results, account); - if (result != NULL) - { - g_simple_async_result_set_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (result), account, NULL); - - g_simple_async_result_complete (result); - - g_hash_table_remove (priv->create_results, account); - g_object_unref (result); - } - - g_signal_emit (manager, signals[ACCOUNT_CREATED], 0, account); - - g_signal_connect (account, "notify::connection", - G_CALLBACK (emp_account_connection_cb), manager); - - g_signal_connect (account, "notify::enabled", - G_CALLBACK (emp_account_enabled_cb), manager); - - g_signal_connect (account, "status-changed", - G_CALLBACK (emp_account_status_changed_cb), manager); - - g_signal_connect (account, "presence-changed", - G_CALLBACK (emp_account_presence_changed_cb), manager); - - g_signal_connect (account, "removed", - G_CALLBACK (emp_account_removed_cb), manager); - - empathy_account_manager_check_ready (manager); -} - -EmpathyAccount * -empathy_account_manager_get_account (EmpathyAccountManager *manager, - const gchar *path) -{ - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - - return g_hash_table_lookup (priv->accounts, path); -} - -EmpathyAccount * -empathy_account_manager_ensure_account (EmpathyAccountManager *manager, - const gchar *path) -{ - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - EmpathyAccount *account; - - account = g_hash_table_lookup (priv->accounts, path); - if (account != NULL) - return account; - - account = empathy_account_new (priv->dbus, path); - g_hash_table_insert (priv->accounts, g_strdup (path), account); - - g_signal_connect (account, "notify::ready", - G_CALLBACK (account_manager_account_ready_cb), manager); - - return account; -} - - -static void -account_manager_ensure_all_accounts (EmpathyAccountManager *manager, - GPtrArray *accounts) -{ - guint i, missing_accounts; - GHashTableIter iter; - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - gpointer value; - EmpathyAccount *account; - gboolean found = FALSE; - const gchar *name; - - /* ensure all accounts coming from MC5 first */ - for (i = 0; i < accounts->len; i++) - { - name = g_ptr_array_index (accounts, i); - - account = empathy_account_manager_ensure_account (manager, name); - empathy_account_refresh_properties (account); - } - - missing_accounts = empathy_account_manager_get_count (manager) - - accounts->len; - - if (missing_accounts > 0) - { - /* look for accounts we have and the Tp AccountManager doesn't, - * and remove them from our cache. - */ - - DEBUG ("%d missing accounts", missing_accounts); - - g_hash_table_iter_init (&iter, priv->accounts); - - while (g_hash_table_iter_next (&iter, NULL, &value) && - missing_accounts > 0) - { - account = value; - - /* look for this account in the AccountManager provided array */ - for (i = 0; i < accounts->len; i++) - { - name = g_ptr_array_index (accounts, i); - - if (!tp_strdiff - (name, empathy_account_get_unique_name (account))) - { - found = TRUE; - break; - } - } - - if (!found) - { - DEBUG ("Account %s was not found, remove it from the cache", - empathy_account_get_unique_name (account)); - - g_object_ref (account); - g_hash_table_iter_remove (&iter); - g_signal_emit (manager, signals[ACCOUNT_DELETED], 0, account); - g_object_unref (account); - - missing_accounts--; - } - - found = FALSE; - } - } -} - -static void -account_manager_got_all_cb (TpProxy *proxy, - GHashTable *properties, - const GError *error, - gpointer user_data, - GObject *weak_object) -{ - EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (weak_object); - GPtrArray *accounts; - - if (error != NULL) - { - DEBUG ("Failed to get account manager properties: %s", error->message); - return; - } - - accounts = tp_asv_get_boxed (properties, "ValidAccounts", - EMPATHY_ARRAY_TYPE_OBJECT); - - if (accounts != NULL) - account_manager_ensure_all_accounts (manager, accounts); - - empathy_account_manager_check_ready (manager); -} - -static void -account_validity_changed_cb (TpAccountManager *proxy, - const gchar *path, - gboolean valid, - gpointer user_data, - GObject *weak_object) -{ - EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (weak_object); - - if (!valid) - return; - - empathy_account_manager_ensure_account (manager, path); -} - -static void -account_manager_start_mc5 (TpDBusDaemon *bus) -{ - TpProxy *mc5_proxy; - - /* trigger MC5 starting */ - mc5_proxy = g_object_new (TP_TYPE_PROXY, - "dbus-daemon", bus, - "dbus-connection", tp_proxy_get_dbus_connection (TP_PROXY (bus)), - "bus-name", MC5_BUS_NAME, - "object-path", "/", - NULL); - - tp_cli_dbus_peer_call_ping (mc5_proxy, -1, NULL, NULL, NULL, NULL); - - g_object_unref (mc5_proxy); -} - -static void -account_manager_name_owner_cb (TpDBusDaemon *proxy, - const gchar *name, - const gchar *new_owner, - gpointer user_data) -{ - EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (user_data); - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - - DEBUG ("Name owner changed for %s, new name: %s", name, new_owner); - - if (EMP_STR_EMPTY (new_owner)) - { - /* MC5 quit or crashed for some reason, let's start it again */ - account_manager_start_mc5 (priv->dbus); - - if (priv->tp_manager != NULL) - g_object_unref (priv->tp_manager); - - priv->tp_manager = NULL; - return; - } - - if (priv->tp_manager == NULL) - { - priv->tp_manager = tp_account_manager_new (priv->dbus); - - tp_cli_account_manager_connect_to_account_validity_changed ( - priv->tp_manager, - account_validity_changed_cb, - NULL, - NULL, - G_OBJECT (manager), - NULL); - - tp_cli_dbus_properties_call_get_all (priv->tp_manager, -1, - TP_IFACE_ACCOUNT_MANAGER, - account_manager_got_all_cb, - NULL, - NULL, - G_OBJECT (manager)); - } -} - -static void -empathy_account_manager_init (EmpathyAccountManager *manager) -{ - EmpathyAccountManagerPriv *priv; - - priv = G_TYPE_INSTANCE_GET_PRIVATE (manager, - EMPATHY_TYPE_ACCOUNT_MANAGER, EmpathyAccountManagerPriv); - - manager->priv = priv; - priv->connected = priv->connecting = 0; - priv->global_presence = TP_CONNECTION_PRESENCE_TYPE_UNSET; - - priv->accounts = g_hash_table_new_full (g_str_hash, g_str_equal, - g_free, (GDestroyNotify) g_object_unref); - - priv->create_results = g_hash_table_new (g_direct_hash, g_direct_equal); - - priv->dbus = tp_dbus_daemon_dup (NULL); - - tp_dbus_daemon_watch_name_owner (priv->dbus, - TP_ACCOUNT_MANAGER_BUS_NAME, - account_manager_name_owner_cb, - manager, - NULL); - - account_manager_start_mc5 (priv->dbus); -} - -static void -do_finalize (GObject *obj) -{ - EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (obj); - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - - g_hash_table_destroy (priv->create_results); - g_hash_table_destroy (priv->accounts); - - g_free (priv->global_status); - g_free (priv->global_status_message); - - g_free (priv->requested_status); - g_free (priv->requested_status_message); - - G_OBJECT_CLASS (empathy_account_manager_parent_class)->finalize (obj); -} - -static void -do_dispose (GObject *obj) -{ - EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (obj); - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - GHashTableIter iter; - GSimpleAsyncResult *result; - - if (priv->dispose_run) - return; - - priv->dispose_run = TRUE; - - /* the manager is being destroyed while there are account creation - * processes pending; this should not happen, but emit the callbacks - * with an error anyway. - */ - g_hash_table_iter_init (&iter, priv->create_results); - while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &result)) - { - g_simple_async_result_set_error (result, G_IO_ERROR, - G_IO_ERROR_CANCELLED, "The account manager was disposed while " - "creating the account"); - g_simple_async_result_complete (result); - g_object_unref (result); - } - g_hash_table_remove_all (priv->create_results); - - if (priv->dbus != NULL) - { - tp_dbus_daemon_cancel_name_owner_watch (priv->dbus, - TP_ACCOUNT_MANAGER_BUS_NAME, account_manager_name_owner_cb, manager); - - g_object_unref (priv->dbus); - priv->dbus = NULL; - } - - G_OBJECT_CLASS (empathy_account_manager_parent_class)->dispose (obj); -} - -static GObject * -do_constructor (GType type, - guint n_construct_params, - GObjectConstructParam *construct_params) -{ - GObject *retval; - - if (!manager_singleton) - { - retval = G_OBJECT_CLASS - (empathy_account_manager_parent_class)->constructor (type, - n_construct_params, construct_params); - manager_singleton = EMPATHY_ACCOUNT_MANAGER (retval); - g_object_add_weak_pointer (retval, (gpointer) &manager_singleton); - } - else - { - retval = g_object_ref (manager_singleton); - } - - return retval; -} - -static void -do_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (object); - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - - switch (prop_id) - { - case PROP_READY: - g_value_set_boolean (value, priv->ready); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -empathy_account_manager_class_init (EmpathyAccountManagerClass *klass) -{ - GObjectClass *oclass = G_OBJECT_CLASS (klass); - - oclass->finalize = do_finalize; - oclass->dispose = do_dispose; - oclass->constructor = do_constructor; - oclass->get_property = do_get_property; - - g_object_class_install_property (oclass, PROP_READY, - g_param_spec_boolean ("ready", - "Ready", - "Whether the initial state dump from the account manager is finished", - FALSE, - G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); - - signals[ACCOUNT_CREATED] = - g_signal_new ("account-created", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, - 1, EMPATHY_TYPE_ACCOUNT); - - signals[ACCOUNT_DELETED] = - g_signal_new ("account-deleted", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, - 1, EMPATHY_TYPE_ACCOUNT); - - signals[ACCOUNT_ENABLED] = - g_signal_new ("account-enabled", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, - 1, EMPATHY_TYPE_ACCOUNT); - - signals[ACCOUNT_DISABLED] = - g_signal_new ("account-disabled", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, - 1, EMPATHY_TYPE_ACCOUNT); - - signals[ACCOUNT_CHANGED] = - g_signal_new ("account-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, - 1, EMPATHY_TYPE_ACCOUNT); - - signals[ACCOUNT_CONNECTION_CHANGED] = - g_signal_new ("account-connection-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - 0, - NULL, NULL, - _empathy_marshal_VOID__OBJECT_INT_UINT_UINT, - G_TYPE_NONE, - 4, EMPATHY_TYPE_ACCOUNT, - G_TYPE_INT, /* reason */ - G_TYPE_UINT, /* actual connection */ - G_TYPE_UINT); /* previous connection */ - - signals[GLOBAL_PRESENCE_CHANGED] = - g_signal_new ("global-presence-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - 0, - NULL, NULL, - _empathy_marshal_VOID__UINT_STRING_STRING, - G_TYPE_NONE, - 3, G_TYPE_UINT, /* Presence type */ - G_TYPE_STRING, /* status */ - G_TYPE_STRING); /* stauts message*/ - - signals[NEW_CONNECTION] = - g_signal_new ("new-connection", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, - 1, TP_TYPE_CONNECTION); - - g_type_class_add_private (oclass, sizeof (EmpathyAccountManagerPriv)); -} - -/* public methods */ - -EmpathyAccountManager * -empathy_account_manager_dup_singleton (void) -{ - return g_object_new (EMPATHY_TYPE_ACCOUNT_MANAGER, NULL); -} - -gboolean -empathy_account_manager_is_ready (EmpathyAccountManager *manager) -{ - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - - return priv->ready; -} - -int -empathy_account_manager_get_connected_accounts (EmpathyAccountManager *manager) -{ - EmpathyAccountManagerPriv *priv; - - g_return_val_if_fail (EMPATHY_IS_ACCOUNT_MANAGER (manager), 0); - - priv = GET_PRIV (manager); - - return priv->connected; -} - -int -empathy_account_manager_get_connecting_accounts ( - EmpathyAccountManager *manager) -{ - EmpathyAccountManagerPriv *priv; - - g_return_val_if_fail (EMPATHY_IS_ACCOUNT_MANAGER (manager), 0); - - priv = GET_PRIV (manager); - - return priv->connecting; -} - -/** - * empathy_account_manager_get_count: - * @manager: a #EmpathyAccountManager - * - * Get the number of accounts. - * - * Returns: the number of accounts. - **/ -int -empathy_account_manager_get_count (EmpathyAccountManager *manager) -{ - EmpathyAccountManagerPriv *priv; - - g_return_val_if_fail (EMPATHY_IS_ACCOUNT_MANAGER (manager), 0); - - priv = GET_PRIV (manager); - - return g_hash_table_size (priv->accounts); -} - -EmpathyAccount * -empathy_account_manager_get_account_for_connection ( - EmpathyAccountManager *manager, - TpConnection *connection) -{ - EmpathyAccountManagerPriv *priv; - GHashTableIter iter; - gpointer value; - - g_return_val_if_fail (EMPATHY_IS_ACCOUNT_MANAGER (manager), 0); - - priv = GET_PRIV (manager); - - g_hash_table_iter_init (&iter, priv->accounts); - while (g_hash_table_iter_next (&iter, NULL, &value)) - { - EmpathyAccount *account = EMPATHY_ACCOUNT (value); - - if (connection == empathy_account_get_connection (account)) - return account; - } - - return NULL; -} - -GList * -empathy_account_manager_dup_accounts (EmpathyAccountManager *manager) -{ - EmpathyAccountManagerPriv *priv; - GList *ret; - - g_return_val_if_fail (EMPATHY_IS_ACCOUNT_MANAGER (manager), NULL); - - priv = GET_PRIV (manager); - - ret = g_hash_table_get_values (priv->accounts); - g_list_foreach (ret, (GFunc) g_object_ref, NULL); - - return ret; -} - -/** - * empathy_account_manager_dup_connections: - * @manager: a #EmpathyAccountManager - * - * Get a #GList of all ready #TpConnection. The list must be freed with - * g_list_free, and its elements must be unreffed. - * - * Returns: the list of connections - **/ -GList * -empathy_account_manager_dup_connections (EmpathyAccountManager *manager) -{ - EmpathyAccountManagerPriv *priv; - GHashTableIter iter; - gpointer value; - GList *ret = NULL; - - g_return_val_if_fail (EMPATHY_IS_ACCOUNT_MANAGER (manager), NULL); - - priv = GET_PRIV (manager); - - g_hash_table_iter_init (&iter, priv->accounts); - while (g_hash_table_iter_next (&iter, NULL, &value)) - { - EmpathyAccount *account = EMPATHY_ACCOUNT (value); - TpConnection *connection; - - connection = empathy_account_get_connection (account); - if (connection != NULL) - ret = g_list_prepend (ret, g_object_ref (connection)); - } - - return ret; -} - -void -empathy_account_manager_request_global_presence ( - EmpathyAccountManager *manager, - TpConnectionPresenceType type, - const gchar *status, - const gchar *message) -{ - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - GHashTableIter iter; - gpointer value; - - DEBUG ("request global presence, type: %d, status: %s, message: %s", - type, status, message); - - g_hash_table_iter_init (&iter, priv->accounts); - while (g_hash_table_iter_next (&iter, NULL, &value)) - { - EmpathyAccount *account = EMPATHY_ACCOUNT (value); - gboolean ready; - - g_object_get (account, "ready", &ready, NULL); - - if (ready) - empathy_account_request_presence (account, type, status, message); - } - - /* save the requested global presence, to use it in case we create - * new accounts or some accounts become ready. - */ - priv->requested_presence = type; - - if (tp_strdiff (priv->requested_status, status)) - { - g_free (priv->requested_status); - priv->requested_status = g_strdup (status); - } - - if (tp_strdiff (priv->requested_status_message, message)) - { - g_free (priv->requested_status_message); - priv->requested_status_message = g_strdup (message); - } -} - -TpConnectionPresenceType -empathy_account_manager_get_requested_global_presence ( - EmpathyAccountManager *manager, - gchar **status, - gchar **message) -{ - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - - if (status != NULL) - *status = g_strdup (priv->requested_status); - if (message != NULL) - *message = g_strdup (priv->requested_status_message); - - return priv->requested_presence; -} - -TpConnectionPresenceType -empathy_account_manager_get_global_presence ( - EmpathyAccountManager *manager, - gchar **status, - gchar **message) -{ - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - - if (status != NULL) - *status = g_strdup (priv->global_status); - if (message != NULL) - *message = g_strdup (priv->global_status_message); - - return priv->global_presence; -} - -static void -empathy_account_manager_created_cb (TpAccountManager *proxy, - const gchar *account_path, - const GError *error, - gpointer user_data, - GObject *weak_object) -{ - EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (weak_object); - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - GSimpleAsyncResult *my_res = user_data; - EmpathyAccount *account; - - if (error != NULL) - { - g_simple_async_result_set_from_error (my_res, - (GError *) error); - g_simple_async_result_complete (my_res); - g_object_unref (my_res); - - return; - } - - account = empathy_account_manager_ensure_account (manager, account_path); - - g_hash_table_insert (priv->create_results, account, my_res); -} - -void -empathy_account_manager_create_account_async (EmpathyAccountManager *manager, - const gchar *connection_manager, - const gchar *protocol, - const gchar *display_name, - GHashTable *parameters, - GHashTable *properties, - GAsyncReadyCallback callback, - gpointer user_data) -{ - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); - GSimpleAsyncResult *res; - - res = g_simple_async_result_new - (G_OBJECT (manager), callback, user_data, - empathy_account_manager_create_account_finish); - - tp_cli_account_manager_call_create_account (priv->tp_manager, - -1, - connection_manager, - protocol, - display_name, - parameters, - properties, - empathy_account_manager_created_cb, - res, - NULL, - G_OBJECT (manager)); -} - -EmpathyAccount * -empathy_account_manager_create_account_finish ( - EmpathyAccountManager *manager, GAsyncResult *result, GError **error) -{ - EmpathyAccount *retval; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), - error)) - return NULL; - - g_return_val_if_fail (g_simple_async_result_is_valid (result, - G_OBJECT (manager), empathy_account_manager_create_account_finish), NULL); - - retval = EMPATHY_ACCOUNT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (result))); - - return retval; -} - diff --git a/libempathy/empathy-account-manager.h b/libempathy/empathy-account-manager.h deleted file mode 100644 index 7b4ebd9bb..000000000 --- a/libempathy/empathy-account-manager.h +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ -/* - * Copyright (C) 2008 Collabora Ltd. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Authors: Cosimo Cecchi <cosimo.cecchi@collabora.co.uk> - */ - -#ifndef __EMPATHY_ACCOUNT_MANAGER_H__ -#define __EMPATHY_ACCOUNT_MANAGER_H__ - -#include <glib-object.h> - -#include "empathy-account.h" - -G_BEGIN_DECLS - -#define EMPATHY_TYPE_ACCOUNT_MANAGER (empathy_account_manager_get_type ()) -#define EMPATHY_ACCOUNT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), \ - EMPATHY_TYPE_ACCOUNT_MANAGER, EmpathyAccountManager)) -#define EMPATHY_ACCOUNT_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), \ - EMPATHY_TYPE_ACCOUNT_MANAGER, EmpathyAccountManagerClass)) -#define EMPATHY_IS_ACCOUNT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \ - EMPATHY_TYPE_ACCOUNT_MANAGER)) -#define EMPATHY_IS_ACCOUNT_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), \ - EMPATHY_TYPE_ACCOUNT_MANAGER)) -#define EMPATHY_ACCOUNT_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \ - EMPATHY_TYPE_ACCOUNT_MANAGER, EmpathyAccountManagerClass)) - -typedef struct _EmpathyAccountManager EmpathyAccountManager; -typedef struct _EmpathyAccountManagerClass EmpathyAccountManagerClass; - -struct _EmpathyAccountManager { - GObject parent; - gpointer priv; -}; - -struct _EmpathyAccountManagerClass { - GObjectClass parent_class; -}; - -GType empathy_account_manager_get_type (void); - -/* public methods */ - -EmpathyAccountManager * empathy_account_manager_dup_singleton (void); - -gboolean empathy_account_manager_is_ready (EmpathyAccountManager *manager); - -int empathy_account_manager_get_connected_accounts - (EmpathyAccountManager *manager); -int empathy_account_manager_get_connecting_accounts - (EmpathyAccountManager *manager); -int empathy_account_manager_get_count - (EmpathyAccountManager *manager); -EmpathyAccount * empathy_account_manager_get_account_for_connection - (EmpathyAccountManager *manager, - TpConnection *connection); -EmpathyAccount * empathy_account_manager_ensure_account - (EmpathyAccountManager *manager, - const gchar *unique_name); -EmpathyAccount * empathy_account_manager_get_account - (EmpathyAccountManager *manager, - const gchar *unique_name); -GList * empathy_account_manager_dup_accounts - (EmpathyAccountManager *manager); -GList * empathy_account_manager_dup_connections - (EmpathyAccountManager *manager); - -void empathy_account_manager_request_global_presence ( - EmpathyAccountManager *manager, - TpConnectionPresenceType type, - const gchar *status, - const gchar *message); - -TpConnectionPresenceType empathy_account_manager_get_requested_global_presence ( - EmpathyAccountManager *manager, - gchar **status, - gchar **message); - -TpConnectionPresenceType empathy_account_manager_get_global_presence ( - EmpathyAccountManager *manager, - gchar **status, - gchar **message); - -void empathy_account_manager_create_account_async ( - EmpathyAccountManager *manager, const gchar *connection_manager, - const gchar *protocol, const gchar *display_name, - GHashTable *parameters, GHashTable *properties, - GAsyncReadyCallback callback, gpointer user_data); - -EmpathyAccount * empathy_account_manager_create_account_finish ( - EmpathyAccountManager *settings, GAsyncResult *result, GError **error); - -G_END_DECLS - -#endif /* __EMPATHY_ACCOUNT_MANAGER_H__ */ - diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c index 0acc8006f..f33e43799 100644 --- a/libempathy/empathy-account-settings.c +++ b/libempathy/empathy-account-settings.c @@ -22,14 +22,15 @@ #include <stdio.h> #include <stdlib.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/util.h> #include <telepathy-glib/interfaces.h> #include <telepathy-glib/gtypes.h> #include "empathy-account-settings.h" -#include "empathy-account-manager.h" #include "empathy-connection-managers.h" #include "empathy-utils.h" +#include "empathy-idle.h" #define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT #include <libempathy/empathy-debug.h> @@ -54,12 +55,11 @@ struct _EmpathyAccountSettingsPriv { gboolean dispose_has_run; EmpathyConnectionManagers *managers; - EmpathyAccountManager *account_manager; - gulong account_manager_ready_id; + TpAccountManager *account_manager; TpConnectionManager *manager; - EmpathyAccount *account; + TpAccount *account; gchar *cm_name; gchar *protocol; gchar *display_name; @@ -72,7 +72,6 @@ struct _EmpathyAccountSettingsPriv GArray *required_params; gulong managers_ready_id; - gulong account_ready_id; GSimpleAsyncResult *apply_result; }; @@ -87,7 +86,7 @@ empathy_account_settings_init (EmpathyAccountSettings *obj) /* allocate any data required by the object here */ priv->managers = empathy_connection_managers_dup_singleton (); - priv->account_manager = empathy_account_manager_dup_singleton (); + priv->account_manager = tp_account_manager_dup (); priv->parameters = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); @@ -97,8 +96,10 @@ empathy_account_settings_init (EmpathyAccountSettings *obj) static void empathy_account_settings_dispose (GObject *object); static void empathy_account_settings_finalize (GObject *object); -static void empathy_account_settings_ready_cb (GObject *obj, - GParamSpec *spec, gpointer user_data); +static void empathy_account_settings_account_ready_cb (GObject *source_object, + GAsyncResult *result, gpointer user_data); +static void empathy_account_settings_managers_ready_cb (GObject *obj, + GParamSpec *pspec, gpointer user_data); static void empathy_account_settings_check_readyness ( EmpathyAccountSettings *self); @@ -181,11 +182,11 @@ empathy_account_settings_constructed (GObject *object) g_free (priv->protocol); priv->cm_name = - g_strdup (empathy_account_get_connection_manager (priv->account)); + g_strdup (tp_account_get_connection_manager (priv->account)); priv->protocol = - g_strdup (empathy_account_get_protocol (priv->account)); + g_strdup (tp_account_get_protocol (priv->account)); priv->icon_name = g_strdup - (empathy_account_get_icon_name (priv->account)); + (tp_account_get_icon_name (priv->account)); } else { @@ -198,10 +199,10 @@ empathy_account_settings_constructed (GObject *object) if (!priv->ready) { - g_signal_connect (priv->account, "notify::ready", - G_CALLBACK (empathy_account_settings_ready_cb), self); + tp_account_prepare_async (priv->account, NULL, + empathy_account_settings_account_ready_cb, self); g_signal_connect (priv->managers, "notify::ready", - G_CALLBACK (empathy_account_settings_ready_cb), self); + G_CALLBACK (empathy_account_settings_managers_ready_cb), self); } if (G_OBJECT_CLASS ( @@ -229,8 +230,8 @@ empathy_account_settings_class_init ( g_object_class_install_property (object_class, PROP_ACCOUNT, g_param_spec_object ("account", "Account", - "The EmpathyAccount backing these settings", - EMPATHY_TYPE_ACCOUNT, + "The TpAccount backing these settings", + TP_TYPE_ACCOUNT, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_CM_NAME, @@ -293,19 +294,10 @@ empathy_account_settings_dispose (GObject *object) g_object_unref (priv->manager); priv->manager = NULL; - if (priv->account_manager_ready_id != 0) - g_signal_handler_disconnect (priv->account_manager, - priv->account_manager_ready_id); - priv->account_manager_ready_id = 0; - if (priv->account_manager != NULL) g_object_unref (priv->account_manager); priv->account_manager = NULL; - if (priv->account_ready_id != 0) - g_signal_handler_disconnect (priv->account, priv->account_ready_id); - priv->account_ready_id = 0; - if (priv->account != NULL) g_object_unref (priv->account); priv->account = NULL; @@ -360,7 +352,8 @@ empathy_account_settings_check_readyness (EmpathyAccountSettings *self) if (priv->ready) return; - if (priv->account != NULL && !empathy_account_is_ready (priv->account)) + if (priv->account != NULL + && !tp_account_is_prepared (priv->account, TP_ACCOUNT_FEATURE_CORE)) return; if (!empathy_connection_managers_is_ready (priv->managers)) @@ -376,11 +369,11 @@ empathy_account_settings_check_readyness (EmpathyAccountSettings *self) { g_free (priv->display_name); priv->display_name = - g_strdup (empathy_account_get_display_name (priv->account)); + g_strdup (tp_account_get_display_name (priv->account)); g_free (priv->icon_name); priv->icon_name = - g_strdup (empathy_account_get_icon_name (priv->account)); + g_strdup (tp_account_get_icon_name (priv->account)); } tp_protocol = tp_connection_manager_get_protocol (priv->manager, @@ -416,8 +409,27 @@ empathy_account_settings_check_readyness (EmpathyAccountSettings *self) } static void -empathy_account_settings_ready_cb (GObject *obj, - GParamSpec *spec, +empathy_account_settings_account_ready_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + EmpathyAccountSettings *settings = EMPATHY_ACCOUNT_SETTINGS (user_data); + TpAccount *account = TP_ACCOUNT (source_object); + GError *error = NULL; + + if (!tp_account_prepare_finish (account, result, &error)) + { + DEBUG ("Failed to prepare account: %s", error->message); + g_error_free (error); + return; + } + + empathy_account_settings_check_readyness (settings); +} + +static void +empathy_account_settings_managers_ready_cb (GObject *object, + GParamSpec *pspec, gpointer user_data) { EmpathyAccountSettings *settings = EMPATHY_ACCOUNT_SETTINGS (user_data); @@ -438,7 +450,7 @@ empathy_account_settings_new (const gchar *connection_manager, } EmpathyAccountSettings * -empathy_account_settings_new_for_account (EmpathyAccount *account) +empathy_account_settings_new_for_account (TpAccount *account) { return g_object_new (EMPATHY_TYPE_ACCOUNT_SETTINGS, "account", account, @@ -506,7 +518,7 @@ empathy_account_settings_get_display_name (EmpathyAccountSettings *settings) return priv->display_name; } -EmpathyAccount * +TpAccount * empathy_account_settings_get_account (EmpathyAccountSettings *settings) { EmpathyAccountSettingsPriv *priv = GET_PRIV (settings); @@ -621,7 +633,7 @@ empathy_account_settings_get (EmpathyAccountSettings *settings, { const GHashTable *parameters; - parameters = empathy_account_get_parameters (priv->account); + parameters = tp_account_get_parameters (priv->account); result = tp_asv_lookup (parameters, param); if (result != NULL) @@ -910,10 +922,10 @@ account_settings_display_name_set_cb (GObject *src, gpointer user_data) { GError *error = NULL; - EmpathyAccount *account = EMPATHY_ACCOUNT (src); + TpAccount *account = TP_ACCOUNT (src); GSimpleAsyncResult *set_result = user_data; - empathy_account_set_display_name_finish (account, res, &error); + tp_account_set_display_name_finish (account, res, &error); if (error != NULL) { @@ -950,7 +962,7 @@ empathy_account_settings_set_display_name_async ( return; } - empathy_account_set_display_name_async (priv->account, name, + tp_account_set_display_name_async (priv->account, name, account_settings_display_name_set_cb, result); } @@ -977,10 +989,10 @@ account_settings_icon_name_set_cb (GObject *src, gpointer user_data) { GError *error = NULL; - EmpathyAccount *account = EMPATHY_ACCOUNT (src); + TpAccount *account = TP_ACCOUNT (src); GSimpleAsyncResult *set_result = user_data; - empathy_account_set_icon_name_finish (account, res, &error); + tp_account_set_icon_name_finish (account, res, &error); if (error != NULL) { @@ -1017,7 +1029,7 @@ empathy_account_settings_set_icon_name_async ( return; } - empathy_account_set_icon_name_async (priv->account, name, + tp_account_set_icon_name_async (priv->account, name, account_settings_icon_name_set_cb, result); } @@ -1048,8 +1060,8 @@ empathy_account_settings_account_updated (GObject *source, GSimpleAsyncResult *r; GError *error = NULL; - if (!empathy_account_update_settings_finish (EMPATHY_ACCOUNT (source), - result, &error)) + if (!tp_account_update_parameters_finish (TP_ACCOUNT (source), + result, NULL, &error)) { g_simple_async_result_set_from_error (priv->apply_result, error); g_error_free (error); @@ -1073,12 +1085,12 @@ empathy_account_settings_created_cb (GObject *source, { EmpathyAccountSettings *settings = EMPATHY_ACCOUNT_SETTINGS (user_data); EmpathyAccountSettingsPriv *priv = GET_PRIV (settings); - EmpathyAccount *account; + TpAccount *account; GError *error = NULL; GSimpleAsyncResult *r; - account = empathy_account_manager_create_account_finish ( - EMPATHY_ACCOUNT_MANAGER (source), result, &error); + account = tp_account_manager_create_account_finish ( + TP_ACCOUNT_MANAGER (source), result, &error); if (account == NULL) { @@ -1106,11 +1118,13 @@ empathy_account_settings_do_create_account (EmpathyAccountSettings *settings) TpConnectionPresenceType type; gchar *status; gchar *message; + EmpathyIdle *idle; properties = tp_asv_new (NULL, NULL); - type = empathy_account_manager_get_requested_global_presence - (priv->account_manager, &status, &message); + idle = empathy_idle_dup_singleton (); + type = empathy_idle_get_requested_presence (idle, &status, &message); + g_object_unref (idle); if (type != TP_CONNECTION_PRESENCE_TYPE_UNSET) { @@ -1142,7 +1156,7 @@ empathy_account_settings_do_create_account (EmpathyAccountSettings *settings) tp_asv_set_string (properties, TP_IFACE_ACCOUNT ".Icon", priv->icon_name); - empathy_account_manager_create_account_async (priv->account_manager, + tp_account_manager_create_account_async (priv->account_manager, priv->cm_name, priv->protocol, priv->display_name, priv->parameters, properties, empathy_account_settings_created_cb, @@ -1152,22 +1166,24 @@ empathy_account_settings_do_create_account (EmpathyAccountSettings *settings) } static void -empathy_account_settings_manager_ready_cb (EmpathyAccountManager *manager, - GParamSpec *spec, +empathy_account_settings_manager_ready_cb (GObject *source_object, + GAsyncResult *result, gpointer user_data) { EmpathyAccountSettings *settings = EMPATHY_ACCOUNT_SETTINGS (user_data); EmpathyAccountSettingsPriv *priv = GET_PRIV (settings); + TpAccountManager *account_manager = TP_ACCOUNT_MANAGER (source_object); + GError *error = NULL; - if (empathy_account_manager_is_ready (manager)) + if (!tp_account_manager_prepare_finish (account_manager, result, &error)) { - g_assert (priv->apply_result != NULL && priv->account == NULL); - g_signal_handler_disconnect (priv->account_manager, - priv->account_manager_ready_id); - priv->account_manager_ready_id = 0; - - empathy_account_settings_do_create_account (settings); + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; } + + g_assert (priv->apply_result != NULL && priv->account == NULL); + empathy_account_settings_do_create_account (settings); } void @@ -1180,8 +1196,8 @@ empathy_account_settings_apply_async (EmpathyAccountSettings *settings, if (priv->apply_result != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (settings), - callback, user_data, - G_IO_ERROR, G_IO_ERROR_PENDING, "Applying already in progress"); + callback, user_data, + G_IO_ERROR, G_IO_ERROR_PENDING, "Applying already in progress"); return; } @@ -1190,20 +1206,14 @@ empathy_account_settings_apply_async (EmpathyAccountSettings *settings, if (priv->account == NULL) { - if (empathy_account_manager_is_ready (priv->account_manager)) - empathy_account_settings_do_create_account (settings); - else - priv->account_manager_ready_id = g_signal_connect ( - priv->account_manager, - "notify::ready", - G_CALLBACK (empathy_account_settings_manager_ready_cb), - settings); + tp_account_manager_prepare_async (priv->account_manager, NULL, + empathy_account_settings_manager_ready_cb, settings); } else { - empathy_account_update_settings_async (priv->account, - priv->parameters, (const gchar **)priv->unset_parameters->data, - empathy_account_settings_account_updated, settings); + tp_account_update_parameters_async (priv->account, + priv->parameters, (const gchar **)priv->unset_parameters->data, + empathy_account_settings_account_updated, settings); } } @@ -1224,12 +1234,12 @@ empathy_account_settings_apply_finish (EmpathyAccountSettings *settings, gboolean empathy_account_settings_has_account (EmpathyAccountSettings *settings, - EmpathyAccount *account) + TpAccount *account) { EmpathyAccountSettingsPriv *priv; g_return_val_if_fail (EMPATHY_IS_ACCOUNT_SETTINGS (settings), FALSE); - g_return_val_if_fail (EMPATHY_IS_ACCOUNT (account), FALSE); + g_return_val_if_fail (TP_IS_ACCOUNT (account), FALSE); priv = GET_PRIV (settings); @@ -1262,7 +1272,7 @@ empathy_account_settings_is_valid (EmpathyAccountSettings *settings) { const GHashTable *account_params; - account_params = empathy_account_get_parameters (priv->account); + account_params = tp_account_get_parameters (priv->account); if (tp_asv_lookup (account_params, current)) continue; } diff --git a/libempathy/empathy-account-settings.h b/libempathy/empathy-account-settings.h index c7d263e3b..0ea9b5567 100644 --- a/libempathy/empathy-account-settings.h +++ b/libempathy/empathy-account-settings.h @@ -24,7 +24,7 @@ #include <glib-object.h> #include <gio/gio.h> -#include <libempathy/empathy-account.h> +#include <telepathy-glib/account.h> #include <telepathy-glib/connection-manager.h> G_BEGIN_DECLS @@ -66,7 +66,7 @@ EmpathyAccountSettings * empathy_account_settings_new ( const char *display_name); EmpathyAccountSettings * empathy_account_settings_new_for_account ( - EmpathyAccount *account); + TpAccount *account); gboolean empathy_account_settings_is_ready (EmpathyAccountSettings *settings); @@ -74,11 +74,11 @@ const gchar *empathy_account_settings_get_cm (EmpathyAccountSettings *settings); const gchar *empathy_account_settings_get_protocol ( EmpathyAccountSettings *settings); -EmpathyAccount *empathy_account_settings_get_account ( +TpAccount *empathy_account_settings_get_account ( EmpathyAccountSettings *settings); gboolean empathy_account_settings_has_account ( - EmpathyAccountSettings *settings, EmpathyAccount *account); + EmpathyAccountSettings *settings, TpAccount *account); TpConnectionManagerParam *empathy_account_settings_get_tp_params ( EmpathyAccountSettings *settings); diff --git a/libempathy/empathy-account.c b/libempathy/empathy-account.c deleted file mode 100644 index fb1b2756d..000000000 --- a/libempathy/empathy-account.c +++ /dev/null @@ -1,1305 +0,0 @@ -/* - * empathy-account.c - Source for EmpathyAccount - * Copyright (C) 2009 Collabora Ltd. - * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <telepathy-glib/enums.h> -#include <telepathy-glib/dbus.h> -#include <telepathy-glib/account.h> -#include <telepathy-glib/gtypes.h> -#include <telepathy-glib/util.h> -#include <telepathy-glib/interfaces.h> -#include <telepathy-glib/defs.h> - -#define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT -#include <libempathy/empathy-debug.h> - -#include <glib/gi18n-lib.h> - -#include "empathy-account.h" -#include "empathy-account-manager.h" -#include "empathy-utils.h" -#include "empathy-marshal.h" - -/* signals */ -enum { - STATUS_CHANGED, - PRESENCE_CHANGED, - REMOVED, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL]; - -/* properties */ -enum { - PROP_ENABLED = 1, - PROP_PRESENCE, - PROP_STATUS, - PROP_STATUS_MESSAGE, - PROP_READY, - PROP_CONNECTION_STATUS, - PROP_CONNECTION_STATUS_REASON, - PROP_CONNECTION, - PROP_UNIQUE_NAME, - PROP_DBUS_DAEMON, - PROP_DISPLAY_NAME -}; - -G_DEFINE_TYPE(EmpathyAccount, empathy_account, G_TYPE_OBJECT) - -/* private structure */ -typedef struct _EmpathyAccountPriv EmpathyAccountPriv; - -struct _EmpathyAccountPriv -{ - gboolean dispose_has_run; - - TpConnection *connection; - guint connection_invalidated_id; - - TpConnectionStatus connection_status; - TpConnectionStatusReason reason; - - TpConnectionPresenceType presence; - gchar *status; - gchar *message; - - gboolean enabled; - gboolean valid; - gboolean ready; - gboolean removed; - /* Timestamp when the connection got connected in seconds since the epoch */ - glong connect_time; - - gchar *cm_name; - gchar *proto_name; - gchar *icon_name; - - gchar *unique_name; - gchar *display_name; - TpDBusDaemon *dbus; - - TpAccount *account; - GHashTable *parameters; -}; - -#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyAccount) - -static void _empathy_account_set_connection (EmpathyAccount *account, - const gchar *path); - -static void -empathy_account_init (EmpathyAccount *obj) -{ - EmpathyAccountPriv *priv; - - priv = G_TYPE_INSTANCE_GET_PRIVATE (obj, - EMPATHY_TYPE_ACCOUNT, EmpathyAccountPriv); - - obj->priv = priv; - - priv->connection_status = TP_CONNECTION_STATUS_DISCONNECTED; -} - -static void -empathy_account_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - EmpathyAccount *account = EMPATHY_ACCOUNT (object); - EmpathyAccountPriv *priv = GET_PRIV (account); - - switch (prop_id) - { - case PROP_ENABLED: - empathy_account_set_enabled_async (account, - g_value_get_boolean (value), NULL, NULL); - break; - case PROP_UNIQUE_NAME: - priv->unique_name = g_value_dup_string (value); - break; - case PROP_DBUS_DAEMON: - priv->dbus = g_value_get_object (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -empathy_account_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - EmpathyAccount *account = EMPATHY_ACCOUNT (object); - EmpathyAccountPriv *priv = GET_PRIV (account); - - switch (prop_id) - { - case PROP_ENABLED: - g_value_set_boolean (value, priv->enabled); - break; - case PROP_READY: - g_value_set_boolean (value, priv->ready); - break; - case PROP_PRESENCE: - g_value_set_uint (value, priv->presence); - break; - case PROP_STATUS: - g_value_set_string (value, priv->status); - break; - case PROP_STATUS_MESSAGE: - g_value_set_string (value, priv->message); - break; - case PROP_CONNECTION_STATUS: - g_value_set_uint (value, priv->connection_status); - break; - case PROP_CONNECTION_STATUS_REASON: - g_value_set_uint (value, priv->reason); - break; - case PROP_CONNECTION: - g_value_set_object (value, - empathy_account_get_connection (account)); - break; - case PROP_UNIQUE_NAME: - g_value_set_string (value, - empathy_account_get_unique_name (account)); - break; - case PROP_DISPLAY_NAME: - g_value_set_string (value, - empathy_account_get_display_name (account)); - break; - case PROP_DBUS_DAEMON: - g_value_set_object (value, priv->dbus); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -empathy_account_update (EmpathyAccount *account, - GHashTable *properties) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - GValueArray *arr; - TpConnectionStatus old_s = priv->connection_status; - gboolean presence_changed = FALSE; - - if (g_hash_table_lookup (properties, "ConnectionStatus") != NULL) - priv->connection_status = - tp_asv_get_int32 (properties, "ConnectionStatus", NULL); - - if (g_hash_table_lookup (properties, "ConnectionStatusReason") != NULL) - priv->reason = tp_asv_get_int32 (properties, - "ConnectionStatusReason", NULL); - - if (g_hash_table_lookup (properties, "CurrentPresence") != NULL) - { - presence_changed = TRUE; - arr = tp_asv_get_boxed (properties, "CurrentPresence", - TP_STRUCT_TYPE_SIMPLE_PRESENCE); - priv->presence = g_value_get_uint (g_value_array_get_nth (arr, 0)); - - g_free (priv->status); - priv->status = g_value_dup_string (g_value_array_get_nth (arr, 1)); - - g_free (priv->message); - priv->message = g_value_dup_string (g_value_array_get_nth (arr, 2)); - } - - if (g_hash_table_lookup (properties, "DisplayName") != NULL) - { - g_free (priv->display_name); - priv->display_name = - g_strdup (tp_asv_get_string (properties, "DisplayName")); - g_object_notify (G_OBJECT (account), "display-name"); - } - - if (g_hash_table_lookup (properties, "Icon") != NULL) - { - const gchar *icon_name; - - icon_name = tp_asv_get_string (properties, "Icon"); - - g_free (priv->icon_name); - - if (EMP_STR_EMPTY (icon_name)) - priv->icon_name = empathy_protocol_icon_name (priv->proto_name); - else - priv->icon_name = g_strdup (icon_name); - } - - if (g_hash_table_lookup (properties, "Enabled") != NULL) - { - gboolean enabled = tp_asv_get_boolean (properties, "Enabled", NULL); - if (priv->enabled != enabled) - { - priv->enabled = enabled; - g_object_notify (G_OBJECT (account), "enabled"); - } - } - - if (g_hash_table_lookup (properties, "Valid") != NULL) - priv->valid = tp_asv_get_boolean (properties, "Valid", NULL); - - if (g_hash_table_lookup (properties, "Parameters") != NULL) - { - GHashTable *parameters; - - parameters = tp_asv_get_boxed (properties, "Parameters", - TP_HASH_TYPE_STRING_VARIANT_MAP); - - if (priv->parameters != NULL) - g_hash_table_unref (priv->parameters); - - priv->parameters = g_boxed_copy (TP_HASH_TYPE_STRING_VARIANT_MAP, - parameters); - } - - if (!priv->ready) - { - priv->ready = TRUE; - g_object_notify (G_OBJECT (account), "ready"); - } - - if (priv->connection_status != old_s) - { - if (priv->connection_status == TP_CONNECTION_STATUS_CONNECTED) - { - GTimeVal val; - g_get_current_time (&val); - - priv->connect_time = val.tv_sec; - } - - g_signal_emit (account, signals[STATUS_CHANGED], 0, - old_s, priv->connection_status, priv->reason); - - g_object_notify (G_OBJECT (account), "connection-status"); - g_object_notify (G_OBJECT (account), "connection-status-reason"); - } - - if (presence_changed) - { - g_signal_emit (account, signals[PRESENCE_CHANGED], 0, - priv->presence, priv->status, priv->message); - g_object_notify (G_OBJECT (account), "presence"); - g_object_notify (G_OBJECT (account), "status"); - g_object_notify (G_OBJECT (account), "status-message"); - } - - if (g_hash_table_lookup (properties, "Connection") != NULL) - { - const gchar *conn_path = - tp_asv_get_object_path (properties, "Connection"); - - _empathy_account_set_connection (account, conn_path); - } -} - -static void -empathy_account_properties_changed (TpAccount *proxy, - GHashTable *properties, - gpointer user_data, - GObject *weak_object) -{ - EmpathyAccount *account = EMPATHY_ACCOUNT (weak_object); - EmpathyAccountPriv *priv = GET_PRIV (account); - - if (!priv->ready) - return; - - empathy_account_update (account, properties); -} - -static void -empathy_account_removed_cb (TpAccount *proxy, - gpointer user_data, - GObject *weak_object) -{ - EmpathyAccount *account = EMPATHY_ACCOUNT (weak_object); - EmpathyAccountPriv *priv = GET_PRIV (account); - - if (priv->removed) - return; - - priv->removed = TRUE; - - g_signal_emit (account, signals[REMOVED], 0); -} - -static void -empathy_account_got_all_cb (TpProxy *proxy, - GHashTable *properties, - const GError *error, - gpointer user_data, - GObject *weak_object) -{ - EmpathyAccount *account = EMPATHY_ACCOUNT (weak_object); - - DEBUG ("Got whole set of properties for %s", - empathy_account_get_unique_name (account)); - - if (error != NULL) - { - DEBUG ("Failed to get the initial set of account properties: %s", - error->message); - return; - } - - empathy_account_update (account, properties); -} - -static gchar * -empathy_account_unescape_protocol (const gchar *protocol, gssize len) -{ - gchar *result, *escape; - /* Bad implementation might accidentally use tp_escape_as_identifier, - * which escapes - in the wrong way... */ - if ((escape = g_strstr_len (protocol, len, "_2d")) != NULL) - { - GString *str; - const gchar *input; - - str = g_string_new (""); - input = protocol; - do { - g_string_append_len (str, input, escape - input); - g_string_append_c (str, '-'); - - len -= escape - input + 3; - input = escape + 3; - } while ((escape = g_strstr_len (input, len, "_2d")) != NULL); - - g_string_append_len (str, input, len); - - result = g_string_free (str, FALSE); - } - else - { - result = g_strndup (protocol, len); - } - - g_strdelimit (result, "_", '-'); - - return result; -} - -static gboolean -empathy_account_parse_unique_name (const gchar *bus_name, - gchar **protocol, gchar **manager) -{ - const gchar *proto, *proto_end; - const gchar *cm, *cm_end; - - g_return_val_if_fail ( - g_str_has_prefix (bus_name, TP_ACCOUNT_OBJECT_PATH_BASE), FALSE); - - cm = bus_name + strlen (TP_ACCOUNT_OBJECT_PATH_BASE); - - for (cm_end = cm; *cm_end != '/' && *cm_end != '\0'; cm_end++) - /* pass */; - - if (*cm_end == '\0') - return FALSE; - - if (cm_end == '\0') - return FALSE; - - proto = cm_end + 1; - - for (proto_end = proto; *proto_end != '/' && *proto_end != '\0'; proto_end++) - /* pass */; - - if (*proto_end == '\0') - return FALSE; - - if (protocol != NULL) - { - *protocol = empathy_account_unescape_protocol (proto, proto_end - proto); - } - - if (manager != NULL) - *manager = g_strndup (cm, cm_end - cm); - - return TRUE; -} - -static void -account_invalidated_cb (TpProxy *proxy, guint domain, gint code, - gchar *message, gpointer user_data) -{ - EmpathyAccount *account = EMPATHY_ACCOUNT (user_data); - EmpathyAccountPriv *priv = GET_PRIV (account); - - if (priv->removed) - return; - - priv->removed = TRUE; - - g_signal_emit (account, signals[REMOVED], 0); -} - -static void -empathy_account_constructed (GObject *object) -{ - EmpathyAccount *account = EMPATHY_ACCOUNT (object); - EmpathyAccountPriv *priv = GET_PRIV (account); - - priv->account = tp_account_new (priv->dbus, priv->unique_name, NULL); - - g_signal_connect (priv->account, "invalidated", - G_CALLBACK (account_invalidated_cb), object); - - empathy_account_parse_unique_name (priv->unique_name, - &(priv->proto_name), &(priv->cm_name)); - - priv->icon_name = empathy_protocol_icon_name (priv->proto_name); - - tp_cli_account_connect_to_account_property_changed (priv->account, - empathy_account_properties_changed, - NULL, NULL, object, NULL); - - tp_cli_account_connect_to_removed (priv->account, - empathy_account_removed_cb, - NULL, NULL, object, NULL); - - empathy_account_refresh_properties (account); -} - -static void empathy_account_dispose (GObject *object); -static void empathy_account_finalize (GObject *object); - -static void -empathy_account_class_init (EmpathyAccountClass *empathy_account_class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (empathy_account_class); - - g_type_class_add_private (empathy_account_class, - sizeof (EmpathyAccountPriv)); - - object_class->set_property = empathy_account_set_property; - object_class->get_property = empathy_account_get_property; - object_class->dispose = empathy_account_dispose; - object_class->finalize = empathy_account_finalize; - object_class->constructed = empathy_account_constructed; - - g_object_class_install_property (object_class, PROP_ENABLED, - g_param_spec_boolean ("enabled", - "Enabled", - "Whether this account is enabled or not", - FALSE, - G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_READY, - g_param_spec_boolean ("ready", - "Ready", - "Whether this account is ready to be used", - FALSE, - G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); - - g_object_class_install_property (object_class, PROP_PRESENCE, - g_param_spec_uint ("presence", - "Presence", - "The account connections presence type", - 0, - NUM_TP_CONNECTION_PRESENCE_TYPES, - TP_CONNECTION_PRESENCE_TYPE_UNSET, - G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); - - g_object_class_install_property (object_class, PROP_STATUS, - g_param_spec_string ("status", - "Status", - "The Status string of the account", - NULL, - G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); - - g_object_class_install_property (object_class, PROP_STATUS_MESSAGE, - g_param_spec_string ("status-message", - "status-message", - "The Status message string of the account", - NULL, - G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); - - g_object_class_install_property (object_class, PROP_CONNECTION_STATUS, - g_param_spec_uint ("connection-status", - "ConnectionStatus", - "The accounts connections status type", - 0, - NUM_TP_CONNECTION_STATUSES, - TP_CONNECTION_STATUS_DISCONNECTED, - G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); - - g_object_class_install_property (object_class, PROP_CONNECTION_STATUS_REASON, - g_param_spec_uint ("connection-status-reason", - "ConnectionStatusReason", - "The account connections status reason", - 0, - NUM_TP_CONNECTION_STATUS_REASONS, - TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED, - G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); - - g_object_class_install_property (object_class, PROP_CONNECTION, - g_param_spec_object ("connection", - "Connection", - "The accounts connection", - TP_TYPE_CONNECTION, - G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); - - g_object_class_install_property (object_class, PROP_UNIQUE_NAME, - g_param_spec_string ("unique-name", - "UniqueName", - "The accounts unique name", - NULL, - G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - - g_object_class_install_property (object_class, PROP_DBUS_DAEMON, - g_param_spec_object ("dbus-daemon", - "dbus-daemon", - "The Tp Dbus daemon on which this account exists", - TP_TYPE_DBUS_DAEMON, - G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - - g_object_class_install_property (object_class, PROP_DISPLAY_NAME, - g_param_spec_string ("display-name", - "DisplayName", - "The accounts display name", - NULL, - G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); - - signals[STATUS_CHANGED] = g_signal_new ("status-changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - 0, NULL, NULL, - _empathy_marshal_VOID__UINT_UINT_UINT, - G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT); - - signals[PRESENCE_CHANGED] = g_signal_new ("presence-changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - 0, NULL, NULL, - _empathy_marshal_VOID__UINT_STRING_STRING, - G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING); - - signals[REMOVED] = g_signal_new ("removed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - 0, NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); -} - -static void -empathy_account_free_connection (EmpathyAccount *account) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - TpConnection *conn; - - if (priv->connection == NULL) - return; - - conn = priv->connection; - priv->connection = NULL; - - if (priv->connection_invalidated_id != 0) - g_signal_handler_disconnect (conn, priv->connection_invalidated_id); - priv->connection_invalidated_id = 0; - - g_object_unref (conn); -} - -void -empathy_account_dispose (GObject *object) -{ - EmpathyAccount *self = EMPATHY_ACCOUNT (object); - EmpathyAccountPriv *priv = GET_PRIV (self); - - if (priv->dispose_has_run) - return; - - priv->dispose_has_run = TRUE; - - empathy_account_free_connection (self); - - /* release any references held by the object here */ - if (G_OBJECT_CLASS (empathy_account_parent_class)->dispose != NULL) - G_OBJECT_CLASS (empathy_account_parent_class)->dispose (object); -} - -void -empathy_account_finalize (GObject *object) -{ - EmpathyAccountPriv *priv = GET_PRIV (object); - - g_free (priv->status); - g_free (priv->message); - - g_free (priv->cm_name); - g_free (priv->proto_name); - g_free (priv->icon_name); - g_free (priv->display_name); - - /* free any data held directly by the object here */ - if (G_OBJECT_CLASS (empathy_account_parent_class)->finalize != NULL) - G_OBJECT_CLASS (empathy_account_parent_class)->finalize (object); -} - -gboolean -empathy_account_is_just_connected (EmpathyAccount *account) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - GTimeVal val; - - if (priv->connection_status != TP_CONNECTION_STATUS_CONNECTED) - return FALSE; - - g_get_current_time (&val); - - return (val.tv_sec - priv->connect_time) < 10; -} - -/** - * empathy_account_get_connection: - * @account: a #EmpathyAccount - * - * Get the connection of the account, or NULL if account is offline or the - * connection is not yet ready. This function does not return a new ref. - * - * Returns: the connection of the account. - **/ -TpConnection * -empathy_account_get_connection (EmpathyAccount *account) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - - if (priv->connection != NULL && - tp_connection_is_ready (priv->connection)) - return priv->connection; - - return NULL; -} - -/** - * empathy_account_get_connection_for_path: - * @account: a #EmpathyAccount - * @patch: the path to connection object for #EmpathyAccount - * - * Get the connection of the account on path. This function does not return a - * new ref. It is not guaranteed that the returned connection object is ready - * - * Returns: the connection of the account. - **/ -TpConnection * -empathy_account_get_connection_for_path (EmpathyAccount *account, - const gchar *path) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - - /* double-check that the object path is valid */ - if (!tp_dbus_check_valid_object_path (path, NULL)) - return NULL; - - /* Should be a full object path, not the special "/" value */ - if (strlen (path) == 1) - return NULL; - - _empathy_account_set_connection (account, path); - - return priv->connection; -} - -/** - * empathy_account_get_unique_name: - * @account: a #EmpathyAccount - * - * Returns: the unique name of the account. - **/ -const gchar * -empathy_account_get_unique_name (EmpathyAccount *account) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - - return priv->unique_name; -} - -/** - * empathy_account_get_display_name: - * @account: a #EmpathyAccount - * - * Returns: the display name of the account. - **/ -const gchar * -empathy_account_get_display_name (EmpathyAccount *account) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - - return priv->display_name; -} - -gboolean -empathy_account_is_valid (EmpathyAccount *account) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - - return priv->valid; -} - -const gchar * -empathy_account_get_connection_manager (EmpathyAccount *account) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - - return priv->cm_name; -} - -const gchar * -empathy_account_get_protocol (EmpathyAccount *account) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - - return priv->proto_name; -} - -const gchar * -empathy_account_get_icon_name (EmpathyAccount *account) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - - return priv->icon_name; -} - -const GHashTable * -empathy_account_get_parameters (EmpathyAccount *account) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - - return priv->parameters; -} - -gboolean -empathy_account_is_enabled (EmpathyAccount *account) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - - return priv->enabled; -} - -gboolean -empathy_account_is_ready (EmpathyAccount *account) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - - return priv->ready; -} - - -EmpathyAccount * -empathy_account_new (TpDBusDaemon *dbus, - const gchar *unique_name) -{ - return EMPATHY_ACCOUNT (g_object_new (EMPATHY_TYPE_ACCOUNT, - "dbus-daemon", dbus, - "unique-name", unique_name, - NULL)); -} - -static void -empathy_account_connection_ready_cb (TpConnection *connection, - const GError *error, - gpointer user_data) -{ - EmpathyAccount *account = EMPATHY_ACCOUNT (user_data); - - if (error != NULL) - { - DEBUG ("(%s) Connection failed to become ready: %s", - empathy_account_get_unique_name (account), error->message); - empathy_account_free_connection (account); - } - else - { - DEBUG ("(%s) Connection ready", - empathy_account_get_unique_name (account)); - g_object_notify (G_OBJECT (account), "connection"); - } -} - -static void -_empathy_account_connection_invalidated_cb (TpProxy *self, - guint domain, - gint code, - gchar *message, - gpointer user_data) -{ - EmpathyAccount *account = EMPATHY_ACCOUNT (user_data); - EmpathyAccountPriv *priv = GET_PRIV (account); - - if (priv->connection == NULL) - return; - - DEBUG ("(%s) Connection invalidated", - empathy_account_get_unique_name (account)); - - g_assert (priv->connection == TP_CONNECTION (self)); - - empathy_account_free_connection (account); - - g_object_notify (G_OBJECT (account), "connection"); -} - -static void -_empathy_account_set_connection (EmpathyAccount *account, - const gchar *path) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - - if (priv->connection != NULL) - { - const gchar *current; - - current = tp_proxy_get_object_path (priv->connection); - if (!tp_strdiff (current, path)) - return; - } - - empathy_account_free_connection (account); - - if (tp_strdiff ("/", path)) - { - GError *error = NULL; - priv->connection = tp_connection_new (priv->dbus, NULL, path, &error); - - if (priv->connection == NULL) - { - DEBUG ("Failed to create a new TpConnection: %s", - error->message); - g_error_free (error); - } - else - { - priv->connection_invalidated_id = g_signal_connect (priv->connection, - "invalidated", - G_CALLBACK (_empathy_account_connection_invalidated_cb), account); - - DEBUG ("Readying connection for %s", priv->unique_name); - /* notify a change in the connection property when it's ready */ - tp_connection_call_when_ready (priv->connection, - empathy_account_connection_ready_cb, account); - } - } - - g_object_notify (G_OBJECT (account), "connection"); -} - -static void -account_enabled_set_cb (TpProxy *proxy, - const GError *error, - gpointer user_data, - GObject *weak_object) -{ - GSimpleAsyncResult *result = user_data; - - if (error != NULL) - g_simple_async_result_set_from_error (result, (GError *) error); - - g_simple_async_result_complete (result); - g_object_unref (result); -} - -gboolean -empathy_account_set_enabled_finish (EmpathyAccount *account, - GAsyncResult *result, - GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), - error) || - !g_simple_async_result_is_valid (result, G_OBJECT (account), - empathy_account_set_enabled_finish)) - return FALSE; - - return TRUE; -} - -void -empathy_account_set_enabled_async (EmpathyAccount *account, - gboolean enabled, - GAsyncReadyCallback callback, - gpointer user_data) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - EmpathyAccountManager *acc_manager; - GValue value = {0, }; - GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (account), - callback, user_data, empathy_account_set_enabled_finish); - char *status = NULL; - char *status_message = NULL; - TpConnectionPresenceType presence; - - if (priv->enabled == enabled) - { - g_simple_async_result_complete_in_idle (result); - return; - } - - if (enabled) - { - acc_manager = empathy_account_manager_dup_singleton (); - presence = empathy_account_manager_get_requested_global_presence - (acc_manager, &status, &status_message); - - if (presence != TP_CONNECTION_PRESENCE_TYPE_UNSET) - empathy_account_request_presence (account, presence, status, - status_message); - - g_object_unref (acc_manager); - g_free (status); - g_free (status_message); - } - - g_value_init (&value, G_TYPE_BOOLEAN); - g_value_set_boolean (&value, enabled); - - tp_cli_dbus_properties_call_set (TP_PROXY (priv->account), - -1, TP_IFACE_ACCOUNT, "Enabled", &value, - account_enabled_set_cb, result, NULL, G_OBJECT (account)); -} - -static void -account_reconnected_cb (TpAccount *proxy, - const GError *error, - gpointer user_data, - GObject *weak_object) -{ - GSimpleAsyncResult *result = user_data; - - if (error != NULL) - g_simple_async_result_set_from_error (result, (GError *) error); - - g_simple_async_result_complete (result); - g_object_unref (result); -} - -gboolean -empathy_account_reconnect_finish (EmpathyAccount *account, - GAsyncResult *result, - GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), - error) || - !g_simple_async_result_is_valid (result, G_OBJECT (account), - empathy_account_reconnect_finish)) - return FALSE; - - return TRUE; -} - -void -empathy_account_reconnect_async (EmpathyAccount *account, - GAsyncReadyCallback callback, - gpointer user_data) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - - GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (account), - callback, user_data, empathy_account_reconnect_finish); - - tp_cli_account_call_reconnect (priv->account, - -1, account_reconnected_cb, result, NULL, G_OBJECT (account)); -} - -static void -empathy_account_requested_presence_cb (TpProxy *proxy, - const GError *error, - gpointer user_data, - GObject *weak_object) -{ - if (error) - DEBUG ("Failed to set the requested presence: %s", error->message); -} - - -void -empathy_account_request_presence (EmpathyAccount *account, - TpConnectionPresenceType type, - const gchar *status, - const gchar *message) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - GValue value = {0, }; - GValueArray *arr; - - g_value_init (&value, TP_STRUCT_TYPE_SIMPLE_PRESENCE); - g_value_take_boxed (&value, dbus_g_type_specialized_construct - (TP_STRUCT_TYPE_SIMPLE_PRESENCE)); - arr = (GValueArray *) g_value_get_boxed (&value); - - g_value_set_uint (arr->values, type); - g_value_set_static_string (arr->values + 1, status); - g_value_set_static_string (arr->values + 2, message); - - tp_cli_dbus_properties_call_set (TP_PROXY (priv->account), - -1, - TP_IFACE_ACCOUNT, - "RequestedPresence", - &value, - empathy_account_requested_presence_cb, - NULL, - NULL, - G_OBJECT (account)); - - g_value_unset (&value); -} - -static void -empathy_account_updated_cb (TpAccount *proxy, - const gchar **reconnect_required, - const GError *error, - gpointer user_data, - GObject *weak_object) -{ - GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data); - - if (error != NULL) - { - g_simple_async_result_set_from_error (result, (GError *) error); - } - - g_simple_async_result_complete (result); - g_object_unref (G_OBJECT (result)); -} - -void -empathy_account_update_settings_async (EmpathyAccount *account, - GHashTable *parameters, const gchar **unset_parameters, - GAsyncReadyCallback callback, gpointer user_data) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (account), - callback, user_data, empathy_account_update_settings_finish); - - tp_cli_account_call_update_parameters (priv->account, - -1, - parameters, - unset_parameters, - empathy_account_updated_cb, - result, - NULL, - G_OBJECT (account)); -} - -gboolean -empathy_account_update_settings_finish (EmpathyAccount *account, - GAsyncResult *result, GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), - error)) - return FALSE; - - g_return_val_if_fail (g_simple_async_result_is_valid (result, - G_OBJECT (account), empathy_account_update_settings_finish), FALSE); - - return TRUE; -} - -static void -account_display_name_set_cb (TpProxy *proxy, - const GError *error, - gpointer user_data, - GObject *weak_object) -{ - GSimpleAsyncResult *result = user_data; - - if (error != NULL) - g_simple_async_result_set_from_error (result, (GError *) error); - - g_simple_async_result_complete (result); - g_object_unref (result); -} - -void -empathy_account_set_display_name_async (EmpathyAccount *account, - const char *display_name, - GAsyncReadyCallback callback, - gpointer user_data) -{ - GSimpleAsyncResult *result; - GValue value = {0, }; - EmpathyAccountPriv *priv = GET_PRIV (account); - - if (display_name == NULL) - { - g_simple_async_report_error_in_idle (G_OBJECT (account), - callback, user_data, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, - _("Can't set an empty display name")); - return; - } - - result = g_simple_async_result_new (G_OBJECT (account), callback, - user_data, empathy_account_set_display_name_finish); - - g_value_init (&value, G_TYPE_STRING); - g_value_set_string (&value, display_name); - - tp_cli_dbus_properties_call_set (priv->account, -1, TP_IFACE_ACCOUNT, - "DisplayName", &value, account_display_name_set_cb, result, NULL, - G_OBJECT (account)); -} - -gboolean -empathy_account_set_display_name_finish (EmpathyAccount *account, - GAsyncResult *result, GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), - error) || - !g_simple_async_result_is_valid (result, G_OBJECT (account), - empathy_account_set_display_name_finish)) - return FALSE; - - return TRUE; -} - -static void -account_icon_name_set_cb (TpProxy *proxy, - const GError *error, - gpointer user_data, - GObject *weak_object) -{ - GSimpleAsyncResult *result = user_data; - - if (error != NULL) - g_simple_async_result_set_from_error (result, (GError *) error); - - g_simple_async_result_complete (result); - g_object_unref (result); -} - -void -empathy_account_set_icon_name_async (EmpathyAccount *account, - const char *icon_name, - GAsyncReadyCallback callback, - gpointer user_data) -{ - GSimpleAsyncResult *result; - GValue value = {0, }; - EmpathyAccountPriv *priv = GET_PRIV (account); - const char *icon_name_set; - - if (icon_name == NULL) - /* settings an empty icon name is allowed */ - icon_name_set = ""; - else - icon_name_set = icon_name; - - result = g_simple_async_result_new (G_OBJECT (account), callback, - user_data, empathy_account_set_icon_name_finish); - - g_value_init (&value, G_TYPE_STRING); - g_value_set_string (&value, icon_name_set); - - tp_cli_dbus_properties_call_set (priv->account, -1, TP_IFACE_ACCOUNT, - "Icon", &value, account_icon_name_set_cb, result, NULL, - G_OBJECT (account)); -} - -gboolean -empathy_account_set_icon_name_finish (EmpathyAccount *account, - GAsyncResult *result, GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), - error) || - !g_simple_async_result_is_valid (result, G_OBJECT (account), - empathy_account_set_icon_name_finish)) - return FALSE; - - return TRUE; -} - -static void -empathy_account_remove_cb (TpAccount *proxy, - const GError *error, - gpointer user_data, - GObject *weak_object) -{ - GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data); - - if (error != NULL) - { - g_simple_async_result_set_from_error (result, (GError *) error); - } - - g_simple_async_result_complete (result); - g_object_unref (G_OBJECT (result)); -} - -void -empathy_account_remove_async (EmpathyAccount *account, - GAsyncReadyCallback callback, gpointer user_data) -{ - EmpathyAccountPriv *priv = GET_PRIV (account); - GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (account), - callback, user_data, empathy_account_remove_finish); - - tp_cli_account_call_remove (priv->account, - -1, - empathy_account_remove_cb, - result, - NULL, - G_OBJECT (account)); -} - -gboolean -empathy_account_remove_finish (EmpathyAccount *account, - GAsyncResult *result, GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), - error)) - return FALSE; - - g_return_val_if_fail (g_simple_async_result_is_valid (result, - G_OBJECT (account), empathy_account_update_settings_finish), FALSE); - - return TRUE; -} - -void -empathy_account_refresh_properties (EmpathyAccount *account) -{ - EmpathyAccountPriv *priv; - - g_return_if_fail (EMPATHY_IS_ACCOUNT (account)); - - priv = GET_PRIV (account); - - tp_cli_dbus_properties_call_get_all (priv->account, -1, - TP_IFACE_ACCOUNT, - empathy_account_got_all_cb, - NULL, - NULL, - G_OBJECT (account)); -} - diff --git a/libempathy/empathy-account.h b/libempathy/empathy-account.h deleted file mode 100644 index 66f899448..000000000 --- a/libempathy/empathy-account.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * empathy-account.h - Header for EmpathyAccount - * Copyright (C) 2009 Collabora Ltd. - * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __EMPATHY_ACCOUNT_H__ -#define __EMPATHY_ACCOUNT_H__ - -#include <glib-object.h> -#include <gio/gio.h> - -#include <telepathy-glib/connection.h> - -G_BEGIN_DECLS - -typedef struct _EmpathyAccount EmpathyAccount; -typedef struct _EmpathyAccountClass EmpathyAccountClass; - -struct _EmpathyAccountClass { - GObjectClass parent_class; -}; - -struct _EmpathyAccount { - GObject parent; - gpointer priv; -}; - -GType empathy_account_get_type (void); - -/* TYPE MACROS */ -#define EMPATHY_TYPE_ACCOUNT (empathy_account_get_type ()) -#define EMPATHY_ACCOUNT(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), EMPATHY_TYPE_ACCOUNT, EmpathyAccount)) -#define EMPATHY_ACCOUNT_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), EMPATHY_TYPE_ACCOUNT, EmpathyAccountClass)) -#define EMPATHY_IS_ACCOUNT(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), EMPATHY_TYPE_ACCOUNT)) -#define EMPATHY_IS_ACCOUNT_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), EMPATHY_TYPE_ACCOUNT)) -#define EMPATHY_ACCOUNT_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), EMPATHY_TYPE_ACCOUNT, \ - EmpathyAccountClass)) - -gboolean empathy_account_is_just_connected (EmpathyAccount *account); -TpConnection *empathy_account_get_connection (EmpathyAccount *account); -TpConnection *empathy_account_get_connection_for_path (EmpathyAccount *account, - const gchar *path); -const gchar *empathy_account_get_unique_name (EmpathyAccount *account); -const gchar *empathy_account_get_display_name (EmpathyAccount *account); - -const gchar *empathy_account_get_connection_manager (EmpathyAccount *account); -const gchar *empathy_account_get_protocol (EmpathyAccount *account); -const gchar *empathy_account_get_icon_name (EmpathyAccount *account); - -void empathy_account_set_enabled_async (EmpathyAccount *account, - gboolean enabled, GAsyncReadyCallback callback, gpointer user_data); -gboolean empathy_account_set_enabled_finish (EmpathyAccount *account, - GAsyncResult *result, GError **error); - -void empathy_account_reconnect_async (EmpathyAccount *account, - GAsyncReadyCallback callback, - gpointer user_data); -gboolean empathy_account_reconnect_finish (EmpathyAccount *account, - GAsyncResult *result, - GError **error); - -gboolean empathy_account_is_enabled (EmpathyAccount *account); - -gboolean empathy_account_is_valid (EmpathyAccount *account); -gboolean empathy_account_is_ready (EmpathyAccount *account); - -void empathy_account_update_settings_async (EmpathyAccount *account, - GHashTable *parameters, const gchar **unset_parameters, - GAsyncReadyCallback callback, gpointer user_data); - -gboolean empathy_account_update_settings_finish (EmpathyAccount *account, - GAsyncResult *result, GError **error); - -void empathy_account_remove_async (EmpathyAccount *account, - GAsyncReadyCallback callback, gpointer user_data); -gboolean empathy_account_remove_finish (EmpathyAccount *account, - GAsyncResult *result, GError **error); - -void empathy_account_set_display_name_async (EmpathyAccount *account, - const gchar *display_name, GAsyncReadyCallback callback, - gpointer user_data); -gboolean empathy_account_set_display_name_finish (EmpathyAccount *account, - GAsyncResult *result, GError **error); - -void empathy_account_set_icon_name_async (EmpathyAccount *account, - const gchar *icon_name, GAsyncReadyCallback callback, - gpointer user_data); -gboolean empathy_account_set_icon_name_finish (EmpathyAccount *account, - GAsyncResult *result, GError **error); - -EmpathyAccount *empathy_account_new (TpDBusDaemon *bus_daemon, - const gchar *unique_name); - -void empathy_account_request_presence (EmpathyAccount *account, - TpConnectionPresenceType type, const gchar *status, const gchar *message); - -const GHashTable *empathy_account_get_parameters (EmpathyAccount *account); - -void empathy_account_refresh_properties (EmpathyAccount *account); - - -G_END_DECLS - -#endif /* #ifndef __EMPATHY_ACCOUNT_H__*/ diff --git a/libempathy/empathy-chatroom-manager.c b/libempathy/empathy-chatroom-manager.c index b8c721bcb..56295fe5a 100644 --- a/libempathy/empathy-chatroom-manager.c +++ b/libempathy/empathy-chatroom-manager.c @@ -30,11 +30,11 @@ #include <libxml/parser.h> #include <libxml/tree.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/interfaces.h> #include "empathy-tp-chat.h" #include "empathy-chatroom-manager.h" -#include "empathy-account-manager.h" #include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER @@ -51,8 +51,8 @@ typedef struct { GList *chatrooms; gchar *file; - EmpathyAccountManager *account_manager; - gulong account_manager_ready_handler_id; + TpAccountManager *account_manager; + /* source id of the autosave timer */ gint save_timer_id; gboolean ready; @@ -105,7 +105,7 @@ chatroom_manager_file_save (EmpathyChatroomManager *manager) continue; } - account_id = empathy_account_get_unique_name ( + account_id = tp_proxy_get_object_path ( empathy_chatroom_get_account (chatroom)); node = xmlNewChild (root, NULL, (const xmlChar *) "chatroom", NULL); @@ -184,7 +184,7 @@ chatroom_manager_parse_chatroom (EmpathyChatroomManager *manager, { EmpathyChatroomManagerPriv *priv; EmpathyChatroom *chatroom; - EmpathyAccount *account; + TpAccount *account; xmlNodePtr child; gchar *str; gchar *name; @@ -230,7 +230,7 @@ chatroom_manager_parse_chatroom (EmpathyChatroomManager *manager, xmlFree (str); } - account = empathy_account_manager_get_account (priv->account_manager, + account = tp_account_manager_ensure_account (priv->account_manager, account_id); if (!account) { g_free (name); @@ -369,12 +369,6 @@ chatroom_manager_finalize (GObject *object) priv = GET_PRIV (object); - if (priv->account_manager_ready_handler_id > 0) - { - g_signal_handler_disconnect (priv->account_manager, - priv->account_manager_ready_handler_id); - } - g_object_unref (priv->account_manager); if (priv->save_timer_id > 0) @@ -402,18 +396,22 @@ chatroom_manager_finalize (GObject *object) } static void -account_manager_ready_cb (GObject *gobject, - GParamSpec *pspec, +account_manager_ready_cb (GObject *source_object, + GAsyncResult *result, gpointer user_data) { EmpathyChatroomManager *self = EMPATHY_CHATROOM_MANAGER (user_data); - EmpathyChatroomManagerPriv *priv = GET_PRIV (self); + TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object); + GError *error = NULL; - chatroom_manager_get_all (self); + if (!tp_account_manager_prepare_finish (manager, result, &error)) + { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } - g_signal_handler_disconnect (gobject, - priv->account_manager_ready_handler_id); - priv->account_manager_ready_handler_id = 0; + chatroom_manager_get_all (self); } static GObject * @@ -440,16 +438,10 @@ empathy_chatroom_manager_constructor (GType type, chatroom_manager_singleton = self; g_object_add_weak_pointer (obj, (gpointer) &chatroom_manager_singleton); - priv->account_manager = empathy_account_manager_dup_singleton (); + priv->account_manager = tp_account_manager_dup (); - priv->account_manager_ready_handler_id = 0; - - if (empathy_account_manager_is_ready (priv->account_manager)) - chatroom_manager_get_all (self); - else - priv->account_manager_ready_handler_id = g_signal_connect ( - G_OBJECT (priv->account_manager), "notify::ready", - G_CALLBACK (account_manager_ready_cb), self); + tp_account_manager_prepare_async (priv->account_manager, NULL, + account_manager_ready_cb, self); if (priv->file == NULL) { @@ -612,7 +604,7 @@ empathy_chatroom_manager_remove (EmpathyChatroomManager *manager, EmpathyChatroom * empathy_chatroom_manager_find (EmpathyChatroomManager *manager, - EmpathyAccount *account, + TpAccount *account, const gchar *room) { EmpathyChatroomManagerPriv *priv; @@ -625,7 +617,7 @@ empathy_chatroom_manager_find (EmpathyChatroomManager *manager, for (l = priv->chatrooms; l; l = l->next) { EmpathyChatroom *chatroom; - EmpathyAccount *this_account; + TpAccount *this_account; const gchar *this_room; chatroom = l->data; @@ -643,7 +635,7 @@ empathy_chatroom_manager_find (EmpathyChatroomManager *manager, GList * empathy_chatroom_manager_get_chatrooms (EmpathyChatroomManager *manager, - EmpathyAccount *account) + TpAccount *account) { EmpathyChatroomManagerPriv *priv; GList *chatrooms, *l; @@ -672,7 +664,7 @@ empathy_chatroom_manager_get_chatrooms (EmpathyChatroomManager *manager, guint empathy_chatroom_manager_get_count (EmpathyChatroomManager *manager, - EmpathyAccount *account) + TpAccount *account) { EmpathyChatroomManagerPriv *priv; GList *l; @@ -731,14 +723,13 @@ static void chatroom_manager_observe_channel_cb (EmpathyDispatcher *dispatcher, EmpathyDispatchOperation *operation, gpointer manager) { - EmpathyChatroomManagerPriv *priv = GET_PRIV (manager); EmpathyChatroom *chatroom; TpChannel *channel; EmpathyTpChat *chat; const gchar *roomname; GQuark channel_type; TpHandleType handle_type; - EmpathyAccount *account; + TpAccount *account; TpConnection *connection; channel_type = empathy_dispatch_operation_get_channel_type_id (operation); @@ -756,8 +747,7 @@ chatroom_manager_observe_channel_cb (EmpathyDispatcher *dispatcher, chat = EMPATHY_TP_CHAT ( empathy_dispatch_operation_get_channel_wrapper (operation)); connection = empathy_tp_chat_get_connection (chat); - account = empathy_account_manager_get_account_for_connection ( - priv->account_manager, connection); + account = empathy_get_account_for_connection (connection); roomname = empathy_tp_chat_get_id (chat); diff --git a/libempathy/empathy-chatroom-manager.h b/libempathy/empathy-chatroom-manager.h index a6038f7fc..8ee2a897a 100644 --- a/libempathy/empathy-chatroom-manager.h +++ b/libempathy/empathy-chatroom-manager.h @@ -27,7 +27,8 @@ #include <glib-object.h> -#include "empathy-account.h" +#include <telepathy-glib/account.h> + #include "empathy-chatroom.h" #include "empathy-dispatcher.h" @@ -59,12 +60,12 @@ gboolean empathy_chatroom_manager_add (EmpathyChatroomMa void empathy_chatroom_manager_remove (EmpathyChatroomManager *manager, EmpathyChatroom *chatroom); EmpathyChatroom * empathy_chatroom_manager_find (EmpathyChatroomManager *manager, - EmpathyAccount *account, - const gchar *room); + TpAccount *account, + const gchar *room); GList * empathy_chatroom_manager_get_chatrooms (EmpathyChatroomManager *manager, - EmpathyAccount *account); + TpAccount *account); guint empathy_chatroom_manager_get_count (EmpathyChatroomManager *manager, - EmpathyAccount *account); + TpAccount *account); void empathy_chatroom_manager_observe (EmpathyChatroomManager *manager, EmpathyDispatcher *dispatcher); diff --git a/libempathy/empathy-chatroom.c b/libempathy/empathy-chatroom.c index 33df9a3d6..5d43a3ec1 100644 --- a/libempathy/empathy-chatroom.c +++ b/libempathy/empathy-chatroom.c @@ -31,7 +31,7 @@ #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyChatroom) typedef struct { - EmpathyAccount *account; + TpAccount *account; gchar *room; gchar *name; gboolean auto_connect; @@ -84,7 +84,7 @@ empathy_chatroom_class_init (EmpathyChatroomClass *klass) g_param_spec_object ("account", "Chatroom Account", "The account associated with an chatroom", - EMPATHY_TYPE_ACCOUNT, + TP_TYPE_ACCOUNT, G_PARAM_READWRITE)); g_object_class_install_property (object_class, @@ -312,7 +312,7 @@ chatroom_set_property (GObject *object, } EmpathyChatroom * -empathy_chatroom_new (EmpathyAccount *account) +empathy_chatroom_new (TpAccount *account) { return g_object_new (EMPATHY_TYPE_CHATROOM, "account", account, @@ -320,7 +320,7 @@ empathy_chatroom_new (EmpathyAccount *account) } EmpathyChatroom * -empathy_chatroom_new_full (EmpathyAccount *account, +empathy_chatroom_new_full (TpAccount *account, const gchar *room, const gchar *name, gboolean auto_connect) @@ -335,7 +335,7 @@ empathy_chatroom_new_full (EmpathyAccount *account, NULL); } -EmpathyAccount * +TpAccount * empathy_chatroom_get_account (EmpathyChatroom *chatroom) { EmpathyChatroomPriv *priv; @@ -348,7 +348,7 @@ empathy_chatroom_get_account (EmpathyChatroom *chatroom) void empathy_chatroom_set_account (EmpathyChatroom *chatroom, - EmpathyAccount *account) + TpAccount *account) { EmpathyChatroomPriv *priv; @@ -466,8 +466,8 @@ gboolean empathy_chatroom_equal (gconstpointer v1, gconstpointer v2) { - EmpathyAccount *account_a; - EmpathyAccount *account_b; + TpAccount *account_a; + TpAccount *account_b; const gchar *room_a; const gchar *room_b; diff --git a/libempathy/empathy-chatroom.h b/libempathy/empathy-chatroom.h index c18c27449..3048aded7 100644 --- a/libempathy/empathy-chatroom.h +++ b/libempathy/empathy-chatroom.h @@ -24,7 +24,8 @@ #include <glib-object.h> -#include <libempathy/empathy-account.h> +#include <telepathy-glib/account.h> + #include <libempathy/empathy-tp-chat.h> G_BEGIN_DECLS @@ -51,14 +52,14 @@ struct _EmpathyChatroomClass { }; GType empathy_chatroom_get_type (void) G_GNUC_CONST; -EmpathyChatroom *empathy_chatroom_new (EmpathyAccount *account); -EmpathyChatroom *empathy_chatroom_new_full (EmpathyAccount *account, +EmpathyChatroom *empathy_chatroom_new (TpAccount *account); +EmpathyChatroom *empathy_chatroom_new_full (TpAccount *account, const gchar *room, const gchar *name, gboolean auto_connect); -EmpathyAccount * empathy_chatroom_get_account (EmpathyChatroom *chatroom); +TpAccount * empathy_chatroom_get_account (EmpathyChatroom *chatroom); void empathy_chatroom_set_account (EmpathyChatroom *chatroom, - EmpathyAccount *account); + TpAccount *account); const gchar * empathy_chatroom_get_room (EmpathyChatroom *chatroom); void empathy_chatroom_set_room (EmpathyChatroom *chatroom, const gchar *room); diff --git a/libempathy/empathy-contact-manager.c b/libempathy/empathy-contact-manager.c index 302fad3c5..53ccfbd63 100644 --- a/libempathy/empathy-contact-manager.c +++ b/libempathy/empathy-contact-manager.c @@ -23,10 +23,10 @@ #include <string.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/enums.h> #include "empathy-contact-manager.h" -#include "empathy-account-manager.h" #include "empathy-contact-monitor.h" #include "empathy-contact-list.h" #include "empathy-utils.h" @@ -37,7 +37,7 @@ #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyContactManager) typedef struct { GHashTable *lists; - EmpathyAccountManager *account_manager; + TpAccountManager *account_manager; EmpathyContactMonitor *contact_monitor; } EmpathyContactManagerPriv; @@ -132,14 +132,21 @@ contact_manager_disconnect_foreach (gpointer key, } static void -contact_manager_new_connection_cb (EmpathyAccountManager *account_manager, - TpConnection *connection, +contact_manager_status_changed_cb (TpAccount *account, + guint old_status, + guint new_status, + guint reason, + gchar *dbus_error_name, + GHashTable *details, EmpathyContactManager *self) { EmpathyContactManagerPriv *priv = GET_PRIV (self); EmpathyTpContactList *list; + TpConnection *connection; + + connection = tp_account_get_connection (account); - if (g_hash_table_lookup (priv->lists, connection)) { + if (connection == NULL || g_hash_table_lookup (priv->lists, connection)) { return; } @@ -174,9 +181,6 @@ contact_manager_finalize (GObject *object) object); g_hash_table_destroy (priv->lists); - g_signal_handlers_disconnect_by_func (priv->account_manager, - contact_manager_new_connection_cb, - object); g_object_unref (priv->account_manager); if (priv->contact_monitor) { @@ -233,9 +237,42 @@ empathy_contact_manager_class_init (EmpathyContactManagerClass *klass) } static void +account_manager_prepared_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + GList *accounts, *l; + EmpathyContactManager *manager = user_data; + TpAccountManager *account_manager = TP_ACCOUNT_MANAGER (source_object); + GError *error = NULL; + + if (!tp_account_manager_prepare_finish (account_manager, result, &error)) { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } + + accounts = tp_account_manager_get_valid_accounts (account_manager); + + for (l = accounts; l != NULL; l = l->next) { + TpAccount *account = l->data; + TpConnection *conn = tp_account_get_connection (account); + + if (conn != NULL) { + contact_manager_status_changed_cb (account, 0, 0, 0, + NULL, NULL, manager); + } + + empathy_signal_connect_weak (account, "status-changed", + G_CALLBACK (contact_manager_status_changed_cb), + G_OBJECT (manager)); + } + g_list_free (accounts); +} + +static void empathy_contact_manager_init (EmpathyContactManager *manager) { - GList *connections, *l; EmpathyContactManagerPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (manager, EMPATHY_TYPE_CONTACT_MANAGER, EmpathyContactManagerPriv); @@ -244,21 +281,11 @@ empathy_contact_manager_init (EmpathyContactManager *manager) empathy_proxy_equal, (GDestroyNotify) g_object_unref, (GDestroyNotify) g_object_unref); - priv->account_manager = empathy_account_manager_dup_singleton (); + priv->account_manager = tp_account_manager_dup (); priv->contact_monitor = NULL; - g_signal_connect (priv->account_manager, "new-connection", - G_CALLBACK (contact_manager_new_connection_cb), - manager); - - /* Get ContactList for existing connections */ - connections = empathy_account_manager_dup_connections (priv->account_manager); - for (l = connections; l; l = l->next) { - contact_manager_new_connection_cb (priv->account_manager, - l->data, manager); - g_object_unref (l->data); - } - g_list_free (connections); + tp_account_manager_prepare_async (priv->account_manager, NULL, + account_manager_prepared_cb, manager); } EmpathyContactManager * diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c index 83ffd0780..a440ef23b 100644 --- a/libempathy/empathy-contact.c +++ b/libempathy/empathy-contact.c @@ -25,10 +25,10 @@ #include <glib/gi18n-lib.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/util.h> #include "empathy-contact.h" -#include "empathy-account-manager.h" #include "empathy-utils.h" #include "empathy-enum-types.h" #include "empathy-marshal.h" @@ -39,7 +39,7 @@ #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyContact) typedef struct { TpContact *tp_contact; - EmpathyAccount *account; + TpAccount *account; gchar *id; gchar *name; EmpathyAvatar *avatar; @@ -159,7 +159,7 @@ empathy_contact_class_init (EmpathyContactClass *class) g_param_spec_object ("account", "The account", "The account associated with the contact", - EMPATHY_TYPE_ACCOUNT, + TP_TYPE_ACCOUNT, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, @@ -409,7 +409,7 @@ empathy_contact_new (TpContact *tp_contact) } EmpathyContact * -empathy_contact_new_for_log (EmpathyAccount *account, +empathy_contact_new_for_log (TpAccount *account, const gchar *id, const gchar *name, gboolean is_user) @@ -554,7 +554,7 @@ empathy_contact_set_avatar (EmpathyContact *contact, g_object_notify (G_OBJECT (contact), "avatar"); } -EmpathyAccount * +TpAccount * empathy_contact_get_account (EmpathyContact *contact) { EmpathyContactPriv *priv; @@ -565,16 +565,12 @@ empathy_contact_get_account (EmpathyContact *contact) if (priv->account == NULL && priv->tp_contact != NULL) { - EmpathyAccountManager *manager; TpConnection *connection; /* FIXME: This assume the account manager already exists */ - manager = empathy_account_manager_dup_singleton (); connection = tp_contact_get_connection (priv->tp_contact); - priv->account = empathy_account_manager_get_account_for_connection ( - manager, connection); - g_object_ref (priv->account); - g_object_unref (manager); + priv->account = + g_object_ref (empathy_get_account_for_connection (connection)); } return priv->account; @@ -855,7 +851,7 @@ static gchar * contact_get_avatar_filename (EmpathyContact *contact, const gchar *token) { - EmpathyAccount *account; + TpAccount *account; gchar *avatar_path; gchar *avatar_file; gchar *token_escaped; @@ -869,8 +865,8 @@ contact_get_avatar_filename (EmpathyContact *contact, avatar_path = g_build_filename (g_get_user_cache_dir (), "telepathy", "avatars", - empathy_account_get_connection_manager (account), - empathy_account_get_protocol (account), + tp_account_get_connection_manager (account), + tp_account_get_protocol (account), NULL); g_mkdir_with_parents (avatar_path, 0700); diff --git a/libempathy/empathy-contact.h b/libempathy/empathy-contact.h index 4e9c98756..d5525818b 100644 --- a/libempathy/empathy-contact.h +++ b/libempathy/empathy-contact.h @@ -25,7 +25,7 @@ #include <glib-object.h> #include <telepathy-glib/contact.h> -#include <libempathy/empathy-account.h> +#include <telepathy-glib/account.h> G_BEGIN_DECLS @@ -70,7 +70,7 @@ typedef enum { GType empathy_contact_get_type (void) G_GNUC_CONST; EmpathyContact * empathy_contact_new (TpContact *tp_contact); -EmpathyContact * empathy_contact_new_for_log (EmpathyAccount *account, +EmpathyContact * empathy_contact_new_for_log (TpAccount *account, const gchar *id, const gchar *name, gboolean is_user); TpContact * empathy_contact_get_tp_contact (EmpathyContact *contact); const gchar * empathy_contact_get_id (EmpathyContact *contact); @@ -80,7 +80,7 @@ void empathy_contact_set_name (EmpathyContact *contact, const gchar *name); EmpathyAvatar * empathy_contact_get_avatar (EmpathyContact *contact); void empathy_contact_set_avatar (EmpathyContact *contact, EmpathyAvatar *avatar); -EmpathyAccount * empathy_contact_get_account (EmpathyContact *contact); +TpAccount * empathy_contact_get_account (EmpathyContact *contact); TpConnection * empathy_contact_get_connection (EmpathyContact *contact); TpConnectionPresenceType empathy_contact_get_presence (EmpathyContact *contact); void empathy_contact_set_presence (EmpathyContact *contact, diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c index eb43bc10e..40045cdb1 100644 --- a/libempathy/empathy-dispatcher.c +++ b/libempathy/empathy-dispatcher.c @@ -28,6 +28,7 @@ #include <glib/gi18n-lib.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/enums.h> #include <telepathy-glib/connection.h> #include <telepathy-glib/util.h> @@ -45,7 +46,6 @@ #include "empathy-handler.h" #include "empathy-utils.h" #include "empathy-tube-handler.h" -#include "empathy-account-manager.h" #include "empathy-tp-contact-factory.h" #include "empathy-chatroom-manager.h" #include "empathy-utils.h" @@ -58,7 +58,7 @@ typedef struct { gboolean dispose_has_run; - EmpathyAccountManager *account_manager; + TpAccountManager *account_manager; /* connection to connection data mapping */ GHashTable *connections; GHashTable *outstanding_classes_requests; @@ -890,11 +890,18 @@ dispatcher_init_connection_if_needed (EmpathyDispatcher *self, } static void -dispatcher_new_connection_cb (EmpathyAccountManager *manager, - TpConnection *connection, +dispatcher_status_changed_cb (TpAccount *account, + guint old_status, + guint new_status, + guint reason, + gchar *dbus_error_name, + GHashTable *details, EmpathyDispatcher *self) { - dispatcher_init_connection_if_needed (self, connection); + TpConnection *conn = tp_account_get_connection (account); + + if (conn != NULL) + dispatcher_init_connection_if_needed (self, conn); } static void @@ -993,9 +1000,6 @@ dispatcher_finalize (GObject *object) g_hash_table_destroy (priv->request_channel_class_async_ids); } - g_signal_handlers_disconnect_by_func (priv->account_manager, - dispatcher_new_connection_cb, object); - for (l = priv->channels; l; l = l->next) { g_signal_handlers_disconnect_by_func (l->data, @@ -1111,18 +1115,46 @@ empathy_dispatcher_class_init (EmpathyDispatcherClass *klass) } static void +account_manager_prepared_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + GList *accounts, *l; + EmpathyDispatcher *self = user_data; + TpAccountManager *account_manager = TP_ACCOUNT_MANAGER (source_object); + GError *error = NULL; + + if (!tp_account_manager_prepare_finish (account_manager, result, &error)) + { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } + + accounts = tp_account_manager_get_valid_accounts (account_manager); + for (l = accounts; l; l = l->next) + { + TpAccount *a = l->data; + TpConnection *conn = tp_account_get_connection (a); + + if (conn != NULL) + dispatcher_status_changed_cb (a, 0, 0, 0, NULL, NULL, self); + + empathy_signal_connect_weak (a, "status-changed", + G_CALLBACK (dispatcher_status_changed_cb), + G_OBJECT (self)); + } + g_list_free (accounts); +} + +static void empathy_dispatcher_init (EmpathyDispatcher *self) { - GList *connections, *l; EmpathyDispatcherPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EMPATHY_TYPE_DISPATCHER, EmpathyDispatcherPriv); self->priv = priv; - priv->account_manager = empathy_account_manager_dup_singleton (); - - g_signal_connect (priv->account_manager, "new-connection", - G_CALLBACK (dispatcher_new_connection_cb), - self); + priv->account_manager = tp_account_manager_dup (); priv->connections = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, (GDestroyNotify) free_connection_data); @@ -1132,15 +1164,8 @@ empathy_dispatcher_init (EmpathyDispatcher *self) priv->channels = NULL; - connections = empathy_account_manager_dup_connections ( - priv->account_manager); - for (l = connections; l; l = l->next) - { - dispatcher_new_connection_cb (priv->account_manager, l->data, - self); - g_object_unref (l->data); - } - g_list_free (connections); + tp_account_manager_prepare_async (priv->account_manager, NULL, + account_manager_prepared_cb, self); priv->request_channel_class_async_ids = g_hash_table_new (g_direct_hash, g_direct_equal); @@ -1956,15 +1981,16 @@ empathy_dispatcher_handle_channels (EmpathyHandler *handler, EmpathyDispatcher *self = EMPATHY_DISPATCHER (user_data); EmpathyDispatcherPriv *priv = GET_PRIV (self); guint i; - EmpathyAccount *account; + TpAccount *account; TpConnection *connection; - account = empathy_account_manager_ensure_account (priv->account_manager, + /* FIXME: should probably find out whether the account manager is prepared + * before ensuring. See bug #600111. */ + account = tp_account_manager_ensure_account (priv->account_manager, account_path); g_assert (account != NULL); - connection = empathy_account_get_connection_for_path (account, - connection_path); + connection = tp_account_ensure_connection (account, connection_path); if (connection == NULL) { g_set_error_literal (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, diff --git a/libempathy/empathy-idle.c b/libempathy/empathy-idle.c index cc6ca62f4..8a0fcd88d 100644 --- a/libempathy/empathy-idle.c +++ b/libempathy/empathy-idle.c @@ -26,10 +26,10 @@ #include <glib/gi18n-lib.h> #include <dbus/dbus-glib.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/dbus.h> #include <telepathy-glib/util.h> -#include "empathy-account-manager.h" #include "empathy-idle.h" #include "empathy-utils.h" #include "empathy-connectivity.h" @@ -40,6 +40,10 @@ /* Number of seconds before entering extended autoaway. */ #define EXT_AWAY_TIME (30*60) +/* Number of seconds to consider an account in the "just connected" state + * for. */ +#define ACCOUNT_IS_JUST_CONNECTED_SECONDS 10 + #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyIdle) typedef struct { DBusGProxy *gs_proxy; @@ -58,7 +62,14 @@ typedef struct { gboolean is_idle; guint ext_away_timeout; - EmpathyAccountManager *manager; + TpAccountManager *manager; + + /* pointer to a TpAccount --> glong of time of connection */ + GHashTable *connect_times; + + TpConnectionPresenceType requested_presence_type; + gchar *requested_status_message; + } EmpathyIdlePriv; typedef enum { @@ -81,8 +92,20 @@ G_DEFINE_TYPE (EmpathyIdle, empathy_idle, G_TYPE_OBJECT); static EmpathyIdle * idle_singleton = NULL; +static const gchar *presence_type_to_status[NUM_TP_CONNECTION_PRESENCE_TYPES] = { + NULL, + "offline", + "available", + "away", + "xa", + "hidden", + "busy", + NULL, + NULL, +}; + static void -idle_presence_changed_cb (EmpathyAccountManager *manager, +idle_presence_changed_cb (TpAccountManager *manager, TpConnectionPresenceType state, gchar *status, gchar *status_message, @@ -279,6 +302,7 @@ idle_finalize (GObject *object) priv = GET_PRIV (object); g_free (priv->status); + g_free (priv->requested_status_message); if (priv->gs_proxy) { g_object_unref (priv->gs_proxy); @@ -290,6 +314,9 @@ idle_finalize (GObject *object) g_object_unref (priv->connectivity); + g_hash_table_destroy (priv->connect_times); + priv->connect_times = NULL; + idle_ext_away_stop (EMPATHY_IDLE (object)); } @@ -421,22 +448,60 @@ empathy_idle_class_init (EmpathyIdleClass *klass) } static void -account_manager_ready_cb (EmpathyAccountManager *account_manager, - GParamSpec *pspec, - EmpathyIdle *idle) +account_status_changed_cb (TpAccount *account, + guint old_status, + guint new_status, + guint reason, + gchar *dbus_error_name, + GHashTable *details, + gpointer user_data) { - EmpathyIdlePriv *priv; + EmpathyIdle *idle = EMPATHY_IDLE (user_data); + EmpathyIdlePriv *priv = GET_PRIV (idle); + GTimeVal val; + + if (new_status == TP_CONNECTION_STATUS_CONNECTED) { + g_get_current_time (&val); + g_hash_table_insert (priv->connect_times, account, + GINT_TO_POINTER (val.tv_sec)); + } else if (new_status == TP_CONNECTION_STATUS_DISCONNECTED) { + g_hash_table_remove (priv->connect_times, account); + } +} + +static void +account_manager_ready_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + EmpathyIdle *idle = EMPATHY_IDLE (user_data); + TpAccountManager *account_manager = TP_ACCOUNT_MANAGER (source_object); + EmpathyIdlePriv *priv = GET_PRIV (idle); TpConnectionPresenceType state; gchar *status, *status_message; + GList *accounts, *l; + GError *error = NULL; - priv = GET_PRIV (idle); + if (!tp_account_manager_prepare_finish (account_manager, result, &error)) { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } - state = empathy_account_manager_get_global_presence (priv->manager, + state = tp_account_manager_get_most_available_presence (priv->manager, &status, &status_message); idle_presence_changed_cb (account_manager, state, status, status_message, idle); + accounts = tp_account_manager_get_valid_accounts (priv->manager); + for (l = accounts; l != NULL; l = l->next) { + empathy_signal_connect_weak (l->data, "status-changed", + G_CALLBACK (account_status_changed_cb), + G_OBJECT (idle)); + } + g_list_free (accounts); + g_free (status); g_free (status_message); } @@ -450,18 +515,12 @@ empathy_idle_init (EmpathyIdle *idle) idle->priv = priv; priv->is_idle = FALSE; - priv->manager = empathy_account_manager_dup_singleton (); - - if (empathy_account_manager_is_ready (priv->manager)) { - priv->state = empathy_account_manager_get_global_presence (priv->manager, - NULL, &priv->status); - } else { - g_signal_connect (priv->manager, "notify::ready", - G_CALLBACK (account_manager_ready_cb), idle); - } + priv->manager = tp_account_manager_dup (); + tp_account_manager_prepare_async (priv->manager, NULL, + account_manager_ready_cb, idle); - g_signal_connect (priv->manager, "global-presence-changed", + g_signal_connect (priv->manager, "most-available-presence-changed", G_CALLBACK (idle_presence_changed_cb), idle); priv->gs_proxy = dbus_g_proxy_new_for_name (tp_get_bus (), @@ -481,6 +540,8 @@ empathy_idle_init (EmpathyIdle *idle) priv->connectivity = empathy_connectivity_dup_singleton (); priv->state_change_signal_id = g_signal_connect (priv->connectivity, "state-change", G_CALLBACK (idle_state_change_cb), idle); + + priv->connect_times = g_hash_table_new (g_direct_hash, g_direct_equal); } EmpathyIdle * @@ -567,26 +628,21 @@ empathy_idle_do_set_presence (EmpathyIdle *idle, const gchar *status_message) { EmpathyIdlePriv *priv = GET_PRIV (idle); - const gchar *statuses[NUM_TP_CONNECTION_PRESENCE_TYPES] = { - NULL, - "offline", - "available", - "away", - "xa", - "hidden", - "busy", - NULL, - NULL, - }; const gchar *status; g_assert (status_type > 0 && status_type < NUM_TP_CONNECTION_PRESENCE_TYPES); - status = statuses[status_type]; + status = presence_type_to_status[status_type]; g_return_if_fail (status != NULL); - empathy_account_manager_request_global_presence (priv->manager, + /* We possibly should be sure that the account manager is prepared, but + * sometimes this isn't possible, like when exiting. In other words, + * we need a callback to empathy_idle_set_presence to be sure the + * presence is set on all accounts successfully. + * However, in practice, this is fine as we've already prepared the + * account manager here in _init. */ + tp_account_manager_set_all_requested_presences (priv->manager, status_type, status, status_message); } @@ -602,6 +658,10 @@ empathy_idle_set_presence (EmpathyIdle *idle, DEBUG ("Changing presence to %s (%d)", status, state); + g_free (priv->requested_status_message); + priv->requested_presence_type = state; + priv->requested_status_message = g_strdup (status); + /* Do not set translated default messages */ default_status = empathy_presence_get_default_message (state); if (!tp_strdiff (status, default_status)) { @@ -645,3 +705,50 @@ empathy_idle_set_auto_away (EmpathyIdle *idle, g_object_notify (G_OBJECT (idle), "auto-away"); } +TpConnectionPresenceType +empathy_idle_get_requested_presence (EmpathyIdle *idle, + gchar **status, + gchar **status_message) +{ + EmpathyIdlePriv *priv = GET_PRIV (idle); + + if (status != NULL) { + *status = g_strdup (presence_type_to_status[priv->requested_presence_type]); + } + + if (status_message != NULL) { + *status_message = g_strdup (priv->requested_status_message); + } + + return priv->requested_presence_type; +} + +/* This function returns %TRUE if EmpathyIdle considers the account + * @account as having just connected recently. Otherwise, it returns + * %FALSE. In doubt, %FALSE is returned. */ +gboolean +empathy_idle_account_is_just_connected (EmpathyIdle *idle, + TpAccount *account) +{ + EmpathyIdlePriv *priv = GET_PRIV (idle); + GTimeVal val; + gpointer ptr; + glong t; + + if (tp_account_get_connection_status (account, NULL) + != TP_CONNECTION_STATUS_CONNECTED) { + return FALSE; + } + + ptr = g_hash_table_lookup (priv->connect_times, account); + + if (ptr == NULL) { + return FALSE; + } + + t = GPOINTER_TO_INT (ptr); + + g_get_current_time (&val); + + return (val.tv_sec - t) < ACCOUNT_IS_JUST_CONNECTED_SECONDS; +} diff --git a/libempathy/empathy-idle.h b/libempathy/empathy-idle.h index 47dcfee23..1a8c313bc 100644 --- a/libempathy/empathy-idle.h +++ b/libempathy/empathy-idle.h @@ -65,6 +65,13 @@ gboolean empathy_idle_get_auto_away (EmpathyIdle *idle); void empathy_idle_set_auto_away (EmpathyIdle *idle, gboolean auto_away); +TpConnectionPresenceType empathy_idle_get_requested_presence (EmpathyIdle *idle, + gchar **status, + gchar **status_message); + +gboolean empathy_idle_account_is_just_connected (EmpathyIdle *idle, + TpAccount *account); + G_END_DECLS #endif /* __EMPATHY_IDLE_H__ */ diff --git a/libempathy/empathy-log-manager.c b/libempathy/empathy-log-manager.c index 309b3b60f..5a57f0c74 100644 --- a/libempathy/empathy-log-manager.c +++ b/libempathy/empathy-log-manager.c @@ -158,7 +158,7 @@ empathy_log_manager_add_message (EmpathyLogManager *manager, gboolean empathy_log_manager_exists (EmpathyLogManager *manager, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom) { @@ -182,7 +182,7 @@ empathy_log_manager_exists (EmpathyLogManager *manager, GList * empathy_log_manager_get_dates (EmpathyLogManager *manager, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom) { @@ -218,7 +218,7 @@ empathy_log_manager_get_dates (EmpathyLogManager *manager, GList * empathy_log_manager_get_messages_for_date (EmpathyLogManager *manager, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom, const gchar *date) @@ -259,7 +259,7 @@ log_manager_message_date_cmp (gconstpointer a, GList * empathy_log_manager_get_filtered_messages (EmpathyLogManager *manager, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom, guint num_messages, @@ -319,7 +319,7 @@ empathy_log_manager_get_filtered_messages (EmpathyLogManager *manager, GList * empathy_log_manager_get_chats (EmpathyLogManager *manager, - EmpathyAccount *account) + TpAccount *account) { GList *l, *out = NULL; EmpathyLogManagerPriv *priv; diff --git a/libempathy/empathy-log-manager.h b/libempathy/empathy-log-manager.h index a67f6e8dd..25f1b5fcd 100644 --- a/libempathy/empathy-log-manager.h +++ b/libempathy/empathy-log-manager.h @@ -63,7 +63,7 @@ struct _EmpathyLogManagerClass struct _EmpathyLogSearchHit { - EmpathyAccount *account; + TpAccount *account; gchar *chat_id; gboolean is_chatroom; gchar *filename; @@ -79,17 +79,17 @@ gboolean empathy_log_manager_add_message (EmpathyLogManager *manager, const gchar *chat_id, gboolean chatroom, EmpathyMessage *message, GError **error); gboolean empathy_log_manager_exists (EmpathyLogManager *manager, - EmpathyAccount *account, const gchar *chat_id, gboolean chatroom); + TpAccount *account, const gchar *chat_id, gboolean chatroom); GList *empathy_log_manager_get_dates (EmpathyLogManager *manager, - EmpathyAccount *account, const gchar *chat_id, gboolean chatroom); + TpAccount *account, const gchar *chat_id, gboolean chatroom); GList *empathy_log_manager_get_messages_for_date (EmpathyLogManager *manager, - EmpathyAccount *account, const gchar *chat_id, gboolean chatroom, + TpAccount *account, const gchar *chat_id, gboolean chatroom, const gchar *date); GList *empathy_log_manager_get_filtered_messages (EmpathyLogManager *manager, - EmpathyAccount *account, const gchar *chat_id, gboolean chatroom, + TpAccount *account, const gchar *chat_id, gboolean chatroom, guint num_messages, EmpathyLogMessageFilter filter, gpointer user_data); GList *empathy_log_manager_get_chats (EmpathyLogManager *manager, - EmpathyAccount *account); + TpAccount *account); GList *empathy_log_manager_search_new (EmpathyLogManager *manager, const gchar *text); void empathy_log_manager_search_free (GList *hits); diff --git a/libempathy/empathy-log-store-empathy.c b/libempathy/empathy-log-store-empathy.c index 9771a9f28..8a25df7bc 100644 --- a/libempathy/empathy-log-store-empathy.c +++ b/libempathy/empathy-log-store-empathy.c @@ -29,13 +29,13 @@ #include <stdlib.h> #include <glib/gstdio.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/util.h> #include <telepathy-glib/defs.h> #include "empathy-log-store.h" #include "empathy-log-store-empathy.h" #include "empathy-log-manager.h" -#include "empathy-account-manager.h" #include "empathy-contact.h" #include "empathy-time.h" #include "empathy-utils.h" @@ -63,7 +63,7 @@ typedef struct { gchar *basedir; gchar *name; - EmpathyAccountManager *account_manager; + TpAccountManager *account_manager; } EmpathyLogStoreEmpathyPriv; static void log_store_iface_init (gpointer g_iface,gpointer iface_data); @@ -105,15 +105,15 @@ empathy_log_store_empathy_init (EmpathyLogStoreEmpathy *self) PACKAGE_NAME, "logs", NULL); priv->name = g_strdup ("Empathy"); - priv->account_manager = empathy_account_manager_dup_singleton (); + priv->account_manager = tp_account_manager_dup (); } static gchar * -log_store_account_to_dirname (EmpathyAccount *account) +log_store_account_to_dirname (TpAccount *account) { const gchar *name; - name = empathy_account_get_unique_name (account); + name = tp_proxy_get_object_path (account); if (g_str_has_prefix (name, TP_ACCOUNT_OBJECT_PATH_BASE)) name += strlen (TP_ACCOUNT_OBJECT_PATH_BASE); @@ -123,7 +123,7 @@ log_store_account_to_dirname (EmpathyAccount *account) static gchar * log_store_empathy_get_dir (EmpathyLogStore *self, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom) { @@ -176,7 +176,7 @@ log_store_empathy_get_timestamp_from_message (EmpathyMessage *message) static gchar * log_store_empathy_get_filename (EmpathyLogStore *self, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom) { @@ -202,7 +202,7 @@ log_store_empathy_add_message (EmpathyLogStore *self, GError **error) { FILE *file; - EmpathyAccount *account; + TpAccount *account; EmpathyContact *sender; const gchar *body_str; const gchar *str; @@ -289,7 +289,7 @@ log_store_empathy_add_message (EmpathyLogStore *self, static gboolean log_store_empathy_exists (EmpathyLogStore *self, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom) { @@ -305,7 +305,7 @@ log_store_empathy_exists (EmpathyLogStore *self, static GList * log_store_empathy_get_dates (EmpathyLogStore *self, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom) { @@ -357,7 +357,7 @@ log_store_empathy_get_dates (EmpathyLogStore *self, static gchar * log_store_empathy_get_filename_for_date (EmpathyLogStore *self, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom, const gchar *date) @@ -406,11 +406,13 @@ log_store_empathy_search_hit_new (EmpathyLogStore *self, else account_name = strv[len-3]; - accounts = empathy_account_manager_dup_accounts (priv->account_manager); + /* FIXME: This assumes the account manager is prepared, but the + * synchronous API forces this. See bug #599189. */ + accounts = tp_account_manager_get_valid_accounts (priv->account_manager); for (l = accounts; l != NULL; l = g_list_next (l)) { - EmpathyAccount *account = EMPATHY_ACCOUNT (l->data); + TpAccount *account = TP_ACCOUNT (l->data); gchar *name; name = log_store_account_to_dirname (account); @@ -434,7 +436,7 @@ log_store_empathy_search_hit_new (EmpathyLogStore *self, static GList * log_store_empathy_get_messages_for_file (EmpathyLogStore *self, - EmpathyAccount *account, + TpAccount *account, const gchar *filename) { GList *messages = NULL; @@ -703,7 +705,7 @@ log_store_empathy_get_chats_for_dir (EmpathyLogStore *self, static GList * log_store_empathy_get_messages_for_date (EmpathyLogStore *self, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom, const gchar *date) @@ -726,7 +728,7 @@ log_store_empathy_get_messages_for_date (EmpathyLogStore *self, static GList * log_store_empathy_get_chats (EmpathyLogStore *self, - EmpathyAccount *account) + TpAccount *account) { gchar *dir; GList *hits; @@ -753,7 +755,7 @@ log_store_empathy_get_name (EmpathyLogStore *self) static GList * log_store_empathy_get_filtered_messages (EmpathyLogStore *self, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom, guint num_messages, diff --git a/libempathy/empathy-log-store.c b/libempathy/empathy-log-store.c index f136f7910..512c4c09b 100644 --- a/libempathy/empathy-log-store.c +++ b/libempathy/empathy-log-store.c @@ -55,7 +55,7 @@ empathy_log_store_get_name (EmpathyLogStore *self) gboolean empathy_log_store_exists (EmpathyLogStore *self, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom) { @@ -84,7 +84,7 @@ empathy_log_store_add_message (EmpathyLogStore *self, GList * empathy_log_store_get_dates (EmpathyLogStore *self, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom) { @@ -97,7 +97,7 @@ empathy_log_store_get_dates (EmpathyLogStore *self, GList * empathy_log_store_get_messages_for_date (EmpathyLogStore *self, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom, const gchar *date) @@ -111,7 +111,7 @@ empathy_log_store_get_messages_for_date (EmpathyLogStore *self, GList * empathy_log_store_get_last_messages (EmpathyLogStore *self, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom) { @@ -124,7 +124,7 @@ empathy_log_store_get_last_messages (EmpathyLogStore *self, GList * empathy_log_store_get_chats (EmpathyLogStore *self, - EmpathyAccount *account) + TpAccount *account) { if (!EMPATHY_LOG_STORE_GET_INTERFACE (self)->get_chats) return NULL; @@ -157,7 +157,7 @@ empathy_log_store_ack_message (EmpathyLogStore *self, GList * empathy_log_store_get_filtered_messages (EmpathyLogStore *self, - EmpathyAccount *account, + TpAccount *account, const gchar *chat_id, gboolean chatroom, guint num_messages, diff --git a/libempathy/empathy-log-store.h b/libempathy/empathy-log-store.h index 5b6a87875..94bc87386 100644 --- a/libempathy/empathy-log-store.h +++ b/libempathy/empathy-log-store.h @@ -25,7 +25,7 @@ #include <glib-object.h> -#include <libempathy/empathy-account.h> +#include <telepathy-glib/account.h> #include "empathy-message.h" #include "empathy-log-manager.h" @@ -50,23 +50,23 @@ struct _EmpathyLogStoreInterface GTypeInterface parent; const gchar * (*get_name) (EmpathyLogStore *self); - gboolean (*exists) (EmpathyLogStore *self, EmpathyAccount *account, + gboolean (*exists) (EmpathyLogStore *self, TpAccount *account, const gchar *chat_id, gboolean chatroom); gboolean (*add_message) (EmpathyLogStore *self, const gchar *chat_id, gboolean chatroom, EmpathyMessage *message, GError **error); - GList * (*get_dates) (EmpathyLogStore *self, EmpathyAccount *account, + GList * (*get_dates) (EmpathyLogStore *self, TpAccount *account, const gchar *chat_id, gboolean chatroom); GList * (*get_messages_for_date) (EmpathyLogStore *self, - EmpathyAccount *account, const gchar *chat_id, gboolean chatroom, + TpAccount *account, const gchar *chat_id, gboolean chatroom, const gchar *date); - GList * (*get_last_messages) (EmpathyLogStore *self, EmpathyAccount *account, + GList * (*get_last_messages) (EmpathyLogStore *self, TpAccount *account, const gchar *chat_id, gboolean chatroom); GList * (*get_chats) (EmpathyLogStore *self, - EmpathyAccount *account); + TpAccount *account); GList * (*search_new) (EmpathyLogStore *self, const gchar *text); void (*ack_message) (EmpathyLogStore *self, const gchar *chat_id, gboolean chatroom, EmpathyMessage *message); - GList * (*get_filtered_messages) (EmpathyLogStore *self, EmpathyAccount *account, + GList * (*get_filtered_messages) (EmpathyLogStore *self, TpAccount *account, const gchar *chat_id, gboolean chatroom, guint num_messages, EmpathyLogMessageFilter filter, gpointer user_data); }; @@ -75,25 +75,25 @@ GType empathy_log_store_get_type (void) G_GNUC_CONST; const gchar *empathy_log_store_get_name (EmpathyLogStore *self); gboolean empathy_log_store_exists (EmpathyLogStore *self, - EmpathyAccount *account, const gchar *chat_id, gboolean chatroom); + TpAccount *account, const gchar *chat_id, gboolean chatroom); gboolean empathy_log_store_add_message (EmpathyLogStore *self, const gchar *chat_id, gboolean chatroom, EmpathyMessage *message, GError **error); GList *empathy_log_store_get_dates (EmpathyLogStore *self, - EmpathyAccount *account, const gchar *chat_id, gboolean chatroom); + TpAccount *account, const gchar *chat_id, gboolean chatroom); GList *empathy_log_store_get_messages_for_date (EmpathyLogStore *self, - EmpathyAccount *account, const gchar *chat_id, gboolean chatroom, + TpAccount *account, const gchar *chat_id, gboolean chatroom, const gchar *date); GList *empathy_log_store_get_last_messages (EmpathyLogStore *self, - EmpathyAccount *account, const gchar *chat_id, gboolean chatroom); + TpAccount *account, const gchar *chat_id, gboolean chatroom); GList *empathy_log_store_get_chats (EmpathyLogStore *self, - EmpathyAccount *account); + TpAccount *account); GList *empathy_log_store_search_new (EmpathyLogStore *self, const gchar *text); void empathy_log_store_ack_message (EmpathyLogStore *self, const gchar *chat_id, gboolean chatroom, EmpathyMessage *message); GList *empathy_log_store_get_filtered_messages (EmpathyLogStore *self, - EmpathyAccount *account, const gchar *chat_id, gboolean chatroom, + TpAccount *account, const gchar *chat_id, gboolean chatroom, guint num_messages, EmpathyLogMessageFilter filter, gpointer user_data); G_END_DECLS diff --git a/libempathy/empathy-tp-roomlist.c b/libempathy/empathy-tp-roomlist.c index 54d232339..2e95f3957 100644 --- a/libempathy/empathy-tp-roomlist.c +++ b/libempathy/empathy-tp-roomlist.c @@ -28,8 +28,6 @@ #include <telepathy-glib/util.h> #include <telepathy-glib/interfaces.h> -#include "empathy-account.h" - #include "empathy-tp-roomlist.h" #include "empathy-chatroom.h" #include "empathy-utils.h" @@ -41,7 +39,7 @@ typedef struct { TpConnection *connection; TpChannel *channel; - EmpathyAccount *account; + TpAccount *account; gboolean is_listing; gboolean start_requested; } EmpathyTpRoomlistPriv; @@ -354,7 +352,7 @@ tp_roomlist_constructed (GObject *list) { EmpathyTpRoomlistPriv *priv = GET_PRIV (list); - priv->connection = empathy_account_get_connection (priv->account); + priv->connection = tp_account_get_connection (priv->account); g_object_ref (priv->connection); tp_cli_connection_call_request_channel (priv->connection, -1, @@ -421,7 +419,7 @@ empathy_tp_roomlist_class_init (EmpathyTpRoomlistClass *klass) g_param_spec_object ("account", "The Account", "The account on which it lists rooms", - EMPATHY_TYPE_ACCOUNT, + TP_TYPE_ACCOUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, @@ -477,7 +475,7 @@ empathy_tp_roomlist_init (EmpathyTpRoomlist *list) } EmpathyTpRoomlist * -empathy_tp_roomlist_new (EmpathyAccount *account) +empathy_tp_roomlist_new (TpAccount *account) { EmpathyTpRoomlist *list; diff --git a/libempathy/empathy-tp-roomlist.h b/libempathy/empathy-tp-roomlist.h index 801e5c69f..f400766a9 100644 --- a/libempathy/empathy-tp-roomlist.h +++ b/libempathy/empathy-tp-roomlist.h @@ -24,8 +24,8 @@ #include <glib.h> +#include <telepathy-glib/account.h> #include <telepathy-glib/connection.h> -#include <libempathy/empathy-account.h> G_BEGIN_DECLS @@ -49,7 +49,7 @@ struct _EmpathyTpRoomlistClass { }; GType empathy_tp_roomlist_get_type (void) G_GNUC_CONST; -EmpathyTpRoomlist *empathy_tp_roomlist_new (EmpathyAccount *account); +EmpathyTpRoomlist *empathy_tp_roomlist_new (TpAccount *account); gboolean empathy_tp_roomlist_is_listing (EmpathyTpRoomlist *list); void empathy_tp_roomlist_start (EmpathyTpRoomlist *list); void empathy_tp_roomlist_stop (EmpathyTpRoomlist *list); diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c index a0cb4111e..21b0599c8 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Copyright (C) 2003-2007 Imendio AB * Copyright (C) 2007-2008 Collabora Ltd. @@ -32,6 +31,8 @@ #include <glib/gi18n-lib.h> #include <libxml/uri.h> + +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/connection.h> #include <telepathy-glib/channel.h> #include <telepathy-glib/dbus.h> @@ -490,3 +491,67 @@ empathy_signal_connect_weak (gpointer instance, g_object_weak_ref (instance_obj, instance_destroyed_cb, ctx); g_object_weak_ref (user_data, user_data_destroyed_cb, ctx); } + +/* Note: this function depends on the account manager having its core feature + * prepared. */ +TpAccount * +empathy_get_account_for_connection (TpConnection *connection) +{ + TpAccountManager *manager; + TpAccount *account = NULL; + GList *accounts, *l; + + manager = tp_account_manager_dup (); + + accounts = tp_account_manager_get_valid_accounts (manager); + + for (l = accounts; l != NULL; l = l->next) + { + TpAccount *a = l->data; + + if (tp_account_get_connection (a) == connection) + { + account = a; + break; + } + } + + g_list_free (accounts); + g_object_unref (manager); + + return account; +} + +gboolean +empathy_account_manager_get_accounts_connected (gboolean *connecting) +{ + TpAccountManager *manager; + GList *accounts, *l; + gboolean out_connecting = FALSE; + gboolean out_connected = FALSE; + + manager = tp_account_manager_dup (); + accounts = tp_account_manager_get_valid_accounts (manager); + + for (l = accounts; l != NULL; l = l->next) + { + TpConnectionStatus s = tp_account_get_connection_status ( + TP_ACCOUNT (l->data), NULL); + + if (s == TP_CONNECTION_STATUS_CONNECTING) + out_connecting = TRUE; + else if (s == TP_CONNECTION_STATUS_CONNECTED) + out_connected = TRUE; + + if (out_connecting && out_connected) + break; + } + + g_list_free (accounts); + g_object_unref (manager); + + if (connecting != NULL) + *connecting = out_connecting; + + return out_connected; +} diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h index d62e096ae..97e5e85b7 100644 --- a/libempathy/empathy-utils.h +++ b/libempathy/empathy-utils.h @@ -85,6 +85,10 @@ void empathy_signal_connect_weak (gpointer instance, GCallback c_handler, GObject *user_data); +TpAccount * empathy_get_account_for_connection (TpConnection *connection); + +gboolean empathy_account_manager_get_accounts_connected (gboolean *connecting); + G_END_DECLS #endif /* __EMPATHY_UTILS_H__ */ diff --git a/po/POTFILES.in b/po/POTFILES.in index fdb074483..6af70385d 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -4,7 +4,6 @@ data/empathy.desktop.in.in data/empathy.schemas.in -libempathy/empathy-account.c libempathy/empathy-ft-handler.c libempathy/empathy-tp-contact-list.c libempathy/empathy-tp-file.c diff --git a/rules/check.mak b/rules/check.mak deleted file mode 100644 index bbb9819f2..000000000 --- a/rules/check.mak +++ /dev/null @@ -1,120 +0,0 @@ -LOOPS = 10 -CLEANFILES += valgrind.*.log - -# run any given test by running make test.check -# if the test fails, run it again at at least debug level 2 -%.check: % - @$(TESTS_ENVIRONMENT) \ - $* || \ - $(TESTS_ENVIRONMENT) \ - $* - -# run any given test in a loop -%.torture: % - @for i in `seq 1 $(LOOPS)`; do \ - $(TESTS_ENVIRONMENT) \ - $*; done - -# run any given test in an infinite loop -%.forever: % - @while true; do \ - $(TESTS_ENVIRONMENT) \ - $* || break; done - -# valgrind any given test by running make test.valgrind -%.valgrind: % - $(TESTS_ENVIRONMENT) \ - CK_DEFAULT_TIMEOUT=360 \ - G_SLICE=always-malloc \ - G_DEBUG=gc-friendly \ - libtool --mode=execute \ - $(VALGRIND_PATH) -q \ - $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ - --tool=memcheck --leak-check=full --trace-children=yes \ - --leak-resolution=high --num-callers=20 \ - ./$* 2>&1 | tee "valgrind.$*.log" - @if grep "==" "valgrind.$*.log" > /dev/null 2>&1; then \ - exit 1; \ - fi - -# valgrind any given test and generate suppressions for it -%.valgrind.gen-suppressions: % - $(TESTS_ENVIRONMENT) \ - CK_DEFAULT_TIMEOUT=360 \ - G_SLICE=always-malloc \ - G_DEBUG=gc-friendly \ - libtool --mode=execute \ - $(VALGRIND_PATH) -q \ - $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ - --tool=memcheck --leak-check=full --trace-children=yes \ - --leak-resolution=high --num-callers=20 \ - --gen-suppressions=all \ - ./$* 2>&1 | tee suppressions.log - -# valgrind any given test until failure by running make test.valgrind-forever -%.valgrind-forever: % - @while $(MAKE) $*.valgrind; do \ - true; done - -# gdb any given test by running make test.gdb -%.gdb: % - $(TESTS_ENVIRONMENT) \ - CK_FORK=no \ - libtool --mode=execute \ - gdb $* - -# torture tests -torture: $(TESTS) - @echo "Torturing tests ..." - for i in `seq 1 $(LOOPS)`; do \ - $(MAKE) check || \ - (echo "Failure after $$i runs"; exit 1) || \ - exit 1; \ - done - @banner="All $(LOOPS) loops passed"; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo $$dashes; echo $$banner; echo $$dashes - -# forever tests -forever: $(TESTS) - @echo "Forever tests ..." - while true; do \ - $(MAKE) check || \ - (echo "Failure"; exit 1) || \ - exit 1; \ - done - -# valgrind all tests -valgrind: $(TESTS) - @echo "Valgrinding tests ..." - @failed=0; \ - for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \ - $(MAKE) $$t.valgrind; \ - if test "$$?" -ne 0; then \ - echo "Valgrind error for test $$t"; \ - failed=`expr $$failed + 1`; \ - whicht="$$whicht $$t"; \ - fi; \ - done; \ - if test "$$failed" -ne 0; then \ - echo "$$failed tests had leaks or errors under valgrind:"; \ - echo "$$whicht"; \ - false; \ - fi - -help: - @echo "make check -- run all checks" - @echo "make torture -- run all checks $(LOOPS) times" - @echo "make (dir)/(test).check -- run the given check once" - @echo "make (dir)/(test).forever -- run the given check forever" - @echo "make (dir)/(test).torture -- run the given check $(LOOPS) times" - @echo - @echo "make (dir)/(test).gdb -- start up gdb for the given test" - @echo - @echo "make valgrind -- valgrind all tests" - @echo "make (dir)/(test).valgrind -- valgrind the given test" - @echo "make (dir)/(test).valgrind-forever -- valgrind the given test forever" - @echo "make (dir)/(test).valgrind.gen-suppressions -- generate suppressions" - @echo " and save to suppressions.log" - @echo "make inspect -- inspect all plugin features" - diff --git a/src/empathy-account-assistant.c b/src/empathy-account-assistant.c index d9834f38b..08cf025d3 100644 --- a/src/empathy-account-assistant.c +++ b/src/empathy-account-assistant.c @@ -225,7 +225,7 @@ account_assistant_account_enabled_cb (GObject *source, EmpathyAccountAssistant *self = user_data; EmpathyAccountAssistantPriv *priv = GET_PRIV (self); - empathy_account_set_enabled_finish (EMPATHY_ACCOUNT (source), + tp_account_set_enabled_finish (TP_ACCOUNT (source), result, &error); if (error) @@ -249,7 +249,7 @@ account_assistant_apply_account_cb (GObject *source, EmpathyAccountAssistant *self = user_data; EmpathyAccountAssistantPriv *priv = GET_PRIV (self); EmpathyAccountSettings *settings = EMPATHY_ACCOUNT_SETTINGS (source); - EmpathyAccount *account; + TpAccount *account; empathy_account_settings_apply_finish (settings, result, &error); @@ -265,7 +265,7 @@ account_assistant_apply_account_cb (GObject *source, /* enable the newly created account */ account = empathy_account_settings_get_account (settings); - empathy_account_set_enabled_async (account, TRUE, + tp_account_set_enabled_async (account, TRUE, account_assistant_account_enabled_cb, self); } diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index e877e632f..2a09e277b 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -32,10 +32,10 @@ #include <glib/gi18n.h> #include <dbus/dbus-glib.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/util.h> #include <libempathy/empathy-utils.h> -#include <libempathy/empathy-account-manager.h> #include <libempathy/empathy-connection-managers.h> #include <libempathy-gtk/empathy-ui-utils.h> @@ -107,11 +107,11 @@ typedef struct { gulong settings_ready_id; EmpathyAccountSettings *settings_ready; - EmpathyAccountManager *account_manager; + TpAccountManager *account_manager; EmpathyConnectionManagers *cms; GtkWindow *parent_window; - EmpathyAccount *initial_selection; + TpAccount *initial_selection; /* Those are needed when changing the selected row. When a user selects * another account and there are unsaved changes on the currently selected @@ -146,9 +146,6 @@ static gboolean accounts_dialog_get_settings_iter ( static void accounts_dialog_model_select_first (EmpathyAccountsDialog *dialog); -static void accounts_dialog_update (EmpathyAccountsDialog *dialog, - EmpathyAccountSettings *settings); - static void accounts_dialog_update_settings (EmpathyAccountsDialog *dialog, EmpathyAccountSettings *settings); @@ -175,7 +172,7 @@ empathy_account_dialog_widget_cancelled_cb ( GtkTreeSelection *selection; GtkTreeIter iter; EmpathyAccountSettings *settings; - EmpathyAccount *account; + TpAccount *account; EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); view = GTK_TREE_VIEW (priv->treeview); @@ -354,7 +351,7 @@ accounts_dialog_model_select_first (EmpathyAccountsDialog *dialog) static gboolean accounts_dialog_has_pending_change (EmpathyAccountsDialog *dialog, - EmpathyAccount **account) + TpAccount **account) { GtkTreeIter iter; GtkTreeModel *model; @@ -502,13 +499,13 @@ static void accounts_dialog_button_add_clicked_cb (GtkWidget *button, EmpathyAccountsDialog *dialog) { - EmpathyAccount *account = NULL; + TpAccount *account = NULL; if (accounts_dialog_has_pending_change (dialog, &account)) { gchar *question_dialog_primary_text = g_strdup_printf ( PENDING_CHANGES_QUESTION_PRIMARY_TEXT, - empathy_account_get_display_name (account)); + tp_account_get_display_name (account)); accounts_dialog_show_question_dialog (dialog, question_dialog_primary_text, @@ -545,14 +542,19 @@ accounts_dialog_update_settings (EmpathyAccountsDialog *dialog, { GtkTreeView *view; GtkTreeModel *model; + GtkTreeSelection *selection; view = GTK_TREE_VIEW (priv->treeview); model = gtk_tree_view_get_model (view); + selection = gtk_tree_view_get_selection (view); if (gtk_tree_model_iter_n_children (model, NULL) > 0) { - /* We have configured accounts, select the first one */ - accounts_dialog_model_select_first (dialog); + /* We have configured accounts, select the first one if there + * is no other account selected already. */ + if (!gtk_tree_selection_get_selected (selection, NULL, NULL)) + accounts_dialog_model_select_first (dialog); + return; } if (empathy_connection_managers_get_cms_num (priv->cms) > 0) @@ -708,9 +710,11 @@ accounts_dialog_name_edited_cb (GtkCellRendererText *renderer, GtkTreePath *treepath; GtkTreeIter iter; EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); + gboolean connecting; + + empathy_account_manager_get_accounts_connected (&connecting); - if (empathy_account_manager_get_connecting_accounts - (priv->account_manager) > 0) + if (connecting) { priv->connecting_id = g_timeout_add (FLASH_TIMEOUT, (GSourceFunc) accounts_dialog_flash_connecting_cb, @@ -739,7 +743,7 @@ accounts_dialog_delete_account_response_cb (GtkDialog *message_dialog, gint response_id, gpointer user_data) { - EmpathyAccount *account; + TpAccount *account; GtkTreeModel *model; GtkTreeIter iter; GtkTreeSelection *selection; @@ -757,7 +761,7 @@ accounts_dialog_delete_account_response_cb (GtkDialog *message_dialog, if (account != NULL) { - empathy_account_remove_async (account, NULL, NULL); + tp_account_remove_async (account, NULL, NULL); g_object_unref (account); account = NULL; } @@ -774,7 +778,7 @@ accounts_dialog_view_delete_activated_cb (EmpathyCellRendererActivatable *cell, const gchar *path_string, EmpathyAccountsDialog *dialog) { - EmpathyAccount *account; + TpAccount *account; GtkTreeModel *model; GtkTreeIter iter; gchar *question_dialog_primary_text; @@ -787,7 +791,7 @@ accounts_dialog_view_delete_activated_cb (EmpathyCellRendererActivatable *cell, gtk_tree_model_get (model, &iter, COL_ACCOUNT_POINTER, &account, -1); - if (account == NULL || !empathy_account_is_valid (account)) + if (account == NULL || !tp_account_is_valid (account)) { gtk_list_store_remove (GTK_LIST_STORE (model), &iter); accounts_dialog_model_select_first (dialog); @@ -802,7 +806,7 @@ accounts_dialog_view_delete_activated_cb (EmpathyCellRendererActivatable *cell, /* Translators: this is used only when built on a moblin platform */ _("Do you want to remove %s from your computer?"), #endif /* HAVE_MOBLIN */ - empathy_account_get_display_name (account)); + tp_account_get_display_name (account)); accounts_dialog_show_question_dialog (dialog, question_dialog_primary_text, #ifndef HAVE_MOBLIN @@ -977,7 +981,7 @@ accounts_dialog_account_selection_change (GtkTreeSelection *selection, gboolean path_currently_selected, gpointer data) { - EmpathyAccount *account = NULL; + TpAccount *account = NULL; EmpathyAccountsDialog *dialog = EMPATHY_ACCOUNTS_DIALOG (data); EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); @@ -1000,7 +1004,7 @@ accounts_dialog_account_selection_change (GtkTreeSelection *selection, question_dialog_primary_text = g_strdup_printf ( PENDING_CHANGES_QUESTION_PRIMARY_TEXT, - empathy_account_get_display_name (account)); + tp_account_get_display_name (account)); accounts_dialog_show_question_dialog (dialog, question_dialog_primary_text, @@ -1031,7 +1035,7 @@ accounts_dialog_model_setup (EmpathyAccountsDialog *dialog) store = gtk_list_store_new (COL_COUNT, G_TYPE_STRING, /* name */ G_TYPE_UINT, /* status */ - EMPATHY_TYPE_ACCOUNT, /* account */ + TP_TYPE_ACCOUNT, /* account */ EMPATHY_TYPE_ACCOUNT_SETTINGS); /* settings */ gtk_tree_view_set_model (GTK_TREE_VIEW (priv->treeview), @@ -1093,7 +1097,7 @@ accounts_dialog_get_settings_iter (EmpathyAccountsDialog *dialog, static gboolean accounts_dialog_get_account_iter (EmpathyAccountsDialog *dialog, - EmpathyAccount *account, + TpAccount *account, GtkTreeIter *iter) { GtkTreeView *view; @@ -1162,11 +1166,12 @@ accounts_dialog_add (EmpathyAccountsDialog *dialog, } static void -accounts_dialog_connection_changed_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, - TpConnectionStatusReason reason, - TpConnectionStatus current, - TpConnectionStatus previous, +accounts_dialog_connection_changed_cb (TpAccount *account, + guint old_status, + guint current, + guint reason, + gchar *dbus_error_name, + GHashTable *details, EmpathyAccountsDialog *dialog) { GtkTreeModel *model; @@ -1190,7 +1195,7 @@ accounts_dialog_connection_changed_cb (EmpathyAccountManager *manager, gtk_tree_path_free (path); } - found = (empathy_account_manager_get_connecting_accounts (manager) > 0); + empathy_account_manager_get_accounts_connected (&found); if (!found && priv->connecting_id) { @@ -1205,7 +1210,7 @@ accounts_dialog_connection_changed_cb (EmpathyAccountManager *manager, } static void -accounts_dialog_account_display_name_changed_cb (EmpathyAccount *account, +accounts_dialog_account_display_name_changed_cb (TpAccount *account, GParamSpec *pspec, gpointer user_data) { @@ -1213,11 +1218,11 @@ accounts_dialog_account_display_name_changed_cb (EmpathyAccount *account, GtkTreeIter iter; GtkTreeModel *model; EmpathyAccountSettings *settings; - EmpathyAccount *selected_account; + TpAccount *selected_account; EmpathyAccountsDialog *dialog = EMPATHY_ACCOUNTS_DIALOG (user_data); EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); - display_name = empathy_account_get_display_name (account); + display_name = tp_account_get_display_name (account); model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview)); settings = accounts_dialog_model_get_selected_settings (dialog); if (settings == NULL) @@ -1240,7 +1245,7 @@ accounts_dialog_account_display_name_changed_cb (EmpathyAccount *account, static void accounts_dialog_add_account (EmpathyAccountsDialog *dialog, - EmpathyAccount *account) + TpAccount *account) { EmpathyAccountSettings *settings; GtkTreeModel *model; @@ -1251,9 +1256,9 @@ accounts_dialog_add_account (EmpathyAccountsDialog *dialog, EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview)); - g_object_get (account, "connection-status", &status, NULL); - name = empathy_account_get_display_name (account); - enabled = empathy_account_is_enabled (account); + status = tp_account_get_connection_status (account, NULL); + name = tp_account_get_display_name (account); + enabled = tp_account_is_enabled (account); settings = empathy_account_settings_new_for_account (account); @@ -1267,11 +1272,12 @@ accounts_dialog_add_account (EmpathyAccountsDialog *dialog, COL_ACCOUNT_SETTINGS_POINTER, settings, -1); - accounts_dialog_connection_changed_cb (priv->account_manager, - account, - TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED, + accounts_dialog_connection_changed_cb (account, + 0, status, TP_CONNECTION_STATUS_DISCONNECTED, + NULL, + NULL, dialog); empathy_signal_connect_weak (account, "notify::display-name", @@ -1282,48 +1288,17 @@ accounts_dialog_add_account (EmpathyAccountsDialog *dialog, } static void -accounts_dialog_update (EmpathyAccountsDialog *dialog, - EmpathyAccountSettings *settings) -{ - GtkTreeModel *model; - GtkTreeIter iter; - TpConnectionStatus status = TP_CONNECTION_STATUS_DISCONNECTED; - const gchar *name; - gboolean enabled = FALSE; - EmpathyAccount *account; - EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); - - model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview)); - name = empathy_account_settings_get_display_name (settings); - - account = empathy_account_settings_get_account (settings); - if (account != NULL) - { - enabled = empathy_account_is_enabled (account); - g_object_get (account, "connection-status", &status, NULL); - } - - accounts_dialog_get_settings_iter (dialog, settings, &iter); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - COL_NAME, name, - COL_STATUS, status, - COL_ACCOUNT_POINTER, account, - COL_ACCOUNT_SETTINGS_POINTER, settings, - -1); -} - -static void -accounts_dialog_account_added_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, +accounts_dialog_account_validity_changed_cb (TpAccountManager *manager, + TpAccount *account, + gboolean valid, EmpathyAccountsDialog *dialog) { accounts_dialog_add_account (dialog, account); } - static void -accounts_dialog_account_removed_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, +accounts_dialog_account_removed_cb (TpAccountManager *manager, + TpAccount *account, EmpathyAccountsDialog *dialog) { GtkTreeIter iter; @@ -1338,7 +1313,7 @@ accounts_dialog_account_removed_cb (EmpathyAccountManager *manager, static void enable_or_disable_account (EmpathyAccountsDialog *dialog, - EmpathyAccount *account, + TpAccount *account, gboolean enabled) { GtkTreeModel *model; @@ -1348,60 +1323,27 @@ enable_or_disable_account (EmpathyAccountsDialog *dialog, model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview)); DEBUG ("Account %s is now %s", - empathy_account_get_display_name (account), + tp_account_get_display_name (account), enabled ? "enabled" : "disabled"); } static void -accounts_dialog_account_disabled_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, +accounts_dialog_account_disabled_cb (TpAccountManager *manager, + TpAccount *account, EmpathyAccountsDialog *dialog) { enable_or_disable_account (dialog, account, FALSE); } static void -accounts_dialog_account_enabled_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, +accounts_dialog_account_enabled_cb (TpAccountManager *manager, + TpAccount *account, EmpathyAccountsDialog *dialog) { enable_or_disable_account (dialog, account, TRUE); } static void -accounts_dialog_account_changed_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, - EmpathyAccountsDialog *dialog) -{ - EmpathyAccountSettings *settings, *selected_settings; - GtkTreeModel *model; - GtkTreeIter iter; - EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); - - model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview)); - - if (!accounts_dialog_get_account_iter (dialog, account, &iter)) - return; - - gtk_tree_model_get (model, &iter, - COL_ACCOUNT_SETTINGS_POINTER, &settings, - -1); - - accounts_dialog_update (dialog, settings); - selected_settings = accounts_dialog_model_get_selected_settings (dialog); - - if (settings == selected_settings) - accounts_dialog_update_name_label (dialog, - empathy_account_settings_get_display_name (settings)); - - if (settings) - g_object_unref (settings); - - if (selected_settings) - g_object_unref (selected_settings); -} - -static void accounts_dialog_button_create_clicked_cb (GtkWidget *button, EmpathyAccountsDialog *dialog) { @@ -1504,14 +1446,14 @@ accounts_dialog_response_cb (GtkWidget *widget, gint response, EmpathyAccountsDialog *dialog) { - EmpathyAccount *account = NULL; + TpAccount *account = NULL; if (accounts_dialog_has_pending_change (dialog, &account)) { gchar *question_dialog_primary_text; question_dialog_primary_text = g_strdup_printf ( PENDING_CHANGES_QUESTION_PRIMARY_TEXT, - empathy_account_get_display_name (account)); + tp_account_get_display_name (account)); accounts_dialog_show_question_dialog (dialog, question_dialog_primary_text, @@ -1549,7 +1491,7 @@ accounts_dialog_destroy_cb (GtkObject *obj, static void accounts_dialog_set_selected_account (EmpathyAccountsDialog *dialog, - EmpathyAccount *account) + TpAccount *account) { GtkTreeSelection *selection; GtkTreeIter iter; @@ -1587,10 +1529,10 @@ accounts_dialog_accounts_setup (EmpathyAccountsDialog *dialog) EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); GList *accounts, *l; - g_signal_connect (priv->account_manager, "account-created", - G_CALLBACK (accounts_dialog_account_added_cb), + g_signal_connect (priv->account_manager, "account-validity-changed", + G_CALLBACK (accounts_dialog_account_validity_changed_cb), dialog); - g_signal_connect (priv->account_manager, "account-deleted", + g_signal_connect (priv->account_manager, "account-removed", G_CALLBACK (accounts_dialog_account_removed_cb), dialog); g_signal_connect (priv->account_manager, "account-enabled", @@ -1599,19 +1541,15 @@ accounts_dialog_accounts_setup (EmpathyAccountsDialog *dialog) g_signal_connect (priv->account_manager, "account-disabled", G_CALLBACK (accounts_dialog_account_disabled_cb), dialog); - g_signal_connect (priv->account_manager, "account-changed", - G_CALLBACK (accounts_dialog_account_changed_cb), - dialog); - g_signal_connect (priv->account_manager, "account-connection-changed", - G_CALLBACK (accounts_dialog_connection_changed_cb), - dialog); /* Add existing accounts */ - accounts = empathy_account_manager_dup_accounts (priv->account_manager); + accounts = tp_account_manager_get_valid_accounts (priv->account_manager); for (l = accounts; l; l = l->next) { accounts_dialog_add_account (dialog, l->data); - g_object_unref (l->data); + + empathy_signal_connect_weak (l->data, "status-changed", + G_CALLBACK (accounts_dialog_connection_changed_cb), G_OBJECT (dialog)); } g_list_free (accounts); @@ -1624,12 +1562,19 @@ accounts_dialog_accounts_setup (EmpathyAccountsDialog *dialog) } static void -accounts_dialog_manager_ready_cb (EmpathyAccountManager *manager, - GParamSpec *pspec, +accounts_dialog_manager_ready_cb (GObject *source_object, + GAsyncResult *result, gpointer user_data) { - if (!empathy_account_manager_is_ready (manager)) - return; + TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object); + GError *error = NULL; + + if (!tp_account_manager_prepare_finish (manager, result, &error)) + { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } accounts_dialog_accounts_setup (user_data); } @@ -1709,7 +1654,7 @@ do_dispose (GObject *obj) /* Disconnect signals */ g_signal_handlers_disconnect_by_func (priv->account_manager, - accounts_dialog_account_added_cb, + accounts_dialog_account_validity_changed_cb, dialog); g_signal_handlers_disconnect_by_func (priv->account_manager, accounts_dialog_account_removed_cb, @@ -1721,12 +1666,6 @@ do_dispose (GObject *obj) accounts_dialog_account_disabled_cb, dialog); g_signal_handlers_disconnect_by_func (priv->account_manager, - accounts_dialog_account_changed_cb, - dialog); - g_signal_handlers_disconnect_by_func (priv->account_manager, - accounts_dialog_connection_changed_cb, - dialog); - g_signal_handlers_disconnect_by_func (priv->account_manager, accounts_dialog_manager_ready_cb, dialog); @@ -1827,13 +1766,10 @@ do_constructed (GObject *object) accounts_dialog_model_setup (dialog); /* Set up signalling */ - priv->account_manager = empathy_account_manager_dup_singleton (); + priv->account_manager = tp_account_manager_dup (); - if (!empathy_account_manager_is_ready (priv->account_manager)) - g_signal_connect (priv->account_manager, "notify::ready", - G_CALLBACK (accounts_dialog_manager_ready_cb), dialog); - else - accounts_dialog_accounts_setup (dialog); + tp_account_manager_prepare_async (priv->account_manager, NULL, + accounts_dialog_manager_ready_cb, dialog); empathy_conf_get_bool (empathy_conf_get (), EMPATHY_PREFS_IMPORT_ASKED, &import_asked); @@ -1891,7 +1827,7 @@ empathy_accounts_dialog_init (EmpathyAccountsDialog *dialog) GtkWidget * empathy_accounts_dialog_show (GtkWindow *parent, - EmpathyAccount *selected_account) + TpAccount *selected_account) { EmpathyAccountsDialog *dialog; EmpathyAccountsDialogPriv *priv; diff --git a/src/empathy-accounts-dialog.h b/src/empathy-accounts-dialog.h index aa8f7c06b..2d9d60c2b 100644 --- a/src/empathy-accounts-dialog.h +++ b/src/empathy-accounts-dialog.h @@ -26,7 +26,7 @@ #include <gtk/gtk.h> -#include <libempathy/empathy-account.h> +#include <telepathy-glib/account.h> G_BEGIN_DECLS @@ -55,7 +55,7 @@ typedef struct { GType empathy_accounts_dialog_get_type (void); GtkWidget *empathy_accounts_dialog_show (GtkWindow *parent, - EmpathyAccount *selected_account); + TpAccount *selected_account); G_END_DECLS diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 7b81d7a43..69469815e 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -35,13 +35,13 @@ #include <glib/gi18n.h> #include <libnotify/notification.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/util.h> #include <libempathy/empathy-contact.h> #include <libempathy/empathy-message.h> #include <libempathy/empathy-dispatcher.h> #include <libempathy/empathy-chatroom-manager.h> -#include <libempathy/empathy-account-manager.h> #include <libempathy/empathy-utils.h> #include <libempathy-gtk/empathy-images.h> @@ -434,7 +434,7 @@ chat_window_update_chat_tab (EmpathyChat *chat) EmpathyContact *remote_contact; const gchar *name; const gchar *id; - EmpathyAccount *account; + TpAccount *account; const gchar *subject; const gchar *status = NULL; GtkWidget *widget; @@ -457,7 +457,7 @@ chat_window_update_chat_tab (EmpathyChat *chat) remote_contact = empathy_chat_get_remote_contact (chat); DEBUG ("Updating chat tab, name=%s, account=%s, subject=%s, remote_contact=%p", - name, empathy_account_get_unique_name (account), subject, remote_contact); + name, tp_proxy_get_object_path (account), subject, remote_contact); /* Update tab image */ if (empathy_chat_get_tp_chat (chat) == NULL) { @@ -501,7 +501,7 @@ chat_window_update_chat_tab (EmpathyChat *chat) append_markup_printf (tooltip, "<b>%s</b><small> (%s)</small>", id, - empathy_account_get_display_name (account)); + tp_account_get_display_name (account)); if (!EMP_STR_EMPTY (status)) { append_markup_printf (tooltip, "\n<i>%s</i>", status); @@ -596,7 +596,7 @@ chat_window_conv_activate_cb (GtkAction *action, is_room = empathy_chat_is_room (priv->current_chat); if (is_room) { const gchar *room; - EmpathyAccount *account; + TpAccount *account; gboolean found = FALSE; EmpathyChatroom *chatroom; @@ -645,7 +645,7 @@ chat_window_favorite_toggled_cb (GtkToggleAction *toggle_action, { EmpathyChatWindowPriv *priv = GET_PRIV (window); gboolean active; - EmpathyAccount *account; + TpAccount *account; const gchar *room; EmpathyChatroom *chatroom; @@ -1346,15 +1346,18 @@ chat_window_drag_data_received (GtkWidget *widget, if (info == DND_DRAG_TYPE_CONTACT_ID) { EmpathyChat *chat = NULL; EmpathyChatWindow *old_window; - EmpathyAccount *account = NULL; - EmpathyAccountManager *account_manager; + TpAccount *account = NULL; + TpAccountManager *account_manager; const gchar *id; gchar **strv; const gchar *account_id; const gchar *contact_id; id = (const gchar*) gtk_selection_data_get_data (selection); - account_manager = empathy_account_manager_dup_singleton (); + + /* FIXME: Perhaps should be sure that the account manager is + * prepared before calling _ensure_account on it. */ + account_manager = tp_account_manager_dup (); DEBUG ("DND contact from roster with id:'%s'", id); @@ -1363,7 +1366,7 @@ chat_window_drag_data_received (GtkWidget *widget, account_id = strv[0]; contact_id = strv[1]; account = - empathy_account_manager_get_account (account_manager, account_id); + tp_account_manager_ensure_account (account_manager, account_id); if (account != NULL) chat = empathy_chat_window_find_chat (account, contact_id); } @@ -1377,7 +1380,7 @@ chat_window_drag_data_received (GtkWidget *widget, if (!chat) { TpConnection *connection; - connection = empathy_account_get_connection (account); + connection = tp_account_get_connection (account); if (connection) { empathy_dispatcher_chat_with_contact_id ( @@ -1855,7 +1858,7 @@ empathy_chat_window_has_focus (EmpathyChatWindow *window) } EmpathyChat * -empathy_chat_window_find_chat (EmpathyAccount *account, +empathy_chat_window_find_chat (TpAccount *account, const gchar *id) { GList *l; diff --git a/src/empathy-chat-window.h b/src/empathy-chat-window.h index 6f3d21fca..1e4a001e5 100644 --- a/src/empathy-chat-window.h +++ b/src/empathy-chat-window.h @@ -31,7 +31,8 @@ #include <glib-object.h> #include <gtk/gtk.h> -#include <libempathy/empathy-account.h> +#include <telepathy-glib/account.h> + #include <libempathy-gtk/empathy-chat.h> G_BEGIN_DECLS @@ -69,7 +70,7 @@ void empathy_chat_window_move_chat (EmpathyChatWindow *old_wi void empathy_chat_window_switch_to_chat (EmpathyChatWindow *window, EmpathyChat *chat); gboolean empathy_chat_window_has_focus (EmpathyChatWindow *window); -EmpathyChat * empathy_chat_window_find_chat (EmpathyAccount *account, +EmpathyChat * empathy_chat_window_find_chat (TpAccount *account, const gchar *id); void empathy_chat_window_present_chat (EmpathyChat *chat); diff --git a/src/empathy-chatrooms-window.c b/src/empathy-chatrooms-window.c index 4ec71ec49..278a1d686 100644 --- a/src/empathy-chatrooms-window.c +++ b/src/empathy-chatrooms-window.c @@ -308,7 +308,7 @@ chatrooms_window_model_refresh_data (EmpathyChatroomsWindow *window, GtkTreeIter iter; GtkTreeViewColumn *column; EmpathyAccountChooser *account_chooser; - EmpathyAccount *account; + TpAccount *account; GList *chatrooms, *l; view = GTK_TREE_VIEW (window->treeview); @@ -506,7 +506,7 @@ chatrooms_window_chatroom_added_cb (EmpathyChatroomManager *manager, EmpathyChatroomsWindow *window) { EmpathyAccountChooser *account_chooser; - EmpathyAccount *account; + TpAccount *account; account_chooser = EMPATHY_ACCOUNT_CHOOSER (window->account_chooser); account = empathy_account_chooser_dup_account (account_chooser); diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c index c68458d69..c10802011 100644 --- a/src/empathy-event-manager.c +++ b/src/empathy-event-manager.c @@ -24,11 +24,12 @@ #include <string.h> #include <glib/gi18n.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/util.h> #include <telepathy-glib/interfaces.h> -#include <libempathy/empathy-account-manager.h> #include <libempathy/empathy-dispatcher.h> +#include <libempathy/empathy-idle.h> #include <libempathy/empathy-tp-contact-factory.h> #include <libempathy/empathy-contact-manager.h> #include <libempathy/empathy-tp-chat.h> @@ -337,14 +338,14 @@ event_channel_process_voip_func (EventPriv *event) button = gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Reject"), GTK_RESPONSE_REJECT); - image = gtk_image_new_from_icon_name (GTK_STOCK_CANCEL, + image = gtk_image_new_from_icon_name ("call-stop", GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (button), image); button = gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Answer"), GTK_RESPONSE_ACCEPT); - image = gtk_image_new_from_icon_name (GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON); + image = gtk_image_new_from_icon_name ("call-start", GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (button), image); g_signal_connect (dialog, "response", @@ -918,13 +919,16 @@ event_manager_presence_changed_cb (EmpathyContactMonitor *monitor, TpConnectionPresenceType previous, EmpathyEventManager *manager) { - EmpathyAccount *account; + TpAccount *account; gchar *header = NULL; gboolean preference = FALSE; + EmpathyIdle *idle; account = empathy_contact_get_account (contact); - if (empathy_account_is_just_connected (account)) - return; + idle = empathy_idle_dup_singleton (); + + if (empathy_idle_account_is_just_connected (idle, account)) + goto out; if (tp_connection_presence_type_cmp_availability (previous, TP_CONNECTION_PRESENCE_TYPE_OFFLINE) > 0) @@ -960,6 +964,9 @@ event_manager_presence_changed_cb (EmpathyContactMonitor *monitor, } } g_free (header); + +out: + g_object_unref (idle); } diff --git a/src/empathy-import-mc4-accounts.c b/src/empathy-import-mc4-accounts.c index 0a72c4929..b4bca6fdb 100644 --- a/src/empathy-import-mc4-accounts.c +++ b/src/empathy-import-mc4-accounts.c @@ -24,11 +24,11 @@ #include <glib.h> #include <glib/gi18n.h> #include <gconf/gconf-client.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/util.h> #include <telepathy-glib/defs.h> #include <dbus/dbus-protocol.h> #include <gnome-keyring.h> -#include <libempathy/empathy-account-manager.h> #include <libempathy/empathy-account-settings.h> #include <libempathy/empathy-connection-managers.h> @@ -189,12 +189,12 @@ _move_contents (const gchar *old, const gchar *new) } static void -_move_logs (EmpathyAccount *account, const gchar *account_name) +_move_logs (TpAccount *account, const gchar *account_name) { gchar *old_path, *new_path, *escaped; const gchar *name; - name = empathy_account_get_unique_name (account); + name = tp_proxy_get_object_path (account); if (g_str_has_prefix (name, TP_ACCOUNT_OBJECT_PATH_BASE)) name += strlen (TP_ACCOUNT_OBJECT_PATH_BASE); @@ -215,7 +215,7 @@ _create_account_cb (GObject *source, GAsyncResult *result, gpointer user_data) { - EmpathyAccount *account; + TpAccount *account; GError *error = NULL; Misc *misc = (Misc *) user_data; @@ -233,7 +233,7 @@ _create_account_cb (GObject *source, _move_logs (account, misc->account_name); - empathy_account_set_enabled_async (account, + tp_account_set_enabled_async (account, misc->enable, NULL, NULL); g_free (misc->account_name); diff --git a/src/empathy-import-widget.c b/src/empathy-import-widget.c index 2dc810b0a..5a0d82c8c 100644 --- a/src/empathy-import-widget.c +++ b/src/empathy-import-widget.c @@ -28,13 +28,12 @@ #define DEBUG_FLAG EMPATHY_DEBUG_OTHER #include <libempathy/empathy-debug.h> -#include <libempathy/empathy-account.h> -#include <libempathy/empathy-account-manager.h> #include <libempathy/empathy-connection-managers.h> #include <libempathy/empathy-utils.h> #include <libempathy-gtk/empathy-ui-utils.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/util.h> #include <glib/gi18n.h> @@ -77,24 +76,12 @@ import_widget_account_id_in_list (GList *accounts, for (l = accounts; l; l = l->next) { - EmpathyAccount *account = l->data; - const gchar *account_string; - GValue *value; - gboolean result; + TpAccount *account = l->data; const GHashTable *parameters; - parameters = empathy_account_get_parameters (account); - - value = g_hash_table_lookup ((GHashTable *) parameters, "account"); - - if (value == NULL) - continue; - - account_string = g_value_get_string (value); - - result = tp_strdiff (account_string, account_id); + parameters = tp_account_get_parameters (account); - if (!result) + if (!tp_strdiff (tp_asv_get_string (parameters, "account"), account_id)) return TRUE; } @@ -102,13 +89,24 @@ import_widget_account_id_in_list (GList *accounts, } static void -import_widget_add_accounts_to_model (EmpathyImportWidget *self) +account_manager_prepared_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { + TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object); + EmpathyImportWidget *self = user_data; GtkTreeModel *model; GtkTreeIter iter; GList *l; EmpathyImportWidgetPriv *priv = GET_PRIV (self); - EmpathyAccountManager *manager = empathy_account_manager_dup_singleton (); + GError *error = NULL; + + if (!tp_account_manager_prepare_finish (manager, result, &error)) + { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview)); @@ -128,14 +126,13 @@ import_widget_add_accounts_to_model (EmpathyImportWidget *self) value = g_hash_table_lookup (data->settings, "account"); - accounts = empathy_account_manager_dup_accounts (manager); + accounts = tp_account_manager_get_valid_accounts (manager); /* Only set the "Import" cell to be active if there isn't already an * account set up with the same account id. */ import = !import_widget_account_id_in_list (accounts, g_value_get_string (value)); - g_list_foreach (accounts, (GFunc) g_object_unref, NULL); g_list_free (accounts); gtk_list_store_append (GTK_LIST_STORE (model), &iter); @@ -148,6 +145,17 @@ import_widget_add_accounts_to_model (EmpathyImportWidget *self) COL_ACCOUNT_DATA, data, -1); } +} + +static void +import_widget_add_accounts_to_model (EmpathyImportWidget *self) +{ + TpAccountManager *manager; + + manager = tp_account_manager_dup (); + + tp_account_manager_prepare_async (manager, NULL, + account_manager_prepared_cb, self); g_object_unref (manager); } @@ -157,12 +165,12 @@ import_widget_create_account_cb (GObject *source, GAsyncResult *result, gpointer user_data) { - EmpathyAccount *account; + TpAccount *account; GError *error = NULL; EmpathyImportWidget *self = user_data; - account = empathy_account_manager_create_account_finish ( - EMPATHY_ACCOUNT_MANAGER (source), result, &error); + account = tp_account_manager_create_account_finish ( + TP_ACCOUNT_MANAGER (source), result, &error); if (account == NULL) { @@ -181,12 +189,12 @@ static void import_widget_add_account (EmpathyImportWidget *self, EmpathyImportAccountData *data) { - EmpathyAccountManager *account_manager; + TpAccountManager *account_manager; gchar *display_name; GHashTable *properties; GValue *username; - account_manager = empathy_account_manager_dup_singleton (); + account_manager = tp_account_manager_dup (); DEBUG ("connection_manager: %s\n", data->connection_manager); @@ -200,7 +208,7 @@ import_widget_add_account (EmpathyImportWidget *self, properties = g_hash_table_new (NULL, NULL); - empathy_account_manager_create_account_async (account_manager, + tp_account_manager_create_account_async (account_manager, (const gchar*) data->connection_manager, data->protocol, display_name, data->settings, properties, import_widget_create_account_cb, g_object_ref (self)); diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c index 83daac08d..a2f9dde13 100644 --- a/src/empathy-main-window.c +++ b/src/empathy-main-window.c @@ -27,9 +27,11 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> +#include <telepathy-glib/account-manager.h> + #include <libempathy/empathy-contact.h> +#include <libempathy/empathy-idle.h> #include <libempathy/empathy-utils.h> -#include <libempathy/empathy-account-manager.h> #include <libempathy/empathy-dispatcher.h> #include <libempathy/empathy-chatroom-manager.h> #include <libempathy/empathy-chatroom.h> @@ -79,7 +81,7 @@ typedef struct { EmpathyContactListView *list_view; EmpathyContactListStore *list_store; - EmpathyAccountManager *account_manager; + TpAccountManager *account_manager; EmpathyChatroomManager *chatroom_manager; EmpathyEventManager *event_manager; guint flash_timeout_id; @@ -305,7 +307,7 @@ static void main_window_error_edit_clicked_cb (GtkButton *button, EmpathyMainWindow *window) { - EmpathyAccount *account; + TpAccount *account; GtkWidget *error_widget; account = g_object_get_data (G_OBJECT (button), "account"); @@ -320,7 +322,7 @@ static void main_window_error_clear_clicked_cb (GtkButton *button, EmpathyMainWindow *window) { - EmpathyAccount *account; + TpAccount *account; GtkWidget *error_widget; account = g_object_get_data (G_OBJECT (button), "account"); @@ -331,7 +333,7 @@ main_window_error_clear_clicked_cb (GtkButton *button, static void main_window_error_display (EmpathyMainWindow *window, - EmpathyAccount *account, + TpAccount *account, const gchar *message) { GtkWidget *child; @@ -352,7 +354,7 @@ main_window_error_display (EmpathyMainWindow *window, /* Just set the latest error and return */ str = g_markup_printf_escaped ("<b>%s</b>\n%s", - empathy_account_get_display_name (account), + tp_account_get_display_name (account), message); gtk_label_set_markup (GTK_LABEL (label), str); g_free (str); @@ -433,7 +435,7 @@ main_window_error_display (EmpathyMainWindow *window, gtk_misc_set_alignment (GTK_MISC (label), 0, 0); str = g_markup_printf_escaped ("<b>%s</b>\n%s", - empathy_account_get_display_name (account), + tp_account_get_display_name (account), message); gtk_label_set_markup (GTK_LABEL (label), str); g_free (str); @@ -460,18 +462,15 @@ main_window_error_display (EmpathyMainWindow *window, } static void -main_window_update_status (EmpathyMainWindow *window, EmpathyAccountManager *manager) +main_window_update_status (EmpathyMainWindow *window) { - int connected; - int connecting; + gboolean connected, connecting; GList *l; - /* Count number of connected/connecting/disconnected accounts */ - connected = empathy_account_manager_get_connected_accounts (manager); - connecting = empathy_account_manager_get_connecting_accounts (manager); + connected = empathy_account_manager_get_accounts_connected (&connecting); /* Update the spinner state */ - if (connecting > 0) { + if (connecting) { ephy_spinner_start (EPHY_SPINNER (window->throbber)); } else { ephy_spinner_stop (EPHY_SPINNER (window->throbber)); @@ -479,19 +478,20 @@ main_window_update_status (EmpathyMainWindow *window, EmpathyAccountManager *man /* Update widgets sensibility */ for (l = window->actions_connected; l; l = l->next) { - gtk_action_set_sensitive (l->data, (connected > 0)); + gtk_action_set_sensitive (l->data, connected); } } static void -main_window_connection_changed_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, - TpConnectionStatusReason reason, - TpConnectionStatus current, - TpConnectionStatus previous, +main_window_connection_changed_cb (TpAccount *account, + guint old_status, + guint current, + guint reason, + gchar *dbus_error_name, + GHashTable *details, EmpathyMainWindow *window) { - main_window_update_status (window, manager); + main_window_update_status (window); if (current == TP_CONNECTION_STATUS_DISCONNECTED && reason != TP_CONNECTION_STATUS_REASON_REQUESTED) { @@ -572,15 +572,17 @@ main_window_contact_presence_changed_cb (EmpathyContactMonitor *monitor, TpConnectionPresenceType previous, EmpathyMainWindow *window) { - EmpathyAccount *account; - gboolean should_play; + TpAccount *account; + gboolean should_play = FALSE; + EmpathyIdle *idle; - account = empathy_contact_get_account (contact); - should_play = !empathy_account_is_just_connected (account); + account = empathy_contact_get_account (contact); + idle = empathy_idle_dup_singleton (); - if (!should_play) { - return; - } + should_play = !empathy_idle_account_is_just_connected (idle, account); + + if (!should_play) + goto out; if (tp_connection_presence_type_cmp_availability (previous, TP_CONNECTION_PRESENCE_TYPE_OFFLINE) > 0) @@ -601,6 +603,9 @@ main_window_contact_presence_changed_cb (EmpathyContactMonitor *monitor, empathy_sound_play (GTK_WIDGET (window->window), EMPATHY_SOUND_CONTACT_CONNECTED); } + +out: + g_object_unref (idle); } static void @@ -641,10 +646,6 @@ main_window_destroy_cb (GtkWidget *widget, /* Save user-defined accelerators. */ main_window_accels_save (); - g_signal_handlers_disconnect_by_func (window->account_manager, - main_window_connection_changed_cb, - window); - if (window->size_timeout_id) { g_source_remove (window->size_timeout_id); } @@ -845,12 +846,12 @@ main_window_view_show_map_cb (GtkCheckMenuItem *item, static void main_window_favorite_chatroom_join (EmpathyChatroom *chatroom) { - EmpathyAccount *account; + TpAccount *account; TpConnection *connection; const gchar *room; account = empathy_chatroom_get_account (chatroom); - connection = empathy_account_get_connection (account); + connection = tp_account_get_connection (account); room = empathy_chatroom_get_room (chatroom); if (connection != NULL) { @@ -1121,12 +1122,27 @@ main_window_configure_event_cb (GtkWidget *widget, } static void -main_window_account_created_or_deleted_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, - EmpathyMainWindow *window) +main_window_account_removed_cb (TpAccountManager *manager, + TpAccount *account, + EmpathyMainWindow *window) { + GList *a; + + a = tp_account_manager_get_valid_accounts (manager); + gtk_action_set_sensitive (window->view_history, - empathy_account_manager_get_count (manager) > 0); + g_list_length (a) > 0); + + g_list_free (a); +} + +static void +main_window_account_validity_changed_cb (TpAccountManager *manager, + TpAccount *account, + gboolean valid, + EmpathyMainWindow *window) +{ + main_window_account_removed_cb (manager, account, window); } static void @@ -1169,6 +1185,33 @@ empathy_main_window_get (void) return main_window != NULL ? main_window->window : NULL; } +static void +account_manager_prepared_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + GList *accounts, *j; + TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object); + EmpathyMainWindow *window = user_data; + GError *error = NULL; + + if (!tp_account_manager_prepare_finish (manager, result, &error)) { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } + + accounts = tp_account_manager_get_valid_accounts (window->account_manager); + for (j = accounts; j != NULL; j = j->next) { + TpAccount *account = TP_ACCOUNT (j->data); + + g_signal_connect (account, "status-changed", + G_CALLBACK (main_window_connection_changed_cb), + window); + } + g_list_free (accounts); +} + GtkWidget * empathy_main_window_show (void) { @@ -1250,11 +1293,10 @@ empathy_main_window_show (void) gtk_action_set_visible (show_map_widget, FALSE); #endif - window->account_manager = empathy_account_manager_dup_singleton (); + window->account_manager = tp_account_manager_dup (); - g_signal_connect (window->account_manager, - "account-connection-changed", - G_CALLBACK (main_window_connection_changed_cb), window); + tp_account_manager_prepare_async (window->account_manager, NULL, + account_manager_prepared_cb, window); window->errors = g_hash_table_new_full (g_direct_hash, g_direct_equal, @@ -1352,13 +1394,13 @@ empathy_main_window_show (void) G_CALLBACK (main_window_event_removed_cb), window); - g_signal_connect (window->account_manager, "account-created", - G_CALLBACK (main_window_account_created_or_deleted_cb), + g_signal_connect (window->account_manager, "account-validity-changed", + G_CALLBACK (main_window_account_validity_changed_cb), window); - g_signal_connect (window->account_manager, "account-deleted", - G_CALLBACK (main_window_account_created_or_deleted_cb), + g_signal_connect (window->account_manager, "account-removed", + G_CALLBACK (main_window_account_removed_cb), window); - main_window_account_created_or_deleted_cb (window->account_manager, NULL, window); + main_window_account_removed_cb (window->account_manager, NULL, window); l = empathy_event_manager_get_events (window->event_manager); while (l) { @@ -1404,7 +1446,7 @@ empathy_main_window_show (void) EMPATHY_PREFS_UI_SHOW_AVATARS, window); - main_window_update_status (window, window->account_manager); + main_window_update_status (window); return window->window; } diff --git a/src/empathy-new-chatroom-dialog.c b/src/empathy-new-chatroom-dialog.c index 219be371d..8ea65adf2 100644 --- a/src/empathy-new-chatroom-dialog.c +++ b/src/empathy-new-chatroom-dialog.c @@ -354,7 +354,7 @@ static void new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog) { EmpathyAccountChooser *account_chooser; - EmpathyAccount *account; + TpAccount *account; const gchar *protocol; const gchar *room; @@ -364,7 +364,7 @@ new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog) if (account == NULL) return; - protocol = empathy_account_get_protocol (account); + protocol = tp_account_get_protocol (account); gtk_entry_set_text (GTK_ENTRY (dialog->entry_server), ""); @@ -396,7 +396,7 @@ new_chatroom_dialog_account_changed_cb (GtkComboBox *combobox, EmpathyNewChatroomDialog *dialog) { EmpathyAccountChooser *account_chooser; - EmpathyAccount *account; + TpAccount *account; gboolean listing = FALSE; gboolean expanded = FALSE; diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c index a2a6f54fb..21cb2dd3d 100644 --- a/src/empathy-status-icon.c +++ b/src/empathy-status-icon.c @@ -32,11 +32,11 @@ #include <libnotify/notification.h> #include <libnotify/notify.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/util.h> #include <libempathy/empathy-utils.h> #include <libempathy/empathy-idle.h> -#include <libempathy/empathy-account-manager.h> #include <libempathy-gtk/empathy-presence-chooser.h> #include <libempathy-gtk/empathy-conf.h> @@ -60,7 +60,7 @@ typedef struct { GtkStatusIcon *icon; EmpathyIdle *idle; - EmpathyAccountManager *account_manager; + TpAccountManager *account_manager; gboolean showing_event_icon; guint blink_timeout; EmpathyEventManager *event_manager; @@ -511,20 +511,18 @@ status_icon_create_menu (EmpathyStatusIcon *icon) } static void -status_icon_connection_changed_cb (EmpathyAccountManager *manager, - EmpathyAccount *account, - TpConnectionStatusReason reason, - TpConnectionStatus current, - TpConnectionStatus previous, - EmpathyStatusIcon *icon) +status_icon_status_changed_cb (TpAccount *account, + TpConnectionStatus current, + TpConnectionStatus previous, + TpConnectionStatusReason reason, + gchar *dbus_error_name, + GHashTable *details, + EmpathyStatusIcon *icon) { EmpathyStatusIconPriv *priv = GET_PRIV (icon); - int connected_accounts; - /* Check for a connected account */ - connected_accounts = empathy_account_manager_get_connected_accounts (manager); - - gtk_action_set_sensitive (priv->new_message_item, connected_accounts > 0); + gtk_action_set_sensitive (priv->new_message_item, + empathy_account_manager_get_accounts_connected (NULL)); } static void @@ -536,10 +534,6 @@ status_icon_finalize (GObject *object) g_source_remove (priv->blink_timeout); } - g_signal_handlers_disconnect_by_func (priv->account_manager, - status_icon_connection_changed_cb, - object); - if (priv->notification) { notify_notification_close (priv->notification, NULL); g_object_unref (priv->notification); @@ -564,6 +558,31 @@ empathy_status_icon_class_init (EmpathyStatusIconClass *klass) } static void +account_manager_prepared_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + GList *list, *l; + TpAccountManager *account_manager = TP_ACCOUNT_MANAGER (source_object); + EmpathyStatusIcon *icon = user_data; + GError *error = NULL; + + if (!tp_account_manager_prepare_finish (account_manager, result, &error)) { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } + + list = tp_account_manager_get_valid_accounts (account_manager); + for (l = list; l != NULL; l = l->next) { + empathy_signal_connect_weak (l->data, "status-changed", + G_CALLBACK (status_icon_status_changed_cb), + G_OBJECT (icon)); + } + g_list_free (list); +} + +static void empathy_status_icon_init (EmpathyStatusIcon *icon) { EmpathyStatusIconPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (icon, @@ -572,13 +591,12 @@ empathy_status_icon_init (EmpathyStatusIcon *icon) icon->priv = priv; priv->icon = gtk_status_icon_new (); - priv->account_manager = empathy_account_manager_dup_singleton (); + priv->account_manager = tp_account_manager_dup (); priv->idle = empathy_idle_dup_singleton (); priv->event_manager = empathy_event_manager_dup_singleton (); - g_signal_connect (priv->account_manager, - "account-connection-changed", - G_CALLBACK (status_icon_connection_changed_cb), icon); + tp_account_manager_prepare_async (priv->account_manager, NULL, + account_manager_prepared_cb, icon); /* make icon listen and respond to MAIN_WINDOW_HIDDEN changes */ empathy_conf_notify_add (empathy_conf_get (), diff --git a/src/empathy.c b/src/empathy.c index 69210760e..72b691c16 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -38,6 +38,7 @@ #include <libebook/e-book.h> #include <libnotify/notify.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/dbus.h> #include <telepathy-glib/util.h> #include <telepathy-glib/connection-manager.h> @@ -49,7 +50,6 @@ #include <libempathy/empathy-chatroom-manager.h> #include <libempathy/empathy-account-settings.h> #include <libempathy/empathy-connectivity.h> -#include <libempathy/empathy-account-manager.h> #include <libempathy/empathy-connection-managers.h> #include <libempathy/empathy-debugger.h> #include <libempathy/empathy-dispatcher.h> @@ -105,16 +105,12 @@ dispatch_cb (EmpathyDispatcher *dispatcher, id = empathy_tp_chat_get_id (tp_chat); if (!EMP_STR_EMPTY (id)) { - EmpathyAccountManager *manager; TpConnection *connection; - EmpathyAccount *account; + TpAccount *account; - manager = empathy_account_manager_dup_singleton (); connection = empathy_tp_chat_get_connection (tp_chat); - account = empathy_account_manager_get_account_for_connection ( - manager, connection); + account = empathy_get_account_for_connection (connection); chat = empathy_chat_window_find_chat (account, id); - g_object_unref (manager); } if (chat) @@ -155,11 +151,11 @@ dispatch_cb (EmpathyDispatcher *dispatcher, } } -/* Salut account creation */ +/* Salut account creation. The TpAccountManager first argument + * must already be prepared when calling this function. */ static gboolean -should_create_salut_account (void) +should_create_salut_account (TpAccountManager *manager) { - EmpathyAccountManager *manager; gboolean salut_created = FALSE; GList *accounts, *l; @@ -174,20 +170,20 @@ should_create_salut_account (void) return FALSE; } - manager = empathy_account_manager_dup_singleton (); - accounts = empathy_account_manager_dup_accounts (manager); + accounts = tp_account_manager_get_valid_accounts (manager); for (l = accounts; l != NULL; l = g_list_next (l)) { - EmpathyAccount *account = EMPATHY_ACCOUNT (l->data); + TpAccount *account = TP_ACCOUNT (l->data); - if (!tp_strdiff (empathy_account_get_protocol (account), "local-xmpp")) - salut_created = TRUE; - - g_object_unref (account); + if (!tp_strdiff (tp_account_get_protocol (account), "local-xmpp")) + { + salut_created = TRUE; + break; + } } - g_object_unref (manager); + g_list_free (accounts); if (salut_created) { @@ -206,7 +202,7 @@ salut_account_created (GObject *source, gpointer user_data) { EmpathyAccountSettings *settings = EMPATHY_ACCOUNT_SETTINGS (source); - EmpathyAccount *account; + TpAccount *account; GError *error = NULL; if (!empathy_account_settings_apply_finish (settings, result, &error)) @@ -218,7 +214,7 @@ salut_account_created (GObject *source, account = empathy_account_settings_get_account (settings); - empathy_account_set_enabled_async (account, TRUE, NULL, NULL); + tp_account_set_enabled_async (account, TRUE, NULL, NULL); empathy_conf_set_bool (empathy_conf_get (), EMPATHY_PREFS_SALUT_ACCOUNT_CREATED, TRUE); @@ -239,8 +235,12 @@ use_conn_notify_cb (EmpathyConf *conf, } static void -create_salut_account_if_needed (EmpathyConnectionManagers *managers) +create_salut_account_am_ready_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { + TpAccountManager *account_manager = TP_ACCOUNT_MANAGER (source_object); + EmpathyConnectionManagers *managers = user_data; EmpathyAccountSettings *settings; TpConnectionManager *manager; const TpConnectionManagerProtocol *protocol; @@ -253,22 +253,28 @@ create_salut_account_if_needed (EmpathyConnectionManagers *managers) gchar *jid = NULL; GError *error = NULL; + if (!tp_account_manager_prepare_finish (account_manager, result, &error)) + { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + goto out; + } - if (!should_create_salut_account ()) - return; + if (!should_create_salut_account (account_manager)) + goto out; manager = empathy_connection_managers_get_cm (managers, "salut"); if (manager == NULL) { DEBUG ("Salut not installed, not making a salut account"); - return; + goto out; } protocol = tp_connection_manager_get_protocol (manager, "local-xmpp"); if (protocol == NULL) { DEBUG ("Salut doesn't support local-xmpp!!"); - return; + goto out; } DEBUG ("Trying to add a salut account..."); @@ -279,7 +285,7 @@ create_salut_account_if_needed (EmpathyConnectionManagers *managers) DEBUG ("Failed to get self econtact: %s", error ? error->message : "No error given"); g_clear_error (&error); - return; + goto out; } settings = empathy_account_settings_new ("salut", "local-xmpp", @@ -321,24 +327,39 @@ create_salut_account_if_needed (EmpathyConnectionManagers *managers) g_object_unref (settings); g_object_unref (contact); g_object_unref (book); + + out: + g_object_unref (managers); +} + +static void +create_salut_account_if_needed (EmpathyConnectionManagers *managers) +{ + TpAccountManager *manager; + + manager = tp_account_manager_dup (); + + tp_account_manager_prepare_async (manager, NULL, + create_salut_account_am_ready_cb, g_object_ref (managers)); + + g_object_unref (manager); } static gboolean -has_non_salut_accounts (EmpathyAccountManager *manager) +has_non_salut_accounts (TpAccountManager *manager) { gboolean ret = FALSE; GList *accounts, *l; - accounts = empathy_account_manager_dup_accounts (manager); + accounts = tp_account_manager_get_valid_accounts (manager); for (l = accounts ; l != NULL; l = g_list_next (l)) { - EmpathyAccount *account = EMPATHY_ACCOUNT (l->data); - - if (tp_strdiff (empathy_account_get_protocol (l->data), "local-xmpp")) - ret = TRUE; - - g_object_unref (account); + if (tp_strdiff (tp_account_get_protocol (l->data), "local-xmpp")) + { + ret = TRUE; + break; + } } g_list_free (accounts); @@ -349,11 +370,13 @@ has_non_salut_accounts (EmpathyAccountManager *manager) static void maybe_show_account_assistant (void) { - EmpathyAccountManager *manager; - manager = empathy_account_manager_dup_singleton (); + TpAccountManager *manager; + manager = tp_account_manager_dup (); if (!has_non_salut_accounts (manager)) empathy_account_assistant_show (GTK_WINDOW (empathy_main_window_get ())); + + g_object_unref (manager); } static gboolean @@ -450,7 +473,7 @@ migrate_config_to_xdg_dir (void) static void do_show_accounts_ui (GtkWindow *window, - EmpathyAccountManager *manager) + TpAccountManager *manager) { GtkWidget *ui; @@ -466,12 +489,19 @@ do_show_accounts_ui (GtkWindow *window, } static void -account_manager_ready_for_accounts_cb (EmpathyAccountManager *manager, - GParamSpec *spec, +account_manager_ready_for_accounts_cb (GObject *source_object, + GAsyncResult *result, gpointer user_data) { - if (!empathy_account_manager_is_ready (manager)) - return; + TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object); + GError *error = NULL; + + if (!tp_account_manager_prepare_finish (manager, result, &error)) + { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } do_show_accounts_ui (user_data, manager); } @@ -480,24 +510,15 @@ static void show_accounts_ui (GtkWindow *window, gboolean force) { - EmpathyAccountManager *manager; + TpAccountManager *manager; - manager = empathy_account_manager_dup_singleton (); - if (empathy_account_manager_is_ready (manager)) - { - if (force) - do_show_accounts_ui (window, manager); - else - maybe_show_account_assistant (); - } - else if (force) - { - /* Only if we we're forced to show the widget connect to ready, otherwise - * the initial readyness will cause the accounts ui to be shown when - * needed */ - g_signal_connect (manager, "notify::ready", - G_CALLBACK (account_manager_ready_for_accounts_cb), window); - } + if (!force) + return; + + manager = tp_account_manager_dup (); + + tp_account_manager_prepare_async (manager, NULL, + account_manager_ready_for_accounts_cb, window); g_object_unref (manager); } @@ -615,14 +636,22 @@ default_log_handler (const gchar *log_domain, #endif /* ENABLE_DEBUG */ static void -account_manager_ready_cb (EmpathyAccountManager *manager, - GParamSpec *spec, +account_manager_ready_cb (GObject *source_object, + GAsyncResult *result, gpointer user_data) { - if (!empathy_account_manager_is_ready (manager)) - return; + TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object); + GError *error = NULL; + + if (!tp_account_manager_prepare_finish (manager, result, &error)) + { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } - if (should_create_salut_account () || !empathy_import_mc4_has_imported ()) + if (should_create_salut_account (manager) + || !empathy_import_mc4_has_imported ()) { EmpathyConnectionManagers *managers; managers = empathy_connection_managers_dup_singleton (); @@ -730,37 +759,48 @@ setup_dispatcher (void) } static void -account_connection_notify_cb (EmpathyAccount *account, - GParamSpec *pspec, +account_status_changed_cb (TpAccount *account, + guint old_status, + guint new_status, + guint reason, + gchar *dbus_error_name, + GHashTable *details, EmpathyChatroom *room) { TpConnection *conn; - conn = empathy_account_get_connection (account); - - if (conn == NULL) - return; + conn = tp_account_get_connection (account); empathy_dispatcher_join_muc (conn, empathy_chatroom_get_room (room), NULL, NULL); } static void -account_manager_chatroom_ready_cb (EmpathyAccountManager *account_manager, - GParamSpec *pspec, - EmpathyChatroomManager *chatroom_manager) +account_manager_chatroom_ready_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { + TpAccountManager *account_manager = TP_ACCOUNT_MANAGER (source_object); + EmpathyChatroomManager *chatroom_manager = user_data; GList *accounts, *l; + GError *error = NULL; - accounts = empathy_account_manager_dup_accounts (account_manager); + if (!tp_account_manager_prepare_finish (account_manager, result, &error)) + { + DEBUG ("Failed to prepare account manager: %s", error->message); + g_error_free (error); + return; + } + + accounts = tp_account_manager_get_valid_accounts (account_manager); for (l = accounts; l != NULL; l = g_list_next (l)) { - EmpathyAccount *account = EMPATHY_ACCOUNT (l->data); + TpAccount *account = TP_ACCOUNT (l->data); TpConnection *conn; GList *chatrooms, *p; - conn = empathy_account_get_connection (account); + conn = tp_account_get_connection (account); chatrooms = empathy_chatroom_manager_get_chatrooms ( chatroom_manager, account); @@ -774,8 +814,8 @@ account_manager_chatroom_ready_cb (EmpathyAccountManager *account_manager, if (conn == NULL) { - g_signal_connect (G_OBJECT (account), "notify::connection", - G_CALLBACK (account_connection_notify_cb), room); + g_signal_connect (G_OBJECT (account), "status-changed", + G_CALLBACK (account_status_changed_cb), room); } else { @@ -787,29 +827,18 @@ account_manager_chatroom_ready_cb (EmpathyAccountManager *account_manager, g_list_free (chatrooms); } - g_list_foreach (accounts, (GFunc) g_object_unref, NULL); g_list_free (accounts); } static void chatroom_manager_ready_cb (EmpathyChatroomManager *chatroom_manager, GParamSpec *pspec, - EmpathyAccountManager *account_manager) + gpointer user_data) { - gboolean ready; + TpAccountManager *account_manager = user_data; - g_object_get (G_OBJECT (account_manager), "ready", &ready, NULL); - - if (ready) - { - account_manager_chatroom_ready_cb (account_manager, NULL, - chatroom_manager); - } - else - { - g_signal_connect (account_manager, "notify::ready", - G_CALLBACK (account_manager_chatroom_ready_cb), chatroom_manager); - } + tp_account_manager_prepare_async (account_manager, NULL, + account_manager_chatroom_ready_cb, chatroom_manager); } int @@ -820,7 +849,7 @@ main (int argc, char *argv[]) #endif EmpathyStatusIcon *icon; EmpathyDispatcher *dispatcher; - EmpathyAccountManager *account_manager; + TpAccountManager *account_manager; EmpathyLogManager *log_manager; EmpathyChatroomManager *chatroom_manager; EmpathyCallFactory *call_factory; @@ -923,7 +952,7 @@ main (int argc, char *argv[]) if (account_dialog_only) { - account_manager = empathy_account_manager_dup_singleton (); + account_manager = tp_account_manager_dup (); show_accounts_ui (NULL, TRUE); gtk_main (); @@ -955,9 +984,9 @@ main (int argc, char *argv[]) empathy_idle_set_state (idle, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); /* account management */ - account_manager = empathy_account_manager_dup_singleton (); - g_signal_connect (account_manager, "notify::ready", - G_CALLBACK (account_manager_ready_cb), NULL); + account_manager = tp_account_manager_dup (); + tp_account_manager_prepare_async (account_manager, NULL, + account_manager_ready_cb, NULL); /* Handle channels */ dispatcher = setup_dispatcher (); diff --git a/tests/.gitignore b/tests/.gitignore index 28aa99b06..73a19245d 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,2 +1,8 @@ -check-main *.log +empathy-utils-test +empathy-irc-server-test +empathy-irc-network-test +empathy-irc-network-manager-test +empathy-chatroom-test +empathy-chatroom-manager-test +test-report.xml diff --git a/tests/Makefile.am b/tests/Makefile.am index a93b6fd8a..25e399406 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,8 +2,6 @@ SUBDIRS = interactive xml CLEANFILES= -include $(top_srcdir)/rules/check.mak - SUPPRESSIONS=valgrind.supp dlopen.supp EXTRA_DIST = \ @@ -23,39 +21,51 @@ LDADD = \ $(top_builddir)/libempathy/libempathy.la \ $(EMPATHY_LIBS) -check_PROGRAMS = check-main -TESTS = check-main -check_main_SOURCES = \ - check-main.c \ - check-helpers.c \ - check-helpers.h \ - check-libempathy.h \ - check-empathy-utils.c \ - check-empathy-helpers.h \ - check-empathy-helpers.c \ - check-irc-helper.h \ - check-irc-helper.c \ - check-empathy-irc-server.c \ - check-empathy-irc-network.c \ - check-empathy-irc-network-manager.c \ - check-empathy-chatroom.c \ - check-empathy-chatroom-manager.c - -check_c_sources = \ - $(check_main_SOURCES) -include $(top_srcdir)/tools/check-coding-style.mk -check-local: check-coding-style - -check_main_LDADD = \ - @CHECK_LIBS@ \ - $(top_builddir)/libempathy-gtk/libempathy-gtk.la \ - $(top_builddir)/libempathy/libempathy.la \ - $(AM_LDFLAGS) - -check_main_CFLAGS = \ - @CHECK_CFLAGS@ \ - $(AM_CFLAGS) +TEST_PROGS = \ + empathy-utils-test \ + empathy-irc-server-test \ + empathy-irc-network-test \ + empathy-irc-network-manager-test \ + empathy-chatroom-test \ + empathy-chatroom-manager-test + +empathy_utils_test_SOURCES = empathy-utils-test.c \ + test-helper.c test-helper.h + +empathy_irc_server_test_SOURCES = empathy-irc-server-test.c \ + test-helper.c test-helper.h \ + test-irc-helper.h test-irc-helper.c + +empathy_irc_network_test_SOURCES = empathy-irc-network-test.c \ + test-helper.c test-helper.h \ + test-irc-helper.h test-irc-helper.c + +empathy_irc_network_manager_test_SOURCES = empathy-irc-network-manager-test.c \ + test-helper.c test-helper.h \ + test-irc-helper.h test-irc-helper.c + +empathy_chatroom_test_SOURCES = empathy-chatroom-test.c \ + test-helper.c test-helper.h + +empathy_chatroom_manager_test_SOURCES = empathy-chatroom-manager-test.c \ + test-helper.c test-helper.h + +check_PROGRAMS = $(TEST_PROGS) TESTS_ENVIRONMENT = EMPATHY_SRCDIR=@abs_top_srcdir@ \ MC_PROFILE_DIR=@abs_top_srcdir@/tests \ MC_MANAGER_DIR=@abs_top_srcdir@/tests + +test-report: test-report.xml + gtester-report $(top_builddir)/tests/$@.xml > \ + $(top_builddir)/tests/$@.html + +test-report.xml: ${TEST_PROGS} test + +test: ${TEST_PROGS} + gtester -o test-report.xml -k --verbose ${TEST_PROGS} + +test-%: empathy-%-test + gtester -o $@-report.xml -k --verbose $< + +.PHONY: test test-report diff --git a/tests/check-empathy-utils.c b/tests/check-empathy-utils.c deleted file mode 100644 index faf261058..000000000 --- a/tests/check-empathy-utils.c +++ /dev/null @@ -1,29 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <string.h> - -#include <check.h> -#include "check-helpers.h" -#include "check-libempathy.h" - -#include <libempathy/empathy-utils.h> - -START_TEST (test_empathy_substring) -{ - gchar *tmp; - - tmp = empathy_substring ("empathy", 2, 6); - fail_if (tmp == NULL); - fail_if (strcmp (tmp, "path") != 0); - - g_free (tmp); -} -END_TEST - -TCase * -make_empathy_utils_tcase (void) -{ - TCase *tc = tcase_create ("empathy-utils"); - tcase_add_test (tc, test_empathy_substring); - return tc; -} diff --git a/tests/check-helpers.c b/tests/check-helpers.c deleted file mode 100644 index 6fd07cf65..000000000 --- a/tests/check-helpers.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * check-helpers.c - Source for some check helpers - * Copyright (C) 2007-2008 Collabora Ltd. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include <stdio.h> -#include <stdlib.h> - -#include <glib/gstdio.h> -#include <gconf/gconf.h> -#include <gconf/gconf-client.h> - -#include "check-helpers.h" - -static gboolean expecting_critical = FALSE; -static gboolean received_critical = FALSE; - -static void -check_helper_log_critical_func (const gchar *log_damain, - GLogLevelFlags log_level, - const gchar *message, - gpointer user_data) -{ - - if (!expecting_critical) - { - fail ("Unexpected critical message: %s\n", message); - } - - g_assert (log_level & G_LOG_LEVEL_CRITICAL); - - received_critical = TRUE; -} - -gboolean -got_critical (void) -{ - return received_critical; -} - -void -expect_critical (gboolean expected) -{ - expecting_critical = expected; - received_critical = FALSE; -} - -void -check_helpers_init (void) -{ - g_log_set_handler (NULL, G_LOG_LEVEL_CRITICAL, - check_helper_log_critical_func, NULL); -} diff --git a/tests/check-helpers.h b/tests/check-helpers.h deleted file mode 100644 index b71b3b65b..000000000 --- a/tests/check-helpers.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * check-helpers.c - Source for some check helpers - * Copyright (C) 2007 Collabora Ltd. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#ifndef __CHECK_HELPERS_H__ -#define __CHECK_HELPERS_H__ - -#include <glib.h> -#include <check.h> - -void -check_helpers_init (void); - -void -expect_critical (gboolean expected); - -gboolean -got_critical (void); - -#define fail_unless_critical(expr, ...) \ -G_STMT_START { \ - expect_critical (TRUE); \ - expr; \ - _fail_unless (got_critical (), __FILE__, __LINE__, \ - "Expected g_critical, got none", ## __VA_ARGS__, NULL); \ - expect_critical (FALSE); \ -} G_STMT_END; - -#endif /* #ifndef __CHECK_HELPERS_H__ */ diff --git a/tests/check-libempathy.h b/tests/check-libempathy.h deleted file mode 100644 index 5dcb2b17a..000000000 --- a/tests/check-libempathy.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __CHECK_LIBEMPATHY__ -#define __CHECK_LIBEMPATHY__ - -TCase * make_empathy_utils_tcase (void); -TCase * make_empathy_irc_server_tcase (void); -TCase * make_empathy_irc_network_tcase (void); -TCase * make_empathy_irc_network_manager_tcase (void); -TCase * make_empathy_chatroom_tcase (void); -TCase * make_empathy_chatroom_manager_tcase (void); - -#endif /* #ifndef __CHECK_LIBEMPATHY__ */ diff --git a/tests/check-main.c b/tests/check-main.c deleted file mode 100644 index 7adbc15df..000000000 --- a/tests/check-main.c +++ /dev/null @@ -1,47 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <glib-object.h> - -#include <check.h> - -#include "check-helpers.h" -#include "check-libempathy.h" -#include <libempathy/empathy-utils.h> - -#include "config.h" - -static Suite * -make_libempathy_suite (void) -{ - Suite *s = suite_create ("libempathy"); - - suite_add_tcase (s, make_empathy_utils_tcase ()); - suite_add_tcase (s, make_empathy_irc_server_tcase ()); - suite_add_tcase (s, make_empathy_irc_network_tcase ()); - suite_add_tcase (s, make_empathy_irc_network_manager_tcase ()); - suite_add_tcase (s, make_empathy_chatroom_tcase ()); - suite_add_tcase (s, make_empathy_chatroom_manager_tcase ()); - - return s; -} - -int -main (void) -{ - int number_failed = 0; - Suite *s; - SRunner *sr; - - check_helpers_init (); - g_type_init (); - empathy_init (); - - s = make_libempathy_suite (); - sr = srunner_create (s); - srunner_run_all (sr, CK_NORMAL); - number_failed += srunner_ntests_failed (sr); - srunner_free (sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; -} diff --git a/tests/check-empathy-chatroom-manager.c b/tests/empathy-chatroom-manager-test.c index 5a3384fe4..3d6b6f6b7 100644 --- a/tests/check-empathy-chatroom-manager.c +++ b/tests/empathy-chatroom-manager-test.c @@ -5,15 +5,12 @@ #include <gconf/gconf.h> #include <gconf/gconf-client.h> +#include <telepathy-glib/account-manager.h> #include <telepathy-glib/util.h> -#include <check.h> - -#include "check-helpers.h" -#include "check-libempathy.h" -#include "check-empathy-helpers.h" #include <libempathy/empathy-chatroom-manager.h> -#include <libempathy/empathy-account-manager.h> + +#include "test-helper.h" #define CHATROOM_SAMPLE "chatrooms-sample.xml" #define CHATROOM_FILE "chatrooms.xml" @@ -387,16 +384,27 @@ START_TEST (test_empathy_chatroom_manager_change_chatroom) END_TEST #endif -TCase * -make_empathy_chatroom_manager_tcase (void) +int +main (int argc, + char **argv) { - TCase *tc = tcase_create ("empathy-chatroom-manager"); - /* - tcase_add_test (tc, test_empathy_chatroom_manager_dup_singleton); - tcase_add_test (tc, test_empathy_chatroom_manager_add); - tcase_add_test (tc, test_empathy_chatroom_manager_remove); - tcase_add_test (tc, test_empathy_chatroom_manager_change_favorite); - tcase_add_test (tc, test_empathy_chatroom_manager_change_chatroom); - */ - return tc; + int result; + + test_init (argc, argv); + +#if 0 + g_test_add_func ("/chatroom-manager/dup-singleton", + test_empathy_chatroom_manager_dup_singleton); + g_test_add_func ("/chatroom-manager/add", test_empathy_chatroom_manager_add); + g_test_add_func ("/chatroom-manager/remove", + test_empathy_chatroom_manager_remove); + g_test_add_func ("/chatroom-manager/change-favorite", + test_empathy_chatroom_manager_change_favorite); + g_test_add_func ("/chatroom-manager/change-chatroom", + test_empathy_chatroom_manager_change_chatroom); +#endif + + result = g_test_run (); + test_deinit (); + return result; } diff --git a/tests/check-empathy-chatroom.c b/tests/empathy-chatroom-test.c index 4d0b7e1ee..3826411a5 100644 --- a/tests/check-empathy-chatroom.c +++ b/tests/empathy-chatroom-test.c @@ -2,10 +2,7 @@ #include <stdio.h> #include <string.h> -#include <check.h> -#include "check-helpers.h" -#include "check-libempathy.h" -#include "check-empathy-helpers.h" +#include "test-helper.h" #include <libempathy/empathy-chatroom.h> @@ -146,14 +143,22 @@ START_TEST (test_change_favorite) END_TEST #endif -TCase * -make_empathy_chatroom_tcase (void) +int +main (int argc, + char **argv) { - TCase *tc = tcase_create ("empathy-chatroom"); - /* - tcase_add_test (tc, test_empathy_chatroom_new); - tcase_add_test (tc, test_favorite_and_auto_connect); - tcase_add_test (tc, test_change_favorite); - */ - return tc; + int result; + + test_init (argc, argv); + +#if 0 + g_test_add_func ("/chatroom/new", test_empathy_chatroom_new); + g_test_add_func ("/chatroom/favorite-and-auto-connect", + test_favorite_and_auto_connect); + g_test_add_func ("/chatroom/change-favorite", test_change_favorite); +#endif + + result = g_test_run (); + test_deinit (); + return result; } diff --git a/tests/check-empathy-irc-network-manager.c b/tests/empathy-irc-network-manager-test.c index 51666fc46..df1147070 100644 --- a/tests/check-empathy-irc-network-manager.c +++ b/tests/empathy-irc-network-manager-test.c @@ -3,11 +3,8 @@ #include <string.h> #include <glib/gstdio.h> -#include <check.h> -#include "check-helpers.h" -#include "check-libempathy.h" -#include "check-irc-helper.h" -#include "check-empathy-helpers.h" +#include "test-irc-helper.h" +#include "test-helper.h" #include <libempathy/empathy-irc-network-manager.h> @@ -15,7 +12,8 @@ #define USER_SAMPLE "user-irc-networks-sample.xml" #define USER_FILE "user-irc-networks.xml" -START_TEST (test_empathy_irc_network_manager_add) +static void +test_empathy_irc_network_manager_add (void) { EmpathyIrcNetworkManager *mgr; EmpathyIrcNetwork *network; @@ -23,47 +21,47 @@ START_TEST (test_empathy_irc_network_manager_add) gchar *name; mgr = empathy_irc_network_manager_new (NULL, NULL); - fail_if (mgr == NULL); + g_assert (mgr != NULL); networks = empathy_irc_network_manager_get_networks (mgr); - fail_if (networks != NULL); + g_assert (networks == NULL); /* add a network */ network = empathy_irc_network_new ("My Network"); - fail_if (network == NULL); + g_assert (network != NULL); empathy_irc_network_manager_add (mgr, network); g_object_unref (network); networks = empathy_irc_network_manager_get_networks (mgr); - fail_if (g_slist_length (networks) != 1); + g_assert (g_slist_length (networks) == 1); g_object_get (networks->data, "name", &name, NULL); - fail_if (name == NULL || strcmp (name, "My Network") != 0); + g_assert (name != NULL && strcmp (name, "My Network") == 0); g_free (name); g_slist_foreach (networks, (GFunc) g_object_unref, NULL); g_slist_free (networks); /* add another network having the same name */ network = empathy_irc_network_new ("My Network"); - fail_if (network == NULL); + g_assert (network != NULL); empathy_irc_network_manager_add (mgr, network); g_object_unref (network); networks = empathy_irc_network_manager_get_networks (mgr); - fail_if (g_slist_length (networks) != 2); + g_assert (g_slist_length (networks) == 2); g_object_get (networks->data, "name", &name, NULL); - fail_if (name == NULL || strcmp (name, "My Network") != 0); + g_assert (name != NULL && strcmp (name, "My Network") == 0); g_free (name); g_object_get (g_slist_next (networks)->data, "name", &name, NULL); - fail_if (name == NULL || strcmp (name, "My Network") != 0); + g_assert (name != NULL || strcmp (name, "My Network") == 0); g_free (name); g_slist_foreach (networks, (GFunc) g_object_unref, NULL); g_slist_free (networks); g_object_unref (mgr); } -END_TEST -START_TEST (test_load_global_file) +static void +test_load_global_file (void) { EmpathyIrcNetworkManager *mgr; gchar *global_file, *user_file; @@ -88,14 +86,14 @@ START_TEST (test_load_global_file) "global-file", &global_file, "user-file", &user_file, NULL); - fail_if (global_file == NULL || strcmp (global_file, global_file_orig) != 0); - fail_if (user_file != NULL); + g_assert (global_file != NULL || strcmp (global_file, global_file_orig) == 0); + g_assert (user_file == NULL); g_free (global_file); g_free (global_file_orig); g_free (user_file); networks = empathy_irc_network_manager_get_networks (mgr); - fail_if (g_slist_length (networks) != 4); + g_assert (g_slist_length (networks) == 4); network_checked[0] = network_checked[1] = network_checked[2] = network_checked[3] = FALSE; @@ -105,7 +103,7 @@ START_TEST (test_load_global_file) gchar *name; g_object_get (l->data, "name", &name, NULL); - fail_if (name == NULL); + g_assert (name != NULL); if (strcmp (name, "Freenode") == 0) { @@ -129,19 +127,18 @@ START_TEST (test_load_global_file) } else { - fail_if (TRUE); + g_assert_not_reached (); } g_free (name); } - fail_if (!network_checked[0] || !network_checked[1] || !network_checked[2] || - !network_checked[3]); + g_assert (network_checked[0] && network_checked[1] && network_checked[2] && + network_checked[3]); g_slist_foreach (networks, (GFunc) g_object_unref, NULL); g_slist_free (networks); g_object_unref (mgr); } -END_TEST static gboolean remove_network_named (EmpathyIrcNetworkManager *mgr, @@ -159,7 +156,7 @@ remove_network_named (EmpathyIrcNetworkManager *mgr, gchar *name; g_object_get (network, "name", &name, NULL); - fail_if (name == NULL); + g_assert (name != NULL); if (strcmp (name, network_name) == 0) { @@ -176,7 +173,8 @@ remove_network_named (EmpathyIrcNetworkManager *mgr, return removed; } -START_TEST (test_empathy_irc_network_manager_remove) +static void +test_empathy_irc_network_manager_remove (void) { EmpathyIrcNetworkManager *mgr; GSList *networks, *l; @@ -196,10 +194,10 @@ START_TEST (test_empathy_irc_network_manager_remove) g_free (global_file_orig); result = remove_network_named (mgr, "GIMPNet"); - fail_if (!result); + g_assert (result); networks = empathy_irc_network_manager_get_networks (mgr); - fail_if (g_slist_length (networks) != 3); + g_assert (g_slist_length (networks) == 3); network_checked[0] = network_checked[1] = network_checked[2] = FALSE; /* check networks and servers */ @@ -208,7 +206,7 @@ START_TEST (test_empathy_irc_network_manager_remove) gchar *name; g_object_get (l->data, "name", &name, NULL); - fail_if (name == NULL); + g_assert (name != NULL); if (strcmp (name, "Freenode") == 0) { @@ -227,20 +225,20 @@ START_TEST (test_empathy_irc_network_manager_remove) } else { - fail_if (TRUE); + g_assert_not_reached (); } g_free (name); } - fail_if (!network_checked[0] || !network_checked[1] || !network_checked[2]); + g_assert (network_checked[0] && network_checked[1] && network_checked[2]); g_slist_foreach (networks, (GFunc) g_object_unref, NULL); g_slist_free (networks); g_object_unref (mgr); } -END_TEST -START_TEST (test_load_user_file) +static void +test_load_user_file (void) { EmpathyIrcNetworkManager *mgr; gchar *global_file, *user_file; @@ -264,14 +262,14 @@ START_TEST (test_load_user_file) "global-file", &global_file, "user-file", &user_file, NULL); - fail_if (global_file != NULL); - fail_if (user_file == NULL || strcmp (user_file, user_file_orig) != 0); + g_assert (global_file == NULL); + g_assert (user_file != NULL && strcmp (user_file, user_file_orig) == 0); g_free (global_file); g_free (user_file); g_free (user_file_orig); networks = empathy_irc_network_manager_get_networks (mgr); - fail_if (g_slist_length (networks) != 3); + g_assert (g_slist_length (networks) == 3); network_checked[0] = network_checked[1] = network_checked[2] = FALSE; /* check networks and servers */ @@ -280,7 +278,7 @@ START_TEST (test_load_user_file) gchar *name; g_object_get (l->data, "name", &name, NULL); - fail_if (name == NULL); + g_assert (name != NULL); if (strcmp (name, "GIMPNet") == 0) { @@ -299,20 +297,20 @@ START_TEST (test_load_user_file) } else { - fail_if (TRUE); + g_assert_not_reached (); } g_free (name); } - fail_if (!network_checked[0] || !network_checked[1] || !network_checked[2]); + g_assert (network_checked[0] && network_checked[1] && network_checked[2]); g_slist_foreach (networks, (GFunc) g_object_unref, NULL); g_slist_free (networks); g_object_unref (mgr); } -END_TEST -START_TEST (test_load_both_files) +static void +test_load_both_files (void) { EmpathyIrcNetworkManager *mgr; gchar *global_file, *user_file; @@ -341,15 +339,15 @@ START_TEST (test_load_both_files) "global-file", &global_file, "user-file", &user_file, NULL); - fail_if (global_file == NULL || strcmp (global_file, global_file_orig) != 0); - fail_if (user_file == NULL || strcmp (user_file, user_file_orig) != 0); + g_assert (global_file != NULL && strcmp (global_file, global_file_orig) == 0); + g_assert (user_file != NULL && strcmp (user_file, user_file_orig) == 0); g_free (global_file); g_free (global_file_orig); g_free (user_file); g_free (user_file_orig); networks = empathy_irc_network_manager_get_networks (mgr); - fail_if (g_slist_length (networks) != 5); + g_assert (g_slist_length (networks) == 5); network_checked[0] = network_checked[1] = network_checked[2] = network_checked[3] = network_checked[4] = FALSE; @@ -359,7 +357,7 @@ START_TEST (test_load_both_files) gchar *name; g_object_get (l->data, "name", &name, NULL); - fail_if (name == NULL); + g_assert (name != NULL); if (strcmp (name, "Freenode") == 0) { @@ -388,21 +386,21 @@ START_TEST (test_load_both_files) } else { - fail_if (TRUE); + g_assert_not_reached (); } g_free (name); } - fail_if (!network_checked[0] || !network_checked[1] || !network_checked[2] || - !network_checked[3] || !network_checked[4]); + g_assert (network_checked[0] && network_checked[1] && network_checked[2] && + network_checked[3] && network_checked[4]); g_slist_foreach (networks, (GFunc) g_object_unref, NULL); g_slist_free (networks); g_object_unref (mgr); } -END_TEST -START_TEST (test_modify_user_file) +static void +test_modify_user_file (void) { EmpathyIrcNetworkManager *mgr; EmpathyIrcNetwork *network; @@ -428,13 +426,13 @@ START_TEST (test_modify_user_file) "global-file", &global_file, "user-file", &user_file, NULL); - fail_if (global_file != NULL); - fail_if (user_file == NULL || strcmp (user_file, user_file_orig) != 0); + g_assert (global_file == NULL); + g_assert (user_file != NULL && strcmp (user_file, user_file_orig) == 0); g_free (global_file); g_free (user_file); networks = empathy_irc_network_manager_get_networks (mgr); - fail_if (g_slist_length (networks) != 3); + g_assert (g_slist_length (networks) == 3); network_modified[0] = network_modified[1] = FALSE; /* check networks and servers */ @@ -444,7 +442,7 @@ START_TEST (test_modify_user_file) network = l->data; g_object_get (network, "name", &name, NULL); - fail_if (name == NULL); + g_assert (name != NULL); if (strcmp (name, "GIMPNet") == 0) { @@ -477,7 +475,7 @@ START_TEST (test_modify_user_file) } else { - fail_if (TRUE); + g_assert_not_reached (); } g_free (address); @@ -500,12 +498,12 @@ START_TEST (test_modify_user_file) } else { - fail_if (TRUE); + g_assert_not_reached (); } g_free (name); } - fail_if (!network_modified[0] || !network_modified[1]); + g_assert (network_modified[0] && network_modified[1]); /* Add a new network */ network = empathy_irc_network_new ("Great Server"); @@ -525,7 +523,7 @@ START_TEST (test_modify_user_file) g_free (user_file_orig); networks = empathy_irc_network_manager_get_networks (mgr); - fail_if (g_slist_length (networks) != 3); + g_assert (g_slist_length (networks) == 3); network_checked[0] = network_checked[1] = network_checked[2] = FALSE; /* check networks and servers */ @@ -534,7 +532,7 @@ START_TEST (test_modify_user_file) gchar *name; g_object_get (l->data, "name", &name, NULL); - fail_if (name == NULL); + g_assert (name != NULL); if (strcmp (name, "GIMPNet") == 0) { @@ -553,20 +551,20 @@ START_TEST (test_modify_user_file) } else { - fail_if (TRUE); + g_assert_not_reached (); } g_free (name); } - fail_if (!network_checked[0] || !network_checked[1] || !network_checked[2]); + g_assert (network_checked[0] && network_checked[1] && network_checked[2]); g_slist_foreach (networks, (GFunc) g_object_unref, NULL); g_slist_free (networks); g_object_unref (mgr); } -END_TEST -START_TEST (test_modify_both_files) +static void +test_modify_both_files (void) { EmpathyIrcNetworkManager *mgr; EmpathyIrcNetwork *network; @@ -596,15 +594,15 @@ START_TEST (test_modify_both_files) "global-file", &global_file, "user-file", &user_file, NULL); - fail_if (global_file == NULL || strcmp (global_file, global_file_orig) != 0); - fail_if (user_file == NULL || strcmp (user_file, user_file_orig) != 0); + g_assert (global_file != NULL && strcmp (global_file, global_file_orig) == 0); + g_assert (user_file != NULL && strcmp (user_file, user_file_orig) == 0); g_free (global_file); g_free (global_file_orig); g_free (user_file); g_free (user_file_orig); networks = empathy_irc_network_manager_get_networks (mgr); - fail_if (g_slist_length (networks) != 5); + g_assert (g_slist_length (networks) == 5); network_modified[0] = network_modified[1] = network_modified[2] = network_modified[3] = FALSE; @@ -615,7 +613,7 @@ START_TEST (test_modify_both_files) network = l->data; g_object_get (network, "name", &name, NULL); - fail_if (name == NULL); + g_assert (name != NULL); if (strcmp (name, "GIMPNet") == 0) { @@ -646,7 +644,7 @@ START_TEST (test_modify_both_files) } else { - fail_if (TRUE); + g_assert_not_reached (); } g_free (address); @@ -684,13 +682,13 @@ START_TEST (test_modify_both_files) } else { - fail_if (TRUE); + g_assert_not_reached (); } g_free (name); } - fail_if (!network_modified[0] || !network_modified[1] || !network_modified[2] - || !network_modified[3]); + g_assert (network_modified[0] && network_modified[1] && network_modified[2] + && network_modified[3]); /* Add a new network */ network = empathy_irc_network_new ("Great Server"); @@ -713,7 +711,7 @@ START_TEST (test_modify_both_files) g_free (user_file_orig); networks = empathy_irc_network_manager_get_networks (mgr); - fail_if (g_slist_length (networks) != 4); + g_assert (g_slist_length (networks) == 4); network_checked[0] = network_checked[1] = network_checked[2] = network_checked[3] = FALSE; @@ -723,7 +721,7 @@ START_TEST (test_modify_both_files) gchar *name; g_object_get (l->data, "name", &name, NULL); - fail_if (name == NULL); + g_assert (name != NULL); if (strcmp (name, "GIMPNet") == 0) { @@ -747,21 +745,21 @@ START_TEST (test_modify_both_files) } else { - fail_if (TRUE); + g_assert_not_reached (); } g_free (name); } - fail_if (!network_checked[0] || !network_checked[1] || !network_checked[2] || - !network_checked[3]); + g_assert (network_checked[0] && network_checked[1] && network_checked[2] && + network_checked[3]); g_slist_foreach (networks, (GFunc) g_object_unref, NULL); g_slist_free (networks); g_object_unref (mgr); } -END_TEST -START_TEST (test_empathy_irc_network_manager_find_network_by_address) +static void +test_empathy_irc_network_manager_find_network_by_address (void) { EmpathyIrcNetworkManager *mgr; EmpathyIrcNetwork *network; @@ -776,23 +774,23 @@ START_TEST (test_empathy_irc_network_manager_find_network_by_address) network = empathy_irc_network_manager_find_network_by_address (mgr, "irc.freenode.net"); - fail_if (network == NULL); + g_assert (network != NULL); check_network (network, "Freenode", "UTF-8", freenode_servers, 2); network = empathy_irc_network_manager_find_network_by_address (mgr, "irc.eu.freenode.net"); - fail_if (network == NULL); + g_assert (network != NULL); check_network (network, "Freenode", "UTF-8", freenode_servers, 2); network = empathy_irc_network_manager_find_network_by_address (mgr, "unknown"); - fail_if (network != NULL); + g_assert (network == NULL); g_object_unref (mgr); } -END_TEST -START_TEST (test_no_modify_with_empty_user_file) +static void +test_no_modify_with_empty_user_file (void) { EmpathyIrcNetworkManager *mgr; GSList *networks; @@ -813,26 +811,40 @@ START_TEST (test_no_modify_with_empty_user_file) g_free (user_file_orig); networks = empathy_irc_network_manager_get_networks (mgr); - fail_if (g_slist_length (networks) != 0); + g_assert (g_slist_length (networks) == 0); g_slist_foreach (networks, (GFunc) g_object_unref, NULL); g_slist_free (networks); g_object_unref (mgr); } -END_TEST -TCase * -make_empathy_irc_network_manager_tcase (void) +int +main (int argc, + char **argv) { - TCase *tc = tcase_create ("empathy-irc-network-manager"); - tcase_add_test (tc, test_empathy_irc_network_manager_add); - tcase_add_test (tc, test_load_global_file); - tcase_add_test (tc, test_empathy_irc_network_manager_remove); - tcase_add_test (tc, test_load_user_file); - tcase_add_test (tc, test_load_both_files); - tcase_add_test (tc, test_modify_user_file); - tcase_add_test (tc, test_modify_both_files); - tcase_add_test (tc, test_empathy_irc_network_manager_find_network_by_address); - tcase_add_test (tc, test_no_modify_with_empty_user_file); - return tc; + int result; + + test_init (argc, argv); + + g_test_add_func ("/irc-network-manager/add", + test_empathy_irc_network_manager_add); + g_test_add_func ("/irc-network-manager/load-global-file", + test_load_global_file); + g_test_add_func ("/irc-network-manager/remove", + test_empathy_irc_network_manager_remove); + g_test_add_func ("/irc-network-manager/load-user-file", test_load_user_file); + g_test_add_func ("/irc-network-manager/load-both-files", + test_load_both_files); + g_test_add_func ("/irc-network-manager/modify-user-file", + test_modify_user_file); + g_test_add_func ("/irc-network-manager/modify-both-files", + test_modify_both_files); + g_test_add_func ("/irc-network-manager/find-network-by-address", + test_empathy_irc_network_manager_find_network_by_address); + g_test_add_func ("/irc-network-manager/no-modify-with-empty-user-file", + test_no_modify_with_empty_user_file); + + result = g_test_run (); + test_deinit (); + return result; } diff --git a/tests/check-empathy-irc-network.c b/tests/empathy-irc-network-test.c index b8124a305..313ab0651 100644 --- a/tests/check-empathy-irc-network.c +++ b/tests/empathy-irc-network-test.c @@ -2,14 +2,13 @@ #include <stdio.h> #include <string.h> -#include <check.h> -#include "check-helpers.h" -#include "check-libempathy.h" -#include "check-irc-helper.h" +#include "test-irc-helper.h" +#include "test-helper.h" #include <libempathy/empathy-irc-network.h> -START_TEST (test_empathy_irc_network_new) +static void +test_empathy_irc_network_new (void) { EmpathyIrcNetwork *network; @@ -18,9 +17,9 @@ START_TEST (test_empathy_irc_network_new) g_object_unref (network); } -END_TEST -START_TEST (test_property_change) +static void +test_property_change (void) { EmpathyIrcNetwork *network; @@ -37,7 +36,6 @@ START_TEST (test_property_change) g_object_unref (network); } -END_TEST static gboolean modified; @@ -48,7 +46,8 @@ modified_cb (EmpathyIrcNetwork *network, modified = TRUE; } -START_TEST (test_modified_signal) +static void +test_modified_signal (void) { EmpathyIrcNetwork *network; @@ -59,14 +58,13 @@ START_TEST (test_modified_signal) g_signal_connect (network, "modified", G_CALLBACK (modified_cb), NULL); g_object_set (network, "name", "Network2", NULL); - fail_if (!modified); + g_assert (modified); modified = FALSE; g_object_set (network, "name", "Network2", NULL); - fail_if (modified); + g_assert (!modified); g_object_unref (network); } -END_TEST static void add_servers (EmpathyIrcNetwork *network, @@ -83,12 +81,13 @@ add_servers (EmpathyIrcNetwork *network, servers[i].port, servers[i].ssl); modified = FALSE; empathy_irc_network_append_server (network, server); - fail_if (!modified); + g_assert (modified); g_object_unref (server); } } -START_TEST (test_add_server) +static void +test_add_server (void) { EmpathyIrcNetwork *network; EmpathyIrcServer *server; @@ -119,11 +118,11 @@ START_TEST (test_add_server) /* Now let's remove the 3rd server */ servers = empathy_irc_network_get_servers (network); l = g_slist_nth (servers, 2); - fail_if (l == NULL); + g_assert (l != NULL); server = l->data; modified = FALSE; empathy_irc_network_remove_server (network, server); - fail_if (!modified); + g_assert (modified); /* free the list */ g_slist_foreach (servers, (GFunc) g_object_unref, NULL); @@ -134,9 +133,9 @@ START_TEST (test_add_server) g_object_unref (network); } -END_TEST -START_TEST (test_modified_signal_because_of_server) +static void +test_modified_signal_because_of_server (void) { EmpathyIrcNetwork *network; EmpathyIrcServer *server; @@ -152,25 +151,25 @@ START_TEST (test_modified_signal_because_of_server) /* Change server properties */ modified = FALSE; g_object_set (server, "address", "server2", NULL); - fail_if (!modified); + g_assert (modified); modified = FALSE; g_object_set (server, "port", 6668, NULL); - fail_if (!modified); + g_assert (modified); modified = FALSE; g_object_set (server, "ssl", TRUE, NULL); - fail_if (!modified); + g_assert (modified); empathy_irc_network_remove_server (network, server); modified = FALSE; g_object_set (server, "address", "server3", NULL); /* We removed the server so the network is not modified anymore */ - fail_if (modified); + g_assert (!modified); g_object_unref (network); } -END_TEST -START_TEST (test_empathy_irc_network_set_server_position) +static void +test_empathy_irc_network_set_server_position (void) { EmpathyIrcNetwork *network; GSList *servers, *l; @@ -197,7 +196,7 @@ START_TEST (test_empathy_irc_network_set_server_position) /* get servers list */ servers = empathy_irc_network_get_servers (network); - fail_if (g_slist_length (servers) != 4); + g_assert (g_slist_length (servers) == 4); modified = FALSE; /* server1 go to the last position */ @@ -215,7 +214,7 @@ START_TEST (test_empathy_irc_network_set_server_position) l = l->next; empathy_irc_network_set_server_position (network, l->data, 1); - fail_if (!modified); + g_assert (modified); /* free the list */ g_slist_foreach (servers, (GFunc) g_object_unref, NULL); @@ -224,17 +223,25 @@ START_TEST (test_empathy_irc_network_set_server_position) /* Check if servers are sorted */ check_network (network, "Network1", "UTF-8", test_servers_sorted, 4); } -END_TEST -TCase * -make_empathy_irc_network_tcase (void) +int +main (int argc, + char **argv) { - TCase *tc = tcase_create ("empathy-irc-network"); - tcase_add_test (tc, test_empathy_irc_network_new); - tcase_add_test (tc, test_property_change); - tcase_add_test (tc, test_modified_signal); - tcase_add_test (tc, test_add_server); - tcase_add_test (tc, test_modified_signal_because_of_server); - tcase_add_test (tc, test_empathy_irc_network_set_server_position); - return tc; + int result; + + test_init (argc, argv); + + g_test_add_func ("/irc-network/new", test_empathy_irc_network_new); + g_test_add_func ("/irc-network/property-change", test_property_change); + g_test_add_func ("/irc-network/modified-signal", test_modified_signal); + g_test_add_func ("/irc-network/add-server", test_add_server); + g_test_add_func ("/irc-network/modified-signal-because-of-server", + test_modified_signal_because_of_server); + g_test_add_func ("/irc-network/set-server-position", + test_empathy_irc_network_set_server_position); + + result = g_test_run (); + test_deinit (); + return result; } diff --git a/tests/check-empathy-irc-server.c b/tests/empathy-irc-server-test.c index 52607f221..573967e43 100644 --- a/tests/check-empathy-irc-server.c +++ b/tests/empathy-irc-server-test.c @@ -2,14 +2,13 @@ #include <stdio.h> #include <string.h> -#include <check.h> -#include "check-helpers.h" -#include "check-libempathy.h" -#include "check-irc-helper.h" +#include "test-irc-helper.h" +#include "test-helper.h" #include <libempathy/empathy-irc-server.h> -START_TEST (test_empathy_irc_server_new) +static void +test_empathy_irc_server_new (void) { EmpathyIrcServer *server; @@ -18,14 +17,14 @@ START_TEST (test_empathy_irc_server_new) g_object_unref (server); } -END_TEST -START_TEST (test_property_change) +static void +test_property_change (void) { EmpathyIrcServer *server; server = empathy_irc_server_new ("test.localhost", 6667, TRUE); - fail_if (server == NULL); + g_assert (server != NULL); g_object_set (server, "address", "test2.localhost", @@ -37,7 +36,6 @@ START_TEST (test_property_change) g_object_unref (server); } -END_TEST static gboolean modified = FALSE; @@ -48,46 +46,53 @@ modified_cb (EmpathyIrcServer *server, modified = TRUE; } -START_TEST (test_modified_signal) +static void +test_modified_signal (void) { EmpathyIrcServer *server; server = empathy_irc_server_new ("test.localhost", 6667, TRUE); - fail_if (server == NULL); + g_assert (server != NULL); g_signal_connect (server, "modified", G_CALLBACK (modified_cb), NULL); /* address */ g_object_set (server, "address", "test2.localhost", NULL); - fail_if (!modified); + g_assert (modified); modified = FALSE; g_object_set (server, "address", "test2.localhost", NULL); - fail_if (modified); + g_assert (!modified); /* port */ g_object_set (server, "port", 6668, NULL); - fail_if (!modified); + g_assert (modified); modified = FALSE; g_object_set (server, "port", 6668, NULL); - fail_if (modified); + g_assert (!modified); /* ssl */ g_object_set (server, "ssl", FALSE, NULL); - fail_if (!modified); + g_assert (modified); modified = FALSE; g_object_set (server, "ssl", FALSE, NULL); - fail_if (modified); + g_assert (!modified); g_object_unref (server); } -END_TEST -TCase * -make_empathy_irc_server_tcase (void) +int +main (int argc, + char **argv) { - TCase *tc = tcase_create ("empathy-irc-server"); - tcase_add_test (tc, test_empathy_irc_server_new); - tcase_add_test (tc, test_property_change); - tcase_add_test (tc, test_modified_signal); - return tc; + int result; + + test_init (argc, argv); + + g_test_add_func ("/irc-server/new", test_empathy_irc_server_new); + g_test_add_func ("/irc-server/property-change", test_property_change); + g_test_add_func ("/irc-server/modified-signal", test_modified_signal); + + result = g_test_run (); + test_deinit (); + return result; } diff --git a/tests/empathy-utils-test.c b/tests/empathy-utils-test.c new file mode 100644 index 000000000..896793aa0 --- /dev/null +++ b/tests/empathy-utils-test.c @@ -0,0 +1,33 @@ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#include <libempathy/empathy-utils.h> +#include "test-helper.h" + +static void +test_substring (void) +{ + gchar *tmp; + + tmp = empathy_substring ("empathy", 2, 6); + g_assert (tmp != NULL); + g_assert (strcmp (tmp, "path") == 0); + + g_free (tmp); +} + +int +main (int argc, + char **argv) +{ + int result; + + test_init (argc, argv); + + g_test_add_func ("/utils/substring", test_substring); + + result = g_test_run (); + test_deinit (); + return result; +} diff --git a/tests/check-empathy-helpers.c b/tests/test-helper.c index 5fb8b4a35..8b6cc2937 100644 --- a/tests/check-empathy-helpers.c +++ b/tests/test-helper.c @@ -1,6 +1,6 @@ /* - * check-empathy-helpers.c - Source for some check helpers - * Copyright (C) 2007-2008 Collabora Ltd. + * test-helper.c - Source for some test helper functions + * Copyright (C) 2007-2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -17,17 +17,25 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <stdio.h> #include <stdlib.h> +#include <glib.h> +#include <glib-object.h> -#include <glib/gstdio.h> -#include <gconf/gconf.h> -#include <gconf/gconf-client.h> +#include "test-helper.h" -#include <libempathy/empathy-account-manager.h> +void +test_init (int argc, + char **argv) +{ + g_test_init (&argc, &argv, NULL); + g_type_init (); +} -#include "check-helpers.h" -#include "check-empathy-helpers.h" +void +test_deinit (void) +{ + ; +} gchar * get_xml_file (const gchar *filename) @@ -54,11 +62,11 @@ copy_xml_file (const gchar *orig, sample = get_xml_file (orig); result = g_file_get_contents (sample, &buffer, &length, NULL); - fail_if (!result); + g_assert (result); file = get_user_xml_file (dest); result = g_file_set_contents (file, buffer, length, NULL); - fail_if (!result); + g_assert (result); g_free (sample); g_free (file); diff --git a/tests/check-empathy-helpers.h b/tests/test-helper.h index 5544b80aa..67e371edc 100644 --- a/tests/check-empathy-helpers.h +++ b/tests/test-helper.h @@ -1,6 +1,6 @@ /* - * check-empathy-helpers.c - Source for some check helpers - * Copyright (C) 2007 Collabora Ltd. + * test-helper.h - Header for some test helper functions + * Copyright (C) 2007-2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,16 +16,22 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __CHECK_EMPATHY_HELPERS_H__ -#define __CHECK_EMPATHY_HELPERS_H__ -#include <glib.h> -#include <libempathy/empathy-account.h> +#ifndef __TEST_HELPER_H__ +#define __TEST_HELPER_H__ + +#include <telepathy-glib/account.h> + +void test_init (int argc, + char **argv); + +void test_deinit (void); gchar * get_xml_file (const gchar *filename); gchar * get_user_xml_file (const gchar *filename); void copy_xml_file (const gchar *orig, const gchar *dest); -EmpathyAccount * get_test_account (void); -void destroy_test_account (EmpathyAccount *account); +TpAccount * get_test_account (void); +void destroy_test_account (TpAccount *account); + -#endif /* #ifndef __CHECK_EMPATHY_HELPERS_H__ */ +#endif diff --git a/tests/check-irc-helper.c b/tests/test-irc-helper.c index 477b134c2..ade247f39 100644 --- a/tests/check-irc-helper.c +++ b/tests/test-irc-helper.c @@ -1,4 +1,4 @@ -#include "check-irc-helper.h" +#include "test-irc-helper.h" void check_server (EmpathyIrcServer *server, @@ -10,7 +10,7 @@ check_server (EmpathyIrcServer *server, guint port; gboolean ssl; - fail_if (server == NULL); + g_assert (server != NULL); g_object_get (server, "address", &address, @@ -18,9 +18,9 @@ check_server (EmpathyIrcServer *server, "ssl", &ssl, NULL); - fail_if (address == NULL || strcmp (address, _address) != 0); - fail_if (port != _port); - fail_if (ssl != _ssl); + g_assert (address != NULL && strcmp (address, _address) == 0); + g_assert (port == _port); + g_assert (ssl == _ssl); g_free (address); } @@ -36,18 +36,18 @@ check_network (EmpathyIrcNetwork *network, GSList *servers, *l; guint i; - fail_if (network == NULL); + g_assert (network != NULL); g_object_get (network, "name", &name, "charset", &charset, NULL); - fail_if (name == NULL || strcmp (name, _name) != 0); - fail_if (charset == NULL || strcmp (charset, _charset) != 0); + g_assert (name != NULL && strcmp (name, _name) == 0); + g_assert (charset != NULL && strcmp (charset, _charset) == 0); servers = empathy_irc_network_get_servers (network); - fail_if (g_slist_length (servers) != nb_servers); + g_assert (g_slist_length (servers) == nb_servers); /* Is that the right servers ? */ for (l = servers, i = 0; l != NULL; l = g_slist_next (l), i++) @@ -65,10 +65,10 @@ check_network (EmpathyIrcNetwork *network, "ssl", &ssl, NULL); - fail_if (address == NULL || strcmp (address, _servers[i].address) - != 0); - fail_if (port != _servers[i].port); - fail_if (ssl != _servers[i].ssl); + g_assert (address != NULL && strcmp (address, _servers[i].address) + == 0); + g_assert (port == _servers[i].port); + g_assert (ssl == _servers[i].ssl); g_free (address); } diff --git a/tests/check-irc-helper.h b/tests/test-irc-helper.h index 32a34b60d..e375f6fb6 100644 --- a/tests/check-irc-helper.h +++ b/tests/test-irc-helper.h @@ -1,9 +1,6 @@ #include <stdlib.h> #include <string.h> -#include <check.h> -#include "check-helpers.h" - #include <libempathy/empathy-irc-server.h> #include <libempathy/empathy-irc-network.h> #include <libempathy/empathy-irc-network-manager.h> |