Changeset 16720


Ignore:
Timestamp:
Aug 29, 2017, 1:25:10 PM (3 years ago)
Author:
jamado
Message:

ms plugin gui adjustments and bug fix; lo plugin bug fix

Location:
internals/2017/PluginAssinaturaOfficeSuite
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-lo-plugin/source/org/libreoffice/extension/comp/CommandExecutor.java

    r16675 r16720  
    1414       
    1515        /**
    16          * Execute the command described by @inline_cmd in a separate process and returns it's output.
     16         * Execute the command described by @cmdline in a separate process and returns it's output.
    1717         *
    18          * @param inline_cmd - String representation of the command line to be executed by the system.
     18         * @param cmdline - String representation of the command line to be executed by the system.
    1919         * @return String representation of the command's output if execution successful, returns null on thrown exception.
    2020         */
     
    3939        }
    4040       
     41        /**
     42         * Execute the process described by @cmd in a separate thread.
     43         *
     44         * @param cmd command line to call the desired process.
     45         */
    4146        public void executeCommandWithThread(final String cmd) {
    4247       
     
    5055        }
    5156       
     57        /**
     58         * Executes terminal commands and creates a corresponding Process instance.
     59         *
     60         * @param cmdline command line to call the desired process.
     61         * @return new Process instance of the process called by @cmdline
     62         */
    5263        public Process getProc(String cmdline) {
    5364                String cmd[] = cmdline.split(" ");
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-lo-plugin/source/org/libreoffice/extension/comp/MiddlewareConnector.java

    r16689 r16720  
    4747                        }
    4848                } else if(this.configurator.getOsPrefix().equals("mac")) {
    49                         if(result.contains("version")) { //Does this condition always stand??
     49                        if(result.contains("version")) {
    5050                                return true;
    5151                        }
     
    6969                cmd.append(" ");
    7070                cmd.append(signMode);
    71                 cmd.append(" \"");
     71                cmd.append(" ");
    7272                cmd.append(temp.getAbsolutePath());
    73                 cmd.append("\"");
    74                 System.out.println(cmd.toString());
    7573                this.executor.executeCommandWithThread(cmd.toString());
    7674        }
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-lo-plugin/source/org/libreoffice/extension/comp/PteidLOExtensionImpl.java

    r16679 r16720  
    2424                          com.sun.star.task.XJobExecutor
    2525{
    26         private static boolean check;
    27         private static boolean isInstalled;
    28         private static MiddlewareConnector mwConn;
     26       
     27        private MiddlewareConnector mwConn;
    2928    private final XComponentContext m_xContext;
    3029    private static final String m_implementationName = PteidLOExtensionImpl.class.getName();
     
    3534    {
    3635        this.m_xContext = xContext;
    37         if(!check) { //verify middleware installation; check only once
    38                 mwConn = new MiddlewareConnector(this.m_xContext);
    39                 if(mwConn.isInstalled()) {
    40                         isInstalled = true;
    41                         System.out.println("installed");
    42                 }
    43                 check = true;
    44         }
     36                this.mwConn = new MiddlewareConnector(this.m_xContext);
    4537       
    4638    };
     
    9587        }
    9688        if(event.equals(actionNames[0])) {
    97                 mwConn.basicSignature(temp);
     89                this.mwConn.basicSignature(temp);
    9890        } else if(event.equals(actionNames[1])){
    99                 mwConn.advancedSignature(temp);
     91                this.mwConn.advancedSignature(temp);
    10092        } else {
    10193                System.out.println("ERROR: Action defaulted!");
     
    111103    private boolean verify() {
    112104        /*Check if middleware is installed*/
    113         if(!isInstalled) {
     105        if(!this.mwConn.isInstalled()) {
    114106                InstallDialog install = new InstallDialog(this.m_xContext);
    115107                install.show();
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-lo-plugin/source/org/libreoffice/extension/helper/FileHelper.java

    r16689 r16720  
    6161                        temp = File.createTempFile("temp", ".pdf"); //default temporary
    6262                        XStorable storable = getStorable(xContext, false);
     63                        System.out.println(convertToURL(xContext, temp)); //REMOVE
    6364                        storable.storeToURL(convertToURL(xContext, temp), mediaDescriptor);
    6465                       
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-ms-plugin/PteidPluginSetup/Product.wxs

    r16700 r16720  
    1717      <ComponentRef Id="Remove_File" />
    1818                </Feature>
     19 
     20  <!-- Pre-requesites for installation -->
     21  <PropertyRef Id="NETFRAMEWORK40CLIENT" />
     22  <PropertyRef Id="NETFRAMEWORK40FULL" />
     23  <Condition Message="This tool requires .NET Framework 4.0. Please install the .NET Framework then run this installer again.">
     24    <![CDATA[NETFRAMEWORK40CLIENT OR NETFRAMEWORK40FULL]]>
     25  </Condition>
     26 
     27  <Property Id="VSTOR40">
     28    <RegistrySearch Id="VSTOR_Installed"
     29                    Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R" Name="VSTORFeature_CLR40" Type="raw"/>
     30  </Property>
     31  <Condition Message="This tool requires the VSTO 4.0 Runtime. Please install the VSTO runtime then run this installer again.">
     32    VSTOR40
     33  </Condition>
     34 
    1935        </Product>
    2036
    21   <Fragment>
    22     <PropertyRef Id="NETFRAMEWORK40" />
    23     <Condition Message="This tool requires .NET Framework 4.0. Please install the .NET Framework then run this installer again.">
    24       <![CDATA[Installed OR NETFRAMEWORK40]]>
    25     </Condition>
    26  
    27     <Property Id="VSTOR40">
    28       <RegistrySearch Id="VSTOR_Installed"
    29                       Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R" Name="VSTORFeature_CLR40" Type="raw"/>
    30     </Property>
    31     <Condition Message="This tool requires the VSTO 4.0 Runtime. Please install the VSTO runtime then run this installer again.">
    32       <![CDATA[Installed OR (VSTOR40  OR NOT OFFICE2007)]]>
    33     </Condition>
    34   </Fragment> 
    35  
    3637        <Fragment>
    3738                <Directory Id="TARGETDIR" Name="SourceDir">
    38                         <Directory Id="PersonalFolder">
     39                        <Directory Id="AppDataFolder"> <!-- Default installation dir AppData -->
    3940        <Directory Id="INSTALLFOLDER" Name="PteidWordPluginSetup">
    4041          <Component Id="Registry_FriendlyName" Win64="no" >
     
    6566          </Component>
    6667         
    67           <Component Id="Remove_File" Guid="abc77eb6-ba80-4f35-bf52-00230b0fd3fb">
     68          <Component Id="Remove_File" Guid="f1ee5cfd-0aa4-4b49-b6f0-1eaa2f044190">
    6869            <RemoveFolder Id="rm" On="uninstall"/>
    6970            <RegistryValue Id="RegKey_ProdComp0" Root="HKCU" KeyPath="yes"
     
    8182    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
    8283
    83       <Component Id="PteidWordPlugin_vsto_Component" Win64="no" Guid="cbb77eb6-ba80-4da5-bf52-00230b0fd3fb">
     84      <Component Id="PteidWordPlugin_vsto_Component" Win64="no" Guid="f1ee5cfd-0aa4-4b49-b6f0-1eaa2f044191">
    8485        <File Id="PteidWordPlugin_vsto"
    8586              Name="PteidWordPlugin.vsto" Source="$(var.AddinFiles)"></File>
     
    9091      </Component>
    9192
    92       <Component Id="PteidWordPlugin_dll_manifest_Component" Win64="no"  Guid="825bcfd2-ef8e-4b0f-8248-612510555f6f" >
     93      <Component Id="PteidWordPlugin_dll_manifest_Component" Win64="no"  Guid="f1ee5cfd-0aa4-4b49-b6f0-1eaa2f044192" >
    9394        <File Id="PteidWordPlugin_dll_manifest"
    9495              Name="PteidWordPlugin.dll.manifest" Source="$(var.AddinFiles)"></File>
     
    99100      </Component>
    100101
    101       <Component Id="PteidWordPlugin_dll_config_Component" Win64="no"  Guid="f1ee5cfd-0aa4-4b49-b6f0-1eaa2f044190">
     102      <Component Id="PteidWordPlugin_dll_config_Component" Win64="no"  Guid="f1ee5cfd-0aa4-4b49-b6f0-1eaa2f044193">
    102103        <File Id="PteidWordPlugin_dll_config"
    103104              Name="PteidWordPlugin.dll.config" Source="$(var.AddinFiles)" />
     
    108109      </Component>
    109110
    110       <Component Id="MSOfficeToolsCommon_dll_Component" Win64="no"  Guid="72f2fc02-46ee-4a8e-a46a-645ea14c2930">
     111      <Component Id="MSOfficeToolsCommon_dll_Component" Win64="no"  Guid="f1ee5cfd-0aa4-4b49-b6f0-1eaa2f044194">
    111112        <File Id="MSOfficeToolsCommon_dll"
    112113              Name="Microsoft.Office.Tools.Common.v4.0.Utilities.dll" Source="$(var.AddinFiles)"></File>
     
    117118      </Component>
    118119
    119       <Component Id="MSOfficeToolsCommon_Common_dll_Component" Win64="no"  Guid="7d78bc12-9edc-4e51-823d-c33c0d5a4ce1">
     120      <Component Id="MSOfficeToolsCommon_Common_dll_Component" Win64="no"  Guid="f1ee5cfd-0aa4-4b49-b6f0-1eaa2f044195">
    120121        <File Id="MSOfficeToolsCommon_Common_dll"
    121122              Name="Microsoft.Office.Tools.Common.dll" Source="$(var.AddinFiles)"></File>
     
    126127      </Component>
    127128
    128       <Component Id="MSOfficeToolsFramework_dll_Component" Win64="no"  Guid="6dd65742-6c4d-4165-a50f-0fe8f1dfcb70">
     129      <Component Id="MSOfficeToolsFramework_dll_Component" Win64="no"  Guid="f1ee5cfd-0aa4-4b49-b6f0-1eaa2f044196">
    129130        <File Id="MSOfficeToolsFramework_dll"
    130131              Name="Microsoft.Office.Tools.v4.0.Framework.dll" Source="$(var.AddinFiles)"></File>
     
    135136      </Component>
    136137
    137       <Component Id="MSOfficeTools_dll_Component" Win64="no"  Guid="2d6e2e44-d5f7-4088-8910-eb1203a1dd2e">
     138      <Component Id="MSOfficeTools_dll_Component" Win64="no"  Guid="f1ee5cfd-0aa4-4b49-b6f0-1eaa2f044197">
    138139        <File Id="MSOfficeTools_dll"
    139140              Name="Microsoft.Office.Tools.dll" Source="$(var.AddinFiles)"></File>
     
    144145      </Component>
    145146
    146       <Component Id="MSOfficeTools_app_runtime_Component" Win64="no" Guid="ceaeaa83-0fb3-4f29-a5c4-3eda87cd5c17">
     147      <Component Id="MSOfficeTools_app_runtime_Component" Win64="no" Guid="f1ee5cfd-0aa4-4b49-b6f0-1eaa2f044198">
    147148        <File Id="MSOfficeTools_Application_Runtime"
    148149              Name="Microsoft.VisualStudio.Tools.Applications.Runtime.dll" Source="$(var.AddinFiles)"></File>
     
    153154      </Component>
    154155
    155       <Component Id="MSOfficeToolsWord_dll_Component" Win64="no"  Guid="d2ce0c37-432f-4028-afba-adbb1dac6029">
     156      <Component Id="MSOfficeToolsWord_dll_Component" Win64="no"  Guid="f1ee5cfd-0aa4-4b49-b6f0-1eaa2f044199">
    156157        <File Id="MSOfficeToolsExcel_dll"
    157158              Name="Microsoft.Office.Tools.Word.dll" Source="$(var.AddinFiles)"></File>
     
    162163      </Component>
    163164
    164       <Component Id="PteidWordPlugin_pdb_Component" Win64="no"  Guid="a2309582-df0a-4c23-9b93-1d2a3f3f5265">
     165      <Component Id="PteidWordPlugin_pdb_Component" Win64="no"  Guid="f1ee5cfd-0aa4-4b49-b6f0-1eaa2f04419a">
    165166        <File Id="PteidWordPlugin_pdb"
    166167              Name="PteidWordPlugin.pdb" Source="$(var.AddinFiles)"></File>
     
    171172      </Component>
    172173
    173       <Component Id="PteidWordPlugin_dll_Component" Win64="no"  Guid="daf470e1-a65d-4c40-b114-f638854d79c3">
     174      <Component Id="PteidWordPlugin_dll_Component" Win64="no"  Guid="f1ee5cfd-0aa4-4b49-b6f0-1eaa2f04419b">
    174175        <File Id="PteidWordPlugin_dll"
    175176              Name="PteidWordPlugin.dll" Source="$(var.AddinFiles)" />
     
    180181      </Component>
    181182
    182      
    183       <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
    184       <!--<Component Id="ProductComponent"> -->
    185       <!-- TODO: Insert files, registry keys, and other resources here. -->
    186       <!--</Component>-->
     183     
    187184    </ComponentGroup>
    188185        </Fragment>
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-ms-plugin/PteidPluginSetup/PteidPluginSetup.wixproj

    r16689 r16720  
    3636  </ItemGroup>
    3737  <ItemGroup>
     38    <WixExtension Include="WixNetFxExtension">
     39      <HintPath>$(WixExtDir)\WixNetFxExtension.dll</HintPath>
     40      <Name>WixNetFxExtension</Name>
     41    </WixExtension>
    3842    <WixExtension Include="WixUIExtension">
    3943      <HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-ms-plugin/PteidWordPlugin/App.config

    r16689 r16720  
    2222    </roleManager>
    2323  </system.web>
    24 <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
     24<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/></startup></configuration>
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-ms-plugin/PteidWordPlugin/Configurator.cs

    r16689 r16720  
    2525        }
    2626
     27        /*
     28         * Configuration setting getter
     29         */
    2730        public string getSetting(string setting)
    2831        {
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-ms-plugin/PteidWordPlugin/MiddlewareConnector.cs

    r16699 r16720  
    3333            StringBuilder args = new StringBuilder(signMode);
    3434            args.Append(" ");
    35             args.Append(GetShortName(tempPath));
     35            args.Append(GetShortName(tempPath)); //uses short file path
    3636         
    3737            Process.Start(this.configurator.getSetting("pteid-call-cmd"), args.ToString());
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-ms-plugin/PteidWordPlugin/Properties/Resources.Designer.cs

    r16689 r16720  
    6464        ///   Looks up a localized resource of type System.Drawing.Bitmap.
    6565        /// </summary>
     66        internal static System.Drawing.Bitmap adv32 {
     67            get {
     68                object obj = ResourceManager.GetObject("adv32", resourceCulture);
     69                return ((System.Drawing.Bitmap)(obj));
     70            }
     71        }
     72       
     73        /// <summary>
     74        ///   Looks up a localized resource of type System.Drawing.Bitmap.
     75        /// </summary>
    6676        internal static System.Drawing.Bitmap AdvancedNormal {
    6777            get {
     
    8090            }
    8191        }
     92       
     93        /// <summary>
     94        ///   Looks up a localized resource of type System.Drawing.Bitmap.
     95        /// </summary>
     96        internal static System.Drawing.Bitmap bsc32 {
     97            get {
     98                object obj = ResourceManager.GetObject("bsc32", resourceCulture);
     99                return ((System.Drawing.Bitmap)(obj));
     100            }
     101        }
    82102    }
    83103}
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-ms-plugin/PteidWordPlugin/Properties/Resources.resx

    r16689 r16720  
    119119  </resheader>
    120120  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
     121  <data name="adv32" type="System.Resources.ResXFileRef, System.Windows.Forms">
     122    <value>..\images\adv32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
     123  </data>
    121124  <data name="AdvancedNormal" type="System.Resources.ResXFileRef, System.Windows.Forms">
    122125    <value>..\images\icon426x26.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
     
    125128    <value>..\images\index26x26.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
    126129  </data>
     130  <data name="bsc32" type="System.Resources.ResXFileRef, System.Windows.Forms">
     131    <value>..\images\bsc32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
     132  </data>
    127133</root>
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-ms-plugin/PteidWordPlugin/PteidWordPlugin.csproj

    r16699 r16720  
    3030    <DefineConstants>VSTO40</DefineConstants>
    3131    <IsWebBootstrapper>False</IsWebBootstrapper>
    32     <TargetFrameworkProfile />
     32    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
    3333    <BootstrapperEnabled>true</BootstrapperEnabled>
    3434    <PublishUrl>C:\Users\João Amado\Documents\Coding Projects\pteid-ms-plugin\PteidWordPlugin\publish\</PublishUrl>
     
    117117    <OutputPath>bin\Release\</OutputPath>
    118118    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
    119     <DefineConstants>VSTO40;TRACE</DefineConstants>
     119    <DefineConstants>TRACE;VSTO40</DefineConstants>
    120120    <WarningLevel>4</WarningLevel>
    121121  </PropertyGroup>
     
    232232    <None Include="images\index26x26.png" />
    233233  </ItemGroup>
     234  <ItemGroup>
     235    <None Include="images\adv32.png" />
     236  </ItemGroup>
     237  <ItemGroup>
     238    <None Include="images\bsc32.png" />
     239  </ItemGroup>
    234240  <PropertyGroup>
    235241    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
     
    257263    <VisualStudio>
    258264      <FlavorProperties GUID="{BAA0C2D2-18E2-41B9-852F-F413020CAA33}">
    259         <ProjectProperties HostName="Word" HostPackage="{29A7B9D7-A7F1-4328-8EF0-6B2D1A56B2C1}" OfficeVersion="15.0" VstxVersion="4.0" ApplicationType="Word" Language="cs" TemplatesPath="" DebugInfoExeName="#Software\Microsoft\Office\15.0\Word\InstallRoot\Path#WINWORD.EXE" DebugInfoCommandLine="/x" AddItemTemplatesGuid="{51063C3A-E220-4D12-8922-BDA915ACD783}" />
     265        <ProjectProperties HostName="Word" HostPackage="{29A7B9D7-A7F1-4328-8EF0-6B2D1A56B2C1}" OfficeVersion="15.0" VstxVersion="4.0" ApplicationType="Word" Language="cs" TemplatesPath="" DebugInfoExeName="#Software\Microsoft\Office\16.0\Word\InstallRoot\Path#WINWORD.EXE" DebugInfoCommandLine="/x" AddItemTemplatesGuid="{51063C3A-E220-4D12-8922-BDA915ACD783}" />
    260266        <Host Name="Word" GeneratedCodeNamespace="PteidWordPlugin" PublishedHash="69C324AB27932AA2FBF2B7EA72250886FF164DE6" IconIndex="0">
    261267          <HostItem Name="ThisAddIn" Code="ThisAddIn.cs" CanonicalName="AddIn" PublishedHash="F84AF433423E490C25462D4D10F3D64CFCBCE325" CanActivate="false" IconIndex="1" Blueprint="ThisAddIn.Designer.xml" GeneratedCode="ThisAddIn.Designer.cs" />
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-ms-plugin/PteidWordPlugin/Ribbon.cs

    r16689 r16720  
    11using Office = Microsoft.Office.Core;
    22using Word = Microsoft.Office.Interop.Word;
    3 using PteidWordPlugin.Properties;
     3using Microsoft.Win32;
    44using System;
    5 using System.Collections.Generic;
    65using System.Drawing;
    76using System.IO;
    8 using System.Linq;
    97using System.Reflection;
    108using System.Runtime.InteropServices;
     
    3836    {
    3937        private Office.IRibbonUI ribbon;
    40         private string[] buttonLabels = { "b1", "b2" };
     38        private string[] buttonLabels = { "bsc", "adv" };
    4139
    4240        public Ribbon()
    43         {
     41        { 
    4442        }
    4543
     
    8684            switch (control.Id)
    8785            {
    88                 case "b1":
     86                case "bsc":
    8987                    {
    90                         return Properties.Resources.BasicNormal;
     88                        return Properties.Resources.bsc32;
    9189                    }
    92                 case "b2":
     90                case "adv":
    9391                    {
    94                         return Properties.Resources.AdvancedNormal;
     92                        return Properties.Resources.adv32;
    9593                    }
    9694            }
     
    144142                doc = app.Documents.Open(this.Application.ActiveDocument.FullName, ReadOnly: true, Visible: false);
    145143            }
    146             else
     144            else //Export current active document
    147145            {
    148146                doc = this.Application.ActiveDocument;
     
    154152        }
    155153       
     154        /*
     155         * Verify if the middleware is installed in the system and if the current active document has any unsaved changes
     156         */
    156157        public bool verify()
    157158        {
    158             if (!isInstalled)
    159             {
    160                 MessageBox.Show(this.configurator.getSetting("install-mw-msg"), this.configurator.getSetting("install-mw-caption"),
    161                                                       MessageBoxButtons.OK, MessageBoxIcon.Error);
     159            if (!this.isInstalled()) //Check mw installation every button click
     160            {
     161                //Show error dialog
     162                DialogResult result = MessageBox.Show(this.configurator.getSetting("install-mw-msg"), this.configurator.getSetting("install-mw-caption"),
     163                                                                                MessageBoxButtons.OK, MessageBoxIcon.Error);
     164               
    162165                return false;
    163166            }
    164167
    165             if(isDocModified())
     168            if(this.isDocModified())
    166169            {
    167170                switch (this.savedState)
    168171                {
    169172                    case 0:
    170                         Word.Dialog saveAs = Application.Dialogs[Word.WdWordDialog.wdDialogFileSaveAs];
     173                        Word.Dialog saveAs = Application.Dialogs[Word.WdWordDialog.wdDialogFileSaveAs]; //show built-in 'Save As' dialog
    171174                        if (saveAs.Show() == 0) return false; //0-cancel, 1-ok
    172175                        break;
     
    174177                    case 1:
    175178                        DialogResult result = MessageBox.Show(this.configurator.getSetting("save-changes-msg"), this.configurator.getSetting("save-changes-caption"),
    176                                                                 MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
     179                                                                MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning); //show custom 'Save changes' dialog
    177180                        if (result == DialogResult.Cancel)
    178181                        {
     
    189192                }
    190193            }
    191 
    192194            return true;
    193195        }
     
    202204            }
    203205
    204             /*Check for unsaved document changes and prompt the user on how to proceed*/
     206            /*Check for unsaved document changes*/
    205207            if (!this.Application.ActiveDocument.Saved)
    206208            {
     
    212214            return false;
    213215        }
     216
     217        private bool isInstalled()
     218        {
     219            //Checking for PTEID mw registry key
     220            RegistryKey key = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, Microsoft.Win32.RegistryView.Registry64); //always check for the reg key in the 64bit registry
     221            RegistryKey regKey = key.OpenSubKey(this.configurator.getSetting("pteid-registry-key"));
     222
     223            if (regKey == null)
     224            {
     225                key.Close();
     226                return false;
     227            }
     228            else
     229            {
     230                key.Close();
     231                regKey.Close();
     232                return true;
     233            }
     234        }
    214235    }
    215236}
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-ms-plugin/PteidWordPlugin/Ribbon.xml

    r16689 r16720  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <customUI  onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    3     <ribbon>
    4         <tabs>
    5             <tab idMso="TabInsert">
    6                 <group id="group1" label="Digital Signature">
    7                     <button id="b1" label="Simple" screentip="Simple Signature" getImage="GetImage" onAction="ButtonActionHandler" size="large"/>
    8                     <button id="b2" label="Advanced" screentip="Advanced Signature" getImage="GetImage" onAction="ButtonActionHandler" size="large"/>   
     2<customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2009/07/customui">
     3  <ribbon>
     4          <tabs>
     5            <tab idMso="TabAddIns" label="Digital Signature">
     6                <group id="group1">
     7                    <button id="bsc" label="Basic" screentip="Simple Signature" getImage="GetImage" onAction="ButtonActionHandler" size="large" keytip="B"/>
     8                    <button id="adv" label="Advanced" screentip="Advanced Signature" getImage="GetImage" onAction="ButtonActionHandler" size="large" keytip="A"/>   
    99                </group>
    1010            </tab>
    1111        </tabs>
    1212    </ribbon>
     13  <contextMenus>
     14    <contextMenu idMso="ContextMenuText">
     15      <button id="MyButton" label="My Button" insertBeforeMso="HyperlinkInsert" onAction="GetButtonID" />
     16    </contextMenu>
     17  </contextMenus>
    1318</customUI>
  • internals/2017/PluginAssinaturaOfficeSuite/pteid-ms-plugin/PteidWordPlugin/ThisAddIn.cs

    r16689 r16720  
    88using Microsoft.Office.Tools.Word;
    99using System.Diagnostics;
    10 using Microsoft.Win32;
     10
    1111
    1212namespace PteidWordPlugin
     
    1414    public partial class ThisAddIn
    1515    {
    16         private static bool isInstalled;
    1716        private Configurator configurator;
    1817
     
    2221            this.configurator = new Configurator();
    2322
    24             //Checking for registry key existance
    25             RegistryKey key = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, Microsoft.Win32.RegistryView.Registry64);
    26             RegistryKey regKey = key.OpenSubKey(this.configurator.getSetting("pteid-registry-key"));
    27            
    28             if (regKey == null)
    29             {
    30                 isInstalled = false;
    31             }
    32             else
    33             {
    34                 Debug.WriteLine(regKey.GetValue("DisplayVersion"));
    35                 isInstalled = true;
    36             }
    37 
    38             key.Close();
    39             regKey.Close();
    4023        }
    4124
Note: See TracChangeset for help on using the changeset viewer.