Example #1
0
    def __init__(self):
        super(AboutWidget, self).__init__()
        self.version = QtCore.QString(
            utils.read_file(os.path.join(root_path(), 'version')))
        self.setModal(True)
        icon = QtGui.QIcon(':/logoGobstones.png')
        self.setWindowIcon(icon)
        self.setWindowTitle(i18n("About"))
        logoHtml = ""
        logoHtml += ("<div align = 'center'>"
                     '<img src=":/logoHelp.png">'
                     "</div>")
        versionHtml = ""
        versionHtml += ('<div align = "center">'
                        "<h3>PyGobstones</h3>"
                        "<p>Versi&oacute;n " + self.version +
                        "</p>".decode('utf8') + "<p>" +
                        i18n("Developed with Python and PyQt") + "</p>"
                        "</div>")
        logo = QtGui.QLabel(logoHtml)
        version = QtGui.QLabel(versionHtml)
        hLayout = QtGui.QHBoxLayout()
        hLayout.addWidget(logo)
        hLayout.addWidget(version)

        tabs = QtGui.QTabWidget(self)
        tabs.tabBar().setStyleSheet(
            "background-color:'white'; color:'#4682b4'; border:2px solid #4682b4; font-size:15px"
        )
        tabs.tabBar().setAttribute(QtCore.Qt.WA_TranslucentBackground)

        about = self.openAndReturnHelpFile(
            os.path.join(root_path(), 'about_files', 'about.html'))
        authors = self.openAndReturnHelpFile(
            os.path.join(root_path(), 'about_files', 'authors.html'))
        history = self.openAndReturnHelpFile(
            os.path.join(root_path(), 'about_files', 'history.html'))

        tabs.addTab(about, _fromUtf8(""))
        tabs.addTab(authors, _fromUtf8(""))
        tabs.addTab(history, _fromUtf8(""))

        tabs.setTabText(0, i18n("About"))
        tabs.setTabText(1, i18n("Authors"))
        tabs.setTabText(2, i18n("History"))

        vLayout = QtGui.QVBoxLayout()
        vLayout.addLayout(hLayout)
        vLayout.addWidget(tabs)
        self.setLayout(vLayout)
Example #2
0
def saveFileName(parent, extensions):
    filename = str(
        QtGui.QFileDialog.getSaveFileName(parent, i18n('Save as ...'),
                                          paths.last_location, extensions))
    if not filename == QtCore.QString(''):
        paths.last_location = os.path.dirname(str(filename))
    return filename
Example #3
0
def saveFileName(parent, extensions):
	filename = unicode(QtGui.QFileDialog.getSaveFileName(parent,
													 i18n('Save as ...'),
                                                     paths.last_location,
													 extensions))
	if not filename == QtCore.QString(''):
		paths.last_location = os.path.dirname(unicode(filename))
	return filename
Example #4
0
    def __init__(self):
        super(CommandHelpWidget, self).__init__()
        self.setModal(True)
        self.setWindowTitle(i18n('User guide editor board'))
        tabs = QtGui.QTabWidget(self)
        tabs.tabBar().setStyleSheet("background-color:'white'; color:'#4682b4'; border:2px solid #4682b4; font-size:15px")
        tabs.tabBar().setAttribute(QtCore.Qt.WA_TranslucentBackground)

        command = self.openAndReturnHelpFile(os.path.join(root_path(), 'about_files','command_editor.html'))

        tabs.addTab(command, _fromUtf8(""))

        tabs.setTabText(0, i18n("commands enables"))

        vLayout = QtGui.QVBoxLayout()
        vLayout.addWidget(tabs)
        self.setLayout(vLayout)
Example #5
0
    def __init__(self):
        super(AboutWidget, self).__init__()
        self.version = QtCore.QString(utils.read_file(os.path.join(root_path(), 'version')))
        self.setModal(True)
        icon = QtGui.QIcon(':/logoGobstones.png')
        self.setWindowIcon(icon)
        self.setWindowTitle(i18n("About"))
        logoHtml = ""
        logoHtml += (       "<div align = 'center'>"
                            '<img src=":/logoHelp.png">'
                            "</div>"
                             )
        versionHtml = ""
        versionHtml += (        '<div align = "center">'
                                "<h3>PyGobstones</h3>"
                                "<p>Versi&oacute;n " + self.version + "</p>".decode('utf8') +
                                "<p>" + i18n("Developed with Python and PyQt") + "</p>"
                                "</div>"
                             )
        logo = QtGui.QLabel(logoHtml)
        version = QtGui.QLabel(versionHtml)
        hLayout = QtGui.QHBoxLayout()
        hLayout.addWidget(logo)
        hLayout.addWidget(version)

        tabs = QtGui.QTabWidget(self)
        tabs.tabBar().setStyleSheet("background-color:'white'; color:'#4682b4'; border:2px solid #4682b4; font-size:15px")
        tabs.tabBar().setAttribute(QtCore.Qt.WA_TranslucentBackground)

        about = self.openAndReturnHelpFile(os.path.join(root_path(), 'about_files','about.html'))
        authors = self.openAndReturnHelpFile(os.path.join(root_path(), 'about_files','authors.html'))
        history = self.openAndReturnHelpFile(os.path.join(root_path(), 'about_files','history.html'))

        tabs.addTab(about, _fromUtf8(""))
        tabs.addTab(authors, _fromUtf8(""))
        tabs.addTab(history, _fromUtf8(""))

        tabs.setTabText(0, i18n("About"))
        tabs.setTabText(1, i18n("Authors"))
        tabs.setTabText(2, i18n("History"))

        vLayout = QtGui.QVBoxLayout()
        vLayout.addLayout(hLayout)
        vLayout.addWidget(tabs)
        self.setLayout(vLayout)
Example #6
0
 def __init__(self):
     super(LicenseWidget, self).__init__()
     self.setModal(True)
     self.browser = QWebView()
     self.browser.load(QtCore.QUrl('http://www.gnu.org/licenses/gpl-3.0.txt'))
     self.setWindowTitle(i18n("License Agreement - Gobstones"))
     layout = QtGui.QHBoxLayout()
     layout.addWidget(self.browser)
     self.setLayout(layout)
Example #7
0
 def __init__(self):
     super(LicenseWidget, self).__init__()
     self.setModal(True)
     self.browser = QWebView()
     self.browser.load(
         QtCore.QUrl('http://www.gnu.org/licenses/gpl-3.0.txt'))
     self.setWindowTitle(i18n("License Agreement - Gobstones"))
     layout = QtGui.QHBoxLayout()
     layout.addWidget(self.browser)
     self.setLayout(layout)
Example #8
0
    def __init__(self):
        super(CommandHelpWidget, self).__init__()
        self.setModal(True)
        self.setWindowTitle(i18n('User guide editor board'))
        tabs = QtGui.QTabWidget(self)
        tabs.tabBar().setStyleSheet(
            "background-color:'white'; color:'#4682b4'; border:2px solid #4682b4; font-size:15px"
        )
        tabs.tabBar().setAttribute(QtCore.Qt.WA_TranslucentBackground)

        command = self.openAndReturnHelpFile(
            os.path.join(root_path(), 'about_files', 'command_editor.html'))

        tabs.addTab(command, _fromUtf8(""))

        tabs.setTabText(0, i18n("commands enables"))

        vLayout = QtGui.QVBoxLayout()
        vLayout.addWidget(tabs)
        self.setLayout(vLayout)
Example #9
0
def openFileName(parent, extensions):
	filename = str(QtGui.QFileDialog.getOpenFileName(parent, i18n('Open File'),
                                                 	 paths.last_location, extensions))
	if not filename == QtCore.QString(''):
		paths.last_location = os.path.dirname(str(filename))
	return filename
Example #10
0
 def retranslateUi(self, editor):
     editor.setWindowTitle(_translate("editor", i18n("Board Editor"), None))
Example #11
0
 def retranslateUi(self, editor):
     editor.setWindowTitle(_translate("editor", i18n("Board Editor"), None))