MCPcopy Create free account
hub / github.com/dannagle/PacketSender / init

Method init

src/persistentconnection.cpp:178–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176
177
178void PersistentConnection::init()
179{
180
181 this->thread = nullptr;
182 QString tcpOrSSL = "TCP";
183 if (sendPacket.isSSL()) {
184 tcpOrSSL = "SSL";
185 }
186 if(sendPacket.isDTLS()){
187 tcpOrSSL = "DTLS";
188 }
189 QDEBUGVAR(tcpOrSSL);
190 setWindowTitle(tcpOrSSL + "://" + sendPacket.toIP + ":" + QString::number(sendPacket.port));
191
192
193 reSendPacket.clear();
194 if (sendPacket.repeat > 0) {
195 QDEBUG() << "This packet is repeating";
196 reSendPacket = sendPacket;
197 } else {
198
199 ui->stopResendingButton->hide();
200 }
201
202
203 QApplication::processEvents();
204
205
206 QSettings settings(SETTINGSFILE, QSettings::IniFormat);
207 bool appendCR = settings.value("appendCRcheck", true).toBool();
208 ui->appendCRcheck->setChecked(appendCR);
209
210 this->darkMode = Settings::useDark();
211
212
213 ui->stopResendingButton->setStyleSheet(PersistentConnection::RESEND_BUTTON_STYLE);
214 ui->stopResendingButton->setFlat(true);
215 ui->stopResendingButton->setCursor(Qt::PointingHandCursor);
216 ui->stopResendingButton->setIcon(QIcon(PSLOGO));
217
218 connect(ui->stopResendingButton, &QPushButton::clicked, this, &PersistentConnection::cancelResends);
219
220}
221
222
223void PersistentConnection::cancelResends()

Callers

nothing calls this directly

Calls 4

isSSLMethod · 0.80
isDTLSMethod · 0.80
setIconMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected