コード例 #1
0
ファイル: moc_mainwindow.cpp プロジェクト: MosheWagner/tzura
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: update((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 1: on_tabWidget_currentChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 2: on_minusBTN_clicked(); break;
        case 3: on_plusBTN_clicked(); break;
        case 4: on_toolButton_clicked(); break;
        case 5: on_nextBTN_clicked(); break;
        case 6: on_prevBTN_clicked(); break;
        case 7: on_saveLayoutBTN_clicked(); break;
        case 8: on_reprocBTN_clicked(); break;
        case 9: on_whiteBTN_clicked((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 10: on_blackBTN_clicked((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 11: on_openfileBTN_clicked(); break;
        case 12: mousePressEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 13: mouseMoveEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 14: valueChangeRequest((*reinterpret_cast< QPoint(*)>(_a[1]))); break;
        case 15: showHelp(); break;
        default: ;
        }
        _id -= 16;
    }
    return _id;
}
コード例 #2
0
void QHisdDataLoggerDialog::on_accept_clicked()
{
    if(! pwnd->IsAddressCheckRight(pwnd->m_pSamSysParame->m_historyLogData.mReadAddr,tr("读取地址"),ui->hisdata_read_address,1))
    {
        return;
    }
    if(ui->triggered->isChecked())
    {
        if(! pwnd->IsAddressCheckRight(pwnd->m_pSamSysParame->m_historyLogData.mTriggerAddr,tr("触发位"),ui->triggerdchoice,0))
        {
            return;
        }
    }
    if(ui->notiy->isChecked())
    {
        if(! pwnd->IsAddressCheckRight(pwnd->m_pSamSysParame->m_historyLogData.mFullNoticAddr,tr("通知位"),ui->notiy_address,0))
        {
            return;
        }
    }
    pwnd->m_pSamSysParame->m_historyLogData.sHistoryDataName =ui->name->text();//历史数据名称
    pwnd->m_pSamSysParame->m_historyLogData.nSampleLen =ui->sample_length->value(); //取样长度
    pwnd->m_pSamSysParame->m_historyLogData.nSampleSize =ui->number_sampling->value();//取样大小
    pwnd->m_pSamSysParame->m_historyLogData.mReadAddr.sShowAddr=ui->hisdata_read_address->text();
    if(ui->timed->isChecked())//取样方式
    {
        pwnd->m_pSamSysParame->m_historyLogData.nSampleType =0;//计时
    }
    else if(ui->triggered->isChecked())
    {
        pwnd->m_pSamSysParame->m_historyLogData.nSampleType =1;//触发
    }
    else if(ui->clocked->isChecked())
    {
        pwnd->m_pSamSysParame->m_historyLogData.nSampleType =2;//整点
    }
    pwnd->m_pSamSysParame->m_historyLogData.bAutoOff=ui->bAutoOff->isChecked();
    pwnd->m_pSamSysParame->m_historyLogData.nTimeInterval =ui->timed_choice->value();//计时取样时间
    pwnd->m_pSamSysParame->m_historyLogData.nTriggerTime =ui->clockedchoice->value();//整点取样时间
  //  pwnd->m_pSamSysParame->m_historyLogData.mReadAddr.sShowAddr= ui->triggerdchoice->text();//触发取样地址
    pwnd->m_pSamSysParame->m_historyLogData.bFullStop =ui->stopsampling->isChecked();//取满后是否停止
    pwnd->m_pSamSysParame->m_historyLogData.bFullNotic = ui->notiy->isChecked();//取满后是否通知
  //  pwnd->m_pSamSysParame->m_historyLogData.mFullNoticAddr.sShowAddr=ui->notiy_address->text();//取满后通知结构体的地址
    pwnd->m_pSamSysParame->m_historyLogData.nFullNoticPercent =ui->fulllimit->value();//通知百分比
    //表格存储的信息
    on_tabWidget_currentChanged(1);//刷新历史数据容器
    pwnd->m_pSamSysParame->m_historyLogData.mSampleList = qhistabledata.mSampleList;
    if(pwnd->m_pSamSysParame->m_historyLogData.sBackupForNewVer.size()<1)
    {
        pwnd->m_pSamSysParame->m_historyLogData.sBackupForNewVer.append(ui->memory_required->text());
    }
    else
    {
        pwnd->m_pSamSysParame->m_historyLogData.sBackupForNewVer[0]=ui->memory_required->text();
    }
    reDrawHisDataDisplay();
    accept();
}
コード例 #3
0
void QHisdDataLoggerDialog::on_Language_currentIndexChanged(int index)//语言切换
{
    if(!bInitFinish)
    {
        return;//初始化未完成时 返回
    }
   // on_sample_length_valueChanged(ui->sample_length->value());//调用改变长度切换刷新表的函数
    on_tabWidget_currentChanged(1);
    if(tablerow < qhistabledata.mSampleList.size() && !qhistabledata.mSampleList.isEmpty() )
    {
        if(qhistabledata.mSampleList.at(tablerow).sNameList.size() > index)
            ui->data_item_name->setText(qhistabledata.mSampleList.at(tablerow).sNameList.at(index));
    }
}
コード例 #4
0
CaosIsp::CaosIsp(QWidget *parent) :
  QMainWindow(parent),
  ui(new Ui::CaosIsp)
{

  Settings settings(Settings::global());
  CLink * device;
  CFont::init();

  QCoreApplication::setOrganizationName("CoActionOS, Inc");
  QCoreApplication::setOrganizationDomain("coactionos.com");
  QCoreApplication::setApplicationName("CoActionOS-ISP");
  QCoreApplication::setApplicationVersion(COACTIONOS_ISP_VERSION);

  ui->setupUi(this);
  CNotify::setUpdateObjects(ui->statusBar, 0);

  link_set_debug(1);

  device = ui->connectWidget->clink();

  QFile file(":/data/CStyle.css");
  if( file.open(QFile::ReadOnly)) {
      QString StyleSheet = QLatin1String(file.readAll());
      qApp->setStyleSheet(StyleSheet);
    }

  ui->tabWidget->setTabText(TAB_INSTALLER, CFont::iconDownloadAlt());
  ui->tabWidget->setTabText(TAB_TERMINAL, CFont::iconEdit());
  ui->tabWidget->setTabText(TAB_PREFERENCES, CFont::iconCogs());
  ui->tabWidget->setTabEnabled(TAB_LABEL, false);

  ui->installTab->setLink(device);
  ui->terminalTab->setLink(device);
  ui->preferencesTab->setLink(device);

  connect(device, SIGNAL(linked(bool)), ui->installTab, SLOT(connected(bool)));
  connect(ui->installTab, SIGNAL(pauseTerminal(bool)), ui->terminalTab, SLOT(setPaused(bool)));
  connect(ui->installTab, SIGNAL(completed()), this, SLOT(installCompleted()));

  connect(ui->terminalTab, SIGNAL(resetTarget()), ui->installTab, SLOT(resetTarget()));
  connect(ui->terminalTab, SIGNAL(showPreferences()), this, SLOT(showPreferences()));

  ui->tabWidget->setCurrentIndex( settings.currentTab().toInt() );
  on_tabWidget_currentChanged(settings.currentTab().toInt());
}
コード例 #5
0
/**********************数据类别改变后更改显示类别的相关信息*****************************/
void QHisdDataLoggerDialog::on_data_item_datatype_currentIndexChanged(int index)
{
    if(!bInitFinish)
    {
        return;//初始化未完成时 返回
    }

    if(tablerow >= qhistabledata.mSampleList.size()) return ;

    qhistabledata.mSampleList[tablerow].nDataType = index;// 把类型信息存储到临时变量中
    ReDataDisplaytype(index);//刷新数据的显示类别

   // on_sample_length_valueChanged(ui->sample_length->value());
    on_tabWidget_currentChanged(1);
    ui->data_item_displaytype->setCurrentIndex(qhistabledata.mSampleList.at(tablerow).nDataShowType);
    //以下是进行内存所需数的计算
ReMemoryCount(ui->number_sampling->value());
}
コード例 #6
0
ファイル: NewX509.cpp プロジェクト: J-Javan/xca
void NewX509::accept()
{
	x509name xn;
	on_tabWidget_currentChanged(0);
	try {
		xn = getX509name(1);
	} catch (errorEx &err) {
		gotoTab(1);
		QMessageBox msg(QMessageBox::Warning, XCA_TITLE, err.getString(),
			QMessageBox::NoButton, this);
		msg.addButton(QMessageBox::Ok);
		msg.addButton(QMessageBox::Close)->setText(tr("Abort rollout"));
		if (msg.exec() == QMessageBox::Close) {
			reject();
		}
		return;
	}
	QString lenErr = xn.checkLength();
	if (!lenErr.isEmpty()) {
		gotoTab(1);
		lenErr = tr("The following length restrictions of RFC3280 are violated:") +
			"\n" + lenErr;
		QMessageBox msg(QMessageBox::Warning, XCA_TITLE,
					lenErr, QMessageBox::NoButton, this);
		msg.addButton(QMessageBox::Ok)->setText(tr("Edit subject"));
		msg.addButton(QMessageBox::Close)->setText(tr("Abort rollout"));
		msg.addButton(QMessageBox::Apply)->setText(tr("Continue rollout"));
		switch (msg.exec())
		{
			case QMessageBox::Ok:
			case QMessageBox::Cancel:
				return;
			case QMessageBox::Close:
				reject();
				return;
			case QMessageBox::Apply:
				break;
		}
	}
	if (fromReqCB->isChecked() && !getSelectedReq()->verify()) {
		gotoTab(0);
		QMessageBox msg(QMessageBox::Warning, XCA_TITLE,
			tr("The verification of the Certificate request failed.\nThe rollout should be aborted."),
			QMessageBox::NoButton, this);
		msg.addButton(QMessageBox::Ok)->setText(tr("Continue anyway"));
		msg.addButton(QMessageBox::Close)->setText(tr("Abort rollout"));
		if (msg.exec() == QMessageBox::Close) {
			reject();
		}
	}
	if (description->text().isEmpty() && !fromReqCB->isChecked()) {
		if (commonName->text().isEmpty()) {
			gotoTab(1);
			QMessageBox msg(QMessageBox::Warning, XCA_TITLE,
				tr("The internal name and the common name are empty.\nPlease set at least the internal name."), QMessageBox::NoButton, this);
			msg.addButton(QMessageBox::Ok)->setText(tr("Edit name"));
			msg.addButton(QMessageBox::Close)->setText(tr("Abort rollout"));
			if (msg.exec() == QMessageBox::Close) {
				reject();
			}
			return;
		} else {
			description->setText(commonName->text());
		}
	}
	if (keyList->count() == 0 && keyList->isEnabled() &&
				!fromReqCB->isChecked())
	{
		gotoTab(1);
		QMessageBox msg(QMessageBox::Warning, XCA_TITLE,
			tr("There is no Key selected for signing."),
			QMessageBox::NoButton, this);
		msg.addButton(QMessageBox::Ok)->setText(tr("Select key"));
		msg.addButton(QMessageBox::Close)->setText(tr("Abort rollout"));
		if (msg.exec() == QMessageBox::Close) {
			reject();
		}
		return;
	}
	QString unsetDN;
	if (pt != tmpl)
		unsetDN = mandatoryDnRemain();
	if (!unsetDN.isEmpty()) {
		gotoTab(1);
		QString text = tr("The following distinguished name entries are empty:\n%1\nthough you have declared them as mandatory in the options menu.").arg(unsetDN);
		QMessageBox msg(QMessageBox::Warning, XCA_TITLE,
					text, QMessageBox::NoButton, this);
		msg.addButton(QMessageBox::Ok)->setText(tr("Edit subject"));
		msg.addButton(QMessageBox::Close)->setText(tr("Abort rollout"));
		msg.addButton(QMessageBox::Apply)->setText(tr("Continue rollout"));
		switch (msg.exec())
		{
			case QMessageBox::Ok:
			case QMessageBox::Cancel:
				return;
			case QMessageBox::Close:
				reject();
				return;
			case QMessageBox::Apply:
				break;
		}
	}
	pki_x509 *signer = NULL;
	if (!selfSignRB->isChecked())
		signer = getSelectedSigner();

	pki_key *signkey = getSelectedKey();
	if (signer)
		signkey = signer->getRefKey();

	if ((!signkey || signkey->isPubKey()) && pt != tmpl) {
		QString txt;
		gotoTab(signer ? 0 : 1);
		QMessageBox msg(QMessageBox::Warning, XCA_TITLE,
			tr("The key you selected for signing is not a private one."),
			QMessageBox::NoButton, this);
		txt = signer ? tr("Select other signer"):tr("Select other key");
		msg.addButton(QMessageBox::Ok)->setText(txt);
		msg.addButton(QMessageBox::Close)->setText(tr("Abort rollout"));
		if (msg.exec() == QMessageBox::Close) {
			reject();
		}
		return;
        }
	if (signer && notBefore->getDate() < signer->getNotBefore()) {
		gotoTab(2);
		QString text = tr("The certificate will be earlier valid than the signer. This is probably not what you want.");
		QMessageBox msg(QMessageBox::Warning, XCA_TITLE,
					text, QMessageBox::NoButton, this);
		msg.addButton(QMessageBox::Ok)->setText(tr("Edit dates"));
		msg.addButton(QMessageBox::Close)->setText(tr("Abort rollout"));
		msg.addButton(QMessageBox::Apply)->setText(tr("Continue rollout"));
		msg.addButton(QMessageBox::Yes)->setText(tr("Adjust date and continue"));
		switch (msg.exec())
		{
			case QMessageBox::Ok:
			case QMessageBox::Cancel:
				return;
			case QMessageBox::Close:
				reject();
				return;
			case QMessageBox::Apply:
				break;
			case QMessageBox::Yes:
				notBefore->setDate(signer->getNotBefore());
		}
	}
	if (signer && notAfter->getDate() > signer->getNotAfter() &&
				!noWellDefinedExpDate->isChecked()) {
		gotoTab(2);
		QString text = tr("The certificate will be longer valid than the signer. This is probably not what you want.");
		QMessageBox msg(QMessageBox::Warning, XCA_TITLE,
					text, QMessageBox::NoButton, this);
		msg.addButton(QMessageBox::Ok)->setText(tr("Edit dates"));
		msg.addButton(QMessageBox::Close)->setText(tr("Abort rollout"));
		msg.addButton(QMessageBox::Apply)->setText(tr("Continue rollout"));
		msg.addButton(QMessageBox::Yes)->setText(tr("Adjust date and continue"));
		switch (msg.exec())
		{
			case QMessageBox::Ok:
			case QMessageBox::Cancel:
				return;
			case QMessageBox::Close:
				reject();
				return;
			case QMessageBox::Apply:
				break;
			case QMessageBox::Yes:
				notAfter->setDate(signer->getNotAfter());
		}
	}
	if (notBefore->getDate() > notAfter->getDate()) {
		gotoTab(2);
		QString text = tr("The certificate will be out of date before it becomes valid. You most probably mixed up both dates.");
		QMessageBox msg(QMessageBox::Warning, XCA_TITLE,
					text, QMessageBox::NoButton, this);
		msg.addButton(QMessageBox::Ok)->setText(tr("Edit dates"));
		msg.addButton(QMessageBox::Close)->setText(tr("Abort rollout"));
		msg.addButton(QMessageBox::Apply)->setText("Continue rollout");
		switch (msg.exec())
		{
			case QMessageBox::Ok:
			case QMessageBox::Cancel:
				return;
			case QMessageBox::Close:
				reject();
				return;
			case QMessageBox::Apply:
				break;
		}
	}
	on_adv_validate_clicked();
	if (checkExtDuplicates()) {
		gotoTab(5);
		QString text = tr("The certificate contains duplicated extensions. Check the validation on the advanced tab.");
		QMessageBox msg(QMessageBox::Warning, XCA_TITLE,
					text, QMessageBox::NoButton, this);
		msg.addButton(QMessageBox::Ok)->setText(tr("Edit extensions"));
		msg.addButton(QMessageBox::Close)->setText(tr("Abort rollout"));
		msg.addButton(QMessageBox::Apply)->setText(tr("Continue rollout"));
		switch (msg.exec())
		{
			case QMessageBox::Ok:
			case QMessageBox::Cancel:
				return;
			case QMessageBox::Close:
				reject();
				return;
			case QMessageBox::Apply:
				break;
		}
	}
	QDialog::accept();
}
コード例 #7
0
void AddressBookDialog::setTab(int tab)
{
    ui->tabWidget->setCurrentIndex(tab);
    on_tabWidget_currentChanged(tab);
}
コード例 #8
0
QHisdDataLoggerDialog::QHisdDataLoggerDialog(QWidget *parent) :
        QDialog(parent),
        ui(new Ui::QHisdDataLoggerDialog)
{
    bInitFinish=false;
    ui->setupUi(this);
    tablerow=0;//初始化第零行

    /**************以下是把历史数据类里面存储的信息赋值到临时变量当中************************/
    qhistabledata = pwnd->m_pSamSysParame->m_historyLogData;
    for(int i=0;i< pwnd->m_pSamSysParame->m_languageProp.sLanguageNameList.size();i++)//初始化语言选项列表框
    {
        ui->Language->addItem(pwnd->m_pSamSysParame->m_languageProp.sLanguageNameList[i]);
    }
    ui->Language->setCurrentIndex(0);//设置默认语言为第一种
    QString trmpstr;//辅助变量
    ui->name->setText(pwnd->m_pSamSysParame->m_historyLogData.sHistoryDataName);//历史数据名称
    ui->sample_length->setValue(pwnd->m_pSamSysParame->m_historyLogData.nSampleLen);//取样长度
    ui->number_sampling->setValue(pwnd->m_pSamSysParame->m_historyLogData.nSampleSize);//取样大小
    /******************以下是计算内存所需数******************************************/
    ui->hisdata_read_address->setText(pwnd->m_pSamSysParame->m_historyLogData.mReadAddr.sShowAddr);//读取地址
    if(pwnd->m_pSamSysParame->m_historyLogData.nSampleType ==0)//取样方式-计时取样
    {
        ui->timed->setChecked(true);
    }
    else if(pwnd->m_pSamSysParame->m_historyLogData.nSampleType ==1)//取样方式-触发取样
    {
        ui->triggered->setChecked(true);
        ui->bAutoOff->setChecked(pwnd->m_pSamSysParame->m_historyLogData.bAutoOff);
    }
    else if(pwnd->m_pSamSysParame->m_historyLogData.nSampleType ==2)//取样方式-整点取样
    {
        ui->clocked->setChecked(true);
    }
    ui->timed_choice->setValue(pwnd->m_pSamSysParame->m_historyLogData.nTimeInterval);//计时取样时间
    ui->clockedchoice->setValue(pwnd->m_pSamSysParame->m_historyLogData.nTriggerTime);//整点取样时间
    ui->triggerdchoice->setText(pwnd->m_pSamSysParame->m_historyLogData.mTriggerAddr.sShowAddr);//触发取样地址
    ui->stopsampling->setChecked(pwnd->m_pSamSysParame->m_historyLogData.bFullStop);//取满后是否停止
    ui->notiy->setChecked(pwnd->m_pSamSysParame->m_historyLogData.bFullNotic);//取满后是否通知
    ui->notiy_address->setText(pwnd->m_pSamSysParame->m_historyLogData.mFullNoticAddr.sShowAddr);//取满后通知结构体的地址
    ui->fulllimit->setValue(pwnd->m_pSamSysParame->m_historyLogData.nFullNoticPercent);//通知百分比
    ui->data_item_address->setText("LH0");//初始化地址,采用第一个单元格的数据
    if(pwnd->m_pSamSysParame->m_historyLogData.mSampleList.first().sNameList.size() < 1)
    {
        pwnd->m_pSamSysParame->m_historyLogData.mSampleList[0].sNameList.resize(1);
    }
    ui->data_item_name->setText(pwnd->m_pSamSysParame->m_historyLogData.mSampleList.first().sNameList.first());//初始化名称
    pwnd->InitDateType(ui->data_item_datatype);//初始化数据类别
    ui->data_item_datatype->addItem(tr("ASCII字符串"));
    ui->data_item_datatype->setCurrentIndex(pwnd->m_pSamSysParame->m_historyLogData.mSampleList.first().nDataType);//设置数据类别
    ui->data_item_displaytype->setCurrentIndex(pwnd->m_pSamSysParame->m_historyLogData.mSampleList.first().nDataShowType);//设置显示类别
    ui->data_item_totaldigits->setValue(pwnd->m_pSamSysParame->m_historyLogData.mSampleList.first().nDataLen);//设置总位数
    ui->data_item_fractionaldigits->setValue(pwnd->m_pSamSysParame->m_historyLogData.mSampleList.first().nDataPointLen);//设置小数位数
    ui->scaling->setChecked(pwnd->m_pSamSysParame->m_historyLogData.mSampleList.first().bZoom);//是否缩放
    trmpstr= pwnd->m_pSamSysParame->m_historyLogData.mSampleList.first().sZoomStr;
    ui->gain->setText(trmpstr);
    trmpstr= pwnd->m_pSamSysParame->m_historyLogData.mSampleList.first().sOffsetStr;
    ui->offset->setText(trmpstr);
    ui->hisdatatable->verticalHeader()->hide();//隐藏表头
    /***************************************************************
   *以下是对界面的操作,隐藏和现实一些相关控件
   ****************************************************************/
    if(!ui->timed->isChecked())//取样方式-计时
    {
        ui->timed_choice->hide();
        ui->label_8->hide();
        ui->label_11->hide();
    }
    if(!ui->clocked->isChecked())//取样方式-整点
    {
        ui->clockedchoice->hide();
        ui->label_10->hide();
        ui->label_13->hide();
    }
    if(!ui->triggered->isChecked())//取样方式-触发
    {
    ui->triggerdchoice->hide();
    ui->triggeredbitchoice->hide();
    ui->label_9->hide();
    ui->bAutoOff->hide();
}
    if(!ui->notiy->isChecked())
    {
        ui->notiy_address->hide();
        ui->notiy_address_check->hide();
        ui->fulllimit->hide();
        ui->label_12->hide();
        ui->label_14->hide();
    }
    if(!ui->scaling->isChecked())
    {
        ui->gain->hide();
        ui->offset->hide();
        ui->label_21->hide();
        ui->label_22->hide();
    }
    QDoubleValidator *validator=new QDoubleValidator(this);//设置手动输入下拉列表框的范围
    ui->offset->setValidator(validator);
    ui->gain->setValidator(validator);
    ui->accept->setFocus();
    ui->memory_required->setDisabled(true);
    bInitFinish=true;//初始化完成标志
  //  on_sample_length_valueChanged(pwnd->m_pSamSysParame->m_historyLogData.nSampleLen);//
   on_tabWidget_currentChanged(1);
    on_data_item_name_textChanged(pwnd->m_pSamSysParame->m_historyLogData.mSampleList.first().sNameList.first());
    on_data_item_datatype_currentIndexChanged(pwnd->m_pSamSysParame->m_historyLogData.mSampleList.first().nDataType);
}
コード例 #9
0
ファイル: cephlist.cpp プロジェクト: GPUWorks/skytechx
void CEphList::on_listWidget_currentRowChanged(int)
{
  on_tabWidget_currentChanged(0);
}