Преглед изворни кода

Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev

ZhouJieSheng пре 1 година
родитељ
комит
f9e27cbf16

+ 12 - 12
PDF Office/MultilingualResources/PDF Office.en.xlf

@@ -2433,8 +2433,8 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <target state="new">Draw freely as you do with a pen</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_HighLight" translate="yes" xml:space="preserve">
-          <source>HighLight</source>
-          <target state="new">HighLight</target>
+          <source>HighLight(Ctrl+Alt+H)</source>
+          <target state="new">HighLight(Ctrl+Alt+H)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_MagnifyTool" translate="yes" xml:space="preserve">
           <source>Magnify Tool</source>
@@ -2451,24 +2451,24 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <target state="new">Squiggly</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_StickyNote" translate="yes" xml:space="preserve">
-          <source>Sticky Note</source>
-          <target state="new">Sticky Note</target>
+          <source>Sticky Note(Ctrl+Alt+N)</source>
+          <target state="new">Sticky Note(Ctrl+Alt+N)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Strikeout" translate="yes" xml:space="preserve">
-          <source>Strikeout</source>
-          <target state="new">Strikeout</target>
+          <source>Strikeout(Ctrl+Alt+S)</source>
+          <target state="new">Strikeout(Ctrl+Alt+S)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Text" translate="yes" xml:space="preserve">
           <source>Text(Ctrl+Alt+T)</source>
           <target state="new">Text(Ctrl+Alt+T)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_UnderLine" translate="yes" xml:space="preserve">
-          <source>UnderLine</source>
-          <target state="new">UnderLine</target>
+          <source>UnderLine(Ctrl+Alt+U)</source>
+          <target state="new">UnderLine(Ctrl+Alt+U)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Link" translate="yes" xml:space="preserve">
-          <source>Link</source>
-          <target state="new">Link</target>
+          <source>Link(Ctrl+Alt+L)</source>
+          <target state="new">Link(Ctrl+Alt+L)</target>
           <note from="MultilingualBuild" annotates="source" priority="2">Link</note>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Sharps" translate="yes" xml:space="preserve">
@@ -2477,8 +2477,8 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <note from="MultilingualBuild" annotates="source" priority="2">绘图工具,按住shift可以绘制正方形/圆形/直箭头/直线</note>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_ShowAnnot" translate="yes" xml:space="preserve">
-          <source>Hide</source>
-          <target state="new">Hide</target>
+          <source>Hide Annotation</source>
+          <target state="new">Hide Annotation</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Signature" translate="yes" xml:space="preserve">
           <source>Add a handwritten signature or create a signature via the trackpad</source>

+ 12 - 12
PDF Office/MultilingualResources/PDF Office.zh-Hans.xlf

@@ -2433,8 +2433,8 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <target state="new">Draw freely as you do with a pen</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_HighLight" translate="yes" xml:space="preserve">
-          <source>HighLight</source>
-          <target state="new">HighLight</target>
+          <source>HighLight(Ctrl+Alt+H)</source>
+          <target state="new">HighLight(Ctrl+Alt+H)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_MagnifyTool" translate="yes" xml:space="preserve">
           <source>Magnify Tool</source>
@@ -2451,24 +2451,24 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <target state="new">Squiggly</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_StickyNote" translate="yes" xml:space="preserve">
-          <source>Sticky Note</source>
-          <target state="new">Sticky Note</target>
+          <source>Sticky Note(Ctrl+Alt+N)</source>
+          <target state="new">Sticky Note(Ctrl+Alt+N)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Strikeout" translate="yes" xml:space="preserve">
-          <source>Strikeout</source>
-          <target state="new">Strikeout</target>
+          <source>Strikeout(Ctrl+Alt+S)</source>
+          <target state="new">Strikeout(Ctrl+Alt+S)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Text" translate="yes" xml:space="preserve">
           <source>Text(Ctrl+Alt+T)</source>
           <target state="new">Text(Ctrl+Alt+T)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_UnderLine" translate="yes" xml:space="preserve">
-          <source>UnderLine</source>
-          <target state="new">UnderLine</target>
+          <source>UnderLine(Ctrl+Alt+U)</source>
+          <target state="new">UnderLine(Ctrl+Alt+U)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Link" translate="yes" xml:space="preserve">
-          <source>Link</source>
-          <target state="new">Link</target>
+          <source>Link(Ctrl+Alt+L)</source>
+          <target state="new">Link(Ctrl+Alt+L)</target>
           <note from="MultilingualBuild" annotates="source" priority="2">Link</note>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Sharps" translate="yes" xml:space="preserve">
@@ -2477,8 +2477,8 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <note from="MultilingualBuild" annotates="source" priority="2">绘图工具,按住shift可以绘制正方形/圆形/直箭头/直线</note>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_ShowAnnot" translate="yes" xml:space="preserve">
-          <source>Hide</source>
-          <target state="new">Hide</target>
+          <source>Hide Annotation</source>
+          <target state="new">Hide Annotation</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Signature" translate="yes" xml:space="preserve">
           <source>Add a handwritten signature or create a signature via the trackpad</source>

+ 12 - 12
PDF Office/MultilingualResources/PDF Office.zh-Hant.xlf

@@ -2433,8 +2433,8 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <target state="new">Draw freely as you do with a pen</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_HighLight" translate="yes" xml:space="preserve">
-          <source>HighLight</source>
-          <target state="new">HighLight</target>
+          <source>HighLight(Ctrl+Alt+H)</source>
+          <target state="new">HighLight(Ctrl+Alt+H)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_MagnifyTool" translate="yes" xml:space="preserve">
           <source>Magnify Tool</source>
@@ -2451,24 +2451,24 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <target state="new">Squiggly</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_StickyNote" translate="yes" xml:space="preserve">
-          <source>Sticky Note</source>
-          <target state="new">Sticky Note</target>
+          <source>Sticky Note(Ctrl+Alt+N)</source>
+          <target state="new">Sticky Note(Ctrl+Alt+N)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Strikeout" translate="yes" xml:space="preserve">
-          <source>Strikeout</source>
-          <target state="new">Strikeout</target>
+          <source>Strikeout(Ctrl+Alt+S)</source>
+          <target state="new">Strikeout(Ctrl+Alt+S)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Text" translate="yes" xml:space="preserve">
           <source>Text(Ctrl+Alt+T)</source>
           <target state="new">Text(Ctrl+Alt+T)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_UnderLine" translate="yes" xml:space="preserve">
-          <source>UnderLine</source>
-          <target state="new">UnderLine</target>
+          <source>UnderLine(Ctrl+Alt+U)</source>
+          <target state="new">UnderLine(Ctrl+Alt+U)</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Link" translate="yes" xml:space="preserve">
-          <source>Link</source>
-          <target state="new">Link</target>
+          <source>Link(Ctrl+Alt+L)</source>
+          <target state="new">Link(Ctrl+Alt+L)</target>
           <note from="MultilingualBuild" annotates="source" priority="2">Link</note>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Sharps" translate="yes" xml:space="preserve">
@@ -2477,8 +2477,8 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <note from="MultilingualBuild" annotates="source" priority="2">绘图工具,按住shift可以绘制正方形/圆形/直箭头/直线</note>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_ShowAnnot" translate="yes" xml:space="preserve">
-          <source>Hide</source>
-          <target state="new">Hide</target>
+          <source>Hide Annotation</source>
+          <target state="new">Hide Annotation</target>
         </trans-unit>
         <trans-unit id="ToolTipsAonnot_Signature" translate="yes" xml:space="preserve">
           <source>Add a handwritten signature or create a signature via the trackpad</source>

+ 7 - 7
PDF Office/Strings/MainPage/MainPage.Designer.cs

@@ -19,7 +19,7 @@ namespace PDF_Master.Strings.MainPage {
     // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
     // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
     // (以 /str 作为命令选项),或重新生成 VS 项目。
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
     public class MainPage {
@@ -2744,7 +2744,7 @@ namespace PDF_Master.Strings.MainPage {
         }
         
         /// <summary>
-        ///   查找类似 HighLight 的本地化字符串。
+        ///   查找类似 HighLight(Ctrl+Alt+H) 的本地化字符串。
         /// </summary>
         public static string ToolTipsAonnot_HighLight {
             get {
@@ -2753,7 +2753,7 @@ namespace PDF_Master.Strings.MainPage {
         }
         
         /// <summary>
-        ///   查找类似 Link 的本地化字符串。
+        ///   查找类似 Link(Ctrl+Alt+L) 的本地化字符串。
         /// </summary>
         public static string ToolTipsAonnot_Link {
             get {
@@ -2789,7 +2789,7 @@ namespace PDF_Master.Strings.MainPage {
         }
         
         /// <summary>
-        ///   查找类似 Hide 的本地化字符串。
+        ///   查找类似 Hide Annotation 的本地化字符串。
         /// </summary>
         public static string ToolTipsAonnot_ShowAnnot {
             get {
@@ -2825,7 +2825,7 @@ namespace PDF_Master.Strings.MainPage {
         }
         
         /// <summary>
-        ///   查找类似 Sticky Note 的本地化字符串。
+        ///   查找类似 Sticky Note(Ctrl+Alt+N) 的本地化字符串。
         /// </summary>
         public static string ToolTipsAonnot_StickyNote {
             get {
@@ -2834,7 +2834,7 @@ namespace PDF_Master.Strings.MainPage {
         }
         
         /// <summary>
-        ///   查找类似 Strikeout 的本地化字符串。
+        ///   查找类似 Strikeout(Ctrl+Alt+S) 的本地化字符串。
         /// </summary>
         public static string ToolTipsAonnot_Strikeout {
             get {
@@ -2852,7 +2852,7 @@ namespace PDF_Master.Strings.MainPage {
         }
         
         /// <summary>
-        ///   查找类似 UnderLine 的本地化字符串。
+        ///   查找类似 UnderLine(Ctrl+Alt+U) 的本地化字符串。
         /// </summary>
         public static string ToolTipsAonnot_UnderLine {
             get {

+ 6 - 6
PDF Office/Strings/MainPage/MainPage.resx

@@ -1081,10 +1081,10 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
     <value>Draw freely as you do with a pen</value>
   </data>
   <data name="ToolTipsAonnot_HighLight" xml:space="preserve">
-    <value>HighLight</value>
+    <value>HighLight(Ctrl+Alt+H)</value>
   </data>
   <data name="ToolTipsAonnot_Link" xml:space="preserve">
-    <value>Link</value>
+    <value>Link(Ctrl+Alt+L)</value>
     <comment>Link</comment>
   </data>
   <data name="ToolTipsAonnot_MagnifyTool" xml:space="preserve">
@@ -1100,7 +1100,7 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
     <comment>绘图工具,按住shift可以绘制正方形/圆形/直箭头/直线</comment>
   </data>
   <data name="ToolTipsAonnot_ShowAnnot" xml:space="preserve">
-    <value>Hide</value>
+    <value>Hide Annotation</value>
   </data>
   <data name="ToolTipsAonnot_Signature" xml:space="preserve">
     <value>Add a handwritten signature or create a signature via the trackpad</value>
@@ -1112,16 +1112,16 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
     <value>Add Stamp</value>
   </data>
   <data name="ToolTipsAonnot_StickyNote" xml:space="preserve">
-    <value>Sticky Note</value>
+    <value>Sticky Note(Ctrl+Alt+N)</value>
   </data>
   <data name="ToolTipsAonnot_Strikeout" xml:space="preserve">
-    <value>Strikeout</value>
+    <value>Strikeout(Ctrl+Alt+S)</value>
   </data>
   <data name="ToolTipsAonnot_Text" xml:space="preserve">
     <value>Text(Ctrl+Alt+T)</value>
   </data>
   <data name="ToolTipsAonnot_UnderLine" xml:space="preserve">
-    <value>UnderLine</value>
+    <value>UnderLine(Ctrl+Alt+U)</value>
   </data>
   <data name="ToolTipsPageEdit_Delete" xml:space="preserve">
     <value>Delete</value>

+ 1 - 1
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -292,7 +292,7 @@ namespace PDF_Master.ViewModels.BOTA
         private bool IsFirst = true;
 
         //判断是否为属性修改进入,属性修改,改变后不让再次其选中注释
-        public bool IsModified = false;
+        public bool IsModified = true;
 
         public AnnotationContentViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
         {

+ 6 - 3
PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs

@@ -508,7 +508,10 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                     if(CurrentFilePath == doc.FilePath)
                     {
 
-                        if ((!(!doc.IsLocked&&(SecurityHelper.CheckHaveAllPermissions(doc)))) && (!(!string.IsNullOrEmpty(currentLoadedPassword) && doc.UnlockWithPassword(currentLoadedPassword) && doc.CheckOwnerPassword(currentLoadedPassword))))
+                        if ((!(!doc.IsLocked&&(SecurityHelper.CheckHaveAllPermissions(doc)))) && 
+                            (!(!string.IsNullOrEmpty(currentLoadedPassword) && 
+                            doc.UnlockWithPassword(currentLoadedPassword) && 
+                            (doc.CheckOwnerPassword(currentLoadedPassword)||SecurityHelper.CheckHaveAllPermissions(doc)))))
                         {
                             doc.Release();
                             continue;
@@ -522,9 +525,9 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                             if (condition.Password != null)
                             {
                                 mergeObject.Password = condition.Password;
-                               if(doc.UnlockWithPassword(condition.Password))
+                               if(doc.UnlockWithPassword(condition.Password)&& doc.CheckOwnerPassword(condition.Password))
                                 {
-                                    doc.CheckOwnerPassword(condition.Password);
+                                    
                                 }
                             }
                         }

+ 1 - 1
PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/CheckPasswordDialogViewModel.cs

@@ -132,7 +132,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
             }
             else
             {
-                if (tempDocument.UnlockWithPassword(Password) && tempDocument.CheckOwnerPassword(Password))
+                if (tempDocument.UnlockWithPassword(Password) && (tempDocument.CheckOwnerPassword(Password)||SecurityHelper.CheckHaveAllPermissions(tempDocument)))
                 {
                         var dialogResult = new DialogResult(ButtonResult.OK);
                         dialogResult.Parameters.Add(ParameterNames.Password, Password);

+ 13 - 10
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -140,7 +140,8 @@ namespace PDF_Master.ViewModels.Tools
         #endregion 事件绑定和解绑
 
         #region 与触发事件调用相关的函数
-        public StickyAnnotArgs GetCurrentAnnot { get; set; }
+        public StickyAnnotArgs GetCurrentAnnot { get; set; }
+
         //鼠标左键双击注释
         private void PDFViewer_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
@@ -690,7 +691,17 @@ namespace PDF_Master.ViewModels.Tools
                         //框选注释
                         PropertyPanel.annotlists = e.AnnotItemsList;
                         viewContentViewModel.IsMultiSelected = true;
-                        viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                        //viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                       
+
+                        #region MVP 在对多选注释做处理
+                        bool isDifferentAnnotTyle = AnnotTransfer.IsDifferentTypeAnnots(e.AnnotItemsList);
+                        if (isDifferentAnnotTyle)
+                            viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                        else
+                            GetSelectedAnnots(e);
+                        #endregion MVP 在对多选注释做处理
+
                         if (viewContentViewModel.mainViewModel.IsBookMode)
                         {
                             ShowPropertyPanel(false);
@@ -699,14 +710,6 @@ namespace PDF_Master.ViewModels.Tools
                         {
                             ShowPropertyPanel(true);
                         }
-
-                        #region MVP 在对多选注释做处理
-                        //bool isDifferentAnnotTyle = AnnotTransfer.IsDifferentTypeAnnots(e.AnnotItemsList);
-                        //if (isDifferentAnnotTyle)
-                        //    viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
-                        //else
-                        //    GetSelectedAnnots(e);
-                        #endregion MVP 在对多选注释做处理
                     }
                 }
             }

+ 1 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs

@@ -385,6 +385,7 @@ namespace PDF_Master.ViewModels.Tools
             menuItem.CommandTarget = (UIElement)sender;
 
             menuItem.Header = T_RightMenuSelectionCopy;
+            menuItem.InputGestureText = "Ctrl+C";
             if (annotCommand.CommandTarget == TargetType.ImageSelection && PDFViewer.GetSelectImageCount() > 0)
             {
                 menuItem.IsEnabled = true;

+ 3 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs

@@ -224,6 +224,9 @@ namespace PDF_Master.ViewModels.Tools
         // 是否处于打印
         private bool IsPasteShape = false;
 
+        //判断注释是否在拖拉创建中
+        public bool IsCreateAnnot = false;
+
         public string PropertyRegionName { get; set; }
         private IEventAggregator events;
         public IDialogService dialogs;

+ 1 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -1755,6 +1755,7 @@ namespace PDF_Master.ViewModels.Tools
                                     if (PDFViewer.ToolManager.HasTool)
                                     {
                                         PDFViewer.RemoveTool(false);
+                                        IsCreateAnnot = true;
                                     }
                                     else
                                     {

+ 20 - 4
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -2211,10 +2211,8 @@ namespace PDF_Master.ViewModels
         {
             if (KeyEventsHelper.IsSingleKey(System.Windows.Input.Key.Escape))
             {
-                if (mainViewModel.IsBookMode == true)
-                {
-                    Off_ReadModel();
-                }
+                //判断是不是不是注释工具下
+                bool isunannotTool = true;
                 //内容选择 退出
                 if (PDFViewer.MouseMode != MouseModes.PanTool)
                 {
@@ -2228,10 +2226,28 @@ namespace PDF_Master.ViewModels
                                 toolContentViewModel.SnapshotEditMenuViewModel.SnapToolArgs.ReSnapshot();
                                 annotToolContent.BtnSelecttool.IsChecked = false;
                                 PDFViewer.SetMouseMode(MouseModes.PanTool);
+                                isunannotTool = false;
+
+                            }
+                        }
+                        else {
+
+                            if (toolContentViewModel!= null)
+                            {
+                                if (toolContentViewModel.IsCreateAnnot) {
+                                    isunannotTool = false;
+                                    toolContentViewModel.IsCreateAnnot=false;
+                                }
+
                             }
                         }
                     }
                 }
+
+                if (mainViewModel.IsBookMode == true&& isunannotTool)
+                {
+                    Off_ReadModel();
+                }
             }
             if (KeyEventsHelper.IsModifierKey(ModifierKeys.Control, Key.C))
             {