changeset 321:bfbd9d6eb901

browser_side: info dialog to let the user know that a refresh is needed after GUI parameters have been changed
author souliane <souliane@mailoo.org>
date Fri, 03 Jan 2014 22:43:44 +0100
parents a0ded7df30f7
children 971e3812903a
files browser_side/xmlui.py libervia.py
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/browser_side/xmlui.py	Fri Jan 03 21:48:49 2014 +0100
+++ b/browser_side/xmlui.py	Fri Jan 03 22:43:44 2014 +0100
@@ -19,6 +19,7 @@
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 """
 
+from sat.core.i18n import _
 from pyjamas.ui.VerticalPanel import VerticalPanel
 from pyjamas.ui.HorizontalPanel import HorizontalPanel
 from pyjamas.ui.CellPanel import CellPanel
@@ -32,6 +33,7 @@
 from pyjamas.ui.CheckBox import CheckBox
 from pyjamas.ui.ListBox import ListBox
 from pyjamas.ui.Button import Button
+from dialog import InfoDialog
 from nativedom import NativeDOM
 
 
@@ -270,6 +272,7 @@
 
     def onSaveParams(self, button):
         print "onSaveParams"
+        refresh = False
         for ctrl in self.param_changed:
             if isinstance(ctrl, CheckBox):
                 value = "true" if ctrl.isChecked() else "false"
@@ -278,4 +281,8 @@
             else:
                 value = ctrl.getText()
             self.host.bridge.call('setParam', None, ctrl._param_name, value, ctrl._param_category)
+            if ctrl._param_name in self.host.ui_refresh_params:
+                refresh = True
         self.close()
+        if refresh:
+            InfoDialog(_("Refresh needed"), _("A parameter requesting a page refresh has been modified.<br/>Your changes will be fully effective only after you refresh the page with 'F5' or from your browser menu.")).show()
--- a/libervia.py	Fri Jan 03 21:48:49 2014 +0100
+++ b/libervia.py	Fri Jan 03 22:43:44 2014 +0100
@@ -184,6 +184,7 @@
         self._register.call('isRegistered', self._isRegisteredCB)
         self.initialised = False
         self.init_cache = []  # used to cache events until initialisation is done
+        self.ui_refresh_params = (Const.ENABLE_UNIBOX_PARAM)
 
     def addSelectedListener(self, callback):
         self._selected_listeners.add(callback)