davemds pushed a commit to branch master.
http://git.enlightenment.org/enlightenment/modules/edgar.git/commit/?id=fb1afc286b81d4a60580aed566258f4c555aeb62
commit fb1afc286b81d4a60580aed566258f4c555aeb62
Author: Dave Andreoli d...@gurumeditation.it
Date: Sun Aug 30 13:56:03 2015 +0200
Add a new Dropbox gadget
It show the dropbox status and enable to start/stop the daemon
---
GADGETS/dropbox/Makefile | 36
GADGETS/dropbox/__init__.py | 252 +++
GADGETS/dropbox/docs/dropboxd-protocol | 97 +++
GADGETS/dropbox/dropbox.edc | 98 +++
GADGETS/dropbox/images/dropbox.png | Bin 0 - 8219 bytes
GADGETS/dropbox/images/dropbox_gray.png | Bin 0 - 8463 bytes
GADGETS/dropbox/images/emblem-syncing.png| Bin 0 - 6708 bytes
GADGETS/dropbox/images/emblem-unsyncable.png | Bin 0 - 3584 bytes
GADGETS/dropbox/images/emblem-uptodate.png | Bin 0 - 4358 bytes
9 files changed, 483 insertions(+)
diff --git a/GADGETS/dropbox/Makefile b/GADGETS/dropbox/Makefile
new file mode 100644
index 000..50b1f27
--- /dev/null
+++ b/GADGETS/dropbox/Makefile
@@ -0,0 +1,36 @@
+# Simple Makefile for Enlightenment (edgar) gadgets
+
+# gadget specific config
+GADGET_NAME = dropbox
+EXTRA_FILES =
+
+
+# nothing should be changed below this point
+GADGET_FILES = __init__.pyc $(GADGET_NAME).edj
+prefix = $(shell pkg-config --variable=libdir enlightenment)
+gadget_folder = ${prefix}/enlightenment/gadgets/$(GADGET_NAME)
+
+.PHONY: all install clean
+
+all: $(GADGET_FILES) $(EXTRA_FILES)
+
+install: all
+ @mkdir -p -v ${gadget_folder}
+ @cp --preserve=mode -v $(GADGET_FILES) $(EXTRA_FILES) $(gadget_folder)
+
+uninstall: all
+ @rm -rfv ${gadget_folder}
+
+clean:
+ @rm -fv *.edj *.pyc
+
+
+EDJE_CC = edje_cc
+EDJE_FLAGS = -v -id images/ -fd fonts/
+
+%.edj: %.edc images/*
+ $(EDJE_CC) $(EDJE_FLAGS) $
+ @chmod -v og+r $@
+
+%.pyc: %.py
+ python3 -c from py_compile import compile; compile('$', '$@')
diff --git a/GADGETS/dropbox/__init__.py b/GADGETS/dropbox/__init__.py
new file mode 100644
index 000..fdfb415
--- /dev/null
+++ b/GADGETS/dropbox/__init__.py
@@ -0,0 +1,252 @@
+# This python file use the following encoding: utf-8
+
+import os
+import sys
+import socket
+
+import e
+
+from efl import ecore
+from efl import evas
+from efl import edje
+from efl.elementary.label import Label
+from efl.elementary.entry import utf8_to_markup
+from efl.elementary.button import Button
+
+
+__gadget_name__ = 'Dropbox'
+__gadget_vers__ = '0.1'
+__gadget_auth__ = 'DaveMDS'
+__gadget_mail__ = 'd...@gurumeditation.it'
+__gadget_desc__ = 'Dropbox info gadget.'
+__gadget_vapi__ = 1
+__gadget_opts__ = { 'popup_on_desktop': False }
+
+
+#def DBG(msg):
+#print(DB: + msg)
+#sys.stdout.flush()
+
+
+class Gadget(e.Gadget):
+
+def __init__(self):
+super().__init__()
+self.db = Dropbox(self.db_status_changed_cb)
+
+def instance_created(self, obj, site):
+super().instance_created(obj, site)
+obj.size_hint_aspect = evas.EVAS_ASPECT_CONTROL_BOTH , 16, 16
+
+def instance_destroyed(self, obj):
+super().instance_destroyed(obj)
+
+def popup_created(self, popup):
+super().popup_created(popup)
+
+popup.data['lb'] = Label(popup)
+popup.part_box_append('popup.box', popup.data['lb'])
+popup.data['lb'].show()
+
+popup.data['bt'] = Button(popup)
+popup.data['bt'].callback_clicked_add(self.start_stop_clicked_cb)
+popup.part_box_append('popup.box', popup.data['bt'])
+popup.data['bt'].show()
+
+self.popup_update(popup)
+
+def popup_destroyed(self, popup):
+super().popup_destroyed(popup)
+
+def db_status_changed_cb(self):
+for icon in self._instances:
+if self.db.is_running:
+icon.signal_emit('daemon,running', '')
+icon.signal_emit('state,'+self.db.status, '')
+else:
+icon.signal_emit('daemon,not_running', '')
+icon.signal_emit('state,unwatched', '')
+
+for popup in self._popups:
+self.popup_update(popup)
+
+def popup_update(self, popup):
+if self.db.is_running:
+popup.data['lb'].text = utf8_to_markup(self.db.status_msg)
+popup.data['bt'].text = 'Stop Dropbox'
+popup.data['bt'].disabled = False
+elif self.db.is_installed:
+popup.data['lb'].text = Dropbox isn't running!
+popup.data['bt'].text = 'Start Dropbox'
+popup.data['bt'].disabled = False
+else:
+popup.data['lb'].text = Dropbox isn't installed!
+popup.data['bt'].text = 'Install Dropbox'
+popup.data['bt'].disabled = True
+
+# force the popup to recalculate it's size
+popup.size_hint_min = popup.size_min
+
+def start_stop_clicked_cb(self,