[tuxdroid-svn] r4599 - in software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdr
Status: Beta
Brought to you by:
ks156
|
From: jerome <c2m...@c2...> - 2009-04-28 09:58:58
|
Author: jerome Date: 2009-04-28 11:58:49 +0200 (Tue, 28 Apr 2009) New Revision: 4599 Removed: software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/FrenchConfiguration.java Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/fr/resources/gadget.xml software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/gadget.pot software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java Log: * Updated french programs gadget to match other ones. Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/fr/resources/gadget.xml =================================================================== --- software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/fr/resources/gadget.xml 2009-04-28 09:15:22 UTC (rev 4598) +++ software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/fr/resources/gadget.xml 2009-04-28 09:58:49 UTC (rev 4599) @@ -16,35 +16,17 @@ <parameters> <parameter category="Options" - name="useStandard" - description="Use standard channels" - type="boolean" - defaultValue="true" /> - <parameter - category="Options" name="channel" description="Select your channel" - type="enum(ARTE, Canal + France, EuroNews Fr., France 2, France 3, La 5, M6, TF1, TV5)" + type="enum(ARTE,Canal + France,EuroNews Fr.,France 2,France 3,La 5,M6,TF1,TV5 , + AB Channel 1,AB Moteurs,AB4,Action,Animaux,BFM TV,Canal J, + CINE CINEMA CLASSIC,CINE CINEMA EMOTION,CINE CINEMA FAMIZ,CINE CINEMA FRISSON, + CINE CINEMA PREMIER,CINE CINEMA STAR,Cine Fx,Cine Polar,Comédie,Direct 8,Disney Channel, + Encyclopedia,Escales,France 4,Gulli,ITV,LCI,Mangas,Mezzo,NRJ 12,NT1,RTL 9,Série Club, + TF6,TMC,Toute l'histoire,TPS STAR,Virgin 17,Voyage,W9)" defaultValue="TF1" /> <parameter category="Options" - name="useDigital" - description="Use digital channels" - type="boolean" - defaultValue="false" /> - <parameter - category="Options" - name="digitalChannel" - description="Select a digital channel" - type="enum(AB Channel 1, AB Moteurs, AB4, Action, Animaux, BFM TV, Canal J, - CINE CINEMA CLASSIC, CINE CINEMA EMOTION, CINE CINEMA FAMIZ, CINE CINEMA FRISSON, - CINE CINEMA PREMIER, CINE CINEMA STAR, Cine Fx, Cine Polar, Comédie, Direct 8, Disney Channel, - Encyclopedia, Escales, France 4, Gulli, ITV, LCI, Mangas, Mezzo, NRJ 12, NT1, RTL 9, Série Club, - TF6, TMC, Toute l'histoire, TPS STAR, Virgin 17, Voyage, - W9, )" - defaultValue="LCI" /> - <parameter - category="Options" name="tHour" description="Select time frame" type="enum(Morning, Afternoon, Evening)" Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/gadget.pot =================================================================== --- software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/gadget.pot 2009-04-28 09:15:22 UTC (rev 4598) +++ software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/gadget.pot 2009-04-28 09:58:49 UTC (rev 4599) @@ -40,15 +40,6 @@ msgid "Select your channel" msgstr "" -msgid "Select a digital channel" -msgstr "" - -msgid "Use standard channels" -msgstr "" - -msgid "Use digital channels" -msgstr "" - msgid "Give program description" msgstr "" Deleted: software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/FrenchConfiguration.java =================================================================== --- software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/FrenchConfiguration.java 2009-04-28 09:15:22 UTC (rev 4598) +++ software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/FrenchConfiguration.java 2009-04-28 09:58:49 UTC (rev 4599) @@ -1,249 +0,0 @@ -/* This file is part of "tuxdroid programs tv". - * Copyright 2009, kysoh - * Author : Conan Jerome - * eMail : jerome.conan AT kysoh.com - * - * "tuxdroid programs tv" 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 programs tv" 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 programs tv"; 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. - */ - -package com.kysoh.tvPrograms.gadget; - -import com.kysoh.tuxdroid.gadget.framework.gadget.SimpleGadgetConfiguration; - -public class FrenchConfiguration extends SimpleGadgetConfiguration{ - - private String digitalChannel = "Disney Channel"; - private boolean useDigital = false; - private boolean useStandard = true; - private String channel = "ARTE"; - private boolean giveProgramDescription = false; - private boolean giveMorning = false; - private boolean giveAfternoon = false; - private boolean giveEvening = false; - private boolean giveNowPlaying = true; - - private String tHour = "Morning"; - - /** - * Return the selected digital channel. - * @return - */ - public String getDigitalChannel() - { - return this.digitalChannel; - } - - - /** - * Set the digital channel. - * @param aHertzChannel - */ - public void setDigitalChannel(String aDigitalChannel) - { - this.digitalChannel = aDigitalChannel; - } - - /** - * Sets 'morning' 'evening' or 'afternoon' - * @return - */ - public String getTHour() - { - return this.tHour; - } - - /** - * Sets the parameter value. - * @param aTHour - */ - public void setTHour(String aTHour) - { - this.tHour = aTHour; - - if(this.tHour.equalsIgnoreCase("morning")) - { - this.setGiveMorning(true); - } - else if(this.tHour.equalsIgnoreCase("afternoon")) - { - this.setGiveAfternoon(true); - } - else if(this.tHour.equalsIgnoreCase("evening")) - { - this.setGiveEvening(true); - } - } - - - /** - * Return true if user wants to hear digitals channels. - * @return - */ - public boolean getUseDigital() - { - return this.useDigital; - } - - - /** - * Set the 'use digital' parameter value. - * @param aUseDigital - */ - public void setUseDigital(boolean aUseDigital) - { - this.useDigital = aUseDigital; - } - - - /** - * Return true if user wants to hear standart programs. - * @return - */ - public boolean getUseStandard() - { - return this.useStandard; - } - - - /** - * Set the 'use standart' parameters. - * @param aUseStandart - */ - public void setUseStandard(boolean aUseStandard) - { - this.useStandard = aUseStandard; - } - - - /** - * Return the channel. - * @return - */ - public String getChannel() - { - return this.channel; - } - - - /** - * Sets the channel. - * @param aChannel - */ - public void setChannel(String aChannel) - { - this.channel = aChannel; - } - - - /** - * Return true if user wants to hear the programs description. - * @return - */ - public boolean getGiveProgramDescription() - { - return this.giveProgramDescription; - } - - - /** - * Sets to give program desciption parameter. - * @param give - */ - public void setGiveProgramDescription(boolean give) - { - this.giveProgramDescription = give; - } - - - /** - * Sets the 'now playing' parameter. - * @param aNowPlaying - */ - public void setNowPlaying(boolean aNowPlaying) - { - this.giveNowPlaying = aNowPlaying; - } - - - /** - * Return true if user wants to hear the current played program. - * @return - */ - public boolean getGiveNowPlaying() - { - return this.giveNowPlaying; - } - - - /** - * Set the 'give morning' parameter. - * @param aGiveMorning - */ - public void setGiveMorning(boolean aGiveMorning) - { - this.giveMorning = aGiveMorning; - } - - - /** - * Return true if user wants to hear the morning program. - * @return - */ - public boolean getGiveMorning() - { - return this.giveMorning; - } - - - /** - * Return true if user wants to hear the afternoon program. - * @return - */ - public boolean getGiveAfternoon() - { - return this.giveAfternoon; - } - - - /** - * Set the afternnon parameter. - * @param aGiveAfternoon - */ - public void setGiveAfternoon(boolean aGiveAfternoon) - { - this.giveAfternoon = aGiveAfternoon; - } - - - /** - * Return true if user wants to hear the evening prgrams. - * @return - */ - public boolean getGiveEvening() - { - return this.giveEvening; - } - - - /** - * Set the 'give evening' parameter. - * @param aGiveEvening - */ - public void setGiveEvening(boolean aGiveEvening) - { - this.giveEvening = aGiveEvening; - } -} Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java =================================================================== --- software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java 2009-04-28 09:15:22 UTC (rev 4598) +++ software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java 2009-04-28 09:58:49 UTC (rev 4599) @@ -28,7 +28,7 @@ import com.kysoh.tvPrograms.ProgramLoadListener; import com.kysoh.tvPrograms.programs.SimplePrograms; -public class GadgetProgramsTvFr extends SimpleGadget<FrenchConfiguration> implements ProgramLoadListener{ +public class GadgetProgramsTvFr extends SimpleGadget<Configuration> implements ProgramLoadListener{ SimplePrograms french; @@ -44,18 +44,7 @@ configuration().getGiveMorning() || configuration().getGiveNowPlaying()) { SimplePrograms.addProgramLoadListener(this); - - //Make use of standard french channels. - if(this.configuration().getUseStandard()) - { - french = new SimplePrograms(SimplePrograms.FR, this.configuration().getChannel()); - } - //Make use of digital programs - else if(this.configuration().getUseDigital()) - { - this.configuration().setUseDigital(false); - french = new SimplePrograms(SimplePrograms.DIGITAL_FRENCH, this.configuration().getDigitalChannel()); - } + french = new SimplePrograms(SimplePrograms.FR, this.configuration().getChannel()); } else { @@ -84,149 +73,21 @@ { try { - giveProgram(completeProgram); - //Checking if gadget has to release digital program. - if(this.configuration().getUseDigital()) - { - this.configuration().setUseDigital(false); - french = new SimplePrograms(SimplePrograms.DIGITAL_FRENCH, this.configuration().getDigitalChannel()); - } - + GadgetProgramTV.giveProgram(this.configuration(), completeProgram, this); } catch(Exception error) { - this.loadError(null); + ; } } /** - * Used function to give the current tv program. - * @param configuration - */ - public void giveProgram(Vector<Program> programme) - { - - //Give now playing program. - if(this.configuration().getGiveNowPlaying()) - { - Program nowPlaying = SimplePrograms.getNowPlaying(programme); - if(nowPlaying != null) - { - throwMessage("Now playing on {0}. {1}", nowPlaying.getChannel(), nowPlaying.getTitle()); - - Program nextPlaying = SimplePrograms.getNextPlaying(programme, nowPlaying); - - if(nextPlaying != null) - { - throwMessage("Next playing {0} at {1}", nextPlaying.getTitle(), nextPlaying.getStartTime()); - } - } - else - { - throwMessage("No TV program for now"); - } - } - - //Morning program. - if(this.configuration().getGiveMorning()) - { - throwMessage("Your morning TV Programs"); - - if(!this.configuration().getGiveNowPlaying()) - { - throwMessage("On {0}", programme.get(0).getChannel()); - } - - Vector<Program> morning = SimplePrograms.sortMorning(programme); - - if(morning.size() == 0) - { - throwMessage("I didn't find any TV programs according to your selected time frame."); - } - - for(Program oneProgram : morning) - { - if(!this.configuration().getGiveProgramDescription()) - { - throwMessage("{0}, {1}", oneProgram.getStartTime(), oneProgram.getTitle()); - } - else - { - throwMessage("{0}, {1}, {2}", oneProgram.getStartTime(), oneProgram.getTitle(), oneProgram.getDescription()); - } - } - } - - //Afternoon program. - if (this.configuration().getGiveAfternoon()) - { - throwMessage("Your afternoon TV Programs"); - - if(!this.configuration().getGiveNowPlaying()) - { - throwMessage("On {0}", programme.get(0).getChannel()); - } - - Vector<Program> afternoon = SimplePrograms.sortAfternoon(programme); - - if(afternoon.size() == 0) - { - throwMessage("I didn't find any TV programs according to your selected time frame."); - } - - for(Program oneProgram : afternoon) - { - - if(!this.configuration().getGiveProgramDescription()) - { - throwMessage("{0}, {1}", oneProgram.getStartTime(), oneProgram.getTitle()); - } - else - { - throwMessage("{0}, {1}, {2}", oneProgram.getStartTime(), oneProgram.getTitle(), oneProgram.getDescription()); - } - } - } - - //Evening program. - if(this.configuration().getGiveEvening()) - { - throwMessage("Your evening TV Programs"); - - if(!this.configuration().getGiveNowPlaying()) - { - throwMessage("On {0}", programme.get(0).getChannel()); - } - - Vector<Program> evening = SimplePrograms.sortEvening(programme); - - if(evening.size() == 0) - { - throwMessage("I didn't find any TV programs according to your selected time frame."); - } - - for(Program oneProgram : evening) - { - if(!this.configuration().getGiveProgramDescription()) - { - throwMessage("{0}, {1}", oneProgram.getStartTime(), oneProgram.getTitle()); - } - else - { - throwMessage("{0}, {1}, {2}", oneProgram.getStartTime(), oneProgram.getTitle(), oneProgram.getDescription()); - } - } - } - } - - - /** * Main entry point. * @param args */ public static void main(String[] args) { - new GadgetProgramsTvFr().boot(args, new FrenchConfiguration()); + new GadgetProgramsTvFr().boot(args, new Configuration()); } } |