Skip to content
Snippets Groups Projects
Commit 80ac28cf authored by stefan's avatar stefan
Browse files

Menubar added "Reset View"

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2571 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 1d56e979
No related branches found
No related tags found
No related merge requests found
......@@ -64,6 +64,11 @@ class InitMenuBar(QtCore.QObject):
self.connect(gl_win, QtCore.SIGNAL('triggered()'), self.ShowGLWin)
window.addAction(gl_win)
reset = QtGui.QAction('Reset View', self)
reset.setStatusTip('Reset the Panels and Widgets')
self.connect(reset, QtCore.SIGNAL('triggered()'), self.ResetView)
window.addAction(reset)
#Options
#Add file loader to menu
loader_manager = QtGui.QAction('File &Loader', self)
......@@ -97,8 +102,23 @@ class InitMenuBar(QtCore.QObject):
gl_win=gosty.GetGLWin()
if gl_win and gl_win.qobject.isHidden():
gl_win.Show()
def ResetView(self):
msg_box = QtGui.QMessageBox()
msg_box.setWindowTitle("Reset the Panels and Widget");
msg_box.setText("Do you really want to reset the Panels and Widgets?");
msg_box.setStandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.Cancel);
msg_box.setDefaultButton(QtGui.QMessageBox.Cancel);
ret = msg_box.exec_();
if(ret == QtGui.QMessageBox.Yes):
settings = QtCore.QSettings()
settings.setValue("restore_settings",QtCore.QVariant(False))
info_box = QtGui.QMessageBox()
info_box.setStandardButtons(QtGui.QMessageBox.Ok)
info_box.setWindowTitle("Restart OpenStructure")
info_box.setText("You must restart OpenStructure for the changes to take effect!");
info_box.exec_();
def _InitMenuBar(app):
InitMenuBar(app.perspective.menubar)
......
......@@ -30,6 +30,14 @@ def _InitRuleBasedBuilder():
# switch to rule-based builder for high fidelity if compounds.chemlib is
# available
_InitRuleBasedBuilder()
def _CheckRestore():
settings = QtCore.QSettings()
restore = settings.value("restore_settings",QtCore.QVariant(False)).toBool()
if not restore:
settings.clear()
settings.setValue("restore_settings",QtCore.QVariant(True))
def _InitPanels(app):
panels = app.perspective.panels
panels.AddWidgetToPool('ost.gui.FileBrowser', -1)
......@@ -49,6 +57,7 @@ def _InitPanels(app):
return True
def _InitFrontEnd():
_CheckRestore()
app=gui.GostyApp.Instance()
app.SetAppTitle("DNG")
main_area=app.perspective.main_area
......@@ -64,7 +73,7 @@ def _InitFrontEnd():
__import__(module_name)
app.ProcessEvents()
_InitInspector(app)
def _load_files():
for pdb_id in options.pdb_ids:
pdb_id, sel=_SplitIDSel(pdb_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment