Exemplo n.º 1
0
def confirmUpdateTerms():
    """
  @return  {reset=bool} or None
  """
    if not netman.manager().isOnline():
        growl.warn(my.tr("Cannot perform update when offline"))
        return
    #_speak(u"今すぐ辞書を更新しますか?")
    t = settings.global_().termsTime() or config.VERSION_TIMESTAMP
    sel = QMessageBox.question(
        _parent(), my.tr("Update user-contributed dictionary"), "\n\n".join((
            "\n".
            join((my.tr(
                "Dictionary terms for machine translation are updated on: {0}."
            ),
                  my.
                  tr("VNR will check for automatically updates. Do you want to update now?"
                     ))),
            my.tr("""
VNR will do incremental update by default.
But if you press Reset, VNR will redownload the entire data, which is slow."""
                  ),
        )).format(i18n.timestamp2datetime(t)), Yes | No | Reset, No)
    if sel == Yes:
        return {'reset': False}
    elif sel == Reset:
        return {'reset': True}
Exemplo n.º 2
0
def confirmUpdateSubs(timestamp=0):
    """
  @param* timestamp  long
  @return  {reset=bool} or None
  """
    if not netman.manager().isOnline():
        growl.warn(my.tr("Cannot perform update when offline"))
        return
    ts = i18n.timestamp2datetime(timestamp) if timestamp else tr_('empty')
    sel = QMessageBox.question(
        _parent(), my.tr("Update user-contributed subtitles"), "\n\n".join((
            "\n".join((
                my.tr("Shared subtitles are updated on: {0}."),
                my.
                tr("VNR will check for automatically updates. Do you want to update now?"
                   ))),
            my.tr("""
VNR will do incremental update by default.
But if you press Reset, VNR will redownload the entire data, which is slow."""
                  ),
        )).format(ts), Yes | No | Reset, No)
    if sel == Yes:
        return {'reset': False}
    elif sel == Reset:
        return {'reset': True}
Exemplo n.º 3
0
def confirmClearEntries():
    """
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), my.tr("Confirm deletion"),
        my.tr("Do you want to permanently delete all entries?"), Yes | No, No)
Exemplo n.º 4
0
def confirmDownloadGameImages():
    """
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), my.tr("Save game images"),
        my.tr("Do you want to save all images to your Desktop?"), Yes | No, No)
Exemplo n.º 5
0
def confirmResetSettings():
    """
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), tr_("Restore default settings"),
        my.tr("Do you want to restore default settings?"), Yes | No, No)
Exemplo n.º 6
0
def confirmUpdateRefs(game=None):
    """
  @param  game  dataman.Game or None
  @return  bool
  """
    #if not game:
    #  growl.notify(my.tr("Unknown game. Please try updating the database."))
    #  return
    if not netman.manager().isOnline():
        growl.warn(my.tr("Cannot perform update when offline"))
        return
    #_speak(u"今すぐゲーム情報を更新しますか?")

    msg = ""
    if game:
        t = game.refsUpdateTime or game.visitTime or config.VERSION_TIMESTAMP
        msg += my.tr("Game references are updated on: {0}.").format(
            i18n.timestamp2datetime(t)) + "\n"

    msg += "\n\n".join((
        my.tr("VNR will automatically check for updates."),
        my.tr("""Do you want to update now?
It might take a couple of seconds to complete."""),
    ))

    return Yes == QMessageBox.question(_parent(),
                                       my.tr("Update game references"), msg,
                                       Yes | No, No)
Exemplo n.º 7
0
def confirmUpdateComments(game=None):
    """
  @param  game  dataman.Game or None
  @return  bool
  """
    #if not game:
    #  growl.notify(my.tr("Unknown game. Please try updating the database."))
    #  return
    if not netman.manager().isOnline():
        growl.warn(my.tr("Cannot perform update when offline"))
        return
    _speak(u"今すぐ字幕を更新しますか?")

    msg = "\n\n".join((
        my.tr("VNR will automatically check for updates."),
        my.tr("""Do you want to update now?
It might take a couple of seconds to complete."""),
    ))

    t = game.commentsUpdateTime or game.visitTime if game else 0
    if t > 0:
        msg = "\n".join((my.tr("Comments are updated on: {0}.").format(
            i18n.timestamp2datetime(t)), msg))
    return Yes == QMessageBox.question(
        _parent(), my.tr("Update user-contributed comments"), msg, Yes | No,
        No)
Exemplo n.º 8
0
def confirmDownloadGameVideos():
    """
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), my.tr("Download YouTube videos"),
        my.tr("Do you want to download all YouTube videos to your Desktop?"),
        Yes | No, No)
Exemplo n.º 9
0
def confirmExportCsv():
    """
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), my.tr("Export Excel CSV"),
        my.tr("Do you want to export the data into an Excel CSV file?"),
        Yes | No, No)
Exemplo n.º 10
0
def confirmRemoveDictionary(name):  # unicode
    """
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), my.tr("Remove dictionary"),
        my.tr("""Do you want to remove the {0} dictionary?
You can reinstall it later if you want.""").format(name), Yes | No, No)
Exemplo n.º 11
0
def confirmQuit():
    """
  @return  bool
  """
    #_speak(u"終了しますか?")
    return Yes == QMessageBox.question(
        _parent(), mytr_("Visual Novel Reader"),
        my.tr("Quit {0}?").format(mytr_("Visual Novel Reader")), Yes | No, No)
Exemplo n.º 12
0
def confirmQuit():
    """
  @return  bool
  """
    from PySide.QtCore import QCoreApplication
    appName = QCoreApplication.instance().applicationName()
    return Yes == QMessageBox.question(_parent(), appName,
                                       my.tr("Quit {0}?").format(appName),
                                       Yes | No, No)
Exemplo n.º 13
0
Arquivo: main.py Projeto: ypypjay/vnr
 def confirmQuit(self):
     from Qt5.QtWidgets import QMessageBox
     yes = QMessageBox.Yes
     no = QMessageBox.No
     sel = QMessageBox.question(self.__d.rootWindow,
                                self.tr("Visual Novel Reader"),
                                self.tr("Quit the wizard?"), yes | no, no)
     if sel == yes:
         self.quit()
Exemplo n.º 14
0
def confirmRemoveApploc():
    """
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), my.tr("Remove AppLocale"),
        my.tr("""Do you want to remove AppLocale?
It requires Internet access and might take a couple of minutes.
You can reinstall it later if you have Internet access."""), Yes | No, No)
Exemplo n.º 15
0
 def confirmQuit(self):
     from Qt5.QtWidgets import QMessageBox
     yes = QMessageBox.Yes
     no = QMessageBox.No
     sel = QMessageBox.question(self.__d.rootWindow, u"Website Reader",
                                i18n.tr("Quit the Website Reader?"),
                                yes | no, no)
     if sel == yes:
         self.quit()
Exemplo n.º 16
0
def confirmStretchGameWindow():
    """
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), my.tr("Switch to full screen"),
        my.tr("""Do you want to stretch the game window to full screen?
You can click the same button again to switch back.

Note: This function does not work well for all games ><"""), Yes | No, No)
Exemplo n.º 17
0
def confirmDuplicateEntry():
    """
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), my.tr("Clone entry"),
        my.tr("""Do you want to clone other people's entry?
The entry has already been enabled even without you cloning it.
Instead, cloning will result in duplicate entries that makes it more difficult to manage."""
              ), Yes | No, No)
Exemplo n.º 18
0
def confirmDownloadFont(name):  # unicode
    """
  @return  bool
  """
    location = "Caches/Fonts"
    return Yes == QMessageBox.question(
        _parent(), my.tr("Download font"),
        my.tr("""Do you want to download the {0}?
It requires Internet access and might take a couple of minutes.
The font will be installed to {1}.""").format(name, location), Yes | No, No)
Exemplo n.º 19
0
def confirmCompileDictionary(name):  # unicode
    """
  @return  bool
  """
    location = "Caches/Dictionaries"
    return Yes == QMessageBox.question(
        _parent(), my.tr("Compile dictionary"),
        my.tr("""Do you want to compile the {0} dictionary?
It does not require Internet access and might take a couple of seconds.
The dictionary will be installed to {1}.""").format(name, location), Yes | No,
        No)
Exemplo n.º 20
0
def confirmKeepSpace():
    """
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), "%s: %s" % (tr_("Warning"), my.tr("Insert spaces")),
        my.tr("""Are you sure to preserve spaces in the game text?
This might be useful for English games.

WARNING:
This might result in redundant spaces for Japanese games."""), Yes | No, No)
Exemplo n.º 21
0
def confirmDeleteGame(game):
    """
  @param  game  dataman.GameObject
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), mytr_("Visual Novel Reader"), "\n".join((
            my.tr("Remove this game from the dashboard?"),
            "",
            tr_("Name") + ": " + game.name,
            tr_("Location") + ": " + game.path,
        )), Yes | No, No)
Exemplo n.º 22
0
def confirmDeleteHookCode():
    """
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), my.tr("Remove Game-specific Hook Code"),
        my.tr("""Do you want to delete the hook code for this game?
It is recommended that you have the Internet access now, so that VNR will delete the hook code from the online database as well.

But other users might revert your deletion later.
If the hook code appear here again, please delete it here again."""), Yes | No,
        No)
Exemplo n.º 23
0
def confirmDeleteComment(comment):
    """
  @param  dataman.Comment
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), my.tr("Confirm deletion"), "\n".join((
            my.tr("Do you want to permanently delete this entry?"),
            "",
            tr_("Text") + ": " + comment.text,
            tr_("Context") + ": " + comment.context,
        )), Yes | No, No)
Exemplo n.º 24
0
def confirmDeleteCharacter(c):
    """
  @param  dataman.Character
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), my.tr("Confirm deletion"), "\n".join((
            my.tr("Do you want to permanently delete this entry?"),
            "",
            tr_("Name") + ": " + (c.name or tr_("Aside")),
            tr_("Gender") + ": " + i18n.gender_name(c.gender),
        )), Yes | No, No)
Exemplo n.º 25
0
def confirmBlockLanguage(lang):
    """
  @param  lang  str
  @return  bool
  """
    lang = i18n.language_name(lang)
    return Yes == QMessageBox.question(
        _parent(), my.tr("Block user language"),
        my.tr("""Are you sure to block {0}?
It is the same as your current user language.
If yes, VNR will block all settings for this language.""").format(lang),
        Yes | No, No)
Exemplo n.º 26
0
def confirmDeleteTerm(term):
    """
  @param  dataman.Term
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), my.tr("Confirm deletion"), "\n".join((
            my.tr("Do you want to permanently delete this entry?"),
            "",
            tr_("Pattern") + ": " + term.pattern,
            tr_("Text") + ": " + term.text,
        )), Yes | No, No)
Exemplo n.º 27
0
def confirmDeleteRef(ref):
    """
  @param  dataman.Reference
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), my.tr("Confirm deletion"), "\n".join((
            my.tr("Do you want to permanently delete this entry?"),
            "",
            tr_("Title") + ": " + ref.title,
            tr_("Release date") + ": " + i18n.timestamp2date(ref.date),
        )), Yes | No, No)
Exemplo n.º 28
0
def confirmRestart():
    """
  @return  bool
  """
    #_speak(u"再起動しますか?")
    return Yes == QMessageBox.question(
        _parent(), mytr_("Visual Novel Reader"), '\n'.join((
            my.tr("Restart {0}?").format(mytr_("Visual Novel Reader")),
            "",
            my.
            tr("If VNR is taking too much memory, restarting it might help reduce its memory usage."
               ),
        )), Yes | No, No)
Exemplo n.º 29
0
def confirmDownloadApploc():
    """
  @return  bool
  """
    from sakurakit import skpaths
    location = skpaths.WINDIR + r"\AppPatch"
    return Yes == QMessageBox.question(
        _parent(), my.tr("Install Microsoft AppLocale"),
        my.
        tr("""Do you want to install the @piaip version of Microsoft AppLocale?
It requires Internet access and might take a couple of minutes.
The program will be installed to {0}.
There is no way to change the installation location.
VNR can also uninstall it later if you want.""").format(location), Yes | No,
        No)
Exemplo n.º 30
0
def confirmKeepThreads():
    """
  @return  bool
  """
    return Yes == QMessageBox.question(
        _parent(), "%s: %s" % (tr_("Warning"), my.tr("Keep all text threads")),
        my.tr("""Are you sure to keep all scenario text threads?
You might NOT want to enable this unless the ADDRESS OF TEXT
(the gray the number) varies each time you launch the game!

WARNING:
For example, if there are several threads marked as KiriKiri,
when you turn this option on, VNR will translate ALL KIRIKIRI TEXTS.
This will result in LARGE AMOUNT OF GARBAGE, which is NOT what you want!"""),
        Yes | No, No)