Network/IRC/IrcNetworkManager.py

changeset 2992
dbdf27746da5
parent 2960
9453efa25fd5
child 3057
10516539f238
child 3160
209a07d7e401
equal deleted inserted replaced
2991:226481ff40d1 2992:dbdf27746da5
20 class IrcIdentity(object): 20 class IrcIdentity(object):
21 """ 21 """
22 Class implementing the IRC identity object. 22 Class implementing the IRC identity object.
23 """ 23 """
24 DefaultIdentityName = "0default" 24 DefaultIdentityName = "0default"
25 DefaultIdentityDisplay = QCoreApplication.translate("IrcIdentity", "Default Identity") 25 DefaultIdentityDisplay = QCoreApplication.translate(
26 26 "IrcIdentity", "Default Identity")
27 DefaultAwayMessage = QCoreApplication.translate("IrcIdentity", "Gone away for now.") 27
28 DefaultQuitMessage = QCoreApplication.translate("IrcIdentity", "IRC for eric5 IDE") 28 DefaultAwayMessage = QCoreApplication.translate(
29 DefaultPartMessage = QCoreApplication.translate("IrcIdentity", "IRC for eric5 IDE") 29 "IrcIdentity", "Gone away for now.")
30 DefaultQuitMessage = QCoreApplication.translate(
31 "IrcIdentity", "IRC for eric5 IDE")
32 DefaultPartMessage = QCoreApplication.translate(
33 "IrcIdentity", "IRC for eric5 IDE")
30 34
31 def __init__(self, name): 35 def __init__(self, name):
32 """ 36 """
33 Constructor 37 Constructor
34 38
150 """ 154 """
151 return self.__nickNames 155 return self.__nickNames
152 156
153 def setServiceName(self, name): 157 def setServiceName(self, name):
154 """ 158 """
155 Public method to set the service name of the identity used for identification. 159 Public method to set the service name of the identity used for
160 identification.
156 161
157 @param name service name (string) 162 @param name service name (string)
158 """ 163 """
159 self.__serviceName = name 164 self.__serviceName = name
160 165
161 def getServiceName(self): 166 def getServiceName(self):
162 """ 167 """
163 Public method to get the service name of the identity used for identification. 168 Public method to get the service name of the identity used for
169 identification.
164 170
165 @return service name (string) 171 @return service name (string)
166 """ 172 """
167 return self.__serviceName 173 return self.__serviceName
168 174
228 """ 234 """
229 self.__rememberPosOnAway = remember 235 self.__rememberPosOnAway = remember
230 236
231 def rememberAwayPosition(self): 237 def rememberAwayPosition(self):
232 """ 238 """
233 Public method to get a flag indicating to remember the chat position upon AWAY. 239 Public method to get a flag indicating to remember the chat position
240 upon AWAY.
234 241
235 @return flag indicating to remember the chat position (boolean) 242 @return flag indicating to remember the chat position (boolean)
236 """ 243 """
237 return self.__rememberPosOnAway 244 return self.__rememberPosOnAway
238 245
502 Public method to load the network data. 509 Public method to load the network data.
503 510
504 @param settings reference to the settings object (QSettings) 511 @param settings reference to the settings object (QSettings)
505 """ 512 """
506 self.__identity = settings.value("Identity", "") 513 self.__identity = settings.value("Identity", "")
507 self.__autoConnect = Preferences.toBool(settings.value("AutoConnect", False)) 514 self.__autoConnect = Preferences.toBool(
515 settings.value("AutoConnect", False))
508 516
509 settings.beginGroup("Server") 517 settings.beginGroup("Server")
510 self.__server = IrcServer("") 518 self.__server = IrcServer("")
511 self.__server.load(settings) 519 self.__server.load(settings)
512 settings.endGroup() 520 settings.endGroup()
653 """ 661 """
654 self.__autoConnect = enable 662 self.__autoConnect = enable
655 663
656 def autoConnect(self): 664 def autoConnect(self):
657 """ 665 """
658 Public method to check, if the network should be connected to at start-up. 666 Public method to check, if the network should be connected to at
667 start-up.
659 668
660 @return flag indicating an auto connect (boolean) 669 @return flag indicating an auto connect (boolean)
661 """ 670 """
662 return self.__autoConnect 671 return self.__autoConnect
663 672
664 @classmethod 673 @classmethod
665 def createDefaultNetwork(cls, ssl=False): 674 def createDefaultNetwork(cls, ssl=False):
666 """ 675 """
667 Class method to create the default network. 676 Class method to create the default network.
668 677
669 @param ssl flag indicating to create a SSL network configuration (boolean) 678 @param ssl flag indicating to create a SSL network configuration
679 (boolean)
670 @return default network object (IrcNetwork) 680 @return default network object (IrcNetwork)
671 """ 681 """
672 # network 682 # network
673 if ssl: 683 if ssl:
674 networkName = "Freenode (SSL)" 684 networkName = "Freenode (SSL)"
903 """ 913 """
904 Public method to delete the given identity. 914 Public method to delete the given identity.
905 915
906 @param name name of the identity to delete (string) 916 @param name name of the identity to delete (string)
907 """ 917 """
908 if name in self.__identities and name != IrcIdentity.DefaultIdentityName: 918 if name in self.__identities and \
919 name != IrcIdentity.DefaultIdentityName:
909 del self.__identities[name] 920 del self.__identities[name]
910 self.identityChanged() 921 self.identityChanged()
911 922
912 def renameIdentity(self, oldName, newName): 923 def renameIdentity(self, oldName, newName):
913 """ 924 """

eric ide

mercurial