QOptionsDialog::QOptionsDialog(const std::string &id, const std::string &caption) :
    FullScreenDialog(caption.c_str()),
    ZLOptionsDialog(id),
    tabno(0)
{
	cap = caption;
	myTabWidget = new MyTabWidget(this);
	setContentWidget(myTabWidget);


	ZSoftKey *softKey = (ZSoftKey *)getCSTWidget(true);

	QRect rect;
	menu = new ZOptionsMenu(rect, softKey, NULL, 0, (ZSkinService::WidgetClsID)4);
	softKey->setOptMenu(ZSoftKey::LEFT, menu);
	softKey->setText(ZSoftKey::LEFT, "Menu", (ZSoftKey::TEXT_PRIORITY)0);

	QRect rect2;
	ZOptionsMenu * menu2 = new ZOptionsMenu(rect2, softKey, NULL, 0, (ZSkinService::WidgetClsID)4);
	menu2->insertItem(QString("Accept"), NULL, NULL, true, 0, 0);
	menu2->insertItem(QString("Cancel"), NULL, NULL, true, 1, 1 );
	softKey->setOptMenu(ZSoftKey::RIGHT, menu2);
	softKey->setText(ZSoftKey::RIGHT, "Done", (ZSoftKey::TEXT_PRIORITY)0);

	connect(menu, SIGNAL(activated(int)), this, SLOT(selectTab(int)));

	menu2->connectItem(0, this, SLOT(accept()));
	menu2->connectItem(1, this, SLOT(reject()));
}
Example #2
0
ZAddAppDlg::ZAddAppDlg()
    :MyBaseDlg()
{
	toLog("ZAddAppDlg: Start");	
  	setMainWidgetTitle(lng->getString("DLG_ADD"));
  	
	lbAppList = new ZListBox ( QString ( "%I%M" ), this, 0);
	lbAppList->setFixedWidth ( SCREEN_WHIDTH ); 
	lbAppList->sort(true);

	setContentWidget ( lbAppList );

	ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
	softKey->setText ( ZSoftKey::LEFT, lng->getString("ADD"), ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setText ( ZSoftKey::RIGHT, lng->getString("CANCEL"), ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( reject() ) );
	softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
	setCSTWidget ( softKey );
	
	toLog("ZAddAppDlg: Build app list");
	
	procReg( CARD_REGISTRY );
	#ifdef OLD_PLATFORM
	procReg( USER_REGISTRY);
	#endif
	procReg( SYS_REGISTRY );
	procReg( INSTALLED_DB );

	toLog("ZAddAppDlg: End");
}
//************************************************************************************************
//************************************** class ZFileOpenDialog ***********************************
//************************************************************************************************
ZFileOpenDialog::ZFileOpenDialog()
  :MyBaseDlg()
{
  setMainWidgetTitle ( "Cron" );

  browser = new ZListBox ( QString ( "%C18%I%M" ), this, 0);
  browser->setFixedWidth ( 240 );
  connect(browser, SIGNAL(returnPressed(ZListBoxItem *)), SLOT(brClicked()));

  sPath = "/";
  CargarBrowser( sPath );

  setContentWidget ( browser );
  
  ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );

  QString ProgDir = QString ( qApp->argv() [0] ) ;
  int i = ProgDir.findRev ( "/" );
  ProgDir.remove ( i+1, ProgDir.length() - i );

  QString val; 
  ZConfig readlang("/ezxlocal/download/appwrite/setup/ezx_system.cfg", true);
  Idioma2 = "ezxlocal/download/mystuff/.system/LinXtend/usr/languages/" + readlang.readEntry(QString("SYS_SYSTEM_SET"), QString("LanguageType"), "en-us");
  if ( ! QFileInfo(Idioma2).isFile() ) Idioma2 = "/ezxlocal/download/mystuff/.system/LinXtend/usr/languages/en-us";

  ZConfig IDini(Idioma2, false);
  QString IDval = IDini.readEntry(QString("COMMON"), QString("MENU_SELECT"), "");
  softKey->setText ( ZSoftKey::LEFT, IDval, ( ZSoftKey::TEXT_PRIORITY ) 0 );
  IDval = IDini.readEntry(QString("COMMON"), QString("MENU_CANCEL"), "");
  softKey->setText ( ZSoftKey::RIGHT, IDval, ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( reject() ) );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
  setCSTWidget ( softKey );
}
Example #4
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 );  	
}
Example #5
0
void MainWidget::next(){
	//printf("connected()\n");
	
	pProgressDialog = new ZProgressDlg("", "Пожалуйста, подождите...", 140, 100, this);
	ZSoftKey* zsoft = pProgressDialog->getSoftKey();

	zsoft->disableClickedSlot(ZSoftKey::LEFT);
	zsoft->disableClickedSlot(ZSoftKey::RIGHT);

	zsoft->setText(ZSoftKey::LEFT, "", ZSoftKey::ZERO);
	zsoft->setText(ZSoftKey::RIGHT, "", ZSoftKey::ZERO);
	
	getProgress = 0;
	pProgressDialog->setProgress(getProgress);
	pProgressDialog->raise();
	pProgressDialog->show();

	if (!timer->isActive()) timer->start(500, FALSE);
	
	QString text1 = LineEdit1->text();
	
	text1 = decodeChar(text1); // TODO: to do something about it

	QString text = QString::fromUtf8(toPercentEncoding(text1));
	printf("Text=%s\n",text.latin1());
#if ALT_TRANSLATE
	QString url2 = QString(	"GET "
							"/ajax/services/language/translate?v=2.0&;hl=ru&q="
							+ QString(text)
							+ "&langpair="
							+ QString(lang_src)
							+ "|"
							+ QString(lang_dst) +
							" HTTP/1.1\r\n"
							"User-Agent: " "Mozilla/5.0" "\r\n"
							"Host: " "ajax.googleapis.com" "\r\n"
							"Connection: Close\r\n\r\n"							
							);
#else
	QString url2 = QString(	"GET "
							"/translate_a/t?client=t&sl="
							+ QString(lang_src)
							+ 	"&tl="
							+ QString(lang_dst) +
							+ "&text="
							+ QString(text) +
							" HTTP/1.1\r\n"
							"User-Agent: " "Mozilla/5.0" "\r\n"
							"Host: " "www.google.com " "\r\n"
							"Connection: Close\r\n\r\n"
							);
#endif						
	socket.writeBlock(url2, url2.length());


}
//************************************************************************************************
//*************************************** class ZSearch ******************************************
//************************************************************************************************
ZSearch::ZSearch(const QString &curPath, const QString &originName)
  :MyBaseDlg()
{
  QString ProgDir =  QString ( qApp->argv() [0] );
  int i = ProgDir.findRev ( "/" );
  ProgDir.remove ( i+1, ProgDir.length() - i );

  ZConfig readlang("/ezxlocal/download/appwrite/setup/ezx_system.cfg", true);
  Idioma = ProgDir + "/languages/" + readlang.readEntry(QString("SYS_SYSTEM_SET"), QString("LanguageType"), "en-us");
  if ( ! QFileInfo(Idioma).isFile() ) Idioma = ProgDir + "/languages/en-us";
  ZConfig lang (Idioma,false); 

  this->setMainWidgetTitle("zTextViewer");
  
  QWidget *myWidget = new ZWidget ( this, NULL, 0);
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  myWidget->setFixedWidth(240);
  ZAppInfoArea* pAIA = new ZAppInfoArea(myWidget, NULL, 0);
  pAIA->setActArea(ZAppInfoArea::no_progress_meter);
  pAIA->appendText(ZAppInfoArea::activity, lang.readEntry(QString("TEXTVIEWER"), "IDS_SAVE", ""), "name");
  setAppInfoArea(pAIA);
  myVBoxLayout->addWidget ( pAIA, 1, 1 );

    ZFormContainer* fc = new ZFormContainer(this);
    setContentWidget(fc);

    lineEdit = new ZLineEdit(this, NULL);
    lineEdit->setTitle(lang.readEntry(QString("TEXTVIEWER"), "IDS_ENTER_FILE_NAME", ""));
    lineEdit->setTitlePosition(ZLineEdit::TitleTop);
    lineEdit->setMaxLength(50);
	lineEdit->setText(originName);
    fc->addChild(lineEdit);

 	buttonDir = new myButton(this, "ZPressButton");
	buttonDir->setTitle(lang.readEntry(QString("TEXTVIEWER"), "IDS_LOCATION", ""));
	QString direc = curPath;
	if ( direc == "" ) direc = "/mmc/mmca1";
	if ( direc[direc.length()-1] == QChar('/') ) 
	  {	direc.remove( direc.length()-1, 1 ); }
    buttonDir->setText(direc); 
	FStext=direc;
	buttonDir->setPixmap(QPixmap(ProgDir+"/img/folder.png"));
    fc->addChild(buttonDir);
	

  ZSoftKey *softKey = new ZSoftKey ( "CST_2A", this, this );
  softKey->setText ( ZSoftKey::RIGHT, lang.readEntry(QString("TEXTVIEWER"), "IDS_CANCEL", ""), ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setText ( ZSoftKey::LEFT, lang.readEntry(QString("TEXTVIEWER"), "IDS_SAVE", ""), ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( slot_cancel() ) );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( slot_search() ) );


  this->setCSTWidget( softKey );

}
ZAddProfile::ZAddProfile()
    :MyBaseDlg()
{
	id = "";
	pas = "";
	edit = false;
	num = 0;
    prot = 0;

	setMainWidgetTitle(LNG_ADDPROFILE);
	
	ZFormContainer *form = new ZFormContainer(this, 0, ZSkinService::clsZFormContainer);
	setContentWidget(form);
	
	zcbProtocol = new ZComboBox(form);
	zcbProtocol->setTitle( LNG_PROTOCOL );
	QPixmap pm;
	pm.load(ProgDir+ "/status/icq/online.png");
	zcbProtocol->insertItem(pm, "ICQ", 0);
	#ifdef _XMPP
	pm.load(ProgDir+ "/status/jabber/online.png");
	zcbProtocol->insertItem(pm, "JABBER", 1);
	#endif
		
	form->addChild(zcbProtocol);
	
	zleID = new ZLineEdit("", form);
	zleID->setTitle( LNG_LOGIN );
	form->addChild ( zleID );
	
	zlePas = new ZLineEdit("", form);
	zlePas->setTitle( LNG_PASSWORD );
	setInputMethod(zlePas, ZKB_INPUT_MULTITAP, ZKbInputField::FIELD_TYPE_PASSWORD);
	zlePas->setEchoMode(ZLineEdit::Password);
	form->addChild ( zlePas );

	connect ( zcbProtocol, SIGNAL ( activated(int) ), this, SLOT ( changeProtocol(int) ) );
	changeProtocol(0);

	QValueList<QUuid> flist2;
	flist2.append( ZKB_INPUT_MULTITAP );
	flist2.append( ZKB_INPUT_SYMBOL );
	setInputMethods((QWidget*)zlePas, (const QUuid&)ZKB_INPUT_MULTITAP, flist2);
	
	ZSoftKey *softKey  = new ZSoftKey("CST_2", this, this);
	softKey->setText ( ZSoftKey::LEFT, LNG_ADD, ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setText ( ZSoftKey::RIGHT, LNG_CANCEL, ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( reject() ) );
	softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( addProfile() ) );
	setSoftKey(softKey);
}
saveDlg :: saveDlg(QString title, QString name) : ZPopup()
{
//	lng = new Lng();
	#ifndef ZN5
	oldMode = getMorphMode();
	setMorphMode(3);
	#endif
	CardExist = false;
	checkedIndex = -1;	
	QDir dir;
	//if ( dir.exists( QString(SD_MPKGBOX) ) )
	//	CardExist = true;	
		
	if( !dir.exists( QString(SKIN_FILE) ) )
		dir.mkdir( QString(SKIN_FILE) );
	//if( !dir.exists( QString(PH_MGX_FILE) ) )	
	//	dir.mkdir( QString(PH_MGX_FILE) );
		
	//ZConfig cfg(MGX_OBJ_PATH);
   // QString path = cfg.readEntry( gname, "Directory", "");	
	//QString oldName = cfg.readEntry( gname, "Name", "");	
		
	//this->enableAia(true);
	this->setTitle(title);
	this->setInstructText(name);
	this->setTitleIcon("action_required_pop.bmp");

	editGroupBox = new ZGroupBox(lng->tr("FT_SAVENAME"), this);

	lineEdit = new ZLineEdit(name, editGroupBox, 0, (ZSkinService::WidgetClsID)39);
	lineEdit->selectAll();
	lineEdit->resize(300, 40);

	this->insertChild(editGroupBox);

	pathGroupBox = new ZGroupBox(lng->tr("FT_SAVEPATH"), this);

	pathBox = new ZComboBox(pathGroupBox);
	pathBox->insertItem(lng->tr("FT_PHONE"), 0);
	if (CardExist) pathBox->insertItem(lng->tr("FT_MMCA1"), 1);
	pathBox->resize(300, 40);

	this->insertChild(pathGroupBox);

	ZSoftKey *softKey = this->getSoftKey();
	softKey->setText(ZSoftKey::LEFT,  tr("TXT_RID_SOFTKEY_OK", "Ok"));
	softKey->setText(ZSoftKey::RIGHT, tr("TXT_RID_SOFTKEY_CANCEL", "Cancel"));
	softKey->setClickedSlot(ZSoftKey::LEFT, this, SLOT(ok()));
	softKey->setClickedSlot(ZSoftKey::RIGHT, this, SLOT(cancel()));
}
Example #9
0
void ZFonts::CreateWindow ( QWidget* parent )
{
	//Set title window
	setMainWidgetTitle ( "zFonts" );
	
	lbFonts = new ZListBox(this);
	
	QFont font ( qApp->font() ); 
	font.setPointSize ( 18 );
	lbFonts->setItemFont( ZListBox::LISTITEM_REGION_A, ZListBox::StStandard, font );	
	lbFonts->setItemFont( ZListBox::LISTITEM_REGION_A, ZListBox::StHighlighted, font );	
	
	connect ( lbFonts, SIGNAL( selected(int) ), this, SLOT( slot_fontSelect(int) ) );
	
	setContentWidget( lbFonts );

	fillFonts();

	//Create SoftKey and Menu
	ZSoftKey *softKey = new ZSoftKey ( NULL , this , this );
	
	QRect rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
	ZOptionsMenu* menu = new ZOptionsMenu ( rect, softKey, NULL, 0 );
	menu->setItemSpacing(12);
	
	QPixmap * pm = new QPixmap();

	pm->load(ProgDir+ "/view_font.png");
	menu->insertItem ( tr("TXT_RID_OPTION_PREVIEW", "Preview"), NULL, pm, true, 0, 0 );
	pm->load(ProgDir+ "/set_fonts.png");
	menu->insertItem ( tr("TXT_RID_SOFTKEY_INSTALL", "Install"), NULL, pm, true, 1, 1 );
	pm->load(ProgDir+ "/about.png");
	menu->insertSeparator(2, 2); 
	menu->insertItem ( tr("TXT_RID_SOFTKEY_ABOUT_JAVA", "About").replace("Java",""), NULL, pm, true, 3, 3 );
	pm->load(ProgDir+ "/exit.png");
	menu->insertItem ( tr("TXT_RID_OPTION_EXIT", "Exit"), NULL, pm, true, 4, 4 );
	
	menu->connectItem ( 0, this, SLOT ( slot_preview() ) );
	menu->connectItem ( 1, this, SLOT ( slot_install() ) );
	menu->connectItem ( 3, this, SLOT ( slot_about() ) );
	menu->connectItem ( 4, qApp, SLOT ( quit() ) );	
	
	softKey->setText ( ZSoftKey::LEFT, tr("TXT_RID_SOFTKEY_OPTIONS", "Options"), ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setText ( ZSoftKey::RIGHT, tr("TXT_RID_OPTION_EXIT", "Exit"), ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setOptMenu ( ZSoftKey::LEFT, menu );
	softKey->setClickedSlot ( ZSoftKey::RIGHT, qApp, SLOT ( quit() ) );
	
	setSoftKey ( softKey );
}
Example #10
0
SettingDlg::SettingDlg():MyBaseDlg()
{
    isCancel = true;
    isFullScreenMode = false;

    setMainWidgetTitle("App Setting");

    form0 = new ZFormContainer(this, 0, ZSkinService::clsZFormContainer);
    //listBox0 = new ZListBox("%C%M", this);
    form1 = new ZFormContainer(this, 0, ZSkinService::clsZFormContainer);
    form2 = new ZFormContainer(this, 0, ZSkinService::clsZFormContainer);
    form3 = new ZFormContainer(this, 0, ZSkinService::clsZFormContainer);
    form4 = new ZFormContainer(this, 0, ZSkinService::clsZFormContainer);

    tabWidget = new ZNavTabWidget(this);
    this->setContentWidget(tabWidget);
    tabWidget->stopNextWhenKeyRepeat(true);

    QPixmap imgTab;
    imgTab.load(getAppDir()+"/img/tab0.png");
    tabWidget->addTab(form0, QIconSet(imgTab), "");
    imgTab.load(getAppDir()+"/img/tab1.png");
    tabWidget->addTab(form1, QIconSet(imgTab), "");
    imgTab.load(getAppDir()+"/img/tab2.png");
    tabWidget->addTab(form2, QIconSet(imgTab), "");
    imgTab.load(getAppDir()+"/img/tab3.png");
    tabWidget->addTab(form3, QIconSet(imgTab), ""); ;
    imgTab.load(getAppDir()+"/img/tab4.png");
    tabWidget->addTab(form4, QIconSet(imgTab), "");

    ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
    softKey->setText(ZSoftKey::LEFT,  lng->tr("FT_SELECT"), (ZSoftKey::TEXT_PRIORITY)0);
    softKey->setText(ZSoftKey::RIGHT, lng->tr("FT_CANCEL"), (ZSoftKey::TEXT_PRIORITY)0);
    softKey->setClickedSlot(ZSoftKey::RIGHT, this, SLOT (reject()));
    softKey->setClickedSlot(ZSoftKey::LEFT, this, SLOT (accept()));
    setCSTWidget(softKey);

    imei = getIMEI();
    imsi = getIMSI();

    buildTab0();
    buildTab1();
    buildTab2();
    buildTab3();
    buildTab4();

    startTimer(300);
}
Example #11
0
ZAboutDialog::ZAboutDialog()
    :MyBaseDlg()
{
  setMainWidgetTitle ( "zCleaner" );

  QString ProgDir = QString ( qApp->argv() [0] ) ;
  int i = ProgDir.findRev ( "/" );
  ProgDir.remove ( i+1, ProgDir.length() - i );
  QWidget *myWidget = new QWidget ( this );
  //myWidget->setGeometry(0,0,240,320);
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  QHBoxLayout *myHBoxLayout = new QHBoxLayout;
  myHBoxLayout->setSpacing ( 4 );
  myHBoxLayout->setMargin ( 0 );

  QLabel *myLabel = new QLabel ( myWidget );
  myLabel->setPixmap ( QPixmap ( "folder.png" ) );
  myLabel->setScaledContents ( false );
  myHBoxLayout->addWidget ( myLabel );

  myLabel = new QLabel ( QString ( "<qt><img src=%1/img/zCleaner_usr.png><br>"
"<qt>zCleaner 0.3 by c_ro87<br>" "<qt>Base GUI zGui 0.7.4g by BeZ<br>"
                                   "<font size=\"-1\">zCleaner is a simple antivirus for Z6</font></qt>" ).arg(ProgDir), myWidget );
  myHBoxLayout->addWidget ( myLabel, 1 );
  myVBoxLayout->addLayout ( myHBoxLayout );

  myLabel = new QLabel ( QString ( "<qt><font size=\"-1\"><p>Copyright (C) 2008 c_ro87<br>"
                                   "<tt>&lt;[email protected]&gt;</tt><br></font></qt>" ),
                         myWidget );
  myVBoxLayout->addWidget ( myLabel );

  QSpacerItem* spacer = new QSpacerItem ( 8, 8, QSizePolicy::Minimum, QSizePolicy::Expanding );
  myVBoxLayout->addItem ( spacer );

  myLabel = new QLabel ( "www.modmymoto.com", myWidget );
  myVBoxLayout->addWidget ( myLabel );
  setContentWidget ( myWidget );

  ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
  softKey->setText ( ZSoftKey::LEFT, "OK", ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
  setCSTWidget ( softKey );
}
//************************************************************************************************
//************************************** class ZFolderSelect2 ***********************************
//************************************************************************************************
ZFolderSelect2::ZFolderSelect2(bool onlyDirs, QString path)
  :MyBaseDlg()
{
  QString ProgDir =  QString ( qApp->argv() [0] );
  int i = ProgDir.findRev ( "/" );
  ProgDir.remove ( i+1, ProgDir.length() - i );

  ZConfig readlang("/ezxlocal/download/appwrite/setup/ezx_system.cfg", true);
  Idioma = ProgDir + "/languages/" + readlang.readEntry(QString("SYS_SYSTEM_SET"), QString("LanguageType"), "en-us");
  if ( ! QFileInfo(Idioma).isFile() ) Idioma = ProgDir + "/languages/en-us";
  ZConfig lang (Idioma,false); 

  this->setMainWidgetTitle("zFileManager");
  
  QWidget *myWidget = new ZWidget ( this, NULL, 0);
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  myWidget->setFixedWidth(240);
  ZAppInfoArea* pAIA = new ZAppInfoArea(myWidget, NULL, 0);
  pAIA->setActArea(ZAppInfoArea::no_progress_meter);
  QPixmap pixmap; pixmap.load(ProgDir+"/img/folder.png");
  pAIA->appendIcon(ZAppInfoArea::activity,pixmap,"");
  pAIA->appendText(ZAppInfoArea::activity, lang.readEntry(QString("LANGUAGE"), "SEARCH_IN", ""), "name");
  setAppInfoArea(pAIA);
  myVBoxLayout->insertWidget (0, pAIA );

  fb = new FileBrowser2("*", onlyDirs, QString ( "%I%M" ), myWidget, 0);
  fb->setDir(path);
  QObject::connect(fb, SIGNAL(isFilePicked(bool)), SLOT(filePicked(bool)));

  
  fb->ProgramDir = ProgDir;
  setContentWidget ( fb );
  
  ZSoftKey *softKey = new ZSoftKey ( "CST_2A", this, this );
  
  softKey->setText ( ZSoftKey::RIGHT, lang.readEntry(QString("LANGUAGE"), "CANCEL", ""), ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setText ( ZSoftKey::LEFT, lang.readEntry(QString("LANGUAGE"), "CHOISE", ""), ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( slot_cancel() ) );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
   
  this->setCSTWidget( softKey );

}
//************************************************************************************************
//************************************** class ZFileSaveDialog ***********************************
//************************************************************************************************
ZFileSaveDialog::ZFileSaveDialog()
  :MyBaseDlg()
{
  QWidget *myWidget = new QWidget ( this );
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  
  // label
  QLabel *myLabel = new QLabel ( QString ( "Filename to save:" ), myWidget );
  myVBoxLayout->addWidget ( myLabel, 0 );
  myLabel->setIndent ( 5 );
  myLabel->setAutoResize ( true );
    
  // zlineedit
  zmle = new ZMultiLineEdit(myWidget, true, 1, "ZMultiLineEdit");
  zmle->setEdited(false);
  zmle->setFixedHeight(myWidget->sizeHint().height());
  zmle->setInsertionMethod ( ( ZMultiLineEdit::InsertionMethod ) 3 );
  zmle->setFontPercent ( 0.7 );
  zmle->setSizePolicy ( QSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
  zmle->setCellHeight(22);

  
  myVBoxLayout->addWidget ( zmle, 1 );
  
  fb = new FileBrowser("*", QString ( "%I%M" ), myWidget, 0, ( ZSkinService::WidgetClsID ) 4);
  fb->setDir("/");
  QObject::connect(fb, SIGNAL(isFilePicked(bool)), SLOT(filePicked(bool)));
  myVBoxLayout->addWidget ( fb, 1 );
  
  
  setContentWidget ( myWidget );
  
  ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
  ZConfig IDini("/tmp/Z6ManagerLang", false);
  QString IDval = IDini.readEntry(QString("Z6MANAGER"), QString("MENU_SELECT"), "");
  softKey->setText ( ZSoftKey::LEFT, IDval, ( ZSoftKey::TEXT_PRIORITY ) 0 );
  IDval = IDini.readEntry(QString("Z6MANAGER"), QString("MENU_CANCEL"), "");
  softKey->setText ( ZSoftKey::RIGHT, IDval, ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( reject() ) );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
  setCSTWidget ( softKey );
}
ZAboutDialog::ZAboutDialog()
    :MyBaseDlg()
{

  setMainWidgetTitle ( "Z6 Manager" );

  QString ProgDir = QString ( qApp->argv() [0] ) ;
  int i = ProgDir.findRev ( "/" );
  ProgDir.remove ( i+1, ProgDir.length() - i );

  QWidget *myWidget = new QWidget ( this );
  //myWidget->setGeometry(0,0,240,320);
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  QHBoxLayout *myHBoxLayout = new QHBoxLayout;
  myHBoxLayout->setSpacing ( 4 );
  myHBoxLayout->setMargin ( 10 );

  QLabel *myLabel = new QLabel ( myWidget );
  myLabel->setPixmap ( QPixmap ( "" ) );
  myLabel->setScaledContents ( false );
  myHBoxLayout->addWidget ( myLabel );

  myLabel = new QLabel ( QString ( "<qt><img src=%1/images/icon.png><br>"
                                   "<font size=\"+1\">Z6 Manager </font><font size=\"-1\">"
                                   "  v2.1<br><br>Motorola Z6 Linuxmod 2.1<br><br>developermoto.com/es<br>modmymoto.com<br>"
                                   "<br>(C) 2009. <br>CepiPerez / segnini75 / c_ro87"
                                   "</font></qt>" ).arg(ProgDir) , myWidget );
  myHBoxLayout->addWidget ( myLabel, 1 );
  myVBoxLayout->addLayout ( myHBoxLayout );

  QSpacerItem* spacer = new QSpacerItem ( 8, 8, QSizePolicy::Minimum, QSizePolicy::Expanding );
  myVBoxLayout->addItem ( spacer );

  //myLabel = new QLabel ( "Licensed under the GNU GPL.", myWidget );
  //myVBoxLayout->addWidget ( myLabel );
  setContentWidget ( myWidget );

  ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
  softKey->setText ( ZSoftKey::LEFT, "Aceptar", ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
  setCSTWidget ( softKey );
}
Example #15
0
ZAboutDialog::ZAboutDialog()
    :MyBaseDlg()
{
  QWidget *myWidget = new QWidget ( this );
  //myWidget->setGeometry(0,0,240,320);
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  QHBoxLayout *myHBoxLayout = new QHBoxLayout;
  myHBoxLayout->setSpacing ( 4 );
  myHBoxLayout->setMargin ( 0 );

  QLabel *myLabel = new QLabel ( myWidget );
  myLabel->setPixmap ( QPixmap ( "folder.png" ) );
  myLabel->setScaledContents ( false );
  myHBoxLayout->addWidget ( myLabel );

  myLabel = new QLabel ( QString ( "<qt>zAlarm 0.2<br>"
                                   "<font size=\"-1\">zAlarm alarm time changer</font></qt>" 
"<font size=\"-1\">Base GUI based on zGui 0.7.4g by BeZ </font></qt>"), myWidget );
  myHBoxLayout->addWidget ( myLabel, 1 );
  myVBoxLayout->addLayout ( myHBoxLayout );

  myLabel = new QLabel ( QString ( "<qt><font size=\"-1\"><p>Copyright (C) 2008 c_ro87<br>"
                                   "<tt>&lt;[email protected]&gt;</tt><br></font></qt>" ),
                         myWidget );
  myVBoxLayout->addWidget ( myLabel );

  QSpacerItem* spacer = new QSpacerItem ( 8, 8, QSizePolicy::Minimum, QSizePolicy::Expanding );
  myVBoxLayout->addItem ( spacer );

  myLabel = new QLabel ( "www.modmymoto.com", myWidget );
  myVBoxLayout->addWidget ( myLabel );
  setContentWidget ( myWidget );

  ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
  softKey->setText ( ZSoftKey::LEFT, "OK", ( ZSoftKey::TEXT_PRIORITY ) 0 );
  //softKey->setText ( ZSoftKey::RIGHT, "Reject", ( ZSoftKey::TEXT_PRIORITY ) 0 );
  //softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( reject() ) );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
  setCSTWidget ( softKey );
}
MediaBrowser::MediaBrowser(MEDIA_TYPE type):ZPopup()
{
	isCancel = true;
	mType = type;
	
	mCurDir = QString("/mmc");
	mSelectedFile = QString::null;
	
	#ifdef ZN5
	#define setTitle setMainWidgetTitle
	#define insertChild setContentWidget
	#define softkey_rep
	#endif
	this->setTitle( lng->tr("FT_FILEPICKER") );
	
	ZFormContainer *form = new ZFormContainer(this);

	this->insertChild(form);	

	listBox = new ZListBox ( QString ( "%I%M" ), this, 0);
	listBox->enableMarquee(ZListBox::LISTITEM_REGION_A, true);
	listBox->enableMarquee(ZListBox::LISTITEM_REGION_B, true);	
	form->addChild(listBox);
	
	#ifdef softkey_rep
	ZSoftKey *softKey = new ZSoftKey("CST_2A", this, this);
	this->setSoftKey(softKey);
	#else
	ZSoftKey *softKey = this->getSoftKey();
	#endif
	softKey->setText(ZSoftKey::LEFT,  lng->tr("FT_SELECT"));
    softKey->setText(ZSoftKey::RIGHT, lng->tr("FT_CANCEL"));	
	softKey->setClickedSlot(ZSoftKey::RIGHT, this, SLOT( slotCancel() ));
	softKey->setClickedSlot(ZSoftKey::LEFT, this, SLOT ( slotOK() ));	

	connect(listBox, SIGNAL( selected(int) ), this, SLOT( obj_click(int) ) );

	QTimer::singleShot(100, this, SLOT( initList() ) );

}	
//************************************************************************************************
//************************************** class ZFileSaveDialog ***********************************
//************************************************************************************************
ZFileSaveDialog::ZFileSaveDialog(const QString &curPath, const QString &originName)
  :MyBaseDlg()
{
  QWidget *myWidget = new QWidget ( this );
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  
  // label
  QLabel *myLabel = new QLabel ( QString ( "Nombre para guardar:" ), myWidget );
  myVBoxLayout->addWidget ( myLabel, 0 );
  myLabel->setIndent ( 5 );
  myLabel->setAutoResize ( true );
    
  // zlineedit
  zmle = new ZMultiLineEdit(myWidget, true, 1, "ZMultiLineEdit");
  zmle->setEdited(false);
  zmle->setFixedHeight(myWidget->sizeHint().height());
  zmle->setInsertionMethod ( ( ZMultiLineEdit::InsertionMethod ) 3 );
  zmle->setFontPercent ( 0.7 );
  zmle->setSizePolicy ( QSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
  //zmle->setCellHeight(22);
  zmle->setText(originName);
  
  myVBoxLayout->addWidget ( zmle, 1 );
  
  fb = new FileBrowser("*", QString ( "%I%M" ), myWidget, 0);
  fb->setDir(curPath);
  QObject::connect(fb, SIGNAL(isFilePicked(bool)), SLOT(filePicked(bool)));
  myVBoxLayout->addWidget ( fb, 1 );
  
  
  setContentWidget ( myWidget );
  
  ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
  softKey->setText ( ZSoftKey::LEFT, "Guardar", ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setText ( ZSoftKey::RIGHT, "Cancelar", ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( reject() ) );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
  setCSTWidget ( softKey );
}
//************************************************************************************************
//************************************** class ZFileOpenDialog ***********************************
//************************************************************************************************
ZFileOpenDialog::ZFileOpenDialog()
  :MyBaseDlg()
{
  
  QString ProgDir =  QString ( qApp->argv() [0] );
  int i = ProgDir.findRev ( "/" );
  ProgDir.remove ( i+1, ProgDir.length() - i );

  ZConfig readlang("/ezxlocal/download/appwrite/setup/ezx_system.cfg", true);
  Idioma = ProgDir + "/languages/" + readlang.readEntry(QString("SYS_SYSTEM_SET"), QString("LanguageType"), "en-us");
  if ( ! QFileInfo(Idioma).isFile() ) Idioma = ProgDir + "/languages/en-us";
  ZConfig lang (Idioma,false); 

  this->setMainWidgetTitle("zTextViewer");

  QWidget *myWidget = new ZWidget ( this, NULL, 0);
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  myWidget->setFixedWidth(240);
  ZAppInfoArea* pAIA = new ZAppInfoArea(myWidget, NULL, 0);
  pAIA->setActArea(ZAppInfoArea::no_progress_meter);
  pAIA->appendText(ZAppInfoArea::activity, lang.readEntry(QString("TEXTVIEWER"), "IDS_OPEN", "Open"), "name");
  setAppInfoArea(pAIA);
  myVBoxLayout->addWidget ( pAIA, 1, 1 );

  fb = new FileBrowser("*", QString ( "%I%M" ), myWidget, 0);
  fb->setDir("/");
  QObject::connect(fb, SIGNAL(isFilePicked(bool)), SLOT(filePicked(bool)));

 // myVBoxLayout->addWidget ( fb, 1 );
  
  setContentWidget ( fb );
  
  ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
  softKey->setText ( ZSoftKey::LEFT, lang.readEntry(QString("TEXTVIEWER"), "IDS_OPEN", "Open"), ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setText ( ZSoftKey::RIGHT, lang.readEntry(QString("TEXTVIEWER"), "IDS_CANCEL", "Cancel"), ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( reject() ) );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
  setCSTWidget ( softKey );
}
ZUserInfo::ZUserInfo(std::string _id)
    :MyBaseDlg()
{
 	setMainWidgetTitle ( LNG_USERINFO );
	id = _id;
	dlgUserInfo = this;

	initInterface();

	ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
	softKey->setText ( ZSoftKey::LEFT, LNG_OK, ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( menu_close() ) );
	// TODO: FIX - Add update button
	//softKey->setText ( ZSoftKey::RIGHT, LNG_UPD, ( ZSoftKey::TEXT_PRIORITY ) 0 );
	//softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( menu_update() ) );	
	setCSTWidget ( softKey );

	pthread_attr_t attr;
	pthread_attr_init(&attr);
	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
	pthread_create(&thread, &attr, getInfo, (void*) &id );
	pthread_attr_destroy(&attr);
}
progressDlg::progressDlg(QString &title, QString &text, const char* cmd, bool isShowPopInfo, int dlgType)
			: ZPopup((ZPopup::POPUP_TYPE_E)dlgType)
{
	this->setTitle(title);
	this->setInstructText(text);
	this->setTitleIcon("info_pop.gif");
	
	popInfoState = isShowPopInfo;
	m_hideState = false;
	m_step = 0;
	ret = 255;
	m_dlgType = dlgType;
	if( m_dlgType == 0 ) 
		popInfoState = true;

	m_progressCmd = new progressCmd(cmd);
	
	m_md = new ZMeterModule(8, this);
	m_md->setAlignment(ZMeterModule::TOP);
	m_mt = m_md->getMeter();
	m_mt->setAutoResize(true);
	
	this->insertChild( (ZWidget*)m_md );
	
	if( m_dlgType == 0 ) {
		ZSoftKey *softKey = this->getSoftKey();
		softKey->setText(ZSoftKey::LEFT, tr("TXT_RID_SOFTKEY_HIDE", "Hide"));
		softKey->setClickedSlot( ZSoftKey::LEFT, this, SLOT ( slotHide() ) );
		softKey->disableClickedSlot( ZSoftKey::RIGHT);	
	}		
	
	timer = new QTimer(this);
	connect( timer, SIGNAL(timeout()), this, SLOT( slotTimerEvent()));
	timer->start(500);
	
	m_progressCmd->start();	
}
//************************************************************************************************
//************************************** class ZFileOpenDialog ***********************************
//************************************************************************************************
ZFileOpenDialog::ZFileOpenDialog()
  :MyBaseDlg()
{
  QWidget *myWidget = new QWidget ( this );
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );

  fb = new FileBrowser("*", QString ( "%I%M" ), myWidget, 0, ( ZSkinService::WidgetClsID ) 4);
  fb->setDir("/");
  QObject::connect(fb, SIGNAL(isFilePicked(bool)), SLOT(filePicked(bool)));

  setMainWidgetTitle ( "Z6 Manager" );

  myVBoxLayout->addWidget ( fb, 1 );
  
  setContentWidget ( myWidget );
  
  ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );

  QString ProgDir = QString ( qApp->argv() [0] ) ;
  int i = ProgDir.findRev ( "/" );
  ProgDir.remove ( i+1, ProgDir.length() - i );

  ZConfig readlang("/ezxlocal/download/appwrite/setup/ezx_system.cfg", true);
  Idioma = "ezxlocal/download/mystuff/.system/LinXtend/usr/languages/" + readlang.readEntry(QString("SYS_SYSTEM_SET"), QString("LanguageType"), "en-us");
  if ( ! QFileInfo(Idioma).isFile() ) Idioma = "/ezxlocal/download/mystuff/.system/LinXtend/usr/languages/en-us";


  ZConfig IDini(Idioma, false);
  QString IDval = IDini.readEntry(QString("COMMON"), QString("MENU_SELECT"), "");
  softKey->setText ( ZSoftKey::LEFT, IDval, ( ZSoftKey::TEXT_PRIORITY ) 0 );
  IDval = IDini.readEntry(QString("COMMON"), QString("MENU_CANCEL"), "");
  softKey->setText ( ZSoftKey::RIGHT, IDval, ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( reject() ) );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
  setCSTWidget ( softKey );
}
//************************************************************************************************
//************************************** class ZIconSelect ***********************************
//************************************************************************************************
ZIconSelect::ZIconSelect()
  :MyBaseDlg()
{
  QString ProgDir = QString ( qApp->argv() [0] ) ;
  int i = ProgDir.findRev ( "/" );
  ProgDir.remove ( i+1, ProgDir.length() - i );

  setMainWidgetTitle ( "Z6 Manager" );

  QString val; 
  ZConfig readlang("/ezxlocal/download/appwrite/setup/ezx_system.cfg", true);
  Idioma = "ezxlocal/download/mystuff/.system/LinXtend/usr/languages/" + readlang.readEntry(QString("SYS_SYSTEM_SET"), QString("LanguageType"), "en-us");
  if ( ! QFileInfo(Idioma).isFile() ) Idioma = "/ezxlocal/download/mystuff/.system/LinXtend/usr/languages/en-us";

  ZConfig lang(Idioma, false);

  this->setMainWidgetTitle(lang.readEntry(QString("LANGUAGE"), "SELECTICON", ""));
  
  QWidget *myWidget = new QWidget ( this );
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );

  browser = new ZListBox ( QString ( "%I%M" ), this, 0);
  browser->setFixedWidth ( 240 );
  QPixmap p1;

  ZListBoxItem* Item = new ZListBoxItem ( browser, QString ( "%I%M" ) );
  Item->appendSubItem ( 1, QString ( ".." ), false, NULL );
  browser->insertItem ( Item, 0,true );
  int ItemSize = browser->itemHeight(0)-2 ; if ( ItemSize>20 ) ItemSize=20;
  browser->clear();

	RES_ICON_Reader iconReader;
	QStringList nombres, iconos;
	nombres.clear();
	nombres += "alarm_clock_std"; nombres += "bluetooth_std"; nombres += "browser_setup_std"; nombres += "browser_std";
	nombres += "calculator_std"; nombres += "calen_std"; nombres += "camera_std"; nombres += "certificate_mgr_std";
	nombres += "connections_std"; nombres += "ctact_std"; nombres += "dialing_service_std"; nombres += "dwnld_mgr_std";
	nombres += "email_std"; nombres += "fem_std"; nombres += "fixed_dial_std"; nombres += "fm_std";
	nombres += "games_std"; nombres += "go_to_url_std"; nombres += "help_std"; nombres += "location_std";
	nombres += "media_finder_std"; nombres += "media_player_std"; nombres += "java_std"; nombres += "im_std";
	nombres += "im_yahoo_std"; nombres += "images_std"; nombres += "fonts_std"; nombres += "lan_std";
	nombres += "moto_source_std"; nombres += "motosync_std"; nombres += "mp_radio_std";
	nombres += "msg_std"; nombres += "multimedia_std"; nombres += "music_library_std"; nombres += "music_std";
	nombres += "netwk_std"; nombres += "notepad_std"; nombres += "office_tools_std"; nombres += "pfile_std";
	nombres += "phone_setting_std"; nombres += "pictureflow_std"; nombres += "recnt_call_std"; nombres += "refresh_std";
	nombres += "screen_std"; nombres += "security_std"; nombres += "service_dial_std"; nombres += "settings_std";
	nombres += "sim_apps_std"; nombres += "stored_page_std"; nombres += "task_list_std"; nombres += "themes_std";
	nombres += "tweaks_std"; nombres += "utility_std"; nombres += "vid_camera_std";
	nombres += "video_std"; nombres += "voice_rec_std"; nombres += "web_access_std"; nombres += "web_history_std";
	nombres += "web_session_std"; nombres += "web_shortcuts_std"; nombres += "world_clock_std";
	nombres += "z6manager_std"; nombres += "z6tweaker_std";

	for ( int j=0 ; j < nombres.count(); ++j )
	{
		ZListBoxItem* listitem1 = new ZListBoxItem ( browser, QString ( "%I%M" ) );
		QString icono = nombres[j];
		p1=QPixmap(iconReader.getIcon(icono, false));
		if ( p1.height() > 19 ) { QImage image; image = p1.convertToImage(); 
		image = image.smoothScale(19, 19); p1.convertFromImage(image); }     
		listitem1->setPixmap ( 0, p1 );
		listitem1->appendSubItem ( 1, nombres[j], false, 0 );
		browser->insertItem ( listitem1,-1,true );
	}	


  connect(browser, SIGNAL(returnPressed(ZListBoxItem *)), SLOT(brClicked()));

  myVBoxLayout->addWidget ( browser, 1 );
  setContentWidget ( browser );

  ZSoftKey *softKey = new ZSoftKey ( "CST_2A", this, this );

  QString IDval = lang.readEntry(QString("COMMON"), QString("MENU_SELECT"), "");
  softKey->setText ( ZSoftKey::LEFT, IDval, ( ZSoftKey::TEXT_PRIORITY ) 0 );
  IDval = lang.readEntry(QString("COMMON"), QString("MENU_CANCEL"), "");
  softKey->setText ( ZSoftKey::RIGHT, IDval, ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( reject() ) );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( brClicked() ) );
  setCSTWidget ( softKey );

}
ZAboutDialog::ZAboutDialog()
    :MyBaseDlg()
{
	setMainWidgetTitle(LNG_ABOUT);
	
	myWidget = new ZWidget ();
	tabWidget = new ZNavTabWidget( myWidget );
	connect(tabWidget,SIGNAL(currentChanged(QWidget* )),this,SLOT(slotPageChanged(QWidget* )));
	
	sv = new ZScrollPanel(this);
	
	ZImage *img = new ZImage( this );
	img->setPixmap ( QPixmap( ProgDir + "/zMessanger_usr.png" ) );
	sv->addChild(img, 10,20);

	QString model;
	
	#if defined(EZX_Z6)
	model = "Z6";
	#elif defined(EZX_ZN5)
	model = "ZN5";
	#elif defined(EZX_U9)
	model = "U9";
	#elif defined(EZX_E8)
	model = "E8";
	#elif defined(EZX_EM30)
	model = "EM30";
	#elif defined(EZX_EM35)
	model = "EM35";
	#elif defined(EZX_VE66)
	model = "VE66";
	#elif defined(EZX_V8)
	model = "V8";
	#else
	model = "";
	#endif

	ZLabel * a = new ZLabel("zMessanger "+model,this);
	QFont font ( a->font() );
	font.setBold ( true );
	a->setFont(font);
	a->setFixedWidth(SCREEN_WIDTH-80);
	a->setAlignment(ZLabel::AlignCenter);
	sv->addChild(a, 80,15);
	QString ver = QString::number(VER_MAJOR)+"."+QString::number(VER_MINOR);

	switch (VER_STATUS)
	{
		case 0: ver = ver+" PreAlpha"; break;
		case 1: ver = ver+" Alpha";    break;
		case 2: ver = ver+" Betta";    break;
		case 3: ver = ver+" RC";       break;
		case 4: ver = ver+" Stable";   break;
	}

	a = new ZLabel(QString("ver. ")+ver,this);
	a->setFixedWidth(SCREEN_WIDTH-80);
	a->setAlignment(ZLabel::AlignCenter);
	sv->addChild(a, 80,45);		
	
	ZSeparator * sep = new ZSeparator();
	sep->setLength(SCREEN_WIDTH-20);
	sv->addChild(sep, 10,90);	
	
	a = new ZLabel("Copyrigth "+LNG_COPYRIGHT+": Ant-ON, 2010",this);
	a->setAutoResize(true);
	a->setPreferredWidth(SCREEN_WIDTH-10);
	sv->addChild(a, 15,100);
	
	a = new ZLabel("e-mail: [email protected]",this);
	a->setAutoResize(true);
	a->setPreferredWidth(SCREEN_WIDTH-10);
	sv->addChild(a, 15,130);
	
	sep = new ZSeparator();
	sep->setLength(SCREEN_WIDTH-20);
	sv->addChild(sep, 10,190);			

	phoneInfo = new ZListBox( tabWidget );
	
	font.setPointSize ( 16 );
	phoneInfo->setItemFont (ZListBox::LISTITEM_REGION_A, ZSkinBase::StStandard, font );
	phoneInfo->setItemFont (ZListBox::LISTITEM_REGION_A, ZSkinBase::StHighlightSelected, font );	
	phoneInfo->setItemFont (ZListBox::LISTITEM_REGION_A, ZSkinBase::StSelected, font );	
	phoneInfo->setItemFont (ZListBox::LISTITEM_REGION_A, ZSkinBase::StHighlighted, font );	
	
	ZSettingItem* item;

	item = new ZSettingItem(phoneInfo, "%M");
	item->appendSubItem(0, "zIM "+model+" "+ver, false);
	phoneInfo->insertItem( item );

	item = new ZSettingItem(phoneInfo, "%M");
	item->appendSubItem(0, "Traffic", true);
    item->setSeparator("-",NULL);
	item->setSelectable(false);	
	phoneInfo->insertItem( item, -1, false );

	item = new ZSettingItem(phoneInfo, "%M");
	item->appendSubItem(0, "IN:", true);
	item->appendSubItem(0, QString::number((double)trafIN/1024, 'g', 2)+" KB" );
	phoneInfo->insertItem( item );
	
	item = new ZSettingItem(phoneInfo, "%M");
	item->appendSubItem(0, "OUT:", true);
	item->appendSubItem(0, QString::number((double)trafOUT/1024, 'g', 2)+" KB" );
	phoneInfo->insertItem( item );
	
	item = new ZSettingItem(phoneInfo, "%M");
	item->appendSubItem(0, "Build", true);
    item->setSeparator("-",NULL);
	item->setSelectable(false);	
	phoneInfo->insertItem( item, -1, false );

	item = new ZSettingItem(phoneInfo, "%M");
	item->appendSubItem(0, "Build number:", false);
	item->appendSubItem(0, QString::number( BUILD_NUMBER ), false );
	phoneInfo->insertItem( item );
	
	item = new ZSettingItem(phoneInfo, "%M");
	item->appendSubItem(0, "Buld date:", false);
	item->appendSubItem(0, QString( BUILD_DATE ), false );
	phoneInfo->insertItem( item );	
	
	phoneInfo->setCurrentItem(1);
	
	QPixmap pm;
	pm.load( ProgDir+ "/image/tab_about.png");
	tabWidget->addTab(sv, QIconSet(pm), "");	
	pm.load( ProgDir+ "/image/tab_othe_info.png");
	tabWidget->addTab(phoneInfo, QIconSet(pm), "");		

	setContentWidget ( tabWidget );  
	
	ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
	softKey->setText ( ZSoftKey::LEFT, LNG_OK, ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
	setCSTWidget ( softKey );
}
ZSettingsDlg::ZSettingsDlg()
    :MyBaseDlg()
{
	setMainWidgetTitle(LNG_SETTINGS);

	myWidget = new ZWidget ();

	tabWidget = new ZNavTabWidget( myWidget );
	setContentWidget ( tabWidget );

	QPixmap pm;

	ZConfig cfg ( ProgDir+"/zMessanger.cfg");
	//##################################   1   ############################################
	net = new ZListBox( tabWidget );
	pm.load( ProgDir+ "/image/tab_net.png");
	tabWidget->addTab(net, QIconSet(pm), "");
	//#####################################################################################
	optInetLink = new ZOptionItem(net, ZOptionItem::EDIT_INTERNET_PROFILE);
	optInetLink->setText( cfg.readEntry(QString("Inet"), QString("ProfileName"), "") );
	optInetLink->setTitle(LNG_INETPROF);
	net->insertItem(optInetLink);
	
	optICQServer = new ZOptionItem(net, ZOptionItem::EDIT_TEXT);
	optICQServer->setText( cfg.readEntry(QString("Inet"), QString("Server"), "login.icq.com") );
	optICQServer->setTitle(LNG_ICQSERV);
	net->insertItem(optICQServer);
	
	optICQPort = new ZOptionItem(net, ZOptionItem::EDIT_TEXT_NUM);
	optICQPort->setText( cfg.readEntry(QString("Inet"), QString("Port"), "5190") );
	optICQPort->setTitle(LNG_PORT);
	net->insertItem(optICQPort);
	
	optICQKeepTime = new ZOptionItem(net, ZOptionItem::EDIT_TEXT_NUM);
	optICQKeepTime->setText( cfg.readEntry(QString("Inet"), QString("TimeKeepConnect"), "500") );
	optICQKeepTime->setTitle(LNG_KEEPCONNECTTIME);
	net->insertItem(optICQKeepTime);
	
	optICQdelayReadSnec = new ZOptionItem(net, ZOptionItem::EDIT_TEXT_NUM);
	optICQdelayReadSnec->setText( cfg.readEntry(QString("Inet"), QString("delayReadSnec"), "2000") );
	optICQdelayReadSnec->setTitle(LNG_DELAYNEWSOCKREAD);
	net->insertItem(optICQdelayReadSnec);
	
	#ifndef _NoUSBNetOption
	optUSBNet = new ZOptionItem(net, ZOptionItem::EDIT_BOOL_ONOFF);
	optUSBNet->setTitle( "Internet on USB" );
	optUSBNet->setNum( cfg.readBoolEntry("Inet", "inetOnUSB", false) );
	net->insertItem(optUSBNet);
	#endif
	//#######################################  2  #########################################
	alert = new ZListBox( tabWidget );
	pm.load( ProgDir + "/image/tab_alert.png");
	tabWidget->addTab(alert, QIconSet(pm), "");
	//#####################################################################################
	
	optVibrate = new ZOptionItem(alert, ZOptionItem::EDIT_BOOL_ONOFF);
	optVibrate->setTitle( LNG_VIBRATE );
	optVibrate->setNum( cfg.readBoolEntry("Alert", "Vibrate", true) );
	alert->insertItem(optVibrate);
	
	optTone = new ZOptionItem(alert, ZOptionItem::EDIT_BOOL_ONOFF);
	optTone->setTitle( LNG_RINGTONE );
	optTone->setNum( cfg.readBoolEntry("Alert", "Ring", false) );
	alert->insertItem(optTone);
	
	optToneVol = new ZOptionItem(alert, ZOptionItem::EDIT_NUM);
	optToneVol->setTitle( LNG_RINGTONEVOL );
	optToneVol->setNum( cfg.readNumEntry("Alert", "Volume", 2) );
	optToneVol->setMaxMin(10, 0);
	alert->insertItem(optToneVol);	
	
	optTonePath = new ZOptionItem(alert, ZOptionItem::EDIT_ONE_OF_LIST);
	optTonePath->setTitle( LNG_RINGTONEPATH );
	
	QDir dirTone ( ProgDir+"/alert/", QString("*.mp3 *.wav") );
	dirTone.setFilter ( QDir::Files | QDir::Hidden );
	toneList = new QStringList( dirTone.entryList() );
	toneList->sort();

	int sel=0, i=0;
	QString text = cfg.readEntry(QString("Alert"), QString("Path"), "msn.mp3");
	for ( QStringList::Iterator it = toneList->begin(); it != toneList->end(); ++it )
		if ( *it == text )
		{
			sel=i;
			break;
		} else
			i++;
	
	optTonePath->setList( toneList );
	optTonePath->setNum( sel );
	
	alert->insertItem(optTonePath);

	//#########################################  3  #######################################
	CL = new ZListBox( tabWidget );
	pm.load( ProgDir+ "/image/tab_CL.png");
	tabWidget->addTab(CL, QIconSet(pm), "");
	//#####################################################################################
	optJampNewMes = new ZOptionItem(CL, ZOptionItem::EDIT_BOOL_YESNO);
	optJampNewMes->setTitle( LNG_AUTO_JAMP_NEW_MESSAGE );
	optJampNewMes->setNum( cfg.readBoolEntry(QString("ContactList"), QString("jampNewMes"), true) );
	CL->insertItem(optJampNewMes);	
	
	optShowOffLine = new ZOptionItem(CL, ZOptionItem::EDIT_BOOL_YESNO);
	optShowOffLine->setTitle( LNG_SHOWOFFCONT );
	optShowOffLine->setNum( !cfg.readBoolEntry(QString("ContactList"), QString("dontShowOffLine"), true) );
	CL->insertItem(optShowOffLine);
	
	optShowGroup = new ZOptionItem(CL, ZOptionItem::EDIT_BOOL_YESNO);
	optShowGroup->setTitle( LNG_SHOWGROUP );
	optShowGroup->setNum( !cfg.readBoolEntry(QString("ContactList"), QString("dontShowGroup"), false) );
	CL->insertItem(optShowGroup);
	
	optRigthXStatus = new ZOptionItem(CL, ZOptionItem::EDIT_BOOL_YESNO);
	optRigthXStatus->setTitle( LNG_XSTATUSRIGTH );
	optRigthXStatus->setNum( cfg.readBoolEntry(QString("ContactList"), QString("rigthAlignXStatus"), true) );
	CL->insertItem(optRigthXStatus);
	
	QStringList * modes = new QStringList();
	modes->append(LNG_NO_SORTCONTACT);
	modes->append(LNG_STATUS_SORTCONTACT);
	modes->append(LNG_STATUS_NICK_SORTCONTACT);
	
	optSortType = new ZOptionItem(CL, ZOptionItem::EDIT_ONE_OF_LIST);
	optSortType->setTitle(LNG_SORTCONTACT);
	optSortType->setList( modes );
	optSortType->setNum( cfg.readNumEntry(QString("ContactList"), QString("sortType"), 2) );
	CL->insertItem(optSortType);

	//#######################################  4  ##########################################
	Chat = new ZListBox( tabWidget );
	pm.load( ProgDir+ "/image/tab_chat.png");
	tabWidget->addTab(Chat, QIconSet(pm), "");
	//#####################################################################################
	
	optSmilePack = new ZOptionItem(Chat, ZOptionItem::EDIT_ONE_OF_LIST);
	optSmilePack->setTitle( LNG_SMILE_PACK );
	
	smileList = zSmile->getSmilePackList();
	
	optSmilePack->setList( smileList );
	
	sel=0; i=0;
	text = cfg.readEntry(QString("Chat"), QString("smilePack"), "kolobok");
	for ( QStringList::Iterator it = smileList->begin(); it != smileList->end(); ++it )
		if ( *it == text )
		{
			sel=i;
			break;
		} else
			i++;	
	
	optSmilePack->setNum( sel );
	Chat->insertItem(optSmilePack);	
	
	optChatFontSize = new ZOptionItem(Chat, ZOptionItem::EDIT_NUM);
	optChatFontSize->setMaxMin(35, 2);
	optChatFontSize->setNum( cfg.readNumEntry(QString("Chat"), QString("chatFontSize"), 11) );
	optChatFontSize->setTitle( LNG_FONTSIZECHAT );
	Chat->insertItem(optChatFontSize);
	
	optMesFontSize = new ZOptionItem(Chat, ZOptionItem::EDIT_NUM);
	optMesFontSize->setMaxMin(35, 2);
	optMesFontSize->setNum( cfg.readNumEntry(QString("Chat"), QString("writeMesFontSize"), 11) );
	optMesFontSize->setTitle( LNG_FONTSIZEMES );
	Chat->insertItem(optMesFontSize);
	
	optMaxNumLine = new ZOptionItem(Chat, ZOptionItem::EDIT_NUM);
	optMaxNumLine->setMaxMin(500, 3);
	optMaxNumLine->setNum( cfg.readNumEntry(QString("Chat"), QString("maxNumLines"), 40) );
	optMaxNumLine->setTitle( LNG_MAXNUMLINESCHAT );
	Chat->insertItem(optMaxNumLine);	
	
	optNoShowStatusBarInChat = new ZOptionItem(Chat, ZOptionItem::EDIT_BOOL_ONOFF);
	optNoShowStatusBarInChat->setTitle( LNG_NO_SHOW_STATUS_BAR_IN_CHAT );
	optNoShowStatusBarInChat->setNum( !cfg.readBoolEntry(QString("Chat"), QString("noShowStatusBarInChat"), false) );
	Chat->insertItem(optNoShowStatusBarInChat);	
	
	optSendByCenter = new ZOptionItem(Chat, ZOptionItem::EDIT_BOOL_YESNO);
	optSendByCenter->setTitle( LNG_SEND_BY_CENTER );
	optSendByCenter->setNum( cfg.readBoolEntry(QString("Chat"), QString("sendByCenter"), false) );
	Chat->insertItem(optSendByCenter);

	optSendTypeMes = new ZOptionItem(Chat, ZOptionItem::EDIT_BOOL_YESNO);
	optSendTypeMes->setTitle( LNG_SENDTYPEMES );
	optSendTypeMes->setNum( !cfg.readBoolEntry(QString("Chat"), QString("notSendTypeMes"), false) );
	Chat->insertItem(optSendTypeMes);
	
	//#####################################  5  ###########################################
	othe = new ZListBox( tabWidget );
	pm.load( ProgDir+ "/image/tab_othe.png");
	tabWidget->addTab(othe, QIconSet(pm), "");
	//#####################################################################################
	
	codec = new QStringList();
	codec->append( "KOI8-R" );
	codec->append( "KOI8-U" );
	codec->append( "ISO8859-2" );
	codec->append( "ISO8859-3" );
	codec->append( "ISO8859-4" );
	codec->append( "ISO8859-5" );
	codec->append( "ISO8859-6-I" );
	codec->append( "ISO8859-7" );
	codec->append( "ISO8859-8-I" );
	codec->append( "ISO8859-9" );
	codec->append( "ISO8859-10" );
	codec->append( "ISO8859-11" );		
	codec->append( "ISO8859-13" );
	codec->append( "ISO8859-14" );
	codec->append( "ISO8859-15" );
	codec->append( "PT154" );
	codec->append( "CP874" );
	codec->append( "CP1250" );
	codec->append( "CP1251" );
	codec->append( "CP1252" );
	codec->append( "CP1253" );
	codec->append( "CP1254" );
	codec->append( "CP1255" );
	codec->append( "CP1256" );	
	codec->append( "CP1257" );	
	codec->append( "CP1258" );

	sel=0, i=0;
	text = cfg.readEntry(QString("Message"), QString("CodePage"), "CP1251");
	for ( QStringList::Iterator it = codec->begin(); it != codec->end(); ++it )
		if ( *it == text )
		{
			sel=i;
			break;
		} else
			i++;
	optCodePage = new ZOptionItem(othe, ZOptionItem::EDIT_ONE_OF_LIST);
	optCodePage->setTitle( LNG_DEFCP );	
	optCodePage->setList( codec );
	optCodePage->setNum( sel );
	othe->insertItem(optCodePage);
	
	optXTrazRequest = new ZOptionItem(othe, ZOptionItem::EDIT_BOOL_YESNO);
	optXTrazRequest->setTitle( LNG_XSTATUSAUTOREQUEST );
	optXTrazRequest->setNum( !cfg.readBoolEntry(QString("Message"), QString("noAutoXTrazRequest"), true) );
	othe->insertItem(optXTrazRequest);
	
	optAutoMsgRequest = new ZOptionItem(othe, ZOptionItem::EDIT_BOOL_YESNO);
	optAutoMsgRequest->setTitle( LNG_STATUSAUTOREQUEST );
	optAutoMsgRequest->setNum( !cfg.readBoolEntry(QString("Message"), QString("noAutoMsgRequest"), true) );
	othe->insertItem(optAutoMsgRequest);
		
	optSaveStusWithExit = new ZOptionItem(othe, ZOptionItem::EDIT_BOOL_ONOFF);
	optSaveStusWithExit->setTitle( LNG_SAVE_STATUS_WITH_EXIT );
	optSaveStusWithExit->setNum( cfg.readBoolEntry(QString("Status"), QString("saveStausCanDisconect"), true) );
	othe->insertItem(optSaveStusWithExit);

	optEye = new ZOptionItem(othe, ZOptionItem::EDIT_BOOL_ONOFF);
	optEye->setTitle( LNG_EYE );
	optEye->setNum(cfg.readBoolEntry(QString("Othe"), QString("enabledEye"), true));
	othe->insertItem(optEye);
	//#####################################################################################
	
	net->setFocus(); // set focus to widget in first tab
	
	ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
	softKey->setText ( ZSoftKey::LEFT, LNG_OK, ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setText ( ZSoftKey::RIGHT, LNG_CANCEL, ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( reject() ) );
	softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( saveSetting() ) );
	setCSTWidget ( softKey );
}
Example #25
0
ZAboutDialog::ZAboutDialog()
    :MyBaseDlg()
{
	setMainWidgetTitle( tr("TXT_RID_SOFTKEY_ABOUT_JAVA", "About").replace("Java","") );
	
	ZScrollPanel * sv = new ZScrollPanel(this);
	this->setContentWidget ( sv );  
	
	ZImage *img = new ZImage( this );
	img->setPixmap ( QPixmap ( QString(qApp->argv()[0])+"_big_usr.png" ) );
	sv->addChild(img, 20,20);

	QFont font ( qApp->font() ); 
	font.setBold(true);
	ZLabel * a = new ZLabel("zFonts",this);
	a->setFont( font );
	a->setFixedWidth( SCREEN_WIDTH-70 );
	a->setAlignment( ZLabel::AlignHCenter );
	#if defined(EZX_E8) || defined(EZX_EM30)
	sv->addChild(a, 70,5);	
	#else
	sv->addChild(a, 70,10);
	#endif
	
	a = new ZLabel(QString("ver: 0.1"),this);
	a->setFixedWidth( SCREEN_WIDTH-70 );
	a->setAlignment( ZLabel::AlignHCenter );	
	#if defined(EZX_E8) || defined(EZX_EM30)  
	sv->addChild(a, 70,28);	
	#else
	sv->addChild(a, 70,35);
	#endif		

	#ifdef EZX_E2	
	a = new ZLabel(QString("Platform: EZX-E2"),this);
	#else
	#ifdef EZX_V8	
	a = new ZLabel(QString("Platform: EZX-V8"),this);
	#else
	#ifdef EZX_Z6	
	a = new ZLabel(QString("Platform: EZX-Z6"),this);
	#else
	#ifdef EZX_Z6W	
	a = new ZLabel(QString("Platform: EZX-Z6w"),this);
	#else	
	#ifdef EZX_ZN5	
	a = new ZLabel(QString("Platform: EZX-ZN5"),this);
	#else
	#ifdef EZX_U9	
	a = new ZLabel(QString("Platform: EZX-U9"),this);
	#else
	#ifdef EZX_EM30	
	a = new ZLabel(QString("Platform: EZX-EM30"),this);
	#else
	#ifdef EZX_EM35	
	a = new ZLabel(QString("Platform: EZX-EM35"),this);
	#else
	#ifdef EZX_VE66	
	a = new ZLabel(QString("Platform: EZX-VE66"),this);
	#else	
	#ifdef EZX_E8	
	a = new ZLabel(QString("Platform: EZX-E8"),this);
	#endif		
	#endif
	#endif
	#endif
	#endif
	#endif
	#endif	
	#endif
	#endif
	#endif		
		
	a->setFixedWidth( SCREEN_WIDTH-70 );
	a->setAlignment( ZLabel::AlignHCenter );	
	#if defined(EZX_E8) || defined(EZX_EM30) 
	sv->addChild(a, 70,52);	
	#else
	sv->addChild(a, 70,60);
	#endif	
	
	ZSeparator * sep = new ZSeparator();
	sep->setLength(SCREEN_WIDTH-20);
	#if defined(EZX_E8) || defined(EZX_EM30)  
	sv->addChild(sep, 10,80);	
	#else
	sv->addChild(sep, 10,100);
	#endif	
	
	a = new ZLabel("Copyrigth ©: Ant-ON, 2011",this);
	a->setAutoResize(true);
	a->setPreferredWidth(SCREEN_WIDTH-5);
	#if defined(EZX_E8) || defined(EZX_EM30) 
	sv->addChild(a, 10,85);
	#else
	sv->addChild(a, 10,110);
	#endif		
	
	a = new ZLabel("e-mail: [email protected]",this);
	a->setAutoResize(true);
	a->setPreferredWidth(SCREEN_WIDTH-5);
	#if defined(EZX_E8) || defined(EZX_EM30) 
	sv->addChild(a, 10,107);
	#else
	sv->addChild(a, 10,140);
	#endif	

	a = new ZLabel("Special for PearlMod!",this);
	a->setAutoResize(true);
	a->setPreferredWidth(SCREEN_WIDTH-5);
	#if defined(EZX_E8) || defined(EZX_EM30) 
	sv->addChild(a, 10,129);
	#else
	sv->addChild(a, 10,170);
	#endif	

	a = new ZLabel("Thanks: BeZ",this);
	a->setAutoResize(true);
	a->setPreferredWidth(SCREEN_WIDTH-5);
	#if defined(EZX_E8) || defined(EZX_EM30) 
	sv->addChild(a, 10,150);
	#else
	sv->addChild(a, 10,200);
	#endif
	
	sep = new ZSeparator();
	sep->setLength(SCREEN_WIDTH-20);
	#if defined(EZX_E8) || defined(EZX_EM30) 
	sv->addChild(sep, 10,173);	
	#else
	sv->addChild(sep, 10,230);
	#endif

	ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
	softKey->setText ( ZSoftKey::LEFT, tr("TXT_RID_SOFTKEY_OK","OK"), ( ZSoftKey::TEXT_PRIORITY ) 0 );
	softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
	setSoftKey( softKey );
}
Example #26
0
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 );


}
Example #27
0
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);
}