Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs #9043 Sorting out merge conflict with develop
Merge branch 'feature/9043_Refl_gui_Excel_style' into develop Conflicts: Code/Mantid/scripts/Interface/ui/reflectometer/refl_gui.py
- Loading branch information
Showing
6 changed files
with
456 additions
and
7 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
Code/Mantid/scripts/Interface/ui/reflectometer/refl_choose_col.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#This is an extension of refl_columns.py as that is a auto-generated script form pyqt and shouldn't be edited | ||
#so this file provides any extra GUI tweaks not easily doable in the designer | ||
#for the time being this also includes non-GUI behaviour | ||
import refl_columns | ||
from PyQt4 import QtCore, QtGui | ||
|
||
try: | ||
_fromUtf8 = QtCore.QString.fromUtf8 | ||
except AttributeError: | ||
_fromUtf8 = lambda s: s | ||
|
||
class ReflChoose(refl_columns.Ui_ChooseColumnsDialog): | ||
visiblestates = {} | ||
def setupUi(self, Dialog, ColHeaders, table): | ||
super(ReflChoose, self).setupUi(Dialog) | ||
self.visiblestates.clear() | ||
self.listColumns.itemChanged.connect(self.on_listColumns_itemChanged) | ||
self.buttonsColumns.clicked.connect(self.on_buttonsColumns_Clicked) | ||
for key, value in ColHeaders.iteritems(): | ||
header = table.horizontalHeaderItem(key).text() | ||
item = QtGui.QListWidgetItem(header) | ||
if value: | ||
item.setCheckState(2) | ||
else: | ||
item.setCheckState(0) | ||
self.listColumns.insertItem(key, item) | ||
def on_listColumns_itemChanged(self, item): | ||
colno=self.listColumns.row(item) | ||
self.visiblestates[colno] = (item.checkState() > 0) | ||
def on_buttonsColumns_Clicked(self, button): | ||
if self.buttonsColumns.button(QtGui.QDialogButtonBox.RestoreDefaults) == button: | ||
for i in range(self.listColumns.count()): | ||
self.listColumns.item(i).setCheckState(2) |
56 changes: 56 additions & 0 deletions
56
Code/Mantid/scripts/Interface/ui/reflectometer/refl_columns.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# Form implementation generated from reading ui file 'D:\mantid\windows\Code\Mantid\scripts\Interface\ui\reflectometer/refl_columns.ui' | ||
# | ||
# Created: Mon Mar 10 10:17:57 2014 | ||
# by: PyQt4 UI code generator 4.8.3 | ||
# | ||
# WARNING! All changes made in this file will be lost! | ||
|
||
from PyQt4 import QtCore, QtGui | ||
|
||
try: | ||
_fromUtf8 = QtCore.QString.fromUtf8 | ||
except AttributeError: | ||
_fromUtf8 = lambda s: s | ||
|
||
class Ui_ChooseColumnsDialog(object): | ||
def setupUi(self, ChooseColumnsDialog): | ||
ChooseColumnsDialog.setObjectName(_fromUtf8("ChooseColumnsDialog")) | ||
ChooseColumnsDialog.resize(231, 300) | ||
ChooseColumnsDialog.setSizeGripEnabled(False) | ||
self.verticalLayout = QtGui.QVBoxLayout(ChooseColumnsDialog) | ||
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) | ||
self.labelColumns = QtGui.QLabel(ChooseColumnsDialog) | ||
self.labelColumns.setObjectName(_fromUtf8("labelColumns")) | ||
self.verticalLayout.addWidget(self.labelColumns) | ||
self.layoutListButtons = QtGui.QHBoxLayout() | ||
self.layoutListButtons.setObjectName(_fromUtf8("layoutListButtons")) | ||
self.listColumns = QtGui.QListWidget(ChooseColumnsDialog) | ||
self.listColumns.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) | ||
self.listColumns.setSelectionMode(QtGui.QAbstractItemView.NoSelection) | ||
self.listColumns.setObjectName(_fromUtf8("listColumns")) | ||
self.layoutListButtons.addWidget(self.listColumns) | ||
self.buttonsColumns = QtGui.QDialogButtonBox(ChooseColumnsDialog) | ||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Expanding) | ||
sizePolicy.setHorizontalStretch(0) | ||
sizePolicy.setVerticalStretch(0) | ||
sizePolicy.setHeightForWidth(self.buttonsColumns.sizePolicy().hasHeightForWidth()) | ||
self.buttonsColumns.setSizePolicy(sizePolicy) | ||
self.buttonsColumns.setLayoutDirection(QtCore.Qt.LeftToRight) | ||
self.buttonsColumns.setOrientation(QtCore.Qt.Vertical) | ||
self.buttonsColumns.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok|QtGui.QDialogButtonBox.RestoreDefaults) | ||
self.buttonsColumns.setCenterButtons(False) | ||
self.buttonsColumns.setObjectName(_fromUtf8("buttonsColumns")) | ||
self.layoutListButtons.addWidget(self.buttonsColumns) | ||
self.verticalLayout.addLayout(self.layoutListButtons) | ||
|
||
self.retranslateUi(ChooseColumnsDialog) | ||
QtCore.QObject.connect(self.buttonsColumns, QtCore.SIGNAL(_fromUtf8("accepted()")), ChooseColumnsDialog.accept) | ||
QtCore.QObject.connect(self.buttonsColumns, QtCore.SIGNAL(_fromUtf8("rejected()")), ChooseColumnsDialog.reject) | ||
QtCore.QMetaObject.connectSlotsByName(ChooseColumnsDialog) | ||
|
||
def retranslateUi(self, ChooseColumnsDialog): | ||
ChooseColumnsDialog.setWindowTitle(QtGui.QApplication.translate("ChooseColumnsDialog", "Choose Columns...", None, QtGui.QApplication.UnicodeUTF8)) | ||
self.labelColumns.setText(QtGui.QApplication.translate("ChooseColumnsDialog", "Choose columns to display", None, QtGui.QApplication.UnicodeUTF8)) | ||
|
100 changes: 100 additions & 0 deletions
100
Code/Mantid/scripts/Interface/ui/reflectometer/refl_columns.ui
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>ChooseColumnsDialog</class> | ||
<widget class="QDialog" name="ChooseColumnsDialog"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>231</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Choose Columns...</string> | ||
</property> | ||
<property name="sizeGripEnabled"> | ||
<bool>false</bool> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QLabel" name="labelColumns"> | ||
<property name="text"> | ||
<string>Choose columns to display</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="layoutListButtons"> | ||
<item> | ||
<widget class="QListWidget" name="listColumns"> | ||
<property name="editTriggers"> | ||
<set>QAbstractItemView::NoEditTriggers</set> | ||
</property> | ||
<property name="selectionMode"> | ||
<enum>QAbstractItemView::NoSelection</enum> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QDialogButtonBox" name="buttonsColumns"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="layoutDirection"> | ||
<enum>Qt::LeftToRight</enum> | ||
</property> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="standardButtons"> | ||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set> | ||
</property> | ||
<property name="centerButtons"> | ||
<bool>false</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections> | ||
<connection> | ||
<sender>buttonsColumns</sender> | ||
<signal>accepted()</signal> | ||
<receiver>ChooseColumnsDialog</receiver> | ||
<slot>accept()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>248</x> | ||
<y>254</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>157</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>buttonsColumns</sender> | ||
<signal>rejected()</signal> | ||
<receiver>ChooseColumnsDialog</receiver> | ||
<slot>reject()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>316</x> | ||
<y>260</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>286</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
</connections> | ||
</ui> |
Oops, something went wrong.