Esempio n. 1
0
def start():
    #Init Qt Application
    app = QApplication(sys.argv)

    #Set application organization, name and version
    QCoreApplication.setOrganizationName('lol-server-status')
    QCoreApplication.setApplicationName(__prj__)
    QCoreApplication.setApplicationVersion(__version__)

    #Set icon for application
    app.setWindowIcon(QIcon(IMAGES['icon_256']))

    #Codec for QString
    QTextCodec.setCodecForCStrings(QTextCodec.codecForName('utf-8'))

    #Add StyleSheet
    with open(STYLES, 'r') as f:
        style = f.read()
        app.setStyleSheet(style)
        f.close()

    #Run user interface
    window = mainWindow()
    window.show()

    sys.exit(app.exec_())
Esempio n. 2
0
def main(args):
    QCoreApplication.setApplicationName("2D Scan Post Processor")
    QCoreApplication.setApplicationVersion("0.2")
    QCoreApplication.setOrganizationName("Phoseon Technology")
    QCoreApplication.setOrganizationDomain("phoseon.com")

    app = QApplication([])
    form = MainDialog()
    # form.show()
    # app.exec_()
    sys.exit(app.exec_())
Esempio n. 3
0
def start():
    app = QApplication(sys.argv)

    QCoreApplication.setApplicationName(__prj__)
    QCoreApplication.setApplicationVersion(__version__)
    #Set Application icon
    app.setWindowIcon(QIcon(IMAGES['minebackup_icon']))
    #Codec for QString
    QTextCodec.setCodecForCStrings(QTextCodec.codecForName('utf-8'))

    #Create configuration
    configuration.config()

    minebackup = main_window()
    minebackup.show()

    sys.exit(app.exec_())
Esempio n. 4
0
	def __init__(self,  parent=None):
		"""
		Konstruktor 
		"""

		self.translator_app = QTranslator()
		self.translator_qt = QTranslator()

		QApplication.installTranslator( self.translator_app )
		QApplication.installTranslator( self.translator_qt )

		QWidget.__init__(self,  parent)

		QCoreApplication.setOrganizationName("Caern")
		QCoreApplication.setOrganizationDomain("www.caern.de")
		QCoreApplication.setApplicationName("DiceRoller WoD")
		QCoreApplication.setApplicationVersion(QString.number(PROGRAM_VERSION_MAJOR) +
			"." +
			QString.number(PROGRAM_VERSION_MINOR) +
			"." +
			QString.number(PROGRAM_VERSION_CHANGE)
		)
		QApplication.setWindowIcon(QIcon(":/icons/logo/WoD.png"))

		self.ui = Ui_MainWindow()
		self.ui.setupUi(self)
		
		self.createInfo()

		#self.createLanguageMenu()
		self.instantRoll = InstantRoll()
		self.extendedRoll = ExtendedRoll()

		# Dieser Zähler bestimmt, wie der rollende Würfel angezeigt wird.
		self.timerDice = QTimer()
		# Verzögert die tatsächliche Ausführung des Würfelwurfs.
		self.timerRoll = QTimer()
		
		self.populateUi()
		self.createConnections()
		self.initializing()

		self.setWindowTitle(QCoreApplication.applicationName())
Esempio n. 5
0
def init():
    """
    Initialize the QCoreApplication.organizationDomain, applicationName,
    applicationVersion and the default settings format. Will only run once.

    .. note:: This should not be run before QApplication has been initialized.
              Otherwise it can break Qt's plugin search paths.

    """
    dist = pkg_resources.get_distribution("Orange3")
    version = dist.version
    # Use only major.minor
    version = ".".join(version.split(".", 2)[:2])

    QCoreApplication.setOrganizationDomain("biolab.si")
    QCoreApplication.setApplicationName("Orange Canvas")
    QCoreApplication.setApplicationVersion(version)
    QSettings.setDefaultFormat(QSettings.IniFormat)

    # Make it a null op.
    global init
    init = lambda: None
def run():
    #Change process name only GNU/Linux
    change_pro_name()

    #Set global var
    global app
    app = QApplication(sys.argv)

    #Set application parameters
    QCoreApplication.setOrganizationName(__prj__)
    QCoreApplication.setApplicationName(__prj__)
    QCoreApplication.setApplicationVersion(__version__)

    #Add style sheet
    with open(style_file, 'r') as f:
        style = f.read()
        app.setStyleSheet(style)

    app.setWindowIcon(QIcon(main_icon))

    window = divergenceMeterWindow()
    window.show()

    sys.exit(app.exec_())
Esempio n. 7
0
        self.verticalLayout.addWidget(self.nameLabel)
        self.versionLabel = QLabel(self)
        self.versionLabel.setText(tr("Version {}").format(QCoreApplication.instance().applicationVersion()))
        self.verticalLayout.addWidget(self.versionLabel)
        self.label_3 = QLabel(self)
        self.verticalLayout.addWidget(self.label_3)
        self.label_3.setText(tr("Copyright Hardcoded Software 2014"))
        self.label = QLabel(self)
        font = QFont()
        font.setWeight(75)
        font.setBold(True)
        self.label.setFont(font)
        self.verticalLayout.addWidget(self.label)
        self.buttonBox = QDialogButtonBox(self)
        self.buttonBox.setOrientation(Qt.Horizontal)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Ok)
        self.verticalLayout.addWidget(self.buttonBox)
        self.horizontalLayout.addLayout(self.verticalLayout)
    

if __name__ == '__main__':
    import sys
    app = QApplication([])
    QCoreApplication.setOrganizationName('Hardcoded Software')
    QCoreApplication.setApplicationName('FooApp')
    QCoreApplication.setApplicationVersion('1.2.3')
    app.LOGO_NAME = ''
    dialog = AboutBox(None, app)
    dialog.show()
    sys.exit(app.exec_())
Esempio n. 8
0
def main(argv):

    path = None
    first_arg = None
    second_arg = None
    config = None
    apath = None
    print("QT VERSION %s" % QT_VERSION_STR )

    try:
        first_arg = argv[1]
        second_arg = argv[2]
    except IndexError:
        pass

    if first_arg is not None:
        if first_arg == "-c":
            config = True 
            if second_arg is not None:
                path = second_arg
        else:
            path = first_arg
        
    try:
        #app = QApplication(argv)
        app = MyApp(argv)

        QCoreApplication.setOrganizationDomain('www.trickplay.com');
        QCoreApplication.setOrganizationName('Trickplay');
        QCoreApplication.setApplicationName('Trickplay Debugger');
        QCoreApplication.setApplicationVersion('0.0.1');
            
        s = QProcessEnvironment.systemEnvironment().toStringList()
        for item in s:
            k , v = str( item ).split( "=" , 1 )
            if k == 'PWD':
                apath = v

        apath = os.path.join(apath, os.path.dirname(str(argv[0])))
        main = MainWindow(app, apath)
        main.config = config

        main.show()
        main.raise_()
        wizard = Wizard()
        app.main = main

        path = wizard.start(path)
        if path:
            settings = QSettings()
            settings.setValue('path', path)

            app.setActiveWindow(main)
            main.start(path, wizard.filesToOpen())
            main.show()

        sys.exit(app.exec_())

    # TODO, better way of doing this for 'clean' exit...
    except KeyboardInterrupt:
		exit("Exited")
Esempio n. 9
0
        self.versionLabel.setText(
            tr("Version {}").format(
                QCoreApplication.instance().applicationVersion()))
        self.verticalLayout.addWidget(self.versionLabel)
        self.label_3 = QLabel(self)
        self.verticalLayout.addWidget(self.label_3)
        self.label_3.setText(tr("Copyright Hardcoded Software 2014"))
        self.label = QLabel(self)
        font = QFont()
        font.setWeight(75)
        font.setBold(True)
        self.label.setFont(font)
        self.verticalLayout.addWidget(self.label)
        self.buttonBox = QDialogButtonBox(self)
        self.buttonBox.setOrientation(Qt.Horizontal)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Ok)
        self.verticalLayout.addWidget(self.buttonBox)
        self.horizontalLayout.addLayout(self.verticalLayout)


if __name__ == '__main__':
    import sys
    app = QApplication([])
    QCoreApplication.setOrganizationName('Hardcoded Software')
    QCoreApplication.setApplicationName('FooApp')
    QCoreApplication.setApplicationVersion('1.2.3')
    app.LOGO_NAME = ''
    dialog = AboutBox(None, app)
    dialog.show()
    sys.exit(app.exec_())
Esempio n. 10
0
from PyQt4.QtGui import QApplication, QIcon, QPixmap

import mg_rc

from hscommon.trans import install_qt_trans
from app import MusicGuru

if sys.platform == 'win32':
    # cx_Freeze workarounds
    import hsfs.tree
    import os
    os.environ['QT_PLUGIN_PATH'] = 'qt4_plugins'

if __name__ == "__main__":
    app = QApplication(sys.argv)
    app.setWindowIcon(QIcon(QPixmap(":/mg_logo")))
    QCoreApplication.setOrganizationName('Hardcoded Software')
    QCoreApplication.setApplicationName('musicGuru')
    QCoreApplication.setApplicationVersion(MusicGuru.VERSION)
    install_qt_trans('en')
    mgapp = MusicGuru()
    exec_result = app.exec_()
    del mgapp
    # Since PyQt 4.7.2, I had crashes on exit, and from reading the mailing list, it seems to be
    # caused by some weird crap about C++ instance being deleted with python instance still living.
    # The worst part is that Phil seems to say this is expected behavior. So, whatever, this
    # gc.collect() below is required to avoid a crash.
    gc.collect()
    del app
    sys.exit(exec_result)
Esempio n. 11
0
    print("Run '%s -h' for help" % (cmd))

def printHelp(cmd):
    print("Usage: %s [cmd]" % (cmd))
    printArguments()

def printVersion():
    print("Cadence version %s" % (VERSION))
    print("Developed by falkTX and the rest of the KXStudio Team")

#--------------- main ------------------
if __name__ == '__main__':
    # App initialization
    app = QCoreApplication(sys.argv)
    app.setApplicationName("Cadence")
    app.setApplicationVersion(VERSION)
    app.setOrganizationName("Cadence")

    # Check arguments
    cmd = sys.argv[0]

    if len(app.arguments()) == 1:
        printHelp(cmd)
    elif len(app.arguments()) == 2:
        arg = app.arguments()[1]
        if arg == "--printLADSPA_PATH":
            printLADSPA_PATH()
        elif arg == "--printDSSI_PATH":
            printDSSI_PATH()
        elif arg == "--printLV2_PATH":
            printLV2_PATH()
Esempio n. 12
0
    def __init__(self, fileName=None, exportPath=None, parent=None):
        debug_timing_start = Debug.timehook()

        super(MainWindow, self).__init__(parent)

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        QCoreApplication.setOrganizationName(Config.ORGANIZATION)
        QCoreApplication.setApplicationName(Config.PROGRAM_NAME)
        QCoreApplication.setApplicationVersion(Config.version())

        #Debug.debug(QApplication.style())

        self.setWindowTitle("")
        self.setWindowIcon(QIcon(":/icons/images/WoD.png"))

        self.__storage = StorageTemplate(self)
        self.storeTemplateData()
        self.__character = StorageCharacter(self.__storage)
        ## Später sollte ich mich für einen entscheiden!!
        self.__readCharacter = ReadXmlCharacter(self.__character)
        self.__writeCharacter = WriteXmlCharacter(self.__character)

        self.ui.pushButton_next.clicked.connect(
            self.ui.selectWidget_select.selectNext)
        self.ui.pushButton_previous.clicked.connect(
            self.ui.selectWidget_select.selectPrevious)
        self.ui.selectWidget_select.currentRowChanged.connect(
            self.ui.stackedWidget_traits.setCurrentIndex)
        self.ui.selectWidget_select.currentRowChanged.connect(
            self.setTabButtonState)
        #self.ui.selectWidget_select.currentRowChanged.connect(self.pageChanged.emit)
        self.__character.speciesChanged.connect(
            self.ui.selectWidget_select.changeIcons)

        self.__readCharacter.exception_raised.connect(
            self.showExceptionMessage)

        # Laden der Konfiguration
        self.readSettings()

        self.populateUi()

        Debug.timesince(debug_timing_start,
                        "Time neccessary to populate the UI.")

        debug_timing_between_start = Debug.timehook()

        self.activate()

        Debug.timesince(debug_timing_between_start,
                        "Time neccessary to activate the UI.")

        debug_timing_between_start = Debug.timehook()

        self.ui.selectWidget_select.currentRowChanged.connect(
            self.showCreationPoints)

        self.ui.actionSettings.triggered.connect(self.showSettingsDialog)
        self.ui.actionNew.triggered.connect(self.newCharacter)
        self.ui.actionOpen.triggered.connect(self.openCharacter)
        self.ui.actionSave.triggered.connect(self.saveCharacter)
        self.ui.actionExport.triggered.connect(self.exportCharacter)
        self.ui.actionPrint.triggered.connect(self.printCharacter)
        self.ui.actionAbout.triggered.connect(self.aboutApp)

        self.reset()
        Debug.timesince(debug_timing_between_start,
                        "Time neccessary to set all initial values.")

        debug_timing_between_start = Debug.timehook()

        ## Wird ein Dateiname angegeben, soll dieser sofort geladen werden.
        if fileName:
            if os.path.exists(fileName):
                if GlobalState.is_verbose:
                    print("Opening file {}.".format(fileName))
                self.openCharacter(fileName)
            elif fileName.lower() in [
                    species.lower()
                    for species in self.__storage.species.keys()
            ]:
                if GlobalState.is_verbose:
                    print(
                        "Empty Charactersheet of species {} will be created.".
                        format(fileName.lower()))
                self.__character.species = fileName[0].upper(
                ) + fileName[1:].lower()
                self.__character.setModified(False)
            else:
                Shell.print_warning(
                    "A file named \"{}\" does not exist.".format(fileName))

            Debug.timesince(debug_timing_between_start,
                            "Time neccessary to load a file at startup.")

        if exportPath:
            if GlobalState.is_verbose:
                print("Creating PDF {}".format(exportPath[0]))
            # exportPath ist eine Liste mit einem einzigen Element als Inhalt (argparse)
            self.__createPdf(exportPath[0])
            # Damit das Programm ordentlich geschlossen werden kann, muß auf das Starten der Event-Loop gewartet werden. dies geht am einfachsten mit einem QTimer.
            QTimer.singleShot(0, self.close)

        Debug.timesince(
            debug_timing_start,
            "The full time span neccessary to prepare the application for user input."
        )
Esempio n. 13
0
	def __init__(self, fileName=None, exportPath=None, parent=None):
		debug_timing_start = Debug.timehook()

		super(MainWindow, self).__init__(parent)

		self.ui = Ui_MainWindow()
		self.ui.setupUi(self)

		QCoreApplication.setOrganizationName( Config.ORGANIZATION )
		QCoreApplication.setApplicationName( Config.PROGRAM_NAME )
		QCoreApplication.setApplicationVersion( Config.version() )

		#Debug.debug(QApplication.style())

		self.setWindowTitle( "" )
		self.setWindowIcon( QIcon( ":/icons/images/WoD.png" ) )

		self.__storage = StorageTemplate( self )
		self.storeTemplateData()
		self.__character = StorageCharacter(self.__storage)
		## Später sollte ich mich für einen entscheiden!!
		self.__readCharacter = ReadXmlCharacter(self.__character)
		self.__writeCharacter = WriteXmlCharacter(self.__character)

		self.ui.pushButton_next.clicked.connect(self.ui.selectWidget_select.selectNext)
		self.ui.pushButton_previous.clicked.connect(self.ui.selectWidget_select.selectPrevious)
		self.ui.selectWidget_select.currentRowChanged.connect(self.ui.stackedWidget_traits.setCurrentIndex)
		self.ui.selectWidget_select.currentRowChanged.connect(self.setTabButtonState)
		#self.ui.selectWidget_select.currentRowChanged.connect(self.pageChanged.emit)
		self.__character.speciesChanged.connect(self.ui.selectWidget_select.changeIcons)

		self.__readCharacter.exception_raised.connect(self.showExceptionMessage)

		# Laden der Konfiguration
		self.readSettings()

		self.populateUi()

		Debug.timesince( debug_timing_start, "Time neccessary to populate the UI." )

		debug_timing_between_start = Debug.timehook()

		self.activate()

		Debug.timesince( debug_timing_between_start, "Time neccessary to activate the UI." )

		debug_timing_between_start = Debug.timehook()

		self.ui.selectWidget_select.currentRowChanged.connect(self.showCreationPoints)

		self.ui.actionSettings.triggered.connect(self.showSettingsDialog)
		self.ui.actionNew.triggered.connect(self.newCharacter)
		self.ui.actionOpen.triggered.connect(self.openCharacter)
		self.ui.actionSave.triggered.connect(self.saveCharacter)
		self.ui.actionExport.triggered.connect(self.exportCharacter)
		self.ui.actionPrint.triggered.connect(self.printCharacter)
		self.ui.actionAbout.triggered.connect(self.aboutApp)

		self.reset()
		Debug.timesince( debug_timing_between_start, "Time neccessary to set all initial values." )

		debug_timing_between_start = Debug.timehook()

		## Wird ein Dateiname angegeben, soll dieser sofort geladen werden.
		if fileName:
			if os.path.exists(fileName):
				if GlobalState.is_verbose:
					print("Opening file {}.".format(fileName))
				self.openCharacter(fileName)
			elif fileName.lower() in [ species.lower() for species in self.__storage.species.keys() ]:
				if GlobalState.is_verbose:
					print("Empty Charactersheet of species {} will be created.".format(fileName.lower()))
				self.__character.species = fileName[0].upper() + fileName[1:].lower()
				self.__character.setModified(False)
			else:
				Shell.print_warning("A file named \"{}\" does not exist.".format(fileName))

			Debug.timesince( debug_timing_between_start, "Time neccessary to load a file at startup." )

		if exportPath:
			if GlobalState.is_verbose:
				print("Creating PDF {}".format(exportPath[0]))
			# exportPath ist eine Liste mit einem einzigen Element als Inhalt (argparse)
			self.__createPdf(exportPath[0])
			# Damit das Programm ordentlich geschlossen werden kann, muß auf das Starten der Event-Loop gewartet werden. dies geht am einfachsten mit einem QTimer.
			QTimer.singleShot(0, self.close)

		Debug.timesince( debug_timing_start, "The full time span neccessary to prepare the application for user input." )
Esempio n. 14
0
def main(argv):

    path = None
    first_arg = None
    second_arg = None
    config = None
    apath = None
    print("QT VERSION %s" % QT_VERSION_STR)

    try:
        first_arg = argv[1]
        second_arg = argv[2]
    except IndexError:
        pass

    if first_arg is not None:
        if first_arg == "-c":
            config = True
            if second_arg is not None:
                path = second_arg
        else:
            path = first_arg

    try:
        #app = QApplication(argv)
        app = MyApp(argv)

        QCoreApplication.setOrganizationDomain('www.trickplay.com')
        QCoreApplication.setOrganizationName('Trickplay')
        QCoreApplication.setApplicationName('Trickplay Debugger')
        QCoreApplication.setApplicationVersion('0.0.1')

        s = QProcessEnvironment.systemEnvironment().toStringList()
        for item in s:
            k, v = str(item).split("=", 1)
            if k == 'PWD':
                apath = v

        apath = os.path.join(apath, os.path.dirname(str(argv[0])))
        main = MainWindow(app, apath)
        main.config = config

        main.show()
        main.raise_()
        wizard = Wizard()
        app.main = main

        path = wizard.start(path)
        if path:
            settings = QSettings()
            settings.setValue('path', path)

            app.setActiveWindow(main)
            main.start(path, wizard.filesToOpen())
            main.show()

        sys.exit(app.exec_())

    # TODO, better way of doing this for 'clean' exit...
    except KeyboardInterrupt:
        exit("Exited")
Esempio n. 15
0
def printHelp(cmd):
    print("Usage: %s [cmd]" % (cmd))
    printArguments()


def printVersion():
    print("Cadence version %s" % (VERSION))
    print("Developed by falkTX and the rest of the KXStudio Team")


#--------------- main ------------------
if __name__ == '__main__':
    # App initialization
    app = QCoreApplication(sys.argv)
    app.setApplicationName("Cadence")
    app.setApplicationVersion(VERSION)
    app.setOrganizationName("Cadence")

    # Check arguments
    cmd = sys.argv[0]

    if len(app.arguments()) == 1:
        printHelp(cmd)
    elif len(app.arguments()) == 2:
        arg = app.arguments()[1]
        if arg == "--printLADSPA_PATH":
            printLADSPA_PATH()
        elif arg == "--printDSSI_PATH":
            printDSSI_PATH()
        elif arg == "--printLV2_PATH":
            printLV2_PATH()
Esempio n. 16
0
from hscommon.plat import ISWINDOWS
from hscommon.trans import install_gettext_trans_under_qt
from qtlib.error_report_dialog import install_excepthook
from qtlib.util import setupQtLogging
from qt.base import dg_rc
from qt.base.platform import BASE_PATH
from core_{edition} import __version__, __appname__

if ISWINDOWS:
    import qt.base.cxfreeze_fix

if __name__ == "__main__":
    app = QApplication(sys.argv)
    QCoreApplication.setOrganizationName('Hardcoded Software')
    QCoreApplication.setApplicationName(__appname__)
    QCoreApplication.setApplicationVersion(__version__)
    setupQtLogging()
    settings = QSettings()
    lang = settings.value('Language')
    locale_folder = op.join(BASE_PATH, 'locale')
    install_gettext_trans_under_qt(locale_folder, lang)
    # Many strings are translated at import time, so this is why we only import after the translator
    # has been installed
    from qt.{edition}.app import DupeGuru
    app.setWindowIcon(QIcon(QPixmap(":/{0}".format(DupeGuru.LOGO_NAME))))
    dgapp = DupeGuru()
    if not ISWINDOWS:
        dgapp.model.registered = True
    install_excepthook()
    sys.exit(app.exec_())