diff src/core/sat_main.py @ 1467:ceba6fd77739

core, bridge: new signal actionNew to launch an action from the backend (e.g. display a dialog message): - SAT.actionNew is a shortcut to call bridge.actionNew with a generated id. The id may be used in the future to ignore an action (e.g.: an action is sent to all frontends to accept a file, one of the frontend did manage the dialog, the other ones can then ignore this dialog), but is not used for now.
author Goffi <goffi@goffi.org>
date Tue, 18 Aug 2015 09:01:18 +0200
parents 176de79c8c39
children b233274e9a0f
line wrap: on
line diff
--- a/src/core/sat_main.py	Tue Aug 18 09:01:18 2015 +0200
+++ b/src/core/sat_main.py	Tue Aug 18 09:01:18 2015 +0200
@@ -40,6 +40,7 @@
 from uuid import uuid4
 import sys
 import os.path
+import uuid
 
 try:
     from collections import OrderedDict # only available from python 2.7
@@ -728,6 +729,15 @@
             del client._waiting_conf[conf_id]
             cb(conf_id, accepted, data, profile)
 
+    def actionNew(self, action_data, profile):
+        """Shortcut to bridge.actionNew which generate and id
+
+        @param action_data(dict): action data (see bridge documentation)
+        @param profile: %(doc_profile)s
+        """
+        id_ = unicode(uuid.uuid4())
+        self.bridge.actionNew(action_data, id_, profile)
+
     def registerProgressCB(self, progress_id, CB, profile):
         """Register a callback called when progress is requested for id"""
         client = self.getClient(profile)