extern "C" {
#endif
-#define APP_STATE_NOTE_SELECTED 100
+#define APP_STATE_NOTEBOOK_SELECTED 100
+#define APP_STATE_NOTE_SELECTED 110
// typedefs for NotebookModel and NoteModel are in types.h
}
void toolbar_init() {
- ui_toolbar_item("AddNote", .icon = UI_ICON_ADD, .onclick = action_note_new);
+ ui_toolbar_item("AddNote", .icon = UI_ICON_ADD, .onclick = action_note_new, .groups = UI_GROUPS(APP_STATE_NOTEBOOK_SELECTED));
ui_toolbar_add_default("AddNote", UI_TOOLBAR_LEFT);
dbuClassAdd(repository_class, Repository, default_key);
dbuClassAdd(repository_class, Repository, authmethod);
dbuClassAdd(repository_class, Repository, encryption);
-}
\ No newline at end of file
+}
Collection *collection = data->row_data;
printf("notebook selected: %s\n", collection->name);
+ ui_set_group(event->obj->ctx, APP_STATE_NOTEBOOK_SELECTED);
if(window->current_notebook && window->current_notebook->collection == collection) {
return; // notebook already selected