示例#1
0
  def __init__(self, parent=None):
    super(IntroPage, self).__init__(parent)
    self.setTitle(self.tr("Add or remove features"))

    introLabel = QtWidgets.QLabel(self.tr("""\
This wizard will direct you to add or remove features.

You can remove the features you don't need to save disk space.
Internet access is needed if you want to add new features.
"""))
    introLabel.setWordWrap(True)

    self._onlineLabel = QtWidgets.QLabel()

    onlineLabel = QtWidgets.QLabel(self.tr("Current Internet status") + ": ")
    onlineLabel.setBuddy(self._onlineLabel)

    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(introLabel)

    row = QtWidgets.QHBoxLayout()
    row.addWidget(onlineLabel)
    row.addWidget(self._onlineLabel)
    row.addStretch()
    layout.addLayout(row)

    self.setLayout(layout)
示例#2
0
  def __init__(self, parent=None):
    super(SelectFilePage, self).__init__(parent)
    self.setTitle(my.tr("Select game executable"))

    introLabel = QtWidgets.QLabel(my.tr("Please select the game executable's location"))
    introLabel.setWordWrap(True)

    self._edit = QtWidgets.QLineEdit()
    self._edit.setPlaceholderText(tr_("Location"))
    self._edit.textChanged.connect(self._validateEdit)
    self._edit.textChanged.connect(self.completeChanged)

    self._browseButton = QtWidgets.QPushButton(tr_("Browse") + " ...")
    skqss.class_(self._browseButton, 'btn btn-info')
    self._browseButton.clicked.connect(self._browse)

    #self._applocButton = QtWidgets.QCheckBox(my.tr("Open in Japanese locale (0x0411) using AppLocale"))
    #self._applocButton.toggled.connect(settings.global_().setApplocEnabled)

    #self._tzButton = QtWidgets.QCheckBox(my.tr("Open in Japanese time zone (+9 Asia/Tokyo)"))
    #self._tzButton.toggled.connect(settings.global_().setTimeZoneEnabled)

    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(introLabel)

    row = QtWidgets.QHBoxLayout()
    row.addWidget(self._edit)
    row.addWidget(self._browseButton)
    layout.addLayout(row)
    #layout.addWidget(self._applocButton)
    #layout.addWidget(self._tzButton)
    self.setLayout(layout)
示例#3
0
    def locationGroup(self):
        introLabel = QtWidgets.QLabel(
            my.
            tr("""You can specify a different executable to launch the game process.
By default it is the same as the executable of the game process."""))
        introLabel.setWordWrap(True)

        #launchLabel = QtWidgets.QLabel(mytr_("Launcher"))
        #launchLabel.setBuddy(self.launchEdit)

        browseLaunchButton = QtWidgets.QPushButton(tr_("Browse"))
        browseLaunchButton.clicked.connect(self._browseLaunchPath)
        skqss.class_(browseLaunchButton, 'btn btn-info')

        layout = QtWidgets.QVBoxLayout()
        launchRow = QtWidgets.QHBoxLayout()
        #launchRow.addWidget(launchLabel)
        launchRow.addWidget(self.launchEdit)
        launchRow.addWidget(browseLaunchButton)
        launchRow.addWidget(self.resetLaunchButton)
        layout.addLayout(launchRow)
        layout.addWidget(introLabel)

        ret = QtWidgets.QGroupBox(my.tr("Alternative launcher location"))
        ret.setLayout(layout)
        return ret
示例#4
0
    def _createUi(self, q, readonly):

        layout = QtWidgets.QVBoxLayout()

        # Header
        row = QtWidgets.QHBoxLayout()
        row.addWidget(self.searchEdit)
        row.addWidget(self.searchLabel)
        row.addWidget(self.searchButton)
        row.addWidget(self.pasteButton)
        layout.addLayout(row)

        # Site
        grid = QtWidgets.QGridLayout()
        r = c = 0
        grid.addWidget(self.trailersButton, r, c)
        c += 1
        grid.addWidget(self.scapeButton, r, c)
        c += 1
        grid.addWidget(self.holysealButton, r, c)
        c += 1
        grid.addWidget(self.freemButton, r, c)

        r += 1
        c = 0
        grid.addWidget(self.getchuButton, r, c)
        c += 1
        grid.addWidget(self.melonButton, r, c)
        c += 1
        grid.addWidget(self.gyuttoButton, r, c)
        c += 1
        grid.addWidget(self.digiketButton, r, c)
        c += 1
        grid.addWidget(self.dmmButton, r, c)
        c += 1
        grid.addWidget(self.dlsiteButton, r, c)

        r += 1
        c = 0
        grid.addWidget(self.amazonButton, r, c)
        c += 1
        grid.addWidget(self.steamButton, r, c)

        layout.addLayout(grid)

        # Body
        layout.addWidget(self.modelView)

        # Footer
        row = QtWidgets.QHBoxLayout()
        row.addWidget(self.filterEdit)
        row.addWidget(self.filterLabel)
        row.addWidget(self.browseButton)
        if not readonly:
            row.addWidget(self.saveButton)
        layout.addLayout(row)

        q.setLayout(layout)
示例#5
0
  def _createUi(self, q):
    grid = QtWidgets.QGridLayout()
    grid.setHorizontalSpacing(0)
    grid.setVerticalSpacing(0)

    # These keys must be consistent with pyhk

    KEYBOARD  = (
      ('Esc',  'F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'F10', 'F11', 'F12'), #'Escape'
      ('`',    '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 'Back'),
      ('Cap',  'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '[', ']', '\\'),
      (None,   'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', "'"), # 'Enter',
      (None,   'Z', 'X', 'C', 'V', 'B', 'N', 'M', ',', '.', '/'),
      #('Up', 'Down', 'Left', 'Right'),
    )

    r = 0
    for keys in KEYBOARD:
      for col,key in enumerate(keys):
        if key:
          btn = self.createKeyButton(key)
          grid.addWidget(btn, r, col)
      r += 1

    WIDE_COL = 2

    KEYBOARD2  = (
      ('Shift', 'Ctrl', 'Alt'), # 'Space'
      ('Insert', 'Delete', 'Home', 'End', 'PageUp', 'PageDown'),
      #('mouse left', 'mouse middle', 'mouse right'),
    )
    for keys in KEYBOARD2:
      for i,key in enumerate(keys):
        col = i * WIDE_COL
        if key:
          btn = self.createKeyButton(key)
          grid.addWidget(btn, r, col, 1, WIDE_COL)
      r += 1

    layout = QtWidgets.QVBoxLayout()
    layout.addLayout(grid)

    row = QtWidgets.QHBoxLayout()
    row.addStretch()
    row.addWidget(self.delButton)
    row.addWidget(self.cancelButton)
    row.addWidget(self.saveButton)
    layout.addLayout(row)

    #buttonBox = QtWidgets.QDialogButtonBox()
    #buttonBox.addButton(self.delButton, buttonBox.ResetRole)
    #buttonBox.addButton(self.cancelButton, buttonBox.RejectRole)
    #buttonBox.addButton(self.saveButton, buttonBox.AcceptRole)
    #layout.addWidget(buttonBox)

    q.setLayout(layout)

    shortcut('ctrl+s', self.save, parent=q)
示例#6
0
    def timeZoneGroup(self):
        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.defaultTimeZoneButton)
        layout.addWidget(self.disableTimeZoneButton)
        layout.addWidget(self.enableTimeZoneButton)

        ret = QtWidgets.QGroupBox(my.tr("Preferred time zone"))
        ret.setLayout(layout)
        return ret
示例#7
0
    def _createUi(self, q):
        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.textEdit)

        row = QtWidgets.QHBoxLayout()
        row.addStretch()
        row.addWidget(self.pasteButton)
        row.addWidget(self.saveButton)
        layout.addLayout(row)
        q.setLayout(layout)
示例#8
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))
示例#9
0
  def __init__(self, parent=None):
    super(IntroPage, self).__init__(parent)
    self.setTitle(my.tr("Add a new visual novel"))

    url = config.URL_READER_DEMO

    introEdit = QtWidgets.QTextBrowser()
    introEdit.setReadOnly(True)
    introEdit.setOpenExternalLinks(True)
    introEdit.setHtml(my.tr(
"""This wizard will help you add new visual novel step by step.
<br/><br/>

An Internet access is not indispensable, but is recommended.
With the Internet, the wizard will be able to search the online database for game settings, which will save you some time for setting things up,
<br/><br/>

Note:
On Windows Vista or Windows 7 where UAC is enabled,
if the target game is launched with <b>admin privilege</b>
(i.e., when you run the game, the Windows will black out, and ask you blablabla and "YES" or "NO" to continue),
<b>please open Visual Novel Reader as admin as well</b>!
<br/><br/>

Here's a <a href="%s">demo on youtube</a> that might be helpful.""") % url)

    self._onlineLabel = QtWidgets.QLabel()

    onlineLabel = QtWidgets.QLabel(my.tr("Current Internet status") + ": ")
    onlineLabel.setBuddy(self._onlineLabel)

    self._elevateLabel = QtWidgets.QLabel(
        tr_("Not administrator") if features.ADMIN == False else
        tr_("Administrator"))
    skqss.class_(self._elevateLabel, 'warning' if features.ADMIN == False else 'normal')
    elevateLabel = QtWidgets.QLabel(my.tr("Current privileges") + ": ")
    elevateLabel.setBuddy(self._elevateLabel)

    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(introEdit)

    row = QtWidgets.QHBoxLayout()
    row.addWidget(onlineLabel)
    row.addWidget(self._onlineLabel)
    row.addStretch()
    layout.addLayout(row)

    row = QtWidgets.QHBoxLayout()
    row.addWidget(elevateLabel)
    row.addWidget(self._elevateLabel)
    row.addStretch()
    layout.addLayout(row)

    self.setLayout(layout)
示例#10
0
  def __init__(self, parent=None):
    super(ConfirmPage, self).__init__(parent)
    self.setTitle(self.tr("Confirm changes"))
    self.setCommitPage(True)

    self._infoLabel = QtWidgets.QLabel()
    self._infoLabel.setWordWrap(True)

    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(self._infoLabel)
    self.setLayout(layout)
示例#11
0
  def __init__(self, parent=None):
    super(FinalPage, self).__init__(parent)
    self.setFinalPage(True)

    self.setTitle(tr_("Finish"))

    self._infoLabel = QtWidgets.QLabel()
    self._infoLabel.setWordWrap(True)

    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(self._infoLabel)
    self.setLayout(layout)
示例#12
0
  def __init__(self, wiz):
    super(SelectWindowPage, self).__init__(wiz)
    self.setTitle(my.tr("Select game window"))

    introLabel = QtWidgets.QLabel(my.tr(
      "Press START and  CLICK the game window, or press the STOP button to cancel."
    ))
    introLabel.setWordWrap(True)

    self._picker = winpicker.WindowPicker(self)
    self._picker.windowClicked.connect(self._onWindowClicked)
    wiz.visibleChanged.connect(self._onVisibleChanged)

    self._windowEdit = QtWidgets.QLineEdit()
    self._windowEdit.setReadOnly(True)
    self._windowEdit.setPlaceholderText(my.tr("Not found, or not a game window"))
    self._windowEdit.setToolTip(my.tr("Game window"))
    windowLabel = QtWidgets.QLabel(my.tr("Game window") + ":")
    windowLabel.setBuddy(self._windowEdit)

    self._nameEdit = QtWidgets.QLineEdit()
    self._nameEdit.setReadOnly(True)
    self._nameEdit.setPlaceholderText(tr_("Not found"))
    self._nameEdit.setToolTip(tr_("Window title"))
    nameLabel = QtWidgets.QLabel("=> " + tr_("Window title") + ":")
    nameLabel.setBuddy(self._nameEdit)

    self._startButton = QtWidgets.QPushButton("\n\n" + tr_("START") + "\n\n")
    self._startButton.clicked.connect(self._start)
    skqss.class_(self._startButton, 'btn btn-primary')

    self._stopButton = QtWidgets.QPushButton("\n\n" + tr_("STOP") + "\n\n")
    self._stopButton.clicked.connect(self._stop)
    skqss.class_(self._stopButton, 'btn btn-danger')

    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(introLabel)
    buttons = QtWidgets.QHBoxLayout()
    buttons.addWidget(self._startButton)
    buttons.addWidget(self._stopButton)
    buttons.setContentsMargins(10,10,10,10)
    layout.addLayout(buttons)

    grid = QtWidgets.QGridLayout()
    # 0
    grid.addWidget(windowLabel, 0, 0)
    grid.addWidget(self._windowEdit, 0, 1)
    # 1
    grid.addWidget(nameLabel)
    grid.addWidget(self._nameEdit)

    layout.addLayout(grid)
    self.setLayout(layout)
示例#13
0
    def _createUi(self, q):
        #url = "http://en.wikipedia.org/wiki/Regular_expression"
        url = "http://www.regular-expressions.info/lookaround.html"
        self.textEdit.appendHtml(
            """You can use this tester to play with the regular expression
(<a href="%s">%s</a>) used in the Shared Dictionary.
<br/><br/>

For example, "regular(?= exp)" will match all "regular" before " exp".
""" % (url, url))

        self.patternEdit.setText("regular(?= exp)")
        self.replaceEdit.setText("HELLO WORLD")

        for sig in (
                self.textEdit.textChanged,
                self.patternEdit.textChanged,
                self.replaceEdit.textChanged,
                self.regexCheckBox.toggled,
                self.icaseCheckBox.toggled,
        ):
            sig.connect(self._refresh)

        layout = QtWidgets.QVBoxLayout()

        grid = QtWidgets.QGridLayout()

        # 0
        grid.addWidget(create_label(tr_("Pattern")), 0, 0)
        grid.addWidget(self.patternEdit, 0, 1)

        # 1
        grid.addWidget(create_label(tr_("Translation")))
        grid.addWidget(self.replaceEdit)

        # 2
        grid.addWidget(create_label(tr_("Status")))
        grid.addWidget(self.messageEdit)

        layout.addLayout(grid)

        row = QtWidgets.QHBoxLayout()
        row.addWidget(self.regexCheckBox)
        row.addWidget(self.icaseCheckBox)
        layout.addLayout(row)

        splitter = QtWidgets.QSplitter(Qt.Vertical)
        splitter.addWidget(self.textEdit)
        splitter.addWidget(self.textView)
        layout.addWidget(splitter)
        q.setLayout(layout)
示例#14
0
    def _createUi(self, q):
        layout = QtWidgets.QVBoxLayout()

        row = QtWidgets.QHBoxLayout()
        row.addWidget(self.inputEdit)
        row.addWidget(self.submitButton)
        row.addWidget(self.pasteButton)
        row.addWidget(self.clearButton)
        row.addWidget(self.speakButton)
        layout.addLayout(row)

        layout.addWidget(self.resultEdit)

        q.setLayout(layout)
示例#15
0
    def embedGroup(self):
        layout = QtWidgets.QVBoxLayout()

        row = QtWidgets.QHBoxLayout()
        row.addWidget(self.embedEnableButton)
        layout.addLayout(row)

        ret = QtWidgets.QGroupBox(mytr_("Embed translation"))
        ret.setLayout(layout)

        ss = settings.global_()
        ret.setEnabled(ss.isGameAgentEnabled())
        ss.gameAgentEnabledChanged.connect(ret.setEnabled)
        return ret
示例#16
0
    def textGroup(self):
        layout = QtWidgets.QVBoxLayout()

        row = QtWidgets.QHBoxLayout()
        row.addWidget(QtWidgets.QLabel(tr_("Language") + ":"))
        row.addWidget(self.languageEdit)
        row.addStretch()
        row.addWidget(QtWidgets.QLabel(tr_("Encoding") + ":"))
        row.addWidget(self.encodingEdit)
        layout.addLayout(row)

        ret = QtWidgets.QGroupBox(mytr_("Game language"))
        ret.setLayout(layout)
        return ret
示例#17
0
  def __init__(self, parent=None):
    super(SyncGamePage, self).__init__(parent)
    self.setTitle(my.tr("Analyzing the game process"))

    introLabel = QtWidgets.QLabel(my.tr("Synchronizing with visual novel") + " ...")
    introLabel.setWordWrap(True)

    self._edit = QtWidgets.QLineEdit()
    self._edit.setReadOnly(True)
    self._edit.setToolTip(tr_("Status"))

    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(introLabel)
    layout.addWidget(self._edit)
    self.setLayout(layout)
示例#18
0
  def _createUi(self, q):
    self.edit = QtWidgets.QLineEdit()
    skqss.class_(self.edit, 'normal')

    grid = QtWidgets.QGridLayout()
    r = 0
    self.updateCommentButton = QtWidgets.QRadioButton(mytr_("Update reason"))
    self.updateCommentButton.setChecked(True)
    self.commentButton = QtWidgets.QRadioButton(tr_("Comment"))
    g = QtWidgets.QButtonGroup(q)
    g.addButton(self.updateCommentButton)
    g.addButton(self.commentButton)
    grid.addWidget(create_label(tr_("Property")), r, 0)
    for i,b in enumerate(g.buttons()):
      grid.addWidget(b, r, i+1)

    r += 1
    self.appendButton = QtWidgets.QRadioButton(tr_("Append"))
    self.appendButton.setChecked(True)
    self.overwriteButton = QtWidgets.QRadioButton(tr_("Overwrite"))
    g = QtWidgets.QButtonGroup(q)
    g.addButton(self.appendButton)
    g.addButton(self.overwriteButton)
    grid.addWidget(create_label(tr_("Method")), r, 0)
    for i,b in enumerate(g.buttons()):
      grid.addWidget(b, r, i+1)

    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(self.edit)

    optionGroup = QtWidgets.QGroupBox(tr_("Option"))
    optionGroup.setLayout(grid)
    layout.addWidget(optionGroup)

    buttonBox = QtWidgets.QDialogButtonBox(
        QtWidgets.QDialogButtonBox.Ok|
        QtWidgets.QDialogButtonBox.Cancel)
    layout.addWidget(buttonBox)
    buttonBox.accepted.connect(q.accept)
    buttonBox.rejected.connect(q.reject)

    okButton = buttonBox.button(buttonBox.Ok)
    okButton.setDefault(True)
    skqss.class_(okButton, 'btn btn-primary')
    #cancelButton = buttonBox.button(buttonBox.Cancel)

    q.setLayout(layout)
示例#19
0
  def __init__(self, parent=None):
    super(SelectPage, self).__init__(parent)
    self.setTitle(self.tr("Select apps"))

    introLabel = QtWidgets.QLabel(self.tr("Select which app to add or remove"))
    introLabel.setWordWrap(True)

    self._playerButton = QtWidgets.QCheckBox(self.tr('"Annot Player" for the anime'))
    self._playerButton.clicked.connect(self.completeChanged)

    self._readerButton = QtWidgets.QCheckBox(self.tr('"Visual Novel Reader" for the visual novel'))
    self._readerButton.clicked.connect(self.completeChanged)

    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(introLabel)
    layout.addWidget(self._readerButton)
    layout.addWidget(self._playerButton)
    self.setLayout(layout)
示例#20
0
    def hookGroup(self):
        layout = QtWidgets.QVBoxLayout()

        row = QtWidgets.QHBoxLayout()
        row.addWidget(self.hookEdit)
        row.addWidget(self.hookButton)
        layout.addLayout(row)

        label = QtWidgets.QLabel(
            my.
            tr("You can edit hook code in Text Settings after the game is launched."
               ))
        label.setWordWrap(True)
        layout.addWidget(label)

        ret = QtWidgets.QGroupBox(
            "%s (%s)" % (my.tr("Game-specific hook code"), tr_("read-only")))
        ret.setLayout(layout)
        return ret
示例#21
0
  def __init__(self, wiz):
    super(SyncThreadPage, self).__init__(wiz)
    self.setTitle(my.tr("Analyzing the game threads"))

    self._complete = False
    wiz.profile().threadUpdated.connect(self._setComplete)

    introLabel = QtWidgets.QLabel(my.tr("Searching for game settings online") + " ...")
    introLabel.setWordWrap(True)

    self._edit = QtWidgets.QLineEdit()
    self._edit.setReadOnly(True)
    self._edit.setToolTip(tr_("Status"))
    self._edit.setText(tr_("Searching") + " ...")

    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(introLabel)
    layout.addWidget(self._edit)
    self.setLayout(layout)
示例#22
0
  def __init__(self, parent=None):
    super(FinalPage, self).__init__(parent)
    self.setFinalPage(True)

    self.setTitle(tr_("Finish"))

    introLabel = QtWidgets.QLabel(my.tr(
      "Complete adding visual novel!"
    ))
    introLabel.setWordWrap(True)


    introEdit = QtWidgets.QTextBrowser()
    introEdit.setReadOnly(True)

    mail = config.EMAIL_HELP
    introEdit.setHtml(my.tr(
"""<span style="color:green">
You can change these settings later in <a href="#">Text Settings</a>.
</span>
<br/><br/>

<span style="color:green">
You can access the context menu by right-click the <span style="color:blue">Blue button</span> sitting on the bottom left corner.
</span>
<br/><br/>

<span style="color:brown">
<b>If the game text does not appear</b>, please try adjusting the text threads in <a href="#">Text Settings</a>,
or complain to me by email (<a href="mailto:%s">%s</a>).
</span>
<br/><br/>

It is recommended that you <b>set the Game Text Speed to maximum</b> if possible.
Especially if you would like to translate this game.""") % (mail, mail))
    introEdit.anchorClicked.connect(
        main.manager().showTextSettings)

    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(introLabel)
    layout.addWidget(introEdit)
    self.setLayout(layout)
示例#23
0
    def loaderGroup(self):
        layout = QtWidgets.QVBoxLayout()

        row = QtWidgets.QHBoxLayout()
        row.addWidget(QtWidgets.QLabel(tr_("Locale") + ":"))
        row.addWidget(self.launchLanguageEdit)
        row.addStretch()
        layout.addLayout(row)

        layout.addWidget(self.defaultLoaderButton)
        layout.addWidget(self.disableLoaderButton)
        layout.addWidget(self.applocButton)
        layout.addWidget(self.localeEmulatorButton)
        layout.addWidget(self.ntleasButton)
        layout.addWidget(self.ntleaButton)
        layout.addWidget(self.localeSwitchButton)

        ret = QtWidgets.QGroupBox(my.tr("Preferred game loader"))
        ret.setLayout(layout)
        return ret
示例#24
0
    def createUi(self, q):
        layout = QtWidgets.QVBoxLayout()

        row = QtWidgets.QHBoxLayout()
        row.addWidget(self.startButton)
        row.addWidget(self.stopButton)
        row.addWidget(self.languageEdit)
        row.addStretch()
        row.addWidget(self.ttsButton)
        layout.addLayout(row)

        row = QtWidgets.QHBoxLayout()
        row.addWidget(self.autoStopButton)
        row.addStretch()
        row.addWidget(self.deviceEdit)
        layout.addLayout(row)

        layout.addWidget(self.textEdit)

        q.setLayout(layout)
示例#25
0
    def _createUi(self, q):
        layout = QtWidgets.QVBoxLayout()

        row = QtWidgets.QHBoxLayout()
        row.addStretch()
        row.addWidget(QtWidgets.QLabel(tr_("Language") + ":"))
        row.addWidget(self.languageEdit)
        layout.addLayout(row)

        layout.addWidget(self.contentEdit)

        row = QtWidgets.QHBoxLayout()
        row.addWidget(self.browseImageButton)
        row.addWidget(self.removeImageButton)
        row.addWidget(self.imageTitleEdit)
        row.addStretch()
        #row.addWidget(self.cancelButton)
        row.addWidget(self.saveButton)
        layout.addLayout(row)

        layout.setContentsMargins(5, 5, 5, 5)
        q.setLayout(layout)
示例#26
0
  def __init__(self, parent=None):
    super(ChooseMeansPage, self).__init__(parent)
    self.setTitle(my.tr("Select how to find the game"))

    introLabel = QtWidgets.QLabel(my.tr("How would you like to select the game?"))
    introLabel.setWordWrap(True)

    self._windowButton = QtWidgets.QRadioButton(my.tr("Select the window of the running game") + " (%s)" % tr_("recommended"))
    self._windowButton.setToolTip("Alt+1")
    self._windowButton.clicked.connect(self.completeChanged)

    self._processButton = QtWidgets.QRadioButton(my.tr("Select the process of the running game"))
    self._processButton.setToolTip("Alt+2")
    self._processButton.clicked.connect(self.completeChanged)

    self._fileButton = QtWidgets.QRadioButton(my.tr("Select the game executable file on the hard drive"))
    self._fileButton.setToolTip("Alt+3")
    self._fileButton.clicked.connect(self.completeChanged)

    skwidgets.shortcut("alt+1", self._windowButton.click)
    skwidgets.shortcut("alt+2", self._processButton.click)
    skwidgets.shortcut("alt+3", self._fileButton.click)

    infoLabel = QtWidgets.QLabel("\n" + my.tr(
      "By the way, you can also drag the game's exe/lnk to the SpringBoard, which is equivalent to #3 (select by file)."
    ))

    infoLabel.setWordWrap(True)

    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(introLabel)
    if not features.WINE:
      layout.addWidget(self._windowButton)
    layout.addWidget(self._processButton)
    layout.addWidget(self._fileButton)
    layout.addWidget(infoLabel)
    self.setLayout(layout)
示例#27
0
    def _createUi(self, q):
        layout = QtWidgets.QVBoxLayout()
        b = cancelButton = QtWidgets.QPushButton(tr_("Cancel"))
        skqss.class_(b, 'btn btn-default')
        b.clicked.connect(q.hide)

        b = updateButton = QtWidgets.QPushButton(tr_("Update"))
        b.setToolTip(tr_("Update"))
        skqss.class_(updateButton, 'btn btn-primary')
        b.clicked.connect(q.hide)
        b.clicked.connect(self.openUpdate)
        b.setDefault(True)

        infoLabel = QtWidgets.QLabel(
            my.tr("""Found new updates for Visual Novel Reader.
Do you want to update now?
You can find recent changes here:"""))
        layout.addWidget(infoLabel)

        linkstyle = 'color:#428bca'  # bootstrap btn-link
        url = 'http://sakuradite.com/changes/vnr'
        changesLabel = QtWidgets.QLabel(
            '<a href="{1}" style="{0}">{1}</a>'.format(linkstyle, url))
        changesLabel.setOpenExternalLinks(True)
        changesLabel.setAlignment(Qt.AlignHCenter)
        changesLabel.setToolTip(tr_("Recent changes"))
        layout.addWidget(changesLabel)

        layout.addStretch()

        row = QtWidgets.QHBoxLayout()
        row.addStretch()
        row.addWidget(cancelButton)
        row.addWidget(updateButton)
        layout.addLayout(row)

        q.setLayout(layout)
示例#28
0
  def __init__(self, parent=None):
    super(SelectProcessPage, self).__init__(parent)
    self.setTitle(my.tr("Select game process"))

    introLabel = QtWidgets.QLabel(my.tr("Please select game process"))
    introLabel.setWordWrap(True)

    self._refreshButton = QtWidgets.QPushButton(tr_("Refresh"))
    self._refreshButton.clicked.connect(self._refresh)
    skqss.class_(self._refreshButton, 'btn btn-success')

    self._table = SkFilterTableController(self)
    self._table.currentIndexChanged.connect(self.completeChanged)

    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(introLabel)
    layout.addWidget(self._table.view())
    search = QtWidgets.QHBoxLayout()
    search.addWidget(self._table.filterEdit())
    search.addWidget(self._table.countLabel())
    search.addWidget(self._refreshButton)
    layout.addLayout(search)

    self.setLayout(layout)
示例#29
0
 def infoGroup(self):
     layout = QtWidgets.QVBoxLayout()
     layout.addWidget(self.nameEdit)
     ret = QtWidgets.QGroupBox(my.tr("Dashboard display name"))
     ret.setLayout(layout)
     return ret
示例#30
0
    def _createUi(self, q):
        self.userTab = _prefs.UserTab()
        self.textTab = _prefs.TextTab()
        self.ttsTab = _prefs.TtsTab()
        self.ocrTab = _prefs.OcrTab()
        #self.srTab = _prefs.SrTab()
        self.gameTab = _prefs.GameTab()
        self.shortcutsTab = _prefs.ShortcutsTab()
        self.uiTab = _prefs.UiTab()
        self.recordingsTab = _prefs.RecordingsTab()
        self.i18nTab = _prefs.I18nTab()
        self.engineTab = _prefs.EngineTab()
        self.internetTab = _prefs.InternetTab()
        self.featureTab = _prefs.FeatureTab()
        #self.pluginTab = _prefs.PluginTab()

        self.translationTab = _prefs.TranslationTab()
        self.machineTranslationTab = _prefs.MachineTranslationTab()
        self.dictionaryTranslationTab = _prefs.DictionaryTranslationTab()
        self.romanTranslationTab = _prefs.RomanTranslationTab()
        self.chineseTranslationTab = _prefs.ChineseTranslationTab()
        #self.translationScriptTab = _prefs.TranslationScriptTab()

        self.termTab = _prefs.TermTab()

        self.downloadsTab = _prefs.DownloadsTab()
        self.dictionaryDownloadsTab = _prefs.DictionaryDownloadsTab()
        self.launcherDownloadsTab = _prefs.LauncherDownloadsTab()
        self.fontDownloadsTab = _prefs.FontDownloadsTab()

        self.libraryTab = _prefs.LibraryTab()
        self.localeLibraryTab = _prefs.LocaleLibraryTab()
        self.translatorLibraryTab = _prefs.TranslatorLibraryTab()
        self.dictionaryLibraryTab = _prefs.DictionaryLibraryTab()
        self.ttsLibraryTab = _prefs.TtsLibraryTab()
        self.ocrLibraryTab = _prefs.OcrLibraryTab()

        #for t in self.itertabs():
        #  t.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
        #                  QtWidgets.QSizePolicy.Expanding)

        container = QtWidgets.QScrollArea()  # widget container
        container.setWidgetResizable(True)  # false by default
        container.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
        container.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
        #container.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        #container.setAlignment(Qt.AlignTop | Qt.AlignHCenter)

        self.controller = skmvc.SkWidgetTreeController(
            parent=q,
            container=container,
            data={
                'display':
                tr_("Preferences"),
                'children': [
                    {
                        'widget': self.userTab,
                        'user': self._indexWidget(self.userTab),
                        'decoration': rc.icon('pref-user'),
                        'display': tr_("Account"),
                        'toolTip': my.tr("User account"),
                    },
                    {
                        'widget': self.engineTab,
                        'user': self._indexWidget(self.engineTab),
                        #'display': u"%s (α)" % mytr_("Embedded"),
                        'display': mytr_("Embedded"),
                        'decoration': rc.icon('pref-config'),
                        'toolTip': my.tr("Embedded subtitles"),
                    },
                    {
                        'widget':
                        self.downloadsTab,
                        'user':
                        self._indexWidget(self.downloadsTab),
                        'decoration':
                        rc.icon('pref-download'),
                        'display':
                        tr_("Downloads"),
                        'toolTip':
                        my.tr("Download additional resources"),
                        'children': [
                            {
                                'widget':
                                self.launcherDownloadsTab,
                                'user':
                                self._indexWidget(self.launcherDownloadsTab),
                                'decoration':
                                rc.icon('pref-locale'),
                                'display':
                                tr_("Launch"),
                                'toolTip':
                                my.tr("Locale changers"),
                            },
                            {
                                'widget':
                                self.dictionaryDownloadsTab,
                                'user':
                                self._indexWidget(self.dictionaryDownloadsTab),
                                'decoration':
                                rc.icon('pref-dict'),
                                'display':
                                tr_("Dictionaries"),
                                'toolTip':
                                my.tr("Manage dictionaries"),
                            },
                            {
                                'widget': self.fontDownloadsTab,
                                'user':
                                self._indexWidget(self.fontDownloadsTab),
                                'decoration': rc.icon('pref-font'),
                                'display': tr_("Fonts"),
                                'toolTip': my.tr("Manage fonts"),
                            },
                        ]
                    },
                    {
                        'widget':
                        self.libraryTab,
                        'user':
                        self._indexWidget(self.libraryTab),
                        'decoration':
                        rc.icon('pref-library'),
                        'display':
                        tr_("Locations"),
                        'toolTip':
                        my.tr("Locations of external libraries"),
                        'children': [
                            {
                                'widget':
                                self.localeLibraryTab,
                                'user':
                                self._indexWidget(self.localeLibraryTab),
                                'decoration':
                                rc.icon('pref-locale'),
                                'display':
                                tr_("Launch"),
                                'toolTip':
                                my.tr("Locations of external locale changers"),
                            },
                            {
                                'widget':
                                self.translatorLibraryTab,
                                'user':
                                self._indexWidget(self.translatorLibraryTab),
                                'decoration':
                                rc.icon('pref-tr-path'),
                                'display':
                                tr_("Translators"),
                                'toolTip':
                                my.tr("Locations of external translators"),
                            },
                            {
                                'widget':
                                self.dictionaryLibraryTab,
                                'user':
                                self._indexWidget(self.dictionaryLibraryTab),
                                'decoration':
                                rc.icon('pref-dict'),
                                'display':
                                tr_("Dictionaries"),
                                'toolTip':
                                my.tr("Locations of external dictionary"),
                            },
                            {
                                'widget': self.ttsLibraryTab,
                                'user': self._indexWidget(self.ttsLibraryTab),
                                'decoration': rc.icon('pref-tts-path'),
                                'display': mytr_("TTS"),
                                'toolTip': my.tr("Locations of external TTS"),
                            },
                            {
                                'widget':
                                self.ocrLibraryTab,
                                'user':
                                self._indexWidget(self.ocrLibraryTab),
                                'decoration':
                                rc.icon('pref-ocr-path'),
                                'display':
                                mytr_("OCR"),
                                'toolTip':
                                my.tr("Locations of external OCR libraries"),
                            },
                        ]
                    },
                    {
                        'widget':
                        self.translationTab,
                        'user':
                        self._indexWidget(self.translationTab),
                        'decoration':
                        rc.icon('pref-tr'),
                        'display':
                        tr_("Translation"),
                        'toolTip':
                        my.tr("Machine translators"),
                        'children': [
                            {
                                'widget':
                                self.machineTranslationTab,
                                'user':
                                self._indexWidget(self.machineTranslationTab),
                                'decoration':
                                rc.icon('pref-tr-path'),
                                'display':
                                tr_("Translators"),
                                'toolTip':
                                my.tr("Preferred machine translators"),
                            },
                            {
                                'widget':
                                self.dictionaryTranslationTab,
                                'user':
                                self._indexWidget(
                                    self.dictionaryTranslationTab),
                                'decoration':
                                rc.icon('pref-dict'),
                                'display':
                                tr_("Dictionaries"),
                                'toolTip':
                                my.tr("Preferred look-up dictionaries"),
                            },
                            {
                                'widget':
                                self.romanTranslationTab,
                                'user':
                                self._indexWidget(self.romanTranslationTab),
                                'decoration':
                                rc.icon('pref-roman'),
                                'display':
                                mytr_("C/K Ruby"),
                                'toolTip':
                                my.
                                tr("Romanization of texts in Chinese and Korean"
                                   ),
                            },
                            {
                                'widget':
                                self.chineseTranslationTab,
                                'user':
                                self._indexWidget(self.chineseTranslationTab),
                                'decoration':
                                rc.icon('pref-zh'),
                                'display':
                                tr_("Chinese"),
                                'toolTip':
                                my.tr("Preferred Chinese variant"),
                            },
                            #{ 'widget': self.translationScriptTab,
                            #  'user': self._indexWidget(self.translationScriptTab),
                            #  'decoration': rc.icon('pref-script'),
                            #  'display': tr_("Scripts"),
                            #  'toolTip': my.tr("Translation replacement scripts"),
                            #},
                        ]
                    },
                    {
                        'widget': self.ttsTab,
                        'user': self._indexWidget(self.ttsTab),
                        'decoration': rc.icon('pref-tts'),
                        'display': mytr_("Text-To-Speech"),
                        'toolTip': mytr_("Text-To-Speech") + " (TTS)",
                    },
                    #{ 'widget': self.srTab,
                    #  'user': self._indexWidget(self.srTab),
                    #  'decoration': rc.icon('pref-sr'),
                    #  'display': u"%s (α)" % mytr_("ASR"),
                    #  'toolTip': mytr_("Automatic speech recognition") + " (ASR)",
                    #},
                    {
                        'widget':
                        self.ocrTab,
                        'user':
                        self._indexWidget(self.ocrTab),
                        'decoration':
                        rc.icon('pref-ocr'),
                        'display':
                        u"%s (α)" % mytr_("OCR"),
                        'toolTip':
                        mytr_("Optical character recognition") + " (OCR)",
                    },
                    {
                        'widget': self.textTab,
                        'user': self._indexWidget(self.textTab),
                        'display': tr_("Font"),
                        'decoration': rc.icon('pref-text'),
                        'toolTip': my.tr("Text rendering"),
                    },
                    {
                        'widget': self.gameTab,
                        'user': self._indexWidget(self.gameTab),
                        'decoration': rc.icon('pref-app'),
                        'display': tr_("Launch"),
                        'toolTip': my.tr("Game launch settings"),
                    },
                    {
                        'widget': self.shortcutsTab,
                        'user': self._indexWidget(self.shortcutsTab),
                        'decoration': rc.icon('pref-shortcuts'),
                        'display': mytr_("Shortcuts"),
                        'toolTip': my.tr("Mouse and keyboard shortcuts"),
                    },
                    {
                        'widget': self.recordingsTab,
                        'user': self._indexWidget(self.recordingsTab),
                        'decoration': rc.icon('pref-rec'),
                        'display': mytr_("Recordings"),
                        'toolTip': my.tr("Game recordings"),
                    },
                    {
                        'widget': self.uiTab,
                        'user': self._indexWidget(self.uiTab),
                        'decoration': rc.icon('pref-ui'),
                        'display': tr_("UI"),
                        'toolTip': my.tr("UI Theme"),
                    },
                    {
                        'widget': self.i18nTab,
                        'user': self._indexWidget(self.i18nTab),
                        'display': tr_("i18n"),
                        'decoration': rc.icon('pref-i18n'),
                        'toolTip': tr_("International"),
                    },
                    {
                        'widget': self.termTab,
                        'user': self._indexWidget(self.termTab),
                        'decoration': rc.icon('pref-share'),
                        'display': mytr_("Shared Dictionary"),
                        'toolTip': mytr_("Shared Dictionary"),
                    },
                    {
                        'widget': self.internetTab,
                        'user': self._indexWidget(self.internetTab),
                        'decoration': rc.icon('pref-internet'),
                        'display': tr_("Internet"),
                        'toolTip': my.tr("Internet options"),
                    },
                    {
                        'widget': self.featureTab,
                        'user': self._indexWidget(self.featureTab),
                        'decoration': rc.icon('pref-feature'),
                        'display': tr_("Features"),
                        'toolTip': my.tr("Application features"),
                    },
                ],
            })
        self.controller.treeView().setHeaderHidden(True)
        self.controller.treeView().expandAll()

        left = QtWidgets.QWidget()
        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.controller.treeView())
        row = QtWidgets.QHBoxLayout()
        row.addWidget(self.controller.filterEdit())
        row.addWidget(self.controller.countLabel())
        layout.addLayout(row)
        left.setLayout(layout)
        q.addWidget(left)

        skqss.class_(self.controller.treeView(), 'texture')

        right = self.controller.widgetView()
        #right.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
        #                    QtWidgets.QSizePolicy.Expanding)
        q.addWidget(right)

        self.controller.currentIndexChanged.connect(self._refreshCurrentWidget)

        w = self.controller.filterEdit()
        w.setToolTip("%s (%s, %s, Ctrl+F)" %
                     (tr_("Search"), tr_("case-insensitive"),
                      tr_("regular expression")))
        shortcut('ctrl+f', w.setFocus, parent=q)