Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ obj/
*.user
*.suo
*.vs/
Red Ink for Word/Red Ink for Word_TemporaryKey.pfx
Red Ink for Excel/Red Ink for Excel_TemporaryKey.pfx
Red Ink for Outlook/Red Ink for Outlook_TemporaryKey.pfx

17 changes: 9 additions & 8 deletions Red Ink for Excel/Red Ink for Excel.vbproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project ToolsVersion="17.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="17.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<!--
This section defines project-level properties.
Expand Down Expand Up @@ -44,21 +44,21 @@
<LoadBehavior>3</LoadBehavior>
</PropertyGroup>
<PropertyGroup Condition="'$(RedInkEnvironment)' == 'Develop'">
<ApplicationVersion>0.2.0.704</ApplicationVersion>
<ApplicationVersion>0.2.0.706</ApplicationVersion>
<PublishUrl>..\clickonce\apps\develop\excel\</PublishUrl>
<InstallUrl>https://redink.ai/apps/develop/excel/</InstallUrl>
<ProductName>Red Ink for Excel %28Develop%29</ProductName>
<FriendlyName>Red Ink for Excel %28Develop%29</FriendlyName>
</PropertyGroup>
<PropertyGroup Condition="'$(RedInkEnvironment)' == 'Preview'">
<ApplicationVersion>1.0.0.201</ApplicationVersion>
<ApplicationVersion>0.2.0.706</ApplicationVersion>
<PublishUrl>..\clickonce\apps\preview\excel\</PublishUrl>
<InstallUrl>https://redink.ai/apps/preview/excel/</InstallUrl>
<ProductName>Red Ink for Excel %28Preview%29</ProductName>
<FriendlyName>Red Ink for Excel %28Preview%29</FriendlyName>
</PropertyGroup>
<PropertyGroup Condition="'$(RedInkEnvironment)' == 'GA'">
<ApplicationVersion>1.0.0.1</ApplicationVersion>
<ApplicationVersion>0.2.0.706</ApplicationVersion>
<PublishUrl>..\clickonce\apps\ga\excel\</PublishUrl>
<InstallUrl>https://redink.ai/apps/ga/excel/</InstallUrl>
<ProductName>Red Ink for Excel</ProductName>
Expand Down Expand Up @@ -330,6 +330,7 @@
<Compile Include="ThisAddIn.vb">
<SubType>Code</SubType>
</Compile>
<None Include="Red Ink for Excel_TemporaryKey.pfx" />
<None Include="Resources\Red_Ink_Logo.png" />
<None Include="Resources\Red_Ink_Logo_Large.png" />
<None Include="Resources\Red_Ink_Logo_Medium.png" />
Expand Down Expand Up @@ -397,11 +398,10 @@
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>
</ManifestKeyFile>
<ManifestKeyFile>Red Ink for Excel_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>50229D23A3CA721BCA66C2ECC258074E6C6D6456</ManifestCertificateThumbprint>
<ManifestCertificateThumbprint>57EEC28D19491A027A48325DADFCB44B40614B27</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestTimestampUrl>http://timestamp.digicert.com</ManifestTimestampUrl>
Expand Down Expand Up @@ -444,4 +444,5 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>
</Project>

100 changes: 100 additions & 0 deletions Red Ink for Excel/Ribbon1.Designer.vb

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

79 changes: 79 additions & 0 deletions Red Ink for Excel/Ribbon1.vb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Imports Microsoft.Office.Tools.Ribbon
Imports Microsoft.Win32
Imports SharedLibrary.SharedLibrary
Public Class Ribbon1

Private Enum OfficeTheme
Expand Down Expand Up @@ -172,4 +173,82 @@ Public Class Ribbon1
Private Sub RI_Renamer_Click(sender As Object, e As RibbonControlEventArgs) Handles RI_Renamer.Click
Globals.ThisAddIn.RenameDocumentsWithAi()
End Sub

Private Sub RI_Model1_Click(sender As Object, e As RibbonControlEventArgs) Handles RI_Model1.Click
Globals.ThisAddIn.SelectModel(1)
End Sub

Private Sub RI_Model2_Click(sender As Object, e As RibbonControlEventArgs) Handles RI_Model2.Click
Globals.ThisAddIn.SelectModel(2)
End Sub

Private Sub RI_Model3_Click(sender As Object, e As RibbonControlEventArgs) Handles RI_Model3.Click
Globals.ThisAddIn.SelectModel(3)
End Sub

Private Sub RI_Model4_Click(sender As Object, e As RibbonControlEventArgs) Handles RI_Model4.Click
Globals.ThisAddIn.SelectModel(4)
End Sub

Private Sub RI_Model5_Click(sender As Object, e As RibbonControlEventArgs) Handles RI_Model5.Click
Globals.ThisAddIn.SelectModel(5)
End Sub

Private Sub RI_Model6_Click(sender As Object, e As RibbonControlEventArgs) Handles RI_Model6.Click
Globals.ThisAddIn.SelectModel(6)
End Sub

Private Sub RI_Model7_Click(sender As Object, e As RibbonControlEventArgs) Handles RI_Model7.Click
Globals.ThisAddIn.SelectModel(7)
End Sub

Private Sub RI_Model8_Click(sender As Object, e As RibbonControlEventArgs) Handles RI_Model8.Click
Globals.ThisAddIn.SelectModel(8)
End Sub

Private Sub RI_Model9_Click(sender As Object, e As RibbonControlEventArgs) Handles RI_Model9.Click
Globals.ThisAddIn.SelectModel(9)
End Sub

Private Sub RI_Model10_Click(sender As Object, e As RibbonControlEventArgs) Handles RI_Model10.Click
Globals.ThisAddIn.SelectModel(10)
End Sub

Public Sub UpdateModelsMenu()
Try
Dim available = ModelConfigManager.GetAvailableModels()
Dim current = ModelConfigManager.GetCurrentModelNumber()

For i = 1 To 10
Dim btn = GetModelButton(i)
If btn Is Nothing Then Continue For

If available.Contains(i) Then
btn.Visible = True
Dim label = ModelConfigManager.GetModelDisplayName(i)
btn.Label = If(i = current, $"{label} ??????", label)
Else
btn.Visible = False
End If
Next
Catch
' non-critical
End Try
End Sub

Private Function GetModelButton(i As Integer) As RibbonButton
Select Case i
Case 1 : Return RI_Model1
Case 2 : Return RI_Model2
Case 3 : Return RI_Model3
Case 4 : Return RI_Model4
Case 5 : Return RI_Model5
Case 6 : Return RI_Model6
Case 7 : Return RI_Model7
Case 8 : Return RI_Model8
Case 9 : Return RI_Model9
Case 10 : Return RI_Model10
End Select
Return Nothing
End Function
End Class
24 changes: 24 additions & 0 deletions Red Ink for Excel/ThisAddIn.vb
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,30 @@ Partial Public Class ThisAddIn
_context.InitialConfigFailed = False
_context.RDV = "Excel (" & Version & ")"
SharedMethods.InitializeConfig(_context, FirstTime, Reload)
Try
If Globals.Ribbons.Ribbon1 IsNot Nothing Then
Globals.Ribbons.Ribbon1.UpdateModelsMenu()
End If
Catch
' Ribbon may not be ready; ignore
End Try
End Sub
Public Shared Sub SelectModel(modelNumber As Integer)
Try
If ModelConfigManager.SelectModel(_context, modelNumber) Then
Try
If Globals.Ribbons.Ribbon1 IsNot Nothing Then
Globals.Ribbons.Ribbon1.UpdateModelsMenu()
End If
Catch
' non-critical
End Try
Else
SharedMethods.ShowCustomMessageBox($"Model {modelNumber} is not configured.")
End If
Catch ex As Exception
SharedMethods.ShowCustomMessageBox($"Error switching model: {ex.Message}")
End Try
End Sub
Private Function INIValuesMissing() As Boolean
Return SharedMethods.INIValuesMissing(_context)
Expand Down
19 changes: 13 additions & 6 deletions Red Ink for Outlook/Red Ink for Outlook.vbproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project ToolsVersion="17.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="17.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<!--
This section defines project-level properties.
Expand Down Expand Up @@ -44,21 +44,21 @@
<LoadBehavior>3</LoadBehavior>
</PropertyGroup>
<PropertyGroup Condition="'$(RedInkEnvironment)' == 'Develop'">
<ApplicationVersion>1.0.0.700</ApplicationVersion>
<ApplicationVersion>1.0.0.704</ApplicationVersion>
<PublishUrl>..\clickonce\apps\develop\outlook\</PublishUrl>
<InstallUrl>https://redink.ai/apps/develop/outlook/</InstallUrl>
<ProductName>Red Ink for Outlook %28Develop%29</ProductName>
<FriendlyName>Red Ink for Outlook %28Develop%29</FriendlyName>
</PropertyGroup>
<PropertyGroup Condition="'$(RedInkEnvironment)' == 'Preview'">
<ApplicationVersion>1.0.0.201</ApplicationVersion>
<ApplicationVersion>1.0.0.704</ApplicationVersion>
<PublishUrl>..\clickonce\apps\preview\outlook\</PublishUrl>
<InstallUrl>https://redink.ai/apps/preview/outlook/</InstallUrl>
<ProductName>Red Ink for Outlook %28Preview%29</ProductName>
<FriendlyName>Red Ink for Outlook %28Preview%29</FriendlyName>
</PropertyGroup>
<PropertyGroup Condition="'$(RedInkEnvironment)' == 'GA'">
<ApplicationVersion>1.0.0.1</ApplicationVersion>
<ApplicationVersion>1.0.0.704</ApplicationVersion>
<PublishUrl>..\clickonce\apps\ga\outlook\</PublishUrl>
<InstallUrl>https://redink.ai/apps/ga/outlook/</InstallUrl>
<ProductName>Red Ink for Outlook</ProductName>
Expand Down Expand Up @@ -352,6 +352,7 @@
</EmbeddedResource>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Red Ink for Outlook_TemporaryKey.pfx" />
<None Include="ThisAddIn.Designer.xml">
<DependentUpon>ThisAddIn.vb</DependentUpon>
</None>
Expand Down Expand Up @@ -411,7 +412,7 @@
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>50229D23A3CA721BCA66C2ECC258074E6C6D6456</ManifestCertificateThumbprint>
<ManifestCertificateThumbprint>8E06065937D5D7EC8032A31BA69ADFD651394DFB</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -433,6 +434,9 @@
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>Red Ink for Outlook_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<!-- Include the build rules for a Visual Basic project. -->
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- Include additional build rules for an Office application add-in. -->
Expand All @@ -448,4 +452,7 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>
</Project>



Loading