Пример #1
0
/*!
  StationDialog is a dialog for entering station parameters (call, name, ...)

  s is station config file (so2sdr.ini) in QSettings .ini format
 */
StationDialog::StationDialog(QSettings &s, QWidget *parent) : QDialog(parent),settings(s)
{
    setupUi(this);

    // load from settings file
    CallLineEdit->setValidator(new UpperValidator(CallLineEdit));
    CallLineEdit->setText(settings.value(s_call,s_call_def).toString());
    NameLineEdit->setValidator(new UpperValidator(NameLineEdit));
    NameLineEdit->setText(settings.value(s_name,s_name_def).toString());
    StateLineEdit->setValidator(new UpperValidator(StateLineEdit));
    StateLineEdit->setText(settings.value(s_state,s_state_def).toString());
    ARRLSectionLineEdit->setValidator(new UpperValidator(ARRLSectionLineEdit));
    ARRLSectionLineEdit->setText(settings.value(s_section,s_section_def).toString());
    GridLineEdit->setValidator(new UpperValidator(GridLineEdit));
    GridLineEdit->setText(settings.value(s_grid,s_grid_def).toString());
    Lat           = 0.;
    Lon           = 0.;
    locator2longlat(&Lon, &Lat, settings.value(s_grid,s_grid_def).toByteArray().data());
    Lon            *= -1.0;
    CQZoneLineEdit->setText(settings.value(s_cqzone,s_cqzone_def).toString());
    ITUZoneLineEdit->setText(settings.value(s_ituzone,s_ituzone_def).toString());
    connect(station_dialog_buttons, SIGNAL(rejected()), this, SLOT(rejectChanges()));
    connect(station_dialog_buttons, SIGNAL(accepted()), this, SLOT(updateStation()));
    CabrilloAddressEdit->setText(settings.value(s_cab_address,s_cab_address_def).toString());
    CabrilloNameLineEdit->setText(settings.value(s_cab_name,s_cab_name_def).toString());
    CityLineEdit->setText(settings.value(s_cab_city,s_cab_city_def).toString());
    StateLineEdit_2->setText(settings.value(s_cab_state,s_cab_state_def).toString());
    CountryLineEdit->setText(settings.value(s_cab_country,s_cab_country_def).toString());
    PostalCodeLineEdit->setText(settings.value(s_cab_zip,s_cab_zip_def).toString());
}
Пример #2
0
ContestOptionsDialog::ContestOptionsDialog(QWidget *parent) : QDialog(parent)
{
    setupUi(this);
    connect(this, SIGNAL(rejected()), this, SLOT(rejectChanges()));
    connect(this, SIGNAL(accepted()), this, SLOT(updateOptions()));
    sent[0]=lineEditExch1;
    sent[1]=lineEditExch2;
    sent[2]=lineEditExch3;
    sent[3]=lineEditExch4;
    offValidator=new QIntValidator(this);
    offValidator->setBottom(1);
    offMinimumLineEdit->setValidator(offValidator);
}
Пример #3
0
SDRDialog::SDRDialog(QSettings& s,QWidget *parent) : QDialog(parent),settings(s)
{
    setupUi(this);
    pathLabel[0] = labelExe1;
    pathLabel[1] = labelExe2;
    ipPtr[0]           = lineEditIP1;
    ipPtr[1]           = lineEditIP2;
    portPtr[0]         = lineEditPort1;
    portPtr[1]         = lineEditPort2;
    configLabel[0]       = labelConfig1;
    configLabel[1]       = labelConfig2;
    connect(buttonExe1,SIGNAL(clicked()),this,SLOT(findExeFile1()));
    connect(buttonExe2,SIGNAL(clicked()),this,SLOT(findExeFile2()));
    connect(buttonConfig1,SIGNAL(clicked()),this,SLOT(findConfig1()));
    connect(buttonConfig2,SIGNAL(clicked()),this,SLOT(findConfig2()));
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(updateSDR()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(rejectChanges()));
    updateFromSettings();
}
Пример #4
0
void UatDialog::setUat(epan_uat *uat)
{
    QString title(tr("Unknown User Accessible Table"));

    uat_ = uat;

    ui->pathLabel->clear();
    ui->pathLabel->setEnabled(false);
    help_button_->setEnabled(false);

    if (uat_) {
        if (uat_->name) {
            title = uat_->name;
        }

        QString abs_path = gchar_free_to_qstring(uat_get_actual_filename(uat_, FALSE));
        ui->pathLabel->setText(abs_path);
        ui->pathLabel->setUrl(QUrl::fromLocalFile(abs_path).toString());
        ui->pathLabel->setToolTip(tr("Open ") + uat->filename);
        ui->pathLabel->setEnabled(true);

        uat_model_ = new UatModel(NULL, uat);
        uat_delegate_ = new UatDelegate;
        ui->uatTreeView->setModel(uat_model_);
        ui->uatTreeView->setItemDelegate(uat_delegate_);

        connect(uat_model_, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
                this, SLOT(modelDataChanged(QModelIndex)));
        connect(ui->uatTreeView, SIGNAL(currentItemChanged(QModelIndex,QModelIndex)),
                this, SLOT(viewCurrentChanged(QModelIndex,QModelIndex)));
        ok_button_->setEnabled(!uat_model_->hasErrors());

        if (uat_->help && strlen(uat_->help) > 0) {
            help_button_->setEnabled(true);
        }

        connect(this, SIGNAL(rejected()), this, SLOT(rejectChanges()));
        connect(this, SIGNAL(accepted()), this, SLOT(acceptChanges()));
    }

    setWindowTitle(title);
}
Пример #5
0
SSBMessageDialog::SSBMessageDialog(QWidget *parent) : QDialog(parent)
{
    setupUi(this);
    upperValidate = new UpperValidator(this);
    connect(ssbmessage_buttons, SIGNAL(rejected()), this, SLOT(rejectChanges()));
    connect(ssbmessage_buttons, SIGNAL(accepted()), this, SLOT(updateSSBMsg()));

    nowRecording=0;
    recGroup.setExclusive(false);

    funcEditPtr[0]  = cq_f1_edit;
    funcEditPtr[1]  = cq_f2_edit;
    funcEditPtr[2]  = cq_f3_edit;
    funcEditPtr[3]  = cq_f4_edit;
    funcEditPtr[4]  = cq_f5_edit;
    funcEditPtr[5]  = cq_f6_edit;
    funcEditPtr[6]  = cq_f7_edit;
    funcEditPtr[7]  = cq_f8_edit;
    funcEditPtr[8]  = cq_f9_edit;
    funcEditPtr[9]  = cq_f10_edit;
    funcEditPtr[10] = cq_f11_edit;
    funcEditPtr[11] = cq_f12_edit;

    funcRecPtr[0]   = rec1;
    funcRecPtr[1]   = rec2;
    funcRecPtr[2]   = rec3;
    funcRecPtr[3]   = rec4;
    funcRecPtr[4]   = rec5;
    funcRecPtr[5]   = rec6;
    funcRecPtr[6]   = rec7;
    funcRecPtr[7]   = rec8;
    funcRecPtr[8]   = rec9;
    funcRecPtr[9]   = rec10;
    funcRecPtr[10]   = rec11;
    funcRecPtr[11]   = rec12;

    for (int i=0;i<12;i++) {
        funcRecPtr[i]->setCheckable(true);
        recGroup.addButton(funcRecPtr[i],i+1);
    }

    ctrlFuncEditPtr[0]  = cq_ctrl_f1_edit;
    ctrlFuncEditPtr[1]  = cq_ctrl_f2_edit;
    ctrlFuncEditPtr[2]  = cq_ctrl_f3_edit;
    ctrlFuncEditPtr[3]  = cq_ctrl_f4_edit;
    ctrlFuncEditPtr[4]  = cq_ctrl_f5_edit;
    ctrlFuncEditPtr[5]  = cq_ctrl_f6_edit;
    ctrlFuncEditPtr[6]  = cq_ctrl_f7_edit;
    ctrlFuncEditPtr[7]  = cq_ctrl_f8_edit;
    ctrlFuncEditPtr[8]  = cq_ctrl_f9_edit;
    ctrlFuncEditPtr[9]  = cq_ctrl_f10_edit;
    ctrlFuncEditPtr[10] = cq_ctrl_f11_edit;
    ctrlFuncEditPtr[11] = cq_ctrl_f12_edit;

    ctrlFuncRecPtr[0]   = recCtrl1;
    ctrlFuncRecPtr[1]   = recCtrl2;
    ctrlFuncRecPtr[2]   = recCtrl3;
    ctrlFuncRecPtr[3]   = recCtrl4;
    ctrlFuncRecPtr[4]   = recCtrl5;
    ctrlFuncRecPtr[5]   = recCtrl6;
    ctrlFuncRecPtr[6]   = recCtrl7;
    ctrlFuncRecPtr[7]   = recCtrl8;
    ctrlFuncRecPtr[8]   = recCtrl9;
    ctrlFuncRecPtr[9]   = recCtrl10;
    ctrlFuncRecPtr[10]   = recCtrl11;
    ctrlFuncRecPtr[11]   = recCtrl12;

    for (int i=0;i<12;i++) {
        ctrlFuncRecPtr[i]->setCheckable(true);
        recGroup.addButton(ctrlFuncRecPtr[i],i+13);
    }

    shiftFuncEditPtr[0]  = cq_shift_f1_edit;
    shiftFuncEditPtr[1]  = cq_shift_f2_edit;
    shiftFuncEditPtr[2]  = cq_shift_f3_edit;
    shiftFuncEditPtr[3]  = cq_shift_f4_edit;
    shiftFuncEditPtr[4]  = cq_shift_f5_edit;
    shiftFuncEditPtr[5]  = cq_shift_f6_edit;
    shiftFuncEditPtr[6]  = cq_shift_f7_edit;
    shiftFuncEditPtr[7]  = cq_shift_f8_edit;
    shiftFuncEditPtr[8]  = cq_shift_f9_edit;
    shiftFuncEditPtr[9]  = cq_shift_f10_edit;
    shiftFuncEditPtr[10] = cq_shift_f11_edit;
    shiftFuncEditPtr[11] = cq_shift_f12_edit;

    shiftFuncRecPtr[0]   = recShft1;
    shiftFuncRecPtr[1]   = recShft2;
    shiftFuncRecPtr[2]   = recShft3;
    shiftFuncRecPtr[3]   = recShft4;
    shiftFuncRecPtr[4]   = recShft5;
    shiftFuncRecPtr[5]   = recShft6;
    shiftFuncRecPtr[6]   = recShft7;
    shiftFuncRecPtr[7]   = recShft8;
    shiftFuncRecPtr[8]   = recShft9;
    shiftFuncRecPtr[9]   = recShft10;
    shiftFuncRecPtr[10]   = recShft11;
    shiftFuncRecPtr[11]   = recShft12;

    for (int i=0;i<12;i++) {
        shiftFuncRecPtr[i]->setCheckable(true);
        recGroup.addButton(shiftFuncRecPtr[i],i+25);
    }

    excFuncEditPtr[0]  = exc_f1_edit;
    excFuncEditPtr[1]  = exc_f2_edit;
    excFuncEditPtr[2]  = exc_f3_edit;
    excFuncEditPtr[3]  = exc_f4_edit;
    excFuncEditPtr[4]  = exc_f5_edit;
    excFuncEditPtr[5]  = exc_f6_edit;
    excFuncEditPtr[6]  = exc_f7_edit;
    excFuncEditPtr[7]  = exc_f8_edit;
    excFuncEditPtr[8]  = exc_f9_edit;
    excFuncEditPtr[9]  = exc_f10_edit;
    excFuncEditPtr[10] = exc_f11_edit;
    excFuncEditPtr[11] = exc_f12_edit;

    excFuncRecPtr[0]   = recExc1;
    excFuncRecPtr[1]   = recExc2;
    excFuncRecPtr[2]   = recExc3;
    excFuncRecPtr[3]   = recExc4;
    excFuncRecPtr[4]   = recExc5;
    excFuncRecPtr[5]   = recExc6;
    excFuncRecPtr[6]   = recExc7;
    excFuncRecPtr[7]   = recExc8;
    excFuncRecPtr[8]   = recExc9;
    excFuncRecPtr[9]   = recExc10;
    excFuncRecPtr[10]   = recExc11;
    excFuncRecPtr[11]   = recExc12;

    for (int i=0;i<12;i++) {
        excFuncRecPtr[i]->setCheckable(true);
        recGroup.addButton(excFuncRecPtr[i],i+37);
    }
    recQsl->setCheckable(true);
    recGroup.addButton(recQsl,49);

    recQuick->setCheckable(true);
    recGroup.addButton(recQuick,50);

    recDupe->setCheckable(true);
    recGroup.addButton(recDupe,51);

    recCallUpdate->setCheckable(true);
    recGroup.addButton(recCallUpdate,52);

    recCqExc->setCheckable(true);
    recGroup.addButton(recCqExc,53);

    connect(&recGroup,SIGNAL(buttonClicked(int)),this,SLOT(recButtons(int)));

    for (int i = 0; i < N_FUNC; i++) {
        funcEditPtr[i]->setValidator(upperValidate);
        ctrlFuncEditPtr[i]->setValidator(upperValidate);
        shiftFuncEditPtr[i]->setValidator(upperValidate);
        excFuncEditPtr[i]->setValidator(upperValidate);
        cqF[i].clear();
        cqCtrlF[i].clear();
        cqShiftF[i].clear();
        excF[i].clear();
    }
    qsl_msg_edit->setValidator(upperValidate);
    qsl_updated_edit->setValidator(upperValidate);
    cq_exc_edit->setValidator(upperValidate);
    sp_exc_edit->setValidator(upperValidate);
    dupe_msg_edit->setValidator(upperValidate);
    quick_qsl_edit->setValidator(upperValidate);
}