Skip to content

Commit de62cf3

Browse files
tduguidtduguid
authored andcommitted
Updated visible tag for ribbon buttons
1 parent e6b8379 commit de62cf3

File tree

5 files changed

+27
-267
lines changed

5 files changed

+27
-267
lines changed

CS/Properties/Settings.Designer.cs

Lines changed: 13 additions & 109 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CS/Properties/Settings.settings

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -32,39 +32,12 @@
3232
<Setting Name="Column_TypeText" Type="System.Int32" Scope="User">
3333
<Value Profile="(Default)">0</Value>
3434
</Setting>
35-
<Setting Name="Visible_grpScriptVariables" Type="System.Boolean" Scope="User">
36-
<Value Profile="(Default)">True</Value>
37-
</Setting>
38-
<Setting Name="Visible_grpFormatDataTable" Type="System.Boolean" Scope="User">
39-
<Value Profile="(Default)">True</Value>
40-
</Setting>
4135
<Setting Name="Visible_grpClipboard" Type="System.Boolean" Scope="User">
42-
<Value Profile="(Default)">True</Value>
43-
</Setting>
44-
<Setting Name="Visible_btnClearInteriorColor" Type="System.Boolean" Scope="User">
45-
<Value Profile="(Default)">True</Value>
46-
</Setting>
47-
<Setting Name="Visible_btnZeroToNull" Type="System.Boolean" Scope="User">
48-
<Value Profile="(Default)">True</Value>
49-
</Setting>
50-
<Setting Name="Option_PathFileListing" Type="System.String" Scope="User">
51-
<Value Profile="(Default)">C:\Temp</Value>
52-
</Setting>
53-
<Setting Name="Visible_btnFileList" Type="System.Boolean" Scope="User">
54-
<Value Profile="(Default)">True</Value>
55-
</Setting>
56-
<Setting Name="Option_PathFileListingSelect" Type="System.Boolean" Scope="User">
57-
<Value Profile="(Default)">True</Value>
58-
</Setting>
59-
<Setting Name="Visible_mnuScriptType" Type="System.Boolean" Scope="User">
60-
<Value Profile="(Default)">True</Value>
36+
<Value Profile="(Default)">False</Value>
6137
</Setting>
6238
<Setting Name="Table_ColumnName" Type="System.String" Scope="User">
6339
<Value Profile="(Default)">SCRIPT</Value>
6440
</Setting>
65-
<Setting Name="Visible_btnSeparateValues" Type="System.Boolean" Scope="User">
66-
<Value Profile="(Default)">True</Value>
67-
</Setting>
6841
<Setting Name="Table_ColumnSeparateValuesDelimiter" Type="System.Char" Scope="User">
6942
<Value Profile="(Default)">;</Value>
7043
</Setting>
@@ -104,5 +77,8 @@
10477
<Setting Name="App_PathNewIssue" Type="System.String" Scope="User">
10578
<Value Profile="(Default)">https://github.com/Office-projects/ScriptHelp/issues/new</Value>
10679
</Setting>
80+
<Setting Name="Visible_grpAnnotation" Type="System.Boolean" Scope="User">
81+
<Value Profile="(Default)">False</Value>
82+
</Setting>
10783
</Settings>
10884
</SettingsFile>

CS/Ribbon.xml

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ Or use the following tag to remove all other ribbons when this loads
6262
id="grpFormatDataTable"
6363
label="Format Data Table"
6464
imageMso="FormatAsTableGallery"
65-
getVisible="GetVisible"
6665
>
6766
<button
6867
id="btnFormatAsTable"
@@ -92,7 +91,6 @@ Or use the following tag to remove all other ribbons when this loads
9291
id="btnSeparateValues"
9392
label="Separate Values"
9493
onAction="OnAction"
95-
getVisible="GetVisible"
9694
imageMso="ChartSwitchRowColumn"
9795
size="normal"
9896
screentip="Separate Values"
@@ -118,7 +116,6 @@ Or use the following tag to remove all other ribbons when this loads
118116
label="Update to NULL"
119117
onAction="OnAction"
120118
getEnabled="GetEnabled"
121-
getVisible="GetVisible"
122119
imageMso="RecordsRefreshRecords"
123120
size="normal"
124121
screentip="Convert to NULL"
@@ -130,7 +127,6 @@ Or use the following tag to remove all other ribbons when this loads
130127
label="Clear Interior Color"
131128
onAction="OnAction"
132129
getEnabled="GetEnabled"
133-
getVisible="GetVisible"
134130
imageMso="TableEraser"
135131
size="normal"
136132
screentip="Clear Interior Color"
@@ -235,8 +231,8 @@ Or use the following tag to remove all other ribbons when this loads
235231
imageMso="FunctionWizard"
236232
label="Add Script Formula"
237233
size="large"
238-
screentip="Add Script Column"
239-
supertip="The selected button will change the script string format."
234+
screentip="Add Script Formula"
235+
supertip="The each button will change the column formula to the selected script string format."
240236
keytip="ADD"
241237
>
242238
<button
@@ -441,42 +437,11 @@ Or use the following tag to remove all other ribbons when this loads
441437
/>
442438
</menu>
443439
</group>
444-
<group
445-
id="grpOptions"
446-
label="Options"
447-
imageMso="PropertySheet"
448-
visible ="false">
449-
<button
450-
id="btnSettings2"
451-
label="Add-In Settings"
452-
onAction="OnAction"
453-
imageMso="PropertySheet"
454-
size="large"
455-
screentip="Add-In Settings Form"
456-
supertip="This opens a user form with a list of custom properties stored in the file."
457-
keytip="SET"
458-
/>
459-
<button
460-
id="btnFileList"
461-
label="Create File List"
462-
onAction="OnAction"
463-
getVisible="GetVisible"
464-
imageMso="GetExternalDataFromText"
465-
size="large"
466-
screentip="Create A File Listing"
467-
supertip="This will create a file listing of the user selected path recursively. It will save the .csv and .bat file in the root folder selected."
468-
keytip="LST"
469-
/>
470-
<button
471-
idMso="ComAddInsDialog"
472-
visible="false"
473-
size="large"
474-
/>
475-
</group>
476440
<group
477441
id="grpAnnotation"
478442
label="Annotate"
479-
imageMso="Camera">
443+
imageMso="Camera"
444+
getVisible="GetVisible">
480445
<button
481446
idMso="Camera"
482447
label="Excel Camera"

CS/Scripts/Ribbon.cs

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -396,18 +396,8 @@ public bool GetVisible(Office.IRibbonControl control)
396396
{
397397
case "grpClipboard":
398398
return Properties.Settings.Default.Visible_grpClipboard;
399-
case "grpFormatDataTable":
400-
return Properties.Settings.Default.Visible_grpFormatDataTable;
401-
case "grpScriptVariables":
402-
return Properties.Settings.Default.Visible_grpScriptVariables;
403-
case "btnClearInteriorColor":
404-
return Properties.Settings.Default.Visible_btnClearInteriorColor;
405-
case "btnZeroToNull":
406-
return Properties.Settings.Default.Visible_btnZeroToNull;
407-
case "btnSeparateValues":
408-
return Properties.Settings.Default.Visible_btnSeparateValues;
409-
case "btnFileList":
410-
return Properties.Settings.Default.Visible_btnFileList;
399+
case "grpAnnotation":
400+
return Properties.Settings.Default.Visible_grpAnnotation;
411401
case "btnScriptTypeTSqlCreateTable":
412402
case "btnScriptTypeTSqlInsertValues":
413403
case "btnScriptTypeTSqlMergeValues":
@@ -483,18 +473,12 @@ public void OnAction(Office.IRibbonControl control)
483473
case "btnSettings":
484474
OpenSettings();
485475
break;
486-
case "btnFileList":
487-
CreateFileList();
488-
break;
489476
case "btnOpenReadMe":
490477
OpenReadMe();
491478
break;
492479
case "btnOpenNewIssue":
493480
OpenNewIssue();
494481
break;
495-
case "btnDownloadNewVersion":
496-
//DownloadNewVersion();
497-
break;
498482
case "btnScriptTypeDqlAppend":
499483
Formula.DqlAppend();
500484
break;
@@ -1026,51 +1010,6 @@ public void SeparateValues()
10261010
}
10271011
}
10281012

1029-
/// <summary>
1030-
/// Creates a recursive file listing based on the users selected directory
1031-
/// </summary>
1032-
/// <remarks></remarks>
1033-
public void CreateFileList()
1034-
{
1035-
string filePath = Properties.Settings.Default.Option_PathFileListing;
1036-
try
1037-
{
1038-
ErrorHandler.CreateLogRecord();
1039-
DialogResult msgDialogResult = DialogResult.None;
1040-
FolderBrowserDialog dlg = new FolderBrowserDialog();
1041-
if (Properties.Settings.Default.Option_PathFileListingSelect == true)
1042-
{
1043-
dlg.RootFolder = Environment.SpecialFolder.MyComputer;
1044-
dlg.SelectedPath = filePath;
1045-
msgDialogResult = dlg.ShowDialog();
1046-
filePath = dlg.SelectedPath;
1047-
}
1048-
if (msgDialogResult == DialogResult.OK | Properties.Settings.Default.Option_PathFileListingSelect == false)
1049-
{
1050-
filePath += @"\";
1051-
string scriptCommands = string.Empty;
1052-
string currentDate = DateTime.Now.ToString("dd.MMM.yyyy_hh.mm.tt");
1053-
string batchFileName = filePath + "FileListing_" + currentDate + "_" + Environment.UserName + ".bat";
1054-
scriptCommands = "echo off" + Environment.NewLine;
1055-
scriptCommands += "cd %1" + Environment.NewLine;
1056-
scriptCommands += @"dir """ + filePath + @""" /s /a-h /b /-p /o:gen >""" + filePath + "FileListing_" + currentDate + "_" + Environment.UserName + @".csv""" + Environment.NewLine;
1057-
scriptCommands += @"""" + filePath + "FileListing_" + currentDate + "_" + Environment.UserName + @".csv""" + Environment.NewLine;
1058-
scriptCommands += "cd .. " + Environment.NewLine;
1059-
scriptCommands += "echo on" + Environment.NewLine;
1060-
System.IO.File.WriteAllText(batchFileName, scriptCommands);
1061-
AssemblyInfo.OpenFile(batchFileName);
1062-
}
1063-
}
1064-
catch (System.UnauthorizedAccessException)
1065-
{
1066-
MessageBox.Show("You don't have access to this folder, bro!" + Environment.NewLine + Environment.NewLine + filePath, "No action taken.", MessageBoxButtons.OK, MessageBoxIcon.Information);
1067-
}
1068-
catch (Exception ex)
1069-
{
1070-
ErrorHandler.DisplayMessage(ex);
1071-
}
1072-
}
1073-
10741013
/// <summary>
10751014
/// Opens the settings taskpane
10761015
/// </summary>

0 commit comments

Comments
 (0)