Exemplo n.º 1
0
/*
 * callback function for a plugin 
 */
static void curses_select_plugin(void *plugin)
{
   /* prevent the selection when the list is empty */
   if (plugin == NULL)
      return;
        
   /* print the message */
   if (plugin_is_activated(plugin) == 0)
      INSTANT_USER_MSG("Activating %s plugin...\n", plugin);
   else
      INSTANT_USER_MSG("Deactivating %s plugin...\n", plugin);
         
   /*
    * pay attention on this !
    * if the plugin init does not return,
    * we are blocked here. So it is encouraged
    * to write plugins which spawn a thread
    * and immediately return
    */
   if (plugin_is_activated(plugin) == 1)
      plugin_fini(plugin);   
   else
      plugin_init(plugin);
        
   /* refres the array for the list widget */
   nplug = 0;
   plugin_list_walk(PLP_MIN, PLP_MAX, &curses_refresh_plug_array);
   
   /* refresh the list */
   wdg_list_refresh(wdg_plugin);
}
Exemplo n.º 2
0
void curses_plugins_update(void)
{
   DEBUG_MSG("curses_plugins_update");

   CURSES_LOCK(pluginlist_mutex);

   /* refres the array for the list widget */
   nplug = 0;
   plugin_list_walk(PLP_MIN, PLP_MAX, &curses_refresh_plug_array);
   
   /* refresh the list */
   wdg_list_refresh(wdg_plugin);

   CURSES_UNLOCK(pluginlist_mutex);
}
Exemplo n.º 3
0
static void refresh_filter_list(void)
{
   build_filter_list();
   wdg_list_set_elements(wdg_filters, wdg_filters_elements);
   wdg_list_refresh(wdg_filters);
}