Esempio n. 1
0
 def initialStatus(self, partialBoard):
     if (self.load_views is None) or (self.load_views != root_path()):
         self.reset_clothing()
         self.loadViewAlternatives()
         self.load_views = root_path()
     self.boardV = BoardViewer(self, parseABoardString(partialBoard), self.mainW.getClothing())
     self.boardV.setParent(self.ui.boardViewer)
     self.ui.boardViewer.removeTab(0)
     self.ui.boardViewer.insertTab(0, self.boardV, i18n('Board'))
     self.setPressAKeyState()
     self.init_switcher()
Esempio n. 2
0
 def initialStatus(self, partialBoard):
     if (self.load_views is None) or (self.load_views != root_path()):
         self.reset_clothing()
         self.loadViewAlternatives()
         self.load_views = root_path()
     self.boardV = BoardViewer(self, parseABoardString(partialBoard),
                               self.mainW.getClothing())
     self.boardV.setParent(self.ui.boardViewer)
     self.ui.boardViewer.removeTab(0)
     self.ui.boardViewer.insertTab(0, self.boardV, i18n('Board'))
     self.setPressAKeyState()
     self.init_switcher()
Esempio n. 3
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)
Esempio n. 4
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)
Esempio n. 5
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)
Esempio n. 6
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)
Esempio n. 7
0
 def __init__(self):
     super(MainWindow, self).__init__()
     self.logger = logging.getLogger()
     self.ui = Ui_MainWindow()
     self.ui.setupUi(self)
     self.initOptions()
     self.initMenuBarActions()
     self.initSignalsAndSlots()
     self.ui.actionStop.setEnabled(False)
     self.clothing = 'Gobstones.xml'
     self.lang = GOBSTONES
     self.initWindowTitle()
     self.initPreferencesDictionary()
     self.initLoggerSize()
     self.initialBoardGenerator = InitialBoardGenerator()
     self.guiInterpreterHandler = GUIInterpreterHandler(self)
     self.programRun = ProgramRun(self.getLang(),
                                 self.guiInterpreterHandler)
     self.rootDirectory = root_path()
     self.runButton = RunButton(self, self.ui.actionRun,
          self.ui.actionStop)
     self.setStyleSheet( "QMainWindow{background-image:url(':/backgroundWidget.png')}")
Esempio n. 8
0
 def __init__(self):
     super(MainWindow, self).__init__()
     self.logger = logging.getLogger()
     self.ui = Ui_MainWindow()
     self.ui.setupUi(self)
     self.initOptions()
     self.initMenuBarActions()
     self.initSignalsAndSlots()
     self.ui.actionStop.setEnabled(False)
     self.clothing = 'Gobstones.xml'
     self.lang = GOBSTONES
     self.initWindowTitle()
     self.initPreferencesDictionary()
     self.initLoggerSize()
     self.initialBoardGenerator = InitialBoardGenerator()
     self.guiInterpreterHandler = GUIInterpreterHandler(self)
     self.programRun = ProgramRun(self.getLang(),
                                  self.guiInterpreterHandler)
     self.rootDirectory = root_path()
     self.runButton = RunButton(self, self.ui.actionRun, self.ui.actionStop)
     self.setStyleSheet(
         "QMainWindow{background-image:url(':/backgroundWidget.png')}")