From: <nic...@us...> - 2014-05-04 16:34:32
|
Revision: 4795 http://sourceforge.net/p/mp-plugins/code/4795 Author: nicsergio Date: 2014-05-04 16:34:28 +0000 (Sun, 04 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Common.Utils.dll trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Core.dll trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Utils.dll trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Added Paths: ----------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Common.Utils.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Core.dll =================================================================== (Binary files differ) Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll =================================================================== (Binary files differ) Index: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll 2014-05-04 16:34:28 UTC (rev 4795) Property changes on: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Utils.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-04 16:34:28 UTC (rev 4795) @@ -26,14 +26,15 @@ { MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin started")); + string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); + myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts + myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //--> sottoscrizione evento di log shortuts + if (LockKeys.ChangeCapsLock(myShortCuts.GeneralForcingCapsLock)) MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "CapsLock " + ((myShortCuts.GeneralForcingCapsLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); if (LockKeys.ChangeNumLock(myShortCuts.GeneralForcingNumLock)) - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "NumLock " + ((myShortCuts.GeneralForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); - - string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); - myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts - myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //--> sottoscrizione evento di log shortuts + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "NumLock " + ((myShortCuts.GeneralForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); + if (myShortCuts.Initialize()) //Inizializzazione & lettura impostazioni shorcuts { try Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-04 16:34:28 UTC (rev 4795) @@ -52,6 +52,10 @@ <SpecificVersion>False</SpecificVersion> <HintPath>ExternalResources\Core.dll</HintPath> </Reference> + <Reference Include="Dialogs, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>ExternalResources\Dialogs.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Deployment" /> @@ -173,6 +177,7 @@ </BootstrapperPackage> </ItemGroup> <ItemGroup> + <Content Include="ExternalResources\Dialogs.dll" /> <Content Include="Resources\Images\SkinNav.png" /> <Content Include="Resources\Images\SkinNavAdd.png" /> <EmbeddedResource Include="Resources\XmlFiles\DefaultConfig.xml"> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-04 16:34:28 UTC (rev 4795) @@ -311,12 +311,17 @@ } void idTextBox_KeyPress(object sender, KeyPressEventArgs e) { - if (!(char.IsDigit(e.KeyChar))) //Filtro per input numerico per la cella WindowID + if ((int)shortCutsDataGridView.CurrentCell.Value <= 0) //Se WindowID negativo (possibile solo con Skin Navigator) + e.Handled = true; //--> carattere inputato da ignorare + else { - Keys key = (Keys)e.KeyChar; - if (!(key == Keys.Back || key == Keys.Delete)) + if (!(char.IsDigit(e.KeyChar))) //Filtro per input numerico per la cella WindowID { - e.Handled = true; //--> carattere inputato da ignorare + Keys key = (Keys)e.KeyChar; + if (!(key == Keys.Back || key == Keys.Delete)) + { + e.Handled = true; //--> carattere inputato da ignorare + } } } } @@ -381,7 +386,11 @@ } private void skinNavAddButton_Click(object sender, EventArgs e) { - + ShortCut sc = new ShortCut(true); + myShortCuts.Items.Add(sc); + shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, shortCutsDataGridView.RowCount - 1]; + shortCutsDataGridView.Rows[shortCutsDataGridView.RowCount - 1].Selected = true; + skinNavAddButton.Enabled = false; } private void rowUpButton_Click(object sender, EventArgs e) { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-04 16:34:28 UTC (rev 4795) @@ -11,6 +11,7 @@ using MediaPortal.Player; using MediaPortal.Profile; using MediaPortal.Util; +using MediaPortal.Dialogs; namespace ProcessPlugins.ShortCuter { @@ -168,7 +169,7 @@ #endregion #region Proprietà - public bool IsValid { get { return (this._windowID > InvalidID) ; } } + public bool IsValid { get { return (this._windowID > InvalidID || this.IsNavigator) ; } } public bool IsNavigator { get { return (this._windowID == NavigatorID); } } public string Caption { get { return this._caption; } set { this._caption = value; } } public int WindowID { get { return this._windowID; } set { this._windowID = value; } } @@ -255,11 +256,12 @@ #endregion #region Costruttore - public ShortCut() //Costruttore classe ShortCut + public ShortCut() : this(false) { } //Costruttore classe ShortCut (senza argomenti) + public ShortCut(bool skinNavigator) //Costruttore classe ShortCut { - _caption = "ShortCut"; //--> inizializzazione titolo + _caption = (skinNavigator ? "Skin Navigator" : "ShortCut"); //--> inizializzazione titolo _keys = new KeyCombination(); //--> istanziazione classe KeyCombination - _destination = new WindowLink(); //--> istanziazione classe WindowLink + _destination = new WindowLink(skinNavigator); //--> istanziazione classe WindowLink _destination.Caption = ""; //--> reset caption destinazione (gestita caption shortcut) _return = false; //--> inizializzazione ritorno a finestra precedente se si è già a destinazione _soundEffect = "click.wav"; //--> inizializzazione effetto sonoro @@ -330,7 +332,8 @@ #endregion #region Proprietà - public bool IsValid { get { return this._keys.IsValid && _destination.IsValid; } } + public bool IsValid { get { return this._destination.IsValid && this._keys.IsValid; } } + public bool IsNavigator { get { return this._destination.IsNavigator; } } public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } public string Key { get { return this._keys.Key; } set { this._keys.Key = value; this.NotifyPropertyChanged("Key"); } } public bool Ctrl { get { return this._keys.Ctrl; } set { this._keys.Ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } @@ -629,33 +632,52 @@ List<ShortCut> scList = GetShortCutsGroup(k); //--> raccolta lista shortcut associati alla combinazione di tasti attuale if (scList != null && scList.Count > 0) //Se trovato almeno uno shortcut { - if (scList.Count == 1) //Shortcut a destinazione singola + if (scList.Find(x => x.IsNavigator) != null) //Se combinazione di tasti corrispondente a Skin Navigator { - if (scList[0].Return && AlreadyAtDestination(scList[0])) //Se impostato flag di ritorno e finestra attuale corrispondente a destinazione - scList[0].GoPrevious(Log); //--> visualizzazione finestra precedente - else - if (scList[0].Go(Log)) //--> visualizzazione finestra di destinazione shortcut - { - lastDestination.WindowID = scList[0].WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = scList[0].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } + + + GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + dlgMenu.Reset(); + dlgMenu.SetHeading("Skin Navigator"); + dlgMenu.ShowQuickNumbers = false; + + dlgMenu.Add("tega"); + dlgMenu.Add("nanda"); + + dlgMenu.DoModal((int)GUIWindowManager.ActiveWindow); + //if (dlgMenu.SelectedLabel >= 0) + } - else //Shortcut a destinazione multipla (ciclico) + else //Shortcuts normali { - int scIndex = 0; - for (int i = 0; i < scList.Count; i++) //Iterazione di verifica se la finestra attuale corrisponde ad una delle destinazioni + if (scList.Count == 1) //Shortcut a destinazione singola { - if (AlreadyAtDestination(scList[i])) + if (scList[0].Return && AlreadyAtDestination(scList[0])) //Se impostato flag di ritorno e finestra attuale corrispondente a destinazione + scList[0].GoPrevious(Log); //--> visualizzazione finestra precedente + else + if (scList[0].Go(Log)) //--> visualizzazione finestra di destinazione shortcut + { + lastDestination.WindowID = scList[0].WindowID; //--> memorizzazione id finestra + lastDestination.LoadParameter = scList[0].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati + } + } + else //Shortcut a destinazione multipla (ciclico) + { + int scIndex = 0; + for (int i = 0; i < scList.Count; i++) //Iterazione di verifica se la finestra attuale corrisponde ad una delle destinazioni { - scIndex = (i + 1) % scList.Count; //--> impostazione indice shortcut successivo - break; + if (AlreadyAtDestination(scList[i])) + { + scIndex = (i + 1) % scList.Count; //--> impostazione indice shortcut successivo + break; + } } + if (scList[scIndex].Go(Log)) //--> visualizzazione finestra di destinazione shortcut + { + lastDestination.WindowID = scList[scIndex].WindowID; //--> memorizzazione id finestra + lastDestination.LoadParameter = scList[scIndex].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati + } } - if (scList[scIndex].Go(Log)) //--> visualizzazione finestra di destinazione shortcut - { - lastDestination.WindowID = scList[scIndex].WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = scList[scIndex].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } } } else //Combinazione di tasti non corrispondente a nessuno shortcut This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |