From: <Sil...@us...> - 2010-05-04 13:18:26
|
Revision: 3572 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3572&view=rev Author: SilentException Date: 2010-05-04 13:18:18 +0000 (Tue, 04 May 2010) Log Message: ----------- Added message if clear recycle bin is unsuccessful (needs language xmls change) Reworked GUIDialogOperation a bit, removed / fixed obsolete MS thread methods Created and used general method for setting properties in DrivesView class When doing update of one view, second view is also updated if showing same drive/folder Unified dialog operations (Reset() and strings) Fixed loading of settings (using XmlConfig class instead of MediaPortal one) Skin changes: * GUIDialogOperation (FileExplorer_dialog.xml): controls 2,3,4 should be changed from label to fadelabel Modified Paths: -------------- trunk/plugins/File Explorer/Constants.cs trunk/plugins/File Explorer/Dialogs/GUIDialogOperation.cs trunk/plugins/File Explorer/DrivesView.cs trunk/plugins/File Explorer/ExceptionViewer.cs trunk/plugins/File Explorer/File Explorer.cs trunk/plugins/File Explorer/Language/strings_de.xml trunk/plugins/File Explorer/Language/strings_en.xml trunk/plugins/File Explorer/Language/strings_fr.xml trunk/plugins/File Explorer/Skin/Blue3/File Explorer_dialog.xml trunk/plugins/File Explorer/Skin/Blue3wide/File Explorer_dialog.xml trunk/plugins/File Explorer/Skin/BlueTwo/File Explorer_dialog.xml trunk/plugins/File Explorer/Skin/Xface/File Explorer_dialog.xml Modified: trunk/plugins/File Explorer/Constants.cs =================================================================== --- trunk/plugins/File Explorer/Constants.cs 2010-05-04 04:44:46 UTC (rev 3571) +++ trunk/plugins/File Explorer/Constants.cs 2010-05-04 13:18:18 UTC (rev 3572) @@ -173,7 +173,8 @@ DefaultFolderRight = 129, Browse = 130, EmptyRecycleBin = 131, - Confirm = 132 + Confirm = 132, + UnableToEmptyRecycleBin = 133 } #endregion @@ -411,6 +412,7 @@ public static readonly string REMOVEFLAGS = LocalizeStrings.Get((int)LocalizedMessages.RemoveFlags); public static readonly string SETREMOVEFLAG = LocalizeStrings.Get((int)LocalizedMessages.SetRemoveFlag); public static readonly string CHANGEFLAG = LocalizeStrings.Get((int)LocalizedMessages.ChangeFlag); + public static readonly string UNABLETOEMPTYRECYCLEBIN = LocalizeStrings.Get((int)LocalizedMessages.UnableToEmptyRecycleBin); } #endregion Modified: trunk/plugins/File Explorer/Dialogs/GUIDialogOperation.cs =================================================================== --- trunk/plugins/File Explorer/Dialogs/GUIDialogOperation.cs 2010-05-04 04:44:46 UTC (rev 3571) +++ trunk/plugins/File Explorer/Dialogs/GUIDialogOperation.cs 2010-05-04 13:18:18 UTC (rev 3572) @@ -69,44 +69,72 @@ private string to = string.Empty; private Thread processThread = null; + + readonly object pauseLock = new object(); + bool paused = false; #endregion #region skin vars - [SkinControlAttribute(2)] - private GUILabelControl lblHeading = null; - [SkinControlAttribute(3)] - private GUILabelControl lblText1 = null; - [SkinControlAttribute(4)] - private GUILabelControl lblText2 = null; + [SkinControlAttribute(2)] private GUIFadeLabel lblHeading = null; + [SkinControlAttribute(3)] private GUIFadeLabel lblText1 = null; + [SkinControlAttribute(4)] private GUIFadeLabel lblText2 = null; #endregion #region public members + + public bool Paused + { + get + { + return paused; + } + set + { + lock (pauseLock) + { + paused = true; + } + } + } + /// <summary> - /// Shows the dialog and waits until the user has closed it. + /// Shows the dialog and waits until the user has closed it. - Obsolete, not used /// </summary> /// <param name="parentID">Parentwindow id.</param> public void DoModal(int parentID) { this.parentID = parentID; - GUIWindow win = GUIWindowManager.GetWindow(parentID); + if (GUIWindowManager.GetWindow(parentID) == null) + { + this.parentID = 0; + return; + } GUIWindowManager.IsSwitchingToNewWindow = true; - GUIWindowManager.RouteToWindow(GetID); + try + { + GUIWindowManager.RouteToWindow(GetID); - // activate this window - GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, GetID, 0, 0, 0, 0, null); - OnMessage(msg); + // activate this window... + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, GetID, 0, 0, -1, 0, null); + OnMessage(msg); + } + finally + { + GUIWindowManager.IsSwitchingToNewWindow = false; + } - GUIWindowManager.IsSwitchingToNewWindow = false; - + GUILayerManager.RegisterLayer(this, GUILayerManager.LayerType.Dialog); running = true; while (running && GUIGraphicsContext.CurrentState == GUIGraphicsContext.State.RUNNING) { GUIWindowManager.Process(); } + + Close(); } - + /// <summary> /// Shows the dialog. /// </summary> @@ -115,20 +143,30 @@ { this.parentID = parentID; - GUIWindow win = GUIWindowManager.GetWindow(parentID); + if (GUIWindowManager.GetWindow(parentID) == null) + { + this.parentID = 0; + return; + } GUIWindowManager.IsSwitchingToNewWindow = true; - GUIWindowManager.RouteToWindow(GetID); + try + { + GUIWindowManager.RouteToWindow(GetID); - // activate this window - GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, GetID, 0, 0, 0, 0, null); - OnMessage(msg); + // activate this window + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, GetID, 0, 0, 0, 0, null); + OnMessage(msg); + } + finally + { + GUIWindowManager.IsSwitchingToNewWindow = false; + } - GUIWindowManager.IsSwitchingToNewWindow = false; + running = true; + GUIWindowManager.Process(); - running = true; - processThread = new Thread(new ThreadStart(this.ProcessThread)); processThread.Start(); } @@ -293,10 +331,12 @@ public void SetToPath(string path) { SuspendThread(); + /* if (path.Length > 30) { path = path.Substring(0, 3) + "..\\" + GetFilename(path); } + */ this.to = path; // lblText2.Label = "To: " + path; lblText2.Label = Constants.Dialog.TO + path; @@ -306,10 +346,12 @@ public void SetPath(string path) { SuspendThread(); + /* if (path.Length > 30) { path = path.Substring(0, 3) + "..\\" + GetFilename(path); } + */ // lblText2.Label = "Path: " + path; lblText2.Label = Constants.Dialog.PATH + path; ResumeThread(); @@ -344,20 +386,27 @@ #region private members private void ProcessThread() { - while (running) + while (running && GUIGraphicsContext.CurrentState == GUIGraphicsContext.State.RUNNING) { - GUIWindowManager.Process(); + if (!Paused) + { + //Log.Debug("Process in thread"); + GUIWindowManager.Process(); + } } } //fmu if someone know how to remove this obsolete m$soft method ? private void SuspendThread() { - processThread.Suspend(); + Paused = true; + //processThread.Suspend(); } + //fmu if someone know how to remove this obsolete m$soft method ? private void ResumeThread() { - processThread.Resume(); + Paused = false; + //processThread.Resume(); } private string GetFilename(string filePath) @@ -405,10 +454,11 @@ public override bool OnMessage(GUIMessage message) { - if (message.Message == GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT) + if (message.TargetWindowId == GetID && message.Message == GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT) { GUIWindowManager.IsSwitchingToNewWindow = true; + bool result = false; lock (this) { Dispose(); @@ -417,14 +467,24 @@ GUIWindowManager.UnRoute(); running = false; + + result = base.OnMessage(message); + + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, parentID, 0, 0, -1, 0, null); + OnMessage(msg); + //GUIWindowManager.ActivateWindow(parentID); + + parentID = 0; + } - GUIWindowManager.IsSwitchingToNewWindow = false; + return result; } - else if (message.Message == GUIMessage.MessageType.GUI_MSG_WINDOW_INIT) + else if (message.TargetWindowId == GetID && message.Message == GUIMessage.MessageType.GUI_MSG_WINDOW_INIT) { - base.OnMessage(message); + bool result = base.OnMessage(message); GUILayerManager.RegisterLayer(this, GUILayerManager.LayerType.Dialog); + return result; } return base.OnMessage(message); } @@ -443,7 +503,10 @@ public void RenderLayer(float timePassed) { - Render(timePassed); + if (running) + { + Render(timePassed); + } } #endregion } Modified: trunk/plugins/File Explorer/DrivesView.cs =================================================================== --- trunk/plugins/File Explorer/DrivesView.cs 2010-05-04 04:44:46 UTC (rev 3571) +++ trunk/plugins/File Explorer/DrivesView.cs 2010-05-04 13:18:18 UTC (rev 3572) @@ -400,15 +400,7 @@ cf += currentPath; // Setting property for skinners.. SetControlLabel does not work so well when using with FadeLabel with <wrapString> :/ - if (lstId == 3) - GUIPropertyManager.SetProperty("#FileExplorer.Left.CurrentDir", cf); - else if (lstId == 4) - GUIPropertyManager.SetProperty("#FileExplorer.Right.CurrentDir", cf); - else - { - GUIPropertyManager.SetProperty("#FileExplorer.Left.CurrentDir", " "); - GUIPropertyManager.SetProperty("#FileExplorer.Right.CurrentDir", " "); - } + SetFileExplorerProperty("CurrentDir", cf); GUIControl.SetControlLabel(winId, lblDirId, cf); } #endregion @@ -416,8 +408,15 @@ #region public members public void Update() { + Update(true); + } + + public void Update(bool updateSecondView) + { LoadPath(); FillListControl(); + if (updateSecondView && SecondView.currentDrive == currentDrive && SecondView.currentPath == currentPath) + SecondView.Update(false); } #region menu id constants @@ -685,8 +684,10 @@ if (!item.IsFolder) { - // dlg.SetHeading("Copy File \"" + item.Label + "\""); - dlg.SetHeading(Constants.Operation.COPYFILE + "\"" + item.Label + "\""); + // dlg.SetHeading("Copy File"); + dlg.SetHeading(Constants.Operation.COPYFILE); + // dlg.SetLine(1, item.Label); + dlg.SetLine(1, item.Label); // dlg.SetLine(2, "From: " + item.Path); dlg.SetLine(2, Constants.Operation.FROM + item.Path); // dlg.SetLine(3, "To: " + secondView.Path); @@ -701,10 +702,14 @@ } else { - // dlg.SetHeading("Copy Directory \"" + item.Label + "\""); - dlg.SetHeading(Constants.Operation.COPYDIR + "\"" + item.Label + "\""); - // dlg.SetLine(2, "To: " + secondView.Path); - dlg.SetLine(2, Constants.Dialog.TO + secondView.Path); // already defined in Dialog + // dlg.SetHeading("Copy Directory"); + dlg.SetHeading(Constants.Operation.COPYDIR); + // dlg.SetLine(1, item.Label); + dlg.SetLine(1, item.Label); + // dlg.SetLine(2, "From: " + item.Path); + dlg.SetLine(2, Constants.Operation.FROM + item.Path); + // dlg.SetLine(3, "To: " + secondView.Path); + dlg.SetLine(3, Constants.Dialog.TO + secondView.Path); // already defined in Dialog dlg.DoModal(GUIWindowManager.ActiveWindow); if (dlg.IsConfirmed) @@ -825,11 +830,13 @@ if (!item.IsFolder) { - // dlg.SetHeading("Move File \"" + item.Label + "\""); - dlg.SetHeading(Constants.Operation.MOVEFILE + "\"" + item.Label + "\""); - // dlg.SetLine(2, "From: " + item.Path); + // dlg.SetHeading("Move File"); + dlg.SetHeading(Constants.Operation.MOVEFILE); + // dlg.SetLine(1, item.Label); + dlg.SetLine(1, item.Label); + // dlg.SetLine(2, "From: " + item.Path); dlg.SetLine(2, Constants.Operation.FROM + item.Path); - // dlg.SetLine(3, "To: " + secondView.Path); + // dlg.SetLine(3, "To: " + secondView.Path); dlg.SetLine(3, Constants.Dialog.TO + secondView.Path); // already defined in Dialog dlg.DoModal(GUIWindowManager.ActiveWindow); @@ -842,10 +849,14 @@ } else { - // dlg.SetHeading("Move Directory \"" + item.Label + "\""); - dlg.SetHeading(Constants.Operation.MOVEDIR + "\"" + item.Label + "\""); - // dlg.SetLine(2, "To: " + secondView.Path); - dlg.SetLine(2, Constants.Dialog.TO + secondView.Path); // already defined in Dialog + // dlg.SetHeading("Move Directory"); + dlg.SetHeading(Constants.Operation.MOVEDIR); + // dlg.SetLine(1, item.Label); + dlg.SetLine(1, item.Label); + // dlg.SetLine(2, "From: " + item.Path); + dlg.SetLine(2, Constants.Operation.FROM + item.Path); + // dlg.SetLine(3, "To: " + secondView.Path); + dlg.SetLine(3, Constants.Dialog.TO + secondView.Path); // already defined in Dialog dlg.DoModal(GUIWindowManager.ActiveWindow); if (dlg.IsConfirmed) @@ -883,11 +894,11 @@ if (System.IO.File.Exists(dest)) { GUIDialogYesNo dlg = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + dlg.Reset(); /* dlg.SetHeading("Moving file"); dlg.SetLine(1, "The file \"" + GetFilename(src) + "\""); dlg.SetLine(2, "alread exists!"); dlg.SetLine(3, "Do you want to overwrite it?"); */ - dlg.Reset(); dlg.SetHeading(Constants.Operation.MOVINGFILE); dlg.SetLine(1, Constants.Operation.THEFILE + "\"" + GetFilename(src) + "\""); dlg.SetLine(2, Constants.Operation.ALREADYEXIST); @@ -915,11 +926,11 @@ if (System.IO.Directory.Exists(dest)) { GUIDialogYesNo dlg = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + dlg.Reset(); /* dlg.SetHeading("Moving directory"); dlg.SetLine(1, "The directory \"" + GetFilename(dest) + "\""); dlg.SetLine(2, "alread exists!"); dlg.SetLine(3, "Do you want to overwrite it?"); */ - dlg.Reset(); dlg.SetHeading(Constants.Operation.MOVINGDIR); dlg.SetLine(1, Constants.Operation.THEDIR + "\"" + GetFilename(dest) + "\""); dlg.SetLine(2, Constants.Operation.ALREADYEXIST); @@ -986,13 +997,13 @@ if (item.IsFolder) { GUIDialogYesNo dlg = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + dlg.Reset(); /* dlg.SetHeading("Delete directory"); dlg.SetLine(1, "Do you really want to delete"); dlg.SetLine(2, "the directory \"" + item.Label + "\"?"); */ - dlg.Reset(); dlg.SetHeading(Constants.Operation.DELETEDIR); dlg.SetLine(1, Constants.Operation.WANTDELETE); - dlg.SetLine(2, Constants.Operation.THEDIR + "\"" + item.Label + "\"?"); + dlg.SetLine(2, LowercaseFirst(Constants.Operation.THEDIR) + "\"" + item.Label + "\"?"); dlg.SetLine(3, " "); dlg.DoModal(GUIWindowManager.ActiveWindow); @@ -1001,14 +1012,14 @@ if ((b) && (!this.DeleteFilesToTrashcan)) { dlg = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + dlg.Reset(); /* dlg.SetHeading("Delete directory"); dlg.SetLine(1, "Do you really want to delete"); dlg.SetLine(2, "the directory \"" + item.Label + "\"?"); dlg.SetLine(3, "After deleting the directory CANNOT BE RESTORED!"); */ - dlg.Reset(); dlg.SetHeading(Constants.Operation.DELETEDIR); dlg.SetLine(1, Constants.Operation.WANTDELETE); - dlg.SetLine(2, Constants.Operation.THEDIR + "\"" + item.Label + "\"?"); + dlg.SetLine(2, LowercaseFirst(Constants.Operation.THEDIR) + "\"" + item.Label + "\"?"); dlg.SetLine(3, Constants.Operation.AFTERDELETE); dlg.DoModal(GUIWindowManager.ActiveWindow); @@ -1027,10 +1038,10 @@ else { GUIDialogYesNo dlg = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + dlg.Reset(); /* dlg.SetHeading("Delete file"); dlg.SetLine(1, "Do you really want to delete"); dlg.SetLine(2, "the file \"" + item.Label + "\"?"); */ - dlg.Reset(); dlg.SetHeading(Constants.Operation.DELETEFILE); dlg.SetLine(1, Constants.Operation.WANTDELETE); dlg.SetLine(2, Constants.Operation.THEFILE + "\"" + item.Label + "\"?"); @@ -1042,11 +1053,11 @@ if ((b) && (!this.DeleteFilesToTrashcan)) { dlg = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + dlg.Reset(); /* dlg.SetHeading("Delete file"); dlg.SetLine(1, "Do you really want to delete"); dlg.SetLine(2, "the file \"" + item.Label + "\"?"); dlg.SetLine(3, "After deleting the file CANNOT BE RESTORED!"); */ - dlg.Reset(); dlg.SetHeading(Constants.Operation.DELETEFILE); dlg.SetLine(1, Constants.Operation.WANTDELETE); dlg.SetLine(2, Constants.Operation.THEFILE + "\"" + item.Label + "\"?"); @@ -1188,10 +1199,11 @@ catch (Exception) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); // dlg.SetHeading("Error"); // dlg.SetLine(2, "Cannot rename directory \"" + item.Label + "\"!"); dlg.SetHeading(Constants.Operation.ERROR); - dlg.SetLine(2, Constants.Operation.CANTRENAMEDIR + "\"" + item.Label + "\"!"); + dlg.SetLine(1, Constants.Operation.CANTRENAMEDIR + "\"" + item.Label + "\"!"); dlg.DoModal(GUIWindowManager.ActiveWindow); } @@ -1212,10 +1224,11 @@ catch (Exception) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); // dlg.SetHeading("Error"); // dlg.SetLine(2, "Cannot rename file \"" + item.Label + "\"!"); dlg.SetHeading(Constants.Operation.ERROR); - dlg.SetLine(2, Constants.Operation.CANTRENAMEFILE + "\"" + item.Label + "\"!"); + dlg.SetLine(1, Constants.Operation.CANTRENAMEFILE + "\"" + item.Label + "\"!"); dlg.DoModal(GUIWindowManager.ActiveWindow); } @@ -1247,10 +1260,11 @@ catch (Exception) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); // dlg.SetHeading("Error"); // dlg.SetLine(2, "Cannot create the directory \"" + keyboard.Text + "\"!"); dlg.SetHeading(Constants.Operation.ERROR); - dlg.SetLine(2, Constants.Operation.CANTCREATEDIR + "\"" + keyboard.Text + "\"!"); + dlg.SetLine(1, Constants.Operation.CANTCREATEDIR + "\"" + keyboard.Text + "\"!"); dlg.DoModal(GUIWindowManager.ActiveWindow); } } @@ -1415,11 +1429,11 @@ if (info.Path.Name.Equals(item.Label)) { GUIDialogYesNo dlg = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + dlg.Reset(); /* dlg.SetHeading("Encrypton/Decryption"); dlg.SetLine(1, "Do you wish to change the encryption status"); dlg.SetLine(2, "for all subdirectories and files in current"); dlg.SetLine(3, "folder?"); */ - dlg.Reset(); dlg.SetHeading(Constants.Operation.ENCRYPTDECRYPT); dlg.SetLine(1, Constants.Operation.CHANGEENCRYPT); dlg.SetLine(2, Constants.Operation.ALLSUBDIR); @@ -1569,11 +1583,11 @@ if (info.Path.Name.Equals(item.Label)) { GUIDialogYesNo dlg = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + dlg.Reset(); /* dlg.SetHeading("Compress/Uncompress"); dlg.SetLine(1, "Do you wish to change the compression status"); dlg.SetLine(2, "for all subdirectories and files in current"); dlg.SetLine(3, "folder?"); */ - dlg.Reset(); dlg.SetHeading(Constants.View.COMPRESS3); dlg.SetLine(1, Constants.Operation.CHANGECOMPRESS); dlg.SetLine(2, Constants.Operation.ALLSUBDIR); @@ -1713,11 +1727,11 @@ if (info.Path.Name.Equals(item.Label)) { GUIDialogYesNo dlg = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + dlg.Reset(); /* dlg.SetHeading("Hide/Unhide"); dlg.SetLine(1, "Do you wish to change the hide status"); dlg.SetLine(2, "for all subdirectories and files in current"); dlg.SetLine(3, "folder?"); */ - dlg.Reset(); dlg.SetHeading(Constants.View.HIDEUNHIDE); dlg.SetLine(1, Constants.Operation.CHANGEHIDE); dlg.SetLine(2, Constants.Operation.ALLSUBDIR); @@ -1868,11 +1882,11 @@ if (info.Path.Name.Equals(item.Label)) { GUIDialogYesNo dlg = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + dlg.Reset(); /* dlg.SetHeading("Set/Remove readonly flag"); dlg.SetLine(1, "Do you wish to change the readonly flag"); dlg.SetLine(2, "for all subdirectories and files in current"); dlg.SetLine(3, "folder?"); */ - dlg.Reset(); dlg.SetHeading(Constants.Operation.SETREMOVEFLAG); dlg.SetLine(1, Constants.Operation.CHANGEFLAG); dlg.SetLine(2, Constants.Operation.ALLSUBDIR); @@ -1950,10 +1964,10 @@ GUIListItem item = GUIControl.GetSelectedListItem(winId, lstId); GUIDialogYesNo dlg = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + dlg.Reset(); /* dlg.SetHeading("Create Audio Playlist"); dlg.SetLine(1, "Would you like to include all audio files of"); dlg.SetLine(2, "the current folder's subdirectories?"); */ - dlg.Reset(); dlg.SetHeading(Constants.Dialog.CREATEAUDIO); dlg.SetLine(1, Constants.Playlist.INCLUDEAUDIOFILES); dlg.SetLine(2, Constants.Playlist.CURRENTFOLDERSUBDIR); @@ -2008,6 +2022,7 @@ if (lstFiles.Count == 0) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); /* dlg.SetHeading("Create Audio Playlist"); dlg.SetLine(1, "No audio files found!"); */ dlg.SetHeading(Constants.Dialog.CREATEAUDIO); @@ -2074,6 +2089,7 @@ if (lstFiles.Count == 0) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); /* dlg.SetHeading("Create Audio Playlist"); dlg.SetLine(1, "No audio files found!"); */ dlg.SetHeading(Constants.Dialog.CREATEAUDIO); @@ -2111,10 +2127,10 @@ GUIListItem item = GUIControl.GetSelectedListItem(winId, lstId); GUIDialogYesNo dlg = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + dlg.Reset(); /* dlg.SetHeading("Create Video Playlist"); dlg.SetLine(1, "Would you like to include all video files of"); dlg.SetLine(2, "the current folder's subdirectories?"); */ - dlg.Reset(); dlg.SetHeading(Constants.Dialog.CREATEVIDEO); dlg.SetLine(1, Constants.Playlist.INCLUDEVIDEOFILES); dlg.SetLine(2, Constants.Playlist.CURRENTFOLDERSUBDIR); @@ -2169,6 +2185,7 @@ if (lstFiles.Count == 0) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); /* dlg.SetHeading("Create Video Playlist"); dlg.SetLine(1, "No video files found!"); */ dlg.SetHeading(Constants.Dialog.CREATEVIDEO); @@ -2234,6 +2251,7 @@ if (lstFiles.Count == 0) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); /* dlg.SetHeading("Create Video Playlist"); dlg.SetLine(1, "No video files found!"); */ dlg.SetHeading(Constants.Dialog.CREATEVIDEO); @@ -2269,6 +2287,7 @@ if (files.Length == 0) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); /* dlg.SetHeading("No playlists found"); dlg.SetLine(1, "No playlists found in directory"); */ dlg.SetHeading(Constants.Playlist.NOPLAYLIST); @@ -2307,6 +2326,7 @@ if (lstFiles.Count == 0) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); /* dlg.SetHeading("Add to Audio Playlist"); dlg.SetLine(1, "No audio files found!"); */ dlg.SetHeading(Constants.Dialog.ADDAUDIO); @@ -2341,6 +2361,7 @@ if (files.Length == 0) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); /* dlg.SetHeading("No playlists found"); dlg.SetLine(1, "No playlists found in directory"); */ dlg.SetHeading(Constants.Playlist.NOPLAYLIST); @@ -2395,6 +2416,7 @@ if (lstFiles.Count == 0) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); /* dlg.SetHeading("Create Audio Playlist"); dlg.SetLine(1, "No audio files found!"); */ dlg.SetHeading(Constants.Dialog.CREATEAUDIO); @@ -2425,6 +2447,7 @@ if (files.Length == 0) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); /* dlg.SetHeading("No playlists found"); dlg.SetLine(1, "No playlists found in directory"); */ dlg.SetHeading(Constants.Playlist.NOPLAYLIST); @@ -2463,6 +2486,7 @@ if (lstFiles.Count == 0) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); /* dlg.SetHeading("Add to Video Playlist"); dlg.SetLine(1, "No video files found!"); */ dlg.SetHeading(Constants.Dialog.ADDVIDEO); @@ -2497,6 +2521,7 @@ if (files.Length == 0) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); /* dlg.SetHeading("No playlists found"); dlg.SetLine(1, "No playlists found in directory"); */ dlg.SetHeading(Constants.Playlist.NOPLAYLIST); @@ -2551,6 +2576,7 @@ if (lstFiles.Count == 0) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); /* dlg.SetHeading("Create Video Playlist"); dlg.SetLine(1, "No video files found!"); */ dlg.SetHeading(Constants.Dialog.CREATEVIDEO); @@ -2599,6 +2625,14 @@ catch (Exception ex) { Log.Error("File Explorer: Unable to clear Recycle Bin: " + ex.Message); + + GUIDialogOK dlgOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlgOK.Reset(); + // dlg.SetHeading("Error"); + // dlg.SetLine(2, "Unable to empty Recycle Bin + "!"); + dlgOK.SetHeading(Constants.Operation.ERROR); + dlgOK.SetLine(1, Constants.Operation.UNABLETOEMPTYRECYCLEBIN + "!"); + dlgOK.DoModal(GUIWindowManager.ActiveWindow); } } @@ -2926,6 +2960,44 @@ #endregion #region Utils + private void SetFileExplorerProperty(string propertyName, string propertyValue) + { + if (string.IsNullOrEmpty(propertyValue)) + propertyValue = " "; + + if (lstId == Constants.ControlIDs.LISTBOX_LEFT) + GUIPropertyManager.SetProperty("#FileExplorer.Left." + propertyName, propertyValue); + if (lstId == Constants.ControlIDs.LISTBOX_RIGHT) + GUIPropertyManager.SetProperty("#FileExplorer.Right." + propertyName, propertyValue); + else + { + GUIPropertyManager.SetProperty("#FileExplorer.Left." + propertyName, " "); + GUIPropertyManager.SetProperty("#FileExplorer.Right." + propertyName, " "); + } + } + + private string UppercaseFirst(string s) + { + // Check for empty string. + if (string.IsNullOrEmpty(s)) + { + return string.Empty; + } + // Return char and concat substring. + return char.ToUpper(s[0]) + s.Substring(1); + } + + private string LowercaseFirst(string s) + { + // Check for empty string. + if (string.IsNullOrEmpty(s)) + { + return string.Empty; + } + // Return char and concat substring. + return char.ToLower(s[0]) + s.Substring(1); + } + private bool IsSystemAttribute(System.IO.FileAttributes a) { return ((System.IO.FileAttributes.System & a) == System.IO.FileAttributes.System); @@ -3238,15 +3310,7 @@ set { selectionMode = value; - if (lstId == 3) - GUIPropertyManager.SetProperty("#FileExplorer.Left.SelectionMode", value.ToString()); - else if (lstId == 4) - GUIPropertyManager.SetProperty("#FileExplorer.Right.SelectionMode", value.ToString()); - else - { - GUIPropertyManager.SetProperty("#FileExplorer.Left.SelectionMode", " "); - GUIPropertyManager.SetProperty("#FileExplorer.Right.SelectionMode", " "); - } + SetFileExplorerProperty("SelectionMode", value.ToString()); } } #endregion Modified: trunk/plugins/File Explorer/ExceptionViewer.cs =================================================================== --- trunk/plugins/File Explorer/ExceptionViewer.cs 2010-05-04 04:44:46 UTC (rev 3571) +++ trunk/plugins/File Explorer/ExceptionViewer.cs 2010-05-04 13:18:18 UTC (rev 3572) @@ -68,6 +68,7 @@ public static void ShowDialog(string msg) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); // dlg.SetHeading("Exception"); dlg.SetHeading(Constants.Exceptions.EXCEPTION); dlg.SetLine(2, msg); @@ -77,6 +78,7 @@ public static void ShowDialog(string msg1, string msg2) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.Reset(); // dlg.SetHeading("Exception"); dlg.SetHeading(Constants.Exceptions.EXCEPTION); dlg.SetLine(1, msg1); Modified: trunk/plugins/File Explorer/File Explorer.cs =================================================================== --- trunk/plugins/File Explorer/File Explorer.cs 2010-05-04 04:44:46 UTC (rev 3571) +++ trunk/plugins/File Explorer/File Explorer.cs 2010-05-04 13:18:18 UTC (rev 3572) @@ -169,14 +169,23 @@ viewLeft.SecondView = viewRight; viewRight.SecondView = viewLeft; - // Settings s = new Settings("FileExplorer.xml"); + /* Settings s = new Settings(Config.GetFile(Config.Dir.Config, "File Explorer.xml")); viewLeft.ShowExtensions = s.GetValueAsBool("File Explorer", Constants.SetupForm.valueNames[0], Constants.SetupForm.valueStandards[0]); viewLeft.DeleteFilesToTrashcan = s.GetValueAsBool("File Explorer", Constants.SetupForm.valueNames[1], Constants.SetupForm.valueStandards[1]); viewLeft.ShowAllFiles = s.GetValueAsBool("File Explorer", Constants.SetupForm.valueNames[2], Constants.SetupForm.valueStandards[2]); viewLeft.ShowSystemFiles = s.GetValueAsBool("File Explorer", Constants.SetupForm.valueNames[3], Constants.SetupForm.valueStandards[3]); viewLeft.ShowSystemDirs = s.GetValueAsBool("File Explorer", Constants.SetupForm.valueNames[4], Constants.SetupForm.valueStandards[4]); + */ + XmlConfig XmlConfig = new XmlConfig(); + + viewLeft.ShowExtensions = XmlConfig.ReadXmlConfig("File Explorer", "explorer", Constants.SetupForm.valueNames[0], Constants.SetupForm.valueStandards[0]); + viewLeft.DeleteFilesToTrashcan = XmlConfig.ReadXmlConfig("File Explorer", "explorer", Constants.SetupForm.valueNames[1], Constants.SetupForm.valueStandards[1]); + viewLeft.ShowAllFiles = XmlConfig.ReadXmlConfig("File Explorer", "explorer", Constants.SetupForm.valueNames[2], Constants.SetupForm.valueStandards[2]); + viewLeft.ShowSystemFiles = XmlConfig.ReadXmlConfig("File Explorer", "explorer", Constants.SetupForm.valueNames[3], Constants.SetupForm.valueStandards[3]); + viewLeft.ShowSystemDirs = XmlConfig.ReadXmlConfig("File Explorer", "explorer", Constants.SetupForm.valueNames[4], Constants.SetupForm.valueStandards[4]); + viewRight.ShowExtensions = viewLeft.ShowExtensions; viewRight.DeleteFilesToTrashcan = viewLeft.DeleteFilesToTrashcan; viewRight.ShowAllFiles = viewLeft.ShowAllFiles; Modified: trunk/plugins/File Explorer/Language/strings_de.xml =================================================================== --- trunk/plugins/File Explorer/Language/strings_de.xml 2010-05-04 04:44:46 UTC (rev 3571) +++ trunk/plugins/File Explorer/Language/strings_de.xml 2010-05-04 13:18:18 UTC (rev 3572) @@ -134,5 +134,6 @@ <String id="130">Auswahl</String> <String id="131">Empty Recycle Bin</String> <String id="132">Confirm</String> + <String id="133">Unable to empty Recycle Bin</String> </Section> </Language> \ No newline at end of file Modified: trunk/plugins/File Explorer/Language/strings_en.xml =================================================================== --- trunk/plugins/File Explorer/Language/strings_en.xml 2010-05-04 04:44:46 UTC (rev 3571) +++ trunk/plugins/File Explorer/Language/strings_en.xml 2010-05-04 13:18:18 UTC (rev 3572) @@ -134,5 +134,6 @@ <String id="130">Browse</String> <String id="131">Empty Recycle Bin</String> <String id="132">Confirm</String> + <String id="133">Unable to empty Recycle Bin</String> </Section> </Language> \ No newline at end of file Modified: trunk/plugins/File Explorer/Language/strings_fr.xml =================================================================== --- trunk/plugins/File Explorer/Language/strings_fr.xml 2010-05-04 04:44:46 UTC (rev 3571) +++ trunk/plugins/File Explorer/Language/strings_fr.xml 2010-05-04 13:18:18 UTC (rev 3572) @@ -134,5 +134,6 @@ <String id="130">Rechercher</String> <String id="131">Vider la Corbeille</String> <String id="132">Confirmer</String> + <String id="133">Unable to empty Recycle Bin</String> </Section> </Language> \ No newline at end of file Modified: trunk/plugins/File Explorer/Skin/Blue3/File Explorer_dialog.xml =================================================================== --- trunk/plugins/File Explorer/Skin/Blue3/File Explorer_dialog.xml 2010-05-04 04:44:46 UTC (rev 3571) +++ trunk/plugins/File Explorer/Skin/Blue3/File Explorer_dialog.xml 2010-05-04 13:18:18 UTC (rev 3572) @@ -14,7 +14,7 @@ </control> <control> <description>dialog Heading</description> - <type>label</type> + <type>fadelabel</type> <id>2</id> <posX>190</posX> <posY>230</posY> @@ -24,7 +24,7 @@ </control> <control> <description>dialog line 1</description> - <type>label</type> + <type>fadelabel</type> <id>3</id> <posX>190</posX> <posY>260</posY> @@ -34,7 +34,7 @@ </control> <control> <description>dialog line 2</description> - <type>label</type> + <type>fadelabel</type> <id>4</id> <posX>190</posX> <posY>280</posY> Modified: trunk/plugins/File Explorer/Skin/Blue3wide/File Explorer_dialog.xml =================================================================== --- trunk/plugins/File Explorer/Skin/Blue3wide/File Explorer_dialog.xml 2010-05-04 04:44:46 UTC (rev 3571) +++ trunk/plugins/File Explorer/Skin/Blue3wide/File Explorer_dialog.xml 2010-05-04 13:18:18 UTC (rev 3572) @@ -14,7 +14,7 @@ </control> <control> <description>dialog Heading</description> - <type>label</type> + <type>fadelabel</type> <id>2</id> <posX>190</posX> <posY>230</posY> @@ -24,7 +24,7 @@ </control> <control> <description>dialog line 1</description> - <type>label</type> + <type>fadelabel</type> <id>3</id> <posX>190</posX> <posY>260</posY> @@ -34,7 +34,7 @@ </control> <control> <description>dialog line 2</description> - <type>label</type> + <type>fadelabel</type> <id>4</id> <posX>190</posX> <posY>280</posY> Modified: trunk/plugins/File Explorer/Skin/BlueTwo/File Explorer_dialog.xml =================================================================== --- trunk/plugins/File Explorer/Skin/BlueTwo/File Explorer_dialog.xml 2010-05-04 04:44:46 UTC (rev 3571) +++ trunk/plugins/File Explorer/Skin/BlueTwo/File Explorer_dialog.xml 2010-05-04 13:18:18 UTC (rev 3572) @@ -14,7 +14,7 @@ </control> <control> <description>dialog Heading</description> - <type>label</type> + <type>fadelabel</type> <id>2</id> <posX>190</posX> <posY>230</posY> @@ -24,7 +24,7 @@ </control> <control> <description>dialog line 1</description> - <type>label</type> + <type>fadelabel</type> <id>3</id> <posX>190</posX> <posY>260</posY> @@ -34,7 +34,7 @@ </control> <control> <description>dialog line 2</description> - <type>label</type> + <type>fadelabel</type> <id>4</id> <posX>190</posX> <posY>280</posY> Modified: trunk/plugins/File Explorer/Skin/Xface/File Explorer_dialog.xml =================================================================== --- trunk/plugins/File Explorer/Skin/Xface/File Explorer_dialog.xml 2010-05-04 04:44:46 UTC (rev 3571) +++ trunk/plugins/File Explorer/Skin/Xface/File Explorer_dialog.xml 2010-05-04 13:18:18 UTC (rev 3572) @@ -14,7 +14,7 @@ </control> <control> <description>dialog Heading</description> - <type>label</type> + <type>fadelabel</type> <id>2</id> <posX>190</posX> <posY>230</posY> @@ -24,7 +24,7 @@ </control> <control> <description>dialog line 1</description> - <type>label</type> + <type>fadelabel</type> <id>3</id> <posX>190</posX> <posY>260</posY> @@ -34,7 +34,7 @@ </control> <control> <description>dialog line 2</description> - <type>label</type> + <type>fadelabel</type> <id>4</id> <posX>190</posX> <posY>280</posY> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |