kopia lustrzana https://github.com/Hamlib/Hamlib
Remove hamlibgui -- going another route
rodzic
b25b496051
commit
e9f9286f21
|
@ -1,48 +0,0 @@
|
||||||
using System;
|
|
||||||
using Gtk;
|
|
||||||
using UI = Gtk.Builder.ObjectAttribute;
|
|
||||||
|
|
||||||
namespace hamlibgui
|
|
||||||
{
|
|
||||||
class MainWindow : Window
|
|
||||||
{
|
|
||||||
[UI] private Label _label1 = null;
|
|
||||||
[UI] private Button _button1 = null;
|
|
||||||
|
|
||||||
private bool connectFlag;
|
|
||||||
|
|
||||||
public MainWindow() : this(new Builder("MainWindow.glade")) { }
|
|
||||||
|
|
||||||
private MainWindow(Builder builder) : base(
|
|
||||||
builder.GetRawOwnedObject("MainWindow"))
|
|
||||||
{
|
|
||||||
builder.Autoconnect(this);
|
|
||||||
|
|
||||||
DeleteEvent += Window_DeleteEvent;
|
|
||||||
_button1.Clicked += Button1_Clicked;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_DeleteEvent(object sender, DeleteEventArgs a)
|
|
||||||
{
|
|
||||||
Application.Quit();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Button1_Clicked(object sender, EventArgs a)
|
|
||||||
{
|
|
||||||
connectFlag = !connectFlag;
|
|
||||||
|
|
||||||
if (connectFlag)
|
|
||||||
{
|
|
||||||
String mytext = "Rig Connected (not really)";
|
|
||||||
_label1.Text = mytext;
|
|
||||||
_button1.Label = "Disconnect Rig";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
String mytext = "Rig not Connected ";
|
|
||||||
_label1.Text = mytext;
|
|
||||||
_button1.Label = "Connect to Rig";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!-- Generated with glade 3.38.2 -->
|
|
||||||
<interface>
|
|
||||||
<requires lib="gtk+" version="3.18"/>
|
|
||||||
<object class="GtkWindow" id="MainWindow">
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="title" translatable="yes">Hamlib Control</property>
|
|
||||||
<property name="default-width">480</property>
|
|
||||||
<property name="default-height">240</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="margin-left">4</property>
|
|
||||||
<property name="margin-right">4</property>
|
|
||||||
<property name="margin-top">4</property>
|
|
||||||
<property name="margin-bottom">4</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="_label1">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Hamlib controller to go here</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="_button1">
|
|
||||||
<property name="label" translatable="yes">Connect to Rig</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="receives-default">True</property>
|
|
||||||
<property name="tooltip-markup" translatable="yes">Click to connect/disconnect rig</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</interface>
|
|
|
@ -1,23 +0,0 @@
|
||||||
using System;
|
|
||||||
using Gtk;
|
|
||||||
|
|
||||||
namespace hamlibgui
|
|
||||||
{
|
|
||||||
class Program
|
|
||||||
{
|
|
||||||
[STAThread]
|
|
||||||
public static void Main(string[] args)
|
|
||||||
{
|
|
||||||
Application.Init();
|
|
||||||
|
|
||||||
var app = new Application("org.hamlibgui.hamlibgui", GLib.ApplicationFlags.None);
|
|
||||||
app.Register(GLib.Cancellable.Current);
|
|
||||||
|
|
||||||
var win = new MainWindow();
|
|
||||||
app.AddWindow(win);
|
|
||||||
|
|
||||||
win.Show();
|
|
||||||
Application.Run();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
This is a test of creating a portable Hamlib GUI controller using dotnet and GTK
|
|
||||||
Should be able to compile on Windows, Linux, and MacOS
|
|
||||||
No guarantee this will go anywhere depending on ability to talk to Hamlib via C#
|
|
||||||
|
|
||||||
On Windows
|
|
||||||
dotnet new install GtkSharp.Template.CSharp
|
|
||||||
dotnet build
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
On Ubuntu I don't see the GtkSharp package -- but you can build the code generated on the Windows side.
|
|
||||||
apt install dotnet-sdk-6.0
|
|
||||||
dotnet build
|
|
||||||
|
|
||||||
|
|
||||||
Note: On Windows you can create a skeleton GTK app
|
|
||||||
dotnet new gtkapp
|
|
|
@ -1,19 +0,0 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>WinExe</OutputType>
|
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="**\*.glade" />
|
|
||||||
<EmbeddedResource Include="**\*.glade">
|
|
||||||
<LogicalName>%(Filename)%(Extension)</LogicalName>
|
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="GtkSharp" Version="3.24.24.*" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
Ładowanie…
Reference in New Issue