Esempio n. 1
0
EventUpdateManager::EventUpdateManager()
	:Thread() {
	d = new PrivateData;
	d->stopEvent = d->eventHandler.addEvent();
	d->updateEvent = d->eventHandler.addEvent();
	d->clientConnectEvent = d->eventHandler.addEvent();
	d->eventUpdateClientListener = new ConnectionListener(L"TelldusEvents", d->clientConnectEvent);
#ifdef _LINUX
	loadScripts("deviceevent");
	loadScripts("devicechangeevent");
	loadScripts("rawdeviceevent");
	loadScripts("sensorevent");
	loadScripts("controllerevent");
#endif  // _LINUX
}
Esempio n. 2
0
void GadgetScript::initialize()
{
	NounGadget::initialize();
	
	// load scripts from the noun context
	loadScripts();
}
Esempio n. 3
0
void PluginManager::reloadScripts() {
    for (ScriptSandbox* script : _scripts) {
        // We only want to reload scripts that are not owned
        if (script->getOwner() != nullptr) continue;
        script->terminate();
    }

    loadScripts();
}
Esempio n. 4
0
void PluginManager::loadAndExecuteScripts() {
    // Load plugin scripts first
    for (AdamantPluginInfo* container : _plugins) {
        if (container->script != nullptr) {
            container->script->evaluateProgram();
        }
    }

    loadScripts();
}
Esempio n. 5
0
GM_Settings::GM_Settings(GM_Manager* manager, QWidget* parent)
    : QDialog(parent)
    , ui(new Ui::GM_Settings)
    , m_manager(manager)
{
    setAttribute(Qt::WA_DeleteOnClose);
    ui->setupUi(this);

    connect(ui->listWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
            this, SLOT(showItemInfo(QListWidgetItem*)));
    connect(ui->listWidget, SIGNAL(removeItemRequested(QListWidgetItem*)),
            this, SLOT(removeItem(QListWidgetItem*)));
    connect(ui->openDirectory, SIGNAL(clicked()),
            this, SLOT(openScriptsDirectory()));
    connect(ui->link, SIGNAL(clicked(QPoint)),
            this, SLOT(openUserJs()));
    connect(manager, SIGNAL(scriptsChanged()),
            this, SLOT(loadScripts()));

    loadScripts();
}
Esempio n. 6
0
void SmsScriptsManager::init()
{
#if SMS_USE_DEBUGGER
 	QScriptEngineDebugger *debugger = new QScriptEngineDebugger(this);
 	debugger->attachTo(Engine);
 	debugger->standardWindow()->show();
#endif

	QString scriptPath = Application::instance()->pathsProvider()->profilePath() + QLatin1String("plugins/data/sms/scripts/gateway.js");
	if (QFile::exists(scriptPath))
		loadScript(scriptPath);
	else
	{
		scriptPath = Application::instance()->pathsProvider()->dataPath() + QLatin1String("plugins/data/sms/scripts/gateway.js");
		if (QFile::exists(scriptPath))
			loadScript(scriptPath);
		// TODO: maybe we should return here if no gateway.js was found?
	}

	// scripts from profile path can replace the ones from data path if the file name is the same
	loadScripts(QDir(Application::instance()->pathsProvider()->profilePath() + QLatin1String("plugins/data/sms/scripts")));
	loadScripts(QDir(Application::instance()->pathsProvider()->dataPath() + QLatin1String("plugins/data/sms/scripts")));
}
Esempio n. 7
0
ScriptEngine::ScriptEngine() :
        QObject(NULL)
{
    DEBUG_BLOCK

    setObjectName("ScriptEngine");

    qRegisterMetaType<ArenaWidget::Flags>("Flags");
    qRegisterMetaType<ArenaWidget::Flags>("ArenaWidget::Flags");

    connect(WulforSettings::getInstance(), SIGNAL(strValueChanged(QString,QString)), this, SLOT(slotWSKeyChanged(QString,QString)));
    connect(&watcher, SIGNAL(fileChanged(QString)), this, SLOT(slotScriptChanged(QString)));
    connect(GlobalTimer::getInstance(), SIGNAL(second()), this ,SLOT(slotProcessChangedFiles()));

    loadScripts();
}