Exemplo n.º 1
0
 def scoreRow(self):
     row = QtWidgets.QHBoxLayout()
     for w in self.scoreEdits.itervalues():
         row.addWidget(w)
     row.addStretch()
     row.setContentsMargins(0, 0, 0, 0)
     return skwidgets.SkLayoutWidget(row)
Exemplo n.º 2
0
 def _createUi(self, q):
     layout = QtWidgets.QVBoxLayout()
     layout.addWidget(self.infoGroup)
     layout.addWidget(self.locationGroup)
     layout.addWidget(self.textGroup)
     layout.addWidget(self.hookGroup)
     layout.addWidget(self.embedGroup)
     if not features.WINE:
         layout.addWidget(self.loaderGroup)
     layout.addWidget(self.timeZoneGroup)
     q.setCentralWidget(skwidgets.SkLayoutWidget(layout))
Exemplo n.º 3
0
  def _createUi(self, q):
    hookPrefsButton = QtWidgets.QPushButton(my.tr("Edit /H Hook Code"))
    skqss.class_(hookPrefsButton, 'btn btn-info')
    hookPrefsButton.setToolTip(my.tr("Modify the game-specific ITH hook code") + " (Alt+H)")
    hookPrefsButton.setStatusTip(hookPrefsButton.toolTip())
    hookPrefsButton.clicked.connect(self._showHookPrefs)

    helpButton = QtWidgets.QPushButton(tr_("Help"))
    helpButton.setToolTip(tr_("Help"))
    skqss.class_(helpButton, 'btn btn-success')
    helpButton.clicked.connect(lambda: self.helpDialog.show())

    wikiButton = QtWidgets.QPushButton(tr_("Wiki"))
    wikiButton.setToolTip(tr_("Wiki"))
    skqss.class_(wikiButton, 'btn btn-default')
    import main
    wikiButton.clicked.connect(lambda: main.manager().openWiki('VNR/Text Settings'))

    #cancelButton = QtWidgets.QPushButton(tr_("Cancel"))
    #cancelButton.clicked.connect(self.q.hide)

    threadArea = QtWidgets.QScrollArea()
    threadArea.setWidget(skwidgets.SkLayoutWidget(self.threadLayout))
    threadArea.setWidgetResizable(True)

    threadGroup = QtWidgets.QGroupBox()
    threadGroup.setTitle(mytr_("Text threads"))
    threadGroup.setLayout(skwidgets.SkWidgetLayout(threadArea))
    #threadGroup.setLayout(self.threadLayout)

    option = QtWidgets.QGroupBox(tr_("Options"))
    optionLayout = QtWidgets.QVBoxLayout()
    row = QtWidgets.QHBoxLayout()
    row.addWidget(QtWidgets.QLabel(mytr_("Game language")+ ":"))
    row.addWidget(self.languageEdit)
    row.addStretch()
    row.addWidget(QtWidgets.QLabel(tr_("Text encoding") + ":"))
    row.addWidget(self.encodingEdit)
    optionLayout.addLayout(row)
    optionLayout.addWidget(self.keepsThreadsButton)
    optionLayout.addWidget(self.removesRepeatButton)
    optionLayout.addWidget(self.ignoresRepeatButton)
    optionLayout.addWidget(self.keepsSpaceButton)
    option.setLayout(optionLayout)

    layout = QtWidgets.QVBoxLayout()
    row = QtWidgets.QHBoxLayout()
    row.addWidget(self.saveButton)
    row.addWidget(hookPrefsButton)
    row.addWidget(self.resetButton)
    row.addWidget(wikiButton)
    row.addWidget(helpButton)
    #row.addWidget(QtWidgets.QLabel(
    #  " <= " + my.tr("click help if you have questions")
    #))
    row.addStretch()
    layout.addLayout(row)

    row = QtWidgets.QHBoxLayout()
    row.addWidget(option)
    row.addStretch()
    layout.addLayout(row)

    layout.addWidget(threadGroup)

    #msg = QtWidgets.QLabel(my.tr("WARNING: PLEASE DO NOT TURN ON REPETITION FILTERS UNLESS THERE ARE REPETITIONS!"))
    msgLabel = QtWidgets.QLabel(my.tr("Don't forget to maximize the text speed (see Help)."))
    skqss.class_(msgLabel, "text-success")
    layout.addWidget(msgLabel)

    wikiLabel = QtWidgets.QLabel(my.tr('Please check this <a href="http://sakuradite.com/wiki/en/VNR/Game_Settings">Game Settings</a> wiki if there is no correct text.'))
    wikiLabel.setOpenExternalLinks(True)
    #skqss.class_(wikiLabel, "text-info")
    layout.addWidget(wikiLabel)

    #buttons = QtWidgets.QHBoxLayout()
    #buttons.addStretch()
    #buttons.addWidget(cancelButton)
    #buttons.addWidget(self.saveButton)
    #layout.addLayout(buttons)
    #layout.addWidget(introLabel)

    #layout.setContentsMargins(18, 18, 18, 9) # left, top, right, bottom
    #self.q.setCentralWidget(skwidgets.SkLayoutWidget(layout))

    q.setLayout(layout)

    skwidgets.shortcut('alt+h', self._showHookPrefs, parent=q)
Exemplo n.º 4
0
    def _createUi(self, q):
        #hookPrefsButton = QtWidgets.QPushButton(my.tr("Edit /H Hook Code"))
        #skqss.class_(hookPrefsButton, 'btn btn-info')
        #hookPrefsButton.setToolTip(my.tr("Modify the game-specific ITH hook code") + " (Alt+H)")
        #hookPrefsButton.setStatusTip(hookPrefsButton.toolTip())
        #hookPrefsButton.clicked.connect(self._showHookPrefs)

        helpButton = QtWidgets.QPushButton(tr_("Help"))
        helpButton.setToolTip(tr_("Help"))
        skqss.class_(helpButton, 'btn btn-success')
        helpButton.clicked.connect(lambda: self.helpDialog.show())

        #wikiButton = QtWidgets.QPushButton(tr_("Wiki"))
        #wikiButton.setToolTip(tr_("Wiki"))
        #skqss.class_(wikiButton, 'btn btn-default')
        #import main
        #wikiButton.clicked.connect(lambda: main.manager().openWiki('VNR/Text Settings'))

        #cancelButton = QtWidgets.QPushButton(tr_("Cancel"))
        #cancelButton.clicked.connect(self.q.hide)

        threadArea = QtWidgets.QScrollArea()
        threadArea.setWidget(skwidgets.SkLayoutWidget(self.threadLayout))
        threadArea.setWidgetResizable(True)

        threadGroup = QtWidgets.QGroupBox()
        threadGroup.setTitle(mytr_("Text threads"))
        threadGroup.setLayout(skwidgets.SkWidgetLayout(threadArea))
        #threadGroup.setLayout(self.threadLayout)

        info = QtWidgets.QGroupBox("%s (%s)" % (
            tr_("Information"),
            tr_("read-only"),
        ))
        infoLayout = QtWidgets.QVBoxLayout()
        row = QtWidgets.QHBoxLayout()
        row.addWidget(QtWidgets.QLabel(mytr_("Game engine") + ":"))
        row.addWidget(self.engineLabel)
        row.addStretch()
        infoLayout.addLayout(row)
        info.setLayout(infoLayout)

        option = QtWidgets.QGroupBox(tr_("Options"))
        optionLayout = QtWidgets.QVBoxLayout()
        row = QtWidgets.QHBoxLayout()
        row.addWidget(QtWidgets.QLabel(mytr_("Game language") + ":"))
        row.addWidget(self.languageEdit)
        row.addStretch()
        row.addWidget(QtWidgets.QLabel(tr_("Text encoding") + ":"))
        row.addWidget(self.encodingEdit)
        optionLayout.addLayout(row)
        option.setLayout(optionLayout)

        layout = QtWidgets.QVBoxLayout()
        row = QtWidgets.QHBoxLayout()
        if not READONLY:
            row.addWidget(self.saveButton)

        #row.addWidget(hookPrefsButton)
        row.addWidget(self.resetButton)
        #row.addWidget(wikiButton)
        if not READONLY:
            row.addWidget(helpButton)
        #row.addWidget(QtWidgets.QLabel(
        #  " <= " + my.tr("click help if you have questions")
        #))
        row.addStretch()
        layout.addLayout(row)

        col = QtWidgets.QVBoxLayout()
        col.addWidget(info)
        col.addWidget(option)
        row = QtWidgets.QHBoxLayout()
        row.addLayout(col)
        row.addStretch()
        layout.addLayout(row)

        layout.addWidget(threadGroup)

        msg = QtWidgets.QLabel(
            "%s: %s" % (tr_("Note"), my.tr("All settings are read-only.")))
        skqss.class_(msg, "text-error")
        layout.addWidget(msg)

        #buttons = QtWidgets.QHBoxLayout()
        #buttons.addStretch()
        #buttons.addWidget(cancelButton)
        #buttons.addWidget(self.saveButton)
        #layout.addLayout(buttons)
        #layout.addWidget(introLabel)

        #layout.setContentsMargins(18, 18, 18, 9) # left, top, right, bottom
        #self.q.setCentralWidget(skwidgets.SkLayoutWidget(layout))

        q.setLayout(layout)