コード例 #1
0
    def __init__(self, argv, application_id=None):
        QApplication.__init__(self, argv)

        self.socket_filename = unicode(
            os.path.expanduser("~/.ipc_%s" % self.generate_ipc_id()))
        self.shared_mem = QSharedMemory()
        self.shared_mem.setKey(self.socket_filename)

        if self.shared_mem.attach():
            self.is_running = True
            return

        self.is_running = False
        if not self.shared_mem.create(1):
            print >> sys.stderr, "Unable to create single instance"
            return
        # start local server
        self.server = QLocalServer(self)
        # connect signal for incoming connections
        self.connect(self.server, SIGNAL("newConnection()"),
                     self.receive_message)
        # if socket file exists, delete it
        if os.path.exists(self.socket_filename):
            os.remove(self.socket_filename)
        # listen
        self.server.listen(self.socket_filename)
コード例 #2
0
ファイル: main.py プロジェクト: diatel/microhex
    def __init__(self):
        QApplication.__init__(self, sys.argv)
        self.setApplicationName('Microhex')
        self.setOrganizationName('zenwarr')
        self.setOrganizationDomain('https://github.com/zenwarr/microhex')
        self.setApplicationVersion('0.0.2 indev')

        # initialize settings
        settings.defaultConfigure('microhex')
        appsettings.doRegister()

        utils.guiThread = threading.current_thread()

        try:
            if not os.path.exists(settings.defaultSettingsDirectory):
                shutil.copytree(os.path.join(utils.applicationPath, 'settings-default'), settings.defaultSettingsDirectory)
        except OSError as err:
            print('failed to install default settings - {0}'.format(err))

        for s in (settings.globalSettings(), settings.globalQuickSettings()):
            try:
                s.load()
            except settings.SettingsError as err:
                print(utils.tr('failed to load settings: {0}').format(err))

        translate.initApplicationTranslation()
コード例 #3
0
    def __init__(self, argv, application_id=None):
        QApplication.__init__(self, argv)

        self.socket_filename = unicode(os.path.expanduser("~/.ipc_%s"
                                                          % self.generate_ipc_id()) )
        self.shared_mem = QSharedMemory()
        self.shared_mem.setKey(self.socket_filename)

        if self.shared_mem.attach():
            self.is_running = True
            return

        self.is_running = False
        if not self.shared_mem.create(1):
            print >>sys.stderr, "Unable to create single instance"
            return
        # start local server
        self.server = QLocalServer(self)
        # connect signal for incoming connections
        self.connect(self.server, SIGNAL("newConnection()"), self.receive_message)
        # if socket file exists, delete it
        if os.path.exists(self.socket_filename):
            os.remove(self.socket_filename)
        # listen
        self.server.listen(self.socket_filename)
コード例 #4
0
 def __init__(self, argv):
     """
     Constructor
     """
     QApplication.__init__(self, argv)
     self.__objectRegistry = {}
     self.__pluginObjectRegistry = {}
コード例 #5
0
ファイル: Application.py プロジェクト: longedok/zalgo2
    def __init__(self, argv):
        QApplication.__init__(self, argv)
        log_level = logging.DEBUG if 1 == 1 else logging.INFO
        logging.basicConfig(level=log_level,format='%(name)s: %(message)s')
        self.logger = logging.getLogger('Application')

        port = self.SELF_PORT
        if len(argv) > 1:
            port = int(argv[1])
        self.network = NetworkThread((self.SELF_HOST, port))
        client = False
        if port != self.SERVER_PORT:
            client = True
            self.network.server.connectPeer((self.SERVER_HOST, self.SERVER_PORT))
        self.file_indexer = FileIndexer(self.MUSIC_DIR)
        self.file_indexer.start()

        if client:
            self.database = Database('client_media_db')
        else:
            self.database = Database()

        self.main_window = MainWindow(self.network)
        self.main_window.show()

        self.network.server.musicFound.connect(self.main_window.tracklist_model.setTrackList)
コード例 #6
0
ファイル: interfaz.py プロジェクト: nesaro/driza
    def __init__(self,interfazconfig, portero, idu, idf, interfazproyectos,interfazoperaciones, gestorpaquetes, options, esnuevo):
        QApplication.__init__(self,[])
        #Translations
        appTranslator = QtCore.QTranslator()
        idioma = QtCore.QLocale.system().name()
        if not (appTranslator.load('driza_'+idioma+'.qm')):
            logging.info('Unable to load language translation file')
        self.installTranslator(appTranslator)

        self.__options = options
        self.__nuevo = esnuevo
        gestortemas = temas.GestorTemas()
        gestorsalida = gestores.GestorSalida()

        self.__gestorproyectos = interfazproyectos
        self.__iconfig=interfazconfig
        self.__iproyectos=interfazproyectos
        self.__ioperaciones=interfazoperaciones
        self.vprincipal = VPrincipal(self, self.__iconfig, portero, idu, self.__iproyectos, gestortemas, self.__ioperaciones)
        self.vsalida = VSalida(self, gestorsalida, gestortemas)
        self.dcrevar = DCrevar(self.vprincipal, idu, interfazconfig, gestorpaquetes)
        self.__dsplash = DSplash(self.vprincipal, gestortemas, self.__iconfig, self.vsalida)
        self.doperaciones = DOperaciones(self.vprincipal, idu, interfazoperaciones, self.vsalida)
        #self.dimportartexto = DImportarTexto(self.vprincipal, idf) #TODO: pasar a qt4
        self.vprincipal.conexiones()
コード例 #7
0
ファイル: metms.py プロジェクト: jerkos/metms
 def __init__(self, argv):
     """
     Constructor
     @load a config dictionnary
     
     """
     QApplication.__init__(self, argv)
     self.settings=QSettings()
     #for e in self.settings.allKeys():
     #    print str(e)
     self.connect(self, SIGNAL('lastWindowClosed()'), self.goodbye)
     
     self.undoStack = QUndoStack(self)
     self.useGL = self.checkGL()
     self.lowMemory = False
     self.multiCore = False
     #self.modelView = 'Samples View'
     #self.showSplash=self.settings.value('showSplash', True).toBool()
     from gui.MetBaseGui import MSSplashScreen
     self.splash = MSSplashScreen(QPixmap(path.normcase("gui/icons/Tux-G2.png")), Qt.WindowStaysOnTopHint)
     self.splash.show()
     #self.splash.setMask(pixmap.mask())        
     self.splash.showMessage((u'Starting now...'), Qt.AlignCenter | Qt.AlignBottom, Qt.black)
     self.processEvents()
     self.controllers = {}
     self.metmsconfig=self.loadConfiguration()
コード例 #8
0
ファイル: mainQt.py プロジェクト: mahongquan/accessql
    def __init__(self):
        QApplication.__init__(self,[])
        self.mainw=uic.loadUi(initpath+"main.ui")#l.loadUi(f,None)
        self.pushbutton_go=self.mainw.findChild(QPushButton,"pushButton_go")
        QApplication.connect(self.pushbutton_go,SIGNAL('clicked()'),self.handlego)
        
        self.pushButton_pdf=self.mainw.findChild(QPushButton,"pushButton_pdf")
        QApplication.connect(self.pushButton_pdf,SIGNAL('clicked()'),self.handlepdf)

        self.pushButton_rtf=self.mainw.findChild(QPushButton,"pushButton_rtf")
        QApplication.connect(self.pushButton_rtf,SIGNAL('clicked()'),self.handlertf)
        
        self.pushButton_excel=self.mainw.findChild(QPushButton,"pushButton_excel")
        QApplication.connect(self.pushButton_excel,SIGNAL('clicked()'),self.handleexcel)
        
        self.grid1=self.mainw.findChild(QTableWidget,"tableWidget") 
        self.web1=self.mainw.findChild(QWebView,"webView")
        self.loadData()
        self.actionOpen_sample=self.mainw.findChild(QAction,"actionOpen_sample")
        self.connect(self.actionOpen_sample,SIGNAL('triggered (bool)'),self.OnOpenSample)
        
        self.actionClear_all=self.mainw.findChild(QAction,"actionClear_all")
        self.connect(self.actionClear_all,SIGNAL('triggered (bool)'),self.ClearAll)
        
        self.actionExit=self.mainw.findChild(QAction,"actionExit")
        self.connect(self.actionExit,SIGNAL('triggered (bool)'),self.OnExit)
コード例 #9
0
    def __init__(self, argv):
        """
        Constructor
        @load a config dictionnary
        
        """
        QApplication.__init__(self, argv)
        self.settings = QSettings()
        #for e in self.settings.allKeys():
        #    print str(e)
        self.connect(self, SIGNAL('lastWindowClosed()'), self.goodbye)

        self.undoStack = QUndoStack(self)
        self.useGL = self.checkGL()
        self.lowMemory = False
        self.multiCore = False
        #self.modelView = 'Samples View'
        #self.showSplash=self.settings.value('showSplash', True).toBool()
        from gui.MetBaseGui import MSSplashScreen
        self.splash = MSSplashScreen(
            QPixmap(path.normcase("gui/icons/Tux-G2.png")),
            Qt.WindowStaysOnTopHint)
        self.splash.show()
        #self.splash.setMask(pixmap.mask())
        self.splash.showMessage((u'Starting now...'),
                                Qt.AlignCenter | Qt.AlignBottom, Qt.black)
        self.processEvents()
        self.controllers = {}
        self.metmsconfig = self.loadConfiguration()
コード例 #10
0
 def __init__(self, *args):
     QApplication.__init__(self, *args)
     styleName = str(self.style().metaObject().className())[1:-5].lower()
     if styleName not in ("windowsxp", "windowsvista", "mac"):
         self.setPalette(self.style().standardPalette())
     self.setWindowIcon(QIcon(":/icon_app.svg"))
     self.connect(self, SIGNAL("lastWindowClosed()"), NodeBoxDocumentBaseClass.writeSettings)
コード例 #11
0
ファイル: app.py プロジェクト: TeddyBoomer/geophar
 def __init__(self, args=[], **kw):
     QApplication.__init__(self, args)
     locale = QLocale.system().name()
     translator=QTranslator ()
     translator.load("qt_" + locale,
                   QLibraryInfo.location(QLibraryInfo.TranslationsPath))
     self.installTranslator(translator)
     self._print_signal.connect(self._print)
コード例 #12
0
 def __init__(self, *args):
     QApplication.__init__(self, *args)
     styleName = str(self.style().metaObject().className())[1:-5].lower()
     if styleName not in ("windowsxp", "windowsvista", "mac"):
         self.setPalette(self.style().standardPalette())
     self.setWindowIcon(QIcon(":/icon_app.svg"))
     self.connect(self, SIGNAL("lastWindowClosed()"),
                  NodeBoxDocumentBaseClass.writeSettings)
コード例 #13
0
 def __init__(self, *args):
     QApplication.__init__(self, *args)
     self.main = MainWindow()
     self.main.show()
     resolution = QDesktopWidget().screenGeometry()
     self.main.move(
         (resolution.width() / 2) - (self.main.frameSize().width() / 2),
         (resolution.height() / 2) - (self.main.frameSize().height() / 2))
コード例 #14
0
ファイル: app.py プロジェクト: Grahack/geophar
 def __init__(self, args=[], **kw):
     QApplication.__init__(self, args)
     locale = QLocale.system().name()
     translator=QTranslator ()
     translator.load("qt_" + locale,
                   QLibraryInfo.location(QLibraryInfo.TranslationsPath))
     self.installTranslator(translator)
     if param.style_Qt:
         self.setStyle(param.style_Qt)
コード例 #15
0
 def __init__(self, argv, opts):
     """
     Constructor
     
     @param argv command line arguments
     @param opts acceptable command line options (ignored)
     """
     QApplication.__init__(self, argv)
     KQApplicationMixin.__init__(self)
コード例 #16
0
ファイル: OTPApplication.py プロジェクト: Pesa/forse
 def __init__(self, appName):
     QApplication.__init__(self, sys.argv)
     if self._initialized:
         return
     qt4reactor.install()
     OTPApplication._appName = appName
     OTPApplication._nodeName = buildNodeName(self._appName, randomize=True)
     OTPApplication._process = twotp.Process(self._nodeName, self._cookie)
     QTimer.singleShot(0, self._startup)
     OTPApplication._initialized = True
コード例 #17
0
 def __init__(self, args=[], **kw):
     QApplication.__init__(self, args)
     locale = QLocale.system().name()
     translator=QTranslator ()
     translator.load("qt_" + locale,
                   QLibraryInfo.location(QLibraryInfo.TranslationsPath))
     self.installTranslator(translator)
     self._print_signal.connect(self._print)
     # Pour Mac OS X
     self.setAttribute(Qt.AA_DontUseNativeMenuBar)
コード例 #18
0
ファイル: oauth_ui.py プロジェクト: ktzhaoshuai/baiduyun
 def __init__(self, oa_url, oa_result_base, args):
     super(QApplication, self).__init__(args)
     QApplication.__init__(self, args)
     self.oa_result_base = oa_result_base
     self.oa_result = oa_result_base
     self.browser = QWebView()
     self.browser.loadFinished.connect(self.__result_available)
     self.browser.load(QUrl(oa_url))
     self.browser.show()
     self.exec_()
コード例 #19
0
 def __init__(self, *args):
     QApplication.__init__(self, *args)
     self._memory = QSharedMemory(self)
     self._memory.setKey("d2mp")
     if self._memory.attach():
         self._running = True
     else:
         self._running = False
         if not self._memory.create(1):
             raise RuntimeError(self._memory.errorString().toLocal8Bit().data())
コード例 #20
0
ファイル: qt.py プロジェクト: user35007/Cryptully
    def __init__(self, argv, nick, turn, port):
        QApplication.__init__(self, argv)

        self.nick = nick
        self.turn = turn
        self.port = port
        self.isEventLoopRunning = False

        qtUtils.setIsLightTheme(self.palette().color(QPalette.Window))

        self.aboutToQuit.connect(self.stop)
コード例 #21
0
ファイル: qt.py プロジェクト: oukiar/Cryptully
    def __init__(self, argv, mode, port, host):
        QApplication.__init__(self, argv)

        self.mode = mode
        self.port = port
        self.host = host
        self.isEventLoopRunning = False
        self.connectedToClient = False
        self.isLightTheme = qtUtils.isLightTheme(self.palette().color(QPalette.Window))

        self.aboutToQuit.connect(self.stop)
コード例 #22
0
 def __init__(self, options):
     QApplication.__init__(self, sys.argv)
     print _("Initializing notification manager...")
     # We don't want the program to get closed when there is no visible notificaition window:
     self.setQuitOnLastWindowClosed(False)
     # Initialize the pending message queue:
     self.message_queue = []
     self.lifespan = options["manager_lifetime"]
     self.last_notification_time = time.time()
     # Initialize the timer:
     self.timer = Timer(self)
     # Initialize the notification displayer:
     self.notification_displayer = NotificationDisplayer(options)
コード例 #23
0
 def __init__(self, args):
     global f
     f = open(filename, "a")
     f.write("Initializing application...\n")
     f.close()
     QApplication.__init__(self, args)
     qApp.addLibraryPath(Paths["Plugins"])
     window = GUI()
     window.show()
     self.exec_()
     f = open(filename, "a")
     f.write("Application exit code.\n")
     f.close()
コード例 #24
0
    def __init__(self):
        """ Initilize the application instance
            and register GApp variable to ourself
        """
        # call parent contructor
        QApplication.__init__(self, sys.argv)

        self.__mainWindow = None
        self.__workspace = None
        self.__scene = None
        self.__topology = None
        self.__dynagen = None
        self.__HypervisorManager = None
        self.__QemuManager = None
        self.__VBoxManager = None

        # Dict for storing config
        self.__systconf = {}
        self.__projconf = {}
        self.__iosimages = {}
        self.__hypervisors = {}
        self.__libraries = {}
        self.__qemuimages = {}
        self.__vboximages = {}
        self.__piximages = {}
        self.__junosimages = {}
        self.__asaimages = {}
        self.__awprouterimages = {}
        self.__idsimages = {}
        self.__recentfiles = []
        self.iosimages_ids = 0
        self.hypervisors_ids = 0
        self.qemuimages_ids = 0
        self.vboximages_ids = 0
        self.piximages_ids = 0
        self.junosimages_ids = 0
        self.asaimages_ids = 0
        self.awprouterimages_ids = 0
        self.idsimages_ids = 0

        # set global app to ourself
        globals.GApp = self

        # Force SystemScope init file to Defaults.SysConfigDir
        if not sys.platform.startswith('win'):
            QSettings.setPath(QSettings.IniFormat,
                              QSettings.SystemScope,
                              Defaults.SysConfigDir)
            QSettings.setPath(QSettings.IniFormat,
                              QSettings.UserScope,
                              os.path.expanduser(Defaults.UsrConfigDir))
コード例 #25
0
ファイル: gui.py プロジェクト: arxsys/dff-ui
    def __init__(self, debug = False, verbosity = 0):
        """Launch GUI"""
	QApplication.__init__(self, sys.argv)
        UI.__init__(self, debug, verbosity)
        self.translator = Translator()
        self.installTranslator(self.translator.getGeneric())
        self.installTranslator(self.translator.getDFF())
        self.setApplicationName("Digital Forensics Framework")
        # Below are macros replaced by CMake using configure_file please don't
        # commit this file with macros replaced, view those macros definition
        # in the top level CMakeLists.txt
        self.setApplicationVersion("1.3.0")
        pixmap = QPixmap(":splash.png")
        self.splash = SplashScreen(pixmap, Qt.WindowStaysOnTopHint, self.applicationVersion())
        self.splash.setMask(pixmap.mask()) 
コード例 #26
0
ファイル: gui.py プロジェクト: kzwkt/dff
 def __init__(self, debug=False, verbosity=0):
     """Launch GUI"""
     QApplication.__init__(self, sys.argv)
     UI.__init__(self, debug, verbosity)
     self.translator = Translator()
     self.installTranslator(self.translator.getGeneric())
     self.installTranslator(self.translator.getDFF())
     self.setApplicationName("Digital Forensics Framework")
     # Below are macros replaced by CMake using configure_file please don't
     # commit this file with macros replaced, view those macros definition
     # in the top level CMakeLists.txt
     self.setApplicationVersion("1.3.0")
     pixmap = QPixmap(":splash.png")
     self.splash = SplashScreen(pixmap, Qt.WindowStaysOnTopHint,
                                self.applicationVersion())
     self.splash.setMask(pixmap.mask())
コード例 #27
0
    def __init__(self, renderer, scene, title):
        QApplication.__init__(self, sys.argv)
        self.window = QMainWindow()
        self.window.setWindowTitle(title)
        self.window.resize(800, 600)

        # Get OpenGL 4.1 context
        glformat = QGLFormat()
        glformat.setVersion(4, 1)
        glformat.setProfile(QGLFormat.CoreProfile)
        glformat.setDoubleBuffer(False)

        self.glwidget = MyGlWidget(renderer, glformat, self, scene)
        self.window.setCentralWidget(self.glwidget)

        self.window.show()
コード例 #28
0
    def __init__(self, argv, catalog):
        QApplication.__init__(self, argv)
        self.aboutToQuit.connect(self.cleanup)
        self.control = QtNetwork.QLocalServer(self)
        self.control.newConnection.connect(self.onControlConnect)
        self.mainwindow = None
        self.catalog = '%s-pds.socket' % catalog

        self._init_translations()

        self.readyToRun = self.control.listen(self.catalog)

        if not self.readyToRun:
            if self.sendToInstance('show-mainwindow'):
                sys.exit()
            else:
                self.control.removeServer(self.catalog)
                self.readyToRun = self.control.listen(self.catalog)
コード例 #29
0
ファイル: gui.py プロジェクト: vertrex/DFF
 def __init__(self, arguments):
     """Launch GUI"""
     self.arguments = arguments
     QApplication.__init__(self, sys.argv)
     UI.__init__(self, arguments)
     self.translator = Translator()
     self.translator.addTranslationPath("dff/ui/gui/i18n/Dff_pro_")
     self.translator.addTranslationPath("dff/modules/i18n/Dff_pro_modules_")
     self.translator.loadLanguage()
     self.setApplicationName("Digital Forensics Framework")
     # Below are macros replaced by CMake using configure_file please don't
     # commit this file with macros replaced, view those macros definition
     # in the top level CMakeLists.txt
     self.setApplicationVersion(dff.VERSION)
     pixmap = QPixmap(":splash.png")
     self.splash = SplashScreen(pixmap, Qt.WindowStaysOnTopHint,
                                self.applicationVersion())
     self.splash.setMask(pixmap.mask())
コード例 #30
0
ファイル: experiment.py プロジェクト: compmem/psyqt
    def __init__(self,argv):
        # init the widget
        QApplication.__init__(self,argv)

        # set up the state machine
        self._machine = QStateMachine()

        # Start with a top-level serial state
        self._exp_state = Serial(new_timeline=True) #QState(QState.ExclusiveStates)
        self._current_parent = self._exp_state

        # Set as initial state of state machine
        self._machine.addState(self._exp_state)
        self._machine.setInitialState(self._exp_state)
        
        # set up timer
        self._last_time = now()
        self._new_time = now()
コード例 #31
0
ファイル: quniqueapp.py プロジェクト: blue-devil/project
    def __init__(self, argv, catalog):
        QApplication.__init__(self, argv)
        self.aboutToQuit.connect(self.cleanup)
        self.control = QtNetwork.QLocalServer(self)
        self.control.newConnection.connect(self.onControlConnect)
        self.mainwindow = None
        self.catalog = '%s-pds.socket' % catalog

        self._init_translations()

        self.readyToRun = self.control.listen(self.catalog)

        if not self.readyToRun:
            if self.sendToInstance('show-mainwindow'):
                sys.exit()
            else:
                self.control.removeServer(self.catalog)
                self.readyToRun = self.control.listen(self.catalog)
コード例 #32
0
ファイル: mainAccess.py プロジェクト: mahongquan/accessql
    def __init__(self):
        QApplication.__init__(self,[])
        self.mainw=uic.loadUi("main.ui")#l.loadUi(f,None)
        self.pushbutton_go=self.mainw.findChild(QPushButton,"pushButton_go")
        QApplication.connect(self.pushbutton_go,SIGNAL('clicked()'),self.handlego)
        
        self.pushButton_pdf=self.mainw.findChild(QPushButton,"pushButton_pdf")
        QApplication.connect(self.pushButton_pdf,SIGNAL('clicked()'),self.handlepdf)

        
        self.grid1=self.mainw.findChild(QTableWidget,"tableWidget") 
        self.web1=self.mainw.findChild(QWebView,"webView")
        self.loadData()
        self.actionOpen_sample=self.mainw.findChild(QAction,"actionOpen_sample")
        self.connect(self.actionOpen_sample,SIGNAL('triggered (bool)'),self.OnOpenSample)
        
        self.actionClear_all=self.mainw.findChild(QAction,"actionClear_all")
        self.connect(self.actionClear_all,SIGNAL('triggered (bool)'),self.ClearAll)
コード例 #33
0
ファイル: experiment.py プロジェクト: paulhendricks/psyqt
    def __init__(self, argv):
        # init the widget
        QApplication.__init__(self, argv)

        # set up the state machine
        self._machine = QStateMachine()

        # Start with a top-level serial state
        self._exp_state = Serial(
            new_timeline=True)  #QState(QState.ExclusiveStates)
        self._current_parent = self._exp_state

        # Set as initial state of state machine
        self._machine.addState(self._exp_state)
        self._machine.setInitialState(self._exp_state)

        # set up timer
        self._last_time = now()
        self._new_time = now()
コード例 #34
0
ファイル: application.py プロジェクト: genbtc/goxgui
    def __init__(self, *args):

        QApplication.__init__(self, *args)

        # initialize logging
        logging.basicConfig(filename='log.txt', level=logging.INFO,
                            filemode='w',format='%(asctime)s %(message)s')
        logging.info("Starting application.")

        # initialize user preferences
        preferences = Preferences()

        # initialize model
        market = GoxMarket(preferences)

        # initialize view
        self.view = View(preferences, market)

        self.connect(self, SIGNAL('lastWindowClosed()'), self.__quit)
コード例 #35
0
ファイル: SlaController.py プロジェクト: SHINOTECH/slaprinter
    def __init__(self, argv):



        QApplication.__init__(self, argv)

        # main window
        self.__mainWindow = QMainWindow()
        self.__ui1 = Ui_MainWindow()
        self.__glMain = object()
        self.__stl_model = StlModel()
        self.__stl_view = None

        # printing dialog
        self.__printingDialog = QDialog()
        self.__ui2 = Ui_PrintingDialog()

        # printing window
        self.__printingWindow = QMainWindow()
        self.__ui3 = Ui_PrintingWindow()
        self.__glStatus = object()

        # printer settings
        self.__printerSettings = QDialog()
        self.__ui4 = Ui_PrinterSettings()

        # slicing dialog
        # ToDo find something working as DropDown or get ComboBox working
        #self.__ui5 = ...

        # slicing window
        self.__glSlice = object()
        self.__slicingwindow = QMainWindow()
        self.__ui6 = Ui_SlicingWindow()
        self.__slicing_model = None
        self.__slicing_view = None
        self.__slices = None
        self.__slicing_index = 0

        self.__connection = None
        self.__config = ConfigurationModel()
        self.current_z = 0
コード例 #36
0
ファイル: singleapp.py プロジェクト: AlecChou/ldoce5viewer
    def __init__(self, argv, key):
        QApplication.__init__(self, argv)

        self._key = key
        self._timeout = 1000

        socket = QLocalSocket(self)
        socket.connectToServer(self._key)
        if socket.waitForConnected(self._timeout):
            self._isRunning = True
            socket.abort()
            return
        socket.abort()

        self._isRunning = False
        self._server = QLocalServer(self)
        self._server.newConnection.connect(self.__onNewConnection)
        self._server.listen(self._key)

        self.aboutToQuit.connect(self.__onAboutToQuit)
コード例 #37
0
ファイル: singleapp.py プロジェクト: vit88/ldoce5viewer
    def __init__(self, argv, key):
        QApplication.__init__(self, argv)

        self._key = key
        self._timeout = 1000

        socket = QLocalSocket(self)
        socket.connectToServer(self._key)
        if socket.waitForConnected(self._timeout):
            self._isRunning = True
            socket.abort()
            return
        socket.abort()

        self._isRunning = False
        self._server = QLocalServer(self)
        self._server.newConnection.connect(self.__onNewConnection)
        self._server.listen(self._key)

        self.aboutToQuit.connect(self.__onAboutToQuit)
コード例 #38
0
ファイル: application.py プロジェクト: genbtc/goxgui
    def __init__(self, *args):

        QApplication.__init__(self, *args)

        # initialize logging
        logging.basicConfig(filename='log.txt',
                            level=logging.INFO,
                            filemode='w',
                            format='%(asctime)s %(message)s')
        logging.info("Starting application.")

        # initialize user preferences
        preferences = Preferences()

        # initialize model
        market = GoxMarket(preferences)

        # initialize view
        self.view = View(preferences, market)

        self.connect(self, SIGNAL('lastWindowClosed()'), self.__quit)
コード例 #39
0
ファイル: main.py プロジェクト: HideTheMess/OpenAnt
 def __init__(self):
     QApplication.__init__(self, sys.argv)
     
     # Set the default background color to a darker grey.
     self.setPalette(QPalette(self.palette().button().color(), QColor(192, 192, 192)))
 
     self.window = MainWindow()
     self.window.show()
     self.window.start()
     self.window.setWindowTitle('OpenAnt')
     
     # Game timer, used in the gameloop FPS calculations.
     self.game_timer = QTime()
     self.game_timer.start()
     
     # Draw map, set view to ground.
     self.map = Map()
     Globals.view = self.map.generateMap()
     self.map.spawnAnts()
     
     # Start the main loop.
     self.gameLoop()
コード例 #40
0
ファイル: application.py プロジェクト: twhyte/goxgui
    def __init__(self, *args):

        self.logfile = open('log.txt', 'w')

        QApplication.__init__(self, *args)

        # initialize model (gox)
        #goxapi.FORCE_PROTOCOL = 'socketio'
        self.config = goxapi.GoxConfig("goxtool.ini")
        self.secret = goxapi.Secret(self.config)
        self.gox = goxapi.Gox(self.secret, self.config)

        
        self.strategy_object = stoploss.Strategy(self.gox)
                
        # initialize view
        self.view = View(self.gox, self.secret, self.logfile)
        self.view.log('Starting application.')

        # start connection to MtGox
        self.gox.start()
        
        self.connect(self, SIGNAL('lastWindowClosed()'), self.__quit)
コード例 #41
0
    def __init__(self):
        QApplication.__init__(self, sys.argv)

        # Set the default background color to a darker grey.
        self.setPalette(
            QPalette(self.palette().button().color(), QColor(192, 192, 192)))

        self.window = MainWindow()
        self.window.show()
        self.window.start()
        self.window.setWindowTitle('OpenAnt')

        # Game timer, used in the gameloop FPS calculations.
        self.game_timer = QTime()
        self.game_timer.start()

        # Draw map, set view to ground.
        self.map = Map()
        Globals.view = self.map.generateMap()
        self.map.spawnAnts()

        # Start the main loop.
        self.gameLoop()
コード例 #42
0
ファイル: application.py プロジェクト: tzarskyz/goxgui
    def __init__(self, *args):

        self.logfile = open('log.txt', 'w')

        QApplication.__init__(self, *args)

        # initialize model (gox)
        goxapi.FORCE_PROTOCOL = 'socketio'
        self.config = goxapi.GoxConfig("goxtool.ini")
        self.secret = goxapi.Secret(self.config)
        self.gox = goxapi.Gox(self.secret, self.config)

        # initialize view
        self.view = View(self.gox, self.secret, self.logfile)

        self.view.log('')
        self.view.log('Starting application.')
        self.view.log('')

        # start connection to MtGox
        self.gox.start()

        self.connect(self, SIGNAL('lastWindowClosed()'), self.__quit)
コード例 #43
0
ファイル: application.py プロジェクト: fukanchik/codimension
    def __init__( self, argv, style ):
        QApplication.__init__( self, argv )

        # Sick! The QT doc recommends the following:
        # "To ensure that the application's style is set correctly, it is best
        # to call this function before the QApplication constructor, if
        # possible". However if I do it before QApplication.__init__() then
        # there is a crash! At least with some styles on Ubuntu 12.04 64 bit.
        # So I have to call the initialization after the __init__ call.
        QApplication.setStyle( style )

        self.mainWindow = None
        self.__lastFocus = None
        self.__beforeMenuBar = None

        # Sick! It seems that QT sends Activate/Deactivate signals every time
        # a dialog window is opened/closed. This happens very quickly (and
        # totally unexpected!). So the last focus widget must not be focused
        # unconditionally as the last focus may come from a dialog which has
        # already been destroyed. Without checking that a widget is still alive
        # (e.g. clicking 'Cancel' in a dialog box) leads to a core dump.

        QApplication.setWindowIcon( PixmapCache().getIcon( 'icon.png' ) )

        self.focusChanged.connect( self.__onFocusChanged )

        # Avoid having rectangular frames on the status bar and
        # some application wide style changes
        appCSS = GlobalData().skin.appCSS
        if appCSS != "":
            self.setStyleSheet( appCSS )

        # Install custom GC
        self.__gc = GarbageCollector( self )

        self.installEventFilter( self )
        return
コード例 #44
0
    def __init__(self, argv, style):
        QApplication.__init__(self, argv)

        # Sick! The QT doc recommends the following:
        # "To ensure that the application's style is set correctly, it is best
        # to call this function before the QApplication constructor, if
        # possible". However if I do it before QApplication.__init__() then
        # there is a crash! At least with some styles on Ubuntu 12.04 64 bit.
        # So I have to call the initialization after the __init__ call.
        QApplication.setStyle(style)

        self.mainWindow = None
        self.__lastFocus = None
        self.__beforeMenuBar = None

        # Sick! It seems that QT sends Activate/Deactivate signals every time
        # a dialog window is opened/closed. This happens very quickly (and
        # totally unexpected!). So the last focus widget must not be focused
        # unconditionally as the last focus may come from a dialog which has
        # already been destroyed. Without checking that a widget is still alive
        # (e.g. clicking 'Cancel' in a dialog box) leads to a core dump.

        QApplication.setWindowIcon(PixmapCache().getIcon('icon.png'))

        self.focusChanged.connect(self.__onFocusChanged)

        # Avoid having rectangular frames on the status bar and
        # some application wide style changes
        appCSS = GlobalData().skin.appCSS
        if appCSS != "":
            self.setStyleSheet(appCSS)

        # Install custom GC
        self.__gc = GarbageCollector(self)

        self.installEventFilter(self)
        return
コード例 #45
0
 def __init__(self, argv):
     QApplication.__init__(self, argv)
コード例 #46
0
 def __init__(self, argv):
   QApplication.__init__(self, argv)
コード例 #47
0
ファイル: luma.py プロジェクト: khosrow/luma-devel
 def __init__(self, argv):
     QApplication.__init__(self, argv)
     self.progressBar = None
コード例 #48
0
 def __init__(self, *args):
     QApplication.__init__(self, *args)
コード例 #49
0
    def __init__(self, *args, **kwargs):
        QApplication.__init__(self, *args, **kwargs)

        self.object_creator_signal.connect(self.object_creator_slot)
        self.setWindowIcon(QIcon(load_pixmap('brickv-icon.png')))
コード例 #50
0
ファイル: qt.py プロジェクト: nledez/cozy-weboob
    def __init__(self):
        QApplication.__init__(self, sys.argv)
        self.setApplicationName(self.APPNAME)

        Application.__init__(self)
        self.cbmanager = QCallbacksManager(self.weboob, self)
コード例 #51
0
 def __init__(self):
     QApplication.__init__(self, sys.argv)
     self.mainWindowController = MainWindowController(self)
     self.exec_()
コード例 #52
0
ファイル: main.py プロジェクト: fischero19/brickv
    def __init__(self, *args, **kwargs):
        QApplication.__init__(self, *args, **kwargs)

        self.object_creator_signal.connect(self.object_creator_slot)
        self.setWindowIcon(QIcon(load_pixmap('brickv-icon.png')))
コード例 #53
0
ファイル: qt.py プロジェクト: frankrousseau/weboob
    def __init__(self):
        QApplication.__init__(self, sys.argv)
        self.setApplicationName(self.APPNAME)

        Application.__init__(self)
        self.cbmanager = QCallbacksManager(self.weboob, self)
コード例 #54
0
ファイル: App.py プロジェクト: sangseu/ecu-manager
 def __init__(self, argv):
     QApplication.__init__(self, argv)
     App._instance = self
コード例 #55
0
ファイル: qt.py プロジェクト: jocelynj/weboob
    def __init__(self):
        QApplication.__init__(self, sys.argv)
        self.setApplicationName(self.APPNAME)

        BaseApplication.__init__(self)
コード例 #56
0
 def __init__(self, *args):
     QApplication.__init__(self, *args)
     self.assertOnEvents = False