2b9c3b6a
—
pyros2097 13 years ago
v0.60 Added new font chooser in menu Added new progress bar and status update Added stop for functions
- Widget/adb.py +16 -43
- Widget/adb.pyc +0 -0
- Widget/ant.py +41 -39
- Widget/command.py +6 -4
- Widget/dialogs.py +81 -27
- Widget/editor.py +35 -10
- Widget/editor.pyc +0 -0
- Widget/lexersquirrel.py +20 -24
- Widget/parser.py +4 -0
- Widget/tab.py +1 -0
- Widget/tab.pyc +0 -0
- Widget/tool.py +72 -8
- Widget/tree.py +158 -6
- Widget/tree.pyc +0 -0
- build/exe.win32-2.7/Sabel.exe +0 -0
- build/exe.win32-2.7/Sabel.zip +0 -0
- build/exe.win32-2.7/config.yml +17 -8
- build/exe.win32-2.7/library.zip +0 -0
- config.py +16 -0
- config.yml +15 -10
- cx.py +1 -1
- globals.py +4 -1
- main.py +1 -1
- mainwindow.py +13 -5
- window.py +171 -57
Widget/adb.py
CHANGED
|
@@ -9,7 +9,6 @@ class Adb(QWidget):
|
|
|
9
9
|
QWidget.__init__(self,parent)
|
|
10
10
|
self.parent = parent
|
|
11
11
|
self.adb_thread = WorkThread()
|
|
12
|
-
self.timer = QTimer()
|
|
13
12
|
self.adblist = config.adb()
|
|
14
13
|
self.device = ""
|
|
15
14
|
self.setDevice()
|
|
@@ -17,40 +16,6 @@ class Adb(QWidget):
|
|
|
17
16
|
self.connect(self.adb_thread, SIGNAL("update"),self.update)
|
|
18
17
|
self.connect(self.adb_thread, SIGNAL("fini"),self.newstart)
|
|
19
18
|
#self.connect(self.timer , SIGNAL('timeout()') , self.onTimeout)
|
|
20
|
-
#self.connect(self.adb_thread , SIGNAL('started()') , self.onThreadStarted)
|
|
21
|
-
#self.connect(self.adb_thread , SIGNAL('finished()'), self.onThreadFinished)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def onTimeout(self):
|
|
25
|
-
print "timeout"
|
|
26
|
-
"""
|
|
27
|
-
# Update the progress bar
|
|
28
|
-
value = self.pbar.value()
|
|
29
|
-
# Going forward or backwards?
|
|
30
|
-
if self.pbar.invertedAppearance():
|
|
31
|
-
if value-2 < self.pbar.minimum():
|
|
32
|
-
self.pbar.setValue(self.pbar.minimum())
|
|
33
|
-
self.pbar.setInvertedAppearance(False)
|
|
34
|
-
else:
|
|
35
|
-
self.pbar.setValue(value-2)
|
|
36
|
-
else:
|
|
37
|
-
if value+2 > self.pbar.maximum():
|
|
38
|
-
self.pbar.setValue(self.pbar.maximum())
|
|
39
|
-
self.pbar.setInvertedAppearance(True)
|
|
40
|
-
else:
|
|
41
|
-
self.pbar.setValue(value+2)
|
|
42
|
-
"""
|
|
43
|
-
|
|
44
|
-
def onThreadStarted(self):
|
|
45
|
-
print "Thread has been started"
|
|
46
|
-
self.timer.start(10)
|
|
47
|
-
#self.enableButtons(False)
|
|
48
|
-
|
|
49
|
-
def onThreadFinished(self):
|
|
50
|
-
print "Thread has finished"
|
|
51
|
-
self.timer.stop()
|
|
52
|
-
#self.enableButtons(True)
|
|
53
|
-
#self.pbar.setValue(0)
|
|
54
19
|
|
|
55
20
|
def setDevice(self):
|
|
56
21
|
if(config.device() == 1):
|
|
@@ -75,25 +40,34 @@ class Adb(QWidget):
|
|
|
75
40
|
self.parent.textEdit.append(line)
|
|
76
41
|
|
|
77
42
|
def checkFinished(self,no,cmd):
|
|
43
|
+
self.parent.progressStop()
|
|
78
44
|
if(no == 0):
|
|
79
|
-
self.parent.textEdit.append("
|
|
45
|
+
self.parent.textEdit.append("Finished: "+cmd)
|
|
80
46
|
else:
|
|
81
|
-
self.parent.textEdit.append("Error
|
|
47
|
+
self.parent.textEdit.append("Error: "+cmd)
|
|
82
48
|
|
|
83
49
|
def newstart(self,no,cmd):
|
|
84
50
|
self.checkFinished(no, cmd)
|
|
51
|
+
self.parent.progressStart()
|
|
85
52
|
if(cmd == self.cmd1):
|
|
86
53
|
self.adb_thread.setCmd(self.cmd2)
|
|
87
54
|
self.adb_thread.run()
|
|
88
55
|
elif(cmd == self.cmd2):
|
|
89
56
|
self.adb_thread.setCmd(self.cmd3)
|
|
57
|
+
self.parent.progressStop()
|
|
90
58
|
self.adb_thread.run2()
|
|
91
59
|
elif(cmd == self.cmd3):
|
|
92
60
|
self.adb_thread.setCmd(self.cmd4)
|
|
93
61
|
self.adb_thread.run()
|
|
94
62
|
elif(cmd == self.cmd4):
|
|
95
63
|
self.adb_thread.setCmd(self.cmd5)
|
|
96
|
-
self.adb_thread.run()
|
|
64
|
+
self.adb_thread.run()
|
|
65
|
+
elif(cmd == self.cmd5):
|
|
66
|
+
if not(self.parent.tabWidget_3.isHidden()):
|
|
67
|
+
self.parent.tabWidget_3.hide()
|
|
68
|
+
self.parent.toolBar.action_Run.setEnabled(True)
|
|
69
|
+
self.parent.progressStop()
|
|
70
|
+
self.parent.statusWriting()
|
|
97
71
|
|
|
98
72
|
def run(self):
|
|
99
73
|
if self.isRunning == False:
|
|
@@ -106,17 +80,16 @@ class Adb(QWidget):
|
|
|
106
80
|
self.parent.textEdit.clear()
|
|
107
81
|
self.parent.textEdit.append("Pushing main.nut...\n")
|
|
108
82
|
self.adb_thread.setCmd(self.cmd1)
|
|
83
|
+
self.parent.statusRunning()
|
|
84
|
+
self.parent.progressStart()
|
|
109
|
-
self.adb_thread.run()
|
|
85
|
+
self.adb_thread.run()
|
|
110
|
-
|
|
111
86
|
|
|
112
87
|
def stop(self):
|
|
113
88
|
if self.isRunning == True:
|
|
114
89
|
self.isRunning = False
|
|
115
90
|
self.parent.toolBar.action_Stop.setDisabled(True)
|
|
116
91
|
self.parent.textEdit.append("Stopped.")
|
|
117
|
-
if not(self.parent.tabWidget_3.isHidden()):
|
|
118
|
-
|
|
92
|
+
self.parent.statusStopping()
|
|
119
|
-
self.parent.toolBar.action_Run.setEnabled(True)
|
|
120
93
|
self.adb_thread.close_process()
|
|
121
94
|
#"adb -d shell ps | grep "+adblist[3]+" | awk '{print $2}' | xargs adbshell kill")
|
|
122
95
|
#adb -d shell ps | grep com.emo_framework.examples | awk '{print $2}' | xargs adb shell kill
|
Widget/adb.pyc
CHANGED
|
Binary file
|
Widget/ant.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
from globals import ospathjoin
|
|
1
|
+
from globals import ospathjoin,config
|
|
2
|
-
from PyQt4.QtGui import QWidget
|
|
2
|
+
from PyQt4.QtGui import QWidget,QMessageBox
|
|
3
3
|
from PyQt4.QtCore import pyqtSignal,SIGNAL,QThread,QProcess,QString,QTimer
|
|
4
4
|
from workthread import WorkThread
|
|
5
5
|
|
|
@@ -8,53 +8,42 @@ class Ant(QWidget):
|
|
|
8
8
|
def __init__(self,parent):
|
|
9
9
|
QWidget.__init__(self,parent)
|
|
10
10
|
self.parent = parent
|
|
11
|
+
self.setAntList()
|
|
11
12
|
self.ant_thread = WorkThread()
|
|
12
13
|
self.timer = QTimer()
|
|
13
14
|
#self.ant_thread = antThread()
|
|
14
15
|
self.connect(self.ant_thread, SIGNAL("update"),self.update)
|
|
15
16
|
self.connect(self.ant_thread, SIGNAL("fini"),self.newstart)
|
|
16
|
-
|
|
17
|
+
self.connect(self.timer , SIGNAL('timeout()') , self.onTimeout)
|
|
17
18
|
#self.connect(self.ant_thread , SIGNAL('started()') , self.onThreadStarted)
|
|
18
19
|
#self.connect(self.ant_thread , SIGNAL('finished()'), self.onThreadFinished)
|
|
19
20
|
|
|
20
21
|
def onTimeout(self):
|
|
21
22
|
print "timeout"
|
|
22
|
-
"""
|
|
23
|
-
# Update the progress bar
|
|
24
|
-
value = self.pbar.value()
|
|
25
|
-
# Going forward or backwards?
|
|
26
|
-
if self.pbar.invertedAppearance():
|
|
27
|
-
if value-2 < self.pbar.minimum():
|
|
28
|
-
self.pbar.setValue(self.pbar.minimum())
|
|
29
|
-
self.pbar.setInvertedAppearance(False)
|
|
30
|
-
else:
|
|
31
|
-
self.pbar.setValue(value-2)
|
|
32
|
-
else:
|
|
33
|
-
if value+2 > self.pbar.maximum():
|
|
34
|
-
self.pbar.setValue(self.pbar.maximum())
|
|
35
|
-
self.pbar.setInvertedAppearance(True)
|
|
36
|
-
else:
|
|
37
|
-
self.pbar.setValue(value+2)
|
|
38
|
-
"""
|
|
39
|
-
|
|
40
|
-
def onThreadStarted(self):
|
|
41
|
-
print "Thread has been started"
|
|
42
|
-
self.timer.start(10)
|
|
43
|
-
#self.enableButtons(False)
|
|
44
|
-
|
|
45
|
-
def onThreadFinished(self):
|
|
46
|
-
print "Thread has finished"
|
|
47
|
-
self.timer.stop()
|
|
48
|
-
#self.enableButtons(True)
|
|
49
|
-
#self.pbar.setValue(0)
|
|
50
23
|
|
|
51
24
|
def update(self,line):
|
|
52
25
|
self.parent.textEdit.append(line)
|
|
53
26
|
|
|
27
|
+
def setAntList(self):
|
|
28
|
+
self.antlist = config.ant()
|
|
29
|
+
self.cmd1 = self.antlist[0]
|
|
30
|
+
self.cmd2 = self.antlist[1]
|
|
31
|
+
self.cmd3 = self.antlist[2]
|
|
32
|
+
self.cmd4 = self.antlist[3]
|
|
33
|
+
self.cmd5 = self.antlist[4]
|
|
34
|
+
|
|
54
|
-
def
|
|
35
|
+
def checkFinished(self,no,cmd):
|
|
36
|
+
if(no == 0):
|
|
37
|
+
#QMessageBox.about(self,"Error","Finished: "+cmd)
|
|
55
|
-
|
|
38
|
+
self.parent.textEdit.append("Finished: "+cmd)
|
|
39
|
+
else:
|
|
56
|
-
|
|
40
|
+
self.parent.textEdit.append("Error: "+cmd)
|
|
57
41
|
|
|
42
|
+
def newstart(self,no,cmd):
|
|
43
|
+
self.checkFinished(no, cmd)
|
|
44
|
+
self.parent.progressStop()
|
|
45
|
+
self.parent.statusWriting()
|
|
46
|
+
|
|
58
47
|
def showOutput(self):
|
|
59
48
|
if(self.parent.tabWidget_3.isHidden()):
|
|
60
49
|
self.parent.tabWidget_3.show()
|
|
@@ -66,7 +55,9 @@ class Ant(QWidget):
|
|
|
66
55
|
self.showOutput()
|
|
67
56
|
self.parent.textEdit.clear()
|
|
68
57
|
self.parent.textEdit.append("Creating... "+prj.getPath())
|
|
69
|
-
self.ant_thread.setCmd(
|
|
58
|
+
self.ant_thread.setCmd(self.cmd1+" "+prj.getPath())
|
|
59
|
+
self.parent.progressStart()
|
|
60
|
+
self.parent.statusCreating()
|
|
70
61
|
self.ant_thread.run()
|
|
71
62
|
|
|
72
63
|
def build(self,prj):
|
|
@@ -75,7 +66,9 @@ class Ant(QWidget):
|
|
|
75
66
|
self.showOutput()
|
|
76
67
|
self.parent.textEdit.clear()
|
|
77
68
|
self.parent.textEdit.append("Ant Building Debug... "+ospathjoin(prj.getPath(),"build.xml"))
|
|
78
|
-
self.ant_thread.setCmd(
|
|
69
|
+
self.ant_thread.setCmd(self.cmd2+" "+ospathjoin(prj.getPath(),"build.xml"))
|
|
70
|
+
self.parent.progressStart()
|
|
71
|
+
self.parent.statusBuilding()
|
|
79
72
|
self.ant_thread.run()
|
|
80
73
|
|
|
81
74
|
def clean(self,prj):
|
|
@@ -84,7 +77,9 @@ class Ant(QWidget):
|
|
|
84
77
|
self.showOutput()
|
|
85
78
|
self.parent.textEdit.clear()
|
|
86
79
|
self.parent.textEdit.append("Ant Cleaning... "+prj.getPath())
|
|
87
|
-
self.ant_thread.setCmd(
|
|
80
|
+
self.ant_thread.setCmd(self.cmd5+" "+ospathjoin(prj.getPath(),"build.xml"))
|
|
81
|
+
self.parent.progressStart()
|
|
82
|
+
self.parent.statusCleaning()
|
|
88
83
|
self.ant_thread.run()
|
|
89
84
|
|
|
90
85
|
def buildRun(self,prj):
|
|
@@ -93,7 +88,8 @@ class Ant(QWidget):
|
|
|
93
88
|
self.showOutput()
|
|
94
89
|
self.parent.textEdit.clear()
|
|
95
90
|
self.parent.textEdit.append("Ant Building and Installing... "+ospathjoin(prj.getPath(),"build.xml"))
|
|
96
|
-
self.ant_thread.setCmd(
|
|
91
|
+
self.ant_thread.setCmd(self.cmd4+" "+ospathjoin(prj.getPath(),"build.xml"))
|
|
92
|
+
self.parent.progressStart()
|
|
97
93
|
self.ant_thread.run()
|
|
98
94
|
|
|
99
95
|
def run(self,prj):
|
|
@@ -102,9 +98,15 @@ class Ant(QWidget):
|
|
|
102
98
|
self.showOutput()
|
|
103
99
|
self.parent.textEdit.clear()
|
|
104
100
|
self.parent.textEdit.append("Installing... "+prj.getPath())
|
|
105
|
-
self.ant_thread.setCmd(
|
|
101
|
+
self.ant_thread.setCmd(self.cmd3+" "+ospathjoin(prj.getPath(),"build.xml"))
|
|
102
|
+
self.parent.progressStart()
|
|
103
|
+
self.parent.statusInstalling()
|
|
106
104
|
self.ant_thread.run()
|
|
107
105
|
|
|
106
|
+
def kill(self):
|
|
107
|
+
self.ant_thread.kill_process()
|
|
108
|
+
self.ant_thread.close_process()
|
|
109
|
+
|
|
108
110
|
def close(self):
|
|
109
111
|
self.ant_thread.kill_process()
|
|
110
112
|
self.ant_thread.close_process()
|
Widget/command.py
CHANGED
|
@@ -26,12 +26,12 @@ class Command(QWidget):
|
|
|
26
26
|
self.run()
|
|
27
27
|
|
|
28
28
|
def finished(self,no,cmd):
|
|
29
|
+
self.parent.progressStop()
|
|
30
|
+
self.parent.statusWriting()
|
|
29
31
|
if(no == 0):
|
|
30
|
-
self.parent.textEdit.append("Finished")
|
|
32
|
+
self.parent.textEdit.append("Finished: "+cmd)
|
|
31
|
-
self.parent.textEdit.append(cmd)
|
|
32
33
|
else:
|
|
33
|
-
self.parent.textEdit.append("Error
|
|
34
|
+
self.parent.textEdit.append("Error: "+cmd)
|
|
34
|
-
self.parent.textEdit.append(cmd)
|
|
35
35
|
|
|
36
36
|
def update(self,line):
|
|
37
37
|
self.parent.textEdit.append(line)
|
|
@@ -42,6 +42,8 @@ class Command(QWidget):
|
|
|
42
42
|
|
|
43
43
|
def run(self):
|
|
44
44
|
self.cmdThread.setCmd(self.cmd)
|
|
45
|
+
self.parent.progressStart()
|
|
46
|
+
self.parent.statusCommand()
|
|
45
47
|
self.cmdThread.run()
|
|
46
48
|
|
|
47
49
|
def close(self):
|
Widget/dialogs.py
CHANGED
|
@@ -2,7 +2,7 @@ from PyQt4 import QtGui
|
|
|
2
2
|
from PyQt4 import QtCore
|
|
3
3
|
from globals import config
|
|
4
4
|
from globals import PY_VERSION,__version__,OS_NAME,Icons
|
|
5
|
-
from
|
|
5
|
+
from tree import BrowseTree
|
|
6
6
|
|
|
7
7
|
class DialogAndroid(QtGui.QDialog):
|
|
8
8
|
def __init__(self, parent):
|
|
@@ -67,7 +67,6 @@ class DialogAndroid(QtGui.QDialog):
|
|
|
67
67
|
self.buttonBox.setGeometry(QtCore.QRect(40, 370, 341, 32))
|
|
68
68
|
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
|
69
69
|
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
|
|
70
|
-
self.buttonBox.setObjectName(("buttonBox"))
|
|
71
70
|
self.tabWidget.setCurrentIndex(1)
|
|
72
71
|
self.setWindowTitle("Tools")
|
|
73
72
|
self.label_2.setText("Push Main File:")
|
|
@@ -79,13 +78,24 @@ class DialogAndroid(QtGui.QDialog):
|
|
|
79
78
|
self.lineEdit_3.setText(config.adb()[1])
|
|
80
79
|
self.lineEdit_4.setText(config.adb()[2])
|
|
81
80
|
self.lineEdit_5.setText(config.adb()[3])
|
|
82
|
-
self.fileButton.clicked.connect(self.
|
|
81
|
+
self.fileButton.clicked.connect(self.showBrowse)
|
|
82
|
+
self.browsedialog = DialogBrowse(self)
|
|
83
|
+
self.browsedialog.tree.itemDoubleClicked.connect(self.getName)
|
|
83
84
|
|
|
85
|
+
def getName(self,item):
|
|
86
|
+
if(item.isFile()):
|
|
87
|
+
if(item.isDoc()):
|
|
88
|
+
self.browsedialog.accept()
|
|
89
|
+
self.getFile(item.getPath())
|
|
90
|
+
|
|
91
|
+
def showBrowse(self):
|
|
92
|
+
self.browsedialog.show()
|
|
84
93
|
|
|
85
|
-
def getFile(self):
|
|
94
|
+
def getFile(self,fname = ""):
|
|
86
|
-
fname = str(QtGui.QFileDialog.getOpenFileName(self,"Open File", '.', "Files (*.*)"))
|
|
87
95
|
if not (fname == ""):
|
|
88
|
-
val = []
|
|
96
|
+
val = []
|
|
97
|
+
fname = fname.replace("\\","/")
|
|
98
|
+
print fname
|
|
89
99
|
self.lineEdit_2.setText(fname+" /sdcard/")
|
|
90
100
|
val.append(str(self.lineEdit_2.text()))
|
|
91
101
|
val.append(str(self.lineEdit_3.text()))
|
|
@@ -102,52 +112,95 @@ class DialogAndroid(QtGui.QDialog):
|
|
|
102
112
|
val.append(str(self.lineEdit_4.text()))
|
|
103
113
|
val.append(str(self.lineEdit_5.text()))
|
|
104
114
|
config.setAdb(val)
|
|
115
|
+
self.parent().adb.setAdbList()
|
|
105
116
|
self.close()
|
|
106
117
|
|
|
107
118
|
def setDevice(self,val):
|
|
108
119
|
config.setDevice(val)
|
|
109
120
|
self.parent().adb.setDevice()
|
|
110
121
|
|
|
122
|
+
class DialogBrowse(QtGui.QDialog):
|
|
123
|
+
def __init__(self, parent):
|
|
124
|
+
QtGui.QDialog.__init__(self, parent)
|
|
125
|
+
self.resize(400, 420)
|
|
126
|
+
self.horizontalLayoutWidget = QtGui.QWidget(self)
|
|
127
|
+
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 400, 400))
|
|
128
|
+
self.tree = BrowseTree()
|
|
129
|
+
self.horizontalLayout = QtGui.QHBoxLayout(self.horizontalLayoutWidget)
|
|
130
|
+
self.horizontalLayout.setMargin(0)
|
|
131
|
+
self.horizontalLayout.addWidget(self.tree)
|
|
132
|
+
self.tree.initProjects()
|
|
133
|
+
|
|
111
134
|
class DialogAnt(QtGui.QDialog):
|
|
112
|
-
def __init__(self, parent
|
|
135
|
+
def __init__(self, parent):
|
|
113
136
|
QtGui.QDialog.__init__(self, parent)
|
|
114
137
|
self.resize(400, 420)
|
|
115
138
|
self.horizontalLayoutWidget = QtGui.QWidget(self)
|
|
116
139
|
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 401, 361))
|
|
117
140
|
self.horizontalLayout = QtGui.QHBoxLayout(self.horizontalLayoutWidget)
|
|
118
141
|
self.horizontalLayout.setMargin(0)
|
|
119
|
-
|
|
120
142
|
self.tabWidget = QtGui.QTabWidget(self.horizontalLayoutWidget)
|
|
121
143
|
self.tab_4 = QtGui.QWidget()
|
|
122
|
-
|
|
123
144
|
self.formLayoutWidget = QtGui.QWidget(self.tab_4)
|
|
124
145
|
self.formLayoutWidget.setGeometry(QtCore.QRect(10, 10, 361, 311))
|
|
125
|
-
|
|
126
146
|
self.formLayout = QtGui.QFormLayout(self.formLayoutWidget)
|
|
127
147
|
self.formLayout.setMargin(0)
|
|
148
|
+
|
|
128
|
-
|
|
149
|
+
label_1 = QtGui.QLabel(self.formLayoutWidget)
|
|
150
|
+
self.lineEdit_1 = QtGui.QLineEdit(self.formLayoutWidget)
|
|
129
|
-
self.formLayout.setWidget(0, QtGui.QFormLayout.SpanningRole,
|
|
151
|
+
self.formLayout.setWidget(0, QtGui.QFormLayout.SpanningRole,label_1)
|
|
152
|
+
self.formLayout.setWidget(1, QtGui.QFormLayout.SpanningRole, self.lineEdit_1)
|
|
153
|
+
label_2 = QtGui.QLabel(self.formLayoutWidget)
|
|
130
154
|
self.lineEdit_2 = QtGui.QLineEdit(self.formLayoutWidget)
|
|
155
|
+
|
|
131
|
-
self.
|
|
156
|
+
self.formLayout.setWidget(2, QtGui.QFormLayout.SpanningRole,label_2)
|
|
132
|
-
self.formLayout.setWidget(
|
|
157
|
+
self.formLayout.setWidget(3, QtGui.QFormLayout.SpanningRole, self.lineEdit_2)
|
|
158
|
+
label_3 = QtGui.QLabel(self.formLayoutWidget)
|
|
133
159
|
self.lineEdit_3 = QtGui.QLineEdit(self.formLayoutWidget)
|
|
134
|
-
self.
|
|
160
|
+
self.formLayout.setWidget(4, QtGui.QFormLayout.SpanningRole,label_3)
|
|
135
|
-
self.formLayout.setWidget(
|
|
161
|
+
self.formLayout.setWidget(5, QtGui.QFormLayout.SpanningRole, self.lineEdit_3)
|
|
136
|
-
self.label_3 = QtGui.QLabel(self.formLayoutWidget)
|
|
137
|
-
self.formLayout.setWidget(2, QtGui.QFormLayout.SpanningRole, self.label_3)
|
|
138
|
-
|
|
162
|
+
label_4 = QtGui.QLabel(self.formLayoutWidget)
|
|
139
|
-
self.formLayout.setWidget(5, QtGui.QFormLayout.SpanningRole, self.label_4)
|
|
140
163
|
self.lineEdit_4 = QtGui.QLineEdit(self.formLayoutWidget)
|
|
141
|
-
self.
|
|
164
|
+
self.formLayout.setWidget(6, QtGui.QFormLayout.SpanningRole,label_4)
|
|
142
|
-
self.formLayout.setWidget(
|
|
165
|
+
self.formLayout.setWidget(7, QtGui.QFormLayout.SpanningRole, self.lineEdit_4)
|
|
143
|
-
|
|
166
|
+
label_5 = QtGui.QLabel(self.formLayoutWidget)
|
|
144
|
-
self.formLayout.setWidget(7, QtGui.QFormLayout.SpanningRole, self.label_5)
|
|
145
167
|
self.lineEdit_5 = QtGui.QLineEdit(self.formLayoutWidget)
|
|
146
|
-
self.
|
|
168
|
+
self.formLayout.setWidget(8, QtGui.QFormLayout.SpanningRole,label_5)
|
|
147
|
-
self.formLayout.setWidget(
|
|
169
|
+
self.formLayout.setWidget(9, QtGui.QFormLayout.SpanningRole, self.lineEdit_5)
|
|
170
|
+
|
|
171
|
+
self.buttonBox = QtGui.QDialogButtonBox(self)
|
|
172
|
+
self.buttonBox.setGeometry(QtCore.QRect(40, 370, 341, 32))
|
|
173
|
+
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
|
174
|
+
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
|
|
175
|
+
self.buttonBox.clicked.connect(self.update)
|
|
176
|
+
|
|
177
|
+
label_1.setText("Create Android Project")
|
|
178
|
+
label_2.setText("Build")
|
|
179
|
+
label_3.setText("Install")
|
|
180
|
+
label_4.setText("Build and Install")
|
|
181
|
+
label_5.setText("Clean")
|
|
182
|
+
self.lineEdit_1.setText(config.ant()[0])
|
|
183
|
+
self.lineEdit_2.setText(config.ant()[1])
|
|
184
|
+
self.lineEdit_3.setText(config.ant()[2])
|
|
185
|
+
self.lineEdit_4.setText(config.ant()[3])
|
|
186
|
+
self.lineEdit_5.setText(config.ant()[4])
|
|
187
|
+
|
|
148
|
-
self.tabWidget.addTab(self.tab_4,
|
|
188
|
+
self.tabWidget.addTab(self.tab_4,"Ant")
|
|
189
|
+
self.setWindowTitle("Ant")
|
|
149
190
|
self.horizontalLayout.addWidget(self.tabWidget)
|
|
150
191
|
|
|
192
|
+
def update(self,btn):
|
|
193
|
+
val = []
|
|
194
|
+
if(btn.text() == "OK"):
|
|
195
|
+
val.append(str(self.lineEdit_1.text()))
|
|
196
|
+
val.append(str(self.lineEdit_2.text()))
|
|
197
|
+
val.append(str(self.lineEdit_3.text()))
|
|
198
|
+
val.append(str(self.lineEdit_4.text()))
|
|
199
|
+
val.append(str(self.lineEdit_5.text()))
|
|
200
|
+
config.setAnt(val)
|
|
201
|
+
self.parent().ant.setAntList()
|
|
202
|
+
self.close()
|
|
203
|
+
|
|
151
204
|
class DialogSquirrel(QtGui.QDialog):
|
|
152
205
|
def __init__(self, parent=None):
|
|
153
206
|
QtGui.QDialog.__init__(self, parent)
|
|
@@ -326,6 +379,7 @@ class DialogTodo(QtGui.QDialog):
|
|
|
326
379
|
item = self.list.takeTopLevelItem(self.list.indexOfTopLevelItem(self.list.currentItem()))
|
|
327
380
|
self.taskList.remove(item.text(0))
|
|
328
381
|
config.setTodo(self.taskList)
|
|
382
|
+
|
|
329
383
|
|
|
330
384
|
class DialogAbout2(QtGui.QDialog):
|
|
331
385
|
def __init__(self, parent=None):
|
Widget/editor.py
CHANGED
|
@@ -16,7 +16,7 @@ class Editor(QsciScintilla):
|
|
|
16
16
|
self.colorStyle = colorStyle
|
|
17
17
|
self.errorLines = []
|
|
18
18
|
self.setUtf8(True)
|
|
19
|
-
self.setText(
|
|
19
|
+
self.setText(text)
|
|
20
20
|
if(eol == 0):
|
|
21
21
|
self.setEolMode(self.EolWindows)
|
|
22
22
|
elif(eol == 1):
|
|
@@ -30,17 +30,13 @@ class Editor(QsciScintilla):
|
|
|
30
30
|
#Margin
|
|
31
31
|
#print self.marginType(self.SymbolMargin)
|
|
32
32
|
# Clickable margin 1 for showing markers
|
|
33
|
-
self.setMarginSensitivity(
|
|
33
|
+
self.setMarginSensitivity(0, True)
|
|
34
|
-
self.setMarginsBackgroundColor(self.colorStyle.margin)
|
|
34
|
+
#self.setMarginsBackgroundColor(self.colorStyle.margin)
|
|
35
35
|
self.connect(self,SIGNAL('marginClicked(int, int, Qt::KeyboardModifiers)'),self.on_margin_clicked)
|
|
36
36
|
# Margin 0 is used for line numbers
|
|
37
37
|
#self.setMarginLineNumbers(0, True)
|
|
38
38
|
#self.setMarginWidth(0, self.fontmetrics.width("0000") + 6)
|
|
39
|
-
self.
|
|
39
|
+
self.setMargin(config.margin())
|
|
40
|
-
if(self.lines()<1000):
|
|
41
|
-
self.setMarginWidth(0, QString("-------"))
|
|
42
|
-
else:
|
|
43
|
-
self.setMarginWidth(0, QString("---------"))
|
|
44
40
|
#self.linesChanged.connect(self.changeMarginWidht())
|
|
45
41
|
#Caret
|
|
46
42
|
self.setCaretLineBackgroundColor(self.colorStyle.caret)
|
|
@@ -91,9 +87,13 @@ class Editor(QsciScintilla):
|
|
|
91
87
|
self.api.load(ospathjoin(apiDir,"emo.api"))
|
|
92
88
|
self.api.prepare()
|
|
93
89
|
self.lexer.setAPIs(self.api) #Very important do not change line otherwise gg
|
|
90
|
+
self.setAutoIndent(True)
|
|
91
|
+
self.setBackspaceUnindents(True)
|
|
92
|
+
self.setIndent(config.indent())
|
|
94
93
|
self.setLexer(self.lexer) #Very important do not change line otherwise gg
|
|
95
94
|
|
|
96
95
|
|
|
96
|
+
|
|
97
97
|
def setColorStyle(self,colorStyle):
|
|
98
98
|
self.colorStyle = colorStyle
|
|
99
99
|
self.setCaretLineBackgroundColor(self.colorStyle.caret)
|
|
@@ -149,16 +149,41 @@ class Editor(QsciScintilla):
|
|
|
149
149
|
self.lexer.setFont(self.font)
|
|
150
150
|
self.setMarginsFont(self.font)
|
|
151
151
|
|
|
152
|
-
def setFontName(self
|
|
152
|
+
def setFontName(self):
|
|
153
|
-
self.font.setFamily(
|
|
153
|
+
self.font.setFamily(config.fontName())
|
|
154
|
+
self.lexer.setFont(self.font)
|
|
155
|
+
|
|
156
|
+
def setFontSize(self):
|
|
157
|
+
self.font.setPointSize(config.fontSize())
|
|
154
158
|
self.lexer.setFont(self.font)
|
|
155
159
|
|
|
160
|
+
def setMargin(self,mar):
|
|
161
|
+
if(mar == 1):
|
|
162
|
+
self.setMarginLineNumbers(1, True)
|
|
163
|
+
if(self.lines()<1000):
|
|
164
|
+
self.setMarginWidth(1, QString("-------"))
|
|
165
|
+
else:
|
|
166
|
+
self.setMarginWidth(1, QString("---------"))
|
|
167
|
+
else:
|
|
168
|
+
self.setMarginLineNumbers(1, False)
|
|
169
|
+
self.setMarginWidth(1, QString("---"))
|
|
170
|
+
|
|
171
|
+
def setIndent(self,val):
|
|
172
|
+
if(val == 0):
|
|
173
|
+
self.setIndentationGuides(False)
|
|
174
|
+
else:
|
|
175
|
+
self.setIndentationGuides(True)
|
|
176
|
+
|
|
177
|
+
|
|
156
178
|
def setThreshold(self,val):
|
|
157
179
|
self.setAutoCompletionThreshold(val)
|
|
158
180
|
|
|
159
181
|
def setLine(self,lineno):
|
|
182
|
+
self.setFocus(True)
|
|
160
183
|
self.setCursorPosition(int(lineno),0)
|
|
161
184
|
self.setCaretLineVisible(True)
|
|
185
|
+
|
|
186
|
+
|
|
162
187
|
|
|
163
188
|
|
|
164
189
|
"""
|
Widget/editor.pyc
CHANGED
|
Binary file
|
Widget/lexersquirrel.py
CHANGED
|
@@ -33,6 +33,8 @@ class LexerSquirrel(QsciLexerPython):
|
|
|
33
33
|
|
|
34
34
|
def __init__(self,colorStyle, parent = None):
|
|
35
35
|
QsciLexerPython.__init__(self, parent)
|
|
36
|
+
self.setV2UnicodeAllowed(True)
|
|
37
|
+
#self.setHighlightSubidentifiers(True)
|
|
36
38
|
#self.parent = parent
|
|
37
39
|
#self.sci = self.parent
|
|
38
40
|
#print self.FunctionMethodName
|
|
@@ -61,26 +63,23 @@ class LexerSquirrel(QsciLexerPython):
|
|
|
61
63
|
}
|
|
62
64
|
"""
|
|
63
65
|
self.styles = [
|
|
64
|
-
#index description color paper font eol
|
|
66
|
+
#index description color paper font eol
|
|
65
67
|
QsciStyle(0, QString("base"), self.colorStyle.color, self.colorStyle.paper, self.plainFont, True),
|
|
66
|
-
QsciStyle(1, QString("comment"), QColor("#
|
|
68
|
+
QsciStyle(1, QString("comment"), QColor("#3f7f5f"), self.colorStyle.paper, self.plainFont, True),
|
|
67
|
-
QsciStyle(2, QString("number"), QColor("#008000"), self.colorStyle.paper, self.
|
|
69
|
+
QsciStyle(2, QString("number"), QColor("#008000"), self.colorStyle.paper, self.plainFont, False),
|
|
68
70
|
QsciStyle(3, QString("DoubleQuotedString"), QColor("#008000"), self.colorStyle.paper, self.plainFont, True),
|
|
69
71
|
QsciStyle(4, QString("SingleQuotedString"), QColor("#008000"), self.colorStyle.paper, self.plainFont, True),
|
|
70
|
-
QsciStyle(5, QString("Keyword"), QColor("#
|
|
72
|
+
QsciStyle(5, QString("Keyword"), QColor("#7f0055"), self.colorStyle.paper, self.boldFont, True),
|
|
71
73
|
QsciStyle(6, QString("TripleSingleQuotedString"), QColor("#ffd0d0"),self.colorStyle.paper, self.plainFont, True),
|
|
72
74
|
QsciStyle(7, QString("TripleDoubleQuotedString"),QColor("#001111"),self.colorStyle.paper, self.plainFont, False),
|
|
73
75
|
QsciStyle(8, QString("ClassName"), QColor("#000000"), self.colorStyle.paper, self.plainFont, False),
|
|
74
76
|
QsciStyle(9, QString("FunctionMethodName"), QColor("#000000"), self.colorStyle.paper, self.plainFont, False),
|
|
75
77
|
QsciStyle(10, QString("Operator"), QColor("#ff00ff"), self.colorStyle.paper, self.plainFont, False),
|
|
76
78
|
QsciStyle(11, QString("Identifier"), QColor("#000000"), self.colorStyle.paper, self.plainFont, False),
|
|
77
|
-
QsciStyle(12, QString("CommentBlock"), QColor("#
|
|
79
|
+
QsciStyle(12, QString("CommentBlock"), QColor("#3f5fbf"), self.colorStyle.paper, self.plainFont, False),
|
|
78
80
|
QsciStyle(13, QString("UnclosedString"), QColor("#010101"), self.colorStyle.paper, self.plainFont, False),
|
|
79
81
|
QsciStyle(14, QString("HighlightedIdentifier"), QColor("#0000ff"), self.colorStyle.paper, self.plainFont, False),
|
|
80
|
-
QsciStyle(15, QString("Decorator"), QColor("#ff00ff"), self.colorStyle.paper, self.plainFont, False)
|
|
82
|
+
QsciStyle(15, QString("Decorator"), QColor("#ff00ff"), self.colorStyle.paper, self.plainFont, False),
|
|
81
|
-
#QsciStyle(7, QString("MultiComment_start"), QColor("#ff00ff"), QColor("#001111"), self.plainFont, False),
|
|
82
|
-
#QsciStyle(8, QString("MultiComment"), QColor("#ff00ff"), QColor("#001111"), self.plainFont, False),
|
|
83
|
-
#QsciStyle(9, QString("MultiComment_stop"), QColor("#ff00ff"), QColor("#001111"), self.plainFont, False)
|
|
84
83
|
]
|
|
85
84
|
self._foldcompact = True
|
|
86
85
|
|
|
@@ -167,21 +166,18 @@ class LexerSquirrel(QsciLexerPython):
|
|
|
167
166
|
length = len(line)
|
|
168
167
|
# We must take care of empty lines.This is done here.
|
|
169
168
|
if length == 1:
|
|
169
|
+
return
|
|
170
|
-
|
|
170
|
+
if line.startswith('@@'):
|
|
171
|
-
|
|
171
|
+
newState = self.styles[1]
|
|
172
|
-
else:
|
|
173
|
-
newState = self.styles[0]
|
|
174
|
-
#if line.startswith('#'):
|
|
175
|
-
# newState = self.styles[3]
|
|
176
|
-
|
|
172
|
+
elif line.startswith('\t+') or line.startswith(' +'):
|
|
177
|
-
|
|
173
|
+
newState = self.styles[3]
|
|
178
174
|
#We work with a non empty line.
|
|
179
175
|
else:
|
|
180
176
|
if line.startswith('@'):
|
|
181
|
-
newState = self.styles[
|
|
177
|
+
newState = self.styles[1]
|
|
182
178
|
elif line.startswith('@'):
|
|
183
|
-
if prevState == self.styles[
|
|
179
|
+
if prevState == self.styles[1] or prevState == self.styles[1]:
|
|
184
|
-
newState = self.styles[
|
|
180
|
+
newState = self.styles[1]
|
|
185
181
|
else:
|
|
186
182
|
newState = self.styles[0]
|
|
187
183
|
#elif line.startswith('//'):
|
|
@@ -215,7 +211,7 @@ class LexerSquirrel(QsciLexerPython):
|
|
|
215
211
|
newState = self.styles[2]
|
|
216
212
|
wordLength = len('class')
|
|
217
213
|
elif line[i:].startswith('function'):
|
|
218
|
-
newState = self.styles[
|
|
214
|
+
newState = self.styles[5]
|
|
219
215
|
wordLength = len('function')
|
|
220
216
|
elif line[i:].startswith(' if'):
|
|
221
217
|
newState = self.styles[4]
|
|
@@ -224,13 +220,13 @@ class LexerSquirrel(QsciLexerPython):
|
|
|
224
220
|
newState = self.styles[4]
|
|
225
221
|
wordLength = length
|
|
226
222
|
elif line[i:].startswith('//'):
|
|
227
|
-
newState = self.styles[
|
|
223
|
+
newState = self.styles[1]
|
|
228
224
|
wordLength = length
|
|
229
225
|
elif line[i:].startswith('/*'):
|
|
230
|
-
newState = self.styles[
|
|
226
|
+
newState = self.styles[1]
|
|
231
227
|
wordLength = length
|
|
232
228
|
elif line[i:].startswith('*/'):
|
|
233
|
-
newState = self.styles[
|
|
229
|
+
newState = self.styles[1]
|
|
234
230
|
wordLength = length
|
|
235
231
|
#else:
|
|
236
232
|
#newState = self.styles[0]
|
Widget/parser.py
CHANGED
|
@@ -34,10 +34,14 @@ class Parser(QWidget):
|
|
|
34
34
|
def run(self,nfile):
|
|
35
35
|
if(nfile.endswith(".nut")):
|
|
36
36
|
self.par_thread.setCmd(sqc+" "+nfile)
|
|
37
|
+
self.parent.statusParsing()
|
|
38
|
+
self.parent.progressStart()
|
|
37
39
|
self.par_thread.run()
|
|
38
40
|
|
|
39
41
|
def stop(self):
|
|
40
42
|
self.par_thread.close_process()
|
|
43
|
+
self.parent.statusWriting()
|
|
44
|
+
self.parent.progressStop()
|
|
41
45
|
|
|
42
46
|
def close(self):
|
|
43
47
|
self.par_thread.kill_process()
|
Widget/tab.py
CHANGED
|
@@ -107,6 +107,7 @@ class TreeTab(QTabWidget):
|
|
|
107
107
|
class OutputTab(QTabWidget):
|
|
108
108
|
def __init__(self,parent):
|
|
109
109
|
QTabWidget.__init__(self,parent)
|
|
110
|
+
|
|
110
111
|
|
|
111
112
|
|
|
112
113
|
class Tiler(QTabWidget):
|
Widget/tab.pyc
CHANGED
|
Binary file
|
Widget/tool.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
from PyQt4.QtGui import QToolBar, QMenu, QAction, QSlider, QWidgetAction
|
|
1
|
+
from PyQt4.QtGui import (QToolBar, QMenu, QAction, QSlider, QWidgetAction, QFontDatabase,
|
|
2
|
+
QFont, QComboBox, QLabel)
|
|
2
3
|
from PyQt4.QtCore import SIGNAL, Qt, QSize
|
|
3
4
|
from globals import config, Icons
|
|
4
5
|
|
|
@@ -24,8 +25,13 @@ class Tool(QToolBar):
|
|
|
24
25
|
self.action_SaveAll.triggered.connect(self.parent.fileSaveAll)
|
|
25
26
|
self.action_SaveAll.setToolTip("Save All Files")
|
|
26
27
|
|
|
28
|
+
|
|
29
|
+
|
|
27
|
-
self.
|
|
30
|
+
self.action_Build = QAction(Icons.thread_view, 'Build', self)
|
|
31
|
+
self.action_Build.setShortcut('Ctrl+B')
|
|
28
|
-
self.
|
|
32
|
+
self.action_Build.triggered.connect(self.parent.build_project)
|
|
33
|
+
self.action_Debug = QAction(Icons.debug_exec, 'Debug', self)
|
|
34
|
+
|
|
29
35
|
self.action_Run = QAction(Icons.run, 'Run', self)
|
|
30
36
|
self.action_Run.setShortcut('Ctrl+R')
|
|
31
37
|
self.action_Run.triggered.connect(self.parent.adb.run)
|
|
@@ -39,6 +45,8 @@ class Tool(QToolBar):
|
|
|
39
45
|
self.action_Design.triggered.connect(self.parent.design)
|
|
40
46
|
self.action_Todo = QAction(Icons.task_set, 'Todo', self)
|
|
41
47
|
self.action_Todo.triggered.connect(self.parent.todo)
|
|
48
|
+
self.action_Help = QAction(Icons.toc_open, 'Help', self)
|
|
49
|
+
self.action_Help.triggered.connect(self.parent.help)
|
|
42
50
|
|
|
43
51
|
men = QMenu()
|
|
44
52
|
|
|
@@ -70,12 +78,42 @@ class Tool(QToolBar):
|
|
|
70
78
|
self.iconSlider.setOrientation(Qt.Horizontal)
|
|
71
79
|
self.iconSlider.setValue(config.iconSize())
|
|
72
80
|
self.iconSlider.setMinimum(16)
|
|
73
|
-
self.iconSlider.setMaximum(
|
|
81
|
+
self.iconSlider.setMaximum(32)
|
|
74
82
|
self.iconSlider.setSingleStep(2)
|
|
75
83
|
self.iconSlider.valueChanged.connect(self.setIcon)
|
|
76
84
|
self.iconSliderAction = QWidgetAction(men)
|
|
77
85
|
self.iconSliderAction.setDefaultWidget(self.iconSlider)
|
|
78
86
|
|
|
87
|
+
'''Font Button'''
|
|
88
|
+
self.fontCombo = QComboBox()
|
|
89
|
+
#self.fontCombo.setStyleSheet("QPushButton {text-align:center;color:blue;text-decoration:underline;font-family:arial; background-color:#d4d0c8; }")
|
|
90
|
+
database = QFontDatabase()
|
|
91
|
+
idx = 0
|
|
92
|
+
for fam in database.families():
|
|
93
|
+
#font = QFont(fam)
|
|
94
|
+
#font.setFixedPitch(True)
|
|
95
|
+
#font.setPointSize(10)
|
|
96
|
+
#text = QLabel(fam)
|
|
97
|
+
#text.setFont(font)
|
|
98
|
+
self.fontCombo.addItem(Icons.font,fam)
|
|
99
|
+
if(fam == config.fontName()):
|
|
100
|
+
self.fontCombo.setCurrentIndex(idx)
|
|
101
|
+
#self.fontCombo.setFont(font)
|
|
102
|
+
idx+= 1
|
|
103
|
+
self.fontCombo.currentIndexChanged.connect(self.parent.setFontName)
|
|
104
|
+
self.fontComboMenu = QWidgetAction(men)
|
|
105
|
+
self.fontComboMenu.setDefaultWidget(self.fontCombo)
|
|
106
|
+
|
|
107
|
+
'''Font Size'''
|
|
108
|
+
self.fontSizeCombo = QComboBox()
|
|
109
|
+
for size in range(0,40):
|
|
110
|
+
self.fontSizeCombo.addItem(str(size+1))
|
|
111
|
+
if(size == config.fontSize()):
|
|
112
|
+
self.fontSizeCombo.setCurrentIndex(size)
|
|
113
|
+
self.fontSizeCombo.currentIndexChanged.connect(self.parent.setFontSize)
|
|
114
|
+
self.fontSizeComboMenu = QWidgetAction(men)
|
|
115
|
+
self.fontSizeComboMenu.setDefaultWidget(self.fontSizeCombo)
|
|
116
|
+
|
|
79
117
|
|
|
80
118
|
action_explorer = QAction("Show Explorer",self)
|
|
81
119
|
action_explorer.triggered.connect(self.parent.exp)
|
|
@@ -84,18 +122,39 @@ class Tool(QToolBar):
|
|
|
84
122
|
action_designer = QAction("Show Designer",self)
|
|
85
123
|
action_designer.triggered.connect(self.parent.design)
|
|
86
124
|
action_Indentation = QAction("Indentation Guides",self)
|
|
125
|
+
action_Indentation.triggered.connect(self.parent.setIndent)
|
|
126
|
+
action_Margin = QAction("Line Numbers",self)
|
|
127
|
+
action_Margin.triggered.connect(self.parent.setMargin)
|
|
128
|
+
action_Android = QAction(Icons.android,'Android', self)
|
|
129
|
+
action_Android.triggered.connect(self.parent.android)
|
|
130
|
+
action_Ant = QAction(Icons.ant_view,'Ant', self)
|
|
131
|
+
action_Ant.triggered.connect(self.parent.antt)
|
|
132
|
+
action_Squirrel = QAction(Icons.nut,'Squirrel', self)
|
|
133
|
+
action_Squirrel.triggered.connect(self.parent.squirrel)
|
|
134
|
+
action_Ios1 = QAction(Icons.ios,'iOS', self)
|
|
135
|
+
men.addAction(action_Android)
|
|
136
|
+
men.addAction(action_Ant)
|
|
137
|
+
men.addAction(action_Squirrel)
|
|
138
|
+
men.addAction(action_Ios1)
|
|
139
|
+
men.addSeparator()
|
|
87
140
|
men.addAction(action_explorer)
|
|
88
141
|
men.addAction(action_console)
|
|
89
142
|
men.addAction(action_designer)
|
|
90
143
|
men.addAction(action_Indentation)
|
|
144
|
+
men.addAction(action_Margin)
|
|
145
|
+
men.addSeparator()
|
|
146
|
+
men.addAction(QAction("Font",self))
|
|
147
|
+
men.addAction(self.fontComboMenu)
|
|
148
|
+
men.addAction(QAction("Font Size",self))
|
|
149
|
+
men.addAction(self.fontSizeComboMenu)
|
|
91
150
|
men.addSeparator()
|
|
92
151
|
men.addAction(QAction("TabWidth",self))
|
|
93
152
|
men.addAction(self.tabsSliderAction)
|
|
94
153
|
men.addSeparator()
|
|
95
154
|
men.addAction(QAction("Threshold",self))
|
|
96
155
|
men.addAction(self.threshSliderAction)
|
|
97
|
-
men.addAction(QAction("Icon Size",self))
|
|
156
|
+
#men.addAction(QAction("Icon Size",self))
|
|
98
|
-
men.addAction(self.iconSliderAction)
|
|
157
|
+
#men.addAction(self.iconSliderAction)
|
|
99
158
|
|
|
100
159
|
self.action_Options = QAction(Icons.emblem_system, 'Options', self)
|
|
101
160
|
self.action_Options.setMenu(men)
|
|
@@ -111,7 +170,7 @@ class Tool(QToolBar):
|
|
|
111
170
|
self.action_Emo = QAction(Icons.emo, 'Emo', self)
|
|
112
171
|
self.action_Emo.setCheckable(True)
|
|
113
172
|
self.action_Emo.triggered.connect(self.parent.emo)
|
|
114
|
-
self.action_Ios = QAction(Icons.ios, '
|
|
173
|
+
self.action_Ios = QAction(Icons.ios, 'ios', self)
|
|
115
174
|
self.action_Ios.setCheckable(True)
|
|
116
175
|
self.action_Ios.triggered.connect(self.parent.ios)
|
|
117
176
|
|
|
@@ -172,9 +231,11 @@ class Tool(QToolBar):
|
|
|
172
231
|
self.addAction(self.action_Save)
|
|
173
232
|
self.addAction(self.action_SaveAll)
|
|
174
233
|
self.addSeparator()
|
|
234
|
+
self.addAction(self.action_Build)
|
|
175
235
|
self.addAction(self.action_Run)
|
|
176
236
|
self.addAction(self.action_RunFile)
|
|
177
237
|
self.addAction(self.action_Stop)
|
|
238
|
+
self.addAction(self.action_Debug)
|
|
178
239
|
self.addSeparator()
|
|
179
240
|
self.addAction(self.action_Design)
|
|
180
241
|
self.addAction(self.action_Todo)
|
|
@@ -194,4 +255,7 @@ class Tool(QToolBar):
|
|
|
194
255
|
|
|
195
256
|
def setIcon(self,val):
|
|
196
257
|
config.setIconSize(val)
|
|
197
|
-
self.setIconSize(QSize(val,val))
|
|
258
|
+
self.setIconSize(QSize(val,val))
|
|
259
|
+
|
|
260
|
+
def make_callback(self, param):
|
|
261
|
+
return lambda:self.parent.setFontName(param)
|
Widget/tree.py
CHANGED
|
@@ -86,7 +86,6 @@ class Project(QTreeWidgetItem):
|
|
|
86
86
|
self.Count += 1
|
|
87
87
|
self.setExpanded(True)
|
|
88
88
|
|
|
89
|
-
|
|
90
89
|
|
|
91
90
|
def getPath(self):
|
|
92
91
|
return self.path
|
|
@@ -193,6 +192,7 @@ class ProjectTree(QTreeWidget):
|
|
|
193
192
|
if(self.closed[self.projects.index(startDir)] == 0):
|
|
194
193
|
i = Project(self,startDir)
|
|
195
194
|
self.addTopLevelItem(i)
|
|
195
|
+
self.setCurrentItem(i)
|
|
196
196
|
self.readDir(i,startDir)
|
|
197
197
|
self.readMainFiles(i,startDir)
|
|
198
198
|
else:
|
|
@@ -215,6 +215,24 @@ class ProjectTree(QTreeWidget):
|
|
|
215
215
|
self.projects.remove(itemPath)
|
|
216
216
|
config.setProject(self.projects)
|
|
217
217
|
self.takeTopLevelItem(self.indexOfTopLevelItem(item))
|
|
218
|
+
|
|
219
|
+
'''Awesome GG working 1/10/12 5pm'''
|
|
220
|
+
def getProject(self,nfile):
|
|
221
|
+
current_item = self.currentItem()
|
|
222
|
+
if(current_item == None):
|
|
223
|
+
QMessageBox.about(self,"Please Select or Add a Project First")
|
|
224
|
+
return None
|
|
225
|
+
else:
|
|
226
|
+
'''This is when a project is selected'''
|
|
227
|
+
if(current_item.parent() == None):
|
|
228
|
+
pass
|
|
229
|
+
#print current_item.getPath()
|
|
230
|
+
else:
|
|
231
|
+
'''This is when a file or child is selected'''
|
|
232
|
+
while(current_item.parent() != None):
|
|
233
|
+
current_item = self.currentItem().parent()
|
|
234
|
+
#print current_item.getPath()
|
|
235
|
+
return current_item
|
|
218
236
|
|
|
219
237
|
def addItem(self,links):
|
|
220
238
|
print links
|
|
@@ -304,15 +322,15 @@ class ProjectTree(QTreeWidget):
|
|
|
304
322
|
action_DeleteProject = QAction(Icons.trash,'Delete', self)
|
|
305
323
|
action_DeleteProject.triggered.connect(lambda:self.deleteProject(item))
|
|
306
324
|
|
|
307
|
-
action_CreateProject = QAction('Create', self)
|
|
325
|
+
action_CreateProject = QAction('Create Android', self)
|
|
308
326
|
action_CreateProject.triggered.connect(lambda:self.create(item))
|
|
309
327
|
action_BuildProject = QAction('Build', self)
|
|
310
328
|
action_BuildProject.triggered.connect(lambda:self.build(item))
|
|
311
|
-
action_BuildRunProject = QAction('Build and
|
|
329
|
+
action_BuildRunProject = QAction('Build and Install', self)
|
|
312
330
|
action_BuildRunProject.triggered.connect(lambda:self.buildRun(item))
|
|
313
331
|
action_CleanProject = QAction('Clean', self)
|
|
314
332
|
action_CleanProject.triggered.connect(lambda:self.clean(item))
|
|
315
|
-
action_RunProject = QAction('
|
|
333
|
+
action_RunProject = QAction('Install', self)
|
|
316
334
|
action_RunProject.triggered.connect(lambda:self.run(item))
|
|
317
335
|
if(item.isProject()):
|
|
318
336
|
if not(item.isClosed()):
|
|
@@ -532,11 +550,73 @@ class ProjectTree(QTreeWidget):
|
|
|
532
550
|
except:
|
|
533
551
|
QMessageBox.about(self,"Error","Could Not Delete The File")
|
|
534
552
|
|
|
553
|
+
class BrowseTree(QTreeWidget):
|
|
554
|
+
def __init__(self,parent = None):
|
|
555
|
+
QTreeWidget.__init__(self,parent)
|
|
556
|
+
self.setColumnCount(1)
|
|
557
|
+
self.setHeaderLabel("Explorer")
|
|
558
|
+
self.projects = []
|
|
559
|
+
self.header().setStretchLastSection(False)
|
|
560
|
+
self.header().setResizeMode(QHeaderView.ResizeToContents)
|
|
561
|
+
|
|
562
|
+
def initProjects(self):
|
|
563
|
+
if(config.projects() != None):
|
|
564
|
+
if(len(config.projects()) != None):
|
|
565
|
+
for pro in config.projects():
|
|
566
|
+
self.createProject(pro)
|
|
567
|
+
|
|
568
|
+
def readDir(self,parent,path):
|
|
569
|
+
for d in oslistdir(path):
|
|
570
|
+
if ospathisdir(ospathjoin(path,d)):
|
|
571
|
+
if not ospathjoin(d).startswith('.'):
|
|
572
|
+
i = Dir(parent,d,path)
|
|
573
|
+
self.readFiles(i,ospathjoin(path,d))
|
|
574
|
+
|
|
575
|
+
def readMainDir(self,parent,path):
|
|
576
|
+
for d in oslistdir(path):
|
|
577
|
+
if ospathisdir(ospathjoin(path,d)):
|
|
578
|
+
if not ospathjoin(d).startswith('.'):
|
|
579
|
+
i = Dir(parent,d,path)
|
|
580
|
+
self.readMainFiles(i,ospathjoin(path,d))
|
|
581
|
+
|
|
582
|
+
def readFiles(self,parent,path):
|
|
583
|
+
for f in oslistdir(path):
|
|
584
|
+
if ospathisdir(ospathjoin(path,f)):
|
|
585
|
+
d = Dir(parent,f,path)
|
|
586
|
+
self.readFiles(d,ospathjoin(path,f))
|
|
587
|
+
else:
|
|
588
|
+
if not ospathjoin(f).startswith('.'):
|
|
589
|
+
File(parent,f,path)
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
def readMainFiles(self,parent,path):
|
|
593
|
+
for f in oslistdir(path):
|
|
594
|
+
if not ospathisdir(ospathjoin(path,f)):
|
|
595
|
+
if not ospathjoin(f).startswith('.'):
|
|
596
|
+
File(parent,f,path)
|
|
597
|
+
|
|
598
|
+
def createProject(self,startDir):
|
|
599
|
+
if(ospathexists(startDir)):
|
|
600
|
+
self.projects.append(startDir)
|
|
601
|
+
self.addProject(startDir)
|
|
602
|
+
return True
|
|
603
|
+
else:
|
|
604
|
+
QMessageBox.about(self,"Can't Open Project","Project Does Not Exist %s"%startDir)
|
|
605
|
+
return False
|
|
606
|
+
|
|
607
|
+
def addProject(self,startDir):
|
|
608
|
+
i = Project(self,startDir)
|
|
609
|
+
self.addTopLevelItem(i)
|
|
610
|
+
self.setCurrentItem(i)
|
|
611
|
+
self.readDir(i,startDir)
|
|
612
|
+
self.readMainFiles(i,startDir)
|
|
613
|
+
|
|
535
614
|
|
|
536
615
|
class Error(QTreeWidgetItem):
|
|
537
616
|
def __init__(self,parent,line,text):
|
|
538
617
|
QTreeWidgetItem.__init__(self,parent)
|
|
539
618
|
self.setIcon(0,Icons.error)
|
|
619
|
+
self.line = line
|
|
540
620
|
self.setText(0,"Line "+line+": "+text)
|
|
541
621
|
|
|
542
622
|
class ErrorFile(QTreeWidgetItem):
|
|
@@ -561,11 +641,83 @@ class ErrorTree(QTreeWidget):
|
|
|
561
641
|
def reset(self):
|
|
562
642
|
if(self.topLevelItemCount() != 0):
|
|
563
643
|
self.clear()
|
|
644
|
+
|
|
645
|
+
class Field(QTreeWidgetItem):
|
|
646
|
+
def __init__(self,parent,name,line):
|
|
647
|
+
QTreeWidgetItem.__init__(self,parent)
|
|
648
|
+
self.line = line
|
|
649
|
+
self.name = name
|
|
650
|
+
self.setText (0, self.name)
|
|
651
|
+
self.setIcon(0,Icons.field)
|
|
652
|
+
|
|
653
|
+
class Class(QTreeWidgetItem):
|
|
654
|
+
def __init__(self,parent,name,line):
|
|
655
|
+
QTreeWidgetItem.__init__(self,parent)
|
|
656
|
+
self.line = line
|
|
657
|
+
self.name = name
|
|
658
|
+
self.setText (0, self.name)
|
|
659
|
+
self.setIcon(0,Icons.class1)
|
|
660
|
+
|
|
661
|
+
class Method(QTreeWidgetItem):
|
|
662
|
+
def __init__(self,parent,name,line):
|
|
663
|
+
QTreeWidgetItem.__init__(self,parent)
|
|
664
|
+
self.line = line
|
|
665
|
+
self.name = name
|
|
666
|
+
self.setText (0, self.name)
|
|
667
|
+
self.setIcon(0,Icons.method)
|
|
564
668
|
|
|
565
669
|
class OutlineTree(QTreeWidget):
|
|
566
670
|
def __init__(self,parent = None):
|
|
567
671
|
QTreeWidget.__init__(self,parent)
|
|
568
672
|
self.setColumnCount(1)
|
|
569
673
|
self.header().close()
|
|
570
|
-
self.
|
|
674
|
+
self.header().setStretchLastSection(False)
|
|
571
|
-
|
|
675
|
+
self.header().setResizeMode(QHeaderView.ResizeToContents)
|
|
676
|
+
self.mainClass = None
|
|
677
|
+
#item = Class(self,"Hero",50)
|
|
678
|
+
#self.addTopLevelItem(item)
|
|
679
|
+
#item2 = Method(item,"say(text)",50)
|
|
680
|
+
#item3 = Field(item,"hp",50)
|
|
681
|
+
|
|
682
|
+
def parseText(self,source):
|
|
683
|
+
gg = source.split("\n")
|
|
684
|
+
idx = 0
|
|
685
|
+
self.reset()
|
|
686
|
+
for line in gg:
|
|
687
|
+
if line.contains("class"):
|
|
688
|
+
self.addClass(line,idx)
|
|
689
|
+
elif line.contains("function"):
|
|
690
|
+
self.addMethod(line,idx)
|
|
691
|
+
idx += 1
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
def addClass(self,text,lineno):
|
|
695
|
+
text.remove("{")
|
|
696
|
+
text.remove("class")
|
|
697
|
+
text.remove(" ")
|
|
698
|
+
self.mainClass = Class(self,text,lineno)
|
|
699
|
+
self.addTopLevelItem(self.mainClass)
|
|
700
|
+
self.expandAll()
|
|
701
|
+
|
|
702
|
+
def addMethod(self,text,lineno):
|
|
703
|
+
text.remove("{")
|
|
704
|
+
text.remove("function")
|
|
705
|
+
text.remove(" ")
|
|
706
|
+
if(self.mainClass != None):
|
|
707
|
+
i = Method(self.mainClass,text,lineno)
|
|
708
|
+
else:
|
|
709
|
+
i = Method(self,text,lineno)
|
|
710
|
+
|
|
711
|
+
def addField(self,text,lineno):
|
|
712
|
+
if(self.mainClass != None):
|
|
713
|
+
i = Field(self.mainClass,text,lineno)
|
|
714
|
+
else:
|
|
715
|
+
i = Field(self,text,lineno)
|
|
716
|
+
|
|
717
|
+
def reset(self):
|
|
718
|
+
'''Important othewise old reference of mainClass is used'''
|
|
719
|
+
self.mainClass = None
|
|
720
|
+
if(self.topLevelItemCount() != 0):
|
|
721
|
+
self.clear()
|
|
722
|
+
|
|
723
|
+
|
Widget/tree.pyc
CHANGED
|
Binary file
|
build/exe.win32-2.7/Sabel.exe
CHANGED
|
Binary file
|
build/exe.win32-2.7/Sabel.zip
CHANGED
|
Binary file
|
build/exe.win32-2.7/config.yml
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
ADB:
|
|
2
|
-
- C:/
|
|
2
|
+
- C:/Android-Template/assets/main.nut /sdcard/
|
|
3
3
|
- com.emo_framework.examples/com.emo_framework.EmoActivity
|
|
4
4
|
- EmoFramework
|
|
5
5
|
- com.emo_framework.examples
|
|
6
6
|
ANT:
|
|
7
|
-
- android update project -
|
|
7
|
+
- android.bat update project -p
|
|
8
|
-
- ant debug
|
|
8
|
+
- ant.bat debug -buildfile
|
|
9
|
+
- ant.bat installd -buildfile
|
|
10
|
+
- ant.bat debug install -buildfile
|
|
11
|
+
- ant.bat clean -buildfile
|
|
9
12
|
CMD:
|
|
10
13
|
- CMD
|
|
11
14
|
- PYTHON
|
|
@@ -19,24 +22,31 @@ ClosedProject:
|
|
|
19
22
|
- 0
|
|
20
23
|
- 0
|
|
21
24
|
- 0
|
|
25
|
+
- 0
|
|
22
26
|
File:
|
|
23
|
-
- C:/CODE/assets/howtoscene.nut
|
|
24
27
|
- C:/CODE/assets/creditscene.nut
|
|
28
|
+
- C:/CODE/assets/main.nut
|
|
29
|
+
- C:/CODE/assets/howtoscene.nut
|
|
30
|
+
- C:/CODE/assets/cll.nut
|
|
25
31
|
PARAM:
|
|
26
32
|
- Dude
|
|
33
|
+
- ' C:/CODE/assets/cll.nut'
|
|
27
34
|
Project:
|
|
28
35
|
- C:/CODE/assets/
|
|
29
36
|
- C:/port/
|
|
37
|
+
- C:/Android-Template/
|
|
30
38
|
Recent: []
|
|
31
39
|
Setting:
|
|
32
40
|
device: 1
|
|
33
41
|
fontname: Courier New
|
|
34
|
-
fontsize:
|
|
42
|
+
fontsize: 9
|
|
35
43
|
iconsize: 16
|
|
44
|
+
indent: 0
|
|
45
|
+
margin: 0
|
|
36
46
|
mode: 0
|
|
37
47
|
styleindex: 8
|
|
38
48
|
tabwidth: 2
|
|
39
|
-
thresh:
|
|
49
|
+
thresh: 1
|
|
40
50
|
workspace: C:/CODE/
|
|
41
51
|
Style: 0
|
|
42
52
|
TODO:
|
|
@@ -46,8 +56,7 @@ TODO:
|
|
|
46
56
|
- Add Style Options
|
|
47
57
|
- Add iOS support
|
|
48
58
|
- Make Mac Build
|
|
49
|
-
- Add Lua and Neko Lexers
|
|
50
59
|
- Dude Thats it for now
|
|
51
60
|
- Squirrel Parser
|
|
52
|
-
- Lua Parser
|
|
53
61
|
- Neko Parser
|
|
62
|
+
- Desginer
|
build/exe.win32-2.7/library.zip
CHANGED
|
Binary file
|
config.py
CHANGED
|
@@ -38,6 +38,16 @@ class Config:
|
|
|
38
38
|
return int(self.readSetting('mode'))
|
|
39
39
|
def setMode(self,value):
|
|
40
40
|
self.writeSetting("mode",value)
|
|
41
|
+
|
|
42
|
+
def margin(self):
|
|
43
|
+
return int(self.readSetting('margin'))
|
|
44
|
+
def setMargin(self,value):
|
|
45
|
+
self.writeSetting("margin",value)
|
|
46
|
+
|
|
47
|
+
def indent(self):
|
|
48
|
+
return int(self.readSetting('indent'))
|
|
49
|
+
def setIndent(self,value):
|
|
50
|
+
self.writeSetting("indent",value)
|
|
41
51
|
|
|
42
52
|
'''0 is emulator 1 is device'''
|
|
43
53
|
def device(self):
|
|
@@ -82,6 +92,12 @@ class Config:
|
|
|
82
92
|
self.data['ADB'] = val
|
|
83
93
|
self.write()
|
|
84
94
|
|
|
95
|
+
def ant(self):
|
|
96
|
+
return self.read('ANT')
|
|
97
|
+
def setAnt(self,val):
|
|
98
|
+
self.data['ANT'] = val
|
|
99
|
+
self.write()
|
|
100
|
+
|
|
85
101
|
def cmds(self):
|
|
86
102
|
return self.read('CMD')
|
|
87
103
|
|
config.yml
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
ADB:
|
|
2
|
-
- C:/
|
|
2
|
+
- C:/Android-Template/assets/main.nut /sdcard/
|
|
3
3
|
- com.emo_framework.examples/com.emo_framework.EmoActivity
|
|
4
4
|
- EmoFramework
|
|
5
5
|
- com.emo_framework.examples
|
|
6
6
|
ANT:
|
|
7
|
-
- android update project -
|
|
7
|
+
- android.bat update project -p
|
|
8
|
-
- ant debug
|
|
8
|
+
- ant.bat debug -buildfile
|
|
9
|
+
- ant.bat installd -buildfile
|
|
10
|
+
- ant.bat debug install -buildfile
|
|
11
|
+
- ant.bat clean -buildfile
|
|
9
12
|
CMD:
|
|
10
13
|
- CMD
|
|
11
14
|
- PYTHON
|
|
@@ -21,24 +24,27 @@ ClosedProject:
|
|
|
21
24
|
- 0
|
|
22
25
|
- 0
|
|
23
26
|
File:
|
|
24
|
-
- C:/CODE/assets/howtoscene.nut
|
|
25
27
|
- C:/CODE/assets/creditscene.nut
|
|
28
|
+
- C:/CODE/assets/main.nut
|
|
29
|
+
- C:/CODE/assets/howtoscene.nut
|
|
26
30
|
PARAM:
|
|
27
|
-
- Dude
|
|
31
|
+
- Dude C:/CODE/assets/creditscene.nut C:/CODE/assets/physics.nut
|
|
28
32
|
Project:
|
|
29
33
|
- C:/CODE/assets/
|
|
30
34
|
- C:/port/
|
|
31
35
|
- C:/Android-Template/
|
|
32
36
|
Recent: []
|
|
33
37
|
Setting:
|
|
34
|
-
device:
|
|
38
|
+
device: 1
|
|
35
39
|
fontname: Courier New
|
|
36
|
-
fontsize:
|
|
40
|
+
fontsize: 9
|
|
37
41
|
iconsize: 16
|
|
42
|
+
indent: 0
|
|
43
|
+
margin: 0
|
|
38
44
|
mode: 0
|
|
39
45
|
styleindex: 8
|
|
40
46
|
tabwidth: 2
|
|
41
|
-
thresh:
|
|
47
|
+
thresh: 1
|
|
42
48
|
workspace: C:/CODE/
|
|
43
49
|
Style: 0
|
|
44
50
|
TODO:
|
|
@@ -48,8 +54,7 @@ TODO:
|
|
|
48
54
|
- Add Style Options
|
|
49
55
|
- Add iOS support
|
|
50
56
|
- Make Mac Build
|
|
51
|
-
- Add Lua and Neko Lexers
|
|
52
57
|
- Dude Thats it for now
|
|
53
58
|
- Squirrel Parser
|
|
54
|
-
- Lua Parser
|
|
55
59
|
- Neko Parser
|
|
60
|
+
- Desginer
|
cx.py
CHANGED
|
@@ -21,7 +21,7 @@ exe = Executable(
|
|
|
21
21
|
|
|
22
22
|
setup(
|
|
23
23
|
name = "Sabel",
|
|
24
|
-
version ="0.
|
|
24
|
+
version ="0.60",
|
|
25
25
|
description = "Sabel IDE",
|
|
26
26
|
executables = [exe]
|
|
27
27
|
)
|
globals.py
CHANGED
|
@@ -4,7 +4,7 @@ from PyQt4.QtGui import QIcon,QPixmap,QApplication,QSplashScreen
|
|
|
4
4
|
from send2trash import send2trash
|
|
5
5
|
from config import Config
|
|
6
6
|
|
|
7
|
-
__version__ = "0.
|
|
7
|
+
__version__ = "0.60"
|
|
8
8
|
#Python accesses local variables much more efficiently than global variables.
|
|
9
9
|
oslistdir = os.listdir
|
|
10
10
|
ospathisdir = os.path.isdir
|
|
@@ -117,6 +117,9 @@ class Icons:
|
|
|
117
117
|
zoomplus = os_icon('zoomplus')
|
|
118
118
|
ios = os_icon('ioss')
|
|
119
119
|
emo = os_icon('emo')
|
|
120
|
+
method = os_icon('auto_jmeth')
|
|
121
|
+
class1 = os_icon('auto_class')
|
|
122
|
+
field = os_icon('auto_field')
|
|
120
123
|
|
|
121
124
|
class Auto:
|
|
122
125
|
auto_activity = os_pixmap('auto_activity')
|
main.py
CHANGED
|
@@ -4,7 +4,7 @@ __license__ = "GPLv3"
|
|
|
4
4
|
__copyright__ = 'Copyright (c) 2012, pyros2097'
|
|
5
5
|
__credits__ = ['pyros2097', 'eclipse']
|
|
6
6
|
__email__ = 'pyros2097@gmail.com'
|
|
7
|
-
__version__ = "0.
|
|
7
|
+
__version__ = "0.60"
|
|
8
8
|
#TODO:
|
|
9
9
|
#Must learn to destroy editor completely because memory keeps increasing
|
|
10
10
|
#when close tab occurs
|
mainwindow.py
CHANGED
|
@@ -29,6 +29,7 @@ class MainWindow(Window):
|
|
|
29
29
|
self.connect(self.tabWidget,SIGNAL("dropped"), self.createTabs)
|
|
30
30
|
self.tabWidget.tabCloseRequested.connect(self.closeTab)
|
|
31
31
|
self.treeWidget.itemDoubleClicked.connect(self.treeItemClicked)
|
|
32
|
+
self.outlineWidget.itemDoubleClicked.connect(self.gotoLine)
|
|
32
33
|
self.errorTree.itemDoubleClicked.connect(self.errorLine)
|
|
33
34
|
self.connect(self.treeWidget,SIGNAL("openFileClicked"),self.treeItemClicked)
|
|
34
35
|
self.connect(self.treeWidget,SIGNAL("create"), lambda x:self.ant.create(x))
|
|
@@ -54,7 +55,7 @@ class MainWindow(Window):
|
|
|
54
55
|
self.openImage(item.getPath())
|
|
55
56
|
elif(item.isAudio()):
|
|
56
57
|
self.openAudio(item.getPath())
|
|
57
|
-
|
|
58
|
+
|
|
58
59
|
def initInterpreter(self):
|
|
59
60
|
self.ipy = PyInterp(self)
|
|
60
61
|
self.ipy.initInterpreter(locals())
|
|
@@ -89,7 +90,8 @@ class MainWindow(Window):
|
|
|
89
90
|
text = ""
|
|
90
91
|
try:
|
|
91
92
|
infile = open(nfile, 'r')
|
|
92
|
-
|
|
93
|
+
tt = infile.read()
|
|
94
|
+
text = unicode(tt,"utf-8")#must add utf-8 for it to work
|
|
93
95
|
|
|
94
96
|
#infile.close()
|
|
95
97
|
self.files.append(nfile)
|
|
@@ -200,6 +202,8 @@ class MainWindow(Window):
|
|
|
200
202
|
fname = self.files[index]
|
|
201
203
|
try:
|
|
202
204
|
fl = open(fname, 'w')
|
|
205
|
+
self.statusSaving()
|
|
206
|
+
self.progressStart()
|
|
203
207
|
tempText = unicode(self.tabWidget.widget(index).text())
|
|
204
208
|
if tempText:
|
|
205
209
|
fl.write(tempText.encode("utf-8"))
|
|
@@ -209,6 +213,8 @@ class MainWindow(Window):
|
|
|
209
213
|
QMessageBox.about(self, "Can't Save","Failed to save ...")
|
|
210
214
|
except:
|
|
211
215
|
QMessageBox.about(self, "Can't Save","File is Locked")
|
|
216
|
+
self.statusWriting()
|
|
217
|
+
self.progressStop()
|
|
212
218
|
self.parser.run(self.files[index])
|
|
213
219
|
#must implement for all files
|
|
214
220
|
|
|
@@ -219,6 +225,8 @@ class MainWindow(Window):
|
|
|
219
225
|
fname = self.files[index]
|
|
220
226
|
try:
|
|
221
227
|
fl = open(fname, 'w')
|
|
228
|
+
self.statusSaving()
|
|
229
|
+
self.progressStart()
|
|
222
230
|
tempText = unicode(self.tabWidget.widget(index).text())
|
|
223
231
|
if tempText:
|
|
224
232
|
fl.write(tempText.encode("utf-8"))
|
|
@@ -226,6 +234,8 @@ class MainWindow(Window):
|
|
|
226
234
|
self.clearDirty(index)
|
|
227
235
|
else:
|
|
228
236
|
QMessageBox.about(self, "Can't Save","Failed to save ...")
|
|
237
|
+
self.statusWriting()
|
|
238
|
+
self.progressStop()
|
|
229
239
|
except:
|
|
230
240
|
QMessageBox.about(self, "Can't Save","File is Locked")
|
|
231
241
|
if(self.files != None):
|
|
@@ -246,7 +256,7 @@ class MainWindow(Window):
|
|
|
246
256
|
notSaved = True
|
|
247
257
|
if notSaved:
|
|
248
258
|
reply = QMessageBox.question(self,
|
|
249
|
-
"
|
|
259
|
+
"Sabel - Unsaved Changes",
|
|
250
260
|
"Save unsaved changes?",
|
|
251
261
|
QMessageBox.Yes|QMessageBox.No|QMessageBox.Cancel)
|
|
252
262
|
if reply == QMessageBox.Cancel:
|
|
@@ -265,6 +275,4 @@ class MainWindow(Window):
|
|
|
265
275
|
lang = 2
|
|
266
276
|
elif nfile.endswith(".neko"):
|
|
267
277
|
lang = 2
|
|
268
|
-
elif nfile.endswith(".lua"):
|
|
269
|
-
lang = 2
|
|
270
278
|
return lang
|
window.py
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
from PyQt4.QtGui import (QAction,QIcon,QMessageBox,QWidgetAction,QMenu,QWidget,
|
|
2
2
|
QHBoxLayout,QVBoxLayout,QTabWidget,QToolBar,QTextEdit,
|
|
3
3
|
QLineEdit,QPushButton,QToolButton,QSplitter,QStatusBar,
|
|
4
|
-
QMainWindow,QPalette,QColor,QSlider,
|
|
4
|
+
QMainWindow,QPalette,QColor,QSlider,QLabel,
|
|
5
|
-
QFont,QComboBox,QFileDialog,QInputDialog,QProgressBar
|
|
5
|
+
QFont,QComboBox,QFileDialog,QInputDialog,QProgressBar
|
|
6
|
+
)
|
|
6
|
-
from PyQt4.QtCore import QSize,Qt,QStringList
|
|
7
|
+
from PyQt4.QtCore import QSize,Qt,QStringList,SIGNAL,SLOT,QString
|
|
7
8
|
from Widget import (EditorTab,Tiler,TreeTab,OutputTab,
|
|
8
9
|
ProjectTree,ErrorTree,OutlineTree,
|
|
9
|
-
DialogAndroid,DialogAbout,DialogAnt,DialogSquirrel,DialogTodo
|
|
10
|
+
DialogAndroid,DialogAbout,DialogAnt,DialogSquirrel,DialogTodo,
|
|
11
|
+
DialogBrowse)
|
|
10
12
|
from Widget.style import Styles
|
|
11
13
|
from stylesheet import *
|
|
12
14
|
|
|
@@ -44,6 +46,7 @@ class Window(QMainWindow):
|
|
|
44
46
|
self.tiler = Tiler(self)
|
|
45
47
|
self.tiler.setMinimumHeight(100)
|
|
46
48
|
self.tabWidget.tabBar().setStyleSheet(stletabb)
|
|
49
|
+
self.tabWidget.currentChanged.connect(self.fileChanged)
|
|
47
50
|
self.tabWidget_2.currentChanged.connect(self.closeExplorer)
|
|
48
51
|
self.tabWidget_3.currentChanged.connect(self.closeConsole)
|
|
49
52
|
self.tabWidget.setTabsClosable(True)
|
|
@@ -58,20 +61,8 @@ class Window(QMainWindow):
|
|
|
58
61
|
self.VerticalLayout_2 = QVBoxLayout(self.tab_5)#QHBoxLayout(self.tab_5)
|
|
59
62
|
self.VerticalLayout_2.setMargin(0)
|
|
60
63
|
self.treeWidget = ProjectTree(self.tab_5)
|
|
61
|
-
self.treeWidget.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
|
|
64
|
+
#self.treeWidget.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
|
|
62
|
-
self.treeWidget.horizontalScrollBar().show()
|
|
65
|
+
#self.treeWidget.horizontalScrollBar().show()
|
|
63
|
-
self.treebar = QToolBar()
|
|
64
|
-
action_Android = QAction(Icons.android,'Android', self)
|
|
65
|
-
action_Android.triggered.connect(self.android)
|
|
66
|
-
action_Ant = QAction(Icons.ant_view,'Ant', self)
|
|
67
|
-
action_Ant.triggered.connect(self.ant)
|
|
68
|
-
action_Squirrel = QAction(Icons.nut,'Squirrel', self)
|
|
69
|
-
action_Squirrel.triggered.connect(self.squirrel)
|
|
70
|
-
self.treebar.addAction(action_Android)
|
|
71
|
-
self.treebar.addAction(action_Ant)
|
|
72
|
-
self.treebar.addAction(action_Squirrel)
|
|
73
|
-
self.treebar.setIconSize(QSize(16,16))
|
|
74
|
-
self.VerticalLayout_2.addWidget(self.treebar)
|
|
75
66
|
self.VerticalLayout_2.addWidget(self.treeWidget)
|
|
76
67
|
|
|
77
68
|
#Outline
|
|
@@ -264,13 +255,24 @@ class Window(QMainWindow):
|
|
|
264
255
|
self.zoomoutButton.setFlat(True)
|
|
265
256
|
self.zoomoutButton.setIcon(Icons.zoomminus)
|
|
266
257
|
self.zoomoutButton.clicked.connect(self.zoomout)
|
|
258
|
+
|
|
259
|
+
'''Status Text, Progress Bar and Stop Button'''
|
|
267
|
-
self.
|
|
260
|
+
self.statusText = QLabel("Writing")
|
|
268
|
-
self.
|
|
261
|
+
self.statusText.setMargin(10)
|
|
269
|
-
self.fontButton.setIcon(Icons.font)
|
|
270
|
-
self.fontButton.clicked.connect(self.setFont)
|
|
271
262
|
self.progressbar = QProgressBar()
|
|
272
263
|
self.progressbar.setMinimum(0)
|
|
273
264
|
self.progressbar.setMaximum(100)
|
|
265
|
+
self.stopButton = QPushButton(self)
|
|
266
|
+
self.stopButton.setFlat(True)
|
|
267
|
+
self.stopButton.setIcon(Icons.stop)
|
|
268
|
+
self.stopButton.clicked.connect(self.forceStop)
|
|
269
|
+
self.progressbar.hide()
|
|
270
|
+
self.stopButton.hide()
|
|
271
|
+
self.temp = False
|
|
272
|
+
self.progress = False
|
|
273
|
+
self.counter = 0
|
|
274
|
+
|
|
275
|
+
'''Adding all widgets to Status Bar'''
|
|
274
276
|
self.statusbar.addWidget(self.aboutButton)
|
|
275
277
|
self.statusbar.addWidget(self.expButton)
|
|
276
278
|
self.statusbar.addWidget(self.cmdButton)
|
|
@@ -278,20 +280,38 @@ class Window(QMainWindow):
|
|
|
278
280
|
self.statusbar.addWidget(self.findButton)
|
|
279
281
|
self.statusbar.addWidget(self.zoominButton)
|
|
280
282
|
self.statusbar.addWidget(self.zoomoutButton)
|
|
281
|
-
self.statusbar.addWidget(self.fontButton)
|
|
283
|
+
#self.statusbar.addWidget(self.fontButton)
|
|
284
|
+
self.statusbar.addWidget(self.statusText)
|
|
282
|
-
|
|
285
|
+
self.statusbar.addWidget(self.progressbar)
|
|
283
|
-
|
|
286
|
+
self.statusbar.addWidget(self.stopButton)
|
|
284
287
|
#self.statusbar.setFixedHeight(18)
|
|
285
288
|
|
|
286
|
-
|
|
289
|
+
''''Initializing Coloring Style'''
|
|
287
290
|
self.colorStyle = None
|
|
288
291
|
self.initColorStyle()
|
|
292
|
+
|
|
289
|
-
|
|
293
|
+
'''Adding Cental Widget and Status Bar'''
|
|
290
294
|
self.setCentralWidget(self.centralwidget)
|
|
291
295
|
self.setStatusBar(self.statusbar)
|
|
292
296
|
self.textEdit.setReadOnly(True)
|
|
293
297
|
#QtGui.QApplication.setStyle(QtGui.QStyleFactory.create('Cleanlooks'))
|
|
294
298
|
|
|
299
|
+
def build_project(self):
|
|
300
|
+
current_file = self.files[self.tabWidget.currentIndex()]
|
|
301
|
+
prj = self.treeWidget.getProject(current_file)
|
|
302
|
+
if(prj != None):
|
|
303
|
+
self.treeWidget.build(prj)
|
|
304
|
+
|
|
305
|
+
def run_project(self):
|
|
306
|
+
current_file = self.files[self.tabWidget.currentIndex()]
|
|
307
|
+
prj = self.treeWidget.getProject(current_file)
|
|
308
|
+
if(prj != None):
|
|
309
|
+
self.treeWidget.run(prj)
|
|
310
|
+
|
|
311
|
+
def forceStop(self):
|
|
312
|
+
self.ant.kill()
|
|
313
|
+
self.progressStop()
|
|
314
|
+
|
|
295
315
|
#-----------------------------------------------------------------------------------#
|
|
296
316
|
# Menu Actions Functions #
|
|
297
317
|
#-----------------------------------------------------------------------------------#
|
|
@@ -347,7 +367,7 @@ class Window(QMainWindow):
|
|
|
347
367
|
form = DialogAndroid(self)
|
|
348
368
|
form.show()
|
|
349
369
|
|
|
350
|
-
def
|
|
370
|
+
def antt(self):
|
|
351
371
|
form = DialogAnt(self)
|
|
352
372
|
form.show()
|
|
353
373
|
|
|
@@ -389,7 +409,8 @@ class Window(QMainWindow):
|
|
|
389
409
|
self.tiler.setCurrentIndex(1)
|
|
390
410
|
self.tiler.hide()
|
|
391
411
|
'''
|
|
412
|
+
|
|
392
|
-
|
|
413
|
+
'''The current Changed idx of tabwidget_3 is passed to this a param'''
|
|
393
414
|
def closeConsole(self,no = 2):
|
|
394
415
|
if(no == 2):
|
|
395
416
|
if(self.tabWidget_3.isHidden()):
|
|
@@ -397,6 +418,8 @@ class Window(QMainWindow):
|
|
|
397
418
|
else:
|
|
398
419
|
self.tabWidget_3.setCurrentIndex(1)
|
|
399
420
|
self.tabWidget_3.hide()
|
|
421
|
+
|
|
422
|
+
'''The current Changed idx of tabwidget_2 is passed to this a param'''
|
|
400
423
|
def closeExplorer(self,no = 2):
|
|
401
424
|
if(no == 2):
|
|
402
425
|
if(self.tabWidget_2.isHidden()):
|
|
@@ -404,9 +427,67 @@ class Window(QMainWindow):
|
|
|
404
427
|
else:
|
|
405
428
|
self.tabWidget_2.setCurrentIndex(0)
|
|
406
429
|
self.tabWidget_2.hide()
|
|
430
|
+
elif(no == 1):
|
|
431
|
+
self.fileChanged(no)
|
|
432
|
+
|
|
433
|
+
def fileChanged(self,no):
|
|
434
|
+
if(self.tabWidget_2.currentIndex() == 1):
|
|
435
|
+
edt = self.tabWidget.widget(self.tabWidget.currentIndex())
|
|
436
|
+
source = edt.text()
|
|
437
|
+
self.outlineWidget.parseText(source)
|
|
438
|
+
|
|
439
|
+
def statusSaving(self):
|
|
440
|
+
self.statusText.setText("Saving")
|
|
441
|
+
def statusParsing(self):
|
|
442
|
+
self.statusText.setText("Parsing")
|
|
443
|
+
def statusWriting(self):
|
|
444
|
+
self.statusText.setText("Writing")
|
|
445
|
+
def statusRunning(self):
|
|
446
|
+
self.statusText.setText("Running")
|
|
447
|
+
def statusStopping(self):
|
|
448
|
+
self.statusText.setText("Stopping")
|
|
449
|
+
def statusCommand(self):
|
|
450
|
+
self.statusText.setText("Command")
|
|
451
|
+
def statusBuilding(self):
|
|
452
|
+
self.statusText.setText("Building")
|
|
453
|
+
def statusInstalling(self):
|
|
454
|
+
self.statusText.setText("Installing")
|
|
455
|
+
def statusCleaning(self):
|
|
456
|
+
self.statusText.setText("Cleaning")
|
|
457
|
+
def statusCreating(self):
|
|
458
|
+
self.statusText.setText("Creating")
|
|
407
459
|
|
|
408
|
-
def
|
|
460
|
+
def progressStart(self):
|
|
461
|
+
self.progress == True
|
|
462
|
+
self.temp == True
|
|
463
|
+
if(self.progressbar.isHidden()):
|
|
464
|
+
self.progressbar.show()
|
|
465
|
+
if(self.stopButton.isHidden()):
|
|
466
|
+
self.stopButton.show()
|
|
467
|
+
self.progressbar.setValue(1)
|
|
468
|
+
|
|
469
|
+
def progressStop(self):
|
|
470
|
+
self.progress == False
|
|
471
|
+
self.temp == False
|
|
409
|
-
|
|
472
|
+
self.progressbar.setValue(100)
|
|
473
|
+
if not(self.progressbar.isHidden()):
|
|
474
|
+
self.progressbar.hide()
|
|
475
|
+
if not(self.stopButton.isHidden()):
|
|
476
|
+
self.stopButton.hide()
|
|
477
|
+
|
|
478
|
+
def progressUpdate(self):
|
|
479
|
+
if(self.progress == True):
|
|
480
|
+
if(self.temp == True):
|
|
481
|
+
self.counter += 1
|
|
482
|
+
self.progressbar.setValue(self.counter)
|
|
483
|
+
if(self.counter == 100):
|
|
484
|
+
self.temp = False
|
|
485
|
+
if(self.temp == False):
|
|
486
|
+
self.counter -= 1
|
|
487
|
+
self.progressbar.setValue(self.counter)
|
|
488
|
+
if(self.counter == 0):
|
|
489
|
+
self.temp = True
|
|
490
|
+
|
|
410
491
|
|
|
411
492
|
#-----------------------------------------------------------------------------------#
|
|
412
493
|
# Editor Functions #
|
|
@@ -432,25 +513,53 @@ class Window(QMainWindow):
|
|
|
432
513
|
edt.setLine(error.line)
|
|
433
514
|
'''Font Functions'''
|
|
434
515
|
def zoomin(self):
|
|
516
|
+
pass
|
|
435
|
-
for i in range(len(self.files)):
|
|
517
|
+
#for i in range(len(self.files)):
|
|
436
|
-
|
|
518
|
+
# self.tabWidget.widget(i).zoomin()
|
|
437
519
|
def zoomout(self):
|
|
520
|
+
pass
|
|
438
|
-
for i in range(len(self.files)):
|
|
521
|
+
#for i in range(len(self.files)):
|
|
439
|
-
|
|
522
|
+
# self.tabWidget.widget(i).zoomout()
|
|
440
|
-
|
|
523
|
+
|
|
441
|
-
font = QFont()
|
|
442
|
-
font.setFamily(config.fontName())
|
|
443
|
-
fdialog = QFontDialog(self)
|
|
444
|
-
fdialog.show()
|
|
445
|
-
fdialog.setCurrentFont(font)
|
|
446
|
-
fdialog.accepted.connect(lambda:self.setFontName(fdialog.currentFont()))
|
|
447
|
-
def setFontName(self,
|
|
524
|
+
def setFontName(self,idx):
|
|
448
|
-
#print "accepted"
|
|
449
|
-
#print font.family()
|
|
450
|
-
fontName = str(
|
|
525
|
+
fontName = str(self.toolBar.fontCombo.itemText(idx))
|
|
451
526
|
config.setFontName(fontName)
|
|
452
527
|
for i in range(len(self.files)):
|
|
453
|
-
self.tabWidget.widget(i).setFontName(
|
|
528
|
+
self.tabWidget.widget(i).setFontName()
|
|
529
|
+
|
|
530
|
+
def setFontSize(self,idx):
|
|
531
|
+
fontSize = idx+1
|
|
532
|
+
config.setFontSize(fontSize)
|
|
533
|
+
for i in range(len(self.files)):
|
|
534
|
+
self.tabWidget.widget(i).setFontSize()
|
|
535
|
+
|
|
536
|
+
def gotoLine(self,item):
|
|
537
|
+
edt = self.tabWidget.widget(self.tabWidget.currentIndex())
|
|
538
|
+
edt.setLine(item.line)
|
|
539
|
+
|
|
540
|
+
def setMargin(self):
|
|
541
|
+
mar = config.margin()
|
|
542
|
+
if(mar == 0):
|
|
543
|
+
config.setMargin(1)
|
|
544
|
+
for i in range(len(self.files)):
|
|
545
|
+
self.tabWidget.widget(i).setMargin(1)
|
|
546
|
+
else:
|
|
547
|
+
config.setMargin(0)
|
|
548
|
+
for i in range(len(self.files)):
|
|
549
|
+
self.tabWidget.widget(i).setMargin(0)
|
|
550
|
+
|
|
551
|
+
def setIndent(self):
|
|
552
|
+
indent = config.indent()
|
|
553
|
+
if(indent == 0):
|
|
554
|
+
config.setIndent(1)
|
|
555
|
+
for i in range(len(self.files)):
|
|
556
|
+
self.tabWidget.widget(i).setIndent(1)
|
|
557
|
+
else:
|
|
558
|
+
config.setIndent(0)
|
|
559
|
+
for i in range(len(self.files)):
|
|
560
|
+
self.tabWidget.widget(i).setIndent(0)
|
|
561
|
+
|
|
562
|
+
|
|
454
563
|
def setThreshold(self,val):
|
|
455
564
|
config.setThresh(val)
|
|
456
565
|
for i in range(len(self.files)):
|
|
@@ -490,17 +599,22 @@ class Window(QMainWindow):
|
|
|
490
599
|
# Command Functions #
|
|
491
600
|
#-----------------------------------------------------------------------------------#
|
|
492
601
|
def getFile(self):
|
|
493
|
-
fname = str(QFileDialog.getOpenFileName(self,"Open File", '.', "Files (*.*)"))
|
|
494
|
-
if not (fname == ""):
|
|
495
|
-
index = self.combo2.currentIndex()
|
|
496
|
-
text = str(self.combo2.itemText(index))+" "+fname
|
|
497
|
-
|
|
602
|
+
self.browsedialog = DialogBrowse(self)
|
|
603
|
+
self.browsedialog.tree.itemDoubleClicked.connect(self.getName)
|
|
498
|
-
|
|
604
|
+
self.browsedialog.show()
|
|
499
|
-
self.paramList.insert(index,text)
|
|
500
|
-
config.setParam(self.paramList)
|
|
501
|
-
|
|
502
|
-
|
|
503
605
|
|
|
606
|
+
def getName(self,item):
|
|
607
|
+
if(item.isFile()):
|
|
608
|
+
self.browsedialog.accept()
|
|
609
|
+
fname = item.getPath()
|
|
610
|
+
if not (fname == ""):
|
|
611
|
+
index = self.combo2.currentIndex()
|
|
612
|
+
text = str(self.combo2.itemText(index))+" "+fname
|
|
613
|
+
self.combo2.setItemText(index,text)
|
|
614
|
+
self.paramList.pop(index)
|
|
615
|
+
self.paramList.insert(index,text)
|
|
616
|
+
config.setParam(self.paramList)
|
|
617
|
+
|
|
504
618
|
def addCmd(self,index):
|
|
505
619
|
text, ok = QInputDialog.getText(self, 'Add Command', 'Command:')
|
|
506
620
|
if(ok):
|