Esempio n. 1
0
 def __init__(self, parent = None):
     """
     Constructor
     """
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.Appinfo.setText(self.Appinfo.text().replace("Info",QCoreApplication.applicationName()+" "+QCoreApplication.applicationVersion()))
     try:
         READMEfile = codecs.open("README.txt","rb", "utf-8")
         README = READMEfile.read()
         READMEfile.close()
     except Exception, e:
         README = unicode(e)
Esempio n. 2
0
 def __init__(self, parent, error):
     flags = Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint
     QDialog.__init__(self, parent, flags)
     self._setupUi()
     name = QCoreApplication.applicationName()
     version = QCoreApplication.applicationVersion()
     errorText = "Application Name: {0}\nVersion: {1}\n\n{2}".format(name, version, error)
     # Under windows, we end up with an error report without linesep if we don't mangle it
     errorText = errorText.replace('\n', os.linesep)
     self.errorTextEdit.setPlainText(errorText)
     
     self.sendButton.clicked.connect(self.accept)
     self.dontSendButton.clicked.connect(self.reject)
Esempio n. 3
0
def log_dir():
    """
    Return the application log directory.
    """
    init()
    if sys.platform == "darwin":
        name = str(QCoreApplication.applicationName())
        logdir = os.path.join(os.path.expanduser("~/Library/Logs"), name)
    else:
        logdir = data_dir()

    if not os.path.exists(logdir):
        os.makedirs(logdir)
    return logdir
Esempio n. 4
0
    def __init__(self, parent, error):
        flags = Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint
        QDialog.__init__(self, parent, flags)
        self._setupUi()
        name = QCoreApplication.applicationName()
        version = QCoreApplication.applicationVersion()
        errorText = "Application Name: {0}\nVersion: {1}\n\n{2}".format(
            name, version, error)
        # Under windows, we end up with an error report without linesep if we don't mangle it
        errorText = errorText.replace('\n', os.linesep)
        self.errorTextEdit.setPlainText(errorText)

        self.sendButton.clicked.connect(self.accept)
        self.dontSendButton.clicked.connect(self.reject)
Esempio n. 5
0
	def aboutApp(self):
		"""
		Zeigt die Info-Nachricht an.
		"""

		self.appText = self.tr("""
			<h1>%1</h1>
			<h2>Version: %2</h2>
			<p>Copyright (C) 2011 by Victor von Rhein<br>
			EMail: [email protected]</p>
		""").arg(QCoreApplication.applicationName()).arg(QCoreApplication.applicationVersion())
		self.gnuText = self.tr("""
			<h2>GNU General Public License</h2>
			<p>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 3 of the License,  or (at your option) any later version.</p>
			<p>This program is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.</p>
			<p>You should have received a copy of the GNU General Public License along with this program.  If not,  see <a>http://www.gnu.org/licenses/</a>.</p>
		""")
		self.wodText = self.tr("""
			<h2>%1</h2>
			<p>%1,  %2,  the %3 and all referring terms and symbols are copyrighted by %4</p>
		""").arg("World of Darkness").arg("White Wolf").arg("White Wolf-Logo").arg("White Wolf Inc.")
		self.aboutText = self.appText + self.gnuText + self.wodText
		QMessageBox.about(self,  "About " + QCoreApplication.applicationName(),  self.aboutText )
Esempio n. 6
0
    def __init__(self, parent = None):
        """
        Constructor
        """
        QMainWindow.__init__(self, parent) #Use QMainWindow.__init___
        self.setupUi(self) #setup the ui...
        #IMPORTANT: the line "QtCore.QMetaObject.connectSlotsByName(MainWindow)" in UI_MainWindow.py MUST be commented.
        self.settings = QSettings(QSettings.IniFormat, QSettings.UserScope, QCoreApplication.organizationName(), QCoreApplication.applicationName()) #Instantiate QSettings, using ini format always
        self.Fuze = fuze.Fuze(self) #Instantiate the Fuze class.
        self.resis = p2fuze.TransFuze(self) #AnotherTestPlugin her useful class.
        if os.name != 'nt': #If you are lucky and don't run that OS...
            self.mediaroot = "/media" #this is a very probable directory to start from to look for the fuze.
        else:
            self.mediaroot = os.path.join(os.path.expanduser("~"), "Desktop") #Otherwise, here we have the classical desktop...
        self.playlistname = self.mediaroot #Apply that for playlists too
        try:
            self.tableWidget.horizontalHeader().setResizeMode(3) #Try to fix size of tableWidgets
            self.tableWidget_2.horizontalHeader().setResizeMode(3)
        except:
            print "Your version of PyQt4 seems a bit out of date. This may lead to problems. But may not :)" #Most probable. The fact is that it doesn't work in PySide and older PyQt4.
        self.output = toPython(self.settings.value("outputdir",QVariant(os.path.expanduser("~"))).toString()) #Where to output things.
        self.setWindowTitle(QCoreApplication.applicationName()+" "+QCoreApplication.applicationVersion())

        ##### These should be commented in case QtCore.QMetaObject.connectSlotsByName(MainWindow) in UI_MainWindow.py isn't commented.
        self.connect(self.actionAbout_Qt, SIGNAL("triggered()"),self.on_actionAbout_Qt_triggered)
        self.connect(self.RemoveButton, SIGNAL("clicked()"),self.on_RemoveButton_clicked)
        self.connect(self.RemoveButton_2, SIGNAL("clicked()"),self.on_RemoveButton_2_clicked)
        self.connect(self.RemoveButton_3, SIGNAL("clicked()"),self.on_RemoveButton_3_clicked)
        self.connect(self.ConvertButton, SIGNAL("clicked()"),self.on_ConvertButton_clicked)
        self.connect(self.ConvertButton_2, SIGNAL("clicked()"),self.on_ConvertButton_2_clicked)
        self.connect(self.actionPreferences, SIGNAL("triggered()"),self.on_actionPreferences_triggered)
        self.connect(self.actionAbout_video4fuze, SIGNAL("triggered()"),self.on_actionAbout_video4fuze_triggered)
        self.connect(self.AddButton, SIGNAL("clicked()"),self.on_AddButton_clicked)
        self.connect(self.AddDirButton, SIGNAL("clicked()"),self.on_AddDirButton_clicked)
        self.connect(self.AddButton_2, SIGNAL("clicked()"),self.on_AddButton_2_clicked)
        self.connect(self.SavePlaylist, SIGNAL("clicked()"),self.on_SavePlaylist_clicked)
        self.connect(self.SongsFromSD, SIGNAL("clicked()"),self.on_SongsFromSD_clicked)
        self.connect(self.SongsFromFuze, SIGNAL("clicked()"),self.on_SongsFromFuze_clicked)
        self.connect(self.OpenPlaylist, SIGNAL("clicked()"),self.on_OpenPlaylist_clicked)
        #####
        self.connect(self.ToggleSort, SIGNAL("clicked()"),self.playlistWidget.sortItems)
        self.connect(self.SelectOutputButton, SIGNAL("clicked()"),self.SelectOutput)
        self.connect(self.SelectOutputButton_2, SIGNAL("clicked()"),self.SelectOutput)
Esempio n. 7
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. 8
0
 def __init__(self, parent = None):
     """
     Constructor
     """
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.Settings = QSettings(QSettings.IniFormat, QSettings.UserScope, QCoreApplication.organizationName(), QCoreApplication.applicationName())
     self.loadSettings(self.Pass2Check.isChecked())
     self.connect(self.DefaultsButton, SIGNAL("clicked()"),self.on_DefaultsButton_clicked)
     self.connect(self.okButton, SIGNAL("clicked()"),self.on_okButton_clicked)
     self.connect(self.Pass2Check, SIGNAL("toggled(bool)"), self.loadSettings)
     self.Pass2Check.setChecked(self.Settings.value("2pass",QVariant("False")).toBool())