diff browser_side/xmlui.py @ 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 e4f586fc6101
children d07b54fdc60a
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()