View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000718 | Double Commander | Graphical user interface | public | 2013-08-27 00:58 | 2017-09-04 08:24 |
| Reporter | hubalu | Assigned To | cobines | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Projection | none | ETA | none | ||
| Product Version | 0.6.0 (trunk) | ||||
| Fixed in Version | 0.5.7 | ||||
| Summary | 0000718: [PATCH] Fixed rename inactive tab | ||||
| Description | Currently it is not possible to rename any tab via right-click context menu because it will always rename the currently selected tab. This patch will solve this issue by adding a new procedure DoRenameTab(Page: TFileViewPage) to the commands. | ||||
| Steps To Reproduce | 1. open multiple different tabs 2. right click on a tab that is not active 3. choose Rename tab from the menu | ||||
| Tags | No tags attached. | ||||
| Attached Files | RenameTab.patch (2,541 bytes)
Index: src/fmain.lfm
===================================================================
--- src/fmain.lfm (revision 5288)
+++ src/fmain.lfm (working copy)
@@ -3133,6 +3133,7 @@
end
object miRenameTab: TMenuItem
Action = actRenameTab
+ OnClick = mnuTabMenuClick
end
object miLine14: TMenuItem
Caption = '-'
Index: src/fmain.pas
===================================================================
--- src/fmain.pas (revision 5288)
+++ src/fmain.pas (working copy)
@@ -1920,6 +1920,8 @@
if MenuItem = miCloseTab then
Commands.DoCloseTab(NoteBook, pmTabMenu.Tag)
+ else if MenuItem = miRenameTab then
+ Commands.DoRenameTab(NoteBook.Page[pmTabMenu.Tag])
else if MenuItem = miTabOptionNormal then
NoteBook.Page[pmTabMenu.Tag].LockState := tlsNormal
else if MenuItem = miTabOptionPathLocked then
Index: src/umaincommands.pas
===================================================================
--- src/umaincommands.pas (revision 5288)
+++ src/umaincommands.pas (working copy)
@@ -64,6 +64,7 @@
procedure DoCloseTab(Notebook: TFileViewNotebook; PageIndex: Integer);
procedure DoCopySelectedFileNamesToClipboard(FileView: TFileView; FullNames: Boolean);
procedure DoNewTab(Notebook: TFileViewNotebook);
+ procedure DoRenameTab(Page: TFileViewPage);
procedure DoContextMenu(Panel: TFileView; X, Y: Integer; Background: Boolean);
procedure DoTransferPath(SourcePage: TFileViewPage; TargetPage: TFileViewPage; FromActivePanel: Boolean);
procedure DoSortByFunctions(View: TFileView; FileFunctions: TFileFunctions);
@@ -450,6 +451,15 @@
NewPage.MakeActive;
end;
+procedure TMainCommands.DoRenameTab(Page: TFileViewPage);
+var
+ sCaption: UTF8String;
+begin
+ sCaption := Page.CurrentTitle;
+ if InputQuery(rsMsgTabRenameCaption, rsMsgTabRenamePrompt, sCaption) then
+ Page.PermanentTitle := sCaption;
+end;
+
procedure TMainCommands.DoOpenVirtualFileSystemList(Panel: TFileView);
var
FileSource: IFileSource;
@@ -1045,17 +1055,8 @@
end;
procedure TMainCommands.cm_RenameTab(const Params: array of string);
-var
- sCaption: UTF8String;
- Page: TFileViewPage;
begin
- with frmMain do
- begin
- Page := ActiveNotebook.ActivePage;
- sCaption:= Page.CurrentTitle;
- if InputQuery(rsMsgTabRenameCaption, rsMsgTabRenamePrompt, sCaption) then
- Page.PermanentTitle := sCaption;
- end;
+ DoRenameTab(frmMain.ActiveNotebook.ActivePage);
end;
procedure TMainCommands.cm_CloseTab(const Params: array of string);
| ||||
| Fixed in Revision | 5289,5298 | ||||
| Operating system | Windows | ||||
| Widgetset | |||||
| Architecture | |||||
|
|
Hi. I have applied the patch because it is good. Thanks. But these changes in Lazarus r41683 http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/lcl/include/menuitem.inc?view=markup&revision=41683&root=lazarus have broken all the menu items that have actions assigned. Now both the menu item OnClick handler and the action are called. Will have to fix this later. Not to confuse that your patch causes this. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2013-08-27 00:58 | hubalu | New Issue | |
| 2013-08-27 00:58 | hubalu | File Added: RenameTab.patch | |
| 2013-08-31 13:00 | cobines | Fixed in Revision | => 5289 |
| 2013-08-31 13:00 | cobines | Note Added: 0001127 | |
| 2013-08-31 13:00 | cobines | Status | new => resolved |
| 2013-08-31 13:00 | cobines | Fixed in Version | => 0.6.0 |
| 2013-08-31 13:00 | cobines | Resolution | open => fixed |
| 2013-08-31 13:00 | cobines | Assigned To | => cobines |
| 2013-08-31 13:01 | cobines | Note Edited: 0001127 | |
| 2013-09-15 13:48 | Alexx2000 | Fixed in Revision | 5289 => 5289,5298 |
| 2013-09-15 13:48 | Alexx2000 | Fixed in Version | 0.6.0 => 0.5.7 |
| 2017-09-04 08:24 | Alexx2000 | Status | resolved => closed |