static int
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
   Config_Item *ci;

   ci = cfd->data;
   if (!cfdata->code)
     return 0;

   if (!strlen(cfdata->code))
     return 0;

   ci->degrees = cfdata->degrees;
   ci->poll_time = (cfdata->poll_time * 60.0);
   if (ci->code)
     eina_stringshare_del(ci->code);

   char *t;
   t = strdup(cfdata->code);
   *t = toupper(*t);
   ci->code = eina_stringshare_add(t);
   ci->show_text = cfdata->show_text;
   ci->popup_on_hover = cfdata->popup_on_hover;

   e_config_save_queue();
   _forecasts_config_updated(ci);
   return 1;
}
Ejemplo n.º 2
0
int
alarm_alarm_ring(Alarm *al, int test)
{
   char buf[4096];
   int ret = 1;

   alarm_config->alarms_state = ALARM_STATE_RINGING;
   if (!test)
     al->state = ALARM_STATE_RINGING;
   alarm_config->alarms_ringing_nb++;
   alarm_edje_signal_emit(EDJE_SIG_SEND_ALARM_RING_START);

   // TODO: real popups
   if (al->open_popup)
     {
        snprintf(buf, sizeof(buf),
                 D_("<hilight>Alarm : %s</hilight><br><br>"
                    "%s"),
                 al->name, (al->description) ? al->description : "" );
        e_module_dialog_show(alarm_config->module, D_("Alarm Module Popup"), buf);
     }

   if (al->run_program != ALARM_RUN_PROGRAM_NO)
     {
        Ecore_Exe *exe;
        
        if (al->run_program == ALARM_RUN_PROGRAM_PARENT)
          {
             exe = ecore_exe_pipe_run(alarm_config->alarms_program_default,
                                      ECORE_EXE_USE_SH, NULL);
          }
        else
          {
             exe = ecore_exe_pipe_run(al->program,
                                      ECORE_EXE_USE_SH, NULL);
          }

        if (exe > 0)
          ecore_exe_free(exe);
        else
          {
             snprintf(buf, sizeof(buf),
                      D_("<hilight>Failed !</hilight><br><br>"
                         "Alarm couln't launch the program you specified"));
             e_module_dialog_show(alarm_config->module, D_("Alarm Module Error"), buf);
             ret = 0;
          }
     }

   _alarm_check_date(al, 0);

   if (alarm_config->alarms_details)
     alarm_edje_refresh_details();

   e_config_save_queue();

   return ret;
}
Ejemplo n.º 3
0
static E_Gadcon_Client *
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
{
   Evas_Object *o;
   E_Gadcon_Client *gcc;
   Instance *inst;
   
   inst = E_NEW(Instance, 1);
   
   o = edje_object_add(gc->evas);

   if (alarm_config->theme)
     {
        char buf[4096];
        snprintf(buf, sizeof(buf), "%s/alarm.edj", e_module_dir_get(alarm_config->module));
        edje_object_file_set(o, buf, THEME_MAIN);
     }
   else
     e_theme_edje_object_set(o, THEME_IN_E, THEME_MAIN);

   edje_object_signal_callback_add(o, EDJE_SIG_RECV_ALARM_STATE_ON,
				   _cb_edje_alarm_state_on, NULL);
   edje_object_signal_callback_add(o, EDJE_SIG_RECV_ALARM_STATE_OFF,
				   _cb_edje_alarm_state_off, NULL);
   edje_object_signal_callback_add(o, EDJE_SIG_RECV_ALARM_RING_STOP,
				   _cb_edje_alarm_ring_stop, NULL);

   gcc = e_gadcon_client_new(gc, name, id, style, o);
   gcc->data = inst;
   
   inst->gcc = gcc;
   inst->obj = o;
   inst->orient = E_GADCON_ORIENT_HORIZ;

   evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
				  _button_cb_mouse_down, inst);

   alarm_config->instances = eina_list_append(alarm_config->instances, inst);

   alarm_details_change();

   switch (alarm_config->alarms_state)
     {
     case ALARM_STATE_ON:
        edje_object_signal_emit(o, EDJE_SIG_SEND_ALARM_STATE_ON);
        break;
     case ALARM_STATE_OFF:
        edje_object_signal_emit(o, EDJE_SIG_SEND_ALARM_STATE_OFF);
        break;
     case ALARM_STATE_RINGING:
        edje_object_signal_emit(o, EDJE_SIG_SEND_ALARM_RING_START);
        break;
     }

   e_config_save_queue();

   return gcc;
}
Ejemplo n.º 4
0
static void
_cb_edje_alarm_state_off(void *data, Evas_Object *obj, const char *emission, const char *source)
{
   if (alarm_config->alarms_state == ALARM_STATE_OFF) return;

   alarm_config->alarms_state = ALARM_STATE_OFF;
   ecore_timer_del(alarm_config->alarms_ring_etimer);
   e_config_save_queue();
}
Ejemplo n.º 5
0
static void
_alarm_cb_dialog_snooze_cancel(void *data, E_Dialog *dia)
{
   Alarm *al;

   al = data;
   _alarm_dialog_snooze_delete(dia, al);

   e_config_save_queue();
}
Ejemplo n.º 6
0
EAPI void *
e_modapi_init(E_Module *m)
{
   Mod *mod;
   char buf[4096];

   mod = calloc(1, sizeof(Mod));
   m->data = mod;

   mod->module = m;
   snprintf(buf, sizeof(buf), "%s/e-module-comp.edj", e_module_dir_get(m));
   e_configure_registry_category_add("appearance", 10, _("Look"), NULL,
                                     "preferences-look");
   e_configure_registry_item_add("appearance/comp", 120, _("Composite"), NULL,
                                 buf, e_int_config_comp_module);

   e_mod_comp_cfdata_edd_init(&(mod->conf_edd),
                              &(mod->conf_match_edd));
                              

   mod->conf = e_config_domain_load("module.comp", mod->conf_edd);
   if (!mod->conf) _e_mod_config_new(m);

   if (!e_config->use_composite)
     {
        e_config->use_composite = 1;
        e_config_save_queue();
     }

   /* XXX: disabled dropshadow module when comp is running */
   {
      Eina_List *l;
      E_Module *m2;
      EINA_LIST_FOREACH(e_module_list(), l, m2)
	{
	   if (m2->enabled && (!strcmp(m2->name, "dropshadow")))
	     e_module_disable(m2);
	}
   }

   /* XXX: update old configs. add config versioning */
   if (mod->conf->first_draw_delay == 0)
     mod->conf->first_draw_delay = 0.20;

   _comp_mod = mod;

   if (!e_mod_comp_init())
     {
        // FIXME: handle if comp init fails
     }

   e_module_delayed_set(m, 0);
   e_module_priority_set(m, -1000);
   return mod;
}
Ejemplo n.º 7
0
static void
_cb_edje_alarm_state_on(void *data, Evas_Object *obj, const char *emission, const char *source)
{
   if (alarm_config->alarms_state == ALARM_STATE_ON) return;

   alarm_config->alarms_state = ALARM_STATE_ON;
   alarm_config->alarms_ring_etimer = ecore_timer_add(ALARMS_CHECK_TIMER,
                                                      _cb_alarms_ring_etimer,
                                                      NULL);
   e_config_save_queue();   
}
Ejemplo n.º 8
0
static Config_Item *
_conf_item_get(const char *id)
{
    Config_Item *ci;

    ci = E_NEW(Config_Item, 1);
    ci->id = eina_stringshare_add(id);
    skeletor_config->items = eina_list_append(skeletor_config->items, ci);
    e_config_save_queue();

    return ci;
}
Ejemplo n.º 9
0
static void
_gc_shutdown(E_Gadcon_Client *gcc)
{
   Instance *inst;
   
   inst = gcc->data;
   evas_object_del(inst->obj);
   alarm_config->instances = eina_list_remove(alarm_config->instances, inst);
   free(inst);

   e_config_save_queue();
}
Ejemplo n.º 10
0
static void
_fsel_path_save(E_Import_Dialog *id)
{
   const char *fdev = NULL, *fpath = NULL;

   e_widget_fsel_path_get(id->fsel_obj, &fdev, &fpath);
   if ((fdev) || (fpath))
     {
        eina_stringshare_replace(&e_config->wallpaper_import_last_dev, fdev);
        eina_stringshare_replace(&e_config->wallpaper_import_last_path, fpath);
        e_config_save_queue();
     }
}
static void
_e_mod_config_schedule_urgent_cb(void *data, Evas_Object *obj, void *event_info)
{
   E_Config_Dialog_Data *cfdata;

   if(!(cfdata = data)) return;

   cfdata->schedule.urgent = e_widget_check_checked_get(obj);
   productivity_conf->urgent = cfdata->schedule.urgent;
   e_mod_config_schedule_save_config(cfdata);
   e_mod_config_worktools_save(cfdata);
   e_config_save_queue();
}
Ejemplo n.º 12
0
static int
_basic_apply_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata)
{
  Config_Item *ci;

  ci = cfd->data;
  if (ci->player)
    eina_stringshare_del (ci->player);
  ci->player = eina_stringshare_add (cfdata->player);
  ci->show_popup = cfdata->show_popup;
  e_config_save_queue ();
  _empris_config_updated (ci);
  return 1;
}
Ejemplo n.º 13
0
/*
 * Store changes to the configuration made in the dialog.
 * These go back to the main config object.
 */
static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
   Xplanet_Config *xplanet_config;
   int config_ok;

   // Pull out the value from the source ilist
   config_ok = parse_config_gui(cfdata);

   if (config_ok)
   {
	  printf("Applying config\n");

	  printf("Delay %d\n",cfdata->delay);
	  printf("Label text: %s\n", cfdata->local_xplanet.label_text);

      eplanet_conf->delay = cfdata->delay;
      eplanet_conf->startDelay = cfdata->startDelay;
      eplanet_conf->taskPriority = cfdata->taskPriority;
      eplanet_conf->loadLimit = cfdata->loadLimit;
      eplanet_conf->minRamLimit = cfdata->minRamLimit;
      eplanet_conf->disableOnBattery = cfdata->disableOnBattery;

      xplanet_config = eina_list_nth(eplanet_conf->xplanet_configs,
            cfdata->current_config);
      xplanet_config->body = cfdata->local_xplanet.body;
      xplanet_config->source_type = cfdata->local_xplanet.source_type;
      xplanet_config->origin = cfdata->local_xplanet.origin;
      xplanet_config->projection = cfdata->local_xplanet.projection;
      xplanet_config->viewpos_type = cfdata->local_xplanet.viewpos_type;
      xplanet_config->viewpos_lat = cfdata->local_xplanet.viewpos_lat;
      xplanet_config->viewpos_lon = cfdata->local_xplanet.viewpos_lon;
      xplanet_config->use_localtime = cfdata->local_xplanet.use_localtime;
      e_widget_slider_value_int_get(cfdata->gui.o_localtime, &(xplanet_config->localtime));
      xplanet_config->viewpos_file = cfdata->local_xplanet.viewpos_file;
      xplanet_config->show_label = cfdata->local_xplanet.show_label;
      xplanet_config->label_text = strdup(cfdata->local_xplanet.label_text);
      xplanet_config->label_time = cfdata->local_xplanet.label_time;
      xplanet_config->label_pos = cfdata->local_xplanet.label_pos;
      xplanet_config->label_pos_other = strdup(cfdata->local_xplanet.label_pos_other);
      xplanet_config->use_config = cfdata->local_xplanet.use_config;
      xplanet_config->config_name = strdup(cfdata->local_xplanet.config_name);
      xplanet_config->extra_options = strdup(cfdata->local_xplanet.extra_options);

      e_config_save_queue();

      cfdata->config_updated = 1;
   }
   return config_ok;
}
Ejemplo n.º 14
0
static int
_basic_apply_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata)
{
  Config_Item *ci;

  if (!cfd)
    return 0;
  ci = cfd->data;
  ci->check_interval = cfdata->check_interval;
  ci->update_interval = cfdata->update_interval;
  e_config_save_queue ();
  _ut_config_updated (ci);

  return 1;
}
Ejemplo n.º 15
0
void
_mail_box_deleted (Config_Item *ci, const char *box_name)
{
  Eina_List *d, *i;
  Config_Box *cb;

  for (i = mail_config->instances; i; i = i->next)
    {
       Instance *inst;
       int found = 0;

       inst = i->data;
       if (inst->ci != ci) continue;
       for (d = ci->boxes; d; d = d->next)
	 {
	    cb = d->data;
	    if ((cb->name) && (box_name))
	      {
		 if (!strcmp (cb->name, box_name))
		   {
		      found = 1;
		      break;
		   }
	      }
	 }
       if (found)
	 {
	    switch (cb->type)
	      {
	       case MAIL_TYPE_IMAP:
		  _mail_imap_del_mailbox (cb);
		  break;
	       case MAIL_TYPE_POP:
		  _mail_pop_del_mailbox (cb);
		  break;
	       case MAIL_TYPE_MDIR:
		  _mail_mdir_del_mailbox (cb);
		  break;
	       case MAIL_TYPE_MBOX:
		  _mail_mbox_del_mailbox (cb);
		  break;
	      }
	    ci->boxes = eina_list_remove (ci->boxes, cb);
	    e_config_save_queue ();
	    break;
	 }
    }
}
static int
_basic_apply_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata)
{
  Config_Item *ci;

  ci = cfd->data;
  ci->poll_time = cfdata->poll_time;
  if (ci->hostname)
    eina_stringshare_del (ci->hostname);
  ci->hostname = eina_stringshare_add (cfdata->hostname);
  ci->port = atoi (cfdata->port);
  ci->show_popup = cfdata->show_popup;
  e_config_save_queue ();
  _mpdule_config_updated (ci);
  return 1;
}
Ejemplo n.º 17
0
static int
_basic_apply_data(E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata)
{
   Config_Item *ci;

   ci = cfd->data;
   if (!strlen(cfdata->status_cmd)) return 0;
   switch (cfdata->okstate_mode)
     {
	case 0: if (!strlen(cfdata->okstate_exitcode)) return 0; break;
	case 1: if (!strlen(cfdata->okstate_string)) return 0; break;
	case 2: if (!strlen(cfdata->okstate_lines)) return 0; break;
     }
   if (!cfdata->poll_time_hours &&
	   !cfdata->poll_time_mins &&
	   !cfdata->poll_time_secs) return 0;

   if (ci->display_name) eina_stringshare_del(ci->display_name);
   ci->display_name = eina_stringshare_add(cfdata->display_name);
   if (ci->icon_path) eina_stringshare_del(ci->icon_path);
   ci->icon_path = eina_stringshare_add(cfdata->icon_path);
   if (ci->status_cmd) eina_stringshare_del(ci->status_cmd);
   ci->status_cmd = eina_stringshare_add(cfdata->status_cmd);
   if (strlen(cfdata->okstate_string))
     {
	if (ci->okstate_string) eina_stringshare_del(ci->okstate_string);
	ci->okstate_string = eina_stringshare_add(cfdata->okstate_string);
     }
   if (ci->dblclk_cmd) eina_stringshare_del(ci->dblclk_cmd);
   if (strlen(cfdata->dblclk_cmd))
     ci->dblclk_cmd = eina_stringshare_add(cfdata->dblclk_cmd);
   if (strlen(cfdata->okstate_exitcode))
     ci->okstate_exitcode = atoi (cfdata->okstate_exitcode);
   if (strlen(cfdata->okstate_lines))
     ci->okstate_lines = atoi (cfdata->okstate_lines);
   ci->display_mode = cfdata->display_mode;
   ci->okstate_mode = cfdata->okstate_mode;
   ci->refresh_after_dblclk_cmd = cfdata->refresh_after_dblclk_cmd;
   ci->poll_time_hours = cfdata->poll_time_hours * 3600;
   ci->poll_time_mins = cfdata->poll_time_mins * 60;
   ci->poll_time_secs = cfdata->poll_time_secs;

   e_config_save_queue();
   _execwatch_config_updated(ci);
   return 1;
}
Ejemplo n.º 18
0
static void
_alarm_cb_dialog_snooze_ok(void *data, E_Dialog *dia)
{
   Alarm *al;
   int time;

   al = data;
   time = al->snooze.hour*3600 + al->snooze.minute*60;
   if (!time) return;
   if (al->snooze.etimer) ecore_timer_del(al->snooze.etimer);
   al->state = ALARM_STATE_SNOOZED;
   al->snooze.remember = 1;
   al->snooze.etimer = ecore_timer_add(time, _cb_alarm_snooze_time, al);
   _alarm_dialog_snooze_delete(dia, al);

   e_config_save_queue();
}
static int
_basic_apply_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata)
{
  Config_Item *ci;

  ci = cfd->data;
  ci->poll_time = cfdata->poll_time;
#ifdef __linux__
  ci->real_ignore_buffers = cfdata->real_ignore_buffers;
  ci->real_ignore_cached = cfdata->real_ignore_cached;
#endif
  ci->always_text = cfdata->always_text;
  ci->show_percent = cfdata->show_percent;
  e_config_save_queue ();
  _mem_config_updated (ci);

  return 1;
}
Ejemplo n.º 20
0
static int
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
   Config_Item *ci;

   ci = cfd->data;
   ci->show_label = cfdata->show_label;
   ci->icon_label = cfdata->icon_label;
   ci->show_desk = cfdata->desk_policy;
   ci->skip_dialogs = cfdata->skip_dialogs;
   ci->skip_always_below_windows = cfdata->skip_always_below_windows;
   ci->iconify_focused = cfdata->iconify_focused;
   ci->ibox_style = cfdata->ibox_style;
   ci->always_group = cfdata->always_group;

   itask_reload(ci->it);

   e_config_save_queue();
   return 1;
}
static int
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
   Population *pop;

   pop = cfd->data;
   e_border_button_bindings_ungrab_all();
   
   pop->conf->penguins_count = cfdata->penguins_count;
   pop->conf->zoom = cfdata->zoom;
   pop->conf->alpha = cfdata->alpha;
   
   eina_stringshare_del(pop->conf->theme);
   pop->conf->theme = eina_stringshare_ref(cfdata->theme);

   e_config_save_queue();
   e_border_button_bindings_grab_all();

   _penguins_cb_config_updated(pop);
   return 1;
}
Ejemplo n.º 22
0
static int
_basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
   places_conf->show_menu = cfdata->show_menu;
   places_conf->auto_mount = cfdata->auto_mount;
   places_conf->auto_open = cfdata->auto_open;
   places_conf->show_home = cfdata->show_home;
   places_conf->show_desk = cfdata->show_desk;
   places_conf->show_trash = cfdata->show_trash;
   places_conf->show_root = cfdata->show_root;
   places_conf->show_temp = cfdata->show_temp;
   places_conf->show_bookm = cfdata->show_bookm;

   const char *fm = eina_stringshare_add(cfdata->fm);
   eina_stringshare_del(places_conf->fm);
   places_conf->fm = fm;

   e_config_save_queue();
   places_update_all_gadgets();
   return 1;
}
Ejemplo n.º 23
0
void
alarm_alarm_ring_stop(Alarm *al, int check)
{
   Eina_List *l;

   if (al)
     {
        if (al->state != ALARM_STATE_RINGING) return;

        al->state = ALARM_STATE_ON;
        alarm_config->alarms_ringing_nb--;
        if (check) _alarm_check_date(al, 0);
     }
   else
     {
        for (l=alarm_config->alarms; l; l=eina_list_next(l))
          {
             al = eina_list_data_get(l);
             if (al->state == ALARM_STATE_RINGING)
               {
                  printf("Stop alarm %s\n", al->name);
                  al->state = ALARM_STATE_ON;
                  alarm_config->alarms_ringing_nb--;
                  if (check) _alarm_check_date(al, 0);
               }
          }
     }

   if (alarm_config->alarms_ringing_nb == 0)
     {
        alarm_edje_signal_emit(EDJE_SIG_SEND_ALARM_STATE_ON);
        alarm_config->alarms_state = ALARM_STATE_ON;
     }

   e_config_save_queue();
}
Ejemplo n.º 24
0
static int
_basic_apply_data(E_Config_Dialog      *cfd,
                  E_Config_Dialog_Data *cfdata)
{
   int need_rearrangement =
     memcmp(cfdata, tiling_g.config, sizeof(Config) - (sizeof(char *) * 2) - sizeof(Eina_List *));

   if (!need_rearrangement)
     {
        if (cfdata->tiling_border && tiling_g.config->tiling_border)
          need_rearrangement = strcmp(cfdata->tiling_border, tiling_g.config->tiling_border);
        else if (cfdata->tiling_border || tiling_g.config->tiling_border)
          need_rearrangement = 1;
     }

   if (!need_rearrangement)
     {
        if (cfdata->floating_border && tiling_g.config->floating_border)
          need_rearrangement = strcmp(cfdata->floating_border, tiling_g.config->floating_border);
        else if (cfdata->floating_border || tiling_g.config->floating_border)
          need_rearrangement = 1;
     }

   if (!need_rearrangement)
     {
        /* Check if the layout for one of the vdesks has changed */
         Eina_List *l;
         for (l = tiling_g.config->vdesks; l; l = l->next)
           {
              struct _E_Config_vdesk *vd = l->data,
              *newvd;
              if (!vd || !(newvd = get_vdesk(cfdata, vd->x, vd->y, vd->zone_num))) continue;
              if (newvd->layout != vd->layout)
                {
                   E_Zone *zone = e_zone_current_get(e_container_current_get(e_manager_current_get()));
                   E_Desk *desk = e_desk_current_get(zone);
                   if (desk->x == vd->x && desk->y == vd->y && zone->num == vd->zone_num)
                     {
                        need_rearrangement = 1;
                        break;
                     }
                }
           }
     }

   if (tiling_g.config->floating_border)
     free(tiling_g.config->floating_border);
   if (tiling_g.config->tiling_border)
     free(tiling_g.config->tiling_border);
   memcpy(tiling_g.config, cfdata, sizeof(Config));

   cfdata->floating_border = NULL;
   cfdata->tiling_border = NULL;
   cfdata->vdesks = NULL;

   e_config_save_queue();

   if (need_rearrangement)
     e_mod_tiling_rearrange();

   return 1;
}