Пример #1
0
class App(QApplication):
    def __init__(self, sys_argv):
        super(App, self).__init__(sys_argv)
        self.model = Model()
        self.main_ctrl = Control()
        self.main_view = MainWindow(self.model, self.main_ctrl)
        self.main_view.show()
Пример #2
0
class App(QApplication):
    def __init__(self, sys_argv):
        super(App, self).__init__(sys_argv)
        self.model = Model()
        self.main_ctrl = Control()
        self.main_view = MainWindow(self.model, self.main_ctrl)
        self.main_view.show()
Пример #3
0
 def __init__(self, athlete): 
     self.athlete = athlete
     self.pushups = athlete.getPushups()
     self.mainWindow = MainWindow_View(self.athlete, self.pushups)
     
     self.graphController = GraphPlotter(self.mainWindow.graphWidget, self.pushups)
     self.graphController.initPlotWidget()
     
     self._initComponents()
     self._initSlots()
     
     self.showMainWindow()     
Пример #4
0
def main():
    globvars.init_globvars()
    globvars.initMainLogger()

    globvars.logger = globvars.mainLogger

    model = CMTModel()
    globvars.controller = Controller(model)
    model.initData(globvars.controller)

    app = QApplication(sys.argv)
    view = CMTWidget(model, globvars.controller)
    client = MainWindow(view)

    qt_handler = QtHandler(client.ui.logTextEdit)
    qt_handler.setLevel(logging.INFO)
    qt_handler.setFormatter(globvars.loggingdata.formatter)
    globvars.mainLogger.addHandler(qt_handler)

    globvars.mainLogger.info("Covalyzer Startup")
    globvars.mainLogger.info("Settings at %s", client.settings.fileName())

    client.show()
    sys.exit(app.exec_())
Пример #5
0
 def __init__(self, wordList):
     listStore = Gtk.ListStore(str)
     wordList.setWordList(listStore)
     self.ModelList = wordList
     self.MainWindow = MainWindow(listStore)
     # Conexiones
     self.MainWindow.selectImageB.connect("clicked",
                                          self.selectScreenshotAndGetWords)
     self.MainWindow.wordSizeCombo.connect(
         "changed", self.onWordSizeComboChangeHandler)
     self.MainWindow.addWordB.connect("clicked", self.addNewWordHandler)
     self.MainWindow.wordEntry.connect("activate", self.addNewWordHandler)
     self.MainWindow.refreshB.connect("clicked", self.cleanListHandler)
     self.MainWindow.hitsEntry.connect("activate", self.filterHandler)
     self.MainWindow.acceptB.connect("clicked", self.filterHandler)
Пример #6
0
# Under MIT License, see LICENSE.txt
import sys
from PyQt4.QtGui import QApplication
from View.MainWindow import MainWindow

__author__ = 'RoboCupULaval'

if __name__ == '__main__':
    app = QApplication(sys.argv)
    f = MainWindow()
    f.show()
    sys.exit(app.exec_())
Пример #7
0
import os
from View.MainWindow import MainWindow
from Controller.LogManager import *


logManager = LogManager()
window = MainWindow()

def main():
    pass

if __name__ == '__main__':
    main()
Пример #8
0
def main():
    app = QApplication(sys.argv)
    mainWindow = MainWindow()
    sys.exit(app.exec_())
Пример #9
0
#!/usr/bin/env python
#-*- coding: utf-8 -*-

__author__ = "Aarón Martín Castillo Medina"
__credits__ = ["Aarón Martín Castillo Medina", "Dra. Katya Rodríguez Vázquez"]

__version__ = "1.0"
__mantainer__ = "Aarón Martín Castillo Medina"
__email__ = "*****@*****.**"
__status__ = "Production"

from View.MainWindow import MainWindow
"""
   Este archivo funge como un launcher (disparador)
   el cual simplemente crea y ejecuta la ventana principal.
"""

#Se crea una instancia de la ventana principal
main_window = MainWindow()

#Se ejecuta el método run
main_window.run()
Пример #10
0
from View.MainWindow import MainWindow

if __name__ == '__main__':
    app = MainWindow()
    app.mainloop()
Пример #11
0
class MainWindow():
    def __init__(self, athlete): 
        self.athlete = athlete
        self.pushups = athlete.getPushups()
        self.mainWindow = MainWindow_View(self.athlete, self.pushups)
        
        self.graphController = GraphPlotter(self.mainWindow.graphWidget, self.pushups)
        self.graphController.initPlotWidget()
        
        self._initComponents()
        self._initSlots()
        
        self.showMainWindow()     
            
    def _initComponents(self):
        self.pushupCreation_Controller = PushupCreator(self.athlete)
        self.pushupCreation_Controller.pushupStored.connect(self.refreshGUI)
        
    def _initSlots(self):
        self.mainWindow.addPushupBtn.clicked.connect(self._showPushup_DialogForm) 
        self.mainWindow.pushupsListWidget.deletePushup.connect(self.deletePushup)
        self.mainWindow.pushupsListWidget.deletePushups_in_a_day.connect(self._deleteDay)
        self.mainWindow.profileCreationMenu_Requested.connect(self._profileCreation)
        self.mainWindow.profileSelectionDialog_Requested.connect(self._profileSelection)
    
    def showMainWindow(self):                            
        self.mainWindow.show()            
    
    @Slot()
    def _showPushup_DialogForm(self):        
        self.pushupCreation_Controller.showCreationDialog()      
    
    @Slot(int)
    def deletePushup(self, pushupId):
        database = Pushup_Foundation()
        database.deletePushup(pushupId)
        
        self.refreshGUI()
    
    @Slot(tuple)
    def _deleteDay(self, pushupsId):        
        database = Pushup_Foundation()
        
        database.deletePushups(pushupsId)
                
        self.refreshGUI()
        
    @Slot()
    def _profileSelection(self):
        database = Athlete_Database()
        athletes = database.getAthletes()
        
        profileSelector = ProfileSelector(athletes) 
        profileSelector.profileSelected.connect(self._profileChange)
        profileSelector.profileUpdated.connect(self.mainWindow.profileBox.setProfile)
        profileSelector.lastProfileDeleted.connect(self._clearUI)
        profileSelector.profileDeleted.connect(self._handleActiveProfileDeletion)
        profileSelector.runSelectionDialog() # Modal window appears
    
    @Slot()
    def _profileCreation(self):
        profileCreationController = ProfileCreation()
        profileCreationController.profileCreated.connect(self._profileChange)
        profileCreationController.run()
        
    @Slot(Athlete_Model)
    def _handleActiveProfileDeletion(self, deletedAthlete):
        if self.athlete == deletedAthlete :
            self.mainWindow.cleanUI()  
            self.mainWindow.addPushupBtn.setDisabled(True)
            
    @Slot(Athlete_Model)
    def _profileChange(self, athleteSelected):                     
        if athleteSelected != self.athlete :
            self.athlete = athleteSelected  
            self._initComponents()
            self.refreshGUI()     

    @Slot()   
    def _clearUI(self):        
        self.mainWindow.cleanUI()  
        
    def refreshGUI(self):
        database = Pushup_Foundation()
        updatedPushups = database.getPushupsByAthlete(self.athlete._name)
        
        self.mainWindow.pushupsListWidget.reloadPushupsList(updatedPushups)
        self.mainWindow.profileBox.setProfile(self.athlete)
        self.mainWindow.addPushupBtn.setDisabled(False)
        self.graphController.refreshGraph(updatedPushups)