Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown #34

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
adf9dba
working on implementing multiple gm editors
Apr 14, 2016
1534eff
Working on creating editors for graphics methods. fixed bugs with com…
Apr 15, 2016
4b6f68c
Added import as to variables list. Fixed bug in line editor. Added fl…
Apr 19, 2016
ae342bf
vector graphing now works much better.'
Apr 19, 2016
cebe1ee
vector graphing now works much better.'
Apr 19, 2016
a84b129
fixed bug when reopening boxfill editor
Apr 19, 2016
f2b6e96
multi line editing for isoline
Apr 21, 2016
70e2653
created my own dialog to implement proper validation for saving varia…
Apr 22, 2016
838e4a4
patched level editor to the point of working on isoline. still cant s…
Apr 22, 2016
61d7e91
fixed bug with random changeLine call
Apr 26, 2016
202d930
added multi text editor. fixed insert bug in multi line editor
Apr 27, 2016
da6a6ff
writing new tests for gm editors and reworking old tests
Apr 28, 2016
74b5f35
Initial commit for tests for multi editors for isoline gm
Apr 28, 2016
5158ec8
added projection editor
Apr 29, 2016
0628eef
tests for projection. Split custom vcs elements dialog into its own file
May 2, 2016
2ed93a5
fixed tests and refactored adding 'new' vcs var
May 3, 2016
a846bf8
Adding new gm implemented in side gm list
May 4, 2016
563ebd0
added the edit gm editor for gm list
May 4, 2016
17229d1
fixed stupid segfault and added remove gm and fixed updating gm vars …
May 5, 2016
0e34081
added remove var functionality and import file functionality
May 6, 2016
3af2e13
add, edit, and remove functionality works for template. Fixed small b…
May 6, 2016
626af68
fixed bugs with saving gm from gm dialog and edit_gm_dialog on sideba…
May 9, 2016
2c54f00
fixed level editor seg fault. createGM from dock fixed and tested
May 10, 2016
a4ba92c
fixing lots of bugs. hopefully their actually fixed
May 11, 2016
d774ec7
added monthly and seasonal climatology. broken test though
May 12, 2016
f227138
Added regrid to edit data menu for manipulations
May 12, 2016
4827917
added averager. everything seems to work. you can make some seriously…
May 13, 2016
9df48ee
reworked the variable editor for circular axis
May 17, 2016
c08917e
added slider to adjust frame.
May 18, 2016
2231077
sorta almost done with variable editor. (famous last words)
May 18, 2016
8839d78
fixed all sliders for var editor. (Dont touch it works just leave it …
May 19, 2016
2564f3e
removed select ROI functionality
May 19, 2016
fb79b22
cleaned up comments and docstring
May 19, 2016
8876f91
added summation functionality
May 20, 2016
8f638f9
added STD manipulation
May 20, 2016
db2b592
safety commit before removing accessing most manipulations from varia…
May 24, 2016
204535c
added all manipulations
May 25, 2016
b0791c9
Added squeeze(partially broken. issue submitted). Added ANNUALCYCLE. …
May 25, 2016
c331644
fixed broken tests
May 25, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cdatgui/bases/background_delegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def paint(self, painter, option, index):
painter.fillRect(option.rect, bg)
super(BorderHighlightStyleDelegate, self).paint(painter, option, index)
if option.state & QtGui.QStyle.State_Selected:
painter.save()
painter.accept()
color = QtGui.QColor(76, 177 ,255)
pen = QtGui.QPen(color, 2, QtCore.Qt.SolidLine, QtCore.Qt.SquareCap, QtCore.Qt.MiterJoin)
w = pen.width() / 2
Expand Down
10 changes: 6 additions & 4 deletions cdatgui/bases/dynamic_grid_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def buildGrid(self, rect, force=False):
return

# clearing
self.clearWidget()
self.clearWidgets()

# calculate
full_columns = possible_columns - 1
Expand Down Expand Up @@ -77,8 +77,8 @@ def buildGrid(self, rect, force=False):

self.cur_col_count = possible_columns

def clearWidget(self):
"""clears widgets from the grid layout. Does not delete widgets"""
def clearWidgets(self):
"""Clears widgets from the grid layout. Does not delete widgets"""
for col, row_count in enumerate(self.counts):
if row_count:
for row in range(row_count):
Expand All @@ -93,7 +93,9 @@ def getWidgets(self):
return self.widgets

def removeWidget(self, widget):
"""removes widgets from gridlayout and updates list and counts"""
"""Removes widgets from gridlayout and updates list and counts
Does Not Delete Widget
"""
for i in self.widgets:
if i == widget:

Expand Down
75 changes: 75 additions & 0 deletions cdatgui/bases/input_dialog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
from PySide import QtCore, QtGui


class AccessibleButtonDialog(QtGui.QWidget):
accepted = QtCore.Signal()
rejected = QtCore.Signal()

def __init__(self, parent=None):
super(AccessibleButtonDialog, self).__init__(parent=parent)

self.setWindowModality(QtCore.Qt.ApplicationModal)
shortcut = QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Escape), self)
shortcut.activated.connect(self.reject)

self.save_button = QtGui.QPushButton('Save')
self.save_button.clicked.connect(self.accept)
self.save_button.setDefault(True)
self.cancel_button = QtGui.QPushButton('Cancel')
self.cancel_button.clicked.connect(self.reject)

save_cancel_layout = QtGui.QHBoxLayout()
save_cancel_layout.addWidget(self.cancel_button)
save_cancel_layout.addWidget(self.save_button)

self.vertical_layout = QtGui.QVBoxLayout()
self.vertical_layout.addLayout(save_cancel_layout)

self.setLayout(self.vertical_layout)

self.setMaximumSize(300, 100)

def reject(self):
self.close()
self.rejected.emit()

def accept(self):
self.close()
self.accepted.emit()


class ValidatingInputDialog(AccessibleButtonDialog):
def __init__(self, parent=None):
super(ValidatingInputDialog, self).__init__(parent=parent)

self.label = QtGui.QLabel()
self.edit = QtGui.QLineEdit()

self.edit.returnPressed.connect(self.save_button.click)

edit_line_layout = QtGui.QHBoxLayout()
edit_line_layout.addWidget(self.label)
edit_line_layout.addWidget(self.edit)

self.vertical_layout.insertLayout(0, edit_line_layout)

self.save_button.setEnabled(False)
self.edit.setFocus()

def setLabelText(self, text):
self.label.setText(text)

def setValidator(self, validator):
self.edit.setValidator(validator)

try:
validator.invalidInput.connect(lambda: self.save_button.setEnabled(False))
validator.validInput.connect(lambda: self.save_button.setEnabled(True))
except AttributeError:
pass

def textValue(self):
return self.edit.text().strip()

def setTextValue(self, text):
self.edit.setText(text)
5 changes: 3 additions & 2 deletions cdatgui/bases/list_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def replace(self, index, value):
self.dataChanged.emit(ind, ind)

def remove(self, ind):
self.removeRows(ind, 1)
return self.removeRows(ind, 1)

def clear(self):
self.removeRows(0, len(self.values))
Expand All @@ -40,9 +40,10 @@ def insertRows(self, row, count, values, parent=QtCore.QModelIndex()):
self.endInsertRows()

def removeRows(self, row, count, parent=QtCore.QModelIndex()):
self.beginRemoveRows(parent, row, row + count)
self.beginRemoveRows(parent, row, row + count - 1)
self.values = self.values[:row] + self.values[row + count:]
self.endRemoveRows()
return True

def rowCount(self, modelIndex=None):
return len(self.values)
Expand Down
Loading