常识性检测改为一键校对

This commit is contained in:
LittleBoy 2025-07-16 17:26:32 +08:00
parent bdd88c4cb1
commit a49e185569
6 changed files with 42 additions and 59 deletions

Binary file not shown.

View File

@ -36,7 +36,7 @@ namespace AIProofread
public class Config
{
public static readonly string APP_NAME = "AI校对王(公告版)";
public static readonly string APP_VERSION = "1.1.0";
public static readonly string APP_VERSION = "1.1.1";
public static bool IS_WPS = false;
public static bool UpgradeForcedNotice = false;
public static readonly string APP_BASE_DIR = AppDomain.CurrentDomain.BaseDirectory;
@ -52,7 +52,7 @@ namespace AIProofread
/// <summary>
/// 网页访问地址
/// </summary>
public static string WEB_PATH = AppServer.DEV; //pre-gm-plugin.gachafun.com localhost:5173 gm2-plugin.zverse.group
public static string WEB_PATH = AppServer.TEST; //pre-gm-plugin.gachafun.com localhost:5173 gm2-plugin.zverse.group
public static bool RUN_IN_DEBUG = true;
public static AppEnvironment APP_ENV = AppEnvironment.Prod;
#else

View File

@ -55,14 +55,12 @@ namespace AIProofread
this.btnLogin = this.Factory.CreateRibbonButton();
this.BtnShowManual = this.Factory.CreateRibbonButton();
this.BtnShowPanel = this.Factory.CreateRibbonButton();
this.menuSencenDect = this.Factory.CreateRibbonMenu();
this.btnDetectionAll = this.Factory.CreateRibbonButton();
this.btnDetectionParagraph = this.Factory.CreateRibbonButton();
this.btnDetectionHistory = this.Factory.CreateRibbonButton();
this.btnDetectionOneClick = this.Factory.CreateRibbonButton();
this.MenuMore = this.Factory.CreateRibbonMenu();
this.btnOpenLexicon = this.Factory.CreateRibbonButton();
this.ButtonSaveCache = this.Factory.CreateRibbonButton();
this.ButtonLoadCache = this.Factory.CreateRibbonButton();
this.btnDetectionHistory = this.Factory.CreateRibbonButton();
this.btnSetting = this.Factory.CreateRibbonButton();
this.grpOther = this.Factory.CreateRibbonGroup();
this.LblDate = this.Factory.CreateRibbonLabel();
@ -108,7 +106,7 @@ namespace AIProofread
this.group1.Items.Add(this.btnLogin);
this.group1.Items.Add(this.BtnShowManual);
this.group1.Items.Add(this.BtnShowPanel);
this.group1.Items.Add(this.menuSencenDect);
this.group1.Items.Add(this.btnDetectionOneClick);
this.group1.Items.Add(this.MenuMore);
this.group1.Name = "group1";
//
@ -240,38 +238,14 @@ namespace AIProofread
this.BtnShowPanel.Visible = false;
this.BtnShowPanel.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.BtnShowPanel_Click);
//
// menuSencenDect
// btnDetectionOneClick
//
this.menuSencenDect.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
this.menuSencenDect.Image = global::AIProofread.Properties.Resources.icon_ai_robot;
this.menuSencenDect.Items.Add(this.btnDetectionAll);
this.menuSencenDect.Items.Add(this.btnDetectionParagraph);
this.menuSencenDect.Items.Add(this.btnDetectionHistory);
this.menuSencenDect.Label = "一键校对\r\n";
this.menuSencenDect.Name = "menuSencenDect";
this.menuSencenDect.ShowImage = true;
//
// btnDetectionAll
//
this.btnDetectionAll.Label = "全文常识检测\r\n";
this.btnDetectionAll.Name = "btnDetectionAll";
this.btnDetectionAll.ShowImage = true;
this.btnDetectionAll.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnDetectionAll_Click);
//
// btnDetectionParagraph
//
this.btnDetectionParagraph.Enabled = false;
this.btnDetectionParagraph.Label = "段落常识检测\r\n";
this.btnDetectionParagraph.Name = "btnDetectionParagraph";
this.btnDetectionParagraph.ShowImage = true;
this.btnDetectionParagraph.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnDetectionParagraph_Click);
//
// btnDetectionHistory
//
this.btnDetectionHistory.Label = "历史检测记录\r\n";
this.btnDetectionHistory.Name = "btnDetectionHistory";
this.btnDetectionHistory.ShowImage = true;
this.btnDetectionHistory.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnDetectionHistory_Click);
this.btnDetectionOneClick.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
this.btnDetectionOneClick.Image = global::AIProofread.Properties.Resources.icon_ai_robot;
this.btnDetectionOneClick.Label = "一键校对\r\n";
this.btnDetectionOneClick.Name = "btnDetectionOneClick";
this.btnDetectionOneClick.ShowImage = true;
this.btnDetectionOneClick.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnDetectionOneClick_Click);
//
// MenuMore
//
@ -280,6 +254,7 @@ namespace AIProofread
this.MenuMore.Items.Add(this.btnOpenLexicon);
this.MenuMore.Items.Add(this.ButtonSaveCache);
this.MenuMore.Items.Add(this.ButtonLoadCache);
this.MenuMore.Items.Add(this.btnDetectionHistory);
this.MenuMore.Items.Add(this.btnSetting);
this.MenuMore.Label = "更多";
this.MenuMore.Name = "MenuMore";
@ -306,6 +281,13 @@ namespace AIProofread
this.ButtonLoadCache.ShowImage = true;
this.ButtonLoadCache.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.ButtonLoadCache_Click);
//
// btnDetectionHistory
//
this.btnDetectionHistory.Label = "校对历史\r\n";
this.btnDetectionHistory.Name = "btnDetectionHistory";
this.btnDetectionHistory.ShowImage = true;
this.btnDetectionHistory.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnDetectionHistory_Click);
//
// btnSetting
//
this.btnSetting.Label = "设置\r\n";
@ -457,9 +439,7 @@ namespace AIProofread
internal Microsoft.Office.Tools.Ribbon.RibbonButton BtnShowVersion;
internal Microsoft.Office.Tools.Ribbon.RibbonDropDown dropDown1;
internal Microsoft.Office.Tools.Ribbon.RibbonGroup grpOther;
internal Microsoft.Office.Tools.Ribbon.RibbonMenu menuSencenDect;
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnDetectionAll;
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnDetectionParagraph;
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnDetectionOneClick;
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnDetectionHistory;
internal Microsoft.Office.Tools.Ribbon.RibbonButton BtnShowManual;
internal Microsoft.Office.Tools.Ribbon.RibbonMenu menuProofreadList;

View File

@ -53,7 +53,7 @@ namespace AIProofread
btnLogout.Enabled = status;
ButtonLoadCache.Enabled = status;
ButtonSaveCache.Enabled = status;
menuSencenDect.Enabled = status;
btnDetectionOneClick.Enabled = status;
//BtnShowPanel.Enabled = status;
BtnExportProofreadResult.Enabled = status;
}
@ -615,14 +615,13 @@ namespace AIProofread
{
return;
}
btnDetectionParagraph.Enabled = r.Start != r.End;
btnDetectionAll.Enabled = r.Start == r.End;
//btnDetectionParagraph.Enabled = r.Start != r.End;
//btnDetectionAll.Enabled = r.Start == r.End;
}
public void SetDetectionBtnStatus(bool allStatus,bool rangeStatus)
public void SetDetectionBtnStatus(bool isChecking)
{
btnDetectionAll.Enabled = allStatus;
btnDetectionParagraph.Enabled = rangeStatus;
btnDetectionOneClick.Enabled = !isChecking;
}
private void BtnShowManual_Click(object sender, RibbonControlEventArgs e)
@ -657,5 +656,14 @@ namespace AIProofread
{
Globals.ThisAddIn.ShowLawQuery();
}
private void btnDetectionOneClick_Click(object sender, RibbonControlEventArgs e)
{
if (CommonSenseDetection.instance.isChecking)
{
return;
}
Globals.ThisAddIn.SendMessageToWeb("show-check-all", "");
}
}
}

View File

@ -159,16 +159,7 @@
<metadata name="BtnShowPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="menuSencenDect.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnDetectionAll.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnDetectionParagraph.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnDetectionHistory.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="btnDetectionOneClick.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnOpenLexicon.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@ -180,6 +171,9 @@
<metadata name="ButtonLoadCache.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnDetectionHistory.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnSetting.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>

View File

@ -64,7 +64,7 @@ namespace AIProofread.core
this.checkingKey = checkingKey;
this.checkingSummary = checkingSummary;
this.checkingLocation = checkingLocation;
Globals.ThisAddIn.ribbon.SetDetectionBtnStatus(false,false);
// Globals.ThisAddIn.ribbon.SetDetectionBtnStatus(false,false);
}
else
{
@ -73,8 +73,9 @@ namespace AIProofread.core
this.checkingSummary = null;
this.checkingLocation = null;
var enableAll = string.IsNullOrEmpty(checkingSummary);
Globals.ThisAddIn.ribbon.SetDetectionBtnStatus(enableAll,!enableAll);
//Globals.ThisAddIn.ribbon.SetDetectionBtnStatus(enableAll,!enableAll);
}
Globals.Ribbons.Ribbon1.SetDetectionBtnStatus(isChecking);
}
public string GetHistory()