Skip to content

Commit

Permalink
Merge pull request #575 from vasole/vasole-patch-1
Browse files Browse the repository at this point in the history
Update WidgetsInstantiationTest.py
  • Loading branch information
vasole authored Aug 20, 2019
2 parents bc9a5df + e6007a0 commit e238a72
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 25 deletions.
11 changes: 7 additions & 4 deletions PyMca5/PyMcaGui/pymca/PyMcaMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,13 +1059,14 @@ def initMenuBar(self):
self.actionOpen = qt.QAction(self)
self.actionOpen.setText(QString("&Open"))
self.actionOpen.setIcon(self.Icons["fileopen"])
self.actionOpen.setShortcut(qt.Qt.CTRL+qt.Qt.Key_O)
self.actionOpen.setShortcut(qt.QKeySequence(qt.Qt.CTRL+qt.Qt.Key_O))
self.actionOpen.triggered[bool].connect(self.onOpen)
#filesaveas
self.actionSaveAs = qt.QAction(self)
self.actionSaveAs.setText(QString("&Save"))
self.actionSaveAs.setIcon(self.Icons["filesave"])
self.actionSaveAs.setShortcut(qt.Qt.CTRL+qt.Qt.Key_S)
self.actionSaveAs.setShortcut(\
qt.QKeySequence(qt.Qt.CTRL+qt.Qt.Key_S))
self.actionSaveAs.triggered[bool].connect(self.onSaveAs)

#filesave
Expand All @@ -1079,14 +1080,16 @@ def initMenuBar(self):
self.actionPrint = qt.QAction(self)
self.actionPrint.setText(QString("&Print"))
self.actionPrint.setIcon(self.Icons["fileprint"])
self.actionPrint.setShortcut(qt.Qt.CTRL+qt.Qt.Key_P)
self.actionPrint.setShortcut(\
qt.QKeySequence(qt.Qt.CTRL+qt.Qt.Key_P))
self.actionPrint.triggered[bool].connect(self.onPrint)

#filequit
self.actionQuit = qt.QAction(self)
self.actionQuit.setText(QString("&Quit"))
#self.actionQuit.setIcon(self.Icons["fileprint"])
self.actionQuit.setShortcut(qt.Qt.CTRL+qt.Qt.Key_Q)
self.actionQuit.setShortcut(\
qt.QKeySequence(qt.Qt.CTRL+qt.Qt.Key_Q))
qApp = qt.QApplication.instance()
self.actionQuit.triggered.connect(qApp.closeAllWindows)

Expand Down
8 changes: 4 additions & 4 deletions PyMca5/PyMcaGui/pymca/PyMcaMdi.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ def createActions(self):
self.actionOpen = qt.QAction(self)
self.actionOpen.setText(QString("&Open"))
self.actionOpen.setIcon(self.Icons["fileopen"])
self.actionOpen.setShortcut(qt.Qt.CTRL+qt.Qt.Key_O)
self.actionOpen.setShortcut(qt.QKeySequence(qt.Qt.CTRL+qt.Qt.Key_O))
self.actionOpen.triggered[bool].connect(self.onOpen)
#filesaveas
self.actionSaveAs = qt.QAction(self)
self.actionSaveAs.setText(QString("&Save"))
self.actionSaveAs.setIcon(self.Icons["filesave"])
self.actionSaveAs.setShortcut(qt.Qt.CTRL+qt.Qt.Key_S)
self.actionSaveAs.setShortcut(qt.QKeySequence(qt.Qt.CTRL+qt.Qt.Key_S))
self.actionSaveAs.triggered[bool].connect(self.onSaveAs)

#filesave
Expand All @@ -144,14 +144,14 @@ def createActions(self):
self.actionPrint = qt.QAction(self)
self.actionPrint.setText(QString("&Print"))
self.actionPrint.setIcon(self.Icons["fileprint"])
self.actionPrint.setShortcut(qt.Qt.CTRL+qt.Qt.Key_P)
self.actionPrint.setShortcut(qt.QKeySequence(qt.Qt.CTRL+qt.Qt.Key_P))
self.actionPrint.triggered[bool].connect(self.onPrint)

#filequit
self.actionQuit = qt.QAction(self)
self.actionQuit.setText(QString("&Quit"))
#self.actionQuit.setIcon(self.Icons["fileprint"])
self.actionQuit.setShortcut(qt.Qt.CTRL+qt.Qt.Key_Q)
self.actionQuit.setShortcut(qt.QKeySequence(qt.Qt.CTRL+qt.Qt.Key_Q))
qApp = qt.QApplication.instance()
self.actionQuit.triggered[bool].connect(qApp.closeAllWindows)

Expand Down
19 changes: 11 additions & 8 deletions PyMca5/PyMcaGui/pymca/SumRulesTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,8 @@ def __init__(self, parent=None):
+'Depending on the tab, estimate either the pre/post\n'
+'edge regions and edge positions or the positions of\n'
+'the p, q and r markers.')
self.buttonEstimate.setShortcut(qt.Qt.CTRL+qt.Qt.Key_E)
self.buttonEstimate.setShortcut(\
qt.QKeySequence(qt.Qt.CTRL+qt.Qt.Key_E))
self.buttonEstimate.clicked.connect(self.estimate)
self.buttonEstimate.setEnabled(False)
self.plotWindow.toolBar.addSeparator()
Expand Down Expand Up @@ -868,37 +869,39 @@ def _createMenuBar(self):
ffile = menu.addMenu('&File')

openAction = qt.QAction('&Open Spec File', self)
openAction.setShortcut(qt.Qt.CTRL+qt.Qt.Key_O)
openAction.setShortcut(qt.QKeySequence(qt.Qt.CTRL+qt.Qt.Key_O))
openAction.setStatusTip('Opened file')
openAction.setToolTip('Opens a data file (*.spec)')
openAction.triggered.connect(self.loadData)

loadAction = qt.QAction('&Load Configuration', self)
loadAction.setShortcut(qt.Qt.CTRL+qt.Qt.Key_L)
loadAction.setShortcut(qt.QKeySequence(qt.Qt.CTRL+qt.Qt.Key_L))
loadAction.setStatusTip('Loaded analysis file')
loadAction.setToolTip('Loads an existing analysis file (*.sra)')
loadAction.triggered.connect(self.loadConfiguration)

saveConfAction = qt.QAction('&Save Configuration', self)
saveConfAction.setShortcut(qt.Qt.CTRL+qt.Qt.Key_S)
saveConfAction.setShortcut(qt.QKeySequence(qt.Qt.CTRL+qt.Qt.Key_S))
saveConfAction.setStatusTip('Saved analysis file')
saveConfAction.setToolTip('Save analysis in file (*.sra)')
saveConfAction.triggered.connect(self.saveConfiguration)

saveConfAsAction = qt.QAction('Save &Configuration as', self)
saveConfAsAction.setShortcut(qt.Qt.SHIFT+qt.Qt.CTRL+qt.Qt.Key_S)
saveConfAsAction.setShortcut(\
qt.QKeySequence(qt.Qt.SHIFT+qt.Qt.CTRL+qt.Qt.Key_S))
saveConfAsAction.setStatusTip('Saved analysis file')
saveConfAsAction.setToolTip('Save analysis in file (*.sra)')
saveConfAsAction.triggered.connect(self.saveConfigurationAs)

saveDataAction = qt.QAction('Save &Data', self)
saveDataAction.setShortcut(qt.Qt.CTRL+qt.Qt.Key_D)
saveDataAction.setShortcut(qt.QKeySequence(qt.Qt.CTRL+qt.Qt.Key_D))
saveDataAction.setStatusTip('Saved analysis file')
saveDataAction.setToolTip('Save analysis in file (*.sra)')
saveDataAction.triggered.connect(self.saveData)

saveDataAsAction = qt.QAction('Save D&ata as', self)
saveDataAsAction.setShortcut(qt.Qt.SHIFT+qt.Qt.CTRL+qt.Qt.Key_D)
saveDataAsAction.setShortcut(\
qt.QKeySequence(qt.Qt.SHIFT+qt.Qt.CTRL+qt.Qt.Key_D))
saveDataAsAction.setStatusTip('Saved analysis file')
saveDataAsAction.setToolTip('Save analysis in file (*.sra)')
saveDataAsAction.triggered.connect(self.saveDataAs)
Expand All @@ -925,7 +928,7 @@ def _createMenuBar(self):
hhelp = menu.addMenu('&Help')

showHelpFileAction = qt.QAction('Show &documentation', self)
showHelpFileAction.setShortcut(qt.Qt.Key_F1)
showHelpFileAction.setShortcut(qt.QKeySequence(qt.Qt.Key_F1))
showHelpFileAction.setStatusTip('')
showHelpFileAction.setToolTip('Opens the documentation (html-file) in the systems native web browser')
showHelpFileAction.triggered.connect(self.showInfoWindow)
Expand Down
12 changes: 6 additions & 6 deletions PyMca5/PyMcaPlugins/AdvancedAlignmentScanPlugin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#/*##########################################################################
# Copyright (C) 2004-2018 T. Rueter, V.A. Sole, European Synchrotron Radiation Facility
# Copyright (C) 2004-2019 T. Rueter, V.A. Sole, European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
Expand Down Expand Up @@ -173,26 +173,26 @@ def __init__(self, parent, ddict, llist, plugin):
buttonSave = qt.QPushButton('Save')
buttonSave.setToolTip('Shortcut: CTRL+S\n'
+'Save shifts to file')
buttonSave.setShortcut(qt.Qt.CTRL + qt.Qt.Key_S)
buttonSave.setShortcut(qt.QKeySequence(qt.Qt.CTRL + qt.Qt.Key_S))
buttonLoad = qt.QPushButton('Load')
buttonLoad.setToolTip('Shortcut: CTRL+O\n'
+'Load shifts from file')
buttonLoad.setShortcut(qt.Qt.CTRL + qt.Qt.Key_O)
buttonLoad.setShortcut(qt.QKeySequence(qt.Qt.CTRL + qt.Qt.Key_O))
buttonStore = qt.QPushButton('Store')
buttonStore.setToolTip('Shortcut: ALT+S\n'
+'Store shifts in memory.\n')
buttonStore.setShortcut(qt.Qt.ALT + qt.Qt.Key_S)
buttonStore.setShortcut(qt.QKeySequence(qt.Qt.ALT + qt.Qt.Key_S))
buttonApply = qt.QPushButton('Apply')
buttonApply.setToolTip('Shortcut: CTRL+Return\n'
+'Apply shift to curves present'
+' in the plot window')
buttonApply.setShortcut(qt.Qt.CTRL + qt.Qt.Key_Return)
buttonApply.setShortcut(qt.QKeySequence(qt.Qt.CTRL + qt.Qt.Key_Return))
buttonCancel = qt.QPushButton('Cancel')
buttonCancel.setToolTip('Shortcut: ESC\n'
+'Closes the window')
buttonCalc = qt.QPushButton('Calculate')
buttonCalc.setToolTip('Shortcut: F5')
buttonCalc.setShortcut(qt.Qt.Key_F5)
buttonCalc.setShortcut(qt.QKeySequence(qt.Qt.Key_F5))

# Table
self.shiftTab = qt.QTableWidget(nRows, nCols)
Expand Down
4 changes: 1 addition & 3 deletions PyMca5/tests/WidgetsInstantiationTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ def testShow(self):
from PyMca5.PyMcaGui.plotting import PyMcaPrintPreview
PyMcaPrintPreview.resetSingletonPrintPreview()

"""
class TestPyMcaMain(TestCaseQt):
def setUp(self):
super(TestPyMcaMain, self).setUp()
Expand All @@ -136,7 +135,6 @@ def testShow(self):
self.qapp.processEvents()
from PyMca5.PyMcaGui.plotting import PyMcaPrintPreview
PyMcaPrintPreview.resetSingletonPrintPreview()
"""

def getSuite(auto=True):
test_suite = unittest.TestSuite()
Expand Down Expand Up @@ -168,7 +166,7 @@ def runTest(self):
TestScanWindow,
TestMcaWindow,
TestMcaAdvancedFit,
#TestPyMcaMain,
TestPyMcaMain,
):
test_suite.addTest(
unittest.defaultTestLoader.loadTestsFromTestCase(TestCaseCls))
Expand Down
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VERSION 5.5.1

- PyMcaBatch: Deal with spaces in the path to the fit configuration file.

- Prevent start crash using PySide2.

VERSION 5.5.0
-------------

Expand Down

0 comments on commit e238a72

Please sign in to comment.