Preferences/ConfigurationPages/IrcPage.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3010
befeff46ec0f
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
35 self.dateFormatCombo.addItems(IrcPage.DateFormats) 35 self.dateFormatCombo.addItems(IrcPage.DateFormats)
36 36
37 # set initial values 37 # set initial values
38 # timestamps 38 # timestamps
39 self.timestampGroup.setChecked(Preferences.getIrc("ShowTimestamps")) 39 self.timestampGroup.setChecked(Preferences.getIrc("ShowTimestamps"))
40 self.showDateCheckBox.setChecked(Preferences.getIrc("TimestampIncludeDate")) 40 self.showDateCheckBox.setChecked(
41 Preferences.getIrc("TimestampIncludeDate"))
41 self.timeFormatCombo.setCurrentIndex( 42 self.timeFormatCombo.setCurrentIndex(
42 self.timeFormatCombo.findText(Preferences.getIrc("TimeFormat"))) 43 self.timeFormatCombo.findText(Preferences.getIrc("TimeFormat")))
43 self.dateFormatCombo.setCurrentIndex( 44 self.dateFormatCombo.setCurrentIndex(
44 self.dateFormatCombo.findText(Preferences.getIrc("DateFormat"))) 45 self.dateFormatCombo.findText(Preferences.getIrc("DateFormat")))
45 46
66 Preferences.getIrc, byName=True) 67 Preferences.getIrc, byName=True)
67 self.initColour("ChannelInfoColour", self.infoButton, 68 self.initColour("ChannelInfoColour", self.infoButton,
68 Preferences.getIrc, byName=True) 69 Preferences.getIrc, byName=True)
69 70
70 # notifications 71 # notifications
71 self.notificationsGroup.setChecked(Preferences.getIrc("ShowNotifications")) 72 self.notificationsGroup.setChecked(
73 Preferences.getIrc("ShowNotifications"))
72 self.joinLeaveCheckBox.setChecked(Preferences.getIrc("NotifyJoinPart")) 74 self.joinLeaveCheckBox.setChecked(Preferences.getIrc("NotifyJoinPart"))
73 self.messageCheckBox.setChecked(Preferences.getIrc("NotifyMessage")) 75 self.messageCheckBox.setChecked(Preferences.getIrc("NotifyMessage"))
74 self.ownNickCheckBox.setChecked(Preferences.getIrc("NotifyNick")) 76 self.ownNickCheckBox.setChecked(Preferences.getIrc("NotifyNick"))
75 77
76 # IRC text colors 78 # IRC text colors
108 Preferences.getIrc, byName=True) 110 Preferences.getIrc, byName=True)
109 111
110 # Automatic User Information Lookup 112 # Automatic User Information Lookup
111 self.whoGroup.setChecked(Preferences.getIrc("AutoUserInfoLookup")) 113 self.whoGroup.setChecked(Preferences.getIrc("AutoUserInfoLookup"))
112 self.whoUsersSpinBox.setValue(Preferences.getIrc("AutoUserInfoMax")) 114 self.whoUsersSpinBox.setValue(Preferences.getIrc("AutoUserInfoMax"))
113 self.whoIntervalSpinBox.setValue(Preferences.getIrc("AutoUserInfoInterval")) 115 self.whoIntervalSpinBox.setValue(
116 Preferences.getIrc("AutoUserInfoInterval"))
114 117
115 # Markers 118 # Markers
116 self.markWhenHiddenCheckBox.setChecked( 119 self.markWhenHiddenCheckBox.setChecked(
117 Preferences.getIrc("MarkPositionWhenHidden")) 120 Preferences.getIrc("MarkPositionWhenHidden"))
118 self.initColour("MarkerLineForegroundColour", self.markerForegroundButton, 121 self.initColour("MarkerLineForegroundColour",
122 self.markerForegroundButton,
119 Preferences.getIrc, byName=True) 123 Preferences.getIrc, byName=True)
120 self.initColour("MarkerLineBackgroundColour", self.markerBackgroundButton, 124 self.initColour("MarkerLineBackgroundColour",
125 self.markerBackgroundButton,
121 Preferences.getIrc, byName=True) 126 Preferences.getIrc, byName=True)
122 127
123 # Shutdown 128 # Shutdown
124 self.confirmShutdownCheckBox.setChecked( 129 self.confirmShutdownCheckBox.setChecked(
125 Preferences.getIrc("AskOnShutdown")) 130 Preferences.getIrc("AskOnShutdown"))
128 """ 133 """
129 Public slot to save the IRC configuration. 134 Public slot to save the IRC configuration.
130 """ 135 """
131 # timestamps 136 # timestamps
132 Preferences.setIrc("ShowTimestamps", self.timestampGroup.isChecked()) 137 Preferences.setIrc("ShowTimestamps", self.timestampGroup.isChecked())
133 Preferences.setIrc("TimestampIncludeDate", self.showDateCheckBox.isChecked()) 138 Preferences.setIrc(
139 "TimestampIncludeDate", self.showDateCheckBox.isChecked())
134 Preferences.setIrc("TimeFormat", self.timeFormatCombo.currentText()) 140 Preferences.setIrc("TimeFormat", self.timeFormatCombo.currentText())
135 Preferences.setIrc("DateFormat", self.dateFormatCombo.currentText()) 141 Preferences.setIrc("DateFormat", self.dateFormatCombo.currentText())
136 142
137 # notifications 143 # notifications
138 Preferences.setIrc("ShowNotifications", self.notificationsGroup.isChecked()) 144 Preferences.setIrc(
139 Preferences.setIrc("NotifyJoinPart", self.joinLeaveCheckBox.isChecked()) 145 "ShowNotifications", self.notificationsGroup.isChecked())
146 Preferences.setIrc(
147 "NotifyJoinPart", self.joinLeaveCheckBox.isChecked())
140 Preferences.setIrc("NotifyMessage", self.messageCheckBox.isChecked()) 148 Preferences.setIrc("NotifyMessage", self.messageCheckBox.isChecked())
141 Preferences.setIrc("NotifyNick", self.ownNickCheckBox.isChecked()) 149 Preferences.setIrc("NotifyNick", self.ownNickCheckBox.isChecked())
142 150
143 # Automatic User Information Lookup 151 # Automatic User Information Lookup
144 Preferences.setIrc("AutoUserInfoLookup", self.whoGroup.isChecked()) 152 Preferences.setIrc("AutoUserInfoLookup", self.whoGroup.isChecked())
145 Preferences.setIrc("AutoUserInfoMax", self.whoUsersSpinBox.value()) 153 Preferences.setIrc("AutoUserInfoMax", self.whoUsersSpinBox.value())
146 Preferences.setIrc("AutoUserInfoInterval", self.whoIntervalSpinBox.value()) 154 Preferences.setIrc(
155 "AutoUserInfoInterval", self.whoIntervalSpinBox.value())
147 156
148 # Markers 157 # Markers
149 Preferences.setIrc("MarkPositionWhenHidden", 158 Preferences.setIrc("MarkPositionWhenHidden",
150 self.markWhenHiddenCheckBox.isChecked()) 159 self.markWhenHiddenCheckBox.isChecked())
151 160
152 # Shutdown 161 # Shutdown
153 Preferences.setIrc("AskOnShutdown", self.confirmShutdownCheckBox.isChecked()) 162 Preferences.setIrc(
163 "AskOnShutdown", self.confirmShutdownCheckBox.isChecked())
154 164
155 # colours 165 # colours
156 self.saveColours(Preferences.setIrc) 166 self.saveColours(Preferences.setIrc)
157 167
158 168
159 def create(dlg): 169 def create(dlg):
160 """ 170 """
161 Module function to create the configuration page. 171 Module function to create the configuration page.
162 172
163 @param dlg reference to the configuration dialog 173 @param dlg reference to the configuration dialog
174 @return reference to the instantiated page (ConfigurationPageBase)
164 """ 175 """
165 page = IrcPage() 176 page = IrcPage()
166 return page 177 return page

eric ide

mercurial