コード例 #1
0
ファイル: LazyWord.cpp プロジェクト: san0xff/lazyword
LazyWord::LazyWord( QWidget * parent ) : QDialog(parent) ,LID(0),CheckEnd(0),GetTheSlot(0)
{
	//-----------Open the database--------------
	SqlOperate a;
	a.connectdatabase();
	//-----------Open the database--------------
	
//================Initial the UI start=================
	RestoreConfig_color();
	RestoreConfigall();
    ConfigureUI();
    createActions();
    IconMenu();
	ShowIcon();
	
	
	//************For test*************
	T = new QTimer(this);
	connect(T,SIGNAL(timeout()),this,SLOT(remind()));
	T->start(3600 * 1000);
	
	//************For test**************
	
	
	connect(ActionRestore, SIGNAL(triggered()), this, SLOT(ShowNormal()));
	
	connect(UpdateLibButton, SIGNAL(clicked()), this, SLOT(updateLib()));
	connect(InsertLibButton, SIGNAL(clicked()), this, SLOT(InsertLib()));    
    connect(ShowTestButton, SIGNAL(clicked()), this, SLOT(ShowMessage()));
    connect(OkButton,SIGNAL(clicked()),this,SLOT(OkSubmit()));
    connect(AboutButton,SIGNAL(clicked()),this,SLOT(about()));
    connect(GetAllExplainButton,SIGNAL(clicked()),this,SLOT(getAllExplain()));
    connect(ChangeColorButton,SIGNAL(clicked()),this,SLOT(setshowcolor()));
	connect(ItimeBox,SIGNAL(valueChanged(int)),this,SLOT(changeItime(int)));
   
    connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(LetterClicked()));
     
    connect(show_AllBox, SIGNAL(toggled(bool)),this, SLOT(setBoxVisible(bool)));
    connect(show_StrangeBox, SIGNAL(toggled(bool)),this, SLOT(setBoxVisibleSingle()));
    connect(show_UnderstandBox, SIGNAL(toggled(bool)),this, SLOT(setBoxVisibleSingle()));
    connect(show_MasterBox, SIGNAL(toggled(bool)),this, SLOT(setBoxVisibleSingle()));

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(ConfigureBox);
    setLayout(mainLayout);

    
    trayIcon->show();
    
    setWindowTitle(tr("LazyWord"));
    setGeometry(QRect(400, 200, 449, 407));
    resize(400, 300);
//======================Initial the UI end==========================  
}
コード例 #2
0
ファイル: Configurator.cpp プロジェクト: iomato/weasel
int Configurator::Run(bool installing)
{
    rime::Deployer& deployer(rime::Service::instance().deployer());
	bool reconfigured = false;

	rime::SwitcherSettings switcher_settings(&deployer);
	UIStyleSettings ui_style_settings(&deployer);

	bool skip_switcher_settings = installing && !switcher_settings.IsFirstRun();
	bool skip_ui_style_settings = installing && !ui_style_settings.IsFirstRun();

	(skip_switcher_settings || ConfigureSwitcher(&switcher_settings, &reconfigured)) &&
		(skip_ui_style_settings || ConfigureUI(&ui_style_settings, &reconfigured));

	if (installing || reconfigured) {
		return UpdateWorkspace(reconfigured);
	}
	return 0;
}