[easytag/wip/gsettings: 11/37] Use GSettings instead of custom settings parsing
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/gsettings: 11/37] Use GSettings instead of custom settings parsing
- Date: Sat, 6 Apr 2013 17:22:32 +0000 (UTC)
commit 577c5490384d123b00be8ee99af3c197c0891202
Author: David King <amigadave amigadave com>
Date: Sun Feb 17 16:07:20 2013 +0000
Use GSettings instead of custom settings parsing
src/ape_tag.c | 11 ++-
src/bar.c | 70 ++----------
src/browser.c | 26 +++--
src/cddb.c | 289 ++++++++++++++++++++++++++++++++++--------------
src/easytag.c | 88 +++++++++------
src/et_core.c | 46 +++++---
src/flac_tag.c | 47 +++++---
src/id3_tag.c | 42 +++++---
src/id3v24_tag.c | 57 ++++++----
src/log.c | 12 +-
src/misc.c | 96 ++++++++--------
src/mp4_tag.c | 7 +-
src/ogg_tag.c | 44 +++++--
src/prefs.c | 307 ++++++++++++++++++++++++++++----------------------
src/scan.c | 113 +++++++++++--------
src/setting.c | 328 +-----------------------------------------------------
src/setting.h | 116 +------------------
17 files changed, 742 insertions(+), 957 deletions(-)
---
diff --git a/src/ape_tag.c b/src/ape_tag.c
index 48afee7..5218ef1 100644
--- a/src/ape_tag.c
+++ b/src/ape_tag.c
@@ -111,14 +111,19 @@ gboolean Ape_Tag_Read_File_Tag (gchar *filename, File_Tag *FileTag)
string = Try_To_Validate_Utf8_String(string);
string1 = g_utf8_strchr(string, -1, '/'); // strchr don't like NULL string
- if (NUMBER_TRACK_FORMATED)
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
{
if (string1)
{
- FileTag->track_total = g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,
atoi(string1 + 1));
+ FileTag->track_total = g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings,
"tag-number-length"),
+ atoi (string1 + 1));
*string1 = '\0';
}
- FileTag->track = g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON, atoi(string));
+ FileTag->track = g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings,
+ "tag-number-length"),
+ atoi(string));
} else
{
if (string1)
diff --git a/src/bar.c b/src/bar.c
index 935a354..9687981 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -47,8 +47,6 @@ static GList *ActionPairsList = NULL;
* Prototypes *
**************/
-static void Check_Menu_Item_Toggled_Browse_Hidden_Dir (GtkWidget *checkmenuitem);
-static void Check_Menu_Item_Toggled_Browse_Subdir (GtkWidget *checkmenuitem);
static void Init_Menu_Bar (void);
static void Statusbar_Remove_Timer (void);
@@ -267,12 +265,15 @@ void Create_UI (GtkWidget **ppmenubar, GtkWidget **pptoolbar)
GtkToggleActionEntry ToggleActionEntries[] =
{
- //{ AM_BROWSE_SUBDIR, GTK_STOCK_INDEX, _("Browse _Subdirectories"),
NULL, _("Browse _Sub-directories"), NULL, FALSE
},
- { AM_BROWSE_SUBDIR, NULL, _("Browse _Subdirectories"),
NULL, _("Browse subdirectories"), NULL,
BROWSE_SUBDIR },
+ { AM_BROWSE_SUBDIR, NULL, _("Browse _Subdirectories"), NULL,
+ _("Browse subdirectories"), NULL,
+ g_settings_get_boolean (ETSettings, "browse-subdir") },
#ifndef G_OS_WIN32 /* No sense here for Win32, "hidden" means : starts with a
* '.'
*/
- { AM_BROWSER_HIDDEN_DIR, NULL, _("Show Hidden Directories"),
NULL, _("Show hidden directories"), G_CALLBACK(Browser_Tree_Rebuild),
BROWSE_HIDDEN_DIR },
+ { AM_BROWSER_HIDDEN_DIR, NULL, _("Show Hidden Directories"), NULL,
+ _("Show hidden directories"), G_CALLBACK(Browser_Tree_Rebuild),
+ g_settings_get_boolean (ETSettings, "browse-show-hidden") },
#endif /* !G_OS_WIN32 */
{ AM_VIEWMODE_TOGGLE, "easytag-artist-album", _("Show Tree Browser / Display by Artist and
Album"), NULL, _("Show tree browser / display by artist and Album"), G_CALLBACK(Action_Select_Browser_Style),
FALSE },
};
@@ -340,66 +341,19 @@ Init_Menu_Bar (void)
CheckMenuItemBrowseSubdirMainMenu = gtk_ui_manager_get_widget(UIManager,
"/MenuBar/BrowserMenu/BrowseSubdir");
if (CheckMenuItemBrowseSubdirMainMenu)
{
- // Link to update BROWSE_SUBDIR when changed
- g_signal_connect(G_OBJECT(CheckMenuItemBrowseSubdirMainMenu),"toggled",
- G_CALLBACK(Check_Menu_Item_Toggled_Browse_Subdir),NULL);
+ g_settings_bind (ETSettings, "browse-subdir",
+ CheckMenuItemBrowseSubdirMainMenu, "active",
+ G_SETTINGS_BIND_DEFAULT);
}
CheckMenuItemBrowseHiddenDirMainMenu = gtk_ui_manager_get_widget(UIManager,
"/MenuBar/BrowserMenu/BrowseHiddenDir");
if (CheckMenuItemBrowseHiddenDirMainMenu)
{
- // Link to update BROWSE_HIDDEN_DIR when changed
- g_signal_connect(G_OBJECT(CheckMenuItemBrowseHiddenDirMainMenu),"toggled",
- G_CALLBACK(Check_Menu_Item_Toggled_Browse_Hidden_Dir),NULL);
+ g_settings_bind (ETSettings, "browse-show-hidden",
+ CheckMenuItemBrowseHiddenDirMainMenu, "active",
+ G_SETTINGS_BIND_DEFAULT);
}
-
- /* If entry not implemented */
- //{GtkWidget *widget = gtk_item_factory_get_widget_by_action(ItemFactory,FILENAME_FROM_TXT);
- //if (widget) gtk_widget_set_sensitive(widget,FALSE);}
-}
-
-/*
- * Callback to update state of check button to browse subdir into menu
- */
-static void
-Check_Menu_Item_Toggled_Browse_Subdir (GtkWidget *checkmenuitem)
-{
- BROWSE_SUBDIR = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(checkmenuitem));
- Check_Menu_Item_Update_Browse_Subdir();
}
-void Check_Menu_Item_Update_Browse_Subdir (void)
-{
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(CheckMenuItemBrowseSubdirMainMenu),BROWSE_SUBDIR);
-}
-
-/*
- * Callback to update state of check button to show hiddendirectories into menu
- */
-static void
-Check_Menu_Item_Toggled_Browse_Hidden_Dir (GtkWidget *checkmenuitem)
-{
- BROWSE_HIDDEN_DIR = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(checkmenuitem));
- Check_Menu_Item_Update_Browse_Hidden_Dir();
-
- // Reload directory, in case we have changed BROWSE_HIDDEN_DIR
- //Browser_Tree_Rebuild(NULL); // Commented, as already done in GtkToggleActionEntry for
AM_BROWSER_HIDDEN_DIR
-}
-
-void
-Check_Menu_Item_Update_Browse_Hidden_Dir (void)
-{
-#ifndef G_OS_WIN32
-
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(CheckMenuItemBrowseHiddenDirMainMenu),BROWSE_HIDDEN_DIR);
-#endif /* !G_OS_WIN32 */
-}
-
-
-
-
-
-
-
-
/*
* Status bar functions
diff --git a/src/browser.c b/src/browser.c
index 8718ae7..92984e0 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -720,7 +720,7 @@ Browser_Tree_Node_Selected (GtkTreeSelection *selection, gpointer user_data)
selectedPath = gtk_tree_model_get_path(GTK_TREE_MODEL(directoryTreeModel), &selectedIter);
/* Open the node */
- if (OPEN_SELECTED_BROWSER_NODE)
+ if (g_settings_get_boolean (ETSettings, "browse-expand-children"))
{
gtk_tree_view_expand_row(GTK_TREE_VIEW(BrowserTree), selectedPath, FALSE);
}
@@ -741,7 +741,8 @@ Browser_Tree_Node_Selected (GtkTreeSelection *selection, gpointer user_data)
Update_Command_Buttons_Sensivity(); // Not clean to put this here...
/* Check if all files have been saved before changing the directory */
- if (CONFIRM_WHEN_UNSAVED_FILES && ET_Check_If_All_Files_Are_Saved() != TRUE)
+ if (g_settings_get_boolean (ETSettings, "confirm-when-unsaved-files")
+ && ET_Check_If_All_Files_Are_Saved() != TRUE)
{
GtkWidget *msgdialog;
gint response;
@@ -782,7 +783,7 @@ Browser_Tree_Node_Selected (GtkTreeSelection *selection, gpointer user_data)
/* Start to read the directory */
/* The first time, 'counter' is equal to zero. And if we don't want to load
* directory on startup, we skip the 'reading', but newt we must read it each time */
- if (LOAD_ON_STARTUP || counter)
+ if (g_settings_get_boolean (ETSettings, "load-on-startup") || counter)
{
gboolean dir_loaded;
GtkTreeIter parentIter;
@@ -800,7 +801,8 @@ Browser_Tree_Node_Selected (GtkTreeSelection *selection, gpointer user_data)
selectedPath = gtk_tree_model_get_path(GTK_TREE_MODEL(directoryTreeModel), &parentIter);
gtk_tree_selection_select_iter (selection, &parentIter);
gtk_tree_view_collapse_row(GTK_TREE_VIEW(BrowserTree),selectedPath);
- if (OPEN_SELECTED_BROWSER_NODE)
+ if (g_settings_get_boolean (ETSettings,
+ "browse-expand-children"))
{
gtk_tree_view_expand_row(GTK_TREE_VIEW(BrowserTree),selectedPath,FALSE);
}
@@ -1413,7 +1415,7 @@ Browser_List_Set_Row_Appearance (GtkTreeIter *iter)
// Set text to bold/red if 'filename' or 'tag' changed
if ( ET_Check_If_File_Is_Saved(rowETFile) == FALSE )
{
- if (CHANGED_FILES_DISPLAYED_TO_BOLD)
+ if (g_settings_get_boolean (ETSettings, "file-changed-bold"))
{
gtk_list_store_set(fileListModel, iter,
LIST_FONT_WEIGHT, PANGO_WEIGHT_BOLD,
@@ -2068,7 +2070,7 @@ Browser_Artist_List_Set_Row_Appearance (GtkTreeIter *iter)
{
if ( ET_Check_If_File_Is_Saved((ET_File *)etfilelist->data) == FALSE )
{
- if (CHANGED_FILES_DISPLAYED_TO_BOLD)
+ if (g_settings_get_boolean (ETSettings, "file-changed-bold"))
{
// Set the font-style to "bold"
gtk_list_store_set(artistListModel, iter,
@@ -2248,7 +2250,7 @@ Browser_Album_List_Set_Row_Appearance (GtkTreeIter *iter)
{
if ( ET_Check_If_File_Is_Saved((ET_File *)etfilelist->data) == FALSE )
{
- if (CHANGED_FILES_DISPLAYED_TO_BOLD)
+ if (g_settings_get_boolean (ETSettings, "file-changed-bold"))
{
// Set the font-style to "bold"
gtk_list_store_set(albumListModel, iter,
@@ -2709,7 +2711,7 @@ static gboolean check_for_subdir (gchar *path)
if ((g_ascii_strcasecmp(dirent->d_name,".") != 0)
&& (g_ascii_strcasecmp(dirent->d_name,"..") != 0)
// Display hidden directories is needed, or keep only the not hidden directories
- && (BROWSE_HIDDEN_DIR
+ && (g_settings_get_boolean (ETSettings, "browse-show-hidden")
|| !( (g_ascii_strncasecmp(dirent->d_name,".", 1) == 0)
&& (strlen(dirent->d_name) > 1)
&& (g_ascii_strncasecmp(dirent->d_name+1,".", 1) != 0) ))
@@ -2886,7 +2888,7 @@ static void expand_cb (GtkWidget *tree, GtkTreeIter *iter, GtkTreePath *gtreePat
&& (g_ascii_strcasecmp(dirent->d_name,".") != 0)
&& (g_ascii_strcasecmp(dirent->d_name,"..") != 0)
// Display hidden directories is needed, or keep only the not hidden directories
- && (BROWSE_HIDDEN_DIR
+ && (g_settings_get_boolean (ETSettings, "browse-show-hidden")
|| !( (g_ascii_strncasecmp(dirent->d_name,".", 1) == 0)
&& (strlen(dirent->d_name) > 1)
&& (g_ascii_strncasecmp(dirent->d_name+1,".", 1) != 0) ))
@@ -3701,7 +3703,9 @@ void Browser_Open_Rename_Directory_Window (void)
RenameDirectoryWithMask = gtk_check_button_new_with_label(_("Use mask:"));
gtk_box_pack_start(GTK_BOX(HBox),RenameDirectoryWithMask,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(RenameDirectoryWithMask),RENAME_DIRECTORY_WITH_MASK);
+ g_settings_bind (ETSettings, "rename-directory-with-mask",
+ RenameDirectoryWithMask, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(RenameDirectoryWithMask,_("If activated, it will use masks to rename
directory."));
g_signal_connect(G_OBJECT(RenameDirectoryWithMask),"toggled",G_CALLBACK(Rename_Directory_With_Mask_Toggled),NULL);
@@ -3814,8 +3818,6 @@ Destroy_Rename_Directory_Window (void)
Add_String_To_Combo_List(RenameDirectoryMaskModel, RENAME_DIRECTORY_DEFAULT_MASK);
Save_Rename_Directory_Masks_List(RenameDirectoryMaskModel, MASK_EDITOR_TEXT);
- RENAME_DIRECTORY_WITH_MASK =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(RenameDirectoryWithMask));
-
gtk_list_store_clear(RenameDirectoryMaskModel);
gtk_widget_destroy(RenameDirectoryWindow);
diff --git a/src/cddb.c b/src/cddb.c
index 6e9c542..d294d5a 100644
--- a/src/cddb.c
+++ b/src/cddb.c
@@ -183,7 +183,6 @@ static void Cddb_Display_Red_Lines_In_Result (void);
static void Cddb_Set_Apply_Button_Sensitivity (void);
static void Cddb_Set_Search_Button_Sensitivity (void);
-static void Cddb_Use_Dlm_2_Check_Button_Toggled (void);
static void Cddb_Show_Categories_Button_Toggled (void);
static gchar *Cddb_Generate_Request_String_With_Fields_And_Categories_Options (void);
static const gchar *Cddb_Get_Id3_Genre_From_Cddb_Genre (const gchar *cddb_genre);
@@ -311,7 +310,8 @@ void Open_Cddb_Window (void)
// Check box to run the scanner
CddbUseLocalAccess = gtk_check_button_new_with_label(_("Use local CDDB"));
gtk_box_pack_start(GTK_BOX(hbox),CddbUseLocalAccess,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbUseLocalAccess),CDDB_USE_LOCAL_ACCESS);
+ g_settings_bind (ETSettings, "cddb-local", CddbUseLocalAccess, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(CddbUseLocalAccess,_("When activating this option, after loading the "
"fields, the current selected scanner will be ran (the scanner window must be opened)."));
@@ -455,7 +455,8 @@ void Open_Cddb_Window (void)
gtk_grid_attach (GTK_GRID (Table), CddbSearchInTitleField, 3, 0, 1, 1);
gtk_grid_attach (GTK_GRID (Table), CddbSearchInTrackNameField, 4, 0, 1, 1);
gtk_grid_attach (GTK_GRID (Table), CddbSearchInOtherField, 5, 0, 1, 1);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbSearchInAllFields), CDDB_SEARCH_IN_ALL_FIELDS);
+ g_settings_bind (ETSettings, "cddb-search-all-fields",
+ CddbSearchInAllFields, "active", G_SETTINGS_BIND_DEFAULT);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbSearchInArtistField), CDDB_SEARCH_IN_ARTIST_FIELD);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbSearchInTitleField), CDDB_SEARCH_IN_TITLE_FIELD);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbSearchInTrackNameField),
CDDB_SEARCH_IN_TRACK_NAME_FIELD);
@@ -520,7 +521,9 @@ void Open_Cddb_Window (void)
gtk_grid_attach (GTK_GRID (Table), CddbSearchInSoundtrackCategory, 6, 3, 1,
1);
gtk_label_set_line_wrap(GTK_LABEL(gtk_bin_get_child(GTK_BIN(CddbSearchInAllCategories))),TRUE); // Wrap
label of the check button.
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbSearchInAllCategories),
CDDB_SEARCH_IN_ALL_CATEGORIES);
+ g_settings_bind (ETSettings, "cddb-search-all-categories",
+ CddbSearchInAllCategories, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbSearchInBluesCategory),
CDDB_SEARCH_IN_BLUES_CATEGORY);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbSearchInClassicalCategory),
CDDB_SEARCH_IN_CLASSICAL_CATEGORY);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbSearchInCountryCategory),
CDDB_SEARCH_IN_COUNTRY_CATEGORY);
@@ -550,7 +553,9 @@ void Open_Cddb_Window (void)
// Button to display/hide the categories
CddbShowCategoriesButton = gtk_toggle_button_new_with_label(_("Categories"));
gtk_grid_attach (GTK_GRID (Table), CddbShowCategoriesButton, 6, 0, 1, 1);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbShowCategoriesButton),CDDB_SHOW_CATEGORIES);
+ g_settings_bind (ETSettings, "cddb-search-show-categories",
+ CddbShowCategoriesButton, "active",
+ G_SETTINGS_BIND_DEFAULT);
g_signal_connect(G_OBJECT(CddbShowCategoriesButton),"toggled",
G_CALLBACK(Cddb_Show_Categories_Button_Toggled),NULL);
/*
@@ -799,23 +804,22 @@ void Open_Cddb_Window (void)
// Check box to run the scanner
CddbRunScanner = gtk_check_button_new_with_label(_("Run the current scanner for each file"));
gtk_box_pack_start(GTK_BOX(hbox),CddbRunScanner,FALSE,TRUE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbRunScanner),CDDB_RUN_SCANNER);
+ g_settings_bind (ETSettings, "cddb-run-scanner", CddbRunScanner, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(CddbRunScanner,_("When activating this option, after loading the "
"fields, the current selected scanner will be ran (the scanner window must be opened)."));
// Check box to use DLM (also used in the preferences window)
CddbUseDLM2 = gtk_check_button_new_with_label(_("Match lines with the Levenshtein algorithm"));
gtk_box_pack_start(GTK_BOX(hbox),CddbUseDLM2,FALSE,FALSE,2);
- // Doesn't activate it by default because if the new user don't pay attention to it,
- // it will not understand why the cddb results aren't loaded correctly...
- //gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbUseDLM2),CDDB_USE_DLM);
+ g_settings_bind (ETSettings, "cddb-dlm-enabled", CddbUseDLM2, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(CddbUseDLM2,_("When activating this option, the "
"Levenshtein algorithm (DLM: Damerau-Levenshtein Metric) will be used "
"to match the CDDB title against every file name in the current folder, "
"and to select the best match. This will be used when selecting the "
"corresponding audio file, or applying CDDB results, instead of using "
"directly the position order."));
- g_signal_connect(G_OBJECT(CddbUseDLM2),"toggled",G_CALLBACK(Cddb_Use_Dlm_2_Check_Button_Toggled),NULL);
// Button to apply
CddbApplyButton = gtk_button_new_from_stock(GTK_STOCK_APPLY);
@@ -840,7 +844,7 @@ void Open_Cddb_Window (void)
CddbStopSearch = FALSE;
gtk_widget_show_all(CddbWindow);
- if (SET_CDDB_WINDOW_POSITION
+ if (g_settings_get_boolean (ETSettings, "cddb-remember-location")
&& CDDB_WINDOW_X > 0 && CDDB_WINDOW_Y > 0)
{
gtk_window_move(GTK_WINDOW(CddbWindow),CDDB_WINDOW_X,CDDB_WINDOW_Y);
@@ -913,14 +917,11 @@ void Cddb_Window_Apply_Changes (void)
CDDB_PANE_HANDLE_POSITION = gtk_paned_get_position(GTK_PANED(CddbWindowHPaned));
}
- CDDB_SEARCH_IN_ALL_FIELDS =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbSearchInAllFields));
CDDB_SEARCH_IN_ARTIST_FIELD =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbSearchInArtistField));
CDDB_SEARCH_IN_TITLE_FIELD =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbSearchInTitleField));
CDDB_SEARCH_IN_TRACK_NAME_FIELD =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbSearchInTrackNameField));
CDDB_SEARCH_IN_OTHER_FIELD =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbSearchInOtherField));
- CDDB_SHOW_CATEGORIES =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbShowCategoriesButton));
- CDDB_SEARCH_IN_ALL_CATEGORIES =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbSearchInAllCategories));
CDDB_SEARCH_IN_BLUES_CATEGORY =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbSearchInBluesCategory));
CDDB_SEARCH_IN_CLASSICAL_CATEGORY =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbSearchInClassicalCategory));
CDDB_SEARCH_IN_COUNTRY_CATEGORY =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbSearchInCountryCategory));
@@ -942,10 +943,6 @@ void Cddb_Window_Apply_Changes (void)
CDDB_SET_TO_GENRE = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbSetToGenre));
CDDB_SET_TO_FILE_NAME = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbSetToFileName));
- CDDB_RUN_SCANNER = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbRunScanner));
- CDDB_USE_DLM = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbUseDLM2));
- CDDB_USE_LOCAL_ACCESS = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbUseLocalAccess));
-
// Save combobox history lists before exit
Save_Cddb_Search_String_List(CddbSearchStringModel, MISC_COMBO_TEXT);
Save_Cddb_Search_String_In_Result_List(CddbSearchStringInResultModel, MISC_COMBO_TEXT);
@@ -1087,15 +1084,6 @@ Cddb_Set_Apply_Button_Sensitivity (void)
}
static void
-Cddb_Use_Dlm_2_Check_Button_Toggled (void)
-{
- if (CddbUseDLM2)
- {
- CDDB_USE_DLM = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbUseDLM2));
- }
-}
-
-static void
Cddb_Set_Search_Button_Sensitivity (void)
{
gboolean cddbinallfields, cddbinartistfield, cddbintitlefield, cddbintracknamefield, cddbinotherfield;
@@ -1386,8 +1374,8 @@ Cddb_Track_List_Row_Selected (GtkTreeSelection *selection, gpointer data)
gchar *text_path;
ET_File **etfile;
- // Exit if we don't have to select files in the main list
- if (!CDDB_FOLLOW_FILE)
+ /* Exit if we don't have to select files in the main list. */
+ if (!g_settings_get_boolean (ETSettings, "cddb-follow-file"))
return;
selectedRows = gtk_tree_selection_get_selected_rows(selection, NULL);
@@ -1410,7 +1398,7 @@ Cddb_Track_List_Row_Selected (GtkTreeSelection *selection, gpointer data)
found = gtk_tree_model_get_iter(GTK_TREE_MODEL(CddbTrackListModel), ¤tFile,
(GtkTreePath*)selectedRows->data);
if (found)
{
- if (CDDB_USE_DLM)
+ if (g_settings_get_boolean (ETSettings, "cddb-dlm-enabled"))
{
gtk_tree_model_get(GTK_TREE_MODEL(CddbTrackListModel), ¤tFile,
CDDB_TRACK_LIST_NAME, &text_path,
@@ -2137,12 +2125,19 @@ Cddb_Generate_Request_String_With_Fields_And_Categories_Options (void)
static gboolean
Cddb_Search_Album_List_From_String (void)
{
- if ( strstr(CDDB_SERVER_NAME_MANUAL_SEARCH,"gnudb") != NULL )
- // Use of gnudb
- return Cddb_Search_Album_List_From_String_Gnudb();
+ gchar *hostname = g_settings_get_string (ETSettings,
+ "cddb-manual-search-hostname");
+
+ if (strstr (hostname, "gnudb") != NULL)
+ {
+ g_free (hostname);
+ return Cddb_Search_Album_List_From_String_Gnudb ();
+ }
else
- // Use of freedb
- return Cddb_Search_Album_List_From_String_Freedb();
+ {
+ g_free (hostname);
+ return Cddb_Search_Album_List_From_String_Freedb ();
+ }
}
@@ -2165,6 +2160,9 @@ Cddb_Search_Album_List_From_String_Freedb (void)
gchar *cddb_server_name;
gint cddb_server_port;
gchar *cddb_server_cgi_path;
+ gboolean proxy_enabled;
+ gchar *proxy_hostname;
+ guint proxy_port;
gchar *ptr_cat, *cat_str, *id_str, *art_alb_str;
gchar *art_alb_tmp = NULL;
@@ -2201,17 +2199,28 @@ Cddb_Search_Album_List_From_String_Freedb (void)
while ( (tmp=strchr(string,' '))!=NULL )
*tmp = '+';
- cddb_server_name = g_strdup(CDDB_SERVER_NAME_MANUAL_SEARCH); //"www.freedb.org");
- cddb_server_port = CDDB_SERVER_PORT_MANUAL_SEARCH; //80;
- cddb_server_cgi_path = g_strdup(CDDB_SERVER_CGI_PATH_MANUAL_SEARCH);//"/~cddb/cddb.cgi");
+ cddb_server_name = g_settings_get_string (ETSettings,
+ "cddb-manual-search-hostname");
+ cddb_server_port = g_settings_get_uint (ETSettings,
+ "cddb-manual-search-port");
+ cddb_server_cgi_path = g_settings_get_string (ETSettings,
+ "cddb-manual-search-path");
/* Connection to the server */
- if ( (socket_id=Cddb_Open_Connection(CDDB_USE_PROXY?CDDB_PROXY_NAME:cddb_server_name,
- CDDB_USE_PROXY?CDDB_PROXY_PORT:cddb_server_port)) <= 0 )
+ proxy_enabled = g_settings_get_boolean (ETSettings, "cddb-proxy-enabled");
+ proxy_hostname = g_settings_get_string (ETSettings, "cddb-proxy-hostname");
+ proxy_port = g_settings_get_uint (ETSettings, "cddb-proxy-port");
+ if ((socket_id = Cddb_Open_Connection (proxy_enabled
+ ? proxy_hostname
+ : cddb_server_name,
+ proxy_enabled
+ ? proxy_port
+ : cddb_server_port)) <= 0)
{
g_free(string);
g_free(cddb_server_name);
- g_free(cddb_server_cgi_path);
+ g_free (cddb_server_cgi_path);
+ g_free (proxy_hostname);
return FALSE;
}
@@ -2227,7 +2236,8 @@ Cddb_Search_Album_List_From_String_Freedb (void)
"%s"
"Connection: close\r\n"
"\r\n",
- CDDB_USE_PROXY?"http://":"", CDDB_USE_PROXY?cddb_server_name:"", // Needed
when using proxy
+ proxy_enabled ? "http://" : "",
+ proxy_enabled ? cddb_server_name : "",
string,
(tmp=Cddb_Generate_Request_String_With_Fields_And_Categories_Options()),
cddb_server_name,cddb_server_port,
@@ -2251,6 +2261,7 @@ Cddb_Search_Album_List_From_String_Freedb (void)
g_free(string);
g_free(cddb_server_name);
g_free(cddb_server_cgi_path);
+ g_free (proxy_hostname);
return FALSE;
}
g_free(cddb_in);
@@ -2299,6 +2310,7 @@ Cddb_Search_Album_List_From_String_Freedb (void)
g_free(cddb_out);
g_free(cddb_server_name);
g_free(cddb_server_cgi_path);
+ g_free (proxy_hostname);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchButton),FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchAutoButton),FALSE);
if (file)
@@ -2424,6 +2436,7 @@ Cddb_Search_Album_List_From_String_Freedb (void)
g_free(cat_str); g_free(id_str); g_free(art_alb_str); g_free(end_str); g_free(html_end_str);
g_free(cddb_server_name);
g_free(cddb_server_cgi_path);
+ g_free (proxy_hostname);
// Close file opened for reading lines
if (file)
@@ -2474,6 +2487,9 @@ Cddb_Search_Album_List_From_String_Gnudb (void)
gchar *cddb_server_name;
gint cddb_server_port;
gchar *cddb_server_cgi_path;
+ gboolean proxy_enabled;
+ gchar *proxy_hostname;
+ guint proxy_port;
gchar *ptr_cat, *cat_str, *art_alb_str;
gchar *end_str;
@@ -2531,17 +2547,30 @@ Cddb_Search_Album_List_From_String_Gnudb (void)
// Do a loop to load all the pages of results
do
{
- cddb_server_name = g_strdup(CDDB_SERVER_NAME_MANUAL_SEARCH); //"www.gnudb.org");
- cddb_server_port = CDDB_SERVER_PORT_MANUAL_SEARCH; //80;
- cddb_server_cgi_path = g_strdup(CDDB_SERVER_CGI_PATH_MANUAL_SEARCH);//"/~cddb/cddb.cgi");
+ cddb_server_name = g_settings_get_string (ETSettings,
+ "cddb-manual-search-hostname");
+ cddb_server_port = g_settings_get_uint (ETSettings,
+ "cddb-manual-search-port");
+ cddb_server_cgi_path = g_settings_get_string (ETSettings,
+ "cddb-manual-search-path");
/* Connection to the server */
- if ( (socket_id=Cddb_Open_Connection(CDDB_USE_PROXY?CDDB_PROXY_NAME:cddb_server_name,
- CDDB_USE_PROXY?CDDB_PROXY_PORT:cddb_server_port)) <= 0 )
+ proxy_enabled = g_settings_get_boolean (ETSettings,
+ "cddb-proxy-enabled");
+ proxy_hostname = g_settings_get_string (ETSettings,
+ "cddb-proxy-hostname");
+ proxy_port = g_settings_get_uint (ETSettings, "cddb-proxy-port");
+ if ((socket_id = Cddb_Open_Connection (proxy_enabled
+ ? proxy_hostname
+ : cddb_server_name,
+ proxy_enabled
+ ? proxy_port
+ : cddb_server_port)) <= 0)
{
g_free(string);
g_free(cddb_server_name);
g_free(cddb_server_cgi_path);
+ g_free (proxy_hostname);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchButton),FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchAutoButton),FALSE);
return FALSE;
@@ -2558,7 +2587,8 @@ Cddb_Search_Album_List_From_String_Gnudb (void)
"%s"
"Connection: close\r\n"
"\r\n",
- CDDB_USE_PROXY?"http://":"", CDDB_USE_PROXY?cddb_server_name:"", //
Needed when using proxy
+ proxy_enabled ? "http://" : "",
+ proxy_enabled ? cddb_server_name : "",
string,
next_page_cpt,
cddb_server_name,cddb_server_port,
@@ -2580,6 +2610,7 @@ Cddb_Search_Album_List_From_String_Gnudb (void)
g_free(string);
g_free(cddb_server_name);
g_free(cddb_server_cgi_path);
+ g_free (proxy_hostname);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchButton),FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchAutoButton),FALSE);
return FALSE;
@@ -2610,6 +2641,7 @@ Cddb_Search_Album_List_From_String_Gnudb (void)
g_free(string);
g_free(cddb_server_name);
g_free(cddb_server_cgi_path);
+ g_free (proxy_hostname);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchButton),FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchAutoButton),FALSE);
return FALSE;
@@ -2627,6 +2659,7 @@ Cddb_Search_Album_List_From_String_Gnudb (void)
g_free(string);
g_free(cddb_server_name);
g_free(cddb_server_cgi_path);
+ g_free (proxy_hostname);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchButton),FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchAutoButton),FALSE);
if (file)
@@ -2772,6 +2805,7 @@ Cddb_Search_Album_List_From_String_Gnudb (void)
g_free(sraf_str);g_free(sraf_end_str);
g_free(cddb_server_name);
g_free(cddb_server_cgi_path);
+ g_free (proxy_hostname);
// Close file opened for reading lines
if (file)
@@ -2824,6 +2858,9 @@ Cddb_Search_Album_From_Selected_Files (void)
gchar *cddb_server_name;
gint cddb_server_port;
gchar *cddb_server_cgi_path;
+ gboolean proxy_enabled;
+ gchar *proxy_hostname;
+ guint proxy_port;
gint server_try = 0;
gchar *tmp, *valid;
gchar *query_string;
@@ -2955,8 +2992,7 @@ Cddb_Search_Album_From_Selected_Files (void)
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchAutoButton),TRUE);
- CDDB_USE_LOCAL_ACCESS = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbUseLocalAccess));
- if (CDDB_USE_LOCAL_ACCESS) // Remote or Local acces?
+ if (g_settings_get_boolean (ETSettings, "cddb-local"))
{
/*
* Local cddb acces
@@ -3083,29 +3119,45 @@ Cddb_Search_Album_From_Selected_Files (void)
server_try++;
if (server_try == 1)
{
- // 1rst try
- cddb_server_name = g_strdup(CDDB_SERVER_NAME_AUTOMATIC_SEARCH);
- cddb_server_port = CDDB_SERVER_PORT_AUTOMATIC_SEARCH;
- cddb_server_cgi_path = g_strdup(CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH);
+ /* 1st try. */
+ cddb_server_name = g_settings_get_string (ETSettings,
+ "cddb-automatic-search-hostname");
+ cddb_server_port = g_settings_get_uint (ETSettings,
+ "cddb-automatic-search-port");
+ cddb_server_cgi_path = g_settings_get_string (ETSettings,
+ "cddb-automatic-search-path");
}else
{
- // 2sd try
- cddb_server_name = g_strdup(CDDB_SERVER_NAME_AUTOMATIC_SEARCH2);
- cddb_server_port = CDDB_SERVER_PORT_AUTOMATIC_SEARCH2;
- cddb_server_cgi_path = g_strdup(CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH2);
+ /* 2nd try. */
+ cddb_server_name = g_settings_get_string (ETSettings,
+ "cddb-automatic-search-hostname2");
+ cddb_server_port = g_settings_get_uint (ETSettings,
+ "cddb-automatic-search-port");
+ cddb_server_cgi_path = g_settings_get_string (ETSettings,
+ "cddb-automatic-search-path2");
}
// Check values
if (!cddb_server_name || strcmp(cddb_server_name,"")==0)
continue;
- // Connection to the server
- if ( (socket_id=Cddb_Open_Connection(CDDB_USE_PROXY?CDDB_PROXY_NAME:cddb_server_name,
- CDDB_USE_PROXY?CDDB_PROXY_PORT:cddb_server_port)) <= 0 )
+ /* Connection to the server. */
+ proxy_enabled = g_settings_get_boolean (ETSettings,
+ "cddb-proxy-enabled");
+ proxy_hostname = g_settings_get_string (ETSettings,
+ "cddb-proxy-hostname");
+ proxy_port = g_settings_get_uint (ETSettings, "cddb-proxy-port");
+ if ((socket_id = Cddb_Open_Connection (proxy_enabled
+ ? proxy_hostname
+ : cddb_server_name,
+ proxy_enabled
+ ? proxy_port
+ : cddb_server_port)) <= 0)
{
g_free(cddb_in);
g_free(cddb_server_name);
g_free(cddb_server_cgi_path);
+ g_free (proxy_hostname);
return FALSE;
}
@@ -3122,7 +3174,9 @@ Cddb_Search_Album_From_Selected_Files (void)
"Host: %s:%d\r\n"
"%s"
"Connection: close\r\n\r\n",
- CDDB_USE_PROXY?"http://":"",CDDB_USE_PROXY?cddb_server_name:"",
cddb_server_cgi_path,
+ proxy_enabled ? "http://" : "",
+ proxy_enabled ? cddb_server_name : "",
+ cddb_server_cgi_path,
cddb_discid,
num_tracks, query_string,
disc_length,
@@ -3148,6 +3202,7 @@ Cddb_Search_Album_From_Selected_Files (void)
g_free(cddb_in);
g_free(cddb_server_name);
g_free(cddb_server_cgi_path);
+ g_free (proxy_hostname);
return FALSE;
}
g_free(cddb_in);
@@ -3169,6 +3224,7 @@ Cddb_Search_Album_From_Selected_Files (void)
g_free(msg);
g_free(cddb_server_name);
g_free(cddb_server_cgi_path);
+ g_free (proxy_hostname);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchButton),FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchAutoButton),FALSE);
return FALSE;
@@ -3185,6 +3241,7 @@ Cddb_Search_Album_From_Selected_Files (void)
g_free(cddb_out);
g_free(cddb_server_name);
g_free(cddb_server_cgi_path);
+ g_free (proxy_hostname);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchButton),FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchAutoButton),FALSE);
if (file)
@@ -3275,6 +3332,7 @@ Cddb_Search_Album_From_Selected_Files (void)
g_free(cddb_end_str);
g_free(cddb_server_name);
g_free(cddb_server_cgi_path);
+ g_free (proxy_hostname);
// Close file opened for reading lines
if (file)
@@ -3352,6 +3410,9 @@ Cddb_Get_Album_Tracks_List (GtkTreeSelection* selection)
gchar *cddb_server_name;
gint cddb_server_port;
gchar *cddb_server_cgi_path;
+ gboolean proxy_enabled;
+ gchar *proxy_hostname;
+ guint proxy_port;
gint bytes_written;
gulong bytes_read_total = 0;
FILE *file = NULL;
@@ -3395,10 +3456,22 @@ Cddb_Get_Album_Tracks_List (GtkTreeSelection* selection)
{
// Remote access
- // Connection to the server
- if ( (socket_id=Cddb_Open_Connection(CDDB_USE_PROXY?CDDB_PROXY_NAME:cddb_server_name,
- CDDB_USE_PROXY?CDDB_PROXY_PORT:cddb_server_port)) <= 0 )
+ /* Connection to the server. */
+ proxy_enabled = g_settings_get_boolean (ETSettings,
+ "cddb-proxy-enabled");
+ proxy_hostname = g_settings_get_string (ETSettings,
+ "cddb-proxy-hostname");
+ proxy_port = g_settings_get_uint (ETSettings, "cddb-proxy-port");
+ if ((socket_id = Cddb_Open_Connection (proxy_enabled
+ ? proxy_hostname
+ : cddb_server_name,
+ proxy_enabled
+ ? proxy_port
+ : cddb_server_port)) <= 0)
+ {
+ g_free (proxy_hostname);
return FALSE;
+ }
if ( strstr(cddb_server_name,"gnudb") != NULL )
{
@@ -3412,7 +3485,8 @@ Cddb_Get_Album_Tracks_List (GtkTreeSelection* selection)
"%s"
"Connection: close\r\n"
"\r\n",
- CDDB_USE_PROXY?"http://":"",
CDDB_USE_PROXY?cddb_server_name:"", // Needed when using proxy
+ proxy_enabled ? "http://" : "",
+ proxy_enabled ? cddb_server_name : "",
cddbalbum->category,cddbalbum->id,
cddb_server_name,cddb_server_port,
PACKAGE_NAME, PACKAGE_VERSION,
@@ -3430,7 +3504,9 @@ Cddb_Get_Album_Tracks_List (GtkTreeSelection* selection)
"Host: %s:%d\r\n"
"%s"
"Connection: close\r\n\r\n",
- CDDB_USE_PROXY?"http://":"",CDDB_USE_PROXY?cddb_server_name:"",
cddb_server_cgi_path,
+ proxy_enabled ? "http://" : "",
+ proxy_enabled ? cddb_server_name : "",
+ cddb_server_cgi_path,
cddbalbum->category,cddbalbum->id,
PACKAGE_NAME, PACKAGE_VERSION,
cddb_server_name,cddb_server_port,
@@ -3450,6 +3526,7 @@ Cddb_Get_Album_Tracks_List (GtkTreeSelection* selection)
Log_Print(LOG_ERROR,_("Cannot send the request (%s)"),g_strerror(errno));
Cddb_Close_Connection(socket_id);
g_free(cddb_in);
+ g_free (proxy_hostname);
return FALSE;
}
g_free(cddb_in);
@@ -3469,6 +3546,7 @@ Cddb_Get_Album_Tracks_List (GtkTreeSelection* selection)
g_free(msg);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchButton),FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchAutoButton),FALSE);
+ g_free (proxy_hostname);
return FALSE;
}
@@ -3485,6 +3563,7 @@ Cddb_Get_Album_Tracks_List (GtkTreeSelection* selection)
Log_Print(LOG_ERROR,"%s",msg);
g_free(msg);
g_free(cddb_out);
+ g_free (proxy_hostname);
if (file)
fclose(file);
return FALSE;
@@ -3500,12 +3579,14 @@ Cddb_Get_Album_Tracks_List (GtkTreeSelection* selection)
Log_Print(LOG_ERROR,"%s",msg);
g_free(msg);
g_free(cddb_out);
+ g_free (proxy_hostname);
if (file)
fclose(file);
return FALSE;
}
}
g_free(cddb_out);
+ g_free (proxy_hostname);
}
cddb_end_str = g_strdup(".");
@@ -3720,7 +3801,7 @@ Cddb_Album_List_Set_Row_Appearance (GtkTreeIter *row)
if (cddbalbum->track_list != NULL)
{
- if (CHANGED_FILES_DISPLAYED_TO_BOLD)
+ if (g_settings_get_boolean (ETSettings, "file-changed-bold"))
{
gtk_list_store_set(CddbAlbumListModel, row,
CDDB_ALBUM_LIST_FONT_STYLE, PANGO_STYLE_NORMAL,
@@ -3746,7 +3827,7 @@ Cddb_Album_List_Set_Row_Appearance (GtkTreeIter *row)
{
if (cddbalbum->other_version == TRUE)
{
- if (CHANGED_FILES_DISPLAYED_TO_BOLD)
+ if (g_settings_get_boolean (ETSettings, "file-changed-bold"))
{
gtk_list_store_set(CddbAlbumListModel, row,
CDDB_ALBUM_LIST_FONT_STYLE, PANGO_STYLE_ITALIC,
@@ -3931,10 +4012,11 @@ Cddb_Set_Track_Infos_To_File_List (void)
if (gtk_tree_model_get_iter(GTK_TREE_MODEL(CddbTrackListModel), ¤tIter, currentPath))
gtk_tree_model_get(GTK_TREE_MODEL(CddbTrackListModel), ¤tIter, CDDB_TRACK_LIST_DATA,
&cddbtrackalbum, -1);
- // Set values in the ETFile
- if (CDDB_USE_DLM)
+ /* Set values in the ETFile. */
+ if (g_settings_get_boolean (ETSettings, "cddb-dlm-enabled"))
{
- // RQ : this part is ~ equal to code for '!CDDB_USE_DLM', but uses '*etfile' instead of 'etfile'
+ /* RQ : this part is ~ equal to code for '!cddb-dlm-enabled', but
+ * uses '*etfile' instead of 'etfile'. */
ET_File **etfile = NULL;
File_Name *FileName = NULL;
File_Tag *FileTag = NULL;
@@ -3967,14 +4049,26 @@ Cddb_Set_Track_Infos_To_File_List (void)
if (cddbsettoallfields || cddbsettotrack)
{
- if (NUMBER_TRACK_FORMATED)
snprintf(buffer,sizeof(buffer),"%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,cddbtrackalbum->track_number);
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
+ {
+ snprintf (buffer, sizeof (buffer), "%.*d",
+ g_settings_get_uint (ETSettings,
+ "tag-number-length"),
+ cddbtrackalbum->track_number);
+ }
else snprintf(buffer,sizeof(buffer),"%d",
cddbtrackalbum->track_number);
ET_Set_Field_File_Tag_Item(&FileTag->track,buffer);
}
if (cddbsettoallfields || cddbsettotracktotal)
{
- if (NUMBER_TRACK_FORMATED)
snprintf(buffer,sizeof(buffer),"%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,list_length);
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
+ {
+ snprintf (buffer, sizeof (buffer), "%.*d",
+ g_settings_get_uint (ETSettings,
+ "tag-number-length"),
+ list_length);
+ }
else snprintf(buffer,sizeof(buffer),"%d", list_length);
ET_Set_Field_File_Tag_Item(&FileTag->track_total,buffer);
}
@@ -3999,8 +4093,14 @@ Cddb_Set_Track_Infos_To_File_List (void)
// Allocation of a new FileName
FileName = ET_File_Name_Item_New();
- // Build the filename with the path
- if (NUMBER_TRACK_FORMATED)
snprintf(buffer,sizeof(buffer),"%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,cddbtrackalbum->track_number);
+ /* Build the filename with the path. */
+ if (g_settings_get_boolean (ETSettings, "tag-pag-number"))
+ {
+ snprintf (buffer, sizeof (buffer), "%.*d",
+ g_settings_get_uint (ETSettings,
+ "tag-number-length"),
+ cddbtrackalbum->track_number);
+ }
else snprintf(buffer,sizeof(buffer),"%d",
cddbtrackalbum->track_number);
filename_generated_utf8 = g_strconcat(buffer," - ",cddbtrackalbum->track_name,NULL);
@@ -4053,14 +4153,26 @@ Cddb_Set_Track_Infos_To_File_List (void)
if (cddbsettoallfields || cddbsettotrack)
{
- if (NUMBER_TRACK_FORMATED)
snprintf(buffer,sizeof(buffer),"%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,cddbtrackalbum->track_number);
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
+ {
+ snprintf (buffer, sizeof(buffer), "%.*d",
+ g_settings_get_uint (ETSettings,
+ "tag-number-length"),
+ cddbtrackalbum->track_number);
+ }
else snprintf(buffer,sizeof(buffer),"%d",
cddbtrackalbum->track_number);
ET_Set_Field_File_Tag_Item(&FileTag->track,buffer);
}
if (cddbsettoallfields || cddbsettotracktotal)
{
- if (NUMBER_TRACK_FORMATED)
snprintf(buffer,sizeof(buffer),"%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,list_length);
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
+ {
+ snprintf (buffer, sizeof(buffer), "%.*d",
+ g_settings_get_uint (ETSettings,
+ "tag-number-length"),
+ list_length);
+ }
else snprintf(buffer,sizeof(buffer),"%d", list_length);
ET_Set_Field_File_Tag_Item(&FileTag->track_total,buffer);
}
@@ -4085,8 +4197,14 @@ Cddb_Set_Track_Infos_To_File_List (void)
// Allocation of a new FileName
FileName = ET_File_Name_Item_New();
- // Build the filename with the path
- if (NUMBER_TRACK_FORMATED)
snprintf(buffer,sizeof(buffer),"%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,cddbtrackalbum->track_number);
+ /* Build the filename with the path. */
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
+ {
+ snprintf (buffer, sizeof(buffer), "%.*d",
+ g_settings_get_uint (ETSettings,
+ "tag-number-length"),
+ cddbtrackalbum->track_number);
+ }
else snprintf(buffer,sizeof(buffer),"%d",
cddbtrackalbum->track_number);
filename_generated_utf8 = g_strconcat(buffer," - ",cddbtrackalbum->track_name,NULL);
@@ -4184,14 +4302,18 @@ Cddb_Get_Pixbuf_From_Server_Name (const gchar *server_name)
static gchar *
Cddb_Format_Proxy_Authentification (void)
{
+ gchar *username, *password;
gchar *ret;
- if (CDDB_USE_PROXY && CDDB_PROXY_USER_NAME != NULL && *CDDB_PROXY_USER_NAME != '\0')
+ username = g_settings_get_string (ETSettings, "cddb-proxy-username");
+ password = g_settings_get_string (ETSettings, "cddb-proxy-password");
+ if (g_settings_get_boolean (ETSettings, "cddb-proxy-enabled")
+ && username != NULL && *username != '\0')
{
const gchar *tempstr;
gchar *str_encoded;
- tempstr = g_strconcat(CDDB_PROXY_USER_NAME, ":", CDDB_PROXY_USER_PASSWORD, NULL);
+ tempstr = g_strconcat (username, ":", password, NULL);
str_encoded = g_base64_encode((const guchar *)tempstr, strlen(tempstr));
ret = g_strdup_printf("Proxy-authorization: Basic %s\r\n", str_encoded);
@@ -4200,5 +4322,8 @@ Cddb_Format_Proxy_Authentification (void)
{
ret = g_strdup("");
}
+
+ g_free (username);
+ g_free (password);
return ret;
}
diff --git a/src/easytag.c b/src/easytag.c
index f656997..23fe5f4 100644
--- a/src/easytag.c
+++ b/src/easytag.c
@@ -219,14 +219,15 @@ command_line (GApplication *application,
/* FIXME: Should manage directory ".." in path. */
while (pathsplit[ps_index])
{
- /* Activate hidden directories in browser if path contains a dir
- * like ".hidden_dir". */
- if ( (g_ascii_strcasecmp (pathsplit[ps_index],"..") != 0)
- && (g_ascii_strncasecmp(pathsplit[ps_index],".", 1) == 0)
- && (strlen(pathsplit[ps_index]) > 1) )
- BROWSE_HIDDEN_DIR = 1;
- /* If user saves the config for this session, this value will
- * be saved to 1. */
+ /* Activate hidden directories in browser if path contains a
+ * dir like ".hidden_dir". */
+ if ((g_ascii_strcasecmp (pathsplit[ps_index], "..") != 0)
+ && (g_ascii_strncasecmp (pathsplit[ps_index], ".", 1) == 0)
+ && (strlen (pathsplit[ps_index]) > 1))
+ {
+ g_settings_set_boolean (ETSettings, "browse-show-hidden",
+ TRUE);
+ }
if (pathsplit[ps_index]
&& g_ascii_strcasecmp(pathsplit[ps_index],".") != 0
@@ -339,7 +340,6 @@ activate (GApplication *application, gpointer user_data)
/* Display_Config(); // <- for debugging */
-
/* Initialization */
ET_Core_Create();
Main_Stop_Button_Pressed = FALSE;
@@ -430,7 +430,7 @@ activate (GApplication *application, gpointer user_data)
gtk_widget_show(MainWindow);
- if (SET_MAIN_WINDOW_POSITION)
+ if (g_settings_get_boolean (ETSettings, "remember-location"))
gtk_window_move(GTK_WINDOW(MainWindow), MAIN_WINDOW_X, MAIN_WINDOW_Y);
/* Load the default dir when the UI is created and displayed
@@ -590,8 +590,9 @@ Create_File_Area (void)
gtk_widget_show(HBox);
gtk_widget_show(FileIndex);
gtk_widget_show(FileEntry);
- if (SHOW_HEADER_INFO)
- gtk_widget_show_all(HeaderInfosTable);
+ gtk_widget_show_all(HeaderInfosTable);
+ g_settings_bind (ETSettings, "file-show-header", HeaderInfosTable,
+ "visible", G_SETTINGS_BIND_GET);
return FileFrame;
}
@@ -1418,8 +1419,10 @@ Mini_Button_Clicked (GObject *object)
path1 = g_path_get_dirname(FileNameCur->value);
if ( path && path1 && strcmp(path,path1)!=0 )
i = 0;
- if (NUMBER_TRACK_FORMATED)
- string_to_set = g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,++i);
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
+ string_to_set = g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings, "tag-number-length"),
+ ++i);
else
string_to_set = g_strdup_printf("%d",++i);
@@ -1456,8 +1459,10 @@ Mini_Button_Clicked (GObject *object)
etfile = (ET_File *)etfilelist->data;
filename_utf8 = ((File_Name *)etfile->FileNameNew->data)->value_utf8;
path_utf8 = g_path_get_dirname(filename_utf8);
- if (NUMBER_TRACK_FORMATED)
- string_to_set =
g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,ET_Get_Number_Of_Files_In_Directory(path_utf8));
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
+ string_to_set = g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings, "tag-number-length"),
+ ET_Get_Number_Of_Files_In_Directory (path_utf8));
else
string_to_set = g_strdup_printf("%d",ET_Get_Number_Of_Files_In_Directory(path_utf8));
g_free(path_utf8);
@@ -1750,7 +1755,7 @@ void Action_Select_First_File (void)
Scan_Rename_File_Generate_Preview();
Scan_Fill_Tag_Generate_Preview();
- if (SET_FOCUS_TO_FIRST_TAG_FIELD)
+ if (!g_settings_get_boolean (ETSettings, "tag-preserve-focus"))
gtk_widget_grab_focus(GTK_WIDGET(TitleEntry));
}
@@ -1784,7 +1789,7 @@ void Action_Select_Prev_File (void)
Scan_Rename_File_Generate_Preview();
Scan_Fill_Tag_Generate_Preview();
- if (SET_FOCUS_TO_FIRST_TAG_FIELD)
+ if (!g_settings_get_boolean (ETSettings, "tag-preserve-focus"))
gtk_widget_grab_focus(GTK_WIDGET(TitleEntry));
}
@@ -1818,7 +1823,7 @@ void Action_Select_Next_File (void)
Scan_Rename_File_Generate_Preview();
Scan_Fill_Tag_Generate_Preview();
- if (SET_FOCUS_TO_FIRST_TAG_FIELD)
+ if (!g_settings_get_boolean (ETSettings, "tag-preserve-focus"))
gtk_widget_grab_focus(GTK_WIDGET(TitleEntry));
}
@@ -1849,7 +1854,7 @@ void Action_Select_Last_File (void)
Scan_Rename_File_Generate_Preview();
Scan_Fill_Tag_Generate_Preview();
- if (SET_FOCUS_TO_FIRST_TAG_FIELD)
+ if (!g_settings_get_boolean (ETSettings, "tag-preserve-focus"))
gtk_widget_grab_focus(GTK_WIDGET(TitleEntry));
}
@@ -2642,7 +2647,8 @@ Save_File (ET_File *ETFile, gboolean multiple_files,
GtkWidget *msgdialog_check_button = NULL;
gint response;
- if (CONFIRM_WRITE_TAG && !SF_HideMsgbox_Write_Tag)
+ if (g_settings_get_boolean (ETSettings, "confirm-write-tags")
+ && !SF_HideMsgbox_Write_Tag)
{
// ET_Display_File_Data_To_UI(ETFile);
@@ -2717,7 +2723,8 @@ Save_File (ET_File *ETFile, gboolean multiple_files,
GtkWidget *msgdialog_check_button = NULL;
gint response;
- if (CONFIRM_RENAME_FILE && !SF_HideMsgbox_Rename_File)
+ if (g_settings_get_boolean (ETSettings, "confirm-rename-file")
+ && !SF_HideMsgbox_Rename_File)
{
gchar *msgdialog_title = NULL;
gchar *msg = NULL;
@@ -3384,7 +3391,8 @@ Delete_File (ET_File *ETFile, gboolean multiple_files)
/*
* Remove the file
*/
- if (CONFIRM_DELETE_FILE && !SF_HideMsgbox_Delete_File)
+ if (g_settings_get_boolean (ETSettings, "confirm-delete-file")
+ && !SF_HideMsgbox_Delete_File)
{
if (multiple_files)
{
@@ -3585,16 +3593,18 @@ gboolean Read_Directory (gchar *path_real)
/* Open the window to quit recursion (since 27/04/2007 : not only into recursion mode) */
Set_Busy_Cursor();
uiaction = gtk_ui_manager_get_action(UIManager, "/ToolBar/Stop");
- g_object_set(uiaction, "sensitive", BROWSE_SUBDIR, NULL);
- //if (BROWSE_SUBDIR)
- Open_Quit_Recursion_Function_Window();
+ g_settings_bind (ETSettings, "browse-subdir", uiaction, "sensitive",
+ G_SETTINGS_BIND_GET);
+ Open_Quit_Recursion_Function_Window();
/* Read the directory recursively */
msg = g_strdup_printf(_("Search in progress…"));
Statusbar_Message(msg,FALSE);
g_free(msg);
- // Search the supported files
- FileList = Read_Directory_Recursively(FileList,path_real,BROWSE_SUBDIR);
+ /* Search the supported files. */
+ FileList = Read_Directory_Recursively (FileList, path_real,
+ g_settings_get_boolean (ETSettings,
+ "browse-subdir"));
nbrfile = g_list_length(FileList);
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ProgressBar), 0.0);
@@ -3656,7 +3666,7 @@ gboolean Read_Directory (gchar *path_real)
//}
/* Prepare message for the status bar */
- if (BROWSE_SUBDIR)
+ if (g_settings_get_boolean (ETSettings, "browse-subdir"))
msg = g_strdup_printf(_("Found %d file(s) in this directory and
subdirectories."),ETCore->ETFileDisplayedList_Length);
else
msg = g_strdup_printf(_("Found %d file(s) in this
directory."),ETCore->ETFileDisplayedList_Length);
@@ -3677,7 +3687,7 @@ gboolean Read_Directory (gchar *path_real)
Browser_Label_Set_Text(_("No files")); /* See in ET_Display_Filename_To_UI */
/* Prepare message for the status bar */
- if (BROWSE_SUBDIR)
+ if (g_settings_get_boolean (ETSettings, "browse-subdir"))
msg = g_strdup(_("No file found in this directory and subdirectories"));
else
msg = g_strdup(_("No file found in this directory"));
@@ -3722,9 +3732,12 @@ Read_Directory_Recursively (GList *file_list, const gchar *path_real,
return file_list;
}
- // We don't read the directories '.' and '..', but may read hidden directories like '.mydir'
- if ( (g_ascii_strcasecmp (dirent->d_name,"..") != 0)
- && ((g_ascii_strncasecmp(dirent->d_name,".", 1) != 0) || (BROWSE_HIDDEN_DIR &&
strlen(dirent->d_name) > 1)) )
+ /* We do not read the directories '.' and '..', but may read hidden
+ * directories like '.mydir'. */
+ if ((g_ascii_strcasecmp (dirent->d_name, "..") != 0)
+ && ((g_ascii_strncasecmp (dirent->d_name, ".", 1) != 0)
+ || (g_settings_get_boolean (ETSettings, "browse-show-hidden")
+ && strlen (dirent->d_name) > 1)))
{
if (path_real[strlen(path_real)-1]!=G_DIR_SEPARATOR)
filename = g_strconcat(path_real,G_DIR_SEPARATOR_S,dirent->d_name,NULL);
@@ -4193,7 +4206,7 @@ void Tag_Area_Display_Controls (ET_File *ETFile)
switch (ETFile->ETFileDescription->TagType)
{
case ID3_TAG:
- if (!FILE_WRITING_ID3V2_WRITE_TAG)
+ if (!g_settings_get_boolean (ETSettings, "id3v2-enabled"))
{
// ID3v1 : Hide specifics ID3v2 fields if not activated!
gtk_widget_hide(GTK_WIDGET(DiscNumberLabel));
@@ -4458,7 +4471,7 @@ Init_Load_Default_Dir (void)
ET_Core_Initialize();
// Open the scanner window
- if (OPEN_SCANNER_WINDOW_ON_STARTUP)
+ if (g_settings_get_boolean (ETSettings, "scan-startup"))
Open_ScannerWindow(SCANNER_TYPE); // Open the last selected scanner
if (INIT_DIRECTORY)
@@ -4914,7 +4927,8 @@ void Quit_MainWindow (void)
Save_Path_Entry_List(BrowserEntryModel, MISC_COMBO_TEXT);
/* Check if all files have been saved before exit */
- if (CONFIRM_WHEN_UNSAVED_FILES && ET_Check_If_All_Files_Are_Saved() != TRUE)
+ if (g_settings_get_boolean (ETSettings, "confirm-when-unsaved-files")
+ && ET_Check_If_All_Files_Are_Saved() != TRUE)
{
/* Some files haven't been saved */
msgbox = gtk_message_dialog_new(GTK_WINDOW(MainWindow),
@@ -4941,7 +4955,7 @@ void Quit_MainWindow (void)
return;
}
- } else if (CONFIRM_BEFORE_EXIT)
+ } else if (g_settings_get_boolean (ETSettings, "confirm-quit"))
{
msgbox = gtk_message_dialog_new(GTK_WINDOW(MainWindow),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
diff --git a/src/et_core.c b/src/et_core.c
index 0d8f1a6..e0269d3 100644
--- a/src/et_core.c
+++ b/src/et_core.c
@@ -3365,8 +3365,12 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
if ( g_utf8_strlen(buffer, -1) > 0 )
{
- if (NUMBER_TRACK_FORMATED) {
- FileTag->track = g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,atoi(buffer));
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
+ {
+ FileTag->track = g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings,
+ "tag-number-length"),
+ atoi (buffer));
g_free(buffer);
} else
FileTag->track = buffer;
@@ -3382,9 +3386,11 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
if ( g_utf8_strlen(buffer, -1) > 0 )
{
- if (NUMBER_TRACK_FORMATED)
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
{
- FileTag->track_total = g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,atoi(buffer));
+ FileTag->track_total = g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings, "tag-number-length"),
+ atoi (buffer));
g_free(buffer);
} else
FileTag->track_total = buffer;
@@ -3596,8 +3602,11 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
{
gchar *tmp_str;
- if (NUMBER_TRACK_FORMATED)
- FileTag->track =
g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,atoi(FileTagCur->track));
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
+ FileTag->track = g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings,
+ "tag-number-length"),
+ atoi (FileTagCur->track));
else
FileTag->track = g_strdup(FileTagCur->track);
// This field must contain only digits
@@ -3614,8 +3623,10 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
/* Track Total */
if ( FileTagCur->track_total && g_utf8_strlen(FileTagCur->track_total, -1)>0 )
{
- if (NUMBER_TRACK_FORMATED)
- FileTag->track_total =
g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,atoi(FileTagCur->track_total));
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
+ FileTag->track_total = g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings, "tag-number-length"),
+ atoi (FileTagCur->track_total));
else
FileTag->track_total = g_strdup(FileTagCur->track_total);
Strip_String(FileTag->track_total);
@@ -3789,7 +3800,8 @@ gboolean ET_Save_File_Tag_To_HD (ET_File *ETFile)
chmod(cur_filename,statbuf.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO));
chown(cur_filename,statbuf.st_uid,statbuf.st_gid);
#endif /* !G_OS_WIN32 */
- if (PRESERVE_MODIFICATION_TIME)
+ if (g_settings_get_boolean (ETSettings,
+ "file-preserve-modification-time"))
{
utimbufbuf.actime = statbuf.st_atime; // Last access time
utimbufbuf.modtime = statbuf.st_mtime; // Last modification time
@@ -3805,10 +3817,13 @@ gboolean ET_Save_File_Tag_To_HD (ET_File *ETFile)
if (state==TRUE)
{
- // Update date and time of the parent directory of the file after changing the tag
- // value (ex: needed for Amarok for refreshing). Note that when renaming a file the
- // parent directory is automatically updated.
- if (UPDATE_PARENT_DIRECTORY_MODIFICATION_TIME)
+ /* Update date and time of the parent directory of the file after
+ * changing the tag value (ex: needed for Amarok for refreshing). Note
+ * that when renaming a file the parent directory is automatically
+ * updated.
+ */
+ if (g_settings_get_boolean (ETSettings,
+ "file-update-parent-modification-time"))
{
gchar *path = g_path_get_dirname(cur_filename);
utime(g_path_get_dirname(cur_filename),NULL);
@@ -4656,8 +4671,9 @@ gboolean ET_File_Name_Convert_Character (gchar *filename_utf8)
*character = '-';
#endif /* G_OS_WIN32 */
- // Convert other illegal characters on FAT32/16 filesystems and ISO9660 and Joliet (CD-ROM filesystems)
- if (REPLACE_ILLEGAL_CHARACTERS_IN_FILENAME)
+ /* Convert other illegal characters on FAT32/16 filesystems and ISO9660 and
+ * Joliet (CD-ROM filesystems). */
+ if (g_settings_get_boolean (ETSettings, "rename-replace-illegal-chars"))
{
// Commented as we display unicode values as "\351" for "é"
//while ( (character=g_utf8_strchr(filename_utf8, -1, '\\'))!=NULL )
diff --git a/src/flac_tag.c b/src/flac_tag.c
index 0792cd4..6ce6d0f 100644
--- a/src/flac_tag.c
+++ b/src/flac_tag.c
@@ -340,9 +340,10 @@ gboolean Flac_Tag_Read_File_Tag (gchar *filename, File_Tag *FileTag)
field_value_tmp = g_strndup(field_value, field_len);
field_value = Try_To_Validate_Utf8_String(field_value_tmp);
g_free(field_value_tmp);
- if (NUMBER_TRACK_FORMATED)
+ if (g_settings_get_boolean (ETSettings,
+ "tag-number-padded"))
{
- FileTag->track_total =
g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,atoi(field_value));
+ FileTag->track_total = g_strdup_printf("%.*d", g_settings_get_uint
(ETSettings, "tag-number-length"), atoi (field_value));
}else
{
FileTag->track_total = g_strdup(field_value);
@@ -369,15 +370,16 @@ gboolean Flac_Tag_Read_File_Tag (gchar *filename, File_Tag *FileTag)
field_value = Try_To_Validate_Utf8_String(field_value_tmp);
g_free(field_value_tmp);
string = g_utf8_strchr(field_value, -1, '/');
- if (NUMBER_TRACK_FORMATED)
+ if (g_settings_get_boolean (ETSettings,
+ "tag-number-padded"))
{
// If track_total not filled before, try now...
if (string && !FileTag->track_total)
{
- FileTag->track_total =
g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,atoi(string+1));
+ FileTag->track_total = g_strdup_printf ("%.*d", g_settings_get_uint
(ETSettings, "tag-number-length"), atoi (string+1));
*string = '\0';
}
- FileTag->track =
g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,atoi(field_value));
+ FileTag->track = g_strdup_printf ("%.*d", g_settings_get_uint (ETSettings,
"tag-number-length"), atoi (field_value));
}else
{
if (string && !FileTag->track_total)
@@ -933,22 +935,26 @@ gboolean Flac_Tag_Write_File_Tag (ET_File *ETFile)
/*********
* Title *
*********/
- Flac_Set_Tag(vc_block,"TITLE=",FileTag->title, VORBIS_SPLIT_FIELD_TITLE);
+ Flac_Set_Tag (vc_block, "TITLE=", FileTag->title,
+ g_settings_get_boolean (ETSettings, "ogg-split-title"));
/**********
* Artist *
**********/
- Flac_Set_Tag(vc_block,"ARTIST=",FileTag->artist,VORBIS_SPLIT_FIELD_ARTIST);
+ Flac_Set_Tag (vc_block, "ARTIST=", FileTag->artist,
+ g_settings_get_boolean (ETSettings, "ogg-split-artist"));
/****************
* Album Artist *
****************/
- Flac_Set_Tag(vc_block,"ALBUMARTIST=",FileTag->album_artist,VORBIS_SPLIT_FIELD_ARTIST);
+ Flac_Set_Tag (vc_block, "ALBUMARTIST=", FileTag->album_artist,
+ g_settings_get_boolean (ETSettings, "ogg-split-artist"));
/*********
* Album *
*********/
- Flac_Set_Tag(vc_block,"ALBUM=",FileTag->album,VORBIS_SPLIT_FIELD_ALBUM);
+ Flac_Set_Tag (vc_block, "ALBUM=", FileTag->album,
+ g_settings_get_boolean (ETSettings, "ogg-split-album"));
/***************
* Disc Number *
@@ -969,22 +975,29 @@ gboolean Flac_Tag_Write_File_Tag (ET_File *ETFile)
/*********
* Genre *
*********/
- Flac_Set_Tag(vc_block,"GENRE=",FileTag->genre,VORBIS_SPLIT_FIELD_GENRE);
+ Flac_Set_Tag (vc_block, "GENRE=", FileTag->genre,
+ g_settings_get_boolean (ETSettings, "ogg-split-genre"));
/***********
* Comment *
***********/
- Flac_Set_Tag(vc_block,"DESCRIPTION=",FileTag->comment,VORBIS_SPLIT_FIELD_COMMENT);
+ Flac_Set_Tag (vc_block, "DESCRIPTION=", FileTag->comment,
+ g_settings_get_boolean (ETSettings,
+ "ogg-split-comment"));
/************
* Composer *
************/
- Flac_Set_Tag(vc_block,"COMPOSER=",FileTag->composer,VORBIS_SPLIT_FIELD_COMPOSER);
+ Flac_Set_Tag (vc_block, "COMPOSER=", FileTag->composer,
+ g_settings_get_boolean (ETSettings,
+ "ogg-split-composer"));
/*******************
* Original artist *
*******************/
- Flac_Set_Tag(vc_block,"PERFORMER=",FileTag->orig_artist,VORBIS_SPLIT_FIELD_ORIG_ARTIST);
+ Flac_Set_Tag (vc_block, "PERFORMER=", FileTag->orig_artist,
+ g_settings_get_boolean (ETSettings,
+ "ogg-split-original-artist"));
/*************
* Copyright *
@@ -1085,8 +1098,10 @@ gboolean Flac_Tag_Write_File_Tag (ET_File *ETFile)
// Move all PADDING blocks to the end on the metadata, and merge them into a single block.
FLAC__metadata_chain_sort_padding(chain);
- // Write tag
- if ( !FLAC__metadata_chain_write(chain, /*padding*/TRUE, PRESERVE_MODIFICATION_TIME) )
+ /* Write tag. */
+ if (!FLAC__metadata_chain_write(chain, /*padding*/TRUE,
+ g_settings_get_boolean (ETSettings,
+ "file-preserve-modification-time")))
{
// Error with "FLAC__metadata_chain_write"
FLAC__Metadata_ChainStatus status = FLAC__metadata_chain_status(chain);
@@ -1110,7 +1125,7 @@ gboolean Flac_Tag_Write_File_Tag (ET_File *ETFile)
/*
* Write also the ID3 tags (ID3v1 and/or ID3v2) if wanted (as needed by some players)
*/
- if (WRITE_ID3_TAGS_IN_FLAC_FILE)
+ if (g_settings_get_boolean (ETSettings, "flac-write-id3"))
{
Id3tag_Write_File_Tag(ETFile);
}else
diff --git a/src/id3_tag.c b/src/id3_tag.c
index a88d1ca..59e340d 100644
--- a/src/id3_tag.c
+++ b/src/id3_tag.c
@@ -131,7 +131,7 @@ Id3tag_Write_File_v23Tag (ET_File *ETFile)
// When writing the first MP3 file, we check if the version of id3lib of the
// system doesn't contain a bug when writting Unicode tags
if (flag_first_check
- && (FILE_WRITING_ID3V2_USE_UNICODE_CHARACTER_SET) )
+ && g_settings_get_boolean (ETSettings, "id3v2-enable-unicode"))
{
flag_first_check = FALSE;
flag_id3lib_bugged = Id3tag_Check_If_Id3lib_Is_Bugged();
@@ -293,8 +293,10 @@ Id3tag_Write_File_v23Tag (ET_File *ETFile)
ID3Tag_AttachFrame(id3_tag,id3_frame);
genre_value = Id3tag_String_To_Genre(FileTag->genre);
- // If genre not defined don't write genre value between brackets! (priority problem noted with some
tools)
- if ((genre_value == ID3_INVALID_GENRE)||(FILE_WRITING_ID3V2_TEXT_ONLY_GENRE))
+ /* If genre not defined do not write genre value between brackets!
+ * (priority problem noted with some tools). */
+ if ((genre_value == ID3_INVALID_GENRE)
+ || g_settings_get_boolean (ETSettings, "id3v2-text-only-genre"))
genre_string_tmp = g_strdup_printf("%s",FileTag->genre);
else
genre_string_tmp = g_strdup_printf("(%d)",genre_value);
@@ -489,10 +491,11 @@ Id3tag_Write_File_v23Tag (ET_File *ETFile)
* equal to 0, id3lib-3.7.12 doesn't update the tag */
number_of_frames = ID3Tag_NumFrames(id3_tag);
- /* If all fields (managed in the UI) are empty and option STRIP_TAG_WHEN_EMPTY_FIELDS
- * is set to 1, we strip the ID3v1.x and ID3v2 tags. Else, write ID3v2 and/or ID3v1
+ /* If all fields (managed in the UI) are empty and option id3-strip-empty
+ * is set to 1, we strip the ID3v1.x and ID3v2 tags. Else, write ID3v2
+ * and/or ID3v1.
*/
- if ( STRIP_TAG_WHEN_EMPTY_FIELDS
+ if (g_settings_get_boolean (ETSettings, "id3-strip-empty")
&& !has_title && !has_artist && !has_album_artist && !has_album && !has_year &&
!has_track
&& !has_genre && !has_composer && !has_orig_artist && !has_copyright && !has_url
&& !has_encoded_by && !has_picture && !has_comment && !has_disc_number)//&& !has_song_len )
@@ -522,7 +525,8 @@ Id3tag_Write_File_v23Tag (ET_File *ETFile)
/*
* ID3v2 tag
*/
- if (FILE_WRITING_ID3V2_WRITE_TAG && number_of_frames!=0)
+ if (g_settings_get_boolean (ETSettings, "id3v2-enabled")
+ && number_of_frames != 0)
{
error_update_id3v2 = ID3Tag_UpdateByTagType(id3_tag,ID3TT_ID3V2);
if (error_update_id3v2 != ID3E_NoError)
@@ -540,7 +544,8 @@ Id3tag_Write_File_v23Tag (ET_File *ETFile)
* by Id3tag_Check_If_Id3lib_Is_Bugged) we didn't make the following
* test => OK */
if (flag_id3lib_bugged
- && ( FILE_WRITING_ID3V2_USE_UNICODE_CHARACTER_SET ))
+ && (g_settings_get_boolean (ETSettings,
+ "id3v2-enable-unicode")))
{
File_Tag *FileTag_tmp = ET_File_Tag_Item_New();
if (Id3tag_Read_File_Tag(filename,FileTag_tmp) == TRUE
@@ -588,7 +593,8 @@ Id3tag_Write_File_v23Tag (ET_File *ETFile)
* Must be set after ID3v2 or ID3Tag_UpdateByTagType cause damage to unicode strings
*/
// id3lib writes incorrectly the ID3v2 tag if unicode used when writing ID3v1 tag
- if (FILE_WRITING_ID3V1_WRITE_TAG && number_of_frames!=0)
+ if (g_settings_get_boolean (ETSettings, "id3v1-enabled")
+ && number_of_frames != 0)
{
// By default id3lib converts id3tag to ISO-8859-1 (single byte character set)
// Note : converting UTF-16 string (two bytes character set) to ISO-8859-1
@@ -835,7 +841,9 @@ gchar *Id3tag_Get_Field (const ID3Frame *id3_frame, ID3_FieldID id3_fieldid)
if (enc != ID3TE_UTF16 && enc != ID3TE_UTF8) // Encoding is ISO-8859-1?
{
- if (USE_NON_STANDARD_ID3_READING_CHARACTER_SET) // Override with another character set?
+ /* Override with another character set? */
+ if (g_settings_get_boolean (ETSettings,
+ "id3-override-read-encoding"))
{
// Encoding set by user to ???.
if ( strcmp(FILE_READING_ID3V1V2_CHARACTER_SET,"ISO-8859-1") == 0 )
@@ -965,7 +973,7 @@ ID3_TextEnc Id3tag_Set_Field (const ID3Frame *id3_frame, ID3_FieldID id3_fieldid
* We prioritize the rule selected in options. If the encoding of the
* field is ISO-8859-1, we can write it to another single byte encoding.
*/
- if (FILE_WRITING_ID3V2_USE_UNICODE_CHARACTER_SET)
+ if (g_settings_get_boolean (ETSettings, "id3v2-enable-unicode"))
{
// Check if we can write the tag using ISO-8859-1 instead of UTF-16...
if ( (string_converted = g_convert(string, strlen(string), "ISO-8859-1",
@@ -1317,9 +1325,11 @@ gboolean Id3tag_Check_If_Id3lib_Is_Bugged (void)
g_output_stream_close (G_OUTPUT_STREAM (ostream), NULL, NULL);
g_object_unref (ostream);
- // Save state of switches as we must force to Unicode before writting
- use_unicode = FILE_WRITING_ID3V2_USE_UNICODE_CHARACTER_SET;
- FILE_WRITING_ID3V2_USE_UNICODE_CHARACTER_SET = TRUE;
+ /* Save state of switches as we must force to Unicode before writing.
+ * FIXME! */
+ g_settings_delay (ETSettings);
+ use_unicode = g_settings_get_boolean (ETSettings, "id3v2-enable-unicode");
+ g_settings_set_boolean (ETSettings, "id3v2-enable-unicode", TRUE);
id3_tag = ID3Tag_New();
path = g_file_get_path (file);
@@ -1337,8 +1347,8 @@ gboolean Id3tag_Check_If_Id3lib_Is_Bugged (void)
ID3Tag_UpdateByTagType(id3_tag,ID3TT_ID3V2);
ID3Tag_Delete(id3_tag);
- FILE_WRITING_ID3V2_USE_UNICODE_CHARACTER_SET = use_unicode;
-
+ g_settings_set_boolean (ETSettings, "id3v2-enable-unicode", use_unicode);
+ g_settings_revert (ETSettings);
id3_tag = ID3Tag_New();
ID3Tag_Link_1 (id3_tag, path);
diff --git a/src/id3v24_tag.c b/src/id3v24_tag.c
index 029e869..e59a0a3 100644
--- a/src/id3v24_tag.c
+++ b/src/id3v24_tag.c
@@ -136,19 +136,19 @@ gboolean Id3tag_Read_File_Tag (gchar *filename, File_Tag *FileTag)
if ((tagsize = id3_tag_query((id3_byte_t const *)string1, ID3_TAG_QUERYSIZE)) <= ID3_TAG_QUERYSIZE)
{
- // ID3v2 tag not found!
- update = FILE_WRITING_ID3V2_WRITE_TAG;
+ /* ID3v2 tag not found! */
+ update = g_settings_get_boolean (ETSettings, "id3v2-enabled");
}else
{
/* ID3v2 tag found */
- if (FILE_WRITING_ID3V2_WRITE_TAG == 0)
+ if (g_settings_get_boolean (ETSettings, "id3v2-enabled") == 0)
{
// To delete the tag
update = 1;
}else
{
/* Determine version if user want to upgrade old tags */
- if (CONVERT_OLD_ID3V2_TAG_VERSION
+ if (g_settings_get_boolean (ETSettings, "id3v2-convert-old")
&& (string1 = g_realloc (string1, tagsize))
&& (read(tmpfile, &string1[ID3_TAG_QUERYSIZE], tagsize - ID3_TAG_QUERYSIZE) == tagsize -
ID3_TAG_QUERYSIZE)
&& (tag = id3_tag_parse((id3_byte_t const *)string1, tagsize))
@@ -182,13 +182,13 @@ gboolean Id3tag_Read_File_Tag (gchar *filename, File_Tag *FileTag)
&& (string1[2] == 'G')
)
{
- // ID3v1 tag found!
- if (!FILE_WRITING_ID3V1_WRITE_TAG)
+ /* ID3v1 tag found! */
+ if (!g_settings_get_boolean (ETSettings, "id3v1-enabled"))
update = 1;
}else
{
- // ID3v1 tag not found!
- if (FILE_WRITING_ID3V1_WRITE_TAG)
+ /* ID3v1 tag not found! */
+ if (g_settings_get_boolean (ETSettings, "id3v1-enabled"))
update = 1;
}
@@ -261,14 +261,18 @@ gboolean Id3tag_Read_File_Tag (gchar *filename, File_Tag *FileTag)
{
string2 = g_utf8_strchr(string1,-1,'/');
- if (NUMBER_TRACK_FORMATED)
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
{
if (string2)
{
- FileTag->track_total =
g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,atoi(string2+1)); // Just to have numbers like this
: '01', '05', '12', ...
- *string2 = '\0'; // To cut string1
+ /* Just to have numbers like this : '01', '05', '12', ...*/
+ FileTag->track_total = g_strdup_printf ("%.*d", g_settings_get_uint (ETSettings,
"tag-number-length"), atoi (string2+1));
+ *string2 = '\0'; /* To cut string1. */
}
- FileTag->track = g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,atoi(string1)); //
Just to have numbers like this : '01', '05', '12', ...
+ /* Just to have numbers like this : '01', '05', '12', ... */
+ FileTag->track = g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings, "tag-number-length"),
+ atoi (string1));
}else
{
if (string2)
@@ -539,10 +543,10 @@ etag_guess_byteorder(const id3_ucs4_t *ustr, gchar **ret) /* XXX */
return 0;
}
- if (USE_NON_STANDARD_ID3_READING_CHARACTER_SET)
+ if (g_settings_get_boolean (ETSettings, "id3-override-read-encoding"))
charset = FILE_READING_ID3V1V2_CHARACTER_SET;
- else if (!FILE_WRITING_ID3V2_USE_UNICODE_CHARACTER_SET) /* XXX */
- charset = FILE_WRITING_ID3V2_NO_UNICODE_CHARACTER_SET;
+ else if (!g_settings_get_boolean (ETSettings, "id3v2-enable-unicode"))
+ charset = FILE_WRITING_ID3V2_NO_UNICODE_CHARACTER_SET; /* XXX */
else g_get_charset(&charset);
if (!charset)
@@ -630,7 +634,8 @@ etag_ucs42gchar(const id3_ucs4_t *usrc, unsigned is_latin,
retval = 0, retstr = NULL;
- if (is_latin && USE_NON_STANDARD_ID3_READING_CHARACTER_SET)
+ if (is_latin && g_settings_get_boolean (ETSettings,
+ "id3-override-read-encoding"))
{
if ((latinstr = (gchar *)id3_ucs4_latin1duplicate(usrc)))
{
@@ -698,7 +703,8 @@ libid3tag_Get_Frame_Str(const struct id3_frame *frame, unsigned etag_field_type,
if (!(etag_field_type & EASYTAG_ID3_FIELD_LATIN1FULL))
continue;
latinstr = g_strdup(field_type == ID3_FIELD_TYPE_LATIN1 ? (gchar
*)id3_field_getlatin1(field) : (gchar *)id3_field_getfulllatin1(field));
- if (USE_NON_STANDARD_ID3_READING_CHARACTER_SET)
+ if (g_settings_get_boolean (ETSettings,
+ "id3-override-read-encoding"))
{
tmpstr = convert_string(latinstr, FILE_READING_ID3V1V2_CHARACTER_SET, "UTF-8", FALSE);
g_free (latinstr);
@@ -790,8 +796,8 @@ gboolean Id3tag_Write_File_v24Tag (ET_File *ETFile)
v1tag = v2tag = NULL;
- // Write ID3v2 tag
- if (FILE_WRITING_ID3V2_WRITE_TAG)
+ /* Write ID3v2 tag. */
+ if (g_settings_get_boolean (ETSettings, "id3v2-enabled"))
{
struct id3_file *file;
struct id3_tag *tmptag;
@@ -850,14 +856,14 @@ gboolean Id3tag_Write_File_v24Tag (ET_File *ETFile)
//ID3_TAG_OPTION_UNSYNCHRONISATION); // Taglib doesn't support frames with
unsynchronisation (patch from Alexey Illarionov) http://bugs.kde.org/show_bug.cgi?id=138829
0);
- if (FILE_WRITING_ID3V2_USE_CRC32)
+ if (g_settings_get_boolean (ETSettings, "id3v2-crc32"))
id3_tag_options(v2tag, ID3_TAG_OPTION_CRC, ~0);
- if (FILE_WRITING_ID3V2_USE_COMPRESSION)
+ if (g_settings_get_boolean (ETSettings, "id3v2-compression"))
id3_tag_options(v2tag, ID3_TAG_OPTION_COMPRESSION, ~0);
}
- // Write ID3v1 tag
- if (FILE_WRITING_ID3V1_WRITE_TAG)
+ /* Write ID3v1 tag. */
+ if (g_settings_get_boolean (ETSettings, "id3v1-enabled"))
{
v1tag = id3_tag_new();
if (!v1tag)
@@ -921,7 +927,8 @@ gboolean Id3tag_Write_File_v24Tag (ET_File *ETFile)
if (FileTag->genre)
genre_value = Id3tag_String_To_Genre(FileTag->genre);
- if ((genre_value == ID3_INVALID_GENRE)||(FILE_WRITING_ID3V2_TEXT_ONLY_GENRE))
+ if ((genre_value == ID3_INVALID_GENRE)
+ || g_settings_get_boolean (ETSettings, "id3v2-text-only-genre"))
string1 = g_strdup(FileTag->genre);
else
string1 = g_strdup_printf("(%d)",genre_value);
@@ -1136,7 +1143,7 @@ id3taglib_set_field(struct id3_frame *frame,
if (str)
{
/* Prepare str for writing according to easytag charset coversion settings */
- if ((FILE_WRITING_ID3V2_USE_UNICODE_CHARACTER_SET == 0)
+ if ((!g_settings_get_boolean (ETSettings, "id3v2-enable-unicode"))
|| (type == ID3_FIELD_TYPE_LATIN1)
|| (type == ID3_FIELD_TYPE_LATIN1FULL)
|| id3v1)
diff --git a/src/log.c b/src/log.c
index 908691e..258fb0b 100644
--- a/src/log.c
+++ b/src/log.c
@@ -162,11 +162,10 @@ GtkWidget *Create_Log_Area (void)
// Load pending messages in the Log list
Log_Print_Tmp_List();
- if (SHOW_LOG_VIEW)
- //gtk_widget_show_all(ScrollWindowLogList);
- gtk_widget_show_all(Frame);
+ gtk_widget_show_all(Frame);
+ g_settings_bind (ETSettings, "log-show", Frame, "visible",
+ G_SETTINGS_BIND_GET);
- //return ScrollWindowLogList;
return Frame;
}
@@ -268,8 +267,9 @@ void Log_Print (Log_Error_Type error_type, gchar const *format, ...)
gchar *time = Log_Format_Date();
// Remove lines that exceed the limit
- if (LogListNbrRows > LOG_MAX_LINES - 1
- && gtk_tree_model_get_iter_first(GTK_TREE_MODEL(logListModel), &iter))
+ if (LogListNbrRows > g_settings_get_uint (ETSettings, "log-lines")
+ - 1 && gtk_tree_model_get_iter_first (GTK_TREE_MODEL (logListModel),
+ &iter))
{
gtk_list_store_remove(GTK_LIST_STORE(logListModel), &iter);
}
diff --git a/src/misc.c b/src/misc.c
index 62c5b61..02ee7ec 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -472,7 +472,10 @@ gboolean Parse_Date (void)
struct tm t0;
/* Early return. */
- if (!DATE_AUTO_COMPLETION) return FALSE;
+ if (!g_settings_get_boolean (ETSettings, "tag-date-autocomplete"))
+ {
+ return FALSE;
+ }
/* Get the info entered by user */
year = gtk_entry_get_text(GTK_ENTRY(YearEntry));
@@ -552,9 +555,12 @@ void Load_Track_List_To_UI (void)
for (i=1; i<=len; i++)
{
- if (NUMBER_TRACK_FORMATED)
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
{
- text = g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,i);
+ text = g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings,
+ "tag-number-length"),
+ i);
} else
{
text = g_strdup_printf("%.2d",i);
@@ -1280,8 +1286,8 @@ void Open_Write_Playlist_Window (void)
Add_String_To_Combo_List(PlayListNameMaskModel, PLAYLIST_NAME);
gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(PlayListNameMaskCombo))), PLAYLIST_NAME);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(playlist_use_mask_name),PLAYLIST_USE_MASK_NAME);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(playlist_use_dir_name),PLAYLIST_USE_DIR_NAME);
+ g_settings_bind (ETSettings, "playlist-use-mask", playlist_use_mask_name,
+ "active", G_SETTINGS_BIND_DEFAULT);
// Mask status icon
MaskStatusIconBox = Create_Pixmap_Icon_With_Event_Box("easytag-forbidden");
@@ -1313,7 +1319,9 @@ void Open_Write_Playlist_Window (void)
playlist_only_selected_files = gtk_check_button_new_with_label(_("Include only the selected files"));
gtk_box_pack_start(GTK_BOX(vbox),playlist_only_selected_files,FALSE,FALSE,0);
-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(playlist_only_selected_files),PLAYLIST_ONLY_SELECTED_FILES);
+ g_settings_bind (ETSettings, "playlist-selected-only",
+ playlist_only_selected_files, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(playlist_only_selected_files,_("If activated, only the selected files will
be "
"written in the playlist file. Else, all the files will be written."));
@@ -1325,9 +1333,9 @@ void Open_Write_Playlist_Window (void)
gtk_box_pack_start(GTK_BOX(vbox),playlist_full_path,FALSE,FALSE,0);
playlist_relative_path =
gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(playlist_full_path),
_("Use relative path for files in playlist"));
+ g_settings_bind (ETSettings, "playlist-relative", playlist_relative_path,
+ "active", G_SETTINGS_BIND_DEFAULT);
gtk_box_pack_start(GTK_BOX(vbox),playlist_relative_path,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(playlist_full_path),PLAYLIST_FULL_PATH);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(playlist_relative_path),PLAYLIST_RELATIVE_PATH);
// Separator line
Separator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
@@ -1336,7 +1344,9 @@ void Open_Write_Playlist_Window (void)
// Create playlist in parent directory
playlist_create_in_parent_dir = gtk_check_button_new_with_label(_("Create playlist in the parent
directory"));
gtk_box_pack_start(GTK_BOX(vbox),playlist_create_in_parent_dir,FALSE,FALSE,0);
-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(playlist_create_in_parent_dir),PLAYLIST_CREATE_IN_PARENT_DIR);
+ g_settings_bind (ETSettings, "playlist-parent-directory",
+ playlist_create_in_parent_dir, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(playlist_create_in_parent_dir,_("If activated, the playlist will be created "
"in the parent directory."));
@@ -1346,7 +1356,9 @@ void Open_Write_Playlist_Window (void)
/* This makes no sense under Win32, so we do not display it. */
gtk_box_pack_start(GTK_BOX(vbox),playlist_use_dos_separator,FALSE,FALSE,0);
#endif /* !G_OS_WIN32 */
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(playlist_use_dos_separator),PLAYLIST_USE_DOS_SEPARATOR);
+ g_settings_bind (ETSettings, "playlist-dos-separator",
+ playlist_use_dos_separator, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(playlist_use_dos_separator,_("This option replaces the UNIX directory "
"separator '/' into DOS separator '\\'."));
@@ -1477,14 +1489,6 @@ void Write_Playlist_Window_Apply_Changes (void)
/* List of variables also set in the function 'Playlist_Write_Button_Pressed' */
if (PLAYLIST_NAME) g_free(PLAYLIST_NAME);
PLAYLIST_NAME =
g_strdup(gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(PlayListNameMaskCombo)))));
- PLAYLIST_USE_MASK_NAME =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_use_mask_name));
- PLAYLIST_USE_DIR_NAME =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_use_dir_name));
-
- PLAYLIST_ONLY_SELECTED_FILES =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_only_selected_files));
- PLAYLIST_FULL_PATH = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_full_path));
- PLAYLIST_RELATIVE_PATH =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_relative_path));
- PLAYLIST_CREATE_IN_PARENT_DIR =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_create_in_parent_dir));
- PLAYLIST_USE_DOS_SEPARATOR =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_use_dos_separator));
PLAYLIST_CONTENT_NONE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_content_none));
PLAYLIST_CONTENT_FILENAME =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_content_filename));
@@ -1537,14 +1541,6 @@ Playlist_Write_Button_Pressed (void)
/* List of variables also set in the function 'Write_Playlist_Window_Apply_Changes' */
/***if (PLAYLIST_NAME) g_free(PLAYLIST_NAME);
PLAYLIST_NAME =
g_strdup(gtk_entry_get_text(GTK_ENTRY(GTK_BIN(PlayListNameMaskCombo)->child)));
- PLAYLIST_USE_MASK_NAME = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_use_mask_name));
- PLAYLIST_USE_DIR_NAME = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_use_dir_name));
-
- PLAYLIST_ONLY_SELECTED_FILES =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_only_selected_files));
- PLAYLIST_FULL_PATH = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_full_path));
- PLAYLIST_RELATIVE_PATH = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_relative_path));
- PLAYLIST_CREATE_IN_PARENT_DIR =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_create_in_parent_dir));
- PLAYLIST_USE_DOS_SEPARATOR =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_use_dos_separator));
PLAYLIST_CONTENT_NONE = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_content_none));
PLAYLIST_CONTENT_FILENAME =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(playlist_content_filename));
@@ -1553,11 +1549,12 @@ Playlist_Write_Button_Pressed (void)
PLAYLIST_CONTENT_MASK_VALUE =
g_strdup(gtk_entry_get_text(GTK_ENTRY(GTK_BIN(PlayListContentMaskCombo)->child)));***/
Write_Playlist_Window_Apply_Changes();
- // Path of the playlist file (may be truncated later if PLAYLIST_CREATE_IN_PARENT_DIR is TRUE)
+ /* Path of the playlist file (may be truncated later if
+ * ETSettings:playlist-parent-directory is TRUE). */
playlist_path_utf8 = filename_to_display(Browser_Get_Current_Path());
// Build the playlist file name
- if (PLAYLIST_USE_MASK_NAME)
+ if (g_settings_get_boolean (ETSettings, "playlist-use-mask"))
{
if (!ETCore->ETFileList)
@@ -1607,7 +1604,7 @@ Playlist_Write_Button_Pressed (void)
}
// Must be placed after "Build the playlist file name", as we can truncate the path!
- if (PLAYLIST_CREATE_IN_PARENT_DIR)
+ if (g_settings_get_boolean (ETSettings, "playlist-parent-directory"))
{
if ( (strcmp(playlist_path_utf8,G_DIR_SEPARATOR_S) != 0) )
{
@@ -1633,8 +1630,8 @@ Playlist_Write_Button_Pressed (void)
playlist_name = filename_from_display(playlist_name_utf8);
playlist_basename_utf8 = g_path_get_basename(playlist_name_utf8);
- // Check if file exists
- if (CONFIRM_WRITE_PLAYLIST)
+ /* Check if file exists. */
+ if (g_settings_get_boolean (ETSettings, "confirm-write-playlist"))
{
if ( (file=fopen(playlist_name,"r")) != NULL )
{
@@ -1788,7 +1785,7 @@ Write_Playlist (const gchar *playlist_name)
fprintf(file,"#EXTM3U\r\n");
}
- if (PLAYLIST_ONLY_SELECTED_FILES)
+ if (g_settings_get_boolean (ETSettings, "playlist-selected-only"))
{
GList *selfilelist = NULL;
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(BrowserList));
@@ -1815,7 +1812,7 @@ Write_Playlist (const gchar *playlist_name)
filename = ((File_Name *)etfile->FileNameCur->data)->value;
duration = ((ET_File_Info *)etfile->ETFileInfo)->duration;
- if (PLAYLIST_RELATIVE_PATH)
+ if (g_settings_get_boolean (ETSettings, "playlist-relative"))
{
// Keep only files in this directory and sub-dirs
if ( strncmp(filename,basedir,strlen(basedir))==0 )
@@ -1843,7 +1840,8 @@ Write_Playlist (const gchar *playlist_name)
}
// 3) Write the file path
- if (PLAYLIST_USE_DOS_SEPARATOR)
+ if (g_settings_get_boolean (ETSettings,
+ "playlist-dos-separator"))
{
gchar *filename_conv = g_strdup(filename+strlen(basedir)+1);
Playlist_Convert_Forwardslash_Into_Backslash(filename_conv);
@@ -1854,7 +1852,7 @@ Write_Playlist (const gchar *playlist_name)
fprintf(file,"%s\r\n",filename+strlen(basedir)+1); // Must be written in system encoding
(not UTF-8)
}
}
- }else // PLAYLIST_FULL_PATH
+ } else /* !ETSettings:playlist-relative */
{
// 2) Write the header
if (PLAYLIST_CONTENT_NONE)
@@ -1878,7 +1876,7 @@ Write_Playlist (const gchar *playlist_name)
}
// 3) Write the file path
- if (PLAYLIST_USE_DOS_SEPARATOR)
+ if (g_settings_get_boolean (ETSettings, "playlist-dos-separator"))
{
gchar *filename_conv = g_strdup(filename);
Playlist_Convert_Forwardslash_Into_Backslash(filename_conv);
@@ -1893,7 +1891,7 @@ Write_Playlist (const gchar *playlist_name)
}
fclose(file);
- if (PLAYLIST_ONLY_SELECTED_FILES)
+ if (g_settings_get_boolean (ETSettings, "playlist-selected-only"))
g_list_free(etfilelist);
g_free(playlist_name_utf8);
g_free(basedir);
@@ -2003,8 +2001,10 @@ void Open_Search_File_Window (void)
SearchInTag = gtk_check_button_new_with_label(_("the Tag"));
gtk_grid_attach (GTK_GRID (Table), SearchInFilename, 1, 1, 1, 1);
gtk_grid_attach (GTK_GRID (Table), SearchInTag, 2, 1, 1, 1);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(SearchInFilename),SEARCH_IN_FILENAME);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(SearchInTag),SEARCH_IN_TAG);
+ g_settings_bind (ETSettings, "search-filename", SearchInFilename,
+ "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (ETSettings, "search-tag", SearchInTag,
+ "active", G_SETTINGS_BIND_DEFAULT);
Separator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
et_grid_attach_full (GTK_GRID (Table), Separator, 3, 1, 1, 1, FALSE, FALSE,
@@ -2014,7 +2014,8 @@ void Open_Search_File_Window (void)
SearchCaseSensitive = gtk_check_button_new_with_label(_("Case sensitive"));
et_grid_attach_full (GTK_GRID (Table), SearchCaseSensitive, 4, 1, 1, 1,
TRUE, FALSE, 0, 0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(SearchCaseSensitive),SEARCH_CASE_SENSITIVE);
+ g_settings_bind (ETSettings, "search-case-sensitive", SearchCaseSensitive,
+ "active", G_SETTINGS_BIND_DEFAULT);
// Results list
ScrollWindow = gtk_scrolled_window_new(NULL,NULL);
@@ -2241,7 +2242,7 @@ void Open_Search_File_Window (void)
gtk_widget_show_all(SearchFileWindow);
- if (SET_SEARCH_WINDOW_POSITION)
+ if (g_settings_get_boolean (ETSettings, "search-remember-location"))
gtk_window_move(GTK_WINDOW(SearchFileWindow), SEARCH_WINDOW_X, SEARCH_WINDOW_Y);
//else
// gtk_window_set_position(GTK_WINDOW(SearchFileWindow), GTK_WIN_POS_CENTER_ON_PARENT); // Must use
gtk_window_set_transient_for to work
@@ -2285,10 +2286,6 @@ void Search_File_Window_Apply_Changes (void)
SEARCH_WINDOW_WIDTH = width;
SEARCH_WINDOW_HEIGHT = height;
}
-
- SEARCH_IN_FILENAME = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(SearchInFilename));
- SEARCH_IN_TAG = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(SearchInTag));
- SEARCH_CASE_SENSITIVE = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(SearchCaseSensitive));
}
}
@@ -2560,7 +2557,7 @@ Add_Row_To_Search_Result_List (ET_File *ETFile, const gchar *string_to_search)
{
if ( SearchResultList_Text[column] && strlen(string_to_search) &&
strstr(SearchResultList_Text[column],string_to_search) )
{
- if (CHANGED_FILES_DISPLAYED_TO_BOLD)
+ if (g_settings_get_boolean (ETSettings, "file-changed-bold"))
SearchResultList_Weight[column] = PANGO_WEIGHT_BOLD;
else
SearchResultList_Color[column] = &RED;
@@ -2582,7 +2579,7 @@ Add_Row_To_Search_Result_List (ET_File *ETFile, const gchar *string_to_search)
if ( list_text && strlen(string_to_search2) && strstr(list_text,string_to_search2) )
{
- if (CHANGED_FILES_DISPLAYED_TO_BOLD)
+ if (g_settings_get_boolean (ETSettings, "file-changed-bold"))
SearchResultList_Weight[column] = PANGO_WEIGHT_BOLD;
else
SearchResultList_Color[column] = &RED;
@@ -3020,7 +3017,8 @@ void Open_Load_Filename_Window (void)
LoadFileRunScanner = gtk_check_button_new_with_label(_("Run the current scanner for each file"));
gtk_box_pack_start(GTK_BOX(VBox),LoadFileRunScanner,FALSE,TRUE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(LoadFileRunScanner),LOAD_FILE_RUN_SCANNER);
+ g_settings_bind (ETSettings, "load-filenames-run-scanner",
+ LoadFileRunScanner, "active", G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(LoadFileRunScanner,_("When activating this option, after loading the "
"filenames, the current selected scanner will be ran (the scanner window must be opened)."));
@@ -3093,8 +3091,6 @@ void Load_Filename_Window_Apply_Changes (void)
LOAD_FILE_WINDOW_WIDTH = width;
LOAD_FILE_WINDOW_HEIGHT = height;
}
-
- LOAD_FILE_RUN_SCANNER = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(LoadFileRunScanner));
}
}
diff --git a/src/mp4_tag.c b/src/mp4_tag.c
index a986c3a..72cf172 100644
--- a/src/mp4_tag.c
+++ b/src/mp4_tag.c
@@ -138,7 +138,12 @@ gboolean Mp4tag_Read_File_Tag (gchar *filename, File_Tag *FileTag)
track = taglib_tag_track(tag);
if (track != 0)
- FileTag->track = NUMBER_TRACK_FORMATED ?
g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,(gint)track) : g_strdup_printf("%d",(gint)track);
+ FileTag->track = g_settings_get_boolean (ETSettings, "tag-number-padded")
+ ? g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings,
+ "tag-number-length"),
+ (gint)track)
+ : g_strdup_printf ("%d", (gint)track);
/* TODO: No total track support in the TagLib C API! */
/*********
diff --git a/src/ogg_tag.c b/src/ogg_tag.c
index dc71a31..c89bb47 100644
--- a/src/ogg_tag.c
+++ b/src/ogg_tag.c
@@ -302,25 +302,34 @@ gboolean Ogg_Tag_Read_File_Tag (gchar *filename, File_Tag *FileTag)
*************************/
if ( (string = vorbis_comment_query(vc,"TRACKNUMBER",0)) != NULL && g_utf8_strlen(string, -1) > 0 )
{
- if (NUMBER_TRACK_FORMATED)
+ if (g_settings_get_boolean (ETSettings, "tag-number-padded"))
{
// Ckeck if TRACKTOTAL used, else takes it in TRACKNUMBER
if ( (string1 = vorbis_comment_query(vc,"TRACKTOTAL",0)) != NULL && g_utf8_strlen(string1, -1) >
0 )
{
- FileTag->track_total =
g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,atoi(string1));
+ FileTag->track_total = g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings,
"tag-number-length"),
+ atoi (string1));
}else
if ( (string1 = g_utf8_strchr(string, -1, '/')) )
{
- FileTag->track_total =
g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,atoi(string1+1));
+ FileTag->track_total = g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings,
"tag-number-length"),
+ atoi (string1 + 1));
*string1 = '\0';
}
- FileTag->track = g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,atoi(string));
+ FileTag->track = g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings,
+ "tag-number-length"),
+ atoi (string));
}else
{
// Ckeck if TRACKTOTAL used, else takes it in TRACKNUMBER
if ( (string1 = vorbis_comment_query(vc,"TRACKTOTAL",0)) != NULL && g_utf8_strlen(string1, -1) >
0 )
{
- FileTag->track_total =
g_strdup_printf("%.*d",NUMBER_TRACK_FORMATED_SPIN_BUTTON,atoi(string1));
+ FileTag->track_total = g_strdup_printf ("%.*d",
+ g_settings_get_uint (ETSettings,
"tag-number-length"),
+ atoi (string1));
}else
if ( (string1 = g_utf8_strchr(string, -1, '/')) )
{
@@ -702,22 +711,26 @@ gboolean Ogg_Tag_Write_File_Tag (ET_File *ETFile)
/*********
* Title *
*********/
- Ogg_Set_Tag(vc,"TITLE=",FileTag->title,VORBIS_SPLIT_FIELD_TITLE);
+ Ogg_Set_Tag (vc, "TITLE=", FileTag->title,
+ g_settings_get_boolean (ETSettings, "ogg-split-title"));
/**********
* Artist *
**********/
- Ogg_Set_Tag(vc,"ARTIST=",FileTag->artist, VORBIS_SPLIT_FIELD_ARTIST);
+ Ogg_Set_Tag (vc, "ARTIST=", FileTag->artist,
+ g_settings_get_boolean (ETSettings, "ogg-split-artist"));
/****************
* Album Artist *
****************/
- Ogg_Set_Tag(vc,"ALBUMARTIST=",FileTag->album_artist, VORBIS_SPLIT_FIELD_ARTIST);
+ Ogg_Set_Tag (vc, "ALBUMARTIST=", FileTag->album_artist,
+ g_settings_get_boolean (ETSettings, "ogg-split-artist"));
/*********
* Album *
*********/
- Ogg_Set_Tag(vc,"ALBUM=",FileTag->album, VORBIS_SPLIT_FIELD_ALBUM);
+ Ogg_Set_Tag (vc, "ALBUM=", FileTag->album,
+ g_settings_get_boolean (ETSettings, "ogg-split-album"));
/***************
* Disc Number *
@@ -739,23 +752,28 @@ gboolean Ogg_Tag_Write_File_Tag (ET_File *ETFile)
/*********
* Genre *
*********/
- Ogg_Set_Tag(vc,"GENRE=",FileTag->genre,VORBIS_SPLIT_FIELD_GENRE);
+ Ogg_Set_Tag (vc, "GENRE=", FileTag->genre,
+ g_settings_get_boolean (ETSettings, "ogg-split-genre"));
/***********
* Comment *
***********/
/* Format of new specification. */
- Ogg_Set_Tag(vc,"DESCRIPTION=",FileTag->comment,VORBIS_SPLIT_FIELD_COMMENT);
+ Ogg_Set_Tag (vc, "DESCRIPTION=", FileTag->comment,
+ g_settings_get_boolean (ETSettings, "ogg-split-comment"));
/************
* Composer *
************/
- Ogg_Set_Tag(vc,"COMPOSER=",FileTag->composer,VORBIS_SPLIT_FIELD_COMPOSER);
+ Ogg_Set_Tag (vc, "COMPOSER=", FileTag->composer,
+ g_settings_get_boolean (ETSettings, "ogg-split-composer"));
/*******************
* Original artist *
*******************/
- Ogg_Set_Tag(vc,"PERFORMER=",FileTag->orig_artist,VORBIS_SPLIT_FIELD_ORIG_ARTIST);
+ Ogg_Set_Tag (vc, "PERFORMER=", FileTag->orig_artist,
+ g_settings_get_boolean (ETSettings,
+ "ogg-split-original-artist"));
/*************
* Copyright *
diff --git a/src/prefs.c b/src/prefs.c
index f34ed8c..2f9278f 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -55,7 +55,6 @@ static void OptionsWindow_Cancel_Button (void);
static gboolean OptionsWindow_Key_Press (GtkWidget *window, GdkEvent *event);
static gboolean Check_Config (void);
-static void Set_Default_Comment_Check_Button_Toggled (void);
static void Number_Track_Formatted_Toggled (void);
static void Number_Track_Formatted_Spin_Button_Changed (GtkWidget *Label,
GtkWidget *SpinButton);
@@ -92,9 +91,9 @@ void Open_OptionsWindow (void)
GtkWidget *VBox, *vbox;
GtkWidget *HBox, *hbox, *id3v1v2hbox;
GtkWidget *Separator;
- gchar temp[MAX_STRING_LEN];
gchar *path_utf8;
gchar *program_path;
+ gchar *default_comment;
/* Check if already opened */
if (OptionsWindow)
@@ -194,7 +193,8 @@ void Open_OptionsWindow (void)
/* Load directory on startup */
LoadOnStartup = gtk_check_button_new_with_label(_("Load on startup the default directory or the
directory passed as argument"));
gtk_box_pack_start(GTK_BOX(vbox),LoadOnStartup,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(LoadOnStartup),LOAD_ON_STARTUP);
+ g_settings_bind (ETSettings, "load-on-startup", LoadOnStartup, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(LoadOnStartup,_("Automatically search files, when EasyTAG starts, "
"into the default directory. Note that this path may be overridden by the parameter "
"passed to easytag (easytag /path_to/mp3_files)."));
@@ -202,7 +202,8 @@ void Open_OptionsWindow (void)
/* Browse subdirectories */
BrowseSubdir = gtk_check_button_new_with_label(_("Search subdirectories"));
gtk_box_pack_start(GTK_BOX(vbox),BrowseSubdir,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(BrowseSubdir),BROWSE_SUBDIR);
+ g_settings_bind (ETSettings, "browse-subdir", BrowseSubdir, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(BrowseSubdir,_("Search subdirectories for files when reading "
"a directory into the tree."));
@@ -210,7 +211,9 @@ void Open_OptionsWindow (void)
OpenSelectedBrowserNode = gtk_check_button_new_with_label(_("Show subdirectories when selecting "
"a directory"));
gtk_box_pack_start(GTK_BOX(vbox),OpenSelectedBrowserNode,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(OpenSelectedBrowserNode),OPEN_SELECTED_BROWSER_NODE);
+ g_settings_bind (ETSettings, "browse-expand-children",
+ OpenSelectedBrowserNode, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(OpenSelectedBrowserNode,_("This expands the selected node into the file "
"browser to display the sub-directories."));
@@ -219,7 +222,8 @@ void Open_OptionsWindow (void)
#ifndef G_OS_WIN32 /* Always true and not user modifiable on win32 */
gtk_box_pack_start(GTK_BOX(vbox),BrowseHiddendir,FALSE,FALSE,0);
#endif /* !G_OS_WIN32 */
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(BrowseHiddendir),BROWSE_HIDDEN_DIR);
+ g_settings_bind (ETSettings, "browse-show-hidden", BrowseHiddendir,
+ "active", G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(BrowseHiddendir,_("Search hidden directories for files "
"(directories starting by a '.')."));
@@ -245,10 +249,11 @@ void Open_OptionsWindow (void)
gtk_container_add(GTK_CONTAINER(Frame),vbox);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 2);
- // Show header infos
+ /* Show header information. */
ShowHeaderInfos = gtk_check_button_new_with_label(_("Show header information of file"));
gtk_box_pack_start(GTK_BOX(vbox),ShowHeaderInfos,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ShowHeaderInfos),SHOW_HEADER_INFO);
+ g_settings_bind (ETSettings, "file-show-header", ShowHeaderInfos, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(ShowHeaderInfos,_("If activated, information about the file as "
"the bitrate, the time, the size, will be displayed under the filename entry."));
@@ -261,14 +266,16 @@ void Open_OptionsWindow (void)
ChangedFilesDisplayedToRed = gtk_radio_button_new_with_label(NULL,_("Red color"));
gtk_box_pack_start(GTK_BOX(hbox),ChangedFilesDisplayedToRed,FALSE,FALSE,4);
-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ChangedFilesDisplayedToRed),CHANGED_FILES_DISPLAYED_TO_RED);
// Set "new" Gtk+-2.0ish black/bold style for changed items
ChangedFilesDisplayedToBold = gtk_radio_button_new_with_label(
gtk_radio_button_get_group(GTK_RADIO_BUTTON(ChangedFilesDisplayedToRed)),_("Bold style"));
gtk_box_pack_start(GTK_BOX(hbox),ChangedFilesDisplayedToBold,FALSE,FALSE,2);
-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ChangedFilesDisplayedToBold),CHANGED_FILES_DISPLAYED_TO_BOLD);
-
+ g_settings_bind (ETSettings, "file-changed-bold",
+ ChangedFilesDisplayedToBold, "active",
+ G_SETTINGS_BIND_DEFAULT);
+ g_signal_connect (ChangedFilesDisplayedToBold, "notify::active",
+ Browser_List_Refresh_Whole_List, NULL);
/* Sorting List Options */
Frame = gtk_frame_new (_("Sorting List Options"));
@@ -372,7 +379,8 @@ void Open_OptionsWindow (void)
// Show / hide log view
ShowLogView = gtk_check_button_new_with_label(_("Show log view in main window"));
gtk_box_pack_start(GTK_BOX(vbox),ShowLogView,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ShowLogView),SHOW_LOG_VIEW);
+ g_settings_bind (ETSettings, "log-show", ShowLogView, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(ShowLogView,_("If activated, the log view would be "
"visible in the main window."));
@@ -385,7 +393,8 @@ void Open_OptionsWindow (void)
LogMaxLinesSpinButton = gtk_spin_button_new_with_range(10.0,1500.0,10.0);
gtk_box_pack_start(GTK_BOX(hbox),LogMaxLinesSpinButton,FALSE,FALSE,0);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(LogMaxLinesSpinButton),(gfloat)LOG_MAX_LINES);
+ g_settings_bind (ETSettings, "log-lines", LogMaxLinesSpinButton,
+ "value", G_SETTINGS_BIND_DEFAULT);
/*
g_signal_connect(G_OBJECT(NumberTrackFormated),"toggled",G_CALLBACK(Number_Track_Formatted_Toggled),NULL);
* g_signal_emit_by_name(G_OBJECT(NumberTrackFormated),"toggled");
gtk_tooltips_set_tip(Tips,GTK_BIN(FilePlayerCombo)->child,_("Enter the program used to "
@@ -417,7 +426,9 @@ void Open_OptionsWindow (void)
ReplaceIllegalCharactersInFilename = gtk_check_button_new_with_label(_("Replace illegal characters in
filename (for Windows and CD-Rom)"));
gtk_box_pack_start(GTK_BOX(vbox),ReplaceIllegalCharactersInFilename,FALSE,FALSE,0);
-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ReplaceIllegalCharactersInFilename),REPLACE_ILLEGAL_CHARACTERS_IN_FILENAME);
+ g_settings_bind (ETSettings, "rename-replace-illegal-chars",
+ ReplaceIllegalCharactersInFilename, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(ReplaceIllegalCharactersInFilename,_("Convert illegal characters for "
"FAT32/16 and ISO9660 + Joliet filesystems ('\\', ':', ';', '*', '?', '\"', '<', '>', '|') "
"of the filename to avoid problem when renaming the file. This is useful when renaming the "
@@ -450,7 +461,9 @@ void Open_OptionsWindow (void)
/* Preserve modification time */
PreserveModificationTime = gtk_check_button_new_with_label(_("Preserve modification time of the file"));
gtk_box_pack_start(GTK_BOX(vbox),PreserveModificationTime,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(PreserveModificationTime),PRESERVE_MODIFICATION_TIME);
+ g_settings_bind (ETSettings, "file-preserve-modification-time",
+ PreserveModificationTime, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(PreserveModificationTime,_("Preserve the modification time "
"(in file properties) when saving the file."));
@@ -458,7 +471,9 @@ void Open_OptionsWindow (void)
UpdateParentDirectoryModificationTime = gtk_check_button_new_with_label(_("Update modification time "
"of the parent directory of the file (recommended when using Amarok)"));
gtk_box_pack_start(GTK_BOX(vbox),UpdateParentDirectoryModificationTime,FALSE,FALSE,0);
-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(UpdateParentDirectoryModificationTime),UPDATE_PARENT_DIRECTORY_MODIFICATION_TIME);
+ g_settings_bind (ETSettings, "file-update-parent-modification-time",
+ UpdateParentDirectoryModificationTime, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(UpdateParentDirectoryModificationTime,_("The modification time "
"of the parent directory of the file will be updated when saving tag the file. At the "
"present time it is automatically done only when renaming a file.\nThis feature is "
@@ -543,7 +558,8 @@ void Open_OptionsWindow (void)
DateAutoCompletion = gtk_check_button_new_with_label(_("Auto completion of date if not complete"));
gtk_box_pack_start(GTK_BOX(vbox),DateAutoCompletion,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(DateAutoCompletion),DATE_AUTO_COMPLETION);
+ g_settings_bind (ETSettings, "tag-date-autocomplete", DateAutoCompletion,
+ "active", G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(DateAutoCompletion,_("Try to complete the year field if you enter "
"only the last numerals of the date (for instance, if the current year is 2005: "
"5 => 2005, 4 => 2004, 6 => 1996, 95 => 1995…)."));
@@ -553,14 +569,17 @@ void Open_OptionsWindow (void)
NumberTrackFormated = gtk_check_button_new_with_label(_("Write the track field with the following number
of digits:"));
gtk_box_pack_start(GTK_BOX(hbox),NumberTrackFormated,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(NumberTrackFormated),NUMBER_TRACK_FORMATED);
+ g_settings_bind (ETSettings, "tag-number-padded", NumberTrackFormated,
+ "active", G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(NumberTrackFormated,_("If activated, the track field is written using "
"the number '0' as padding to obtain a number with 'n' digits (for example, with two digits: '05', "
"'09', '10'…). Else it keeps the 'raw' track value."));
NumberTrackFormatedSpinButton = gtk_spin_button_new_with_range(2.0,6.0,1.0);
gtk_box_pack_start(GTK_BOX(hbox),NumberTrackFormatedSpinButton,FALSE,FALSE,0);
-
gtk_spin_button_set_value(GTK_SPIN_BUTTON(NumberTrackFormatedSpinButton),(gfloat)NUMBER_TRACK_FORMATED_SPIN_BUTTON);
+ g_settings_bind (ETSettings, "tag-number-length",
+ NumberTrackFormatedSpinButton, "value",
+ G_SETTINGS_BIND_DEFAULT);
g_signal_connect(G_OBJECT(NumberTrackFormated),"toggled",G_CALLBACK(Number_Track_Formatted_Toggled),NULL);
g_signal_emit_by_name(G_OBJECT(NumberTrackFormated),"toggled");
@@ -574,30 +593,12 @@ void Open_OptionsWindow (void)
gtk_box_pack_start(GTK_BOX(vbox),Separator,FALSE,FALSE,0);
/* Tag field focus */
- Table = et_grid_new (2, 3);
- gtk_box_pack_start(GTK_BOX(vbox),Table,FALSE,FALSE,0);
- /*gtk_grid_set_row_spacing (GTK_GRID (Table), 2);*/
- gtk_grid_set_column_spacing (GTK_GRID (Table), 2);
-
- Label = gtk_label_new(_("Tag field focus when switching files in list with "
- "shortcuts Page Up/Page Down:"));
- gtk_grid_attach (GTK_GRID (Table), Label, 0, 0, 2, 1);
- gtk_misc_set_alignment(GTK_MISC(Label),0,0.5);
-
- Label = gtk_label_new(" ");
- gtk_grid_attach (GTK_GRID (Table), Label, 0, 1, 1, 1);
+ SetFocusToSameTagField = gtk_check_button_new_with_label (_("Keep focus on the same tag field when
switching files"));
+ gtk_box_pack_start (GTK_BOX (vbox), SetFocusToSameTagField, FALSE, FALSE,
+ 0);
+ g_settings_bind (ETSettings, "tag-preserve-focus", SetFocusToSameTagField,
+ "active", G_SETTINGS_BIND_DEFAULT);
- SetFocusToSameTagField = gtk_radio_button_new_with_label(NULL,
- _("Keep focus to the same tag field"));
- gtk_grid_attach (GTK_GRID (Table), SetFocusToSameTagField, 1, 1, 1, 1);
- //gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(SetFocusToSameTagField),SET_FOCUS_TO_SAME_TAG_FIELD);
-
- SetFocusToFirstTagField = gtk_radio_button_new_with_label(
- gtk_radio_button_get_group(GTK_RADIO_BUTTON(SetFocusToSameTagField)),
- _("Return focus to the first tag field (i.e. 'Title' field)"));
- gtk_grid_attach (GTK_GRID (Table), SetFocusToFirstTagField, 1, 2, 1, 1);
- //gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(SetFocusToFirstTagField),SET_FOCUS_TO_FIRST_TAG_FIELD);
-
/* Tag Splitting */
Frame = gtk_frame_new (_("Tag Splitting"));
gtk_box_pack_start(GTK_BOX(VBox),Frame,FALSE,FALSE,0);
@@ -626,13 +627,22 @@ void Open_OptionsWindow (void)
gtk_grid_attach (GTK_GRID (Table), VorbisSplitFieldComposer, 1, 2, 1, 1);
gtk_grid_attach (GTK_GRID (Table), VorbisSplitFieldOrigArtist, 1, 3, 1, 1);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(VorbisSplitFieldTitle), VORBIS_SPLIT_FIELD_TITLE);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(VorbisSplitFieldArtist), VORBIS_SPLIT_FIELD_ARTIST);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(VorbisSplitFieldAlbum), VORBIS_SPLIT_FIELD_ALBUM);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(VorbisSplitFieldGenre), VORBIS_SPLIT_FIELD_GENRE);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(VorbisSplitFieldComment), VORBIS_SPLIT_FIELD_COMMENT);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(VorbisSplitFieldComposer), VORBIS_SPLIT_FIELD_COMPOSER);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(VorbisSplitFieldOrigArtist),
VORBIS_SPLIT_FIELD_ORIG_ARTIST);
+ g_settings_bind (ETSettings, "ogg-split-title", VorbisSplitFieldTitle,
+ "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (ETSettings, "ogg-split-artist", VorbisSplitFieldArtist,
+ "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (ETSettings, "ogg-split-album", VorbisSplitFieldAlbum,
+ "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (ETSettings, "ogg-split-genre", VorbisSplitFieldGenre,
+ "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (ETSettings, "ogg-split-comment", VorbisSplitFieldComment,
+ "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (ETSettings, "ogg-split-composer",
+ VorbisSplitFieldComposer, "active",
+ G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (ETSettings, "ogg-split-original-artist",
+ VorbisSplitFieldOrigArtist, "active",
+ G_SETTINGS_BIND_DEFAULT);
/*
* ID3 Tag Settings
@@ -664,7 +674,8 @@ void Open_OptionsWindow (void)
/* Write ID3 tags in FLAC files */
WriteId3TagsInFlacFiles = gtk_check_button_new_with_label(_("Write ID3 tags in FLAC files (in addition
to FLAC tag)"));
gtk_grid_attach (GTK_GRID (Table), WriteId3TagsInFlacFiles, 0, 0, 1, 1);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(WriteId3TagsInFlacFiles),WRITE_ID3_TAGS_IN_FLAC_FILE);
+ g_settings_bind (ETSettings, "flac-write-id3", WriteId3TagsInFlacFiles,
+ "active", G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(WriteId3TagsInFlacFiles,_("If activated, ID3 tags will be "
"also added in the FLAC file (according the two rules above, plus the FLAC tag). "
"Else ID3 tags will be stripped."));
@@ -672,7 +683,8 @@ void Open_OptionsWindow (void)
/* Strip tag when fields (managed by EasyTAG) are empty */
StripTagWhenEmptyFields = gtk_check_button_new_with_label(_("Strip tags if all fields are set to
blank"));
gtk_grid_attach (GTK_GRID (Table), StripTagWhenEmptyFields, 0, 1, 1, 1);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(StripTagWhenEmptyFields),STRIP_TAG_WHEN_EMPTY_FIELDS);
+ g_settings_bind (ETSettings, "id3-strip-empty", StripTagWhenEmptyFields,
+ "active", G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(StripTagWhenEmptyFields,_("As ID3v2 tags may contain other data than "
"Title, Artist, Album, Year, Track, Genre or Comment (as an attached picture, lyrics…), "
"this option allows you to strip the whole tag when these seven standard data fields have "
@@ -681,28 +693,35 @@ void Open_OptionsWindow (void)
/* Convert old ID3v2 tag version */
ConvertOldId3v2TagVersion = gtk_check_button_new_with_label(_("Automatically convert old ID3v2 tag
versions"));
gtk_grid_attach (GTK_GRID (Table), ConvertOldId3v2TagVersion, 0, 2, 1, 1);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ConvertOldId3v2TagVersion),CONVERT_OLD_ID3V2_TAG_VERSION);
+ g_settings_bind (ETSettings, "id3v2-convert-old",
+ ConvertOldId3v2TagVersion, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(ConvertOldId3v2TagVersion,_("If activated, an old ID3v2 tag version (as "
"ID3v2.2) will be updated to the ID3v2.3 version."));
/* Use CRC32 */
FileWritingId3v2UseCrc32 = gtk_check_button_new_with_label(_("Use CRC32"));
gtk_grid_attach (GTK_GRID (Table), FileWritingId3v2UseCrc32, 1, 0, 1, 1);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileWritingId3v2UseCrc32),FILE_WRITING_ID3V2_USE_CRC32);
+ g_settings_bind (ETSettings, "id3v2-crc32", FileWritingId3v2UseCrc32,
+ "active", G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(FileWritingId3v2UseCrc32,_("Set CRC32 in the ID3v2 tags"));
/* Use Compression */
FileWritingId3v2UseCompression = gtk_check_button_new_with_label(_("Use Compression"));
gtk_grid_attach (GTK_GRID (Table), FileWritingId3v2UseCompression, 1, 1, 1,
1);
-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileWritingId3v2UseCompression),FILE_WRITING_ID3V2_USE_COMPRESSION);
+ g_settings_bind (ETSettings, "id3v2-compression",
+ FileWritingId3v2UseCompression, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(FileWritingId3v2UseCompression,_("Set Compression in the ID3v2 tags"));
/* Write Genre in text */
FileWritingId3v2TextOnlyGenre = gtk_check_button_new_with_label(_("Write Genre in text only"));
gtk_grid_attach (GTK_GRID (Table), FileWritingId3v2TextOnlyGenre, 1, 2, 1,
1);
-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileWritingId3v2TextOnlyGenre),FILE_WRITING_ID3V2_TEXT_ONLY_GENRE);
+ g_settings_bind (ETSettings, "id3v2-text-only-genre",
+ FileWritingId3v2TextOnlyGenre, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(FileWritingId3v2TextOnlyGenre,_("Don't use ID3v1 number references in genre
tag. Enable this if you see numbers as genre in your music player."));
/* Character Set for writing ID3 tag */
@@ -728,7 +747,8 @@ void Open_OptionsWindow (void)
/* Write ID3v2 tag */
FileWritingId3v2WriteTag = gtk_check_button_new_with_label(_("Write ID3v2 tag"));
gtk_grid_attach (GTK_GRID (Table), FileWritingId3v2WriteTag, 0, 0, 5, 1);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileWritingId3v2WriteTag),FILE_WRITING_ID3V2_WRITE_TAG);
+ g_settings_bind (ETSettings, "id3v2-enabled", FileWritingId3v2WriteTag,
+ "active", G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(FileWritingId3v2WriteTag,_("If activated, an ID3v2.4 tag will be added or "
"updated at the beginning of the MP3 files. Else it will be stripped."));
g_signal_connect_after(G_OBJECT(FileWritingId3v2WriteTag),"toggled",
@@ -766,8 +786,9 @@ void Open_OptionsWindow (void)
// Unicode
FileWritingId3v2UseUnicodeCharacterSet = gtk_radio_button_new_with_label(NULL, _("Unicode "));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileWritingId3v2UseUnicodeCharacterSet),
- FILE_WRITING_ID3V2_USE_UNICODE_CHARACTER_SET);
+ g_settings_bind (ETSettings, "id3v2-enable-unicode",
+ FileWritingId3v2UseUnicodeCharacterSet, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_grid_attach (GTK_GRID (Table), FileWritingId3v2UseUnicodeCharacterSet,
1, 3, 1, 1);
@@ -792,8 +813,6 @@ void Open_OptionsWindow (void)
_("Other"));
gtk_grid_attach (GTK_GRID (Table),
FileWritingId3v2UseNoUnicodeCharacterSet, 1, 4, 1, 1);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileWritingId3v2UseNoUnicodeCharacterSet),
- !FILE_WRITING_ID3V2_USE_UNICODE_CHARACTER_SET);
FileWritingId3v2NoUnicodeCharacterSetCombo = gtk_combo_box_text_new();
gtk_widget_set_tooltip_text (FileWritingId3v2NoUnicodeCharacterSetCombo,
@@ -857,7 +876,8 @@ void Open_OptionsWindow (void)
/* Write ID3v1 tag */
FileWritingId3v1WriteTag = gtk_check_button_new_with_label(_("Write ID3v1.x tag"));
gtk_grid_attach (GTK_GRID (Table), FileWritingId3v1WriteTag, 0, 0, 4, 1);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileWritingId3v1WriteTag),FILE_WRITING_ID3V1_WRITE_TAG);
+ g_settings_bind (ETSettings, "id3v1-enabled", FileWritingId3v1WriteTag,
+ "active", G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(FileWritingId3v1WriteTag,_("If activated, an ID3v1 tag will be added or "
"updated at the end of the MP3 files. Else it will be stripped."));
g_signal_connect_after(G_OBJECT(FileWritingId3v1WriteTag),"toggled",
@@ -928,8 +948,9 @@ void Open_OptionsWindow (void)
// "File Reading Charset" Check Button + Combo
UseNonStandardId3ReadingCharacterSet = gtk_check_button_new_with_label(_(
"Non-standard:"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(UseNonStandardId3ReadingCharacterSet),
- USE_NON_STANDARD_ID3_READING_CHARACTER_SET);
+ g_settings_bind (ETSettings, "id3-override-read-encoding",
+ UseNonStandardId3ReadingCharacterSet, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_grid_attach (GTK_GRID (Table), UseNonStandardId3ReadingCharacterSet, 0,
0, 1, 1);
gtk_widget_set_tooltip_text(UseNonStandardId3ReadingCharacterSet,
@@ -1038,7 +1059,9 @@ void Open_OptionsWindow (void)
PFSDontUpperSomeWords = gtk_check_button_new_with_label(_("Don't uppercase "
"first letter of words for some prepositions and articles."));
gtk_box_pack_start(GTK_BOX(vbox),PFSDontUpperSomeWords, FALSE, FALSE, 0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(PFSDontUpperSomeWords), PFS_DONT_UPPER_SOME_WORDS);
+ g_settings_bind (ETSettings, "process-uppercase-prepositions",
+ PFSDontUpperSomeWords, "active",
+ G_SETTINGS_BIND_DEFAULT | G_SETTINGS_BIND_INVERT_BOOLEAN);
gtk_widget_set_tooltip_text(PFSDontUpperSomeWords, _("Don't convert first "
"letter of words like prepositions, articles and words like feat., "
"when using the scanner 'First letter uppercase of each word' (for "
@@ -1053,7 +1076,8 @@ void Open_OptionsWindow (void)
OpenScannerWindowOnStartup = gtk_check_button_new_with_label(_("Open the Scanner Window on startup"));
gtk_box_pack_start(GTK_BOX(vbox),OpenScannerWindowOnStartup,FALSE,FALSE,0);
-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(OpenScannerWindowOnStartup),OPEN_SCANNER_WINDOW_ON_STARTUP);
+ g_settings_bind (ETSettings, "scan-startup", OpenScannerWindowOnStartup,
+ "active", G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(OpenScannerWindowOnStartup,_("Activate this option to open automatically "
"the scanner window when EasyTAG starts."));
@@ -1068,7 +1092,8 @@ void Open_OptionsWindow (void)
// Overwrite text into tag fields
OverwriteTagField = gtk_check_button_new_with_label(_("Overwrite fields when scanning tags"));
gtk_box_pack_start(GTK_BOX(vbox),OverwriteTagField,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(OverwriteTagField),OVERWRITE_TAG_FIELD);
+ g_settings_bind (ETSettings, "fill-overwrite-tag-fields",
+ OverwriteTagField, "active", G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(OverwriteTagField,_("If activated, the scanner will replace existing text "
"in fields by the new one. If deactivated, only blank fields of the tag will be filled."));
@@ -1082,29 +1107,33 @@ void Open_OptionsWindow (void)
gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,0);
SetDefaultComment = gtk_check_button_new_with_label(_("Set this text as default comment:"));
gtk_box_pack_start(GTK_BOX(hbox),SetDefaultComment,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(SetDefaultComment),SET_DEFAULT_COMMENT);
+ g_settings_bind (ETSettings, "fill-set-default-comment", SetDefaultComment,
+ "active", G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(SetDefaultComment,_("Activate this option if you want to put the "
"following string into the comment field when using the 'Fill Tag' scanner."));
DefaultComment = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(DefaultCommentModel));
gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(DefaultComment),MISC_COMBO_TEXT);
gtk_box_pack_start(GTK_BOX(hbox),DefaultComment,FALSE,FALSE,0);
gtk_widget_set_size_request(GTK_WIDGET(DefaultComment), 250, -1);
- g_signal_connect(G_OBJECT(SetDefaultComment),"toggled",
- G_CALLBACK(Set_Default_Comment_Check_Button_Toggled),NULL);
- if (DEFAULT_COMMENT==NULL)
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(SetDefaultComment),FALSE);
- Set_Default_Comment_Check_Button_Toggled();
+ g_settings_bind (ETSettings, "fill-set-default-comment", DefaultComment,
+ "sensitive", G_SETTINGS_BIND_GET);
+
/* History list */
Load_Default_Tag_Comment_Text_List(DefaultCommentModel, MISC_COMBO_TEXT);
- Add_String_To_Combo_List(DefaultCommentModel, DEFAULT_COMMENT);
- if (DEFAULT_COMMENT)
- gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(DefaultComment))), DEFAULT_COMMENT);
+ default_comment = g_settings_get_string (ETSettings,
+ "fill-default-comment");
+ Add_String_To_Combo_List (DefaultCommentModel, default_comment);
+ g_free (default_comment);
+ g_settings_bind (ETSettings, "fill-default-comment",
+ gtk_bin_get_child (GTK_BIN (DefaultComment)), "text",
+ G_SETTINGS_BIND_DEFAULT);
// CRC32 comment
Crc32Comment = gtk_check_button_new_with_label(_("Use CRC32 as the default "
"comment (for files with ID3 tags only)."));
gtk_box_pack_start(GTK_BOX(vbox),Crc32Comment,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Crc32Comment),SET_CRC32_COMMENT);
+ g_settings_bind (ETSettings, "fill-crc32-comment", Crc32Comment, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(Crc32Comment,_("Calculates the CRC-32 value of the file "
"and writes it into the comment field when using the 'Fill Tag' scanner."));
g_signal_connect_swapped(G_OBJECT(SetDefaultComment), "toggled",
@@ -1144,32 +1173,33 @@ void Open_OptionsWindow (void)
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(CddbServerNameAutomaticSearch), "at.freedb.org");
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(CddbServerNameAutomaticSearch), "au.freedb.org");
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(CddbServerNameAutomaticSearch), "ca.freedb.org");
- //gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(CddbServerNameAutomaticSearch), "ca2.freedb.org");
- //gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(CddbServerNameAutomaticSearch), "de.freedb.org");
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(CddbServerNameAutomaticSearch), "es.freedb.org");
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(CddbServerNameAutomaticSearch), "fi.freedb.org");
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(CddbServerNameAutomaticSearch), "ru.freedb.org");
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(CddbServerNameAutomaticSearch), "uk.freedb.org");
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(CddbServerNameAutomaticSearch), "us.freedb.org");
- if (CDDB_SERVER_NAME_AUTOMATIC_SEARCH)
-
gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(CddbServerNameAutomaticSearch))),CDDB_SERVER_NAME_AUTOMATIC_SEARCH);
+ g_settings_bind (ETSettings, "cddb-automatic-search-hostname",
+ gtk_bin_get_child (GTK_BIN (CddbServerNameAutomaticSearch)),
+ "text", G_SETTINGS_BIND_DEFAULT);
Label = gtk_label_new (_("Port:"));
gtk_box_pack_start(GTK_BOX(hbox),Label,FALSE,FALSE,2);
- CddbServerPortAutomaticSearch = gtk_entry_new();
+ CddbServerPortAutomaticSearch = gtk_spin_button_new_with_range (0.0,
+ 65535.0,
+ 1.0);
+ g_settings_bind (ETSettings, "cddb-automatic-search-port",
+ CddbServerPortAutomaticSearch, "value",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_size_request(GTK_WIDGET(CddbServerPortAutomaticSearch), 45, -1);
- gtk_entry_set_max_length(GTK_ENTRY(CddbServerPortAutomaticSearch),5);
gtk_box_pack_start(GTK_BOX(hbox),CddbServerPortAutomaticSearch,FALSE,FALSE,0);
- sprintf(temp,"%i",CDDB_SERVER_PORT_AUTOMATIC_SEARCH);
- gtk_entry_set_text(GTK_ENTRY(CddbServerPortAutomaticSearch),temp);
-
g_signal_connect(G_OBJECT(CddbServerPortAutomaticSearch),"insert_text",G_CALLBACK(Insert_Only_Digit),NULL);
Label = gtk_label_new (_("CGI Path:"));
gtk_box_pack_start(GTK_BOX(hbox),Label,FALSE,FALSE,2);
CddbServerCgiPathAutomaticSearch = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(hbox),CddbServerCgiPathAutomaticSearch,FALSE,FALSE,0);
- if (CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH)
-
gtk_entry_set_text(GTK_ENTRY(CddbServerCgiPathAutomaticSearch),CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH);
+ g_settings_bind (ETSettings, "cddb-automatic-search-path",
+ CddbServerCgiPathAutomaticSearch, "text",
+ G_SETTINGS_BIND_DEFAULT);
// 2sd automatic search server
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,2);
@@ -1179,25 +1209,28 @@ void Open_OptionsWindow (void)
CddbServerNameAutomaticSearch2 = gtk_combo_box_text_new_with_entry();
gtk_box_pack_start(GTK_BOX(hbox),CddbServerNameAutomaticSearch2,FALSE,FALSE,0);
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(CddbServerNameAutomaticSearch2),
"freedb.musicbrainz.org");
- if (CDDB_SERVER_NAME_AUTOMATIC_SEARCH2)
-
gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(CddbServerNameAutomaticSearch2))),CDDB_SERVER_NAME_AUTOMATIC_SEARCH2);
+ g_settings_bind (ETSettings, "cddb-automatic-search-hostname2",
+ gtk_bin_get_child (GTK_BIN (CddbServerNameAutomaticSearch2)),
+ "text", G_SETTINGS_BIND_DEFAULT);
Label = gtk_label_new (_("Port:"));
gtk_box_pack_start(GTK_BOX(hbox),Label,FALSE,FALSE,2);
- CddbServerPortAutomaticSearch2 = gtk_entry_new();
+ CddbServerPortAutomaticSearch2 = gtk_spin_button_new_with_range (0.0,
+ 65535.0,
+ 1.0);
+ g_settings_bind (ETSettings, "cddb-automatic-search-port2",
+ CddbServerPortAutomaticSearch2, "value",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_size_request(GTK_WIDGET(CddbServerPortAutomaticSearch2), 45, -1);
- gtk_entry_set_max_length(GTK_ENTRY(CddbServerPortAutomaticSearch2),5);
gtk_box_pack_start(GTK_BOX(hbox),CddbServerPortAutomaticSearch2,FALSE,FALSE,0);
- sprintf(temp,"%i",CDDB_SERVER_PORT_AUTOMATIC_SEARCH2);
- gtk_entry_set_text(GTK_ENTRY(CddbServerPortAutomaticSearch2),temp);
-
g_signal_connect(G_OBJECT(CddbServerPortAutomaticSearch2),"insert_text",G_CALLBACK(Insert_Only_Digit),NULL);
Label = gtk_label_new (_("CGI Path:"));
gtk_box_pack_start(GTK_BOX(hbox),Label,FALSE,FALSE,2);
CddbServerCgiPathAutomaticSearch2 = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(hbox),CddbServerCgiPathAutomaticSearch2,FALSE,FALSE,0);
- if (CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH2)
- gtk_entry_set_text(GTK_ENTRY(CddbServerCgiPathAutomaticSearch2)
,CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH2);
+ g_settings_bind (ETSettings, "cddb-automatic-search-path2",
+ CddbServerCgiPathAutomaticSearch2, "text",
+ G_SETTINGS_BIND_DEFAULT);
// CDDB Server Settings (Manual Search)
Frame = gtk_frame_new (_("Server Settings for Manual Search"));
@@ -1214,25 +1247,28 @@ void Open_OptionsWindow (void)
gtk_box_pack_start(GTK_BOX(hbox),CddbServerNameManualSearch,FALSE,FALSE,0);
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(CddbServerNameManualSearch), "www.freedb.org");
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(CddbServerNameManualSearch), "www.gnudb.org");
- if (CDDB_SERVER_NAME_MANUAL_SEARCH)
-
gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(CddbServerNameManualSearch))),CDDB_SERVER_NAME_MANUAL_SEARCH);
+ g_settings_bind (ETSettings, "cddb-manual-search-hostname",
+ gtk_bin_get_child (GTK_BIN (CddbServerNameManualSearch)),
+ "text", G_SETTINGS_BIND_DEFAULT);
Label = gtk_label_new (_("Port:"));
gtk_box_pack_start(GTK_BOX(hbox),Label,FALSE,FALSE,2);
- CddbServerPortManualSearch = gtk_entry_new();
+ CddbServerPortManualSearch = gtk_spin_button_new_with_range (0.0, 65535.0,
+ 1.0);
+ g_settings_bind (ETSettings, "cddb-manual-search-port",
+ CddbServerPortManualSearch, "value",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_size_request(GTK_WIDGET(CddbServerPortManualSearch), 45, -1);
gtk_entry_set_max_length(GTK_ENTRY(CddbServerPortManualSearch),5);
gtk_box_pack_start(GTK_BOX(hbox),CddbServerPortManualSearch,FALSE,FALSE,0);
- sprintf(temp,"%i",CDDB_SERVER_PORT_MANUAL_SEARCH);
- gtk_entry_set_text(GTK_ENTRY(CddbServerPortManualSearch),temp);
- g_signal_connect(G_OBJECT(CddbServerPortManualSearch),"insert_text",G_CALLBACK(Insert_Only_Digit),NULL);
Label = gtk_label_new (_("CGI Path:"));
gtk_box_pack_start(GTK_BOX(hbox),Label,FALSE,FALSE,2);
CddbServerCgiPathManualSearch = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(hbox),CddbServerCgiPathManualSearch,FALSE,FALSE,0);
- if (CDDB_SERVER_CGI_PATH_MANUAL_SEARCH)
- gtk_entry_set_text(GTK_ENTRY(CddbServerCgiPathManualSearch) ,CDDB_SERVER_CGI_PATH_MANUAL_SEARCH);
+ g_settings_bind (ETSettings, "cddb-manual-search-path",
+ CddbServerCgiPathManualSearch, "text",
+ G_SETTINGS_BIND_DEFAULT);
// Local access for CDDB (Automatic Search)
Frame = gtk_frame_new (_("Local CD Data Base"));
@@ -1292,7 +1328,8 @@ void Open_OptionsWindow (void)
CddbUseProxy = gtk_check_button_new_with_label(_("Use a proxy"));
gtk_grid_attach (GTK_GRID (Table), CddbUseProxy, 0, 0, 5, 1);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbUseProxy),CDDB_USE_PROXY);
+ g_settings_bind (ETSettings, "cddb-proxy-enabled", CddbUseProxy, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(CddbUseProxy,_("Set active the settings of the proxy server."));
Label = gtk_label_new(" ");
@@ -1303,37 +1340,35 @@ void Open_OptionsWindow (void)
gtk_misc_set_alignment(GTK_MISC(Label),1,0.5);
CddbProxyName = gtk_entry_new();
gtk_grid_attach (GTK_GRID (Table), CddbProxyName, 2, 1, 1, 1);
- if (CDDB_PROXY_NAME)
- gtk_entry_set_text(GTK_ENTRY(CddbProxyName),CDDB_PROXY_NAME);
+ g_settings_bind (ETSettings, "cddb-proxy-hostname", CddbProxyName, "text",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(CddbProxyName,_("Name of the proxy server."));
Label = gtk_label_new (_("Port:"));
gtk_grid_attach (GTK_GRID (Table), Label, 3, 1, 1, 1);
gtk_misc_set_alignment(GTK_MISC(Label),1,0.5);
- CddbProxyPort = gtk_entry_new();
+ CddbProxyPort = gtk_spin_button_new_with_range (0.0, 65535.0, 1.0);
+ g_settings_bind (ETSettings, "cddb-proxy-port", CddbProxyPort, "value",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_size_request(GTK_WIDGET(CddbProxyPort), 45, -1);
- gtk_entry_set_max_length(GTK_ENTRY(CddbProxyPort),5);
gtk_grid_attach (GTK_GRID (Table), CddbProxyPort, 4, 1, 1, 1);
gtk_widget_set_tooltip_text(CddbProxyPort,_("Port of the proxy server."));
- sprintf(temp,"%i",CDDB_PROXY_PORT);
- gtk_entry_set_text(GTK_ENTRY(CddbProxyPort),temp);
- g_signal_connect(G_OBJECT(CddbProxyPort),"insert_text",G_CALLBACK(Insert_Only_Digit),NULL);
g_signal_connect(G_OBJECT(CddbUseProxy),"toggled",G_CALLBACK(Cddb_Use_Proxy_Toggled),NULL);
Label = gtk_label_new(_("User Name:"));
gtk_grid_attach (GTK_GRID (Table), Label, 1, 2, 1, 1);
gtk_misc_set_alignment(GTK_MISC(Label),1,0.5);
CddbProxyUserName = gtk_entry_new();
- if (CDDB_PROXY_USER_NAME)
- gtk_entry_set_text(GTK_ENTRY(CddbProxyUserName),CDDB_PROXY_USER_NAME);
+ g_settings_bind (ETSettings, "cddb-proxy-username", CddbProxyUserName,
+ "text", G_SETTINGS_BIND_DEFAULT);
gtk_grid_attach (GTK_GRID (Table), CddbProxyUserName, 2, 2, 1, 1);
gtk_widget_set_tooltip_text(CddbProxyUserName,_("Name of user for the the proxy server."));
Label = gtk_label_new(_("User Password:"));
gtk_grid_attach (GTK_GRID (Table), Label, 3, 2, 1, 1);
gtk_misc_set_alignment(GTK_MISC(Label),1,0.5);
CddbProxyUserPassword = gtk_entry_new();
- if (CDDB_PROXY_USER_PASSWORD)
- gtk_entry_set_text(GTK_ENTRY(CddbProxyUserPassword),CDDB_PROXY_USER_PASSWORD);
+ gtk_entry_set_visibility (GTK_ENTRY (CddbProxyUserPassword), FALSE);
+ g_settings_bind (ETSettings, "cddb-proxy-password", CddbProxyUserPassword,
+ "text", G_SETTINGS_BIND_DEFAULT);
gtk_grid_attach (GTK_GRID (Table), CddbProxyUserPassword, 4, 2, 1, 1);
- gtk_entry_set_visibility(GTK_ENTRY(CddbProxyUserPassword),FALSE);
gtk_widget_set_tooltip_text(CddbProxyUserPassword,_("Password of user for the the proxy server."));
Cddb_Use_Proxy_Toggled();
@@ -1349,7 +1384,8 @@ void Open_OptionsWindow (void)
CddbFollowFile = gtk_check_button_new_with_label(_("Select corresponding audio "
"file (according position or DLM if activated below)"));
gtk_box_pack_start(GTK_BOX(vbox),CddbFollowFile,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbFollowFile),CDDB_FOLLOW_FILE);
+ g_settings_bind (ETSettings, "cddb-follow-file", CddbFollowFile, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(CddbFollowFile,_("If activated, when selecting a "
"line in the list of tracks name, the corresponding audio file in the "
"main list will be also selected."));
@@ -1358,7 +1394,8 @@ void Open_OptionsWindow (void)
CddbUseDLM = gtk_check_button_new_with_label(_("Use the Levenshtein algorithm "
"(DLM) to match lines (using title) with audio files (using filename)"));
gtk_box_pack_start(GTK_BOX(vbox),CddbUseDLM,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbUseDLM),CDDB_USE_DLM);
+ g_settings_bind (ETSettings, "cddb-dlm-enabled", CddbUseDLM, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(CddbUseDLM,_("When activating this option, the "
"Levenshtein algorithm (DLM: Damerau-Levenshtein Metric) will be used "
"to match the CDDB title against every file name in the current folder, "
@@ -1381,30 +1418,36 @@ void Open_OptionsWindow (void)
ConfirmBeforeExit = gtk_check_button_new_with_label(_("Confirm exit from program"));
gtk_box_pack_start(GTK_BOX(VBox),ConfirmBeforeExit,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ConfirmBeforeExit),CONFIRM_BEFORE_EXIT);
+ g_settings_bind (ETSettings, "confirm-quit", ConfirmBeforeExit, "active",
+ G_SETTINGS_BIND_DEFAULT);
gtk_widget_set_tooltip_text(ConfirmBeforeExit,_("If activated, opens a dialog box to ask "
"confirmation before exiting the program."));
ConfirmWriteTag = gtk_check_button_new_with_label(_("Confirm writing of file tag"));
gtk_box_pack_start(GTK_BOX(VBox),ConfirmWriteTag,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ConfirmWriteTag),CONFIRM_WRITE_TAG);
+ g_settings_bind (ETSettings, "confirm-write-tags", ConfirmWriteTag,
+ "active", G_SETTINGS_BIND_DEFAULT);
ConfirmRenameFile = gtk_check_button_new_with_label(_("Confirm renaming of file"));
gtk_box_pack_start(GTK_BOX(VBox),ConfirmRenameFile,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ConfirmRenameFile),CONFIRM_RENAME_FILE);
+ g_settings_bind (ETSettings, "confirm-rename-file", ConfirmRenameFile,
+ "active", G_SETTINGS_BIND_DEFAULT);
ConfirmDeleteFile = gtk_check_button_new_with_label(_("Confirm deleting of file"));
gtk_box_pack_start(GTK_BOX(VBox),ConfirmDeleteFile,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ConfirmDeleteFile),CONFIRM_DELETE_FILE);
+ g_settings_bind (ETSettings, "confirm-delete-file", ConfirmDeleteFile,
+ "active", G_SETTINGS_BIND_DEFAULT);
ConfirmWritePlayList = gtk_check_button_new_with_label(_("Confirm writing of playlist"));
gtk_box_pack_start(GTK_BOX(VBox),ConfirmWritePlayList,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ConfirmWritePlayList),CONFIRM_WRITE_PLAYLIST);
+ g_settings_bind (ETSettings, "confirm-write-playlist",
+ ConfirmWritePlayList, "active", G_SETTINGS_BIND_DEFAULT);
ConfirmWhenUnsavedFiles = gtk_check_button_new_with_label(_("Confirm changing directory when there are
unsaved changes"));
gtk_box_pack_start(GTK_BOX(VBox),ConfirmWhenUnsavedFiles,FALSE,FALSE,0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ConfirmWhenUnsavedFiles),CONFIRM_WHEN_UNSAVED_FILES);
-
+ g_settings_bind (ETSettings, "confirm-when-unsaved-files",
+ ConfirmWhenUnsavedFiles, "active",
+ G_SETTINGS_BIND_DEFAULT);
/*
* Buttons box of Option Window
@@ -1441,13 +1484,8 @@ void Open_OptionsWindow (void)
gtk_widget_show_all(OptionsWindow);
/* Load the default page */
- gtk_notebook_set_current_page(GTK_NOTEBOOK(OptionsNoteBook), OPTIONS_NOTEBOOK_PAGE);
-}
-
-
-static void Set_Default_Comment_Check_Button_Toggled (void)
-{
-
gtk_widget_set_sensitive(DefaultComment,gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(SetDefaultComment)));
+ g_settings_bind (ETSettings, "preferences-page", OptionsNoteBook, "page",
+ G_SETTINGS_BIND_DEFAULT);
}
void Number_Track_Formatted_Toggled (void)
@@ -1683,9 +1721,6 @@ void OptionsWindow_Apply_Changes (void)
OPTIONS_WINDOW_HEIGHT = height;
}
- /* Get the last visible notebook page */
- OPTIONS_NOTEBOOK_PAGE = gtk_notebook_get_current_page(GTK_NOTEBOOK(OptionsNoteBook));
-
/* Save combobox history lists before exit */
Save_Default_Path_To_MP3_List (DefaultPathModel, MISC_COMBO_TEXT);
Save_Default_Tag_Comment_Text_List(DefaultCommentModel, MISC_COMBO_TEXT);
diff --git a/src/scan.c b/src/scan.c
index d2dddae..45105bd 100644
--- a/src/scan.c
+++ b/src/scan.c
@@ -322,8 +322,10 @@ Scan_Tag_With_Mask (ET_File *ETFile)
// Get the target entry for this code
dest = Scan_Return_File_Tag_Field_From_Mask_Code(FileTag,mask_item->code);
- // We display the text affected to the code
- if ( dest && ( OVERWRITE_TAG_FIELD || *dest==NULL || strlen(*dest)==0 ) )
+ /* We display the text affected to the code. */
+ if (dest && (g_settings_get_boolean (ETSettings,
+ "fill-overwrite-tag-fields")
+ || *dest == NULL || strlen (*dest) == 0))
ET_Set_Field_File_Tag_Item(dest,mask_item->string);
if (!fill_tag_list->next) break;
@@ -331,12 +333,22 @@ Scan_Tag_With_Mask (ET_File *ETFile)
}
Scan_Free_File_Fill_Tag_List(fill_tag_list);
- // Set the default text to comment
- if (SET_DEFAULT_COMMENT && (OVERWRITE_TAG_FIELD || FileTag->comment==NULL || strlen(FileTag->comment)==0
) )
- ET_Set_Field_File_Tag_Item((void *)&FileTag->comment,DEFAULT_COMMENT);
+ /* Set the default text to comment. */
+ if (g_settings_get_boolean (ETSettings, "fill-set-default-comment")
+ && (g_settings_get_boolean (ETSettings, "fill-overwrite-tag-fields")
+ || FileTag->comment == NULL || strlen (FileTag->comment) == 0 ))
+ {
+ gchar *default_comment = g_settings_get_string (ETSettings,
+ "fill-default-comment");
+ ET_Set_Field_File_Tag_Item ((void *)&FileTag->comment,
+ default_comment);
+ g_free (default_comment);
+ }
- // Set CRC-32 value as default comment (for files with ID3 tag only ;-)
- if (SET_CRC32_COMMENT && (OVERWRITE_TAG_FIELD || FileTag->comment==NULL || strlen(FileTag->comment)==0 )
)
+ /* Set CRC-32 value as default comment (for files with ID3 tag only). */
+ if (g_settings_get_boolean (ETSettings, "fill-crc32-comment")
+ && (g_settings_get_boolean (ETSettings, "fill-overwrite-tag-fields")
+ || FileTag->comment == NULL || strlen (FileTag->comment) == 0 ))
{
guint32 crc32_value;
gchar *buffer;
@@ -1503,7 +1515,7 @@ void Scan_Process_Fields_First_Letters_Uppercase (gchar *string)
gboolean set_to_upper_case, set_to_upper_case_tmp;
// There have to be space at the end of words to seperate them from prefix
// Chicago Manual of Style "Heading caps" Capitalization Rules (CMS 1993, 282)
(http://www.docstyles.com/cmscrib.htm#Note2)
- gchar *exempt[] =
+ const gchar *exempt[] =
{
"a ", "a_",
"against ", "against_",
@@ -1529,10 +1541,6 @@ void Scan_Process_Fields_First_Letters_Uppercase (gchar *string)
NULL
};
- if (!PFS_DONT_UPPER_SOME_WORDS)
- {
- exempt[0] = NULL;
- }
Scan_Process_Fields_All_Downcase(string);
if (!g_utf8_validate(string,-1,NULL))
@@ -1593,7 +1601,14 @@ void Scan_Process_Fields_First_Letters_Uppercase (gchar *string)
c = g_utf8_get_char(word);
strncpy(word, utf8_character, g_unichar_to_utf8(g_unichar_toupper(c), utf8_character));
- // Set lowercase the first character of this word if found in the exempt words list
+ if (g_settings_get_boolean (ETSettings,
+ "process-uppercase-prepositions"))
+ {
+ break;
+ }
+
+ /* Lowercase the first character of this word if found in the
+ * exempt words list. */
for (i=0; exempt[i]!=NULL; i++)
{
if (g_ascii_strncasecmp(exempt[i], word, strlen(exempt[i])) == 0)
@@ -2415,7 +2430,8 @@ void Open_ScannerWindow (gint scanner_type)
gtk_box_pack_start(GTK_BOX(HBox1),MaskEditorButton,FALSE,FALSE,0);
gtk_button_set_relief(GTK_BUTTON(MaskEditorButton),GTK_RELIEF_NONE);
gtk_widget_set_tooltip_text(MaskEditorButton,_("Show / Hide Masks Editor"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(MaskEditorButton),SCAN_MASK_EDITOR_BUTTON);
+ g_settings_bind (ETSettings, "scan-mask-editor-show", MaskEditorButton,
+ "active", G_SETTINGS_BIND_DEFAULT);
g_signal_connect(G_OBJECT(MaskEditorButton),"toggled",G_CALLBACK(Scan_Toggle_Mask_Editor_Button),NULL);
/* Legend button */
@@ -2425,7 +2441,8 @@ void Open_ScannerWindow (gint scanner_type)
gtk_box_pack_start(GTK_BOX(HBox1),LegendButton,FALSE,FALSE,0);
gtk_button_set_relief(GTK_BUTTON(LegendButton),GTK_RELIEF_NONE);
gtk_widget_set_tooltip_text(LegendButton,_("Show / Hide Legend"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(LegendButton),SCAN_LEGEND_BUTTON);
+ g_settings_bind (ETSettings, "scan-legend-show", LegendButton, "active",
+ G_SETTINGS_BIND_DEFAULT);
g_signal_connect(G_OBJECT(LegendButton),"toggled",G_CALLBACK(Scan_Toggle_Legend_Button),NULL);
/* Close button */
@@ -2694,10 +2711,6 @@ void Open_ScannerWindow (gint scanner_type)
gtk_box_pack_start(GTK_BOX(hbox),ProcessFieldsConvertFrom, FALSE,FALSE,0);
gtk_box_pack_start(GTK_BOX(hbox),ProcessFieldsConvertLabelTo,FALSE,FALSE,0);
gtk_box_pack_start(GTK_BOX(hbox),ProcessFieldsConvertTo, FALSE,FALSE,0);
- if (PROCESS_FIELDS_CONVERT_FROM)
- gtk_entry_set_text(GTK_ENTRY(ProcessFieldsConvertFrom),PROCESS_FIELDS_CONVERT_FROM);
- if (PROCESS_FIELDS_CONVERT_TO)
- gtk_entry_set_text(GTK_ENTRY(ProcessFieldsConvertTo),PROCESS_FIELDS_CONVERT_TO);
/* List creation for check buttons in group */
pf_cb_group1 = g_list_append (pf_cb_group1,ProcessFieldsConvertIntoSpace);
pf_cb_group1 = g_list_append (pf_cb_group1,ProcessFieldsConvertSpace);
@@ -2710,7 +2723,14 @@ void Open_ScannerWindow (gint scanner_type)
/* Set check buttons to init value */
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsConvertIntoSpace),PF_CONVERT_INTO_SPACE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsConvertSpace),PF_CONVERT_SPACE);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsConvert),PF_CONVERT);
+ g_settings_bind (ETSettings, "process-convert-characters",
+ ProcessFieldsConvert, "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (ETSettings, "process-convert-characters-from",
+ ProcessFieldsConvertFrom, "text",
+ G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (ETSettings, "process-convert-characters-to",
+ ProcessFieldsConvertTo, "text", G_SETTINGS_BIND_DEFAULT);
+
/* Tooltips */
gtk_widget_set_tooltip_text(ProcessFieldsConvertIntoSpace,
_("The underscore character or the string '%20' are replaced by one space. "
@@ -2752,11 +2772,18 @@ void Open_ScannerWindow (gint scanner_type)
g_signal_connect(G_OBJECT(ProcessFieldsFirstLettersUppercase),"toggled",G_CALLBACK(Process_Fields_First_Letters_Check_Button_Toggled),NULL);
g_signal_connect(G_OBJECT(ProcessFieldsDetectRomanNumerals),"toggled",G_CALLBACK(Process_Fields_Check_Button_Toggled),NULL);
/* Set check buttons to init value */
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsAllUppercase),PF_CONVERT_ALL_UPPERCASE);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsAllDowncase),PF_CONVERT_ALL_DOWNCASE);
-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsFirstLetterUppercase),PF_CONVERT_FIRST_LETTER_UPPERCASE);
-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsFirstLettersUppercase),PF_CONVERT_FIRST_LETTERS_UPPERCASE);
-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsDetectRomanNumerals),PF_DETECT_ROMAN_NUMERALS);
+ g_settings_bind (ETSettings, "process-uppercase-all",
+ ProcessFieldsAllUppercase, "active",
+ G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (ETSettings, "process-lowercase-all",
+ ProcessFieldsAllDowncase, "active",
+ G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (ETSettings, "process-uppercase-first-letters",
+ ProcessFieldsFirstLettersUppercase, "active",
+ G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (ETSettings, "process-detect-roman-numerals",
+ ProcessFieldsDetectRomanNumerals, "active",
+ G_SETTINGS_BIND_DEFAULT);
/* Tooltips */
gtk_widget_set_tooltip_text(ProcessFieldsAllUppercase,
_("Convert all words in all fields to upper case. "
@@ -2794,9 +2821,15 @@ void Open_ScannerWindow (gint scanner_type)
g_signal_connect(G_OBJECT(ProcessFieldsInsertSpace),
"toggled",G_CALLBACK(Process_Fields_Check_Button_Toggled),pf_cb_group3);
g_signal_connect(G_OBJECT(ProcessFieldsOnlyOneSpace),"toggled",G_CALLBACK(Process_Fields_Check_Button_Toggled),pf_cb_group3);
/* Set check buttons to init value */
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsRemoveSpace),PF_REMOVE_SPACE);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsInsertSpace),PF_INSERT_SPACE);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsOnlyOneSpace),PF_ONLY_ONE_SPACE);
+ g_settings_bind (ETSettings, "process-remove-spaces",
+ ProcessFieldsRemoveSpace, "active",
+ G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (ETSettings, "process-insert-capital-spaces",
+ ProcessFieldsInsertSpace, "active",
+ G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (ETSettings, "process-remove-duplicate-spaces",
+ ProcessFieldsOnlyOneSpace, "active",
+ G_SETTINGS_BIND_DEFAULT);
/* Tooltips */
gtk_widget_set_tooltip_text(ProcessFieldsRemoveSpace,
_("All spaces between words are removed. "
@@ -3133,9 +3166,6 @@ void ScannerWindow_Apply_Changes (void)
// The scanner selected
SCANNER_TYPE = gtk_combo_box_get_active(GTK_COMBO_BOX(ScannerOptionCombo));
- SCAN_MASK_EDITOR_BUTTON = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(MaskEditorButton));
- SCAN_LEGEND_BUTTON = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(LegendButton));
-
/* Group: select entries to process */
PROCESS_FILENAME_FIELD = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFileNameField));
PROCESS_TITLE_FIELD = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessTitleField));
@@ -3150,27 +3180,9 @@ void ScannerWindow_Apply_Changes (void)
PROCESS_URL_FIELD = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessURLField));
PROCESS_ENCODED_BY_FIELD = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessEncodedByField));
- if (PROCESS_FIELDS_CONVERT_FROM) g_free(PROCESS_FIELDS_CONVERT_FROM);
- PROCESS_FIELDS_CONVERT_FROM = g_strdup(gtk_entry_get_text(GTK_ENTRY(ProcessFieldsConvertFrom)));
- if (PROCESS_FIELDS_CONVERT_TO) g_free(PROCESS_FIELDS_CONVERT_TO);
- PROCESS_FIELDS_CONVERT_TO = g_strdup(gtk_entry_get_text(GTK_ENTRY(ProcessFieldsConvertTo)));
-
/* Group: convert one character */
PF_CONVERT_INTO_SPACE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFieldsConvertIntoSpace));
PF_CONVERT_SPACE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFieldsConvertSpace));
- PF_CONVERT = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFieldsConvert));
-
- /* Group: capitalize */
- PF_CONVERT_ALL_UPPERCASE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFieldsAllUppercase));
- PF_CONVERT_ALL_DOWNCASE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFieldsAllDowncase));
- PF_CONVERT_FIRST_LETTER_UPPERCASE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFieldsFirstLetterUppercase));
- PF_CONVERT_FIRST_LETTERS_UPPERCASE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFieldsFirstLettersUppercase));
- PF_DETECT_ROMAN_NUMERALS =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFieldsDetectRomanNumerals));
-
- /* Group: remove/insert space */
- PF_REMOVE_SPACE = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFieldsRemoveSpace));
- PF_INSERT_SPACE = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFieldsInsertSpace));
- PF_ONLY_ONE_SPACE = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFieldsOnlyOneSpace));
// Save default masks...
if (SCAN_TAG_DEFAULT_MASK) g_free(SCAN_TAG_DEFAULT_MASK);
@@ -4094,7 +4106,8 @@ Scanner_Option_Menu_Activate_Item (GtkWidget *combo, gpointer data)
static void
Scan_Set_Scanner_Window_Init_Position (void)
{
- if (ScannerWindow && SET_SCANNER_WINDOW_POSITION)
+ if (ScannerWindow && g_settings_get_boolean (ETSettings,
+ "scan-remember-location"))
{
gtk_widget_realize(ScannerWindow);
gtk_window_move(GTK_WINDOW(ScannerWindow),SCANNER_WINDOW_X,SCANNER_WINDOW_Y);
diff --git a/src/setting.c b/src/setting.c
index dee65f3..ba41e87 100644
--- a/src/setting.c
+++ b/src/setting.c
@@ -109,15 +109,8 @@ static gboolean Create_Easytag_Directory (void);
********************/
tConfigVariable Config_Variables[] =
{
- {"load_on_startup", CV_TYPE_BOOL, &LOAD_ON_STARTUP },
{"default_path_to_mp3", CV_TYPE_STRING, &DEFAULT_PATH_TO_MP3 },
- {"browser_line_style", CV_TYPE_BOOL, &BROWSER_LINE_STYLE },
- {"browser_expander_style", CV_TYPE_BOOL, &BROWSER_EXPANDER_STYLE },
- {"browse_subdir", CV_TYPE_BOOL, &BROWSE_SUBDIR },
- {"browse_hidden_dir", CV_TYPE_BOOL, &BROWSE_HIDDEN_DIR },
- {"open_selected_browser_node", CV_TYPE_BOOL, &OPEN_SELECTED_BROWSER_NODE },
- {"set_main_window_position", CV_TYPE_BOOL, &SET_MAIN_WINDOW_POSITION },
{"main_window_x", CV_TYPE_INT, &MAIN_WINDOW_X },
{"main_window_y", CV_TYPE_INT, &MAIN_WINDOW_Y },
{"main_window_height", CV_TYPE_INT, &MAIN_WINDOW_HEIGHT },
@@ -126,86 +119,40 @@ tConfigVariable Config_Variables[] =
{"pane_handle_position2", CV_TYPE_INT, &PANE_HANDLE_POSITION2 },
{"pane_handle_position3", CV_TYPE_INT, &PANE_HANDLE_POSITION3 },
{"pane_handle_position4", CV_TYPE_INT, &PANE_HANDLE_POSITION4 },
- {"show_header_infos", CV_TYPE_BOOL, &SHOW_HEADER_INFO },
- {"changed_files_displayed_to_red", CV_TYPE_BOOL, &CHANGED_FILES_DISPLAYED_TO_RED },
- {"changed_files_displayed_to_bold", CV_TYPE_BOOL, &CHANGED_FILES_DISPLAYED_TO_BOLD },
-
- {"date_auto_completion", CV_TYPE_BOOL, &DATE_AUTO_COMPLETION },
- {"number_track_formated", CV_TYPE_BOOL, &NUMBER_TRACK_FORMATED },
- {"number_track_formated_spin_button", CV_TYPE_INT, &NUMBER_TRACK_FORMATED_SPIN_BUTTON },
- {"set_focus_to_same_tag_field", CV_TYPE_BOOL, &SET_FOCUS_TO_SAME_TAG_FIELD },
- {"set_focus_to_first_tag_field", CV_TYPE_BOOL, &SET_FOCUS_TO_FIRST_TAG_FIELD },
+
{"sorting_file_mode", CV_TYPE_INT, &SORTING_FILE_MODE },
{"sorting_file_case_sensitive", CV_TYPE_BOOL, &SORTING_FILE_CASE_SENSITIVE },
- {"log_max_lines", CV_TYPE_INT, &LOG_MAX_LINES },
- {"sho_log_view", CV_TYPE_BOOL, &SHOW_LOG_VIEW },
- {"replace_illegal_character_in_filename", CV_TYPE_BOOL,
&REPLACE_ILLEGAL_CHARACTERS_IN_FILENAME },
{"filename_extension_lower_case", CV_TYPE_BOOL, &FILENAME_EXTENSION_LOWER_CASE
},
{"filename_extension_upper_case", CV_TYPE_BOOL, &FILENAME_EXTENSION_UPPER_CASE
},
{"filename_extension_no_change", CV_TYPE_BOOL, &FILENAME_EXTENSION_NO_CHANGE
},
- {"preserve_modification_time", CV_TYPE_BOOL, &PRESERVE_MODIFICATION_TIME
},
- {"update_parent_directory_modification_time", CV_TYPE_BOOL,
&UPDATE_PARENT_DIRECTORY_MODIFICATION_TIME},
{"filename_character_set_other", CV_TYPE_BOOL, &FILENAME_CHARACTER_SET_OTHER
},
{"filename_character_set_approximate", CV_TYPE_BOOL, &FILENAME_CHARACTER_SET_APPROXIMATE
},
{"filename_character_set_discard", CV_TYPE_BOOL, &FILENAME_CHARACTER_SET_DISCARD
},
- {"write_id3_tags_in_flac_file", CV_TYPE_BOOL, &WRITE_ID3_TAGS_IN_FLAC_FILE
},
- {"strip_tag_when_empty_fields", CV_TYPE_BOOL, &STRIP_TAG_WHEN_EMPTY_FIELDS
},
- {"convert_old_id3v2_tag_version", CV_TYPE_BOOL, &CONVERT_OLD_ID3V2_TAG_VERSION
},
- {"use_non_standard_id3_reading_character_set", CV_TYPE_BOOL,
&USE_NON_STANDARD_ID3_READING_CHARACTER_SET},
{"file_reading_id3v1v2_character_set", CV_TYPE_STRING,&FILE_READING_ID3V1V2_CHARACTER_SET},
- {"file_writing_id3v2_write_tag", CV_TYPE_BOOL, &FILE_WRITING_ID3V2_WRITE_TAG },
{"file_writing_id3v2_version_4", CV_TYPE_BOOL, &FILE_WRITING_ID3V2_VERSION_4 },
- {"file_writing_id3v2_use_crc32", CV_TYPE_BOOL, &FILE_WRITING_ID3V2_USE_CRC32 },
- {"file_writing_id3v2_use_compression", CV_TYPE_BOOL, &FILE_WRITING_ID3V2_USE_COMPRESSION
},
- {"file_writing_id3v2_use_unicode_character_set", CV_TYPE_BOOL,
&FILE_WRITING_ID3V2_USE_UNICODE_CHARACTER_SET},
{"file_writing_id3v2_unicode_character_set",
CV_TYPE_STRING,&FILE_WRITING_ID3V2_UNICODE_CHARACTER_SET},
{"file_writing_id3v2_no_unicode_character_set",
CV_TYPE_STRING,&FILE_WRITING_ID3V2_NO_UNICODE_CHARACTER_SET},
{"file_writing_id3v2_iconv_options_no", CV_TYPE_BOOL, &FILE_WRITING_ID3V2_ICONV_OPTIONS_NO},
{"file_writing_id3v2_iconv_options_translit", CV_TYPE_BOOL,
&FILE_WRITING_ID3V2_ICONV_OPTIONS_TRANSLIT},
{"file_writing_id3v2_iconv_options_ignore", CV_TYPE_BOOL,
&FILE_WRITING_ID3V2_ICONV_OPTIONS_IGNORE},
- {"file_writing_id3v2_text_only_genre", CV_TYPE_BOOL, &FILE_WRITING_ID3V2_TEXT_ONLY_GENRE},
- {"file_writing_id3v1_write_tag", CV_TYPE_BOOL, &FILE_WRITING_ID3V1_WRITE_TAG },
{"file_writing_id3v1_character_set", CV_TYPE_STRING,&FILE_WRITING_ID3V1_CHARACTER_SET},
{"file_writing_id3v1_iconv_options_no", CV_TYPE_BOOL, &FILE_WRITING_ID3V1_ICONV_OPTIONS_NO},
{"file_writing_id3v1_iconv_options_translit", CV_TYPE_BOOL,
&FILE_WRITING_ID3V1_ICONV_OPTIONS_TRANSLIT},
{"file_writing_id3v1_iconv_options_ignore", CV_TYPE_BOOL,
&FILE_WRITING_ID3V1_ICONV_OPTIONS_IGNORE},
- {"vorbis_split_field_title", CV_TYPE_BOOL, &VORBIS_SPLIT_FIELD_TITLE},
- {"vorbis_split_field_artist", CV_TYPE_BOOL, &VORBIS_SPLIT_FIELD_ARTIST},
- {"vorbis_split_field_album", CV_TYPE_BOOL, &VORBIS_SPLIT_FIELD_ALBUM},
- {"vorbis_split_field_genre", CV_TYPE_BOOL, &VORBIS_SPLIT_FIELD_GENRE},
- {"vorbis_split_field_comment", CV_TYPE_BOOL, &VORBIS_SPLIT_FIELD_COMMENT},
- {"vorbis_split_field_composer", CV_TYPE_BOOL, &VORBIS_SPLIT_FIELD_COMPOSER},
- {"vorbis_split_field_orig_artist", CV_TYPE_BOOL, &VORBIS_SPLIT_FIELD_ORIG_ARTIST},
{"audio_file_player", CV_TYPE_STRING,&AUDIO_FILE_PLAYER },
{"scanner_type", CV_TYPE_INT, &SCANNER_TYPE },
- {"scan_mask_editor_button", CV_TYPE_BOOL,&SCAN_MASK_EDITOR_BUTTON },
- {"scan_legend_button", CV_TYPE_BOOL,&SCAN_LEGEND_BUTTON },
{"fts_convert_underscore_and_p20_into_space",CV_TYPE_BOOL,&FTS_CONVERT_UNDERSCORE_AND_P20_INTO_SPACE },
{"fts_convert_space_into_underscore", CV_TYPE_BOOL,&FTS_CONVERT_SPACE_INTO_UNDERSCORE },
{"rfs_convert_underscore_and_p20_into_space",CV_TYPE_BOOL,&RFS_CONVERT_UNDERSCORE_AND_P20_INTO_SPACE },
{"rfs_convert_space_into_underscore", CV_TYPE_BOOL,&RFS_CONVERT_SPACE_INTO_UNDERSCORE },
{"rfs_remove_spaces", CV_TYPE_BOOL,&RFS_REMOVE_SPACES },
- {"pfs_dont_upper_some_words", CV_TYPE_BOOL,&PFS_DONT_UPPER_SOME_WORDS },
- {"overwrite_tag_field", CV_TYPE_BOOL, &OVERWRITE_TAG_FIELD },
- {"set_default_comment", CV_TYPE_BOOL, &SET_DEFAULT_COMMENT },
- {"default_comment", CV_TYPE_STRING, &DEFAULT_COMMENT },
- {"crc32_comment", CV_TYPE_BOOL, &SET_CRC32_COMMENT },
- {"open_scanner_window_on_startup", CV_TYPE_BOOL, &OPEN_SCANNER_WINDOW_ON_STARTUP },
- {"set_scanner_window_position", CV_TYPE_BOOL, &SET_SCANNER_WINDOW_POSITION },
{"scanner_window_x", CV_TYPE_INT, &SCANNER_WINDOW_X },
{"scanner_window_y", CV_TYPE_INT, &SCANNER_WINDOW_Y },
- {"confirm_before_exit", CV_TYPE_BOOL, &CONFIRM_BEFORE_EXIT },
- {"confirm_write_tag", CV_TYPE_BOOL, &CONFIRM_WRITE_TAG },
- {"confirm_rename_file", CV_TYPE_BOOL, &CONFIRM_RENAME_FILE },
- {"confirm_write_playlist", CV_TYPE_BOOL, &CONFIRM_WRITE_PLAYLIST },
- {"confirm_delete_file", CV_TYPE_BOOL, &CONFIRM_DELETE_FILE },
- {"confirm_when_unsaved_files", CV_TYPE_BOOL, &CONFIRM_WHEN_UNSAVED_FILES },
-
{"process_filename_field", CV_TYPE_BOOL, &PROCESS_FILENAME_FIELD },
{"process_title_field", CV_TYPE_BOOL, &PROCESS_TITLE_FIELD },
{"process_artist_field", CV_TYPE_BOOL, &PROCESS_ARTIST_FIELD },
@@ -218,29 +165,11 @@ tConfigVariable Config_Variables[] =
{"process_copyright_field", CV_TYPE_BOOL, &PROCESS_COPYRIGHT_FIELD },
{"process_url_field", CV_TYPE_BOOL, &PROCESS_URL_FIELD },
{"process_encoded_by_field", CV_TYPE_BOOL, &PROCESS_ENCODED_BY_FIELD },
- {"process_fields_convert_from", CV_TYPE_STRING, &PROCESS_FIELDS_CONVERT_FROM },
- {"process_fields_convert_to", CV_TYPE_STRING, &PROCESS_FIELDS_CONVERT_TO },
{"pf_convert_into_space", CV_TYPE_BOOL, &PF_CONVERT_INTO_SPACE },
{"pf_convert_space", CV_TYPE_BOOL, &PF_CONVERT_SPACE },
- {"pf_convert", CV_TYPE_BOOL, &PF_CONVERT },
- {"pf_convert_all_uppercase", CV_TYPE_BOOL, &PF_CONVERT_ALL_UPPERCASE },
- {"pf_convert_all_downcase", CV_TYPE_BOOL, &PF_CONVERT_ALL_DOWNCASE },
- {"pf_convert_first_letter_uppercase", CV_TYPE_BOOL, &PF_CONVERT_FIRST_LETTER_UPPERCASE },
- {"pf_convert_first_letters_uppercase", CV_TYPE_BOOL, &PF_CONVERT_FIRST_LETTERS_UPPERCASE },
- {"pf_detect_roman_numerals", CV_TYPE_BOOL, &PF_DETECT_ROMAN_NUMERALS },
- {"pf_remove_space", CV_TYPE_BOOL, &PF_REMOVE_SPACE },
- {"pf_insert_space", CV_TYPE_BOOL, &PF_INSERT_SPACE },
- {"pf_only_one_space", CV_TYPE_BOOL, &PF_ONLY_ONE_SPACE },
{"playlist_name", CV_TYPE_STRING, &PLAYLIST_NAME },
- {"playlist_use_mask_name", CV_TYPE_BOOL, &PLAYLIST_USE_MASK_NAME },
- {"playlist_use_dir_name", CV_TYPE_BOOL, &PLAYLIST_USE_DIR_NAME },
- {"playlist_only_selected_files", CV_TYPE_BOOL, &PLAYLIST_ONLY_SELECTED_FILES },
- {"playlist_full_path", CV_TYPE_BOOL, &PLAYLIST_FULL_PATH },
- {"playlist_relative_path", CV_TYPE_BOOL, &PLAYLIST_RELATIVE_PATH },
- {"playlist_create_in_parent_dir", CV_TYPE_BOOL, &PLAYLIST_CREATE_IN_PARENT_DIR },
- {"playlist_use_dos_separator", CV_TYPE_BOOL, &PLAYLIST_USE_DOS_SEPARATOR },
{"playlist_content_none", CV_TYPE_BOOL, &PLAYLIST_CONTENT_NONE },
{"playlist_content_filename", CV_TYPE_BOOL, &PLAYLIST_CONTENT_FILENAME },
{"playlist_content_mask", CV_TYPE_BOOL, &PLAYLIST_CONTENT_MASK },
@@ -250,46 +179,23 @@ tConfigVariable Config_Variables[] =
{"playlist_window_width", CV_TYPE_INT, &PLAYLIST_WINDOW_WIDTH },
{"playlist_window_height", CV_TYPE_INT, &PLAYLIST_WINDOW_HEIGHT },
- {"load_file_run_scanner", CV_TYPE_BOOL, &LOAD_FILE_RUN_SCANNER },
{"load_file_window_x", CV_TYPE_INT, &LOAD_FILE_WINDOW_X },
{"load_file_window_y", CV_TYPE_INT, &LOAD_FILE_WINDOW_Y },
{"load_file_window_width", CV_TYPE_INT, &LOAD_FILE_WINDOW_WIDTH },
{"load_file_window_height", CV_TYPE_INT, &LOAD_FILE_WINDOW_HEIGHT },
- {"cddb_server_name_automatic_search", CV_TYPE_STRING, &CDDB_SERVER_NAME_AUTOMATIC_SEARCH },
- {"cddb_server_port_automatic_search", CV_TYPE_INT, &CDDB_SERVER_PORT_AUTOMATIC_SEARCH },
- {"cddb_server_cgi_path_automatic_search", CV_TYPE_STRING, &CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH },
- {"cddb_server_name_automatic_search2", CV_TYPE_STRING, &CDDB_SERVER_NAME_AUTOMATIC_SEARCH2 },
- {"cddb_server_port_automatic_search2", CV_TYPE_INT, &CDDB_SERVER_PORT_AUTOMATIC_SEARCH2 },
- {"cddb_server_cgi_path_automatic_search2", CV_TYPE_STRING, &CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH2 },
- {"cddb_server_name_manual_search", CV_TYPE_STRING, &CDDB_SERVER_NAME_MANUAL_SEARCH },
- {"cddb_server_port_manual_search", CV_TYPE_INT, &CDDB_SERVER_PORT_MANUAL_SEARCH },
- {"cddb_server_cgi_path_manual_search", CV_TYPE_STRING, &CDDB_SERVER_CGI_PATH_MANUAL_SEARCH },
{"cddb_local_path", CV_TYPE_STRING, &CDDB_LOCAL_PATH },
- {"cddb_use_proxy", CV_TYPE_INT, &CDDB_USE_PROXY },
- {"cddb_proxy_name", CV_TYPE_STRING, &CDDB_PROXY_NAME },
- {"cddb_proxy_port", CV_TYPE_INT, &CDDB_PROXY_PORT },
- {"cddb_proxy_user_name", CV_TYPE_STRING, &CDDB_PROXY_USER_NAME },
- {"cddb_proxy_user_password", CV_TYPE_STRING, &CDDB_PROXY_USER_PASSWORD },
- {"set_cddb_window_position", CV_TYPE_BOOL, &SET_CDDB_WINDOW_POSITION },
{"cddb_window_x", CV_TYPE_INT, &CDDB_WINDOW_X },
{"cddb_window_y", CV_TYPE_INT, &CDDB_WINDOW_Y },
{"cddb_window_height", CV_TYPE_INT, &CDDB_WINDOW_HEIGHT },
{"cddb_window_width", CV_TYPE_INT, &CDDB_WINDOW_WIDTH },
{"cddb_pane_handle_position", CV_TYPE_INT, &CDDB_PANE_HANDLE_POSITION },
- {"cddb_follow_file", CV_TYPE_BOOL, &CDDB_FOLLOW_FILE },
- {"cddb_use_dlm", CV_TYPE_BOOL, &CDDB_USE_DLM },
- {"cddb_use_local_access", CV_TYPE_BOOL, &CDDB_USE_LOCAL_ACCESS },
-
- {"cddb_search_in_all_fields", CV_TYPE_BOOL, &CDDB_SEARCH_IN_ALL_FIELDS },
{"cddb_search_in_artist_field", CV_TYPE_BOOL, &CDDB_SEARCH_IN_ARTIST_FIELD },
{"cddb_search_in_title_field", CV_TYPE_BOOL, &CDDB_SEARCH_IN_TITLE_FIELD },
{"cddb_search_in_track_name_field", CV_TYPE_BOOL, &CDDB_SEARCH_IN_TRACK_NAME_FIELD },
{"cddb_search_in_other_field", CV_TYPE_BOOL, &CDDB_SEARCH_IN_OTHER_FIELD },
- {"cddb_show_categories", CV_TYPE_BOOL, &CDDB_SHOW_CATEGORIES },
- {"cddb_search_in_all_categories", CV_TYPE_BOOL, &CDDB_SEARCH_IN_ALL_CATEGORIES },
{"cddb_search_in_blues_categories", CV_TYPE_BOOL, &CDDB_SEARCH_IN_BLUES_CATEGORY },
{"cddb_search_in_classical_categories", CV_TYPE_BOOL, &CDDB_SEARCH_IN_CLASSICAL_CATEGORY },
{"cddb_search_in_country_categories", CV_TYPE_BOOL, &CDDB_SEARCH_IN_COUNTRY_CATEGORY },
@@ -311,23 +217,15 @@ tConfigVariable Config_Variables[] =
{"cddb_set_to_genre", CV_TYPE_BOOL, &CDDB_SET_TO_GENRE },
{"cddb_set_to_file_name", CV_TYPE_BOOL, &CDDB_SET_TO_FILE_NAME },
- {"cddb_run_scanner", CV_TYPE_BOOL, &CDDB_RUN_SCANNER },
-
- {"set_search_window_position", CV_TYPE_BOOL, &SET_SEARCH_WINDOW_POSITION },
{"search_window_x", CV_TYPE_INT, &SEARCH_WINDOW_X },
{"search_window_y", CV_TYPE_INT, &SEARCH_WINDOW_Y },
{"search_window_height", CV_TYPE_INT, &SEARCH_WINDOW_HEIGHT },
{"search_window_width", CV_TYPE_INT, &SEARCH_WINDOW_WIDTH },
- {"search_in_filename", CV_TYPE_BOOL, &SEARCH_IN_FILENAME },
- {"search_in_tag", CV_TYPE_BOOL, &SEARCH_IN_TAG },
- {"search_case_sensitive", CV_TYPE_BOOL, &SEARCH_CASE_SENSITIVE },
{"scan_tag_default_mask", CV_TYPE_STRING, &SCAN_TAG_DEFAULT_MASK },
{"rename_file_default_mask", CV_TYPE_STRING, &RENAME_FILE_DEFAULT_MASK },
{"rename_directory_default_mask", CV_TYPE_STRING, &RENAME_DIRECTORY_DEFAULT_MASK },
- {"rename_directory_with_mask", CV_TYPE_BOOL, &RENAME_DIRECTORY_WITH_MASK },
- {"options_notebook_page", CV_TYPE_INT, &OPTIONS_NOTEBOOK_PAGE },
{"options_window_height", CV_TYPE_INT, &OPTIONS_WINDOW_HEIGHT },
{"options_window_width", CV_TYPE_INT, &OPTIONS_WINDOW_WIDTH }
@@ -347,17 +245,10 @@ void Init_Config_Variables (void)
{
const gchar *music_dir;
+ ETSettings = g_settings_new ("org.gnome.EasyTAG");
/*
* Common
*/
- LOAD_ON_STARTUP = 0;
- BROWSE_SUBDIR = 1;
-#ifdef G_OS_WIN32
- BROWSE_HIDDEN_DIR = 1;
-#else /* !G_OS_WIN32 */
- BROWSE_HIDDEN_DIR = 0;
-#endif /* !G_OS_WIN32 */
- OPEN_SELECTED_BROWSER_NODE = 1;
music_dir = g_get_user_special_dir (G_USER_DIRECTORY_MUSIC);
DEFAULT_PATH_TO_MP3 = music_dir ? g_strdup (music_dir)
@@ -366,7 +257,6 @@ void Init_Config_Variables (void)
/*
* Misc
*/
- SET_MAIN_WINDOW_POSITION = 1; // Set it to '0' if problem with some Windows Manager
MAIN_WINDOW_X = -1; // '-1' lets the Windows Manager to place the window
MAIN_WINDOW_Y = -1;
MAIN_WINDOW_WIDTH = 1040;
@@ -375,23 +265,13 @@ void Init_Config_Variables (void)
PANE_HANDLE_POSITION2 = 360;
PANE_HANDLE_POSITION3 = 300;
PANE_HANDLE_POSITION4 = 300;
- SHOW_HEADER_INFO = 1;
- CHANGED_FILES_DISPLAYED_TO_RED = 1;
- CHANGED_FILES_DISPLAYED_TO_BOLD = 0;
-
- DATE_AUTO_COMPLETION = 1;
- NUMBER_TRACK_FORMATED = 1;
- NUMBER_TRACK_FORMATED_SPIN_BUTTON = 2;
- SET_FOCUS_TO_SAME_TAG_FIELD = 1;
- SET_FOCUS_TO_FIRST_TAG_FIELD = 0;
+
SORTING_FILE_MODE = SORTING_BY_ASCENDING_FILENAME;
#ifdef G_OS_WIN32
SORTING_FILE_CASE_SENSITIVE = 1;
#else /* !G_OS_WIN32 */
SORTING_FILE_CASE_SENSITIVE = 0;
#endif /* !G_OS_WIN32 */
- LOG_MAX_LINES = 50;
- SHOW_LOG_VIEW = 1;
#ifdef G_OS_WIN32
AUDIO_FILE_PLAYER = ET_Win32_Get_Audio_File_Player();
@@ -402,12 +282,9 @@ void Init_Config_Variables (void)
/*
* File Settings
*/
- REPLACE_ILLEGAL_CHARACTERS_IN_FILENAME = 1;
FILENAME_EXTENSION_LOWER_CASE = 1;
FILENAME_EXTENSION_UPPER_CASE = 0;
FILENAME_EXTENSION_NO_CHANGE = 0;
- PRESERVE_MODIFICATION_TIME = 1;
- UPDATE_PARENT_DIRECTORY_MODIFICATION_TIME = 0;
FILENAME_CHARACTER_SET_OTHER = 1;
FILENAME_CHARACTER_SET_APPROXIMATE = 0;
@@ -416,20 +293,12 @@ void Init_Config_Variables (void)
/*
* Tag Settings
*/
- WRITE_ID3_TAGS_IN_FLAC_FILE = 0;
- STRIP_TAG_WHEN_EMPTY_FIELDS = 1;
- CONVERT_OLD_ID3V2_TAG_VERSION = 1;
- USE_NON_STANDARD_ID3_READING_CHARACTER_SET = 0;
FILE_READING_ID3V1V2_CHARACTER_SET = g_strdup("UTF-8");
- FILE_WRITING_ID3V2_WRITE_TAG = 1;
#ifdef G_OS_WIN32
FILE_WRITING_ID3V2_VERSION_4 = 0;
#else /* !G_OS_WIN32 */
FILE_WRITING_ID3V2_VERSION_4 = 1;
#endif /* !G_OS_WIN32 */
- FILE_WRITING_ID3V2_USE_CRC32 = 0;
- FILE_WRITING_ID3V2_USE_COMPRESSION = 0;
- FILE_WRITING_ID3V2_USE_UNICODE_CHARACTER_SET = 1;
#ifdef G_OS_WIN32
FILE_WRITING_ID3V2_UNICODE_CHARACTER_SET = g_strdup("UTF-16");
#else /* !G_OS_WIN32 */
@@ -439,49 +308,22 @@ void Init_Config_Variables (void)
FILE_WRITING_ID3V2_ICONV_OPTIONS_NO = 1;
FILE_WRITING_ID3V2_ICONV_OPTIONS_TRANSLIT = 0;
FILE_WRITING_ID3V2_ICONV_OPTIONS_IGNORE = 0;
- FILE_WRITING_ID3V1_WRITE_TAG = 1;
FILE_WRITING_ID3V1_CHARACTER_SET = g_strdup("ISO-8859-1");
FILE_WRITING_ID3V1_ICONV_OPTIONS_NO = 0;
FILE_WRITING_ID3V1_ICONV_OPTIONS_TRANSLIT = 1;
FILE_WRITING_ID3V1_ICONV_OPTIONS_IGNORE = 0;
- VORBIS_SPLIT_FIELD_TITLE = 1;
- VORBIS_SPLIT_FIELD_ARTIST = 1;
- VORBIS_SPLIT_FIELD_ALBUM = 1;
- VORBIS_SPLIT_FIELD_GENRE = 1;
- VORBIS_SPLIT_FIELD_COMMENT = 1;
- VORBIS_SPLIT_FIELD_COMPOSER = 1;
- VORBIS_SPLIT_FIELD_ORIG_ARTIST = 1;
/*
* Scanner
*/
SCANNER_TYPE = SCANNER_FILL_TAG;
- SCAN_MASK_EDITOR_BUTTON = 0;
- SCAN_LEGEND_BUTTON = 0;
FTS_CONVERT_UNDERSCORE_AND_P20_INTO_SPACE = 1;
FTS_CONVERT_SPACE_INTO_UNDERSCORE = 0;
RFS_CONVERT_UNDERSCORE_AND_P20_INTO_SPACE = 1;
- RFS_CONVERT_SPACE_INTO_UNDERSCORE = 0;
- PFS_DONT_UPPER_SOME_WORDS = 0;
- OVERWRITE_TAG_FIELD = 1;
- SET_DEFAULT_COMMENT = 0;
- DEFAULT_COMMENT = g_strdup("Tagged with EasyTAG");
- SET_CRC32_COMMENT = 0;
- OPEN_SCANNER_WINDOW_ON_STARTUP = 0;
- SET_SCANNER_WINDOW_POSITION = 1; // Set it to '0' if problem with some Windows Manager
SCANNER_WINDOW_X = -1;
SCANNER_WINDOW_Y = -1;
/*
- * Confirmation
- */
- CONFIRM_BEFORE_EXIT = 1;
- CONFIRM_WRITE_TAG = 1;
- CONFIRM_RENAME_FILE = 1;
- CONFIRM_DELETE_FILE = 1;
- CONFIRM_WRITE_PLAYLIST = 1;
-
- /*
* Scanner window
*/
PROCESS_FILENAME_FIELD = 0;
@@ -497,32 +339,13 @@ void Init_Config_Variables (void)
PROCESS_URL_FIELD = 1;
PROCESS_ENCODED_BY_FIELD = 1;
- PROCESS_FIELDS_CONVERT_FROM = NULL;
- PROCESS_FIELDS_CONVERT_TO = NULL;
-
PF_CONVERT_INTO_SPACE = 1;
PF_CONVERT_SPACE = 0;
- PF_CONVERT = 0;
- PF_CONVERT_ALL_UPPERCASE = 0;
- PF_CONVERT_ALL_DOWNCASE = 0;
- PF_CONVERT_FIRST_LETTER_UPPERCASE = 0;
- PF_CONVERT_FIRST_LETTERS_UPPERCASE = 1;
- PF_DETECT_ROMAN_NUMERALS = 1;
- PF_REMOVE_SPACE = 0;
- PF_INSERT_SPACE = 0;
- PF_ONLY_ONE_SPACE = 1;
/*
* Playlist window
*/
PLAYLIST_NAME = g_strdup("playlist_%a_-_%b");
- PLAYLIST_USE_MASK_NAME = 0;
- PLAYLIST_USE_DIR_NAME = 1;
- PLAYLIST_ONLY_SELECTED_FILES = 1;
- PLAYLIST_FULL_PATH = 0;
- PLAYLIST_RELATIVE_PATH = 1;
- PLAYLIST_CREATE_IN_PARENT_DIR = 0;
- PLAYLIST_USE_DOS_SEPARATOR = 0;
PLAYLIST_CONTENT_NONE = 0;
PLAYLIST_CONTENT_FILENAME = 1;
PLAYLIST_CONTENT_MASK = 0;
@@ -536,7 +359,6 @@ void Init_Config_Variables (void)
/*
* Load File window
*/
- LOAD_FILE_RUN_SCANNER = 0;
LOAD_FILE_WINDOW_X = -1;
LOAD_FILE_WINDOW_Y = -1;
LOAD_FILE_WINDOW_WIDTH = -1;
@@ -545,41 +367,19 @@ void Init_Config_Variables (void)
/*
* CDDB window
*/
- CDDB_SERVER_NAME_AUTOMATIC_SEARCH = g_strdup("freedb.freedb.org");
- CDDB_SERVER_PORT_AUTOMATIC_SEARCH = 80;
- CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH = g_strdup("/~cddb/cddb.cgi");
- CDDB_SERVER_NAME_AUTOMATIC_SEARCH2 = g_strdup("freedb.musicbrainz.org");
- CDDB_SERVER_PORT_AUTOMATIC_SEARCH2 = 80;
- CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH2 = g_strdup("/~cddb/cddb.cgi");
- CDDB_SERVER_NAME_MANUAL_SEARCH = g_strdup("www.gnudb.org");
- CDDB_SERVER_PORT_MANUAL_SEARCH = 80;
- CDDB_SERVER_CGI_PATH_MANUAL_SEARCH = g_strdup("/~cddb/cddb.cgi");
CDDB_LOCAL_PATH = NULL;
- CDDB_USE_PROXY = 0;
- CDDB_PROXY_NAME = g_strdup("localhost");
- CDDB_PROXY_PORT = 8080;
- CDDB_PROXY_USER_NAME = NULL;
- CDDB_PROXY_USER_PASSWORD = NULL;
- SET_CDDB_WINDOW_POSITION = 1; // Set it to '0' if problem with some Windows Manager
CDDB_WINDOW_X = -1;
CDDB_WINDOW_Y = -1;
CDDB_WINDOW_WIDTH = 660;
CDDB_WINDOW_HEIGHT = 470;
CDDB_PANE_HANDLE_POSITION = 350;
- CDDB_FOLLOW_FILE = 1;
- CDDB_USE_DLM = 0;
- CDDB_USE_LOCAL_ACCESS = 0;
-
- CDDB_SEARCH_IN_ALL_FIELDS = 0;
CDDB_SEARCH_IN_ARTIST_FIELD = 1;
CDDB_SEARCH_IN_TITLE_FIELD = 1;
CDDB_SEARCH_IN_TRACK_NAME_FIELD = 0;
CDDB_SEARCH_IN_OTHER_FIELD = 0;
- CDDB_SHOW_CATEGORIES = 0;
- CDDB_SEARCH_IN_ALL_CATEGORIES = 1;
CDDB_SEARCH_IN_BLUES_CATEGORY = 0;
CDDB_SEARCH_IN_CLASSICAL_CATEGORY = 0;
CDDB_SEARCH_IN_COUNTRY_CATEGORY = 0;
@@ -601,19 +401,13 @@ void Init_Config_Variables (void)
CDDB_SET_TO_GENRE = 0;
CDDB_SET_TO_FILE_NAME = 1;
- CDDB_RUN_SCANNER = 0;
-
/*
* Search window
*/
- SET_SEARCH_WINDOW_POSITION = 1; // Set it to '0' if problem with some Windows Manager
SEARCH_WINDOW_X = -1;
SEARCH_WINDOW_Y = -1;
SEARCH_WINDOW_HEIGHT = 350;
SEARCH_WINDOW_WIDTH = 650;
- SEARCH_IN_FILENAME = 1;
- SEARCH_IN_TAG = 1;
- SEARCH_CASE_SENSITIVE = 0;
/*
* Masks
@@ -621,12 +415,10 @@ void Init_Config_Variables (void)
SCAN_TAG_DEFAULT_MASK = NULL;
RENAME_FILE_DEFAULT_MASK = NULL;
RENAME_DIRECTORY_DEFAULT_MASK = NULL;
- RENAME_DIRECTORY_WITH_MASK = 0;
/*
* Other parameters
*/
- OPTIONS_NOTEBOOK_PAGE = 0;
OPTIONS_WINDOW_HEIGHT = 300;
OPTIONS_WINDOW_WIDTH = 400;
@@ -648,7 +440,6 @@ Apply_Changes_Of_Preferences_Window (void)
if (OptionsWindow)
{
/* Common */
- LOAD_ON_STARTUP = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(LoadOnStartup));
if (DEFAULT_PATH_TO_MP3) g_free(DEFAULT_PATH_TO_MP3);
DEFAULT_PATH_TO_MP3 =
g_strdup(gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(DefaultPathToMp3))))); // Saved in UTF-8
#if 0
@@ -656,29 +447,9 @@ Apply_Changes_Of_Preferences_Window (void)
ET_Win32_Path_Replace_Backslashes(DEFAULT_PATH_TO_MP3);
#endif /* G_OS_WIN32 */
#endif
- BROWSE_SUBDIR = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(BrowseSubdir));
- BROWSE_HIDDEN_DIR = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(BrowseHiddendir));
- OPEN_SELECTED_BROWSER_NODE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(OpenSelectedBrowserNode));
-
- /* User interface */
- SHOW_HEADER_INFO = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ShowHeaderInfos));
- // We reload the list if the selected style have changed
- if (CHANGED_FILES_DISPLAYED_TO_RED !=
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ChangedFilesDisplayedToRed)))
- {
- CHANGED_FILES_DISPLAYED_TO_RED =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ChangedFilesDisplayedToRed));
- CHANGED_FILES_DISPLAYED_TO_BOLD =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ChangedFilesDisplayedToBold));
- Browser_List_Refresh_Whole_List();
- }
/* Misc */
- DATE_AUTO_COMPLETION =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(DateAutoCompletion));
- NUMBER_TRACK_FORMATED =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(NumberTrackFormated));
- NUMBER_TRACK_FORMATED_SPIN_BUTTON =
gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(NumberTrackFormatedSpinButton));
SORTING_FILE_CASE_SENSITIVE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(SortingFileCaseSensitive));
- SET_FOCUS_TO_SAME_TAG_FIELD =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(SetFocusToSameTagField));
- SET_FOCUS_TO_FIRST_TAG_FIELD =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(SetFocusToFirstTagField));
- LOG_MAX_LINES =
gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(LogMaxLinesSpinButton));
- SHOW_LOG_VIEW =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ShowLogView));
SORTING_FILE_MODE = gtk_combo_box_get_active(GTK_COMBO_BOX(SortingFileCombo));
@@ -686,23 +457,15 @@ Apply_Changes_Of_Preferences_Window (void)
AUDIO_FILE_PLAYER =
g_strdup(gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(FilePlayerCombo)))));
/* File Settings */
- REPLACE_ILLEGAL_CHARACTERS_IN_FILENAME =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ReplaceIllegalCharactersInFilename));
FILENAME_EXTENSION_LOWER_CASE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FilenameExtensionLowerCase));
FILENAME_EXTENSION_UPPER_CASE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FilenameExtensionUpperCase));
FILENAME_EXTENSION_NO_CHANGE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FilenameExtensionNoChange));
- PRESERVE_MODIFICATION_TIME =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(PreserveModificationTime));
- UPDATE_PARENT_DIRECTORY_MODIFICATION_TIME =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(UpdateParentDirectoryModificationTime));
FILENAME_CHARACTER_SET_OTHER =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FilenameCharacterSetOther));
FILENAME_CHARACTER_SET_APPROXIMATE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FilenameCharacterSetApproximate));
FILENAME_CHARACTER_SET_DISCARD =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FilenameCharacterSetDiscard));
/* Tag Settings */
- WRITE_ID3_TAGS_IN_FLAC_FILE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(WriteId3TagsInFlacFiles));
- STRIP_TAG_WHEN_EMPTY_FIELDS =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(StripTagWhenEmptyFields));
- CONVERT_OLD_ID3V2_TAG_VERSION =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ConvertOldId3v2TagVersion));
- USE_NON_STANDARD_ID3_READING_CHARACTER_SET =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(UseNonStandardId3ReadingCharacterSet));
-
#ifdef ENABLE_ID3LIB
active = gtk_combo_box_get_active(GTK_COMBO_BOX(FileWritingId3v2VersionCombo));
FILE_WRITING_ID3V2_VERSION_4 = !active;
@@ -713,12 +476,6 @@ Apply_Changes_Of_Preferences_Window (void)
FILE_READING_ID3V1V2_CHARACTER_SET = Charset_Get_Name_From_Title(temp);
g_free(temp);
- FILE_WRITING_ID3V2_WRITE_TAG =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FileWritingId3v2WriteTag));
- FILE_WRITING_ID3V2_USE_CRC32 =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FileWritingId3v2UseCrc32));
- FILE_WRITING_ID3V2_USE_COMPRESSION =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FileWritingId3v2UseCompression));
- FILE_WRITING_ID3V2_TEXT_ONLY_GENRE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FileWritingId3v2TextOnlyGenre));
- FILE_WRITING_ID3V2_USE_UNICODE_CHARACTER_SET =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FileWritingId3v2UseUnicodeCharacterSet));
-
active = gtk_combo_box_get_active(GTK_COMBO_BOX(FileWritingId3v2UnicodeCharacterSetCombo));
FILE_WRITING_ID3V2_UNICODE_CHARACTER_SET = (active == 1) ? "UTF-16" : "UTF-8";
@@ -730,7 +487,6 @@ Apply_Changes_Of_Preferences_Window (void)
FILE_WRITING_ID3V2_ICONV_OPTIONS_TRANSLIT =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FileWritingId3v2IconvOptionsTranslit));
FILE_WRITING_ID3V2_ICONV_OPTIONS_IGNORE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FileWritingId3v2IconvOptionsIgnore));
- FILE_WRITING_ID3V1_WRITE_TAG =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FileWritingId3v1WriteTag));
temp = Get_Active_Combo_Box_Item(GTK_COMBO_BOX(FileWritingId3v1CharacterSetCombo));
FILE_WRITING_ID3V1_CHARACTER_SET = Charset_Get_Name_From_Title(temp);
g_free(temp);
@@ -739,14 +495,6 @@ Apply_Changes_Of_Preferences_Window (void)
FILE_WRITING_ID3V1_ICONV_OPTIONS_TRANSLIT =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FileWritingId3v1IconvOptionsTranslit));
FILE_WRITING_ID3V1_ICONV_OPTIONS_IGNORE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FileWritingId3v1IconvOptionsIgnore));
- VORBIS_SPLIT_FIELD_TITLE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(VorbisSplitFieldTitle));
- VORBIS_SPLIT_FIELD_ARTIST =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(VorbisSplitFieldArtist));
- VORBIS_SPLIT_FIELD_ALBUM =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(VorbisSplitFieldAlbum));
- VORBIS_SPLIT_FIELD_GENRE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(VorbisSplitFieldGenre));
- VORBIS_SPLIT_FIELD_COMMENT =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(VorbisSplitFieldComment));
- VORBIS_SPLIT_FIELD_COMPOSER =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(VorbisSplitFieldComposer));
- VORBIS_SPLIT_FIELD_ORIG_ARTIST =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(VorbisSplitFieldOrigArtist));
-
/* Scanner */
// Fill Tag Scanner
FTS_CONVERT_UNDERSCORE_AND_P20_INTO_SPACE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(FTSConvertUnderscoreAndP20IntoSpace));
@@ -755,59 +503,11 @@ Apply_Changes_Of_Preferences_Window (void)
RFS_CONVERT_UNDERSCORE_AND_P20_INTO_SPACE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(RFSConvertUnderscoreAndP20IntoSpace));
RFS_CONVERT_SPACE_INTO_UNDERSCORE =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(RFSConvertSpaceIntoUnderscore));
RFS_REMOVE_SPACES =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(RFSRemoveSpaces));
- // Process File Scanner
- PFS_DONT_UPPER_SOME_WORDS =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(PFSDontUpperSomeWords));
-
- OVERWRITE_TAG_FIELD = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(OverwriteTagField));
- SET_DEFAULT_COMMENT = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(SetDefaultComment));
- if (DEFAULT_COMMENT) g_free(DEFAULT_COMMENT);
- DEFAULT_COMMENT =
g_strdup(gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(DefaultComment)))));
- SET_CRC32_COMMENT = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(Crc32Comment));
-
- OPEN_SCANNER_WINDOW_ON_STARTUP =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(OpenScannerWindowOnStartup));
/* CDDB */
- if (CDDB_SERVER_NAME_AUTOMATIC_SEARCH) g_free(CDDB_SERVER_NAME_AUTOMATIC_SEARCH);
- CDDB_SERVER_NAME_AUTOMATIC_SEARCH =
g_strdup(gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(CddbServerNameAutomaticSearch)))));
- CDDB_SERVER_PORT_AUTOMATIC_SEARCH =
atoi(gtk_entry_get_text(GTK_ENTRY(CddbServerPortAutomaticSearch)));
- if (CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH) g_free(CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH);
- CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH =
g_strdup(gtk_entry_get_text(GTK_ENTRY(CddbServerCgiPathAutomaticSearch)));
-
- if (CDDB_SERVER_NAME_AUTOMATIC_SEARCH2) g_free(CDDB_SERVER_NAME_AUTOMATIC_SEARCH2);
- CDDB_SERVER_NAME_AUTOMATIC_SEARCH2 =
g_strdup(gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(CddbServerNameAutomaticSearch2)))));
- CDDB_SERVER_PORT_AUTOMATIC_SEARCH2 =
atoi(gtk_entry_get_text(GTK_ENTRY(CddbServerPortAutomaticSearch2)));
- if (CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH2) g_free(CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH2);
- CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH2 =
g_strdup(gtk_entry_get_text(GTK_ENTRY(CddbServerCgiPathAutomaticSearch2)));
-
- if (CDDB_SERVER_NAME_MANUAL_SEARCH) g_free(CDDB_SERVER_NAME_MANUAL_SEARCH);
- CDDB_SERVER_NAME_MANUAL_SEARCH =
g_strdup(gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(CddbServerNameManualSearch)))));
- CDDB_SERVER_PORT_MANUAL_SEARCH = atoi(gtk_entry_get_text(GTK_ENTRY(CddbServerPortManualSearch)));
- if (CDDB_SERVER_CGI_PATH_MANUAL_SEARCH) g_free(CDDB_SERVER_CGI_PATH_MANUAL_SEARCH);
- CDDB_SERVER_CGI_PATH_MANUAL_SEARCH =
g_strdup(gtk_entry_get_text(GTK_ENTRY(CddbServerCgiPathManualSearch)));
-
if (CDDB_LOCAL_PATH) g_free(CDDB_LOCAL_PATH);
CDDB_LOCAL_PATH = g_strdup(gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(CddbLocalPath)))));
- CDDB_USE_PROXY = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbUseProxy));
- if (CDDB_PROXY_NAME) g_free(CDDB_PROXY_NAME);
- CDDB_PROXY_NAME = g_strdup(gtk_entry_get_text(GTK_ENTRY(CddbProxyName)));
- CDDB_PROXY_PORT = atoi(gtk_entry_get_text(GTK_ENTRY(CddbProxyPort)));
- if (CDDB_PROXY_USER_NAME) g_free(CDDB_PROXY_USER_NAME);
- CDDB_PROXY_USER_NAME = g_strdup(gtk_entry_get_text(GTK_ENTRY(CddbProxyUserName)));
- if (CDDB_PROXY_USER_PASSWORD) g_free(CDDB_PROXY_USER_PASSWORD);
- CDDB_PROXY_USER_PASSWORD = g_strdup(gtk_entry_get_text(GTK_ENTRY(CddbProxyUserPassword)));
-
- CDDB_FOLLOW_FILE = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbFollowFile));
- CDDB_USE_DLM = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbUseDLM));
-
- /* Confirmation */
- CONFIRM_BEFORE_EXIT = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ConfirmBeforeExit));
- CONFIRM_WRITE_TAG = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ConfirmWriteTag));
- CONFIRM_RENAME_FILE = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ConfirmRenameFile));
- CONFIRM_DELETE_FILE = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ConfirmDeleteFile));
- CONFIRM_WRITE_PLAYLIST = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ConfirmWritePlayList));
- CONFIRM_WHEN_UNSAVED_FILES =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ConfirmWhenUnsavedFiles));
-
/* Parameters and variables of Scanner Window are in "scan.c" file */
/* Parameters and variables of Cddb Window are in "cddb.c" file */
}
@@ -815,28 +515,6 @@ Apply_Changes_Of_Preferences_Window (void)
/*
* Changes to apply to :
*/
- if (MainWindow)
- {
- if (SHOW_HEADER_INFO) gtk_widget_show_all(HeaderInfosTable);
- else gtk_widget_hide(HeaderInfosTable);
-
- if (SHOW_LOG_VIEW) gtk_widget_show_all(LogArea);
- else gtk_widget_hide(LogArea);
-
- /* Update state of check-menu-item into main/popup menu to browse subdirs */
- Check_Menu_Item_Update_Browse_Subdir();
-
- /* Update state of check-menu-item into main/popup menu to show hidden directories */
- Check_Menu_Item_Update_Browse_Hidden_Dir();
-
- /* Reload if number of character changed for track list */
- //Load_Track_List_To_UI();
-
- /* Reload directory, in case we have changed BROWSE_HIDDEN_DIR */
- // FIX ME : commented as it reloads files...
- //Browser_Tree_Rebuild(NULL);
- }
-
if (ScannerWindow)
{
gtk_window_set_transient_for (GTK_WINDOW (ScannerWindow),
diff --git a/src/setting.h b/src/setting.h
index e3ea138..4d99f81 100644
--- a/src/setting.h
+++ b/src/setting.h
@@ -46,20 +46,15 @@ struct _tConfigVariable
/*
- * Config varariables
+ * Config variables
*/
+GSettings *ETSettings;
+
/* Common */
-gint LOAD_ON_STARTUP;
gchar *DEFAULT_PATH_TO_MP3;
-gint BROWSER_LINE_STYLE;
-gint BROWSER_EXPANDER_STYLE;
-gint BROWSE_SUBDIR;
-gint BROWSE_HIDDEN_DIR;
-gint OPEN_SELECTED_BROWSER_NODE;
/* Misc */
-// User Interface
-gint SET_MAIN_WINDOW_POSITION;
+/* User Interface. */
gint MAIN_WINDOW_X;
gint MAIN_WINDOW_Y;
gint MAIN_WINDOW_HEIGHT;
@@ -68,10 +63,6 @@ gint PANE_HANDLE_POSITION1;
gint PANE_HANDLE_POSITION2;
gint PANE_HANDLE_POSITION3;
gint PANE_HANDLE_POSITION4;
-gint SHOW_HEADER_INFO;
-
-gint CHANGED_FILES_DISPLAYED_TO_RED;
-gint CHANGED_FILES_DISPLAYED_TO_BOLD;
gint SORTING_FILE_MODE;
gint SORTING_FILE_CASE_SENSITIVE;
@@ -79,87 +70,39 @@ gint SORTING_FILE_CASE_SENSITIVE;
gchar *AUDIO_FILE_PLAYER;
/* File Settings */
-gint REPLACE_ILLEGAL_CHARACTERS_IN_FILENAME;
gint FILENAME_EXTENSION_LOWER_CASE;
gint FILENAME_EXTENSION_UPPER_CASE;
gint FILENAME_EXTENSION_NO_CHANGE;
-gint PRESERVE_MODIFICATION_TIME;
-gint UPDATE_PARENT_DIRECTORY_MODIFICATION_TIME;
gint FILENAME_CHARACTER_SET_OTHER;
gint FILENAME_CHARACTER_SET_APPROXIMATE;
gint FILENAME_CHARACTER_SET_DISCARD;
/* Tag Settings */
-gint WRITE_ID3_TAGS_IN_FLAC_FILE;
-gint STRIP_TAG_WHEN_EMPTY_FIELDS;
-gint CONVERT_OLD_ID3V2_TAG_VERSION;
-
gint FILE_WRITING_ID3V2_VERSION_4;
-gint USE_NON_STANDARD_ID3_READING_CHARACTER_SET;
gchar *FILE_READING_ID3V1V2_CHARACTER_SET;
-gint FILE_WRITING_ID3V2_WRITE_TAG;
-gint FILE_WRITING_ID3V2_USE_CRC32;
-gint FILE_WRITING_ID3V2_USE_COMPRESSION;
-gint FILE_WRITING_ID3V2_TEXT_ONLY_GENRE;
-gint FILE_WRITING_ID3V2_USE_UNICODE_CHARACTER_SET;
gchar *FILE_WRITING_ID3V2_UNICODE_CHARACTER_SET;
gchar *FILE_WRITING_ID3V2_NO_UNICODE_CHARACTER_SET;
gint FILE_WRITING_ID3V2_ICONV_OPTIONS_NO;
gint FILE_WRITING_ID3V2_ICONV_OPTIONS_TRANSLIT;
gint FILE_WRITING_ID3V2_ICONV_OPTIONS_IGNORE;
-gint FILE_WRITING_ID3V1_WRITE_TAG;
gchar *FILE_WRITING_ID3V1_CHARACTER_SET;
gint FILE_WRITING_ID3V1_ICONV_OPTIONS_NO;
gint FILE_WRITING_ID3V1_ICONV_OPTIONS_TRANSLIT;
gint FILE_WRITING_ID3V1_ICONV_OPTIONS_IGNORE;
-gint VORBIS_SPLIT_FIELD_TITLE;
-gint VORBIS_SPLIT_FIELD_ARTIST;
-gint VORBIS_SPLIT_FIELD_ALBUM;
-gint VORBIS_SPLIT_FIELD_GENRE;
-gint VORBIS_SPLIT_FIELD_COMMENT;
-gint VORBIS_SPLIT_FIELD_COMPOSER;
-gint VORBIS_SPLIT_FIELD_ORIG_ARTIST;
-
-gint DATE_AUTO_COMPLETION;
-gint NUMBER_TRACK_FORMATED;
-gint NUMBER_TRACK_FORMATED_SPIN_BUTTON;
-gint SET_FOCUS_TO_SAME_TAG_FIELD;
-gint SET_FOCUS_TO_FIRST_TAG_FIELD;
-gint LOG_MAX_LINES;
-gint SHOW_LOG_VIEW;
-
-
/* Scanner */
gint SCANNER_TYPE;
-gint SCAN_MASK_EDITOR_BUTTON;
-gint SCAN_LEGEND_BUTTON;
gint FTS_CONVERT_UNDERSCORE_AND_P20_INTO_SPACE;
gint FTS_CONVERT_SPACE_INTO_UNDERSCORE;
gint RFS_CONVERT_UNDERSCORE_AND_P20_INTO_SPACE;
gint RFS_CONVERT_SPACE_INTO_UNDERSCORE;
gint RFS_REMOVE_SPACES;
-gint PFS_DONT_UPPER_SOME_WORDS;
-gint OVERWRITE_TAG_FIELD;
-gint SET_DEFAULT_COMMENT;
-gchar *DEFAULT_COMMENT;
-gint SET_CRC32_COMMENT;
-gint OPEN_SCANNER_WINDOW_ON_STARTUP;
-gint SET_SCANNER_WINDOW_POSITION;
gint SCANNER_WINDOW_X;
gint SCANNER_WINDOW_Y;
-/* Confirmation */
-gint CONFIRM_BEFORE_EXIT;
-gint CONFIRM_WRITE_TAG;
-gint CONFIRM_RENAME_FILE;
-gint CONFIRM_WRITE_PLAYLIST;
-gint CONFIRM_DELETE_FILE;
-gint CONFIRM_WHEN_UNSAVED_FILES;
-
/* Scanner window */
gint PROCESS_FILENAME_FIELD;
gint PROCESS_TITLE_FIELD;
@@ -173,29 +116,11 @@ gint PROCESS_ORIG_ARTIST_FIELD;
gint PROCESS_COPYRIGHT_FIELD;
gint PROCESS_URL_FIELD;
gint PROCESS_ENCODED_BY_FIELD;
-gchar *PROCESS_FIELDS_CONVERT_FROM;
-gchar *PROCESS_FIELDS_CONVERT_TO;
gint PF_CONVERT_INTO_SPACE;
gint PF_CONVERT_SPACE;
-gint PF_CONVERT;
-gint PF_CONVERT_ALL_UPPERCASE;
-gint PF_CONVERT_ALL_DOWNCASE;
-gint PF_CONVERT_FIRST_LETTER_UPPERCASE;
-gint PF_CONVERT_FIRST_LETTERS_UPPERCASE;
-gint PF_DETECT_ROMAN_NUMERALS;
-gint PF_REMOVE_SPACE;
-gint PF_INSERT_SPACE;
-gint PF_ONLY_ONE_SPACE;
/* Playlist window */
gchar *PLAYLIST_NAME;
-gint PLAYLIST_USE_MASK_NAME;
-gint PLAYLIST_USE_DIR_NAME;
-gint PLAYLIST_ONLY_SELECTED_FILES;
-gint PLAYLIST_FULL_PATH;
-gint PLAYLIST_RELATIVE_PATH;
-gint PLAYLIST_CREATE_IN_PARENT_DIR;
-gint PLAYLIST_USE_DOS_SEPARATOR;
gint PLAYLIST_CONTENT_NONE;
gint PLAYLIST_CONTENT_FILENAME;
gint PLAYLIST_CONTENT_MASK;
@@ -207,51 +132,26 @@ gint PLAYLIST_WINDOW_WIDTH;
gint PLAYLIST_WINDOW_HEIGHT;
/* "Load filenames from txt" window */
-gint LOAD_FILE_RUN_SCANNER;
-
gint LOAD_FILE_WINDOW_X;
gint LOAD_FILE_WINDOW_Y;
gint LOAD_FILE_WINDOW_WIDTH;
gint LOAD_FILE_WINDOW_HEIGHT;
/* CDDB in preferences window */
-gchar *CDDB_SERVER_NAME_AUTOMATIC_SEARCH;
-gint CDDB_SERVER_PORT_AUTOMATIC_SEARCH;
-gchar *CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH;
-gchar *CDDB_SERVER_NAME_AUTOMATIC_SEARCH2;
-gint CDDB_SERVER_PORT_AUTOMATIC_SEARCH2;
-gchar *CDDB_SERVER_CGI_PATH_AUTOMATIC_SEARCH2;
-gchar *CDDB_SERVER_NAME_MANUAL_SEARCH;
-gint CDDB_SERVER_PORT_MANUAL_SEARCH;
-gchar *CDDB_SERVER_CGI_PATH_MANUAL_SEARCH;
gchar *CDDB_LOCAL_PATH;
-gint CDDB_USE_PROXY;
-gchar *CDDB_PROXY_NAME;
-gint CDDB_PROXY_PORT;
-gchar *CDDB_PROXY_USER_NAME;
-gchar *CDDB_PROXY_USER_PASSWORD;
-gint SET_CDDB_WINDOW_POSITION;
gint CDDB_WINDOW_X;
gint CDDB_WINDOW_Y;
gint CDDB_WINDOW_HEIGHT;
gint CDDB_WINDOW_WIDTH;
gint CDDB_PANE_HANDLE_POSITION;
-gint CDDB_FOLLOW_FILE;
-gint CDDB_USE_DLM;
-gint CDDB_USE_LOCAL_ACCESS;
-
/* CDDB window */
-gint CDDB_SEARCH_IN_ALL_FIELDS;
gint CDDB_SEARCH_IN_ARTIST_FIELD;
gint CDDB_SEARCH_IN_TITLE_FIELD;
gint CDDB_SEARCH_IN_TRACK_NAME_FIELD;
gint CDDB_SEARCH_IN_OTHER_FIELD;
-gint CDDB_SHOW_CATEGORIES;
-
-gint CDDB_SEARCH_IN_ALL_CATEGORIES;
gint CDDB_SEARCH_IN_BLUES_CATEGORY;
gint CDDB_SEARCH_IN_CLASSICAL_CATEGORY;
gint CDDB_SEARCH_IN_COUNTRY_CATEGORY;
@@ -273,27 +173,19 @@ gint CDDB_SET_TO_TRACK_TOTAL;
gint CDDB_SET_TO_GENRE;
gint CDDB_SET_TO_FILE_NAME;
-gint CDDB_RUN_SCANNER;
-
/* Search Window */
-gint SET_SEARCH_WINDOW_POSITION;
gint SEARCH_WINDOW_X;
gint SEARCH_WINDOW_Y;
gint SEARCH_WINDOW_HEIGHT;
gint SEARCH_WINDOW_WIDTH;
-gint SEARCH_IN_FILENAME;
-gint SEARCH_IN_TAG;
-gint SEARCH_CASE_SENSITIVE;
/* Default mask */
gchar *SCAN_TAG_DEFAULT_MASK;
gchar *RENAME_FILE_DEFAULT_MASK;
gchar *RENAME_DIRECTORY_DEFAULT_MASK;
-gint RENAME_DIRECTORY_WITH_MASK;
/* Other parameters */
-gint OPTIONS_NOTEBOOK_PAGE;
gint OPTIONS_WINDOW_HEIGHT;
gint OPTIONS_WINDOW_WIDTH;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]