3
# This is a part of the external applets for Cairo-Dock
4
# Copyright : (C) 2010-2011 by Nochka85, Fabounet and Matttbe
5
# E-mail : fabounet@glx-dock.org
7
# This program is free software; you can redistribute it and/or
8
# modify it under the terms of the GNU General Public License
9
# as published by the Free Software Foundation; either version 2
10
# of the License, or (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
# http://www.gnu.org/licenses/licenses.html#GPL
22
from CDApplet import CDApplet
27
class CDBashApplet(CDApplet):
29
# call high-level init
30
self.app_folder = os.path.abspath(".")
31
CDApplet.__init__(self)
33
##### private methods #####
35
def call(self,action):
36
os.popen("cd " + self.app_folder + " && ./" + self.cAppletName + ".sh " + self.cAppletName + " " + self.cBusPath + " " + self.cConfFile + " " + self.cParentAppName + " " + action).read().rstrip()
38
##### applet definition #####
40
def get_config(self,keyfile):
41
self.call("get_config")
54
def on_click(self,iState):
55
self.call("on_click "+str(iState))
57
def on_middle_click(self):
58
self.call("on_middle_click")
60
def on_build_menu(self):
61
self.call("on_build_menu")
63
def on_menu_select(self,iNumEntry):
64
self.call("on_menu_select "+str(iNumEntry))
66
def on_scroll(self,bScrollUp):
67
self.call("on_scroll "+str(bScrollUp))
69
def on_drop_data(self,cReceivedData):
70
self.call("on_drop_data '"+cReceivedData+"'")
72
def on_answer_dialog(self, button, answer):
73
self.call("on_answer_dialog "+str(button)+" '"+str(answer)+"'")
75
def on_shortkey(self,key):
76
self.call("on_shortkey '"+key+"'")
78
def on_change_focus(self,bIsActive):
79
self.call("on_change_focus '"+str(bIsActive)+"'")
81
def on_click_sub_icon(self, iState, cIconID):
82
self.call("on_click_sub_icon '"+str(iState)+"' '"+cIconID+"'")