-
Notifications
You must be signed in to change notification settings - Fork 2
Gm editors #24
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
Open
sampsonbryce
wants to merge
29
commits into
CDAT:master
Choose a base branch
from
sampsonbryce:gm_editors
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Gm editors #24
Changes from 24 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
adf9dba
working on implementing multiple gm editors
1534eff
Working on creating editors for graphics methods. fixed bugs with com…
4b6f68c
Added import as to variables list. Fixed bug in line editor. Added fl…
ae342bf
vector graphing now works much better.'
cebe1ee
vector graphing now works much better.'
a84b129
fixed bug when reopening boxfill editor
f2b6e96
multi line editing for isoline
70e2653
created my own dialog to implement proper validation for saving varia…
838e4a4
patched level editor to the point of working on isoline. still cant s…
61d7e91
fixed bug with random changeLine call
202d930
added multi text editor. fixed insert bug in multi line editor
da6a6ff
writing new tests for gm editors and reworking old tests
74b5f35
Initial commit for tests for multi editors for isoline gm
5158ec8
added projection editor
0628eef
tests for projection. Split custom vcs elements dialog into its own file
2ed93a5
fixed tests and refactored adding 'new' vcs var
a846bf8
Adding new gm implemented in side gm list
563ebd0
added the edit gm editor for gm list
17229d1
fixed stupid segfault and added remove gm and fixed updating gm vars …
0e34081
added remove var functionality and import file functionality
3af2e13
add, edit, and remove functionality works for template. Fixed small b…
626af68
fixed bugs with saving gm from gm dialog and edit_gm_dialog on sideba…
2c54f00
fixed level editor seg fault. createGM from dock fixed and tested
a4ba92c
fixing lots of bugs. hopefully their actually fixed
9a0e9c9
PR update. Added save ticks option
2b0fffa
fixed plotter and tests
a643900
fixed colormap editor and fixed part of legend editor to incorporate …
1d0bb69
fixed rename colormap
72465af
found stupid gosh darn off by one error in legend editor for missing …
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,75 @@ | ||
| from PySide import QtCore, QtGui | ||
|
|
||
|
|
||
| class AccessableButtonDialog(QtGui.QWidget): | ||
| accepted = QtCore.Signal() | ||
| rejected = QtCore.Signal() | ||
|
|
||
| def __init__(self): | ||
| super(AccessableButtonDialog, self).__init__() | ||
|
|
||
| self.setWindowModality(QtCore.Qt.ApplicationModal) | ||
| shortcut = QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Escape), self) | ||
| shortcut.activated.connect(self.cancel) | ||
|
|
||
| self.save_button = QtGui.QPushButton('Save') | ||
| self.save_button.clicked.connect(self.save) | ||
| self.save_button.setEnabled(False) | ||
| self.save_button.setDefault(True) | ||
| self.cancel_button = QtGui.QPushButton('Cancel') | ||
| self.cancel_button.clicked.connect(self.cancel) | ||
|
|
||
| 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 cancel(self): | ||
| self.close() | ||
| self.rejected.emit() | ||
|
|
||
| def save(self): | ||
| self.close() | ||
| self.accepted.emit() | ||
|
|
||
|
|
||
| class ValidatingInputDialog(AccessableButtonDialog): | ||
| def __init__(self): | ||
| super(ValidatingInputDialog, self).__init__() | ||
|
|
||
| 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.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) | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,36 @@ | ||
| from cdatgui.bases.input_dialog import ValidatingInputDialog | ||
| from PySide import QtCore, QtGui | ||
| import vcs | ||
|
|
||
|
|
||
| class VcsElementsDialog(ValidatingInputDialog): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. VCSElementsDialog* |
||
| def __init__(self, element): | ||
| super(VcsElementsDialog, self).__init__() | ||
| self.element = element | ||
| self.setValidator(VcsElementsValidator()) | ||
|
|
||
| def save(self): | ||
| if self.textValue() in vcs.elements[self.element]: | ||
| check = QtGui.QMessageBox.question(self, "Overwrite {0}?".format(self.element), | ||
| "{0} '{1}' already exists. Overwrite?".format(self.element.capitalize(), self.textValue()), | ||
| buttons=QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel) | ||
| if check == QtGui.QDialogButtonBox.FirstButton: | ||
| self.close() | ||
| self.accepted.emit() | ||
| else: | ||
| self.close() | ||
| self.accepted.emit() | ||
|
|
||
|
|
||
| class VcsElementsValidator(QtGui.QValidator): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. VCSElementsValidator* |
||
| invalidInput = QtCore.Signal() | ||
| validInput = QtCore.Signal() | ||
|
|
||
| def validate(self, inp, pos): | ||
| inp = inp.strip() | ||
| if not inp or inp == 'default': | ||
| self.invalidInput.emit() | ||
| return QtGui.QValidator.Intermediate | ||
|
|
||
| self.validInput.emit() | ||
| return QtGui.QValidator.Acceptable | ||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accessible*