Esempio n. 1
0
int ProfileDialog::execAction(ProfileDialog::ProfileAction profile_action)
{
    int ret = QDialog::Accepted;
    QTreeWidgetItem *item;

    switch (profile_action) {
    case ShowProfiles:
        ret = exec();
        break;
    case NewProfile:
        on_newToolButton_clicked();
        ret = exec();
        break;
    case EditCurrentProfile:
        item = pd_ui_->profileTreeWidget->currentItem();
        if (item) {
            pd_ui_->profileTreeWidget->editItem(item, 0);
        }
        ret = exec();
        break;
    case DeleteCurrentProfile:
        if (delete_current_profile()) {
            wsApp->setConfigurationProfile (NULL);
        }
        break;
    default:
        g_assert_not_reached();
        break;
    }
    return ret;
}
Esempio n. 2
0
DecodeAsDialog::DecodeAsDialog(QWidget *parent, capture_file *cf, bool create_new) :
    QDialog(parent),
    ui(new Ui::DecodeAsDialog),
    cap_file_(cf),
    table_names_combo_box_(NULL),
    selector_combo_box_(NULL)
{
    ui->setupUi(this);
    setWindowTitle(wsApp->windowTitleString(tr("Decode As" UTF8_HORIZONTAL_ELLIPSIS)));
    ui->deleteToolButton->setEnabled(false);

    GList *cur;
    for (cur = decode_as_list; cur; cur = cur->next) {
        decode_as_t *entry = (decode_as_t *) cur->data;
        QString table_ui_name = get_dissector_table_ui_name(entry->table_name);
        if (!table_ui_name.isEmpty()) {
            ui_name_to_name_[table_ui_name] = entry->table_name;
        }
    }

    connect(wsApp, SIGNAL(preferencesChanged()), this, SLOT(fillTable()));
    fillTable();

    if (create_new) on_newToolButton_clicked();
}