bool DeviceLockInterface::isSet() {
    if (m_cacheRefreshNeeded) {
        m_codeSet = runPlugin(QStringList() << "--is-set" << "lockcode");
        m_cacheRefreshNeeded = false;
    }
    return m_codeSet;
}
Example #2
0
	void PluginItem::setState(const State &destState)
	{
		if(hasError() || !m_enabled)
			return;

		switch(destState) {
			case Loaded:
				loadPlugin();
			break;

			case Initialized:
				initializePlugin();
			break;

			case Running:
				runPlugin();
			break;

			case Stopped:
				stopPlugin();
			break;

			case Unloaded:
				unloadPlugin();
			break;

			default:
				break;
		}
	}
bool DeviceLockInterface::setCode(const QString &oldCode, const QString &newCode)
{
    bool return_value = runPlugin(QStringList() << "--set-code" << oldCode << newCode);
    if (return_value) {
        m_cacheRefreshNeeded = true;
        emit isSetChanged();
    }
    return return_value;
}
bool DeviceLockInterface::clearCode(const QString &currentCode)
{
    bool return_value = runPlugin(QStringList() << "--clear-code" << currentCode);
    if (return_value) {
        m_cacheRefreshNeeded = true;
        emit isSetChanged();
    }
    return return_value;
}
void DeviceLockInterface::refresh()
{
    bool wasCodeSet = m_codeSet;
    m_codeSet = runPlugin(QStringList() << "--is-set" << "lockcode");
    m_cacheRefreshNeeded = false;

    if (wasCodeSet != m_codeSet) {
        emit isSetChanged();
    }
}
Example #6
0
int main(int argc, char* argv[])
{
	std::cout << "usage : " << argv[0] << "{-x | -xml=file} {-t | --test=test_path} test_plugin_path" << std::endl << std::endl;
	if (argc < 2)
		return 1;

	bool result = false;
	try {
        CommandLineParser command;
        command.parseArgs(argc, argv);
		
		result = runPlugin(command);
	}
	catch (std::exception &e) {
		std::cerr << std::endl
			<< "ERROR: " << e.what()
			<< std::endl;
	}
	return result ? 0 : 1;
}
Example #7
0
bool DeviceLock::isSet() {
    return runPlugin(QStringList() << "--is-set" << "lockcode");
}
Example #8
0
bool DeviceLock::setCode(const QString &oldCode, const QString &newCode)
{
    return runPlugin(QStringList() << "--set-code" << oldCode << newCode);
}
Example #9
0
bool DeviceLock::checkCode(const QString &code)
{
    return runPlugin(QStringList() << "--check-code" << code);
}
bool DeviceLockInterface::clearDevice(const QString &code)
{
    return runPlugin(QStringList() << "--clear-device" << code);
}