void ZGui::eliminarTipoDELETE() { QString aux=""; ZConfig conf ( getProgramDir() + "av_db.cfg", true ); QStringList list = conf.readListEntry ( QString("DATABASE"), QString("DELETE"), QChar(';') ); ZSingleSelectDlg * dlg = new ZSingleSelectDlg("Remove", "Select type", this, "ZSingleSelectDlg", true, 0, 0); dlg->addItemsList(list); dlg->exec(); int elegido=dlg->getCheckedItemIndex(); aux=list[elegido]; list.remove(list[elegido]); conf.writeEntry(QString("DATABASE"), QString("DELETE"), list, ';'); dlg=NULL; if(infos==NULL) { infos = new ZNoticeDlg(ZNoticeDlg::Information, 3000, QString("OK"), QString("Type " + aux +" removed"), this, "z", true, 0); infos->show(); } infos=NULL;
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;
ZGui::ZGui ( const QString &ejecuta, QWidget* parent, const char* name, WFlags fl ) : ZKbMainWidget ( ZHeader::FULL_TYPE, NULL, "ZMainWidget", 0 ) { QString eje = ejecuta; if ( eje == "cleannow" ) {infos=NULL; dlg=NULL; ZConfig conf ( getProgramDir() + "av_db.cfg", true ); QStringList list = conf.readListEntry ( QString("DATABASE"), QString("DELETE"), QChar(';') ); QStringList a=""; for(int i=0;i< list.count();i++) { a=limpiar(SD,list[i]); borrar(a); a=""; a=limpiar(phone,list[i]); borrar(a); a="";} qApp->quit(); } else {infos=NULL; dlg=NULL; eliminados=""; CreateWindow ( parent ); ( ( ZApplication* ) qApp )->showMainWidget ( this );} }
void ZGui::ejecutar() { QStringList a=""; int lug=0; int mod=0; mod=modo->currentItem(); if(mod==1)//MODO AV { ZConfig conf ( getProgramDir() + "av_db.cfg", true ); QStringList list = conf.readListEntry ( QString("DATABASE"), QString("ASK"), QChar(';') ); lug=lugar->currentItem(); if(lug==0) { for(int i=0;i<list.count();i++) { a=limpiar(SD,list[i]); borrarcuidado(a); a=""; } } else if(lug==1) { for(int i=0;i<list.count();i++) { a=limpiar(phone,list[i]); borrarcuidado(a); a=""; } } else if(lug==2) { for(int i=0;i<list.count();i++) { a=limpiar(SD,list[i]); borrarcuidado(a); a=""; a=limpiar(phone,list[i]); borrarcuidado(a); a=""; } } } else if(mod==0) { ZConfig conf ( getProgramDir() + "av_db.cfg", true ); QStringList list = conf.readListEntry ( QString("DATABASE"), QString("DELETE"), QChar(';') ); //for(int j=0;j<list.count();j++) sal << list[j] << endl; lug=lugar->currentItem(); if(lug==0) { for(int i=0;i<list.count();i++) { a=limpiar(SD,list[i]); borrar(a); a=""; } } else if(lug==1) { for(int i=0;i<list.count();i++) { a=limpiar(phone,list[i]); borrar(a); a=""; } } else if(lug==2) { for(int i=0;i<list.count();i++) { a=limpiar(SD,list[i]); borrar(a); a=""; a=limpiar(phone,list[i]); borrar(a); a=""; } } }//Fin modo clean if(infos==NULL) { infos = new ZNoticeDlg(ZNoticeDlg::Information, 3000, QString("Your Z6 is clean now"), QString("!!"), this, "z", true, 0); infos->show(); } infos=NULL;