Skip to content
Permalink
Browse files

add tor icon toggle for proxy

requested by many
  • Loading branch information...
Marco Peereboom
Marco Peereboom committed Nov 28, 2012
1 parent 62e3b73 commit 374f8c06dd04fa1324181f575f12971f5d46eb5f
Showing with 34 additions and 6 deletions.
  1. +2 −0 Makefile
  2. +2 −0 dragonfly/Makefile
  3. +2 −0 freebsd/Makefile
  4. +2 −0 linux/Makefile
  5. +2 −0 netbsd/Makefile
  6. +5 −2 settings.c
  7. BIN tordisabled.ico
  8. BIN torenabled.ico
  9. +18 −4 xombrero.c
  10. +1 −0 xombrero.h
@@ -71,6 +71,8 @@ beforeinstall:
install -m 644 ${.CURDIR}/hsts-preload ${PREFIX}/share/xombrero
install -m 644 ${.CURDIR}/user-agent-headers ${PREFIX}/share/xombrero
install -m 644 ${.CURDIR}/http-accept-headers ${PREFIX}/share/xombrero
install -m 644 ${.CURDIR}/torenabled.ico ${PREFIX}/share/xombrero
install -m 644 ${.CURDIR}/tordisabled.ico ${PREFIX}/share/xombrero

${PROG} ${OBJS} beforedepend: javascript.h tooltip.h

@@ -81,6 +81,8 @@ install: all
install -m 644 ../tld-rules $(DESTDIR)$(RESDIR)
install -m 644 ../style.css $(DESTDIR)$(RESDIR)
install -m 644 ../hsts-preload $(DESTDIR)$(RESDIR)
install -m 644 ../torenabled.ico $(DESTDIR)$(RESDIR)
install -m 644 ../tordisabled.ico $(DESTDIR)$(RESDIR)

clean:
rm -f xombrero *.o
@@ -79,6 +79,8 @@ install: all
install -m 644 ../tld-rules $(DESTDIR)$(RESDIR)
install -m 644 ../style.css $(DESTDIR)$(RESDIR)
install -m 644 ../hsts-preload $(DESTDIR)$(RESDIR)
install -m 644 ../torenabled.ico $(DESTDIR)$(RESDIR)
install -m 644 ../tordisabled.ico $(DESTDIR)$(RESDIR)

clean:
rm -f xombrero *.o
@@ -73,6 +73,8 @@ install: all
install -m 644 ../tld-rules $(DESTDIR)$(RESDIR)
install -m 644 ../style.css $(DESTDIR)$(RESDIR)
install -m 644 ../hsts-preload $(DESTDIR)$(RESDIR)
install -m 644 ../torenabled.ico $(DESTDIR)$(RESDIR)
install -m 644 ../tordisabled.ico $(DESTDIR)$(RESDIR)

uninstall:
rm -f $(DESTDIR)$(BINDIR)/xombrero
@@ -81,6 +81,8 @@ install: all
install -m 644 ../tld-rules $(DESTDIR)$(RESDIR)
install -m 644 ../style.css $(DESTDIR)$(RESDIR)
install -m 644 ../hsts-preload $(DESTDIR)$(RESDIR)
install -m 644 ../torenabled.ico $(DESTDIR)$(RESDIR)
install -m 644 ../tordisabled.ico $(DESTDIR)$(RESDIR)

clean:
rm -f xombrero *.o
@@ -3027,10 +3027,13 @@ setup_proxy(char *uri)
gtk_label_set_text(GTK_LABEL(t->sbe.proxy),
"proxy");
gtk_widget_show(t->proxy_toggle);
button_set_stockid(t->proxy_toggle,
GTK_STOCK_CONNECT);
button_set_file(t->proxy_toggle,
"torenabled.ico");
}
}
} else {
TAILQ_FOREACH(t, &tabs, entry)
button_set_file(t->proxy_toggle, "tordisabled.ico");
}
}

BIN +1.12 KB tordisabled.ico
Binary file not shown.
BIN +1.12 KB torenabled.ico
Binary file not shown.
@@ -3325,14 +3325,12 @@ proxy_cmd(struct tab *t, struct karg *args)
}
if (http_proxy) {
setup_proxy(NULL);
button_set_file(t->proxy_toggle, "tordisabled.ico");
show_oops(t, "http proxy disabled");
button_set_stockid(t->proxy_toggle,
GTK_STOCK_DISCONNECT);
} else {
setup_proxy(http_proxy_save);
button_set_file(t->proxy_toggle, "torenabled.ico");
show_oops(t, "http_proxy = %s", http_proxy);
button_set_stockid(t->proxy_toggle,
GTK_STOCK_CONNECT);
}
}
done:
@@ -7262,6 +7260,11 @@ create_toolbar(struct tab *t)
/* toggle proxy button */
t->proxy_toggle = create_button("Proxy-Toggle", proxy_uri ?
GTK_STOCK_CONNECT : GTK_STOCK_DISCONNECT, 0);
/* override icons */
if (proxy_uri)
button_set_file(t->proxy_toggle, "torenabled.ico");
else
button_set_file(t->proxy_toggle, "tordisabled.ico");
gtk_widget_set_sensitive(t->proxy_toggle, TRUE);
g_signal_connect(G_OBJECT(t->proxy_toggle), "clicked",
G_CALLBACK(proxy_toggle_cb), t);
@@ -8240,6 +8243,17 @@ create_button(char *name, char *stockid, int size)
return (button);
}

void
button_set_file(GtkWidget *button, char *filename)
{
GtkWidget *image;
char file[PATH_MAX];

snprintf(file, sizeof file, "%s" PS "%s", resource_dir, filename);
image = gtk_image_new_from_file(file);
gtk_button_set_image(GTK_BUTTON(button), image);
}

void
button_set_stockid(GtkWidget *button, char *stockid)
{
@@ -418,6 +418,7 @@ void set_status(struct tab *t, gchar *fmt, ...);

void load_webkit_string(struct tab *, const char *, gchar *, int);
void button_set_stockid(GtkWidget *, char *);
void button_set_file(GtkWidget *, char *);
void webview_progress_changed_cb(WebKitWebView *, GParamSpec *, struct tab *);

/* cookies */

0 comments on commit 374f8c0

Please sign in to comment.
You can’t perform that action at this time.