Ticket #4763: transmissionbt.4763.patch

File transmissionbt.4763.patch, 3.3 KB (added by fanatid, 8 years ago)
Line 
1diff -r transmissionbt.a/gtk/conf.c transmissionbt.b/gtk/conf.c
2104a105,106
3>   tr_variantDictAddStr  (d, TR_KEY_filter_mode, "All");
4>   tr_variantDictAddStr  (d, TR_KEY_filter_text, "");
5diff -r transmissionbt.a/gtk/filter.c transmissionbt.b/gtk/filter.c
620a21
7> #include "conf.h"
8679a681,720
9> static void
10> activity_combo_box_set_active (GtkTreeModel * tmodel, GtkComboBox * combo)
11> {
12>   GtkTreeIter iter;
13>   const char * c_mode;
14>   int mode;
15>   int type;
16>   gboolean valid;
17>
18>   c_mode = gtr_pref_string_get (tr_quark_new ("filter-mode", -1));
19>   if (!g_strcmp0 (c_mode, "Downloading"))
20>     mode = ACTIVITY_FILTER_DOWNLOADING;
21>   else if (!g_strcmp0 (c_mode, "Seeding"))
22>     mode = ACTIVITY_FILTER_SEEDING;
23>   else if (!g_strcmp0 (c_mode, "Active"))
24>     mode = ACTIVITY_FILTER_ACTIVE;
25>   else if (!g_strcmp0 (c_mode, "Paused"))
26>     mode = ACTIVITY_FILTER_PAUSED;
27>   else if (!g_strcmp0 (c_mode, "Finished"))
28>     mode = ACTIVITY_FILTER_FINISHED;
29>   else if (!g_strcmp0 (c_mode, "Verifying"))
30>     mode = ACTIVITY_FILTER_VERIFYING;
31>   else if (!g_strcmp0 (c_mode, "Error"))
32>     mode = ACTIVITY_FILTER_ERROR;
33>   else
34>     mode = ACTIVITY_FILTER_ALL;
35>
36>   valid = gtk_tree_model_get_iter_first (tmodel, &iter);
37>   while (valid)
38>   {
39>     gtk_tree_model_get (tmodel, &iter, ACTIVITY_FILTER_COL_TYPE, &type, -1);
40>     if (type == mode)
41>     {
42>       gtk_combo_box_set_active_iter (combo, &iter);
43>       break;
44>     }
45>     valid = gtk_tree_model_iter_next (tmodel, &iter);
46>   }
47> }
48>
49695c736
50<   gtk_combo_box_set_active (c_combo_box, 0);
51---
52>   activity_combo_box_set_active (activity_model, c_combo_box);
53777a819
54>   gtr_pref_string_set (tr_quark_new("filter-text",-1), folded);
55826a869
56>   bool save_filter_data = (combo != NULL);
57835a879,897
58>   if (save_filter_data)
59>   {
60>     if (type == ACTIVITY_FILTER_DOWNLOADING)
61>       gtr_pref_string_set (tr_quark_new("filter-mode",-1), "Downloading");
62>     else if (type == ACTIVITY_FILTER_SEEDING)
63>       gtr_pref_string_set (tr_quark_new("filter-mode",-1), "Seeding");
64>     else if (type == ACTIVITY_FILTER_ACTIVE)
65>       gtr_pref_string_set (tr_quark_new("filter-mode",-1), "Active");
66>     else if (type == ACTIVITY_FILTER_PAUSED)
67>       gtr_pref_string_set (tr_quark_new("filter-mode",-1), "Paused");
68>     else if (type == ACTIVITY_FILTER_FINISHED)
69>       gtr_pref_string_set (tr_quark_new("filter-mode",-1), "Finished");
70>     else if (type == ACTIVITY_FILTER_VERIFYING)
71>       gtr_pref_string_set (tr_quark_new("filter-mode",-1), "Verifying");
72>     else if (type == ACTIVITY_FILTER_ERROR)
73>       gtr_pref_string_set (tr_quark_new("filter-mode",-1), "Error");
74>     else
75>       gtr_pref_string_set (tr_quark_new("filter-mode",-1), "All");
76>   }
771000a1063,1065
78>   gtk_entry_set_text (GTK_ENTRY (s),
79>                       gtr_pref_string_get (tr_quark_new ("filter-text", -1)));
80>   g_signal_connect (s, "changed", G_CALLBACK (filter_entry_changed), data->filter_model);
811004d1068
82<   g_signal_connect (s, "changed", G_CALLBACK (filter_entry_changed), data->filter_model);
831005a1070
84>   filter_entry_changed (GTK_EDITABLE (s), data->filter_model);
85diff -r transmissionbt.a/gtk/tr-prefs.h transmissionbt.b/gtk/tr-prefs.h
8627a28,29
87> #define PREF_KEY_FILTER_MODE                             "filter-mode"
88> #define PREF_KEY_FILTER_TEXT                             "filter-text"