Skip to content

Commit

Permalink
Final wordsub fixes before 0.2!
Browse files Browse the repository at this point in the history
  • Loading branch information
LegoStormtroopr committed Sep 30, 2013
1 parent ad38719 commit 87a7867
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 26 deletions.
22 changes: 22 additions & 0 deletions Canard.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- mode: python -*-
a = Analysis(['canard_main.py'],
pathex=['C:\\Users\\theodore\\Documents\\GitHub\\canard'],
hiddenimports=[],
hookspath=None,
runtime_hooks=None)
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='Canard.exe',
debug=False,
strip=None,
upx=True,
console=False , icon='icons\\Canard_icon.ico')
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=None,
upx=True,
name='Canard')
20 changes: 11 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ widgets:
pyrcc4 icons/canard.qrc -o SQBLWidgets/sqblUI/canard_rc.py

prepExe:
cp -r icons dist/dist/canard_main/
rm dist/dist/canard_main/icons/Canard_icon.ico
cp -r images dist/dist/canard_main/
mkdir dist/dist/canard_main/roxy
cp -r ../roxy-sqbl-instrument-creator/* dist/dist/canard_main/roxy/
mkdir dist/dist/canard_main/sqbl
cp -r ../sqbl-schema/Schemas/* dist/dist/canard_main/sqbl/
mkdir dist/dist/canard_main/examples
cp -r ../sqbl-schema/Tests/* dist/dist/canard_main/examples
cp -r icons dist/Canard/
rm dist/Canard/icons/Canard_icon.ico
cp -r images dist/Canard/
mkdir dist/Canard/roxy
cp -r ../roxy-sqbl-instrument-creator/* dist/Canard/roxy/
mkdir dist/Canard/sqbl
cp -r ../sqbl-schema/Schemas/* dist/Canard/sqbl/
mkdir dist/Canard/examples
cp -r ../sqbl-schema/Tests/* dist/Canard/examples
mkdir dist/Canard/plugins
cp -r ./plugins/* dist/Canard/plugins

24 changes: 9 additions & 15 deletions SQBLWidgets/SQBLWidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,18 +646,12 @@ def addRow(self):
# Add the new condition to the XML
sg = self.parent.element.append(newCond)

# IF there is only one column and is the empty default one, delete it.
#if self.rowCount() == 1 and self.horizontalHeaderItem(0) is not None:
# self.removeRow(0)

row = self.rowCount()

self.insertRow(row)
for cols,questionID in enumerate(self.parent.questions):
# Add the offset for the branch at the start
editor = self.makeCellPair(cols,str(questionID))

self.setCellWidget(row,cols,editor)
for col,questionID in enumerate(self.parent.questions):
editor = self.makeCellPair(row,str(questionID))
self.setCellWidget(row,col,editor)

def addCol(self,questionID):
# Is the question already present
Expand All @@ -667,7 +661,7 @@ def addCol(self,questionID):
self.insertColumn(col)
self.setHorizontalHeaderItem(col,QtGui.QTableWidgetItem(questionID+" "))
for row in range(0,self.rowCount()):
editor = self.makeCellPair(col,str(questionID))
editor = self.makeCellPair(row,str(questionID))
self.setCellWidget(row,col,editor)

class ConditionalTree(SQBLNamedWidget, sqblUI.conditionalTree.Ui_Form):
Expand Down Expand Up @@ -965,15 +959,15 @@ def canInsertFromMimeData(q,s=UiField):
if q.hasFormat("text/xml+x-sqbl+wordsub"):
return True
else:
QtGui.QTextEdit.canInsertFromMimeData(q, event)
QtGui.QTextEdit.canInsertFromMimeData(s,q)
UiField.canInsertFromMimeData = canInsertFromMimeData

def insertFromMimeData(q,s=UiField):
if q.hasFormat("text/xml+x-sqbl+wordsub"):
insert = str(q.data('text/xml+x-sqbl+wordsub'))
s.insertPlainText(insert)
else:
QtGui.QTextEdit.insertFromMimeData(q, event)
QtGui.QTextEdit.insertFromMimeData(s,q)
UiField.insertFromMimeData = insertFromMimeData
SQBLutil.XMLHighlighter(UiField.document())

Expand Down Expand Up @@ -1074,7 +1068,7 @@ def __init__(self,element,model):
class StatementText(SQBLTextComponentObject, sqblUI.statementText.Ui_Form):
def __init__(self,element,model):
SQBLTextComponentObject.__init__(self,element,model)
self.connect(self.statementText,"StatementText")
self.connect(self.statementText,"StatementText",richtext=True)

# Reusable by widgets for all 'NogicNodes', eg. Conditionals, Loops, etc...
class LogicNodeText(SQBLTextComponentObject, sqblUI.logicNodeText.Ui_Form):
Expand Down Expand Up @@ -1143,8 +1137,8 @@ def __init__(self,element,model):
def enableConditionButtons(self): self.updateConditionButtons(True)
def disableConditionButtons(self): self.updateConditionButtons(False)
def updateConditionButtons(self,enabled=True):
self.addCondition.setEnabled(enabled)
self.removeCondition.setEnabled(enabled)
self.addCondition.setEnabled(enabled)
self.removeCondition.setEnabled(enabled)

def updateTagName(self,text):
lang = self.languages.itemData(self.languages.currentIndex()).toPyObject()
Expand Down
2 changes: 1 addition & 1 deletion canard_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from SQBLWidgets.SQBLmodel import _ns

VERSION = "0.1.0B"
VERSION = "0.2.0B"
CRITICAL_SIZE = 50 # Number of nodes before refreshes get slow.

_APPWINDOWTITLE = "Canard Question Module Editor"
Expand Down
2 changes: 1 addition & 1 deletion ui/wordSub.ui
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<string notr="true">* {font-size:8pt; }</string>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Drag questions to the left add rows, drag branches to the top add columns, right click on row or column headings to remove them.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Drag questions from the components tree to the top header to add new columns.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
Expand Down

0 comments on commit 87a7867

Please sign in to comment.