Exemplo n.º 1
0
Arquivo: suzu.py Projeto: Xifax/suzu
def main():
    
    app = QApplication(sys.argv)
    app.setWindowIcon(QIcon(PATH_TO_RES + LOGOS + 'suzu.png'))
    
    # application settings #
    options = Options()
    if options.isPlastique():  app.setStyle('plastique')
    
    # main gui module #
    quiz = Quiz(options)
    
    # additional gui components #
    about = About()
    options = OptionsDialog(quiz.srs.db, quiz.options)
    qdict = QuickDictionary(quiz.jmdict, quiz.edict, quiz.kjd, quiz.srs.db, quiz.options)
    
    # background updater #
    updater = BackgroundDownloader(quiz.options.getRepetitionInterval())
    updater.start()
    
    # additional tools #
    tools = Tools()
    web = WebPage()
    statistics = StatsInfo(quiz.srs.db)
    rehash = QuizRehash(quiz.srs.db, quiz.kjd, quiz.edict)
    
    # initializing references and hotkeys #
    quiz.addReferences(about, options, qdict, updater, tools, statistics, web, rehash)
    quiz.initGlobalHotkeys()
    
    try:
        sys.exit(app.exec_())
    except Exception, e:
        log.debug(e)
Exemplo n.º 2
0
def main():
    try:
        app = QApplication(sys.argv)
        #app.setStyle('cleanlooks')
        app.setStyleSheet(qdarkstyle.load_stylesheet())
        db = Database('sample.db')

        icon = QIcon('app.ico')
        app.setWindowIcon(icon)

    #   set the default font for the app
        app.setFont(MEDIUM_FONT)
        app.setStyle(BUTTON_STYLE)

        main_view = MainView()
        main_view.showMaximized()
 
        main_view.show()
        app.exec_()

    #   clean up and exit code
        for model in main_view.models:
            model.submitAll() # commit all pending changes to all models
        db.close()
        app.quit()
        sys.exit(0)
        #os._exit(0)
    except SystemExit:
        print("Closing Window...")
    except Exception as e:
        print(str(e))
Exemplo n.º 3
0
def main():
	QApplication.setColorSpec(QApplication.ManyColor)
	app = QApplication(sys.argv)
	app.setOrganizationName("NJN Ltd.")
	app.setOrganizationDomain("e-nool.blogspot.com")
	app.setApplicationName("Nigandu English to Tamil Dictionary")
	app.setWindowIcon(QIcon(":/icons/njnlogo.png"))
	form = mainwin()
	form.show()
	app.exec_()
Exemplo n.º 4
0
def init():
    logging.debug('PySide ver: %s  (lib path: %s)', PySide.__version__,
                  QLibraryInfo.location(QLibraryInfo.LibrariesPath))
    app = QApplication(sys.argv)
    app.setWindowIcon(makeQIcon(':/appicon-24.png', ':/appicon-48.png'))

    global scaleRatio
    scaleRatio = app.desktop().logicalDpiX() / 96  # when will x != y happen?
    logging.debug('DPI scale ratio %s' % scaleRatio)

    setTranslationLocale()
    global font
    font = Fonts()
    font.load()

    setStyleSheet()
    return app
Exemplo n.º 5
0
    def about(self):
        """Popup a box with about message.
        Input:
            None
        Output:
            None"""
        QMessageBox.about(
            self,
            "About MClub Mover",
            """This program is designed to help make the process of copying \
files from multiple directories much easier and simpler.\n
This software is provided as is with absolutely no warranties.""",
            WindowModility=True)


if __name__ == '__main__':
    ##TODO: Look into setting caching to remember a users preference from previous execution
    if os_version == 'Windows':  # Uberhack to make windows show my icon in the taskbar
        ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(
            'mclub.mover.%s' % __version__)
    app = QApplication(sys.argv)
    splash_img = QPixmap('splash.png')
    splash = QSplashScreen(
        splash_img
    )  # Need to see how to cleanly destroy the splash once the form is loaded.
    splash.show()
    frame = MainWindow()
    frame.show()
    app.setWindowIcon(QIcon('favicon.png'))
    app.exec_()
Exemplo n.º 6
0
from PySide.QtCore import Qt

from qrmainwindow import QtReduceMainWindow

app = QApplication(sys.argv)

app.setOrganizationName("The Reduce Project")
app.setOrganizationDomain("reduce-algebra.sourceforge.net")
app.setApplicationName("QReduce")

qtTranslator = QTranslator(app)
qtTranslator.load("qt_" + QLocale.system().name(),
                  QLibraryInfo.location(QLibraryInfo.TranslationsPath))
app.installTranslator(qtTranslator)

qreduceTranslator = QTranslator(app)
qreduceTranslator.load(sys.path[0] + "/" + "qreducetr." +
                       str(locale.getdefaultlocale()[0]))
#app.installTranslator(qreduceTranslator)

# app.setStyleSheet("QStatusBar::item { border: 0px solid black }");

app.setWindowIcon(QIcon(sys.path[0] + "/" + "Bumblebee.png"))

if os.uname()[0] == "Darwin":
    app.setAttribute(Qt.AA_DontShowIconsInMenus)

mainwindow = QtReduceMainWindow()

sys.exit(app.exec_())
Exemplo n.º 7
0
        return os.system('dot_clean %s' % path)
    
    def siguienteClicked(self):
        if self.lista.currentItem():
            selected = self.lista.currentItem().text()
            path = os.path.join('/Volumes', selected)
            if self.dot_clean(path) == 0:
                title = 'Proceso exitoso'
                msg = u'Se limpió la memoria con éxito'
            else:
                title = 'Proceso fallido'
                msg = u'Ocurrió un error inesperado. Verifique que la memoria esté montada.'
        else:
            title = 'Proceso fallido'
            msg = u'No se encuentra ninguna memoria, por favor introduzca una y vuelva a iniciar la apliación'
        QMessageBox.information(self, title, msg)
        self.close()

if __name__ == '__main__':
    app = QApplication(sys.argv)
    app.setOrganizationName("ehmSoftware")
    app.setOrganizationDomain("ehmsoft.com")
    app.setApplicationName("Dot Clean")
    app.setWindowIcon(QIcon(":/images/icono.png"))
    ventana = GUIdot_cleanMac()
    ventana.show()
    ventana.raise_()
    sys.exit(app.exec_())


Exemplo n.º 8
0
# --coding:utf-8--
import sys

from PySide.QtGui import QApplication, QIcon
from gui.qtmainframe import MainFrame
from libs import json_reader

APP = QApplication(sys.argv)
APP.setWindowIcon(QIcon(json_reader.buildPath('icon.gif')))
M = MainFrame(APP)
sys.exit(APP.exec_())
Exemplo n.º 9
0
Arquivo: python.py Projeto: wiz21b/koi
    splash.update()
    for xyzi in range(100): # Strange name to avoid defining local variable...
        app.processEvents()


mainlog.debug("Python {}".format(str(sys.version).replace('\n',' ')))
# mainlog.debug("SQLAlchemy {}".format(sqlalchemy.__version__))
# mainlog.debug("PySide {}".format(PySide.__version__))
# mainlog.debug("QtCore {}".format(PySide.QtCore.__version__))
# mainlog.debug("Console encoding : {}".format(sys.getdefaultencoding()))
mainlog.debug("Locale : {}".format(locale.getdefaultlocale()))
mainlog.debug("Config dir : {}".format(get_data_dir()))
mainlog.debug("Resource dir : {}".format(resource_dir))

app = QApplication(sys.argv)
app.setWindowIcon(QIcon(os.path.join(resource_dir,'win_icon.png')))

# Fix issues with combo box that gets cleared too fast
app.setEffectEnabled(Qt.UI_AnimateCombo, False)

if configuration.font_select == False:
    qss = open( os.path.join(resource_dir,"standard.qss"),"r")
else:
    qss = open( os.path.join(resource_dir,"bigfont.qss"),"r")

app.setStyleSheet(qss.read())
qss.close()

# from PySide.QtGui import QPainter, QBrush,QColor,QPen, QStyleOption, QStyle
# from PySide.QtCore import QTimer
Exemplo n.º 10
0
'''
PS2-Stats : Python module for PlanetSide 2 Stat tracking.

Copyright (C) 2013 Brendan Betts ([email protected])

License: GNU LGPL

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

Created on Jun 25, 2013
'''
from src.GUI.ControlMainWindow import ControlMainWindow
from PySide.QtGui import QApplication,QIcon
import sys

if __name__ == '__main__':
    app = QApplication(sys.argv)
    app.setWindowIcon(QIcon("../images/ps2-logo.png"))
    my_app = ControlMainWindow()
    my_app.show()
    sys.exit(app.exec_())
Exemplo n.º 11
0
        dialog.setOption(QFileDialog.ShowDirsOnly)
        dialog.exec_()
        self.lblDestPath.setEnabled(True)
        self.lblDestPath.setText(os.path.abspath(dialog.directory().absolutePath()))
        self.update_table_view()
        self.copyButton.setEnabled(True)

    def about(self):
        """Popup a box with about message.
        Input:
            None
        Output:
            None"""
        QMessageBox.about(self, "About MClub Mover",
                """This program is designed to help make the process of copying \
files from multiple directories much easier and simpler.\n
This software is provided as is with absolutely no warranties.""",
                WindowModility=True)

if __name__ == '__main__':
    ##TODO: Look into setting caching to remember a users preference from previous execution
    if os_version == 'Windows':  # Uberhack to make windows show my icon in the taskbar
        ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('mclub.mover.%s' % __version__)
    app = QApplication(sys.argv)
    splash_img = QPixmap('splash.png')
    splash = QSplashScreen(splash_img)  # Need to see how to cleanly destroy the splash once the form is loaded.
    splash.show()
    frame = MainWindow()
    frame.show()
    app.setWindowIcon(QIcon('favicon.png'))
    app.exec_()
Exemplo n.º 12
0
        elif (state == 1):
            answer = rx
            window.centralWidget().putAnswer(sender, answer)
            tx = "You selected answer: " + answer + ".\nPlease check that this is your desired answer. Feel free to change your answer before time runs out."
    else:
        tx = "Sorry, there is no current active session"
    resp.sms(tx)
    return str(resp)


@app.route('/exit', methods=['POST'])
def exit():
    func = request.environ.get('werkzeug.server.shutdown')
    if func is None:
        raise RuntimeError('Not running with the Werkzeug Server')
    func()
    return "Shutting down..."


flaskThread = threading.Thread(target=runFlask)
flaskThread.start()
qapp = QApplication(sys.argv)
qapp.setWindowIcon(QIcon("./icon.png"))
window = TriviaWindow()

qapp.exec_()

requests.post('http://localhost:5000/exit')
flaskThread.join()
sys.exit()