SF.net SVN: fclient:[767] trunk/fclient/src/fclient/impl/Ui_MainWindow.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-07-27 11:28:53
|
Revision: 767
http://fclient.svn.sourceforge.net/fclient/?rev=767&view=rev
Author: jUrner
Date: 2008-07-27 11:29:02 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
no longer needed
Removed Paths:
-------------
trunk/fclient/src/fclient/impl/Ui_MainWindow.py
Deleted: trunk/fclient/src/fclient/impl/Ui_MainWindow.py
===================================================================
--- trunk/fclient/src/fclient/impl/Ui_MainWindow.py 2008-07-27 11:27:22 UTC (rev 766)
+++ trunk/fclient/src/fclient/impl/Ui_MainWindow.py 2008-07-27 11:29:02 UTC (rev 767)
@@ -1,160 +0,0 @@
-from __future__ import absolute_import
-if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below
- import os; __path__ = [os.path.dirname(__file__)]
-
-import logging
-import sys
-logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
-
-from PyQt4 import QtCore, QtGui
-
-from . import config
-from . import Ui_Prefs
-from . import Ui_View
-from .lib.qt4ex import dlgabout
-
-from .tpls.Ui_MainWindowTpl import Ui_MainWindow
-#**********************************************************************************
-#
-#**********************************************************************************
-class Settings(config.SettingsBase):
-
- _key_ = config.IdMainWindow
- _settings_ = (
- ('Geometry', 'ByteArray', QtCore.QByteArray(), config.SettingScopePrivate),
- )
-
-
-class Actions(config.ActionsBase):
-
- def __init__(self, parent):
- config.ActionsBase.__init__(self, parent)
-
- self.action(
- name='ActionPreferences',
- text=self.trUtf8('&Preferences...'),
- trigger=parent.onActPreferencesTriggered,
- )
- self.action(
- name='ActionExit',
- text=self.trUtf8('E&xit'),
- trigger=parent.onActExitTriggered,
- )
- self.action(
- name='ActionAbout',
- text=self.trUtf8('A&bout...'),
- trigger=parent.onActAboutTriggered,
- )
- self.action(
- name='ActionHelp',
- text=self.trUtf8('&Help...'),
- trigger=parent.onActHelpTriggered,
- )
-
-#**********************************************************************************
-#
-#**********************************************************************************
-class MenuBar(QtGui.QMenuBar):
-
- def __init__(self, parent):
- QtGui.QMenuBar.__init__(self, parent)
- self.setObjectName('MenuBar')
- #config.ObjectRegistry.register(self)
-
- self.menuApplication = QtGui.QMenu(self.trUtf8('&Application'), self)
- self.addMenu(self.menuApplication)
- self.menuApplication.addAction(parent.fclientActions['ActionPreferences'])
- self.menuApplication.addAction(parent.fclientActions['ActionExit'])
-
- self.menuHelp = QtGui.QMenu(self.trUtf8('&Help'), self)
- self.addMenu(self.menuHelp)
- self.menuHelp.addAction(parent.fclientActions['ActionAbout'])
- self.menuHelp.addAction(parent.fclientActions['ActionHelp'])
-
-
- def addViewMenu(self, menu):
- self.insertMenu(self.menuHelp.children()[0], menu)
- return menu
-
-
-
-class StatusBar(QtGui.QStatusBar):
-
- def __init__(self, parent):
- QtGui.QStatusBar.__init__(self, parent)
- self.setObjectName('StatusBar')
- #config.ObjectRegistry.register(self)
- parent.setStatusBar(self)
-
-#**********************************************************************************
-#
-#**********************************************************************************
-class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
-
- def __init__(self, parent=None):
- QtGui.QMainWindow.__init__(self, parent)
- self._isCreated = False
-
- self.setupUi(self)
- config.ObjectRegistry.register(self)
-
- self.fclientSettings = Settings().restore()
- self.fclientActions = Actions(self)
- self.setMenuBar(MenuBar(self))
- self.setStatusBar(StatusBar(self))
-
- self.restoreGeometry(self.fclientSettings.value('Geometry'))
-
- ##################################################
- ## events
- ##################################################
- def closeEvent(self, event):
- self.fclientSettings.setValues(Geometry=self.saveGeometry())
-
-
- def showEvent(self, event):
- if self._isCreated:
- return
- self._isCreated = True
-
- ##################################################
- ## event onrs
- ##################################################
- def onActPreferencesTriggered(self):
- dlg = Ui_Prefs.PrefsDlg(self)
- if dlg.exec_() == dlg.Accepted:
- pass
-
- def onActExitTriggered(self):
- self.close()
-
- def onActHelpTriggered(self):
- pass
-
- def onActAboutTriggered(self):
- dlg = dlgabout.DlgAbout(
- self,
- ##state=self.guiSettings['DlgAboutState'],
- caption=config.FclientAppName + ' - ' + self.trUtf8('About'),
- appName=config.FclientAppName,
- description=self.trUtf8('a freenet client written in python and Qt4'),
- version=config.FclientVersion,
- author=config.FclientAuthor,
- licence=config.FclientLicence,
- copyright=config.FclientCopyright,
- homepage=config.FclientHomepage
- )
- dlg.exec_()
- #self.guiSettings['DlgAboutState'] = dlg.saveState()
-
-#**********************************************************************************
-#
-#**********************************************************************************
-if __name__ == '__main__':
- import sys
-
- app = QtGui.QApplication(sys.argv)
- w = MainWindow(None)
- w.show()
- res = app.exec_()
- sys.exit(res)
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|