title: PyQt - How can I re-initialise the whole code without restarting it?
body: <p>I wrote a python GUI program consisting of two separate files; One is for logic code and the other for GUI using PyQt4. The behaviour of some objects (buttons, text fields ...) changes throughout the code and I need to reset everything to its original status by clicking on a QAction class menu item. How can I do that?</p>
  
  <p>EDIT: the function that supposed to reset the GUI to the original status:</p>
  
  <pre><code>def newSession(self):
          self.ui.setupUi(self)
          self.filename = ""
          self.paramsSplitted = []
          self.timestep = None
          self.index = None
          self.selectedParam = None
          self.selectedMethod = None
  
          --Snip--
  </code></pre>