src/eric7/MicroPython/WifiDialogs/WifiNetworksWindow.py

branch
mpy_network
changeset 9789
d8e0ab86ddca
parent 9781
3112f77f722b
child 9828
32c8a5b57332
equal deleted inserted replaced
9788:12294115900a 9789:d8e0ab86ddca
47 47
48 self.networkList.sortByColumn(0, Qt.SortOrder.AscendingOrder) 48 self.networkList.sortByColumn(0, Qt.SortOrder.AscendingOrder)
49 49
50 def scanNetworks(self): 50 def scanNetworks(self):
51 """ 51 """
52 Private method to ask the device for a network scan and display the result. 52 Public method to ask the device for a network scan and display the result.
53 """ 53 """
54 self.networkList.clear() 54 self.networkList.clear()
55 self.statusLabel.clear() 55 self.statusLabel.clear()
56 56
57 if not self.periodicCheckBox.isChecked(): 57 if not self.periodicCheckBox.isChecked():
65 EricMessageBox.warning( 65 EricMessageBox.warning(
66 self, 66 self,
67 self.tr("Scan WiFi Networks"), 67 self.tr("Scan WiFi Networks"),
68 self.tr( 68 self.tr(
69 """<p>The scan for available WiFi networks failed.</p>""" 69 """<p>The scan for available WiFi networks failed.</p>"""
70 """<p>Reason: {0}</p>"""), 70 """<p>Reason: {0}</p>"""
71 ),
71 ) 72 )
72 if self.periodicCheckBox.isChecked(): 73 if self.periodicCheckBox.isChecked():
73 self.periodicCheckBox.setChecked(False) 74 self.periodicCheckBox.setChecked(False)
74 75
75 else: 76 else:
82 [ 83 [
83 network[0], 84 network[0],
84 str(network[2]), 85 str(network[2]),
85 network[1], 86 network[1],
86 str(network[3]), 87 str(network[3]),
87 network[4] 88 network[4],
88 ], 89 ],
89 ) 90 )
90 itm.setTextAlignment(1, Qt.AlignmentFlag.AlignHCenter) 91 itm.setTextAlignment(1, Qt.AlignmentFlag.AlignHCenter)
91 itm.setTextAlignment(2, Qt.AlignmentFlag.AlignHCenter) 92 itm.setTextAlignment(2, Qt.AlignmentFlag.AlignHCenter)
92 itm.setTextAlignment(3, Qt.AlignmentFlag.AlignHCenter) 93 itm.setTextAlignment(3, Qt.AlignmentFlag.AlignHCenter)
112 ) 113 )
113 self.networkList.header().setStretchLastSection(True) 114 self.networkList.header().setStretchLastSection(True)
114 115
115 def closeEvent(self, evt): 116 def closeEvent(self, evt):
116 """ 117 """
117 Public method to handle a window close event. 118 Protected method to handle a window close event.
118 119
119 @param evt reference to the close event 120 @param evt reference to the close event
120 @type QCloseEvent 121 @type QCloseEvent
121 """ 122 """
122 self.__scanTimer.stop() 123 self.__scanTimer.stop()
143 144
144 @param interval periodic scan interval 145 @param interval periodic scan interval
145 @type int 146 @type int
146 """ 147 """
147 if self.periodicCheckBox.isChecked(): 148 if self.periodicCheckBox.isChecked():
148 self.__scanTimer.setInterval(interval* 1000) 149 self.__scanTimer.setInterval(interval * 1000)

eric ide

mercurial