Refine Word ribbon and Windows Companion presentation for 1.0.0.29
This commit is contained in:
parent
a02441c123
commit
fe793f4b7a
@ -14,7 +14,7 @@ public sealed class CredentialRotation
|
||||
}
|
||||
public sealed class CompanionPreferences
|
||||
{
|
||||
public int Width {get;set;}=540;public int Height {get;set;}=640;public bool AdvancedMode {get;set;}public bool RememberInDocument {get;set;}public Guid LastManuscript {get;set;}
|
||||
public int Width {get;set;}=410;public int Height {get;set;}=540;public bool AdvancedMode {get;set;}public bool RememberInDocument {get;set;}public Guid LastManuscript {get;set;}
|
||||
}
|
||||
public sealed class CompanionState
|
||||
{
|
||||
|
||||
@ -2,6 +2,6 @@
|
||||
<Import Project="../DeveloperVersion.props" />
|
||||
<PropertyGroup><AssemblyVersion>$(ApplicationVersion)</AssemblyVersion><FileVersion>$(ApplicationVersion)</FileVersion><Version>$(ApplicationVersion)</Version></PropertyGroup>
|
||||
<PropertyGroup><OutputType>Exe</OutputType><TargetFrameworks>net10.0;net10.0-windows</TargetFrameworks><EnableWindowsTargeting>true</EnableWindowsTargeting><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable><Company>Nick Beckley</Company></PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net10.0-windows'"><OutputType>WinExe</OutputType><UseWindowsForms>true</UseWindowsForms></PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net10.0-windows'"><OutputType>WinExe</OutputType><UseWindowsForms>true</UseWindowsForms><ApplicationIcon>../../PlotLine/wwwroot/favicon.ico</ApplicationIcon></PropertyGroup>
|
||||
<ItemGroup><ProjectReference Include="../Protocol/PlotDirector.Companion.Protocol.csproj" /></ItemGroup>
|
||||
</Project>
|
||||
|
||||
@ -104,7 +104,7 @@ public sealed class SessionManager(CloudGateway? cloud = null,ChapterAiWork? ai
|
||||
if(message.Kind.StartsWith("ai-",StringComparison.Ordinal))return ai?.Handle(document.Descriptor,message,answer)??Reject(answer,"ai-unavailable");
|
||||
switch (message.Kind)
|
||||
{
|
||||
case "tray-context":case "tray-intent": break;
|
||||
case "tray-context":case "tray-intent":case "tray-workspace": break;
|
||||
case "tray-sync":case "tray-repair":if(!word.ChapterCapable)return Reject(answer,"unsupported-chapter-capability");break;
|
||||
case "metrics": break;
|
||||
case "adapter-result":break;
|
||||
|
||||
@ -27,7 +27,7 @@ internal static class TrayApplication
|
||||
internal sealed class CompanionWindow:Form
|
||||
{
|
||||
private readonly TrayCoordinator control;private readonly CloudGateway cloud;private readonly CancellationTokenSource shutdown;private readonly string directory;
|
||||
private readonly Icon brand=CreateBrandIcon();private readonly NotifyIcon tray;private readonly System.Windows.Forms.Timer timer=new(){Interval=750};
|
||||
private readonly Icon brand=Icon.ExtractAssociatedIcon(Application.ExecutablePath) ?? (Icon)SystemIcons.Application.Clone();private readonly NotifyIcon tray;private readonly System.Windows.Forms.Timer timer=new(){Interval=750};
|
||||
private readonly ToolTip tips=new();private bool exiting,refreshing,advanced,choosingBook;private Guid selected,lastActive;private TrayDocument[] displayed=[];private string docsKey="",error="";
|
||||
private readonly ComboBox documents=new(){DropDownStyle=ComboBoxStyle.DropDownList,Dock=DockStyle.Top,AccessibleName="Word manuscript"};
|
||||
private readonly ComboBox books=new(){DropDownStyle=ComboBoxStyle.DropDownList,Dock=DockStyle.Top,DisplayMember="Title",AccessibleName="PlotDirector book",DropDownWidth=620};
|
||||
@ -39,16 +39,23 @@ internal sealed class CompanionWindow:Form
|
||||
public CompanionWindow(TrayCoordinator control,CloudGateway cloud,CancellationTokenSource shutdown,string directory)
|
||||
{
|
||||
this.control=control;this.cloud=cloud;this.shutdown=shutdown;this.directory=directory;advanced=cloud.Preferences.AdvancedMode;
|
||||
Text="PlotDirector Companion";Icon=brand;Font=new("Segoe UI",10);AutoScaleMode=AutoScaleMode.Dpi;MinimumSize=new(460,590);Size=new(Math.Clamp(cloud.Preferences.Width,460,1000),Math.Clamp(cloud.Preferences.Height,590,1100));DoubleBuffered=true;
|
||||
var layout=Stack(22);layout.Dock=DockStyle.Fill;layout.AutoSize=false;layout.AutoScroll=true;Controls.Add(layout);
|
||||
var header=new TableLayoutPanel{Dock=DockStyle.Top,AutoSize=true,ColumnCount=2,Margin=new(0,0,0,16)};header.ColumnStyles.Add(new(SizeType.Percent,100));header.ColumnStyles.Add(new(SizeType.AutoSize));
|
||||
Text="PlotDirector Companion";Icon=brand;Font=new("Segoe UI",10);AutoScaleMode=AutoScaleMode.Dpi;MinimumSize=new(400,460);DoubleBuffered=true;
|
||||
var preferences=cloud.Preferences;
|
||||
var previousDefault=preferences.Width==540&&preferences.Height==640;
|
||||
var workArea=Screen.FromPoint(Cursor.Position).WorkingArea.Size;
|
||||
Size=new(Math.Clamp(previousDefault?410:preferences.Width,400,Math.Max(400,Math.Min(1000,workArea.Width))),
|
||||
Math.Clamp(previousDefault?540:preferences.Height,460,Math.Max(460,Math.Min(1100,workArea.Height))));
|
||||
var layout=Stack(14);layout.Dock=DockStyle.Fill;layout.AutoSize=false;layout.AutoScroll=true;Controls.Add(layout);
|
||||
var header=new TableLayoutPanel{Dock=DockStyle.Top,AutoSize=true,ColumnCount=2,Margin=new(0,0,0,8)};header.ColumnStyles.Add(new(SizeType.Percent,100));header.ColumnStyles.Add(new(SizeType.AutoSize));
|
||||
var name=Label("PlotDirector");name.Font=new("Segoe UI",24,FontStyle.Bold);header.Controls.Add(name,0,0);header.Controls.Add(Button("Settings",ShowSettings),1,0);
|
||||
var version=Label("COMPANION · "+typeof(CompanionWindow).Assembly.GetName().Version);version.Font=new("Segoe UI",9);header.Controls.Add(version,0,1);layout.Controls.Add(header);
|
||||
var connection=Card();connection.Controls.Add(Heading("YOUR CONNECTIONS"));connection.Controls.Add(serverStatus);connection.Controls.Add(account);connection.Controls.Add(wordStatus);connection.Controls.Add(authorise);layout.Controls.Add(connection);
|
||||
authorise.Click+=(_,_)=>Safe(()=>cloud.Connect(cloud.Status().ServerUrl));
|
||||
var manuscript=Card();manuscript.Controls.Add(Heading("CURRENT MANUSCRIPT"));manuscript.Controls.Add(documents);manuscript.Controls.Add(guidance);
|
||||
var bookLayout=new TableLayoutPanel{Dock=DockStyle.Top,AutoSize=true,ColumnCount=2,Margin=new(0,12,0,8),MinimumSize=new(0,180)};bookLayout.ColumnStyles.Add(new(SizeType.Absolute,124));bookLayout.ColumnStyles.Add(new(SizeType.Percent,100));bookLayout.Controls.Add(cover,0,0);
|
||||
var details=Stack(8);details.Controls.Add(Heading("PLOTDIRECTOR BOOK"));bookTitle.Font=new("Segoe UI",14,FontStyle.Bold);details.Controls.Add(bookTitle);details.Controls.Add(projectTitle);details.Controls.Add(Button("Change book…",ChangeBook));bookLayout.Controls.Add(details,1,0);manuscript.Controls.Add(bookLayout);layout.Controls.Add(manuscript);
|
||||
var bookLayout=new TableLayoutPanel{Dock=DockStyle.Top,AutoSize=true,ColumnCount=2,Margin=new(0,6,0,4),MinimumSize=new(0,164)};bookLayout.ColumnStyles.Add(new(SizeType.Absolute,110));bookLayout.ColumnStyles.Add(new(SizeType.Percent,100));bookLayout.Controls.Add(cover,0,0);
|
||||
var details=Stack(8);details.Controls.Add(Heading("PLOTDIRECTOR BOOK"));bookTitle.Font=new("Segoe UI",14,FontStyle.Bold);details.Controls.Add(bookTitle);details.Controls.Add(projectTitle);details.Controls.Add(Button("Change book…",ChangeBook));bookLayout.Controls.Add(details,1,0);
|
||||
details.SizeChanged+=(_,_)=>{var titleWidth=Math.Max(1,details.ClientSize.Width-details.Padding.Horizontal-bookTitle.Margin.Horizontal);bookTitle.MaximumSize=new(titleWidth,0);projectTitle.MaximumSize=new(titleWidth,0);};
|
||||
manuscript.Controls.Add(bookLayout);layout.Controls.Add(manuscript);
|
||||
var open=Button("Open PlotDirector ↗",()=>cloud.OpenSite());open.Tag="primary";open.Dock=DockStyle.Top;open.MinimumSize=new(0,44);layout.Controls.Add(open);
|
||||
notice.Margin=new(0,12,0,0);layout.Controls.Add(notice);
|
||||
documents.SelectedIndexChanged+=(_,_)=>{if(!refreshing&&documents.SelectedItem is TrayDocument doc){selected=doc.Session;SavePreferences();RefreshState();}};
|
||||
@ -61,7 +68,7 @@ internal sealed class CompanionWindow:Form
|
||||
private static Label Label(string text="")=>new(){Text=text,AutoSize=true,Dock=DockStyle.Top,MaximumSize=new(1600,0),Margin=new(0,3,0,5)};
|
||||
private static Label Heading(string text){var label=Label(text);label.Font=new("Segoe UI",9,FontStyle.Bold);label.Margin=new(0,0,0,9);return label;}
|
||||
private static TableLayoutPanel Stack(int padding=0){var panel=new TableLayoutPanel{Dock=DockStyle.Top,AutoSize=true,AutoSizeMode=AutoSizeMode.GrowAndShrink,ColumnCount=1,Padding=new(padding),Margin=new(0)};panel.ColumnStyles.Add(new(SizeType.Percent,100));return panel;}
|
||||
private static RoundedCard Card()=>new(){Dock=DockStyle.Top,AutoSize=true,AutoSizeMode=AutoSizeMode.GrowAndShrink,Padding=new(16),Margin=new(0,0,0,14),ColumnCount=1};
|
||||
private static RoundedCard Card()=>new(){Dock=DockStyle.Top,AutoSize=true,AutoSizeMode=AutoSizeMode.GrowAndShrink,Padding=new(10),Margin=new(0,0,0,8),ColumnCount=1};
|
||||
private Button Button(string text,Action action){var button=new Button{Text=text,AutoSize=true,MinimumSize=new(0,34)};button.Click+=(_,_)=>Safe(action);return button;}
|
||||
private void Safe(Action action){try{error="";action();}catch(Exception e)when(e is InvalidOperationException or ArgumentException or IOException or System.ComponentModel.Win32Exception){error=e.Message;}if(dialogNotice is {IsDisposed:false})SetText(dialogNotice,error);RefreshState();}
|
||||
private void SavePreferences(){var size=WindowState==FormWindowState.Normal?Size:RestoreBounds.Size;var prefs=cloud.Preferences;prefs.Width=size.Width;prefs.Height=size.Height;prefs.AdvancedMode=advanced;prefs.LastManuscript=Current?.Manuscript??prefs.LastManuscript;cloud.SavePreferences(prefs);}
|
||||
@ -84,8 +91,10 @@ internal sealed class CompanionWindow:Form
|
||||
private void ShowSettings()
|
||||
{
|
||||
if(settings!=null&&!settings.IsDisposed){settings.Show(this);settings.Activate();return;}
|
||||
settings=new Form{Text="PlotDirector · Settings",Icon=brand,Font=Font,AutoScaleMode=AutoScaleMode.Dpi,MinimumSize=new(480,420),Size=new(640,620),StartPosition=FormStartPosition.CenterParent};
|
||||
var root=Stack(20);root.Dock=DockStyle.Fill;root.AutoScroll=true;settings.Controls.Add(root);
|
||||
settings=new Form{Text="PlotDirector · Settings",Icon=brand,Font=Font,AutoScaleMode=AutoScaleMode.Dpi,MinimumSize=new(540,460),Size=new(800,780),StartPosition=FormStartPosition.CenterParent};
|
||||
var workArea=Screen.FromControl(this).WorkingArea.Size;
|
||||
settings.Size=new(Math.Min(settings.Width,workArea.Width),Math.Min(settings.Height,workArea.Height));
|
||||
var root=Stack(22);root.Dock=DockStyle.Fill;root.AutoSize=false;root.AutoScroll=true;settings.Controls.Add(root);
|
||||
settingsNotice=Label();root.Controls.Add(settingsNotice);root.Controls.Add(Heading("CONNECTION & ACCOUNT"));site=new(){Text=cloud.Status().ServerUrl,Dock=DockStyle.Top,AccessibleName="PlotDirector server HTTPS address"};root.Controls.Add(site);
|
||||
root.Controls.Add(Label("Your approved connection reconnects automatically. Changing account requires browser approval."));
|
||||
var accountActions=new FlowLayoutPanel{Dock=DockStyle.Top,AutoSize=true};accountActions.Controls.Add(Button("Change account…",()=>cloud.ChangeAccount(site.Text.Trim())));accountActions.Controls.Add(Button("Sign out",()=>{if(MessageBox.Show(settings,"Sign out and revoke this Companion’s approval? You will need browser approval to connect again.","Sign out",MessageBoxButtons.OKCancel)==DialogResult.OK)cloud.SignOut();}));root.Controls.Add(accountActions);
|
||||
@ -95,7 +104,9 @@ internal sealed class CompanionWindow:Form
|
||||
advancedPanel.Controls.Add(Heading("TROUBLESHOOTING"));diagnostics=new(){Multiline=true,ReadOnly=true,Dock=DockStyle.Top,Height=160,ScrollBars=ScrollBars.Vertical,AccessibleName="Connection and document diagnostics"};advancedPanel.Controls.Add(diagnostics);
|
||||
var checks=new FlowLayoutPanel{Dock=DockStyle.Top,AutoSize=true};checks.Controls.Add(Button("Check connection",()=>_ = cloud.ReconnectAsync()));checks.Controls.Add(Button("Check Word registration",()=>{if(Current==null)throw new InvalidOperationException("Open and select a Word document first.");control.RefreshPresence(selected);}));checks.Controls.Add(Button("Open logs folder",()=>System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(directory){UseShellExecute=true})));advancedPanel.Controls.Add(checks);
|
||||
advancedPanel.Controls.Add(Heading("SELECTED WORD DOCUMENT"));advancedPanel.Controls.Add(Label("Maintenance touches only PlotDirector-owned markers and association properties. Word is never saved automatically. If interrupted, inspect again before retrying."));
|
||||
foreach(var entry in new[]{("Inspect hidden identifiers","inspect"),("Remove PlotDirector markers…","markers"),("Reset document association…","reset"),("Clean and unlink…","clean")}){var kind=entry.Item2;advancedPanel.Controls.Add(Button(entry.Item1,()=>Maintenance(kind)));}
|
||||
var maintenanceActions=new FlowLayoutPanel{Dock=DockStyle.Top,AutoSize=true};
|
||||
foreach(var entry in new[]{("Inspect hidden identifiers","inspect"),("Remove PlotDirector markers…","markers"),("Reset document association…","reset"),("Clean and unlink…","clean")}){var kind=entry.Item2;maintenanceActions.Controls.Add(Button(entry.Item1,()=>Maintenance(kind)));}
|
||||
advancedPanel.Controls.Add(maintenanceActions);
|
||||
advancedToggle.CheckedChanged+=(_,_)=>{advanced=advancedToggle.Checked;advancedPanel.Visible=advanced;SavePreferences();};
|
||||
root.Controls.Add(Button("Help",()=>cloud.OpenSite("help")));settings.FormClosing+=(_,_)=>SavePreferences();PaintTheme(settings);RefreshState();settings.Show(this);
|
||||
}
|
||||
@ -149,12 +160,6 @@ internal sealed class CompanionWindow:Form
|
||||
}
|
||||
private void Exit(){SavePreferences();exiting=true;File.WriteAllText(Path.Combine(directory,"paused"),"User exited Companion");shutdown.Cancel();tray.Visible=false;Application.Exit();}
|
||||
protected override void Dispose(bool disposing){if(disposing){Microsoft.Win32.SystemEvents.UserPreferenceChanged-=OnPreferences;coverStop?.Cancel();timer.Dispose();settings?.Dispose();tips.Dispose();tray.Dispose();brand.Dispose();}base.Dispose(disposing);}
|
||||
private static Icon CreateBrandIcon()
|
||||
{
|
||||
using var bitmap=new Bitmap(32,32);using(var graphics=Graphics.FromImage(bitmap)){graphics.SmoothingMode=System.Drawing.Drawing2D.SmoothingMode.AntiAlias;graphics.Clear(Color.Transparent);using var brush=new SolidBrush(Color.FromArgb(108,58,47));graphics.FillEllipse(brush,0,0,31,31);using var font=new Font("Segoe UI",19,FontStyle.Bold,GraphicsUnit.Pixel);using var ink=new SolidBrush(Color.FromArgb(255,244,223));graphics.DrawString("P",font,ink,7,3);}
|
||||
var handle=bitmap.GetHicon();try{using var borrowed=Icon.FromHandle(handle);return (Icon)borrowed.Clone();}finally{DestroyIcon(handle);}
|
||||
}
|
||||
[System.Runtime.InteropServices.DllImport("user32.dll")]private static extern bool DestroyIcon(IntPtr handle);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -41,6 +41,8 @@ public sealed partial class TrayCoordinator(SessionManager sessions,CloudGateway
|
||||
if(request.Kind is "tray-sync" or "tray-repair")_ = RequestChapterFromRibbon(doc,request.Revision);
|
||||
if ((request.Kind is "tray-context" or "tray-intent") && answer.Status == "ok")
|
||||
_ = OpenRibbonWorkspace(doc.Session, request.Revision, request.Kind == "tray-context" ? "context" : "intent");
|
||||
if (request.Kind == "tray-workspace" && answer.Status == "ok")
|
||||
_ = OpenRibbonWorkspace(doc.Session, request.Revision, "book");
|
||||
CaptureFrame(doc,request,answer);
|
||||
if((request.Kind=="selection"||request.Kind=="snapshot-end")&&!ChapterCapable(instance)){doc.ChapterId=answer.ChapterId;doc.SceneId=answer.SceneId;doc.ChapterTitle=answer.ChapterTitle;doc.SceneTitle=answer.SceneTitle;}
|
||||
if(answer.WordCount.HasValue)doc.Words=answer.WordCount;
|
||||
|
||||
@ -1 +1 @@
|
||||
<Project><PropertyGroup><ApplicationVersion>1.0.0.28</ApplicationVersion></PropertyGroup></Project>
|
||||
<Project><PropertyGroup><ApplicationVersion>1.0.0.29</ApplicationVersion></PropertyGroup></Project>
|
||||
|
||||
@ -42,6 +42,7 @@ namespace PlotDirector.WordAddIn
|
||||
var enabled = CanOpenBook(null).ToString();
|
||||
Refresh("PlotDirectorContext", enabled);
|
||||
Refresh("PlotDirectorIntent", enabled);
|
||||
Refresh("PlotDirectorWeb", enabled);
|
||||
Refresh("PlotDirectorSynchronise", enabled);
|
||||
Refresh("PlotDirectorRepair", enabled);
|
||||
}
|
||||
@ -55,15 +56,9 @@ namespace PlotDirector.WordAddIn
|
||||
displayed[id] = value;
|
||||
}
|
||||
|
||||
private static string ShortLabel(string text, int limit) =>
|
||||
text.Length <= limit ? text : text.Substring(0, limit - (char.IsHighSurrogate(text[limit - 1]) ? 1 : 0)) + "…";
|
||||
|
||||
public bool CanOpenBook(Office.IRibbonControl control) => adapter()?.HasRibbonBook == true;
|
||||
public string GetBook(Office.IRibbonControl control) => ShortLabel(GetBookTip(control), 40);
|
||||
public string GetBookTip(Office.IRibbonControl control) => adapter()?.RibbonBook ?? "No linked book";
|
||||
public string GetChapter(Office.IRibbonControl control) => ShortLabel(GetChapterTip(control), 64);
|
||||
public string GetChapterTip(Office.IRibbonControl control) => adapter()?.RibbonChapter ?? "Chapter unverified";
|
||||
public string GetScene(Office.IRibbonControl control) => ShortLabel(GetSceneTip(control), 64);
|
||||
public string GetSceneTip(Office.IRibbonControl control) => adapter()?.RibbonScene ?? "Scene unverified";
|
||||
public string GetSyncStatus(Office.IRibbonControl control) => adapter()?.ChapterStatusLabel ?? "Not connected";
|
||||
public string GetSyncProgress(Office.IRibbonControl control) => adapter()?.RibbonSyncProgress ?? " ";
|
||||
@ -71,6 +66,7 @@ namespace PlotDirector.WordAddIn
|
||||
public string GetStatus(Office.IRibbonControl control) => adapter()?.ConnectionState == "connected" ? "Companion connected" : "Companion offline";
|
||||
public void OpenContext(Office.IRibbonControl control) => adapter()?.OpenWritingWorkspace("tray-context");
|
||||
public void OpenIntent(Office.IRibbonControl control) => adapter()?.OpenWritingWorkspace("tray-intent");
|
||||
public void OpenPlotDirector(Office.IRibbonControl control) => adapter()?.OpenWritingWorkspace("tray-workspace");
|
||||
public void Synchronise(Office.IRibbonControl control) => adapter()?.RequestChapterSynchronisation(false);
|
||||
public void Repair(Office.IRibbonControl control) => adapter()?.RequestChapterSynchronisation(true);
|
||||
public void Troubleshooting(Office.IRibbonControl control) => adapter()?.ShowTroubleshooting();
|
||||
|
||||
@ -3,6 +3,6 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTitle("PlotDirector Word Companion — Native development")]
|
||||
[assembly: AssemblyCompany("Nick Beckley")]
|
||||
[assembly: AssemblyProduct("PlotDirector")]
|
||||
[assembly: AssemblyVersion("1.0.0.28")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.28")]
|
||||
[assembly: AssemblyVersion("1.0.0.29")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.29")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
@ -3,23 +3,28 @@
|
||||
<tabs>
|
||||
<tab id="PlotDirectorTab" label="PlotDirector">
|
||||
<group id="PlotDirectorManuscript" label="Manuscript">
|
||||
<labelControl id="PlotDirectorBook" getLabel="GetBook" getSupertip="GetBookTip" />
|
||||
<labelControl id="PlotDirectorChapter" getLabel="GetChapter" getSupertip="GetChapterTip" />
|
||||
<labelControl id="PlotDirectorScene" getLabel="GetScene" getSupertip="GetSceneTip" />
|
||||
<editBox id="PlotDirectorBook" label="Book" getText="GetBookTip" getSupertip="GetBookTip" enabled="false" sizeString="MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM" />
|
||||
<editBox id="PlotDirectorChapter" label="Chapter" getText="GetChapterTip" getSupertip="GetChapterTip" enabled="false" sizeString="MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM" />
|
||||
<editBox id="PlotDirectorScene" label="Scene" getText="GetSceneTip" getSupertip="GetSceneTip" enabled="false" sizeString="MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM" />
|
||||
</group>
|
||||
<group id="PlotDirectorWriting" label="Writing">
|
||||
<button id="PlotDirectorContext" label="Writing Context" size="large" imageMso="ReadingMode" onAction="OpenContext" getEnabled="CanOpenBook" />
|
||||
<button id="PlotDirectorIntent" label="Writing Intent" size="large" imageMso="ReviewNewComment" onAction="OpenIntent" getEnabled="CanOpenBook" />
|
||||
<button id="PlotDirectorWeb" label="PlotDirector" size="large" imageMso="HyperlinkInsert" onAction="OpenPlotDirector" getEnabled="CanOpenBook" />
|
||||
</group>
|
||||
<group id="PlotDirectorCompanion" label="Companion">
|
||||
<button id="PlotDirectorOpen" label="Open Companion" size="large" imageMso="WindowNew" onAction="OpenCompanion" />
|
||||
</group>
|
||||
<group id="PlotDirectorSync" label="Synchronisation">
|
||||
<button id="PlotDirectorSyncStatus" getLabel="GetSyncStatus" getSupertip="GetSyncTip" imageMso="FileDocumentInspect" onAction="Troubleshooting" />
|
||||
<labelControl id="PlotDirectorSyncProgress" getLabel="GetSyncProgress" />
|
||||
<button id="PlotDirectorSynchronise" label="Synchronise" imageMso="RefreshAll" onAction="Synchronise" getEnabled="CanOpenBook" supertip="Check this manuscript using the existing chapter synchronisation workflow." />
|
||||
<box id="PlotDirectorSyncState" boxStyle="vertical">
|
||||
<labelControl id="PlotDirectorStatus" getLabel="GetStatus" />
|
||||
<labelControl id="PlotDirectorSyncStatus" getLabel="GetSyncStatus" getSupertip="GetSyncTip" />
|
||||
<labelControl id="PlotDirectorSyncProgress" getLabel="GetSyncProgress" />
|
||||
</box>
|
||||
<button id="PlotDirectorSynchronise" label="Synchronise" size="large" imageMso="RefreshAll" onAction="Synchronise" getEnabled="CanOpenBook" supertip="Check this manuscript using the existing chapter synchronisation workflow." />
|
||||
</group>
|
||||
<group id="PlotDirectorConnection" label="Connection">
|
||||
<labelControl id="PlotDirectorStatus" getLabel="GetStatus" />
|
||||
<button id="PlotDirectorOpen" label="Open Companion" imageMso="WindowNew" onAction="OpenCompanion" />
|
||||
<menu id="PlotDirectorTools" label="Tools">
|
||||
<group id="PlotDirectorMaintenance" label="Tools">
|
||||
<menu id="PlotDirectorTools" label="Tools" size="large" imageMso="ToolsOptions">
|
||||
<button id="PlotDirectorRepair" label="Repair Synchronisation" onAction="Repair" getEnabled="CanOpenBook" supertip="Validate or repair the existing import while preserving existing chapters, scenes and author decisions." />
|
||||
<button id="PlotDirectorRemoveLegacyMarkers" label="Remove Legacy Markers" onAction="RemoveLegacyMarkers" supertip="Remove old PlotDirector chapter and scene anchors while keeping the manuscript and its identity." />
|
||||
<button id="PlotDirectorTroubleshooting" label="Troubleshooting" onAction="Troubleshooting" supertip="Inspect advanced Word connection, navigation and synchronisation diagnostics." />
|
||||
|
||||
@ -28,15 +28,8 @@ $output=(Resolve-Path $OutputDirectory).Path
|
||||
$work=Join-Path $output 'build'
|
||||
New-Item -ItemType Directory -Path $work -Force | Out-Null
|
||||
|
||||
# Reuse the tray's existing P branding for setup, shortcuts and Apps & Features.
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
$bitmap=[Drawing.Bitmap]::new(64,64);$graphics=[Drawing.Graphics]::FromImage($bitmap)
|
||||
$graphics.Clear([Drawing.Color]::Transparent);$graphics.SmoothingMode='AntiAlias'
|
||||
$brush=[Drawing.SolidBrush]::new([Drawing.Color]::FromArgb(116,67,46));$graphics.FillEllipse($brush,1,1,62,62)
|
||||
$font=[Drawing.Font]::new('Segoe UI',35,[Drawing.FontStyle]::Bold,[Drawing.GraphicsUnit]::Pixel)
|
||||
$format=[Drawing.StringFormat]::new();$format.Alignment='Center';$format.LineAlignment='Center'
|
||||
$graphics.DrawString('P',$font,[Drawing.Brushes]::White,[Drawing.RectangleF]::new(0,0,64,64),$format)
|
||||
$icon=[Drawing.Icon]::FromHandle($bitmap.GetHicon());$iconPath=Join-Path $work 'PlotDirector.ico';$stream=[IO.File]::Create($iconPath);$icon.Save($stream);$stream.Dispose();$graphics.Dispose();$font.Dispose();$brush.Dispose();$bitmap.Dispose()
|
||||
# Use the same authoritative web favicon as the tray executable.
|
||||
$iconPath=Join-Path $repo 'PlotLine/wwwroot/favicon.ico'
|
||||
|
||||
$installer=New-Object -ComObject WindowsInstaller.Installer
|
||||
function Invoke-Com($object,[string]$name,[object[]]$arguments){$values=@(foreach($value in $arguments){if($null -eq $value){$null}else{$value.PSObject.BaseObject}});$object.GetType().InvokeMember($name,[Reflection.BindingFlags]::InvokeMethod,$null,$object,$values)}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"version": "1.0.0.28",
|
||||
"msiVersion": "1.0.28",
|
||||
"productCode": "{DDEA70FE-62F7-4530-922F-B3C2CA1A2860}",
|
||||
"version": "1.0.0.29",
|
||||
"msiVersion": "1.0.29",
|
||||
"productCode": "{CE0CA0FF-BB63-43C3-82A0-B32640956FEF}",
|
||||
"upgradeCode": "{641A087B-9779-458C-B290-BCBBAD49319A}",
|
||||
"atlasBaseline": "9fed339879887964d526cff00772ffc4dc522c5d",
|
||||
"baselineProductCode": "{98F46939-764D-407F-BD1F-1D88315D010A}",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user