From 1d608b279e0a5496d6d8b11ec4f6ed56f3ba8730 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 1 Aug 2017 20:00:54 +0700 Subject: [PATCH] Issues #988 hiding/showing menu and toolbar --- main.lfm | 40 ++++++++++++++++++++++++++++++++++------ main.pas | 39 ++++++++++++++++++++++++++++++++++++++- transgui.lpi | 5 ++--- transgui.res | Bin 91360 -> 91356 bytes 4 files changed, 74 insertions(+), 10 deletions(-) diff --git a/main.lfm b/main.lfm index 4347ddeb..bc4d8bbe 100644 --- a/main.lfm +++ b/main.lfm @@ -348,11 +348,11 @@ inherited MainForm: TMainForm Height = 326 Top = 225 Width = 881 - ActivePage = tabGeneral + ActivePage = tabTrackers Align = alBottom Constraints.MinHeight = 50 Images = ImageList16 - TabIndex = 0 + TabIndex = 1 TabOrder = 1 OnChange = PageInfoChange OnResize = PageInfoResize @@ -924,14 +924,14 @@ inherited MainForm: TMainForm end object tabTrackers: TTabSheet Caption = 'Trackers' - ClientHeight = 558 - ClientWidth = 1544 + ClientHeight = 298 + ClientWidth = 873 ImageIndex = 5 object lvTrackers: TVarGrid Left = 0 - Height = 279 + Height = 298 Top = 0 - Width = 772 + Width = 873 Align = alClient Columns = < item @@ -1962,6 +1962,14 @@ inherited MainForm: TMainForm Action = acInfoPane ShortCut = 123 end + object MenuItem501: TMenuItem + Action = acToolbarShow + ShortCut = 16506 + end + object MenuItem502: TMenuItem + Action = acMenuShow + ShortCut = 16507 + end object MenuItem96: TMenuItem Action = acStatusBar end @@ -2459,6 +2467,18 @@ inherited MainForm: TMainForm Checked = True OnExecute = acStatusBarSizesExecute end + object acToolbarShow: TAction + Category = 'View' + Caption = 'Toolbar' + Checked = True + OnExecute = acToolbarShowExecute + end + object acMenuShow: TAction + Category = 'View' + Caption = 'Menu' + Checked = True + OnExecute = acMenuShowExecute + end end object TorrentsListTimer: TTimer[9] Enabled = False @@ -4903,4 +4923,12 @@ inherited MainForm: TMainForm left = 832 top = 152 end + object ActionList1: TActionList[29] + left = 840 + object MenuShow: TAction + Caption = 'MenuShow' + OnExecute = MenuShowExecute + ShortCut = 16507 + end + end end diff --git a/main.pas b/main.pas index 05823187..350299de 100644 --- a/main.pas +++ b/main.pas @@ -35,7 +35,7 @@ interface const AppName = 'Transmission Remote GUI'; - AppVersion = '5.8.3'; + AppVersion = '5.9'; resourcestring sAll = 'All torrents'; @@ -218,6 +218,10 @@ TMainForm = class(TBaseForm) acFolderGrouping: TAction; acAdvEditTrackers: TAction; acFilterPane: TAction; + acMenuShow : TAction; + MenuShow: TAction; + ActionList1: TActionList; + acToolbarShow : TAction; acInfoPane: TAction; acStatusBar: TAction; acCopyPath: TAction; @@ -230,6 +234,8 @@ TMainForm = class(TBaseForm) acVerifyTorrent: TAction; ActionList: TActionList; ApplicationProperties: TApplicationProperties; + MenuItem501: TMenuItem; + MenuItem502: TMenuItem; txMagLabel: TLabel; txMagnetLink: TEdit; MenuItem101: TMenuItem; @@ -503,6 +509,7 @@ TMainForm = class(TBaseForm) procedure acForceStartTorrentExecute(Sender: TObject); procedure acHideAppExecute(Sender: TObject); procedure acInfoPaneExecute(Sender: TObject); + procedure acMenuShowExecute(Sender: TObject); procedure acMoveTorrentExecute(Sender: TObject); procedure acNewConnectionExecute(Sender: TObject); procedure acOpenContainingFolderExecute(Sender: TObject); @@ -537,6 +544,8 @@ TMainForm = class(TBaseForm) procedure acStatusBarSizesExecute(Sender: TObject); procedure acStopAllTorrentsExecute(Sender: TObject); procedure acStopTorrentExecute(Sender: TObject); + procedure MenuShowExecute(Sender: TObject); + procedure acToolbarShowExecute(Sender: TObject); procedure acTorrentPropsExecute(Sender: TObject); procedure acTrackerGroupingExecute(Sender: TObject); procedure acUpdateBlocklistExecute(Sender: TObject); @@ -1788,6 +1797,15 @@ procedure TMainForm.acInfoPaneExecute(Sender: TObject); RpcObj.AdvInfo:=aiNone; end; +procedure TMainForm.acMenuShowExecute(Sender: TObject); +begin + acMenuShow.Checked:=not acMenuShow.Checked; + if acMenuShow.Checked = false then + MainForm.Menu := nil + else + MainForm.Menu := MainMenu; +end; + procedure TMainForm.acMoveTorrentExecute(Sender: TObject); var ids: variant; @@ -3477,6 +3495,25 @@ procedure TMainForm.acStopTorrentExecute(Sender: TObject); TorrentAction(GetSelectedTorrents, 'torrent-stop'); end; +procedure TMainForm.MenuShowExecute(Sender: TObject); +begin + acMenuShow.Checked:=not acMenuShow.Checked; + if acMenuShow.Checked = false then + MainForm.Menu := nil + else + MainForm.Menu := MainMenu; +end; + +procedure TMainForm.acToolbarShowExecute(Sender: TObject); +begin + + acToolbarShow.Checked:=not acToolbarShow.Checked; + if acToolbarShow.Checked = false then + MainToolBar.Visible:= false + else + MainToolBar.Visible:= true; +end; + procedure TMainForm.acTorrentPropsExecute(Sender: TObject); begin TorrentProps(0); diff --git a/transgui.lpi b/transgui.lpi index 372d5f85..6cb4b16c 100644 --- a/transgui.lpi +++ b/transgui.lpi @@ -20,9 +20,8 @@ - - - + + diff --git a/transgui.res b/transgui.res index c30723c65b0d75c0a5261cf0113bfff42271584f..87538dae30b2d00d7ee63e2cbc177fda339a0dcd 100644 GIT binary patch delta 83 zcmaEGlJ(9>)(s78j1`j`+2n!bLNoBlPUd^e>XxV&~bNf|JM($_;#WEHK delta 87 zcmca}lJ&t!)(s78j5U)R+2n!bLN