From 0f214cb02831668aeff5af88556a3164031a1e23 Mon Sep 17 00:00:00 2001 From: Cheng Date: Thu, 5 Oct 2023 20:31:45 +1000 Subject: [PATCH] broken file dialog, broken save default file looks like wxWidgets bugs going back to sample code either sample code breaks, and I make a bug report to wxWidgets, or I converge the sample code to my code, and see when it breaks --- src/frame.cpp | 35 ++++++++++++++++++++++++++++++++--- src/stdafx.h | 6 +++--- wxWidgets | 2 +- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/frame.cpp b/src/frame.cpp index 1696e64..a2096a3 100644 --- a/src/frame.cpp +++ b/src/frame.cpp @@ -253,7 +253,8 @@ CREATE TABLE "Keys"( "ROWID" INTEGER PRIMARY KEY, "pubkey" BLOB NOT NULL UNIQUE, "id" integer NOT NULL, - "use" INTEGER NOT NULL) STRICT; + "use" INTEGER NOT NULL +) STRICT; CREATE UNIQUE INDEX i_pubkey ON Keys (pubkey); CREATE UNIQUE INDEX i_id ON Keys (use, id); @@ -269,6 +270,35 @@ CREATE TABLE "Misc"( "ROWID" INTEGER PRIMARY KEY, "m" ANY ) STRICT; + +CREATE VIEW UserZookoIDs AS +SELECT + "Names".name AS name, + "Keys".pubkey AS pubkey +FROM "Names" INNER JOIN "Keys" +ON "Names"."ROWID"="Keys"."id" AND "Keys"."use"=1 +ORDER BY LOWER("name"), "name" +COLLATE BINARY; + +CREATE TRIGGER InsertUserZookoID INSTEAD OF INSERT ON UserZookoIDs FOR EACH ROW BEGIN + INSERT OR FAIL INTO "Names" VALUES( + NULL, + NEW."name" + ); + INSERT OR FAIL INTO "Keys" VALUES( + NULL, + NEW."pubkey", + last_insert_rowid(), + 1 + ); +END + +CREATE TRIGGER DeleteUserZookoID INSTEAD OF DELETE ON UserZookoIDs FOR EACH ROW BEGIN + DELETE FROM "Keys" WHERE "Keys"."pubkey" = OLD."pubkey"; + DELETE FROM "Names" WHERE "Names"."name" = OLD."name"; +END + + COMMIT;)|"); wxLogMessage("\t\tConstructing default wallet %s", filename.GetFullPath()); // We now have a working wallet file with no valid data. Attempting to create a strong random secret, a name, and public and private keys for that name. @@ -322,9 +352,8 @@ void Frame::OnSaveNew(wxCommandEvent& WXUNUSED(event)) ristretto255::hash<256> WalletSecret{ wxStrWallet.ToUTF8() }; NewWallet(wxFileWallet, WalletSecret); wxLogMessage("new wallet created: %s", wxStrWallet); - display_wallet* panel = new display_wallet(this, wxFileWallet); if (m_panel)m_panel->Destroy(); - m_panel = panel; + m_panel = new display_wallet(this, wxFileWallet); m_panel->Show(); } } diff --git a/src/stdafx.h b/src/stdafx.h index c8feed3..fbe0ac1 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -90,9 +90,9 @@ inline wxString _wx(const char* sz) { return wxString::FromUTF8Unchecked(sz); } // no longer ill formed. static_assert(wxMAJOR_VERSION == 3, "expecting wxWidgets wxWidgets 3.2.0"); static_assert(wxMINOR_VERSION == 2, "expecting wxWidgets wxWidgets 3.2.0"); -static_assert(wxRELEASE_NUMBER == 0, "expecting wxWidgets wxWidgets 3.2.0"); -static_assert(wxSUBRELEASE_NUMBER == 1, "expecting wxWidgets wxWidgets 3.2.0"); -static_assert(wxVERSION_STRING == wxT("wxWidgets 3.2.0"), "expecting wxWidgets wxWidgets 3.2.0"); +static_assert(wxRELEASE_NUMBER == 2, "expecting wxWidgets wxWidgets 3.2.0"); +static_assert(wxSUBRELEASE_NUMBER == 0, "expecting wxWidgets wxWidgets 3.2.0"); +static_assert(wxVERSION_STRING == L"wxWidgets 3.2.2", "expecting wxWidgets wxWidgets 3.2.0"); // static_assert(wxMAJOR_VERSION == 3 && wxMINOR_VERSION == 2 && wxRELEASE_NUMBER == 0 && wxSUBRELEASE_NUMBER == 1 && wxVERSION_STRING == wxT("wxWidgets 3.2.0"), "expecting wxWidgets wxWidgets 3.2.0"); #include "rotime.h" #include "slash6.h" diff --git a/wxWidgets b/wxWidgets index c2980fa..71d2e28 160000 --- a/wxWidgets +++ b/wxWidgets @@ -1 +1 @@ -Subproject commit c2980fa75c41eac5152898fc41709832ccb24759 +Subproject commit 71d2e28c0b32f80f2d39778c65f824c7bd0e8d48