[Pykafe-commits] SF.net SVN: pykafe: [143] branches/0.1_alpha2/server
Status: Pre-Alpha
Brought to you by:
jnmbk
From: <jn...@us...> - 2007-07-11 12:59:53
|
Revision: 143 http://pykafe.svn.sourceforge.net/pykafe/?rev=143&view=rev Author: jnmbk Date: 2007-07-11 05:59:55 -0700 (Wed, 11 Jul 2007) Log Message: ----------- start refactoring Modified Paths: -------------- branches/0.1_alpha2/server/__init__.py Added Paths: ----------- branches/0.1_alpha2/server/globals.py Modified: branches/0.1_alpha2/server/__init__.py =================================================================== --- branches/0.1_alpha2/server/__init__.py 2007-07-11 12:09:32 UTC (rev 142) +++ branches/0.1_alpha2/server/__init__.py 2007-07-11 12:59:55 UTC (rev 143) @@ -10,23 +10,28 @@ # Please read the COPYING file. # -from sys import argv, exit -from PyQt4 import QtGui -from mainwindow import Ui_MainWindow -from config import PykafeConfiguration +from PyQt4 import QtCore, QtGui, uic +import sys -config = PykafeConfiguration() -app = QtGui.QApplication(argv) -if config.startup_askpassword: - import passwordwindow - window = QtGui.QDialog() - passwordUi = passwordwindow.Ui_Dialog() - passwordUi.setupUi(window) - window.setModal(True) - window.show() -else: - window = QtGui.QMainWindow() - ui = Ui_MainWindow() - ui.setupUi(window) - window.show() -exit(app.exec_()) +import globals + +def main(): + app = QtGui.QApplication(sys.argv) + app.setOrganizationName("pykafe") + app.setApplicationName("pykafe") + settings = QtCore.QSettings() + if settings.value("startup/askpassword", QtCore.QVariant(False)).toBool(): + import passwordwindow + ui = QtGui.QDialog() + passwordUi = passwordwindow.Ui_Dialog() + passwordUi.setupUi(ui) + ui.setModal(True) + ui.show() + else: + ui = uic.loadUi(globals.UiMain) + ui.show() + exitCode = app.exec_() + sys.exit(exitCode) + +if __name__ == "__main__": + main() Added: branches/0.1_alpha2/server/globals.py =================================================================== --- branches/0.1_alpha2/server/globals.py (rev 0) +++ branches/0.1_alpha2/server/globals.py 2007-07-11 12:59:55 UTC (rev 143) @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2007, pyKafe Development Team +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# Please read the COPYING file. +# + +import os + +dataDir = "/usr/share/pykafe" + +# .ui files +UiMain = os.path.join(datadir, "main.ui") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |