Ejemplo n.º 1
0
void MainWidget::CreateUI()
{
	qDebug("MainWidget::CreateUI()");
	
	setMainWidgetTitle("zTranslate / 1.0");
	
	//soft keys
	softKey = new ZSoftKey(NULL , this , this);
	softKey->setText(ZSoftKey::LEFT, "Menu", (ZSoftKey::TEXT_PRIORITY)0);
	softKey->setTextForOptMenuHide("Menu");
	QRect rect = ZGlobal::getContentR();

	
	menu = new ZOptionsMenu(rect, this, 0, 0, (ZSkinService::WidgetClsID)55);
	menu->setItemSpacing(10);
	
	pm = QPixmap(QString("img/icon/translate.png"));
	menu->insertItem(tr(" Перевести"),&pm,this,SLOT(slotConnectInternet()));
	
	pm = QPixmap(QString("img/icon/options.png"));
	menu->insertItem(tr(" Настройки"),&pm,this,SLOT(slotSetting()));
	
	pm = QPixmap(QString("img/icon/about.png"));
	menu->insertItem(tr(" О программе..."),&pm,this,SLOT(about()));
	
	pm = QPixmap(QString("img/icon/exit.png"));
	menu->insertItem(tr(" Выход"),&pm,this,SLOT(slotQuit()));
	
	softKey->setText(ZSoftKey::RIGHT, tr("Выход"), (ZSoftKey::TEXT_PRIORITY)0);
	softKey->setClickedSlot(ZSoftKey::RIGHT, this, SLOT(slotQuit()));
	softKey->setOptMenu(ZSoftKey::LEFT, menu);

	zapp = new ZAppInfoArea(this,"app info",  0, ZSkinService::clsZAppInfoArea);	
    zapp->insertText(ZAppInfoArea::ACTIVITY, 0, "", NULL);

	form = new ZFormContainer(this, 0, ZSkinService::clsZFormContainer);
	

	
	LineEdit1 = new ZLineEdit(this);
	form->addChild(LineEdit1);

	button1 = new ZPressButton(this);
	connect(button1,SIGNAL(pressed()),SLOT(slotShowSrcLng()));
	buttonUpdate();
	form->addChild(button1);

	MultiLine = new ZMultiLineEdit(this);
	form->addChild(MultiLine);
	
	LineEdit1->setText("");
	MultiLine->setText("");
	
	setContentWidget(form);
	setTitleBarWidget(zapp);
	setSoftKey(softKey);	
	
	show();
}
Ejemplo n.º 2
0
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);
}
Ejemplo n.º 3
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 );
}
Ejemplo n.º 4
0
void ZGui::CreateWindow ( QWidget* parent )
{
	ZConfig ini(Idioma, false);
	QString val;

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

    setMainWidgetTitle ( "Cron" );

	setContentWidget ( zllb1 );

	softKey = new ZSoftKey ( NULL , this , this );
	Create_MenuApp();
	Create_SoftKey();
	setSoftKey ( softKey );

	zllb1->setFocus();

}
Ejemplo n.º 5
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 );
}
Ejemplo n.º 6
0
void TextEditor::CreateWindow ( QWidget* parent )
{
    
  setMainWidgetTitle ( APP_NAME );
  ZWidget *myWidget = new ZWidget ( this, NULL, 0);
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  myWidget->setFixedWidth(880);
  //----------------------------------------------------------------------    
  pAIA = new ZAppInfoArea(myWidget, NULL, 0);
  pAIA ->setInputArea();
  pAIA->setActArea(ZAppInfoArea::no_progress_meter);
  setAppInfoArea(pAIA);
  myVBoxLayout->addWidget ( pAIA, 0 );
  //----------------------------------------------------------------------
  
  m_pScrollPanel = new ZScrollPanel ( myWidget, NULL, 0, ZSkinService::clsZScrollPanel);
  m_pScrollPanel->setFixedWidth(880);
//  m_pScrollPanel->setFixedHeight(DISPLAY_HEIGHT - 35 );
 
  
  m_pTextEdit = new ZMultiLineEditEx ( m_pScrollPanel->viewport(), false, 1, "ZMultiLineEdit" );
  
  //m_pTextEdit->setCellHeight( DEFAULT_EDIT_CELL_HEIGHT.toInt() );
  m_pTextEdit->setFontPercent( FUENTE.toFloat() );
  //QFont f; f.setPixelSize(DEFAULT_EDIT_FONT_SIZE);
  //m_pTextEdit->setFont(f);
  m_pScrollPanel->addChild(m_pTextEdit, 0, 0);

  //our textedit handle center button
  QObject::connect( m_pTextEdit, SIGNAL( clicked() ), SLOT( slot_MarkBegin() ) );
  
  
  m_pSoftKey = new ZSoftKey ( "CST_2" , this , this );

  CreateMenu ( this );
  CreateSoftKeys(this);
  setContentWidget ( myWidget );

  QFile file;
  if ( qApp->argc() > 1 && file.exists ( qApp->argv() [1] ) )
  {
    m_sFileName = QString(qApp->argv()[1]).utf8();
    m_sFilePath = getFilePath(m_sFileName);
    load( m_sFileName );
  }
  else
  {
	if ( qApp->argc() > 1 && file.exists ( qApp->argv() [2] ) )
	{
	  m_sFileName = QString(qApp->argv()[2]).utf8();
	  m_sFilePath = getFilePath(m_sFileName);
	  load( m_sFileName );
	}
	else  {   slot_newFile();  }
  }
  setSoftKey ( m_pSoftKey );

	int y = 0;
	y = y + this->headerSize().height();
	y = y + m_pSoftKey->height();
	y = y + pAIA->height();
	m_pScrollPanel->setFixedHeight(320-y);
	m_pTextEdit->setFixedHeight(320-y);

}
Ejemplo n.º 7
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);
}
Ejemplo n.º 8
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 );


}