Say goodbye to the Systray widget
This is a really bad break !!! ... shame on us to have used an efl beta api :(
This commit is contained in:
parent
3e198f7294
commit
7c555cc9da
|
@ -78,7 +78,6 @@ __all__ = (
|
|||
"slideshow",
|
||||
"spinner",
|
||||
#"store",
|
||||
"systray",
|
||||
"table",
|
||||
"theme",
|
||||
"thumb",
|
||||
|
|
|
@ -59,8 +59,6 @@ ELM_EVENT_PROCESS_FOREGROUND = enums.ELM_EVENT_PROCESS_FOREGROUND
|
|||
ELM_ECORE_EVENT_ETHUMB_CONNECT = enums.ELM_ECORE_EVENT_ETHUMB_CONNECT
|
||||
ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED = enums.ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED
|
||||
ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED = enums.ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED
|
||||
ELM_EVENT_SYSTRAY_READY = enums.ELM_EVENT_SYSTRAY_READY
|
||||
|
||||
|
||||
ELM_FOCUS_PREVIOUS = enums.ELM_FOCUS_PREVIOUS
|
||||
ELM_FOCUS_NEXT = enums.ELM_FOCUS_NEXT
|
||||
|
@ -516,18 +514,6 @@ ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS = enums.ELM_SLIDER_INDICATOR_VISIBLE_MO
|
|||
ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS = enums.ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS
|
||||
ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE = enums.ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE
|
||||
|
||||
ELM_EVENT_SYSTRAY_READY = enums.ELM_EVENT_SYSTRAY_READY
|
||||
|
||||
ELM_SYSTRAY_CATEGORY_APP_STATUS = enums.ELM_SYSTRAY_CATEGORY_APP_STATUS
|
||||
ELM_SYSTRAY_CATEGORY_COMMUNICATIONS = enums.ELM_SYSTRAY_CATEGORY_COMMUNICATIONS
|
||||
ELM_SYSTRAY_CATEGORY_SYS_SERVICES = enums.ELM_SYSTRAY_CATEGORY_SYS_SERVICES
|
||||
ELM_SYSTRAY_CATEGORY_HARDWARE = enums.ELM_SYSTRAY_CATEGORY_HARDWARE
|
||||
ELM_SYSTRAY_CATEGORY_OTHER = enums.ELM_SYSTRAY_CATEGORY_OTHER
|
||||
|
||||
ELM_SYSTRAY_STATUS_PASSIVE = enums.ELM_SYSTRAY_STATUS_PASSIVE
|
||||
ELM_SYSTRAY_STATUS_ACTIVE = enums.ELM_SYSTRAY_STATUS_ACTIVE
|
||||
ELM_SYSTRAY_STATUS_ATTENTION = enums.ELM_SYSTRAY_STATUS_ATTENTION
|
||||
|
||||
ELM_THUMB_ANIMATION_START = enums.ELM_THUMB_ANIMATION_START
|
||||
ELM_THUMB_ANIMATION_LOOP = enums.ELM_THUMB_ANIMATION_LOOP
|
||||
ELM_THUMB_ANIMATION_STOP = enums.ELM_THUMB_ANIMATION_STOP
|
||||
|
@ -1285,7 +1271,6 @@ include "slider.pxi"
|
|||
include "slideshow.pxi"
|
||||
include "spinner.pxi"
|
||||
#include "store.pxi"
|
||||
# include "systray.pxi"
|
||||
include "table.pxi"
|
||||
include "theme.pxi"
|
||||
include "thumb.pxi"
|
||||
|
|
|
@ -14,7 +14,6 @@ from . import ELM_EVENT_PROCESS_BACKGROUND
|
|||
from . import ELM_EVENT_PROCESS_FOREGROUND
|
||||
from . import ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED
|
||||
from . import ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED
|
||||
from . import ELM_EVENT_SYSTRAY_READY
|
||||
|
||||
from . import ELM_OBJECT_LAYER_BACKGROUND
|
||||
from . import ELM_OBJECT_LAYER_DEFAULT
|
||||
|
|
|
@ -89,13 +89,6 @@ cdef class EthumbConnect(Event):
|
|||
def __repr__(self):
|
||||
return "<%s()>" % (self.__class__.__name__,)
|
||||
|
||||
cdef class EventSystrayReady(Event):
|
||||
cdef int _set_obj(self, void *o) except 0:
|
||||
return 1
|
||||
|
||||
def __repr__(self):
|
||||
return "<%s()>" % (self.__class__.__name__,)
|
||||
|
||||
|
||||
def need_efreet():
|
||||
"""Request that your elementary application needs Efreet
|
||||
|
@ -113,23 +106,17 @@ def need_efreet():
|
|||
def need_systray():
|
||||
"""Request that your elementary application needs Elm_Systray
|
||||
|
||||
This initializes the Elm_Systray when called and, if support exists,
|
||||
returns True, otherwise returns False. This must be called
|
||||
before any elm_systray calls.
|
||||
WARNING: elm is no more capable of systray functionality
|
||||
|
||||
:return: True if support exists and initialization succeeded.
|
||||
:return: always return False
|
||||
:rtype: bool
|
||||
|
||||
.. versionadded:: 1.8
|
||||
.. versionremoved:: 1.21
|
||||
|
||||
"""
|
||||
cdef bint ret = elm_need_systray()
|
||||
if ret:
|
||||
try:
|
||||
_event_mapping_register(enums.ELM_EVENT_SYSTRAY_READY, EventSystrayReady)
|
||||
except ValueError:
|
||||
pass
|
||||
return ret
|
||||
print("ERROR: the Systray functionality do not exists anymore...apologies")
|
||||
return False
|
||||
|
||||
def need_sys_notify():
|
||||
"""Request that your elementary application needs Elm_Sys_Notify
|
||||
|
|
|
@ -1,218 +0,0 @@
|
|||
# Copyright (C) 2007-2016 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 3 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
include "systray_cdef.pxi"
|
||||
|
||||
cdef class Systray(Eo):
|
||||
|
||||
"""
|
||||
|
||||
This is the class that actually implements the widget.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, Eo parent not None, *args, **kwargs):
|
||||
cdef cEo *obj = efl_add(elm_systray_class_get(), parent.obj)
|
||||
self._set_obj(obj)
|
||||
self._set_properties_from_keyword_args(kwargs)
|
||||
|
||||
property id:
|
||||
"""The id of the Status Notifier Item.
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __set__(self, value):
|
||||
if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
|
||||
elm_obj_systray_id_set(
|
||||
self.obj, <const char *>value if value is not None else NULL
|
||||
)
|
||||
|
||||
def __get__(self):
|
||||
return _ctouni(elm_obj_systray_id_get(self.obj))
|
||||
|
||||
def id_set(self, value):
|
||||
if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
|
||||
elm_obj_systray_id_set(
|
||||
self.obj, <const char *>value if value is not None else NULL
|
||||
)
|
||||
|
||||
def id_get(self):
|
||||
return _ctouni(elm_obj_systray_id_get(self.obj))
|
||||
|
||||
property category:
|
||||
"""
|
||||
|
||||
The category of the Status Notifier Item.
|
||||
|
||||
:type: :ref:`Elm_Systray_Category`
|
||||
|
||||
"""
|
||||
def __set__(self, Elm_Systray_Category value):
|
||||
elm_obj_systray_category_set(self.obj, value)
|
||||
|
||||
def __get__(self):
|
||||
return <Elm_Systray_Category>elm_obj_systray_category_get(self.obj)
|
||||
|
||||
def category_set(self, Elm_Systray_Category value):
|
||||
elm_obj_systray_category_set(self.obj, value)
|
||||
|
||||
def category_get(self):
|
||||
return <Elm_Systray_Category>elm_obj_systray_category_get(self.obj)
|
||||
|
||||
property icon_theme_path:
|
||||
"""The path to the theme where the icons can be found.
|
||||
|
||||
Set this value to "" to use the default path.
|
||||
|
||||
:type: string
|
||||
"""
|
||||
def __set__(self, value):
|
||||
if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
|
||||
elm_obj_systray_icon_theme_path_set(
|
||||
self.obj, <const char *>value if value is not None else NULL
|
||||
)
|
||||
|
||||
def __get__(self):
|
||||
return _ctouni(elm_obj_systray_icon_theme_path_get(self.obj))
|
||||
|
||||
def icon_theme_path_set(self, value):
|
||||
if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
|
||||
elm_obj_systray_icon_theme_path_set(
|
||||
self.obj, <const char *>value if value is not None else NULL
|
||||
)
|
||||
|
||||
def icon_theme_path_get(self):
|
||||
return _ctouni(elm_obj_systray_icon_theme_path_get(self.obj))
|
||||
|
||||
property menu:
|
||||
"""The D-Bus Menu to be shown when the Status Notifier Item is activated by the user.
|
||||
|
||||
:type: :class:`~efl.elementary.menu.Menu`
|
||||
"""
|
||||
def __set__(self, Eo value):
|
||||
elm_obj_systray_menu_set(self.obj, value.obj)
|
||||
|
||||
def __get__(self):
|
||||
return object_from_instance(<cEo *>elm_obj_systray_menu_get(self.obj))
|
||||
|
||||
def menu_set(self, Eo value):
|
||||
elm_obj_systray_menu_set(self.obj, value.obj)
|
||||
|
||||
def menu_get(self):
|
||||
return object_from_instance(<cEo *>elm_obj_systray_menu_get(self.obj))
|
||||
|
||||
property att_icon_name:
|
||||
"""The name of the attention icon to be used by the Status Notifier Item.
|
||||
|
||||
:type: string
|
||||
"""
|
||||
def __set__(self, value):
|
||||
if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
|
||||
elm_obj_systray_att_icon_name_set(
|
||||
self.obj, <const char *>value if value is not None else NULL
|
||||
)
|
||||
|
||||
def __get__(self):
|
||||
return _ctouni(elm_obj_systray_att_icon_name_get(self.obj))
|
||||
|
||||
def att_icon_name_set(self, value):
|
||||
if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
|
||||
elm_obj_systray_att_icon_name_set(
|
||||
self.obj, <const char *>value if value is not None else NULL
|
||||
)
|
||||
|
||||
def att_icon_name_get(self):
|
||||
return _ctouni(elm_obj_systray_att_icon_name_get(self.obj))
|
||||
|
||||
property status:
|
||||
"""The status of the Status Notifier Item.
|
||||
|
||||
:type: :ref:`Elm_Systray_Status`
|
||||
"""
|
||||
def __set__(self, Elm_Systray_Status value):
|
||||
elm_obj_systray_status_set(self.obj, value)
|
||||
|
||||
def __get__(self):
|
||||
return elm_obj_systray_status_get(self.obj)
|
||||
|
||||
def status_set(self, Elm_Systray_Status value):
|
||||
elm_obj_systray_status_set(self.obj, value)
|
||||
|
||||
def status_get(self):
|
||||
return elm_obj_systray_status_get(self.obj)
|
||||
|
||||
property icon_name:
|
||||
"""The name of the icon to be used by the Status Notifier Item.
|
||||
|
||||
:type: string
|
||||
"""
|
||||
def __set__(self, value):
|
||||
if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
|
||||
elm_obj_systray_icon_name_set(
|
||||
self.obj, <const char *>value if value is not None else NULL
|
||||
)
|
||||
|
||||
def __get__(self):
|
||||
return _ctouni(elm_obj_systray_icon_name_get(self.obj))
|
||||
|
||||
def icon_name_set(self, value):
|
||||
if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
|
||||
elm_obj_systray_icon_name_set(
|
||||
self.obj, <const char *>value if value is not None else NULL
|
||||
)
|
||||
|
||||
def icon_name_get(self):
|
||||
return _ctouni(elm_obj_systray_icon_name_get(self.obj))
|
||||
|
||||
property title:
|
||||
"""The title of the Status Notifier Item.
|
||||
|
||||
:type: string
|
||||
"""
|
||||
def __set__(self, value):
|
||||
if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
|
||||
elm_obj_systray_title_set(
|
||||
self.obj, <const char *>value if value is not None else NULL
|
||||
)
|
||||
|
||||
def __get__(self):
|
||||
return _ctouni(elm_obj_systray_title_get(self.obj))
|
||||
|
||||
def title_set(self, value):
|
||||
if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
|
||||
elm_obj_systray_title_set(
|
||||
self.obj, <const char *>value if value is not None else NULL
|
||||
)
|
||||
|
||||
def title_get(self):
|
||||
return _ctouni(elm_obj_systray_title_get(self.obj))
|
||||
|
||||
def register(self):
|
||||
"""Register this Status Notifier Item in the System Tray Watcher.
|
||||
|
||||
This function should only be called after the event
|
||||
``ELM_EVENT_SYSTRAY_READY``, for which you can set a callback with
|
||||
:func:`on_systray_ready`, is emitted.
|
||||
|
||||
"""
|
||||
return elm_obj_systray_register(self.obj)
|
||||
|
||||
|
||||
def on_systray_ready(func, *args, **kwargs):
|
||||
"""Use this to set a handler for the systray ready event."""
|
||||
return EventHandler(enums.ELM_EVENT_SYSTRAY_READY, func, *args, **kwargs)
|
|
@ -1,13 +0,0 @@
|
|||
from . import Systray, on_systray_ready
|
||||
|
||||
from . import ELM_EVENT_SYSTRAY_READY
|
||||
|
||||
from . import ELM_SYSTRAY_CATEGORY_APP_STATUS
|
||||
from . import ELM_SYSTRAY_CATEGORY_COMMUNICATIONS
|
||||
from . import ELM_SYSTRAY_CATEGORY_SYS_SERVICES
|
||||
from . import ELM_SYSTRAY_CATEGORY_HARDWARE
|
||||
from . import ELM_SYSTRAY_CATEGORY_OTHER
|
||||
|
||||
from . import ELM_SYSTRAY_STATUS_PASSIVE
|
||||
from . import ELM_SYSTRAY_STATUS_ACTIVE
|
||||
from . import ELM_SYSTRAY_STATUS_ATTENTION
|
|
@ -1,25 +0,0 @@
|
|||
from efl.elementary.enums cimport Elm_Systray_Category, Elm_Systray_Status
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
|
||||
ctypedef cEo Elm_Systray
|
||||
|
||||
const Efl_Class *elm_systray_class_get()
|
||||
|
||||
void elm_obj_systray_id_set(cEo *obj, const char *id)
|
||||
const char * elm_obj_systray_id_get(const cEo *obj)
|
||||
void elm_obj_systray_category_set(cEo *obj, Elm_Systray_Category cat)
|
||||
Elm_Systray_Category elm_obj_systray_category_get(const cEo *obj)
|
||||
void elm_obj_systray_icon_theme_path_set(cEo *obj, const char *icon_theme_path)
|
||||
const char * elm_obj_systray_icon_theme_path_get(const cEo *obj)
|
||||
void elm_obj_systray_menu_set(cEo *obj, const cEo *menu)
|
||||
const cEo * elm_obj_systray_menu_get(const cEo *obj)
|
||||
void elm_obj_systray_att_icon_name_set(cEo *obj, const char *att_icon_name)
|
||||
const char * elm_obj_systray_att_icon_name_get(const cEo *obj)
|
||||
void elm_obj_systray_status_set(cEo *obj, Elm_Systray_Status st)
|
||||
Elm_Systray_Status elm_obj_systray_status_get(const cEo *obj)
|
||||
void elm_obj_systray_icon_name_set(cEo *obj, const char *icon_name)
|
||||
const char * elm_obj_systray_icon_name_get(const cEo *obj)
|
||||
void elm_obj_systray_title_set(cEo *obj, const char *title)
|
||||
const char * elm_obj_systray_title_get(const cEo *obj)
|
||||
Eina_Bool elm_obj_systray_register(const cEo *obj)
|
|
@ -247,7 +247,6 @@ items = [
|
|||
]),
|
||||
("System", [
|
||||
("Notification", "test_sys_notify", "sys_notify_clicked"),
|
||||
("Systray", "test_systray", "systray_clicked"),
|
||||
]),
|
||||
("Text", [
|
||||
("Label", "test_label", "label_clicked"),
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import efl.elementary as elm
|
||||
|
||||
from efl.elementary.window import StandardWindow
|
||||
from efl.elementary.systray import Systray, on_systray_ready
|
||||
from efl.elementary.menu import Menu
|
||||
|
||||
|
||||
def systray_clicked(obj, item=None):
|
||||
if not elm.need_systray():
|
||||
print("systray support not available")
|
||||
return
|
||||
|
||||
win = StandardWindow("test", "systray test", size=(400, 400), autodel=True)
|
||||
if not obj:
|
||||
win.callback_delete_request_add(lambda x: elm.exit())
|
||||
|
||||
menu = Menu(win)
|
||||
menu.item_add(None, "it works!")
|
||||
|
||||
global tray
|
||||
tray = Systray(win)
|
||||
tray.icon_name = "elementary"
|
||||
tray.att_icon_name = "elementary"
|
||||
tray.menu = menu
|
||||
|
||||
on_systray_ready(lambda x: tray.register())
|
||||
|
||||
win.show()
|
||||
|
||||
if __name__ == "__main__":
|
||||
elm.init()
|
||||
|
||||
systray_clicked(None)
|
||||
|
||||
elm.run()
|
||||
elm.shutdown()
|
|
@ -568,22 +568,6 @@ cdef extern from "Elementary.h":
|
|||
ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS
|
||||
ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE
|
||||
|
||||
# systray
|
||||
ctypedef enum:
|
||||
ELM_EVENT_SYSTRAY_READY
|
||||
|
||||
ctypedef enum Elm_Systray_Category:
|
||||
ELM_SYSTRAY_CATEGORY_APP_STATUS
|
||||
ELM_SYSTRAY_CATEGORY_COMMUNICATIONS
|
||||
ELM_SYSTRAY_CATEGORY_SYS_SERVICES
|
||||
ELM_SYSTRAY_CATEGORY_HARDWARE
|
||||
ELM_SYSTRAY_CATEGORY_OTHER
|
||||
|
||||
ctypedef enum Elm_Systray_Status:
|
||||
ELM_SYSTRAY_STATUS_PASSIVE
|
||||
ELM_SYSTRAY_STATUS_ACTIVE
|
||||
ELM_SYSTRAY_STATUS_ATTENTION
|
||||
|
||||
# thumb
|
||||
ctypedef enum Elm_Thumb_Animation_Setting:
|
||||
ELM_THUMB_ANIMATION_START
|
||||
|
|
Loading…
Reference in New Issue