summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-09-03 18:40:47 +0200
committerGravatar waker <wakeroid@gmail.com>2012-09-03 18:40:47 +0200
commit0f2eeef7a722570c03c9b09f30ebba28d7b95c13 (patch)
treee8b8c5fdf6b40382ed31f658f4ca2d13eaa6f8a5 /plugins
parent7ea264a5f181ab7caaccb380b7240e1236a9c4cc (diff)
gtkui: added gui configuration for cp1251 and cp936 recoding
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtkui/callbacks.h8
-rw-r--r--plugins/gtkui/deadbeef.glade42
-rw-r--r--plugins/gtkui/interface.c20
-rw-r--r--plugins/gtkui/prefwin.c26
4 files changed, 94 insertions, 2 deletions
diff --git a/plugins/gtkui/callbacks.h b/plugins/gtkui/callbacks.h
index 098c77c7..05f150e9 100644
--- a/plugins/gtkui/callbacks.h
+++ b/plugins/gtkui/callbacks.h
@@ -1171,3 +1171,11 @@ on_editcolumn_title_changed (GtkEditable *editable,
void
on_useragent_changed (GtkEditable *editable,
gpointer user_data);
+
+void
+on_enable_cp1251_recoding_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data);
+
+void
+on_enable_cp936_recoding_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data);
diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade
index 28b38349..bf25d82f 100644
--- a/plugins/gtkui/deadbeef.glade
+++ b/plugins/gtkui/deadbeef.glade
@@ -3674,6 +3674,46 @@ Album</property>
<property name="fill">False</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkCheckButton" id="enable_cp1251_recoding">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enable Russian CP1251 detection and recoding</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_enable_cp1251_recoding_toggled" last_modification_time="Mon, 03 Sep 2012 16:36:19 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="enable_cp936_recoding">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enable Chinese CP936 detection and recoding</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_enable_cp936_recoding_toggled" last_modification_time="Mon, 03 Sep 2012 16:36:16 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="tab_expand">False</property>
@@ -3684,7 +3724,7 @@ Album</property>
<child>
<widget class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="label" translatable="yes">GUI</property>
+ <property name="label" translatable="yes">GUI/Misc</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c
index 074458da..73a15757 100644
--- a/plugins/gtkui/interface.c
+++ b/plugins/gtkui/interface.c
@@ -1722,6 +1722,8 @@ create_prefwin (void)
GtkWidget *hbox101;
GtkWidget *label128;
GtkWidget *gui_plugin;
+ GtkWidget *enable_cp1251_recoding;
+ GtkWidget *enable_cp936_recoding;
GtkWidget *label2;
GtkWidget *notebook4;
GtkWidget *vbox21;
@@ -2132,7 +2134,15 @@ create_prefwin (void)
gtk_widget_show (gui_plugin);
gtk_box_pack_start (GTK_BOX (hbox101), gui_plugin, TRUE, TRUE, 0);
- label2 = gtk_label_new (_("GUI"));
+ enable_cp1251_recoding = gtk_check_button_new_with_mnemonic (_("Enable Russian CP1251 detection and recoding"));
+ gtk_widget_show (enable_cp1251_recoding);
+ gtk_box_pack_start (GTK_BOX (vbox9), enable_cp1251_recoding, FALSE, FALSE, 0);
+
+ enable_cp936_recoding = gtk_check_button_new_with_mnemonic (_("Enable Chinese CP936 detection and recoding"));
+ gtk_widget_show (enable_cp936_recoding);
+ gtk_box_pack_start (GTK_BOX (vbox9), enable_cp936_recoding, FALSE, FALSE, 0);
+
+ label2 = gtk_label_new (_("GUI/Misc"));
gtk_widget_show (label2);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 3), label2);
@@ -2681,6 +2691,12 @@ create_prefwin (void)
g_signal_connect ((gpointer) gui_plugin, "changed",
G_CALLBACK (on_gui_plugin_changed),
NULL);
+ g_signal_connect ((gpointer) enable_cp1251_recoding, "toggled",
+ G_CALLBACK (on_enable_cp1251_recoding_toggled),
+ NULL);
+ g_signal_connect ((gpointer) enable_cp936_recoding, "toggled",
+ G_CALLBACK (on_enable_cp936_recoding_toggled),
+ NULL);
g_signal_connect ((gpointer) override_bar_colors, "toggled",
G_CALLBACK (on_override_bar_colors_toggled),
NULL);
@@ -2832,6 +2848,8 @@ create_prefwin (void)
GLADE_HOOKUP_OBJECT (prefwin, hbox101, "hbox101");
GLADE_HOOKUP_OBJECT (prefwin, label128, "label128");
GLADE_HOOKUP_OBJECT (prefwin, gui_plugin, "gui_plugin");
+ GLADE_HOOKUP_OBJECT (prefwin, enable_cp1251_recoding, "enable_cp1251_recoding");
+ GLADE_HOOKUP_OBJECT (prefwin, enable_cp936_recoding, "enable_cp936_recoding");
GLADE_HOOKUP_OBJECT (prefwin, label2, "label2");
GLADE_HOOKUP_OBJECT (prefwin, notebook4, "notebook4");
GLADE_HOOKUP_OBJECT (prefwin, vbox21, "vbox21");
diff --git a/plugins/gtkui/prefwin.c b/plugins/gtkui/prefwin.c
index e5753d55..ddecb632 100644
--- a/plugins/gtkui/prefwin.c
+++ b/plugins/gtkui/prefwin.c
@@ -576,6 +576,13 @@ on_preferences_activate (GtkMenuItem *menuitem,
// resume last session
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (w, "resume_last_session")), deadbeef->conf_get_int ("resume_last_session", 0));
+ // enable cp1251 recoding
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (w, "enable_cp1251_recoding")), deadbeef->conf_get_int ("junk.enable_cp1251_detection", 1));
+
+ // enable cp936 recoding
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (w, "enable_cp936_recoding")), deadbeef->conf_get_int ("junk.enable_cp936_detection", 0));
+
+
// fill gui plugin list
combobox = GTK_COMBO_BOX (lookup_widget (w, "gui_plugin"));
const char **names = deadbeef->plug_get_gui_names ();
@@ -1277,6 +1284,25 @@ on_resume_last_session_toggled (GtkToggleButton *togglebutton,
deadbeef->conf_set_int ("resume_last_session", active);
}
+void
+on_enable_cp1251_recoding_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data)
+{
+ int active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
+ deadbeef->conf_set_int ("junk.enable_cp1251_detection", active);
+ deadbeef->sendmessage (DB_EV_CONFIGCHANGED, 0, 0, 0);
+}
+
+
+void
+on_enable_cp936_recoding_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data)
+{
+ int active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
+ deadbeef->conf_set_int ("junk.enable_cp936_detection", active);
+ deadbeef->sendmessage (DB_EV_CONFIGCHANGED, 0, 0, 0);
+}
+
void
on_auto_name_playlist_from_folder_toggled