コード例 #1
0
ファイル: prefs_themes.c プロジェクト: Mortal/claws
void prefs_themes_init(void)
{
	ThemesData   *tdata;
	ThemesPage   *page;
	GList        *tpaths;
	static gchar *path[3];

	path[0] = _("Display");
	path[1] = _("Themes");
	path[2] = NULL;

	debug_print("Creating preferences for themes...\n");

	tdata = g_new0(ThemesData, 1);
	prefs_themes_data = tdata;

	prefs_themes_get_themes_and_names(tdata);

	page = g_new0(ThemesPage, 1);

	page->page.path = path;
	page->page.create_widget = prefs_themes_create_widget;
	page->page.destroy_widget = prefs_themes_destroy_widget;
	page->page.save_page = prefs_themes_save;
	page->page.weight = 130.0;
	prefs_gtk_register_page((PrefsPage *) page);

	tdata->page = page;

	tpaths = g_list_first(tdata->themes);
	if (tdata->displayed == NULL)
		tdata->displayed = (gchar *)(tpaths->data);
}
コード例 #2
0
ファイル: address_keeper_prefs.c プロジェクト: ctubio/claws
void address_keeper_prefs_init(void)
{
	static gchar *path[3];
	gchar *rcpath;
	gchar *tmp;
	
	path[0] = _("Plugins");
	path[1] = _("Address Keeper");
	path[2] = NULL;

	prefs_set_default(param);
	rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
	prefs_read_config(param, PREFS_BLOCK_NAME, rcpath, NULL);
	g_free(rcpath);

	tmp = g_malloc(strlen(addkeeperprefs.block_matching_addrs) + 1);
	pref_get_unescaped_pref(tmp, addkeeperprefs.block_matching_addrs);
	g_free(addkeeperprefs.block_matching_addrs);
	addkeeperprefs.block_matching_addrs = tmp;

	addkeeperprefs_page.page.path = path;
	addkeeperprefs_page.page.create_widget = addkeeper_prefs_create_widget_func;
	addkeeperprefs_page.page.destroy_widget = addkeeper_prefs_destroy_widget_func;
	addkeeperprefs_page.page.save_page = addkeeper_prefs_save_func;
	addkeeperprefs_page.page.weight = 40.0;

	prefs_gtk_register_page((PrefsPage *) &addkeeperprefs_page);
}
コード例 #3
0
void prefs_spelling_init(void)
{
	SpellingPage *page;
	static gchar *path[3];

	path[0] = _("Compose");
	path[1] = _("Spell Checker");
	path[2] = NULL;

	page = g_new0(SpellingPage, 1);
	page->page.path = path;
	page->page.create_widget = prefs_spelling_create_widget;
	page->page.destroy_widget = prefs_spelling_destroy_widget;
	page->page.save_page = prefs_spelling_save;
	page->page.weight = 50.0;

	prefs_gtk_register_page((PrefsPage *) page);
	prefs_spelling = page;

	if (!prefs_common.dictionary)
		prefs_common.dictionary = g_strdup_printf("%s%s",
						prefs_common.aspell_path,
						g_getenv("LANG"));
	if (!strlen(prefs_common.dictionary)
	||  !strcmp(prefs_common.dictionary,"(None"))
		prefs_common.dictionary = g_strdup_printf("%s%s",
						prefs_common.aspell_path,
						g_getenv("LANG"));
	if (strcasestr(prefs_common.dictionary,".utf"))
		*(strcasestr(prefs_common.dictionary,".utf")) = '\0';
	if (strstr(prefs_common.dictionary,"@"))
		*(strstr(prefs_common.dictionary,"@")) = '\0';
}
コード例 #4
0
ファイル: prefs_image_viewer.c プロジェクト: Mortal/claws
void prefs_image_viewer_init(void)
{
	ImageViewerPage *page;
	static gchar *path[3];

	path[0] = _("Message View");
	path[1] = _("Image Viewer");
	path[2] = NULL;

	page = g_new0(ImageViewerPage, 1);
	page->page.path = path;
	page->page.create_widget = imageviewer_create_widget_func;
	page->page.destroy_widget = imageviewer_destroy_widget_func;
	page->page.save_page = imageviewer_save_func;
	page->page.weight = 160.0;
	prefs_gtk_register_page((PrefsPage *) page);
	prefs_imageviewer = page;
}
コード例 #5
0
ファイル: prefs_summaries.c プロジェクト: twolife/claws
void prefs_summaries_init(void)
{
	SummariesPage *page;
	static gchar *path[3];

	path[0] = _("Display");
	path[1] = _("Summaries");
	path[2] = NULL;

	page = g_new0(SummariesPage, 1);
	page->page.path = path;
	page->page.create_widget = prefs_summaries_create_widget;
	page->page.destroy_widget = prefs_summaries_destroy_widget;
	page->page.save_page = prefs_summaries_save;
	page->page.weight = 140.0;
	prefs_gtk_register_page((PrefsPage *) page);
	prefs_summaries = page;
}
コード例 #6
0
void prefs_ext_prog_init(void)
{
	ExtProgPage *page;
	static gchar *path[3];
	
	path[0] = _("Message View");
	path[1] = _("External Programs");
	path[2] = NULL;

	page = g_new0(ExtProgPage, 1);
	page->page.path = path;
	page->page.create_widget = prefs_ext_prog_create_widget;
	page->page.destroy_widget = prefs_ext_prog_destroy_widget;
	page->page.save_page = prefs_ext_prog_save;
	page->page.weight = 45.0;
	prefs_gtk_register_page((PrefsPage *) page);
	prefs_ext_prog = page;
}
コード例 #7
0
ファイル: prefs_wrapping.c プロジェクト: Mortal/claws
void prefs_wrapping_init(void)
{
	WrappingPage *page;
	static gchar *path[3];

	path[0] = _("Compose");
	path[1] = _("Wrapping");
	path[2] = NULL;

	page = g_new0(WrappingPage, 1);
	page->page.path = path;
	page->page.create_widget = prefs_wrapping_create_widget;
	page->page.destroy_widget = prefs_wrapping_destroy_widget;
	page->page.save_page = prefs_wrapping_save;
	page->page.weight = 182.0;
	prefs_gtk_register_page((PrefsPage *) page);
	prefs_wrapping = page;
}
コード例 #8
0
ファイル: prefs_message.c プロジェクト: eworm-de/claws-mail
void prefs_message_init(void)
{
	MessagePage *page;
	static gchar *path[3];

	path[0] = _("Message View");
	path[1] = _("Text Options");
	path[2] = NULL;

	page = g_new0(MessagePage, 1);
	page->page.path = path;
	page->page.create_widget = prefs_message_create_widget;
	page->page.destroy_widget = prefs_message_destroy_widget;
	page->page.save_page = prefs_message_save;
	page->page.weight = 170.0;
	prefs_gtk_register_page((PrefsPage *) page);
	prefs_message = page;
}
コード例 #9
0
ファイル: vcal_prefs.c プロジェクト: twolife/claws
void vcal_prefs_init(void)
{
    static gchar *path[3];
    gchar *rcpath;
    gboolean passwords_migrated = FALSE;

    path[0] = _("Plugins");
    path[1] = _("vCalendar");
    path[2] = NULL;

    prefs_set_default(param);
    rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
    prefs_read_config(param, PREFS_BLOCK_NAME, rcpath, NULL);
    g_free(rcpath);

    /* Move passwords that are still in main config to password store. */
    if (vcalprefs.export_pass != NULL &&
            strlen(vcalprefs.export_pass) > 0) {
        passwd_store_set(PWS_PLUGIN, "vCalendar", "export",
                         vcalprefs.export_pass, TRUE);
        passwords_migrated = TRUE;
        memset(vcalprefs.export_pass, 0, strlen(vcalprefs.export_pass));
        g_free(vcalprefs.export_pass);
    }
    if (vcalprefs.export_freebusy_pass != NULL &&
            strlen(vcalprefs.export_freebusy_pass) > 0) {
        passwd_store_set(PWS_PLUGIN, "vCalendar", "export",
                         vcalprefs.export_freebusy_pass, TRUE);
        passwords_migrated = TRUE;
        memset(vcalprefs.export_freebusy_pass, 0, strlen(vcalprefs.export_freebusy_pass));
        g_free(vcalprefs.export_freebusy_pass);
    }

    if (passwords_migrated)
        passwd_store_write_config();

    vcal_prefs_page.page.path = path;
    vcal_prefs_page.page.create_widget = vcal_prefs_create_widget_func;
    vcal_prefs_page.page.destroy_widget = vcal_prefs_destroy_widget_func;
    vcal_prefs_page.page.save_page = vcal_prefs_save_func;

    prefs_gtk_register_page((PrefsPage *) &vcal_prefs_page);
}
コード例 #10
0
ファイル: bsfilter_gtk.c プロジェクト: Mortal/claws
gint bsfilter_gtk_init(void)
{
	static gchar *path[3];

	path[0] = _("Plugins");
	path[1] = _("Bsfilter");
	path[2] = NULL;

	bsfilter_page.page.path = path;
	bsfilter_page.page.create_widget = bsfilter_create_widget_func;
	bsfilter_page.page.destroy_widget = bsfilter_destroy_widget_func;
	bsfilter_page.page.save_page = bsfilter_save_func;
	bsfilter_page.page.weight = 35.0;

	prefs_gtk_register_page((PrefsPage *) &bsfilter_page);
	bsfilter_set_message_callback(gtk_safe_message_callback);

	debug_print("Bsfilter GTK plugin loaded\n");
	return 0;	
}
コード例 #11
0
ファイル: spamassassin_gtk.c プロジェクト: twolife/claws
gint spamassassin_gtk_init(void)
{
	static gchar *path[3];

	path[0] = _("Plugins");
	path[1] = _("SpamAssassin");
	path[2] = NULL;

	spamassassin_page.page.path = path;
	spamassassin_page.page.create_widget = spamassassin_create_widget_func;
	spamassassin_page.page.destroy_widget = spamassassin_destroy_widget_func;
	spamassassin_page.page.save_page = spamassassin_save_func;
	spamassassin_page.page.weight = 35.0;

	prefs_gtk_register_page((PrefsPage *) &spamassassin_page);
	spamassassin_set_message_callback(gtk_message_callback);

	debug_print("SpamAssassin GTK plugin loaded\n");
	return 0;	
}
コード例 #12
0
ファイル: fancy_prefs.c プロジェクト: SpOOnman/claws
void fancy_prefs_init(void)
{
	static gchar *path[3];
	gchar *rcpath;

	path[0] = _("Plugins");
	path[1] = "Fancy";
	path[2] = NULL;

	prefs_set_default(param);
	rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
	prefs_read_config(param, PREFS_BLOCK_NAME, rcpath, NULL);
	g_free(rcpath);
	
	fancy_prefs_page.page.path = path;
	fancy_prefs_page.page.create_widget = create_fancy_prefs_page;
	fancy_prefs_page.page.destroy_widget = destroy_fancy_prefs_page;
	fancy_prefs_page.page.save_page = save_fancy_prefs_page;
	fancy_prefs_page.page.weight = 30.0;
	prefs_gtk_register_page((PrefsPage *) &fancy_prefs_page);
}
コード例 #13
0
void libravatar_prefs_init(void)
{
	static gchar *path[3];
	gchar *rcpath;

	path[0] = _("Plugins");
	path[1] = _("Libravatar");
	path[2] = NULL;

	prefs_set_default(param);
	rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
	prefs_read_config(param, PREFS_BLOCK_NAME, rcpath, NULL);
	g_free(rcpath);

	libravatarprefs_page.page.path = path;
	libravatarprefs_page.page.create_widget = libravatar_prefs_create_widget_func;
	libravatarprefs_page.page.destroy_widget = libravatar_prefs_destroy_widget_func;
	libravatarprefs_page.page.save_page = libravatar_prefs_save_func;

	prefs_gtk_register_page((PrefsPage *) &libravatarprefs_page);
}
コード例 #14
0
ファイル: rssyl_prefs.c プロジェクト: Tux/claws-mail
void rssyl_prefs_init(void)
{
	static gchar *path[3];
	gchar *rcpath;

	path[0] = _("Plugins");
	path[1] = PLUGIN_NAME;		/* We don't need this translated */
	path[2] = NULL;

	prefs_set_default(param);
	rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
	prefs_read_config(param, PREFS_BLOCK_NAME, rcpath, NULL);
	g_free(rcpath);

	rssyl_gtk_prefs_page.page.path = path;
	rssyl_gtk_prefs_page.page.create_widget = create_rssyl_prefs_page;
	rssyl_gtk_prefs_page.page.destroy_widget = destroy_rssyl_prefs_page;
	rssyl_gtk_prefs_page.page.save_page = save_rssyl_prefs;
	rssyl_gtk_prefs_page.page.weight = 30.0;

	prefs_gtk_register_page((PrefsPage *) &rssyl_gtk_prefs_page);
}
コード例 #15
0
ファイル: prefs_gpg.c プロジェクト: Mortal/claws
void prefs_gpg_init()
{
	static gchar *path[3];
	gchar *rcpath;
	const gchar *tmp = NULL;

	prefs_set_default(param);
	rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
	prefs_read_config(param, "GPG", rcpath, NULL);
	g_free(rcpath);

        path[0] = _("Plugins");
        path[1] = _("GPG");
        path[2] = NULL;

        gpg_page.page.path = path;
        gpg_page.page.create_widget = prefs_gpg_create_widget_func;
        gpg_page.page.destroy_widget = prefs_gpg_destroy_widget_func;
        gpg_page.page.save_page = prefs_gpg_save_func;
        gpg_page.page.weight = 30.0;

        prefs_gtk_register_page((PrefsPage *) &gpg_page);

        gpg_account_page.page.path = path;
        gpg_account_page.page.create_widget = prefs_gpg_account_create_widget_func;
        gpg_account_page.page.destroy_widget = prefs_gpg_account_destroy_widget_func;
        gpg_account_page.page.save_page = prefs_gpg_account_save_func;
        gpg_account_page.page.weight = 30.0;

        prefs_account_register_page((PrefsPage *) &gpg_account_page);
	
	tmp = g_getenv("GPG_AGENT_INFO");
	if (tmp)
		saved_gpg_agent_info = g_strdup(tmp);

	prefs_gpg_enable_agent(prefs_gpg_get_config()->use_gpg_agent);
}