Skip to content

Commit e4b4087

Browse files
committed
Move Open File to be the first fix #1776
1 parent 466b40c commit e4b4087

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed

Analogy/CommonChangeLog.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ public static class CommonChangeLog
88
public static IEnumerable<AnalogyChangeLog> GetChangeLog()
99
{
1010
return new List<AnalogyChangeLog>
11-
{
11+
{
12+
new ("V4.14.2 - Move Open File to be the first #1776",AnalogChangeLogType.Feature,"Lior Banai",new DateTime(2023,07,07)),
1213
new ("V4.14.2 - Fix built-in prasers #1775",AnalogChangeLogType.Bug,"Lior Banai",new DateTime(2023,07,07)),
1314
new ("V4.14.1 - Add Analogy.LogViewer.FFmpeg tool #1755",AnalogChangeLogType.Feature,"Lior Banai",new DateTime(2023, 06, 03)),
1415
new ("V4.14.1 - Enable User Control Only Tab #1754",AnalogChangeLogType.Feature,"Lior Banai",new DateTime(2023, 06, 02)),

Analogy/Forms/MainForm.cs

+27-27
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ private async void AnalogyMainForm_Load(object sender, EventArgs e)
215215
foreach (FactoryContainer fc in FactoriesManager.Instance.Factories
216216
.Where(factory => !FactoriesManager.Instance.IsBuiltInFactory(factory.Factory) &&
217217
factory.FactorySetting.Status != DataProviderFactoryStatus.Disabled
218-
&& (factory.DataProvidersFactories.Any(d=>d.DataProviders.Any()
218+
&& (factory.DataProvidersFactories.Any(d => d.DataProviders.Any()
219219
|| factory.UserControlsFactories.Any()))))
220220
{
221221
CreateDataSource(fc, 3);
@@ -273,7 +273,7 @@ private async void AnalogyMainForm_Load(object sender, EventArgs e)
273273
}
274274
if (settings.ShowWhatIsNewAtStartup)
275275
{
276-
//settings.ShowWhatIsNewAtStartup = false;
276+
//settings.ShowWhatIsNewAtStartup = false;
277277
}
278278
}
279279

@@ -331,7 +331,7 @@ private void PopulateGlobalTools()
331331
var allFactories = FactoriesManager.Instance.Factories.ToList();
332332
allFactories.AddRange(FactoriesManager.Instance.BuiltInFactories);
333333
foreach (FactoryContainer fc in allFactories
334-
.Where(factory => factory.FactorySetting.Status != DataProviderFactoryStatus.Disabled
334+
.Where(factory => factory.FactorySetting.Status != DataProviderFactoryStatus.Disabled
335335
&& factory.CustomActionsFactories.Any()))
336336
{
337337
var actionFactories = fc.CustomActionsFactories;
@@ -419,15 +419,15 @@ private void SetupEventHandlers()
419419
{
420420
Utils.OpenLink("https://www.binance.com/en/register?ref=V8P114PE");
421421
};
422-
dockManager1.ClosingPanel += (s, e) =>
422+
dockManager1.ClosingPanel += (s, e) =>
423423
{
424-
Control control = e.Panel.ActiveControl;
425-
if (control != null)
426-
{
427-
control.Dispose();
428-
}
429-
var workspace = Utils.GetLogWindows<IAnalogyWorkspace>(this);
430-
workspace?.SaveCurrentWorkspace();
424+
Control control = e.Panel.ActiveControl;
425+
if (control != null)
426+
{
427+
control.Dispose();
428+
}
429+
var workspace = Utils.GetLogWindows<IAnalogyWorkspace>(this);
430+
workspace?.SaveCurrentWorkspace();
431431
};
432432
bbtnSponsorOpenCollection.ItemClick +=
433433
(s, e) => Utils.OpenLink("https://opencollective.com/analogy-log-viewer");
@@ -566,9 +566,9 @@ private void SetupEventHandlers()
566566
Show();
567567
}
568568
};
569-
569+
570570
bbiBookmarks.ItemClick += (s, e) => OpenBookmarkLog();
571-
571+
572572
}
573573

574574
private async Task OpenOfflineLogs(RibbonPage ribbonPage, string[] filenames,
@@ -577,7 +577,7 @@ private async Task OpenOfflineLogs(RibbonPage ribbonPage, string[] filenames,
577577
{
578578
OpenedWindows++;
579579
await FactoriesManager.Instance.InitializeIfNeeded(dataProvider);
580-
string fullTitle = $"{offlineTitle} #{OpenedWindows}{(title == null ? "" : $" ({title})")}";
580+
string fullTitle = $"{offlineTitle} #{OpenedWindows}{(title == null ? "" : $" ({title})")}";
581581
UserControl offlineUC = new LocalLogFilesUC(dataProvider, filenames, title: fullTitle);
582582
var page = dockManager1.AddPanel(DockingStyle.Float);
583583
page.DockedAsTabbedDocument = true;
@@ -1460,7 +1460,7 @@ async Task OpenOffline(string titleOfDataSource, IAnalogyOfflineDataProvider dat
14601460
{
14611461
OpenedWindows++;
14621462
await FactoriesManager.Instance.InitializeIfNeeded(dataProvider);
1463-
string fullTitle = $"{offlineTitle} #{OpenedWindows} ({titleOfDataSource})";
1463+
string fullTitle = $"{offlineTitle} #{OpenedWindows} ({titleOfDataSource})";
14641464
UserControl offlineUC = new LocalLogFilesUC(dataProvider, files, initialFolder, title: fullTitle);
14651465
var page = dockManager1.AddPanel(DockingStyle.Float);
14661466
page.DockedAsTabbedDocument = true;
@@ -1486,7 +1486,7 @@ async Task OpenExternalDataSource(string titleOfDataSource, IAnalogyOfflineDataP
14861486
}
14871487

14881488
async Task OpenFilePooling(string titleOfDataSource, IAnalogyOfflineDataProvider dataProvider,
1489-
string initialFolder, string file, string initialFile)
1489+
string initialFolder, string file, string initialFile)
14901490
{
14911491

14921492
OpenedWindows++;
@@ -1591,8 +1591,8 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
15911591
{
15921592
//add Open files entry
15931593
BarSubItem openFiles = new BarSubItem();
1594-
openFiles.Caption = "Open Files";
1595-
group.ItemLinks.Add(openFiles);
1594+
openFiles.Caption = "Open File";
1595+
group.ItemLinks.Insert(0, openFiles);
15961596
openFiles.ImageOptions.Image = Resources.Article_16x16;
15971597
openFiles.ImageOptions.LargeImage = Resources.Article_32x32;
15981598
openFiles.RibbonStyle = RibbonItemStyles.All;
@@ -1684,7 +1684,7 @@ await OpenOffline(dataProvider.OptionalTitle, dataProvider,
16841684
filePoolingBtn.Caption = caption;
16851685
filePoolingBtn.SuperTip =
16861686
Utils.GetSuperTip(caption, "Monitor file for changes in real time and reload the file automatically");
1687-
group.ItemLinks.Add(filePoolingBtn);
1687+
group.ItemLinks.Insert(1, filePoolingBtn);
16881688
filePoolingBtn.ImageOptions.Image = images?.GetSmallFilePoolingImage(factoryId) ?? Resources.FilePooling_16x16;
16891689
filePoolingBtn.ImageOptions.LargeImage = images?.GetLargeFilePoolingImage(factoryId) ?? Resources.FilePooling_32x32;
16901690
filePoolingBtn.RibbonStyle = RibbonItemStyles.All;
@@ -1718,7 +1718,7 @@ await OpenFilePooling(dataProvider.OptionalTitle, dataProvider,
17181718

17191719

17201720
//add recent
1721-
group.ItemLinks.Add(recentBar);
1721+
group.ItemLinks.Insert(2, recentBar);
17221722
foreach (var dataProvider in offlineProviders)
17231723
{
17241724
var recents = settings.GetRecentFiles(dataProvider.Id)
@@ -1824,7 +1824,7 @@ async Task OpenOffline(string titleOfDataSource, string initialFolder, string[]
18241824
{
18251825
OpenedWindows++;
18261826
await FactoriesManager.Instance.InitializeIfNeeded(offlineAnalogy);
1827-
string fullTitle = $"{offlineTitle} #{OpenedWindows} ({titleOfDataSource})";
1827+
string fullTitle = $"{offlineTitle} #{OpenedWindows} ({titleOfDataSource})";
18281828
UserControl offlineUC = new LocalLogFilesUC(offlineAnalogy, files, initialFolder, title: fullTitle);
18291829
var page = dockManager1.AddPanel(DockingStyle.Float);
18301830
page.DockedAsTabbedDocument = true;
@@ -1851,11 +1851,11 @@ async Task OpenExternalDataSource(string titleOfDataSource, IAnalogyOfflineDataP
18511851

18521852
}
18531853

1854-
void OpenFilePooling(string titleOfDataSource, string initialFolder, string file, string initialFile)
1854+
void OpenFilePooling(string titleOfDataSource, string initialFolder, string file, string initialFile)
18551855
{
18561856

18571857
OpenedWindows++;
1858-
string fullTitle = $"{filePoolingTitle} #{filePooling++} ({titleOfDataSource})";
1858+
string fullTitle = $"{filePoolingTitle} #{filePooling++} ({titleOfDataSource})";
18591859
UserControl filepoolingUC = new FilePoolingUCLogs(offlineAnalogy, file, initialFile, initialFolder, title: fullTitle);
18601860
var page = dockManager1.AddPanel(DockingStyle.Float);
18611861
page.DockedAsTabbedDocument = true;
@@ -1963,8 +1963,8 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
19631963
{
19641964
//add Open files entry
19651965
BarButtonItem openFiles = new BarButtonItem();
1966-
openFiles.Caption = "Open Files";
1967-
group.ItemLinks.Add(openFiles);
1966+
openFiles.Caption = "Open File";
1967+
group.ItemLinks.Insert(0, openFiles);
19681968
openFiles.ImageOptions.Image = offlineAnalogy.SmallImage ?? Resources.Article_16x16;
19691969
openFiles.ImageOptions.LargeImage = offlineAnalogy.LargeImage ?? Resources.Article_32x32;
19701970
openFiles.RibbonStyle = RibbonItemStyles.All;
@@ -1990,7 +1990,7 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
19901990
filePoolingBtn.Caption = caption;
19911991
filePoolingBtn.SuperTip =
19921992
Utils.GetSuperTip(caption, "Monitor file for changes in real time and reload the file automatically");
1993-
group.ItemLinks.Add(filePoolingBtn);
1993+
group.ItemLinks.Insert(1, filePoolingBtn);
19941994
filePoolingBtn.ImageOptions.Image = images?.GetSmallFilePoolingImage(factoryId) ?? Resources.FilePooling_16x16;
19951995
filePoolingBtn.ImageOptions.LargeImage = images?.GetLargeFilePoolingImage(factoryId) ?? Resources.FilePooling_32x32;
19961996
filePoolingBtn.RibbonStyle = RibbonItemStyles.All;
@@ -2024,7 +2024,7 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
20242024
}
20252025

20262026
//add recent
2027-
group.ItemLinks.Add(recentBar);
2027+
group.ItemLinks.Insert(2, recentBar);
20282028
var recents = settings.GetRecentFiles(offlineAnalogy.Id)
20292029
.Select(itm => itm.FileName).ToList();
20302030
AddRecentFiles(ribbonPage, recentBar, offlineAnalogy, title, recents);

0 commit comments

Comments
 (0)