Skip to content

Commit

Permalink
Added select button as sync.
Browse files Browse the repository at this point in the history
  • Loading branch information
333fred committed Mar 14, 2015
1 parent ab66dd4 commit 854a349
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ void request_update() {
app_message_outbox_send();
}

// Single click callback
void select_single_click_handler(ClickRecognizerRef recognizer, void *context) {
APP_LOG(APP_LOG_LEVEL_INFO, "In single click handler");
request_update();
}

// ClickConfigProvider for the refresh button
void config_provider(Window *window) {
window_single_click_subscribe(BUTTON_ID_SELECT, select_single_click_handler);
}

static void message_dropped_callback(AppMessageResult reason, void *ctx) {
APP_LOG(APP_LOG_LEVEL_WARNING, "Message Dropped: %s", translate_error(reason));
}
Expand Down Expand Up @@ -256,6 +267,7 @@ static void init() {
app_message_register_outbox_failed(outbox_failed_callback);
app_message_open(app_message_inbox_size_maximum(), app_message_outbox_size_maximum());
request_update();
window_set_click_config_provider(s_main_window, (ClickConfigProvider) config_provider);
}

static void deinit() {
Expand Down

0 comments on commit 854a349

Please sign in to comment.