v0.0.52 - Release: login dialog shows app version in title; n_signer key-index label live-updates BIP-32 derivation path
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "login_dialog.h"
|
||||
#include "key_store.h"
|
||||
#include "agent_login.h"
|
||||
#include "version.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
@@ -111,6 +112,7 @@ static GtkWidget *create_seed_screen(login_ctx_t *ctx);
|
||||
static GtkWidget *create_readonly_screen(login_ctx_t *ctx);
|
||||
static GtkWidget *create_nip46_screen(login_ctx_t *ctx);
|
||||
static GtkWidget *create_nsigner_screen(login_ctx_t *ctx);
|
||||
static void on_index_changed(GtkWidget *spin, gpointer user_data);
|
||||
#if defined(NOSTR_ENABLE_NSIGNER_CLIENT)
|
||||
static void on_detect_serial(GtkWidget *btn, gpointer user_data);
|
||||
#endif
|
||||
@@ -1016,17 +1018,24 @@ static GtkWidget *create_nsigner_screen(login_ctx_t *ctx) {
|
||||
g_signal_connect(transport_combo, "changed",
|
||||
G_CALLBACK(on_transport_changed), box);
|
||||
|
||||
/* Nostr index spinner. */
|
||||
/* Nostr index spinner. The label shows the derived BIP-32 path
|
||||
* m/44'/1237'/N'/0/0 and updates N' live as the user changes the
|
||||
* spin button value, so they can see which key they are selecting. */
|
||||
GtkWidget *index_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
|
||||
gtk_box_pack_start(GTK_BOX(box), index_box, FALSE, FALSE, 0);
|
||||
|
||||
GtkWidget *index_label = gtk_label_new("Key Index (NIP-06 m/44'/1237'/N'/0/0):");
|
||||
GtkWidget *index_label = gtk_label_new("Key Index (m/44'/1237'/0'/0/0):");
|
||||
gtk_widget_set_halign(index_label, GTK_ALIGN_START);
|
||||
gtk_box_pack_start(GTK_BOX(index_box), index_label, FALSE, FALSE, 0);
|
||||
|
||||
GtkWidget *index_spin = gtk_spin_button_new_with_range(0, 1000, 1);
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(index_spin), 0);
|
||||
gtk_box_pack_start(GTK_BOX(index_box), index_spin, FALSE, FALSE, 0);
|
||||
|
||||
/* Update the path label whenever the index value changes. */
|
||||
g_signal_connect(index_spin, "value-changed",
|
||||
G_CALLBACK(on_index_changed), index_label);
|
||||
|
||||
GtkWidget *hint = gtk_label_new("n_signer is a foreground, RAM-only hardware signer. Your private key never leaves the device.");
|
||||
gtk_widget_set_sensitive(hint, FALSE);
|
||||
gtk_widget_set_halign(hint, GTK_ALIGN_START);
|
||||
@@ -1040,9 +1049,23 @@ static GtkWidget *create_nsigner_screen(login_ctx_t *ctx) {
|
||||
g_object_set_data(G_OBJECT(box), "service-box", service_box);
|
||||
g_object_set_data(G_OBJECT(box), "service-entry", service_entry);
|
||||
g_object_set_data(G_OBJECT(box), "index-spin", index_spin);
|
||||
g_object_set_data(G_OBJECT(box), "index-label", index_label);
|
||||
return box;
|
||||
}
|
||||
|
||||
/* Update the key-index path label when the spin button value changes.
|
||||
* Shows the live BIP-32 derivation path m/44'/1237'/N'/0/0 with the
|
||||
* current N value substituted in. */
|
||||
static void on_index_changed(GtkWidget *spin, gpointer user_data) {
|
||||
GtkSpinButton *sb = GTK_SPIN_BUTTON(spin);
|
||||
GtkWidget *label = GTK_WIDGET(user_data);
|
||||
int idx = gtk_spin_button_get_value_as_int(sb);
|
||||
char text[96];
|
||||
snprintf(text, sizeof(text),
|
||||
"Key Index (m/44'/1237'/%d'/0/0):", idx);
|
||||
gtk_label_set_text(GTK_LABEL(label), text);
|
||||
}
|
||||
|
||||
/* ── Serial device enumeration callback ───────────────────────── */
|
||||
|
||||
#if defined(NOSTR_ENABLE_NSIGNER_CLIENT)
|
||||
@@ -1135,12 +1158,20 @@ int login_dialog_run(GtkWindow *parent, login_result_t *result) {
|
||||
ctx.result = result;
|
||||
ctx.done = FALSE;
|
||||
|
||||
/* Title. */
|
||||
/* Title — shows the application name and version. */
|
||||
GtkWidget *title = gtk_label_new(NULL);
|
||||
gtk_label_set_markup(GTK_LABEL(title),
|
||||
"<span size='large' weight='bold'>Sign in with your Nostr key</span>");
|
||||
{
|
||||
char title_markup[128];
|
||||
snprintf(title_markup, sizeof(title_markup),
|
||||
"<span size='large' weight='bold'>Sovereign Browser %s</span>",
|
||||
SB_VERSION);
|
||||
gtk_label_set_markup(GTK_LABEL(title), title_markup);
|
||||
}
|
||||
gtk_box_pack_start(GTK_BOX(content), title, FALSE, FALSE, 8);
|
||||
|
||||
GtkWidget *subtitle = gtk_label_new("Sign in with your Nostr key");
|
||||
gtk_box_pack_start(GTK_BOX(content), subtitle, FALSE, FALSE, 0);
|
||||
|
||||
/* Notebook with tabs for each login method. */
|
||||
GtkWidget *notebook = gtk_notebook_new();
|
||||
gtk_box_pack_start(GTK_BOX(content), notebook, TRUE, TRUE, 4);
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
#ifndef SOVEREIGN_BROWSER_VERSION_H
|
||||
#define SOVEREIGN_BROWSER_VERSION_H
|
||||
|
||||
#define SB_VERSION "v0.0.51"
|
||||
#define SB_VERSION "v0.0.52"
|
||||
#define SB_VERSION_MAJOR 0
|
||||
#define SB_VERSION_MINOR 0
|
||||
#define SB_VERSION_PATCH 51
|
||||
#define SB_VERSION_PATCH 52
|
||||
|
||||
#endif /* SOVEREIGN_BROWSER_VERSION_H */
|
||||
|
||||
Reference in New Issue
Block a user