Ejemplo n.º 1
0
Archivo: prefs.c Proyecto: ayttm/ayttm
static void s_write_module_prefs(void *inListItem, void *inData)
{
	eb_PLUGIN_INFO *plugin_info = inListItem;
	FILE *fp = (FILE *)inData;
	LList *master_prefs = NULL;
	LList *current_prefs = NULL;

	eb_debug(DBG_CORE, "Writing prefs for %s\n", plugin_info->name);

	fprintf(fp, "\t%s\n", plugin_info->name);

	master_prefs = GetPref(plugin_info->name);
	master_prefs = value_pair_remove(master_prefs, "load");

	current_prefs = eb_input_to_value_pair(plugin_info->pi.prefs);

	if (plugin_info->status == PLUGIN_LOADED)
		current_prefs = value_pair_add(current_prefs, "load", "1");
	else
		current_prefs = value_pair_add(current_prefs, "load", "0");

	master_prefs = value_pair_update(master_prefs, current_prefs);

	SetPref(plugin_info->name, master_prefs);

	value_pair_print_values(master_prefs, fp, 2);

	fprintf(fp, "\tend\n");

	value_pair_free(current_prefs);
}
Ejemplo n.º 2
0
Archivo: prefs.c Proyecto: ayttm/ayttm
AyModulePrefs *ay_prefs_sift_modules(void)
{
	const LList *plugins = GetPref(EB_PLUGIN_LIST);
	AyModulePrefs *out = g_new0(AyModulePrefs, 1);

	for (; plugins; plugins = plugins->next) {
		eb_PLUGIN_INFO *plugin_info = plugins->data;

		if (plugin_info == NULL)
			continue;

		switch (plugin_info->pi.type)
		{
		case PLUGIN_SERVICE:
			out->services = l_list_append(out->services, plugin_info);
			break;
		case PLUGIN_FILTER:
			out->filters = l_list_append(out->filters, plugin_info);
			break;
		case PLUGIN_UTILITY:
		case PLUGIN_UNKNOWN:
			out->utilities = l_list_append(out->utilities, plugin_info);
			break;
		case PLUGIN_SMILEY:
			out->smileys = l_list_append(out->smileys, plugin_info);
			break;
		case PLUGIN_IMPORTER:
			out->importers = l_list_append(out->importers, plugin_info);
			break;
		}
	}

	return out;
}
// Returns true if Acceptable Ads are enabled, false otherwise.
bool CAdblockPlusClient::IsAcceptableAdsEnabled()
{
  std::vector<SubscriptionDescription> subscriptions = GetListedSubscriptions();
  std::wstring aaUrl = GetPref(L"subscriptions_exceptionsurl", L"");
  for (std::vector<SubscriptionDescription>::iterator subscription = subscriptions.begin(); subscription != subscriptions.end(); subscription++)
  {
    if (subscription->url == aaUrl)
    {
      return true;
    }
  }
  return false;
}
Ejemplo n.º 4
0
Archivo: prefs.c Proyecto: ayttm/ayttm
char *cGetLocalPref(const char *key)
{
	char newkey[MAX_PREF_NAME_LEN];
	char *value = NULL;

	snprintf(newkey, MAX_PREF_NAME_LEN, "Local::%s", key);

	value = (char *)GetPref(newkey);

	if (!value)
		value = "";

	return (value);
}
Ejemplo n.º 5
0
//----------------------------------------------------------------------------------------------------
void GBUserPrefs::Load()
{
    string strLine;
    vector<string> oKeyValue;
    ifstream oPrefsFile( "userprefs.ini" );
    if( oPrefsFile )
    {
        while( getline( oPrefsFile, strLine ) )
        {
            if( strLine.front() != ';' )
            {
                SplitString( strLine, '=', oKeyValue );
                if( oKeyValue.size() > 1 )
                {
                    m_UserPrefsMap[ oKeyValue[ 0 ] ] = oKeyValue[ 1 ];
                }
            }
        }
        oPrefsFile.close();
    }

    m_strBiosFilepath = GetPref( "bios_file" );
    m_bBiosEnabled = ValidateBiosFile();
}
std::wstring CAdblockPlusClient::GetPref(const std::wstring& name, const wchar_t* defaultValue)
{
  return GetPref(name, std::wstring(defaultValue));
}
Ejemplo n.º 7
0
Archivo: prefs.c Proyecto: ayttm/ayttm
void ayttm_prefs_write(void)
{
	const int bufferLen = 1024;
	char buff[bufferLen];
	char file[bufferLen];
	FILE *fp = NULL;

	snprintf(buff, bufferLen, "%sprefs.tmp", config_dir);
	snprintf(file, bufferLen, "%sprefs", config_dir);

	fp = fopen(buff, "w");

	/* window positions, etc. */
	fprintf(fp, "x_contact_window=%d\n", iGetLocalPref("x_contact_window"));
	fprintf(fp, "y_contact_window=%d\n", iGetLocalPref("y_contact_window"));
	fprintf(fp, "status_show_level=%d\n",
		iGetLocalPref("status_show_level"));

	/* chat */
	fprintf(fp, "do_typing_notify=%d\n", iGetLocalPref("do_typing_notify"));
	fprintf(fp, "do_send_typing_notify=%d\n",
		iGetLocalPref("do_send_typing_notify"));
	fprintf(fp, "do_escape_close=%d\n", iGetLocalPref("do_escape_close"));
	fprintf(fp, "do_convo_timestamp=%d\n",
		iGetLocalPref("do_convo_timestamp"));
	fprintf(fp, "do_enter_send=%d\n", iGetLocalPref("do_enter_send"));
	fprintf(fp, "do_ignore_unknown=%d\n",
		iGetLocalPref("do_ignore_unknown"));
	fprintf(fp, "do_multi_line=%d\n", iGetLocalPref("do_multi_line"));
	fprintf(fp, "do_raise_window=%d\n", iGetLocalPref("do_raise_window"));
	fprintf(fp, "regex_pattern=%s\n", cGetLocalPref("regex_pattern"));
	fprintf(fp, "do_smiley=%d\n", iGetLocalPref("do_smiley"));
	fprintf(fp, "do_send_idle_time=%d\n",
		iGetLocalPref("do_send_idle_time"));
	fprintf(fp, "do_timestamp=%d\n", iGetLocalPref("do_timestamp"));
	fprintf(fp, "do_ignore_fore=%d\n", iGetLocalPref("do_ignore_fore"));
	fprintf(fp, "do_ignore_back=%d\n", iGetLocalPref("do_ignore_back"));
	fprintf(fp, "do_ignore_font=%d\n", iGetLocalPref("do_ignore_font"));
	fprintf(fp, "do_auto_complete=%d\n", iGetLocalPref("do_auto_complete"));
	fprintf(fp, "FontFace=%s\n", cGetLocalPref("FontFace"));
	fprintf(fp, "encodings=%s\n", cGetLocalPref("encodings"));
#ifdef HAVE_LIBENCHANT
	fprintf(fp, "do_spell_checking=%d\n",
		iGetLocalPref("do_spell_checking"));
	fprintf(fp, "spell_dictionary=%s\n", cGetLocalPref("spell_dictionary"));
#endif

	/* logging */
	fprintf(fp, "do_logging=%d\n", iGetLocalPref("do_logging"));
	fprintf(fp, "do_strip_html=%d\n", iGetLocalPref("do_strip_html"));
	fprintf(fp, "do_restore_last_conv=%d\n",
		iGetLocalPref("do_restore_last_conv"));

	/* tabs */
	fprintf(fp, "do_tabbed_chat=%d\n", iGetLocalPref("do_tabbed_chat"));
	fprintf(fp, "do_tabbed_chat_orient=%d\n",
		iGetLocalPref("do_tabbed_chat_orient"));
	fprintf(fp, "accel_next_tab=%s\n", cGetLocalPref("accel_next_tab"));
	fprintf(fp, "accel_prev_tab=%s\n", cGetLocalPref("accel_prev_tab"));

	/* sound */
	fprintf(fp, "do_no_sound_when_away=%d\n",
		iGetLocalPref("do_no_sound_when_away"));
	fprintf(fp, "do_no_sound_for_ignore=%d\n",
		iGetLocalPref("do_no_sound_for_ignore"));
	fprintf(fp, "do_online_sound=%d\n", iGetLocalPref("do_online_sound"));
	fprintf(fp, "do_play_send=%d\n", iGetLocalPref("do_play_send"));
	fprintf(fp, "do_play_first=%d\n", iGetLocalPref("do_play_first"));
	fprintf(fp, "do_play_receive=%d\n", iGetLocalPref("do_play_receive"));
	fprintf(fp, "BuddyArriveFilename=%s\n",
		cGetLocalPref("BuddyArriveFilename"));
	fprintf(fp, "BuddyAwayFilename=%s\n",
		cGetLocalPref("BuddyAwayFilename"));
	fprintf(fp, "BuddyLeaveFilename=%s\n",
		cGetLocalPref("BuddyLeaveFilename"));
	fprintf(fp, "SendFilename=%s\n", cGetLocalPref("SendFilename"));
	fprintf(fp, "ReceiveFilename=%s\n", cGetLocalPref("ReceiveFilename"));
	fprintf(fp, "FirstMsgFilename=%s\n", cGetLocalPref("FirstMsgFilename"));
	fprintf(fp, "SoundVolume=%f\n", fGetLocalPref("SoundVolume"));

	/* misc */
	fprintf(fp, "do_ayttm_debug=%d\n", iGetLocalPref("do_ayttm_debug"));
	fprintf(fp, "do_ayttm_debug_html=%d\n",
		iGetLocalPref("do_ayttm_debug_html"));
	fprintf(fp, "do_plugin_debug=%d\n", iGetLocalPref("do_ayttm_debug"));
	fprintf(fp, "do_version_check=%d\n", iGetLocalPref("do_version_check"));
	fprintf(fp, "usercount_window_seen=%d\n",
		iGetLocalPref("usercount_window_seen"));
	fprintf(fp, "length_contact_window=%d\n",
		iGetLocalPref("length_contact_window"));
	fprintf(fp, "width_contact_window=%d\n",
		iGetLocalPref("width_contact_window"));
	fprintf(fp, "do_noautoresize=%d\n", iGetLocalPref("do_noautoresize"));
	fprintf(fp, "do_show_tooltips=%d\n", iGetLocalPref("do_show_tooltips"));
	fprintf(fp, "use_alternate_browser=%d\n",
		iGetLocalPref("use_alternate_browser"));
	fprintf(fp, "alternate_browser=%s\n",
		cGetLocalPref("alternate_browser"));

	/* advanced */
	fprintf(fp, "proxy_type=%d\n", iGetLocalPref("proxy_type"));
	fprintf(fp, "proxy_host=%s\n", cGetLocalPref("proxy_host"));
	fprintf(fp, "proxy_port=%d\n", iGetLocalPref("proxy_port"));
	fprintf(fp, "do_proxy_auth=%d\n", iGetLocalPref("do_proxy_auth"));
	fprintf(fp, "proxy_user=%s\n", cGetLocalPref("proxy_user"));
	fprintf(fp, "proxy_password=%s\n", cGetLocalPref("proxy_password"));

	fprintf(fp, "use_recoding=%d\n", iGetLocalPref("use_recoding"));
	fprintf(fp, "local_encoding=%s\n", cGetLocalPref("local_encoding"));
	fprintf(fp, "remote_encoding=%s\n", cGetLocalPref("remote_encoding"));

	/* version checking */
	fprintf(fp, "last_warned_version=%s\n",
		cGetLocalPref("last_warned_version"));

	/* modules */
	fprintf(fp, "modules_path=%s\n", cGetLocalPref("modules_path"));
	fprintf(fp, "plugins\n");
	l_list_foreach(GetPref(EB_PLUGIN_LIST), s_write_module_prefs, fp);
	fprintf(fp, "end\n");

	fclose(fp);

#ifdef __MINGW32__
	{
		struct stat stb;
		if (stat(file, &stb) == 0)
			unlink(file);
	}
#endif

	rename(buff, file);
}
Ejemplo n.º 8
0
void CKeySend::SelectAll() const
{
  m_impl->SelectAll(m_delayMS, GetPref(PWSprefs::AutotypeSelectAllKeyCode),
                    GetPref(PWSprefs::AutotypeSelectAllModMask));
}
Ejemplo n.º 9
0
static pws_os::AutotypeMethod DefaultAutytypeMethod() {
  return GetPref(PWSprefs::UseAltAutoType)? pws_os::ATMETHOD_XTEST: pws_os::ATMETHOD_XSENDKEYS;
}