void GoogleEarthOptionsDialog::browseFilenameDialog() { QString fn = ""; QString file = this->GoogleEarthProgram_lineEdit->text(); QString fileStart = getProgramDir(); // *********************************************************************************************************************** fileStart.replace( "://", ":/" ); QFileInfo fi( file ); if ( fi.exists() == true ) fileStart = file; #if defined(Q_OS_WIN) fn = QFileDialog::getOpenFileName( this, tr( "Select the Google Earth program" ), fileStart, tr( "EXE file (*.exe)" ), 0, QFileDialog::DontUseNativeDialog ); #endif #if defined(Q_OS_LINUX) fn = QFileDialog::getOpenFileName( this, tr( "Select the Google Earth program" ), fileStart, tr( "All (*)" ), 0, QFileDialog::DontUseNativeDialog ); #endif #if defined(Q_OS_MAC) fn = QFileDialog::getExistingDirectory( this, tr( "Select the Google Earth program" ), fileStart, QFileDialog::DontUseNativeDialog ); #endif if ( fn.isEmpty() == true ) fn = file; this->GoogleEarthProgram_lineEdit->setText( QDir::toNativeSeparators( fn ) ); GoogleEarthProgram_lineEdit->setFocus(); }
int loadMotif() { void * xmLib = NULL, *xtLib = NULL, *x11Lib = NULL, *xinLib = NULL; #ifdef AIX void * motifShim = NULL; #endif char * path = getProgramDir(); int dlFlags = RTLD_LAZY; /* initialize ptr struct to 0's */ memset(&motif, 0, sizeof(struct MOTIF_PTRS)); #ifndef AIX if (path != NULL) { /* look for libXm first in the root of eclipse */ char * lib = malloc((strlen(path) + strlen(_T_ECLIPSE(XM_LIB)) + 2) * sizeof(char)); sprintf( lib, "%s%c%s", path, dirSeparator, XM_LIB); xmLib = dlopen(lib, dlFlags); free(lib); } #else dlFlags |= RTLD_MEMBER; motifShim = loadMotifShimLibrary(); if (motifShim == NULL) return -1; #endif if (xmLib == NULL) { xmLib = dlopen(XM_LIB, dlFlags); } if (xmLib == NULL) { /* bail now, don't load the others, libXm must be loaded first, so leave things for * swt to do later */ return -1; } xtLib = dlopen(XT_LIB, dlFlags); x11Lib = dlopen(X11_LIB, dlFlags); /* printf("XmLib: %s: %x\nXtLib: %s: %x\nX11Lib:%s, %x\n", XM_LIB, xmLib, XT_LIB, xtLib, X11_LIB, x11Lib);*/ #ifndef NO_XINERAMA_EXTENSIONS /* don't fail without Xinerama */ xinLib = dlopen(XIN_LIB, dlFlags); if (xinLib != NULL) loadMotifSymbols(xinLib, xinFunctions); #endif if( xtLib == NULL || x11Lib == NULL) return -1; if (loadMotifSymbols(xmLib, xmFunctions) != 0) return -1; if (loadMotifSymbols(xtLib, xtFunctions) != 0) return -1; if (loadMotifSymbols(x11Lib, x11Functions) != 0) return -1; #ifdef AIX if (loadMotifSymbols(motifShim, shimFunctions) !=0) return -1; #endif return 0; }
void CallDaemon::loadConfig() { ZConfig conf(getProgramDir()+"incalladd.ini", true); //allowout = conf.readBoolEntry("CONFIG","allowout"); showno = conf.readBoolEntry("CONFIG", "showno"); switchrc = conf.readBoolEntry("CONFIG", "switchcallrecord"); //ignorewav = conf.readEntry("FIREWALL","ignorewav"); //mode = conf.readEntry("FIREWALL", "mode"); qDebug(mode); //blacklist = conf.readListEntry("FIREWALL", "blacklist", QChar(';')); //whitelist = conf.readListEntry("FIREWALL", "whitelist", QChar(';')); iplist = conf.readListEntry("IP", "iplist", ';'); }
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 );} }
int main( int argc, _TCHAR* argv[] ) { _TCHAR* errorMsg; _TCHAR* program; _TCHAR* iniFile; _TCHAR* ch; _TCHAR** configArgv = NULL; int configArgc = 0; int exitCode = 0; int ret = 0; void * handle = 0; RunMethod runMethod; SetInitialArgs setArgs; setlocale(LC_ALL, ""); initialArgc = argc; initialArgv = malloc((argc + 1) * sizeof(_TCHAR*)); memcpy(initialArgv, argv, (argc + 1) * sizeof(_TCHAR*)); /* * Strip off any extroneous <CR> from the last argument. If a shell script * on Linux is created in DOS format (lines end with <CR><LF>), the C-shell * does not strip off the <CR> and hence the argument is bogus and may * not be recognized by the launcher or eclipse itself. */ ch = _tcschr( argv[ argc - 1 ], _T_ECLIPSE('\r') ); if (ch != NULL) { *ch = _T_ECLIPSE('\0'); } /* Determine the full pathname of this program. */ program = findProgram(argv); /* Parse configuration file arguments */ iniFile = checkForIni(argc, argv); if (iniFile != NULL) ret = readConfigFile(iniFile, &configArgc, &configArgv); else ret = readIniFile(program, &configArgc, &configArgv); if (ret == 0) { parseArgs (&configArgc, configArgv); } /* Parse command line arguments */ /* Overrides configuration file arguments */ parseArgs( &argc, argv ); /* Special case - user arguments specified in the config file * are appended to the user arguments passed from the command line. */ if (configArgc > 0) { createUserArgs(configArgc, configArgv, &argc, &argv); } /* Initialize official program name */ officialName = name != NULL ? _tcsdup( name ) : getDefaultOfficialName(program); /* Find the directory where the Eclipse program is installed. */ programDir = getProgramDir(program); /* Find the eclipse library */ eclipseLibrary = findLibrary(eclipseLibrary, program); if(eclipseLibrary != NULL) handle = loadLibrary(eclipseLibrary); if(handle == NULL) { errorMsg = malloc( (_tcslen(libraryMsg) + _tcslen(officialName) + 10) * sizeof(_TCHAR) ); _stprintf( errorMsg, libraryMsg, officialName ); if (!suppressErrors) displayMessage( officialName, errorMsg ); else _ftprintf(stderr, _T_ECLIPSE("%s:\n%s\n"), officialName, errorMsg); free( errorMsg ); exit( 1 ); } setArgs = (SetInitialArgs)findSymbol(handle, SET_INITIAL_ARGS); if(setArgs != NULL) setArgs(initialArgc, initialArgv, eclipseLibrary); else { if(!suppressErrors) displayMessage(officialName, entryMsg); else _ftprintf(stderr, _T_ECLIPSE("%s:\n%s\n"), officialName, entryMsg); exit(1); } runMethod = (RunMethod)findSymbol(handle, RUN_METHOD); if(runMethod != NULL) exitCode = runMethod(argc, argv, userVMarg); else { if(!suppressErrors) displayMessage(officialName, entryMsg); else _ftprintf(stderr, _T_ECLIPSE("%s:\n%s\n"), officialName, entryMsg); exit(1); } unloadLibrary(handle); free( eclipseLibrary ); free( programDir ); free( program ); free( officialName ); return exitCode; }
/* * Find the VM shared library starting from the java executable */ static _TCHAR* findLib( _TCHAR* command ) { int i, j; size_t pathLength; struct _stat stats; _TCHAR * path; /* path to resulting jvm shared library */ _TCHAR * location; /* points to begining of jvmLocations section of path */ /* for looking in the registry */ HKEY jreKey = NULL; DWORD length = MAX_PATH; _TCHAR keyName[MAX_PATH]; _TCHAR * jreKeyName; if (command != NULL) { location = lastDirSeparator( command ) + 1; /*check first to see if command already points to the library */ if (isVMLibrary(command)) { if (_tstat( command, &stats ) == 0 && (stats.st_mode & S_IFREG) != 0) return command; /* exists */ return NULL; /* doesn't exist */ } pathLength = (size_t) (location - command); path = malloc((pathLength + MAX_LOCATION_LENGTH + 1 + _tcslen(vmLibrary) + 1) * sizeof(_TCHAR)); _tcsncpy(path, command, pathLength); location = &path[pathLength]; /* * We are trying base/jvmLocations[*]/vmLibrary * where base is the directory containing the given java command, normally jre/bin */ i = -1; while(jvmLocations[++i] != NULL) { _stprintf(location, _T_ECLIPSE("%s%c%s"), jvmLocations[i], dirSeparator, vmLibrary); if (_tstat( path, &stats ) == 0 && (stats.st_mode & S_IFREG) != 0) { /* found it */ return path; } } /* if command is eclipse/jre, don't look in registry */ location = malloc( (_tcslen( getProgramDir() ) + _tcslen( shippedVMDir ) + 1) * sizeof(_TCHAR) ); _stprintf( location, _T_ECLIPSE("%s%s"), getProgramDir(), shippedVMDir ); if( _tcsncmp(command, location, _tcslen(location)) == 0) { free(location); return NULL; } free(location); } /* Not found yet, try the registry, we will use the first vm >= 1.4 */ jreKeyName = _T("Software\\JavaSoft\\Java Runtime Environment"); if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, jreKeyName, 0, KEY_READ, &jreKey) == ERROR_SUCCESS) { if(RegQueryValueEx(jreKey, _T_ECLIPSE("CurrentVersion"), NULL, NULL, (void*)&keyName, &length) == ERROR_SUCCESS) { path = checkVMRegistryKey(jreKey, keyName); if (path != NULL) { RegCloseKey(jreKey); return path; } } j = 0; length = MAX_PATH; while (RegEnumKeyEx(jreKey, j++, keyName, &length, 0, 0, 0, 0) == ERROR_SUCCESS) { /*look for a 1.4 or 1.5 vm*/ if( _tcsncmp(_T("1.4"), keyName, 3) <= 0 ) { path = checkVMRegistryKey(jreKey, keyName); if (path != NULL) { RegCloseKey(jreKey); return path; } } } RegCloseKey(jreKey); } return NULL; }
void ZGui::CreateWindow ( QWidget * ) { ///Set title window setMainWidgetTitle ( "zTextEdit" ); ///load lenguage ProgDir = getProgramDir(); lng->ProgDir = ProgDir; lng->autoLoadLng(); ///Load settings ZConfig cfg(ProgDir+"/zTextEdit.cfg"); cfg_fontSize = cfg.readNumEntry(QString("GUI"), QString("FontSize"), 15); cfg_underline = cfg.readBoolEntry(QString("GUI"), QString("Underline"), true); cfg_autoOpen = cfg.readBoolEntry(QString("GUI"), QString("AutoOpen"), false); cfg_menuCopy = cfg.readBoolEntry(QString("GUI"), QString("MenuCopyOnDial"), false); #ifdef MDI curDlg=0; countDlg=1; #endif if (cfg_autoOpen) { sFileName = cfg.readEntry(QString("LastFile"), QString("FileName"), ""); sFilePath = cfg.readEntry(QString("LastFile"), QString("FilePath"), ""); } cfg_chineseCodeDetect = cfg.readBoolEntry(QString("Enginea"), QString("ChineseCodeDetect"), false); #ifdef SELECT_CUR_LINE cfg_selCurLine = cfg.readBoolEntry(QString("GUI"), QString("SelCurLine"), false); #endif /* #if !( defined(EZX_ZN5) || defined(EZX_U9) || defined(EZX_Z6W) ) cfg_infoBar = cfg.readBoolEntry(QString("GUI"), QString("InfoBar"), false); //Create info bar if ( cfg_infoBar ) { ZAppInfoArea *pAIA = new ZAppInfoArea(this); #if defined(EZX_Z6) || defined(EZX_V8) pAIA->setActArea( ZAppInfoArea::no_progress_meter ); #else pAIA->setActArea( ZAppInfoArea::NO_PROGRESS_METER ); #endif pAIA->setInputArea(); setAppInfoArea( pAIA ); } #endif */ ///Create main widget on window #ifndef MDI edit = new ZMultiLineEdit( this, false, 1, "ZMultiLineEdit" ); CHECK_PTR(edit); setSettingToEdit(edit); setContentWidget(edit); edit->setGeometry( ZGlobal::getContentR( false ) ); #else wStack = new QWidgetStack(this); curDlg=0; zmeEditList[curDlg] = new ZMultiLineEdit( this, false, 1, "ZMultiLineEdit" ); dlgCapList[curDlg] = "New"; CHECK_PTR(zmeEditList[curDlg]); setSettingToEdit(zmeEditList[curDlg]); wStack->addWidget(zmeEditList[curDlg], curDlg); setContentWidget(wStack); wStack->raiseWidget(curDlg); #endif textCode=0; ///Create SoftKey and Menu ZSoftKey *softKey = new ZSoftKey ( NULL , this , this ); QPixmap* pm = new QPixmap(); QRect rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); MainMenu = new ZOptionsMenu ( rect, softKey, NULL, 0 ); MainMenu->setItemSpacing(10); ///File Menu FileMenu = new ZOptionsMenu ( rect, softKey, NULL, 0 ); FileMenu->setItemSpacing(10); pm->load(ProgDir+ "/img/new.png"); FileMenu->insertItem ( MENU_FIX+lng->getString("NEW"), NULL, pm, true, 0, 0 ); pm->load(ProgDir+ "/img/open.png"); FileMenu->insertItem ( MENU_FIX+lng->getString("OPEN"), NULL, pm, true, 1, 1 ); pm->load(ProgDir+ "/img/save.png"); FileMenu->insertItem ( MENU_FIX+lng->getString("SAVE"), NULL, pm, true, 2, 2 ); pm->load(ProgDir+ "/img/fake.png"); FileMenu->insertItem ( MENU_FIX+lng->getString("SAVEAS"), NULL, pm, true, 3, 3 ); FileMenu->connectItem ( 0, this, SLOT ( slot_fileNew() ) ); FileMenu->connectItem ( 1, this, SLOT ( slot_fileOpen() ) ); FileMenu->connectItem ( 2, this, SLOT ( slot_fileSave() ) ); FileMenu->connectItem ( 3, this, SLOT ( slot_fileSaveAs() ) ); pm->load(ProgDir+ "/img/new.png"); MainMenu->insertItem ( MENU_FIX+lng->getString("FILE"), FileMenu, pm , true , 1, 1 ); ///Edit Menu EditMenu = new ZOptionsMenu ( rect, softKey, NULL, 0 ); EditMenu->setItemSpacing(10); pm->load(ProgDir+ "/img/copy.png"); EditMenu->insertItem ( MENU_FIX+lng->getString("COPY"), NULL, pm, true, 0, 0); pm->load(ProgDir+ "/img/cut.png"); EditMenu->insertItem ( MENU_FIX+lng->getString("CUT"), NULL, pm, true, 1, 1); pm->load(ProgDir+ "/img/paste.png"); EditMenu->insertItem ( MENU_FIX+lng->getString("PASTE"), NULL, pm, true, 2, 2); pm->load(ProgDir+ "/img/select_all.png"); EditMenu->insertItem ( MENU_FIX+lng->getString("SELECT_ALL"), NULL, pm, true, 3, 3); pm->load(ProgDir+ "/img/fake.png"); EditMenu->insertItem ( MENU_FIX+lng->getString("SELECT_BLOCK"), NULL, pm, true, 4, 4); EditMenu->connectItem ( 0, this, SLOT ( slot_editCopy() ) ); EditMenu->connectItem ( 1, this, SLOT ( slot_editCut() ) ); EditMenu->connectItem ( 2, this, SLOT ( slot_editPaste() ) ); EditMenu->connectItem ( 3, this, SLOT ( slot_editSelAll() ) ); EditMenu->connectItem ( 4, this, SLOT ( slot_editSelectBlock() ) ); pm->load(ProgDir+ "/img/edit.png"); MainMenu->insertItem ( MENU_FIX+lng->getString("EDIT"), EditMenu, pm , true , 2, 2 ); CodeMenu = new ZOptionsMenu ( rect, softKey, NULL, 0 ); CodeMenu->setItemSpacing(10); #if !(defined(EZX_Z6) || defined(EZX_V8)) CodeMenu->insertItem ( "UTF-8", NULL, NULL, true, 0, 0, false, true, true ); CodeMenu->insertItem ( "Win1251", NULL, NULL, true, 1, 1, false, true ); CodeMenu->insertItem ( "KOI8-R", NULL, NULL, true, 2, 2, false, true ); CodeMenu->insertItem ( "ISO8859-1", NULL, NULL, true, 3, 3, false, true ); CodeMenu->insertItem ( "ISO8859-2", NULL, NULL, true, 4, 4, false, true ); CodeMenu->insertItem ( "ISO8859-5", NULL, NULL, true, 5, 5, false, true ); CodeMenu->insertItem ( "KOI8-U", NULL, NULL, true, 6, 6, false, true ); CodeMenu->insertItem ( "Big5", NULL, NULL, true, 7, 7, false, true ); CodeMenu->insertItem ( "GBK", NULL, NULL, true, 8, 8, false, true ); #else CodeMenu->insertItem ( "UTF-8", NULL, NULL, NULL, true, true, true, 0, 0 ); CodeMenu->insertItem ( "Win1251", NULL, NULL, NULL, true, true, false, 1, 1 ); CodeMenu->insertItem ( "KOI8-R", NULL, NULL, NULL, true, true, false, 2, 2 ); CodeMenu->insertItem ( "ISO8859-1", NULL, NULL, NULL, true, true, false, 3, 3 ); CodeMenu->insertItem ( "ISO8859-2", NULL, NULL, NULL, true, true, false, 4, 4 ); CodeMenu->insertItem ( "ISO8859-5", NULL, NULL, NULL, true, true, false, 5, 5 ); CodeMenu->insertItem ( "KOI8-U", NULL, NULL, NULL, true, true, false, 6, 6 ); CodeMenu->insertItem ( "Big5", NULL, NULL, NULL, true, true, false, 7, 7 ); CodeMenu->insertItem ( "GBK", NULL, NULL, NULL, true, true, false, 8, 8 ); #endif #define CODEC_COUNT 9 connect( CodeMenu, SIGNAL( activated( int ) ), this, SLOT( slot_codecChenged( int ) ) ); pm->load(ProgDir+ "/img/fake.png"); MainMenu->insertItem ( MENU_FIX+lng->getString("CODE"), CodeMenu, pm, true , 3, 3 ); #ifdef MDI DlgMenu = new ZOptionsMenu ( rect, softKey, NULL, 0 ); DlgMenu->setItemSpacing(10); connect( DlgMenu, SIGNAL( activated( int ) ), this, SLOT( slot_dlgChenged( int ) ) ); pm->load(ProgDir+ "/img/document.png"); MainMenu->insertItem ( MENU_FIX+lng->getString("DLG"), DlgMenu, pm, true , 3, 3 ); buildDlgMenu(); #endif pm->load(ProgDir+ "/img/find.png"); MainMenu->insertItem ( MENU_FIX+lng->getString("SEARCH"), NULL, pm, true, 4, 4 ); pm->load(ProgDir+ "/img/options.png"); MainMenu->insertItem ( MENU_FIX+lng->getString("OPTION"), NULL, pm, true, 5, 5 ); pm->load(ProgDir+ "/img/about.png"); MainMenu->insertItem ( MENU_FIX+lng->getString("ABOUT"), NULL, pm, true, 6, 6 ); pm->load(ProgDir+ "/img/exit.png"); MainMenu->insertItem ( MENU_FIX+lng->getString("EXIT"), NULL, pm, true, 7, 7 ); MainMenu->connectItem ( 4, this, SLOT ( slot_fileFind() ) ); MainMenu->connectItem ( 5, this, SLOT ( slot_settings() ) ); MainMenu->connectItem ( 6, this, SLOT ( slot_about() ) ); MainMenu->connectItem ( 7, this, SLOT ( slot_exit() ) ); softKey->setTextForOptMenuHide(lng->getString("FILE")); softKey->setText ( ZSoftKey::LEFT, lng->getString("FILE"), ( ZSoftKey::TEXT_PRIORITY ) 0 ); softKey->setText ( ZSoftKey::RIGHT, lng->getString("EXIT"), ( ZSoftKey::TEXT_PRIORITY ) 0 ); softKey->setOptMenu ( ZSoftKey::LEFT, MainMenu ); softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( slot_exit() ) ); #if defined(EZX_ZN5) || defined(EZX_U9) || defined(EZX_Z6W) edit->setFixedHeight( SCREEN_HEIGHT - headerSize().height() - softKey->height()); #endif setSoftKey ( softKey ); ///Connect std signal #ifndef EZX_VE66 connect( qApp, SIGNAL(signalRaise()), this, SLOT(slot_Raise()) ); connect( qApp, SIGNAL(askReturnToIdle(int)), this, SLOT(slot_ReturnToIdle(int)) ); #endif ///init peremen textCode = 0; pos = NULL; isMarck = false; ///load file if need if ( !cfg_autoOpen ) sFileName = ""; QFile file; if ( qApp->argc() > 1 ) { sFileName = ""; if ( file.exists(QString::fromUtf8(qApp->argv()[1])) ) sFileName = QString::fromUtf8(qApp->argv()[1]); else if ( qApp->argc() > 2 ) if ( file.exists(QString::fromUtf8(qApp->argv()[2])) ) sFileName = QString::fromUtf8(qApp->argv()[2]); sFilePath = getFilePath(sFileName); sFileName = getFileName(sFileName); } if ( sFileName.isEmpty() || sFilePath.isEmpty() ) slot_fileNew(); else load(sFilePath+sFileName); }
void ZGui::CreateWindow ( QWidget* parent ) { setMainWidgetTitle ( "zCleaner" ); ZWidget *myWidget = new ZWidget ( this, NULL, 0, ( ZSkinService::WidgetClsID ) 40 ); QFont f ( qApp->font() ); f.setPointSize ( 10 ); myWidget->setFont ( f ); QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 ); //***************************** //*** add elements here QLabel *myLabel = new QLabel ( QString ( "<qt><font size=\"+1\">zCleaner</font><br>" "<font size=\"-1\">Simple antivirus for Z6</font></qt>" ), myWidget ); myVBoxLayout->addWidget ( myLabel, 0 ); myLabel->setIndent ( 5 ); myLabel->setAutoResize ( true ); scrollPanel = new ZScrollPanel ( myWidget, NULL, 0, ( ZSkinService::WidgetClsID ) 0 ); scrollPanel->resize ( 240, 320 ); //----------------------------------------------------------------------------------- modo=new ZComboBox(this,"ZComboBox",true);//declaro los combobox lugar=new ZComboBox(this,"ZComboBox",true); modo->insertItem("Clean", 0 ); modo->insertItem("AV", 1 ); //modo->insertItem("Picture/Video", 2 ); scrollPanel->addChild(modo , 100 , 5);//agrego el combobox de las apps al escritorio lab1 = new ZLabel("Mode" , this, "ZLabel", 0, (ZSkinService::WidgetClsID)4); lab1->setPreferredWidth(240); lab1->setAutoResize(true ); scrollPanel->addChild(lab1 , 10 , 8);//agrego el label al menu lugar->insertItem("SD",0); lugar->insertItem("Phone",1); lugar->insertItem("SD/Phone",2); scrollPanel->addChild(lugar , 100 , 55);//agrego el propiestario al escritorio lab2 = new ZLabel("Location" , this, "ZLabel", 0, (ZSkinService::WidgetClsID)4); lab2->setPreferredWidth(240); lab2->setAutoResize(true ); scrollPanel->addChild(lab2 , 10 , 58);//agrego el label al menu myVBoxLayout->addWidget ( scrollPanel, 0 ); //***************************** setContentWidget ( myWidget ); //************** softkeys and menus ************************** ZSoftKey *softKey = new ZSoftKey ( NULL , this , this ); QPixmap* pm = new QPixmap(); QRect rect, rect2, rect3, rect4; ZOptionsMenu* agre = new ZOptionsMenu ( rect3, softKey, NULL, 0, ( ZSkinService::WidgetClsID ) 2 ); //pm->load(getProgramDir() + "img/about.png"); agre->insertItem ( QString ( " ASK" ), NULL, NULL, true, 0, 0 ); agre->insertItem ( QString ( " DELETE" ), NULL, NULL, true, 1, 1 ); agre->connectItem ( 0, this, SLOT ( agregarTipoASK() ) ); agre->connectItem ( 1, this, SLOT ( agregarTipoDELETE() ) ); ZOptionsMenu* borr = new ZOptionsMenu ( rect4, softKey, NULL, 0, ( ZSkinService::WidgetClsID ) 2 ); borr->insertItem ( QString ( " ASK" ), NULL, NULL, true, 0, 0 ); borr->insertItem ( QString ( " DELETE" ), NULL, NULL, true, 1, 1 ); borr->connectItem ( 0, this, SLOT ( eliminarTipoASK() ) ); ZOptionsMenu* data = new ZOptionsMenu ( rect2, softKey, NULL, 0, ( ZSkinService::WidgetClsID ) 2 ); pm->load(getProgramDir() + "img/add.png"); data->insertItem ( QString ( " Add type" ), agre, pm, true, 0, 0 ); pm->load(getProgramDir() + "img/remove.png"); data->insertItem ( QString ( " Remove type" ), borr, pm, true, 1, 1 ); ZOptionsMenu* menu = new ZOptionsMenu ( rect, softKey, NULL, 0, ( ZSkinService::WidgetClsID ) 2 ); pm->load(getProgramDir() + "img/about.png"); menu->insertItem ( QString ( " About" ), NULL, pm, true, 0, 0 ); menu->insertSeparator(1, 1); pm->load(getProgramDir() + "img/white.png"); menu->insertItem ( QString ( " Clean" ), NULL, pm, true, 2, 2 ); pm->load(getProgramDir() + "img/properties.png"); menu->insertItem ( QString ( " Database" ), data, pm, true, 3, 3 ); pm->load(getProgramDir() + "img/edit.png"); menu->insertItem ( QString ( " Save delete files list" ), NULL, pm, true, 4, 4 ); menu->insertSeparator(5, 5); pm->load(getProgramDir() + "img/exit.png"); menu->insertItem ( QString ( " Exit" ), NULL, pm, true, 6, 6 ); menu->connectItem ( 6, qApp, SLOT ( quit() ) ); menu->connectItem ( 2, this, SLOT ( ejecutar() ) ); menu->connectItem ( 0, this, SLOT ( about() ) ); menu->connectItem ( 4, this, SLOT ( verEliminados() ) ); softKey->setOptMenu ( ZSoftKey::LEFT, menu ); softKey->setText ( ZSoftKey::LEFT, "Menu", ( ZSoftKey::TEXT_PRIORITY ) 0 ); softKey->setText ( ZSoftKey::RIGHT, "Exit", ( ZSoftKey::TEXT_PRIORITY ) 0 ); softKey->setClickedSlot ( ZSoftKey::RIGHT, qApp, SLOT ( quit() ) ); setSoftKey ( softKey ); }
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;