Qt: Handle cancel in import coloring rules

Change-Id: I450cfc41d19c0dcb4aa59c0515d8d0834cfee60b
Reviewed-on: https://code.wireshark.org/review/20223
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Stig Bjørlykke 2017-02-21 13:18:55 +01:00
parent 4b722f2e51
commit 6814cf4fa7
1 changed files with 6 additions and 4 deletions

View File

@ -325,10 +325,12 @@ void ColoringRulesDialog::on_buttonBox_clicked(QAbstractButton *button)
if (button == import_button_) {
QString file_name = QFileDialog::getOpenFileName(this, wsApp->windowTitleString(tr("Import Coloring Rules")),
wsApp->lastOpenDir().path());
gchar* err_msg = NULL;
if (!color_filters_import(file_name.toUtf8().constData(), this, &err_msg, color_filter_add_cb)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
if (!file_name.isEmpty()) {
gchar* err_msg = NULL;
if (!color_filters_import(file_name.toUtf8().constData(), this, &err_msg, color_filter_add_cb)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
}
}
} else if (button == export_button_) {
int num_items = ui->coloringRulesTreeWidget->selectedItems().count();