It is currently Sat Nov 26, 2011 8:26 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: FS#248 - disable tray icon on 64 bit machines
PostPosted: Sun Mar 22, 2009 12:03 am 
Offline
Developer

Joined: Mon Apr 28, 2008 11:33 pm
Posts: 36
Here is a quick patch that i have written to disable the tray icon when using a 64bit JRE on windows. It only effects TedSystemInfo.java and gives the user no indication as to why they can't have the system tray. The problem with the system tray seems to lie with using the 64bit jre rather than the 64bit windows itself. at the moment i am running the 32bit jre on vista ultimate 64bit and the tray icon is working without a problem. If you would like me to go further and add a message for the user/log message etc i can.

gb

p.s. this is in relation to https://ted.nu/bugs/index.php?do=details&task_id=248&project=1

Code:
Index: ted/TedSystemInfo.java
===================================================================
--- ted/TedSystemInfo.java   (revision 729)
+++ ted/TedSystemInfo.java   (working copy)
@@ -8,6 +8,7 @@
   private static boolean isHeadless=false;
   private static boolean saveLocal;
   private static final String osname = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
+   private static final String jrearch =System.getProperty("os.arch").toLowerCase();
   
   public static final String MINIMUM_JAVA = "1.5";
   
@@ -18,7 +19,7 @@
   public static boolean osSupportsTray()
   {
      // return if the tray program supports the current os ted is running on   
-      if (osIsWindows() || osIsMac() || osIsLinux() || osIsSolaris()) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+      if ((osIsWindows() && !isJre64Bit() )|| osIsMac() || osIsLinux() || osIsSolaris()) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
      {
         return true;
      }
@@ -248,6 +249,12 @@
      TedSystemInfo.isHeadless = isHeadless;
   }
   
-   
+   public static boolean isJre64Bit()
+   {
+      if(jrearch.contains("64"))
+         return true;
+      
+      return false;
+   }

}


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 22, 2009 12:11 pm 
Offline
Lead Developer
User avatar

Joined: Mon Jan 16, 2006 5:46 pm
Posts: 904
Location: Netherlands
Oki, thanks! Looks like a good enough fix.

I'm not sure if you should warn the user that the tray icon has been disabled. Might become quite annoying if you get this message every time you start ted.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 29, 2009 2:23 pm 
Offline
Lead Developer
User avatar

Joined: Mon Jan 16, 2006 5:46 pm
Posts: 904
Location: Netherlands
Hi gb, I added your fix to the code! Thanks again.

If it would be possible for you could you also disable the tray options in the preferences menu if the user is using 64jre? Maybe the explanation can be shown there why this option is disabled. It'll also be added to the readme file so the user knows what's going on.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 30, 2009 2:19 pm 
Offline
Developer

Joined: Mon Apr 28, 2008 11:33 pm
Posts: 36
Hi Jofo, i shall do that when i get some time. What steps do i need to take to setup strings for translation?

I've also got some questions about the general interaction of certain internal classes of Ted ( i thought i might take a look at adding support for anime series) but i will start a seperate thread for that.

cheers,

gb


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 30, 2009 5:51 pm 
Offline
Developer

Joined: Mon Apr 28, 2008 11:33 pm
Posts: 36
regarding the Options panel, is it alright for me to hide the options (add to systray and start minimised) and dislay a label there instead?
Image

gb


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 30, 2009 10:13 pm 
Offline
Lead Developer
User avatar

Joined: Mon Jan 16, 2006 5:46 pm
Posts: 904
Location: Netherlands
itsmegb wrote:
Hi Jofo, i shall do that when i get some time. What steps do i need to take to setup strings for translation?

In the translations folder you can find the tedlang.properties file which contains all the strings in ted. The format of the file is self explanatory. If you would then want to use the string in the code use the following command for example:
Lang.getString("TedConfigDialog.LabelLanguage")

Quote:
regarding the Options panel, is it alright for me to hide the options (add to systray and start minimised) and dislay a label there instead?

Hmm... I think I would still show the checkboxes but disable them. Otherwise you could just as well show nothing. But this is a tricky one. I'll discuss it with roel and come back to you on this tomorrow.

Quote:
I've also got some questions about the general interaction of certain internal classes of Ted ( i thought i might take a look at adding support for anime series) but i will start a seperate thread for that.

Please look at this thread. I just made a post there about this issue.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 30, 2009 10:37 pm 
Offline
Lead Developer
User avatar

Joined: Mon Jan 16, 2006 4:11 pm
Posts: 645
Location: Netherlands
I think showing a label is nice, but I suggest you keep the checkboxes visible so users have an idea what they miss. just add a label under them explaining why they are disabled will do.

I changed your implementation a bit such that the 64 bit string is also checked for linux and mac since I am afraid the trayicon will not work there either... So be sure to grab the latest version of the systeminfo file before you start implementing this ui.

_________________
Roel

i watch: simpsons, south park, lost, top gear, true blood & fringe
download - documentation - bugs/feature requests - sourceforge -


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 30, 2009 11:33 pm 
Offline
Developer

Joined: Mon Apr 28, 2008 11:33 pm
Posts: 36
ok cool, regarding the 64bit linux implementation, may i point out this post i made a year ago :P

https://ted.nu/forum/viewtopic.php?t=1488&highlight=

gb

Edit: i think i still have a copy of the files that i linked to in the original post if you still want them!


Top
 Profile  
 
 Post subject: Re: FS#248 - disable tray icon on 64 bit machines
PostPosted: Sat Feb 13, 2010 10:46 am 
Offline

Joined: Sat Feb 13, 2010 10:43 am
Posts: 3
Can someone tell me how to import the patch?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group