|
From: <gre...@us...> - 2007-04-26 15:21:53
|
Revision: 346
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=346&view=rev
Author: gregmac45
Date: 2007-04-26 08:16:31 -0700 (Thu, 26 Apr 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/plugins/OnlinePhotos/Flickr.cs
trunk/plugins/OnlinePhotos/MyClass.cs
Modified: trunk/plugins/OnlinePhotos/Flickr.cs
===================================================================
--- trunk/plugins/OnlinePhotos/Flickr.cs 2007-04-26 00:24:38 UTC (rev 345)
+++ trunk/plugins/OnlinePhotos/Flickr.cs 2007-04-26 15:16:31 UTC (rev 346)
@@ -58,12 +58,14 @@
}
public static List<MyPhoto> getPhotosByTag(String tag)
{
- Photos photos = _flickr.PhotosSearch(tag,"");
+ PhotoSearchExtras extras = new PhotoSearchExtras();
+ Photos photos = _flickr.PhotosSearch(
+ tag,TagMode.AllTags,"",extras);
return loadMyPhotoList(photos);
}
public static List<MyPhoto> getPhotosByText(String text)
{
- Photos photos = _flickr.PhotosSearchText(text, "");
+ Photos photos = _flickr.PhotosSearchText(text);
return loadMyPhotoList(photos);
}
private static List<MyPhoto> loadMyPhotoList(Photos photos)
Modified: trunk/plugins/OnlinePhotos/MyClass.cs
===================================================================
--- trunk/plugins/OnlinePhotos/MyClass.cs 2007-04-26 00:24:38 UTC (rev 345)
+++ trunk/plugins/OnlinePhotos/MyClass.cs 2007-04-26 15:16:31 UTC (rev 346)
@@ -180,15 +180,38 @@
{
//_log.Info("onPageLoad state home");
GUIPropertyManager.SetProperty("#header.label", "Online Photos");
+ DisplayHome();
//DisplaySites();
}
+ else if (_CurrentState == State.categories)
+ {
+ DisplayCurrentPhotos();
+ }
currentView = View.Icons;
ChangeFacadeView();
base.OnPageLoad();
}
-
+ public override void OnAction(Action action)
+ {
+ if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU)
+ {
+ if (_CurrentState == State.videos)
+ {
+ //DisplayCategories();
+ //_CurrentState = State.categories;
+ //return;
+ }
+ else if (_CurrentState == State.categories)
+ {
+ DisplayHome();
+ _CurrentState = State.home;
+ return;
+ }
+ }
+ base.OnAction(action);
+ }
protected override void OnPageDestroy(int new_windowId)
{
@@ -205,6 +228,41 @@
{
OnSlideShow();
}
+ else if (control == facadeView)
+ {
+ String SelectedSiteId = facadeView.SelectedListItem.Path;
+ switch (SelectedSiteId)
+ {
+ case "1":
+ DisplayInterestingFlickrPhotos();
+ _CurrentState = State.categories;
+ break;
+ case "2":
+ DisplayRecentFlickrPhotos();
+ _CurrentState = State.categories;
+ break;
+ case "3":
+ string q = "";
+ if (GetUserInputString(ref q))
+ {
+
+ DisplayFlickrPhotosWithTags(q);
+ _CurrentState = State.categories;
+
+ }
+ break;
+ case "4":
+ string text = "";
+ if (GetUserInputString(ref text))
+ {
+
+ DisplayFlickrPhotosWithText(text);
+ _CurrentState = State.categories;
+
+ }
+ break;
+ }
+ }
}
public void DisplayInterestingFlickrPhotos()
{
@@ -222,6 +280,21 @@
CurrentPhotoList = MyFlickr.getPhotosByTag(tags);
DisplayCurrentPhotos();
}
+ public void DisplayFlickrPhotosWithText(String text)
+ {
+ CurrentPhotoList = MyFlickr.getPhotosByText(text);
+ DisplayCurrentPhotos();
+ }
+ private bool GetUserInputString(ref string sString)
+ {
+ VirtualKeyboard keyBoard = (VirtualKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_KEYBOARD);
+ keyBoard.Reset();
+ keyBoard.IsSearchKeyboard = true;
+ keyBoard.Text = sString;
+ keyBoard.DoModal(GetID); // show it...
+ if (keyBoard.IsConfirmed) sString = keyBoard.Text;
+ return keyBoard.IsConfirmed;
+ }
public void DisplayCurrentPhotos()
{
facadeView.Clear();
@@ -442,7 +515,7 @@
Log.Error(e);
}
}
- private void DisplaySites()
+ private void DisplayHome()
{
//facadeView.Clear();
GUIControl.ClearControl(GetID, facadeView.GetID);
@@ -450,17 +523,32 @@
GUIListItem loListItem;
//foreach (Site loSite in moSiteList.Values)
//{
- loListItem = new GUIListItem("Flickr");
+ loListItem = new GUIListItem("Flickr - Interesting Photos");
loListItem.Path = "1";
loListItem.IsFolder = true;
MediaPortal.Util.Utils.SetDefaultIcons(loListItem);
facadeView.Add(loListItem);
-
- loListItem = new GUIListItem("Picasa Web");
+
+ loListItem = new GUIListItem("Flickr - Recent Photos");
loListItem.Path = "2";
loListItem.IsFolder = true;
MediaPortal.Util.Utils.SetDefaultIcons(loListItem);
facadeView.Add(loListItem);
+
+
+ loListItem = new GUIListItem("Flickr - Search by tag");
+ loListItem.Path = "3";
+ loListItem.IsFolder = true;
+ MediaPortal.Util.Utils.SetDefaultIcons(loListItem);
+ facadeView.Add(loListItem);
+
+ loListItem = new GUIListItem("Flickr - Search by text");
+ loListItem.Path = "4";
+ loListItem.IsFolder = true;
+ MediaPortal.Util.Utils.SetDefaultIcons(loListItem);
+ facadeView.Add(loListItem);
+
+
//}
//GUIPropertyManager.SetProperty("#itemcount", facadeView.Count-1 + "");
}
@@ -516,7 +604,7 @@
GUIListItem item = facadeView[i];
if (!item.IsFolder && !item.IsRemote)
{
- SlideShow.Add(CurrentPhotoList[i].smallUrl);
+ SlideShow.Add(facadeView[i].ThumbnailImage);
}
i++;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|