feat(modulo): wire up Wizard accessibility page
This commit is contained in:
parent
1edb533c32
commit
7f7b3cb358
|
@ -92,17 +92,12 @@ pub fn show(options: WizardOptions) {
|
||||||
.lock()
|
.lock()
|
||||||
.expect("unable to acquire lock in enable_accessibility method");
|
.expect("unable to acquire lock in enable_accessibility method");
|
||||||
let handlers_ref = (*lock).as_ref().expect("unable to unwrap handlers");
|
let handlers_ref = (*lock).as_ref().expect("unable to unwrap handlers");
|
||||||
// TODO:
|
if let Some(handler_ref) = handlers_ref.enable_accessibility.as_ref() {
|
||||||
// if let Some(handler_ref) = handlers_ref.add_to_path.as_ref() {
|
(*handler_ref)();
|
||||||
// if (*handler_ref)() {
|
1
|
||||||
// 1
|
} else {
|
||||||
// } else {
|
-1
|
||||||
// 0
|
}
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// -1
|
|
||||||
// }
|
|
||||||
0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" fn is_accessibility_enabled() -> c_int {
|
extern "C" fn is_accessibility_enabled() -> c_int {
|
||||||
|
@ -110,18 +105,16 @@ pub fn show(options: WizardOptions) {
|
||||||
.lock()
|
.lock()
|
||||||
.expect("unable to acquire lock in is_accessibility_enabled method");
|
.expect("unable to acquire lock in is_accessibility_enabled method");
|
||||||
let handlers_ref = (*lock).as_ref().expect("unable to unwrap handlers");
|
let handlers_ref = (*lock).as_ref().expect("unable to unwrap handlers");
|
||||||
// TODO:
|
if let Some(handler_ref) = handlers_ref.is_accessibility_enabled.as_ref() {
|
||||||
// if let Some(handler_ref) = handlers_ref.add_to_path.as_ref() {
|
if (*handler_ref)() {
|
||||||
// if (*handler_ref)() {
|
1
|
||||||
// 1
|
} else {
|
||||||
// } else {
|
|
||||||
// 0
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// -1
|
|
||||||
// }
|
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
-1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" fn on_completed() {
|
extern "C" fn on_completed() {
|
||||||
let lock = HANDLERS
|
let lock = HANDLERS
|
||||||
|
|
|
@ -99,6 +99,7 @@ protected:
|
||||||
void migrate_button_clicked(wxCommandEvent &event);
|
void migrate_button_clicked(wxCommandEvent &event);
|
||||||
void migrate_compatibility_mode_clicked(wxCommandEvent &event);
|
void migrate_compatibility_mode_clicked(wxCommandEvent &event);
|
||||||
void add_path_continue_clicked( wxCommandEvent& event );
|
void add_path_continue_clicked( wxCommandEvent& event );
|
||||||
|
void accessibility_enable_clicked( wxCommandEvent& event );
|
||||||
|
|
||||||
void navigate_to_next_page_or_close();
|
void navigate_to_next_page_or_close();
|
||||||
void change_default_button(int target_page);
|
void change_default_button(int target_page);
|
||||||
|
@ -110,7 +111,7 @@ public:
|
||||||
DerivedFrame::DerivedFrame(wxWindow *parent)
|
DerivedFrame::DerivedFrame(wxWindow *parent)
|
||||||
: WizardFrame(parent)
|
: WizardFrame(parent)
|
||||||
{
|
{
|
||||||
// TODO: load images for accessibility page if on macOS
|
// Welcome images
|
||||||
|
|
||||||
if (metadata->welcome_image_path)
|
if (metadata->welcome_image_path)
|
||||||
{
|
{
|
||||||
|
@ -120,6 +121,19 @@ DerivedFrame::DerivedFrame(wxWindow *parent)
|
||||||
|
|
||||||
this->welcome_version_text->SetLabel(wxString::Format("( version %s )", metadata->version));
|
this->welcome_version_text->SetLabel(wxString::Format("( version %s )", metadata->version));
|
||||||
|
|
||||||
|
// Accessiblity images
|
||||||
|
|
||||||
|
if (metadata->accessibility_image_1_path)
|
||||||
|
{
|
||||||
|
wxBitmap accessiblityImage1 = wxBitmap(metadata->accessibility_image_1_path, wxBITMAP_TYPE_PNG);
|
||||||
|
this->accessibility_image1->SetBitmap(accessiblityImage1);
|
||||||
|
}
|
||||||
|
if (metadata->accessibility_image_2_path)
|
||||||
|
{
|
||||||
|
wxBitmap accessiblityImage2 = wxBitmap(metadata->accessibility_image_2_path, wxBITMAP_TYPE_PNG);
|
||||||
|
this->accessibility_image2->SetBitmap(accessiblityImage2);
|
||||||
|
}
|
||||||
|
|
||||||
// Load the first page
|
// Load the first page
|
||||||
int page = find_next_page(-1);
|
int page = find_next_page(-1);
|
||||||
if (page >= 0)
|
if (page >= 0)
|
||||||
|
@ -143,6 +157,10 @@ void DerivedFrame::navigate_to_next_page_or_close()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (metadata->on_completed) {
|
||||||
|
metadata->on_completed();
|
||||||
|
}
|
||||||
|
|
||||||
Close(true);
|
Close(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -216,6 +234,14 @@ void DerivedFrame::add_path_continue_clicked( wxCommandEvent& event ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DerivedFrame::accessibility_enable_clicked( wxCommandEvent& event )
|
||||||
|
{
|
||||||
|
if (metadata->enable_accessibility)
|
||||||
|
{
|
||||||
|
metadata->enable_accessibility();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DerivedFrame::check_timer_tick(wxTimerEvent &event)
|
void DerivedFrame::check_timer_tick(wxTimerEvent &event)
|
||||||
{
|
{
|
||||||
if (this->m_simplebook->GetSelection() == LEGACY_VERSION_PAGE_INDEX)
|
if (this->m_simplebook->GetSelection() == LEGACY_VERSION_PAGE_INDEX)
|
||||||
|
@ -227,6 +253,14 @@ void DerivedFrame::check_timer_tick(wxTimerEvent &event)
|
||||||
this->navigate_to_next_page_or_close();
|
this->navigate_to_next_page_or_close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (this->m_simplebook->GetSelection() == ACCESSIBILITY_PAGE_INDEX) {
|
||||||
|
if (metadata->is_accessibility_enabled)
|
||||||
|
{
|
||||||
|
if (metadata->is_accessibility_enabled() == 1)
|
||||||
|
{
|
||||||
|
this->navigate_to_next_page_or_close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user