85028691
—
pyros2097 13 years ago
v0.56 Fixed Project bugs added todo list
- .settings/org.eclipse.core.resources.prefs +2 -0
- Widget/Project.ui +0 -195
- Widget/__init__.py +5 -3
- Widget/__init__.pyc +0 -0
- Widget/ant.py +36 -14
- Widget/audio.py +128 -0
- Widget/command.py +3 -4
- Widget/dialogs.py +44 -55
- Widget/image.py +20 -0
- Widget/lexersquirrel.py +1 -1
- Widget/tab.py +115 -12
- Widget/tab.pyc +0 -0
- Widget/tree.py +79 -35
- Widget/tree.pyc +0 -0
- build/exe.win32-2.7/PyQt4.phonon.pyd +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.yaml +16 -11
- build/exe.win32-2.7/library.zip +0 -0
- build/exe.win32-2.7/phonon4.dll +0 -0
- build/exe.win32-2.7/phonon_backend/phonon_ds94.dll +0 -0
- config.py +23 -78
- config.yaml +13 -9
- cx.py +1 -2
- globals.py +1 -2
- icons.py +1 -1
- main.py +31 -0
- mainwindow.py +67 -87
- stylesheet.py +0 -26
- window.py +146 -38
.settings/org.eclipse.core.resources.prefs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
eclipse.preferences.version=1
|
|
2
|
+
encoding//Widget/audio.py=utf-8
|
Widget/Project.ui
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<ui version="4.0">
|
|
3
|
-
<class>Dialog</class>
|
|
4
|
-
<widget class="QDialog" name="Dialog">
|
|
5
|
-
<property name="geometry">
|
|
6
|
-
<rect>
|
|
7
|
-
<x>0</x>
|
|
8
|
-
<y>0</y>
|
|
9
|
-
<width>580</width>
|
|
10
|
-
<height>348</height>
|
|
11
|
-
</rect>
|
|
12
|
-
</property>
|
|
13
|
-
<property name="windowTitle">
|
|
14
|
-
<string>New Project</string>
|
|
15
|
-
</property>
|
|
16
|
-
<widget class="QDialogButtonBox" name="buttonBox">
|
|
17
|
-
<property name="geometry">
|
|
18
|
-
<rect>
|
|
19
|
-
<x>210</x>
|
|
20
|
-
<y>300</y>
|
|
21
|
-
<width>341</width>
|
|
22
|
-
<height>32</height>
|
|
23
|
-
</rect>
|
|
24
|
-
</property>
|
|
25
|
-
<property name="orientation">
|
|
26
|
-
<enum>Qt::Horizontal</enum>
|
|
27
|
-
</property>
|
|
28
|
-
<property name="standardButtons">
|
|
29
|
-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
30
|
-
</property>
|
|
31
|
-
</widget>
|
|
32
|
-
<widget class="QWidget" name="formLayoutWidget">
|
|
33
|
-
<property name="geometry">
|
|
34
|
-
<rect>
|
|
35
|
-
<x>10</x>
|
|
36
|
-
<y>40</y>
|
|
37
|
-
<width>521</width>
|
|
38
|
-
<height>241</height>
|
|
39
|
-
</rect>
|
|
40
|
-
</property>
|
|
41
|
-
<layout class="QFormLayout" name="formLayout">
|
|
42
|
-
<item row="0" column="0">
|
|
43
|
-
<widget class="QLabel" name="label">
|
|
44
|
-
<property name="font">
|
|
45
|
-
<font>
|
|
46
|
-
<family>MS Sans Serif</family>
|
|
47
|
-
<pointsize>10</pointsize>
|
|
48
|
-
</font>
|
|
49
|
-
</property>
|
|
50
|
-
<property name="text">
|
|
51
|
-
<string>New Project Name:</string>
|
|
52
|
-
</property>
|
|
53
|
-
</widget>
|
|
54
|
-
</item>
|
|
55
|
-
<item row="1" column="0">
|
|
56
|
-
<widget class="QLabel" name="label_2">
|
|
57
|
-
<property name="font">
|
|
58
|
-
<font>
|
|
59
|
-
<family>MS Sans Serif</family>
|
|
60
|
-
<pointsize>10</pointsize>
|
|
61
|
-
</font>
|
|
62
|
-
</property>
|
|
63
|
-
<property name="text">
|
|
64
|
-
<string>Project Location:</string>
|
|
65
|
-
</property>
|
|
66
|
-
</widget>
|
|
67
|
-
</item>
|
|
68
|
-
<item row="2" column="0">
|
|
69
|
-
<widget class="QLabel" name="label_3">
|
|
70
|
-
<property name="font">
|
|
71
|
-
<font>
|
|
72
|
-
<family>MS Sans Serif</family>
|
|
73
|
-
<pointsize>10</pointsize>
|
|
74
|
-
</font>
|
|
75
|
-
</property>
|
|
76
|
-
<property name="text">
|
|
77
|
-
<string>Project Description:</string>
|
|
78
|
-
</property>
|
|
79
|
-
</widget>
|
|
80
|
-
</item>
|
|
81
|
-
<item row="0" column="1">
|
|
82
|
-
<widget class="QLineEdit" name="lineEdit"/>
|
|
83
|
-
</item>
|
|
84
|
-
<item row="1" column="1">
|
|
85
|
-
<widget class="QLineEdit" name="lineEdit_2"/>
|
|
86
|
-
</item>
|
|
87
|
-
<item row="2" column="1">
|
|
88
|
-
<widget class="QTextEdit" name="textEdit"/>
|
|
89
|
-
</item>
|
|
90
|
-
<item row="3" column="0">
|
|
91
|
-
<widget class="QLabel" name="label_4">
|
|
92
|
-
<property name="font">
|
|
93
|
-
<font>
|
|
94
|
-
<family>MS Sans Serif</family>
|
|
95
|
-
<pointsize>10</pointsize>
|
|
96
|
-
</font>
|
|
97
|
-
</property>
|
|
98
|
-
<property name="text">
|
|
99
|
-
<string>Project License:</string>
|
|
100
|
-
</property>
|
|
101
|
-
</widget>
|
|
102
|
-
</item>
|
|
103
|
-
<item row="3" column="1">
|
|
104
|
-
<widget class="QComboBox" name="comboBox">
|
|
105
|
-
<item>
|
|
106
|
-
<property name="text">
|
|
107
|
-
<string>Apache License 2.0</string>
|
|
108
|
-
</property>
|
|
109
|
-
</item>
|
|
110
|
-
<item>
|
|
111
|
-
<property name="text">
|
|
112
|
-
<string>Artistic License/GPL</string>
|
|
113
|
-
</property>
|
|
114
|
-
</item>
|
|
115
|
-
<item>
|
|
116
|
-
<property name="text">
|
|
117
|
-
<string>Eclipse Plugin License 1.0</string>
|
|
118
|
-
</property>
|
|
119
|
-
</item>
|
|
120
|
-
<item>
|
|
121
|
-
<property name="text">
|
|
122
|
-
<string>GNU General Public License v2</string>
|
|
123
|
-
</property>
|
|
124
|
-
</item>
|
|
125
|
-
<item>
|
|
126
|
-
<property name="text">
|
|
127
|
-
<string>GNU General Public License v3</string>
|
|
128
|
-
</property>
|
|
129
|
-
</item>
|
|
130
|
-
<item>
|
|
131
|
-
<property name="text">
|
|
132
|
-
<string>GNU Lesser General Public License</string>
|
|
133
|
-
</property>
|
|
134
|
-
</item>
|
|
135
|
-
<item>
|
|
136
|
-
<property name="text">
|
|
137
|
-
<string>MIT License</string>
|
|
138
|
-
</property>
|
|
139
|
-
</item>
|
|
140
|
-
<item>
|
|
141
|
-
<property name="text">
|
|
142
|
-
<string>Mozilla Public License 1.1</string>
|
|
143
|
-
</property>
|
|
144
|
-
</item>
|
|
145
|
-
<item>
|
|
146
|
-
<property name="text">
|
|
147
|
-
<string>New BSD License</string>
|
|
148
|
-
</property>
|
|
149
|
-
</item>
|
|
150
|
-
<item>
|
|
151
|
-
<property name="text">
|
|
152
|
-
<string>Other</string>
|
|
153
|
-
</property>
|
|
154
|
-
</item>
|
|
155
|
-
</widget>
|
|
156
|
-
</item>
|
|
157
|
-
</layout>
|
|
158
|
-
</widget>
|
|
159
|
-
</widget>
|
|
160
|
-
<resources/>
|
|
161
|
-
<connections>
|
|
162
|
-
<connection>
|
|
163
|
-
<sender>buttonBox</sender>
|
|
164
|
-
<signal>accepted()</signal>
|
|
165
|
-
<receiver>Dialog</receiver>
|
|
166
|
-
<slot>accept()</slot>
|
|
167
|
-
<hints>
|
|
168
|
-
<hint type="sourcelabel">
|
|
169
|
-
<x>248</x>
|
|
170
|
-
<y>254</y>
|
|
171
|
-
</hint>
|
|
172
|
-
<hint type="destinationlabel">
|
|
173
|
-
<x>157</x>
|
|
174
|
-
<y>274</y>
|
|
175
|
-
</hint>
|
|
176
|
-
</hints>
|
|
177
|
-
</connection>
|
|
178
|
-
<connection>
|
|
179
|
-
<sender>buttonBox</sender>
|
|
180
|
-
<signal>rejected()</signal>
|
|
181
|
-
<receiver>Dialog</receiver>
|
|
182
|
-
<slot>reject()</slot>
|
|
183
|
-
<hints>
|
|
184
|
-
<hint type="sourcelabel">
|
|
185
|
-
<x>316</x>
|
|
186
|
-
<y>260</y>
|
|
187
|
-
</hint>
|
|
188
|
-
<hint type="destinationlabel">
|
|
189
|
-
<x>286</x>
|
|
190
|
-
<y>274</y>
|
|
191
|
-
</hint>
|
|
192
|
-
</hints>
|
|
193
|
-
</connection>
|
|
194
|
-
</connections>
|
|
195
|
-
</ui>
|
Widget/__init__.py
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
from editor import Editor
|
|
2
|
-
from tab import
|
|
2
|
+
from tab import *
|
|
3
|
-
from tree import
|
|
3
|
+
from tree import *
|
|
4
4
|
from adb import Adb
|
|
5
5
|
from ant import Ant
|
|
6
6
|
from parser import Parser
|
|
7
7
|
from command import Command
|
|
8
8
|
from ipython import PyInterp
|
|
9
9
|
from style import *
|
|
10
|
-
from dialogs import *
|
|
10
|
+
from dialogs import *
|
|
11
|
+
from audio import Audio
|
|
12
|
+
from image import Image
|
Widget/__init__.pyc
CHANGED
|
Binary file
|
Widget/ant.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from globals import adblist,device
|
|
1
|
+
from globals import adblist,device,ospathjoin
|
|
2
2
|
from PyQt4.QtGui import QWidget
|
|
3
3
|
from PyQt4.QtCore import pyqtSignal,SIGNAL,QThread,QProcess,QString,QTimer
|
|
4
4
|
from workthread import WorkThread
|
|
@@ -53,35 +53,57 @@ class Ant(QWidget):
|
|
|
53
53
|
self.parent.textEdit.append(line)
|
|
54
54
|
|
|
55
55
|
def newstart(self,no,cmd):
|
|
56
|
-
|
|
56
|
+
self.parent.textEdit.append("Finished")
|
|
57
|
+
self.parent.textEdit.append(cmd)
|
|
57
58
|
|
|
59
|
+
def showOutput(self):
|
|
60
|
+
if(self.parent.tabWidget_3.isHidden()):
|
|
61
|
+
self.parent.tabWidget_3.show()
|
|
62
|
+
self.parent.tabWidget_3.setCurrentIndex(1)
|
|
58
63
|
|
|
59
|
-
def create(self):
|
|
64
|
+
def create(self,prj):
|
|
60
65
|
if self.isRunning == False:
|
|
61
66
|
self.isRunning = True
|
|
67
|
+
self.showOutput()
|
|
68
|
+
self.parent.textEdit.clear()
|
|
62
|
-
self.parent.textEdit.append("
|
|
69
|
+
self.parent.textEdit.append("Creating... "+prj.getPath())
|
|
63
|
-
self.adb_thread.setCmd("android update project -p "+prj)
|
|
70
|
+
self.adb_thread.setCmd("android.bat update project -p "+prj.getPath())
|
|
64
71
|
self.adb_thread.run()
|
|
65
72
|
|
|
66
|
-
def build(self):
|
|
73
|
+
def build(self,prj):
|
|
67
74
|
if self.isRunning == False:
|
|
68
75
|
self.isRunning = True
|
|
76
|
+
self.showOutput()
|
|
69
|
-
self.parent.textEdit.
|
|
77
|
+
self.parent.textEdit.clear()
|
|
78
|
+
self.parent.textEdit.append("Ant Building Debug... "+ospathjoin(prj.getPath(),"build.xml"))
|
|
70
|
-
self.adb_thread.setCmd("ant debug "+prj)
|
|
79
|
+
self.adb_thread.setCmd("ant.bat debug -buildfile "+ospathjoin(prj.getPath(),"build.xml"))
|
|
71
80
|
self.adb_thread.run()
|
|
72
81
|
|
|
73
|
-
def clean(self):
|
|
82
|
+
def clean(self,prj):
|
|
74
83
|
if self.isRunning == False:
|
|
75
84
|
self.isRunning = True
|
|
85
|
+
self.showOutput()
|
|
86
|
+
self.parent.textEdit.clear()
|
|
76
|
-
self.parent.textEdit.append("
|
|
87
|
+
self.parent.textEdit.append("Ant Cleaning... "+prj.getPath())
|
|
77
|
-
self.adb_thread.setCmd("ant clean "+prj)
|
|
88
|
+
self.adb_thread.setCmd("ant.bat clean -buildfile "+ospathjoin(prj.getPath(),"build.xml"))
|
|
78
89
|
self.adb_thread.run()
|
|
79
90
|
|
|
80
|
-
def buildRun(self):
|
|
91
|
+
def buildRun(self,prj):
|
|
81
92
|
if self.isRunning == False:
|
|
82
93
|
self.isRunning = True
|
|
94
|
+
self.showOutput()
|
|
95
|
+
self.parent.textEdit.clear()
|
|
96
|
+
self.parent.textEdit.append("Ant Building and Installing... "+ospathjoin(prj.getPath(),"build.xml"))
|
|
97
|
+
self.adb_thread.setCmd("ant.bat debug install -buildfile "+ospathjoin(prj.getPath(),"build.xml"))
|
|
98
|
+
self.adb_thread.run()
|
|
99
|
+
|
|
100
|
+
def run(self,prj):
|
|
101
|
+
if self.isRunning == False:
|
|
102
|
+
self.isRunning = True
|
|
103
|
+
self.showOutput()
|
|
104
|
+
self.parent.textEdit.clear()
|
|
83
|
-
self.parent.textEdit.append("
|
|
105
|
+
self.parent.textEdit.append("Installing... "+prj.getPath())
|
|
84
|
-
self.adb_thread.setCmd("ant
|
|
106
|
+
self.adb_thread.setCmd("ant.bat install -buildfile "+ospathjoin(prj.getPath(),"build.xml"))
|
|
85
107
|
self.adb_thread.run()
|
|
86
108
|
|
|
87
109
|
def close(self):
|
Widget/audio.py
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from PyQt4 import QtCore, QtGui
|
|
3
|
+
from PyQt4.phonon import Phonon
|
|
4
|
+
|
|
5
|
+
class Audio(QtGui.QDialog):
|
|
6
|
+
def __init__(self,parent,nfile):
|
|
7
|
+
QtGui.QDialog.__init__(self,parent)
|
|
8
|
+
self.resize(300, 250)
|
|
9
|
+
self.audioOutput = Phonon.AudioOutput(Phonon.MusicCategory, self)
|
|
10
|
+
self.mediaObject = Phonon.MediaObject(self)
|
|
11
|
+
|
|
12
|
+
self.mediaObject.setTickInterval(1000)
|
|
13
|
+
self.mediaObject.tick.connect(self.tick)
|
|
14
|
+
self.mediaObject.stateChanged.connect(self.stateChanged)
|
|
15
|
+
|
|
16
|
+
Phonon.createPath(self.mediaObject, self.audioOutput)
|
|
17
|
+
|
|
18
|
+
self.setupActions()
|
|
19
|
+
self.setupUi()
|
|
20
|
+
self.timeLcd.display("00:00")
|
|
21
|
+
self.finished.connect(self.stop)
|
|
22
|
+
if nfile == "":
|
|
23
|
+
return
|
|
24
|
+
self.mediaObject.enqueue(Phonon.MediaSource(nfile))
|
|
25
|
+
self.mediaObject.play()
|
|
26
|
+
|
|
27
|
+
def stop(self):
|
|
28
|
+
#print "stopping"
|
|
29
|
+
#self.mediaObject.stop()
|
|
30
|
+
#self.mediaObject.clearQueue()
|
|
31
|
+
self.mediaObject.deleteLater()
|
|
32
|
+
|
|
33
|
+
def stateChanged(self, newState, oldState):
|
|
34
|
+
if newState == Phonon.ErrorState:
|
|
35
|
+
if self.mediaObject.errorType() == Phonon.FatalError:
|
|
36
|
+
QtGui.QMessageBox.warning(self, "Fatal Error",
|
|
37
|
+
self.mediaObject.errorString())
|
|
38
|
+
else:
|
|
39
|
+
QtGui.QMessageBox.warning(self, "Error",
|
|
40
|
+
self.mediaObject.errorString())
|
|
41
|
+
|
|
42
|
+
elif newState == Phonon.PlayingState:
|
|
43
|
+
self.playAction.setEnabled(False)
|
|
44
|
+
self.pauseAction.setEnabled(True)
|
|
45
|
+
self.stopAction.setEnabled(True)
|
|
46
|
+
|
|
47
|
+
elif newState == Phonon.StoppedState:
|
|
48
|
+
self.stopAction.setEnabled(False)
|
|
49
|
+
self.playAction.setEnabled(True)
|
|
50
|
+
self.pauseAction.setEnabled(False)
|
|
51
|
+
self.timeLcd.display("00:00")
|
|
52
|
+
|
|
53
|
+
elif newState == Phonon.PausedState:
|
|
54
|
+
self.pauseAction.setEnabled(False)
|
|
55
|
+
self.stopAction.setEnabled(True)
|
|
56
|
+
self.playAction.setEnabled(True)
|
|
57
|
+
|
|
58
|
+
def tick(self, time):
|
|
59
|
+
displayTime = QtCore.QTime(0, (time / 60000) % 60, (time / 1000) % 60)
|
|
60
|
+
self.timeLcd.display(displayTime.toString('mm:ss'))
|
|
61
|
+
|
|
62
|
+
def setupActions(self):
|
|
63
|
+
self.playAction = QtGui.QAction(
|
|
64
|
+
self.style().standardIcon(QtGui.QStyle.SP_MediaPlay), "Play",
|
|
65
|
+
self, shortcut="Ctrl+P", enabled=False,
|
|
66
|
+
triggered=self.mediaObject.play)
|
|
67
|
+
|
|
68
|
+
self.pauseAction = QtGui.QAction(
|
|
69
|
+
self.style().standardIcon(QtGui.QStyle.SP_MediaPause),
|
|
70
|
+
"Pause", self, shortcut="Ctrl+A", enabled=False,
|
|
71
|
+
triggered=self.mediaObject.pause)
|
|
72
|
+
|
|
73
|
+
self.stopAction = QtGui.QAction(
|
|
74
|
+
self.style().standardIcon(QtGui.QStyle.SP_MediaStop), "Stop",
|
|
75
|
+
self, shortcut="Ctrl+S", enabled=False,
|
|
76
|
+
triggered=self.mediaObject.stop)
|
|
77
|
+
|
|
78
|
+
def setupUi(self):
|
|
79
|
+
bar = QtGui.QToolBar()
|
|
80
|
+
|
|
81
|
+
bar.addAction(self.playAction)
|
|
82
|
+
bar.addAction(self.pauseAction)
|
|
83
|
+
bar.addAction(self.stopAction)
|
|
84
|
+
|
|
85
|
+
self.seekSlider = Phonon.SeekSlider(self)
|
|
86
|
+
self.seekSlider.setMediaObject(self.mediaObject)
|
|
87
|
+
|
|
88
|
+
self.volumeSlider = Phonon.VolumeSlider(self)
|
|
89
|
+
self.volumeSlider.setAudioOutput(self.audioOutput)
|
|
90
|
+
self.volumeSlider.setSizePolicy(QtGui.QSizePolicy.Maximum,
|
|
91
|
+
QtGui.QSizePolicy.Maximum)
|
|
92
|
+
|
|
93
|
+
volumeLabel = QtGui.QLabel()
|
|
94
|
+
volumeLabel.setPixmap(QtGui.QPixmap('images/volume.png'))
|
|
95
|
+
|
|
96
|
+
palette = QtGui.QPalette()
|
|
97
|
+
palette.setBrush(QtGui.QPalette.Light, QtCore.Qt.darkGray)
|
|
98
|
+
|
|
99
|
+
self.timeLcd = QtGui.QLCDNumber()
|
|
100
|
+
#self.timeLcd.setFixedSize(35,35)
|
|
101
|
+
self.timeLcd.setPalette(palette)
|
|
102
|
+
|
|
103
|
+
seekerLayout = QtGui.QHBoxLayout()
|
|
104
|
+
seekerLayout.addWidget(self.seekSlider)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
playbackLayout = QtGui.QHBoxLayout()
|
|
108
|
+
playbackLayout.addWidget(bar)
|
|
109
|
+
playbackLayout.addStretch()
|
|
110
|
+
playbackLayout.addWidget(volumeLabel)
|
|
111
|
+
playbackLayout.addWidget(self.volumeSlider)
|
|
112
|
+
|
|
113
|
+
mainLayout = QtGui.QVBoxLayout()
|
|
114
|
+
mainLayout.addLayout(seekerLayout)
|
|
115
|
+
mainLayout.addLayout(playbackLayout)
|
|
116
|
+
mainLayout.addWidget(self.timeLcd)
|
|
117
|
+
|
|
118
|
+
widget = QtGui.QWidget()
|
|
119
|
+
widget.setLayout(mainLayout)
|
|
120
|
+
self.setLayout(mainLayout)
|
|
121
|
+
#self.setWindowTitle("Audio Player")
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
if __name__ == '__main__':
|
|
125
|
+
app = QtGui.QApplication(sys.argv)
|
|
126
|
+
window = Audio()
|
|
127
|
+
window.show()
|
|
128
|
+
sys.exit(app.exec_())
|
Widget/command.py
CHANGED
|
@@ -21,10 +21,9 @@ class Command(QWidget):
|
|
|
21
21
|
|
|
22
22
|
def setCmdLine(self):
|
|
23
23
|
com = self.parent.combo.itemText(self.parent.combo.currentIndex())
|
|
24
|
-
self.cmd = str(com+" "+self.parent.
|
|
24
|
+
self.cmd = str(com+" "+self.parent.combo2.itemText(self.parent.combo2.currentIndex()))
|
|
25
|
-
if self.cmd != "":
|
|
26
|
-
|
|
25
|
+
self.parent.textEdit.clear()
|
|
27
|
-
|
|
26
|
+
self.run()
|
|
28
27
|
|
|
29
28
|
def finished(self,no,cmd):
|
|
30
29
|
if(no == 0):
|
Widget/dialogs.py
CHANGED
|
@@ -214,7 +214,7 @@ class DialogAbout(QtGui.QMessageBox):
|
|
|
214
214
|
POSSIBILITY OF SUCH DAMAGE.
|
|
215
215
|
""" % (__version__,PY_VERSION,QtCore.QT_VERSION_STR, QtCore.PYQT_VERSION_STR,OS_NAME)
|
|
216
216
|
self.about(self,"About",text)
|
|
217
|
-
|
|
217
|
+
|
|
218
218
|
class TodoWidget(QtGui.QWidget):
|
|
219
219
|
def __init__(self,parent,task=None):
|
|
220
220
|
QtGui.QWidget.__init__(self,parent)
|
|
@@ -225,8 +225,8 @@ class TodoWidget(QtGui.QWidget):
|
|
|
225
225
|
self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label)
|
|
226
226
|
self.task = QtGui.QLineEdit(self)
|
|
227
227
|
self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.task)
|
|
228
|
-
self.
|
|
228
|
+
self.ok = QtGui.QPushButton("add",self)
|
|
229
|
-
self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.
|
|
229
|
+
self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ok)
|
|
230
230
|
self.label_2 = QtGui.QLabel(self)
|
|
231
231
|
self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_2)
|
|
232
232
|
self.dateTime = QtGui.QDateTimeEdit(self)
|
|
@@ -234,53 +234,8 @@ class TodoWidget(QtGui.QWidget):
|
|
|
234
234
|
self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.dateTime)
|
|
235
235
|
|
|
236
236
|
self.verticalLayout.addLayout(self.formLayout)
|
|
237
|
-
self.label.setBuddy(self.task)
|
|
238
|
-
self.label_2.setBuddy(self.dateTime)
|
|
239
|
-
#QtCore.QObject.connect(self.dateTime, QtCore.SIGNAL(("dateTimeChanged(QDateTime)")), self.save)
|
|
240
|
-
#QtCore.QObject.connect(self.done, QtCore.SIGNAL(("stateChanged(int)")), self.save)
|
|
241
|
-
#QtCore.QObject.connect(self.task, QtCore.SIGNAL(("textChanged(QString)")), selfsave)
|
|
242
|
-
#QtCore.QObject.connect(self.tags, QtCore.SIGNAL(("textChanged(QString)")), self.save)
|
|
243
|
-
self.setTabOrder(self.task, self.done)
|
|
244
|
-
#self.setWindowTitle("Form")
|
|
245
237
|
self.label.setText("Task:")
|
|
246
|
-
self.done.setText("Finished")
|
|
247
|
-
self.label_2.setText("Due Date:")
|
|
248
238
|
self.item=None
|
|
249
|
-
|
|
250
|
-
def edit(self,item):
|
|
251
|
-
"""Takes an item, loads the widget with the item's
|
|
252
|
-
task contents, shows the widget"""
|
|
253
|
-
self.item=item
|
|
254
|
-
self.task.setText(self.item.task.text)
|
|
255
|
-
self.done.setChecked(self.item.task.done)
|
|
256
|
-
dt=self.item.task.date
|
|
257
|
-
if dt:
|
|
258
|
-
self.dateTime.setDate(QtCore.QDate(dt.year,dt.month,dt.day))
|
|
259
|
-
self.dateTime.setTime(QtCore.QTime(dt.hour,dt.minute))
|
|
260
|
-
else:
|
|
261
|
-
self.dateTime.setDateTime(QtCore.QDateTime())
|
|
262
|
-
self.show()
|
|
263
|
-
|
|
264
|
-
def save(self):
|
|
265
|
-
if self.item==None:
|
|
266
|
-
return
|
|
267
|
-
# Save date and time in the task
|
|
268
|
-
d=self.dateTime.date()
|
|
269
|
-
t=self.dateTime.time()
|
|
270
|
-
|
|
271
|
-
self.item.task.date=datetime(
|
|
272
|
-
d.year(),
|
|
273
|
-
d.month(),
|
|
274
|
-
d.day(),
|
|
275
|
-
t.hour(),
|
|
276
|
-
t.minute()
|
|
277
|
-
)
|
|
278
|
-
|
|
279
|
-
# Save text in the task
|
|
280
|
-
self.item.task.text=str(self.task.text())
|
|
281
|
-
# Display the data in the item
|
|
282
|
-
self.item.setText(0,self.item.task.text)
|
|
283
|
-
self.item.setText(1,str(self.item.task.date))
|
|
284
239
|
|
|
285
240
|
class DialogTodo(QtGui.QDialog):
|
|
286
241
|
def __init__(self,parent = None):
|
|
@@ -297,32 +252,66 @@ class DialogTodo(QtGui.QDialog):
|
|
|
297
252
|
self.list.setUniformRowHeights(True)
|
|
298
253
|
self.list.setAllColumnsShowFocus(True)
|
|
299
254
|
self.list.setSortingEnabled(True)
|
|
300
|
-
self.list.headerItem().setText(0,"Date")
|
|
301
|
-
self.list.headerItem().setText(
|
|
255
|
+
self.list.headerItem().setText(0,"Task")
|
|
256
|
+
self.list.setColumnCount(1)
|
|
257
|
+
self.list.setStyleSheet("QTreeWidget::item{height:24px;font-size:20px}");
|
|
258
|
+
#self.list.headerItem().setText(1,"Date")
|
|
302
259
|
self.editor = TodoWidget(self.horizontalLayoutWidget)
|
|
303
260
|
self.toolBar = QtGui.QToolBar(self)
|
|
304
261
|
self.actionDelete_Task = QtGui.QAction(self)
|
|
305
262
|
self.actionDelete_Task.setIcon(Icons.close_view)
|
|
263
|
+
self.actionDelete_Task.triggered.connect(self.delItem)
|
|
306
264
|
self.actionNew_Task = QtGui.QAction(self)
|
|
307
265
|
self.actionNew_Task.setIcon(Icons.add)
|
|
308
|
-
self.actionNew_Task.triggered.connect(self.
|
|
266
|
+
self.actionNew_Task.triggered.connect(self.showAddBar)
|
|
309
267
|
self.actionEdit_Task = QtGui.QAction(self)
|
|
310
|
-
self.actionEdit_Task.setChecked(False)
|
|
311
|
-
self.actionEdit_Task.setIcon(Icons.cut_edit)
|
|
312
268
|
self.toolBar.addAction(self.actionNew_Task)
|
|
313
269
|
self.toolBar.addAction(self.actionDelete_Task)
|
|
314
|
-
self.toolBar.addAction(self.actionEdit_Task)
|
|
315
270
|
self.actionDelete_Task.setShortcut("Del")
|
|
316
271
|
self.horizontalLayout.addWidget(self.toolBar)
|
|
317
272
|
self.horizontalLayout.addWidget(self.list)
|
|
318
273
|
self.horizontalLayout.addWidget(self.editor)
|
|
319
274
|
self.editor.hide()
|
|
275
|
+
self.editor.ok.clicked.connect(self.enterText)
|
|
276
|
+
self.taskList = []
|
|
277
|
+
temp = config.todo()
|
|
278
|
+
if(temp != None):
|
|
279
|
+
if(len(temp) != 0):
|
|
280
|
+
for i in temp:
|
|
281
|
+
self.addItem(i)
|
|
282
|
+
|
|
320
283
|
|
|
321
|
-
def
|
|
284
|
+
def showAddBar(self):
|
|
322
285
|
if(self.editor.isHidden()):
|
|
323
286
|
self.editor.show()
|
|
324
287
|
else:
|
|
325
288
|
self.editor.hide()
|
|
289
|
+
|
|
290
|
+
def enterText(self):
|
|
291
|
+
text = self.editor.task.text()
|
|
292
|
+
self.addItem(str(text))
|
|
293
|
+
|
|
294
|
+
def addItem(self,text):
|
|
295
|
+
if(text != ""):
|
|
296
|
+
if(self.taskList != None):
|
|
297
|
+
if(len(self.taskList) != 0):
|
|
298
|
+
if(text not in self.taskList):
|
|
299
|
+
self.taskList.append(text)
|
|
300
|
+
i = QtGui.QTreeWidgetItem(self.list)
|
|
301
|
+
i.setText(0,text)
|
|
302
|
+
self.list.addTopLevelItem(i)
|
|
303
|
+
config.setTodo(self.taskList)
|
|
304
|
+
else:
|
|
305
|
+
self.taskList.append(text)
|
|
306
|
+
i = QtGui.QTreeWidgetItem(self.list)
|
|
307
|
+
i.setText(0,text)
|
|
308
|
+
self.list.addTopLevelItem(i)
|
|
309
|
+
config.setTodo(self.taskList)
|
|
310
|
+
|
|
311
|
+
def delItem(self):
|
|
312
|
+
item = self.list.takeTopLevelItem(self.list.indexOfTopLevelItem(self.list.currentItem()))
|
|
313
|
+
self.taskList.remove(item.text(0))
|
|
314
|
+
config.setTodo(self.taskList)
|
|
326
315
|
|
|
327
316
|
class DialogAbout2(QtGui.QDialog):
|
|
328
317
|
def __init__(self, parent=None):
|
Widget/image.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from PyQt4.QtGui import QColor,QPalette,QLabel,QDialog,QPixmap,QScrollArea,QVBoxLayout
|
|
2
|
+
|
|
3
|
+
class Image(QDialog):
|
|
4
|
+
def __init__(self,parent,nfile):
|
|
5
|
+
QDialog.__init__(self,parent)
|
|
6
|
+
tab = QLabel()
|
|
7
|
+
pal = QPalette(self.palette())
|
|
8
|
+
bgcolor = QColor("#ffffff")
|
|
9
|
+
pal.setColor(QPalette.Background,bgcolor)
|
|
10
|
+
tab.setPalette(pal)
|
|
11
|
+
if nfile == "":
|
|
12
|
+
return
|
|
13
|
+
pix = QPixmap(nfile)
|
|
14
|
+
tab.setPixmap(pix)
|
|
15
|
+
scrollArea = QScrollArea()
|
|
16
|
+
scrollArea.setWidget(tab)
|
|
17
|
+
mainLayout = QVBoxLayout()
|
|
18
|
+
mainLayout.addWidget(scrollArea)
|
|
19
|
+
self.setLayout(mainLayout)
|
|
20
|
+
self.resize(pix.width()+25, pix.height()+25)
|
Widget/lexersquirrel.py
CHANGED
|
@@ -67,7 +67,7 @@ class LexerSquirrel(QsciLexerPython):
|
|
|
67
67
|
QsciStyle(2, QString("number"), QColor("#008000"), self.colorStyle.paper, self.boldFont, False),
|
|
68
68
|
QsciStyle(3, QString("DoubleQuotedString"), QColor("#008000"), self.colorStyle.paper, self.plainFont, True),
|
|
69
69
|
QsciStyle(4, QString("SingleQuotedString"), QColor("#008000"), self.colorStyle.paper, self.plainFont, True),
|
|
70
|
-
QsciStyle(5, QString("Keyword"), QColor("#
|
|
70
|
+
QsciStyle(5, QString("Keyword"), QColor("#00003f"), self.colorStyle.paper, self.boldFont, True),
|
|
71
71
|
QsciStyle(6, QString("TripleSingleQuotedString"), QColor("#ffd0d0"),self.colorStyle.paper, self.plainFont, True),
|
|
72
72
|
QsciStyle(7, QString("TripleDoubleQuotedString"),QColor("#001111"),self.colorStyle.paper, self.plainFont, False),
|
|
73
73
|
QsciStyle(8, QString("ClassName"), QColor("#000000"), self.colorStyle.paper, self.plainFont, False),
|
Widget/tab.py
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
from PyQt4.QtGui import (QTabWidget, QMenu, QDrag, QApplication,
|
|
2
|
-
|
|
2
|
+
QTabBar, QShortcut, QKeySequence, QWidget,
|
|
3
|
+
QHBoxLayout, QLabel, QPixmap, QScrollArea,
|
|
3
|
-
|
|
4
|
+
QPalette, QColor)
|
|
4
5
|
from PyQt4.QtCore import SIGNAL, Qt, QPoint, QMimeData, QByteArray
|
|
5
6
|
|
|
6
|
-
from PyQt4 import QtGui
|
|
7
|
-
from PyQt4 import QtCore
|
|
8
|
-
|
|
7
|
+
from globals import ossep,ospathbasename,Icons
|
|
9
8
|
|
|
10
9
|
class MyTabBar(QTabBar):
|
|
11
10
|
"""Tabs base class with drag and drop support"""
|
|
@@ -21,23 +20,23 @@ class MyTabBar(QTabBar):
|
|
|
21
20
|
|
|
22
21
|
def dragMoveEvent(self, event):
|
|
23
22
|
if event.mimeData().hasUrls:
|
|
24
|
-
event.setDropAction(
|
|
23
|
+
event.setDropAction(Qt.CopyAction)
|
|
25
24
|
event.accept()
|
|
26
25
|
else:
|
|
27
26
|
event.ignore()
|
|
28
27
|
|
|
29
28
|
def dropEvent(self, event):
|
|
30
29
|
if event.mimeData().hasUrls:
|
|
31
|
-
event.setDropAction(
|
|
30
|
+
event.setDropAction(Qt.CopyAction)
|
|
32
31
|
event.accept()
|
|
33
32
|
links = []
|
|
34
33
|
for url in event.mimeData().urls():
|
|
35
34
|
links.append(str(url.toLocalFile()))
|
|
36
|
-
self.emit(
|
|
35
|
+
self.emit(SIGNAL("dropped"), links)
|
|
37
36
|
else:
|
|
38
37
|
event.ignore()
|
|
39
38
|
|
|
40
|
-
class
|
|
39
|
+
class EditorTab(QTabWidget):
|
|
41
40
|
def __init__(self,parent):
|
|
42
41
|
QTabWidget.__init__(self,parent)
|
|
43
42
|
self.setTabBar(MyTabBar(self))
|
|
@@ -52,19 +51,123 @@ class Tab(QTabWidget):
|
|
|
52
51
|
|
|
53
52
|
def dragMoveEvent(self, event):
|
|
54
53
|
if event.mimeData().hasUrls:
|
|
55
|
-
event.setDropAction(
|
|
54
|
+
event.setDropAction(Qt.CopyAction)
|
|
56
55
|
event.accept()
|
|
57
56
|
else:
|
|
58
57
|
event.ignore()
|
|
59
58
|
|
|
60
59
|
def dropEvent(self, event):
|
|
61
60
|
if event.mimeData().hasUrls:
|
|
62
|
-
event.setDropAction(
|
|
61
|
+
event.setDropAction(Qt.CopyAction)
|
|
63
62
|
event.accept()
|
|
64
63
|
links = []
|
|
65
64
|
for url in event.mimeData().urls():
|
|
66
65
|
links.append(str(url.toLocalFile()))
|
|
67
|
-
self.emit(
|
|
66
|
+
self.emit(SIGNAL("dropped"), links)
|
|
67
|
+
else:
|
|
68
|
+
event.ignore()
|
|
69
|
+
|
|
70
|
+
def addItem(self,l):
|
|
71
|
+
self.emit(SIGNAL("dropped"),l)
|
|
72
|
+
|
|
73
|
+
class TreeTab(QTabWidget):
|
|
74
|
+
def __init__(self,parent):
|
|
75
|
+
QTabWidget.__init__(self,parent)
|
|
76
|
+
self.setTabBar(MyTabBar(self))
|
|
77
|
+
self.setAcceptDrops(True)
|
|
78
|
+
self.connect(self.tabBar(), SIGNAL("dropped"), self.addItem)
|
|
79
|
+
|
|
80
|
+
def dragEnterEvent(self, event):
|
|
81
|
+
if event.mimeData().hasUrls:
|
|
82
|
+
event.accept()
|
|
83
|
+
else:
|
|
84
|
+
event.ignore()
|
|
85
|
+
|
|
86
|
+
def dragMoveEvent(self, event):
|
|
87
|
+
if event.mimeData().hasUrls:
|
|
88
|
+
event.setDropAction(Qt.CopyAction)
|
|
89
|
+
event.accept()
|
|
90
|
+
else:
|
|
91
|
+
event.ignore()
|
|
92
|
+
|
|
93
|
+
def dropEvent(self, event):
|
|
94
|
+
if event.mimeData().hasUrls:
|
|
95
|
+
event.setDropAction(Qt.CopyAction)
|
|
96
|
+
event.accept()
|
|
97
|
+
links = []
|
|
98
|
+
for url in event.mimeData().urls():
|
|
99
|
+
links.append(str(url.toLocalFile()))
|
|
100
|
+
self.emit(SIGNAL("dropped"), links)
|
|
101
|
+
else:
|
|
102
|
+
event.ignore()
|
|
103
|
+
|
|
104
|
+
def addItem(self,l):
|
|
105
|
+
self.emit(SIGNAL("dropped"),l)
|
|
106
|
+
|
|
107
|
+
class OutputTab(QTabWidget):
|
|
108
|
+
def __init__(self,parent):
|
|
109
|
+
QTabWidget.__init__(self,parent)
|
|
110
|
+
#self.setTabBar(MyTabBar(self))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class Tiler(QTabWidget):
|
|
114
|
+
Count = 0
|
|
115
|
+
def __init__(self,parent):
|
|
116
|
+
QTabWidget.__init__(self,parent)
|
|
117
|
+
self.tabCloseRequested.connect(self.closeTab)
|
|
118
|
+
self.setAcceptDrops(True)
|
|
119
|
+
#self.connect(self.tabBar(), SIGNAL("dropped"), self.addItem)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def addImage(self,nfile):
|
|
123
|
+
#widgetLayout = QHBoxLayout()
|
|
124
|
+
tab = QLabel()
|
|
125
|
+
pal = QPalette(self.palette())
|
|
126
|
+
pal.setColor(QPalette.Background,QColor("#ffffff"))
|
|
127
|
+
tab.setPalette(pal)
|
|
128
|
+
tab.setPixmap(QPixmap(nfile))
|
|
129
|
+
#widgetLayout.addWidget(tab)
|
|
130
|
+
#widget.setLayout(widgetLayout)
|
|
131
|
+
scrollArea = QScrollArea()
|
|
132
|
+
scrollArea.setWidget(tab)
|
|
133
|
+
#dialogLayout = QVBoxLayout()
|
|
134
|
+
#dialogLayout.addWidget(scrollArea)
|
|
135
|
+
#self.setLayout(dialogLayout)
|
|
136
|
+
self.addTab(scrollArea, ospathbasename(nfile))
|
|
137
|
+
self.setCurrentIndex(self.Count)
|
|
138
|
+
self.Count+=1
|
|
139
|
+
|
|
140
|
+
def closeTab(self,index):
|
|
141
|
+
self.removeTab(index)
|
|
142
|
+
self.Count-=1
|
|
143
|
+
|
|
144
|
+
def hideTiler(self):
|
|
145
|
+
self.tiler.setCurrentIndex(0)
|
|
146
|
+
self.tiler.hide()
|
|
147
|
+
#if(self.currentIndex() == self.indexOf(self.cornerWidget())):
|
|
148
|
+
# return True
|
|
149
|
+
|
|
150
|
+
def dragEnterEvent(self, event):
|
|
151
|
+
if event.mimeData().hasUrls:
|
|
152
|
+
event.accept()
|
|
153
|
+
else:
|
|
154
|
+
event.ignore()
|
|
155
|
+
|
|
156
|
+
def dragMoveEvent(self, event):
|
|
157
|
+
if event.mimeData().hasUrls:
|
|
158
|
+
event.setDropAction(Qt.CopyAction)
|
|
159
|
+
event.accept()
|
|
160
|
+
else:
|
|
161
|
+
event.ignore()
|
|
162
|
+
|
|
163
|
+
def dropEvent(self, event):
|
|
164
|
+
if event.mimeData().hasUrls:
|
|
165
|
+
event.setDropAction(Qt.CopyAction)
|
|
166
|
+
event.accept()
|
|
167
|
+
links = []
|
|
168
|
+
for url in event.mimeData().urls():
|
|
169
|
+
links.append(str(url.toLocalFile()))
|
|
170
|
+
self.emit(SIGNAL("dropped"), links)
|
|
68
171
|
else:
|
|
69
172
|
event.ignore()
|
|
70
173
|
|
Widget/tab.pyc
CHANGED
|
Binary file
|
Widget/tree.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from PyQt4.QtGui import (QTreeWidgetItem,QTreeWidget,QMessageBox,
|
|
2
|
-
QIcon,QDrag,QMenu,QAction,QInputDialog,QCursor,QToolBar
|
|
2
|
+
QIcon,QDrag,QMenu,QAction,QInputDialog,QCursor,QToolBar,
|
|
3
|
+
QHeaderView,QFileDialog)
|
|
3
4
|
from PyQt4.QtCore import SIGNAL,Qt,QMimeData,QUrl,QPoint
|
|
4
5
|
from globals import (oslistdir,ospathisdir,ospathsep,ospathjoin,ospathexists,
|
|
5
6
|
ospathbasename,os_icon,osremove,osrename,ospathdirname,
|
|
@@ -11,7 +12,7 @@ class Dir(QTreeWidgetItem):
|
|
|
11
12
|
QTreeWidgetItem.__init__(self,parent)
|
|
12
13
|
self.path = ospathjoin(path,name)
|
|
13
14
|
self.setText (0, name)
|
|
14
|
-
self.setIcon(0,Icons.
|
|
15
|
+
self.setIcon(0,Icons.foldej)
|
|
15
16
|
|
|
16
17
|
def getPath(self):
|
|
17
18
|
return self.path
|
|
@@ -30,28 +31,30 @@ class File(QTreeWidgetItem):
|
|
|
30
31
|
self.setText (0, name)
|
|
31
32
|
self.doc = False
|
|
32
33
|
self.pic = False
|
|
34
|
+
self.audio = False
|
|
33
35
|
#mime = QMimeData()
|
|
34
36
|
#mime.setUrls([QUrl.fromLocalFile(self.path)])
|
|
35
37
|
#print self.path+":"+str(mime.hasUrls())
|
|
38
|
+
self.setIcon(0,Icons.file_obj)
|
|
36
39
|
self.Doc(name)
|
|
37
40
|
self.Pic(name)
|
|
38
|
-
if not (self.doc and self.pic):
|
|
39
|
-
|
|
41
|
+
self.Audio(name)
|
|
40
|
-
|
|
41
42
|
|
|
42
43
|
def Doc(self,name):
|
|
43
44
|
for e in self.ext:
|
|
44
45
|
if name.endswith(e):
|
|
45
46
|
self.setIcon(0,Icons.file_obj)
|
|
46
47
|
self.doc = True
|
|
47
|
-
#if(name.endswith(".txt") or name.endswith(".nut") or name.endswith(".py")):
|
|
48
|
-
# self.setIcon(0,os_icon("file_obj"))
|
|
49
|
-
# self.doc = True
|
|
50
48
|
|
|
51
49
|
def Pic(self,name):
|
|
52
50
|
if(name.endswith(".png") or name.endswith(".gif") or name.endswith(".jpg")):
|
|
53
|
-
self.setIcon(0,Icons.
|
|
51
|
+
self.setIcon(0,Icons.image)
|
|
54
52
|
self.pic = True
|
|
53
|
+
|
|
54
|
+
def Audio(self,name):
|
|
55
|
+
if(name.endswith(".wav") or name.endswith(".mp3") or name.endswith(".ogg")):
|
|
56
|
+
self.setIcon(0,Icons.image)
|
|
57
|
+
self.audio = True
|
|
55
58
|
|
|
56
59
|
def getPath(self):
|
|
57
60
|
return self.path
|
|
@@ -65,6 +68,8 @@ class File(QTreeWidgetItem):
|
|
|
65
68
|
return self.doc
|
|
66
69
|
def isPic(self):
|
|
67
70
|
return self.pic
|
|
71
|
+
def isAudio(self):
|
|
72
|
+
return self.audio
|
|
68
73
|
|
|
69
74
|
class Project(QTreeWidgetItem):
|
|
70
75
|
Count = -1
|
|
@@ -107,7 +112,15 @@ class ProjectTree(QTreeWidget):
|
|
|
107
112
|
self.connect(self, SIGNAL("dropped"), self.addItem)
|
|
108
113
|
self.projects = []
|
|
109
114
|
self.closed = config.closedProjects()
|
|
115
|
+
if(self.closed == None):
|
|
110
|
-
|
|
116
|
+
self.closed = []
|
|
117
|
+
self.header().setStretchLastSection(False)
|
|
118
|
+
self.header().setResizeMode(QHeaderView.ResizeToContents)
|
|
119
|
+
#self.setColumnWidth(0,280)
|
|
120
|
+
|
|
121
|
+
def initProjects(self):
|
|
122
|
+
for pro in config.projects():
|
|
123
|
+
self.createProject(pro)
|
|
111
124
|
|
|
112
125
|
def readDir(self,parent,path):
|
|
113
126
|
for d in oslistdir(path):
|
|
@@ -138,21 +151,46 @@ class ProjectTree(QTreeWidget):
|
|
|
138
151
|
if not ospathisdir(ospathjoin(path,f)):
|
|
139
152
|
if not ospathjoin(f).startswith('.'):
|
|
140
153
|
File(parent,f,path)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def newProject(self):
|
|
157
|
+
fname = str(QFileDialog.getExistingDirectory(self,"Open Project Folder"))
|
|
158
|
+
if not (fname == ""):
|
|
159
|
+
fname = fname+"/"
|
|
160
|
+
if len(self.projects) != 0:
|
|
161
|
+
if(fname in self.projects):
|
|
162
|
+
QMessageBox.about(self, "Already Open","Project Already Open\n"+fname)
|
|
163
|
+
else:
|
|
164
|
+
self.createProject(fname)
|
|
165
|
+
else:
|
|
166
|
+
self.createProject(fname)
|
|
167
|
+
|
|
168
|
+
#Important all projects must go through this
|
|
169
|
+
def createProject(self,startDir):
|
|
170
|
+
if(ospathexists(startDir)):
|
|
171
|
+
self.projects.append(startDir)
|
|
172
|
+
self.addProject(startDir)
|
|
173
|
+
config.setProject(self.projects)
|
|
174
|
+
#print "adding"+startDir
|
|
175
|
+
else:
|
|
176
|
+
#print "removing"+startDir
|
|
177
|
+
self.projects.remove(startDir)
|
|
178
|
+
config.setProject(self.projects)
|
|
179
|
+
QMessageBox.about(self,"Can't Open Project","Project Does Not Exist %s"%startDir)
|
|
180
|
+
|
|
141
181
|
|
|
142
182
|
|
|
143
183
|
def addProject(self,startDir):
|
|
144
|
-
if(
|
|
184
|
+
if(len(self.closed) == len(self.projects)):
|
|
145
|
-
self.
|
|
185
|
+
self.closed.append(0)
|
|
146
|
-
|
|
186
|
+
if(self.closed[self.projects.index(startDir)] == 0):
|
|
147
|
-
|
|
187
|
+
i = Project(self,startDir)
|
|
148
|
-
|
|
188
|
+
self.addTopLevelItem(i)
|
|
149
|
-
|
|
189
|
+
self.readDir(i,startDir)
|
|
150
|
-
|
|
190
|
+
self.readMainFiles(i,startDir)
|
|
151
|
-
else:
|
|
152
|
-
i = Project(self,startDir,True)
|
|
153
|
-
self.addTopLevelItem(i)
|
|
154
191
|
else:
|
|
155
|
-
|
|
192
|
+
i = Project(self,startDir,True)
|
|
193
|
+
self.addTopLevelItem(i)
|
|
156
194
|
|
|
157
195
|
def addClosedProject(self,startDir):
|
|
158
196
|
if(ospathexists(startDir)):
|
|
@@ -162,6 +200,16 @@ class ProjectTree(QTreeWidget):
|
|
|
162
200
|
config.setClosedProjects(self.closed)
|
|
163
201
|
else:
|
|
164
202
|
QMessageBox.about(self,"Can't Close Project","Project Does Not Exist %s"%startDir)
|
|
203
|
+
|
|
204
|
+
def removeProject(self,item):
|
|
205
|
+
itemPath = item.getPath()
|
|
206
|
+
self.closed.pop(self.projects.index(itemPath))
|
|
207
|
+
config.setClosedProjects(self.closed)
|
|
208
|
+
self.projects.remove(itemPath)
|
|
209
|
+
config.setProject(self.projects)
|
|
210
|
+
self.takeTopLevelItem(self.indexOfTopLevelItem(item))
|
|
211
|
+
|
|
212
|
+
|
|
165
213
|
|
|
166
214
|
def addItem(self,links):
|
|
167
215
|
print links
|
|
@@ -249,13 +297,14 @@ class ProjectTree(QTreeWidget):
|
|
|
249
297
|
action_DeleteProject = QAction(Icons.trash,'Delete', self)
|
|
250
298
|
action_DeleteProject.triggered.connect(lambda:self.deleteProject(item))
|
|
251
299
|
|
|
252
|
-
|
|
300
|
+
action_CreateProject = QAction('Create', self)
|
|
301
|
+
action_CreateProject.triggered.connect(lambda:self.create(item))
|
|
253
302
|
action_BuildProject = QAction('Build', self)
|
|
254
303
|
action_BuildProject.triggered.connect(lambda:self.build(item))
|
|
255
304
|
action_BuildRunProject = QAction('Build and Run', self)
|
|
256
305
|
action_BuildRunProject.triggered.connect(lambda:self.buildRun(item))
|
|
257
306
|
action_CleanProject = QAction('Clean', self)
|
|
258
|
-
action_CleanProject.triggered.connect(lambda:self.
|
|
307
|
+
action_CleanProject.triggered.connect(lambda:self.clean(item))
|
|
259
308
|
action_RunProject = QAction('Run', self)
|
|
260
309
|
action_RunProject.triggered.connect(lambda:self.run(item))
|
|
261
310
|
if(item.isProject()):
|
|
@@ -263,6 +312,7 @@ class ProjectTree(QTreeWidget):
|
|
|
263
312
|
menu.addAction(action_Folder)
|
|
264
313
|
menu.addAction(action_File)
|
|
265
314
|
menu.addSeparator()
|
|
315
|
+
menu.addAction(action_CreateProject)
|
|
266
316
|
menu.addAction(action_BuildProject)
|
|
267
317
|
menu.addAction(action_BuildRunProject)
|
|
268
318
|
menu.addAction(action_RunProject)
|
|
@@ -331,14 +381,6 @@ class ProjectTree(QTreeWidget):
|
|
|
331
381
|
print ind+pro
|
|
332
382
|
self.addProject(pro)
|
|
333
383
|
|
|
334
|
-
def removeProject(self,item):
|
|
335
|
-
itemPath = item.getPath()
|
|
336
|
-
self.closed.pop(self.projects.index(itemPath))
|
|
337
|
-
config.setClosedProjects(self.closed)
|
|
338
|
-
self.projects.remove(itemPath)
|
|
339
|
-
config.removeProject(itemPath)
|
|
340
|
-
self.takeTopLevelItem(self.indexOfTopLevelItem(item))
|
|
341
|
-
|
|
342
384
|
|
|
343
385
|
def newFolder(self,item):
|
|
344
386
|
text,ok = QInputDialog.getText(self,"QInputDialog::getText()","Name:")
|
|
@@ -380,14 +422,16 @@ class ProjectTree(QTreeWidget):
|
|
|
380
422
|
def pasteDir(self,item):
|
|
381
423
|
pass
|
|
382
424
|
|
|
425
|
+
def create(self,item):
|
|
426
|
+
self.emit(SIGNAL("create"),item)
|
|
383
427
|
def build(self,item):
|
|
384
|
-
|
|
428
|
+
self.emit(SIGNAL("build"),item)
|
|
385
429
|
def buildRun(self,item):
|
|
386
|
-
|
|
430
|
+
self.emit(SIGNAL("buildRun"),item)
|
|
387
431
|
def clean(self,item):
|
|
388
|
-
|
|
432
|
+
self.emit(SIGNAL("clean"),item)
|
|
389
433
|
def run(self,item):
|
|
390
|
-
|
|
434
|
+
self.emit(SIGNAL("run"),item)
|
|
391
435
|
|
|
392
436
|
def renameProject(self,item):
|
|
393
437
|
itempath = item.getPath()
|
Widget/tree.pyc
CHANGED
|
Binary file
|
build/exe.win32-2.7/PyQt4.phonon.pyd
ADDED
|
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.yaml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
ADB:
|
|
2
|
-
- C:/CODE/
|
|
2
|
+
- C:/CODE/sabel.png /sdcard/
|
|
3
3
|
- com.emo_framework.examples/com.emo_framework.EmoActivity
|
|
4
4
|
- EmoFramework
|
|
5
5
|
- com.emo_framework.examples
|
|
@@ -7,30 +7,35 @@ ANT:
|
|
|
7
7
|
- android update project --target 5 --path .
|
|
8
8
|
- ant debug install
|
|
9
9
|
CMD:
|
|
10
|
-
- ADD
|
|
11
10
|
- GCC
|
|
12
11
|
- CMD
|
|
13
12
|
- PYTHON
|
|
14
13
|
- ADB
|
|
15
14
|
- G++
|
|
16
15
|
- Make
|
|
17
|
-
-
|
|
16
|
+
- SQ
|
|
17
|
+
- JAVA
|
|
18
|
+
ClosedProject:
|
|
19
|
+
- 0
|
|
20
|
+
- 0
|
|
18
21
|
File:
|
|
19
|
-
- C:/CODE/
|
|
22
|
+
- C:/CODE/datad/runtime.nut
|
|
20
|
-
- C:/CODE/assets/creditscene.nut
|
|
21
|
-
|
|
23
|
+
PARAM:
|
|
22
|
-
-
|
|
24
|
+
- dude
|
|
23
25
|
Project:
|
|
24
|
-
- C:/CODE/
|
|
26
|
+
- C:/CODE/datad/
|
|
25
|
-
- C:/CODE/assets/
|
|
26
|
-
Recent:
|
|
27
|
+
Recent: []
|
|
27
|
-
- C:\CODE\main.nut
|
|
28
28
|
Setting:
|
|
29
29
|
device: 1
|
|
30
30
|
fontname: Courier New
|
|
31
31
|
fontsize: 10
|
|
32
32
|
iconsize: 16
|
|
33
|
+
mode: 0
|
|
33
34
|
styleindex: 8
|
|
35
|
+
tabwidth: 4
|
|
34
36
|
thresh: 2
|
|
35
37
|
workspace: C:/CODE/
|
|
36
38
|
Style: 0
|
|
39
|
+
TODO:
|
|
40
|
+
- Remove Headers
|
|
41
|
+
- Rewrite code
|
build/exe.win32-2.7/library.zip
CHANGED
|
Binary file
|
build/exe.win32-2.7/phonon4.dll
ADDED
|
Binary file
|
build/exe.win32-2.7/phonon_backend/phonon_ds94.dll
ADDED
|
Binary file
|
config.py
CHANGED
|
@@ -54,6 +54,9 @@ class Config:
|
|
|
54
54
|
|
|
55
55
|
def projects(self):
|
|
56
56
|
return self.read('Project')
|
|
57
|
+
def setProject(self,pros):
|
|
58
|
+
self.data['Project'] = pros
|
|
59
|
+
self.write()
|
|
57
60
|
|
|
58
61
|
def closedProjects(self):
|
|
59
62
|
return self.read('ClosedProject')
|
|
@@ -66,28 +69,28 @@ class Config:
|
|
|
66
69
|
|
|
67
70
|
def files(self):
|
|
68
71
|
return self.read('File')
|
|
69
|
-
|
|
70
|
-
def
|
|
72
|
+
def setFile(self,files):
|
|
71
73
|
self.data['File'] = files
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
self.write()
|
|
74
|
-
|
|
75
|
+
|
|
75
|
-
|
|
76
76
|
def adb(self):
|
|
77
77
|
return self.read('ADB')
|
|
78
78
|
def setAdb(self,val):
|
|
79
|
-
self.data['ADB']
|
|
79
|
+
self.data['ADB'] = val
|
|
80
|
-
self.data['ADB'][1] = val[1]
|
|
81
|
-
self.data['ADB'][2] = val[2]
|
|
82
|
-
self.data['ADB'][3] = val[3]
|
|
83
80
|
self.write()
|
|
84
81
|
|
|
85
|
-
def
|
|
82
|
+
def cmds(self):
|
|
86
83
|
return self.read('CMD')
|
|
87
84
|
|
|
88
85
|
def setCmd(self,val):
|
|
89
|
-
for i in range(0,len(val)):
|
|
90
|
-
|
|
86
|
+
self.data['CMD'] = val
|
|
87
|
+
self.write()
|
|
88
|
+
|
|
89
|
+
def params(self):
|
|
90
|
+
return self.read('PARAM')
|
|
91
|
+
|
|
92
|
+
def setParam(self,val):
|
|
93
|
+
self.data['PARAM'] = val
|
|
91
94
|
self.write()
|
|
92
95
|
|
|
93
96
|
|
|
@@ -97,73 +100,15 @@ class Config:
|
|
|
97
100
|
return self.readSetting('styleindex')
|
|
98
101
|
def setstyleIndex(self,value):
|
|
99
102
|
self.writeSetting("styleindex",value)
|
|
103
|
+
|
|
104
|
+
def todo(self):
|
|
105
|
+
return self.read('TODO')
|
|
106
|
+
def setTodo(self,val):
|
|
107
|
+
self.data['TODO'] = val
|
|
108
|
+
self.write()
|
|
100
109
|
|
|
101
110
|
def write(self):
|
|
102
111
|
try:
|
|
103
112
|
yaml.dump(self.data,open(self.configfile,'w'),default_flow_style=False)
|
|
104
113
|
except:
|
|
105
|
-
QMessageBox.about(self,"Can't Open","cannot open config file\n"+self.configfile)
|
|
114
|
+
QMessageBox.about(self,"Can't Open","cannot open config file\n"+self.configfile)
|
|
106
|
-
|
|
107
|
-
def check(self,data,nfile):
|
|
108
|
-
#Python store reference to list so this points back to data
|
|
109
|
-
#so awesome and weird
|
|
110
|
-
#Must implement to add data not to rewrite data sad
|
|
111
|
-
if data != None:
|
|
112
|
-
for i in data:
|
|
113
|
-
if(i == nfile):
|
|
114
|
-
return False
|
|
115
|
-
return True
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
def addFile(self,nfile):
|
|
119
|
-
files = self.files()
|
|
120
|
-
if(files == None):
|
|
121
|
-
files = []
|
|
122
|
-
if(self.check(files,nfile)):
|
|
123
|
-
if(os.path.exists(nfile)):
|
|
124
|
-
files.append(nfile)
|
|
125
|
-
self.setfiles(files)
|
|
126
|
-
try:
|
|
127
|
-
yaml.dump(self.data,open(self.configfile,'w'),default_flow_style=False)
|
|
128
|
-
except:
|
|
129
|
-
QMessageBox.about(self,"Can't Open","cannot open config file\n"+self.configfile)
|
|
130
|
-
else:
|
|
131
|
-
QMessageBox.about(self,"Can't Open","File Does not Exist\n")
|
|
132
|
-
else:
|
|
133
|
-
#print "File is Already Saved" #need to fix this
|
|
134
|
-
pass
|
|
135
|
-
|
|
136
|
-
def removeFile(self,nfile):
|
|
137
|
-
files = self.files()
|
|
138
|
-
if not (self.check(files,nfile)):
|
|
139
|
-
files.remove(nfile)
|
|
140
|
-
try:
|
|
141
|
-
yaml.dump(self.data,open(self.configfile,'w'),default_flow_style=False)
|
|
142
|
-
except:
|
|
143
|
-
QMessageBox.about(self,"Can't Open","cannot open config file\n"+self.configfile)
|
|
144
|
-
|
|
145
|
-
def addProject(self,nfile):
|
|
146
|
-
pros = self.projects()
|
|
147
|
-
if pros == None:
|
|
148
|
-
pros = []
|
|
149
|
-
if(self.check(pros,nfile)):
|
|
150
|
-
if(os.path.exists(nfile)):
|
|
151
|
-
pros.append(nfile)
|
|
152
|
-
self.setProjects(pros)
|
|
153
|
-
try:
|
|
154
|
-
yaml.dump(self.data,open(self.configfile,'w'),default_flow_style=False)
|
|
155
|
-
except:
|
|
156
|
-
QMessageBox.about(self,"Can't Open","cannot open config file\n"+self.configfile)
|
|
157
|
-
else:
|
|
158
|
-
QMessageBox.about(self,"Can't Open","Folder Does not Exist\n")
|
|
159
|
-
else:
|
|
160
|
-
pass
|
|
161
|
-
|
|
162
|
-
def removeProject(self,nfile):
|
|
163
|
-
pros = self.projects()
|
|
164
|
-
if not(self.check(pros,nfile)):
|
|
165
|
-
pros.remove(nfile)
|
|
166
|
-
try:
|
|
167
|
-
yaml.dump(self.data,open(self.configfile,'w'),default_flow_style=False)
|
|
168
|
-
except:
|
|
169
|
-
QMessageBox.about(self,"Can't Open","cannot open config file\n"+self.configfile)
|
config.yaml
CHANGED
|
@@ -18,15 +18,18 @@ CMD:
|
|
|
18
18
|
ClosedProject:
|
|
19
19
|
- 0
|
|
20
20
|
- 0
|
|
21
|
+
- 0
|
|
21
22
|
File:
|
|
22
|
-
- C:/CODE/
|
|
23
|
+
- C:/CODE/assetsd/creditscene.nut
|
|
24
|
+
- C:/CODE/assetsd/common.nut
|
|
25
|
+
- C:/CODE/assetsd/common.nut
|
|
23
|
-
- C:/CODE/
|
|
26
|
+
- C:/CODE/assetsd/howtoscene.nut
|
|
27
|
+
PARAM:
|
|
24
|
-
- C:/CODE/
|
|
28
|
+
- hh C:/CODE/152940-ios.jpeg
|
|
25
29
|
Project:
|
|
26
|
-
- C:/CODE/
|
|
30
|
+
- C:/CODE/datad/
|
|
27
|
-
- C:/CODE/
|
|
31
|
+
- C:/CODE/assetsd/
|
|
28
|
-
Recent:
|
|
32
|
+
Recent: []
|
|
29
|
-
- C:\CODE\main.nut
|
|
30
33
|
Setting:
|
|
31
34
|
device: 1
|
|
32
35
|
fontname: Courier New
|
|
@@ -39,5 +42,6 @@ Setting:
|
|
|
39
42
|
workspace: C:/CODE/
|
|
40
43
|
Style: 0
|
|
41
44
|
TODO:
|
|
45
|
+
- Fix Closed Projects Bug
|
|
46
|
+
- Add Build Options
|
|
42
|
-
-
|
|
47
|
+
- Add OS support
|
|
43
|
-
- Rewrite code
|
cx.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from cx_Freeze import setup, Executable
|
|
2
|
-
from globals import __version__
|
|
3
2
|
#excludes = ['curses', 'email', 'tcl','tk','Tkinter','Tkconstants','pywin.debugger']
|
|
4
3
|
"""
|
|
5
4
|
excludes = ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger',
|
|
@@ -22,7 +21,7 @@ exe = Executable(
|
|
|
22
21
|
|
|
23
22
|
setup(
|
|
24
23
|
name = "Sabel",
|
|
25
|
-
version =
|
|
24
|
+
version ="0.56",
|
|
26
25
|
description = "Sabel IDE",
|
|
27
26
|
executables = [exe]
|
|
28
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.56"
|
|
8
8
|
#Python accesses local variables much more efficiently than global variables.
|
|
9
9
|
oslistdir = os.listdir
|
|
10
10
|
ospathisdir = os.path.isdir
|
|
@@ -47,7 +47,6 @@ fontName = config.fontName()
|
|
|
47
47
|
iconSize = config.iconSize()
|
|
48
48
|
adblist = config.adb()
|
|
49
49
|
device = config.device()
|
|
50
|
-
cmds = config.cmd()
|
|
51
50
|
|
|
52
51
|
def os_icon(name):
|
|
53
52
|
return QIcon(":/{0}.png".format(ospathjoin(iconDir,name)))
|
icons.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Resource object code
|
|
4
4
|
#
|
|
5
|
-
# Created:
|
|
5
|
+
# Created: Sun Sep 2 19:45:35 2012
|
|
6
6
|
# by: The Resource Compiler for PyQt (Qt v4.8.2)
|
|
7
7
|
#
|
|
8
8
|
# WARNING! All changes made in this file will be lost!
|
main.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
__author__ = "pyros2097"
|
|
3
|
+
__license__ = "GPLv3"
|
|
4
|
+
__copyright__ = 'Copyright (c) 2012, pyros2097'
|
|
5
|
+
__credits__ = ['pyros2097', 'eclipse']
|
|
6
|
+
__email__ = 'pyros2097@gmail.com'
|
|
7
|
+
__version__ = "0.56"
|
|
8
|
+
#TODO:
|
|
9
|
+
#Must learn to destroy editor completely because memory keeps increasing
|
|
10
|
+
#when close tab occurs
|
|
11
|
+
|
|
12
|
+
from PyQt4.QtGui import QApplication,QSplashScreen
|
|
13
|
+
from PyQt4.QtCore import Qt
|
|
14
|
+
import icons
|
|
15
|
+
app = QApplication([])
|
|
16
|
+
from globals import splash_pix
|
|
17
|
+
from mainwindow import MainWindow
|
|
18
|
+
|
|
19
|
+
def main():
|
|
20
|
+
splash = QSplashScreen(splash_pix, Qt.WindowStaysOnTopHint)
|
|
21
|
+
splash.setMask(splash_pix.mask())
|
|
22
|
+
splash.show()
|
|
23
|
+
app.processEvents()
|
|
24
|
+
frame = MainWindow()
|
|
25
|
+
frame.showMaximized()
|
|
26
|
+
splash.finish(frame)
|
|
27
|
+
frame.init()
|
|
28
|
+
app.exec_()
|
|
29
|
+
|
|
30
|
+
if __name__ == "__main__":
|
|
31
|
+
main()
|
mainwindow.py
CHANGED
|
@@ -2,7 +2,7 @@ from PyQt4.QtGui import (QApplication,QPixmap,QSplashScreen,QMessageBox,
|
|
|
2
2
|
QIcon,QAction,QCheckBox,QFileDialog)
|
|
3
3
|
from PyQt4.QtCore import SIGNAL,Qt,QStringList,QString
|
|
4
4
|
from window import Window
|
|
5
|
-
from Widget import Editor,PyInterp,Adb,Ant,Parser,Command
|
|
5
|
+
from Widget import Editor,PyInterp,Adb,Ant,Parser,Command,Audio,Image
|
|
6
6
|
from globals import (ospathsep,ospathjoin,ospathbasename,workDir,config,workSpace,
|
|
7
7
|
iconSize,iconDir,ospathexists,os_icon)
|
|
8
8
|
import sys
|
|
@@ -12,7 +12,6 @@ class MainWindow(Window):
|
|
|
12
12
|
Window.__init__(self,parent)
|
|
13
13
|
#Important must be empty this is a reference
|
|
14
14
|
self.files = []
|
|
15
|
-
self.projects = None
|
|
16
15
|
self.recent = None
|
|
17
16
|
self.dirty = None
|
|
18
17
|
self.isFull = False
|
|
@@ -20,46 +19,38 @@ class MainWindow(Window):
|
|
|
20
19
|
self.parser = Parser(self)
|
|
21
20
|
self.command = Command(self)
|
|
22
21
|
self.ant = Ant(self)
|
|
23
|
-
self.init()
|
|
24
22
|
|
|
25
23
|
def init(self):
|
|
26
|
-
self.initConfig()
|
|
27
24
|
self.initToolBar()
|
|
28
|
-
self.
|
|
25
|
+
self.initConfig()
|
|
26
|
+
self.treeWidget.initProjects()
|
|
29
27
|
self.connect(self, SIGNAL('triggered()'), self.closeEvent)
|
|
30
28
|
self.connect(self.tabWidget,SIGNAL("dropped"), self.createTabs)
|
|
29
|
+
self.tabWidget.tabCloseRequested.connect(self.closeTab)
|
|
30
|
+
self.treeWidget.itemDoubleClicked.connect(self.treeItemClicked)
|
|
31
|
+
self.connect(self.treeWidget,SIGNAL("create"), lambda x:self.ant.create(x))
|
|
32
|
+
self.connect(self.treeWidget,SIGNAL("build"), lambda x:self.ant.build(x))
|
|
33
|
+
self.connect(self.treeWidget,SIGNAL("buildRun"), lambda x:self.ant.buildRun(x))
|
|
34
|
+
self.connect(self.treeWidget,SIGNAL("clean"), lambda x:self.ant.clean(x))
|
|
35
|
+
self.connect(self.treeWidget,SIGNAL("run"), lambda x:self.ant.run(x))
|
|
36
|
+
|
|
31
37
|
#self.initInterpreter()
|
|
32
38
|
|
|
33
|
-
def initConfig(self):
|
|
39
|
+
def initConfig(self):
|
|
34
|
-
self.projects = config.projects()
|
|
35
40
|
self.recent = config.recent()
|
|
36
41
|
self.dirty = []
|
|
37
42
|
if(config.files() != None):
|
|
38
43
|
for i in config.files():
|
|
39
44
|
self.createTab(i)
|
|
40
|
-
self.tabWidget.tabCloseRequested.connect(self.closeTab)
|
|
41
|
-
self.treeWidget.itemDoubleClicked.connect(self.ss)
|
|
42
|
-
|
|
43
|
-
def initProjects(self):
|
|
44
|
-
if self.projects != None:
|
|
45
|
-
if len(self.projects) != 0:
|
|
46
|
-
for pro in self.projects:
|
|
47
|
-
self.createProject(pro)
|
|
48
45
|
|
|
49
|
-
#Important all projects must go through this
|
|
50
|
-
def
|
|
46
|
+
def treeItemClicked(self,item):
|
|
51
|
-
if(ospathexists(startDir)):
|
|
52
|
-
self.treeWidget.addProject(startDir)
|
|
53
|
-
else:
|
|
54
|
-
config.removeProject(startDir)
|
|
55
|
-
QMessageBox.about(self,"Can't Open Project","Project Does Not Exist %s"%startDir)
|
|
56
|
-
|
|
57
|
-
def ss(self,item):
|
|
58
47
|
if(item.isFile()):
|
|
59
48
|
if(item.isDoc()):
|
|
60
49
|
self.createTab(item.getPath())
|
|
61
50
|
elif(item.isPic()):
|
|
62
|
-
self.
|
|
51
|
+
self.openImage(item.getPath())
|
|
52
|
+
elif(item.isAudio()):
|
|
53
|
+
self.openAudio(item.getPath())
|
|
63
54
|
|
|
64
55
|
def initInterpreter(self):
|
|
65
56
|
self.ipy = PyInterp(self)
|
|
@@ -68,47 +59,61 @@ class MainWindow(Window):
|
|
|
68
59
|
|
|
69
60
|
def createTab(self,nfile):
|
|
70
61
|
if(nfile != None):
|
|
71
|
-
if
|
|
62
|
+
if(self.files != None):
|
|
72
|
-
if
|
|
63
|
+
if(len(self.files) != 0):
|
|
73
|
-
|
|
64
|
+
if(nfile in self.files):
|
|
74
|
-
if(i == nfile):
|
|
75
65
|
#print "File Already Open\n"+nfile
|
|
76
66
|
self.tabWidget.setCurrentIndex(self.files.index(nfile))
|
|
77
|
-
return
|
|
78
|
-
if type(nfile) == str:
|
|
79
67
|
if(ospathexists(nfile)):
|
|
80
|
-
text = ""
|
|
81
|
-
try:
|
|
82
|
-
infile = open(nfile, 'r')
|
|
83
|
-
text = infile.read()
|
|
84
|
-
infile.close()
|
|
85
|
-
config.addFile(nfile)
|
|
86
|
-
self.dirty.append(False)
|
|
87
|
-
|
|
68
|
+
self.openEditor(nfile)
|
|
88
|
-
#print len(self.files)
|
|
89
|
-
except:
|
|
90
|
-
config.removeFile(nfile)
|
|
91
|
-
QMessageBox.about(self,"Can't Open","File Does Not Exist or Locked\n"+nfile)
|
|
92
|
-
|
|
93
|
-
tab = Editor(self,text,self.syntax(nfile),self.colorStyle)
|
|
94
|
-
self.tabWidget.addTab(tab,ospathbasename(nfile))
|
|
95
|
-
tab.textChanged.connect(lambda:self.setDirty(nfile))
|
|
96
|
-
if(self.files != None):
|
|
97
|
-
if(len(self.files)) != 0:
|
|
98
|
-
#This line sets the opened file to display first Important not checked
|
|
99
|
-
self.tabWidget.setCurrentIndex(len(self.files)-1)
|
|
100
69
|
else:
|
|
101
70
|
#dont know must check this the last file is not removed executes only
|
|
102
|
-
#
|
|
71
|
+
#1 when it has to remove 2 files
|
|
103
72
|
#check sel.files
|
|
104
73
|
#print len(config.files())
|
|
74
|
+
print "removing"+nfile
|
|
75
|
+
self.files.remove(nfile)
|
|
105
|
-
config.
|
|
76
|
+
config.setFile(self.files)
|
|
106
|
-
QMessageBox.about(self,"Can't Open","File Does Not Exist
|
|
77
|
+
QMessageBox.about(self,"Can't Open","File Does Not Exist\n"+nfile)
|
|
107
78
|
|
|
108
|
-
def createTabs(self,
|
|
79
|
+
def createTabs(self,links):
|
|
109
|
-
for i in
|
|
80
|
+
for i in links:
|
|
110
81
|
self.createTab(i)
|
|
111
82
|
|
|
83
|
+
def openEditor(self,nfile):
|
|
84
|
+
text = ""
|
|
85
|
+
try:
|
|
86
|
+
infile = open(nfile, 'r')
|
|
87
|
+
text = infile.read()
|
|
88
|
+
infile.close()
|
|
89
|
+
self.files.append(nfile)
|
|
90
|
+
config.setFile(self.files)
|
|
91
|
+
self.dirty.append(False)
|
|
92
|
+
#print len(self.files)
|
|
93
|
+
tab = Editor(self,text,self.syntax(nfile),self.colorStyle)
|
|
94
|
+
self.tabWidget.addTab(tab,ospathbasename(nfile))
|
|
95
|
+
tab.textChanged.connect(lambda:self.setDirty(nfile))
|
|
96
|
+
if(self.files != None):
|
|
97
|
+
if(len(self.files)) != 0:
|
|
98
|
+
#This line sets the opened file to display first Important not checked
|
|
99
|
+
self.tabWidget.setCurrentIndex(len(self.files)-1)
|
|
100
|
+
except:
|
|
101
|
+
#print "removing"+nfile
|
|
102
|
+
self.files.remove(nfile)
|
|
103
|
+
config.setFile(self.files)
|
|
104
|
+
QMessageBox.about(self,"Can't Open","File is Being Used\n"+nfile)
|
|
105
|
+
|
|
106
|
+
def openImage(self,nfile):
|
|
107
|
+
form = Image(self,nfile)
|
|
108
|
+
form.show()
|
|
109
|
+
#print nfile
|
|
110
|
+
#self.tiler.addImage(nfile)
|
|
111
|
+
#self.tiler.show()
|
|
112
|
+
|
|
113
|
+
def openAudio(self,nfile):
|
|
114
|
+
form = Audio(self,nfile)
|
|
115
|
+
form.show()
|
|
116
|
+
|
|
112
117
|
def closeTab(self,index):
|
|
113
118
|
'''Boolean result invocation method.'''
|
|
114
119
|
done = True
|
|
@@ -126,10 +131,9 @@ class MainWindow(Window):
|
|
|
126
131
|
done = True
|
|
127
132
|
if(done):
|
|
128
133
|
#print index
|
|
129
|
-
config.removeFile(self.files[index])
|
|
130
134
|
self.files.remove(self.files[index])
|
|
135
|
+
config.setFile(self.files)
|
|
131
136
|
self.tabWidget.removeTab(index)
|
|
132
|
-
#return True
|
|
133
137
|
|
|
134
138
|
def setDirty(self,file):
|
|
135
139
|
'''On change of text in textEdit window, set the flag
|
|
@@ -147,34 +151,12 @@ class MainWindow(Window):
|
|
|
147
151
|
flbase = ospathbasename(self.files[index])
|
|
148
152
|
self.tabWidget.setTabText(index,flbase)
|
|
149
153
|
|
|
150
|
-
def newProject(self):
|
|
151
|
-
fname = str(QFileDialog.getExistingDirectory(self,"Open Project Folder"))
|
|
152
|
-
if not (fname == ""):
|
|
153
|
-
fname = fname+"/"
|
|
154
|
-
#print fname
|
|
155
|
-
#print self.projects
|
|
156
|
-
if len(self.projects) != 0:
|
|
157
|
-
for nfile in self.projects:
|
|
158
|
-
if(nfile != fname):
|
|
159
|
-
self.createProject(fname)
|
|
160
|
-
config.addProject(fname)
|
|
161
|
-
return
|
|
162
|
-
else:
|
|
163
|
-
QMessageBox.about(self, "Already Open","Project Already Open\n"+fname)
|
|
164
|
-
return
|
|
165
|
-
else:
|
|
166
|
-
self.createProject(fname)
|
|
167
|
-
config.addProject(fname)
|
|
168
|
-
return
|
|
169
|
-
|
|
170
154
|
def fileOpen(self):
|
|
171
|
-
fname = str(QFileDialog.getOpenFileName(self,
|
|
172
|
-
|
|
155
|
+
fname = str(QFileDialog.getOpenFileName(self,"Open File", '.', "Files (*.*)"))
|
|
173
156
|
if not (fname == ""):
|
|
174
157
|
if self.files != None:
|
|
175
158
|
if len(self.files) != 0:
|
|
176
|
-
|
|
159
|
+
if(fname in self.files):
|
|
177
|
-
if(file != fname):
|
|
178
160
|
self.createTab(fname)
|
|
179
161
|
return
|
|
180
162
|
else:
|
|
@@ -183,13 +165,10 @@ class MainWindow(Window):
|
|
|
183
165
|
else:
|
|
184
166
|
self.createTab(fname)
|
|
185
167
|
else:
|
|
186
|
-
print "not"
|
|
168
|
+
#print "not"
|
|
187
169
|
#this is when the files list is empty and None type
|
|
188
|
-
if(self.files == None):
|
|
189
|
-
|
|
170
|
+
self.files = []
|
|
190
171
|
self.createTab(fname)
|
|
191
|
-
else:
|
|
192
|
-
return
|
|
193
172
|
|
|
194
173
|
def fileSave(self):
|
|
195
174
|
if(self.files != None):
|
|
@@ -234,6 +213,7 @@ class MainWindow(Window):
|
|
|
234
213
|
self.adb.close()
|
|
235
214
|
self.parser.close()
|
|
236
215
|
self.command.close()
|
|
216
|
+
self.ant.close()
|
|
237
217
|
notSaved = False
|
|
238
218
|
for files in self.dirty:
|
|
239
219
|
if files == True:
|
stylesheet.py
CHANGED
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
slisty = """
|
|
2
|
-
QSlider::groove:horizontal {
|
|
3
|
-
border: 1px solid #999999;
|
|
4
|
-
height: 8px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
|
|
5
|
-
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #B1B1B1, stop:1 #c4c4c4);
|
|
6
|
-
margin: 2px 0;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
QSlider::handle:horizontal {
|
|
10
|
-
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
|
|
11
|
-
border: 1px solid #5c5c5c;
|
|
12
|
-
width: 18px;
|
|
13
|
-
margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
|
|
14
|
-
border-radius: 3px;
|
|
15
|
-
}
|
|
16
|
-
/*
|
|
17
|
-
QSlider::add-page:horizontal {
|
|
18
|
-
background: white;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
QSlider::sub-page:horizontal {
|
|
22
|
-
background: pink;
|
|
23
|
-
}
|
|
24
|
-
*/
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
1
|
stletabb = """
|
|
28
2
|
/* Style the tab using the tab sub-control. Note that
|
|
29
3
|
it reads QTabBar _not_ QTabWidget */
|
window.py
CHANGED
|
@@ -2,16 +2,17 @@ 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
4
|
QMainWindow,QPalette,QColor,QSlider,QFontDialog,QLabel,
|
|
5
|
-
QFont,QComboBox,QFileDialog,QInputDialog)
|
|
5
|
+
QFont,QComboBox,QFileDialog,QInputDialog,QProgressBar)
|
|
6
6
|
from PyQt4.QtCore import QSize,Qt,QStringList
|
|
7
|
-
from Widget import (
|
|
7
|
+
from Widget import (EditorTab,Tiler,TreeTab,OutputTab,
|
|
8
|
+
ProjectTree,ErrorTree,OutlineTree,
|
|
8
|
-
DialogAnt,DialogSquirrel,DialogTodo)
|
|
9
|
+
DialogAndroid,DialogAbout,DialogAnt,DialogSquirrel,DialogTodo)
|
|
9
10
|
from Widget.style import Styles
|
|
10
11
|
from stylesheet import *
|
|
11
12
|
|
|
12
13
|
from globals import (ospathsep,ospathjoin,ospathbasename,workDir,config,workSpace,
|
|
13
14
|
iconSize,iconDir,adblist,Icons,os_icon,
|
|
14
|
-
fontName,fontSize
|
|
15
|
+
fontName,fontSize)
|
|
15
16
|
|
|
16
17
|
class Window(QMainWindow):
|
|
17
18
|
def __init__(self,parent = None):
|
|
@@ -24,24 +25,33 @@ class Window(QMainWindow):
|
|
|
24
25
|
self.horizontalLayout = QHBoxLayout(self.centralwidget)
|
|
25
26
|
self.horizontalLayout.setMargin(0)
|
|
26
27
|
self.styleIndex = config.styleIndex()
|
|
27
|
-
self.cmdList =cmds
|
|
28
|
+
self.cmdList = config.cmds()
|
|
29
|
+
self.paramList = config.params()
|
|
28
30
|
self.mode = config.mode()
|
|
29
31
|
|
|
30
32
|
#TabWidgets
|
|
33
|
+
#This parent is for findbar and vetical layount do not remove
|
|
31
34
|
self.tab_1 = QWidget(self)
|
|
32
35
|
self.tab_1.setMinimumWidth(800)
|
|
33
|
-
self.tabWidget =
|
|
36
|
+
self.tabWidget = EditorTab(self)
|
|
34
37
|
self.VericalLayout = QVBoxLayout(self.tab_1)
|
|
35
38
|
self.VericalLayout.setMargin(0)
|
|
36
39
|
self.VericalLayout.addWidget(self.tabWidget)
|
|
37
40
|
|
|
38
|
-
self.tabWidget_2 =
|
|
41
|
+
self.tabWidget_2 = TreeTab(self)
|
|
39
42
|
#self.tabWidget_2.setMaximumWidth(200)
|
|
40
|
-
self.tabWidget_3 =
|
|
43
|
+
self.tabWidget_3 = OutputTab(self)
|
|
41
44
|
self.tabWidget_3.setMaximumHeight(200)#260
|
|
42
|
-
|
|
45
|
+
self.tiler = Tiler(self)
|
|
43
|
-
|
|
46
|
+
self.tiler.setMinimumHeight(100)
|
|
44
47
|
self.tabWidget.tabBar().setStyleSheet(stletabb)
|
|
48
|
+
self.tabWidget_2.currentChanged.connect(self.closeExplorer)
|
|
49
|
+
self.tabWidget_3.currentChanged.connect(self.closeConsole)
|
|
50
|
+
self.tabWidget.setTabsClosable(True)
|
|
51
|
+
self.tabWidget.setTabShape(0)
|
|
52
|
+
#self.tiler.currentChanged.connect(self.closeDesigner)
|
|
53
|
+
self.tiler.setTabsClosable(True)
|
|
54
|
+
self.tiler.setTabShape(0)
|
|
45
55
|
|
|
46
56
|
#Tree
|
|
47
57
|
self.tab_5 = QWidget()
|
|
@@ -84,7 +94,6 @@ class Window(QMainWindow):
|
|
|
84
94
|
self.textEdit = QTextEdit()
|
|
85
95
|
self.inputLayout = QHBoxLayout()
|
|
86
96
|
self.inputLayout.setMargin(0)
|
|
87
|
-
self.runEdit = QLineEdit()
|
|
88
97
|
self.fileButton = QPushButton()
|
|
89
98
|
self.fileButton.setText("File")
|
|
90
99
|
self.fileButton.clicked.connect(self.getFile)
|
|
@@ -92,6 +101,7 @@ class Window(QMainWindow):
|
|
|
92
101
|
self.runButton.setFlat(True)
|
|
93
102
|
self.runButton.setIcon(Icons.go)
|
|
94
103
|
self.combo = QComboBox()
|
|
104
|
+
self.combo.setFixedWidth(100)
|
|
95
105
|
self.comboAdd = QPushButton()
|
|
96
106
|
self.comboAdd.setIcon(Icons.add)
|
|
97
107
|
self.comboAdd.setFlat(True)
|
|
@@ -99,15 +109,36 @@ class Window(QMainWindow):
|
|
|
99
109
|
self.comboDel = QPushButton()
|
|
100
110
|
self.comboDel.setIcon(Icons.close_view)
|
|
101
111
|
self.comboDel.setFlat(True)
|
|
102
|
-
|
|
112
|
+
self.comboDel.clicked.connect(self.delCmd)
|
|
113
|
+
self.combo2 = QComboBox()
|
|
114
|
+
self.combo2.setFixedWidth(600)
|
|
115
|
+
self.combo2Add = QPushButton()
|
|
116
|
+
self.combo2Add.setIcon(Icons.add)
|
|
117
|
+
self.combo2Add.setFlat(True)
|
|
118
|
+
self.combo2Add.clicked.connect(self.addParam)
|
|
119
|
+
self.combo2Del = QPushButton()
|
|
120
|
+
self.combo2Del.setIcon(Icons.close_view)
|
|
121
|
+
self.combo2Del.setFlat(True)
|
|
122
|
+
self.combo2Del.clicked.connect(self.delParam)
|
|
123
|
+
if(self.checkHasValue(self.cmdList)):
|
|
103
|
-
|
|
124
|
+
for cmd in self.cmdList:
|
|
104
|
-
|
|
125
|
+
self.combo.addItem(cmd)
|
|
126
|
+
else:
|
|
127
|
+
self.cmdList = []
|
|
128
|
+
if(self.checkHasValue(self.paramList)):
|
|
129
|
+
for param in self.paramList:
|
|
130
|
+
self.combo2.addItem(param)
|
|
131
|
+
else:
|
|
132
|
+
self.paramList = []
|
|
133
|
+
|
|
105
134
|
self.horizontalLayout_2.addWidget(self.textEdit)
|
|
106
|
-
self.inputLayout.addWidget(QLabel("
|
|
135
|
+
self.inputLayout.addWidget(QLabel("Command:"))
|
|
107
136
|
self.inputLayout.addWidget(self.combo)
|
|
108
137
|
self.inputLayout.addWidget(self.comboAdd)
|
|
109
138
|
self.inputLayout.addWidget(self.comboDel)
|
|
110
|
-
self.inputLayout.addWidget(self.
|
|
139
|
+
self.inputLayout.addWidget(self.combo2)
|
|
140
|
+
self.inputLayout.addWidget(self.combo2Add)
|
|
141
|
+
self.inputLayout.addWidget(self.combo2Del)
|
|
111
142
|
self.inputLayout.addWidget(self.fileButton)
|
|
112
143
|
self.inputLayout.addWidget(self.runButton)
|
|
113
144
|
self.horizontalLayout_2.addLayout(self.inputLayout)
|
|
@@ -119,6 +150,12 @@ class Window(QMainWindow):
|
|
|
119
150
|
self.errorTree = ErrorTree(self.tab_7)
|
|
120
151
|
self.horizontalLayout_4.addWidget(self.errorTree)
|
|
121
152
|
|
|
153
|
+
#Tiler
|
|
154
|
+
#self.tab_11 = QWidget()
|
|
155
|
+
#self.horizontalLayout_11 = QHBoxLayout(self.tab_11)
|
|
156
|
+
#self.horizontalLayout_11.setMargin(0)
|
|
157
|
+
#self.horizontalLayout_11.addWidget(self.tiler)
|
|
158
|
+
|
|
122
159
|
#Find
|
|
123
160
|
self.tab_8 = QWidget()
|
|
124
161
|
self.tab_8.setObjectName("tab_8")
|
|
@@ -170,26 +207,17 @@ class Window(QMainWindow):
|
|
|
170
207
|
self.VericalLayout.addWidget(self.tab_8)
|
|
171
208
|
self.tab_8.hide()
|
|
172
209
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
#
|
|
210
|
+
#Tabwidgets
|
|
176
211
|
self.tabWidget_2.addTab(self.tab_5,"Projects")
|
|
177
212
|
self.tabWidget_2.addTab(self.tab_2,"Outline")
|
|
178
213
|
self.tabWidget_2.addTab(QWidget(self),"")
|
|
179
214
|
self.tabWidget_2.setTabIcon(2,Icons.close_view)
|
|
180
|
-
self.tabWidget_2.currentChanged.connect(self.closeExplorer)
|
|
181
|
-
|
|
182
215
|
self.tabWidget_3.addTab(self.tab_7,"Error")
|
|
183
216
|
self.tabWidget_3.addTab(self.tab_6,"Output")
|
|
184
217
|
self.tabWidget_3.addTab(QWidget(self),"")
|
|
185
218
|
self.tabWidget_3.setTabIcon(0,Icons.error)
|
|
186
219
|
self.tabWidget_3.setTabIcon(1,Icons.console_view)
|
|
187
220
|
self.tabWidget_3.setTabIcon(2,Icons.close_view)
|
|
188
|
-
self.tabWidget_3.currentChanged.connect(self.closeConsole)
|
|
189
|
-
|
|
190
|
-
self.tabWidget.setTabsClosable(True)
|
|
191
|
-
self.tabWidget.setTabShape(0)
|
|
192
|
-
|
|
193
221
|
|
|
194
222
|
#Splitters
|
|
195
223
|
self.split1 = QSplitter(Qt.Horizontal)
|
|
@@ -199,6 +227,8 @@ class Window(QMainWindow):
|
|
|
199
227
|
|
|
200
228
|
self.split2 = QSplitter(Qt.Vertical)
|
|
201
229
|
self.split2.addWidget(self.split1)
|
|
230
|
+
self.split2.addWidget(self.tiler)
|
|
231
|
+
self.tiler.hide()
|
|
202
232
|
self.split2.addWidget(self.tabWidget_3)
|
|
203
233
|
self.tabWidget_3.hide()
|
|
204
234
|
self.horizontalLayout.addWidget(self.split2)
|
|
@@ -210,11 +240,20 @@ class Window(QMainWindow):
|
|
|
210
240
|
self.aboutButton.setFlat(True)
|
|
211
241
|
self.aboutButton.setIcon(Icons.anchor)
|
|
212
242
|
self.aboutButton.clicked.connect(self.about)
|
|
243
|
+
self.expButton = QPushButton(self)
|
|
244
|
+
self.expButton.setFlat(True)
|
|
245
|
+
self.expButton.setIcon(Icons.prj)
|
|
246
|
+
self.expButton.clicked.connect(self.exp)
|
|
213
247
|
self.cmdButton = QPushButton(self)
|
|
214
248
|
self.cmdButton.setFlat(True)
|
|
215
249
|
self.cmdButton.setIcon(Icons.console_view)
|
|
216
250
|
self.cmdButton.clicked.connect(self.cmd)
|
|
217
251
|
self.cmdButton.setShortcut('Ctrl+D')
|
|
252
|
+
self.imgButton = QPushButton(self)
|
|
253
|
+
self.imgButton.setFlat(True)
|
|
254
|
+
self.imgButton.setIcon(Icons.color_palette)
|
|
255
|
+
self.imgButton.clicked.connect(self.design)
|
|
256
|
+
self.imgButton.setShortcut('Ctrl+I')
|
|
218
257
|
self.findButton = QPushButton(self)
|
|
219
258
|
self.findButton.setFlat(True)
|
|
220
259
|
self.findButton.setIcon(Icons.find)
|
|
@@ -232,12 +271,19 @@ class Window(QMainWindow):
|
|
|
232
271
|
self.fontButton.setFlat(True)
|
|
233
272
|
self.fontButton.setIcon(Icons.font)
|
|
234
273
|
self.fontButton.clicked.connect(self.setFont)
|
|
274
|
+
self.progressbar = QProgressBar()
|
|
275
|
+
self.progressbar.setMinimum(0)
|
|
276
|
+
self.progressbar.setMaximum(100)
|
|
235
277
|
self.statusbar.addWidget(self.aboutButton)
|
|
278
|
+
self.statusbar.addWidget(self.expButton)
|
|
236
279
|
self.statusbar.addWidget(self.cmdButton)
|
|
280
|
+
self.statusbar.addWidget(self.imgButton)
|
|
237
281
|
self.statusbar.addWidget(self.findButton)
|
|
238
282
|
self.statusbar.addWidget(self.zoominButton)
|
|
239
283
|
self.statusbar.addWidget(self.zoomoutButton)
|
|
240
284
|
self.statusbar.addWidget(self.fontButton)
|
|
285
|
+
self.statusbar.addWidget(self.progressbar)
|
|
286
|
+
self.progressbar.hide()
|
|
241
287
|
#self.statusbar.setFixedHeight(18)
|
|
242
288
|
|
|
243
289
|
#Init colorstyling
|
|
@@ -252,7 +298,7 @@ class Window(QMainWindow):
|
|
|
252
298
|
|
|
253
299
|
def initToolBar(self):
|
|
254
300
|
self.action_NewProject = QAction(Icons.newprj, 'Project', self)
|
|
255
|
-
self.action_NewProject.triggered.connect(self.newProject)
|
|
301
|
+
self.action_NewProject.triggered.connect(self.treeWidget.newProject)
|
|
256
302
|
self.action_NewProject.setToolTip("Create a New Project")
|
|
257
303
|
|
|
258
304
|
self.action_Open = QAction(Icons.open, 'Open', self)
|
|
@@ -277,12 +323,12 @@ class Window(QMainWindow):
|
|
|
277
323
|
self.action_Run.triggered.connect(self.adb.run)
|
|
278
324
|
self.action_RunFile = QAction(Icons.go, 'Cmd', self)
|
|
279
325
|
self.action_RunFile.triggered.connect(self.command.setCmd)
|
|
280
|
-
self.runEdit.returnPressed.connect(self.command.setCmdLine)
|
|
281
326
|
self.runButton.clicked.connect(self.command.setCmdLine)
|
|
282
327
|
self.action_Stop = QAction(Icons.stop, 'Stop', self)
|
|
283
328
|
self.action_Stop.setShortcut('Ctrl+Q')
|
|
284
329
|
self.action_Stop.triggered.connect(self.adb.stop)
|
|
285
330
|
self.action_Design = QAction(Icons.color_palette, 'Design', self)
|
|
331
|
+
self.action_Design.triggered.connect(self.design)
|
|
286
332
|
self.action_Todo = QAction(Icons.task_set, 'Todo', self)
|
|
287
333
|
self.action_Todo.triggered.connect(self.todo)
|
|
288
334
|
|
|
@@ -312,12 +358,16 @@ class Window(QMainWindow):
|
|
|
312
358
|
|
|
313
359
|
|
|
314
360
|
action_explorer = QAction("Show Explorer",self)
|
|
315
|
-
action_explorer.triggered.connect(
|
|
361
|
+
action_explorer.triggered.connect(self.exp)
|
|
316
|
-
men.addAction(action_explorer)
|
|
317
362
|
action_console = QAction("Show Console",self)
|
|
318
|
-
action_console.triggered.connect(
|
|
363
|
+
action_console.triggered.connect(self.cmd)
|
|
364
|
+
action_designer = QAction("Show Designer",self)
|
|
365
|
+
action_designer.triggered.connect(self.design)
|
|
366
|
+
action_Indentation = QAction("Indentation Guides",self)
|
|
367
|
+
men.addAction(action_explorer)
|
|
319
368
|
men.addAction(action_console)
|
|
369
|
+
men.addAction(action_designer)
|
|
320
|
-
men.addAction(
|
|
370
|
+
men.addAction(action_Indentation)
|
|
321
371
|
men.addSeparator()
|
|
322
372
|
men.addAction(QAction("TabWidth",self))
|
|
323
373
|
men.addAction(self.tabsSliderAction)
|
|
@@ -325,7 +375,7 @@ class Window(QMainWindow):
|
|
|
325
375
|
men.addAction(QAction("Threshold",self))
|
|
326
376
|
men.addAction(self.threshSliderAction)
|
|
327
377
|
|
|
328
|
-
self.action_Options = QAction(Icons.
|
|
378
|
+
self.action_Options = QAction(Icons.emblem_system, 'Options', self)
|
|
329
379
|
self.action_Options.setMenu(men)
|
|
330
380
|
self.action_Options.triggered.connect(self.options)
|
|
331
381
|
|
|
@@ -445,7 +495,7 @@ class Window(QMainWindow):
|
|
|
445
495
|
self.action_Squirrel.setChecked(True)
|
|
446
496
|
|
|
447
497
|
def ios(self):
|
|
448
|
-
print "
|
|
498
|
+
print "ios"
|
|
449
499
|
|
|
450
500
|
|
|
451
501
|
def sq(self):
|
|
@@ -490,6 +540,12 @@ class Window(QMainWindow):
|
|
|
490
540
|
self.tab_8.show()
|
|
491
541
|
else:
|
|
492
542
|
self.tab_8.hide()
|
|
543
|
+
|
|
544
|
+
def exp(self):
|
|
545
|
+
if(self.tabWidget_2.isHidden()):
|
|
546
|
+
self.tabWidget_2.show()
|
|
547
|
+
else:
|
|
548
|
+
self.tabWidget_2.hide()
|
|
493
549
|
|
|
494
550
|
def cmd(self):
|
|
495
551
|
if(self.tabWidget_3.isHidden()):
|
|
@@ -497,6 +553,23 @@ class Window(QMainWindow):
|
|
|
497
553
|
else:
|
|
498
554
|
self.tabWidget_3.hide()
|
|
499
555
|
|
|
556
|
+
def design(self):
|
|
557
|
+
if(self.tiler.isHidden()):
|
|
558
|
+
self.tiler.show()
|
|
559
|
+
else:
|
|
560
|
+
self.tiler.hide()
|
|
561
|
+
|
|
562
|
+
def closeDesigner(self,no):
|
|
563
|
+
pass
|
|
564
|
+
'''
|
|
565
|
+
if(no == self.tiler.closeIndex()):
|
|
566
|
+
if(self.tiler.isHidden()):
|
|
567
|
+
self.tiler.show()
|
|
568
|
+
else:
|
|
569
|
+
self.tiler.setCurrentIndex(1)
|
|
570
|
+
self.tiler.hide()
|
|
571
|
+
'''
|
|
572
|
+
|
|
500
573
|
def closeConsole(self,no = 2):
|
|
501
574
|
if(no == 2):
|
|
502
575
|
if(self.tabWidget_3.isHidden()):
|
|
@@ -512,6 +585,9 @@ class Window(QMainWindow):
|
|
|
512
585
|
self.tabWidget_2.setCurrentIndex(0)
|
|
513
586
|
self.tabWidget_2.hide()
|
|
514
587
|
|
|
588
|
+
def updatePBar(self, val):
|
|
589
|
+
self.progressbar.setValue(val)
|
|
590
|
+
|
|
515
591
|
#-----------------------------------------------------------------------------------#
|
|
516
592
|
# Editor Functions #
|
|
517
593
|
#-----------------------------------------------------------------------------------#
|
|
@@ -591,7 +667,14 @@ class Window(QMainWindow):
|
|
|
591
667
|
def getFile(self):
|
|
592
668
|
fname = str(QFileDialog.getOpenFileName(self,"Open File", '.', "Files (*.*)"))
|
|
593
669
|
if not (fname == ""):
|
|
670
|
+
index = self.combo2.currentIndex()
|
|
671
|
+
text = str(self.combo2.itemText(index))+" "+fname
|
|
594
|
-
self.
|
|
672
|
+
self.combo2.setItemText(index,text)
|
|
673
|
+
self.paramList.pop(index)
|
|
674
|
+
self.paramList.insert(index,text)
|
|
675
|
+
config.setParam(self.paramList)
|
|
676
|
+
|
|
677
|
+
|
|
595
678
|
|
|
596
679
|
def addCmd(self,index):
|
|
597
680
|
text, ok = QInputDialog.getText(self, 'Add Command', 'Command:')
|
|
@@ -602,7 +685,32 @@ class Window(QMainWindow):
|
|
|
602
685
|
#print self.cmdList
|
|
603
686
|
self.combo.addItem(cmd)
|
|
604
687
|
config.setCmd(self.cmdList)
|
|
688
|
+
config.setParam(self.paramList)
|
|
605
689
|
|
|
690
|
+
def delCmd(self):
|
|
691
|
+
index = self.combo.currentIndex()
|
|
692
|
+
self.combo.removeItem(index)
|
|
693
|
+
self.cmdList.pop(index)
|
|
694
|
+
#print self.cmdList
|
|
695
|
+
config.setCmd(self.cmdList)
|
|
696
|
+
|
|
606
|
-
def
|
|
697
|
+
def addParam(self,index):
|
|
698
|
+
text, ok = QInputDialog.getText(self, 'Add Parameters', 'Params:')
|
|
699
|
+
if(ok):
|
|
700
|
+
if(str(text) != ''):
|
|
701
|
+
param = str(text)
|
|
702
|
+
self.paramList.append(param)
|
|
703
|
+
self.combo2.addItem(param)
|
|
704
|
+
config.setParam(self.paramList)
|
|
705
|
+
|
|
706
|
+
def delParam(self):
|
|
707
|
+
index = self.combo2.currentIndex()
|
|
708
|
+
self.combo2.removeItem(index)
|
|
709
|
+
self.paramList.pop(index)
|
|
710
|
+
config.setParam(self.paramList)
|
|
711
|
+
|
|
712
|
+
def checkHasValue(self,list):
|
|
713
|
+
if(list != None and len(list) != 0):
|
|
714
|
+
return True
|
|
607
|
-
|
|
715
|
+
else:
|
|
608
|
-
|
|
716
|
+
return False
|