Skip to content

Commit

Permalink
simplify file tools (search/compre/combine
Browse files Browse the repository at this point in the history
 [UI] move tools to last place/collapsed in order to simplify UI #1181
  • Loading branch information
LiorBanai committed Dec 17, 2021
1 parent 3456bef commit 29d4221
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Analogy/CommonChangeLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ public static class CommonChangeLog
public static IEnumerable<AnalogyChangeLog> GetChangeLog()
{
return new List<AnalogyChangeLog>
{
{
new AnalogyChangeLog("V4.8.1 - NullReferenceException when opening List of Providers #1183",AnalogChangeLogType.Bug,"Lior Banai",new DateTime(2021,12,17)),
new AnalogyChangeLog("V4.8.1 - [UI] move tools to last place/collapsed in order to simplify UI #1181",AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2021,12,17)),
new AnalogyChangeLog("V4.8.1 - [UI] Move Data Visualizer to the more button #1182",AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2021,12,10)),
new AnalogyChangeLog("V4.8.1 - [DevExpress] Update DevExpress version to 21.2.4 Post NET6 Release #1152",AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2021,12,10)),
new AnalogyChangeLog("V4.8.1 - [.NET 3.1/5/6] missing DevExpress Assembly #1180",AnalogChangeLogType.Bug,"Lior Banai",new DateTime(2021,12,09)),
Expand Down
27 changes: 18 additions & 9 deletions Analogy/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1345,10 +1345,15 @@ private void AddOfflineDataSource(IAnalogyFactory primaryFactory, RibbonPage rib
string optionalText = !string.IsNullOrEmpty(offlineAnalogy.OptionalTitle)
? " for " + offlineAnalogy.OptionalTitle
: string.Empty;
RibbonPageGroup groupOfflineFileTools = new RibbonPageGroup($"Tools{optionalText}");
RibbonPageGroup groupOfflineFileTools = new RibbonPageGroup($"File Tools");
groupOfflineFileTools.AllowTextClipping = false;
ribbonPage.Groups.Add(groupOfflineFileTools);
AddSingleOfflineDataSource(primaryFactory, ribbonPage, offlineAnalogy, factory, group, groupOfflineFileTools);
var tools = new BarSubItem();
tools.Caption = "File Tools";
tools.RibbonStyle = RibbonItemStyles.All;
tools.ImageOptions.LargeImage = Resources.FileAction_32x32;
groupOfflineFileTools.ItemLinks.Add(tools);
AddSingleOfflineDataSource(primaryFactory, ribbonPage, offlineAnalogy, factory, group, tools);
}
else
{
Expand Down Expand Up @@ -1606,14 +1611,19 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)

//add tools

RibbonPageGroup groupOfflineFileTools = new RibbonPageGroup($"Tools for {factoryTitle}");
RibbonPageGroup groupOfflineFileTools = new RibbonPageGroup($"File Tools");
groupOfflineFileTools.AllowTextClipping = false;
ribbonPage.Groups.Add(groupOfflineFileTools);

var tools = new BarSubItem();
tools.Caption = "File Tools";
tools.RibbonStyle = RibbonItemStyles.All;
tools.ImageOptions.LargeImage = Resources.FileAction_32x32;
groupOfflineFileTools.ItemLinks.Add(tools);

BarSubItem searchFiles = new BarSubItem();
searchFiles.Caption = "Search in Files";
groupOfflineFileTools.ItemLinks.Add(searchFiles);
tools.ItemLinks.Add(searchFiles);
searchFiles.ImageOptions.Image = images?.GetSmallSearchImage(factoryId) ?? Resources.Lookup_Reference_32x32;
searchFiles.ImageOptions.LargeImage = images?.GetLargeSearchImage(factoryId) ?? Resources.Lookup_Reference_32x32;
searchFiles.RibbonStyle = RibbonItemStyles.All;
Expand All @@ -1632,7 +1642,7 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)

BarSubItem combineFiles = new BarSubItem();
combineFiles.Caption = "Combine Files";
groupOfflineFileTools.ItemLinks.Add(combineFiles);
tools.ItemLinks.Add(combineFiles);
combineFiles.ImageOptions.Image = images?.GetSmallCombineLogsImage(factoryId) ?? Resources.Sutotal_32x32;
combineFiles.ImageOptions.LargeImage = images?.GetLargeCombineLogsImage(factoryId) ?? Resources.Sutotal_32x32;
combineFiles.RibbonStyle = RibbonItemStyles.All;
Expand All @@ -1652,7 +1662,7 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)

BarSubItem compareFiles = new BarSubItem();
compareFiles.Caption = "Compare Files";
groupOfflineFileTools.ItemLinks.Add(compareFiles);
tools.ItemLinks.Add(compareFiles);
compareFiles.ImageOptions.Image = images?.GetSmallCompareLogsImage(factoryId) ?? Resources.TwoColumns;
compareFiles.ImageOptions.LargeImage = images?.GetLargeCompareLogsImage(factoryId) ?? Resources.TwoColumns;
compareFiles.RibbonStyle = RibbonItemStyles.All;
Expand All @@ -1671,7 +1681,7 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)


private void AddSingleOfflineDataSource(IAnalogyFactory primaryFactory, RibbonPage ribbonPage, IAnalogyOfflineDataProvider offlineAnalogy,
IAnalogyDataProvidersFactory factory, RibbonPageGroup group, RibbonPageGroup groupOfflineFileTools)
IAnalogyDataProvidersFactory factory, RibbonPageGroup group, BarSubItem groupOfflineFileTools)
{
Guid factoryId = factory.FactoryId;
string title = factory.Title;
Expand Down Expand Up @@ -1913,8 +1923,7 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
var combined = new FormCombineFiles(offlineAnalogy);
combined.Show(this);
};



BarButtonItem compareFiles = new BarButtonItem();
compareFiles.Caption = "Compare Files";
groupOfflineFileTools.ItemLinks.Add(compareFiles);
Expand Down
20 changes: 20 additions & 0 deletions Analogy/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Analogy/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -592,4 +592,10 @@
<data name="Watermark_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Watermark_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FileAction_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\FileAction_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FileAction_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\FileAction_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file added Analogy/Resources/FileAction_16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Analogy/Resources/FileAction_32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 29d4221

Please sign in to comment.