View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001481 | Double Commander | Default | public | 2016-08-05 19:36 | 2021-09-05 15:10 |
Reporter | mortalis | Assigned To | Alexx2000 | ||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Projection | none | ETA | none | ||
Platform | PC x32 x64 | OS | Windows | OS Version | XP/7 |
Product Version | 1.0.0 (trunk) | Product Build | 7022 | ||
Target Version | 0.9.0 | Fixed in Version | 0.9.0 | ||
Summary | 0001481: Added 3 commands (cm_ActivateTabByIndex, cm_OpenDriveByIndex, cm_MaximizePanel) | ||||
Description | The commands do the following: cm_ActivateTabByIndex: activates tab with a given index shortcuts Ctrl+1, 2, ... Ctrl+` goes to the last tab the single parameter is the tab index (1-based) cm_OpenDriveByIndex: opens the drive with a given index shortcuts Alt+1, 2, ... the single parameter is the drive index (1-based) cm_MaximizePanel: hides the not active panel and extends the current one to the width of the window shortcut F11 toggles this state the parameter 'colwidth' gives the column index (1-based) and its width for the maximized panel state (implemented only for 1 column, later will add the parameter processing for any number of columns) The code is in the added patch. | ||||
Tags | No tags attached. | ||||
Attached Files | new_commands.patch (9,607 bytes)
Index: src/fmain.lfm =================================================================== --- src/fmain.lfm (revision 7022) +++ src/fmain.lfm (working copy) @@ -1569,6 +1569,12 @@ Caption = 'Operations &Viewer' OnExecute = actExecute end + object actMaximizePanel: TAction + Tag = 16 + Category = 'Window' + Caption = 'Maximize current panel' + OnExecute = actExecute + end object actRefresh: TAction Tag = 19 Category = 'View' @@ -2286,6 +2292,12 @@ Caption = 'Go to previous entry in history' OnExecute = actExecute end + object actOpenDriveByIndex: TAction + Tag = 14 + Category = 'Navigation' + Caption = 'Open Drive by Index' + OnExecute = actExecute + end object actOpenBar: TAction Tag = 16 Category = 'Window' @@ -2544,6 +2556,12 @@ Caption = 'Load the Next Favorite Tabs in the list' OnExecute = actExecute end + object actActivateTabByIndex: TAction + Tag = 21 + Category = 'Tabs' + Caption = 'Activate Tab By Index' + OnExecute = actExecute + end object actConfigTreeViewMenus: TAction Tag = 5 Category = 'Configuration' Index: src/fmain.pas =================================================================== --- src/fmain.pas (revision 7022) +++ src/fmain.pas (working copy) @@ -164,6 +164,7 @@ actKeyboard: TAction; actPrevTab: TAction; actNextTab: TAction; + actActivateTabByIndex: TAction; actCloseAllTabs: TAction; actSetTabOptionNormal: TAction; actSetTabOptionPathLocked: TAction; @@ -188,6 +189,8 @@ actNewTab: TAction; actConfigToolbars: TAction; actDebugShowCommandParameters: TAction; + actOpenDriveByIndex: TAction; + actMaximizePanel: TAction; btnF10: TSpeedButton; btnF3: TSpeedButton; btnF4: TSpeedButton; Index: src/ufileviewnotebook.pas =================================================================== --- src/ufileviewnotebook.pas (revision 7022) +++ src/ufileviewnotebook.pas (working copy) @@ -154,6 +154,7 @@ procedure DestroyAllPages; procedure ActivatePrevTab; procedure ActivateNextTab; + procedure ActivateTabByIndex(Index: Integer); property ActivePage: TFileViewPage read GetActivePage; property ActiveView: TFileView read GetActiveView; @@ -594,6 +595,17 @@ Page[PageIndex + 1].MakeActive; end; +procedure TFileViewNotebook.ActivateTabByIndex(Index: Integer); +begin + if Index < -1 then + exit; + + if Index = -1 then + Page[PageCount - 1].MakeActive + else if PageCount >= Index+1 then + Page[Index].MakeActive; +end; + procedure TFileViewNotebook.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); {$IF DEFINED(LCLGTK2)} var Index: src/uglobs.pas =================================================================== --- src/uglobs.pas (revision 7022) +++ src/uglobs.pas (working copy) @@ -174,6 +174,9 @@ var + gTempColWidth: Integer; + gTempSplitterPos: Double; + { For localization } gPOFileName, gHelpLang: String; @@ -839,7 +842,7 @@ AddIfNotExists(['F8','','', 'Shift+F8','','trashcan=reversesetting',''], 'cm_Delete'); AddIfNotExists(['F9'],[],'cm_RunTerm'); - AddIfNotExists(['Ctrl+7'],[],'cm_ShowCmdLineHistory'); + // AddIfNotExists(['Ctrl+7'],[],'cm_ShowCmdLineHistory'); AddIfNotExists(['Ctrl+Down'],'cm_ShowCmdLineHistory',['Ctrl+7'],[]); //Historic backward support reason... AddIfNotExists(['Ctrl+B'],[],'cm_FlatView'); AddIfNotExists(['Ctrl+D'],[],'cm_DirHotList'); @@ -897,6 +900,30 @@ AddIfNotExists(['Alt+Right'],[],'cm_ViewHistoryNext'); AddIfNotExists(['Alt+Shift+Enter'],[],'cm_CountDirContent'); AddIfNotExists(['Alt+Shift+F9'],[],'cm_TestArchive'); + AddIfNotExists([ + 'Ctrl+1','','1','', + 'Ctrl+2','','2','', + 'Ctrl+3','','3','', + 'Ctrl+4','','4','', + 'Ctrl+5','','5','', + 'Ctrl+6','','6','', + 'Ctrl+7','','7','', + 'Ctrl+8','','8','', + 'Ctrl+9','','9','', + 'Ctrl+`','','-1',''], + 'cm_ActivateTabByIndex'); + AddIfNotExists([ + 'Alt+1','','1','', + 'Alt+2','','2','', + 'Alt+3','','3','', + 'Alt+4','','4','', + 'Alt+5','','5','', + 'Alt+6','','6','', + 'Alt+7','','7','', + 'Alt+8','','8','', + 'Alt+9','','9',''], + 'cm_OpenDriveByIndex'); + AddIfNotExists(['F11','','colwidth=2,200',''],'cm_MaximizePanel'); if HotMan.Version < 38 then begin Index: src/umaincommands.pas =================================================================== --- src/umaincommands.pas (revision 7022) +++ src/umaincommands.pas (working copy) @@ -200,6 +200,7 @@ procedure cm_CloseDuplicateTabs(const Params: array of string); procedure cm_NextTab(const Params: array of string); procedure cm_PrevTab(const Params: array of string); + procedure cm_ActivateTabByIndex(const Params: array of string); procedure cm_SaveTabs(const Params: array of string); procedure cm_LoadTabs(const Params: array of string); procedure cm_SetTabOptionNormal(const Params: array of string); @@ -333,6 +334,8 @@ procedure cm_CopyAllTabsToOpposite(const {%H-}Params: array of string); procedure cm_ConfigTreeViewMenus(const {%H-}Params: array of string); procedure cm_ConfigTreeViewMenusColors(const {%H-}Params: array of string); + procedure cm_OpenDriveByIndex(const Params: array of string); + procedure cm_MaximizePanel(const Params: array of string); // Internal commands procedure cm_ExecuteToolbarItem(const Params: array of string); @@ -358,7 +361,8 @@ DCOSUtils, DCStrUtils, DCBasicTypes, uFileSourceCopyOperation, fSyncDirsDlg, uHotDir, DCXmlConfig, dmCommonData, fOptionsFrame, foptionsDirectoryHotlist, fOptionsToolbar, fMainCommandsDlg, uConnectionManager, fOptionsTabs, fOptionsFavoriteTabs, - fTreeViewMenu, fOptionsTreeViewMenu, fOptionsTreeViewMenuColor, uArchiveFileSource + fTreeViewMenu, fOptionsTreeViewMenu, fOptionsTreeViewMenuColor, uArchiveFileSource, + ExtCtrls, uColumns {$IFDEF COLUMNSFILEVIEW_VTV} , uColumnsFileViewVtv {$ELSE} @@ -1474,6 +1478,19 @@ frmMain.ActiveNotebook.ActivatePrevTab; end; +procedure TMainCommands.cm_ActivateTabByIndex(const Params: array of string); +var Index: Integer; +begin + if Length(Params) <> 0 then + begin + Index := StrToIntDef(Params[0], 1); + if Index = -1 then + frmMain.ActiveNotebook.ActivateTabByIndex(Index) + else + frmMain.ActiveNotebook.ActivateTabByIndex(Index-1); + end; +end; + { TMainCommands.cm_SaveTabs } // To respect legacy, we can invoke "cm_SaveTabs" with a single parameter and it will be a "DefaultParam", which means without any equal sign, directly the filename. // With the following code, we may have more descriptive parameters like the following: @@ -4692,10 +4709,92 @@ if Editor.CanFocus then Editor.SetFocus; end; +procedure TMainCommands.cm_OpenDriveByIndex(const Params: array of string); +var drivesCount: Integer; + Index: Integer; +begin + if Length(Params) <> 0 then + begin + Index := StrToIntDef(Params[0], 1) - 1; + + drivesCount := frmMain.dskLeft.ButtonCount; + if Index < drivesCount then + begin + if frmMain.SelectedPanel = fpLeft then + frmMain.dskLeft.Buttons[Index].Click + else if frmMain.SelectedPanel = fpRight then + frmMain.dskRight.Buttons[Index].Click; + end; + end; +end; +procedure TMainCommands.cm_MaximizePanel(const Params: array of string); +var activeColumnsView: TColumnsFileView; + ColumnsClass: TPanelColumnsClass; + colWidthParam: String; + notActivePanel: TPanel; + notActiveDiskPanel: TPanel; + commaPos, strLen: Integer; + splitPos, colId, colWidth: Integer; +begin + activeColumnsView := frmMain.LeftTabs.ActivePage.FileView as TColumnsFileView; + ColumnsClass := ColSet.GetColumnSet(activeColumnsView.ActiveColm); + if frmMain.NotActiveFrame = frmMain.FrameLeft then + begin + notActivePanel := frmMain.pnlLeft; + notActiveDiskPanel := frmMain.pnlDskLeft; + splitPos := 0; + end + else + begin + notActivePanel := frmMain.pnlRight; + notActiveDiskPanel := frmMain.pnlDskRight; + splitPos := 100; + end; + + + if Length(Params) <> 0 then + begin + GetParamValue(Params[0], 'colwidth', colWidthParam); + commaPos := Pos(',', colWidthParam); + strLen := Length(colWidthParam); + colId := StrToIntDef( Copy(colWidthParam, 1, commaPos - 1), 1 ) - 1; + colWidth := StrToIntDef( Copy(colWidthParam, commaPos + 1, strLen - commaPos), gTempColWidth ); + + if notActivePanel.IsVisible then + begin + gTempColWidth := ColumnsClass.GetColumnWidth(colId); + ColumnsClass.SetColumnWidth(colId, colWidth); + end + else + begin + ColumnsClass.SetColumnWidth(colId, gTempColWidth); + end; + + frmMain.UpdateWindowView; + end; + + + if notActivePanel.IsVisible then + begin + notActivePanel.Hide; + notActiveDiskPanel.Hide; + frmMain.MainSplitter.Hide; + gTempSplitterPos := frmMain.MainSplitterPos; + DoPanelsSplitterPerPos(splitPos); + end + else + begin + DoPanelsSplitterPerPos(round(gTempSplitterPos)); + + notActivePanel.Show; + notActiveDiskPanel.Show; + frmMain.MainSplitter.Show; + end; +end; @@ -4712,5 +4811,8 @@ + + + end. | ||||
Fixed in Revision | 8335-8337 | ||||
Operating system | Windows | ||||
Widgetset | Win32 | ||||
Architecture | 32-bit, 64-bit | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2016-08-05 19:36 | mortalis | New Issue | |
2016-08-05 19:36 | mortalis | File Added: new_commands.patch | |
2016-08-07 17:05 | Alexx2000 | Status | new => acknowledged |
2018-09-03 06:51 | Alexx2000 | Target Version | => 0.9.0 |
2018-09-16 17:55 | Alexx2000 | Fixed in Revision | => 8335-8336 |
2018-09-16 17:57 | Alexx2000 | Assigned To | => Alexx2000 |
2018-09-16 17:57 | Alexx2000 | Status | acknowledged => assigned |
2018-09-16 18:25 | Alexx2000 | Fixed in Revision | 8335-8336 => 8335-8337 |
2018-12-10 08:58 | Alexx2000 | Note Added: 0002968 | |
2018-12-10 08:58 | Alexx2000 | Status | assigned => resolved |
2018-12-10 08:58 | Alexx2000 | Fixed in Version | => 0.9.0 |
2018-12-10 08:58 | Alexx2000 | Resolution | open => fixed |
2021-09-05 15:10 | Alexx2000 | Status | resolved => closed |