File diff 751341c267ed → f22bd3eead48
accounting/gtkclient.py
Show inline comments
...
 
@@ -12,44 +12,44 @@ from gi.repository import GObject
 

	
 
from accounting.client import Client
 

	
 
_log = logging.getLogger(__name__)
 

	
 

	
 
def indicate_activity(func_or_str):
 
    description = None
 

	
 
    def decorator(func):
 
        @wraps(func)
 
        def wrapper(self, *args, **kw):
 
            self.status_description.set_text(description)
 
            self.activity_description.set_text(description)
 
            self.activity_indicator.show()
 
            self.activity_indicator.start()
 

	
 
            return func(self, *args, **kw)
 

	
 
        return wrapper
 

	
 
    if callable(func_or_str):
 
        description = 'Working'
 
        return decorator(func_or_str)
 
    else:
 
        description = func_or_str
 
        return decorator
 

	
 

	
 
def indicate_activity_done(func):
 
    @wraps(func)
 
    def wrapper(self, *args, **kw):
 
        self.status_description.set_text('')
 
        self.activity_description.set_text('')
 
        self.activity_indicator.stop()
 
        self.activity_indicator.hide()
 

	
 
        return func(self, *args, **kw)
 

	
 
    return wrapper
 

	
 

	
 
class AccountingApplication:
 
    def __init__(self):
 
        #Gtk.Window.__init__(self, title='Accounting Client')