work about window, hoorey

This commit is contained in:
Lynne Megido 2021-10-24 03:35:20 +10:00
parent 5298a97c18
commit 5ac54873ea
Signed by: lynnesbian
GPG key ID: F0A184B5213D9F90
5 changed files with 96 additions and 23 deletions

15
AboutDialogue.cs Normal file
View file

@ -0,0 +1,15 @@
using Gtk;
namespace Buypeeb {
public class AboutDialogue : AboutDialog {
public AboutDialogue() : this(new Builder("about.glade")) { }
private AboutDialogue(Builder builder) : base(builder.GetObject("DialogueAbout").Handle) {
builder.Autoconnect(this);
}
public void ButtonCloseClicked(object sender, Gtk.ResponseArgs args) {
Dispose();
}
}
}

View file

@ -416,11 +416,11 @@ namespace Buypeeb {
/// <returns></returns>
private MessageDialog MsgBox(string message, ButtonsType buttonsType = ButtonsType.OkCancel) {
var md = new MessageDialog(
parent_window: this,
flags: DialogFlags.DestroyWithParent | DialogFlags.Modal,
type: MessageType.Question,
bt: buttonsType,
format: message
this,
DialogFlags.DestroyWithParent | DialogFlags.Modal,
MessageType.Question,
buttonsType,
message
) {KeepAbove = true, Resizable = false, FocusOnMap = true, Title = "Buypeeb"};
return md;
@ -437,9 +437,9 @@ namespace Buypeeb {
string title = "Buypeeb", string message = "Hi there!", string prefill = null
) {
var ed = new Dialog(
title: title,
parent: this,
flags: DialogFlags.DestroyWithParent | DialogFlags.Modal,
title,
this,
DialogFlags.DestroyWithParent | DialogFlags.Modal,
/* button_data: */ "Cancel", ResponseType.Cancel, "OK", ResponseType.Ok
) {DefaultResponse = ResponseType.Ok, KeepAbove = true};
@ -597,9 +597,9 @@ namespace Buypeeb {
private void ButtonOpenClicked(object sender, EventArgs a) {
var od = new FileChooserDialog(
title: "Open userdata.json",
parent: this,
action: FileChooserAction.Open,
"Open userdata.json",
this,
FileChooserAction.Open,
"Cancel", ResponseType.Cancel, "Open", ResponseType.Accept
);
@ -631,9 +631,9 @@ namespace Buypeeb {
private void ButtonSaveAsClicked(object sender, EventArgs a) {
var sd = new FileChooserDialog(
title: "Save userdata.json",
parent: this,
action: FileChooserAction.Save,
"Save userdata.json",
this,
FileChooserAction.Save,
"Cancel", ResponseType.Cancel, "Save", ResponseType.Accept
) {CurrentName = "userdata.json"};
@ -670,9 +670,9 @@ namespace Buypeeb {
}
var sd = new FileChooserDialog(
title: "Export watchlist as CSV",
parent: this,
action: FileChooserAction.Save,
"Export watchlist as CSV",
this,
FileChooserAction.Save,
"Cancel", ResponseType.Cancel, "Save", ResponseType.Accept
) {CurrentName = "buypeeb.csv"};

View file

@ -19,8 +19,7 @@ namespace Buypeeb {
private readonly List<string> updateIntervalEntryNames = new()
{"UpdateInterval", "UpdateIntervalCritical", "FavouriteUpdateInterval", "FavouriteUpdateIntervalCritical"};
public SettingsWindow(Settings settings) : this(new Builder("settings.glade"), settings) {
}
public SettingsWindow(Settings settings) : this(new Builder("settings.glade"), settings) { }
private SettingsWindow(Builder builder, Settings settings) : base(builder.GetObject("WindowSettings").Handle) {
Title = "Buypeeb - Settings";
@ -94,5 +93,11 @@ namespace Buypeeb {
private void ButtonCancelClicked(object sender, EventArgs args) {
Dispose();
}
private void ButtonAboutClicked(object sender, EventArgs args) {
var win = new AboutDialogue();
Application.AddWindow(win);
win.Show();
}
}
}

View file

@ -7,16 +7,25 @@
</PropertyGroup>
<ItemGroup>
<None Remove="**\*.glade"/>
<None Remove="**\*.glade" />
<EmbeddedResource Include="**\*.glade">
<LogicalName>%(Filename)%(Extension)</LogicalName>
</EmbeddedResource>
<None Remove="yahoo.html"/>
<None Remove="yahoo.html" />
<EmbeddedResource Remove="obj\**" />
<None Remove="obj\**" />
<EmbeddedResource Remove="out\**" />
<None Remove="out\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CsvHelper" Version="27.1.1"/>
<PackageReference Include="GtkSharp" Version="3.24.24.34"/>
<PackageReference Include="CsvHelper" Version="27.1.1" />
<PackageReference Include="GtkSharp" Version="3.24.24.34" />
</ItemGroup>
<ItemGroup>
<Compile Remove="obj\**" />
<Compile Remove="out\**" />
</ItemGroup>
</Project>

44
ui/about.glade Normal file
View file

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkAboutDialog" id="DialogueAbout">
<property name="can-focus">False</property>
<property name="title" translatable="yes">About Buypeeb</property>
<property name="modal">True</property>
<property name="window-position">center-on-parent</property>
<property name="destroy-with-parent">True</property>
<property name="type-hint">dialog</property>
<property name="program-name">Buypeeb</property>
<property name="version">1.0</property>
<property name="website">https://git.bune.city/lynnesbian/buypeeb-cs</property>
<property name="authors">Lynnesbian</property>
<property name="logo-icon-name">image-loading</property>
<property name="license-type">gpl-3-0-only</property>
<signal name="response" handler="ButtonCloseClicked" swapped="no"/>
<child internal-child="vbox">
<object class="GtkBox">
<property name="width-request">-1</property>
<property name="can-focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can-focus">False</property>
<property name="layout-style">end</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
</interface>