From 74d560add00621421d366759bcc80900d8e14d8a Mon Sep 17 00:00:00 2001 From: fahim Date: Wed, 11 Feb 2015 16:34:48 +0530 Subject: Subject: Added splash screen Description: Added basic splash screen codewith default image which need to modified in future. --- src/frontEnd/Application.py | 36 ++++++++++++++++++++++++------------ src/frontEnd/ViewManagement.py | 11 +++++++++++ src/frontEnd/ViewManagement.pyc | Bin 2287 -> 2519 bytes src/frontEnd/Workspace.py | 31 ++++++++++++++++--------------- src/frontEnd/Workspace.pyc | Bin 3433 -> 3466 bytes src/images/close.jpeg | Bin 5605 -> 0 bytes src/images/close.png | Bin 47906 -> 0 bytes src/images/help.jpeg | Bin 4737 -> 0 bytes src/images/help.png | Bin 43181 -> 0 bytes src/images/newproj.jpeg | Bin 2236 -> 0 bytes src/images/newproj.png | Bin 11544 -> 0 bytes src/images/openproj.jpeg | Bin 4425 -> 0 bytes src/images/openproj.png | Bin 31199 -> 0 bytes 13 files changed, 51 insertions(+), 27 deletions(-) delete mode 100644 src/images/close.jpeg delete mode 100644 src/images/close.png delete mode 100644 src/images/help.jpeg delete mode 100644 src/images/help.png delete mode 100644 src/images/newproj.jpeg delete mode 100644 src/images/newproj.png delete mode 100644 src/images/openproj.jpeg delete mode 100644 src/images/openproj.png diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index 7f783ff3..ccc08248 100755 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -18,12 +18,12 @@ #=============================================================================== -from PyQt4 import QtGui +from PyQt4 import QtGui, QtCore from configuration.Appconfig import Appconfig import ViewManagement import Workspace import sys - +import time class Application(QtGui.QMainWindow): """ @@ -111,26 +111,38 @@ def main(args): """ It is main function of the module.It starts the application """ - app = QtGui.QApplication(args) + print "Hello Main" + app = QtGui.QApplication(sys.argv) + + splash_pix = QtGui.QPixmap('../images/FreeEDAlogo.jpg') + splash = QtGui.QSplashScreen(splash_pix,QtCore.Qt.WindowStaysOnTopHint) + progressBar = QtGui.QProgressBar(splash) + splash.setMask(splash_pix.mask()) + splash.show() + + for i in range(0, 100): + progressBar.setValue(i) + t = time.time() + while time.time() < t + 0.1: + app.processEvents() + + time.sleep(2) + appView = Application() appView.show() + splash.finish(appView) sys.exit(app.exec_()) """ - while 1: - print work_space.status_label.text() - if work_space.status_label.text() == 'OK': - print "OK" - appView.show() - break - else: - pass - + appView = Application() + appView.show() + sys.exit(app.exec_()) """ # Call main function if __name__ == '__main__': + # Create and display the splash screen main(sys.argv) diff --git a/src/frontEnd/ViewManagement.py b/src/frontEnd/ViewManagement.py index fac383bc..27d9ecba 100755 --- a/src/frontEnd/ViewManagement.py +++ b/src/frontEnd/ViewManagement.py @@ -68,6 +68,17 @@ class ViewManagement(QtGui.QSplitter): self.ngspice_btn.setIcon(QtGui.QIcon('../images/default.png')) self.ngspice_btn.setIconSize(QtCore.QSize(50,50)) self.grid.addWidget(self.ngspice_btn,0,2) + + self.footprint_btn = QtGui.QPushButton() + self.footprint_btn.setIcon(QtGui.QIcon('../images/default.png')) + self.footprint_btn.setIconSize(QtCore.QSize(50,50)) + self.grid.addWidget(self.footprint_btn,1,0) + + self.pcb_btn = QtGui.QPushButton() + self.pcb_btn.setIcon(QtGui.QIcon('../images/default.png')) + self.pcb_btn.setIconSize(QtCore.QSize(50,50)) + self.grid.addWidget(self.pcb_btn,1,1) + diff --git a/src/frontEnd/ViewManagement.pyc b/src/frontEnd/ViewManagement.pyc index b7023ebd..d7b30b5e 100644 Binary files a/src/frontEnd/ViewManagement.pyc and b/src/frontEnd/ViewManagement.pyc differ diff --git a/src/frontEnd/Workspace.py b/src/frontEnd/Workspace.py index 95c19942..0db3fbd7 100644 --- a/src/frontEnd/Workspace.py +++ b/src/frontEnd/Workspace.py @@ -39,14 +39,14 @@ class Workspace(QtGui.QWidget): def initWorkspace(self): print "Calling workspace" - self.tedit = QtGui.QTextEdit(self) - self.label = QtGui.QLabel(self) - self.ledit = QtGui.QLineEdit(self) + self.note = QtGui.QTextEdit(self) + self.workspace_label = QtGui.QLabel(self) + self.worspace_loc = QtGui.QLineEdit(self) #Add text to text edit,label and line edit - self.tedit.append(self.obj.workspace_text) - self.label.setText("Workspace:") - self.ledit.setText(self.obj.home) + self.note.append(self.obj.workspace_text) + self.workspace_label.setText("Workspace:") + self.worspace_loc.setText(self.obj.home) #Buttons self.browsebtn = QtGui.QPushButton('Browse') @@ -57,9 +57,9 @@ class Workspace(QtGui.QWidget): self.cancelbtn.clicked.connect(self.defaultWorkspace) #Set Geometry - self.tedit.setGeometry(QtCore.QRect(0, 0, 400, 100)) - self.label.setGeometry(QtCore.QRect(10, 130, 81, 17)) - self.ledit.setGeometry(QtCore.QRect(100, 150, 200, 100)) + self.note.setGeometry(QtCore.QRect(0, 0, 400, 100)) + self.workspace_label.setGeometry(QtCore.QRect(10, 130, 81, 17)) + self.worspace_loc.setGeometry(QtCore.QRect(100, 150, 200, 100)) self.browsebtn.setGeometry(QtCore.QRect(290, 120, 98, 27)) self.okbtn.setGeometry(QtCore.QRect(290, 250, 98, 27)) self.cancelbtn.setGeometry(QtCore.QRect(180, 250, 98, 27)) @@ -68,14 +68,14 @@ class Workspace(QtGui.QWidget): #Layout self.hbox = QtGui.QHBoxLayout() - self.hbox.addWidget(self.tedit) + self.hbox.addWidget(self.note) self.grid = QtGui.QGridLayout() self.grid.addChildLayout(self.hbox) - self.grid.addWidget(self.label,2,0) - self.grid.addWidget(self.ledit, 2, 1) + self.grid.addWidget(self.workspace_label,2,0) + self.grid.addWidget(self.worspace_loc, 2, 1) self.grid.addWidget(self.browsebtn, 2, 2) self.grid.addWidget(self.okbtn,3,2) self.grid.addWidget(self.cancelbtn,3,3) @@ -85,7 +85,7 @@ class Workspace(QtGui.QWidget): self.setWindowTitle("Workspace Launcher") #self.setWindowIcon(QtGui.QIcon('logo.png')) self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) - self.tedit.setReadOnly(True) + self.note.setReadOnly(True) self.show() @@ -95,7 +95,7 @@ class Workspace(QtGui.QWidget): def createWorkspace(self): print "Create workspace is called" - self.create_workspace = str(self.ledit.text()) + self.create_workspace = str(self.worspace_loc.text()) if os.path.isdir(self.create_workspace): pass @@ -105,6 +105,7 @@ class Workspace(QtGui.QWidget): else: os.mkdir(self.create_workspace) self.obj.default_workspace["workspace"] = self.create_workspace + self.close() @@ -112,5 +113,5 @@ class Workspace(QtGui.QWidget): print "Browse Location called" self.workspace_directory = QtGui.QFileDialog.getExistingDirectory() print "Path file :", self.workspace_directory - self.ledit.setText(self.workspace_directory) + self.worspace_loc.setText(self.workspace_directory) \ No newline at end of file diff --git a/src/frontEnd/Workspace.pyc b/src/frontEnd/Workspace.pyc index 7492f39a..8da188bc 100644 Binary files a/src/frontEnd/Workspace.pyc and b/src/frontEnd/Workspace.pyc differ diff --git a/src/images/close.jpeg b/src/images/close.jpeg deleted file mode 100644 index ae1224d2..00000000 Binary files a/src/images/close.jpeg and /dev/null differ diff --git a/src/images/close.png b/src/images/close.png deleted file mode 100644 index 952e1a53..00000000 Binary files a/src/images/close.png and /dev/null differ diff --git a/src/images/help.jpeg b/src/images/help.jpeg deleted file mode 100644 index 843cc08e..00000000 Binary files a/src/images/help.jpeg and /dev/null differ diff --git a/src/images/help.png b/src/images/help.png deleted file mode 100644 index ddb893d4..00000000 Binary files a/src/images/help.png and /dev/null differ diff --git a/src/images/newproj.jpeg b/src/images/newproj.jpeg deleted file mode 100644 index 13238844..00000000 Binary files a/src/images/newproj.jpeg and /dev/null differ diff --git a/src/images/newproj.png b/src/images/newproj.png deleted file mode 100644 index 0b3b368f..00000000 Binary files a/src/images/newproj.png and /dev/null differ diff --git a/src/images/openproj.jpeg b/src/images/openproj.jpeg deleted file mode 100644 index 86114b8a..00000000 Binary files a/src/images/openproj.jpeg and /dev/null differ diff --git a/src/images/openproj.png b/src/images/openproj.png deleted file mode 100644 index c903aa48..00000000 Binary files a/src/images/openproj.png and /dev/null differ -- cgit