summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-09-08 22:04:10 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-09-08 22:04:10 +0000
commit857d40de5969510fd453d6158805eafd9eba56dd (patch)
tree13811700bc569e0c9a575997752179f57c04c4a8 /src
parent35ab76c3e30c2721b5c4ba17d4c9f89cc5759131 (diff)
another button
Diffstat (limited to 'src')
-rw-r--r--src/main.c1
-rw-r--r--src/trg-main-window.c11
-rw-r--r--src/trg-preferences-dialog.c18
-rw-r--r--src/util.c10
-rw-r--r--src/util.h1
5 files changed, 26 insertions, 15 deletions
diff --git a/src/main.c b/src/main.c
index 71d101c..fb54202 100644
--- a/src/main.c
+++ b/src/main.c
@@ -149,7 +149,6 @@ int main(int argc, char *argv[])
curl_global_init(CURL_GLOBAL_ALL);
-
window = trg_main_window_new(client, should_be_minimised(argc, argv));
#ifdef HAVE_LIBUNIQUE
diff --git a/src/trg-main-window.c b/src/trg-main-window.c
index 5358423..48e7c4b 100644
--- a/src/trg-main-window.c
+++ b/src/trg-main-window.c
@@ -104,7 +104,6 @@ static gint confirm_action_dialog(GtkWindow * win,
gchar * question_multi, gchar * action_stock);
static GtkWidget *my_scrolledwin_new(GtkWidget * child);
static void view_stats_toggled_cb(GtkWidget * w, gpointer data);
-static void trg_widget_set_visible(GtkWidget * w, gboolean visible);
static void view_states_toggled_cb(GtkCheckMenuItem * w, gpointer data);
static void view_notebook_toggled_cb(GtkCheckMenuItem * w, gpointer data);
static GtkWidget *trg_main_window_notebook_new(TrgMainWindow * win);
@@ -655,16 +654,6 @@ static void view_stats_toggled_cb(GtkWidget * w, gpointer data) {
gtk_widget_show_all(GTK_WIDGET(dlg));
}
-/* gtk_widget_set_sensitive() was introduced in 2.18, we can have a minimum of
- * 2.16 otherwise. */
-
-static void trg_widget_set_visible(GtkWidget * w, gboolean visible) {
- if (visible)
- gtk_widget_show(w);
- else
- gtk_widget_hide(w);
-}
-
static void view_states_toggled_cb(GtkCheckMenuItem * w, gpointer data) {
TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(data);
trg_widget_set_visible(priv->stateSelectorScroller,
diff --git a/src/trg-preferences-dialog.c b/src/trg-preferences-dialog.c
index c187301..84cfb7c 100644
--- a/src/trg-preferences-dialog.c
+++ b/src/trg-preferences-dialog.c
@@ -306,6 +306,12 @@ static void menu_bar_toggle_filter_dirs(GtkToggleButton * w, gpointer win) {
trg_state_selector_set_show_dirs(selector, gtk_toggle_button_get_active(w));
}
+static void view_states_toggled_cb(GtkToggleButton * w, gpointer data) {
+ GtkWidget *scroll = gtk_widget_get_parent(GTK_WIDGET(trg_main_window_get_state_selector(TRG_MAIN_WINDOW(data))));
+ trg_widget_set_visible(scroll,
+ gtk_toggle_button_get_active(w));
+}
+
static void notebook_toggled_cb(GtkToggleButton *b, gpointer data) {
trg_main_window_notebook_set_visible(TRG_MAIN_WINDOW(data), gtk_toggle_button_get_active(b));
}
@@ -313,21 +319,27 @@ static void notebook_toggled_cb(GtkToggleButton *b, gpointer data) {
static GtkWidget *trg_prefs_desktopPage(TrgPreferencesDialog *dlg) {
TrgPreferencesDialogPrivate *priv = TRG_PREFERENCES_DIALOG_GET_PRIVATE(dlg);
- GtkWidget *tray, *w, *t;
+ GtkWidget *tray, *w, *dep, *t;
gint row = 0;
t = hig_workarea_create();
hig_workarea_add_section_title(t, &row, _("Features"));
+ dep = w = trgp_check_new(dlg, _("State selector"),
+ TRG_PREFS_KEY_SHOW_STATE_SELECTOR, TRG_PREFS_GLOBAL, NULL);
+ g_signal_connect(G_OBJECT(w), "toggled",
+ G_CALLBACK(view_states_toggled_cb), priv->win);
+ hig_workarea_add_wide_control(t, &row, w);
+
w = trgp_check_new(dlg, _("Directory filters"), TRG_PREFS_KEY_FILTER_DIRS,
- TRG_PREFS_GLOBAL, NULL);
+ TRG_PREFS_GLOBAL, GTK_TOGGLE_BUTTON(dep));
g_signal_connect(G_OBJECT(w), "toggled",
G_CALLBACK(menu_bar_toggle_filter_dirs), priv->win);
hig_workarea_add_wide_control(t, &row, w);
w = trgp_check_new(dlg, _("Tracker filters"),
- TRG_PREFS_KEY_FILTER_TRACKERS, TRG_PREFS_GLOBAL, NULL);
+ TRG_PREFS_KEY_FILTER_TRACKERS, TRG_PREFS_GLOBAL, GTK_TOGGLE_BUTTON(dep));
g_signal_connect(G_OBJECT(w), "toggled",
G_CALLBACK(toggle_filter_trackers), priv->win);
hig_workarea_add_wide_control(t, &row, w);
diff --git a/src/util.c b/src/util.c
index b961d3c..05c28ee 100644
--- a/src/util.c
+++ b/src/util.c
@@ -357,3 +357,13 @@ void rm_trailing_slashes(gchar *str)
return;
}
}
+
+/* gtk_widget_set_sensitive() was introduced in 2.18, we can have a minimum of
+ * 2.16 otherwise. */
+
+void trg_widget_set_visible(GtkWidget * w, gboolean visible) {
+ if (visible)
+ gtk_widget_show(w);
+ else
+ gtk_widget_hide(w);
+}
diff --git a/src/util.h b/src/util.h
index 2084d86..ae392b2 100644
--- a/src/util.h
+++ b/src/util.h
@@ -66,5 +66,6 @@ double tr_truncd(double x, int decimal_places);
int evutil_vsnprintf(char *buf, size_t buflen, const char *format,
va_list ap);
void rm_trailing_slashes(gchar *str);
+void trg_widget_set_visible(GtkWidget * w, gboolean visible);
#endif /* UTIL_H_ */