Exemplo n.º 1
0
void MainWindow::sltOnPushButtonApply()
{
    saveMainConf();
    static int flag = 0;
    static int timeFlag = QTime::currentTime().second();
    int currentTime = QTime::currentTime().second();
    if((qAbs(currentTime-timeFlag) > 1)||(flag == 0))
    {
        flag ++;
        qDebug()<<"emit sigRestartQimpanel();";
        emit sigRestartQimpanel();
    }
     timeFlag = QTime::currentTime().second();
}
void EditingSkinDialog::on_pushButton_ok_released()
{
    if(mItem->text().indexOf("(local)")==-1)
    {
        QString cmd = "cp -R /usr/share/fcitx-qimpanel/skin/" + mItem->text() +" "+ localPath ;
        qDebug()<<cmd;
        QByteArray ba = cmd.toLatin1();
        const char *transpd = ba.data();
        if(0!= system(transpd))
        {
            return ;
        }
    }
    saveMainConf();
    this->accept();
}