diff --git a/Frame/Frame.Options.Hotkey.lfm b/Frame/Frame.Options.Hotkey.lfm index ef235bde..0acbe133 100644 --- a/Frame/Frame.Options.Hotkey.lfm +++ b/Frame/Frame.Options.Hotkey.lfm @@ -33,9 +33,9 @@ inherited frmHotkeyOptionsPage: TfrmHotkeyOptionsPage Width = 425 BorderSpacing.Bottom = 4 Caption = 'Enable hotkeys' - OnClick = cbHotKeyClick ParentFont = False TabOrder = 0 + OnClick = cbHotKeyClick end object lblHotkeyWindow: TLabel Left = 4 @@ -153,7 +153,15 @@ inherited frmHotkeyOptionsPage: TfrmHotkeyOptionsPage DefaultNodeHeight = 32 DragOperations = [] Header.AutoSizeIndex = 0 - Header.Columns = < + Header.Options = [hoColumnResize, hoDblClickResize, hoDrag, hoVisible, hoHeaderClickAutoSort, hoAutoResizeInclCaption] + Header.ParentFont = False + ParentFont = False + PopupMenu = pmHotkey + TabOrder = 0 + TreeOptions.MiscOptions = [toAcceptOLEDrop, toCheckSupport, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning, toEditOnClick] + TreeOptions.PaintOptions = [toPopupMode, toShowDropmark, toThemeAware, toUseBlendedImages, toUseExplorerTheme] + TreeOptions.SelectionOptions = [toFullRowSelect, toRightClickSelect] + Columns = < item Position = 0 Text = 'Name' @@ -174,13 +182,6 @@ inherited frmHotkeyOptionsPage: TfrmHotkeyOptionsPage Text = 'Hotkey' Width = 200 end> - Header.Options = [hoColumnResize, hoDblClickResize, hoDrag, hoVisible, hoHeaderClickAutoSort, hoAutoResizeInclCaption] - ParentFont = False - PopupMenu = pmHotkey - TabOrder = 0 - TreeOptions.MiscOptions = [toAcceptOLEDrop, toCheckSupport, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning, toEditOnClick] - TreeOptions.PaintOptions = [toPopupMode, toShowDropmark, toThemeAware, toUseBlendedImages, toUseExplorerTheme] - TreeOptions.SelectionOptions = [toFullRowSelect, toRightClickSelect] end end object pmHotkey: TPopupMenu[2] diff --git a/Frame/Frame.Options.Hotkey.lrj b/Frame/Frame.Options.Hotkey.lrj index 6353a3fe..1216e360 100644 --- a/Frame/Frame.Options.Hotkey.lrj +++ b/Frame/Frame.Options.Hotkey.lrj @@ -5,10 +5,6 @@ {"hash":162766164,"name":"tfrmhotkeyoptionspage.lblhotkeygm.caption","sourcebytes":[83,104,111,119,32,103,114,97,112,104,105,99,32,109,101,110,117,32,119,104,101,110,32,104,111,116,107,101,121,32,105,115,32,112,114,101,115,115,101,100],"value":"Show graphic menu when hotkey is pressed"}, {"hash":247070100,"name":"tfrmhotkeyoptionspage.lblhotkeycm.caption","sourcebytes":[83,104,111,119,32,99,108,97,115,115,105,99,32,109,101,110,117,32,119,104,101,110,32,104,111,116,107,101,121,32,105,115,32,112,114,101,115,115,101,100],"value":"Show classic menu when hotkey is pressed"}, {"hash":77701492,"name":"tfrmhotkeyoptionspage.grpordersoftware.caption","sourcebytes":[72,111,116,107,101,121,115,32,108,105,115,116],"value":"Hotkeys list"}, -{"hash":346165,"name":"tfrmhotkeyoptionspage.vstitems.header.columns[0].text","sourcebytes":[78,97,109,101],"value":"Name"}, -{"hash":376933,"name":"tfrmhotkeyoptionspage.vstitems.header.columns[1].text","sourcebytes":[84,121,112,101],"value":"Type"}, -{"hash":145482249,"name":"tfrmhotkeyoptionspage.vstitems.header.columns[2].text","sourcebytes":[67,97,116,101,103,111,114,121],"value":"Category"}, -{"hash":83276233,"name":"tfrmhotkeyoptionspage.vstitems.header.columns[3].text","sourcebytes":[72,111,116,107,101,121],"value":"Hotkey"}, {"hash":114087587,"name":"tfrmhotkeyoptionspage.actproperties.caption","sourcebytes":[80,114,111,112,101,114,116,105,101,115],"value":"Properties"}, {"hash":204660201,"name":"tfrmhotkeyoptionspage.actremovehotkey.caption","sourcebytes":[82,101,109,111,118,101,32,72,111,116,107,101,121],"value":"Remove Hotkey"}, {"hash":79503785,"name":"tfrmhotkeyoptionspage.actedithotkey.caption","sourcebytes":[69,100,105,116,32,72,111,116,107,101,121],"value":"Edit Hotkey"} diff --git a/Frame/Frame.Options.Hotkey.pas b/Frame/Frame.Options.Hotkey.pas index 9aa6236d..66151d94 100644 --- a/Frame/Frame.Options.Hotkey.pas +++ b/Frame/Frame.Options.Hotkey.pas @@ -110,7 +110,6 @@ procedure TfrmHotkeyOptionsPage.actEditHotkeyExecute(Sender: TObject); if (ShortCut <> '') then begin NodeData.Hotkey := TextToShortCut(ShortCut); - NodeData.ActiveHotkey := True; NodeData.Changed := True; if (edtHotkeyMF.Text = ShortCut) then @@ -278,8 +277,7 @@ procedure TfrmHotkeyOptionsPage.SaveInHotkeyItemList( NodeData := TvCustomRealNodeData(TVirtualTreeMethods.GetNodeItemData(Node, ATree)); if Assigned(NodeData) then begin - NodeData.ActiveHotkey := ATree.IsVisible[Node]; - if NodeData.ActiveHotkey then + if ATree.IsVisible[Node] then AItemList.AddItem(NodeData) else AItemList.RemoveItem(NodeData); diff --git a/Frame/Frame.Properties.Advanced.lfm b/Frame/Frame.Properties.Advanced.lfm index 81d88221..44f32633 100644 --- a/Frame/Frame.Properties.Advanced.lfm +++ b/Frame/Frame.Properties.Advanced.lfm @@ -42,10 +42,10 @@ inherited frmAdvancedPropertyPage: TfrmAdvancedPropertyPage Width = 130 Constraints.MinWidth = 130 ItemHeight = 15 - OnChange = cxSchedulerChange ParentFont = False Style = csDropDownList TabOrder = 0 + OnChange = cxSchedulerChange end object dtpSchDate: TDateTimePicker Left = 4 @@ -114,26 +114,16 @@ inherited frmAdvancedPropertyPage: TfrmAdvancedPropertyPage Font.Style = [fsBold] ParentFont = False TabOrder = 1 - object cbHotKey: TCheckBox - Left = 4 - Height = 19 - Top = 4 - Width = 194 - Caption = 'Active hotkey' - OnClick = cbHotKeyClick - ParentFont = False - TabOrder = 0 - end object edtHotkey: TButtonedEdit Left = 4 - Height = 22 - Top = 25 + Height = 20 + Top = 4 Width = 194 BorderSpacing.Top = 2 CharCase = ecUppercase ParentFont = False ReadOnly = True - TabOrder = 1 + TabOrder = 0 OnChange = edtHotkeyChange OnClick = edtHotkeyClick OnRightButtonClick = edtHotkeyRightButtonClick diff --git a/Frame/Frame.Properties.Advanced.lrj b/Frame/Frame.Properties.Advanced.lrj index 8b8b0e91..6d74887a 100644 --- a/Frame/Frame.Properties.Advanced.lrj +++ b/Frame/Frame.Properties.Advanced.lrj @@ -3,7 +3,6 @@ {"hash":342540,"name":"tfrmadvancedpropertypage.dtpschdate.textfornulldate","sourcebytes":[78,85,76,76],"value":"NULL"}, {"hash":342540,"name":"tfrmadvancedpropertypage.dtpschtime.textfornulldate","sourcebytes":[78,85,76,76],"value":"NULL"}, {"hash":83276233,"name":"tfrmadvancedpropertypage.grphotkey.caption","sourcebytes":[72,111,116,107,101,121],"value":"Hotkey"}, -{"hash":22920697,"name":"tfrmadvancedpropertypage.cbhotkey.caption","sourcebytes":[65,99,116,105,118,101,32,104,111,116,107,101,121],"value":"Active hotkey"}, {"hash":90893459,"name":"tfrmadvancedpropertypage.grpothers.caption","sourcebytes":[79,116,104,101,114,115],"value":"Others"}, {"hash":227251173,"name":"tfrmadvancedpropertypage.cbhidesoftware.caption","sourcebytes":[72,105,100,101,32,116,104,105,115,32,115,111,102,116,119,97,114,101,32,102,114,111,109,32,109,101,110,117],"value":"Hide this software from menu"}, {"hash":153613577,"name":"tfrmadvancedpropertypage.cbdontinsertmru.caption","sourcebytes":[68,111,110,39,116,32,105,110,115,101,114,116,32,116,104,105,115,32,115,111,102,116,119,97,114,101,32,105,110,32,114,101,99,101,110,116,115,32,40,77,82,85,41],"value":"Don't insert this software in recents (MRU)"}, diff --git a/Frame/Frame.Properties.Advanced.pas b/Frame/Frame.Properties.Advanced.pas index 44f6075f..a8fd31bd 100644 --- a/Frame/Frame.Properties.Advanced.pas +++ b/Frame/Frame.Properties.Advanced.pas @@ -44,11 +44,9 @@ TfrmAdvancedPropertyPage = class(TfrmBasePropertyPage) dtpSchDate: TDateTimePicker; dtpSchTime: TDateTimePicker; grpHotkey: TGroupBox; - - cbHotKey: TCheckBox; + pnlTop: TPanel; procedure cxSchedulerChange(Sender: TObject); - procedure cbHotKeyClick(Sender: TObject); procedure edtHotkeyRightButtonClick(Sender: TObject); procedure edtHotkeyChange(Sender: TObject); procedure edtHotkeyClick(Sender: TObject); @@ -76,11 +74,6 @@ implementation { TfrmAdvancedPropertyPage } -procedure TfrmAdvancedPropertyPage.cbHotKeyClick(Sender: TObject); -begin - edtHotkey.Enabled := cbHotKey.Checked; -end; - procedure TfrmAdvancedPropertyPage.cxSchedulerChange(Sender: TObject); begin dtpSchDate.Enabled := cxScheduler.ItemIndex = Ord(smOnce); @@ -115,9 +108,8 @@ function TfrmAdvancedPropertyPage.InternalLoadData: Boolean; dtpSchTime.Time := CurrentNodeData.SchDateTime; cxSchedulerChange(Self); //Hotkey - cbHotKey.Checked := CurrentNodeData.ActiveHotkey; - edtHotkey.Text := ShortCutToText(CurrentNodeData.Hotkey); - cbHotKeyClick(Self); + if (CurrentNodeData.IsHotkeyActive) then + edtHotkey.Text := ShortCutToText(CurrentNodeData.Hotkey); //Specific file settings cbHideSoftware.Checked := CurrentNodeData.HideFromMenu; if CurrentNodeData.IsFileItem then @@ -154,7 +146,6 @@ function TfrmAdvancedPropertyPage.InternalSaveData: Boolean; CurrentNodeData.SchDateTime := RecodeSecond(CurrentNodeData.SchDateTime, 0); //Hotkey CurrentNodeData.Hotkey := TextToShortCut(edtHotkey.Text); - CurrentNodeData.ActiveHotkey := cbHotKey.Checked; //Specific file settings CurrentNodeData.HideFromMenu := cbHideSoftware.Checked; if CurrentNodeData.IsFileItem then @@ -191,8 +182,7 @@ procedure TfrmAdvancedPropertyPage.edtHotkeyClick(Sender: TObject); procedure TfrmAdvancedPropertyPage.edtHotkeyRightButtonClick(Sender: TObject); begin - if Sender is TButtonedEdit then - TButtonedEdit(Sender).Text := ''; + edtHotkey.Text := ''; end; end. diff --git a/Library/Database.List.pas b/Library/Database.List.pas index 56e068d4..15c01687 100644 --- a/Library/Database.List.pas +++ b/Library/Database.List.pas @@ -58,7 +58,6 @@ TSQLtbl_list = class(TOrm) //Table tbl_list Fscheduler_mode : Byte; Fscheduler_datetime : TDateTime; Frun_from_category : Boolean; - FActiveHotkey : Boolean; Fhotkey : Word; Fenvironment_vars : RawUTF8; @@ -103,7 +102,6 @@ TSQLtbl_list = class(TOrm) //Table tbl_list property autorun_position: Integer read Fautorun_position write Fautorun_position; property scheduler_mode: Byte read Fscheduler_mode write Fscheduler_mode; property scheduler_datetime: TDateTime read Fscheduler_datetime write Fscheduler_datetime; - property activehotkey: Boolean read FActiveHotkey write FActiveHotkey; property hotkey: Word read Fhotkey write Fhotkey; property run_from_category: Boolean read Frun_from_category write Frun_from_category; property environment_vars: RawUTF8 read Fenvironment_vars write Fenvironment_vars; @@ -132,7 +130,7 @@ class procedure TSQLtbl_list.InsertFileRecord(AData: TvBaseNodeData; ADBManager: //If enabled, register item's hotkey with new ID if AData is TvCustomRealNodeData then - if TvCustomRealNodeData(AData).ActiveHotkey then + if TvCustomRealNodeData(AData).IsHotkeyActive then ASuiteManager.ListManager.HotKeyItemList.AddItem(TvCustomRealNodeData(AData)); SQLFilesData.Free; @@ -178,7 +176,6 @@ class procedure TSQLtbl_list.LoadItemsByParentID(Tree: TBaseVirtualTree; ADBMana SchMode := TSchedulerMode(SQLItemsData.scheduler_mode); SchDateTime := SQLItemsData.scheduler_datetime; Hotkey := SQLItemsData.hotkey; - ActiveHotkey := SQLItemsData.activehotkey; WindowState := SQLItemsData.window_state; ActionOnExe := TActionOnExecute(SQLItemsData.onlaunch); end; @@ -276,7 +273,6 @@ procedure TSQLtbl_list.LoadDataFromNode(AData: TvBaseNodeData; AIndex, AParentID Fonlaunch := Ord(ActionOnExe); Fscheduler_mode := Ord(SchMode); Fscheduler_datetime := SchDateTime; - FActiveHotkey := ActiveHotkey; Fhotkey := Hotkey; end; //Add file fields diff --git a/Library/Lists.Manager.pas b/Library/Lists.Manager.pas index 6bc65faa..1d5c7f5d 100644 --- a/Library/Lists.Manager.pas +++ b/Library/Lists.Manager.pas @@ -92,7 +92,7 @@ procedure TListManager.RemoveItemFromLists(AItemData: TvCustomRealNodeData); FMRUList.RemoveItem(AItemData); FMFUList.RemoveItem(AItemData); //Remove item from hotkey list - if AItemData.ActiveHotkey then + if AItemData.IsHotkeyActive then FHotKeyItemList.RemoveItem(AItemData); //Remove item from scheduler list if AItemData.SchMode <> smDisabled then diff --git a/Library/NodeDataTypes.Custom.pas b/Library/NodeDataTypes.Custom.pas index 30a6033a..61cf7b46 100644 --- a/Library/NodeDataTypes.Custom.pas +++ b/Library/NodeDataTypes.Custom.pas @@ -40,14 +40,14 @@ TvCustomRealNodeData = class(TvBaseNodeData) FAutorunPos : Integer; //Position for ASuiteStartUpApp and ASuiteShutdownApp FSchMode : TSchedulerMode; //0 Disabled, 1 Once, 2 Hourly, 3 Daily, 4 Weekly FSchDateTime : TDateTime; - FActiveHotkey : Boolean; - FHotkey : Cardinal; + FHotkey : TShortCut; FLastAccess : Int64; + function GetIsHotkeyActive: Boolean; procedure SetAutorun(value: TAutorunType); + procedure SetHotkey(AValue: TShortCut); procedure SetSchMode(value: TSchedulerMode); procedure SetSchDateTime(value: TDateTime); - procedure SetActiveHotkey(const Value: Boolean); function GetPathAbsoluteIcon: String; procedure RunActionOnExe(Action: TActionOnExecute); protected @@ -75,8 +75,8 @@ TvCustomRealNodeData = class(TvBaseNodeData) property AutorunPos: Integer read FAutorunPos write FAutorunPos; property SchMode: TSchedulerMode read FSchMode write SetSchMode; property SchDateTime: TDateTime read FSchDateTime write SetSchDateTime; - property ActiveHotkey: Boolean read FActiveHotkey write SetActiveHotkey; - property Hotkey: Cardinal read FHotkey write FHotkey; + property Hotkey: TShortCut read FHotkey write SetHotkey; + property IsHotkeyActive: Boolean read GetIsHotkeyActive; end; PvCustomRealNodeData = ^TvCustomRealNodeData; @@ -99,7 +99,6 @@ procedure TvCustomRealNodeData.Copy(source: TvBaseNodeData); Self.WindowState := SourceNodeData.WindowState; Self.ActionOnExe := SourceNodeData.ActionOnExe; Self.Hotkey := SourceNodeData.Hotkey; - Self.ActiveHotkey :=SourceNodeData.ActiveHotkey; Self.Autorun := SourceNodeData.Autorun; Self.SchMode := SourceNodeData.SchMode; Self.SchDateTime := SourceNodeData.SchDateTime; @@ -112,7 +111,6 @@ constructor TvCustomRealNodeData.Create(AType: TvTreeDataType); FPathIcon := ''; FSchMode := smDisabled; FSchDateTime := Now; - FActiveHotkey := False; FHotkey := 0; FWindowState := 0; FActionOnExe := aeDefault; @@ -121,20 +119,6 @@ constructor TvCustomRealNodeData.Create(AType: TvTreeDataType); FLastAccess := -1; end; -procedure TvCustomRealNodeData.SetActiveHotkey(const Value: Boolean); -begin - if (Config.ASuiteState <> lsImporting) then - begin - //Old value is true, remove it in HotKeyApp - if (FActiveHotkey) then - ASuiteManager.ListManager.HotKeyItemList.RemoveItem(Self); - //New value is true, add it in HotKeyApp - if (value) then - ASuiteManager.ListManager.HotKeyItemList.AddItem(Self); - end; - FActiveHotkey := Value; -end; - procedure TvCustomRealNodeData.SetSchDateTime(value: TDateTime); begin //If value is not a empty TDateTime, set it in FSchDateTime @@ -268,6 +252,25 @@ procedure TvCustomRealNodeData.SetAutorun(value:TAutorunType); FAutorun := value; end; +function TvCustomRealNodeData.GetIsHotkeyActive: Boolean; +begin + Result := Self.Hotkey <> 0; +end; + +procedure TvCustomRealNodeData.SetHotkey(AValue: TShortCut); +begin + if (Config.ASuiteState <> lsImporting) then + begin + //Old value is true, remove it in HotKeyApp + if (Self.IsHotkeyActive) then + ASuiteManager.ListManager.HotKeyItemList.RemoveItem(Self); + //New value is true, add it in HotKeyApp + if (AValue <> 0) then + ASuiteManager.ListManager.HotKeyItemList.AddItem(Self); + end; + FHotkey := AValue; +end; + procedure TvCustomRealNodeData.SetLastAccess(const Value: Int64); begin FLastAccess := Value; diff --git a/Library/VirtualTree.Events.pas b/Library/VirtualTree.Events.pas index b333265f..f5319997 100644 --- a/Library/VirtualTree.Events.pas +++ b/Library/VirtualTree.Events.pas @@ -746,7 +746,6 @@ procedure TVirtualTreeEvents.DoLoadNode(Sender: TBaseVirtualTree; Node: PVirtual //New node can't use same hotkey of old node if DataDest.Data is TvCustomRealNodeData then begin - TvCustomRealNodeData(DataDest.Data).ActiveHotkey := False; TvCustomRealNodeData(DataDest.Data).Hotkey := 0; end; diff --git a/Utilities/Utility.XML.pas b/Utilities/Utility.XML.pas index c63eecda..fa04641c 100644 --- a/Utilities/Utility.XML.pas +++ b/Utilities/Utility.XML.pas @@ -372,8 +372,6 @@ procedure LoadXMLSettings(XMLDoc: TXMLDocument); //Main Form - Position and size Config.HoldSize := GetBoolPropertyXML(Node, 'HoldSize', false); Config.AlwaysOnTop := GetBoolPropertyXML(Node, 'MainOnTop', false); - //Hotkey - Config.HotKey := GetBoolPropertyXML(Node, 'ActiveHotKey',true); //Window Hotkey Config.WindowHotkey := ShortCutToText(XMLToShortcut(Node, 'HotKeyCode', 'HotKeyModifier')); //Menu Hotkey diff --git a/languages/ASuite.pot b/languages/ASuite.pot index 18b83c3b..8f6fd572 100644 --- a/languages/ASuite.pot +++ b/languages/ASuite.pot @@ -635,10 +635,6 @@ msgstr "" msgid "Hide this software from menu" msgstr "" -#: tfrmadvancedpropertypage.cbhotkey.caption -msgid "Active hotkey" -msgstr "" - #: tfrmadvancedpropertypage.cbshortcutdesktop.caption msgid "Create shortcut on desktop when ASuite is running" msgstr ""