feat(modulo): implement already_running flag on welcome gui
This commit is contained in:
parent
2d559b7fb0
commit
56502fd0e5
|
@ -126,6 +126,8 @@ typedef struct WelcomeMetadata {
|
|||
const char *window_icon_path;
|
||||
const char *tray_image_path;
|
||||
|
||||
const int already_running;
|
||||
|
||||
// METHODS
|
||||
int (*dont_show_again_changed)(int);
|
||||
} WelcomeMetadata;
|
||||
|
|
|
@ -143,6 +143,8 @@ pub struct WelcomeMetadata {
|
|||
pub window_icon_path: *const c_char,
|
||||
pub tray_image_path: *const c_char,
|
||||
|
||||
pub already_running: c_int,
|
||||
|
||||
pub dont_show_again_changed: extern fn(c_int),
|
||||
}
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ pub fn show(options: WelcomeOptions) {
|
|||
let welcome_metadata = WelcomeMetadata {
|
||||
window_icon_path: c_window_icon_path_ptr,
|
||||
tray_image_path: c_tray_image_path_ptr,
|
||||
already_running: if options.is_already_running { 1 } else { 0 },
|
||||
dont_show_again_changed,
|
||||
};
|
||||
|
||||
|
|
|
@ -64,6 +64,12 @@ DerivedWelcomeFrame::DerivedWelcomeFrame(wxWindow *parent)
|
|||
{
|
||||
this->tray_info_label->Hide();
|
||||
}
|
||||
|
||||
this->dont_show_checkbox->Hide();
|
||||
|
||||
if (welcome_metadata->already_running) {
|
||||
this->title_label->SetLabel("Espanso is already running!");
|
||||
}
|
||||
}
|
||||
|
||||
void DerivedWelcomeFrame::on_dont_show_change( wxCommandEvent& event ) {
|
||||
|
|
|
@ -22,6 +22,7 @@ pub use crate::sys::welcome::show;
|
|||
pub struct WelcomeOptions {
|
||||
pub window_icon_path: Option<String>,
|
||||
pub tray_image_path: Option<String>,
|
||||
pub is_already_running: bool,
|
||||
|
||||
pub handlers: WelcomeHandlers,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user