Example #1
0
bool accounts::read_data() {

	QFile file(core_i->get_config_dir() + "/" + ACCOUNTS_DATA_FILENAME);
	QFileInfo info(file);
	if(!file.exists()) {
		qDebug() << "File not found:" << info.absoluteFilePath();
		return true;
	}

	QString error_str;
	int error_line, error_col;
	QDomDocument doc;
	if(!doc.setContent(&file, false, &error_str, &error_line, &error_col)) {
		qWarning() << "Accounts: failed to load XML file ("<< info.absoluteFilePath() << ") - error on line" << error_line << ":" << error_str;
		return false;
	}
	
	QDomElement root = doc.documentElement();
	if(root.tagName() != "accounts") {
		qWarning() << "Accounts: XML contains no 'accounts' element";
		return false;
	}
	
	QDomNode node = root.firstChild();
	while(!node.isNull()) {
		if(node.toElement().tagName() == "account-data")
			parse_account_node(node.toElement());
		node = node.nextSibling();
	}
	
	if(options) options->reset();

	return true;
}
Example #2
0
void PluginManager::init()
{
	QDir appDirPath = QDir(qApp->applicationDirPath());
	QString pluginPath;
	if (appDirPath.cd("plugins")) {
		pluginPath = appDirPath.absolutePath();
	}

	if (!pluginPath.isEmpty()) {
		QDirIterator it(pluginPath);
		SettingsPrivate *settings = SettingsPrivate::instance();
		QMap<QString, PluginInfo> plugins = settings->plugins();
		QStringList failedPlugins;
		while (it.hasNext()) {
			if (QLibrary::isLibrary(it.next()) && !it.fileInfo().isSymLink()) {
				// If plugin was recognized by the App at least once
				if (plugins.contains(it.filePath())) {
					PluginInfo pluginInfo = plugins.value(it.filePath());
					if (pluginInfo.isEnabled() && !this->loadPlugin(it.filePath())) {
						failedPlugins << it.fileName();
					}
				} else if (!this->loadPlugin(it.filePath())) {
					failedPlugins << it.fileName();
				}
			}
		}

		// If at least one plugin wasn't restored (API has changed for example)
		if (!failedPlugins.isEmpty()) {
			this->alertUser(failedPlugins);
		}
	}
}
Example #3
0
void PluginMgrDlg::Initialize()
{
    clConfig conf("plugins.conf");
    PluginInfoArray plugins;
    conf.ReadItem(&plugins);

    m_initialDisabledPlugins = plugins.GetDisabledPlugins();
    std::sort(m_initialDisabledPlugins.begin(), m_initialDisabledPlugins.end());

    const PluginInfo::PluginMap_t& pluginsMap = plugins.GetPlugins();

    // Clear the list
    m_checkListPluginsList->Clear();

    PluginInfo::PluginMap_t::const_iterator iter = pluginsMap.begin();
    for(; iter != pluginsMap.end(); ++iter) {
        PluginInfo info = iter->second;

        int item = m_checkListPluginsList->Append(info.GetName());
        if(item != wxNOT_FOUND) {
            m_checkListPluginsList->Check((unsigned int)item, plugins.CanLoad(info.GetName()));
        }
    }

    if(m_checkListPluginsList->IsEmpty() == false) {
        m_checkListPluginsList->Select(0);
        CreateInfoPage(0);
    }
    m_checkListPluginsList->SetFocus();
}
Example #4
0
void PluginInfoArray::AddPlugin(const PluginInfo& plugin)
{
    if ( m_plugins.count(plugin.GetName()) )
        m_plugins.erase(plugin.GetName());
        
    m_plugins.insert(std::make_pair(plugin.GetName(), plugin));
}
Example #5
0
static void
init_logline_generator(GPtrArray *plugin_array)
{
  if (!plugin_array)
    return;

  gboolean require_framing = FALSE;
  for (int i=0; i < plugin_array->len; i++)
    {
      PluginInfo *plugin = g_ptr_array_index(plugin_array,i);
      if (!plugin)
        continue;

      /* check if any active plugin requires framing */
      if (plugin->require_framing && plugin->is_plugin_activated())
        {
          require_framing = TRUE;
          break;
        }
    }

  int framing;
  if (syslog_proto && !noframing)
    framing = 1;
  else if (!syslog_proto && require_framing && !noframing)
    framing = 1;
  else
    framing = 0;

  prepare_log_line_template(
    syslog_proto,
    framing,
    global_plugin_option.message_length,
    sdata_value);
}
bool PluginFactory::loaded( const PluginInfoPair& pair )
{
    PluginInfo *pluginInfo = pair.first;
    if( !pluginInfo ) return false;

    return pluginInfo->get();
}
Example #7
0
/*!

\brief PluginInfo constructor.
\param[in] Info PluginInfo used for setting the observers name, handle, and runtime
context.
\note This constructor is intended for Plugins that wish to receive messages.
The observer will have the same name and runtime handle as the plugin using this
constructor.

*/
dmz::MessageObserver::MessageObserver (const PluginInfo &Info) :
      _msgObsState (*(new MessageObserverState (
         Info.get_handle (),
         Info.get_name (),
         Info.get_context ()))) {

   if (_msgObsState.context) { _msgObsState.context->add_observer (*this); }
}
Example #8
0
/** Disable a previously registered plugin (so it still can be listed in options). */
void SettingsPrivate::disablePlugin(const QString &absFilePath)
{
	QMap<QString, QVariant> map = value("plugins").toMap();
	PluginInfo pluginInfo = map.value(absFilePath).value<PluginInfo>();
	pluginInfo.setEnabled(false);
	map.insert(absFilePath, QVariant::fromValue(pluginInfo));
	this->setValue("plugins", map);
}
Example #9
0
extern "C" EXPORT PluginInfo GetPluginInfo() {
	PluginInfo info;
	info.SetAuthor(wxT("Peter Janků, Michal Bližňák, Tomas Bata University in Zlin, Czech Republic (www.fai.utb.cz)"));
	info.SetName(_("DatabaseExplorer"));
	info.SetDescription(_("DatabaseExplorer for CodeLite"));
	info.SetVersion(DBE_VERSION);
	return info;
}
/*!
  Get a plugin trough  its name plugin.
  \param name The plugin name.
 */
Plugin*
PluginsManager::getPlugin (string &name)
{
  PluginInfo* info = pluginsInfos.get (name);
  if (info)
    return info->getPlugin ();
  return NULL;
}
Example #11
0
CL_PLUGIN_API PluginInfo GetPluginInfo()
{
    PluginInfo info;
    info.SetAuthor(wxT("pavel.iqx"));
    info.SetName(wxT("MemCheck"));
    info.SetDescription(_("MemCheck plugin detects memory leaks. Uses Valgrind (memcheck tool) as backend."));
    info.SetVersion(wxT("0.5"));
    return info;
}
Example #12
0
CL_PLUGIN_API PluginInfo* GetPluginInfo()
{
    static PluginInfo info;
    info.SetAuthor(wxT("eran"));
    info.SetName(wxT("Tweaks"));
    info.SetDescription(_("Tweak codelite"));
    info.SetVersion(wxT("v1.0"));
    return &info;
}
Example #13
0
extern "C" EXPORT PluginInfo GetPluginInfo()
{
	PluginInfo info;
	info.SetAuthor(wxT("Eran Ifrah, patched by Stefan Roesch"));
	info.SetName(CSCOPE_NAME);
	info.SetDescription(wxT("CScope Integration for EmbeddedLite"));
	info.SetVersion(wxT("v1.1"));
	return info;
}
Example #14
0
extern "C" EXPORT PluginInfo GetPluginInfo()
{
    PluginInfo info;
    info.SetAuthor(wxT("Eran Ifrah"));
    info.SetName(wxT("Outline"));
    info.SetDescription(_("Show Current the Layout of the current file"));
    info.SetVersion(wxT("v1.0"));
    return info;
}
Example #15
0
CL_PLUGIN_API PluginInfo* GetPluginInfo()
{
    static PluginInfo info;
    info.SetAuthor(wxT("Eran Ifrah"));
    info.SetName(wxT("Diff Plugin"));
    info.SetDescription(_("CodeLite Diff Plugin"));
    info.SetVersion(wxT("v1.0"));
    return &info;
}
Example #16
0
CL_PLUGIN_API PluginInfo* GetPluginInfo()
{
    static PluginInfo info;
    info.SetAuthor(wxT("Eran Ifrah, patched by Stefan Roesch"));
    info.SetName(CSCOPE_NAME);
    info.SetDescription(_("CScope Integration for CodeLite"));
    info.SetVersion(wxT("v1.1"));
    return &info;
}
Example #17
0
extern "C" EXPORT PluginInfo GetPluginInfo()
{
    PluginInfo info;
    info.SetAuthor(wxT("eran"));
    info.SetName(wxT("LLDBDebuggerPlugin"));
    info.SetDescription(wxT("LLDB Debugger for CodeLite"));
    info.SetVersion(wxT("v1.0"));
    return info;
}
Example #18
0
CL_PLUGIN_API PluginInfo* GetPluginInfo()
{
    static PluginInfo info;
    info.SetAuthor(wxT("Eran Ifrah"));
    info.SetName(wxT("Source Code Formatter"));
    info.SetDescription(_("Source Code Formatter (Supports C/C++/Obj-C/JavaScript/PHP files)"));
    info.SetVersion(wxT("v2.0"));
    return &info;
}
Example #19
0
extern "C" EXPORT PluginInfo GetPluginInfo()
{
    PluginInfo info;
    info.SetAuthor(wxT("eran"));
    info.SetName(wxT("Tweaks"));
    info.SetDescription(wxT("Tweak codelite"));
    info.SetVersion(wxT("v1.0"));
    return info;
}
Example #20
0
CL_PLUGIN_API PluginInfo* GetPluginInfo()
{
    static PluginInfo info;
    info.SetAuthor(wxT("Frank Lichtner"));
    info.SetName(plugName);
    info.SetDescription(_("A small tool to add expandable code snippets and template classes"));
    info.SetVersion(wxT("v1.0"));
    return &info;
}
Example #21
0
CL_PLUGIN_API PluginInfo* GetPluginInfo()
{
    static PluginInfo info;
    info.SetAuthor(wxT("eran"));
    info.SetName(wxT("LLDBDebuggerPlugin"));
    info.SetDescription(_("LLDB Debugger for CodeLite"));
    info.SetVersion(wxT("v1.0"));
    return &info;
}
Example #22
0
// ------------------------------------------------------------
CL_PLUGIN_API PluginInfo* GetPluginInfo()
{
    static PluginInfo info;
    info.SetAuthor(wxT("Frank Lichtner"));
    info.SetName(wxT("SpellCheck"));
    info.SetDescription(_("CodeLite spell checker"));
    info.SetVersion(wxT("v1.6"));
    return &info;
}
Example #23
0
// ------------------------------------------------------------
extern "C" EXPORT PluginInfo GetPluginInfo()
{
    PluginInfo info;
    info.SetAuthor(wxT("Frank Lichtner"));
    info.SetName(wxT("SpellCheck"));
    info.SetDescription(wxT("CodeLite spell checker"));
    info.SetVersion(wxT("v1.6"));
    return info;
}
Example #24
0
extern "C" EXPORT PluginInfo GetPluginInfo()
{
    PluginInfo info;
    info.SetAuthor(wxT("The CodeLite Team"));
    info.SetName(wxT("PHP"));
    info.SetDescription(wxT("Enable PHP support for codelite IDE"));
    info.SetVersion(wxT("v1.0"));
    return info;
}
Example #25
0
CL_PLUGIN_API PluginInfo* GetPluginInfo()
{
    static PluginInfo info;
    info.SetAuthor(wxT("Eran Ifrah"));
    info.SetName(wxT("Word Completion"));
    info.SetDescription(_("Suggest completion based on words typed in the editors"));
    info.SetVersion(wxT("v1.0"));
    return &info;
}
Example #26
0
extern "C" EXPORT PluginInfo GetPluginInfo()
{
    PluginInfo info;
    info.SetAuthor(wxT("Eran Ifrah"));
    info.SetName(wxT("QMakePlugin"));
    info.SetDescription(_("Qt's QMake integration with CodeLite"));
    info.SetVersion(wxT("v1.0"));
    return info;
}
Example #27
0
extern "C" EXPORT PluginInfo GetPluginInfo()
{
    PluginInfo info;
    info.SetAuthor(wxT("Eran Ifrah"));
    info.SetName(wxT("CodeLiteDiff"));
    info.SetDescription(wxT("CodeLite Diff Plugin"));
    info.SetVersion(wxT("v1.0"));
    return info;
}
CL_PLUGIN_API PluginInfo* GetPluginInfo()
{
    static PluginInfo info;
    info.SetAuthor(wxT("Brandon Captain"));
    info.SetName(wxT("ZoomNavigator"));
    info.SetDescription(_("A dockable pane that shows a zoomed-out view of your code."));
    info.SetVersion(wxT("v1.0"));
    return &info;
}
Example #29
0
extern "C" EXPORT PluginInfo GetPluginInfo()
{
    PluginInfo info;
    info.SetAuthor(wxT("Auria"));
    info.SetName(wxT("MacBundler"));
    info.SetDescription(wxT("MacBundler : manage OS X app bundles"));
    info.SetVersion(wxT("v0.1"));
    return info;
}
Example #30
0
CL_PLUGIN_API PluginInfo* GetPluginInfo()
{
    static PluginInfo info;
    info.SetAuthor(wxT("PC"));
    info.SetName(wxT("SmartCompletion"));
    info.SetDescription(_("Make the default Code Completion smarter and better"));
    info.SetVersion(wxT("v1.0"));
    return &info;
}