diff options
Diffstat (limited to 'src/configuration')
-rw-r--r-- | src/configuration/Appconfig.py | 44 | ||||
-rw-r--r-- | src/configuration/Appconfig.pyc | bin | 0 -> 905 bytes | |||
-rw-r--r-- | src/configuration/__init__.py | 0 | ||||
-rw-r--r-- | src/configuration/__init__.pyc | bin | 0 -> 144 bytes | |||
-rw-r--r-- | src/configuration/test.py | 61 |
5 files changed, 105 insertions, 0 deletions
diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py new file mode 100644 index 00000000..d8156ab1 --- /dev/null +++ b/src/configuration/Appconfig.py @@ -0,0 +1,44 @@ +#=============================================================================== +# +# FILE: Appconfig.py +# +# USAGE: --- +# +# DESCRIPTION: This define all configuration used in Application. +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: Fahim Khan, fahim.elex@gmail.com +# ORGANIZATION: ecSim team at FOSSEE, IIT Bombay. +# CREATED: Wednesday 04 February 2015 +# REVISION: --- +#=============================================================================== + + +from PyQt4 import QtGui + + +class Appconfig(QtGui.QWidget): + """ + All configuration goes here + """ + def __init__(self): + super(Appconfig, self).__init__() + #Application Details + self._APPLICATION = 'ecSim' + self._VERSION = 'v1.1' + self._AUTHOR = 'Fahim' + + #Application setting + self.app_xpos = 100 + self.app_ypos = 100 + self.app_width = 600 + self.app_heigth = 400 + + + + + +
\ No newline at end of file diff --git a/src/configuration/Appconfig.pyc b/src/configuration/Appconfig.pyc Binary files differnew file mode 100644 index 00000000..f5c9cccb --- /dev/null +++ b/src/configuration/Appconfig.pyc diff --git a/src/configuration/__init__.py b/src/configuration/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/configuration/__init__.py diff --git a/src/configuration/__init__.pyc b/src/configuration/__init__.pyc Binary files differnew file mode 100644 index 00000000..11873a91 --- /dev/null +++ b/src/configuration/__init__.pyc diff --git a/src/configuration/test.py b/src/configuration/test.py new file mode 100644 index 00000000..4dd9f39d --- /dev/null +++ b/src/configuration/test.py @@ -0,0 +1,61 @@ +''' +Created on 04-Feb-2015 + +@author: fahim +''' +import sys +from PyQt4 import QtGui, QtCore + + +class MainWindow(QtGui.QMainWindow): + + def __init__(self, *args): + apply(QtGui.QMainWindow.__init__, (self, ) + args) + self.setCaption("Adding and deleting widgets") + self.setName("main window") + self.mainWidget=QtGui.QWidget(self) + self.setCentralWidget(self.mainWidget) + self.mainLayout=QtGui.QVBoxLayout(self.mainWidget, 5, 5, "main") + self.buttonLayout=QtGui.QHBoxLayout(self.mainLayout, 5, "button") + self.widgetLayout=QtGui.QVBoxLayout(self.mainLayout, 5, "widget") + + self.bnAdd=QtGui.QPushButton("Add widget", self.mainWidget, "add") + self.connect(self.bnAdd, QtCore.SIGNAL("clicked()"), + self.slotAddWidget) + + self.bnRemove=QtGui.QPushButton("Remove widget", + self.mainWidget, "remove") + self.connect(self.bnRemove, QtCore.SIGNAL("clicked()"), + self.slotRemoveWidget) + + self.buttonLayout.addWidget(self.bnAdd) + self.buttonLayout.addWidget(self.bnRemove) + + self.buttons = [] + + def slotAddWidget(self): + widget=QtGui.QPushButton("test", self.mainWidget) + self.widgetLayout.addWidget(widget) + self.buttons.append(widget) + widget.show() + + def slotRemoveWidget(self): + self.widgetLayout.parent().removeChild(self.widgetLayout) + self.widgetLayout=QtGui.QVBoxLayout(self.mainLayout, 5, "widget") + self.buttons[-1].parent().removeChild(self.buttons[-1]) + del self.buttons[-1:] + + +def main(args): + app=QtGui.QApplication(args) + win=MainWindow() + win.show() + app.connect(app, QtCore.SIGNAL("lastWindowClosed()") + , app + ,QtCore.SLOT("quit()") + ) + app.exec_loop() + +if __name__=="__main__": + main(sys.argv) + |