From 78acf4665191cb79dd7f46541e821f3f99a3cdd0 Mon Sep 17 00:00:00 2001 From: ondrej Date: Fri, 9 Jun 2017 11:11:42 +0000 Subject: [PATCH] ide: revert r55275 #e0275cda73 git-svn-id: trunk@55276 - --- ide/desktopmanager.lfm | 53 +++++++++---------------------------- ide/desktopmanager.pas | 33 +---------------------- ide/environmentopts.pp | 19 +++---------- ide/lazarusidestrconsts.pas | 2 -- 4 files changed, 18 insertions(+), 89 deletions(-) diff --git a/ide/desktopmanager.lfm b/ide/desktopmanager.lfm index 69b41c752f..f936edb639 100644 --- a/ide/desktopmanager.lfm +++ b/ide/desktopmanager.lfm @@ -10,7 +10,7 @@ object DesktopForm: TDesktopForm OnCreate = FormCreate OnShow = FormShow Position = poScreenCenter - LCLVersion = '1.9.0.0' + LCLVersion = '1.5' object ButtonPanel1: TButtonPanel Left = 6 Height = 34 @@ -27,7 +27,7 @@ object DesktopForm: TDesktopForm CancelButton.Name = 'CancelButton' CancelButton.Caption = 'Close' CancelButton.DefaultCaption = False - TabOrder = 4 + TabOrder = 3 ShowButtons = [pbClose, pbHelp] object ExportBitBtn: TBitBtn Left = 93 @@ -58,9 +58,9 @@ object DesktopForm: TDesktopForm AnchorSideLeft.Control = LblGrayedInfo AnchorSideRight.Control = LblGrayedInfo AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = AssociatedDebugDesktopComboBox + AnchorSideBottom.Control = AutoSaveActiveDesktopCheckBox Left = 11 - Height = 161 + Height = 190 Top = 8 Width = 320 Anchors = [akTop, akLeft, akRight, akBottom] @@ -87,7 +87,7 @@ object DesktopForm: TDesktopForm Caption = 'Auto save active desktop' ParentShowHint = False ShowHint = True - TabOrder = 2 + TabOrder = 1 end object ToolBar1: TToolBar Left = 340 @@ -98,7 +98,7 @@ object DesktopForm: TDesktopForm Anchors = [akTop, akRight, akBottom] Caption = 'ToolBar1' EdgeBorders = [] - TabOrder = 3 + TabOrder = 2 object SaveTB: TToolButton Left = 1 Top = 0 @@ -109,6 +109,7 @@ object DesktopForm: TDesktopForm end object ToolButton1: TToolButton Left = 1 + Height = 5 Top = 22 Width = 23 Caption = 'ToolButton1' @@ -166,6 +167,7 @@ object DesktopForm: TDesktopForm end object ToolButton2: TToolButton Left = 1 + Height = 5 Top = 120 Width = 23 Caption = 'ToolButton2' @@ -173,6 +175,7 @@ object DesktopForm: TDesktopForm end object ToolButton3: TToolButton Left = 1 + Height = 5 Top = 49 Width = 23 Caption = 'ToolButton3' @@ -192,39 +195,9 @@ object DesktopForm: TDesktopForm ParentColor = False WordWrap = True end - object AssociatedDebugDesktopComboBox: TComboBox - AnchorSideLeft.Control = AssociatedDebugDesktopLabel - AnchorSideLeft.Side = asrBottom - AnchorSideRight.Control = DesktopListBox - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = AutoSaveActiveDesktopCheckBox - Left = 184 - Height = 23 - Top = 175 - Width = 147 - Anchors = [akLeft, akRight, akBottom] - BorderSpacing.Left = 10 - ItemHeight = 15 - OnChange = AssociatedDebugDesktopComboBoxChange - Style = csDropDownList - TabOrder = 1 - end - object AssociatedDebugDesktopLabel: TLabel - AnchorSideLeft.Control = AutoSaveActiveDesktopCheckBox - AnchorSideTop.Control = AssociatedDebugDesktopComboBox - AnchorSideTop.Side = asrCenter - Left = 11 - Height = 15 - Top = 179 - Width = 163 - Caption = 'AssociatedDebugDesktopLabel' - ParentColor = False - ParentShowHint = False - ShowHint = True - end object ExportMenu: TPopupMenu - Left = 48 - Top = 24 + left = 48 + top = 24 object ExportItem: TMenuItem Action = ExportAction OnClick = ExportActionClick @@ -235,8 +208,8 @@ object DesktopForm: TDesktopForm end end object ActionList1: TActionList - Left = 128 - Top = 32 + left = 128 + top = 32 object SaveAction: TAction Caption = 'SaveAction' OnExecute = SaveActionClick diff --git a/ide/desktopmanager.pas b/ide/desktopmanager.pas index 70117dee45..aea6ffee65 100644 --- a/ide/desktopmanager.pas +++ b/ide/desktopmanager.pas @@ -20,13 +20,11 @@ type { TDesktopForm } TDesktopForm = class(TForm) - AssociatedDebugDesktopComboBox: TComboBox; ExportBitBtn: TBitBtn; ImportBitBtn: TBitBtn; ImportAction: TAction; ExportAction: TAction; ExportAllAction: TAction; - AssociatedDebugDesktopLabel: TLabel; MoveUpAction: TAction; MoveDownAction: TAction; DeleteAction: TAction; @@ -53,7 +51,6 @@ type MoveDownTB: TToolButton; ToolButton2: TToolButton; ToolButton3: TToolButton; - procedure AssociatedDebugDesktopComboBoxChange(Sender: TObject); procedure DeleteActionClick(Sender: TObject); procedure DesktopListBoxDrawItem(Control: TWinControl; Index: Integer; ARect: TRect; {%H-}State: TOwnerDrawState); @@ -347,8 +344,6 @@ begin AutoSaveActiveDesktopCheckBox.Caption := dlgAutoSaveActiveDesktop; AutoSaveActiveDesktopCheckBox.Hint := dlgAutoSaveActiveDesktopHint; LblGrayedInfo.Caption := dlgGrayedDesktopsUndocked; - AssociatedDebugDesktopLabel.Caption := dlgAssociatedDebugDesktop; - AssociatedDebugDesktopLabel.Hint := dlgAssociatedDebugDesktopHint; LblGrayedInfo.Font.Color := clGrayText; ExportAction.Hint := lisExport; @@ -392,14 +387,11 @@ begin HasNonCompatible := False; DesktopListBox.Clear; - AssociatedDebugDesktopComboBox.Clear; - AssociatedDebugDesktopComboBox.Items.AddObject(dlgPOIconDescNone, nil); // Saved desktops for i:=0 to EnvironmentOptions.Desktops.Count-1 do begin DskTop := EnvironmentOptions.Desktops[i]; - DesktopListBox.Items.AddObject(DskTop.Name, DskTop); - AssociatedDebugDesktopComboBox.Items.AddObject(DskTop.Name, DskTop); + DesktopListBox.Items.Add(DskTop.Name); if not DskTop.Compatible then HasNonCompatible := True; end; @@ -454,19 +446,6 @@ begin end; end; -procedure TDesktopForm.AssociatedDebugDesktopComboBoxChange(Sender: TObject); -var - SelDesktop: TDesktopOpt; -begin - if DesktopListBox.ItemIndex = -1 then - Exit; - - SelDesktop := DesktopListBox.Items.Objects[DesktopListBox.ItemIndex] as TDesktopOpt; - SelDesktop.AssociatedDebugDesktopName := AssociatedDebugDesktopComboBox.Text; - if SelDesktop.Name = EnvironmentOptions.ActiveDesktopName then - EnvironmentOptions.Desktop.AssociatedDebugDesktopName := SelDesktop.AssociatedDebugDesktopName; -end; - procedure TDesktopForm.DeleteActionClick(Sender: TObject); var dskName: String; @@ -779,20 +758,10 @@ procedure TDesktopForm.DesktopListBoxSelectionChange(Sender: TObject; User: bool var HasSel, IsActive, IsDebug: Boolean; CurName: String; - SelDesktop: TDesktopOpt; begin HasSel := DesktopListBox.ItemIndex>=0; if HasSel then begin - SelDesktop := DesktopListBox.Items.Objects[DesktopListBox.ItemIndex] as TDesktopOpt; - if (SelDesktop.AssociatedDebugDesktopName<>'') then - begin - AssociatedDebugDesktopComboBox.ItemIndex := - AssociatedDebugDesktopComboBox.Items.IndexOfObject(EnvironmentOptions.Desktops.Find(SelDesktop.AssociatedDebugDesktopName)); - if AssociatedDebugDesktopComboBox.ItemIndex<0 then - AssociatedDebugDesktopComboBox.ItemIndex := 0; - end else - AssociatedDebugDesktopComboBox.ItemIndex := 0; CurName := DesktopListBox.Items[DesktopListBox.ItemIndex]; IsActive := CurName = EnvironmentOptions.ActiveDesktopName; IsDebug := CurName = EnvironmentOptions.DebugDesktopName; diff --git a/ide/environmentopts.pp b/ide/environmentopts.pp index 310defb9a4..798a93e8e5 100644 --- a/ide/environmentopts.pp +++ b/ide/environmentopts.pp @@ -298,7 +298,6 @@ type TDesktopOpt = class private FName: String; - FAssociatedDebugDesktopName: String; FIsDocked: Boolean; FXMLCfg: TRttiXMLConfig; FConfigStore: TXMLOptionsStorage; @@ -345,7 +344,6 @@ type procedure RestoreDesktop; property Name: String read FName write FName; - property AssociatedDebugDesktopName: String read FAssociatedDebugDesktopName write FAssociatedDebugDesktopName; property IDEWindowCreatorsLayoutList: TSimpleWindowLayoutList read FIDEWindowCreatorsLayoutList write FIDEWindowCreatorsLayoutList; property IDEDialogLayoutList: TIDEDialogLayoutList read FIDEDialogLayoutList; property SingleTaskBarButton: boolean read FSingleTaskBarButton write FSingleTaskBarButton; @@ -1170,7 +1168,6 @@ begin begin FIDEWindowCreatorsLayoutList.CopyItemsFrom(Source.FIDEWindowCreatorsLayoutList); FIDEDialogLayoutList.Assign(Source.FIDEDialogLayoutList); - FAssociatedDebugDesktopName := Source.FAssociatedDebugDesktopName; end; FSingleTaskBarButton := Source.FSingleTaskBarButton; FHideIDEOnRun := Source.FHideIDEOnRun; @@ -1202,7 +1199,6 @@ begin FIDEWindowCreatorsLayoutList.LoadFromConfig(FConfigStore, Path); FIDEDialogLayoutList.LoadFromConfig(FConfigStore, Path+'Dialogs/'); - FAssociatedDebugDesktopName:=FXMLCfg.GetValue(Path+'AssociatedDebugDesktopName/Value', ''); FSingleTaskBarButton:=FXMLCfg.GetValue(Path+'SingleTaskBarButton/Value', False); FHideIDEOnRun:=FXMLCfg.GetValue(Path+'HideIDEOnRun/Value',false); FAutoAdjustIDEHeight:=FXMLCfg.GetValue(Path+'AutoAdjustIDEHeight/Value',true); @@ -1259,7 +1255,6 @@ begin FIDEWindowCreatorsLayoutList.SaveToConfig(FConfigStore, Path); FIDEDialogLayoutList.SaveToConfig(FConfigStore,Path+'Dialogs/'); - FXMLCfg.SetDeleteValue(Path+'AssociatedDebugDesktopName/Value', FAssociatedDebugDesktopName, ''); FXMLCfg.SetDeleteValue(Path+'SingleTaskBarButton/Value',FSingleTaskBarButton, False); FXMLCfg.SetDeleteValue(Path+'HideIDEOnRun/Value',FHideIDEOnRun,false); FXMLCfg.SetDeleteValue(Path+'AutoAdjustIDEHeight/Value',FAutoAdjustIDEHeight,true); @@ -2688,8 +2683,7 @@ function TEnvironmentOptions.GetActiveDesktop: TDesktopOpt; end; var - OldActiveDesktop: TDesktopOpt; - OldActiveDesktopName: string; + DefaultDesktop: TDesktopOpt; begin if FActiveDesktopName <> '' then @@ -2701,7 +2695,6 @@ begin //the selected desktop is unsupported (docked/undocked) // -> use default - OldActiveDesktopName := FActiveDesktopName; ChooseDefault; Result := FDesktops.Find(FActiveDesktopName); if Assigned(Result) and Result.Compatible then @@ -2710,17 +2703,15 @@ begin //recreate desktop with ActiveDesktopName if Assigned(Result) then FDesktops.Remove(Result); + DefaultDesktop := FDesktops.Find('default'); Result := TDesktopOpt.Create(FActiveDesktopName); FDesktops.Add(Result); Result.Assign(Desktop); if Assigned(IDEDockMaster) then Result.FDockedOpt.LoadDefaults; - OldActiveDesktop := FDesktops.Find(OldActiveDesktopName); - if not Assigned(OldActiveDesktop) then - OldActiveDesktop := FDesktops.Find('default'); - if Assigned(OldActiveDesktop) then - Result.Assign(OldActiveDesktop, False, False); + if Assigned(DefaultDesktop) then + Result.Assign(DefaultDesktop, False, False); end; procedure TEnvironmentOptions.SetTestBuildDirectory(const AValue: string); @@ -2755,8 +2746,6 @@ begin DoBeforeWrite(False); //this is needed to get the EditorToolBar refreshed!!! - needed only here in UseDesktop() Desktop.Assign(ADesktop); ActiveDesktopName := ADesktop.Name; - if ADesktop.AssociatedDebugDesktopName<>'' then - DebugDesktopName := ADesktop.AssociatedDebugDesktopName; DoAfterWrite(False); //this is needed to get the EditorToolBar refreshed!!! - needed only here in UseDesktop() Desktop.ExportSettingsToIDE; Desktop.RestoreDesktop; diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index 54add39ca9..640e5d206e 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -1355,8 +1355,6 @@ resourcestring dlgGrayedDesktopsUndocked = 'Grayed desktops are for undocked environment.'; dlgAutoSaveActiveDesktop = 'Auto save active desktop'; dlgAutoSaveActiveDesktopHint = 'Save active desktop on IDE close'+sLineBreak+'Save debug desktop on IDE close and debug end'; - dlgAssociatedDebugDesktop = 'Associated debug desktop'; - dlgAssociatedDebugDesktopHint = 'If you select the desktop, the associated debug desktop will be selected as well.'; // Window options dlgShowingWindows = 'Showing Windows';