Procházet zdrojové kódy

文案,文件浏览器重复类型删除

liyijie před 1 rokem
rodič
revize
ddc25d3e21

+ 8 - 2
PDF Office/Helper/ConverterHelper.cs

@@ -400,32 +400,38 @@ namespace PDF_Master.Helper
             if (wordConverter != null)
             {
                 wordConverter.Cancel();
+                return;
             }
             if (excelConverter != null)
             {
                 excelConverter.Cancel();
+                return;
             }
             if (pptConverter != null)
             {
                 pptConverter.Cancel();
+                return;
             }
             if (txtConverter != null)
             {
                 txtConverter.Cancel();
+                return;
             }
             if (csvConverter != null)
             {
                 csvConverter.Cancel();
+                return;
             }
             if (rtfConverter != null)
             {
                 rtfConverter.Cancel();
+                return;
             }
             if (htmlConverter != null)
             {
                 htmlConverter.Cancel();
+                return;
             }
-            Console.WriteLine("killed");
         }
         private static void StartFile(string path)
         {
@@ -483,7 +489,7 @@ namespace PDF_Master.Helper
 
                     word.Visible = false;
                     word.ShowWindowsInTaskbar = true;
-                    document = word.Documents.Open(sourcepath,OpenAndRepair:true);
+                    document = word.Documents.Open(sourcepath, OpenAndRepair: true);
                     var page = document.PageSetup;
                     page.PaperSize = paperSize;
                     if (margin > 0)

+ 20 - 0
PDF Office/MultilingualResources/PDF Office.en.xlf

@@ -2548,6 +2548,26 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <source>Annotation Default Font</source>
           <target state="new">Annotation Default Font</target>
         </trans-unit>
+        <trans-unit id="TipContent_ReleaseRestricted" translate="yes" xml:space="preserve">
+          <source>Remove Restrictions</source>
+          <target state="new">Remove Restrictions</target>
+        </trans-unit>
+        <trans-unit id="TipContent_RestrictedContent" translate="yes" xml:space="preserve">
+          <source>The file is protected with a password.</source>
+          <target state="new">The file is protected with a password.</target>
+        </trans-unit>
+        <trans-unit id="TipContent_RestrictedTitle" translate="yes" xml:space="preserve">
+          <source>File Restricted</source>
+          <target state="new">File Restricted</target>
+        </trans-unit>
+        <trans-unit id="RighMenuText_Redefine" translate="yes" xml:space="preserve">
+          <source>Redefine</source>
+          <target state="new">Redefine</target>
+        </trans-unit>
+        <trans-unit id="RighMenuText_RestoreDefaultSettings" translate="yes" xml:space="preserve">
+          <source>Restore Default Settings</source>
+          <target state="new">Restore Default Settings</target>
+        </trans-unit>
       </group>
     </body>
   </file>

+ 20 - 0
PDF Office/MultilingualResources/PDF Office.zh-Hans.xlf

@@ -2544,6 +2544,26 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <target state="new">View pages continuously with scrolling enabled</target>
           <note from="MultilingualBuild" annotates="source" priority="2">[阅读页]通过滚动连续浏览多个页面</note>
         </trans-unit>
+        <trans-unit id="TipContent_ReleaseRestricted" translate="yes" xml:space="preserve">
+          <source>Remove Restrictions</source>
+          <target state="new">Remove Restrictions</target>
+        </trans-unit>
+        <trans-unit id="TipContent_RestrictedContent" translate="yes" xml:space="preserve">
+          <source>The file is protected with a password.</source>
+          <target state="new">The file is protected with a password.</target>
+        </trans-unit>
+        <trans-unit id="TipContent_RestrictedTitle" translate="yes" xml:space="preserve">
+          <source>File Restricted</source>
+          <target state="new">File Restricted</target>
+        </trans-unit>
+        <trans-unit id="RighMenuText_Redefine" translate="yes" xml:space="preserve">
+          <source>Redefine</source>
+          <target state="new">Redefine</target>
+        </trans-unit>
+        <trans-unit id="RighMenuText_RestoreDefaultSettings" translate="yes" xml:space="preserve">
+          <source>Restore Default Settings</source>
+          <target state="new">Restore Default Settings</target>
+        </trans-unit>
         <trans-unit id="Settings_Annotation_Annotation_Font" translate="yes" xml:space="preserve">
           <source>Annotation Default Font</source>
           <target state="new">Annotation Default Font</target>

+ 20 - 0
PDF Office/MultilingualResources/PDF Office.zh-Hant.xlf

@@ -2544,6 +2544,26 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <target state="new">View pages continuously with scrolling enabled</target>
           <note from="MultilingualBuild" annotates="source" priority="2">[阅读页]通过滚动连续浏览多个页面</note>
         </trans-unit>
+        <trans-unit id="TipContent_ReleaseRestricted" translate="yes" xml:space="preserve">
+          <source>Remove Restrictions</source>
+          <target state="new">Remove Restrictions</target>
+        </trans-unit>
+        <trans-unit id="TipContent_RestrictedContent" translate="yes" xml:space="preserve">
+          <source>The file is protected with a password.</source>
+          <target state="new">The file is protected with a password.</target>
+        </trans-unit>
+        <trans-unit id="TipContent_RestrictedTitle" translate="yes" xml:space="preserve">
+          <source>File Restricted</source>
+          <target state="new">File Restricted</target>
+        </trans-unit>
+        <trans-unit id="RighMenuText_Redefine" translate="yes" xml:space="preserve">
+          <source>Redefine</source>
+          <target state="new">Redefine</target>
+        </trans-unit>
+        <trans-unit id="RighMenuText_RestoreDefaultSettings" translate="yes" xml:space="preserve">
+          <source>Restore Default Settings</source>
+          <target state="new">Restore Default Settings</target>
+        </trans-unit>
         <trans-unit id="Settings_Annotation_Annotation_Font" translate="yes" xml:space="preserve">
           <source>Annotation Default Font</source>
           <target state="new">Annotation Default Font</target>

+ 45 - 0
PDF Office/Strings/MainPage/MainPage.Designer.cs

@@ -1822,6 +1822,24 @@ namespace PDF_Master.Strings.MainPage {
             }
         }
         
+        /// <summary>
+        ///   查找类似 Redefine 的本地化字符串。
+        /// </summary>
+        public static string RighMenuText_Redefine {
+            get {
+                return ResourceManager.GetString("RighMenuText_Redefine", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Restore Default Settings 的本地化字符串。
+        /// </summary>
+        public static string RighMenuText_RestoreDefaultSettings {
+            get {
+                return ResourceManager.GetString("RighMenuText_RestoreDefaultSettings", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 Sample 的本地化字符串。
         /// </summary>
@@ -2598,6 +2616,33 @@ namespace PDF_Master.Strings.MainPage {
             }
         }
         
+        /// <summary>
+        ///   查找类似 Remove Restrictions 的本地化字符串。
+        /// </summary>
+        public static string TipContent_ReleaseRestricted {
+            get {
+                return ResourceManager.GetString("TipContent_ReleaseRestricted", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 The file is protected with a password. 的本地化字符串。
+        /// </summary>
+        public static string TipContent_RestrictedContent {
+            get {
+                return ResourceManager.GetString("TipContent_RestrictedContent", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 File Restricted 的本地化字符串。
+        /// </summary>
+        public static string TipContent_RestrictedTitle {
+            get {
+                return ResourceManager.GetString("TipContent_RestrictedTitle", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 Compress 的本地化字符串。
         /// </summary>

+ 15 - 0
PDF Office/Strings/MainPage/MainPage.resx

@@ -762,6 +762,12 @@ Drag files to reorder as you need.</value>
   <data name="RemovePassword_YES" xml:space="preserve">
     <value>Remove</value>
   </data>
+  <data name="RighMenuText_Redefine" xml:space="preserve">
+    <value>Redefine</value>
+  </data>
+  <data name="RighMenuText_RestoreDefaultSettings" xml:space="preserve">
+    <value>Restore Default Settings</value>
+  </data>
   <data name="Sample" xml:space="preserve">
     <value>Sample</value>
     <comment>高亮,删除线,下划线的示例文案</comment>
@@ -1035,6 +1041,15 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
   <data name="Thumbnails_Title" xml:space="preserve">
     <value>Thumbnail</value>
   </data>
+  <data name="TipContent_ReleaseRestricted" xml:space="preserve">
+    <value>Remove Restrictions</value>
+  </data>
+  <data name="TipContent_RestrictedContent" xml:space="preserve">
+    <value>The file is protected with a password.</value>
+  </data>
+  <data name="TipContent_RestrictedTitle" xml:space="preserve">
+    <value>File Restricted</value>
+  </data>
   <data name="ToolsBar_Compress" xml:space="preserve">
     <value>Compress</value>
   </data>

+ 2 - 2
PDF Office/Styles/ContextMenuStyle.xaml

@@ -14,11 +14,11 @@
     <ContextMenu x:Key="CustomFontStyleFlyoutMenu" FontSize="14">
         <MenuItem
             Name="ChangeStyleMenuItem"
-            Header="用所选部分重新定义"
+            Header="{x:Static mainpage:MainPage.RighMenuText_Redefine}"
             IsEnabled="True" />
         <MenuItem
             Name="BackStyleMenuItem"
-            Header="恢复默认预设样式"
+            Header="{x:Static mainpage:MainPage.RighMenuText_RestoreDefaultSettings}"
             IsEnabled="True" />
     </ContextMenu>
 

+ 2 - 2
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogViewModel.cs

@@ -477,7 +477,7 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs
         {
             System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
             dlg.Multiselect = false;
-            dlg.Filter = "PDF|*.pdf;*.PDF;";
+            dlg.Filter = "PDF|*.pdf;";
             if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 SelectFileName = dlg.FileName;
@@ -494,7 +494,7 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs
             FileNameNumber = fileNames.Count;
             System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
             dlg.Multiselect = true;
-            dlg.Filter = "Picture|*.png;*.PNG;*.jpg;*.JPG;*.bmp;*.gif;*tiff;*jpeg;";
+            dlg.Filter = "Picture|*.png;*.jpg;*.bmp;*.gif;*tiff;*jpeg;";
             if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 fileNames.AddRange(dlg.FileNames.ToList());

+ 1 - 1
PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs

@@ -137,7 +137,7 @@ namespace PDF_Master.ViewModels.HomePanel.PDFTools
             if (toolItem.FnType == PDFFnType.ImageToPDF)
             {
                 dlg.Multiselect = true;
-                dlg.Filter = "Picture|*.png;*.PNG;*.jpg;*.JPG;*bmp;*jpeg;*gif;*tiff;";
+                dlg.Filter = "Picture|*.png;*.jpg;*bmp;*jpeg;*gif;*tiff;";
             }
             else if(toolItem.FnType == PDFFnType.Merge)
             {

+ 42 - 1
PDF Office/ViewModels/TipContent/FileRestrictedTipViewModel.cs

@@ -12,7 +12,47 @@ using static PDF_Master.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySetti
 namespace PDF_Master.ViewModels.TipContent
 {
     public class FileRestrictedTipViewModel : BindableBase, INavigationAware
-    {
+    {
+        #region 文案
+        private string T_restrictedTitle;
+        public string T_RestrictedTitle
+        {
+            get { return T_restrictedTitle; }
+            set
+            {
+                SetProperty(ref T_restrictedTitle, value);
+            }
+        }
+
+        private string T_releaseRestrictedContent;
+        public string T_ReleaseRestrictedContent
+        {
+            get { return T_releaseRestrictedContent; }
+            set
+            {
+                SetProperty(ref T_releaseRestrictedContent, value);
+            }
+        }
+
+        private string T_releaseRestricted;
+        public string T_ReleaseRestricted
+        {
+            get { return T_releaseRestricted; }
+            set
+            {
+                SetProperty(ref T_releaseRestricted, value);
+            }
+        }
+        private void IntString()
+        {
+            T_RestrictedTitle = App.MainPageLoader.GetString("TipContent_RestrictedTitle");
+            T_ReleaseRestrictedContent = App.MainPageLoader.GetString("TipContent_RestrictedContent");
+            T_ReleaseRestricted = App.MainPageLoader.GetString("TipContent_ReleaseRestricted");
+        }
+
+        #endregion 
+
+
         public string unicode = null;
         public IEventAggregator eventAggregator;
         public IDialogService DialogService;
@@ -22,6 +62,7 @@ namespace PDF_Master.ViewModels.TipContent
         public DelegateCommand RestrictCommand { get; set; }
         public FileRestrictedTipViewModel(IEventAggregator eventAggregator, IDialogService dialogService)
         {
+            IntString();
             this.eventAggregator = eventAggregator;
             this.DialogService = dialogService;
             unicode = App.mainWindowViewModel.SelectedItem.Unicode;

+ 3 - 3
PDF Office/Views/TipContent/FileRestrictedTip.xaml

@@ -17,16 +17,16 @@
                     <ColumnDefinition Width="24"></ColumnDefinition>
                 </Grid.ColumnDefinitions>
                 <StackPanel Orientation="Horizontal">
-                    <TextBlock Text="File Restricted" FontSize="14" VerticalAlignment="Center" FontFamily="Segoe UI" FontWeight="Medium" ></TextBlock>
+                    <TextBlock Text="{Binding T_RestrictedTitle}" FontSize="14" VerticalAlignment="Center" FontFamily="Segoe UI" FontWeight="Medium" ></TextBlock>
                 </StackPanel>
                 <Button Background="Transparent" BorderBrush="Transparent" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Right" Command="{Binding CloseTipCommand}">
                     <Path Data="M6.00006 7.06066L9.46973 10.5303L10.5304 9.46967L7.06072 6L10.5304 2.53033L9.46973 1.46967L6.00006 4.93934L2.53039 1.46967L1.46973 2.53033L4.9394 6L1.46973 9.46967L2.53039 10.5303L6.00006 7.06066Z" Fill="#94989C"></Path>
                 </Button>
             </Grid>
 
-            <TextBlock Grid.Row="1" TextWrapping="Wrap"  Text="Files are password protected. Restricted features need to be unlocked to use" Foreground="{StaticResource color.sys.text.neutral.lv2}" Margin="0,8,16,0" FontFamily="Segoe UI" FontSize="14"></TextBlock>
+            <TextBlock Grid.Row="1" TextWrapping="Wrap"  Text="{Binding T_ReleaseRestrictedContent}" Foreground="{StaticResource color.sys.text.neutral.lv2}" Margin="0,8,16,0" FontFamily="Segoe UI" FontSize="14"></TextBlock>
             <Button Grid.Row="2" Height="32"  Width="151" HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="Transparent" BorderThickness="1" Command="{Binding RestrictCommand}">
-                <TextBlock Text="Release restrictions" FontSize="14"></TextBlock>
+                <TextBlock Text="{Binding T_ReleaseRestricted}" FontSize="14"></TextBlock>
             </Button>
         </Grid>
     </Border>