You can subscribe to this list here.
2007 |
Jan
(36) |
Feb
(79) |
Mar
(123) |
Apr
(95) |
May
(119) |
Jun
(172) |
Jul
(124) |
Aug
(100) |
Sep
(83) |
Oct
(52) |
Nov
(97) |
Dec
(87) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(131) |
Feb
(80) |
Mar
(163) |
Apr
(178) |
May
(73) |
Jun
(54) |
Jul
(106) |
Aug
(118) |
Sep
(50) |
Oct
(125) |
Nov
(100) |
Dec
(99) |
2009 |
Jan
(104) |
Feb
(99) |
Mar
(68) |
Apr
(81) |
May
(52) |
Jun
(87) |
Jul
(67) |
Aug
(33) |
Sep
(27) |
Oct
(37) |
Nov
(60) |
Dec
(116) |
2010 |
Jan
(82) |
Feb
(79) |
Mar
(38) |
Apr
(50) |
May
(45) |
Jun
(53) |
Jul
(23) |
Aug
(86) |
Sep
(22) |
Oct
(96) |
Nov
(97) |
Dec
(73) |
2011 |
Jan
(24) |
Feb
(45) |
Mar
(28) |
Apr
(31) |
May
(42) |
Jun
(25) |
Jul
|
Aug
(12) |
Sep
(28) |
Oct
(13) |
Nov
(43) |
Dec
(13) |
2012 |
Jan
(62) |
Feb
(28) |
Mar
(6) |
Apr
(16) |
May
(7) |
Jun
|
Jul
(16) |
Aug
(2) |
Sep
(1) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
2013 |
Jan
(5) |
Feb
|
Mar
(34) |
Apr
(9) |
May
(6) |
Jun
(10) |
Jul
(32) |
Aug
(8) |
Sep
(11) |
Oct
(35) |
Nov
(24) |
Dec
(22) |
2014 |
Jan
(44) |
Feb
(9) |
Mar
(9) |
Apr
(15) |
May
(25) |
Jun
(34) |
Jul
(16) |
Aug
(11) |
Sep
(7) |
Oct
(6) |
Nov
(1) |
Dec
(12) |
2015 |
Jan
(33) |
Feb
(19) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(5) |
From: <che...@us...> - 2007-06-20 17:16:11
|
Revision: 573 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=573&view=rev Author: chef_koch Date: 2007-06-20 10:16:03 -0700 (Wed, 20 Jun 2007) Log Message: ----------- no code change, just a reorder of the some methods Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 12:27:51 UTC (rev 572) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 17:16:03 UTC (rev 573) @@ -526,28 +526,6 @@ } } - GUIListItem GetSelectedItem() - { - return facadeView.SelectedListItem; - } - - int GetSelectedItemNo() - { - return facadeView.SelectedListItemIndex; - } - - int GetCurrentFatherID() - { - if (lastApp != null) - { - return lastApp.AppID; - } - else - { - return -1; // root - } - } - public int StartWindow { get { return startWindow; } @@ -671,7 +649,28 @@ } } + GUIListItem GetSelectedItem() + { + return facadeView.SelectedListItem; + } + int GetSelectedItemNo() + { + return facadeView.SelectedListItemIndex; + } + + int GetCurrentFatherID() + { + if (lastApp != null) + { + return lastApp.AppID; + } + else + { + return -1; // root + } + } + bool RefreshButtonVisible() { if (lastApp == null) @@ -729,158 +728,83 @@ base.OnPageDestroy(newWindowId); } - public override void Render(float timePassed) + public override void OnAction(Action action) { - base.Render(timePassed); - - if (ThumbnailPath != _lastThumbnailPath) + switch (action.wID) { - screenShotImage.FileName = ThumbnailPath; - facadeView.FilmstripView.InfoImageFileName = ThumbnailPath; - facadeView.FilmstripView.NeedRefresh(); - - _lastThumbnailPath = ThumbnailPath; + case Action.ActionType.ACTION_PARENT_DIR: + case Action.ActionType.ACTION_PREVIOUS_MENU: + // <U> keypress + BackItemClicked(); + UpdateButtons(); + break; + case Action.ActionType.ACTION_CLOSE_DIALOG: + SaveFolderSettings(""); + GUIWindowManager.ShowPreviousWindow(); + break; + case Action.ActionType.ACTION_SHOW_INFO: + OnInfo(); + break; + default: + base.OnAction(action); + break; } - - RenderThumbnail(timePassed); } - /* public override void AllocResources() - { - base.AllocResources(); - if (screenShotImage != null) screenShotImage.AllocResources(); - } - public override void FreeResources() - { - base.FreeResources(); - if (screenShotImage != null) screenShotImage.FreeResources(); - }*/ - - /* public override void Render(float timePassed) - { - base.Render(timePassed); - RenderFilmStrip(); - RenderScreenShot(timePassed); - } - */ - void OnInfo() + public override bool OnMessage(GUIMessage message) { - // <F3> keypress - if (null != lastApp) + switch (message.Message) { - selectedItemIndex = GetSelectedItemNo(); - GUIListItem item = GetSelectedItem(); - - FileItem curFile = null; - - if (!item.Label.Equals(ProgramUtils.cBackLabel) && (!item.IsFolder)) - { - if ((item.MusicTag != null) && (item.MusicTag is FileItem)) + case GUIMessage.MessageType.GUI_MSG_ITEM_FOCUS_CHANGED: { - curFile = (FileItem)item.MusicTag; - } - // show file info but only if the selected item is not the back button - bool ovVisible = mapSettings.OverviewVisible; - ProgramInfoAction modalResult = ProgramInfoAction.LookupFileInfo; - int selectedFileID = -1; - lastApp.OnInfo(item, ref ovVisible, ref modalResult, ref selectedFileID); - if ((null != curFile) && (modalResult == ProgramInfoAction.LookupFileInfo)) - { - FileItem scrapeFile = lastApp.Files.GetFileItemByID(selectedFileID); - if (null != scrapeFile) + int iControl = message.SenderControlId; + if (iControl == facadeView.GetID) { - int scrapeIndex = lastApp.Files.IndexOf(scrapeFile); - if (-1 != scrapeIndex) + if (lastApp != null) { - GUIControl.SelectItemControl(GetID, facadeView.GetID, scrapeIndex + 1); + lastApp.ResetThumbs(); } - ScrapeFileInfo(scrapeFile); } } - mapSettings.OverviewVisible = ovVisible; - UpdateListControl(); - } + break; } + return base.OnMessage(message); } - void ScrapeFileInfo(FileItem curFile) + protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) { - int minRelevance = 30; - bool bSuccess = false; - ScraperSaveType saveType = ScraperSaveType.DataAndImages; - GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_OK); - GUIDialogProgress dlgProgress = (GUIDialogProgress)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_PROGRESS); - dlgProgress.ShowWaitCursor = false; - dlgProgress.ShowProgressBar(false); - dlgProgress.SetHeading("Lookup Gameinfo"); - dlgProgress.SetLine(1, curFile.Title); - dlgProgress.SetLine(2, curFile.System_); - dlgProgress.SetLine(3, ""); - dlgProgress.StartModal(GetID); - // dlgProgress.SetPercentage(60); - dlgProgress.Progress(); - bSuccess = curFile.FindFileInfo(ScraperType.ALLGAME); - if ((bSuccess && curFile.FileInfoList.Count > 0) && ((FileItemInfo)(curFile.FileInfoList[0])).RelevanceNorm >= minRelevance) + base.OnClicked(controlId, control, actionType); + if (control == btnViewAs) { - GUIDialogSelect pDlg = (GUIDialogSelect)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_SELECT); - if (null != pDlg) - { - pDlg.Reset(); - pDlg.SetHeading("Select Title"); - foreach (FileItemInfo item in curFile.FileInfoList) - { - if (item.RelevanceNorm >= minRelevance) - { - pDlg.Add(String.Format("{0} ({1})", item.Title, item.Platform)); - } - } - pDlg.DoModal(GetID); + mapSettings.SwitchToNextView(); + ShowThumbPanel(); - // and wait till user selects one - int iSelectedGame = pDlg.SelectedLabel; - if (iSelectedGame < 0) return; - - dlgProgress.StartModal(GetID); - dlgProgress.Progress(); - dlgProgress.ShowProgressBar(false); - curFile.FileInfoFavourite = (FileItemInfo)curFile.FileInfoList[iSelectedGame]; - - curFile.FindFileInfoDetail(lastApp, curFile.FileInfoFavourite, ScraperType.ALLGAME, saveType); - if ((saveType == ScraperSaveType.DataAndImages) || (saveType == ScraperSaveType.Data)) - { - // dlgProgress.SetPercentage(60); - dlgProgress.Progress(); - curFile.SaveFromFileInfoFavourite(); - } - // dlgProgress.SetPercentage(100); - dlgProgress.Progress(); - dlgProgress.Close(); - dlgProgress = null; - } - OnInfo(); } - else + else if (control == btnRefresh) { - string strMsg = ""; - if (!bSuccess) + if (lastApp != null) { - strMsg = "Connection failed"; - Log.Info("myPrograms: RefreshData failed"); + lastApp.Refresh(true); + lastFilepath = lastApp.DefaultFilepath(); + // todo: reset viewHandler + UpdateButtons(); + UpdateListControl(); } - else + } + else if (control == btnViews) + { + OnShowViews(); + } + else if (control == facadeView) + { + // application or file-item was clicked.... + if (actionType == Action.ActionType.ACTION_SELECT_ITEM) { - strMsg = String.Format("No match for '{0}'", curFile.Title); - Log.Info("myPrograms: No data found for '{0}'", curFile.Title); + OnClick(); } - if (null != dlgOk) - { - dlgOk.SetHeading(187); - dlgOk.SetLine(1, strMsg); - dlgOk.SetLine(2, String.Empty); - dlgOk.DoModal(GetID); - } } } + protected override void OnShowContextMenu() { GUIListItem item = facadeView.SelectedListItem; @@ -910,137 +834,44 @@ } } - protected void OnShowViews() + public override void Render(float timePassed) { - GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); - if (dlg == null) return; - dlg.Reset(); - dlg.SetHeading(499); // Actions - dlg.Add(GUILocalizeStrings.Get(100000 + GetID)); // Files - foreach (ViewDefinition view in DatabaseSettings.viewHandler.Views) + base.Render(timePassed); + + if (ThumbnailPath != _lastThumbnailPath) { - dlg.Add(view.LocalizedName); + screenShotImage.FileName = ThumbnailPath; + facadeView.FilmstripView.InfoImageFileName = ThumbnailPath; + facadeView.FilmstripView.NeedRefresh(); + + _lastThumbnailPath = ThumbnailPath; } - dlg.DoModal(GetID); - if (dlg.SelectedLabel == -1) return; - if (dlg.SelectedLabel == 0) - { - int nNewWindow = (int)Window.WINDOW_FILES; - StartWindow = nNewWindow; - ActualView = ""; - DatabaseSettings.viewHandler.CurrentView = null; - if (nNewWindow != GetID) - { - GUIWindowManager.ReplaceWindow(nNewWindow); - } - } - else - { - ViewDefinition selectedView = (ViewDefinition)DatabaseSettings.viewHandler.Views[dlg.SelectedLabel - 1]; - DatabaseSettings.viewHandler.CurrentView = selectedView.Name; - ActualView = selectedView.Name; - int nNewWindow = (int)Window.WINDOW_FILES; - if (GetID != nNewWindow) - { - StartWindow = nNewWindow; - if (nNewWindow != GetID) - { - GUIWindowManager.ReplaceWindow(nNewWindow); - } - } - else - { - if (facadeView.Count <= 0) - { - GUIControl.FocusControl(GetID, btnViewAs.GetID); - } - } - } - if (lastApp != null) - { - lastApp.LoadFiles(); - } - UpdateButtons(); - UpdateListControl(); + + RenderThumbnail(timePassed); } - - protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) + #region old (maybe obsolete) code: AllocResources() / FreeResources() / Render(float timePassed) + /* + public override void AllocResources() { - base.OnClicked(controlId, control, actionType); - if (control == btnViewAs) - { - mapSettings.SwitchToNextView(); - ShowThumbPanel(); - - } - else if (control == btnRefresh) - { - if (lastApp != null) - { - lastApp.Refresh(true); - lastFilepath = lastApp.DefaultFilepath(); - // todo: reset viewHandler - UpdateButtons(); - UpdateListControl(); - } - } - else if (control == btnViews) - { - OnShowViews(); - } - else if (control == facadeView) - { - // application or file-item was clicked.... - if (actionType == Action.ActionType.ACTION_SELECT_ITEM) - { - OnClick(); - } - } + base.AllocResources(); + if (screenShotImage != null) screenShotImage.AllocResources(); } - public override bool OnMessage(GUIMessage message) + public override void FreeResources() { - switch (message.Message) - { - case GUIMessage.MessageType.GUI_MSG_ITEM_FOCUS_CHANGED: - { - int iControl = message.SenderControlId; - if (iControl == facadeView.GetID) - { - if (lastApp != null) - { - lastApp.ResetThumbs(); - } - } - } - break; - } - return base.OnMessage(message); + base.FreeResources(); + if (screenShotImage != null) screenShotImage.FreeResources(); } - public override void OnAction(Action action) + public override void Render(float timePassed) { - switch (action.wID) - { - case Action.ActionType.ACTION_PARENT_DIR: - case Action.ActionType.ACTION_PREVIOUS_MENU: - // <U> keypress - BackItemClicked(); - UpdateButtons(); - break; - case Action.ActionType.ACTION_CLOSE_DIALOG: - SaveFolderSettings(""); - GUIWindowManager.ShowPreviousWindow(); - break; - case Action.ActionType.ACTION_SHOW_INFO: - OnInfo(); - break; - default: - base.OnAction(action); - break; - } + base.Render(timePassed); + RenderFilmStrip(); + RenderScreenShot(timePassed); } + */ + #endregion #endregion @@ -1081,7 +912,7 @@ void ShowThumbPanel() { int itemIndex = facadeView.SelectedListItemIndex; - + switch ((View)mapSettings.ViewAs) { case View.List: @@ -1160,7 +991,7 @@ if (lastApp != null) facadeView.Sort(new ProgramSort(CurrentSortMethod, CurrentSortAsc)); - + string itemCountText = String.Format("{0} {1}", TotalItems, GUILocalizeStrings.Get(632)); GUIPropertyManager.SetProperty("#itemcount", itemCountText); @@ -1246,66 +1077,6 @@ #region EventHandlers - void FileItemClicked(GUIListItem item) - { - // file item was clicked => launch it! - if (lastApp != null) - { - mapSettings.LastAppID = lastApp.AppID; - lastFilepath = lastApp.DefaultFilepath(); - lastApp.LaunchFile(item); - } - } - - void FolderItemClicked(GUIListItem item) - { - if (item.MusicTag != null) - { - if (item.MusicTag is ApplicationItem) - { - - ApplicationItem candidate = (ApplicationItem)item.MusicTag; - - - SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastFilepath); - lastApp = candidate; - mapSettings.LastAppID = lastApp.AppID; - lastFilepath = lastApp.DefaultFilepath(); - DatabaseSettings.viewHandler.CurrentLevel = 0; - - } - else if (item.MusicTag is FileItem) - { - SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastFilepath); - // example: subfolder in directory-cache mode - // => set filepath which will be a search criteria for sql / browse - if (lastFilepath == "") - { - // first subfolder - lastFilepath = lastApp.FileDirectory + "\\" + item.Label; - } - else - { - // subsequent subfolder - lastFilepath = lastFilepath + "\\" + item.Label; - } - } - else if (item.MusicTag is ProgramFilterItem) - { - AddNextFilter(item); - } - UpdateListControl(); - } - else - { - // tag is null - // example: subfolder in directory-browse mode - SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastFilepath); - lastFilepath = item.Path; - UpdateListControl(); - } - } - void BackItemClicked() { if (lastApp != null) @@ -1374,6 +1145,66 @@ } + void FileItemClicked(GUIListItem item) + { + // file item was clicked => launch it! + if (lastApp != null) + { + mapSettings.LastAppID = lastApp.AppID; + lastFilepath = lastApp.DefaultFilepath(); + lastApp.LaunchFile(item); + } + } + + void FolderItemClicked(GUIListItem item) + { + if (item.MusicTag != null) + { + if (item.MusicTag is ApplicationItem) + { + + ApplicationItem candidate = (ApplicationItem)item.MusicTag; + + + SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastFilepath); + lastApp = candidate; + mapSettings.LastAppID = lastApp.AppID; + lastFilepath = lastApp.DefaultFilepath(); + DatabaseSettings.viewHandler.CurrentLevel = 0; + + } + else if (item.MusicTag is FileItem) + { + SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastFilepath); + // example: subfolder in directory-cache mode + // => set filepath which will be a search criteria for sql / browse + if (lastFilepath == "") + { + // first subfolder + lastFilepath = lastApp.FileDirectory + "\\" + item.Label; + } + else + { + // subsequent subfolder + lastFilepath = lastFilepath + "\\" + item.Label; + } + } + else if (item.MusicTag is ProgramFilterItem) + { + AddNextFilter(item); + } + UpdateListControl(); + } + else + { + // tag is null + // example: subfolder in directory-browse mode + SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastFilepath); + lastFilepath = item.Path; + UpdateListControl(); + } + } + void AddNextFilter(GUIListItem item) { ProgramFilterItem curFilter; @@ -1403,6 +1234,85 @@ } } + void ScrapeFileInfo(FileItem curFile) + { + int minRelevance = 30; + bool bSuccess = false; + ScraperSaveType saveType = ScraperSaveType.DataAndImages; + GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_OK); + GUIDialogProgress dlgProgress = (GUIDialogProgress)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_PROGRESS); + dlgProgress.ShowWaitCursor = false; + dlgProgress.ShowProgressBar(false); + dlgProgress.SetHeading("Lookup Gameinfo"); + dlgProgress.SetLine(1, curFile.Title); + dlgProgress.SetLine(2, curFile.System_); + dlgProgress.SetLine(3, ""); + dlgProgress.StartModal(GetID); + // dlgProgress.SetPercentage(60); + dlgProgress.Progress(); + bSuccess = curFile.FindFileInfo(ScraperType.ALLGAME); + if ((bSuccess && curFile.FileInfoList.Count > 0) && ((FileItemInfo)(curFile.FileInfoList[0])).RelevanceNorm >= minRelevance) + { + GUIDialogSelect pDlg = (GUIDialogSelect)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_SELECT); + if (null != pDlg) + { + pDlg.Reset(); + pDlg.SetHeading("Select Title"); + foreach (FileItemInfo item in curFile.FileInfoList) + { + if (item.RelevanceNorm >= minRelevance) + { + pDlg.Add(String.Format("{0} ({1})", item.Title, item.Platform)); + } + } + pDlg.DoModal(GetID); + + // and wait till user selects one + int iSelectedGame = pDlg.SelectedLabel; + if (iSelectedGame < 0) return; + + dlgProgress.StartModal(GetID); + dlgProgress.Progress(); + dlgProgress.ShowProgressBar(false); + curFile.FileInfoFavourite = (FileItemInfo)curFile.FileInfoList[iSelectedGame]; + + curFile.FindFileInfoDetail(lastApp, curFile.FileInfoFavourite, ScraperType.ALLGAME, saveType); + if ((saveType == ScraperSaveType.DataAndImages) || (saveType == ScraperSaveType.Data)) + { + // dlgProgress.SetPercentage(60); + dlgProgress.Progress(); + curFile.SaveFromFileInfoFavourite(); + } + // dlgProgress.SetPercentage(100); + dlgProgress.Progress(); + dlgProgress.Close(); + dlgProgress = null; + } + OnInfo(); + } + else + { + string strMsg = ""; + if (!bSuccess) + { + strMsg = "Connection failed"; + Log.Info("myPrograms: RefreshData failed"); + } + else + { + strMsg = String.Format("No match for '{0}'", curFile.Title); + Log.Info("myPrograms: No data found for '{0}'", curFile.Title); + } + if (null != dlgOk) + { + dlgOk.SetHeading(187); + dlgOk.SetLine(1, strMsg); + dlgOk.SetLine(2, String.Empty); + dlgOk.DoModal(GetID); + } + } + } + void OnItemSelected(GUIListItem item, GUIControl parent) { ThumbnailPath = ""; @@ -1448,6 +1358,100 @@ } } + void OnInfo() + { + // <F3> keypress + if (null != lastApp) + { + selectedItemIndex = GetSelectedItemNo(); + GUIListItem item = GetSelectedItem(); + + FileItem curFile = null; + + if (!item.Label.Equals(ProgramUtils.cBackLabel) && (!item.IsFolder)) + { + if ((item.MusicTag != null) && (item.MusicTag is FileItem)) + { + curFile = (FileItem)item.MusicTag; + } + // show file info but only if the selected item is not the back button + bool ovVisible = mapSettings.OverviewVisible; + ProgramInfoAction modalResult = ProgramInfoAction.LookupFileInfo; + int selectedFileID = -1; + lastApp.OnInfo(item, ref ovVisible, ref modalResult, ref selectedFileID); + if ((null != curFile) && (modalResult == ProgramInfoAction.LookupFileInfo)) + { + FileItem scrapeFile = lastApp.Files.GetFileItemByID(selectedFileID); + if (null != scrapeFile) + { + int scrapeIndex = lastApp.Files.IndexOf(scrapeFile); + if (-1 != scrapeIndex) + { + GUIControl.SelectItemControl(GetID, facadeView.GetID, scrapeIndex + 1); + } + ScrapeFileInfo(scrapeFile); + } + } + mapSettings.OverviewVisible = ovVisible; + UpdateListControl(); + } + } + } + + void OnShowViews() + { + GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); + if (dlg == null) return; + dlg.Reset(); + dlg.SetHeading(499); // Actions + dlg.Add(GUILocalizeStrings.Get(100000 + GetID)); // Files + foreach (ViewDefinition view in DatabaseSettings.viewHandler.Views) + { + dlg.Add(view.LocalizedName); + } + dlg.DoModal(GetID); + if (dlg.SelectedLabel == -1) return; + if (dlg.SelectedLabel == 0) + { + int nNewWindow = (int)Window.WINDOW_FILES; + StartWindow = nNewWindow; + ActualView = ""; + DatabaseSettings.viewHandler.CurrentView = null; + if (nNewWindow != GetID) + { + GUIWindowManager.ReplaceWindow(nNewWindow); + } + } + else + { + ViewDefinition selectedView = (ViewDefinition)DatabaseSettings.viewHandler.Views[dlg.SelectedLabel - 1]; + DatabaseSettings.viewHandler.CurrentView = selectedView.Name; + ActualView = selectedView.Name; + int nNewWindow = (int)Window.WINDOW_FILES; + if (GetID != nNewWindow) + { + StartWindow = nNewWindow; + if (nNewWindow != GetID) + { + GUIWindowManager.ReplaceWindow(nNewWindow); + } + } + else + { + if (facadeView.Count <= 0) + { + GUIControl.FocusControl(GetID, btnViewAs.GetID); + } + } + } + if (lastApp != null) + { + lastApp.LoadFiles(); + } + UpdateButtons(); + UpdateListControl(); + } + #endregion } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-20 12:27:59
|
Revision: 572 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=572&view=rev Author: chef_koch Date: 2007-06-20 05:27:51 -0700 (Wed, 20 Jun 2007) Log Message: ----------- minor code cleanup Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 12:18:15 UTC (rev 571) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 12:27:51 UTC (rev 572) @@ -1081,27 +1081,26 @@ void ShowThumbPanel() { int itemIndex = facadeView.SelectedListItemIndex; - - if (mapSettings.ViewAs == (int)View.List) + + switch ((View)mapSettings.ViewAs) { - facadeView.View = GUIFacadeControl.ViewMode.List; - screenShotImage.Visible = true; + case View.List: + facadeView.View = GUIFacadeControl.ViewMode.List; + screenShotImage.Visible = true; + break; + case View.Icons: + facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; + screenShotImage.Visible = false; + break; + case View.LargeIcons: + facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; + screenShotImage.Visible = false; + break; + case View.FilmStrip: + facadeView.View = GUIFacadeControl.ViewMode.Filmstrip; + screenShotImage.Visible = false; + break; } - else if (mapSettings.ViewAs == (int)View.Icons) - { - facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; - screenShotImage.Visible = false; - } - else if (mapSettings.ViewAs == (int)View.LargeIcons) - { - facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; - screenShotImage.Visible = false; - } - else if (mapSettings.ViewAs == (int)View.FilmStrip) - { - facadeView.View = GUIFacadeControl.ViewMode.Filmstrip; - screenShotImage.Visible = false; - } facadeView.SelectedListItemIndex = itemIndex; UpdateButtons(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-20 12:18:18
|
Revision: 571 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=571&view=rev Author: chef_koch Date: 2007-06-20 05:18:15 -0700 (Wed, 20 Jun 2007) Log Message: ----------- move 4 methods to region "Helper Routines" minor code cleanup Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 12:09:31 UTC (rev 570) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 12:18:15 UTC (rev 571) @@ -671,6 +671,41 @@ } } + + bool RefreshButtonVisible() + { + if (lastApp == null) + { + return false; + } + else + { + return (lastApp.RefreshButtonVisible() && lastApp.GUIRefreshPossible && lastApp.EnableGUIRefresh); + } + } + + bool ThereAreAppsToDisplay() + { + if (lastApp == null) + { + return true; // root has globalApplicationList + } + else + { + return lastApp.SubItemsAllowed(); // grouper items for example + } + } + + bool ThereAreFilesOrLinksToDisplay() + { + return (lastApp != null); // all globalApplicationList can have files except the root + } + + bool IsBackButtonNecessary() + { + return (lastApp != null); // always show back button except for root + } + #endregion #region Overrides @@ -1112,64 +1147,21 @@ slideTime = (DateTime.Now.Ticks / 10000); // reset timer! } - bool RefreshButtonVisible() - { - if (lastApp == null) - { - return false; - } - else - { - return (lastApp.RefreshButtonVisible() && lastApp.GUIRefreshPossible && lastApp.EnableGUIRefresh); - } - } - - bool ThereAreAppsToDisplay() - { - if (lastApp == null) - { - return true; // root has globalApplicationList - } - else - { - return lastApp.SubItemsAllowed(); // grouper items for example - } - } - - bool ThereAreFilesOrLinksToDisplay() - { - return (lastApp != null); // all globalApplicationList can have files except the root - } - - bool IsBackButtonNecessary() - { - return (lastApp != null); // always show back button except for root - } - void UpdateListControl() { - int TotalItems = 0; GUIControl.ClearControl(GetID, facadeView.GetID); if (IsBackButtonNecessary()) - { ProgramUtils.AddBackButton(facadeView); - } + int TotalItems = 0; if (ThereAreAppsToDisplay()) - { - TotalItems = TotalItems + DisplayApps(); - } - + TotalItems += DisplayApps(); if (ThereAreFilesOrLinksToDisplay()) - { - TotalItems = TotalItems + DisplayFiles(); - } + TotalItems += DisplayFiles(); if (lastApp != null) - { facadeView.Sort(new ProgramSort(CurrentSortMethod, CurrentSortAsc)); - } - + string itemCountText = String.Format("{0} {1}", TotalItems, GUILocalizeStrings.Get(632)); GUIPropertyManager.SetProperty("#itemcount", itemCountText); @@ -1179,15 +1171,11 @@ } } - int DisplayFiles() { - int totalFiles = 0; - if (lastApp == null) - { - return totalFiles; - } - totalFiles = lastApp.DisplayFiles(this.lastFilepath, facadeView); + if (lastApp == null) return 0; + + int totalFiles = lastApp.DisplayFiles(this.lastFilepath, facadeView); return (totalFiles); } @@ -1255,7 +1243,6 @@ } } - #endregion #region EventHandlers @@ -1417,7 +1404,6 @@ } } - void OnItemSelected(GUIListItem item, GUIControl parent) { ThumbnailPath = ""; @@ -1436,7 +1422,6 @@ } } - void OnClick() { GUIListItem item = GetSelectedItem(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-20 12:09:33
|
Revision: 570 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=570&view=rev Author: chef_koch Date: 2007-06-20 05:09:31 -0700 (Wed, 20 Jun 2007) Log Message: ----------- - uncommented the directx.device reset, it is needed sometimes after Project64 was closed, (no problems with snes9x) - in consequence of the device reset, the screen keeps black -> this is fixed by changing the conditions in RefreshThumbnail() Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs 2007-06-19 19:47:03 UTC (rev 569) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs 2007-06-20 12:09:31 UTC (rev 570) @@ -504,7 +504,7 @@ if (mpGuiMode) { - //GUIGraphicsContext.DX9Device.Reset(GUIGraphicsContext.DX9Device.PresentationParameters); + GUIGraphicsContext.DX9Device.Reset(GUIGraphicsContext.DX9Device.PresentationParameters); AutoPlay.StartListening(); } } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-19 19:47:03 UTC (rev 569) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 12:09:31 UTC (rev 570) @@ -1090,16 +1090,12 @@ GUIListItem item = GetSelectedItem(); // some preconditions... + if (item == null) return; if (appWithImg == null) { - if ((item != null) && (item.MusicTag != null) && (item.MusicTag is ApplicationItem)) - { - appWithImg = (ApplicationItem)(item.MusicTag); - } - else - { - return; - } + if (item.MusicTag == null) return; + appWithImg = item.MusicTag as ApplicationItem; + if (appWithImg == null) return; } ThumbnailPath = ""; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-19 19:47:06
|
Revision: 569 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=569&view=rev Author: chef_koch Date: 2007-06-19 12:47:03 -0700 (Tue, 19 Jun 2007) Log Message: ----------- added note about an allgame bug Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/README.txt Modified: trunk/plugins/myGUIProgramsAlt/README.txt =================================================================== --- trunk/plugins/myGUIProgramsAlt/README.txt 2007-06-19 19:42:19 UTC (rev 568) +++ trunk/plugins/myGUIProgramsAlt/README.txt 2007-06-19 19:47:03 UTC (rev 569) @@ -31,9 +31,9 @@ .: To-do next :. ---------------- Revise the code, clear out BUGS: + - AllGame-Import: rating is not imported correctly + - fileinfodetails : fixup --fileinfodetails : fixup - Add some more specific emulator support.. - bring/keep the profiles up-to-date - Maybe some more "special" items like mame,gamebase This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-19 19:42:23
|
Revision: 568 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=568&view=rev Author: chef_koch Date: 2007-06-19 12:42:19 -0700 (Tue, 19 Jun 2007) Log Message: ----------- commented out some lines to avoid a problem with direct input a few plugins add some methods to the OnStart / OnStopExternal event of Utils Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs 2007-06-17 19:17:57 UTC (rev 567) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs 2007-06-19 19:42:19 UTC (rev 568) @@ -494,12 +494,13 @@ g_Player.Stop(); } - proc = new Process(); - proc.EnableRaisingEvents = true; - proc.Exited += new EventHandler(proc_Exited); + //proc = new Process(); + //proc.EnableRaisingEvents = true; + //proc.Exited += new EventHandler(proc_Exited); - proc.StartInfo = procStart; - ProgramUtils.StartProcess(proc, this.WaitForExit); + //proc.StartInfo = procStart; + //ProgramUtils.StartProcess(proc, this.WaitForExit); + Utils.StartProcess(procStart, this.WaitForExit); if (mpGuiMode) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-17 19:18:01
|
Revision: 567 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=567&view=rev Author: chef_koch Date: 2007-06-17 12:17:57 -0700 (Sun, 17 Jun 2007) Log Message: ----------- fixed my cleanup sorry ;) Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-17 19:11:03 UTC (rev 566) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-17 19:17:57 UTC (rev 567) @@ -988,8 +988,8 @@ { switch (action.wID) { - case action.wID == Action.ActionType.ACTION_PARENT_DIR: - case action.wID == Action.ActionType.ACTION_PREVIOUS_MENU: + case Action.ActionType.ACTION_PARENT_DIR: + case Action.ActionType.ACTION_PREVIOUS_MENU: // <U> keypress BackItemClicked(); UpdateButtons(); @@ -1003,6 +1003,7 @@ break; default: base.OnAction(action); + break; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-17 19:11:06
|
Revision: 566 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=566&view=rev Author: chef_koch Date: 2007-06-17 12:11:03 -0700 (Sun, 17 Jun 2007) Log Message: ----------- yet another small cleanup Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-17 15:37:03 UTC (rev 565) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-17 19:11:03 UTC (rev 566) @@ -964,7 +964,6 @@ } } - public override bool OnMessage(GUIMessage message) { switch (message.Message) @@ -985,31 +984,26 @@ return base.OnMessage(message); } - public override void OnAction(Action action) { - if (action.wID == Action.ActionType.ACTION_PARENT_DIR || action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) + switch (action.wID) { - // <U> keypress - BackItemClicked(); - UpdateButtons(); - return; + case action.wID == Action.ActionType.ACTION_PARENT_DIR: + case action.wID == Action.ActionType.ACTION_PREVIOUS_MENU: + // <U> keypress + BackItemClicked(); + UpdateButtons(); + break; + case Action.ActionType.ACTION_CLOSE_DIALOG: + SaveFolderSettings(""); + GUIWindowManager.ShowPreviousWindow(); + break; + case Action.ActionType.ACTION_SHOW_INFO: + OnInfo(); + break; + default: + base.OnAction(action); } - - // if (action.wID == Action.ActionType.ACTION_CLOSE_DIALOG || action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) - if (action.wID == Action.ActionType.ACTION_CLOSE_DIALOG) - { - SaveFolderSettings(""); - GUIWindowManager.ShowPreviousWindow(); - return; - } - - if (action.wID == Action.ActionType.ACTION_SHOW_INFO) - { - OnInfo(); - return; - } - base.OnAction(action); } #endregion @@ -1121,9 +1115,6 @@ slideTime = (DateTime.Now.Ticks / 10000); // reset timer! } - - - bool RefreshButtonVisible() { if (lastApp == null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-17 15:37:07
|
Revision: 565 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=565&view=rev Author: chef_koch Date: 2007-06-17 08:37:03 -0700 (Sun, 17 Jun 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/FritzBox/FritzBox/ trunk/plugins/FritzBox/FritzBox/Caller.cs trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzBox.csproj trunk/plugins/FritzBox/FritzBox/FritzBox.png trunk/plugins/FritzBox/FritzBox/FritzBoxDisabled.png trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.resx trunk/plugins/FritzBox/FritzBox/FritzBoxWatch.cs trunk/plugins/FritzBox/FritzBox/Properties/ trunk/plugins/FritzBox/FritzBox/gfx/ Removed Paths: ------------- trunk/plugins/FritzBox/Caller.cs trunk/plugins/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox.csproj trunk/plugins/FritzBox/FritzBox.png trunk/plugins/FritzBox/FritzBoxDisabled.png trunk/plugins/FritzBox/FritzBoxSetupFrom.cs trunk/plugins/FritzBox/FritzBoxSetupFrom.resx trunk/plugins/FritzBox/FritzBoxWatch.cs trunk/plugins/FritzBox/Properties/ trunk/plugins/FritzBox/gfx/ Deleted: trunk/plugins/FritzBox/Caller.cs =================================================================== --- trunk/plugins/FritzBox/Caller.cs 2007-06-17 11:03:06 UTC (rev 564) +++ trunk/plugins/FritzBox/Caller.cs 2007-06-17 15:37:03 UTC (rev 565) @@ -1,89 +0,0 @@ -#region Copyright (C) 2005-2007 Team MediaPortal - -/* - * Copyright (C) 2005-2007 Team MediaPortal - * http://www.team-mediaportal.com - * - * This Program 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, or (at your option) - * any later version. - * - * This Program 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 GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#endregion - -using System; -using System.Collections.Generic; -using System.Text; - -namespace FritzBox -{ - public class Caller - { - string _id; - string _name; - bool _show; - - public Caller() - { - this._id = ""; - this._name = ""; - this._show = false; - } - - public Caller(string id, string name, bool show) - { - this._id = id; - this._name = name; - this._show = show; - } - - public string ID - { - get - { - return _id; - } - set - { - _id = value; - } - } - - public string Name - { - get - { - return _name; - } - set - { - _name = value; - } - } - - public bool Show - { - get - { - return _show; - } - set - { - _show = value; - } - } - - } -} Copied: trunk/plugins/FritzBox/FritzBox/Caller.cs (from rev 554, trunk/plugins/FritzBox/Caller.cs) =================================================================== --- trunk/plugins/FritzBox/FritzBox/Caller.cs (rev 0) +++ trunk/plugins/FritzBox/FritzBox/Caller.cs 2007-06-17 15:37:03 UTC (rev 565) @@ -0,0 +1,89 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; + +namespace FritzBox +{ + public class Caller + { + string _id; + string _name; + bool _show; + + public Caller() + { + this._id = ""; + this._name = ""; + this._show = false; + } + + public Caller(string id, string name, bool show) + { + this._id = id; + this._name = name; + this._show = show; + } + + public string ID + { + get + { + return _id; + } + set + { + _id = value; + } + } + + public string Name + { + get + { + return _name; + } + set + { + _name = value; + } + } + + public bool Show + { + get + { + return _show; + } + set + { + _show = value; + } + } + + } +} Copied: trunk/plugins/FritzBox/FritzBox/FritzBox.cs (from rev 554, trunk/plugins/FritzBox/FritzBox.cs) =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs (rev 0) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2007-06-17 15:37:03 UTC (rev 565) @@ -0,0 +1,698 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections; +using System.Diagnostics; +using System.IO; +using System.Net.Sockets; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Threading; +using System.Windows.Forms; +using System.Xml; + +using MediaPortal.Ripper; + +using MediaPortal.Util; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using MediaPortal.Dialogs; +using MediaPortal.Player; +using System.Collections.Generic; + + +namespace FritzBox +{ + /* + * Things to do: + * - add more comments to code + * - split code more in methods/classes + */ + + [PluginIcons("FritzBox.FritzBox.png", "FritzBox.FritzBoxDisabled.png")] + public class FritzBox : ISetupForm, IPlugin + { + #region Variables + #region Private Variables + + private bool _fritzBoxDisabled = false; + + // notify settings + private int _timeout = -1; // autoclose the dialog after the timeout expired + private bool _closeOnTimeout = false; + + public static bool _filterMSNs = false; + public static string[] _msn; + + public static bool _showMsnOnHeading = false; + + // media settings + private bool _stopMedia = true; // stop media when an event happend + private bool _resumeMedia = true; // resume media when notify is closed + + private bool _showNotify = true; + private List<string> notifyQueue = new List<string>(); + + #endregion + + #region public Variables + + public const string _version = "0.2.2.0"; + public static int _lastVersion = 0; + public static bool _extensiveLogging = false; + + // phonebook settings + public static bool _usePhonebook = true; + public static bool _showUnknownCaller = true; + public static bool _saveUnknownCaller = true; + + public static List<Caller> phonebook = new List<Caller>(); + + #endregion + + FritzBoxWatch FritzBoxWatch; + + // Protected Variables + #endregion + + #region Constructors/Destructors + public FritzBox() + { + } + #endregion + + #region Private Methods + + #region Settings + private void LoadSettings() + { + char[] charSeparators = new char[] { ';' }; + + if (_extensiveLogging) + Log.Info("FRITZ!Box: LoadSettings"); + + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + _lastVersion = xmlreader.GetValueAsInt("fritzbox", "lastVersion", 0); + + _extensiveLogging = xmlreader.GetValueAsBool("fritzbox", "extensiveLogging", false); + + FritzBoxWatch.fritzBoxAddress = xmlreader.GetValueAsString("fritzbox", "address", "fritz.box"); + FritzBoxWatch.fritzBoxPort = xmlreader.GetValueAsString("fritzbox", "port", "1012"); + + // notify settings + _closeOnTimeout = xmlreader.GetValueAsBool("fritzbox", "closeOnTimeout", false); + _timeout = xmlreader.GetValueAsInt("fritzbox", "timeout", 10); + + if ((!_closeOnTimeout) || (_timeout == 0)) + _timeout = -1; + + _filterMSNs = xmlreader.GetValueAsBool("fritzbox", "filterMSNs", false); + string strMSN = xmlreader.GetValueAsString("fritzbox", "MSN", ""); + _msn = strMSN.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); + + if (_extensiveLogging) + Log.Debug("FRITZ!Box: MSNs loaded: {0}", strMSN); + + _showMsnOnHeading = xmlreader.GetValueAsBool("fritzbox", "showMsnOnHeading", false); + + // media settings + _stopMedia = xmlreader.GetValueAsBool("fritzbox", "stopMedia", true); + _resumeMedia = xmlreader.GetValueAsBool("fritzbox", "resumeMedia", true); + + // phonebook settings + _usePhonebook = xmlreader.GetValueAsBool("fritzbox", "usePhonebook", true); + _showUnknownCaller = xmlreader.GetValueAsBool("fritzbox", "showUnknownCaller", true); + _saveUnknownCaller = xmlreader.GetValueAsBool("fritzbox", "saveUnknownCaller", true); + + if (_extensiveLogging) + { + Log.Info("FRITZ!Box: closeOnTimeout = {0}", _closeOnTimeout.ToString()); + Log.Info("FRITZ!Box: timeout = {0}", _timeout.ToString()); + Log.Info("FRITZ!Box: showMsnOnHeading = {0}", _showMsnOnHeading.ToString()); + + Log.Info("FRITZ!Box: stopMedia = {0}", _stopMedia.ToString()); + Log.Info("FRITZ!Box: resumeMedia = {0}", _resumeMedia.ToString()); + + Log.Info("FRITZ!Box: usePhonebook = {0}", _usePhonebook.ToString()); + Log.Info("FRITZ!Box: showUnknownCaller = {0}", _showUnknownCaller.ToString()); + Log.Info("FRITZ!Box: saveUnknownCaller = {0}", _saveUnknownCaller.ToString()); + } + } + + LoadPhonebook(); + } + + private void SaveSettings() + { + if (_extensiveLogging) + Log.Info("FRITZ!Box: SaveSettings"); + + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + xmlwriter.SetValue("fritzbox", "lastVersion", _version.Replace(".", string.Empty)); + } + + SavePhonebook(); + } + #endregion + + #region Phonebook + public static void LoadPhonebook() + { + if ((_lastVersion < 0220) && (!File.Exists(Config.GetFile(Config.Dir.Config, "fritzbox.xml")))) + { + UpdateTo0220(); + return; + } + + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) + { + int countCaller = xmlreader.GetValueAsInt("phonebook", "count", 0); + + for (int i = 0; i < countCaller; i++) + { + Caller caller = new Caller(); + + caller.ID = xmlreader.GetValueAsString("phonebook", string.Format("callerID{0}", i.ToString()), ""); + caller.Name = xmlreader.GetValueAsString("phonebook", string.Format("name{0}", i.ToString()), ""); + caller.Show = xmlreader.GetValueAsBool("phonebook", string.Format("show{0}", i.ToString()), false); + + phonebook.Add(caller); + + if (_extensiveLogging) + Log.Debug("FRITZ!Box: caller loaded: {0} {1} {2}", caller.ID, caller.Name, caller.Show); + } + } + if (_extensiveLogging) + Log.Debug("FRITZ!Box: imported {0} callers", phonebook.Count.ToString()); + } + + public static void SavePhonebook() + { + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) + { + xmlwriter.SetValue("phonebook", "count", phonebook.Count); + + for (int i = 0; i < phonebook.Count; i++) + { + Caller caller = phonebook[i]; + + xmlwriter.SetValue("phonebook", string.Format("callerID{0}", i.ToString()), caller.ID); + xmlwriter.SetValue("phonebook", string.Format("name{0}", i.ToString()), caller.Name); + xmlwriter.SetValueAsBool("phonebook", string.Format("show{0}", i.ToString()), caller.Show); + } + } + } + + public static void UpdateTo0220() + { + char[] charSeparators = new char[] { ';' }; + + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + string[] strLCallerId = xmlreader.GetValueAsString("fritzbox", "phonebookCallerId", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); + string[] strLName = xmlreader.GetValueAsString("fritzbox", "phonebookName", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); + string[] strLShow = xmlreader.GetValueAsString("fritzbox", "phonebookShow", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); + + for (int i = 0; i <= strLCallerId.GetUpperBound(0); i++) + { + Caller caller = new Caller(strLCallerId[i], strLName[i], bool.Parse(strLShow[i])); + phonebook.Add(caller); + + if (_extensiveLogging) + Log.Debug("FRITZ!Box: caller loaded: {0} {1} {2}", caller.ID, caller.Name, caller.Show); + } + } + } + + public static int ImportFritzBoxMonitor(string filepath) + { + try + { + int count = 0; + + // Create an instance of StreamReader to read from a file. + // The using statement also closes the StreamReader. + using (StreamReader sr = new StreamReader(filepath)) + { + string line; + // Read and display lines from the file until the end of + // the file is reached. + while ((line = sr.ReadLine()) != null) + { + if ( (count == 0) && line.Contains("sep=;") ) + continue; + if ( (count == 0) && line.Contains("Telefonnummer")) + continue; + + string[] ar = line.Split(char.Parse(";")); + + ar[0] = ar[0].TrimStart('!'); + ar[1] = ar[1].TrimStart('!'); + + Caller caller = new Caller(); + + caller.ID = ar[2]; + caller.Name = string.Format("{0} {1}", ar[0], ar[1]); + caller.Name = caller.Name.Trim(); + caller.Show = true; + + if (CallerExists(caller)) continue; + + phonebook.Add(caller); + count++; + } + } + + return count; + } + catch (Exception e) + { + // Let the user know what went wrong. + Log.Error("The file could not be read: {0}", e.Message); + return 0; + } + } + + public static bool CallerExists(Caller caller) + { + for (int i = 0; i < phonebook.Count; i++) + { + if (phonebook[i].ID == caller.ID) + return true; + } + return false; + } + #endregion + + public bool IsFritzBoxConnected(string fritzBoxAddress, string fritzBoxPort) + { + TcpClient TcpClient; + + try + { + TcpClient = new TcpClient(fritzBoxAddress, Int32.Parse(fritzBoxPort)); + } + catch (Exception) + { + return false; + } + + TcpClient.Close(); + return true; + } + + #region FritzBoxActions + private void OnFritzBoxEvent(string dataStream) + { + if (!_showNotify) + { + Log.Info("External process is running. Notify is queued and will be shown later."); + notifyQueue.Add(dataStream); + return; + } + + string[] strList; // splitted data + + // data-stream can be in following format: + // incoming calls: DateTime;RING;ConnectionID;CallerID;MSN;??POTS??; + // outgoing calls: DateTime;CALL;ConnectionID;??Nebenstelle??;MSN;CallerID;??POTS??; + // connection started: DateTime;CONNECT;ConnectionID;??Nebenstelle??;CallerID; + // connection closed: DateTime;DISCONNECT;ConnectionID;ConnectedTime; + + // DateTime format: + // 12.12.06 12:12:12 + // dd.MM.yy hh:mm:ss + + dataStream = dataStream.Replace("\n", ""); + if (FritzBox._extensiveLogging) + Log.Info("received data: {0}", dataStream); + strList = dataStream.Split(';'); + + switch (strList[1]) + { + case "RING": + OnIncomingCall(strList[0], strList[3], strList[4]); + break; + + case "CALL": + OnOutgoingCall(strList[0], strList[3], strList[4], strList[5]); + break; + + case "CONNECT": + OnConnectionStarted(strList[0], strList[3], strList[4]); + break; + + case "DISCONNECT": + OnConnectionClosed(strList[0], int.Parse(strList[3])); + break; + } + } + + private void OnIncomingCall(string dateTime, string callerId, string msn) + { + Log.Info("incoming call:"); + Log.Info(" DateTime: {0}", dateTime); + if (FritzBox._extensiveLogging) + { + Log.Info(" Caller: {0}", callerId); + Log.Info(" MSN: {0}", msn); + } + + if (CheckMSN(msn) == true) + { + if (callerId == "") + { + Log.Info("Caller is not identified by CLIP."); + + if (FritzBox._showUnknownCaller) + DialogOnIncomingCall("", msn); + } + else + { + if (FritzBox._usePhonebook) + { + + + + + bool foundCaller = false; + + if (phonebook.Count == 0) + { + Log.Info("Phonebook is empty. Caller is added to the phonebook."); + Caller caller = new Caller(callerId, callerId, true); + phonebook.Add(caller); + } + else + { + int i = 0; + + do + { + Caller caller = phonebook[i]; + + if (caller.ID.Equals(callerId)) + { + Log.Info("Caller is identified by phonebook as {0}.", caller.Name); + foundCaller = true; + + if (caller.Show) + { + Log.Info("Caller is accepted by phonebook and dialog will be shown."); + + DialogOnIncomingCall(caller.Name, msn); + } + else + { + Log.Info("Caller is denied by phonebook and dialog won't be shown."); + } + } + i++; + } + while (!foundCaller && (i < phonebook.Count)); + + if (!foundCaller) + { + Log.Info("Caller is not identified by phonebook."); + + if (FritzBox._saveUnknownCaller) + { + Log.Info("saveUnknownCallers is ON - Caller is added to the phonebook."); + + Caller caller = new Caller(callerId, callerId, FritzBox._showUnknownCaller); + phonebook.Add(caller); + } + + if (FritzBox._showUnknownCaller) + { + Log.Info("showUnknownCallers is ON - Caller is shown."); + + DialogOnIncomingCall(callerId, msn); + } + } + + } + } + else + DialogOnIncomingCall(callerId, msn); + } + } + } + + private void OnOutgoingCall(string dateTime, string nebenstelle, string msn, string callerId) + { + Log.Info("outgoing call:"); + Log.Info(" DateTime: {0}", dateTime); + if (FritzBox._extensiveLogging) + { + Log.Info(" Nebenstelle: {0}", nebenstelle); + Log.Info(" MSN: {0}", msn); + Log.Info(" Caller: {0}", callerId); + } + } + + private void OnConnectionStarted(string dateTime, string nebenstelle, string callerId) + { + Log.Info("connection started:"); + Log.Info(" DateTime: {0}", dateTime); + if (FritzBox._extensiveLogging) + { + Log.Info(" Nebenstelle: {0}", nebenstelle); + Log.Info(" Caller: {0}", callerId); + } + } + + private void OnConnectionClosed(string dateTime, int connectedTime) + { + Log.Info("connection closed:"); + Log.Info(" DateTime: {0}", dateTime); + Log.Info(" conneted time (in s): {0}", connectedTime.ToString()); + } + #endregion + + void DialogOnIncomingCall(string strCallerId, string strMSN) + { + string strImage = null; + string strHeading = null; + + if (strCallerId == "") + { + strCallerId = GUILocalizeStrings.Get(2014); // 2014 = unknown + strImage = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, "_unknown"); + } + else + { + //search image for caller + if (_extensiveLogging) + Log.Info("searching image: " + MediaPortal.Util.Utils.GetCoverArtName(Thumbs.Yac, strCallerId)); + + if (File.Exists(MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, strCallerId))) + { + if (_extensiveLogging) + Log.Info("found image for caller: " + MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, strCallerId)); + else + Log.Info("found image for caller"); + + strImage = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, strCallerId); + } + else + { + Log.Info("found NO image for caller"); + strImage = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, "_noImage"); + } + } + + if (_showMsnOnHeading) + strHeading = GUILocalizeStrings.Get(1023) + " on " + strMSN; // ???? Incoming call on + else + strHeading = GUILocalizeStrings.Get(1023); // 1023 Incoming call + + //show dialog + if (g_Player.Playing && !g_Player.Paused && _stopMedia) + g_Player.Pause(); + + GUIDialogNotify dlgNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); + if (dlgNotify == null) return; + + dlgNotify.Reset(); + dlgNotify.ClearAll(); + dlgNotify.SetHeading(strHeading); + dlgNotify.SetImage(strImage); + dlgNotify.SetText(strCallerId); + dlgNotify.TimeOut = _timeout; + + dlgNotify.DoModal(GUIWindowManager.ActiveWindow); + + if (g_Player.Playing && g_Player.Paused && _stopMedia && _resumeMedia) + g_Player.Pause(); + } + + private bool CheckMSN(string msn) + { + bool foundMSN = false; + + if (FritzBox._filterMSNs) + { + for (int i = 0; i <= FritzBox._msn.GetUpperBound(0); i++) + { + if (FritzBox._msn[i].ToString() == msn) + foundMSN = true; + } + if (foundMSN == true) + { + Log.Info("MSN is on list."); + return true; + } + else + { + Log.Info("MSN is not on list. Notify won't be shown."); + return false; + } + } + else + { + Log.Info("MSN filter is disabled."); + return true; + } + } + + + public void OnStartExternal(Process proc, bool waitForExit) + { + if (waitForExit) + { + _showNotify = false; + } + else + { + _showNotify = true; + } + } + public void OnStopExternal(Process proc, bool waitForExit) + { + _showNotify = true; + + //for (int i = 0; i < notifyQueue.Count; i++) + // OnFritzBoxEvent(notifyQueue[i]); + + notifyQueue.Clear(); + } + + #endregion + + #region <Interface> Implementations + + #region IPlugin Interface + + /// <summary> + /// This method will be called by mediaportal to start your process plugin + /// </summary> + public void Start() + { + Log.Info("FRITZ!Box Plugin {0} starting.", _version); + + FritzBoxWatch = new FritzBoxWatch(); + LoadSettings(); + FritzBoxWatch.Start(); + + FritzBoxWatch.FritzBoxAction += new FritzBoxWatch.EventHandler(OnFritzBoxEvent); + + Utils.OnStartExternal += new Utils.UtilEventHandler(OnStartExternal); + Utils.OnStopExternal += new Utils.UtilEventHandler(OnStopExternal); + } + + /// <summary> + /// This method will be called by mediaportal to stop your process plugin + /// </summary> + public void Stop() + { + if (!_fritzBoxDisabled) + FritzBoxWatch.Stop(); + + SaveSettings(); + } + + #endregion + + #region ISetupForm Interface + + public bool CanEnable() + { + return true; + } + + public string Description() + { + return "Displays FRITZ!Box calling information."; + } + + public bool DefaultEnabled() + { + return false; + } + + public int GetWindowId() + { + return -1; + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = null; + strButtonImage = null; + strButtonImageFocus = null; + strPictureImage = null; + return false; + } + + public string Author() + { + return "chefkoch"; + } + + public string PluginName() + { + return "FRITZ!Box CallMonitor"; + } + + public bool HasSetup() + { + return true; + } + + public void ShowPlugin() + { + Form setup = new FritzBoxSetupForm(); + setup.ShowDialog(); + } + + #endregion + + #endregion + } +} \ No newline at end of file Copied: trunk/plugins/FritzBox/FritzBox/FritzBox.csproj (from rev 554, trunk/plugins/FritzBox/FritzBox.csproj) =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.csproj (rev 0) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2007-06-17 15:37:03 UTC (rev 565) @@ -0,0 +1,117 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{7A458560-A537-429E-A016-1A4513CB586F}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>FritzBox</RootNamespace> + <AssemblyName>FritzBox</AssemblyName> + <ApplicationIcon> + </ApplicationIcon> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <Optimize>true</Optimize> + <DebugType>pdbonly</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Caller.cs" /> + <Compile Include="FritzBox.cs" /> + <Compile Include="FritzBoxSetupFrom.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="FritzBoxWatch.cs" /> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\mediaportal\Core\Core.csproj"> + <Project>{02FFFC1F-2555-4B99-8B01-3432D0673855}</Project> + <Name>Core</Name> + </ProjectReference> + <ProjectReference Include="..\..\mediaportal\Dialogs\Dialogs.csproj"> + <Project>{396C5208-5D46-4A11-92C1-FD0F2F42D7DD}</Project> + <Name>Dialogs</Name> + </ProjectReference> + <ProjectReference Include="..\..\mediaportal\Utils\Utils.csproj"> + <Project>{6DA0E4DF-6230-4642-98B5-E690BB6942BB}</Project> + <Name>Utils</Name> + </ProjectReference> + <ProjectReference Include="..\..\mediaportal\WindowPlugins\WindowPlugins.csproj"> + <Project>{B282C55B-A37B-4CEC-A4FC-00791069BF00}</Project> + <Name>WindowPlugins</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="FritzBoxSetupFrom.resx"> + <DependentUpon>FritzBoxSetupFrom.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="Properties\Resources.resx"> + <SubType>Designer</SubType> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="FritzBoxDisabled.png" /> + <EmbeddedResource Include="FritzBox.png" /> + </ItemGroup> + <ItemGroup> + <None Include="gfx\FritzBoxIconTransparent.png" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent>copy "$(TargetPath)" "C:\Programme\Team MediaPortal\MediaPortal\Plugins\Process\$(TargetFileName)" +rem copy "$(TargetPath)" "$(ProjectDir)\..\FritzBox_release\MP_svn_release\Plugins\Process\$(TargetFileName)" +rem copy "$(ProjectDir)\*" "$(ProjectDir)\..\FritzBox_release\MP_svn_source\*"</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Copied: trunk/plugins/FritzBox/FritzBox/FritzBox.png (from rev 554, trunk/plugins/FritzBox/FritzBox.png) =================================================================== (Binary files differ) Copied: trunk/plugins/FritzBox/FritzBox/FritzBoxDisabled.png (from rev 554, trunk/plugins/FritzBox/FritzBoxDisabled.png) =================================================================== (Binary files differ) Copied: trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs (from rev 554, trunk/plugins/FritzBox/FritzBoxSetupFrom.cs) =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs (rev 0) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs 2007-06-17 15:37:03 UTC (rev 565) @@ -0,0 +1,1091 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; +using System.Net.Sockets; +using System.IO; +using MediaPortal.Profile; + +using MediaPortal.Util; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; + +namespace FritzBox +{ + /// <summary> + /// Zusammenfassung f\xFCr CallSetupFrom. + /// </summary> + public class FritzBoxSetupForm : Form + { + private MediaPortal.UserInterface.Controls.MPTabControl tabControlFritzBoxSettings; + private TabPage tabGeneral; + private TabPage tabIncoming; + private MediaPortal.UserInterface.Controls.MPGroupBox groupBoxNotify; + private MediaPortal.UserInterface.Controls.MPGroupBox groupBoxMedia; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxStopMedia; + private TabPage tabPhonebook; + private DataGridView dataGridView; + private DataGridViewTextBoxColumn colCallerId; + private DataGridViewTextBoxColumn colName; + private DataGridViewCheckBoxColumn colShow; + private MediaPortal.UserInterface.Controls.MPGroupBox groupBoxPhonebook; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxSaveUnknownCaller; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxShowUnknownCaller; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxUsePhonebook; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxCallerShow; + private MediaPortal.UserInterface.Controls.MPTextBox textBoxCallerName; + private MediaPortal.UserInterface.Controls.MPTextBox textBoxCallerId; + private MediaPortal.UserInterface.Controls.MPButton buttonCallerRemove; + private MediaPortal.UserInterface.Controls.MPLabel labelCallerId; + private MediaPortal.UserInterface.Controls.MPLabel labelCallerName; + private MediaPortal.UserInterface.Controls.MPButton buttonCallerChange; + private MediaPortal.UserInterface.Controls.MPButton buttonCancel; + private MediaPortal.UserInterface.Controls.MPButton buttonSave; + private MediaPortal.UserInterface.Controls.MPNumericUpDown numericUpDownTimeout; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxCloseOnTimout; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxResumeMedia; + private MediaPortal.UserInterface.Controls.MPLabel labelVersion; + private MediaPortal.UserInterface.Controls.MPGroupBox mpGroupBox1; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxExtensiveLogging; + private MediaPortal.UserInterface.Controls.MPButton buttonTest; + private MediaPortal.UserInterface.Controls.MPTextBox textBoxPort; + private MediaPortal.UserInterface.Controls.MPTextBox textBoxAddress; + private MediaPortal.UserInterface.Controls.MPLabel labelPort; + private MediaPortal.UserInterface.Controls.MPLabel labelAddress; + private MediaPortal.UserInterface.Controls.MPLabel labelHelp; + private MediaPortal.UserInterface.Controls.MPButton buttonMSNsRemove; + private MediaPortal.UserInterface.Controls.MPButton buttonMSNsAdd; + private PictureBox pictureBoxCaller; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxFilterMSNs; + private MediaPortal.UserInterface.Controls.MPComboBox comboBoxMSNs; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxShowMsnOnHeading; + private PictureBox pictureBox1; + private MediaPortal.UserInterface.Controls.MPButton mpImportFBMonitor; + private OpenFileDialog openFileDialog; + + /// <summary> + /// Erforderliche Designervariable. + /// </summary> + private Container components = null; + + public FritzBoxSetupForm() + { + // + // Erforderlich f\xFCr die Windows Form-Designerunterst\xFCtzung + // + InitializeComponent(); + + LoadSettings(); + // + // TODO: F\xFCgen Sie den Konstruktorcode nach dem Aufruf von InitializeComponent hinzu + // + } + + /// <summary> + /// Die verwendeten Ressourcen bereinigen. + /// </summary> + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (components != null) + { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// <summary> + /// Erforderliche Methode f\xFCr die Designerunterst\xFCtzung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor ge\xE4ndert werden. + /// </summary> + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FritzBoxSetupForm)); + this.tabControlFritzBoxSettings = new MediaPortal.UserInterface.Controls.MPTabControl(); + this.tabGeneral = new System.Windows.Forms.TabPage(); + this.checkBoxExtensiveLogging = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.mpGroupBox1 = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.buttonTest = new MediaPortal.UserInterface.Controls.MPButton(); + this.textBoxPort = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.textBoxAddress = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.labelPort = new MediaPortal.UserInterface.Controls.MPLabel(); + this.labelAddress = new MediaPortal.UserInterface.Controls.MPLabel(); + this.labelHelp = new MediaPortal.UserInterface.Controls.MPLabel(); + this.tabIncoming = new System.Windows.Forms.TabPage(); + this.groupBoxPhonebook = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.mpImportFBMonitor = new MediaPortal.UserInterface.Controls.MPButton(); + this.checkBoxSaveUnknownCaller = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.checkBoxShowUnknownCaller = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.checkBoxUsePhonebook = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.groupBoxNotify = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.checkBoxShowMsnOnHeading = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.buttonMSNsRemove = new MediaPortal.UserInterface.Controls.MPButton(); + this.checkBoxFilterMSNs = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.buttonMSNsAdd = new MediaPortal.UserInterface.Controls.MPButton(); + this.comboBoxMSNs = new MediaPortal.UserInterface.Controls.MPComboBox(); + this.numericUpDownTimeout = new MediaPortal.UserInterface.Controls.MPNumericUpDown(); + this.checkBoxCloseOnTimout = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.groupBoxMedia = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.checkBoxResumeMedia = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.checkBoxStopMedia = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.tabPhonebook = new System.Windows.Forms.TabPage(); + this.pictureBoxCaller = new System.Windows.Forms.PictureBox(); + this.buttonCallerChange = new MediaPortal.UserInterface.Controls.MPButton(); + this.checkBoxCallerShow = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.textBoxCallerName = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.textBoxCallerId = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.buttonCallerRemove = new MediaPortal.UserInterface.Controls.MPButton(); + this.dataGridView = new System.Windows.Forms.DataGridView(); + this.colCallerId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colShow = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.labelCallerId = new MediaPortal.UserInterface.Controls.MPLabel(); + this.labelCallerName = new MediaPortal.UserInterface.Controls.MPLabel(); + this.buttonCancel = new MediaPortal.UserInterface.Controls.MPButton(); + this.buttonSave = new MediaPortal.UserInterface.Controls.MPButton(); + this.labelVersion = new MediaPortal.UserInterface.Controls.MPLabel(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.tabControlFritzBoxSettings.SuspendLayout(); + this.tabGeneral.SuspendLayout(); + this.mpGroupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.tabIncoming.SuspendLayout(); + this.groupBoxPhonebook.SuspendLayout(); + this.groupBoxNotify.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTimeout)).BeginInit(); + this.groupBoxMedia.SuspendLayout(); + this.tabPhonebook.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCaller)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); + this.SuspendLayout(); + // + // tabControlFritzBoxSettings + // + this.tabControlFritzBoxSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tabControlFritzBoxSettings.Controls.Add(this.tabGeneral); + this.tabControlFritzBoxSettings.Controls.Add(this.tabIncoming); + this.tabControlFritzBoxSettings.Controls.Add(this.tabPhonebook); + this.tabControlFritzBoxSettings.Location = new System.Drawing.Point(12, 13); + this.tabControlFritzBoxSettings.Name = "tabControlFritzBoxSettings"; + this.tabControlFritzBoxSettings.SelectedIndex = 0; + this.tabControlFritzBoxSettings.Size = new System.Drawing.Size(531, 337); + this.tabControlFritzBoxSettings.TabIndex = 0; + // + // tabGeneral + // + this.tabGeneral.Controls.Add(this.checkBoxExtensiveLogging); + this.tabGeneral.Controls.Add(this.mpGroupBox1); + this.tabGeneral.Location = new System.Drawing.Point(4, 22); + this.tabGeneral.Name = "tabGeneral"; + this.tabGeneral.Padding = new System.Windows.Forms.Padding(3); + this.tabGeneral.Size = new System.Drawing.Size(523, 311); + this.tabGeneral.TabIndex = 0; + this.tabGeneral.Text = "General"; + this.tabGeneral.UseVisualStyleBackColor = true; + // + // checkBoxExtensiveLogging + // + this.checkBoxExtensiveLogging.AutoSize = true; + this.checkBoxExtensiveLogging.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxExtensiveLogging.Location = new System.Drawing.Point(6, 138); + this.checkBoxExtensiveLogging.Name = "checkBoxExtensiveLogging"; + this.checkBoxExtensiveLogging.Size = new System.Drawing.Size(339, 17); + this.checkBoxExtensiveLogging.TabIndex = 1; + this.checkBoxExtensiveLogging.Text = "extensive logging (!!! phonenumbers are written to the logfile !!!)"; + this.checkBoxExtensiveLogging.UseVisualStyleBackColor = true; + // + // mpGroupBox1 + // + this.mpGroupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.mpGroupBox1.Controls.Add(this.pictureBox1); + this.mpGroupBox1.Controls.Add(this.buttonTest); + this.mpGroupBox1.Controls.Add(this.textBoxPort); + this.mpGroupBox1.Controls.Add(this.textBoxAddress); + this.mpGroupBox1.Controls.Add(this.labelPort); + this.mpGroupBox1.Controls.Add(this.labelAddress); + this.mpGroupBox1.Controls.Add(this.labelHelp); + this.mpGroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.mpGroupBox1.Location = new System.Drawing.Point(6, 6); + this.mpGroupBox1.Name = "mpGroupBox1"; + this.mpGroupBox1.Size = new System.Drawing.Size(511, 125); + this.mpGroupBox1.TabIndex = 0; + this.mpGroupBox1.TabStop = false; + this.mpGroupBox1.Text = "connection"; + // + // pictureBox1 + // + this.pictureBox1.Image = global::FritzBox.Properties.Resources.FritzBoxIconTransparent; + this.pictureBox1.Location = new System.Drawing.Point(6, 20); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(97, 99); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.pictureBox1.TabIndex = 2; + this.pictureBox1.TabStop = false; + // + // buttonTest + // + this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonTest.Location = new System.Drawing.Point(430, 20); + this.buttonTest.Name = "buttonTest"; + this.buttonTest.Size = new System.Drawing.Size(75, 21); + this.buttonTest.TabIndex = 2; + this.buttonTest.Text = "Test"; + this.buttonTest.UseVisualStyleBackColor = true; + this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click); + // + // textBoxPort + // + this.textBoxPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxPort.BorderColor = System.Drawing.Color.Empty; + this.textBoxPort.Location = new System.Drawing.Point(165, 47); + this.textBoxPort.Name = "textBoxPort"; + this.textBoxPort.Size = new System.Drawing.Size(259, 21); + this.textBoxPort.TabIndex = 1; + // + // textBoxAddress + // + this.textBoxAddress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxAddress.BorderColor = System.Drawing.Color.Empty; + this.textBoxAddress.Location = new System.Drawing.Point(165, 20); + this.textBoxAddress.Name = "textBoxAddress"; + this.textBoxAddress.Size = new System.Drawing.Size(259, 21); + this.textBoxAddress.TabIndex = 0; + // + // labelPort + // + this.labelPort.AutoSize = true; + this.labelPort.Location = new System.Drawing.Point(128, 50); + this.labelPort.Name = "labelPort"; + this.labelPort.Size = new System.Drawing.Size(31, 13); + this.labelPort.TabIndex = 8; + this.labelPort.Text = "Port:"; + // + // labelAddress + // + this.labelAddress.AutoSize = true; + this.labelAddress.Location = new System.Drawing.Point(109, 24); + this.labelAddress.Name = "labelAddress"; + this.labelAddress.Size = new System.Drawing.Size(50, 13); + this.labelAddress.TabIndex = 7; + this.labelAddress.Text = "Address:"; + // + // labelHelp + // + this.labelHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelHelp.Location = new System.Drawing.Point(165, 73); + this.labelHelp.Name = "labelHelp"; + this.labelHelp.Size = new System.Drawing.Size(340, 49); + this.labelHelp.TabIndex = 6; + // + // tabIncoming + // + this.tabIncoming.Controls.Add(this.groupBoxPhonebook); + this.tabIncoming.Controls.Add(this.groupBoxNotify); + this.tabIncoming.Controls.Add(this.groupBoxMedia); + this.tabIncoming.Location = new System.Drawing.Point(4, 22); + this.tabIncoming.Name = "tabIncoming"; + this.tabIncoming.Padding = new System.Windows.Forms.Padding(3); + this.tabIncoming.Size = new System.Drawing.Size(523, 311); + this.tabIncoming.TabIndex = 1; + this.tabIncoming.Text = "Incoming Call"; + this.tabIncoming.UseVisualStyleBackColor = true; + // + // groupBoxPhonebook + // + this.groupBoxPhonebook.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxPhonebook.Controls.Add(this.mpImportFBMonitor); + this.groupBoxPhonebook.Controls.Add(this.checkBoxSaveUnknownCaller); + this.groupBoxPhonebook.Controls.Add(this.checkBoxShowUnknownCaller); + this.groupBoxPhonebook.Controls.Add(this.checkBoxUsePhonebook); + this.groupBoxPhonebook.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.groupBoxPhonebook.Location = new System.Drawing.Point(6, 208); + this.groupBoxPhonebook.Name = "groupBoxPhonebook"; + this.groupBoxPhonebook.Size = new System.Drawing.Size(511, 95); + this.groupBoxPhonebook.TabIndex = 2; + this.groupBoxPhonebook.TabStop = false; + this.groupBoxPhonebook.Text = "phonebook settings"; + // + // mpImportFBMonitor + // + this.mpImportFBMonitor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.mpImportFBMonitor.Location = new System.Drawing.Point(355, 20); + this.mpImportFBMonitor.Name = "mpImportFBMonitor"; + this.mpImportFBMonitor.Size = new System.Drawing.Size(150, 23); + this.mpImportFBMonitor.TabIndex = 3; + this.mpImportFBMonitor.Text = "Import FRITZ!Box Monitor"; + this.mpImportFBMonitor.UseVisualStyleBackColor = true; + this.mpImportFBMonitor.Click += new System.EventHandler(this.mpImportFBMonitor_Click); + // + // checkBoxSaveUnknownCaller + // + this.checkBoxSaveUnknownCaller.AutoSize = true; + this.checkBoxSaveUnknownCaller.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxSaveUnknownCaller.Location = new System.Drawing.Point(24, 68); + this.checkBoxSaveUnknownCaller.Name = "checkBoxSaveUnknownCaller"; + this.checkBoxSaveUnknownCaller.Size = new System.Drawing.Size(121, 17); + this.checkBoxSaveUnknownCaller.TabIndex = 2; + this.checkBoxSaveUnknownCaller.Text = "save unknown caller"; + this.checkBoxSaveUnknownCaller.UseVisualStyleBackColor = true; + // + // checkBoxShowUnknownCaller + // + this.checkBoxShowUnknownCaller.AutoSize = true; + this.checkBoxShowUnknownCaller.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxShowUnknownCaller.Location = new System.Drawing.Point(24, 45); + this.checkBoxShowUnknownCaller.Name = "checkBoxShowUnknownCaller"; + this.checkBoxShowUnknownCaller.Size = new System.Drawing.Size(123, 17); + this.checkBoxShowUnknownCaller.TabIndex = 1; + this.checkBoxShowUnknownCaller.Text = "show unknown caller"; + this.checkBoxShowUnknownCaller.UseVisualStyleBackColor = true; + // + // checkBoxUsePhonebook + // + this.checkBoxUsePhonebook.AutoSize = true; + this.checkBoxUsePhonebook.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxUsePhonebook.Location = new System.Drawing.Point(6, 20); + this.checkBoxUsePhonebook.Name = "checkBoxUsePhonebook"; + this.checkBoxUsePhonebook.Size = new System.Drawing.Size(97, 17); + this.checkBoxUsePhonebook.TabIndex = 0; + this.checkBoxUsePhonebook.Text = "use phonebook"; + this.checkBoxUsePhonebook.UseVisualStyleBackColor = true; + this.checkBoxUsePhonebook.CheckedChanged += new System.EventHandler(this.checkBoxUsePhonebook_CheckedChanged); + // + // groupBoxNotify + // + this.groupBoxNotify.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxNotify.Controls.Add(this.checkBoxShowMsnOnHeading); + this.groupBoxNotify.Controls.Add(this.buttonMSNsRemove); + this.groupBoxNotify.Controls.Add(this.checkBoxFilterMSNs); + this.groupBoxNotify.Controls.Add(this.buttonMSNsAdd); + this.groupBoxNotify.Controls.Add(this.comboBoxMSNs); + this.groupBoxNotify.Controls.Add(this.numericUpDownTimeout); + this.groupBoxNotify.Controls.Add(this.checkBoxCloseOnTimout); + this.groupBoxNotify.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.groupBoxNotify.Location = new System.Drawing.Point(6, 6); + this.groupBoxNotify.Name = "groupBoxNotify"; + this.groupBoxNotify.Size = new System.Drawing.Size(511, 122); + this.groupBoxNotify.TabIndex = 0; + this.groupBoxNotify.TabStop = false; + this.groupBoxNotify.Text = "notify settings"; + // + // checkBoxShowMsnOnHeading + // + this.checkBoxShowMsnOnHeading.AutoSize = true; + this.checkBoxShowMsnOnHeading.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxShowMsnOnHeading.Location = new System.Drawing.Point(6, 99); + this.checkBoxShowMsnOnHeading.Name = "checkBoxShowMsnOnHeading"; + this.checkBoxShowMsnOnHeading.Size = new System.Drawing.Size(161, 17); + this.checkBoxShowMsnOnHeading.TabIndex = 6; + this.checkBoxShowMsnOnHeading.Text = "show MSN on notify-heading"; + this.checkBoxShowMsnOnHeading.UseVisualStyleBackColor = true; + // + // buttonMSNsRemove + // + this.buttonMSNsRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonMSNsRemove.Location = new System.Drawing.Point(275, 72); + this.buttonMSNsRemove.Name = "buttonMSNsRemove"; + this.buttonMSNsRemove.Size = new System.Drawing.Size(63, 21); + this.buttonMSNsRemove.TabIndex = 5; + this.buttonMSNsRemove.Text = "Remove"; + this.buttonMSNsRemove.UseVisualStyleBackColor = true; + this.buttonMSNsRemove.Click += new System.EventHandler(this.buttonMSNsRemove_Click); + // + // checkBoxFilterMSNs + // + this.checkBoxFilterMSNs.AutoSize = true; + this.checkBoxFilterMSNs.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxFilterMSNs.Location = new System.Drawing.Point(6, 49); + this.checkBoxFilterMSNs.Name = "checkBoxFilterMSNs"; + this.checkBoxFilterMSNs.Size = new System.Drawing.Size(194, 17); + this.checkBoxFilterMSNs.TabIndex = 2; + this.checkBoxFilterMSNs.Text = "show notify only for following MSNs"; + this.checkBoxFilterMSNs.UseVisualStyleBackColor = true; + this.checkBoxFilterMSNs.CheckedChanged += new System.EventHandler(this.checkBoxFilterMSNs_CheckedChanged); + // + // buttonMSNsAdd + // + this.buttonMSNsAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonMSNsAdd.Location = new System.Drawing.Point(206, 72); + this.buttonMSNsAdd.Name = "buttonMSNsAdd"; + this.buttonMSNsAdd.Size = new System.Drawing.Size(63, 21); + this.buttonMSNsAdd.TabIndex = 4; + this.buttonMSNsAdd.Text = "Add"; + this.buttonMSNsAdd.UseVisualStyleBackColor = true; + this.buttonMSNsAdd.Click += new System.EventHandler(this.buttonMSNsAdd_Click); + // + // comboBoxMSNs + // + this.comboBoxMSNs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxMSNs.BorderColor = System.Drawing.Color.Empty; + this.comboBoxMSNs.FormattingEnabled = true; + this.comboBoxMSNs.Location = new System.Drawing.Point(24, 72); + this.comboBoxMSNs.Name = "comboBoxMSNs"; + this.comboBoxMSNs.Size = new System.Drawing.Size(176, 21); + this.comboBoxMSNs.Sorted = true; + this.comboBoxMSNs.TabIndex = 3; + // + // numericUpDownTimeout + // + this.numericUpDownTimeout.Enabled = false; + this.numericUpDownTimeout.Location = new System.Drawing.Point(206, 20); + this.numericUpDownTimeout.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.numericUpDownTimeout.Name = "numericUpDownTimeout"; + this.numericUpDownTimeout.Size = new System.Drawing.Size(53, 21); + this.numericUpDownTimeout.TabIndex = 1; + this.numericUpDownTimeout.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.numericUpDownTimeout.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // checkBoxCloseOnTimout + // + this.checkBoxCloseOnTimout.AutoSize = true; + this.checkBoxCloseOnTimout.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxCloseOnTimout.Location = new System.Drawing.Point(6, 20); + this.checkBoxCloseOnTimout.Name = "checkBoxCloseOnTimout"; + this.checkBoxCloseOnTimout.Size = new System.Drawing.Size(179, 17); + this.checkBoxCloseOnTimout.TabIndex = 0; + this.checkBoxCloseOnTimout.Text = "auto-close after timeout expired"; + this.checkBoxCloseOnTimout.UseVisualStyleBackColor = true; + this.checkBoxCloseOnTimout.CheckedChanged += new System.EventHandler(this.checkBoxCloseOnTimout_CheckedChanged_1); + // + // groupBoxMedia + // + this.groupBoxMedia.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxMedia.Controls.Add(this.checkBoxResumeMedia); + this.groupBoxMedia.Controls.Add(this.checkBoxStopMedia); + this.groupBoxMedia.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.groupBoxMedia.Location = new System.Drawing.Point(6, 134); + this.groupBoxMedia.Name = "groupBoxMedia"; + this.groupBoxMedia.Size = new System.Drawing.Size(511, 68); + this.groupBoxMedia.TabIndex = 1; + this.groupBoxMedia.TabStop = false; + this.groupBoxMedia.Text = "media settings"; + // + // checkBoxResumeMedia + // + this.checkBoxResumeMedia.AutoSize = true; + this.... [truncated message content] |
From: <che...@us...> - 2007-06-17 11:03:10
|
Revision: 564 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=564&view=rev Author: chef_koch Date: 2007-06-17 04:03:06 -0700 (Sun, 17 Jun 2007) Log Message: ----------- code cleanup of LaunchFile() Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs 2007-06-17 10:51:25 UTC (rev 563) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs 2007-06-17 11:03:06 UTC (rev 564) @@ -425,83 +425,61 @@ public virtual void LaunchFile(FileItem curFileItem, bool mpGuiMode) { string curFilename = curFileItem.Filename; - if (curFilename == "") - { - return; - } + if (curFilename == "") return; // Launch File by item if (mpGuiMode) - { curFileItem.UpdateLaunchInfo(); - } + ProcessStartInfo procStart = new ProcessStartInfo(); - if (Filename != "") - { - // use the APPLICATION launcher and add current file information - procStart.FileName = Filename; // filename of the application - // set the arguments: one of the arguments is the fileitem-filename - procStart.Arguments = " " + this.Arguments + " "; + if (this.Filename != "") + { // use the APPLICATION launcher and add current file information + + // filename of the application + procStart.FileName = this.Filename; + + // avoid double quotes around the filename-argument..... if (UseQuotes) - { - // avoid double quotes around the filename-argument..... curFilename = "\"" + (curFileItem.Filename.TrimStart('\"')).TrimEnd('\"') + "\""; - } - if (procStart.Arguments.IndexOf("%FILEnoPATHnoEXT%") >= 0) - { + // set the arguments: one of the arguments is the fileitem-filename + if (this.Arguments.Contains("%FILEnoPATHnoEXT%")) // ex. kawaks: // winkawaks.exe alpham2 // => filename without path and extension is necessary! - string filenameNoPathNoExt = curFileItem.ExtractFileName(); - filenameNoPathNoExt = (filenameNoPathNoExt.TrimStart('\"')).TrimEnd('\"'); - filenameNoPathNoExt = Path.GetFileNameWithoutExtension(filenameNoPathNoExt); - procStart.Arguments = procStart.Arguments.Replace("%FILEnoPATHnoEXT%", filenameNoPathNoExt); - } + procStart.Arguments = " " + this.Arguments.Replace("%FILEnoPATHnoEXT%", Path.GetFileNameWithoutExtension(curFileItem.Filename)); + else if (this.Arguments.Contains("%FILE%")) + // placeholder found => replace the placeholder by the correct filename + procStart.Arguments = " " + this.Arguments.Replace("%FILE%", curFilename); else - { - // the fileitem-argument can be positioned anywhere in the argument string... - if (procStart.Arguments.IndexOf("%FILE%") == -1) - { - // no placeholder found => default handling: add the fileitem as the last argument - procStart.Arguments = procStart.Arguments + curFilename; - } - else - { - // placeholder found => replace the placeholder by the correct filename - procStart.Arguments = procStart.Arguments.Replace("%FILE%", curFilename); - } - } - procStart.WorkingDirectory = StartupDir; - if (procStart.WorkingDirectory.IndexOf("%FILEDIR%") != -1) - { - procStart.WorkingDirectory = procStart.WorkingDirectory.Replace("%FILEDIR%", Path.GetDirectoryName(curFileItem.Filename)); - } - procStart.UseShellExecute = UseShellExecute; + // no placeholder found => default handling: add the fileitem as the last argument + procStart.Arguments = " " + this.Arguments + " " + curFilename; + + // set WorkingDirectory + if (this.StartupDir.Contains("%FILEDIR%")) + procStart.WorkingDirectory = this.StartupDir.Replace("%FILEDIR%", Path.GetDirectoryName(curFileItem.Filename)); + else + procStart.WorkingDirectory = this.StartupDir; } else { // application has no launch-file // => try to make a correct launch using the current FILE object procStart.FileName = curFileItem.Filename; - procStart.WorkingDirectory = Path.GetFullPath(curFileItem.Filename); - - if (StartupDir != "") - { - if (StartupDir.Contains("%FILEDIR%")) - { - procStart.WorkingDirectory = procStart.WorkingDirectory.Replace("%FILEDIR%", Path.GetDirectoryName(curFileItem.Filename)); - } - else - { - procStart.WorkingDirectory = StartupDir; - } - } - - procStart.UseShellExecute = UseShellExecute; + // set WorkingDirectory + if (this.StartupDir == "") + procStart.WorkingDirectory = Path.GetDirectoryName(curFileItem.Filename); + else if (this.StartupDir.Contains("%FILEDIR%")) + procStart.WorkingDirectory = this.StartupDir.Replace("%FILEDIR%", Path.GetDirectoryName(curFileItem.Filename)); + else + procStart.WorkingDirectory = this.StartupDir; } + + // set UseShellExecute + procStart.UseShellExecute = this.UseShellExecute; + // set WindowStyle procStart.WindowStyle = this.WindowStyle; this.LaunchErrorMsg = ""; @@ -509,14 +487,11 @@ { DoPreLaunch(); - if (mpGuiMode) { AutoPlay.StopListening(); if (g_Player.Playing) - { g_Player.Stop(); - } } proc = new Process(); @@ -524,15 +499,13 @@ proc.Exited += new EventHandler(proc_Exited); proc.StartInfo = procStart; - ProgramUtils.StartProcess(proc, WaitForExit); + ProgramUtils.StartProcess(proc, this.WaitForExit); - if (mpGuiMode) { //GUIGraphicsContext.DX9Device.Reset(GUIGraphicsContext.DX9Device.PresentationParameters); AutoPlay.StartListening(); } - } catch (Exception ex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2007-06-17 10:51:28
|
Revision: 563 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=563&view=rev Author: zebons Date: 2007-06-17 03:51:25 -0700 (Sun, 17 Jun 2007) Log Message: ----------- Add an setup option for always display the Configuration Menu when entering in the plugin Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs trunk/plugins/MyFilms/MesFilmsSetup.Designer.cs trunk/plugins/MyFilms/MesFilmsSetup.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-06-17 10:43:10 UTC (rev 562) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-06-17 10:51:25 UTC (rev 563) @@ -325,9 +325,13 @@ GUIWindowManager.ShowPreviousWindow(); } bool boolchoice = true; - CurrentConfig = xmlreader.GetValueAsString("MyFilms", "Default_Config", ""); if (CurrentConfig == "") CurrentConfig = xmlreader.GetValueAsString("MyFilms", "Current_Config", ""); + + if (xmlreader.GetValueAsBool("MyFilms", "Menu_Config", false)) + CurrentConfig = xmlreader.GetValueAsString("MyFilms", "Default_Config", ""); + else + CurrentConfig = ""; if (CurrentConfig == "") { boolchoice = false; @@ -1204,6 +1208,7 @@ { using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MyFilms.xml"))) { + xmlwriter.SetValue("MyFilms", "Current_Config", CurrentConfig); xmlwriter.SetValue(CurrentConfig, "StrSelect", StrSelect.ToString()); xmlwriter.SetValue(CurrentConfig, "StrActors", StrActors.ToString()); xmlwriter.SetValue(CurrentConfig, "StrTitleSelect", StrTitleSelect.ToString()); @@ -1237,10 +1242,10 @@ //----------------------------------------------------------------------------------------------- // Load Config Parameters in MyFilms.xml file (section CurrentConfig) //----------------------------------------------------------------------------------------------- - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MyFilms.xml"))) - { - xmlwriter.SetValue("MyFilms", "Current_Config", CurrentConfig); - } + //using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MyFilms.xml"))) + //{ + // xmlwriter.SetValue("MyFilms", "Current_Config", CurrentConfig); + //} using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MyFilms.xml"))) { StrStorage = xmlreader.GetValueAsString(CurrentConfig, "AntStorage", ""); @@ -1307,6 +1312,7 @@ StrViewDfltItem = xmlreader.GetValueAsString(CurrentConfig, "ViewDfltItem", ""); StrViewDfltText = xmlreader.GetValueAsString(CurrentConfig, "ViewDfltText", ""); TitleDelim = xmlreader.GetValueAsString(CurrentConfig, "TitleDelim", "."); + } if ((boolreturn) && (wselectedlabel == "")) { Modified: trunk/plugins/MyFilms/MesFilmsSetup.Designer.cs =================================================================== --- trunk/plugins/MyFilms/MesFilmsSetup.Designer.cs 2007-06-17 10:43:10 UTC (rev 562) +++ trunk/plugins/MyFilms/MesFilmsSetup.Designer.cs 2007-06-17 10:51:25 UTC (rev 563) @@ -183,6 +183,7 @@ this.ButDelet = new System.Windows.Forms.Button(); this.ButSave = new System.Windows.Forms.Button(); this.Config_Dflt = new System.Windows.Forms.CheckBox(); + this.Config_Menu = new System.Windows.Forms.CheckBox(); this.General.SuspendLayout(); this.tabPage1.SuspendLayout(); this.groupBox11.SuspendLayout(); @@ -1049,11 +1050,22 @@ this.Config_Dflt.Text = "Default Configuration"; this.Config_Dflt.UseVisualStyleBackColor = true; // + // Config_Menu + // + this.Config_Menu.AutoSize = true; + this.Config_Menu.Location = new System.Drawing.Point(351, 43); + this.Config_Menu.Name = "Config_Menu"; + this.Config_Menu.Size = new System.Drawing.Size(297, 17); + this.Config_Menu.TabIndex = 74; + this.Config_Menu.Text = "Display Always Configuration\'s Menu (if no Default Config)"; + this.Config_Menu.UseVisualStyleBackColor = true; + // // MesFilmsSetup // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(780, 476); + this.Controls.Add(this.Config_Menu); this.Controls.Add(this.ButSave); this.Controls.Add(this.Config_Dflt); this.Controls.Add(this.ButDelet); @@ -1188,6 +1200,7 @@ private CheckBox SortTitle; private CheckBox radioButton2; private CheckBox radioButton1; + private CheckBox Config_Menu; } } \ No newline at end of file Modified: trunk/plugins/MyFilms/MesFilmsSetup.cs =================================================================== --- trunk/plugins/MyFilms/MesFilmsSetup.cs 2007-06-17 10:43:10 UTC (rev 562) +++ trunk/plugins/MyFilms/MesFilmsSetup.cs 2007-06-17 10:51:25 UTC (rev 563) @@ -38,6 +38,7 @@ ToolTip1.AutoPopDelay = 15000; ToolTip1.SetToolTip(this.Config_Name, "Enter here a config Name." + "\n" + "You can define many configuration on many (or on the same) database with differents selections." + "\n" + "Some configurations can be protected by a password usefull for children protection " + "\n" + "if you don't want they watch some movies..."); ToolTip1.SetToolTip(this.Config_Dflt, "If you select this, that configuration will be loaded each time you enter in the plugin." + "\n" + "If no default config defined and many configs, the configuration to load will be asked the first time." + "\n" + "After, the plugin load the last configuration used if no default defined"); + ToolTip1.SetToolTip(this.Config_Menu, "If you select this, the Configuration's Menu will be displayed each time you enter in the plugin. You cann't select that option if a Default Configuration is defined" + "\n" + "If no default config defined and many configs, the configuration to load will be asked the first time." + "\n" + "After, the plugin load the last configuration used if no default defined"); ToolTip1.SetToolTip(this.Dwp, "Enter a password here if you want to protect that configuration." + "\n" + "Usefull for children protection if you don't want they watch some movies." + "\n" + "You have to repeat your password"); ToolTip1.SetToolTip(this.textBox1, "Name of the plugin displayed in MP." + "\n" + "By default Films, but you can choose a better name"); ToolTip1.SetToolTip(this.MesFilmsCat, "Enter here the complete Filename + Path to your AMC XML Database." + "\n" + "You can use the search button to help you"); @@ -59,6 +60,8 @@ ToolTip1.SetToolTip(this.ButSave, "Save the Configuration. Controls are made at this time." + "\n" + "For DVDP database type, the temporary is built here" + "\n" + "and after each time the DVDP XML update date will be newer than the generated file one"); ToolTip1.SetToolTip(this.ButDelet, "Delete all informations for that configuration." + "\n" + "If that config was the default one, No default config'll be define."); ToolTip1.SetToolTip(this.ButQuit, "No comments..."); + ToolTip1.SetToolTip(this.groupBox9, "With those options, you can use specifics Tags DVDP's Fields" + "\n" + "and store either with Genre field either in another field" + "\n" + "of the generated DB."); + ToolTip1.SetToolTip(this.groupBox10, "With that option, you can store either the DVDP's Sorted field" + "\n" + "either the Original Title of the generated DB."); textBox1.Text = MyFilms_xmlreader.GetValueAsString("MyFilms", "PluginName", "Films"); MesFilms_nb_config = MyFilms_xmlreader.GetValueAsInt("MyFilms", "NbConfig", -1); for (int i = 0; i < (int)MesFilms_nb_config; i++) @@ -66,7 +69,14 @@ Config_Name.Items.Add(MyFilms_xmlreader.GetValueAsString("MyFilms", "ConfigName" + i, "")); MyFilms_xmlwriter.RemoveEntry("MyFilms", "ConfigName" + i); } - AntMovieCatalog ds = new AntMovieCatalog(); + if (MesFilms_nb_config > 0) + { + if (MyFilms_xmlreader.GetValueAsBool("MyFilms", "Menu_Config", false)) + Config_Menu.Checked = true; + else + Config_Menu.Checked = false; + } + AntMovieCatalog ds = new AntMovieCatalog(); AntStorage.Items.Add("(none)"); AntTitle2.Items.Add("(none)"); AntSort.Items.Add("(none)"); @@ -141,8 +151,14 @@ Config_Name.Focus(); return; } - if (textBox1.Text.Length == 0) + if ((Config_Dflt.Checked) && (Config_Menu.Checked)) { + System.Windows.Forms.MessageBox.Show("Option 'Always Display Configuration Menu' not possible with a Default Configuration defined !", "Configuration", MessageBoxButtons.OK, MessageBoxIcon.Stop); + Config_Menu.Focus(); + return; + } + if (textBox1.Text.Length == 0) + { System.Windows.Forms.MessageBox.Show("The Plugin's Name is Mandatory !", "Configuration", MessageBoxButtons.OK, MessageBoxIcon.Stop); textBox1.Focus(); return; @@ -344,6 +360,10 @@ if (MyFilms_xmlreader.GetValueAsString("MyFilms", "Default_Config", "") == Config_Name.Text) MyFilms_xmlwriter.RemoveEntry("MyFilms", "Default_Config"); } + if (Config_Menu.Checked) + { + MyFilms_xmlwriter.SetValueAsBool("MyFilms", "Menu_Config", Config_Menu.Checked); + } MyFilms_xmlwriter.SetValue(Config_Name.Text.ToString(), "CatalogType", CatalogType.SelectedIndex.ToString()); MyFilms_xmlwriter.SetValue(Config_Name.Text.ToString(), "AntCatalog", MesFilmsCat.Text.ToString()); MyFilms_xmlwriter.SetValue(Config_Name.Text.ToString(), "AntPicture", MesFilmsImg.Text.ToString()); @@ -498,12 +518,13 @@ ItemSearchFileName.Text = MyFilms_xmlreader.GetValueAsString(Config_Name.Text.ToString(), "ItemSearchFileName", ""); View_Dflt_Item.Items.Remove(View_Dflt_Item.Text); View_Dflt_Item.Items.Add(View_Dflt_Item.Text); - View_Dflt_Item.Text = MyFilms_xmlreader.GetValueAsString(Config_Name.Text.ToString(), "ViewDfltItem", ""); + View_Dflt_Item.Text = MyFilms_xmlreader.GetValueAsString(Config_Name.Text.ToString(), "ViewDfltItem", "(none)"); View_Dflt_Text.Text = MyFilms_xmlreader.GetValueAsString(Config_Name.Text.ToString(), "ViewDfltText", ""); if((Config_Name.Text) == MyFilms_xmlreader.GetValueAsString("MyFilms", "Default_Config", "")) Config_Dflt.Checked = true; else Config_Dflt.Checked = false; + if (!(AntViewItem1.Text == "Country") & !(AntViewItem1.Text == "Category") & !(AntViewItem1.Text == "Year") & !(AntViewItem1.Text == "(none)")) View_Dflt_Item.Items.Add(AntViewItem1.Text); if (!(AntViewItem2.Text == "Country") & !(AntViewItem2.Text == "Category") & !(AntViewItem2.Text == "Year") & !(AntViewItem2.Text == "(none)")) @@ -668,6 +689,8 @@ MyFilms_xmlwriter.SetValue("MyFilms", "NbConfig", Config_Name.Items.Count); MyFilms_xmlwriter.SetValue("MyFilms", "PluginName", textBox1.Text.ToString()); MyFilms_xmlwriter.SetValue("MyFilms", "Default_Config", ""); + MyFilms_xmlwriter.Dispose(); + mydivx.Dispose(); Close(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-17 10:43:30
|
Revision: 562 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=562&view=rev Author: chef_koch Date: 2007-06-17 03:43:10 -0700 (Sun, 17 Jun 2007) Log Message: ----------- renamed some objects Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs 2007-06-17 10:32:26 UTC (rev 561) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs 2007-06-17 10:43:10 UTC (rev 562) @@ -103,6 +103,11 @@ #region Properties // Helper Routines + public SQLiteClient db + { + get { return sqlDB; } + } + public int AppID { get { return appID; } @@ -294,10 +299,6 @@ } - public SQLiteClient db - { - get { return sqlDB; } - } public int CurrentSortIndex { get { return GetCurrentSortIndex(); } @@ -410,26 +411,20 @@ return (FileItem)Files[index]; } - public virtual void LaunchFile(GUIListItem item) + public virtual void LaunchFile(GUIListItem guiListItem) { // Launch File by GUILISTITEM // => look for FileItem and launch it using the found object - if (item.MusicTag == null) - { - return; - } - FileItem curFile = (FileItem)item.MusicTag; + if (guiListItem.MusicTag == null) return; + FileItem curFileItem = (FileItem)guiListItem.MusicTag; + if (curFileItem == null) return; - if (curFile == null) - { - return; - } - this.LaunchFile(curFile, true); + this.LaunchFile(curFileItem, true); } - public virtual void LaunchFile(FileItem curFile, bool mpGuiMode) + public virtual void LaunchFile(FileItem curFileItem, bool mpGuiMode) { - string curFilename = curFile.Filename; + string curFilename = curFileItem.Filename; if (curFilename == "") { return; @@ -438,7 +433,7 @@ // Launch File by item if (mpGuiMode) { - curFile.UpdateLaunchInfo(); + curFileItem.UpdateLaunchInfo(); } ProcessStartInfo procStart = new ProcessStartInfo(); @@ -451,7 +446,7 @@ if (UseQuotes) { // avoid double quotes around the filename-argument..... - curFilename = "\"" + (curFile.Filename.TrimStart('\"')).TrimEnd('\"') + "\""; + curFilename = "\"" + (curFileItem.Filename.TrimStart('\"')).TrimEnd('\"') + "\""; } if (procStart.Arguments.IndexOf("%FILEnoPATHnoEXT%") >= 0) @@ -459,7 +454,7 @@ // ex. kawaks: // winkawaks.exe alpham2 // => filename without path and extension is necessary! - string filenameNoPathNoExt = curFile.ExtractFileName(); + string filenameNoPathNoExt = curFileItem.ExtractFileName(); filenameNoPathNoExt = (filenameNoPathNoExt.TrimStart('\"')).TrimEnd('\"'); filenameNoPathNoExt = Path.GetFileNameWithoutExtension(filenameNoPathNoExt); procStart.Arguments = procStart.Arguments.Replace("%FILEnoPATHnoEXT%", filenameNoPathNoExt); @@ -481,7 +476,7 @@ procStart.WorkingDirectory = StartupDir; if (procStart.WorkingDirectory.IndexOf("%FILEDIR%") != -1) { - procStart.WorkingDirectory = procStart.WorkingDirectory.Replace("%FILEDIR%", Path.GetDirectoryName(curFile.Filename)); + procStart.WorkingDirectory = procStart.WorkingDirectory.Replace("%FILEDIR%", Path.GetDirectoryName(curFileItem.Filename)); } procStart.UseShellExecute = UseShellExecute; } @@ -489,15 +484,15 @@ { // application has no launch-file // => try to make a correct launch using the current FILE object - procStart.FileName = curFile.Filename; - procStart.WorkingDirectory = Path.GetFullPath(curFile.Filename); + procStart.FileName = curFileItem.Filename; + procStart.WorkingDirectory = Path.GetFullPath(curFileItem.Filename); if (StartupDir != "") { if (StartupDir.Contains("%FILEDIR%")) { - procStart.WorkingDirectory = procStart.WorkingDirectory.Replace("%FILEDIR%", Path.GetDirectoryName(curFile.Filename)); + procStart.WorkingDirectory = procStart.WorkingDirectory.Replace("%FILEDIR%", Path.GetDirectoryName(curFileItem.Filename)); } else { @@ -542,12 +537,12 @@ catch (Exception ex) { string ErrorString = String.Format("myPrograms: error launching program\n filename: {0}\n arguments: {1}\n WorkingDirectory: {2}\n stack: {3} {4} {5}", - procStart.FileName, - procStart.Arguments, - procStart.WorkingDirectory, - ex.Message, - ex.Source, - ex.StackTrace); + procStart.FileName, + procStart.Arguments, + procStart.WorkingDirectory, + ex.Message, + ex.Source, + ex.StackTrace); Log.Info(ErrorString); this.LaunchErrorMsg = ErrorString; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-17 10:32:28
|
Revision: 561 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=561&view=rev Author: chef_koch Date: 2007-06-17 03:32:26 -0700 (Sun, 17 Jun 2007) Log Message: ----------- minor formatting Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs 2007-06-16 15:44:09 UTC (rev 560) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs 2007-06-17 10:32:26 UTC (rev 561) @@ -369,17 +369,17 @@ strTxt = strReturn.Trim(); } */ + static public void StartProcess(Process proc, bool bWaitForExit) { - try { Log.Info("Start process {0} {1}", proc.StartInfo.FileName, proc.StartInfo.Arguments); + + // Event: Starting external process if (OnStartExternal != null) - { - // Event: Starting external process OnStartExternal(proc, bWaitForExit); - } + proc.Start(); proc.WaitForInputIdle(); if (bWaitForExit) @@ -391,13 +391,11 @@ // Thread.Sleep(5000); //} proc.WaitForExit(); - } + + // Event: After launching external process if (OnStopExternal != null) - { - // Event: After launching external process OnStopExternal(proc, bWaitForExit); - } } catch (Exception ex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-16 15:44:14
|
Revision: 560 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=560&view=rev Author: chef_koch Date: 2007-06-16 08:44:09 -0700 (Sat, 16 Jun 2007) Log Message: ----------- renamed property from Startupdir to StartupDir Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItemList.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs 2007-06-16 13:27:16 UTC (rev 559) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs 2007-06-16 15:44:09 UTC (rev 560) @@ -139,7 +139,7 @@ get { return windowStyle; } set { windowStyle = value; } } - public string Startupdir + public string StartupDir { get { return startupDir; } set { startupDir = value; } @@ -478,7 +478,7 @@ procStart.Arguments = procStart.Arguments.Replace("%FILE%", curFilename); } } - procStart.WorkingDirectory = Startupdir; + procStart.WorkingDirectory = StartupDir; if (procStart.WorkingDirectory.IndexOf("%FILEDIR%") != -1) { procStart.WorkingDirectory = procStart.WorkingDirectory.Replace("%FILEDIR%", Path.GetDirectoryName(curFile.Filename)); @@ -493,15 +493,15 @@ procStart.WorkingDirectory = Path.GetFullPath(curFile.Filename); - if (Startupdir != "") + if (StartupDir != "") { - if (Startupdir.Contains("%FILEDIR%")) + if (StartupDir.Contains("%FILEDIR%")) { procStart.WorkingDirectory = procStart.WorkingDirectory.Replace("%FILEDIR%", Path.GetDirectoryName(curFile.Filename)); } else { - procStart.WorkingDirectory = Startupdir; + procStart.WorkingDirectory = StartupDir; } } @@ -901,7 +901,7 @@ AppID = GetNewAppID(); // important to avoid subsequent inserts! string sql = String.Format("insert into tblApplicationItem (appid, fatherID, title, shorttitle, filename, arguments, windowstyle, startupdir, useshellexecute, usequotes, source_type, source, imagefile, filedirectory, imagedirectory, validextensions, importvalidimagesonly, iposition, enabled, enableGUIRefresh, GUIRefreshPossible, pincode, contentID, systemDefault, WaitForExit, preLaunch, postLaunch) values('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', '{10}', '{11}', '{12}', '{13}', '{14}', '{15}', '{16}', '{17}', '{18}', '{19}', '{20}', '{21}', '{22}', '{23}', '{24}', '{25}', '{26}')", AppID, FatherID, ProgramUtils.Encode(Title), ProgramUtils.Encode(ShortTitle), ProgramUtils.Encode(Filename), ProgramUtils.Encode(Arguments), - ProgramUtils.WindowStyleToStr(WindowStyle), ProgramUtils.Encode(Startupdir), ProgramUtils.BooleanToStr(UseShellExecute), + ProgramUtils.WindowStyleToStr(WindowStyle), ProgramUtils.Encode(StartupDir), ProgramUtils.BooleanToStr(UseShellExecute), ProgramUtils.BooleanToStr(UseQuotes), ProgramUtils.ApplicationTypeToString(SourceType), ProgramUtils.Encode(Source), ProgramUtils.Encode(Imagefile), ProgramUtils.Encode(FileDirectory), ProgramUtils.Encode(ImageDirectory), ProgramUtils.Encode(ValidExtensions), ProgramUtils.BooleanToStr(importValidImagesOnly), Position, ProgramUtils.BooleanToStr(Enabled), ProgramUtils.BooleanToStr(EnableGUIRefresh), ProgramUtils.BooleanToStr(GUIRefreshPossible), Pincode, @@ -931,7 +931,7 @@ { sql = String.Format("update tblApplicationItem set title = '{0}', shorttitle = '{1}', filename = '{2}', arguments = '{3}', windowstyle = '{4}', startupdir = '{5}', useshellexecute = '{6}', usequotes = '{7}', source_type = '{8}', source = '{9}', imagefile = '{10}',filedirectory = '{11}',imagedirectory = '{12}',validextensions = '{13}',importvalidimagesonly = '{14}',iposition = {15}, enabled = '{16}', fatherID = '{17}', enableGUIRefresh = '{18}', GUIRefreshPossible = '{19}', pincode = '{20}', contentID = '{21}', systemDefault = '{22}', WaitForExit = '{23}', preLaunch = '{24}', postLaunch = '{25}' where appID = {26}", ProgramUtils.Encode(Title), ProgramUtils.Encode(ShortTitle), ProgramUtils.Encode(Filename), ProgramUtils.Encode(Arguments), - ProgramUtils.WindowStyleToStr(WindowStyle), ProgramUtils.Encode(Startupdir), ProgramUtils.BooleanToStr(UseShellExecute), + ProgramUtils.WindowStyleToStr(WindowStyle), ProgramUtils.Encode(StartupDir), ProgramUtils.BooleanToStr(UseShellExecute), ProgramUtils.BooleanToStr(UseQuotes), ProgramUtils.ApplicationTypeToString(SourceType), ProgramUtils.Encode(Source), ProgramUtils.Encode(Imagefile), ProgramUtils.Encode(FileDirectory), ProgramUtils.Encode(ImageDirectory), ProgramUtils.Encode(ValidExtensions), ProgramUtils.BooleanToStr(importValidImagesOnly), Position, ProgramUtils.BooleanToStr(Enabled), FatherID, ProgramUtils.BooleanToStr(EnableGUIRefresh), ProgramUtils.BooleanToStr(GUIRefreshPossible), @@ -1104,7 +1104,7 @@ this.Filename = sourceApp.Filename; this.Arguments = sourceApp.Arguments; this.WindowStyle = sourceApp.WindowStyle; - this.Startupdir = sourceApp.Startupdir; + this.StartupDir = sourceApp.StartupDir; this.UseShellExecute = sourceApp.UseShellExecute; this.UseQuotes = sourceApp.UseQuotes; this.SourceType = sourceApp.SourceType; @@ -1263,7 +1263,7 @@ XmlNode startupDirNode = node.SelectSingleNode("startupDir"); if (startupDirNode != null) { - this.Startupdir = startupDirNode.InnerText; + this.StartupDir = startupDirNode.InnerText; } XmlNode useQuotesNode = node.SelectSingleNode("useQuotes"); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItemList.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItemList.cs 2007-06-16 13:27:16 UTC (rev 559) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItemList.cs 2007-06-16 15:44:09 UTC (rev 560) @@ -64,7 +64,7 @@ newApp.Filename = ProgramUtils.Get(results, recordIndex, "filename"); newApp.Arguments = ProgramUtils.Get(results, recordIndex, "arguments"); newApp.WindowStyle = ProgramUtils.GetProcessWindowStyle(results, recordIndex, "windowstyle"); - newApp.Startupdir = ProgramUtils.Get(results, recordIndex, "startupdir"); + newApp.StartupDir = ProgramUtils.Get(results, recordIndex, "startupdir"); newApp.UseShellExecute = ProgramUtils.GetBool(results, recordIndex, "useshellexecute"); newApp.UseQuotes = ProgramUtils.GetBool(results, recordIndex, "usequotes"); newApp.SourceType = ProgramUtils.GetSourceType(results, recordIndex, "source_type"); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs 2007-06-16 13:27:16 UTC (rev 559) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs 2007-06-16 15:44:09 UTC (rev 560) @@ -53,7 +53,7 @@ applicationExeTextBox.Text = curApp.Filename; applicationArgumentsTextBox.Text = curApp.Arguments; SetWindowStyle(curApp.WindowStyle); - startupDirComboBox.Text = curApp.Startupdir; + startupDirComboBox.Text = curApp.StartupDir; shellexecuteCheckBox.Checked = (curApp.UseShellExecute); quoteCheckBox.Checked = (curApp.UseQuotes); waitExitCheckBox.Checked = (curApp.WaitForExit); @@ -70,7 +70,7 @@ curApp.Filename = applicationExeTextBox.Text; curApp.Arguments = applicationArgumentsTextBox.Text; curApp.WindowStyle = GetSelectedWindowStyle(); - curApp.Startupdir = startupDirComboBox.Text; + curApp.StartupDir = startupDirComboBox.Text; curApp.UseShellExecute = (shellexecuteCheckBox.Checked); curApp.UseQuotes = (quoteCheckBox.Checked); curApp.WaitForExit = (waitExitCheckBox.Checked); @@ -107,7 +107,7 @@ applicationArgumentsTextBox.Text = applicationItem.Arguments; SetWindowStyle(applicationItem.WindowStyle); - startupDirComboBox.Text = applicationItem.Startupdir; + startupDirComboBox.Text = applicationItem.StartupDir; shellexecuteCheckBox.Checked = applicationItem.UseShellExecute; quoteCheckBox.Checked = applicationItem.UseQuotes; waitExitCheckBox.Checked = applicationItem.WaitForExit; Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs 2007-06-16 13:27:16 UTC (rev 559) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs 2007-06-16 15:44:09 UTC (rev 560) @@ -65,7 +65,7 @@ this.titleTextBox.Text = curApp.Title; this.applicationExeTextBox.Text = curApp.Filename; this.applicationArgumentsTextBox.Text = curApp.Arguments; - this.startupDirComboBox.Text = curApp.Startupdir; + this.startupDirComboBox.Text = curApp.StartupDir; this.quoteCheckBox.Checked = true; //(curApp.UseQuotes); this.waitExitCheckBox.Checked = (curApp.WaitForExit); @@ -85,7 +85,7 @@ curApp.Filename = this.applicationExeTextBox.Text; curApp.Arguments = this.applicationArgumentsTextBox.Text; curApp.WindowStyle = GetSelectedWindowStyle(); - curApp.Startupdir = this.startupDirComboBox.Text; + curApp.StartupDir = this.startupDirComboBox.Text; curApp.UseShellExecute = (this.shellexecuteCheckBox.Checked); curApp.UseQuotes = (this.quoteCheckBox.Checked); curApp.WaitForExit = (this.waitExitCheckBox.Checked); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-06-16 13:27:18
|
Revision: 559 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=559&view=rev Author: and-81 Date: 2007-06-16 06:27:16 -0700 (Sat, 16 Jun 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Common/MPUtils/MPUtils.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MP Blast Zone Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MP Control Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2 Blaster Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3 Blaster Plugin.csproj Modified: trunk/plugins/IR Server Suite/Common/MPUtils/MPUtils.csproj =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/MPUtils.csproj 2007-06-16 12:18:13 UTC (rev 558) +++ trunk/plugins/IR Server Suite/Common/MPUtils/MPUtils.csproj 2007-06-16 13:27:16 UTC (rev 559) @@ -33,14 +33,14 @@ </DocumentationFile> </PropertyGroup> <ItemGroup> - <Reference Include="Core, Version=0.2.2.0, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Core.DLL</HintPath> <Private>False</Private> </Reference> - <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Dialogs, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Dialogs.DLL</HintPath> <Private>False</Private> </Reference> <Reference Include="System" /> @@ -48,9 +48,9 @@ <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> - <Reference Include="Utils, Version=2.1.2.0, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Utils, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Utils.DLL</HintPath> <Private>False</Private> </Reference> </ItemGroup> Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MP Blast Zone Plugin.csproj =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MP Blast Zone Plugin.csproj 2007-06-16 12:18:13 UTC (rev 558) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MP Blast Zone Plugin.csproj 2007-06-16 13:27:16 UTC (rev 559) @@ -79,14 +79,14 @@ </Compile> </ItemGroup> <ItemGroup> - <Reference Include="Core, Version=1.0.2581.1884, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Core.DLL</HintPath> <Private>False</Private> </Reference> - <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Dialogs, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Dialogs.DLL</HintPath> <Private>False</Private> </Reference> <Reference Include="System" /> @@ -94,9 +94,9 @@ <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> - <Reference Include="Utils, Version=1.0.2581.1867, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Utils, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\MediaPortal\Core\bin\Release\Utils.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Utils.DLL</HintPath> <Private>False</Private> </Reference> </ItemGroup> Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MP Control Plugin.csproj =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MP Control Plugin.csproj 2007-06-16 12:18:13 UTC (rev 558) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MP Control Plugin.csproj 2007-06-16 13:27:16 UTC (rev 559) @@ -85,28 +85,28 @@ </Compile> </ItemGroup> <ItemGroup> - <Reference Include="Core, Version=1.0.2581.1884, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Core.DLL</HintPath> <Private>False</Private> </Reference> - <Reference Include="Databases, Version=1.0.2581.1890, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Databases, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\MediaPortal\Databases\bin\Release\Databases.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Databases.DLL</HintPath> <Private>False</Private> </Reference> - <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Dialogs, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Dialogs.DLL</HintPath> <Private>False</Private> </Reference> <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal Development\MediaPortal\xbmc\bin\Release\Microsoft.DirectX.Direct3D.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Microsoft.DirectX.Direct3D.DLL</HintPath> </Reference> - <Reference Include="RemotePlugins, Version=1.0.2581.1913, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="RemotePlugins, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\MediaPortal\RemotePlugins\bin\Release\RemotePlugins.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\RemotePlugins.DLL</HintPath> <Private>False</Private> </Reference> <Reference Include="System" /> @@ -114,14 +114,14 @@ <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> - <Reference Include="TVCapture, Version=1.0.2581.1894, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="TVCapture, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\MediaPortal\TVCapture\bin\Release\TVCapture.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\TVCapture.DLL</HintPath> <Private>False</Private> </Reference> - <Reference Include="Utils, Version=1.0.2581.1867, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Utils, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\MediaPortal\Core\bin\Release\Utils.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Utils.DLL</HintPath> <Private>False</Private> </Reference> </ItemGroup> Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2 Blaster Plugin.csproj =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2 Blaster Plugin.csproj 2007-06-16 12:18:13 UTC (rev 558) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2 Blaster Plugin.csproj 2007-06-16 13:27:16 UTC (rev 559) @@ -85,19 +85,19 @@ <Compile Include="TV2BlasterPlugin.cs" /> </ItemGroup> <ItemGroup> - <Reference Include="Core, Version=1.0.2581.1884, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Core.DLL</HintPath> <Private>False</Private> </Reference> - <Reference Include="Databases, Version=1.0.2581.1890, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Databases, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\MediaPortal\Databases\bin\Release\Databases.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Databases.DLL</HintPath> <Private>False</Private> </Reference> - <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Dialogs, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Dialogs.DLL</HintPath> <Private>False</Private> </Reference> <Reference Include="System" /> @@ -105,14 +105,14 @@ <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> - <Reference Include="TVCapture, Version=1.0.2581.1894, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="TVCapture, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\MediaPortal\TVCapture\bin\Release\TVCapture.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\TVCapture.DLL</HintPath> <Private>False</Private> </Reference> - <Reference Include="Utils, Version=1.0.2581.1867, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Utils, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\MediaPortal\Core\bin\Release\Utils.dll</HintPath> + <HintPath>..\..\..\..\MediaPortal 0.2.3.0\Utils.DLL</HintPath> <Private>False</Private> </Reference> </ItemGroup> Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3 Blaster Plugin.csproj =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3 Blaster Plugin.csproj 2007-06-16 12:18:13 UTC (rev 558) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3 Blaster Plugin.csproj 2007-06-16 13:27:16 UTC (rev 559) @@ -79,22 +79,22 @@ <ItemGroup> <Reference Include="Gentle.Common, Version=1.2.9.1285, Culture=neutral, PublicKeyToken=80b5de62e27be49b"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\TV Engine\TVLibrary\TVDatabase\references\Gentle.Common.dll</HintPath> + <HintPath>..\..\..\..\TV Engine 3 0.2.3.0\Gentle.Common.DLL</HintPath> <Private>False</Private> </Reference> <Reference Include="Gentle.Framework, Version=1.2.9.1286, Culture=neutral, PublicKeyToken=80b5de62e27be49b"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\TV Engine\TVLibrary\TVDatabase\references\Gentle.Framework.dll</HintPath> + <HintPath>..\..\..\..\TV Engine 3 0.2.3.0\Gentle.Framework.DLL</HintPath> <Private>False</Private> </Reference> <Reference Include="PluginBase, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\TV Engine\TVLibrary\TvService\bin\Release\PluginBase.dll</HintPath> + <HintPath>..\..\..\..\TV Engine 3 0.2.3.0\PluginBase.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="SetupControls, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\TV Engine\TVLibrary\SetupControls\bin\Release\SetupControls.dll</HintPath> + <HintPath>..\..\..\..\TV Engine 3 0.2.3.0\SetupControls.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="System"> @@ -112,22 +112,22 @@ <Reference Include="System.Xml" /> <Reference Include="TvBusinessLayer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\TV Engine\TVLibrary\TvService\bin\Release\TvBusinessLayer.dll</HintPath> + <HintPath>..\..\..\..\TV Engine 3 0.2.3.0\TvBusinessLayer.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="TvControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\TV Engine\TVLibrary\TvControl\bin\Release\TvControl.dll</HintPath> + <HintPath>..\..\..\..\TV Engine 3 0.2.3.0\TvControl.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="TVDatabase, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\TV Engine\TVLibrary\TVDatabase\bin\Release\TVDatabase.dll</HintPath> + <HintPath>..\..\..\..\TV Engine 3 0.2.3.0\TVDatabase.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="TvLibrary.Interfaces, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\MediaPortal Development\TV Engine\TVLibrary\TvLibrary.Interfaces\bin\Release\TvLibrary.Interfaces.dll</HintPath> + <HintPath>..\..\..\..\TV Engine 3 0.2.3.0\TvLibrary.Interfaces.dll</HintPath> <Private>False</Private> </Reference> </ItemGroup> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-06-16 12:18:15
|
Revision: 558 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=558&view=rev Author: and-81 Date: 2007-06-16 05:18:13 -0700 (Sat, 16 Jun 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.resx trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/PopupMessage.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs trunk/plugins/IR Server Suite/Common/MPUtils/Forms/GoToScreen.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPUtils.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs trunk/plugins/MCEReplacement/AssemblyInfo.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj Added Paths: ----------- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/TcpMessageCommand.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/TcpMessageCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/TcpMessageCommand.resx Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-06-16 00:09:51 UTC (rev 557) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-06-16 12:18:13 UTC (rev 558) @@ -217,6 +217,12 @@ _notifyIcon.Visible = false; + if (_mode == IRServerMode.ServerMode) + { + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Server Shutdown", null); + SendToAll(message); + } + if (_pluginReceive != null && _pluginReceive.CanReceive) _pluginReceive.RemoteButtonCallback -= new RemoteButtonHandler(RemoteButtonPressed); @@ -949,12 +955,6 @@ { IrssLog.Info("Shutdown command received"); - if (_mode == IRServerMode.ServerMode) - { - PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Server Shutdown", null); - SendToAll(response); - } - Stop(); Application.Exit(); break; @@ -1084,12 +1084,6 @@ IrssLog.Info("Quit"); - if (_mode == IRServerMode.ServerMode) - { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Server Shutdown", null); - SendToAll(message); - } - Stop(); Application.Exit(); } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs 2007-06-16 00:09:51 UTC (rev 557) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs 2007-06-16 12:18:13 UTC (rev 558) @@ -79,16 +79,20 @@ this.textBoxSerialCommand = new System.Windows.Forms.TextBox(); this.labelSerialCommand = new System.Windows.Forms.Label(); this.tabPageMessage = new System.Windows.Forms.TabPage(); - this.checkBoxMsgCurrApp = new System.Windows.Forms.CheckBox(); - this.labelMsgApp = new System.Windows.Forms.Label(); - this.buttonFindMsgApp = new System.Windows.Forms.Button(); - this.textBoxMsgApp = new System.Windows.Forms.TextBox(); + this.groupBoxMessageDetails = new System.Windows.Forms.GroupBox(); + this.labelMessage = new System.Windows.Forms.Label(); + this.numericUpDownMsg = new System.Windows.Forms.NumericUpDown(); this.numericUpDownLParam = new System.Windows.Forms.NumericUpDown(); this.numericUpDownWParam = new System.Windows.Forms.NumericUpDown(); - this.numericUpDownMsg = new System.Windows.Forms.NumericUpDown(); this.labelLParam = new System.Windows.Forms.Label(); this.labelWParam = new System.Windows.Forms.Label(); - this.labelMessage = new System.Windows.Forms.Label(); + this.groupBoxMessageTarget = new System.Windows.Forms.GroupBox(); + this.radioButtonActiveWindow = new System.Windows.Forms.RadioButton(); + this.textBoxMsgTarget = new System.Windows.Forms.TextBox(); + this.buttonFindMsgTarget = new System.Windows.Forms.Button(); + this.radioButtonWindowTitle = new System.Windows.Forms.RadioButton(); + this.radioButtonApplication = new System.Windows.Forms.RadioButton(); + this.radioButtonClass = new System.Windows.Forms.RadioButton(); this.tabPageKeystrokes = new System.Windows.Forms.TabPage(); this.buttonKeyHelp = new System.Windows.Forms.Button(); this.labelKeystrokes = new System.Windows.Forms.Label(); @@ -107,9 +111,11 @@ ((System.ComponentModel.ISupportInitialize)(this.numericUpDownDataBits)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownBaudRate)).BeginInit(); this.tabPageMessage.SuspendLayout(); + this.groupBoxMessageDetails.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMsg)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLParam)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownWParam)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMsg)).BeginInit(); + this.groupBoxMessageTarget.SuspendLayout(); this.tabPageKeystrokes.SuspendLayout(); this.SuspendLayout(); // @@ -123,7 +129,7 @@ this.groupBoxButton.Controls.Add(this.textBoxButtonDesc); this.groupBoxButton.Location = new System.Drawing.Point(8, 8); this.groupBoxButton.Name = "groupBoxButton"; - this.groupBoxButton.Size = new System.Drawing.Size(408, 80); + this.groupBoxButton.Size = new System.Drawing.Size(456, 80); this.groupBoxButton.TabIndex = 0; this.groupBoxButton.TabStop = false; this.groupBoxButton.Text = "Button"; @@ -154,7 +160,7 @@ this.textBoxKeyCode.Location = new System.Drawing.Point(88, 16); this.textBoxKeyCode.Name = "textBoxKeyCode"; this.textBoxKeyCode.ReadOnly = true; - this.textBoxKeyCode.Size = new System.Drawing.Size(312, 20); + this.textBoxKeyCode.Size = new System.Drawing.Size(360, 20); this.textBoxKeyCode.TabIndex = 1; this.textBoxKeyCode.TabStop = false; this.textBoxKeyCode.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -165,8 +171,9 @@ | System.Windows.Forms.AnchorStyles.Right))); this.textBoxButtonDesc.Location = new System.Drawing.Point(88, 48); this.textBoxButtonDesc.Name = "textBoxButtonDesc"; - this.textBoxButtonDesc.Size = new System.Drawing.Size(312, 20); + this.textBoxButtonDesc.Size = new System.Drawing.Size(360, 20); this.textBoxButtonDesc.TabIndex = 3; + this.textBoxButtonDesc.TextChanged += new System.EventHandler(this.textBoxButtonDesc_TextChanged); // // groupBoxSet // @@ -179,7 +186,7 @@ this.groupBoxSet.Controls.Add(this.buttonTest); this.groupBoxSet.Location = new System.Drawing.Point(8, 96); this.groupBoxSet.Name = "groupBoxSet"; - this.groupBoxSet.Size = new System.Drawing.Size(408, 264); + this.groupBoxSet.Size = new System.Drawing.Size(456, 296); this.groupBoxSet.TabIndex = 1; this.groupBoxSet.TabStop = false; this.groupBoxSet.Text = "Command"; @@ -189,16 +196,16 @@ this.textBoxCommand.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBoxCommand.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.textBoxCommand.Location = new System.Drawing.Point(64, 232); + this.textBoxCommand.Location = new System.Drawing.Point(64, 264); this.textBoxCommand.Name = "textBoxCommand"; this.textBoxCommand.ReadOnly = true; - this.textBoxCommand.Size = new System.Drawing.Size(280, 20); + this.textBoxCommand.Size = new System.Drawing.Size(328, 20); this.textBoxCommand.TabIndex = 2; // // buttonSet // this.buttonSet.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonSet.Location = new System.Drawing.Point(8, 232); + this.buttonSet.Location = new System.Drawing.Point(8, 264); this.buttonSet.Name = "buttonSet"; this.buttonSet.Size = new System.Drawing.Size(48, 20); this.buttonSet.TabIndex = 1; @@ -220,7 +227,7 @@ this.tabControl.Location = new System.Drawing.Point(8, 24); this.tabControl.Name = "tabControl"; this.tabControl.SelectedIndex = 0; - this.tabControl.Size = new System.Drawing.Size(392, 200); + this.tabControl.Size = new System.Drawing.Size(440, 232); this.tabControl.TabIndex = 0; // // tabPageBlastIR @@ -235,7 +242,7 @@ this.tabPageBlastIR.Location = new System.Drawing.Point(4, 22); this.tabPageBlastIR.Name = "tabPageBlastIR"; this.tabPageBlastIR.Padding = new System.Windows.Forms.Padding(3); - this.tabPageBlastIR.Size = new System.Drawing.Size(384, 174); + this.tabPageBlastIR.Size = new System.Drawing.Size(432, 206); this.tabPageBlastIR.TabIndex = 0; this.tabPageBlastIR.Text = "Blast IR"; this.tabPageBlastIR.UseVisualStyleBackColor = true; @@ -255,13 +262,13 @@ this.comboBoxSpeed.FormattingEnabled = true; this.comboBoxSpeed.Location = new System.Drawing.Point(96, 80); this.comboBoxSpeed.Name = "comboBoxSpeed"; - this.comboBoxSpeed.Size = new System.Drawing.Size(88, 21); + this.comboBoxSpeed.Size = new System.Drawing.Size(120, 21); this.comboBoxSpeed.TabIndex = 5; // // buttonLearnIR // this.buttonLearnIR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonLearnIR.Location = new System.Drawing.Point(312, 144); + this.buttonLearnIR.Location = new System.Drawing.Point(360, 176); this.buttonLearnIR.Name = "buttonLearnIR"; this.buttonLearnIR.Size = new System.Drawing.Size(64, 24); this.buttonLearnIR.TabIndex = 6; @@ -286,7 +293,7 @@ this.comboBoxIRCode.FormattingEnabled = true; this.comboBoxIRCode.Location = new System.Drawing.Point(96, 16); this.comboBoxIRCode.Name = "comboBoxIRCode"; - this.comboBoxIRCode.Size = new System.Drawing.Size(280, 21); + this.comboBoxIRCode.Size = new System.Drawing.Size(328, 21); this.comboBoxIRCode.TabIndex = 1; // // comboBoxPort @@ -295,7 +302,7 @@ this.comboBoxPort.FormattingEnabled = true; this.comboBoxPort.Location = new System.Drawing.Point(96, 48); this.comboBoxPort.Name = "comboBoxPort"; - this.comboBoxPort.Size = new System.Drawing.Size(88, 21); + this.comboBoxPort.Size = new System.Drawing.Size(120, 21); this.comboBoxPort.TabIndex = 3; // // labelIRCommand @@ -315,7 +322,7 @@ this.tabPageMacro.Location = new System.Drawing.Point(4, 22); this.tabPageMacro.Name = "tabPageMacro"; this.tabPageMacro.Padding = new System.Windows.Forms.Padding(3); - this.tabPageMacro.Size = new System.Drawing.Size(384, 174); + this.tabPageMacro.Size = new System.Drawing.Size(432, 206); this.tabPageMacro.TabIndex = 1; this.tabPageMacro.Text = "Macro"; this.tabPageMacro.UseVisualStyleBackColor = true; @@ -323,7 +330,7 @@ // buttonNewMacro // this.buttonNewMacro.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonNewMacro.Location = new System.Drawing.Point(312, 144); + this.buttonNewMacro.Location = new System.Drawing.Point(360, 176); this.buttonNewMacro.Name = "buttonNewMacro"; this.buttonNewMacro.Size = new System.Drawing.Size(64, 24); this.buttonNewMacro.TabIndex = 2; @@ -339,7 +346,7 @@ this.comboBoxMacro.FormattingEnabled = true; this.comboBoxMacro.Location = new System.Drawing.Point(96, 16); this.comboBoxMacro.Name = "comboBoxMacro"; - this.comboBoxMacro.Size = new System.Drawing.Size(280, 21); + this.comboBoxMacro.Size = new System.Drawing.Size(328, 21); this.comboBoxMacro.TabIndex = 1; // // labelMacro @@ -368,7 +375,7 @@ this.tabPageProgram.Location = new System.Drawing.Point(4, 22); this.tabPageProgram.Name = "tabPageProgram"; this.tabPageProgram.Padding = new System.Windows.Forms.Padding(3); - this.tabPageProgram.Size = new System.Drawing.Size(384, 174); + this.tabPageProgram.Size = new System.Drawing.Size(432, 206); this.tabPageProgram.TabIndex = 3; this.tabPageProgram.Text = "Run"; this.tabPageProgram.UseVisualStyleBackColor = true; @@ -401,7 +408,7 @@ this.comboBoxWindowStyle.Location = new System.Drawing.Point(96, 112); this.comboBoxWindowStyle.MaxDropDownItems = 4; this.comboBoxWindowStyle.Name = "comboBoxWindowStyle"; - this.comboBoxWindowStyle.Size = new System.Drawing.Size(104, 21); + this.comboBoxWindowStyle.Size = new System.Drawing.Size(112, 21); this.comboBoxWindowStyle.TabIndex = 9; // // labelWindowStyle @@ -428,7 +435,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.textBoxApplicationParameters.Location = new System.Drawing.Point(96, 80); this.textBoxApplicationParameters.Name = "textBoxApplicationParameters"; - this.textBoxApplicationParameters.Size = new System.Drawing.Size(280, 20); + this.textBoxApplicationParameters.Size = new System.Drawing.Size(328, 20); this.textBoxApplicationParameters.TabIndex = 7; // // labelStartupFolder @@ -443,7 +450,7 @@ // buttonStartupFolder // this.buttonStartupFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonStartupFolder.Location = new System.Drawing.Point(352, 48); + this.buttonStartupFolder.Location = new System.Drawing.Point(400, 48); this.buttonStartupFolder.Name = "buttonStartupFolder"; this.buttonStartupFolder.Size = new System.Drawing.Size(24, 20); this.buttonStartupFolder.TabIndex = 5; @@ -457,7 +464,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.textBoxAppStartFolder.Location = new System.Drawing.Point(96, 48); this.textBoxAppStartFolder.Name = "textBoxAppStartFolder"; - this.textBoxAppStartFolder.Size = new System.Drawing.Size(248, 20); + this.textBoxAppStartFolder.Size = new System.Drawing.Size(296, 20); this.textBoxAppStartFolder.TabIndex = 4; // // labelApplication @@ -472,7 +479,7 @@ // buttonLocate // this.buttonLocate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonLocate.Location = new System.Drawing.Point(352, 16); + this.buttonLocate.Location = new System.Drawing.Point(400, 16); this.buttonLocate.Name = "buttonLocate"; this.buttonLocate.Size = new System.Drawing.Size(24, 20); this.buttonLocate.TabIndex = 2; @@ -486,7 +493,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.textBoxApp.Location = new System.Drawing.Point(96, 16); this.textBoxApp.Name = "textBoxApp"; - this.textBoxApp.Size = new System.Drawing.Size(248, 20); + this.textBoxApp.Size = new System.Drawing.Size(296, 20); this.textBoxApp.TabIndex = 1; // // tabPageSerial @@ -498,7 +505,7 @@ this.tabPageSerial.Location = new System.Drawing.Point(4, 22); this.tabPageSerial.Name = "tabPageSerial"; this.tabPageSerial.Padding = new System.Windows.Forms.Padding(3); - this.tabPageSerial.Size = new System.Drawing.Size(384, 174); + this.tabPageSerial.Size = new System.Drawing.Size(432, 206); this.tabPageSerial.TabIndex = 2; this.tabPageSerial.Text = "Serial"; this.tabPageSerial.UseVisualStyleBackColor = true; @@ -520,7 +527,7 @@ this.groupBoxPortSetup.Controls.Add(this.labelComPort); this.groupBoxPortSetup.Location = new System.Drawing.Point(8, 48); this.groupBoxPortSetup.Name = "groupBoxPortSetup"; - this.groupBoxPortSetup.Size = new System.Drawing.Size(368, 120); + this.groupBoxPortSetup.Size = new System.Drawing.Size(416, 144); this.groupBoxPortSetup.TabIndex = 3; this.groupBoxPortSetup.TabStop = false; this.groupBoxPortSetup.Text = "Port setup"; @@ -529,7 +536,7 @@ // this.comboBoxComPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxComPort.FormattingEnabled = true; - this.comboBoxComPort.Location = new System.Drawing.Point(80, 24); + this.comboBoxComPort.Location = new System.Drawing.Point(88, 24); this.comboBoxComPort.Name = "comboBoxComPort"; this.comboBoxComPort.Size = new System.Drawing.Size(96, 21); this.comboBoxComPort.TabIndex = 1; @@ -538,7 +545,7 @@ // this.comboBoxStopBits.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxStopBits.FormattingEnabled = true; - this.comboBoxStopBits.Location = new System.Drawing.Point(80, 88); + this.comboBoxStopBits.Location = new System.Drawing.Point(88, 88); this.comboBoxStopBits.Name = "comboBoxStopBits"; this.comboBoxStopBits.Size = new System.Drawing.Size(96, 21); this.comboBoxStopBits.TabIndex = 9; @@ -547,14 +554,14 @@ // this.labelStopBits.Location = new System.Drawing.Point(8, 88); this.labelStopBits.Name = "labelStopBits"; - this.labelStopBits.Size = new System.Drawing.Size(72, 21); + this.labelStopBits.Size = new System.Drawing.Size(80, 21); this.labelStopBits.TabIndex = 8; this.labelStopBits.Text = "Stop bits:"; this.labelStopBits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // numericUpDownDataBits // - this.numericUpDownDataBits.Location = new System.Drawing.Point(264, 56); + this.numericUpDownDataBits.Location = new System.Drawing.Point(312, 56); this.numericUpDownDataBits.Maximum = new decimal(new int[] { 8, 0, @@ -577,9 +584,9 @@ // // labelDataBits // - this.labelDataBits.Location = new System.Drawing.Point(192, 56); + this.labelDataBits.Location = new System.Drawing.Point(232, 56); this.labelDataBits.Name = "labelDataBits"; - this.labelDataBits.Size = new System.Drawing.Size(72, 20); + this.labelDataBits.Size = new System.Drawing.Size(80, 20); this.labelDataBits.TabIndex = 6; this.labelDataBits.Text = "Data bits:"; this.labelDataBits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -588,7 +595,7 @@ // this.comboBoxParity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxParity.FormattingEnabled = true; - this.comboBoxParity.Location = new System.Drawing.Point(80, 56); + this.comboBoxParity.Location = new System.Drawing.Point(88, 56); this.comboBoxParity.Name = "comboBoxParity"; this.comboBoxParity.Size = new System.Drawing.Size(96, 21); this.comboBoxParity.TabIndex = 5; @@ -597,14 +604,14 @@ // this.labelParity.Location = new System.Drawing.Point(8, 56); this.labelParity.Name = "labelParity"; - this.labelParity.Size = new System.Drawing.Size(72, 21); + this.labelParity.Size = new System.Drawing.Size(80, 21); this.labelParity.TabIndex = 4; this.labelParity.Text = "Parity:"; this.labelParity.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // numericUpDownBaudRate // - this.numericUpDownBaudRate.Location = new System.Drawing.Point(264, 24); + this.numericUpDownBaudRate.Location = new System.Drawing.Point(312, 24); this.numericUpDownBaudRate.Maximum = new decimal(new int[] { 256000, 0, @@ -627,9 +634,9 @@ // // labelBaudRate // - this.labelBaudRate.Location = new System.Drawing.Point(192, 24); + this.labelBaudRate.Location = new System.Drawing.Point(232, 24); this.labelBaudRate.Name = "labelBaudRate"; - this.labelBaudRate.Size = new System.Drawing.Size(72, 20); + this.labelBaudRate.Size = new System.Drawing.Size(80, 20); this.labelBaudRate.TabIndex = 2; this.labelBaudRate.Text = "Baud rate:"; this.labelBaudRate.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -638,7 +645,7 @@ // this.labelComPort.Location = new System.Drawing.Point(8, 24); this.labelComPort.Name = "labelComPort"; - this.labelComPort.Size = new System.Drawing.Size(72, 20); + this.labelComPort.Size = new System.Drawing.Size(80, 20); this.labelComPort.TabIndex = 0; this.labelComPort.Text = "Com port:"; this.labelComPort.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -646,7 +653,7 @@ // buttonParamQuestion // this.buttonParamQuestion.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonParamQuestion.Location = new System.Drawing.Point(352, 16); + this.buttonParamQuestion.Location = new System.Drawing.Point(400, 16); this.buttonParamQuestion.Name = "buttonParamQuestion"; this.buttonParamQuestion.Size = new System.Drawing.Size(24, 20); this.buttonParamQuestion.TabIndex = 2; @@ -660,7 +667,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.textBoxSerialCommand.Location = new System.Drawing.Point(96, 16); this.textBoxSerialCommand.Name = "textBoxSerialCommand"; - this.textBoxSerialCommand.Size = new System.Drawing.Size(248, 20); + this.textBoxSerialCommand.Size = new System.Drawing.Size(296, 20); this.textBoxSerialCommand.TabIndex = 1; // // labelSerialCommand @@ -674,65 +681,57 @@ // // tabPageMessage // - this.tabPageMessage.Controls.Add(this.checkBoxMsgCurrApp); - this.tabPageMessage.Controls.Add(this.labelMsgApp); - this.tabPageMessage.Controls.Add(this.buttonFindMsgApp); - this.tabPageMessage.Controls.Add(this.textBoxMsgApp); - this.tabPageMessage.Controls.Add(this.numericUpDownLParam); - this.tabPageMessage.Controls.Add(this.numericUpDownWParam); - this.tabPageMessage.Controls.Add(this.numericUpDownMsg); - this.tabPageMessage.Controls.Add(this.labelLParam); - this.tabPageMessage.Controls.Add(this.labelWParam); - this.tabPageMessage.Controls.Add(this.labelMessage); + this.tabPageMessage.Controls.Add(this.groupBoxMessageDetails); + this.tabPageMessage.Controls.Add(this.groupBoxMessageTarget); this.tabPageMessage.Location = new System.Drawing.Point(4, 22); this.tabPageMessage.Name = "tabPageMessage"; this.tabPageMessage.Padding = new System.Windows.Forms.Padding(3); - this.tabPageMessage.Size = new System.Drawing.Size(384, 174); + this.tabPageMessage.Size = new System.Drawing.Size(432, 206); this.tabPageMessage.TabIndex = 4; - this.tabPageMessage.Text = "Message"; + this.tabPageMessage.Text = "Window Message"; this.tabPageMessage.UseVisualStyleBackColor = true; // - // checkBoxMsgCurrApp + // groupBoxMessageDetails // - this.checkBoxMsgCurrApp.Location = new System.Drawing.Point(96, 40); - this.checkBoxMsgCurrApp.Name = "checkBoxMsgCurrApp"; - this.checkBoxMsgCurrApp.Size = new System.Drawing.Size(160, 16); - this.checkBoxMsgCurrApp.TabIndex = 3; - this.checkBoxMsgCurrApp.Text = "Send to active window"; - this.checkBoxMsgCurrApp.UseVisualStyleBackColor = true; + this.groupBoxMessageDetails.Controls.Add(this.labelMessage); + this.groupBoxMessageDetails.Controls.Add(this.numericUpDownMsg); + this.groupBoxMessageDetails.Controls.Add(this.numericUpDownLParam); + this.groupBoxMessageDetails.Controls.Add(this.numericUpDownWParam); + this.groupBoxMessageDetails.Controls.Add(this.labelLParam); + this.groupBoxMessageDetails.Controls.Add(this.labelWParam); + this.groupBoxMessageDetails.Location = new System.Drawing.Point(8, 104); + this.groupBoxMessageDetails.Name = "groupBoxMessageDetails"; + this.groupBoxMessageDetails.Size = new System.Drawing.Size(416, 88); + this.groupBoxMessageDetails.TabIndex = 1; + this.groupBoxMessageDetails.TabStop = false; + this.groupBoxMessageDetails.Text = "Details"; // - // labelMsgApp + // labelMessage // - this.labelMsgApp.Location = new System.Drawing.Point(8, 16); - this.labelMsgApp.Name = "labelMsgApp"; - this.labelMsgApp.Size = new System.Drawing.Size(88, 20); - this.labelMsgApp.TabIndex = 0; - this.labelMsgApp.Text = "Application:"; - this.labelMsgApp.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.labelMessage.Location = new System.Drawing.Point(8, 24); + this.labelMessage.Name = "labelMessage"; + this.labelMessage.Size = new System.Drawing.Size(72, 20); + this.labelMessage.TabIndex = 0; + this.labelMessage.Text = "Message:"; + this.labelMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // buttonFindMsgApp + // numericUpDownMsg // - this.buttonFindMsgApp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonFindMsgApp.Location = new System.Drawing.Point(352, 16); - this.buttonFindMsgApp.Name = "buttonFindMsgApp"; - this.buttonFindMsgApp.Size = new System.Drawing.Size(24, 20); - this.buttonFindMsgApp.TabIndex = 2; - this.buttonFindMsgApp.Text = "..."; - this.buttonFindMsgApp.UseVisualStyleBackColor = true; - this.buttonFindMsgApp.Click += new System.EventHandler(this.buttonFindMsgApp_Click); + this.numericUpDownMsg.Location = new System.Drawing.Point(80, 24); + this.numericUpDownMsg.Maximum = new decimal(new int[] { + -1, + 0, + 0, + 0}); + this.numericUpDownMsg.Name = "numericUpDownMsg"; + this.numericUpDownMsg.Size = new System.Drawing.Size(104, 20); + this.numericUpDownMsg.TabIndex = 1; + this.numericUpDownMsg.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numericUpDownMsg.ThousandsSeparator = true; // - // textBoxMsgApp - // - this.textBoxMsgApp.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxMsgApp.Location = new System.Drawing.Point(96, 16); - this.textBoxMsgApp.Name = "textBoxMsgApp"; - this.textBoxMsgApp.Size = new System.Drawing.Size(248, 20); - this.textBoxMsgApp.TabIndex = 1; - // // numericUpDownLParam // - this.numericUpDownLParam.Location = new System.Drawing.Point(96, 136); + this.numericUpDownLParam.Location = new System.Drawing.Point(304, 56); this.numericUpDownLParam.Maximum = new decimal(new int[] { -1, 0, @@ -740,13 +739,13 @@ 0}); this.numericUpDownLParam.Name = "numericUpDownLParam"; this.numericUpDownLParam.Size = new System.Drawing.Size(104, 20); - this.numericUpDownLParam.TabIndex = 9; + this.numericUpDownLParam.TabIndex = 5; this.numericUpDownLParam.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownLParam.ThousandsSeparator = true; // // numericUpDownWParam // - this.numericUpDownWParam.Location = new System.Drawing.Point(96, 104); + this.numericUpDownWParam.Location = new System.Drawing.Point(304, 24); this.numericUpDownWParam.Maximum = new decimal(new int[] { -1, 0, @@ -754,51 +753,110 @@ 0}); this.numericUpDownWParam.Name = "numericUpDownWParam"; this.numericUpDownWParam.Size = new System.Drawing.Size(104, 20); - this.numericUpDownWParam.TabIndex = 7; + this.numericUpDownWParam.TabIndex = 3; this.numericUpDownWParam.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownWParam.ThousandsSeparator = true; // - // numericUpDownMsg - // - this.numericUpDownMsg.Location = new System.Drawing.Point(96, 72); - this.numericUpDownMsg.Maximum = new decimal(new int[] { - -1, - 0, - 0, - 0}); - this.numericUpDownMsg.Name = "numericUpDownMsg"; - this.numericUpDownMsg.Size = new System.Drawing.Size(104, 20); - this.numericUpDownMsg.TabIndex = 5; - this.numericUpDownMsg.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.numericUpDownMsg.ThousandsSeparator = true; - // // labelLParam // - this.labelLParam.Location = new System.Drawing.Point(8, 136); + this.labelLParam.Location = new System.Drawing.Point(216, 56); this.labelLParam.Name = "labelLParam"; this.labelLParam.Size = new System.Drawing.Size(88, 20); - this.labelLParam.TabIndex = 8; + this.labelLParam.TabIndex = 4; this.labelLParam.Text = "Long Param:"; this.labelLParam.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelWParam // - this.labelWParam.Location = new System.Drawing.Point(8, 104); + this.labelWParam.Location = new System.Drawing.Point(216, 24); this.labelWParam.Name = "labelWParam"; this.labelWParam.Size = new System.Drawing.Size(88, 20); - this.labelWParam.TabIndex = 6; + this.labelWParam.TabIndex = 2; this.labelWParam.Text = "Word Param:"; this.labelWParam.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // labelMessage + // groupBoxMessageTarget // - this.labelMessage.Location = new System.Drawing.Point(8, 72); - this.labelMessage.Name = "labelMessage"; - this.labelMessage.Size = new System.Drawing.Size(88, 20); - this.labelMessage.TabIndex = 4; - this.labelMessage.Text = "Message:"; - this.labelMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.groupBoxMessageTarget.Controls.Add(this.radioButtonActiveWindow); + this.groupBoxMessageTarget.Controls.Add(this.textBoxMsgTarget); + this.groupBoxMessageTarget.Controls.Add(this.buttonFindMsgTarget); + this.groupBoxMessageTarget.Controls.Add(this.radioButtonWindowTitle); + this.groupBoxMessageTarget.Controls.Add(this.radioButtonApplication); + this.groupBoxMessageTarget.Controls.Add(this.radioButtonClass); + this.groupBoxMessageTarget.Location = new System.Drawing.Point(8, 16); + this.groupBoxMessageTarget.Name = "groupBoxMessageTarget"; + this.groupBoxMessageTarget.Size = new System.Drawing.Size(416, 80); + this.groupBoxMessageTarget.TabIndex = 0; + this.groupBoxMessageTarget.TabStop = false; + this.groupBoxMessageTarget.Text = "Target"; // + // radioButtonActiveWindow + // + this.radioButtonActiveWindow.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.radioButtonActiveWindow.Location = new System.Drawing.Point(16, 24); + this.radioButtonActiveWindow.Name = "radioButtonActiveWindow"; + this.radioButtonActiveWindow.Size = new System.Drawing.Size(104, 16); + this.radioButtonActiveWindow.TabIndex = 0; + this.radioButtonActiveWindow.Text = "Active window"; + this.radioButtonActiveWindow.UseVisualStyleBackColor = true; + this.radioButtonActiveWindow.CheckedChanged += new System.EventHandler(this.radioButtonActiveWindow_CheckedChanged); + // + // textBoxMsgTarget + // + this.textBoxMsgTarget.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxMsgTarget.Location = new System.Drawing.Point(8, 48); + this.textBoxMsgTarget.Name = "textBoxMsgTarget"; + this.textBoxMsgTarget.Size = new System.Drawing.Size(368, 20); + this.textBoxMsgTarget.TabIndex = 4; + // + // buttonFindMsgTarget + // + this.buttonFindMsgTarget.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonFindMsgTarget.Location = new System.Drawing.Point(384, 48); + this.buttonFindMsgTarget.Name = "buttonFindMsgTarget"; + this.buttonFindMsgTarget.Size = new System.Drawing.Size(24, 20); + this.buttonFindMsgTarget.TabIndex = 5; + this.buttonFindMsgTarget.Text = "..."; + this.buttonFindMsgTarget.UseVisualStyleBackColor = true; + this.buttonFindMsgTarget.Click += new System.EventHandler(this.buttonFindMsgTarget_Click); + // + // radioButtonWindowTitle + // + this.radioButtonWindowTitle.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.radioButtonWindowTitle.Location = new System.Drawing.Point(304, 24); + this.radioButtonWindowTitle.Name = "radioButtonWindowTitle"; + this.radioButtonWindowTitle.Size = new System.Drawing.Size(96, 16); + this.radioButtonWindowTitle.TabIndex = 3; + this.radioButtonWindowTitle.TabStop = true; + this.radioButtonWindowTitle.Text = "Window title"; + this.radioButtonWindowTitle.UseVisualStyleBackColor = true; + this.radioButtonWindowTitle.CheckedChanged += new System.EventHandler(this.radioButtonWindowTitle_CheckedChanged); + // + // radioButtonApplication + // + this.radioButtonApplication.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.radioButtonApplication.Location = new System.Drawing.Point(128, 24); + this.radioButtonApplication.Name = "radioButtonApplication"; + this.radioButtonApplication.Size = new System.Drawing.Size(88, 16); + this.radioButtonApplication.TabIndex = 1; + this.radioButtonApplication.TabStop = true; + this.radioButtonApplication.Text = "Application"; + this.radioButtonApplication.UseVisualStyleBackColor = true; + this.radioButtonApplication.CheckedChanged += new System.EventHandler(this.radioButtonApplication_CheckedChanged); + // + // radioButtonClass + // + this.radioButtonClass.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.radioButtonClass.Location = new System.Drawing.Point(224, 24); + this.radioButtonClass.Name = "radioButtonClass"; + this.radioButtonClass.Size = new System.Drawing.Size(72, 16); + this.radioButtonClass.TabIndex = 2; + this.radioButtonClass.TabStop = true; + this.radioButtonClass.Text = "Class"; + this.radioButtonClass.UseVisualStyleBackColor = true; + this.radioButtonClass.CheckedChanged += new System.EventHandler(this.radioButtonClass_CheckedChanged); + // // tabPageKeystrokes // this.tabPageKeystrokes.Controls.Add(this.buttonKeyHelp); @@ -807,7 +865,7 @@ this.tabPageKeystrokes.Location = new System.Drawing.Point(4, 22); this.tabPageKeystrokes.Name = "tabPageKeystrokes"; this.tabPageKeystrokes.Padding = new System.Windows.Forms.Padding(3); - this.tabPageKeystrokes.Size = new System.Drawing.Size(384, 174); + this.tabPageKeystrokes.Size = new System.Drawing.Size(432, 206); this.tabPageKeystrokes.TabIndex = 5; this.tabPageKeystrokes.Text = "Keystrokes"; this.tabPageKeystrokes.UseVisualStyleBackColor = true; @@ -815,7 +873,7 @@ // buttonKeyHelp // this.buttonKeyHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonKeyHelp.Location = new System.Drawing.Point(312, 144); + this.buttonKeyHelp.Location = new System.Drawing.Point(360, 176); this.buttonKeyHelp.Name = "buttonKeyHelp"; this.buttonKeyHelp.Size = new System.Drawing.Size(64, 24); this.buttonKeyHelp.TabIndex = 2; @@ -829,7 +887,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.labelKeystrokes.Location = new System.Drawing.Point(8, 8); this.labelKeystrokes.Name = "labelKeystrokes"; - this.labelKeystrokes.Size = new System.Drawing.Size(368, 16); + this.labelKeystrokes.Size = new System.Drawing.Size(416, 16); this.labelKeystrokes.TabIndex = 0; this.labelKeystrokes.Text = "Keystrokes:"; this.labelKeystrokes.TextAlign = System.Drawing.ContentAlignment.BottomLeft; @@ -843,13 +901,13 @@ this.textBoxKeys.Multiline = true; this.textBoxKeys.Name = "textBoxKeys"; this.textBoxKeys.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.textBoxKeys.Size = new System.Drawing.Size(368, 112); + this.textBoxKeys.Size = new System.Drawing.Size(416, 144); this.textBoxKeys.TabIndex = 1; // // buttonTest // this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonTest.Location = new System.Drawing.Point(352, 232); + this.buttonTest.Location = new System.Drawing.Point(400, 264); this.buttonTest.Name = "buttonTest"; this.buttonTest.Size = new System.Drawing.Size(48, 20); this.buttonTest.TabIndex = 3; @@ -861,7 +919,7 @@ // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(360, 368); + this.buttonCancel.Location = new System.Drawing.Point(408, 400); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(56, 24); this.buttonCancel.TabIndex = 3; @@ -872,7 +930,7 @@ // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(296, 368); + this.buttonOK.Location = new System.Drawing.Point(344, 400); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(56, 24); this.buttonOK.TabIndex = 2; @@ -886,14 +944,14 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(424, 401); + this.ClientSize = new System.Drawing.Size(472, 433); this.Controls.Add(this.groupBoxButton); this.Controls.Add(this.groupBoxSet); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(432, 428); + this.MinimumSize = new System.Drawing.Size(480, 428); this.Name = "ButtonMappingForm"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; @@ -914,10 +972,12 @@ ((System.ComponentModel.ISupportInitialize)(this.numericUpDownDataBits)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownBaudRate)).EndInit(); this.tabPageMessage.ResumeLayout(false); - this.tabPageMessage.PerformLayout(); + this.groupBoxMessageDetails.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMsg)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLParam)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownWParam)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMsg)).EndInit(); + this.groupBoxMessageTarget.ResumeLayout(false); + this.groupBoxMessageTarget.PerformLayout(); this.tabPageKeystrokes.ResumeLayout(false); this.tabPageKeystrokes.PerformLayout(); this.ResumeLayout(false); @@ -975,10 +1035,6 @@ private System.Windows.Forms.TextBox textBoxSerialCommand; private System.Windows.Forms.Label labelSerialCommand; private System.Windows.Forms.TabPage tabPageMessage; - private System.Windows.Forms.CheckBox checkBoxMsgCurrApp; - private System.Windows.Forms.Label labelMsgApp; - private System.Windows.Forms.Button buttonFindMsgApp; - private System.Windows.Forms.TextBox textBoxMsgApp; private System.Windows.Forms.NumericUpDown numericUpDownLParam; private System.Windows.Forms.NumericUpDown numericUpDownWParam; private System.Windows.Forms.NumericUpDown numericUpDownMsg; @@ -993,6 +1049,14 @@ private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.Button buttonOK; private System.Windows.Forms.CheckBox checkBoxNoWindow; + private System.Windows.Forms.RadioButton radioButtonWindowTitle; + private System.Windows.Forms.RadioButton radioButtonClass; + private System.Windows.Forms.RadioButton radioButtonApplication; + private System.Windows.Forms.RadioButton radioButtonActiveWindow; + private System.Windows.Forms.TextBox textBoxMsgTarget; + private System.Windows.Forms.Button buttonFindMsgTarget; + private System.Windows.Forms.GroupBox groupBoxMessageTarget; + private System.Windows.Forms.GroupBox groupBoxMessageDetails; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-06-16 00:09:51 UTC (rev 557) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-06-16 12:18:13 UTC (rev 558) @@ -175,15 +175,31 @@ break; } - case Common.CmdPrefixMessage: + case Common.CmdPrefixWindowMsg: { - string[] commands = Common.SplitMessageCommand(suffix); + string[] commands = Common.SplitWindowMessageCommand(suffix); tabControl.SelectTab(tabPageMessage); - textBoxMsgApp.Text = (checkBoxMsgCurrApp.Checked ? "*" : commands[0]); - numericUpDownMsg.Value = decimal.Parse(commands[1]); - numericUpDownWParam.Value = decimal.Parse(commands[2]); - numericUpDownLParam.Value = decimal.Parse(commands[3]); + switch (commands[0].ToLowerInvariant()) + { + case "active": + radioButtonActiveWindow.Checked = true; + break; + case "application": + radioButtonApplication.Checked = true; + break; + case "class": + radioButtonClass.Checked = true; + break; + case "window": + radioButtonWindowTitle.Checked = true; + break; + } + + textBoxMsgTarget.Text = commands[1]; + numericUpDownMsg.Value = decimal.Parse(commands[2]); + numericUpDownWParam.Value = decimal.Parse(commands[3]); + numericUpDownLParam.Value = decimal.Parse(commands[4]); break; } @@ -284,10 +300,30 @@ case "tabPageMessage": { + string target = "error"; + + if (radioButtonActiveWindow.Checked) + { + target = "active"; + textBoxMsgTarget.Text = "*"; + } + else if (radioButtonApplication.Checked) + { + target = "application"; + } + else if (radioButtonClass.Checked) + { + target = "class"; + } + else if (radioButtonWindowTitle.Checked) + { + target = "window"; + } + textBoxCommand.Text = _command = - String.Format("{0}{1}|{2}|{3}|{4}", - Common.CmdPrefixMessage, - checkBoxMsgCurrApp.Checked ? "*" : textBoxMsgApp.Text, + String.Format("{0}|{1}|{2}|{3}|{4}", + target, + textBoxMsgTarget.Text, numericUpDownMsg.Value.ToString(), numericUpDownWParam.Value.ToString(), numericUpDownLParam.Value.ToString()); @@ -319,17 +355,49 @@ } } - private void buttonFindMsgApp_Click(object sender, EventArgs e) + private void buttonFindMsgTarget_Click(object sender, EventArgs e) { - OpenFileDialog find = new OpenFileDialog(); - find.Filter = "All files|*.*"; - find.Multiselect = false; - find.Title = "Application to send message to"; + if (radioButtonApplication.Checked) + { + OpenFileDialog find = new OpenFileDialog(); + find.Filter = "All files|*.*"; + find.Multiselect = false; + find.Title = "Application to send message to"; - if (find.ShowDialog(this) == DialogResult.OK) - textBoxMsgApp.Text = find.FileName; + if (find.ShowDialog(this) == DialogResult.OK) + textBoxMsgTarget.Text = find.FileName; + } + else if (radioButtonClass.Checked) + { + // TODO: Locate Class + } + else if (radioButtonWindowTitle.Checked) + { + // TODO: Locate Window + } } + private void radioButtonActiveWindow_CheckedChanged(object sender, EventArgs e) + { + buttonFindMsgTarget.Enabled = false; + textBoxMsgTarget.Enabled = false; + } + private void radioButtonApplication_CheckedChanged(object sender, EventArgs e) + { + buttonFindMsgTarget.Enabled = true; + textBoxMsgTarget.Enabled = true; + } + private void radioButtonClass_CheckedChanged(object sender, EventArgs e) + { + buttonFindMsgTarget.Enabled = false; + textBoxMsgTarget.Enabled = true; + } + private void radioButtonWindowTitle_CheckedChanged(object sender, EventArgs e) + { + buttonFindMsgTarget.Enabled = false; + textBoxMsgTarget.Enabled = true; + } + private void buttonLocate_Click(object sender, EventArgs e) { OpenFileDialog find = new OpenFileDialog(); @@ -372,21 +440,16 @@ private void buttonKeyHelp_Click(object sender, EventArgs e) { - MessageBox.Show(this, -@"Place special keys inside {}, for example: {F4} for the F4 key. -Use + to apply the SHIFT key to the following character, -Use ^ to apply the CONTROL key to the following character, -Use % to apply the ALT key to the following character. - -For more information refer to 'Simulating Keystrokes.txt' -", "Advanced keystroke input", MessageBoxButtons.OK, MessageBoxIcon.Information); + try + { + Help.ShowHelp(this, SystemRegistry.GetInstallFolder() + "\\IR Server Suite.chm", HelpNavigator.Topic, "Common\\keystrokes_info.html"); + } + catch (Exception ex) + { + MessageBox.Show(this, ex.Message, "Failed to load help", MessageBoxButtons.OK, MessageBoxIcon.Error); + } } - private void checkBoxMsgCurrApp_CheckedChanged(object sender, EventArgs e) - { - textBoxMsgApp.Enabled = !checkBoxMsgCurrApp.Checked; - } - private void textBoxButtonDesc_TextChanged(object sender, EventArgs e) { _description = textBoxButtonDesc.Text; Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs 2007-06-16 00:09:51 UTC (rev 557) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs 2007-06-16 12:18:13 UTC (rev 558) @@ -43,7 +43,8 @@ comboBoxCommands.Items.Add(Common.UITextRun); comboBoxCommands.Items.Add(Common.UITextPause); comboBoxCommands.Items.Add(Common.UITextSerial); - comboBoxCommands.Items.Add(Common.UITextMessage); + comboBoxCommands.Items.Add(Common.UITextWindowMsg); + comboBoxCommands.Items.Add(Common.UITextTcpMsg); comboBoxCommands.Items.Add(Common.UITextKeys); //TODO: Add Shutdown and Reboot comboBoxCommands.Items.Add(Common.UITextStandby); @@ -89,11 +90,16 @@ writer.WriteAttributeString("command", Common.XmlTagSerial); writer.WriteAttributeString("cmdproperty", item.Substring(Common.CmdPrefixSerial.Length)); } - else if (item.StartsWith(Common.CmdPrefixMessage)) + else if (item.StartsWith(Common.CmdPrefixWindowMsg)) { - writer.WriteAttributeString("command", Common.XmlTagMessage); - writer.WriteAttributeString("cmdproperty", item.Substring(Common.CmdPrefixMessage.Length)); + writer.WriteAttributeString("command", Common.XmlTagWindowMsg); + writer.WriteAttributeString("cmdproperty", item.Substring(Common.CmdPrefixWindowMsg.Length)); } + else if (item.StartsWith(Common.CmdPrefixTcpMsg)) + { + writer.WriteAttributeString("command", Common.XmlTagTcpMsg); + writer.WriteAttributeString("cmdproperty", item.Substring(Common.CmdPrefixTcpMsg.Length)); + } else if (item.StartsWith(Common.CmdPrefixKeys)) { writer.WriteAttributeString("command", Common.XmlTagKeys); @@ -154,10 +160,14 @@ listBoxMacro.Items.Add(Common.CmdPrefixSerial + commandProperty); break; - case Common.XmlTagMessage: - listBoxMacro.Items.Add(Common.CmdPrefixMessage + commandProperty); + case Common.XmlTagWindowMsg: + listBoxMacro.Items.Add(Common.CmdPrefixWindowMsg + commandProperty); break; + case Common.XmlTagTcpMsg: + listBoxMacro.Items.Add(Common.CmdPrefixTcpMsg + commandProperty); + break; + case Common.XmlTagKeys: listBoxMacro.Items.Add(Common.CmdPrefixKeys + commandProperty); break; @@ -216,14 +226,22 @@ listBoxMacro.Items.Add(Common.CmdPrefixSerial + serialCommand.CommandString); } - else if (selected == Common.UITextMessage) + else if (selected == Common.UITextWindowMsg) { MessageCommand messageCommand = new MessageCommand(); if (messageCommand.ShowDialog(this) == DialogResult.Cancel) return; - listBoxMacro.Items.Add(Common.CmdPrefixMessage + messageCommand.CommandString); + listBoxMacro.Items.Add(Common.CmdPrefixWindowMsg + messageCommand.CommandString); } + else if (selected == Common.UITextTcpMsg) + { + TcpMessageCommand tcpMessageCommand = new TcpMessageCommand(); + if (tcpMessageCommand.ShowDialog(this) == DialogResult.Cancel) + return; + + listBoxMacro.Items.Add(Common.CmdPrefixTcpMsg + tcpMessageCommand.CommandString); + } else if (selected == Common.UITextKeys) { KeysCommand keysCommand = new KeysCommand(); @@ -369,18 +387,30 @@ listBoxMacro.Items.Insert(index, Common.CmdPrefixSerial + serialCommand.CommandString); listBoxMacro.SelectedIndex = index; } - else if (selected.StartsWith(Common.CmdPrefixMessage)) + else if (selected.StartsWith(Common.CmdPrefixWindowMsg)) { - string[] commands = Common.SplitMessageCommand(selected.Substring(Common.CmdPrefixMessage.Length)); + string[] commands = Common.SplitWindowMessageCommand(selected.Substring(Common.CmdPrefixWindowMsg.Length)); MessageCommand messageCommand = new MessageCommand(commands); if (messageCommand.ShowDialog(this) == DialogResult.Cancel) return; int index = listBoxMacro.SelectedIndex; listBoxMacro.Items.RemoveAt(index); - listBoxMacro.Items.Insert(index, Common.CmdPrefixMessage + messageCommand.CommandString); + listBoxMacro.Items.Insert(index, Common.CmdPrefixWindowMsg + messageCommand.CommandString); listBoxMacro.SelectedIndex = index; } + else if (selected.StartsWith(Common.CmdPrefixTcpMsg)) + { + string[] commands = Common.SplitTcpMessageCommand(selected.Substring(Common.CmdPrefixTcpMsg.Length)); + TcpMessageCommand tcpMessageCommand = new TcpMessageCommand(commands); + if (tcpMessageCommand.ShowDialog(this) == DialogResult.Cancel) + return; + + int index = listBoxMacro.SelectedIndex; + listBoxMacro.Items.RemoveAt(index); + listBoxMacro.Items.Insert(index, Common.CmdPrefixTcpMsg + tcpMessageCommand.CommandString); + listBoxMacro.SelectedIndex = index; + } else if (selected.StartsWith(Common.CmdPrefixKeys)) { KeysCommand keysCommand = new KeysCommand(selected.Substring(Common.CmdPrefixKeys.Length)); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-06-16 00:09:51 UTC (rev 557) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-06-16 12:18:13 UTC (rev 558) @@ -163,7 +163,7 @@ comboBoxCommands.Items.Add(Common.UITextRun); comboBoxCommands.Items.Add(Common.UITextSerial); - comboBoxCommands.Items.Add(Common.UITextMessage); + comboBoxCommands.Items.Add(Common.UITextWindowMsg); comboBoxCommands.Items.Add(Common.UITextKeys); string[] list = Common.GetIRList(true); @@ -433,7 +433,7 @@ } catch { - // keyCode did not fall within KnownRemoteButtons enum + // keyCode did not fall within MceButton enum } map = new ButtonMappingForm(keyCode, description, String.Empty); @@ -687,13 +687,13 @@ command = Common.CmdPrefixSerial + serialCommand.CommandString; } - else if (selected == Common.UITextMessage) + else if (selected == Common.UITextWindowMsg) { MessageCommand messageCommand = new MessageCommand(); if (messageCommand.ShowDialog(this) == DialogResult.Cancel) return; - command = Common.CmdPrefixMessage + messageCommand.CommandString; + command = Common.CmdPrefixWindowMsg + messageCommand.CommandString; } else if (selected == Common.UITextKeys) { @@ -757,14 +757,14 @@ command = Common.CmdPrefixSerial + serialCommand.CommandString; } - else if (command.StartsWith(Common.CmdPrefixMessage)) + else if (command.StartsWith(Common.CmdPrefixWindowMsg)) { - string[] commands = Common.SplitMessageCommand(command.Substring(Common.CmdPrefixMessage.Length)); + string[] commands = Common.SplitWindowMessageCommand(command.Substring(Common.CmdPrefixWindowMsg.Length)); MessageCommand messageCommand = new MessageCommand(commands); if (messageCommand.ShowDialog(this) == DialogResult.Cancel) return; - command = Common.CmdPrefixMessage + messageCommand.CommandString; + command = Common.CmdPrefixWindowMsg + messageCommand.CommandString; } else if (command.StartsWith(Common.CmdPrefixKeys)) { Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-06-16 00:09:51 UTC (rev 557) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-06-16 12:18:13 UTC (rev 558) @@ -843,13 +843,20 @@ break; } - case Common.XmlTagMessage: + case Common.XmlTagWindowMsg: { - string[] commands = Common.SplitMessageCommand(commandProperty); - Common.ProcessMessageCommand(commands); + string[] commands = Common.SplitWindowMessageCommand(commandProperty); + Common.ProcessWindowMessageCommand(commands); break; } + case Common.XmlTagTcpMsg: + { + string[] commands = Common.SplitTcpMessageCommand(commandProperty); + Common.ProcessTcpMessageCommand(commands); + break; + } + case Common.XmlTagKeys: { Common.ProcessKeyCommand(commandProperty); @@ -973,10 +980,10 @@ string[] commands = Common.SplitSerialCommand(command.Substring(Common.CmdPrefixSerial.Length)); Common.ProcessSerialCommand(commands); } - else if (command.StartsWith(Common.CmdPrefixMessage)) // Message Command + else if (command.StartsWith(Common.CmdPrefixWindowMsg)) // Message Command { - string[] commands = Common.SplitMessageCommand(command.Substring(Common.CmdPrefixMessage.Length)); - Common.ProcessMessageCommand(commands); + string[] commands = Common.SplitWindowMessageCommand(command.Substring(Common.CmdPrefixWindowMsg.Length)); + Common.ProcessWindowMessageCommand(commands); } else if (command.StartsWith(Common.CmdPrefixKeys)) // Keystroke Command { Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs =================================================================== --- trunk/plugins/IR Server ... [truncated message content] |
From: <che...@us...> - 2007-06-16 00:09:54
|
Revision: 557 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=557&view=rev Author: chef_koch Date: 2007-06-15 17:09:51 -0700 (Fri, 15 Jun 2007) Log Message: ----------- no code content changes, only ordered the code and added regions Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs 2007-06-15 23:36:24 UTC (rev 556) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs 2007-06-16 00:09:51 UTC (rev 557) @@ -40,29 +40,42 @@ namespace GUIPrograms.ApplicationItems { - /// <summary> - /// Summary description for Application. - /// </summary> public class ApplicationItem { + #region Variables + protected static SQLiteClient sqlDB = null; - private DatabaseSorter dbPc = new DatabaseSorter(); - public delegate void FilelinkLaunchEventHandler(FilelinkItem curLink, bool mpGuiMode); - - public event FilelinkLaunchEventHandler OnLaunchFilelink = null; - int appID; int fatherID; string title; string shortTitle; string filename; + string arguments; ProcessWindowStyle windowStyle; - Process proc; string startupDir; - bool useShellExecute; bool useQuotes; + bool useShellExecute; + bool waitForExit; + string preLaunch; + string postLaunch; + + bool enabled; + bool enableGUIRefresh; + int appPosition; + + public bool filesAreLoaded = false; // load on demand.... + protected FileItemList fileList = null; + public bool linksAreLoaded = false; // load on demand.... + protected FilelinkItemList fileLinks = null; + + bool importMamePlaychoice10 = false; + bool importMameMahjong = false; + + + // more variables, maybe need some renaming or anything else + Process proc; ApplicationType sourceType; string sourceFile; string imageFile; @@ -71,24 +84,142 @@ string fileDirectory; string validExtensions; bool importValidImagesOnly; - int appPosition; - bool enabled; - bool enableGUIRefresh; + int pincode; int contentID; string systemDefault; - bool waitForExit; - string preLaunch; - string postLaunch; - bool importMamePlaychoice10 = false; + string launchErrorMsg; + // two magic image-slideshow counters + int thumbIndex = 0; + int thumbFolderIndex = -1; + + string lastFilepath = ""; // cached path + + private DatabaseSorter dbPc = new DatabaseSorter(); + + #endregion + + #region Properties + // Helper Routines + + public int AppID + { + get { return appID; } + set { appID = value; } + } + public int FatherID + { + get { return fatherID; } + set { fatherID = value; } + } + public string Title + { + get { return title; } + set { title = value; } + } + public string ShortTitle + { + get { return shortTitle; } + set { shortTitle = value; } + } + public string Filename + { + get { return filename; } + set { filename = value; } + } + + public string Arguments + { + get { return arguments; } + set { arguments = value; } + } + public ProcessWindowStyle WindowStyle + { + get { return windowStyle; } + set { windowStyle = value; } + } + public string Startupdir + { + get { return startupDir; } + set { startupDir = value; } + } + public bool UseQuotes + { + get { return useQuotes; } + set { useQuotes = value; } + } + public bool UseShellExecute + { + get { return useShellExecute; } + set { useShellExecute = value; } + } + public bool WaitForExit + { + get { return waitForExit; } + set { waitForExit = value; } + } + public string PreLaunch + { + get { return preLaunch; } + set { preLaunch = value; } + } + public string PostLaunch + { + get { return postLaunch; } + set { postLaunch = value; } + } + + public bool Enabled + { + get { return enabled; } + set { enabled = value; } + } + public bool EnableGUIRefresh + { + get { return enableGUIRefresh; } + set { enableGUIRefresh = value; } + } + public bool GUIRefreshPossible + { + get { return RefreshButtonVisible(); } + } + public int Position + { + get { return appPosition; } + set { appPosition = value; } + } + + public FileItemList Files + { + // load on demand.... + get + { + if (!filesAreLoaded) + { + LoadFiles(); + } + return fileList; + } + } + public FilelinkItemList Filelinks + { + // load on demand.... + get + { + if (!linksAreLoaded) + { + LoadFileLinks(); + } + return fileLinks; + } + } + public bool ImportMamePlaychoice10 { get { return importMamePlaychoice10; } set { importMamePlaychoice10 = value; } } - bool importMameMahjong = false; - public bool ImportMameMahjong { get { return importMameMahjong; } @@ -96,35 +227,102 @@ } - string launchErrorMsg; + // more Properties, maybe need some renaming or anything else + public string FileDirectory + { + get { return fileDirectory; } + set { fileDirectory = value; } + } + public string ImageDirectory + { + get { return imageDirectories; } + set { SetImageDirectory(value); } + } + private void SetImageDirectory(string value) + { + imageDirectories = value; + imageDirs = imageDirectories.Split(';'); + for (int i = 0; i < imageDirs.Length; i++) + { + imageDirs[i] = imageDirs[i].Trim(); + // hack the \n away.... + // imageDirs[i] = imageDirs[i].TrimStart('\n'); + // hack trailing backslashes away + imageDirs[i] = imageDirs[i].TrimEnd('\\'); + } + } + public string Imagefile + { + get { return imageFile; } + set { imageFile = value; } + } + public string Source + { + get { return sourceFile; } + set { sourceFile = value; } + } + public ApplicationType SourceType + { + get { return sourceType; } + set { sourceType = value; } + } + public string ValidExtensions + { + get { return validExtensions; } + set { validExtensions = value; } + } + public bool ImportValidImagesOnly + { + get { return importValidImagesOnly; } + set { importValidImagesOnly = value; } + } + public int ContentID + { + get { return contentID; } + set { contentID = value; } + } + public string SystemDefault + { + get { return systemDefault; } + set { systemDefault = value; } + } + public string LaunchErrorMsg + { + get { return launchErrorMsg; } + set { launchErrorMsg = value; } + } - // two magic image-slideshow counters - int thumbIndex = 0; - int thumbFolderIndex = -1; - string lastFilepath = ""; // cached path + public SQLiteClient db + { + get { return sqlDB; } + } + public int CurrentSortIndex + { + get { return GetCurrentSortIndex(); } + set { SetCurrentSortIndex(value); } + } + public bool CurrentSortIsAscending + { + get { return GetCurrentSortIsAscending(); } + set { SetCurrentSortIsAscending(value); } + } - public bool filesAreLoaded = false; // load on demand.... - protected FileItemList fileList = null; + #endregion - public bool linksAreLoaded = false; - protected FilelinkItemList fileLinks = null; + #region Events + public delegate void FilelinkLaunchEventHandler(FilelinkItem curLink, bool mpGuiMode); + public event FilelinkLaunchEventHandler OnLaunchFilelink = null; + // event: read new file public delegate void RefreshInfoEventHandler(string informationMessage, int progressBarProgess); - public event RefreshInfoEventHandler OnRefreshInfo = null; - protected void SendRefreshInfo(string informationMessage, int progressBarCtr) - { - if (OnRefreshInfo != null) - { - OnRefreshInfo(informationMessage, progressBarCtr); - } - } + #endregion - protected int GetID = ProgramUtils.GetID; + #region Constructor public ApplicationItem(SQLiteClient initSqlDB) { @@ -162,24 +360,22 @@ } - public SQLiteClient db - { - get { return sqlDB; } - } + #endregion - public int CurrentSortIndex - { - get { return GetCurrentSortIndex(); } - set { SetCurrentSortIndex(value); } - } - public bool CurrentSortIsAscending + + + protected void SendRefreshInfo(string informationMessage, int progressBarCtr) { - get { return GetCurrentSortIsAscending(); } - set { SetCurrentSortIsAscending(value); } + if (OnRefreshInfo != null) + { + OnRefreshInfo(informationMessage, progressBarCtr); + } } + protected int GetID = ProgramUtils.GetID; + public FileItem PrevFile(FileItem curFile) { if (Files == null) @@ -214,7 +410,23 @@ return (FileItem)Files[index]; } + public virtual void LaunchFile(GUIListItem item) + { + // Launch File by GUILISTITEM + // => look for FileItem and launch it using the found object + if (item.MusicTag == null) + { + return; + } + FileItem curFile = (FileItem)item.MusicTag; + if (curFile == null) + { + return; + } + this.LaunchFile(curFile, true); + } + public virtual void LaunchFile(FileItem curFile, bool mpGuiMode) { string curFilename = curFile.Filename; @@ -345,6 +557,16 @@ } } + protected virtual void LaunchFilelink(FilelinkItem curLink, bool MPGUIMode) + { + this.OnLaunchFilelink(curLink, MPGUIMode); + } + + + + + + void proc_Exited(object sender, EventArgs e) { @@ -419,28 +641,6 @@ } } - public virtual void LaunchFile(GUIListItem item) - { - // Launch File by GUILISTITEM - // => look for FileItem and launch it using the found object - if (item.MusicTag == null) - { - return; - } - FileItem curFile = (FileItem)item.MusicTag; - - if (curFile == null) - { - return; - } - this.LaunchFile(curFile, true); - } - - protected virtual void LaunchFilelink(FilelinkItem curLink, bool MPGUIMode) - { - this.OnLaunchFilelink(curLink, MPGUIMode); - } - public virtual string DefaultFilepath() { return ""; // override this if the appitem can have subfolders @@ -496,7 +696,6 @@ return totalItems; } - void OnRetrieveCoverArt(GUIListItem gli) { if ((gli.MusicTag != null) && (gli.MusicTag is FileItem)) @@ -544,6 +743,31 @@ } } + public virtual void OnInfo(GUIListItem item, ref bool isOverviewVisible, ref ProgramInfoAction modalResult, ref int selectedFileID) + { + GUIFileInfo fileInfoDialog = (GUIFileInfo)GUIWindowManager.GetWindow(ProgramUtils.ProgramInfoID); + if (null != fileInfoDialog) + { + if (item.MusicTag == null) + { + return; + } + FileItem curFile = (FileItem)item.MusicTag; + fileInfoDialog.App = this; + fileInfoDialog.File = curFile; + fileInfoDialog.IsOverviewVisible = isOverviewVisible; + fileInfoDialog.DoModal(GetID); + isOverviewVisible = fileInfoDialog.IsOverviewVisible; + modalResult = fileInfoDialog.ModalResult; + selectedFileID = fileInfoDialog.SelectedFileID; + return; + } + } + + + + #region old sorting stuff, some(all) might be obsolete, but maybe usefull for improving new sorting method + public virtual void OnSort(GUIFacadeControl view, bool doSwitchState) { /* @@ -591,6 +815,10 @@ dbPc.sortAscending = newValue; } + #endregion + + + public virtual bool RefreshButtonVisible() { return false; // otherwise, override this in child class @@ -634,232 +862,8 @@ } - public virtual void OnInfo(GUIListItem item, ref bool isOverviewVisible, ref ProgramInfoAction modalResult, ref int selectedFileID) - { - GUIFileInfo fileInfoDialog = (GUIFileInfo)GUIWindowManager.GetWindow(ProgramUtils.ProgramInfoID); - if (null != fileInfoDialog) - { - if (item.MusicTag == null) - { - return; - } - FileItem curFile = (FileItem)item.MusicTag; - fileInfoDialog.App = this; - fileInfoDialog.File = curFile; - fileInfoDialog.IsOverviewVisible = isOverviewVisible; - fileInfoDialog.DoModal(GetID); - isOverviewVisible = fileInfoDialog.IsOverviewVisible; - modalResult = fileInfoDialog.ModalResult; - selectedFileID = fileInfoDialog.SelectedFileID; - return; - } - } + #region DB stuff - public int AppID - { - get { return appID; } - set { appID = value; } - } - - public int FatherID - { - get { return fatherID; } - set { fatherID = value; } - } - - public string Title - { - get { return title; } - set { title = value; } - } - - public string ShortTitle - { - get { return shortTitle; } - set { shortTitle = value; } - } - - public string Filename - { - get { return filename; } - set { filename = value; } - } - - public string Arguments - { - get { return arguments; } - set { arguments = value; } - } - - public bool UseQuotes - { - get { return useQuotes; } - set { useQuotes = value; } - } - - public bool UseShellExecute - { - get { return useShellExecute; } - set { useShellExecute = value; } - } - - public bool Enabled - { - get { return enabled; } - set { enabled = value; } - } - - public ProcessWindowStyle WindowStyle - { - get { return windowStyle; } - set { windowStyle = value; } - } - - public string Startupdir - { - get { return startupDir; } - set { startupDir = value; } - } - - public string FileDirectory - { - get { return fileDirectory; } - set { fileDirectory = value; } - } - - public string ImageDirectory - { - get { return imageDirectories; } - set { SetImageDirectory(value); } - } - - private void SetImageDirectory(string value) - { - imageDirectories = value; - imageDirs = imageDirectories.Split(';'); - for (int i = 0; i < imageDirs.Length; i++) - { - imageDirs[i] = imageDirs[i].Trim(); - // hack the \n away.... - // imageDirs[i] = imageDirs[i].TrimStart('\n'); - // hack trailing backslashes away - imageDirs[i] = imageDirs[i].TrimEnd('\\'); - } - } - - public string Imagefile - { - get { return imageFile; } - set { imageFile = value; } - } - - public string Source - { - get { return sourceFile; } - set { sourceFile = value; } - } - - public ApplicationType SourceType - { - get { return sourceType; } - set { sourceType = value; } - } - - public string ValidExtensions - { - get { return validExtensions; } - set { validExtensions = value; } - } - - public bool ImportValidImagesOnly - { - get { return importValidImagesOnly; } - set { importValidImagesOnly = value; } - } - - public int Position - { - get { return appPosition; } - set { appPosition = value; } - } - - public int ContentID - { - get { return contentID; } - set { contentID = value; } - } - - public string SystemDefault - { - get { return systemDefault; } - set { systemDefault = value; } - } - - public bool WaitForExit - { - get { return waitForExit; } - set { waitForExit = value; } - } - - - public bool GUIRefreshPossible - { - get { return RefreshButtonVisible(); } - } - - public bool EnableGUIRefresh - { - get { return enableGUIRefresh; } - set { enableGUIRefresh = value; } - } - - public string LaunchErrorMsg - { - get { return launchErrorMsg; } - set { launchErrorMsg = value; } - } - - public string PreLaunch - { - get { return preLaunch; } - set { preLaunch = value; } - } - - public string PostLaunch - { - get { return postLaunch; } - set { postLaunch = value; } - } - - - public FileItemList Files - { - // load on demand.... - get - { - if (!filesAreLoaded) - { - LoadFiles(); - } - return fileList; - } - } - - - public FilelinkItemList Filelinks - { - // load on demand.... - get - { - if (!linksAreLoaded) - { - LoadFileLinks(); - } - return fileLinks; - } - } - - private int GetNewAppID() { // get an unused SQL application KEY-number @@ -961,8 +965,6 @@ } - - protected void DeleteFiles() { if ((AppID >= 0) && (sqlDB != null)) @@ -993,7 +995,6 @@ } } - public virtual void LoadFiles() { if (sqlDB != null) @@ -1031,6 +1032,20 @@ } } + public void InsertOrUpdateSettings() + { + if (appID == -1) + { + Insert(); + } + else + { + Update(); + } + } + + #endregion + protected virtual void FixFileLinks() { // after a import the appitem has completely new @@ -1074,25 +1089,11 @@ } - - public void InsertOrUpdateSettings() - { - if (appID == -1) - { - Insert(); - } - else - { - Update(); - } - } - public virtual string CurrentFilePath() { return this.FileDirectory; } - public void Assign(ApplicationItem sourceApp) { this.Enabled = sourceApp.Enabled; @@ -1122,9 +1123,8 @@ this.ContentID = sourceApp.ContentID; } + #region imagedirectory stuff - - // imagedirectory stuff // get next imagedirectory that holds at least one image for a fileitem // * m_pFile: the file we're looking images for private void GetNextThumbFolderIndex(FileItem fileItem) @@ -1178,7 +1178,6 @@ } } - public string GetCurThumb(FileItem fileItem) { string curThumb = ""; @@ -1226,6 +1225,7 @@ thumbIndex++; } + #endregion public void LoadFromXmlProfile(XmlNode node) { @@ -1278,6 +1278,5 @@ this.ValidExtensions = fileExtensioneNode.InnerText; } } - } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-15 23:36:26
|
Revision: 556 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=556&view=rev Author: chef_koch Date: 2007-06-15 16:36:24 -0700 (Fri, 15 Jun 2007) Log Message: ----------- removed obsolete space in filename Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj Added Paths: ----------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs Removed Paths: ------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem .cs Deleted: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem .cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem .cs 2007-06-15 22:21:16 UTC (rev 555) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem .cs 2007-06-15 23:36:24 UTC (rev 556) @@ -1,1283 +0,0 @@ -#region Copyright (C) 2005-2007 Team MediaPortal - -/* - * Copyright (C) 2005-2007 Team MediaPortal - * http://www.team-mediaportal.com - * - * This Program 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, or (at your option) - * any later version. - * - * This Program 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 GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#endregion - -using System; -using System.IO; -using System.Collections.Generic; -using System.Diagnostics; -using System.Xml; -using SQLite.NET; -using MediaPortal.Ripper; -using MediaPortal.Player; -using MediaPortal.GUI.Library; -using MediaPortal.Util; - -using GUIPrograms; -using GUIPrograms.Database; -using GUIPrograms.FileItems; - -namespace GUIPrograms.ApplicationItems -{ - /// <summary> - /// Summary description for Application. - /// </summary> - public class ApplicationItem - { - protected static SQLiteClient sqlDB = null; - private DatabaseSorter dbPc = new DatabaseSorter(); - - public delegate void FilelinkLaunchEventHandler(FilelinkItem curLink, bool mpGuiMode); - - public event FilelinkLaunchEventHandler OnLaunchFilelink = null; - - int appID; - int fatherID; - string title; - string shortTitle; - string filename; - string arguments; - ProcessWindowStyle windowStyle; - Process proc; - string startupDir; - bool useShellExecute; - bool useQuotes; - ApplicationType sourceType; - string sourceFile; - string imageFile; - string imageDirectories; // in one string for sqlite db field - public string[] imageDirs; // imageDirectories splitted - string fileDirectory; - string validExtensions; - bool importValidImagesOnly; - int appPosition; - bool enabled; - bool enableGUIRefresh; - int pincode; - int contentID; - string systemDefault; - bool waitForExit; - string preLaunch; - string postLaunch; - bool importMamePlaychoice10 = false; - - public bool ImportMamePlaychoice10 - { - get { return importMamePlaychoice10; } - set { importMamePlaychoice10 = value; } - } - bool importMameMahjong = false; - - public bool ImportMameMahjong - { - get { return importMameMahjong; } - set { importMameMahjong = value; } - } - - - string launchErrorMsg; - - - // two magic image-slideshow counters - int thumbIndex = 0; - int thumbFolderIndex = -1; - - string lastFilepath = ""; // cached path - - public bool filesAreLoaded = false; // load on demand.... - protected FileItemList fileList = null; - - public bool linksAreLoaded = false; - protected FilelinkItemList fileLinks = null; - - // event: read new file - public delegate void RefreshInfoEventHandler(string informationMessage, int progressBarProgess); - - public event RefreshInfoEventHandler OnRefreshInfo = null; - - protected void SendRefreshInfo(string informationMessage, int progressBarCtr) - { - if (OnRefreshInfo != null) - { - OnRefreshInfo(informationMessage, progressBarCtr); - } - } - - protected int GetID = ProgramUtils.GetID; - - public ApplicationItem(SQLiteClient initSqlDB) - { - - // constructor: save SQLiteDB object - sqlDB = initSqlDB; - // .. init member variables ... - appID = -1; - fatherID = -1; - title = ""; - shortTitle = ""; - filename = ""; - arguments = ""; - windowStyle = ProcessWindowStyle.Normal; - startupDir = "%FILEDIR%"; - useShellExecute = false; - useQuotes = true; - enabled = true; - sourceType = ApplicationType.UNKNOWN; - sourceFile = ""; - imageFile = ""; - fileDirectory = ""; - imageDirectories = ""; - validExtensions = ""; - appPosition = 0; - importValidImagesOnly = false; - enableGUIRefresh = false; - pincode = -1; - contentID = 100; - systemDefault = ""; - waitForExit = true; - filesAreLoaded = false; - preLaunch = ""; - postLaunch = ""; - - } - - public SQLiteClient db - { - get { return sqlDB; } - } - - public int CurrentSortIndex - { - get { return GetCurrentSortIndex(); } - set { SetCurrentSortIndex(value); } - } - - public bool CurrentSortIsAscending - { - get { return GetCurrentSortIsAscending(); } - set { SetCurrentSortIsAscending(value); } - } - - - public FileItem PrevFile(FileItem curFile) - { - if (Files == null) - { - return null; - } - if (Files.Count == 0) - { - return null; - } - int index = this.Files.IndexOf(curFile); - index = index - 1; - if (index < 0) - index = Files.Count - 1; - return (FileItem)Files[index]; - } - - public FileItem NextFile(FileItem curFile) - { - if (Files == null) - { - return null; - } - if (Files.Count == 0) - { - return null; - } - int index = this.Files.IndexOf(curFile); - index = index + 1; - if (index > Files.Count - 1) - index = 0; - return (FileItem)Files[index]; - } - - - public virtual void LaunchFile(FileItem curFile, bool mpGuiMode) - { - string curFilename = curFile.Filename; - if (curFilename == "") - { - return; - } - - // Launch File by item - if (mpGuiMode) - { - curFile.UpdateLaunchInfo(); - } - ProcessStartInfo procStart = new ProcessStartInfo(); - - if (Filename != "") - { - // use the APPLICATION launcher and add current file information - procStart.FileName = Filename; // filename of the application - // set the arguments: one of the arguments is the fileitem-filename - procStart.Arguments = " " + this.Arguments + " "; - if (UseQuotes) - { - // avoid double quotes around the filename-argument..... - curFilename = "\"" + (curFile.Filename.TrimStart('\"')).TrimEnd('\"') + "\""; - } - - if (procStart.Arguments.IndexOf("%FILEnoPATHnoEXT%") >= 0) - { - // ex. kawaks: - // winkawaks.exe alpham2 - // => filename without path and extension is necessary! - string filenameNoPathNoExt = curFile.ExtractFileName(); - filenameNoPathNoExt = (filenameNoPathNoExt.TrimStart('\"')).TrimEnd('\"'); - filenameNoPathNoExt = Path.GetFileNameWithoutExtension(filenameNoPathNoExt); - procStart.Arguments = procStart.Arguments.Replace("%FILEnoPATHnoEXT%", filenameNoPathNoExt); - } - else - { - // the fileitem-argument can be positioned anywhere in the argument string... - if (procStart.Arguments.IndexOf("%FILE%") == -1) - { - // no placeholder found => default handling: add the fileitem as the last argument - procStart.Arguments = procStart.Arguments + curFilename; - } - else - { - // placeholder found => replace the placeholder by the correct filename - procStart.Arguments = procStart.Arguments.Replace("%FILE%", curFilename); - } - } - procStart.WorkingDirectory = Startupdir; - if (procStart.WorkingDirectory.IndexOf("%FILEDIR%") != -1) - { - procStart.WorkingDirectory = procStart.WorkingDirectory.Replace("%FILEDIR%", Path.GetDirectoryName(curFile.Filename)); - } - procStart.UseShellExecute = UseShellExecute; - } - else - { - // application has no launch-file - // => try to make a correct launch using the current FILE object - procStart.FileName = curFile.Filename; - procStart.WorkingDirectory = Path.GetFullPath(curFile.Filename); - - - if (Startupdir != "") - { - if (Startupdir.Contains("%FILEDIR%")) - { - procStart.WorkingDirectory = procStart.WorkingDirectory.Replace("%FILEDIR%", Path.GetDirectoryName(curFile.Filename)); - } - else - { - procStart.WorkingDirectory = Startupdir; - } - } - - procStart.UseShellExecute = UseShellExecute; - } - procStart.WindowStyle = this.WindowStyle; - - this.LaunchErrorMsg = ""; - try - { - DoPreLaunch(); - - - if (mpGuiMode) - { - AutoPlay.StopListening(); - if (g_Player.Playing) - { - g_Player.Stop(); - } - } - - proc = new Process(); - proc.EnableRaisingEvents = true; - proc.Exited += new EventHandler(proc_Exited); - - proc.StartInfo = procStart; - ProgramUtils.StartProcess(proc, WaitForExit); - - - if (mpGuiMode) - { - //GUIGraphicsContext.DX9Device.Reset(GUIGraphicsContext.DX9Device.PresentationParameters); - AutoPlay.StartListening(); - } - - } - catch (Exception ex) - { - string ErrorString = String.Format("myPrograms: error launching program\n filename: {0}\n arguments: {1}\n WorkingDirectory: {2}\n stack: {3} {4} {5}", - procStart.FileName, - procStart.Arguments, - procStart.WorkingDirectory, - ex.Message, - ex.Source, - ex.StackTrace); - Log.Info(ErrorString); - this.LaunchErrorMsg = ErrorString; - } - finally - { - DoPostLaunch(); - } - } - - void proc_Exited(object sender, EventArgs e) - { - - if (proc != null) - { - proc.Dispose(); - proc = null; - } - } - - protected void DoPreLaunch() - { - if (waitForExit && (preLaunch != "")) - { - LaunchCmd(preLaunch); - } - } - - protected void DoPostLaunch() - { - if (waitForExit && (preLaunch != "")) - { - LaunchCmd(postLaunch); - } - } - - protected void LaunchCmd(string commands) - { - string results = ""; - string errors = ""; - string[] script; - string curLine; - Process p = new Process(); - StreamWriter sw; - StreamReader sr; - StreamReader err; - - script = commands.Split(';'); - if (script.Length > 0) - { - ProcessStartInfo psI = new ProcessStartInfo("cmd"); - psI.UseShellExecute = false; - psI.RedirectStandardInput = true; - psI.RedirectStandardOutput = true; - psI.RedirectStandardError = true; - psI.CreateNoWindow = true; - p.StartInfo = psI; - - p.Start(); - sw = p.StandardInput; - sr = p.StandardOutput; - err = p.StandardError; - - sw.AutoFlush = true; - - for (int i = 0; i < script.Length; i++) - { - curLine = script[i].Trim(); - curLine = curLine.TrimStart('\n'); - if (curLine != "") - sw.WriteLine(curLine); - } - sw.Close(); - - results += sr.ReadToEnd(); - errors += err.ReadToEnd(); - - if (errors.Trim() != "") - { - Log.Info("Application PrePost errors: {0}", errors); - } - } - } - - public virtual void LaunchFile(GUIListItem item) - { - // Launch File by GUILISTITEM - // => look for FileItem and launch it using the found object - if (item.MusicTag == null) - { - return; - } - FileItem curFile = (FileItem)item.MusicTag; - - if (curFile == null) - { - return; - } - this.LaunchFile(curFile, true); - } - - protected virtual void LaunchFilelink(FilelinkItem curLink, bool MPGUIMode) - { - this.OnLaunchFilelink(curLink, MPGUIMode); - } - - public virtual string DefaultFilepath() - { - return ""; // override this if the appitem can have subfolders - } - - public virtual int DisplayFiles(string filePath, GUIFacadeControl facadeView) - { - int totalItems = 0; - if (filePath != lastFilepath) - { - Files.Load(AppID, filePath); - Filelinks.Load(AppID, filePath); - } - totalItems = totalItems + DisplayArrayList(filePath, this.Files, facadeView); - totalItems = totalItems + DisplayArrayList(filePath, this.Filelinks, facadeView); - lastFilepath = filePath; - return totalItems; - } - - protected int DisplayArrayList(string filePath, List<object> dbItems, GUIFacadeControl facadeView) - { - int totalItems = 0; - //foreach (FileItem currentFileItem in dbItems) - foreach (object obj in dbItems) - { - totalItems = totalItems + 1; - if (obj is FileItem) - { - FileItem curFile = obj as FileItem; - GUIListItem gli = new GUIListItem(curFile.Title); - gli.Label2 = curFile.Title2; - gli.MusicTag = curFile; - gli.IsFolder = curFile.IsFolder; - gli.OnRetrieveArt += new MediaPortal.GUI.Library.GUIListItem.RetrieveCoverArtHandler(OnRetrieveCoverArt); - gli.OnItemSelected += new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(OnItemSelected); - facadeView.Add(gli); - } - else if (obj is ProgramFilterItem) - { - ProgramFilterItem curFilter = obj as ProgramFilterItem; - GUIListItem gli = new GUIListItem(curFilter.Title); - gli.Label2 = curFilter.Title2; // some filters may have more than one text - gli.MusicTag = curFilter; - gli.IsFolder = true; - //ck - gli.OnItemSelected += new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(OnItemSelected); - - - facadeView.Add(gli); - - } - } - return totalItems; - } - - - void OnRetrieveCoverArt(GUIListItem gli) - { - if ((gli.MusicTag != null) && (gli.MusicTag is FileItem)) - { - FileItem curFile = (FileItem)gli.MusicTag; - if (curFile.Imagefile != "") - { - gli.ThumbnailImage = curFile.Imagefile; - gli.IconImageBig = curFile.Imagefile; - gli.IconImage = curFile.Imagefile; - } - else - { - gli.ThumbnailImage = GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png"; - gli.IconImageBig = GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png"; - gli.IconImage = GUIGraphicsContext.Skin + @"\media\DefaultFolderNF.png"; - } - } - } - - /* private void OnItemSelected(GUIListItem item, GUIControl parent) - { - GUIFilmstripControl filmstrip = parent as GUIFilmstripControl; - if (filmstrip == null) return; - if (item == null) return; - if ((item.MusicTag != null) && (item.MusicTag is FileItem) && (!item.IsFolder)) - { - filmstrip.InfoImageFileName = item.ThumbnailImage; - } - else - { - filmstrip.InfoImageFileName = ""; - } - }*/ - private void OnItemSelected(GUIListItem item, GUIControl parent) - { - GUIPrograms.ThumbnailPath = ""; - if (item.ThumbnailImage != "" - && item.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png" - && item.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultAlbum.png" - ) - { - // only show big thumb if there is really one.... - GUIPrograms.ThumbnailPath = item.ThumbnailImage; - } - } - - public virtual void OnSort(GUIFacadeControl view, bool doSwitchState) - { - /* - * if (!filesAreLoaded) - { - LoadFiles(); - } - - if (doSwitchState) - { - dbPc.UpdateState(); - } - view.Sort(dbPc); - */ - } - - public virtual void OnSortToggle(GUIFacadeControl view) - { - dbPc.sortAscending = (!dbPc.sortAscending); - view.Sort(dbPc); - } - - public virtual int GetCurrentSortIndex() - { - return dbPc.CurrentSortMethodIndex; - } - - public virtual void SetCurrentSortIndex(int newValue) - { - dbPc.CurrentSortMethodIndex = newValue; - } - - public virtual string CurrentSortTitle() - { - return dbPc.CurrentSortMethodAsText; - } - - public virtual bool GetCurrentSortIsAscending() - { - return dbPc.sortAscending; - } - - public virtual void SetCurrentSortIsAscending(bool newValue) - { - dbPc.sortAscending = newValue; - } - - public virtual bool RefreshButtonVisible() - { - return false; // otherwise, override this in child class - } - - public virtual bool FileEditorAllowed() - { - return true; // otherwise, override this in child class - } - - public virtual bool FileAddAllowed() - { - return true; // otherwise, override this in child class - } - - public virtual bool FilesCanBeFavourites() - { - return true; // otherwise, override this in child class - } - - public virtual bool FileBrowseAllowed() - { - // set this to true, if SUBDIRECTORIES are allowed - // (example: possible for DIRECTORY-CACHE) - return false; // otherwise, override this in child class - } - - public virtual bool SubItemsAllowed() - { - return false; - } - - public virtual bool ProfileLoadingAllowed() - { - return false; - } - - public virtual void Refresh(bool mpGuiMode) - { - // descendant classes do that! - } - - - public virtual void OnInfo(GUIListItem item, ref bool isOverviewVisible, ref ProgramInfoAction modalResult, ref int selectedFileID) - { - GUIFileInfo fileInfoDialog = (GUIFileInfo)GUIWindowManager.GetWindow(ProgramUtils.ProgramInfoID); - if (null != fileInfoDialog) - { - if (item.MusicTag == null) - { - return; - } - FileItem curFile = (FileItem)item.MusicTag; - fileInfoDialog.App = this; - fileInfoDialog.File = curFile; - fileInfoDialog.IsOverviewVisible = isOverviewVisible; - fileInfoDialog.DoModal(GetID); - isOverviewVisible = fileInfoDialog.IsOverviewVisible; - modalResult = fileInfoDialog.ModalResult; - selectedFileID = fileInfoDialog.SelectedFileID; - return; - } - } - - public int AppID - { - get { return appID; } - set { appID = value; } - } - - public int FatherID - { - get { return fatherID; } - set { fatherID = value; } - } - - public string Title - { - get { return title; } - set { title = value; } - } - - public string ShortTitle - { - get { return shortTitle; } - set { shortTitle = value; } - } - - public string Filename - { - get { return filename; } - set { filename = value; } - } - - public string Arguments - { - get { return arguments; } - set { arguments = value; } - } - - public bool UseQuotes - { - get { return useQuotes; } - set { useQuotes = value; } - } - - public bool UseShellExecute - { - get { return useShellExecute; } - set { useShellExecute = value; } - } - - public bool Enabled - { - get { return enabled; } - set { enabled = value; } - } - - public ProcessWindowStyle WindowStyle - { - get { return windowStyle; } - set { windowStyle = value; } - } - - public string Startupdir - { - get { return startupDir; } - set { startupDir = value; } - } - - public string FileDirectory - { - get { return fileDirectory; } - set { fileDirectory = value; } - } - - public string ImageDirectory - { - get { return imageDirectories; } - set { SetImageDirectory(value); } - } - - private void SetImageDirectory(string value) - { - imageDirectories = value; - imageDirs = imageDirectories.Split(';'); - for (int i = 0; i < imageDirs.Length; i++) - { - imageDirs[i] = imageDirs[i].Trim(); - // hack the \n away.... - // imageDirs[i] = imageDirs[i].TrimStart('\n'); - // hack trailing backslashes away - imageDirs[i] = imageDirs[i].TrimEnd('\\'); - } - } - - public string Imagefile - { - get { return imageFile; } - set { imageFile = value; } - } - - public string Source - { - get { return sourceFile; } - set { sourceFile = value; } - } - - public ApplicationType SourceType - { - get { return sourceType; } - set { sourceType = value; } - } - - public string ValidExtensions - { - get { return validExtensions; } - set { validExtensions = value; } - } - - public bool ImportValidImagesOnly - { - get { return importValidImagesOnly; } - set { importValidImagesOnly = value; } - } - - public int Position - { - get { return appPosition; } - set { appPosition = value; } - } - - public int ContentID - { - get { return contentID; } - set { contentID = value; } - } - - public string SystemDefault - { - get { return systemDefault; } - set { systemDefault = value; } - } - - public bool WaitForExit - { - get { return waitForExit; } - set { waitForExit = value; } - } - - - public bool GUIRefreshPossible - { - get { return RefreshButtonVisible(); } - } - - public bool EnableGUIRefresh - { - get { return enableGUIRefresh; } - set { enableGUIRefresh = value; } - } - - public string LaunchErrorMsg - { - get { return launchErrorMsg; } - set { launchErrorMsg = value; } - } - - public string PreLaunch - { - get { return preLaunch; } - set { preLaunch = value; } - } - - public string PostLaunch - { - get { return postLaunch; } - set { postLaunch = value; } - } - - - public FileItemList Files - { - // load on demand.... - get - { - if (!filesAreLoaded) - { - LoadFiles(); - } - return fileList; - } - } - - - public FilelinkItemList Filelinks - { - // load on demand.... - get - { - if (!linksAreLoaded) - { - LoadFileLinks(); - } - return fileLinks; - } - } - - - private int GetNewAppID() - { - // get an unused SQL application KEY-number - if (sqlDB != null) - { - // won't work in multiuser environment :) - SQLiteResultSet results; - int res = 0; - results = sqlDB.Execute("SELECT MAX(APPID) FROM tblApplicationItem"); - SQLiteResultSet.Row arr = results.Rows[0]; - if (arr.fields[0] != null) - { - if (arr.fields[0] != "") - { - res = Int32.Parse(arr.fields[0]); - } - } - return res + 1; - } - else return -1; - } - - private void Insert() - { - if (sqlDB != null) - { - try - { - if (ContentID <= 0) - { - ContentID = 100; - } - //to remove - string Pincode = ""; - AppID = GetNewAppID(); // important to avoid subsequent inserts! - string sql = String.Format("insert into tblApplicationItem (appid, fatherID, title, shorttitle, filename, arguments, windowstyle, startupdir, useshellexecute, usequotes, source_type, source, imagefile, filedirectory, imagedirectory, validextensions, importvalidimagesonly, iposition, enabled, enableGUIRefresh, GUIRefreshPossible, pincode, contentID, systemDefault, WaitForExit, preLaunch, postLaunch) values('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', '{10}', '{11}', '{12}', '{13}', '{14}', '{15}', '{16}', '{17}', '{18}', '{19}', '{20}', '{21}', '{22}', '{23}', '{24}', '{25}', '{26}')", - AppID, FatherID, ProgramUtils.Encode(Title), ProgramUtils.Encode(ShortTitle), ProgramUtils.Encode(Filename), ProgramUtils.Encode(Arguments), - ProgramUtils.WindowStyleToStr(WindowStyle), ProgramUtils.Encode(Startupdir), ProgramUtils.BooleanToStr(UseShellExecute), - ProgramUtils.BooleanToStr(UseQuotes), ProgramUtils.ApplicationTypeToString(SourceType), ProgramUtils.Encode(Source), ProgramUtils.Encode(Imagefile), - ProgramUtils.Encode(FileDirectory), ProgramUtils.Encode(ImageDirectory), ProgramUtils.Encode(ValidExtensions), ProgramUtils.BooleanToStr(importValidImagesOnly), Position, - ProgramUtils.BooleanToStr(Enabled), ProgramUtils.BooleanToStr(EnableGUIRefresh), ProgramUtils.BooleanToStr(GUIRefreshPossible), Pincode, - ContentID, ProgramUtils.Encode(SystemDefault), ProgramUtils.BooleanToStr(WaitForExit), ProgramUtils.Encode(PreLaunch), ProgramUtils.Encode(PostLaunch) - ); - sqlDB.Execute(sql); - } - catch (SQLiteException ex) - { - Log.Info("programdatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace); - } - } - } - - private void Update() - { - string sql = ""; - //to remove - string Pincode = ""; - if ((AppID >= 0) && (sqlDB != null)) - { - if (ContentID <= 0) - { - ContentID = 100; - } - try - { - sql = String.Format("update tblApplicationItem set title = '{0}', shorttitle = '{1}', filename = '{2}', arguments = '{3}', windowstyle = '{4}', startupdir = '{5}', useshellexecute = '{6}', usequotes = '{7}', source_type = '{8}', source = '{9}', imagefile = '{10}',filedirectory = '{11}',imagedirectory = '{12}',validextensions = '{13}',importvalidimagesonly = '{14}',iposition = {15}, enabled = '{16}', fatherID = '{17}', enableGUIRefresh = '{18}', GUIRefreshPossible = '{19}', pincode = '{20}', contentID = '{21}', systemDefault = '{22}', WaitForExit = '{23}', preLaunch = '{24}', postLaunch = '{25}' where appID = {26}", - ProgramUtils.Encode(Title), ProgramUtils.Encode(ShortTitle), ProgramUtils.Encode(Filename), ProgramUtils.Encode(Arguments), - ProgramUtils.WindowStyleToStr(WindowStyle), ProgramUtils.Encode(Startupdir), ProgramUtils.BooleanToStr(UseShellExecute), - ProgramUtils.BooleanToStr(UseQuotes), ProgramUtils.ApplicationTypeToString(SourceType), ProgramUtils.Encode(Source), ProgramUtils.Encode(Imagefile), - ProgramUtils.Encode(FileDirectory), ProgramUtils.Encode(ImageDirectory), ProgramUtils.Encode(ValidExtensions), ProgramUtils.BooleanToStr(importValidImagesOnly), Position, - ProgramUtils.BooleanToStr(Enabled), FatherID, ProgramUtils.BooleanToStr(EnableGUIRefresh), ProgramUtils.BooleanToStr(GUIRefreshPossible), - Pincode, ContentID, ProgramUtils.Encode(SystemDefault), ProgramUtils.BooleanToStr(WaitForExit), ProgramUtils.Encode(PreLaunch), ProgramUtils.Encode(PostLaunch), - AppID); - sqlDB.Execute(sql); - } - catch (SQLiteException ex) - { - Log.Info("programdatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace); - Log.Info("sql \n{0}", sql); - } - } - } - - public void Delete() - { - if ((AppID >= 0) && (sqlDB != null)) - { - try - { - DeleteFiles(); - DeleteFileLinks(); - sqlDB.Execute(String.Format("delete from tblApplicationItem where appid = {0}", AppID)); - } - catch (SQLiteException ex) - { - Log.Info("programdatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace); - } - } - } - - - - - protected void DeleteFiles() - { - if ((AppID >= 0) && (sqlDB != null)) - { - try - { - sqlDB.Execute(String.Format("delete from tblFileItem where appid = {0}", AppID)); - } - catch (SQLiteException ex) - { - Log.Info("programdatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace); - } - } - } - - protected void DeleteFileLinks() - { - if ((AppID >= 0) && (sqlDB != null)) - { - try - { - sqlDB.Execute(String.Format("delete from tblFilterItem where appid = {0} or grouperappid = {0}", AppID)); - } - catch (SQLiteException ex) - { - Log.Info("programdatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace); - } - } - } - - - public virtual void LoadFiles() - { - if (sqlDB != null) - { - // load Files and fill Files-List<string> here! - if (fileList == null) - { - fileList = new FileItemList(sqlDB); - } - else - { - fileList.Clear(); - } - lastFilepath = ""; - fileList.Load(AppID, ""); - filesAreLoaded = true; - } - } - - public virtual void LoadFileLinks() - { - if (sqlDB != null) - { - if (fileLinks == null) - { - fileLinks = new FilelinkItemList(sqlDB); - } - else - { - fileLinks.Clear(); - } - lastFilepath = ""; - fileLinks.Load(AppID, ""); - linksAreLoaded = true; - } - } - - protected virtual void FixFileLinks() - { - // after a import the appitem has completely new - // fileitems (new ids) and LINKS stored in filteritems - // are out of sync... fix this here! - - // query with data to fix - string sqlSelectDataToFix = String.Format("select fi.appid, fi.fileid as oldfileid, f.fileid as newfileid, fi.filename as filename from tblFilterItem fi, tblFileItem f where fi.appID = f.appid and fi.filename = f.filename and fi.appID = {0}", AppID); - - // update command to fix one single link - string sqlFixOneLink = "update tblFilterItem set fileID = {0}, tag = 0 where appID = {1} and filename = '{2}'"; - - SQLiteResultSet rows2fix; - - - try - { - // 1) initialize TAG - sqlDB.Execute(String.Format("update tblFilterItem set tag = 1234 where appid = {0}", AppID)); - - // 2) fix all fileids of the newly imported files - rows2fix = sqlDB.Execute(sqlSelectDataToFix); - int newFileID; - string filenameToFix; - if (rows2fix.Rows.Count == 0) return; - for (int row = 0; row < rows2fix.Rows.Count; row++) - { - newFileID = ProgramUtils.GetIntDef(rows2fix, row, "newfileid", -1); - filenameToFix = ProgramUtils.Get(rows2fix, row, "filename"); - sqlDB.Execute(String.Format(sqlFixOneLink, newFileID, AppID, ProgramUtils.Encode(filenameToFix))); - } - - // 3) delete untouched links ( they were not imported anymore ) - sqlDB.Execute(String.Format("delete from tblFilterItem where appid = {0} and tag = 1234", AppID)); - - } - catch (SQLiteException ex) - { - Log.Info("programdatabase exception (Application.FixFileLinks) err:{0} stack:{1}", ex.Message, ex.StackTrace); - } - - } - - - public void InsertOrUpdateSettings() - { - if (appID == -1) - { - Insert(); - } - else - { - Update(); - } - } - - public virtual string CurrentFilePath() - { - return this.FileDirectory; - } - - - public void Assign(ApplicationItem sourceApp) - { - this.Enabled = sourceApp.Enabled; - this.AppID = sourceApp.AppID; - this.FatherID = sourceApp.FatherID; - this.Title = sourceApp.Title; - this.ShortTitle = sourceApp.ShortTitle; - this.Filename = sourceApp.Filename; - this.Arguments = sourceApp.Arguments; - this.WindowStyle = sourceApp.WindowStyle; - this.Startupdir = sourceApp.Startupdir; - this.UseShellExecute = sourceApp.UseShellExecute; - this.UseQuotes = sourceApp.UseQuotes; - this.SourceType = sourceApp.SourceType; - this.Source = sourceApp.Source; - this.Imagefile = sourceApp.Imagefile; - this.FileDirectory = sourceApp.FileDirectory; - this.ImageDirectory = sourceApp.ImageDirectory; - this.ValidExtensions = sourceApp.ValidExtensions; - this.ImportValidImagesOnly = sourceApp.ImportValidImagesOnly; - this.Position = sourceApp.Position; - this.EnableGUIRefresh = sourceApp.EnableGUIRefresh; - this.WaitForExit = sourceApp.WaitForExit; - this.PreLaunch = sourceApp.PreLaunch; - this.PostLaunch = sourceApp.PostLaunch; - this.SystemDefault = sourceApp.SystemDefault; - this.ContentID = sourceApp.ContentID; - } - - - - // imagedirectory stuff - // get next imagedirectory that holds at least one image for a fileitem - // * m_pFile: the file we're looking images for - private void GetNextThumbFolderIndex(FileItem fileItem) - { - if (fileItem == null) return; - bool foundThumb = false; - while (!foundThumb) - { - thumbFolderIndex++; - if (thumbFolderIndex >= imageDirs.Length) - { - thumbFolderIndex = -1; - foundThumb = true; - } - else - { - string candFolder = imageDirs[thumbFolderIndex]; - string candThumb = candFolder + "\\" + fileItem.ExtractImageFileNoPath(); - if (candThumb.ToLower() != fileItem.Imagefile.ToLower()) - { - foundThumb = (System.IO.File.Exists(candThumb)); - } - else - { - // skip the initial directory, in case it's reentered as a search directory! - foundThumb = false; - } - } - } - } - - public virtual string GetCurThumb(GUIListItem item) - { - if (item.MusicTag == null) - { - return ""; - } - if (item.MusicTag is FileItem) - { - FileItem curFile = item.MusicTag as FileItem; - return GetCurThumb(curFile); - } - else if (item.MusicTag is ApplicationItem) - { - ApplicationItem curApp = item.MusicTag as ApplicationItem; - return curApp.Imagefile; - } - else - { - return ""; - } - } - - - public string GetCurThumb(FileItem fileItem) - { - string curThumb = ""; - if (thumbFolderIndex == -1) - { - curThumb = fileItem.Imagefile; - } - else - { - string curFolder = imageDirs[thumbFolderIndex]; - curThumb = curFolder + "\\" + fileItem.ExtractImageFileNoPath(); - } - if (thumbIndex > 0) - { - // try to find another thumb.... - // use the myGames convention: - // every thumb has the postfix "_1", "_2", etc with the same file extension - string curExtension = fileItem.ExtractImageExtension(); - if (curThumb != "") - { - string cand = curThumb.Replace(curExtension, "_" + thumbIndex.ToString() + curExtension); - if (System.IO.File.Exists(cand)) - { - // found another thumb => override the filename! - curThumb = cand; - } - else - { - thumbIndex = 0; // restart at the first thumb! - GetNextThumbFolderIndex(fileItem); - } - } - } - return curThumb; - } - - public void ResetThumbs() - { - thumbIndex = 0; - thumbFolderIndex = -1; - } - - public void NextThumb() - { - thumbIndex++; - } - - - public void LoadFromXmlProfile(XmlNode node) - { - - XmlNode titleNode = node.SelectSingleNode("title"); - if (titleNode != null) - { - this.Title = titleNode.InnerText; - } - - XmlNode launchingAppNode = node.SelectSingleNode("launchingApplication"); - if (launchingAppNode != null) - { - this.Filename = launchingAppNode.InnerText; - } - - XmlNode useShellExecuteNode = node.SelectSingleNode("useShellExecute"); - if (useShellExecuteNode != null) - { - this.UseShellExecute = ProgramUtils.StrToBoolean(useShellExecuteNode.InnerText); - } - - XmlNode argumentsNode = node.SelectSingleNode("arguments"); - if (argumentsNode != null) - { - this.Arguments = argumentsNode.InnerText; - } - - XmlNode windowStyleNode = node.SelectSingleNode("windowStyle"); - if (windowStyleNode != null) - { - this.WindowStyle = ProgramUtils.StringToWindowStyle(windowStyleNode.InnerText); - } - - XmlNode startupDirNode = node.SelectSingleNode("startupDir"); - if (startupDirNode != null) - { - this.Startupdir = startupDirNode.InnerText; - } - - XmlNode useQuotesNode = node.SelectSingleNode("useQuotes"); - if (useQuotesNode != null) - { - this.UseQuotes = ProgramUtils.StrToBoolean(useQuotesNode.InnerText); - } - - XmlNode fileExtensioneNode = node.SelectSingleNode("fileextensions"); - if (fileExtensioneNode != null) - { - this.ValidExtensions = fileExtensioneNode.InnerText; - } - } - - } -} \ No newline at end of file Copied: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs (from rev 554, trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem .cs) =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs (rev 0) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ApplicationItems/ApplicationItem.cs 2007-06-15 23:36:24 UTC (rev 556) @@ -0,0 +1,1283 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.IO; +using System.Collections.Generic; +using System.Diagnostics; +using System.Xml; +using SQLite.NET; +using MediaPortal.Ripper; +using MediaPortal.Player; +using MediaPortal.GUI.Library; +using MediaPortal.Util; + +using GUIPrograms; +using GUIPrograms.Database; +using GUIPrograms.FileItems; + +namespace GUIPrograms.ApplicationItems +{ + /// <summary> + /// Summary description for Application. + /// </summary> + public class ApplicationItem + { + protected static SQLiteClient sqlDB = null; + private DatabaseSorter dbPc = new DatabaseSorter(); + + public delegate void FilelinkLaunchEventHandler(FilelinkItem curLink, bool mpGuiMode); + + public event FilelinkLaunchEventHandler OnLaunchFilelink = null; + + int appID; + int fatherID; + string title; + string shortTitle; + string filename; + string arguments; + ProcessWindowStyle windowStyle; + Process proc; + string startupDir; + bool useShellExecute; + bool useQuotes; + ApplicationType sourceType; + string sourceFile; + string imageFile; + string imageDirectories; // in one string for sqlite db field + public string[] imageDirs; // imageDirectories splitted + string fileDirectory; + string validExtensions; + bool importValidImagesOnly; + int appPosition; + bool enabled; + bool enableGUIRefresh; + int pincode; + int contentID; + string systemDefault; + bool waitForExit; + string preLaunch; + string postLaunch; + bool importMamePlaychoice10 = false; + + public bool ImportMamePlaychoice10 + { + get { return importMamePlaychoice10; } + set { importMamePlaychoice10 = value; } + } + bool importMameMahjong = false; + + public bool ImportMameMahjong + { + get { return importMameMahjong; } + set { importMameMahjong = value; } + } + + + string launchErrorMsg; + + + // two magic image-slideshow counters + int thumbIndex = 0; + int thumbFolderIndex = -1; + + string lastFilepath = ""; // cached path + + public bool filesAreLoaded = false; // load on demand.... + protected FileItemList fileList = null; + + public bool linksAreLoaded = false; + protected FilelinkItemList fileLinks = null; + + // event: read new file + public delegate void RefreshInfoEventHandler(string informationMessage, int progressBarProgess); + + public event RefreshInfoEventHandler OnRefreshInfo = null; + + protected void SendRefreshInfo(string informationMessage, int progressBarCtr) + { + if (OnRefreshInfo != null) + { + OnRefreshInfo(informationMessage, progressBarCtr); + } + } + + protected int GetID = ProgramUtils.GetID; + + public ApplicationItem(SQLiteClient initSqlDB) + { + + // constructor: save SQLiteDB object + sqlDB = initSqlDB; + // .. init member variables ... + appID = -1; + fatherID = -1; + title = ""; + shortTitle = ""; + filename = ""; + arguments = ""; + windowStyle = ProcessWindowStyle.Normal; + startupDir = "%FILEDIR%"; + useShellExecute = false; + useQuotes = true; + enabled = true; + sourceType = ApplicationType.UNKNOWN; + sourceFile = ""; + imageFile = ""; + fileDirectory = ""; + imageDirectories = ""; + validExtensions = ""; + appPosition = 0; + importValidImagesOnly = false; + enableGUIRefresh = false; + pincode = -1; + contentID = 100; + systemDefault = ""; + waitForExit = true; + filesAreLoaded = false; + preLaunch = ""; + postLaunch = ""; + + } + + public SQLiteClient db + { + get { return sqlDB; } + } + + public int CurrentSortIndex + { + get { return GetCurrentSortIndex(); } + set { SetCurrentSortIndex(value); } + } + + public bool CurrentSortIsAscending + { + get { return GetCurrentSortIsAscending(); } + set { SetCurrentSortIsAscending(value); } + } + + + public FileItem PrevFile(FileItem curFile) + { + if (Files == null) + { + return null; + } + if (Files.Count == 0) + { + return null; + } + int index = this.Files.IndexOf(curFile); + index = index - 1; + if (index < 0) + index = Files.Count - 1; + return (FileItem)Files[index]; + } + + public FileItem NextFile(FileItem curFile) + { + if (Files == null) + { + return null; + } + if (Files.Count == 0) + { + return null; + } + int index = this.Files.IndexOf(curFile); + index = index + 1; + if (index > Files.Count - 1) + index = 0; + return (FileItem)Files[index]; + } + + + public virtual void LaunchFile(FileItem curFile, bool mpGuiMode) + { + string curFilename = curFile.Filename; + if (curFilename == "") + { + return; + } + + // Launch File by item + if (mpGuiMode) + { + curFile.UpdateLaunchInfo(); + } + ProcessStartInfo procStart = new ProcessStartInfo(); + + if (Filename != "") + { + // use the APPLICATION launcher and add current file information + procStart.FileName = Filename; // filename of the application + // set the arguments: one of the arguments is the fileitem-filename + procStart.Arguments = " " + this.Arguments + " "; + if (UseQuotes) + { + // avoid double quotes around the filename-argument..... + curFilename = "\"" + (curFile.Filename.TrimStart('\"')).TrimEnd('\"') + "\""; + } + + if (procStart.Arguments.IndexOf("%FILEnoPATHnoEXT%") >= 0) + { + // ex. kawaks: + // winkawaks.exe alpham2 + // => filename without path and extension is necessary! + string filenameNoPathNoExt = curFile.ExtractFileName(); + filenameNoPathNoExt = (filenameNoPathNoExt.TrimStart('\"')).TrimEnd('\"'); + filenameNoPathNoExt = Path.GetFileNameWithoutExtension(filenameNoPathNoExt); + procStart.Arguments = procStart.Arguments.Replace("%FILEnoPATHnoEXT%", filenameNoPathNoExt); + } + else + { + // the fileitem-argument can be positioned anywhere in the argument string... + if (procStart.Arguments.IndexOf("%FILE%") == -1) + { + // no placeholder found => default handling: add the fileitem as the last argument + procStart.Arguments = procStart.Arguments + curFilename; + } + else + { + // placeholder found => replace the placeholder by the correct filename + procStart.Arguments = procStart.Arguments.Replace("%FILE%", curFilename); + } + } + procStart.WorkingDirectory = Startupdir; + if (procStart.WorkingDirectory.IndexOf("%FILEDIR%") != -1) + { + procStart.WorkingDirectory = procStart.WorkingDirectory.Replace("%FILEDIR%", Path.GetDirectoryName(curFile.Filename)); + } + procStart.UseShellExecute = UseShellExecute; + } + else + { + // application has no launch-file + // => try to make a correct launch using the current FILE object + procStart.FileName = curFile.Filename; + procStart.WorkingDirectory = Path.GetFullPath(curFile.Filename); + + + if (Startupdir != "") + { + if (Startupdir.Contains("%FILEDIR%")) + { + procStart.WorkingDirectory = procStart.WorkingDirectory.Replace("%FILEDIR%", Path.GetDirectoryName(curFile.Filename)); + } + else + { + procStart.WorkingDirectory = Startupdir; + } + } + + procStart.UseShellExecute = UseShellExecute; + } + procStart.WindowStyle = this.WindowStyle; + + this.LaunchErrorMsg = ""; + try + { + DoPreLaunch(); + + + if (mpGuiMode) + { + AutoPlay.StopListening(); + if (g_Player.Playing) + { + g_Player.Stop(); + } + } + + proc = new Process(); + proc.EnableRaisingEvents = true; + proc.Exited += new EventHandler(proc_Exited); + + proc.StartInfo = procStart; + ProgramUtils.StartProcess(proc, WaitForExit); + + + if (mpGuiMode) + { + //GUIGraphicsContext.DX9Device.Reset(GUIGraphicsContext.DX9Device.PresentationParameters); + AutoPlay.StartListening(); + } + + } + catch (Exception ex) + { + string ErrorString = String.Format("myPrograms: error launching program\n filename: {0}\n arguments: {1}\n WorkingDirectory: {2}\n stack: {3} {4} {5}", + procStart.FileName, + procStart.Arguments, + procStart.WorkingDirectory, + ex.Message, + ex.Source, + ex.StackTrace); + Log.Info(ErrorString); + this.LaunchErrorMsg = ErrorString; + } + finally + { + DoPostLaunch(); + } + } + + void proc_Exited(object sender, EventArgs e) + { + + if (proc != null) + { + proc.Dispose(); + proc = null; + } + } + + protected void DoPreLaunch() + { + if (waitForExit && (preLaunch != "")) + { + LaunchCmd(preLaunch); + } + } + + protected void DoPostLaunch() + { + if (waitForExit && (preLaunch != "")) + { + LaunchCmd(postLaunch); + } + } + + protected void LaunchCmd(string commands) + { + string results = ""; + string errors = ""; + string[] script; + string curLine; + Process p = new Process(); + StreamWriter sw; + StreamReader sr; + StreamReader err; + + script = commands.Split(';'); + if (script.Length > 0) + { + ProcessStartInfo psI = new ProcessStartInfo("cmd"); + psI.UseShellExecute = false; + psI.RedirectStandardInput = true; + psI.RedirectStandardOutput = true; + psI.RedirectStandardError = true; + psI.CreateNoWindow = true; + p.StartInfo = psI; + + p.Start(); + sw = p.StandardInput; + sr = p.StandardOutput; + err = p.StandardError; + + sw.AutoFlush = true; + + for (int i = 0; i < script.Length; i++) + { + curLine = script[i].Trim(); + curLine = curLine.TrimStart('\n'); + if (curLine != "") + sw.WriteLine(curLine); + } + sw.Close(); + + results += sr.ReadToEnd(); + errors += err.ReadToEnd(); + + if (errors.Trim() != "") + { + Log.Info("Application PrePost errors: {0}", errors); + } + } + } + + public virtual void LaunchFile(GUIListItem item) + { + // Launch File by GUILISTITEM + // => look for FileItem and launch it using the found object + if (item.MusicTag == null) + { + return; + } + FileItem curFile = (FileItem)item.MusicTag; + + if (curFile == null) + { + return; + } + this.LaunchFile(curFile, true); + } + + protected virtual void LaunchFilelink(FilelinkItem curLink, bool MPGUIMode) + { + this.OnLaunchFilelink(curLink, MPGUIMode); + } + + public virtual string DefaultFilepath() + { + return ""; // override this if the appitem can have subfolders + } + + public virtual int DisplayFiles(string filePath, GUIFacadeControl facadeView) + { + int totalItems = 0; + if (filePath != lastFilepath) + { + Files.Load(AppID, filePath); + Filelinks.Load(AppID, filePath); + } + totalItems = totalItems + DisplayArrayList(filePath, this.Files, facadeView); + totalItems = totalItems + DisplayArrayList(filePath, this.Filelinks, facadeView); + lastFilepath = filePath; + return totalItems; + } + + protected int DisplayArrayList(string filePath, List<object> dbItems, GUIFacadeControl facadeView) + { + int totalItems = 0; + //foreach (FileItem currentFileItem in dbItems) + foreach (object obj in dbItems) + { + totalItems = totalItems + 1; + if (obj is FileItem) + { + FileItem curFile = obj as FileItem; + GUIListItem gli = new GUIListItem(curFile.Title); + gli.Label2 = curFile.Title2; + gli.MusicTag = curFile; + gli.IsFolder = curFile.IsFolder; + gli.OnRetrieveArt += new MediaPortal.GUI.Library.GUIListItem.RetrieveCoverArtHandler(OnRetrieveCoverArt); + gli.OnItemSelected += new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(OnItemSelected); + facadeView.Add(gli); + } + else if (obj is ProgramFilterItem) + { + ProgramFilterItem curFilter = obj as ProgramFilterItem; + GUIListItem gli = new GUIListItem(curFilter.Title); + gli.Label2 = curFilter.Title2; // some filters may have more than one text + gli.MusicTag = curFilter; + gli.IsFolder = true; + //ck + gli.OnItemSelected += new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(OnItemSelected); + + + facadeView.Add(gli); + + } + } + return totalItems; + } + + + void OnRetrieveCoverArt(GUIListItem gli) + { + if ((gli.MusicTag != null) && (gli.MusicTag is FileItem)) + { + FileItem curFile = (FileItem)gli.MusicTag; + if (curFile.Imagefile != "") + { + gli.ThumbnailImage = curFile.Imagefile; + gli.IconImageBig = curFile.Imagefile; + gli.IconImage = curFile.Imagefile; + } + else + { + gli.ThumbnailImage = GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png"; + gli.IconImageBig = GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png"; + gli.IconImage = GUIGraphicsContext.Skin + @"\media\DefaultFolderNF.png"; + } + } + } + + /* private void OnItemSelected(GUIListItem item, GUIControl parent) + { + GUIFilmstripControl filmstrip = parent as GUIFilmstripControl; + if (filmstrip == null) return; + if (item == null) return; + if ((item.MusicTag != null) && (item.MusicTag is FileItem) && (!item.IsFolder)) + { + filmstrip.InfoImageFileName = item.ThumbnailImage; + } + else + { + filmstrip.InfoImageFileName = ""; + } + }*/ + private void OnItemSelected(GUIListItem item, GUIControl parent) + { + GUIPrograms.ThumbnailPath = ""; + if (item.ThumbnailImage != "" + && item.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png" + && item.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultAlbum.png" + ) + { + // only show big thumb if there is really one.... + GUIPrograms.ThumbnailPath = item.ThumbnailImage; + } + } + + public virtual void OnSort(GUIFacadeControl view, bool doSwitchState) + { + /* + * if (!filesAreLoaded) + { + LoadFiles(); + } + + if (doSwitchState) + { + dbPc.UpdateState(); + } + view.Sort(dbPc); + */ + } + + public virtual void OnSortToggle(GUIFacadeControl view) + { + dbPc.sortAscending = (!dbPc.sortAscending); + view.Sort(dbPc); + } + + public virtual int GetCurrentSortIndex() + { + return dbPc.CurrentSortMethodIndex; + } + + public virtual void SetCurrentSortIndex(int newValue) + { + dbPc.CurrentSortMethodIndex = newValue; + } + + public virtual string CurrentSortTitle() + { + return dbPc.CurrentSortMethodAsText; + } + + public virtual bool GetCurrentSortIsAscending() + { + return dbPc.sortAscending; + } + + public virtual void SetCurrentSortIsAscending(bool newValue) + { + dbPc.sortAscending = newValue; + } + + public virtual bool RefreshButtonVisible() + { + return false; // otherwise, override this in child class + } + + public virtual bool FileEditorAllowed() + { + return true; // otherwise, override this in child class + } + + public virtual bool FileAddAllowed() + { + return true; // otherwise, override this in child class + } + + public virtual bool FilesCanBeFavourites() + { + return true; // otherwise, override this in child class + } + + public virtual bool FileBrowseAllowed() + { + // set this to true, if SUBDIRECTORIES are allowed + // (example: possible for DIRECTORY-CACHE) + return false; // otherwise, override this in child class + } + + public virtual bool SubItemsAllowed() + { + return false; + } + + public virtual bool ProfileLoadingAllowed() + { + return false; + } + + public virtual void Refresh(bool mpGuiMode) + { + // descendant classes do that! + } + + + public virtual void OnInfo(GUIListItem item, ref bool isOverviewVisible, ref ProgramInfoAction modalResult, ref int selectedFileID) + { + GUIFileInfo fileInfoDialog = (GUIFileInfo)GUIWindowManager.GetWindow(ProgramUtils.ProgramInfoID); + if (null != fileInfoDialog) + { + if (item.MusicTag == null) + { + return; + } + FileItem curFile = (FileItem)item.MusicTag; + fileInfoDialog.App = this; + fileInfoDialog.File = curFile; + fileInfoDialog.IsOverviewVisible = isOverviewVisible; + fileInfoDialog.DoModal(GetID); + isOverviewVisible = fileInfoDialog.IsOverviewVisible; + modalResult = fileInfoDialog.ModalResult; + selectedFileID = fileInfoDialog.SelectedFileID; + return; + } + } + + public int AppID + { + get { return appID; } + set { appID = value; } + } + + public int FatherID + { + get { return fatherID; } + set { fatherID = value; } + } + + public string Title + { + get { return title; } + set { title = value; } + } + + public string ShortTitle + { + get { return shortTitle; } + set { shortTitle = value; } + } + + public string Filename + { + get { return filename; } + set { filename = value; } + } + + public string Arguments + { + get { return arguments; } + set { arguments = value; } + } + + public bool UseQuotes + { + get { return useQuotes; } + set { useQuotes = value; } + } + + public bool UseShellExecute + { + get { return useShellExecute; } + set { useShellExecute = value; } + } + + public bool Enabled + { + get { return enabled; } + set { enabled = value; } + } + + public ProcessWindowStyle WindowStyle + { + get { return windowStyle; } + set { windowStyle = value; } + } + + public string Startupdir + { + get { return startupDir; } + set { startupDir = value; } + } + + public string FileDirectory + { + get { return fileDirectory; } + set { fileDirectory = value; } + } + + public string ImageDirectory + { + get { return imageDirectories; } + set { SetImageDirectory(value); } + } + + private void SetImageDirectory(string value) + { + imageDirectories = value; + imageDirs = imageDirectories.Split(';'); + for (int i = 0; i < imageDirs.Length; i++) + { + imageDirs[i] = imageDirs[i].Trim(); + // hack the \n away.... + // imageDirs[i] = imageDirs[i].TrimStart('\n'); + // hack trailing backslashes away + imageDirs[i] = imageDirs[i].TrimEnd('\\'); + } + } + + public string Imagefile + { + get { return imageFile; } + set { imageFile = value; } + } + + public string Source + { + get { return sourceFile; } + set { sourceFile = value; } + } + + public ApplicationType SourceType + { + get { return sourceType; } + set { ... [truncated message content] |
From: <ze...@us...> - 2007-06-15 22:21:25
|
Revision: 555 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=555&view=rev Author: zebons Date: 2007-06-15 15:21:16 -0700 (Fri, 15 Jun 2007) Log Message: ----------- Corrected bug for hierarchy structure Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs trunk/plugins/MyFilms/MesFilmsDetail.cs trunk/plugins/MyFilms/MesFilmsSetup.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-06-15 00:25:15 UTC (rev 554) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-06-15 22:21:16 UTC (rev 555) @@ -149,6 +149,7 @@ string CurrentSortMethod = null; decimal w_rating = 0; int l_index = 0; + string l_title = ""; string FileImage = "9999"; AntMovieCatalog mydivx =new AntMovieCatalog(); private string StrPluginName = "Films"; @@ -560,7 +561,7 @@ // New Window for detailed selected item information { //l_index = facadeView.SelectedListItemIndex; - save_config_values(); + //save_config_values(); mydivx.Clear(); GUIWindowManager.ActivateWindow(ID_MesFilmsDetail); } @@ -784,7 +785,14 @@ } if (iSelItem >= 0) //-1 = ignore, >=0 = itemID to locate (test every item in case item is from within a folder) { - if ((int)(r["Number"]) == iSelItem) l_index = facadeView.Count - 1; //test if this item is one to select + if (!(l_title.Length > 0)) + { + if (((int)(r["Number"]) == iSelItem)) l_index = facadeView.Count - 1; //test if this item is one to select + } + else + { + if (((int)(r["Number"]) == iSelItem) && ((string)(r[StrTitle1]) == l_title)) l_index = facadeView.Count - 1; //test if this item is one to select + } } sPrevTitle = sTitle; fin: ; @@ -795,6 +803,8 @@ GUIControl.SelectItemControl(GetID, (int)Controls.CTRL_List, (int)l_index); GUIPropertyManager.SetProperty("#nbobjects", facadeView.Count.ToString() + " " + GUILocalizeStrings.Get(127)); + if (facadeView.Count == 1 && item.IsFolder) + wselectedlabel = item.Label; return !(facadeView.Count == 1 && item.IsFolder); //ret false if single folder found } @@ -1204,6 +1214,7 @@ xmlwriter.SetValue(CurrentConfig, "StrSortSens", StrSortSens.ToString()); xmlwriter.SetValue(CurrentConfig, "Selection", StrTxtSelect); xmlwriter.SetValue(CurrentConfig, "IndexItem", (facadeView.SelectedListItemIndex > -1) ? ((boolselect) ? facadeView.SelectedListItemIndex.ToString() : facadeView.SelectedListItem.ItemId.ToString()) : "-1"); //may need to check if there is no item selected and so save -1 + xmlwriter.SetValue(CurrentConfig, "TitleItem", (facadeView.SelectedListItemIndex > -1) ? ((boolselect) ? facadeView.SelectedListItemIndex.ToString() : facadeView.SelectedListItem.Label.ToString()) : ""); //may need to check if there is no item selected and so save "" xmlwriter.SetValueAsBool(CurrentConfig, "boolselect", boolselect); xmlwriter.SetValueAsBool(CurrentConfig, "boolreturn", boolreturn); xmlwriter.SetValue(CurrentConfig, "WSelectedLabel", wselectedlabel); @@ -1286,6 +1297,7 @@ StrSortSens = xmlreader.GetValueAsString(CurrentConfig, "StrSortSens", ""); StrTxtSelect = xmlreader.GetValueAsString(CurrentConfig, "Selection", ""); l_index = xmlreader.GetValueAsInt(CurrentConfig, "IndexItem", -1); + l_title = xmlreader.GetValueAsString(CurrentConfig, "TitleItem", ""); boolselect = xmlreader.GetValueAsBool(CurrentConfig, "boolselect", false); boolreturn = xmlreader.GetValueAsBool(CurrentConfig, "boolreturn", false); WStrSort = xmlreader.GetValueAsString(CurrentConfig, "WStrSort", ""); Modified: trunk/plugins/MyFilms/MesFilmsDetail.cs =================================================================== --- trunk/plugins/MyFilms/MesFilmsDetail.cs 2007-06-15 00:25:15 UTC (rev 554) +++ trunk/plugins/MyFilms/MesFilmsDetail.cs 2007-06-15 22:21:16 UTC (rev 555) @@ -103,6 +103,7 @@ bool SearchFile = false; string CurrentConfig = null; string wzone = null; + string StrTIndex = null; int StrIndex = 0; int StrMax = 0; public SQLiteClient m_db; @@ -198,7 +199,8 @@ StrSort = xmlreader.GetValueAsString(CurrentConfig, "StrSort", ""); CurrentSortMethod = xmlreader.GetValueAsString(CurrentConfig, "CurrentSortMethod", ""); StrSortSens = xmlreader.GetValueAsString(CurrentConfig, "StrSortSens", ""); - StrIndex = (int)xmlreader.GetValueAsInt(CurrentConfig, "IndexItem", 0); + StrIndex = xmlreader.GetValueAsInt(CurrentConfig, "IndexItem", 0); + StrTIndex = xmlreader.GetValueAsString(CurrentConfig, "TitleItem", ""); Strlabel1 = xmlreader.GetValueAsString(CurrentConfig, "AntLabel1", ""); Strlabel2 = xmlreader.GetValueAsString(CurrentConfig, "AntLabel2", ""); Stritem1 = xmlreader.GetValueAsString(CurrentConfig, "AntItem1", ""); @@ -556,12 +558,25 @@ StrIndex = -1; foreach (DataRow enr in r) { - if ((int)(enr["Number"]) == ItemId) + if ((StrTIndex != "") && (StrTIndex != null)) { - StrIndex = cnt; - break; + string wtitle = enr[StrTitle1].ToString(); + if (((int)(enr["Number"]) == ItemId) && (StrTIndex.Substring(StrTIndex.LastIndexOf(TitleDelim) + 1) == StrTIndex.Substring(StrTIndex.LastIndexOf(TitleDelim) + 1))) + { + StrIndex = cnt; + break; + } + cnt++; } - cnt++; + else + { + if ((int)(enr["Number"]) == ItemId) + { + StrIndex = cnt; + break; + } + cnt++; + } } } } @@ -776,6 +791,7 @@ using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MyFilms.xml"))) { xmlwriter.SetValue(CurrentConfig, "IndexItem", r[StrIndex]["Number"]); + xmlwriter.SetValue(CurrentConfig, "TitleItem", r[StrIndex][StrTitle1]); if (ID != -1) xmlwriter.SetValue(CurrentConfig, "LastID", ID); } } Modified: trunk/plugins/MyFilms/MesFilmsSetup.cs =================================================================== --- trunk/plugins/MyFilms/MesFilmsSetup.cs 2007-06-15 00:25:15 UTC (rev 554) +++ trunk/plugins/MyFilms/MesFilmsSetup.cs 2007-06-15 22:21:16 UTC (rev 555) @@ -319,6 +319,8 @@ StrDfltSelect = "(" + StrDfltSelect + "(" + AntFilterItem2.Text + " " + wAntFilterSign + " #" + Convert.ToDateTime(AntFilterText2.Text) + "# or " + AntFilterItem2.Text + " is null)) AND "; else StrDfltSelect = "(" + StrDfltSelect + "(" + AntFilterItem2.Text + " " + wAntFilterSign + " '" + AntFilterText2.Text + "' or " + AntFilterItem2.Text + " is null)) AND "; + if (View_Dflt_Item.Text.Length == 0) + View_Dflt_Item.Text = "(none)"; Verify_Config(); //string currentLanguage = String.Empty; //using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-15 00:25:15
|
Revision: 554 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=554&view=rev Author: chef_koch Date: 2007-06-14 17:25:15 -0700 (Thu, 14 Jun 2007) Log Message: ----------- yet another small addition Modified Paths: -------------- trunk/plugins/My Connect4/readme.txt Modified: trunk/plugins/My Connect4/readme.txt =================================================================== --- trunk/plugins/My Connect4/readme.txt 2007-06-15 00:23:50 UTC (rev 553) +++ trunk/plugins/My Connect4/readme.txt 2007-06-15 00:25:15 UTC (rev 554) @@ -10,6 +10,7 @@ - added option to enable/disable sounds on the fly - plugin should be full localisable now - minor improvements + - added skin file: BlueTwo wide - thx to Technec - skinners, pls have a look at the button-ids ... regards This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-15 00:23:51
|
Revision: 553 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=553&view=rev Author: chef_koch Date: 2007-06-14 17:23:50 -0700 (Thu, 14 Jun 2007) Log Message: ----------- added skin file: BlueTwo wide Added Paths: ----------- trunk/plugins/My Connect4/Release/skin/BlueTwo wide/ trunk/plugins/My Connect4/Release/skin/BlueTwo wide/MyConnect4.xml Added: trunk/plugins/My Connect4/Release/skin/BlueTwo wide/MyConnect4.xml =================================================================== --- trunk/plugins/My Connect4/Release/skin/BlueTwo wide/MyConnect4.xml (rev 0) +++ trunk/plugins/My Connect4/Release/skin/BlueTwo wide/MyConnect4.xml 2007-06-15 00:23:50 UTC (rev 553) @@ -0,0 +1,618 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>22031969</id> + <defaultcontrol>2</defaultcontrol> + <allowoverlay>yes</allowoverlay> + <autohidetopbar>yes</autohidetopbar> + <controls> + <import>common.time.xml</import> + <control> + <description>BackGround</description> + <type>image</type> + <id>1</id> + <posX>0</posX> + <posY>0</posY> + <width>1366</width> + <height>768</height> + <texture>background.png</texture> + </control> + <control> + <description>header label</description> + <type>label</type> + <id>1</id> + <posX>398</posX> + <posY>93</posY> + <label>#header_label</label> + <font>font16</font> + <align>right</align> + <textcolor>White</textcolor> + <animation effect="fade" time="200">WindowOpen</animation> + <animation effect="fade" time="200">WindowClose</animation> + </control> + <control> + <description>button group</description> + <type>group</type> + <animation effect="fade" time="250">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="slide" time="250" start="-300,0">WindowOpen</animation> + <animation effect="slide" time="500" end="0,-300">WindowClose</animation> + <posX>113</posX> + <posY>129</posY> + <layout>StackLayout</layout> + <control> + <description>Start</description> + <type>button</type> + <id>2</id> + <onleft>2</onleft> + <onright>301</onright> + <onup>6</onup> + <ondown>3</ondown> + </control> + <control> + <description>Mode</description> + <type>button</type> + <id>3</id> + <onleft>3</onleft> + <onright>301</onright> + <onup>2</onup> + <ondown>4</ondown> + </control> + <control> + <description>Level</description> + <type>button</type> + <id>4</id> + <onleft>4</onleft> + <onright>301</onright> + <onup>3</onup> + <ondown>5</ondown> + </control> + <control> + <description>Sounds</description> + <type>togglebutton</type> + <id>5</id> + <onleft>5</onleft> + <onright>301</onright> + <onup>4</onup> + <ondown>6</ondown> + </control> + <control> + <description>Round</description> + <type>button</type> + <id>1</id> + <label>#Round</label> + <font>font12</font> + <enabled>false</enabled> + <textureFocus>-</textureFocus> + <textureNoFocus>-</textureNoFocus> + </control> + <control> + <description>Player: / GameOver</description> + <type>button</type> + <id>1</id> + <label>#Player</label> + <font>font12</font> + <enabled>false</enabled> + <textureFocus>-</textureFocus> + <textureNoFocus>-</textureNoFocus> + </control> + <control> + <description>What is this?</description> + <type>button</type> + <id>6</id> + <onleft>6</onleft> + <onright>301</onright> + <onup>5</onup> + <ondown>2</ondown> + </control> + </control> + <control> + <description>BackGround Game</description> + <type>image</type> + <id>15</id> + <posX>610</posX> + <posY>200</posY> + <width>460</width> + <height>380</height> + <texture>MyConnBack.png</texture> + <animation effect="fade" time="250">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="slide" time="400" start="0,-300">WindowOpen</animation> + <animation effect="slide" time="400" end="800,0">WindowClose</animation> + </control> + <control> + <description>game group</description> + + <type>group</type> + <animation effect="fade" time="250">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="slide" time="400" start="0,-300">WindowOpen</animation> + <animation effect="slide" time="400" end="800,0">WindowClose</animation> + <control> + <description>text label</description> + <type>label</type> + <id>18</id> + <posX>440</posX> + <posY>610</posY> + <label>#Status</label> + <font>font16</font> + <align>Left</align> + <textcolor>ffffffff</textcolor> + </control> + <control> + <description>Pointer 01</description> + <type>button</type> + <id>301</id> + <posX>640</posX> + <posY>210</posY> + <width>40</width> + <height>40</height> + <onright>302</onright> + <onup>301</onup> + <ondown>301</ondown> + <textureFocus>MyConn4Cur.png</textureFocus> + </control> + <control> + <description>Pointer 02</description> + <type>button</type> + <id>302</id> + <posX>700</posX> + <posY>210</posY> + <width>40</width> + <height>40</height> + <onleft>301</onleft> + <onright>303</onright> + <onup>302</onup> + <ondown>302</ondown> + <textureFocus>MyConn4Cur.png</textureFocus> + </control> + <control> + <description>Pointer 03</description> + <type>button</type> + <id>303</id> + <posX>760</posX> + <posY>210</posY> + <width>40</width> + <height>40</height> + <onleft>302</onleft> + <onright>304</onright> + <onup>303</onup> + <ondown>303</ondown> + <textureFocus>MyConn4Cur.png</textureFocus> + </control> + <control> + <description>Pointer 04</description> + <type>button</type> + <id>304</id> + <posX>820</posX> + <posY>210</posY> + <width>40</width> + <height>40</height> + <onleft>303</onleft> + <onright>305</onright> + <onup>304</onup> + <ondown>304</ondown> + <textureFocus>MyConn4Cur.png</textureFocus> + </control> + <control> + <description>Pointer 05</description> + <type>button</type> + <id>305</id> + <posX>880</posX> + <posY>210</posY> + <width>40</width> + <height>40</height> + <onleft>304</onleft> + <onright>306</onright> + <onup>305</onup> + <ondown>305</ondown> + <textureFocus>MyConn4Cur.png</textureFocus> + </control> + <control> + <description>Pointer 06</description> + <type>button</type> + <id>306</id> + <posX>940</posX> + <posY>210</posY> + <width>40</width> + <height>40</height> + <onleft>305</onleft> + <onright>307</onright> + <onup>306</onup> + <ondown>306</ondown> + <textureFocus>MyConn4Cur.png</textureFocus> + </control> + <control> + <description>Pointer 07</description> + <type>button</type> + <id>307</id> + <posX>1000</posX> + <posY>210</posY> + <width>40</width> + <height>40</height> + <onleft>306</onleft> + <onright>301</onright> + <onup>307</onup> + <ondown>307</ondown> + <textureFocus>MyConn4Cur.png</textureFocus> + </control> + <control> + <type>image</type> + <id>101</id> + <posX>640</posX> + <posY>260</posY> + <width>40</width> + <height>40</height> + <texture>#Con_1_1</texture> + </control> + <control> + <type>image</type> + <id>102</id> + <posX>700</posX> + <posY>260</posY> + <width>40</width> + <height>40</height> + <texture>#Con_1_2</texture> + </control> + <control> + <type>image</type> + <id>103</id> + <posX>760</posX> + <posY>260</posY> + <width>40</width> + <height>40</height> + <texture>#Con_1_3</texture> + </control> + <control> + <type>image</type> + <id>104</id> + <posX>820</posX> + <posY>260</posY> + <width>40</width> + <height>40</height> + <texture>#Con_1_4</texture> + </control> + <control> + <type>image</type> + <id>105</id> + <posX>880</posX> + <posY>260</posY> + <width>40</width> + <height>40</height> + <texture>#Con_1_5</texture> + </control> + <control> + <type>image</type> + <id>106</id> + <posX>940</posX> + <posY>260</posY> + <width>40</width> + <height>40</height> + <texture>#Con_1_6</texture> + </control> + <control> + <type>image</type> + <id>107</id> + <posX>1000</posX> + <posY>260</posY> + <width>40</width> + <height>40</height> + <texture>#Con_1_7</texture> + </control> + <control> + <type>image</type> + <id>111</id> + <posX>640</posX> + <posY>310</posY> + <width>40</width> + <height>40</height> + <texture>#Con_2_1</texture> + </control> + <control> + <type>image</type> + <id>112</id> + <posX>700</posX> + <posY>310</posY> + <width>40</width> + <height>40</height> + <texture>#Con_2_2</texture> + </control> + <control> + <type>image</type> + <id>113</id> + <posX>760</posX> + <posY>310</posY> + <width>40</width> + <height>40</height> + <texture>#Con_2_3</texture> + </control> + <control> + <type>image</type> + <id>114</id> + <posX>820</posX> + <posY>310</posY> + <width>40</width> + <height>40</height> + <texture>#Con_2_4</texture> + </control> + <control> + <type>image</type> + <id>115</id> + <posX>880</posX> + <posY>310</posY> + <width>40</width> + <height>40</height> + <texture>#Con_2_5</texture> + </control> + <control> + <type>image</type> + <id>116</id> + <posX>940</posX> + <posY>310</posY> + <width>40</width> + <height>40</height> + <texture>#Con_2_6</texture> + </control> + <control> + <type>image</type> + <id>117</id> + <posX>1000</posX> + <posY>310</posY> + <width>40</width> + <height>40</height> + <texture>#Con_2_7</texture> + </control> + <control> + <type>image</type> + <id>121</id> + <posX>640</posX> + <posY>360</posY> + <width>40</width> + <height>40</height> + <texture>#Con_3_1</texture> + </control> + <control> + <type>image</type> + <id>122</id> + <posX>700</posX> + <posY>360</posY> + <width>40</width> + <height>40</height> + <texture>#Con_3_2</texture> + </control> + <control> + <type>image</type> + <id>123</id> + <posX>760</posX> + <posY>360</posY> + <width>40</width> + <height>40</height> + <texture>#Con_3_3</texture> + </control> + <control> + <type>image</type> + <id>124</id> + <posX>820</posX> + <posY>360</posY> + <width>40</width> + <height>40</height> + <texture>#Con_3_4</texture> + </control> + <control> + <type>image</type> + <id>125</id> + <posX>880</posX> + <posY>360</posY> + <width>40</width> + <height>40</height> + <texture>#Con_3_5</texture> + </control> + <control> + <type>image</type> + <id>126</id> + <posX>940</posX> + <posY>360</posY> + <width>40</width> + <height>40</height> + <texture>#Con_3_6</texture> + </control> + <control> + <type>image</type> + <id>127</id> + <posX>1000</posX> + <posY>360</posY> + <width>40</width> + <height>40</height> + <texture>#Con_3_7</texture> + </control> + <control> + <type>image</type> + <id>131</id> + <posX>640</posX> + <posY>410</posY> + <width>40</width> + <height>40</height> + <texture>#Con_4_1</texture> + </control> + <control> + <type>image</type> + <id>132</id> + <posX>700</posX> + <posY>410</posY> + <width>40</width> + <height>40</height> + <texture>#Con_4_2</texture> + </control> + <control> + <type>image</type> + <id>133</id> + <posX>760</posX> + <posY>410</posY> + <width>40</width> + <height>40</height> + <texture>#Con_4_3</texture> + </control> + <control> + <type>image</type> + <id>134</id> + <posX>820</posX> + <posY>410</posY> + <width>40</width> + <height>40</height> + <texture>#Con_4_4</texture> + </control> + <control> + <type>image</type> + <id>135</id> + <posX>880</posX> + <posY>410</posY> + <width>40</width> + <height>40</height> + <texture>#Con_4_5</texture> + </control> + <control> + <type>image</type> + <id>136</id> + <posX>940</posX> + <posY>410</posY> + <width>40</width> + <height>40</height> + <texture>#Con_4_6</texture> + </control> + <control> + <type>image</type> + <id>137</id> + <posX>1000</posX> + <posY>410</posY> + <width>40</width> + <height>40</height> + <texture>#Con_4_7</texture> + </control> + <control> + <type>image</type> + <id>141</id> + <posX>640</posX> + <posY>460</posY> + <width>40</width> + <height>40</height> + <texture>#Con_5_1</texture> + </control> + <control> + <type>image</type> + <id>142</id> + <posX>700</posX> + <posY>460</posY> + <width>40</width> + <height>40</height> + <texture>#Con_5_2</texture> + </control> + <control> + <type>image</type> + <id>143</id> + <posX>760</posX> + <posY>460</posY> + <width>40</width> + <height>40</height> + <texture>#Con_5_3</texture> + </control> + <control> + <type>image</type> + <id>144</id> + <posX>820</posX> + <posY>460</posY> + <width>40</width> + <height>40</height> + <texture>#Con_5_4</texture> + </control> + <control> + <type>image</type> + <id>145</id> + <posX>880</posX> + <posY>460</posY> + <width>40</width> + <height>40</height> + <texture>#Con_5_5</texture> + </control> + <control> + <type>image</type> + <id>146</id> + <posX>940</posX> + <posY>460</posY> + <width>40</width> + <height>40</height> + <texture>#Con_5_6</texture> + </control> + <control> + <type>image</type> + <id>147</id> + <posX>1000</posX> + <posY>460</posY> + <width>40</width> + <height>40</height> + <texture>#Con_5_7</texture> + </control> + <control> + <type>image</type> + <id>151</id> + <posX>640</posX> + <posY>510</posY> + <width>40</width> + <height>40</height> + <texture>#Con_6_1</texture> + </control> + <control> + <type>image</type> + <id>152</id> + <posX>700</posX> + <posY>510</posY> + <width>40</width> + <height>40</height> + <texture>#Con_6_2</texture> + </control> + <control> + <type>image</type> + <id>153</id> + <posX>760</posX> + <posY>510</posY> + <width>40</width> + <height>40</height> + <texture>#Con_6_3</texture> + </control> + <control> + <type>image</type> + <id>154</id> + <posX>820</posX> + <posY>510</posY> + <width>40</width> + <height>40</height> + <texture>#Con_6_4</texture> + </control> + <control> + <type>image</type> + <id>155</id> + <posX>880</posX> + <posY>510</posY> + <width>40</width> + <height>40</height> + <texture>#Con_6_5</texture> + </control> + <control> + <type>image</type> + <id>156</id> + <posX>940</posX> + <posY>510</posY> + <width>40</width> + <height>40</height> + <texture>#Con_6_6</texture> + </control> + <control> + <type>image</type> + <id>157</id> + <posX>1000</posX> + <posY>510</posY> + <width>40</width> + <height>40</height> + <texture>#Con_6_7</texture> + </control> + </control> + </controls> +</window> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-14 23:39:36
|
Revision: 552 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=552&view=rev Author: chef_koch Date: 2007-06-14 16:39:33 -0700 (Thu, 14 Jun 2007) Log Message: ----------- update for v0.3 release Modified Paths: -------------- trunk/plugins/My Connect4/readme.txt Modified: trunk/plugins/My Connect4/readme.txt =================================================================== --- trunk/plugins/My Connect4/readme.txt 2007-06-14 23:39:04 UTC (rev 551) +++ trunk/plugins/My Connect4/readme.txt 2007-06-14 23:39:33 UTC (rev 552) @@ -4,6 +4,19 @@ Connect 4 (Vier gewinnt) ------------------------ +v0.3 + + - MediaPortal 0.2.3.0 ready + - added option to enable/disable sounds on the fly + - plugin should be full localisable now + - minor improvements + - skinners, pls have a look at the button-ids ... + +regards +chefkoch + +------------------------------------------ + v0.2 -nice icons for the config This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-14 23:39:16
|
Revision: 551 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=551&view=rev Author: chef_koch Date: 2007-06-14 16:39:04 -0700 (Thu, 14 Jun 2007) Log Message: ----------- fixed: language is now updated after changed in GUIsettings Modified Paths: -------------- trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs Modified: trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs =================================================================== --- trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs 2007-06-14 23:37:47 UTC (rev 550) +++ trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs 2007-06-14 23:39:04 UTC (rev 551) @@ -181,8 +181,6 @@ public override bool Init() { - MyConnect.GUILocalizeStrings.Load(GUI.Library.GUILocalizeStrings.CurrentLanguage()); - bool result = Load(GUIGraphicsContext.Skin + @"\MyConnect4.xml"); if (ah == null) ah = new OnActionHandler(OnAction2); @@ -196,6 +194,8 @@ protected override void OnPageLoad() { + MyConnect.GUILocalizeStrings.Load(GUI.Library.GUILocalizeStrings.CurrentLanguage()); + _Game.Interval = 300; _Game.Tick += new EventHandler(_Game_Tick); _Game.Start(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-14 23:37:51
|
Revision: 550 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=550&view=rev Author: chef_koch Date: 2007-06-14 16:37:47 -0700 (Thu, 14 Jun 2007) Log Message: ----------- small update Modified Paths: -------------- trunk/plugins/My Connect4/Release/language/MyConnect4/strings_de.xml Modified: trunk/plugins/My Connect4/Release/language/MyConnect4/strings_de.xml =================================================================== --- trunk/plugins/My Connect4/Release/language/MyConnect4/strings_de.xml 2007-06-14 16:34:39 UTC (rev 549) +++ trunk/plugins/My Connect4/Release/language/MyConnect4/strings_de.xml 2007-06-14 23:37:47 UTC (rev 550) @@ -17,14 +17,14 @@ <String id="21">Computer</String> <String id="22">Spieler</String> <String id="31">Was ist Vier gewinnt?</String> - <String id="32">Connect 4 is a game where your object is to get 4 tokens in a row. -This could be vertically, horizontal or diagonally. + <String id="32">Vier gewinnt? Müsstest du kennen :P +Ziel ist es 4 chips in eine Reihe zu bekommen. Diese kann sowohl vertikal, horizontal als auch diagonal verlaufen. -Gameboard design by Mikael Söderström. +Design des Spielbretts von by Mikael Söderström. -AI code has been taken from http://www.Planet-Source-Code.com +Der Quelltext für Künstliche Intelligenz des Computer Gegners ist von http://www.Planet-Source-Code.com. -Good luck +Viel Glück Mark Koenig (kroko)</String> </Section> </Language> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nor...@us...> - 2007-06-14 16:34:41
|
Revision: 549 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=549&view=rev Author: northern_sky Date: 2007-06-14 09:34:39 -0700 (Thu, 14 Jun 2007) Log Message: ----------- small cleanup + fixed gameurl for new items too Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/FileItems/FileItem.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/FileItems/FileItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/FileItems/FileItem.cs 2007-06-14 13:04:07 UTC (rev 548) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/FileItems/FileItem.cs 2007-06-14 16:34:39 UTC (rev 549) @@ -577,76 +577,59 @@ string strSQL = String.Format( @" INSERT INTO - tblFileItem ( - fileid, - appid, - title, - filename, - filepath, - imagefile, - mainGenre, - subGenre, - country, - manufacturer, - year, - rating, - overview, - system, - manualfilename, - lastTimeLaunched, - launchcount, - isfolder, - external_id, - uppertitle, - tagdata, - categorydata - ) + tblFileItem + ( + fileid, + appid, + title, + filename, + filepath, + imagefile, + mainGenre, + subGenre, + country, + manufacturer, + year, + rating, + overview, + system, + manualfilename, + lastTimeLaunched, + launchcount, + isfolder, + external_id, + uppertitle, + tagdata, + categorydata, + gameInfoUrl + ) - VALUES ( - null, - '{0}', - '{1}', - '{2}', - '{3}', - '{4}', - '{5}', - '{6}', - '{7}', - '{8}', - '{9}', - '{10}', - '{11}', - '{12}', - '{13}', - '{14}', - '{15}', - '{16}', - '{17}', - '{18}', - '{19}', - '{20}' - )", - AppID, - ProgramUtils.Encode(Title), - ProgramUtils.Encode(Filename), - ProgramUtils.Encode(Filepath), - ProgramUtils.Encode(Imagefile), - ProgramUtils.Encode(MainGenre), - ProgramUtils.Encode(SubGenre), - Country, - ProgramUtils.Encode(Manufacturer), - strYear, - Rating, - ProgramUtils.Encode(Overview), - ProgramUtils.Encode(System_), - ProgramUtils.Encode(ManualFilename), - strLastLaunch, - strLaunchCount, - ProgramUtils.BooleanToStr(IsFolder), - ExtFileID, - ProgramUtils.Encode(Title.ToUpper()), - ProgramUtils.Encode(TagData), - ProgramUtils.Encode(CategoryData)); + VALUES + ( + null, + '" + AppID + @"', + '" + ProgramUtils.Encode(Title)+ @"', + '" + ProgramUtils.Encode(Filename)+ @"', + '" + ProgramUtils.Encode(Filepath)+ @"', + '" + ProgramUtils.Encode(Imagefile)+ @"', + '" + ProgramUtils.Encode(MainGenre)+ @"', + '" + ProgramUtils.Encode(SubGenre)+ @"', + '" + Country+ @"', + '" + ProgramUtils.Encode(Manufacturer)+ @"', + '" + strYear+ @"', + '" + Rating+ @"', + '" + ProgramUtils.Encode(Overview)+ @"', + '" + ProgramUtils.Encode(System_)+ @"', + '" + ProgramUtils.Encode(ManualFilename)+ @"', + '" + strLastLaunch+ @"', + '" + strLaunchCount+ @"', + '" + ProgramUtils.BooleanToStr(IsFolder)+ @"', + '" + ExtFileID+ @"', + '" + ProgramUtils.Encode(Title.ToUpper())+ @"', + '" + ProgramUtils.Encode(TagData)+ @"', + '" + ProgramUtils.Encode(CategoryData))+ @"', + '" + ProgramUtils.Encode(GameInfoURL)+ @"' + )"; // Log.Info("dw sql\n{0}", strSQL); sqlDB.Execute(strSQL); } @@ -656,118 +639,7 @@ } } - /* private void Insert() - { - string strLastLaunch = ""; - string strLaunchCount = ""; - string strYear = ""; - if (LastTimeLaunched != DateTime.MinValue) - { - strLastLaunch = String.Format("{0}", LastTimeLaunched); - } - if (LaunchCount > 0) - { - strLaunchCount = String.Format("{0}", LaunchCount); // poor man's inttostr :-) - } - if (Year > 0) - { - strYear = String.Format("{0}", Year); - } - - try - { - string strSQL = String.Format( - @" - INSERT INTO - tblFileItem ( - fileid, - appid, - title, - filename, - filepath, - imagefile, - genre, - genre2, - genre3, - genre4, - genre5, - country, - manufacturer, - year, - rating, - overview, - system, - manualfilename, - lastTimeLaunched, - launchcount, - isfolder, - external_id, - uppertitle, - tagdata, - categorydata - ) - - VALUES ( - null, - '{0}', - '{1}', - '{2}', - '{3}', - '{4}', - '{5}', - '{6}', - '{7}', - '{8}', - '{9}', - '{10}', - '{11}', - '{12}', - '{13}', - '{14}', - '{15}', - '{16}', - '{17}', - '{18}', - '{19}', - '{20}', - '{21}', - '{22}', - '{23}' - )", - AppID, - ProgramUtils.Encode(Title), - ProgramUtils.Encode(Filename), - ProgramUtils.Encode(Filepath), - ProgramUtils.Encode(Imagefile), - ProgramUtils.Encode(Genre), - ProgramUtils.Encode(Genre2), - ProgramUtils.Encode(Genre3), - ProgramUtils.Encode(Genre4), - ProgramUtils.Encode(Genre5), - Country, - ProgramUtils.Encode(Manufacturer), - strYear, - Rating, - ProgramUtils.Encode(Overview), - ProgramUtils.Encode(System_), - ProgramUtils.Encode(ManualFilename), - strLastLaunch, - strLaunchCount, - ProgramUtils.BooleanToStr(IsFolder), - ExtFileID, - ProgramUtils.Encode(Title.ToUpper()), - ProgramUtils.Encode(TagData), - ProgramUtils.Encode(CategoryData)); - // Log.Info("dw sql\n{0}", strSQL); - sqlDB.Execute(strSQL); - } - catch (SQLiteException ex) - { - Log.Info("programdatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace); - } - } - - */ + private void Update() { string strYear = ""; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |