|
|
|
|
|
|
||
|
/****************************************************************************/ /**
**/ /** Copyright
(c) 2005 Diodia Software (http://www.diodia.com/) **/ /**
**/ /** Use in any
form with or without modification for commercial and non- **/ /** commercial
purposes is permitted. **/ /**
**/ /****************************************************************************/ #include "stdafx.h"
#include "Helper.h" #include "ContextC.h" #include "CommandC.h" #include "RssDownloaderC.h" #include "RssFeedC.h" #include "RssHelpers.h"
/****************************************************************************/ /* /* DESCRIPTION : New feeds have been downloaded. /* /* RETURN VALUE: None /* /****************************************************************************/ void ContextC::RegistryChanged(HKEY MainKey, const char *SubKey) { UpdateFeedDisplay(); }
/****************************************************************************/ /* /* DESCRIPTION : New feeds have been downloaded. /* /* RETURN VALUE: None /* /****************************************************************************/ void ContextC::UpdateFeedDisplay() { RssFeedC *Feed; RssItemC *Item; std::string Name; std::string Address; char NameVal[32]; char AddressVal[32]; int Index = 0;
if (!RssDownloader.LockRegistry()) return;
mMultiFeed.Clear();
while (true) { sprintf(NameVal, "Name%d", Index); sprintf(AddressVal, "Address%d", Index);
Name = RegistryReadString(HKEY_CURRENT_USER, REG_KEY "\\Feeds", NameVal); Address = RegistryReadString(HKEY_CURRENT_USER, REG_KEY "\\Feeds", AddressVal);
if (Name.empty() || Address.empty()) break;
Feed = new RssFeedC(FeedNameToFileName(RssDownloader.GetFeedDirectory(), Name.c_str()).c_str());
UpdateRssFeed(Feed);
Feed->SetTitle(Name.c_str());
mMultiFeed.AddFeed(Feed);
Index++; }
RssDownloader.UnlockRegistry();
CommandC *FeedList = ((CommandC *) FindCommand("RSS Feeds Toolbar.FeedList"));
FeedList->ClearItemList();
if (mMultiFeed.GetNoOfItems() <= 0) return;
for (int Idx = 0; Idx < mFeedListSize && Idx < mMultiFeed.GetNoOfItems(); Idx++) { Item = mMultiFeed.GetNthItem(mMultiFeed.GetNoOfItems() - 1 - Idx);
FeedList->AddItem(FeedItemToDisplayString(Item).c_str()); }
FeedList->SetSelected(0);
FeedItemSelected(FeedList->GetItemList()->mList[0].c_str()); }
|
Source Files Commands.cpp Context.cpp CreatePath.cpp DateParser.cpp DlgEditFeedC.cpp DlgManageFeedsC.cpp Hook.cpp Iso8601.cpp MsXmlMisc.cpp MsXmlSelect.cpp RegistryNotify.cpp RegistryUtil.cpp RSS.cpp RSS.def RSS.idl RssAction.cpp RssDownloader.cpp RssFeed.cpp RssHelpers.cpp RssInit.cpp RssItem.cpp RssMultiFeed.cpp RssTimer.cpp RssXml.cpp StdAfx.cpp Header Files Commands.h ContextC.h DateParser.h DlgEditFeedC.h DlgManageFeedsC.h Helper.h HookC.h RegistryNotify.h RegistryNotifyC.h Resource.h RssDownloaderC.h RssFeedC.h RssHelpers.h RssItemC.h RssMultiFeedC.h StdAfx.h ThreadObject.h XmlHelpers.h Resource Files about.htm DiodiaLogoSmall.gif logo.bmp manifest.xml read.bmp RSS.rc RSS.rgs ToolBandLayout.xml |
|
|
© 2002-2009 Diodia Software |
||