Skip to content

Commit

Permalink
Remove obsolete rules hint option from sat-list
Browse files Browse the repository at this point in the history
  • Loading branch information
csete committed Dec 9, 2017
1 parent 579d3f4 commit bcdb050
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 50 deletions.
2 changes: 1 addition & 1 deletion src/sat-cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ sat_cfg_bool_t sat_cfg_bool[SAT_CFG_BOOL_NUM] = {
{"GLOBAL", "MAIN_WIN_POS", FALSE},
{"GLOBAL", "MOD_WIN_POS", FALSE},
{"GLOBAL", "MOD_STATE", FALSE},
{"MODULES", "RULES_HINT", TRUE},
{"MODULES", "RULES_HINT", FALSE},
{"MODULES", "MAP_QTH_INFO", TRUE},
{"MODULES", "MAP_NEXT_EVENT", TRUE},
{"MODULES", "MAP_CURSOR_TRACK", FALSE},
Expand Down
2 changes: 1 addition & 1 deletion src/sat-cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ typedef enum {
SAT_CFG_BOOL_MAIN_WIN_POS, /*!< Restore position of main window */
SAT_CFG_BOOL_MOD_WIN_POS, /*!< Restore size and position of module windows */
SAT_CFG_BOOL_MOD_STATE, /*!< Restore module state */
SAT_CFG_BOOL_RULES_HINT, /*!< Enable rules hint in GtkSatList. */
SAT_CFG_BOOL_RULES_HINT_OBSOLETE, /*!< Enable rules hint in GtkSatList. */
SAT_CFG_BOOL_MAP_SHOW_QTH_INFO, /*!< Show QTH info on map */
SAT_CFG_BOOL_MAP_SHOW_NEXT_EV, /*!< Show next event on map */
SAT_CFG_BOOL_MAP_SHOW_CURS_TRACK, /*!< Track mouse cursor on map. */
Expand Down
48 changes: 0 additions & 48 deletions src/sat-pref-list-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,14 @@
static GtkWidget *check[SAT_LIST_COL_NUMBER];
extern const gchar *SAT_LIST_COL_TITLE[];
extern const gchar *SAT_LIST_COL_HINT[];
static GtkWidget *ruleshint;
static gboolean dirty = FALSE;
static gboolean reset = FALSE;
static guint startflags;
static guint flags;
static gboolean rh_flag;

static void create_reset_button(GKeyFile * cfg, GtkBox * vbox);
static void reset_cb(GtkWidget * button, gpointer cfg);
static void toggle_cb(GtkToggleButton * toggle, gpointer data);
static void toggle_rh_cb(GtkToggleButton * toggle, gpointer data);

/**
* Create and initialise widgets for the list view preferences tab.
Expand Down Expand Up @@ -130,39 +127,10 @@ GtkWidget *sat_pref_list_view_create(GKeyFile * cfg)
gtk_widget_show_all(hbox);
#endif

/* vertical box */
vbox = gtk_vbox_new(FALSE, 10);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 10);
gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0);

/* rules hint; only in global mode */
if (cfg == NULL)
{
ruleshint =
gtk_check_button_new_with_label(_
("Enable rules hint in the list views"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ruleshint),
sat_cfg_get_bool
(SAT_CFG_BOOL_RULES_HINT));

/* store original value */
rh_flag = sat_cfg_get_bool(SAT_CFG_BOOL_RULES_HINT);

/* connect toggle signal */
g_signal_connect(G_OBJECT(ruleshint), "toggled",
G_CALLBACK(toggle_rh_cb), NULL);
gtk_widget_set_tooltip_text(ruleshint,
_("Enabling rules hint may make reading "
"across many columns easier. By default the satlist will be rendered "
"with alternating colours, but the exact behaviour is "
"up to the theme engine."));
gtk_box_pack_start(GTK_BOX(vbox), gtk_hseparator_new(), FALSE, FALSE,
0);
gtk_box_pack_start(GTK_BOX(vbox), ruleshint, FALSE, FALSE, 0);
}
gtk_box_pack_start(GTK_BOX(vbox), gtk_hseparator_new(), FALSE, FALSE, 0);

/* create RESET button */
create_reset_button(cfg, GTK_BOX(vbox));

startflags = flags;
Expand Down Expand Up @@ -192,9 +160,6 @@ void sat_pref_list_view_ok(GKeyFile * cfg)
else
{
sat_cfg_set_int(SAT_CFG_INT_LIST_COLUMNS, flags);
sat_cfg_set_bool(SAT_CFG_BOOL_RULES_HINT,
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
(ruleshint)));
}
}
else if (reset)
Expand All @@ -208,7 +173,6 @@ void sat_pref_list_view_ok(GKeyFile * cfg)
else
{
sat_cfg_reset_int(SAT_CFG_INT_LIST_COLUMNS);
sat_cfg_reset_bool(SAT_CFG_BOOL_RULES_HINT);
}
}

Expand Down Expand Up @@ -273,9 +237,6 @@ static void reset_cb(GtkWidget * button, gpointer cfg)
{
/* global mode, get defaults */
flags = sat_cfg_get_int_def(SAT_CFG_INT_LIST_COLUMNS);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ruleshint),
sat_cfg_get_bool_def
(SAT_CFG_BOOL_RULES_HINT));
}
else
{
Expand Down Expand Up @@ -308,12 +269,3 @@ static void toggle_cb(GtkToggleButton * toggle, gpointer data)
/* clear dirty flag if we are back where we started */
dirty = (flags != startflags);
}

static void toggle_rh_cb(GtkToggleButton * toggle, gpointer data)
{
(void)toggle;
(void)data;

if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ruleshint)) != rh_flag)
dirty = TRUE;
}

0 comments on commit bcdb050

Please sign in to comment.