eric6/Tools/TRPreviewer.py

changeset 8151
8c1445825e7b
parent 8143
2c730d5fd177
child 8207
d359172d11be
equal deleted inserted replaced
8150:fc1ae39af8c9 8151:8c1445825e7b
101 self.TRPreviewerLayout.addWidget(self.preview) 101 self.TRPreviewerLayout.addWidget(self.preview)
102 self.preview.lastWidgetClosed.connect(self.__updateActions) 102 self.preview.lastWidgetClosed.connect(self.__updateActions)
103 103
104 self.setCentralWidget(self.cw) 104 self.setCentralWidget(self.cw)
105 105
106 self.languageCombo.activated[str].connect(self.setTranslation) 106 self.languageCombo.activated[int].connect(self.__setTranslation)
107 107
108 self.translations = TranslationsDict(self.languageCombo, self) 108 self.translations = TranslationsDict(self.languageCombo, self)
109 self.translations.translationChanged.connect( 109 self.translations.translationChanged.connect(
110 self.preview.rebuildWidgets) 110 self.preview.rebuildWidgets)
111 111
401 self.translations.add(fileName, first) 401 self.translations.add(fileName, first)
402 first = False 402 first = False
403 403
404 self.__updateActions() 404 self.__updateActions()
405 405
406 def setTranslation(self, name): 406 def __setTranslation(self, index):
407 """ 407 """
408 Public slot to activate a translation. 408 Private slot to activate a translation.
409 409
410 @param name name (language) of the translation (string) 410 @param index index of the selected entry
411 """ 411 @type int
412 """
413 name = self.languageCombo.itemText(index)
412 self.translations.set(name) 414 self.translations.set(name)
413 415
414 def __showWindowMenu(self): 416 def __showWindowMenu(self):
415 """ 417 """
416 Private slot to handle the aboutToShow signal of the window menu. 418 Private slot to handle the aboutToShow signal of the window menu.

eric ide

mercurial