Пример #1
0
void ZGui::addtask()
{
//	ZDateModule* dlg = new ZDateModule(this, NULL, 0, ZSkinService::clsZDateModule);
//	ZDatePickerDlg* msg = new ZDatePickerDlg(dlg, this, NULL, true, 0);
//	msg->exec(); delete msg; msg = NULL;
//	QDate fecha = msg->getResultDate();

  QString minuto, hora, dia, mes, dias, tarea;

  ZConfig IDini(Idioma, false);
  QString val = IDini.readEntry(QString("CRONTAB"), QString("MINUTE"), "");
  ZSingleCaptureDlg* zscd = new ZSingleCaptureDlg( QString("Cron"), val, ZSingleCaptureDlg::normal, NULL, "ZSingleCaptureDlg", true, 0, 0);
  ZLineEdit* zle = (ZLineEdit*)zscd->getLineEdit(); zle->setEdited(true);  
  if (zscd->exec() == 1) { if ( zle->text() != "" ) { minuto=zle->text(); } } else return;

  val = IDini.readEntry(QString("CRONTAB"), QString("HOUR"), "");
  zscd = new ZSingleCaptureDlg( QString("Cron"), val, ZSingleCaptureDlg::normal, NULL, "ZSingleCaptureDlg", true, 0, 0);
  zle = (ZLineEdit*)zscd->getLineEdit(); zle->setEdited(true);  
  if (zscd->exec() == 1) { if ( zle->text() != "" ) { hora=zle->text(); } } else return;

  val = IDini.readEntry(QString("CRONTAB"), QString("DAYMONTH"), "");
  zscd = new ZSingleCaptureDlg( QString("Cron"), val, ZSingleCaptureDlg::normal, NULL, "ZSingleCaptureDlg", true, 0, 0);
  zle = (ZLineEdit*)zscd->getLineEdit(); zle->setEdited(true);  
  if (zscd->exec() == 1) { if ( zle->text() != "" ) { dia=zle->text(); } } else return;

  val = IDini.readEntry(QString("CRONTAB"), QString("MONTH"), "");
  zscd = new ZSingleCaptureDlg( QString("Cron"), val, ZSingleCaptureDlg::normal, NULL, "ZSingleCaptureDlg", true, 0, 0);
  zle = (ZLineEdit*)zscd->getLineEdit(); zle->setEdited(true);  
  if (zscd->exec() == 1) { if ( zle->text() != "" ) { mes=zle->text(); } } else return;

  val = IDini.readEntry(QString("CRONTAB"), QString("DAYWEEK"), "");
  zscd = new ZSingleCaptureDlg( QString("Cron"), val, ZSingleCaptureDlg::normal, NULL, "ZSingleCaptureDlg", true, 0, 0);
  zle = (ZLineEdit*)zscd->getLineEdit(); zle->setEdited(true);  
  if (zscd->exec() == 1) { if ( zle->text() != "" ) { dias=zle->text(); } } else return;

  qApp->processEvents();

  ZFileOpenDialog *zopen  = new ZFileOpenDialog();
  zopen->exec();
  if ( zopen->result() == 1 )
  {
    QString archivo = zopen->getFileName();
    if (archivo != "")
	{
	  system(QString("echo \"%1 %2 %3 %4 %5 %6\" >> /ezxlocal/LinXtend/usr/bin/cron/user.txt").arg(minuto).arg(hora).arg(dia).arg(mes).arg(dias).arg(archivo));
	  zllb1->clear(); CargarMenu1();
	}
  }

}
Пример #2
0
void ZFonts::previewFont(QString sFontPath)
{
	QString sFontName = QFileInfo(sFontPath).baseName();

    QFontFactory* ffFactory = qt_fontmanager->factories.at(0);
    QDiskFont* dfFont = new QDiskFont(ffFactory, sFontName, false, 20, 0, "s", sFontPath);
    qt_fontmanager->diskfonts.append(dfFont);
    QFontDatabase::qwsAddDiskFont(dfFont);
    
	QFont fOrg = QFont::defaultFont();
	QFont fNew = fOrg;
	fNew.setFamily( sFontName );
	QFont::setDefaultFont( fNew );  

	ZSingleCaptureDlg* scdPreview = new ZSingleCaptureDlg(sFontName,"", ZSingleCaptureDlg::TypeTextField, this);
	scdPreview->enableAia(false);
	QPixmap pm( ProgDir+"/fonts.png" );
	scdPreview->setTitleIcon(pm);  
	                                               
	ZSoftKey* skKey = scdPreview->getSoftKey();
	skKey->disableClickedSlot(ZSoftKey::LEFT);
	skKey->setText(ZSoftKey::RIGHT, tr("TXT_RID_SOFTKEY_BACK","Back"), (ZSoftKey::TEXT_PRIORITY)0);
	skKey->setText(ZSoftKey::LEFT, "", (ZSoftKey::TEXT_PRIORITY)0);

	ZMultiLineEdit* mleText = scdPreview->getMultiLineEdit();
	mleText->setText(getViewText());
	mleText->setUnderline( false );
	mleText->setFocus();

	scdPreview->exec();
	delete scdPreview;
	
	QFont::setDefaultFont( fOrg );  	
}
Пример #3
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;
    }
}
Пример #4
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;
Пример #5
0
void ZOptionItem::selected(ZSettingItem* item)
{
	if ( (ZOptionItem*)item != this )
		return;
	
	switch ( type )
	{
		case EDIT_TEXT:
		case EDIT_TEXT_NUM:
		case EDIT_FILE:
			{
			ZSingleCaptureDlg* zscd = new ZSingleCaptureDlg(title, "", ZSingleCaptureDlg::TypeLineEdit, this, "", true, 0, 0);
			ZLineEdit* zle = (ZLineEdit*)zscd->getLineEdit();
			#ifndef WITHOUT_EDIT_TEXT_NUM
			if ( type==EDIT_TEXT_NUM )
				((ZApplication*)qApp)->setInputMethod(zle, ZKB_INPUT_NUMERIC, ZKbInputField::FIELD_TYPE_NUMERIC, ""); 
			#endif
			zle->setText(text);
			if ( zscd->exec() == QDialog::Accepted )
				setText(zle->text());
			delete zle;
			delete zscd;
			}
			break;
		case EDIT_BOOL_YESNO:
		case EDIT_BOOL_ONOFF:
			{
			QStringList itemList;
			if ( type==EDIT_BOOL_ONOFF )
			{
				itemList.append(LNG_ON);
				itemList.append(LNG_OFF);
			} else
			{
				itemList.append(LNG_YES);
				itemList.append(LNG_NO);				
			}
			ZSingleSelectDlg *dlg = new ZSingleSelectDlg(title, "", this);
			dlg->addItemsList(itemList);
			dlg->getListBox()->checkItem(!n, true);
			if ( dlg->exec() == QDialog::Accepted )
				setNum(!dlg->getCheckedItemIndex());
			delete dlg;
			}
			break;
		case EDIT_NUM:
			{
			ZNumPickerDlg * dlg = new ZNumPickerDlg(2, this);
			ZNumModule* num = dlg->getNumModule();
			num->setMaxValue(max);
			num->setMinValue(min);
			num->setValue(n);
			if ( dlg->exec() == QDialog::Accepted )
				setNum( num->getValue() );
			delete num;
			delete dlg;
			}
			break;
		#ifndef WITHOUT_GAIN_VOL
		case EDIT_GAIN_VOLUME:
			{
			ZNumPickerDlg * dlg = new ZNumPickerDlg(2, this);
			ZNumModule* num = dlg->getNumModule();
			num->setMaxValue( GAIN_DEVICE_VOL_MAX );
			num->setMinValue( GAIN_DEVICE_VOL_MIN);
			num->setValue( gainTable[n] );			
			if ( dlg->exec() == QDialog::Accepted )
			{
				gainTable[n] = num->getValue();
				setSubItem(0, 1, QString::number( gainTable[n] ) );				
			}
			delete num;
			delete dlg;
			}
			break;	
		case EDIT_GAIN_EQUALOSER:
			{

			ZSingleCaptureDlg* zscd = new ZSingleCaptureDlg(title, "", ZSingleCaptureDlg::TypeLineEdit, this, "", true, 0, 0);
			ZLineEdit* zle = (ZLineEdit*)zscd->getLineEdit();
			((ZApplication*)qApp)->setInputMethod(zle, ZKB_INPUT_NUMERIC, ZKbInputField::FIELD_TYPE_NUMERIC, ""); 
			zle->setText(QString::number(u2n.num-GAIN_EQUALASER_MIN));		
			if ( zscd->exec() == QDialog::Accepted )
			{
				int num = zle->text().toInt();
				if ( num<0 )
					num=0;
				if ( num>GAIN_EQUALASER_MAX-GAIN_EQUALASER_MIN )
					num=GAIN_EQUALASER_MAX-GAIN_EQUALASER_MIN;
				
				u2n.num = num+GAIN_EQUALASER_MIN;
				memcpy(&gainTable[n], u2n.data, 2);
				setSubItem(0, 1, QString::number( u2n.num-GAIN_EQUALASER_MIN ) );				
			}
			delete zle;
			delete zscd;
			}
			break;		
		#endif	
		case EDIT_ONE_OF_LIST:
			{
			if ( list == NULL )
				return;
			ZSingleSelectDlg *dlg = new ZSingleSelectDlg(title, "", this);
			dlg->addItemsList(*list);
			dlg->getListBox()->checkItem(n, true);
			if ( dlg->exec() == QDialog::Accepted )
				setNum(dlg->getCheckedItemIndex());
			delete dlg;	
			}	
			break;
		case EDIT_INTERNET_PROFILE:
			#ifndef WITHOUT_EDIT_INTERNET_PROFILE
			{
			UINT32 profiles = NAPI_GetMaxProfiles();
			QStringList list;
			list.append(LNG_ASK);
			if(profiles != -1) 
			{
				char *buf = new char[NAPI_MAX_PROFILE_NAME_LENGTH * profiles];
				if(NAPI_ListAllProfile((INT8*)buf, &profiles) != -1) 
				{
					char *prof_ptr = buf;
					for(uint i = 0; i < profiles; i++, prof_ptr = buf + i * NAPI_MAX_PROFILE_NAME_LENGTH)
						list.append(QString::fromUtf8(prof_ptr));
				}
				delete buf;	
			}
			ZSingleSelectDlg *dlg = new ZSingleSelectDlg(title, "", this);
			dlg->addItemsList(list);
			
			int sel=0, i=0;
			for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
				if ( *it == text )
				{
					sel=i;
					break;
				} else
					i++;
			if ( sel >= 0 )
				dlg->getListBox()->checkItem(sel, true);
			if ( dlg->exec() == QDialog::Accepted )
			{
				n=dlg->getCheckedItemIndex();
				setText( (n>0)?(*(list.at(n))):"" );
			}
			delete dlg;
			}
			#endif
			break;
	}
}