Skip to content

Commit f946d4d

Browse files
Simple cleanup for installer
1 parent cddf760 commit f946d4d

9 files changed

+643
-42
lines changed

AlibreAddOn.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ public static void AddOnLoad(IntPtr hwnd, IAutomationHook pAutomationHook, IntPt
1515
AlibreRoot = (IADRoot) pAutomationHook.Root;
1616
_parentWinHandle = hwnd;
1717
_laucherAddonHandle = new AlibrePythonShellAddon.AlibrePythonShellAddon(AlibreRoot, _parentWinHandle);
18-
IADSession currentSession = AlibreRoot.TopmostSession;
19-
var PythonShell = new MainWindow(currentSession);
20-
var winform = new Form1(currentSession);
21-
winform.Show();
2218
}
2319
public static IADRoot GetRoot()
2420
{

AlibrePythonShellAddon.adc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<AlibreDesignAddOn specificationVersion="2" friendlyName="AlibrePythonShellAddon 1">
2-
<Author name="AuthorName" link="https://github.com/Testbed-for-Alibre-Design/AlibrePythonShell"/>
3-
<Copyright>Copyright (c) 2023</Copyright>
1+
<AlibreDesignAddOn specificationVersion="2" friendlyName="Alibre Python Shell">
2+
<Author name="Testbed for Alibre Design" link="https://github.com/Testbed-for-Alibre-Design/AlibrePythonShellAddon"/>
3+
<Copyright>Copyright (c) 2024</Copyright>
44
<DLL type="Managed" loadedWhen="Startup" location="AlibrePythonShell.dll"/>
55
<Icon location="logo.ico"/>
6-
<Menu text="AlibrePythonShellAddon 1"/>
7-
<Description>AlibrePythonShellAddon</Description>
6+
<Menu text="Alibre Python Shell"/>
7+
<Description>Alibre Python Shell Addon</Description>
88
<Workspace type="Always"/>
9-
<Property name="Identifier" value="AlibrePythonShellAddon"/>
9+
<Property name="Identifier" value="AlibrePythonShell"/>
1010
</AlibreDesignAddOn>

AlibrePythonShellAddon.cs

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public AlibrePythonShellAddon(IADRoot alibreRoot, IntPtr parentWinHandle)
2424
_alibreRoot = alibreRoot;
2525
_parentWinHandle = parentWinHandle;
2626

27-
//PythonShell.Topmost = true;
2827
BuildMenuTree();
2928
}
3029
public int RootMenuItem => MenuIdRoot;
@@ -55,9 +54,9 @@ public string MenuItemText(int menuId)
5554
{
5655
switch (menuId)
5756
{
58-
case MenuIdRoot: return "Global IronPython Console";
57+
case MenuIdRoot: return "Alibre Python Shell";
5958
}
60-
return "Global IronPython Console";
59+
return "Alibre Python Shell";
6160
}
6261
public bool PopupMenu(int menuId)
6362
{
@@ -93,7 +92,7 @@ public string MenuItemToolTip(int menuId)
9392
{
9493
switch (menuId)
9594
{
96-
case MenuIdUtils: return "Global IronPython Console";
95+
case MenuIdUtils: return "Alibre Python Shell";
9796
}
9897
return "";
9998
}
@@ -103,7 +102,7 @@ public string MenuIcon(int menuId)
103102
{
104103
case MenuIdUtils: return "logo.ico";
105104
}
106-
return "Global IronPython Console";
105+
return "Alibre Python Shell";
107106
}
108107
public bool HasPersistentDataToSave(string sessionIdentifier)
109108
{
@@ -116,28 +115,15 @@ public IAlibreAddOnCommand InvokeCommand(int menuId, string sessionIdentifier)
116115
{
117116
case MenuIdUtils:
118117
{
119-
return LauncherAddonCmd(session);
118+
return InvokeAddonCmd(session);
120119
}
121120
}
122121
return null;
123122
}
124-
private void OpenNewWindowOnSeparateThread()
123+
private IAlibreAddOnCommand InvokeAddonCmd(IADSession currentSession)
125124
{
126-
127-
}
128-
private IAlibreAddOnCommand LauncherAddonCmd(IADSession currentSession)
129-
{
130-
131-
System.Windows.MessageBox.Show("AlibrePythonShell Addon", "Global IronPython ConsoleCommand");
132-
133-
//Window cliW = new IronPython.
134-
135-
Window PythonShell = new MainWindow(currentSession);
136-
PythonShell.ShowDialog();
137-
//PythonShell.ShowDialog();
138-
//PythonShell.Topmost = true;
139-
// Create a new thread;
140-
125+
var winform = new Form1(currentSession);
126+
winform.Show();
141127
return null;
142128
}
143129
public void SaveData(IStream pCustomData, string sessionIdentifier)
@@ -148,7 +134,7 @@ public void setIsAddOnLicensed(bool isLicensed)
148134
}
149135
public bool UseDedicatedRibbonTab()
150136
{
151-
return true;
137+
return false;
152138
}
153139
public void LoadData(IStream pCustomData, string sessionIdentifier)
154140
{

AlibrePythonShellAddon.csproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<DebugSymbols>true</DebugSymbols>
2020
<DebugType>full</DebugType>
2121
<Optimize>false</Optimize>
22-
<OutputPath>bin\RhinoPythonShell\</OutputPath>
22+
<OutputPath>bin\</OutputPath>
2323
<DefineConstants>DEBUG;TRACE</DefineConstants>
2424
<ErrorReport>prompt</ErrorReport>
2525
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
@@ -58,26 +58,26 @@
5858
<Reference Include="IronPython, Version=2.7.8.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
5959
<SpecificVersion>False</SpecificVersion>
6060
<HintPath>..\..\..\..\..\Program Files\Rhino 6\Plug-ins\IronPython\IronPython.dll</HintPath>
61-
<Private>False</Private>
61+
<Private>True</Private>
6262
</Reference>
6363
<Reference Include="IronPython.Modules, Version=2.7.8.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
6464
<SpecificVersion>False</SpecificVersion>
6565
<HintPath>..\..\..\..\..\Program Files\Rhino 6\Plug-ins\IronPython\IronPython.Modules.dll</HintPath>
66-
<Private>False</Private>
66+
<Private>True</Private>
6767
</Reference>
6868
<Reference Include="Microsoft.Dynamic, Version=1.2.0.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
6969
<SpecificVersion>False</SpecificVersion>
7070
<HintPath>..\..\..\..\..\Program Files\Rhino 6\Plug-ins\IronPython\Microsoft.Dynamic.dll</HintPath>
71-
<Private>False</Private>
71+
<Private>True</Private>
7272
</Reference>
7373
<Reference Include="Microsoft.Scripting, Version=1.2.0.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
7474
<SpecificVersion>False</SpecificVersion>
7575
<HintPath>..\..\..\..\..\Program Files\Rhino 6\Plug-ins\IronPython\Microsoft.Scripting.dll</HintPath>
76-
<Private>False</Private>
76+
<Private>True</Private>
7777
</Reference>
7878
<Reference Include="Microsoft.Scripting.Metadata">
7979
<HintPath>..\..\..\..\..\Program Files\Rhino 6\Plug-ins\IronPython\Microsoft.Scripting.Metadata.dll</HintPath>
80-
<Private>False</Private>
80+
<Private>True</Private>
8181
</Reference>
8282
<Reference Include="PresentationCore" />
8383
<Reference Include="PresentationFramework" />
@@ -147,13 +147,13 @@
147147
<Content Include="IronPythonConsole.py">
148148
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
149149
</Content>
150-
<Resource Include="Resources\python.ico" />
151-
<Content Include="logo.ico">
150+
<Content Include="logo.png">
152151
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
153152
</Content>
154-
<Content Include="logo.png">
153+
<Content Include="logo.ico">
155154
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
156155
</Content>
156+
<Resource Include="Resources\python.ico" />
157157
<Content Include="AlibrePython\Host\__init__.py">
158158
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
159159
</Content>

0 commit comments

Comments
 (0)