Skip to content
Permalink
Browse files

Places multi devices notif fix + some clean up

  • Loading branch information...
thewaiter committed May 30, 2018
1 parent 279e8e6 commit abd20f12f7296ec3daa9b3b706f6e697c305e7af
Showing with 19 additions and 17 deletions.
  1. +2 −1 src/modules/places/e_mod_main.c
  2. +2 −2 src/modules/places/e_mod_main.h
  3. +15 −14 src/modules/places/e_mod_places.c
@@ -127,10 +127,11 @@ e_modapi_init(E_Module *m)
"inconvenience.<br>");
}
}

/* if we don't have a config yet, or it got erased above,
* then create a default one */
if (!places_conf) _places_conf_new();
E_CONFIG_LIMIT(places_conf->alert_p, 0, 100);
E_CONFIG_LIMIT(places_conf->alert_timeout, 0, 300);

places_conf->module = m;
e_gadcon_provider_register(&_gc_class);
@@ -31,8 +31,8 @@ struct _Config
unsigned char show_root;
unsigned char show_temp;
unsigned char show_bookm;
int alert_p;
int alert_timeout;
int alert_p;
int alert_timeout;
};

typedef struct _Config_Item Config_Item;
@@ -33,7 +33,7 @@ void _places_header_activated_cb(void *data __UNUSED__, Evas_Object *o __UNUSED_
static Ecore_Timer *poller = NULL;
static char theme_file[PATH_MAX];
Eina_List *volumes = NULL;
static int perc_backup = 0;
static int perc_backup[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};


/* Implementation */
@@ -533,6 +533,7 @@ _places_poller(void *data __UNUSED__)
Eina_List *l;
long long new;
int percent;
int i=0;
static E_Notification *notification;
char diskname[200];
char diskpercent[200];
@@ -550,21 +551,21 @@ _places_poller(void *data __UNUSED__)

#ifdef HAVE_ENOTIFY
if ((places_conf->alert_p > 0) && (percent > places_conf->alert_p)
&& (percent > perc_backup))
&& (percent > perc_backup[i]))
{
sprintf(diskname,_("Disk %s is full!"), vol->label);
sprintf(diskpercent,_("Disk usage is %d %%!"), percent);

notification = e_notification_full_new
(
_("Places"),0,"dialog_error", diskname,
diskpercent, places_conf->alert_timeout * 1000
);
e_notification_send(notification, NULL, NULL);
e_notification_unref(notification);
notification = NULL;
//~ sprintf(diskname,_("Disk ""%s"" is full!"), vol->label);
sprintf(diskname,_("Places warning!"));
sprintf(diskpercent,_("Disk ''%s'' usage is %d %%!"), vol->label, percent);

notification = e_notification_full_new
(_("Places"),0,"dialog_error", diskname,
diskpercent, places_conf->alert_timeout * 1000);
e_notification_send(notification, NULL, NULL);
e_notification_unref(notification);
notification = NULL;
}
perc_backup = percent;
perc_backup[i] = percent;
i++;
#endif

places_volume_update(vol);

0 comments on commit abd20f1

Please sign in to comment.
You can’t perform that action at this time.