[Pkg-wmaker-commits] [wmcoincoin] 74/87: Allow choice between SFW/NSFW totozes
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Fri Aug 28 17:27:44 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmcoincoin.
commit c55fc0cde011d5c7364ae876cb962195d88743c2
Author: SeeSchloss <mvalleton at noparking.net>
Date: Wed Apr 8 15:33:00 2015 +0200
Allow choice between SFW/NSFW totozes
---
src/options_list.h | 2 ++
src/pinnipede_totoz.c | 7 ++++++-
src/prefs.c | 4 ++++
src/prefs.h | 1 +
src/prefs_gestion.c | 1 +
src/wmccc.c | 1 +
src/wmccc_interface.c | 18 ++++++++++++++++++
src/wmccc_save_prefs.c | 1 +
8 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/src/options_list.h b/src/options_list.h
index ec11d77..c535026 100644
--- a/src/options_list.h
+++ b/src/options_list.h
@@ -71,6 +71,7 @@ OPT_tribunenews_max_refresh_delay,
OPT_tribunenews_switch_off_coincoin_delay,
OPT_board_enable_hfr_pictures,
OPT_board_auto_dl_pictures,
+OPT_board_sfw_pictures,
OPT_balltrap_enable,
OPT_balltrap_max_ducks,
OPT_tribune_troll_detector,
@@ -222,6 +223,7 @@ char *wmcc_options_strings[NB_WMCC_OPTIONS+1] = {
"tribunenews.switch_off_coincoin_delay",
"board.enable_hfr_pictures",
"board.auto_dl_pictures",
+"board.sfw_pictures",
"balltrap.enable",
"balltrap.max_ducks",
"tribune.troll_detector",
diff --git a/src/pinnipede_totoz.c b/src/pinnipede_totoz.c
index fa80bc0..c7603d7 100644
--- a/src/pinnipede_totoz.c
+++ b/src/pinnipede_totoz.c
@@ -460,7 +460,12 @@ pp_totoz_get_image(Dock *dock, unsigned char *imgname) {
HttpRequest r;
char *imgurl=NULL, *pathimg=NULL, *pathdesc=NULL, *cmd;
int is_found=0, i=0, lu;
- static char siteroot[]="http://totoz.eu"; //modif par pierre80 suite a modif sur toz.eu
+ char *siteroot;
+ if (Prefs.board_sfw_pictures) {
+ siteroot = "http://totoz.eu";
+ } else {
+ siteroot = "http://nsfw.totoz.eu";
+ }
static char *extlist[]={"gif", "png", NULL};
static char *mimelist[]={"image/gif", "image/png", NULL};
char buf[1500];
diff --git a/src/prefs.c b/src/prefs.c
index dbf3c05..4a2787a 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -860,6 +860,7 @@ wmcc_prefs_set_default(GeneralPrefs *p) {
ASSIGN_STRING_VAL(p->wikipedia_search_url, "http://fr.wikipedia.org/wiki/Special:Search?search=%s&go=Go");
p->enable_troll_detector = 1;
p->board_auto_dl_pictures = 0;
+ p->board_sfw_pictures = 0;
p->board_enable_hfr_pictures = 0;
p->disable_xft_antialiasing = 0;
@@ -1152,6 +1153,9 @@ wmcc_prefs_validate_option(GeneralPrefs *p, SitePrefs *sp, SitePrefs *global_sp,
case OPT_board_auto_dl_pictures: {
CHECK_BOOL_ARG(p->board_auto_dl_pictures);
} break;
+ case OPT_board_sfw_pictures: {
+ CHECK_BOOL_ARG(p->board_sfw_pictures);
+ } break;
case OPT_board_enable_hfr_pictures: {
CHECK_BOOL_ARG(p->board_enable_hfr_pictures);
} break;
diff --git a/src/prefs.h b/src/prefs.h
index 57a7b16..d85a146 100644
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -216,6 +216,7 @@ typedef struct _GeneralPrefs{
/* options totozeuses */
int board_auto_dl_pictures;
+ int board_sfw_pictures;
int board_enable_hfr_pictures;
BiColor sc_bg_color, sc_bg_light_color, sc_bg_dark_color,
diff --git a/src/prefs_gestion.c b/src/prefs_gestion.c
index 30af66e..8062ee4 100644
--- a/src/prefs_gestion.c
+++ b/src/prefs_gestion.c
@@ -512,6 +512,7 @@ wmcc_prefs_relecture(Dock *dock, int whatfile)
G_STR_OPT_COPY(browser2_cmd);
G_INT_OPT_COPY(enable_troll_detector);
+ G_INT_OPT_COPY(board_sfw_pictures);
G_INT_OPT_COPY(board_auto_dl_pictures);
G_INT_OPT_COPY(board_enable_hfr_pictures);
diff --git a/src/wmccc.c b/src/wmccc.c
index 14e4d0b..e23b199 100644
--- a/src/wmccc.c
+++ b/src/wmccc.c
@@ -787,6 +787,7 @@ static int prepare_or_finalize_conf_dialog_(GtkWidget *dialog, int finalize) {
PFC_TOGGLE_BUTTON_G(enable_troll_detector);
PFC_TOGGLE_BUTTON_G(board_enable_hfr_pictures);
PFC_TOGGLE_BUTTON_G(board_auto_dl_pictures);
+ PFC_TOGGLE_BUTTON_G(board_sfw_pictures);
PFC_TOGGLE_BUTTON_G(hunt_opened);
PFC_TOGGLE_BUTTON_S(hunt_opened_on_site);
PFC_SPIN_BUTTON_G(hunt_max_duck);
diff --git a/src/wmccc_interface.c b/src/wmccc_interface.c
index 6015b2d..f6dec63 100644
--- a/src/wmccc_interface.c
+++ b/src/wmccc_interface.c
@@ -1106,6 +1106,9 @@ create_global_pinnipede_options_dialog (void)
GtkWidget *hbox33;
GtkWidget *image14;
GtkWidget *vbox20;
+ GtkWidget *hbox44;
+ GtkWidget *board_sfw_pictures;
+ GtkWidget *board_sfw_pictures_fb;
GtkWidget *hbox34;
GtkWidget *board_enable_hfr_pictures;
GtkWidget *board_enable_hfr_pictures_fb;
@@ -1482,6 +1485,18 @@ create_global_pinnipede_options_dialog (void)
gtk_widget_show (board_auto_dl_pictures_fb);
gtk_box_pack_start (GTK_BOX (hbox35), board_auto_dl_pictures_fb, FALSE, FALSE, 0);
+ hbox44 = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (hbox44);
+ gtk_box_pack_start (GTK_BOX (vbox20), hbox44, TRUE, TRUE, 0);
+
+ board_sfw_pictures = gtk_check_button_new_with_mnemonic (_("Only display safe for work images."));
+ gtk_widget_show (board_sfw_pictures);
+ gtk_box_pack_start (GTK_BOX (hbox44), board_sfw_pictures, FALSE, FALSE, 0);
+
+ board_sfw_pictures_fb = gtk_label_new (_("label96"));
+ gtk_widget_show (board_sfw_pictures_fb);
+ gtk_box_pack_start (GTK_BOX (hbox44), board_sfw_pictures_fb, FALSE, FALSE, 0);
+
hseparator7 = gtk_hseparator_new ();
gtk_widget_show (hseparator7);
gtk_box_pack_start (GTK_BOX (vbox19), hseparator7, FALSE, FALSE, 0);
@@ -1621,6 +1636,9 @@ create_global_pinnipede_options_dialog (void)
GLADE_HOOKUP_OBJECT (global_pinnipede_options_dialog, hbox33, "hbox33");
GLADE_HOOKUP_OBJECT (global_pinnipede_options_dialog, image14, "image14");
GLADE_HOOKUP_OBJECT (global_pinnipede_options_dialog, vbox20, "vbox20");
+ GLADE_HOOKUP_OBJECT (global_pinnipede_options_dialog, hbox44, "hbox44");
+ GLADE_HOOKUP_OBJECT (global_pinnipede_options_dialog, board_sfw_pictures, "board_sfw_pictures");
+ GLADE_HOOKUP_OBJECT (global_pinnipede_options_dialog, board_sfw_pictures_fb, "board_sfw_pictures_fb");
GLADE_HOOKUP_OBJECT (global_pinnipede_options_dialog, hbox34, "hbox34");
GLADE_HOOKUP_OBJECT (global_pinnipede_options_dialog, board_enable_hfr_pictures, "board_enable_hfr_pictures");
GLADE_HOOKUP_OBJECT (global_pinnipede_options_dialog, board_enable_hfr_pictures_fb, "board_enable_hfr_pictures_fb");
diff --git a/src/wmccc_save_prefs.c b/src/wmccc_save_prefs.c
index 14b0d15..80144bf 100644
--- a/src/wmccc_save_prefs.c
+++ b/src/wmccc_save_prefs.c
@@ -147,6 +147,7 @@ prefs_write_to_file(GeneralPrefs *p, FILE *f) {
G_SAVEINT(OPT_tribunenews_switch_off_coincoin_delay, switch_off_coincoin_delay);
G_SAVEBOOL(OPT_tribune_troll_detector, enable_troll_detector);
#ifdef HAVE_WMCOINCOIN_PLAYER
+ G_SAVEBOOL(OPT_board_sfw_pictures, board_sfw_pictures);
G_SAVEBOOL(OPT_board_auto_dl_pictures, board_auto_dl_pictures);
G_SAVEBOOL(OPT_board_enable_hfr_pictures, board_enable_hfr_pictures);
#endif
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmcoincoin.git
More information about the Pkg-wmaker-commits
mailing list