Began designing the third Voile setup page.

This commit is contained in:
feyris-tan 2026-01-23 20:04:58 +01:00
parent 8e57233dad
commit 3111168579
8 changed files with 143 additions and 0 deletions

View File

@ -83,5 +83,10 @@ namespace Voile.Patchouli.Reflection
throw new VoileReflectionException(String.Format("Could not figure out plugin type of {0}", t.Name));
}
}
public IReadOnlyList<VoilePluginInfo> GetDataStorages()
{
return _knownDataStorages.AsReadOnly();
}
}
}

View File

@ -48,11 +48,14 @@
buttonNext = new Button();
buttonBack = new Button();
openFileDialogCertificate = new OpenFileDialog();
tabPage1 = new TabPage();
label5 = new Label();
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
tabControl1.SuspendLayout();
tabPageWelcome.SuspendLayout();
tabPageLicense.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureBox2).BeginInit();
tabPage1.SuspendLayout();
SuspendLayout();
//
// pictureBox1
@ -69,6 +72,7 @@
//
tabControl1.Controls.Add(tabPageWelcome);
tabControl1.Controls.Add(tabPageLicense);
tabControl1.Controls.Add(tabPage1);
tabControl1.Location = new Point(138, 12);
tabControl1.Name = "tabControl1";
tabControl1.SelectedIndex = 0;
@ -255,6 +259,25 @@
openFileDialogCertificate.Filter = "X.509 Certificate (*.cer)|*.cer";
openFileDialogCertificate.Title = "Open Voile License File";
//
// tabPage1
//
tabPage1.Controls.Add(label5);
tabPage1.Location = new Point(4, 24);
tabPage1.Name = "tabPage1";
tabPage1.Size = new Size(348, 384);
tabPage1.TabIndex = 2;
tabPage1.Text = "Pick Data Storage";
tabPage1.UseVisualStyleBackColor = true;
//
// label5
//
label5.AutoSize = true;
label5.Location = new Point(3, 0);
label5.Name = "label5";
label5.Size = new Size(347, 165);
label5.TabIndex = 0;
label5.Text = resources.GetString("label5.Text");
//
// FirstRunWizard
//
AutoScaleDimensions = new SizeF(7F, 15F);
@ -277,6 +300,8 @@
tabPageLicense.ResumeLayout(false);
tabPageLicense.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureBox2).EndInit();
tabPage1.ResumeLayout(false);
tabPage1.PerformLayout();
ResumeLayout(false);
}
@ -301,5 +326,7 @@
private Label label4;
private PictureBox pictureBox2;
private OpenFileDialog openFileDialogCertificate;
private TabPage tabPage1;
private Label label5;
}
}

View File

@ -10,6 +10,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Voile.Patchouli.Reflection;
using Voile.Properties;
namespace Voile
@ -31,6 +32,9 @@ namespace Voile
private byte[] licenseBuffer;
private int licenseState;
private X509Certificate licenseCertificate;
private bool sharewareMode;
private bool dataStorageRadioButtonsGenerated;
public void DisplayTabPage(int target, bool isGoingBack = false)
{
@ -74,6 +78,7 @@ namespace Voile
buttonNext.Enabled = radioButtonAmBegginer.Checked || radioButtonAmExpert.Checked;
break;
case 1:
//Lizenzstatus validieren.
buttonValidateLicense.Enabled = ((licenceCertificateFileInfo != null) & radioButtonHasLicense.Checked);
buttonLoadLicenseFile.Enabled = radioButtonHasLicense.Checked;
pictureBox2.Visible = radioButtonHasLicense.Checked;
@ -102,6 +107,14 @@ namespace Voile
break;
}
}
//Können wir weiter machen?
sharewareMode = radioButtonNoLicense.Checked;
buttonNext.Enabled = (sharewareMode) | (licenseState == 6);
break;
case 2:
if (!dataStorageRadioButtonsGenerated)
GenerateDataStorageRadioButtons();
break;
default:
MessageBox.Show("Could not find handler for the current tab page.");
@ -109,6 +122,13 @@ namespace Voile
}
}
private void GenerateDataStorageRadioButtons()
{
VoilePluginManager pluginManager = VoilePluginManager.GetInstance();
IReadOnlyList<VoilePluginInfo> dataStoragePlugins = pluginManager.GetDataStorages();
//TODO: Finish generating the radio buttons for the data storage.
}
private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
RefreshView();

View File

@ -117,6 +117,19 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="label5.Text" xml:space="preserve">
<value>Great — lets choose where Voile should store its
structured data.
Blindscan results, DVB table contents, and historical
scan information will all be kept in the storage option you select
below. Since youre using Expert Mode, you have full control
over the database backend. (In Beginner Mode, Voile would
simply use SQLite automatically.)
Feel free to pick the option that best fits your workflow or
existing infrastructure.</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Welcome to Voile!

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Voile.Patchouli.Data;
namespace Voile.Persistence
{
internal class DirectoryStorage : IVoileObjectStorage, IVoileDataStorage
{
public DirectoryStorage(DirectoryInfo directory)
{
Directory = directory;
}
public DirectoryInfo Directory { get; }
}
}

View File

@ -0,0 +1,47 @@
using skyscraper8.Skyscraper.Scraper.Storage;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Voile.Common.Reflection;
using Voile.Patchouli.Data;
using Voile.Patchouli.Reflection;
namespace Voile.Persistence
{
[VoilePlugin]
[VoilePluginId(1)]
[Voile.Patchouli.Reflection.DisplayName("File-system folder")]
class DirectoryStorageFactory : IVoileDataStorageFactory, IVoileObjectStorageFactory
{
public override bool Equals(object? obj)
{
DirectoryStorageFactory dsf = obj as DirectoryStorageFactory
if (dsf == null)
return false;
return dsf.Directory.Equals(this.Directory);
}
IVoileDataStorage IVoileDataStorageFactory.CreateDataStorage()
{
return new DirectoryStorage(Directory);
}
IVoileObjectStorage IVoileObjectStorageFactory.CreateObjectStorage()
{
return new DirectoryStorage(Directory);
}
public bool IsEquipvalentDataStorageFactory(IVoileDataStorageFactory dataStorageFactory)
{
return Equals(dataStorageFactory);
}
[System.ComponentModel.DisplayName("Path")]
[System.ComponentModel.Description("The Path in which data should be stored.")]
public DirectoryInfo Directory { get; set; }
}
}

11
Voile/README.md Normal file
View File

@ -0,0 +1,11 @@
# DataStorage Ids
|Id|Name |
|--|----------------|
|1 |DirectoryStorage|
# ObjectStorage Ids
|Id|Name |
|--|----------------|
|1 |DirectoryStorage|

View File

@ -22,6 +22,7 @@
<ItemGroup>
<ProjectReference Include="..\..\skyscraper8\skyscraper8\skyscraper8.csproj" />
<ProjectReference Include="..\Sophia.Net.DRM\Sophia.Net.DRM.csproj" />
<ProjectReference Include="..\Voile.Patchouli\Voile.Patchouli.csproj" />
</ItemGroup>
<ItemGroup>