Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=8f7f6555f087fe496acf084fc630e69605d0046f
commit 8f7f6555f087fe496acf084fc630e69605d0046f Author: bouleetbil <[email protected]> Date: Tue Sep 14 23:26:20 2010 +0200 *fixes RSS timer check diff --git a/frugal-mono-tools/Fen_Menu.cs b/frugal-mono-tools/Fen_Menu.cs index d43b838..00bc6b0 100644 --- a/frugal-mono-tools/Fen_Menu.cs +++ b/frugal-mono-tools/Fen_Menu.cs @@ -18,6 +18,7 @@ using System; using Gdk; using Gtk; +using Rss; using System.Timers; namespace frugalmonotools @@ -50,6 +51,8 @@ namespace frugalmonotools WID_Config fen_config ; WID_Hardware fen_hardware ; WID_LoginManager fen_loginManager; + + string CurrentWidget=""; protected Gtk.TreeIter iter; public Fen_Menu () : base(Gtk.WindowType.Toplevel) @@ -123,7 +126,7 @@ namespace frugalmonotools private void SelectModule(string module) { - + CurrentWidget=module; this.HBOX_Details.Destroy(); this.HBOX_Details = new global::Gtk.HBox (); this.HBOX_Details.SetSizeRequest(680,500); @@ -226,26 +229,32 @@ namespace frugalmonotools } private void checkRSS(object source, ElapsedEventArgs e) { - //FIX ME - /* //RSS try{ - modelFlux.Clear(); - rssFeed =RssFeed.Read(UrlPlanet); + if (CurrentWidget==cch_news) + { + fen_news.CheckRss(); + return; + } + RssFeed rssFeed =RssFeed.Read(MainClass.UrlPlanet); RssChannel rssChannel = (RssChannel)rssFeed.Channels[0]; - - int i = 0; string latest=""; foreach (RssItem item in rssChannel.Items) { - string titre=item.Title; if(latest =="")latest=item.Link.AbsoluteUri.ToString(); - modelFlux.AppendValues(titre,i); - i++; + if (MainClass.cache.GetLatest()!=latest) + { + Outils.Inform("Frugalware","News are available."); + //write cache + MainClass.cache.SetLatest(latest); + MainClass.cache.CacheSave(); + } + return; } - InformNewFlux(latest); + } - catch{} */ + catch{} + } diff --git a/frugal-mono-tools/Main.cs b/frugal-mono-tools/Main.cs index 5332ff4..b28b343 100644 --- a/frugal-mono-tools/Main.cs +++ b/frugal-mono-tools/Main.cs @@ -32,6 +32,7 @@ namespace frugalmonotools { class MainClass { + public static string UrlPlanet="http://planet.frugalware.org/feed.php?type=rss"; //pacman-g2 initialise public static PacmanG2 pacmanG2 = new PacmanG2(); public static Configuration configuration = new Configuration(); diff --git a/frugal-mono-tools/WID_News.cs b/frugal-mono-tools/WID_News.cs index 62ac88f..8f25ea3 100644 --- a/frugal-mono-tools/WID_News.cs +++ b/frugal-mono-tools/WID_News.cs @@ -32,7 +32,7 @@ namespace frugalmonotools //HTML htl; //RSS - const string UrlPlanet="http://planet.frugalware.org/feed.php?type=rss"; + ListStore modelFlux = new ListStore (typeof (string),typeof (int)); RssFeed rssFeed ; //RSS FluxRss; @@ -49,11 +49,15 @@ namespace frugalmonotools scroll.Add(webview); this.vbox5.Add (this.scroll); this.scroll.ShowAll(); + CheckRss(); - //RSS + } + public void CheckRss() + { + //RSS try{ CBO_TitleNews.Model=modelFlux; - rssFeed =RssFeed.Read(UrlPlanet); + rssFeed =RssFeed.Read(MainClass.UrlPlanet); RssChannel rssChannel = (RssChannel)rssFeed.Channels[0]; int i = 0; @@ -68,9 +72,9 @@ namespace frugalmonotools InformNewFlux(latest); } catch{} + } - - private void InformNewFlux(string latest) + public void InformNewFlux(string latest) { if (MainClass.cache.GetLatest()!=latest) { _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
