src/eric7/Network/IRC/IrcChannelWidget.py

branch
eric7
changeset 9413
80c06d472826
parent 9221
bf71ee032bb4
child 9473
3f23dbf37dbe
--- a/src/eric7/Network/IRC/IrcChannelWidget.py	Tue Oct 18 16:05:20 2022 +0200
+++ b/src/eric7/Network/IRC/IrcChannelWidget.py	Tue Oct 18 16:06:21 2022 +0200
@@ -31,18 +31,17 @@
     QLineEdit,
 )
 
-from EricWidgets import EricMessageBox, EricFileDialog
-from EricWidgets.EricApplication import ericApp
+from eric7.EricWidgets import EricMessageBox, EricFileDialog
+from eric7.EricWidgets.EricApplication import ericApp
 
 from .Ui_IrcChannelWidget import Ui_IrcChannelWidget
 
 from .IrcUtilities import ircFilter, ircTimestamp, getChannelModesDict
 
-import Utilities
-import UI.PixmapCache
-import Preferences
+from eric7.EricGui import EricPixmapCache
+from eric7 import Preferences, Utilities
 
-from UI.Info import Version, Copyright
+from eric7.UI.Info import Version, Copyright
 
 
 class IrcUserItem(QListWidgetItem):
@@ -140,17 +139,17 @@
         """
         # step 1: determine the icon
         if self.__privilege & IrcUserItem.Voice:
-            icon = UI.PixmapCache.getIcon("ircVoice")
+            icon = EricPixmapCache.getIcon("ircVoice")
         elif self.__privilege & IrcUserItem.Owner:
-            icon = UI.PixmapCache.getIcon("ircOwner")
+            icon = EricPixmapCache.getIcon("ircOwner")
         elif self.__privilege & IrcUserItem.Operator:
-            icon = UI.PixmapCache.getIcon("ircOp")
+            icon = EricPixmapCache.getIcon("ircOp")
         elif self.__privilege & IrcUserItem.Halfop:
-            icon = UI.PixmapCache.getIcon("ircHalfop")
+            icon = EricPixmapCache.getIcon("ircHalfop")
         elif self.__privilege & IrcUserItem.Admin:
-            icon = UI.PixmapCache.getIcon("ircAdmin")
+            icon = EricPixmapCache.getIcon("ircAdmin")
         else:
-            icon = UI.PixmapCache.getIcon("ircNormal")
+            icon = EricPixmapCache.getIcon("ircNormal")
         if self.__privilege & IrcUserItem.Away:
             icon = self.__awayIcon(icon)
 
@@ -165,7 +164,7 @@
         @return away icon (QIcon)
         """
         pix1 = icon.pixmap(16, 16)
-        pix2 = UI.PixmapCache.getPixmap("ircAway")
+        pix2 = EricPixmapCache.getPixmap("ircAway")
         painter = QPainter(pix1)
         painter.drawPixmap(0, 0, pix2)
         painter.end()
@@ -273,7 +272,7 @@
         self.__ui = ericApp().getObject("UserInterface")
         self.__ircWidget = parent
 
-        self.editTopicButton.setIcon(UI.PixmapCache.getIcon("ircEditTopic"))
+        self.editTopicButton.setIcon(EricPixmapCache.getIcon("ircEditTopic"))
         self.editTopicButton.hide()
 
         height = self.usersList.height() + self.messages.height()
@@ -710,14 +709,14 @@
         if Preferences.getIrc("ShowNotifications"):
             if Preferences.getIrc("NotifyMessage"):
                 self.__ui.showNotification(
-                    UI.PixmapCache.getPixmap("irc48"), self.tr("Channel Message"), msg
+                    EricPixmapCache.getPixmap("irc48"), self.tr("Channel Message"), msg
                 )
             elif (
                 Preferences.getIrc("NotifyNick")
                 and self.__userName.lower() in msg.lower()
             ):
                 self.__ui.showNotification(
-                    UI.PixmapCache.getPixmap("irc48"), self.tr("Nick mentioned"), msg
+                    EricPixmapCache.getPixmap("irc48"), self.tr("Nick mentioned"), msg
                 )
 
     def addUsers(self, users):
@@ -754,7 +753,7 @@
                 "NotifyJoinPart"
             ):
                 self.__ui.showNotification(
-                    UI.PixmapCache.getPixmap("irc48"), self.tr("Join Channel"), msg
+                    EricPixmapCache.getPixmap("irc48"), self.tr("Join Channel"), msg
                 )
             return True
 
@@ -787,7 +786,7 @@
                 "NotifyJoinPart"
             ):
                 self.__ui.showNotification(
-                    UI.PixmapCache.getPixmap("irc48"), self.tr("Leave Channel"), nmsg
+                    EricPixmapCache.getPixmap("irc48"), self.tr("Leave Channel"), nmsg
                 )
             return True
 
@@ -816,7 +815,7 @@
                 "NotifyJoinPart"
             ):
                 self.__ui.showNotification(
-                    UI.PixmapCache.getPixmap("irc48"), self.tr("Quit"), msg
+                    EricPixmapCache.getPixmap("irc48"), self.tr("Quit"), msg
                 )
 
         # always return False for other channels and server to process
@@ -1460,24 +1459,28 @@
         """
         self.__messagesMenu = QMenu(self)
         self.__copyMessagesAct = self.__messagesMenu.addAction(
-            UI.PixmapCache.getIcon("editCopy"), self.tr("Copy"), self.__copyMessages
+            EricPixmapCache.getIcon("editCopy"), self.tr("Copy"), self.__copyMessages
         )
         self.__messagesMenu.addSeparator()
         self.__cutAllMessagesAct = self.__messagesMenu.addAction(
-            UI.PixmapCache.getIcon("editCut"), self.tr("Cut all"), self.__cutAllMessages
+            EricPixmapCache.getIcon("editCut"),
+            self.tr("Cut all"),
+            self.__cutAllMessages,
         )
         self.__copyAllMessagesAct = self.__messagesMenu.addAction(
-            UI.PixmapCache.getIcon("editCopy"),
+            EricPixmapCache.getIcon("editCopy"),
             self.tr("Copy all"),
             self.__copyAllMessages,
         )
         self.__messagesMenu.addSeparator()
         self.__clearMessagesAct = self.__messagesMenu.addAction(
-            UI.PixmapCache.getIcon("editDelete"), self.tr("Clear"), self.__clearMessages
+            EricPixmapCache.getIcon("editDelete"),
+            self.tr("Clear"),
+            self.__clearMessages,
         )
         self.__messagesMenu.addSeparator()
         self.__saveMessagesAct = self.__messagesMenu.addAction(
-            UI.PixmapCache.getIcon("fileSave"), self.tr("Save"), self.__saveMessages
+            EricPixmapCache.getIcon("fileSave"), self.tr("Save"), self.__saveMessages
         )
         self.__messagesMenu.addSeparator()
         self.__setMarkerMessagesAct = self.__messagesMenu.addAction(
@@ -1532,7 +1535,7 @@
         """
         Private slot to send a private message to a specific user.
         """
-        from EricWidgets import EricTextInputDialog
+        from eric7.EricWidgets import EricTextInputDialog
 
         user = self.usersList.selectedItems()[0].text()
         ok, message = EricTextInputDialog.getText(
@@ -1548,7 +1551,7 @@
         """
         Private slot to send a query message to a specific user.
         """
-        from EricWidgets import EricTextInputDialog
+        from eric7.EricWidgets import EricTextInputDialog
 
         user = self.usersList.selectedItems()[0].text()
         ok, message = EricTextInputDialog.getText(
@@ -1564,7 +1567,7 @@
         """
         Private slot to send a notice message to a specific user.
         """
-        from EricWidgets import EricTextInputDialog
+        from eric7.EricWidgets import EricTextInputDialog
 
         user = self.usersList.selectedItems()[0].text()
         ok, message = EricTextInputDialog.getText(

eric ide

mercurial