static void clearsearch_clicked(GtkButton attribute((unused)) *button,
gpointer attribute((unused)) userdata) {
gtk_entry_set_text(GTK_ENTRY(searchentry), "");
+ /* Put the input focus back */
+ gtk_widget_grab_focus(searchentry);
}
/** @brief Called when the 'next search result' button is clicked */
static void choose_selectnone_activate(GtkWidget attribute((unused)) *w) {
}
+/** @brief Called when the choose tab is selected */
+static void choose_tab_selected(void) {
+ gtk_widget_grab_focus(searchentry);
+}
+
/** @brief Main menu callbacks for Choose screen */
static const struct tabtype tabtype_choose = {
choose_properties_sensitive,
choose_properties_activate,
choose_selectall_activate,
choose_selectnone_activate,
+ choose_tab_selected,
};
/* Public entry points ----------------------------------------------------- */
*
* Updates the menu settings to correspond to the new page.
*/
-static void tab_switched(GtkNotebook attribute((unused)) *notebook,
+static void tab_switched(GtkNotebook *notebook,
GtkNotebookPage attribute((unused)) *page,
guint page_num,
gpointer attribute((unused)) user_data) {
menu_update(page_num);
+ GtkWidget *const tab = gtk_notebook_get_nth_page(notebook, page_num);
+ const struct tabtype *const t = g_object_get_data(G_OBJECT(tab), "type");
+ if(t->selected)
+ t->selected();
}
/** @brief Create the report box */
void (*properties_activate)(GtkWidget *tab);
void (*selectall_activate)(GtkWidget *tab);
void (*selectnone_activate)(GtkWidget *tab);
+ void (*selected)(void);
};
/** @brief Button definitions */
queue_properties_activate,
queue_selectall_activate,
queue_selectnone_activate,
+ 0
};
/* Other entry points ------------------------------------------------------ */