Beispiel #1
0
void SettingDlg::buttonClicked()
{
    QString regType = regcb->currentText();
    QString title = lng->tr("FT_CONFIRM_REG");
    QString text = QString("%1:%2 \n").arg(lng->tr("FT_REGTYPE")).arg(regType);
    if( regType == "IMEI" )
        text += QString("IMEI:%1").arg(imei);
    else
        text += QString("IMSI:%1").arg(imsi);

    ZSingleCaptureDlg* dlg = new ZSingleCaptureDlg(title, text,
            (ZSingleCaptureDlg::CaptureDlgType)0, NULL, "ZSingleCaptureDlg", true, 0, 0);

    if( dlg->exec() == ZPopup::Accepted )  {
        cfg->reg_key = dlg->getResultText().stripWhiteSpace();
        delete dlg;
        dlg = NULL;

        cfg->reg_type = regType;
        cfg->saveCfg();

        if( codeComp->cpcp() )  {
            showNotify("", QString("Register Successfully !!") );
            tabWidget->setCurrentPage(0);
        } else {
            showNotify("", QString("Register Error !!"), 1);
        }
    } else {
        delete dlg;
        dlg = NULL;
    }
}
Beispiel #2
0
void ZGui::agregarTipoASK()
{
  QString aux="";
ZSingleCaptureDlg* dialogo = new ZSingleCaptureDlg ( "Add type", "Enter new file type", ZSingleCaptureDlg::normal, NULL, "dlg", true, 0, 0 );
     if ( dialogo->exec() )
      {
        aux = dialogo->getResultText();
      }dialogo=NULL;
 if(aux!="") {
 ZConfig conf ( getProgramDir() + "av_db.cfg", true );
 QStringList list = conf.readListEntry ( QString("DATABASE"), QString("ASK"), QChar(';') );
 list +=  aux;
 conf.writeEntry(QString("DATABASE"), QString("ASK"), list, ';');}
 if(infos==NULL)
  {
  infos = new ZNoticeDlg(ZNoticeDlg::Information, 3000, QString("OK"), QString("Type " + aux +" added"), this, "z", true, 0);
   infos->show();
 
  } infos=NULL;