Esempio n. 1
0
 def __init__(self, parent=None):
   WINDOW_FLAGS = Qt.Dialog|Qt.WindowMinMaxButtonsHint
   super(SubtitleEditor, self).__init__(parent, WINDOW_FLAGS)
   skqss.class_(self, 'texture')
   self.setWindowTitle(mytr_("Subtitle Editor"))
   self.setWindowIcon(rc.icon('window-textedit'))
   self.__d = _SubtitleEditor(self)
Esempio n. 2
0
 def __init__(self, parent=None):
   WINDOW_FLAGS = Qt.Dialog|Qt.WindowMinMaxButtonsHint
   super(VirtualKeyInputDialog, self).__init__(parent, WINDOW_FLAGS)
   skqss.class_(self, 'texture')
   self.setWindowTitle(mytr_("Shortcuts"))
   self.setWindowIcon(rc.icon('window-shortcuts'))
   self.__d = _VirtualKeyInputDialog(self)
Esempio n. 3
0
  def __init__(self, parent=None):
    #WINDOW_FLAGS = (
    #  Qt.Window
    #  | Qt.CustomizeWindowHint
    #  | Qt.WindowTitleHint
    #  | Qt.WindowSystemMenuHint
    #  | Qt.WindowMinMaxButtonsHint
    #  | Qt.WindowCloseButtonHint
    #)
    super(MainWindow, self).__init__(parent)
    skqss.addclass(self, _MainWindow.styleClass())

    self.setStyleSheet(''.join(imap(rc.qss, config.QT_STYLESHEETS)))
    #self.setStyleSheet(rc.qss('browser'))

    self.setWindowTitle(u"Kagami (α)")
    self.setWindowIcon(rc.icon('logo-browser'))
    #ui.glassifyWidget(self)
    self.__d = _MainWindow(self)

    b = self.statusBar()
    b.setGraphicsEffect(ui.createGlowEffect(b))

    self.messageReceived.connect(self.showStatusMessage)
    #self.showStatusMessage(tr_("Ready"))
    self.statusBar().hide()
Esempio n. 4
0
    def showGame(self, gameId):
        if not gameId:
            growl.notify(
                my.tr("Unknown game. Please try updating the database."))
            return
        d = self.__d
        d.gameId = gameId

        import dataman
        dm = dataman.manager()

        name = self._getGameName(gameId)

        title = my.tr("Please select the game title")
        if name:
            title += " - " + name

        w = d.dialog
        w.setWindowTitle(title)

        icon = self._getGameIcon(gameId)
        w.setWindowIcon(icon or rc.icon('window-refinput'))
        if name:
            w.setDefaultText(name)
        d.showWindow(w)
Esempio n. 5
0
 def __init__(self, parent=None):
     WINDOW_FLAGS = Qt.Dialog | Qt.WindowMinMaxButtonsHint
     super(TopicInput, self).__init__(parent, WINDOW_FLAGS)
     skqss.class_(self, 'texture')
     self.setWindowTitle(mytr_("New Topic"))
     self.setWindowIcon(rc.icon('window-textedit'))
     self.__d = _TopicInput(self)
Esempio n. 6
0
  def showGame(self, tokenId=0, itemId=0, info=None):
    """
    @param* tokenId  long
    @param* itemId  long
    @param* info  GameInfo
    """
    if not info:
      import dataman
      info = dataman.manager().queryGameInfo(itemId=itemId, id=tokenId, cache=True)
      if info and not tokenId:
        tokenId = info.gameId

    if not info or not tokenId:
      growl.notify(my.tr("Unknown game"))
      return
    if not info.hasNames():
      growl.notify(my.tr("Game character names not found"))
      return

    w = self.__d.getDialog(tokenId)
    if w and w.isVisible() and w.tokenId() == tokenId:
      w.raise_()
    else:
      w.setGameName(info.title)
      w.setWindowIcon(info.icon or rc.icon('window-name'))
      w.setTokenId(tokenId)
      w.setNames(info.iterNameYomi())
      w.show()
Esempio n. 7
0
  def __init__(self, parent=None):
    WINDOW_FLAGS = Qt.Dialog|Qt.WindowMinMaxButtonsHint
    super(GameWizard, self).__init__(parent, WINDOW_FLAGS)
    self.setWindowIcon(rc.icon('window-gamewiz'))
    self.setWindowTitle(mytr_("Game Wizard"))
    #if features.WINE:
    #  self.setWizardStyle(QtWidgets.QWizard.MacStyle)

    self.__profile = GameProfile(self)

    PAGEID.INTRO = self.addPage(IntroPage(self))

    PAGEID.CHOOSE_MEANS = self.addPage(ChooseMeansPage(self))
    PAGEID.SELECT_WINDOW = self.addPage(SelectWindowPage(self))
    PAGEID.SELECT_PROCESS = self.addPage(SelectProcessPage(self))
    PAGEID.SELECT_FILE = self.addPage(SelectFilePage(self))
    PAGEID.CONFIRM_GAME = self.addPage(ConfirmGamePage(self))
    PAGEID.SYNC_GAME = self.addPage(SyncGamePage(self))
    PAGEID.SYNC_THREAD = self.addPage(SyncThreadPage(self))
    PAGEID.SELECT_THREAD = self.addPage(SelectThreadPage(self))

    PAGEID.FINAL = self.addPage(FinalPage(self))

    #self.setStartId(PAGEID.SELECT_THREAD)

    dprint("pass")
Esempio n. 8
0
 def setGame(self, game):
     """
 @param  game  dataman.GameObject
 """
     icon = game.icon() if game else None
     self.setWindowIcon(icon or rc.icon('window-subview'))
     root = self.rootObject()
     root.setProperty('game', game)
Esempio n. 9
0
  def __init__(self, parent=None):
    super(TrayIcon, self).__init__(parent)
    self.setIcon(rc.icon('logo-reader'))
    self.setToolTip(QCoreApplication.instance().applicationName())
    self.activated.connect(self.onActivated)

    self.__d = _TrayIcon(self)
    TrayIcon.instance = self
Esempio n. 10
0
 def __init__(self, parent=None):
     WINDOW_FLAGS = Qt.Dialog | Qt.WindowMinMaxButtonsHint
     super(UpdateDialog, self).__init__(parent, WINDOW_FLAGS)
     skqss.class_(self, 'texture')
     self.__d = _UpdateDialog(self)
     self.setWindowIcon(rc.icon('window-update'))
     self.setWindowTitle(tr_("Software Update"))
     self.resize(220, 120)
Esempio n. 11
0
    def __init__(self, parent=None, f=0):
        super(_Window, self).__init__(parent, f)
        self.__canClose = False
        self.setWindowIcon(rc.icon('logo-reader'))
        self.setWindowTitle(QCoreApplication.instance().applicationName())
        self.showNothing()

        self.setStyleSheet(''.join(imap(rc.qss, config.QT_STYLESHEETS)))
Esempio n. 12
0
 def __init__(self, parent=None):
     super(VoiceView, self).__init__(
         rc.qml_url('voiceview'),
         parent,
         imageProviders=((qmlrc.ResourceImageProvider.PROVIDER_ID,
                          qmlrc.ResourceImageProvider()), ))
     self.setWindowIcon(rc.icon('window-voice'))
     dprint("pass")
Esempio n. 13
0
 def __init__(self, parent=None):
     super(SubtitleMaker, self).__init__(
         rc.qml_url('submaker'),
         parent,
         imageProviders=((qmlrc.ResourceImageProvider.PROVIDER_ID,
                          qmlrc.ResourceImageProvider()), ))
     self.setWindowIcon(rc.icon('window-submaker'))
     SubtitleMaker.instance = self
     dprint("pass")
Esempio n. 14
0
 def __init__(self, parent=None):
   WINDOW_FLAGS = Qt.Dialog|Qt.WindowMinMaxButtonsHint
   super(NameInput, self).__init__(parent)
   self.setWindowFlags(WINDOW_FLAGS)
   skqss.class_(self, 'texture')
   self.setWindowTitle(my.tr("Create dictionary entry"))
   self.setWindowIcon(rc.icon('window-name'))
   self.setWidgetResizable(True) # automatically stretch widgets
   self.__d = _NameInput(self)
Esempio n. 15
0
 def setGameId(self, gameId):
     """
 @param  game  dataman.GameObject
 """
     import dataman
     icon = dataman.manager().queryGameIcon(id=gameId)
     self.setWindowIcon(icon or rc.icon('window-refview'))
     root = self.rootObject()
     root.setProperty('gameId', gameId)
Esempio n. 16
0
 def __init__(self, parent=None):
     WINDOW_FLAGS = Qt.Dialog | Qt.WindowMinMaxButtonsHint
     super(RegExpTester, self).__init__(parent, WINDOW_FLAGS)
     skqss.class_(self, 'texture')
     self.__d = _RegExpTester(self)
     self.setWindowTitle(mytr_("Test Regular Expression"))
     self.setWindowIcon(rc.icon('window-regexp'))
     self.resize(380, 350)
     dprint("pass")
Esempio n. 17
0
 def __init__(self, parent=None):
   WINDOW_FLAGS = Qt.Dialog|Qt.WindowMinMaxButtonsHint
   super(HookPrefsDialog, self).__init__(parent, WINDOW_FLAGS)
   skqss.class_(self, 'texture')
   self.setWindowTitle(my.tr("Edit Hook Code"))
   self.setWindowIcon(rc.icon('window-hookprefs'))
   #self.setModel(True)
   self.__d = _HookPrefsDialog(self)
   self.resize(450, 400)
Esempio n. 18
0
 def __init__(self, parent=None):
     WINDOW_FLAGS = Qt.Dialog | Qt.WindowMinMaxButtonsHint
     super(DictionaryTester, self).__init__(parent, WINDOW_FLAGS)
     skqss.class_(self, 'texture-inverse')
     self.setWindowTitle(mytr_("Japanese Dictionary"))
     self.setWindowIcon(rc.icon('window-jdict'))
     self.__d = _DictionaryTester(self)
     #self.__d.refresh()
     self.resize(400, 300)
Esempio n. 19
0
    def __init__(self, parent=None):
        WINDOW_FLAGS = Qt.Dialog | Qt.WindowMinMaxButtonsHint
        super(GameBoardDialog, self).__init__(parent, WINDOW_FLAGS)
        self.setWindowIcon(rc.icon('window-gameboard'))
        self.setWindowTitle(mytr_("Game Board"))
        self.__d = _GameBoardDialog(self)
        self.resize(765, 660)

        # Refresh only once
        self.__d.refresh()
Esempio n. 20
0
  def __init__(self, argv):
    super(Application, self).__init__(argv)

    self.setApplicationName(u"Website Reader")
    self.setApplicationVersion(str(config.VERSION_TIMESTAMP))
    self.setOrganizationName(config.VERSION_ORGANIZATION)
    self.setOrganizationDomain(config.VERSION_DOMAIN)
    self.setWindowIcon(rc.icon('logo-browser'))

    dprint("pass")
Esempio n. 21
0
 def __init__(self, parent=None):
     WINDOW_FLAGS = Qt.Dialog | Qt.WindowMinMaxButtonsHint
     super(BBCodeTester, self).__init__(parent)
     skqss.class_(self, 'texture')
     self.setWindowFlags(WINDOW_FLAGS)
     self.setWindowTitle(mytr_("Test BBCode"))
     self.setWindowIcon(rc.icon('window-bbcode'))
     self.__d = _BBCodeTester(self)
     self.setContentsMargins(9, 9, 9, 9)
     self.resize(400, 300)
     dprint("pass")
Esempio n. 22
0
 def __init__(self, parent=None):
     WINDOW_FLAGS = Qt.Dialog | Qt.WindowMinMaxButtonsHint
     super(MTTester, self).__init__(parent)
     skqss.class_(self, 'texture')
     self.setWindowFlags(WINDOW_FLAGS)
     self.setWindowTitle(mytr_("Test Machine Translation"))
     self.setWindowIcon(rc.icon('window-mttest'))
     self.__d = _MTTester(self)
     #self.setContentsMargins(9, 9, 9, 9)
     self.resize(800, 300)
     dprint("pass")
Esempio n. 23
0
 def __init__(self, parent=None):
     WINDOW_FLAGS = Qt.Dialog | Qt.WindowMinMaxButtonsHint
     super(SpeechRecognitionTester, self).__init__(parent)
     skqss.class_(self, 'texture')
     self.setWindowFlags(WINDOW_FLAGS)
     self.setWindowTitle(mytr_("Test Speech Recognition"))
     self.setWindowIcon(rc.icon('window-srtest'))
     self.__d = _SpeechRecognitionTester(self)
     #self.setContentsMargins(9, 9, 9, 9)
     self.resize(400, 200)
     dprint("pass")
Esempio n. 24
0
    def __init__(self, argv):
        super(Application, self).__init__(argv)

        self.setApplicationName(mytr_("Visual Novel Reader"))
        self.setApplicationVersion(str(config.VERSION_TIMESTAMP))
        self.setOrganizationName(config.VERSION_ORGANIZATION)
        self.setOrganizationDomain(config.VERSION_DOMAIN)
        self.setWindowIcon(rc.icon('logo-reader'))

        #if skos.WIN:
        #  ignoreWindowsExceptions()

        dprint("pass")
Esempio n. 25
0
        def __init__(self, parent=None):
            super(Window, self).__init__(parent)
            self.setWindowIcon(rc.icon('logo-youtube'))

            appName = QtWidgets.QApplication.instance().applicationName()
            self.setWindowTitle("%s (pre-alpha)" % appName)

            self.setStyleSheet(''.join(imap(rc.qss, (
                'bootstrap',
                'share',
            ))).replace('$PWD', config.root_abspath()))

            dprint("pass")
Esempio n. 26
0
    def __init__(self, parent=None):
        WINDOW_FLAGS = Qt.Dialog | Qt.WindowMinMaxButtonsHint
        super(TermInput, self).__init__(parent, WINDOW_FLAGS)
        skqss.class_(self, 'texture')
        self.setWindowTitle(my.tr("Create dictionary entry"))
        self.setWindowIcon(rc.icon('window-dict'))
        self.__d = _TermInput(self)
        #self.__d.autofill()
        #self.resize(300, 270)
        self.resize(280, 320)
        #self.statusBar() # show status bar

        import dataman
        dataman.manager().loginChanged.connect(
            lambda name: name or self.hide())
Esempio n. 27
0
    def __init__(self, parent=None):
        WINDOW_FLAGS = Qt.Dialog | Qt.WindowMinMaxButtonsHint
        super(PrefsDialog, self).__init__(Qt.Horizontal, parent)
        self.setWindowFlags(WINDOW_FLAGS)
        self.setWindowIcon(rc.icon('window-prefs'))
        self.setWindowTitle(tr_("Preferences"))
        self.setChildrenCollapsible(False)
        self.__d = _PrefsDialog(self)

        skqss.class_(self, 'texture')
        for i in xrange(self.count()):
            skqss.class_(self.widget(i), 'texture')

        self.resize(550,
                    555)  # large enough that there is no vertical scroll bar
        self.setSizes([170, 380])  # 170 + 380 = 550 (width)
        dprint("pass")
Esempio n. 28
0
  def __init__(self, parent=None):
    WINDOW_FLAGS = Qt.Window | Qt.WindowMinMaxButtonsHint
    super(AppWizard, self).__init__(parent, WINDOW_FLAGS)
    self.__d = _AppWizard(self)
    self.setStyleSheet(rc.qss('share'))

    self.setWindowIcon(rc.icon('logo-installer'))
    self.setWindowTitle(self.tr("Add or Remove Features"))
    #self.setWizardStyle(QtWidgets.QWizard.MacStyle)

    PAGEID.INTRO = self.addPage(IntroPage(self))

    PAGEID.SELECT = self.addPage(SelectPage(self))
    PAGEID.CONFIRM = self.addPage(ConfirmPage(self))

    PAGEID.FINAL = self.addPage(FinalPage(self))

    dprint("pass")
Esempio n. 29
0
    def __init__(self, parent=None):
        super(TermView, self).__init__(
            rc.qml_url('termview'),
            parent,
            imageProviders=((qmlrc.ResourceImageProvider.PROVIDER_ID,
                             qmlrc.ResourceImageProvider()), ))
        self.setWindowIcon(rc.icon('window-dict'))

        root = self.rootObject()

        ctx = 'termComet',
        for k in ctx:
            obj = root.findChild(QObject, k)
            assert obj
            setattr(self, k, obj)

        TermView.instance = self

        dprint("pass")
Esempio n. 30
0
  def setVisible(self, visible):
    """@reimp @public"""
    d = self.__d
    if visible:
      g = _gameprofile()
      icon = g.icon() if g else None
      if not icon or icon.isNull():
        icon = rc.icon('logo-reader')
      self.setWindowIcon(icon)

      title = "%s (%s)" % (
        mytr_("Text Settings"),
        my.tr("Engine: ITH"),
      )

      name = g.name() if g else None
      if name:
        title = "%s - %s" % (name, title)
      self.setWindowTitle(title)

    if visible:
      texthook.global_().hijackProcess()

    if visible != self.isVisible():
      if visible:
        d.clear()
        d.load()
        self.updateEnabled()
        skevents.runlater(self.updateSize)
      else:
        d.unload()

    texthook.global_().setWhitelistEnabled(not visible)

    d.setActive(visible)
    super(TextPrefsDialog, self).setVisible(visible)