Esempio n. 1
0
// Helper thread for restart
void PamGUI::timerTick(){
    // send alive message to plugin
    pluginMessage(MSG_ALIVE);
    switch(repeatDelay){
        case 0:
            if(!device->isRunning()){
                syslog(LOG_ERR,"ERROR: Fingerprint device not running.");
                qApp->exit(-1);
                return;
            }
            //do nothing
            break;
        case 1:
            syslog(LOG_INFO,"Waiting for device to stop...");
            device->wait(5000);
            syslog(LOG_INFO,"Stopped, restarting");
            //restart fingerprint scanner
            showMessage(MSG_NORMAL,"Ready...");
            device->start();
            repeatDelay--;
            break;
        default:
            repeatDelay--;  //still wait
    }
}
Esempio n. 2
0
void PluginManager::onPluginMessage(const AdamantPlugin* plugin, QString message, QtMsgType type) const {
    if (plugin) {
        AdamantPluginInfo* data = getPluginData(plugin);
        if (data) {
            message.prepend(QString("[%1] ").arg(data->name));
        }
    }
    emit pluginMessage(message, type);
}
Esempio n. 3
0
void PamGUI::showMessage(const char *target,const QString msg){
    QFont font;
    if(target){
        if(strcmp(target,MSG_BOLD)==0){
            font.setPointSize(10);
            font.setBold(true);
            statusBar->setFont(font);
        }
        if(strcmp(target,MSG_NORMAL)==0){
            font.setPointSize(9);
            font.setBold(false);
            statusBar->setFont(font);
        }
    }
    statusBar->setText(msg);    // Show message on statusBar
    syslog(LOG_DEBUG,"Message: %s",msg.toStdString().data()); // Message to syslog
    
    // send message to plugin
    string fifoMsg(""); // Compose a message for fingerprint-plugin
    fifoMsg.append(target);
    fifoMsg.append(msg.toStdString());
    fifoMsg.append("\0");
    pluginMessage(fifoMsg.data());
}