mirror of https://gitlab.com/basile.b/dexed.git
add MRU list for the projects groups
This commit is contained in:
parent
7bea816372
commit
1e957c8f2b
|
@ -1471,6 +1471,7 @@ object CEMainForm: TCEMainForm
|
|||
LCLVersion = '1.6.0.4'
|
||||
object mainMenu: TMainMenu
|
||||
Images = imgList
|
||||
top = 1
|
||||
object MenuItem1: TMenuItem
|
||||
Caption = 'File'
|
||||
object MenuItem5: TMenuItem
|
||||
|
@ -3755,6 +3756,46 @@ object CEMainForm: TCEMainForm
|
|||
D0FF3C94D1FF3E97D3EE000000000000000000000000FFFFFF00
|
||||
}
|
||||
end
|
||||
object mnuItemMruGroup: TMenuItem
|
||||
Caption = 'Open recent projects group'
|
||||
Bitmap.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000FFFFFF000000
|
||||
00000000000000000000000000000000001200000025000000330000002E0000
|
||||
00000000000000000000000000000000000000000000FFFFFF00FFFFFF000000
|
||||
0000000000120000002500000033326E987A3E8BC1C84195D1FF3892D1ED0000
|
||||
00330000003300000033000000330000003300000023FFFFFF00FFFFFF000000
|
||||
002F326F997C3D8AC1C74092CEFF54ADDEFF66C4EDFF78E0FEFF3591D1FFBBB2
|
||||
AAFFB0AEABFFADADABFFAEAEABFFAFAFADFFA4A4A2C0FFFFFF00FFFFFF004295
|
||||
CEEF58B0DFFF6DC9EFFF7FE2FDFF7EE3FEFF7ADEFCFF7EE1FFFF308CCDFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0B0ADFFFFFFFF00FFFFFF004094
|
||||
CFFF92F1FFFF85E7FFFF80E1FDFF7ADEFBFF77DBFBFF83E1FFFF308ACBFFFFFF
|
||||
FBFFFFFFFDFFFCFCFCFFFCFCFCFFFFFFFFFFAEAEABFFFFFFFF00FFFFFF003E92
|
||||
CEFF9AF0FFFF83E4FDFF7EDFFCFF7ADDFBFF76DAFAFF89E2FEFF48A8DDFF70AE
|
||||
D9FFFFFCF8FFF9F6F6FFF7F6F6FFFFFFFFFFADADABFFFFFFFF00FFFFFF003E92
|
||||
CEFFA3F1FFFF82E3FCFF7EDFFCFF7ADDFBFF76DAFAFF71D9FBFF9DE8FFFF2A89
|
||||
CBFFFFFBF6FFF6F4F3FFF4F3F3FFFFFFFFFFADADABFFFFFFFF00FFFFFF003D92
|
||||
CEFFADF3FFFF81E3FCFF7EDFFCFF7ADDFBFF76DAFAFF6FD8FAFFABEBFFFF2B89
|
||||
CCFFFFF8F1FFF2F1EFFFEFF0EEFFFFFFFFFFADADABFFFFFFFF00FFFFFF003C92
|
||||
CEFFB6F6FFFF80E3FCFF7DDFFCFF7ADDFBFF76DAFAFF6ED7FAFFB9EFFFFF2A89
|
||||
CCFFFCF2EDFFEEECEBFFEBEAEAFFFFFFFFFFADADABFFFFFFFF00FFFFFF003C91
|
||||
CEFFC0F8FFFF7FE2FCFF7DDFFCFF7ADDFBFF75DAFAFF6DD7FAFFC6F3FFFF2989
|
||||
CBFFFFF9F4FFFFFFFFFFFFFFFFFFFFFFFFFFAEAEABFFFFFFFF00FFFFFF003B91
|
||||
CEFFC9F9FFFF7EE2FCFF7CDEFCFF78DCFBFF72D9FAFF6AD6FAFFD2F6FFFF2888
|
||||
CBFFFFFFFFFFCDCBC9FFA4A4A2FFFFFFFFFFAFAFADFFFFFFFF00FFFFFF003A91
|
||||
CEFFD2FCFFFF7AE2FCFF77DDFCFF7FDFFBFF9BE6FDFFB3EDFFFFD4F9FFFF2688
|
||||
CBFFFFFFFFFFA7A5A2FFFFFFFFFFE9E9E9FFB0B0AEACFFFFFF00FFFFFF003991
|
||||
CFFFE9FFFFFFAFF0FFFFCEF7FFFFDAFAFFFFC4ECFCFF8CCAECFF5FAEE0FF82BD
|
||||
E6FFFFFFFFFFFFFFFFFFE9E9E9FFAFAFADA700000000FFFFFF00FFFFFF003C93
|
||||
D0FFE9FFFFFFA8DAF3FF7BBDE4FF4398D2FF408EC7FF6E9CBCFF90A5B2FFBAAF
|
||||
A6FFB5ADA6FFB5AFA9FFB5B1ADA40000000000000000FFFFFF00FFFFFF004297
|
||||
D2FF3B93D0FF62ADDCFF93CDEDFFBBE7FAFFD8FCFFFFD6FCFFFFD3FBFFFFD1FB
|
||||
FFFFD3FCFFFF2E91D5FF000000000000000000000000FFFFFF00FFFFFF00459A
|
||||
D3EF4498D2FF4197D1FF3F95D1FF3D94D0FF3B93D0FF3A92D0FF3A92D0FF3A93
|
||||
D0FF3C94D1FF3E97D3EE000000000000000000000000FFFFFF00
|
||||
}
|
||||
ImageIndex = 9
|
||||
end
|
||||
object MenuItem103: TMenuItem
|
||||
Action = actProjGroupClose
|
||||
Bitmap.Data = {
|
||||
|
|
|
@ -149,6 +149,7 @@ type
|
|||
MenuItem103: TMenuItem;
|
||||
MenuItem104: TMenuItem;
|
||||
MenuItem105: TMenuItem;
|
||||
mnuItemMruGroup: TMenuItem;
|
||||
MenuItem11: TMenuItem;
|
||||
MenuItem12: TMenuItem;
|
||||
MenuItem13: TMenuItem;
|
||||
|
@ -344,6 +345,7 @@ type
|
|||
fNativeProject: TCENativeProject;
|
||||
fProjMru: TCEMRUProjectList;
|
||||
fFileMru: TCEMRUDocumentList;
|
||||
fPrjGrpMru: TCEMRUProjectsGroupList;
|
||||
fWidgList: TCEWidgetList;
|
||||
fMesgWidg: TCEMessagesWidget;
|
||||
fEditWidg: TCEEditorWidget;
|
||||
|
@ -451,6 +453,7 @@ type
|
|||
procedure mruChange(Sender: TObject);
|
||||
procedure mruFileItemClick(Sender: TObject);
|
||||
procedure mruProjItemClick(Sender: TObject);
|
||||
procedure mruProjGroupItemClick(Sender: TObject);
|
||||
procedure mruClearClick(Sender: TObject);
|
||||
|
||||
// layout
|
||||
|
@ -484,15 +487,18 @@ type
|
|||
|
||||
TCEPersistentMainMrus = class(TWritableLfmTextComponent)
|
||||
private
|
||||
fProjMruPt: TCEMRUFileList;
|
||||
fFileMruPt: TCEMRUFileList;
|
||||
fProjMruPt: TCEMRUFileList;
|
||||
fPrjGrpMruPt: TCEMRUFileList;
|
||||
procedure setProjMru(value: TCEMRUFileList);
|
||||
procedure setFileMru(value: TCEMRUFileList);
|
||||
procedure setProjectsGroupMru(value: TCEMRUFileList);
|
||||
published
|
||||
property mostRecentFiles: TCEMRUFileList read fFileMruPt write setFileMru;
|
||||
property mostRecentprojects: TCEMRUFileList read fProjMruPt write setProjMru;
|
||||
property mostRecentProjectsGroups: TCEMRUFileList read fPrjGrpMruPt write setProjectsGroupMru;
|
||||
public
|
||||
procedure setTargets(projs: TCEMRUFileList; files: TCEMRUFileList);
|
||||
procedure setTargets(projs: TCEMRUFileList; files: TCEMRUFileList; group: TCEMRUFileList);
|
||||
end;
|
||||
|
||||
TCELastDocsAndProjs = class(TWritableLfmTextComponent)
|
||||
|
@ -526,6 +532,7 @@ type
|
|||
fCovModUt: boolean;
|
||||
fMaxRecentProjs: integer;
|
||||
fMaxRecentDocs: integer;
|
||||
fMaxRecentGroups: integer;
|
||||
fDcdPort: word;
|
||||
fRunnableDest: TCEPathname;
|
||||
fAlwaysUseDest: boolean;
|
||||
|
@ -552,6 +559,7 @@ type
|
|||
property reloadLastDocuments: boolean read fReloadLastDocuments write fReloadLastDocuments;
|
||||
property maxRecentProjects: integer read fMaxRecentProjs write fMaxRecentProjs;
|
||||
property maxRecentDocuments: integer read fMaxRecentDocs write fMaxRecentDocs;
|
||||
property maxRecentProjectsGroups: integer read fMaxRecentGroups write fMaxRecentGroups;
|
||||
property dubCompiler: TCECompiler read getDubCompiler write setDubCompiler;
|
||||
property nativeProjectCompiler: TCECompiler read getNativeProjecCompiler write setNativeProjecCompiler;
|
||||
property dscanUnittests: boolean read fDscanUnittests write fDscanUnittests default true;
|
||||
|
@ -757,7 +765,8 @@ begin
|
|||
fDscanUnittests := true;
|
||||
fSplitterScrollSpeed := 2;
|
||||
fMaxRecentProjs := 10;
|
||||
fMaxRecentDocs :=10;
|
||||
fMaxRecentDocs := 10;
|
||||
fMaxRecentGroups:= 10;
|
||||
fFlatLook:=true;
|
||||
end;
|
||||
|
||||
|
@ -851,6 +860,7 @@ begin
|
|||
begin
|
||||
fMaxRecentProjs:= CEMainForm.fProjMru.maxCount;
|
||||
fMaxRecentDocs:= CEMainForm.fFileMru.maxCount;
|
||||
fMaxRecentGroups:= CEMainForm.fPrjGrpMru.maxCount;
|
||||
fDcdPort := DcdWrapper.port;
|
||||
fCovModUt:= CEMainForm.fCovModUt;
|
||||
fDscanUnittests := CEMainForm.fDscanUnittests;
|
||||
|
@ -860,6 +870,7 @@ begin
|
|||
fDcdPort:=fBackup.fDcdPort;
|
||||
fMaxRecentDocs:= fBackup.fMaxRecentDocs;
|
||||
fMaxRecentProjs:= fBackup.fMaxRecentProjs;
|
||||
fMaxRecentGroups := fBackup.fMaxRecentGroups;
|
||||
fReloadLastDocuments:=fBackup.fReloadLastDocuments;
|
||||
fFloatingWidgetOnTop := fBackup.fFloatingWidgetOnTop;
|
||||
fFlatLook:=fBackup.fFlatLook;
|
||||
|
@ -877,6 +888,7 @@ begin
|
|||
CEMainForm.fCovModUt:= fCovModUt;
|
||||
CEMainForm.fProjMru.maxCount := fMaxRecentProjs;
|
||||
CEMainForm.fFileMru.maxCount := fMaxRecentDocs;
|
||||
CEMainForm.fPrjGrpMru.maxCount:= fMaxRecentGroups;
|
||||
CEMainForm.updateFloatingWidgetOnTop(fFloatingWidgetOnTop);
|
||||
CEMainForm.fDscanUnittests := fDscanUnittests;
|
||||
DcdWrapper.port:=fDcdPort;
|
||||
|
@ -886,6 +898,7 @@ begin
|
|||
begin
|
||||
fBackup.fMaxRecentDocs:= fMaxRecentDocs;
|
||||
fBackup.fMaxRecentProjs:= fMaxRecentProjs;
|
||||
fBackup.fMaxRecentGroups:= fMaxRecentGroups;
|
||||
fBackup.fReloadLastDocuments:=fReloadLastDocuments;
|
||||
fBackup.fFloatingWidgetOnTop:=fFloatingWidgetOnTop;
|
||||
fBackup.fDcdPort:=fDcdPort;
|
||||
|
@ -1119,10 +1132,17 @@ begin
|
|||
fFileMruPt.assign(value);
|
||||
end;
|
||||
|
||||
procedure TCEPersistentMainMrus.setTargets(projs: TCEMRUFileList; files: TCEMRUFileList);
|
||||
procedure TCEPersistentMainMrus.setProjectsGroupMru(value: TCEMRUFileList);
|
||||
begin
|
||||
fPrjGrpMruPt.assign(value);
|
||||
end;
|
||||
|
||||
procedure TCEPersistentMainMrus.setTargets(projs: TCEMRUFileList; files: TCEMRUFileList;
|
||||
group: TCEMRUFileList);
|
||||
begin
|
||||
fFileMruPt := files;
|
||||
fProjMruPt := projs;
|
||||
fPrjGrpMruPt := group;
|
||||
end;
|
||||
{$ENDREGION}
|
||||
|
||||
|
@ -1210,10 +1230,13 @@ procedure TCEMainForm.InitMRUs;
|
|||
begin
|
||||
fProjMru := TCEMRUProjectList.Create;
|
||||
fFileMru := TCEMRUDocumentList.Create;
|
||||
fPrjGrpMru:= TCEMRUProjectsGroupList.create;
|
||||
fProjMru.objectTag := mnuItemMruProj;
|
||||
fFileMru.objectTag := mnuItemMruFile;
|
||||
fPrjGrpMru.objectTag := mnuItemMruGroup;
|
||||
fProjMru.OnChange := @mruChange;
|
||||
fFileMru.OnChange := @mruChange;
|
||||
fPrjGrpMru.OnChange := @mruChange;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.InitWidgets;
|
||||
|
@ -1430,7 +1453,7 @@ begin
|
|||
fname := getCoeditDocPath + 'mostrecent.txt';
|
||||
if fname.fileExists then with TCEPersistentMainMrus.create(nil) do
|
||||
try
|
||||
setTargets(fFileMru, fProjMru);
|
||||
setTargets(fFileMru, fProjMru, fPrjGrpMru);
|
||||
loadFromFile(fname);
|
||||
finally
|
||||
Free;
|
||||
|
@ -1467,7 +1490,7 @@ begin
|
|||
// project and files MRU
|
||||
with TCEPersistentMainMrus.create(nil) do
|
||||
try
|
||||
setTargets(fFileMru, fProjMru);
|
||||
setTargets(fFileMru, fProjMru, fPrjGrpMru);
|
||||
saveToFile(getCoeditDocPath + 'mostrecent.txt');
|
||||
finally
|
||||
Free;
|
||||
|
@ -1756,6 +1779,7 @@ begin
|
|||
fWidgList.Free;
|
||||
fProjMru.Free;
|
||||
fFileMru.Free;
|
||||
fPrjGrpMru.Free;
|
||||
FreeRunnableProc;
|
||||
//
|
||||
fMainMenuSubj.Free;
|
||||
|
@ -1883,7 +1907,9 @@ begin
|
|||
if srcLst = fFileMru then
|
||||
clickTrg := @mruFileItemClick
|
||||
else if srcLst = fProjMru then
|
||||
clickTrg := @mruProjItemClick;
|
||||
clickTrg := @mruProjItemClick
|
||||
else if srcLst = fPrjGrpMru then
|
||||
clickTrg:= @mruProjGroupItemClick;
|
||||
|
||||
trgMnu.Clear;
|
||||
|
||||
|
@ -3241,12 +3267,23 @@ procedure TCEMainForm.mruProjItemClick(Sender: TObject);
|
|||
begin
|
||||
if checkProjectLock then
|
||||
exit;
|
||||
if (fProject <> nil) and not fProject.inGroup and
|
||||
fProject.modified and
|
||||
(dlgFileChangeClose(fProject.filename, UnsavedProj) = mrCancel) then exit;
|
||||
if (fProject <> nil) and not fProject.inGroup and fProject.modified and
|
||||
(dlgFileChangeClose(fProject.filename, UnsavedProj) = mrCancel) then
|
||||
exit;
|
||||
openProj(TMenuItem(Sender).Hint);
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.mruProjGroupItemClick(Sender: TObject);
|
||||
begin
|
||||
if checkProjectLock then
|
||||
exit;
|
||||
if fProjectGroup.groupModified and (dlgFileChangeClose(
|
||||
fProjectGroup.groupFilename, UnsavedPGrp) = mrCancel) then
|
||||
exit;
|
||||
fProjectGroup.closeGroup;
|
||||
fProjectGroup.openGroup(TMenuItem(Sender).Hint);
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actProjCloseExecute(Sender: TObject);
|
||||
begin
|
||||
if (fProject <> nil) and not fProject.inGroup and fProject.modified and
|
||||
|
@ -3346,11 +3383,13 @@ begin
|
|||
if dlgFileChangeClose(fProjectGroup.groupFilename, UnsavedPGrp) = mrCancel then
|
||||
exit;
|
||||
end;
|
||||
fProjectGroup.closeGroup;
|
||||
with TOpenDialog.Create(nil) do
|
||||
try
|
||||
if execute then
|
||||
begin
|
||||
fProjectGroup.openGroup(filename);
|
||||
fPrjGrpMru.Insert(0, filename);
|
||||
end;
|
||||
finally
|
||||
free;
|
||||
end;
|
||||
|
|
|
@ -74,6 +74,13 @@ type
|
|||
destructor destroy; override;
|
||||
end;
|
||||
|
||||
(**
|
||||
* MRU list for the ceodit projects group.
|
||||
* Managed manually since only 1 group exists.
|
||||
*)
|
||||
TCEMRUProjectsGroupList = class(TCEMRUFileList)
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
constructor TCEMruList.Create;
|
||||
|
|
Loading…
Reference in New Issue