src/eric7/Tools/TRPreviewer.py

branch
eric7
changeset 10431
64157aeb0312
parent 9695
ad962e9b904d
child 10439
21c28b0f9e41
--- a/src/eric7/Tools/TRPreviewer.py	Wed Dec 20 19:28:22 2023 +0100
+++ b/src/eric7/Tools/TRPreviewer.py	Thu Dec 21 12:03:40 2023 +0100
@@ -58,8 +58,11 @@
         Constructor
 
         @param filenames filenames of form and/or translation files to load
-        @param parent parent widget of this window (QWidget)
-        @param name name of this window (string)
+        @type list of str
+        @param parent parent widget of this window
+        @type QWidget
+        @param name name of this window
+        @type str
         """
         self.mainWidget = None
         self.currentFile = QDir.currentPath()
@@ -162,7 +165,8 @@
         """
         Protected event handler for the close event.
 
-        @param event close event (QCloseEvent)
+        @param event close event
+        @type QCloseEvent
         """
         if self.SAServer is not None:
             self.SAServer.shutdown()
@@ -478,8 +482,10 @@
         Constructor
 
         @param selector reference to the QComboBox used to show the
-            available languages (QComboBox)
-        @param parent parent widget (QWidget)
+            available languages
+        @type QComboBox
+        @param parent parent widget
+        @type QWidget
         """
         super().__init__(parent)
 
@@ -495,9 +501,11 @@
         If the translation file (*.qm) has not been loaded yet, it will
         be loaded automatically.
 
-        @param fileName name of the translation file to be added (string)
+        @param fileName name of the translation file to be added
+        @type str
         @param setTranslation flag indicating, if this should be set as
-            the active translation (boolean)
+            the active translation
+        @type bool
         """
         if not self.__haveFileName(fileName):
             ntr = Translation()
@@ -529,7 +537,8 @@
         """
         Public slot to set a translator by name.
 
-        @param name name (language) of the translator to set (string)
+        @param name name (language) of the translator to set
+        @type str
         """
         nTranslator = None
 
@@ -592,8 +601,10 @@
         """
         Private method to find a translation by file name.
 
-        @param transFileName file name of the translation file (string)
+        @param transFileName file name of the translation file
+        @type str
         @return reference to a translation object or None
+        @rtype QTranslator
         """
         for trans in self.translations:
             if trans.fileName == transFileName:
@@ -604,8 +615,10 @@
         """
         Private method to find a translation by name.
 
-        @param name name (language) of the translation (string)
+        @param name name (language) of the translation
+        @type str
         @return reference to a translation object or None
+        @rtype QTranslator
         """
         for trans in self.translations:
             if trans.name == name:
@@ -616,8 +629,10 @@
         """
         Private method to check for the presence of a translation.
 
-        @param transFileName file name of the translation file (string)
-        @return flag indicating the presence of the translation (boolean)
+        @param transFileName file name of the translation file
+        @type str
+        @return flag indicating the presence of the translation
+        @rtype bool
         """
         return self.__findFileName(transFileName) is not None
 
@@ -625,8 +640,10 @@
         """
         Private method to check for the presence of a named translation.
 
-        @param name name (language) of the translation (string)
-        @return flag indicating the presence of the translation (boolean)
+        @param name name (language) of the translation
+        @type str
+        @return flag indicating the presence of the translation
+        @rtype bool
         """
         return self.__findName(name) is not None
 
@@ -634,8 +651,10 @@
         """
         Private method to generate a unique name.
 
-        @param transFileName file name of the translation file (string)
-        @return unique name (string or None)
+        @param transFileName file name of the translation file
+        @type str
+        @return unique name
+        @rtype str
         """
         name = os.path.basename(transFileName)
         if not name:
@@ -654,7 +673,8 @@
         Private method to delete a translator from the list of available
         translators.
 
-        @param name name of the translator to delete (string)
+        @param name name of the translator to delete
+        @type str
         """
         if name == noTranslationName:
             return
@@ -673,8 +693,10 @@
         """
         Public slot to load a translation file.
 
-        @param transFileName file name of the translation file (string)
-        @return reference to the new translator object (QTranslator)
+        @param transFileName file name of the translation file
+        @type str
+        @return reference to the new translator object
+        @rtype QTranslator
         """
         tr = QTranslator()
         if tr.load(transFileName):
@@ -693,7 +715,8 @@
         """
         Public method to check for loaded translations.
 
-        @return flag signaling if any translation was loaded (boolean)
+        @return flag signaling if any translation was loaded
+        @rtype bool
         """
         return len(self.translations) > 0
 
@@ -707,9 +730,12 @@
         """
         Constructor
 
-        @param uiFileName name of the UI file to load (string)
-        @param parent parent widget (QWidget)
-        @param name name of this widget (string)
+        @param uiFileName name of the UI file to load
+        @type str
+        @param parent parent widget
+        @type QWidget
+        @param name name of this widget
+        @type str
         """
         super().__init__(parent)
         if name:
@@ -728,7 +754,8 @@
         """
         Public method to return the validity of this widget view.
 
-        @return flag indicating the validity (boolean)
+        @return flag indicating the validity
+        @rtype bool
         """
         return self.__valid
 
@@ -736,7 +763,8 @@
         """
         Public method to retrieve the name of the UI file.
 
-        @return filename of the loaded UI file (string)
+        @return filename of the loaded UI file
+        @rtype str
         """
         return self.__uiFileName
 
@@ -796,7 +824,8 @@
         """
         Constructor
 
-        @param parent parent widget (QWidget)
+        @param parent parent widget
+        @type QWidget
         """
         super().__init__(parent)
 
@@ -809,7 +838,8 @@
         """
         Public slot to load a UI file.
 
-        @param uiFileName name of the UI file to load (string)
+        @param uiFileName name of the UI file to load
+        @type str
         """
         wview = self.__findWidget(uiFileName)
         if wview is None:
@@ -849,9 +879,12 @@
         """
         Public method called to filter an event.
 
-        @param obj object, that generated the event (QObject)
-        @param ev the event, that was generated by object (QEvent)
+        @param obj object, that generated the event
+        @type QObject
+        @param ev the event, that was generated by object
+        @type QEvent
         @return flag indicating if event was filtered out
+        @rtype bool
         """
         if obj in self.widgets and ev.type() == QEvent.Type.Close:
             with contextlib.suppress(ValueError):
@@ -865,8 +898,10 @@
         """
         Private method to find a specific widget view.
 
-        @param uiFileName filename of the loaded UI file (string)
-        @return reference to the widget (WidgetView) or None
+        @param uiFileName filename of the loaded UI file
+        @type str
+        @return reference to the widget or None
+        @rtype WidgetView
         """
         wviewList = self.findChildren(WidgetView)
         if wviewList is None:
@@ -898,6 +933,7 @@
         Public method to set up the widgets part of the Window menu.
 
         @param windowMenu reference to the window menu
+        @type QMenu
         """
         for idx, wid in enumerate(self.widgets):
             act = windowMenu.addAction(wid.windowTitle())
@@ -909,7 +945,8 @@
         """
         Public method to handle the toggle of a window.
 
-        @param act reference to the action that triggered (QAction)
+        @param act reference to the action that triggered
+        @type QAction
         """
         idx = act.data()
         if idx is not None:
@@ -920,6 +957,7 @@
         Private method to toggle a workspace window.
 
         @param w window to be toggled
+        @type QWidget
         """
         if w.isHidden():
             w.show()
@@ -930,6 +968,7 @@
         """
         Public method to check for loaded widgets.
 
-        @return flag signaling if any widget was loaded (boolean)
+        @return flag signaling if any widget was loaded
+        @rtype bool
         """
         return len(self.widgets) > 0

eric ide

mercurial