void SCTPChunkStatisticsDialog::on_actionChunkTypePreferences_triggered() { gchar* err = NULL; pref_t *pref = prefs_find_preference(prefs_find_module("sctp"),"statistics_chunk_types"); if (!pref) { g_log(NULL, G_LOG_LEVEL_ERROR, "Can't find preference sctp/statistics_chunk_types"); return; } uat_t *uat = prefs_get_uat_value(pref); uat_clear(uat); if (!uat_load(uat, &err)) { /* XXX - report this through the GUI */ g_log(NULL, G_LOG_LEVEL_WARNING, "Error loading table '%s': %s", uat->name, err); g_free(err); } UatDialog *uatdialog = new UatDialog(this, uat); uatdialog->exec(); // Emitting PacketDissectionChanged directly from a QDialog can cause // problems on macOS. wsApp->flushAppSignals(); ui->tableWidget->clear(); ui->tableWidget->setRowCount(0); ui->tableWidget->setHorizontalHeaderItem(0, new QTableWidgetItem(QString(tr("Association")))); ui->tableWidget->setHorizontalHeaderItem(1, new QTableWidgetItem(QString(tr("Endpoint 1")))); ui->tableWidget->setHorizontalHeaderItem(2, new QTableWidgetItem(QString(tr("Endpoint 2")))); fillTable(); }
void SCTPChunkStatisticsDialog::on_actionChunkTypePreferences_triggered() { const gchar* err = NULL; pref_t *pref = prefs_find_preference(prefs_find_module("sctp"),"statistics_chunk_types"); uat_t *uat = pref->varp.uat; uat_clear(uat); uat_load(pref->varp.uat, &err); if (err) { printf("Error loading table '%s': %s",pref->varp.uat->name,err); } UatDialog *uatdialog = new UatDialog(this, pref->varp.uat); uatdialog->exec(); ui->tableWidget->clear(); ui->tableWidget->setRowCount(0); ui->tableWidget->setHorizontalHeaderItem(0, new QTableWidgetItem(QString(tr("Association")))); ui->tableWidget->setHorizontalHeaderItem(1, new QTableWidgetItem(QString(tr("Endpoint 1")))); ui->tableWidget->setHorizontalHeaderItem(2, new QTableWidgetItem(QString(tr("Endpoint 2")))); fillTable(); }