Author: remi
Date: 2008-12-17 11:09:56 +0100 (Wed, 17 Dec 2008)
New Revision: 3145

Modified:
   
software_suite_v2/software/gadgets/tuxdroid-gadget-gmail/trunk/tuxdroid-gadget-gmail/sources/net/karmaLab/tuxDroid/gadgets/MailGadget.java
Log:
* mail host forced to "pop.gmail.com"
* mail protocol forced to "pop3s"
* feedback (tts speech and browser launching on gmail account) when the pop3 is 
not configured in the account

Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-gmail/trunk/tuxdroid-gadget-gmail/sources/net/karmaLab/tuxDroid/gadgets/MailGadget.java
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-gmail/trunk/tuxdroid-gadget-gmail/sources/net/karmaLab/tuxDroid/gadgets/MailGadget.java
  2008-12-17 10:07:25 UTC (rev 3144)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-gmail/trunk/tuxdroid-gadget-gmail/sources/net/karmaLab/tuxDroid/gadgets/MailGadget.java
  2008-12-17 10:09:56 UTC (rev 3145)
@@ -1,21 +1,21 @@
-/* This file is part of "TuxDroid Gadget Mail".
+/* This file is part of "TuxDroid Gadget GMail".
  *    Copyright 2008, kysoh
  *    Author : Yoran Brault
  *    eMail  : softw...@_bad_karma-lab.net (remove _bad_ before sending an 
email)
  *    Site   : http://www.kysoh.com/
  *
- * "TuxDroid Gadget Mail" is free software; you can redistribute it and/or
+ * "TuxDroid Gadget GMail" is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
- * "TuxDroid Gadget Mail" is distributed in the hope that it will be useful,
+ * "TuxDroid Gadget GMail" 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
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public
- * License along with "TuxDroid Gadget Mail"; if not, write to the Free
+ * License along with "TuxDroid Gadget GMail"; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
@@ -58,6 +58,8 @@
         */
        public void mailBox(boolean readOne) throws MessagingException, 
IOException, ClassNotFoundException {
                this.configuration().setPort(-1);
+               this.configuration().setHost("pop.gmail.com");
+               this.configuration().setProtocol(ServerProtocol.pop3s);
                String sessionId = configuration().getHost() + "_" + 
configuration().getPort() + "_" + configuration().getUser();
                State stateAlert = readState(State.class, sessionId + "ALERT");
                State stateRun = readState(State.class, sessionId + "RUN");
@@ -86,7 +88,19 @@
                                break;
                        }
                }
-               store.connect(configuration().getHost(), port, 
configuration().getUser(), configuration().getPassword());
+               try
+               {
+                       store.connect(configuration().getHost(), port, 
configuration().getUser(), configuration().getPassword());
+               }
+               catch (Exception e)
+               {
+                       if (e.toString().contains("[SYS/PERM]"))
+                       {
+                               
BareBonesBrowserLaunch.openURL("http://mail.google.com/mail/?#settings/fwdandpop";);
+                               System.out.println("GMAIL : Can't open the box 
!!");
+                               throwMessage("You must activate the pop3 
service in your Mail account");
+                       }
+               }
                Folder folder = store.getFolder(configuration().getFolder());
                folder.open(Folder.READ_ONLY);
                Message messages[] = folder.getMessages();


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to