feat(modulo): add auto startup wizard page

This commit is contained in:
Federico Terzi 2021-10-09 17:33:39 +02:00
parent 2680a5ef4f
commit 0804ef5e27
8 changed files with 527 additions and 1 deletions

View File

@ -109,6 +109,7 @@ typedef struct WizardMetadata {
const int is_legacy_version_page_enabled;
const int is_wrong_edition_page_enabled;
const int is_migrate_page_enabled;
const int is_auto_start_page_enabled;
const int is_add_path_page_enabled;
const int is_accessibility_page_enabled;
@ -121,6 +122,7 @@ typedef struct WizardMetadata {
// METHODS
int (*is_legacy_version_running)();
int (*backup_and_migrate)();
int (*auto_start)(int);
int (*add_to_path)();
int (*enable_accessibility)();
int (*is_accessibility_enabled)();

View File

@ -127,6 +127,7 @@ pub struct WizardMetadata {
pub is_legacy_version_page_enabled: c_int,
pub is_wrong_edition_page_enabled: c_int,
pub is_migrate_page_enabled: c_int,
pub is_auto_start_page_enabled: c_int,
pub is_add_path_page_enabled: c_int,
pub is_accessibility_page_enabled: c_int,
@ -138,6 +139,7 @@ pub struct WizardMetadata {
pub is_legacy_version_running: extern "C" fn() -> c_int,
pub backup_and_migrate: extern "C" fn() -> c_int,
pub auto_start: extern "C" fn(auto_start: c_int) -> c_int,
pub add_to_path: extern "C" fn() -> c_int,
pub enable_accessibility: extern "C" fn() -> c_int,
pub is_accessibility_enabled: extern "C" fn() -> c_int,

View File

@ -81,6 +81,22 @@ pub fn show(options: WizardOptions) -> bool {
}
}
extern "C" fn auto_start(auto_start: c_int) -> c_int {
let lock = HANDLERS
.lock()
.expect("unable to acquire lock in auto_start method");
let handlers_ref = (*lock).as_ref().expect("unable to unwrap handlers");
if let Some(handler_ref) = handlers_ref.auto_start.as_ref() {
if (*handler_ref)(auto_start != 0) {
1
} else {
0
}
} else {
-1
}
}
extern "C" fn add_to_path() -> c_int {
let lock = HANDLERS
.lock()
@ -169,6 +185,11 @@ pub fn show(options: WizardOptions) -> bool {
} else {
0
},
is_auto_start_page_enabled: if options.is_auto_start_page_enabled {
1
} else {
0
},
is_add_path_page_enabled: if options.is_add_path_page_enabled {
1
} else {
@ -192,6 +213,7 @@ pub fn show(options: WizardOptions) -> bool {
is_legacy_version_running,
backup_and_migrate,
auto_start,
add_to_path,
enable_accessibility,
is_accessibility_enabled,

View File

@ -32,7 +32,8 @@ const int MOVE_BUNDLE_PAGE_INDEX = WELCOME_PAGE_INDEX + 1;
const int LEGACY_VERSION_PAGE_INDEX = MOVE_BUNDLE_PAGE_INDEX + 1;
const int WRONG_EDITION_PAGE_INDEX = LEGACY_VERSION_PAGE_INDEX + 1;
const int MIGRATE_PAGE_INDEX = WRONG_EDITION_PAGE_INDEX + 1;
const int ADD_PATH_PAGE_INDEX = MIGRATE_PAGE_INDEX + 1;
const int AUTO_START_PAGE_INDEX = MIGRATE_PAGE_INDEX + 1;
const int ADD_PATH_PAGE_INDEX = AUTO_START_PAGE_INDEX + 1;
const int ACCESSIBILITY_PAGE_INDEX = ADD_PATH_PAGE_INDEX + 1;
const int MAX_PAGE_INDEX = ACCESSIBILITY_PAGE_INDEX + 1; // Update if a new page is added at the end
@ -82,6 +83,11 @@ int find_next_page(int current_index)
{
return MIGRATE_PAGE_INDEX;
}
case AUTO_START_PAGE_INDEX:
if (wizard_metadata->is_auto_start_page_enabled)
{
return AUTO_START_PAGE_INDEX;
}
case ADD_PATH_PAGE_INDEX:
if (wizard_metadata->is_add_path_page_enabled)
{
@ -105,6 +111,7 @@ protected:
void welcome_start_clicked(wxCommandEvent &event);
void migrate_button_clicked(wxCommandEvent &event);
void migrate_compatibility_mode_clicked(wxCommandEvent &event);
void auto_start_continue_clicked( wxCommandEvent& event );
void add_path_continue_clicked( wxCommandEvent& event );
void accessibility_enable_clicked( wxCommandEvent& event );
void quit_espanso_clicked( wxCommandEvent& event );
@ -218,6 +225,45 @@ void DerivedFrame::migrate_button_clicked(wxCommandEvent &event)
}
}
void DerivedFrame::auto_start_continue_clicked( wxCommandEvent& event ) {
if (!auto_start_checkbox->IsChecked()) {
if (wizard_metadata->auto_start)
{
wizard_metadata->auto_start(0);
}
this->navigate_to_next_page_or_close();
return;
}
if (wizard_metadata->auto_start)
{
while (true) {
int result = wizard_metadata->auto_start(1);
if (result == 1)
{
this->navigate_to_next_page_or_close();
return;
}
else
{
wxMessageDialog* dialog = new wxMessageDialog(this,
"An error occurred while registering Espanso as a service, please check the logs for more information.\nDo you want to retry? You can always configure this option later",
"Operation failed",
wxCENTER | wxOK_DEFAULT | wxOK | wxCANCEL |
wxICON_EXCLAMATION);
dialog->SetOKLabel("Retry");
int prompt_result = dialog->ShowModal();
if (prompt_result == wxID_CANCEL) {
this->navigate_to_next_page_or_close();
break;
}
}
}
}
}
void DerivedFrame::add_path_continue_clicked( wxCommandEvent& event ) {
if (!add_path_checkbox->IsChecked()) {
this->navigate_to_next_page_or_close();
@ -253,6 +299,7 @@ void DerivedFrame::add_path_continue_clicked( wxCommandEvent& event ) {
}
}
void DerivedFrame::accessibility_enable_clicked( wxCommandEvent& event )
{
if (wizard_metadata->enable_accessibility)

View File

@ -1971,6 +1971,408 @@
</object>
</object>
</object>
<object class="simplebookpage" expanded="1">
<property name="label">a page</property>
<property name="select">0</property>
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg">wxSYS_COLOUR_WINDOW</property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">auto_start_panel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer2122</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">20</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALIGN_LEFT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font">,90,92,18,70,0</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Launch on System startup</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">auto_start_title</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag"></property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">20</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxLEFT|wxRIGHT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Espanso can be launched automatically when you start your PC. &#x0A;&#x0A;Do you want to proceed?</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">auto_start_description</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">500</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">20</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">1</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Yes, launch Espanso on system startup (recommended)</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">auto_start_checkbox</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Note: you can always disable this option later.</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">auto_start_note</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">500</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxALIGN_RIGHT|wxALL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">1</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Continue</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">auto_start_continue</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">auto_start_continue_clicked</event>
</object>
</object>
</object>
</object>
</object>
<object class="simplebookpage" expanded="1">
<property name="label">a page</property>
<property name="select">0</property>

View File

@ -219,6 +219,46 @@ WizardFrame::WizardFrame( wxWindow* parent, wxWindowID id, const wxString& title
migrate_panel->Layout();
bSizer211->Fit( migrate_panel );
m_simplebook->AddPage( migrate_panel, wxT("a page"), false );
auto_start_panel = new wxPanel( m_simplebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
auto_start_panel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
wxBoxSizer* bSizer2122;
bSizer2122 = new wxBoxSizer( wxVERTICAL );
auto_start_title = new wxStaticText( auto_start_panel, wxID_ANY, wxT("Launch on System startup"), wxDefaultPosition, wxDefaultSize, 0 );
auto_start_title->Wrap( -1 );
auto_start_title->SetFont( wxFont( 18, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bSizer2122->Add( auto_start_title, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_LEFT|wxTOP, 20 );
bSizer2122->Add( 0, 20, 0, 0, 5 );
auto_start_description = new wxStaticText( auto_start_panel, wxID_ANY, wxT("Espanso can be launched automatically when you start your PC. \n\nDo you want to proceed?"), wxDefaultPosition, wxDefaultSize, 0 );
auto_start_description->Wrap( 500 );
bSizer2122->Add( auto_start_description, 0, wxLEFT|wxRIGHT|wxTOP, 10 );
auto_start_checkbox = new wxCheckBox( auto_start_panel, wxID_ANY, wxT("Yes, launch Espanso on system startup (recommended)"), wxDefaultPosition, wxDefaultSize, 0 );
auto_start_checkbox->SetValue(true);
bSizer2122->Add( auto_start_checkbox, 0, wxALL, 20 );
auto_start_note = new wxStaticText( auto_start_panel, wxID_ANY, wxT("Note: you can always disable this option later."), wxDefaultPosition, wxDefaultSize, 0 );
auto_start_note->Wrap( 500 );
bSizer2122->Add( auto_start_note, 0, wxALL, 10 );
bSizer2122->Add( 0, 0, 1, wxEXPAND, 5 );
auto_start_continue = new wxButton( auto_start_panel, wxID_ANY, wxT("Continue"), wxDefaultPosition, wxDefaultSize, 0 );
auto_start_continue->SetDefault();
bSizer2122->Add( auto_start_continue, 0, wxALIGN_RIGHT|wxALL, 10 );
auto_start_panel->SetSizer( bSizer2122 );
auto_start_panel->Layout();
bSizer2122->Fit( auto_start_panel );
m_simplebook->AddPage( auto_start_panel, wxT("a page"), false );
add_path_panel = new wxPanel( m_simplebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
add_path_panel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
@ -326,6 +366,7 @@ WizardFrame::WizardFrame( wxWindow* parent, wxWindowID id, const wxString& title
wrong_edition_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WizardFrame::quit_espanso_clicked ), NULL, this );
migrate_compatibility_mode_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WizardFrame::migrate_compatibility_mode_clicked ), NULL, this );
migrate_backup_and_migrate_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WizardFrame::migrate_button_clicked ), NULL, this );
auto_start_continue->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WizardFrame::auto_start_continue_clicked ), NULL, this );
add_path_continue_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WizardFrame::add_path_continue_clicked ), NULL, this );
accessibility_enable_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WizardFrame::accessibility_enable_clicked ), NULL, this );
}
@ -340,6 +381,7 @@ WizardFrame::~WizardFrame()
wrong_edition_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WizardFrame::quit_espanso_clicked ), NULL, this );
migrate_compatibility_mode_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WizardFrame::migrate_compatibility_mode_clicked ), NULL, this );
migrate_backup_and_migrate_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WizardFrame::migrate_button_clicked ), NULL, this );
auto_start_continue->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WizardFrame::auto_start_continue_clicked ), NULL, this );
add_path_continue_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WizardFrame::add_path_continue_clicked ), NULL, this );
accessibility_enable_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WizardFrame::accessibility_enable_clicked ), NULL, this );

View File

@ -69,6 +69,12 @@ class WizardFrame : public wxFrame
wxHyperlinkCtrl* migrate_link;
wxButton* migrate_compatibility_mode_button;
wxButton* migrate_backup_and_migrate_button;
wxPanel* auto_start_panel;
wxStaticText* auto_start_title;
wxStaticText* auto_start_description;
wxCheckBox* auto_start_checkbox;
wxStaticText* auto_start_note;
wxButton* auto_start_continue;
wxPanel* add_path_panel;
wxStaticText* add_path_title;
wxStaticText* add_path_description;
@ -92,6 +98,7 @@ class WizardFrame : public wxFrame
virtual void quit_espanso_clicked( wxCommandEvent& event ) { event.Skip(); }
virtual void migrate_compatibility_mode_clicked( wxCommandEvent& event ) { event.Skip(); }
virtual void migrate_button_clicked( wxCommandEvent& event ) { event.Skip(); }
virtual void auto_start_continue_clicked( wxCommandEvent& event ) { event.Skip(); }
virtual void add_path_continue_clicked( wxCommandEvent& event ) { event.Skip(); }
virtual void accessibility_enable_clicked( wxCommandEvent& event ) { event.Skip(); }

View File

@ -27,6 +27,7 @@ pub struct WizardOptions {
pub is_legacy_version_page_enabled: bool,
pub is_wrong_edition_page_enabled: bool,
pub is_migrate_page_enabled: bool,
pub is_auto_start_page_enabled: bool,
pub is_add_path_page_enabled: bool,
pub is_accessibility_page_enabled: bool,
@ -42,6 +43,7 @@ pub struct WizardOptions {
pub struct WizardHandlers {
pub is_legacy_version_running: Option<Box<dyn Fn() -> bool + Send>>,
pub backup_and_migrate: Option<Box<dyn Fn() -> MigrationResult + Send>>,
pub auto_start: Option<Box<dyn Fn(bool) -> bool + Send>>,
pub add_to_path: Option<Box<dyn Fn() -> bool + Send>>,
pub enable_accessibility: Option<Box<dyn Fn() + Send>>,
pub is_accessibility_enabled: Option<Box<dyn Fn() -> bool + Send>>,