[easytag/wip/application-window: 1/8] Move main window to EtApplicationWindow object
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/application-window: 1/8] Move main window to EtApplicationWindow object
- Date: Sun, 29 Dec 2013 21:02:40 +0000 (UTC)
commit 8b66e533da19be6bf8be236a2916578d76c549de
Author: David King <amigadave amigadave com>
Date: Sat Nov 2 21:33:18 2013 +0000
Move main window to EtApplicationWindow object
Makefile.am | 2 +
po/POTFILES.in | 1 +
src/application.c | 17 +-
src/application.h | 6 +-
src/application_window.c | 2003 ++++++++++++++++++++++++++++++++++++++++++++++
src/application_window.h | 58 ++
src/bar.c | 6 +-
src/bar.h | 2 +-
src/browser.c | 3 -
src/easytag.c | 1961 +--------------------------------------------
src/easytag.h | 5 -
src/et_core.c | 4 +-
src/setting.c | 32 +-
src/setting.h | 10 -
14 files changed, 2133 insertions(+), 1977 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index a8f6d19..2152263 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -35,6 +35,7 @@ easytag_SOURCES = \
src/about.c \
src/ape_tag.c \
src/application.c \
+ src/application_window.c \
src/bar.c \
src/browser.c \
src/browser.h \
@@ -76,6 +77,7 @@ easytag_headers = \
src/about.h \
src/ape_tag.h \
src/application.h \
+ src/application_window.h \
src/bar.h \
src/cddb.h \
src/charset.h \
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 9ec12e7..221a0ea 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -2,6 +2,7 @@ data/easytag.desktop.in
src/about.c
src/ape_tag.c
src/application.c
+src/application_window.c
src/bar.c
src/browser.c
src/cddb.c
diff --git a/src/application.c b/src/application.c
index 8135363..d30b65c 100644
--- a/src/application.c
+++ b/src/application.c
@@ -28,7 +28,7 @@ G_DEFINE_TYPE (EtApplication, et_application, G_TYPE_APPLICATION)
struct _EtApplicationPrivate
{
- GtkWindow *main_window;
+ EtApplicationWindow *window;
};
static const GOptionEntry entries[] =
@@ -156,7 +156,7 @@ et_application_init (EtApplication *application)
ET_TYPE_APPLICATION,
EtApplicationPrivate);
- application->priv->main_window = NULL;
+ application->priv->window = NULL;
}
static void
@@ -192,12 +192,12 @@ et_application_new ()
*
* Returns: the current application window, or %NULL if no window is set
*/
-GtkWindow *
+EtApplicationWindow *
et_application_get_window (EtApplication *application)
{
g_return_val_if_fail (ET_APPLICATION (application), NULL);
- return application->priv->main_window;
+ return application->priv->window;
}
/*
@@ -208,10 +208,11 @@ et_application_get_window (EtApplication *application)
* Set the application window, if none has been set already.
*/
void
-et_application_set_window (EtApplication *application, GtkWindow *window)
+et_application_set_window (EtApplication *application,
+ EtApplicationWindow *window)
{
- g_return_if_fail (ET_APPLICATION (application) || GTK_WINDOW (window)
- || application->priv->main_window != NULL);
+ g_return_if_fail (ET_APPLICATION (application) && GTK_WINDOW (window)
+ && application->priv->window == NULL);
- application->priv->main_window = window;
+ application->priv->window = window;
}
diff --git a/src/application.h b/src/application.h
index c3a1858..ddf0aed 100644
--- a/src/application.h
+++ b/src/application.h
@@ -22,6 +22,8 @@
#include <gio/gio.h>
#include <gtk/gtk.h>
+#include "application_window.h"
+
G_BEGIN_DECLS
#define ET_TYPE_APPLICATION (et_application_get_type ())
@@ -46,8 +48,8 @@ struct _EtApplicationClass
GType et_application_get_type (void);
EtApplication *et_application_new (void);
-GtkWindow *et_application_get_window (EtApplication *application);
-void et_application_set_window (EtApplication *application, GtkWindow *window);
+EtApplicationWindow *et_application_get_window (EtApplication *application);
+void et_application_set_window (EtApplication *application, EtApplicationWindow *window);
G_END_DECLS
diff --git a/src/application_window.c b/src/application_window.c
new file mode 100644
index 0000000..2e2309d
--- /dev/null
+++ b/src/application_window.c
@@ -0,0 +1,2003 @@
+/* EasyTAG - tag editor for audio files
+ * Copyright (C) 2013 David King <amigadave amigadave com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include "application_window.h"
+
+#include <gdk/gdkkeysyms.h>
+#include <glib/gi18n.h>
+
+#include "bar.h"
+#include "browser.h"
+#include "easytag.h"
+#include "gtk2_compat.h"
+#include "log.h"
+#include "misc.h"
+#include "picture.h"
+#include "scan.h"
+#include "setting.h"
+
+/* TODO: Use G_DEFINE_TYPE_WITH_PRIVATE. */
+G_DEFINE_TYPE (EtApplicationWindow, et_application_window, GTK_TYPE_WINDOW)
+
+#define et_application_window_get_instance_private(window) (window->priv)
+
+struct _EtApplicationWindowPrivate
+{
+ GtkWidget *file_area;
+ GtkWidget *log_area;
+ GtkWidget *tag_area;
+
+ /* Tag area labels. */
+ GtkWidget *title_label;
+ GtkWidget *artist_label;
+ GtkWidget *album_artist_label;
+ GtkWidget *album_label;
+ GtkWidget *disc_number_label;
+ GtkWidget *year_label;
+ GtkWidget *track_label;
+ GtkWidget *genre_label;
+ GtkWidget *comment_label;
+ GtkWidget *composer_label;
+ GtkWidget *orig_artist_label;
+ GtkWidget *copyright_label;
+ GtkWidget *url_label;
+ GtkWidget *encoded_by_label;
+
+ /* FIXME: Tag area entries. */
+
+ /* Notebook tabs. */
+ GtkWidget *images_tab;
+
+ /* Image treeview model. */
+ GtkListStore *images_model;
+
+ GtkWidget *hpaned;
+ GtkWidget *vpaned;
+
+ /* Mini buttons. */
+ GtkWidget *track_sequence_button;
+ GtkWidget *track_number_button;
+ GtkToolItem *apply_image_toolitem;
+};
+
+static void Attach_Popup_Menu_To_Tag_Entries (GtkEntry *entry);
+static void et_tag_field_connect_signals (GtkEntry *entry);
+static gboolean et_tag_field_on_key_press_event (GtkEntry *entry,
+ GdkEventKey *event,
+ gpointer user_data);
+
+static void Mini_Button_Clicked (GObject *object);
+
+static void
+Convert_P20_And_Underscore_Into_Spaces (GtkWidget *entry)
+{
+ gchar *string = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
+
+ Scan_Convert_Underscore_Into_Space (string);
+ Scan_Convert_P20_Into_Space (string);
+ gtk_entry_set_text (GTK_ENTRY (entry), string);
+ g_free (string);
+}
+
+static void
+Convert_Space_Into_Underscore (GtkWidget *entry)
+{
+ gchar *string = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
+
+ Scan_Convert_Space_Into_Undescore (string);
+ gtk_entry_set_text (GTK_ENTRY (entry), string);
+ g_free (string);
+}
+
+static void
+Convert_All_Uppercase (GtkWidget *entry)
+{
+ gchar *string = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
+
+ Scan_Process_Fields_All_Uppercase (string);
+ gtk_entry_set_text (GTK_ENTRY (entry), string);
+ g_free (string);
+}
+
+static void
+Convert_All_Lowercase (GtkWidget *entry)
+{
+ gchar *string = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
+
+ Scan_Process_Fields_All_Downcase (string);
+ gtk_entry_set_text (GTK_ENTRY (entry), string);
+ g_free (string);
+}
+
+static void
+Convert_Letter_Uppercase (GtkWidget *entry)
+{
+ gchar *string = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
+
+ Scan_Process_Fields_Letter_Uppercase (string);
+ gtk_entry_set_text (GTK_ENTRY (entry), string);
+ g_free (string);
+}
+
+static void
+Convert_First_Letters_Uppercase (GtkWidget *entry)
+{
+ gchar *string = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
+
+ Scan_Process_Fields_First_Letters_Uppercase (string);
+ gtk_entry_set_text (GTK_ENTRY (entry), string);
+ g_free (string);
+}
+
+static void
+Convert_Remove_Space (GtkWidget *entry)
+{
+ gchar *string = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
+
+ Scan_Process_Fields_Remove_Space (string);
+ gtk_entry_set_text (GTK_ENTRY (entry), string);
+ g_free (string);
+}
+
+static void
+Convert_Insert_Space (GtkWidget *entry)
+{
+ // FIX ME : we suppose that it will not grow more than 2 times its size...
+ gsize string_length = 2 * strlen (gtk_entry_get_text (GTK_ENTRY (entry)));
+ gchar *string = g_malloc (string_length + 1);
+ strncpy (string, gtk_entry_get_text (GTK_ENTRY (entry)), string_length);
+ string[string_length] = '\0';
+
+ Scan_Process_Fields_Insert_Space (&string);
+ gtk_entry_set_text (GTK_ENTRY (entry), string);
+ g_free (string);
+}
+
+static void
+Convert_Only_One_Space (GtkWidget *entry)
+{
+ gchar *string = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
+
+ Scan_Process_Fields_Keep_One_Space (string);
+ gtk_entry_set_text (GTK_ENTRY (entry), string);
+ g_free (string);
+}
+
+static void
+Convert_Remove_All_Text (GtkWidget *entry)
+{
+ gtk_entry_set_text (GTK_ENTRY (entry), "");
+}
+
+/* Show the popup menu when the third mouse button is pressed. */
+static gboolean
+Entry_Popup_Menu_Handler (GtkMenu *menu,
+ GdkEventButton *event,
+ gpointer user_data)
+{
+ if (event && (event->type == GDK_BUTTON_PRESS) && (event->button == 3))
+ {
+ gtk_menu_popup (menu, NULL, NULL, NULL, NULL, event->button,
+ event->time);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/*
+ * Popup menu attached to all entries of tag + filename + rename combobox.
+ * Displayed when pressing the right mouse button and contains functions to process ths strings.
+ */
+static void
+Attach_Popup_Menu_To_Tag_Entries (GtkEntry *entry)
+{
+ GtkWidget *menu;
+ GtkWidget *image;
+ GtkWidget *menu_item;
+
+ menu = gtk_menu_new ();
+ g_signal_connect_swapped (entry, "button-press-event",
+ G_CALLBACK (Entry_Popup_Menu_Handler),
+ G_OBJECT (menu));
+
+ /* Menu items */
+ menu_item = gtk_image_menu_item_new_with_label (_("Tag selected files with this field"));
+ image = gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ g_signal_connect_swapped (menu_item, "activate",
+ G_CALLBACK (Mini_Button_Clicked),
+ G_OBJECT (entry));
+
+ /* Separator */
+ menu_item = gtk_menu_item_new ();
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+
+ menu_item = gtk_image_menu_item_new_with_label (_("Convert '_' and '%20' to spaces"));
+ image = gtk_image_new_from_stock (GTK_STOCK_CONVERT, GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ g_signal_connect_swapped (menu_item, "activate",
+ G_CALLBACK (Convert_P20_And_Underscore_Into_Spaces),
+ G_OBJECT (entry));
+
+ menu_item = gtk_image_menu_item_new_with_label (_("Convert ' ' to '_'"));
+ image = gtk_image_new_from_stock (GTK_STOCK_CONVERT, GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ g_signal_connect_swapped (menu_item, "activate",
+ G_CALLBACK (Convert_Space_Into_Underscore),
+ G_OBJECT (entry));
+
+ /* Separator */
+ menu_item = gtk_menu_item_new ();
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+
+ menu_item = gtk_image_menu_item_new_with_label (_("All uppercase"));
+ image = gtk_image_new_from_stock ("easytag-all-uppercase",
+ GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ g_signal_connect_swapped (menu_item, "activate",
+ G_CALLBACK (Convert_All_Uppercase),
+ G_OBJECT (entry));
+
+ menu_item = gtk_image_menu_item_new_with_label (_("All lowercase"));
+ image = gtk_image_new_from_stock ("easytag-all-downcase",
+ GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ g_signal_connect_swapped (menu_item, "activate",
+ G_CALLBACK (Convert_All_Lowercase),
+ G_OBJECT (entry));
+
+ menu_item = gtk_image_menu_item_new_with_label (_("First letter uppercase"));
+ image = gtk_image_new_from_stock ("easytag-first-letter-uppercase",
+ GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ g_signal_connect_swapped (menu_item, "activate",
+ G_CALLBACK (Convert_Letter_Uppercase),
+ G_OBJECT (entry));
+
+ menu_item = gtk_image_menu_item_new_with_label (_("First letter uppercase of each word"));
+ image = gtk_image_new_from_stock ("easytag-first-letter-uppercase-word",
+ GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ g_signal_connect_swapped (menu_item, "activate",
+ G_CALLBACK (Convert_First_Letters_Uppercase),
+ G_OBJECT (entry));
+
+ /* Separator */
+ menu_item = gtk_menu_item_new ();
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+
+ menu_item = gtk_image_menu_item_new_with_label (_("Remove spaces"));
+ image = gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ g_signal_connect_swapped (menu_item, "activate",
+ G_CALLBACK (Convert_Remove_Space),
+ G_OBJECT (entry));
+
+ menu_item = gtk_image_menu_item_new_with_label (_("Insert space before uppercase letter"));
+ image = gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ g_signal_connect_swapped (menu_item, "activate",
+ G_CALLBACK (Convert_Insert_Space),
+ G_OBJECT (entry));
+
+ menu_item = gtk_image_menu_item_new_with_label (_("Remove duplicate spaces or underscores"));
+ image = gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ g_signal_connect_swapped (menu_item, "activate",
+ G_CALLBACK (Convert_Only_One_Space),
+ G_OBJECT (entry));
+
+ menu_item = gtk_image_menu_item_new_with_label (_("Remove all text"));
+ image = gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ g_signal_connect_swapped (menu_item, "activate",
+ G_CALLBACK (Convert_Remove_All_Text),
+ G_OBJECT (entry));
+
+ gtk_widget_show_all (menu);
+}
+
+
+/*
+ * Clear the entries of tag area
+ */
+void
+Clear_Tag_Entry_Fields (void)
+{
+ g_return_if_fail (TitleEntry != NULL);
+
+ gtk_entry_set_text (GTK_ENTRY (TitleEntry), "");
+ gtk_entry_set_text (GTK_ENTRY (ArtistEntry), "");
+ gtk_entry_set_text (GTK_ENTRY (AlbumArtistEntry), "");
+ gtk_entry_set_text (GTK_ENTRY (AlbumEntry), "");
+ gtk_entry_set_text (GTK_ENTRY (DiscNumberEntry), "");
+ gtk_entry_set_text (GTK_ENTRY (YearEntry), "");
+ gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (TrackEntryCombo))),
+ "");
+ gtk_entry_set_text (GTK_ENTRY (TrackTotalEntry), "");
+ gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (GenreCombo))),
+ "");
+ gtk_entry_set_text (GTK_ENTRY (CommentEntry), "");
+ gtk_entry_set_text (GTK_ENTRY (ComposerEntry), "");
+ gtk_entry_set_text (GTK_ENTRY (OrigArtistEntry), "");
+ gtk_entry_set_text (GTK_ENTRY (CopyrightEntry), "");
+ gtk_entry_set_text (GTK_ENTRY (URLEntry), "");
+ gtk_entry_set_text (GTK_ENTRY (EncodedByEntry), "");
+ PictureEntry_Clear ();
+}
+
+
+/*
+ * Clear the entry of file area
+ */
+void
+Clear_File_Entry_Field (void)
+{
+ g_return_if_fail (FileEntry != NULL);
+
+ gtk_entry_set_text (GTK_ENTRY (FileEntry),"");
+}
+
+
+/*
+ * Clear the header information
+ */
+void
+Clear_Header_Fields (void)
+{
+ g_return_if_fail (VersionValueLabel != NULL);
+
+ /* Default values are MPs data */
+ gtk_label_set_text (GTK_LABEL (VersionLabel), _("Encoder:"));
+ gtk_label_set_text (GTK_LABEL (VersionValueLabel), "");
+ gtk_label_set_text (GTK_LABEL (BitrateValueLabel), "");
+ gtk_label_set_text (GTK_LABEL (SampleRateValueLabel), "");
+ gtk_label_set_text (GTK_LABEL (ModeLabel), _("Mode:"));
+ gtk_label_set_text (GTK_LABEL (ModeValueLabel), "");
+ gtk_label_set_text (GTK_LABEL (SizeValueLabel), "");
+ gtk_label_set_text (GTK_LABEL (DurationValueLabel), "");
+}
+
+
+static void
+Mini_Button_Clicked (GObject *object)
+{
+ GtkWidget *toplevel;
+ EtApplicationWindowPrivate *priv;
+ GList *etfilelist = NULL;
+ GList *selection_filelist = NULL;
+ GList *l;
+ gchar *string_to_set = NULL;
+ gchar *string_to_set1 = NULL;
+ gchar *msg = NULL;
+ ET_File *etfile;
+ File_Tag *FileTag;
+ GtkTreeSelection *selection;
+
+ g_return_if_fail (ETCore->ETFileDisplayedList != NULL ||
+ BrowserList != NULL);
+
+ /* FIXME: hack! */
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (object));
+
+ if (gtk_widget_is_toplevel (toplevel))
+ {
+ priv = et_application_window_get_instance_private (ET_APPLICATION_WINDOW (toplevel));
+ }
+ else
+ {
+ g_error ("Main window is not a toplevel!");
+ }
+
+ // Save the current displayed data
+ ET_Save_File_Data_From_UI(ETCore->ETFileDisplayed);
+
+ // Warning : 'selection_filelist' is not a list of 'ETFile' items!
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(BrowserList));
+ selection_filelist = gtk_tree_selection_get_selected_rows(selection, NULL);
+
+ // Create an 'ETFile' list from 'selection_filelist'
+ for (l = selection_filelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = Browser_List_Get_ETFile_From_Path (l->data);
+ etfilelist = g_list_prepend (etfilelist, etfile);
+ }
+
+ etfilelist = g_list_reverse (etfilelist);
+ g_list_free_full (selection_filelist, (GDestroyNotify)gtk_tree_path_free);
+
+
+ if (object == G_OBJECT (TitleEntry))
+ {
+ string_to_set = gtk_editable_get_chars(GTK_EDITABLE(TitleEntry),0,-1); // The string to apply to all
other files
+
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item(&FileTag->title,string_to_set);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+ if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
+ msg = g_strdup_printf(_("Selected files tagged with title '%s'."),string_to_set);
+ else
+ msg = g_strdup(_("Removed title from selected files."));
+ }
+ else if (object == G_OBJECT (ArtistEntry))
+ {
+ string_to_set = gtk_editable_get_chars(GTK_EDITABLE(ArtistEntry),0,-1);
+
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item(&FileTag->artist,string_to_set);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+ if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
+ msg = g_strdup_printf(_("Selected files tagged with artist '%s'."),string_to_set);
+ else
+ msg = g_strdup(_("Removed artist from selected files."));
+ }
+ else if (object == G_OBJECT (AlbumArtistEntry))
+ {
+ string_to_set = gtk_editable_get_chars(GTK_EDITABLE(AlbumArtistEntry),0,-1);
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item(&FileTag->album_artist,string_to_set);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+ if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
+ msg = g_strdup_printf(_("Selected files tagged with album artist '%s'."),string_to_set);
+ else
+ msg = g_strdup(_("Removed album artist from selected files."));
+ }
+ else if (object == G_OBJECT (AlbumEntry))
+ {
+ string_to_set = gtk_editable_get_chars(GTK_EDITABLE(AlbumEntry),0,-1);
+
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item(&FileTag->album,string_to_set);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+ if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
+ msg = g_strdup_printf(_("Selected files tagged with album '%s'."),string_to_set);
+ else
+ msg = g_strdup(_("Removed album name from selected files."));
+ }
+ else if (object == G_OBJECT (DiscNumberEntry))
+ {
+ const gchar *entry_text;
+ gchar *separator;
+
+ entry_text = gtk_entry_get_text (GTK_ENTRY (DiscNumberEntry));
+ separator = g_utf8_strchr (entry_text, -1, '/');
+
+ if (separator)
+ {
+ string_to_set1 = g_strdup (separator + 1);
+ string_to_set = g_strndup (entry_text,
+ separator - entry_text);
+ }
+ else
+ {
+ string_to_set = g_strdup (entry_text);
+ string_to_set1 = NULL;
+ }
+
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item (&FileTag->disc_number, string_to_set);
+ ET_Set_Field_File_Tag_Item (&FileTag->disc_total, string_to_set1);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+
+ if (string_to_set != NULL && g_utf8_strlen (string_to_set, -1) > 0)
+ {
+ if (string_to_set1 != NULL
+ && g_utf8_strlen (string_to_set1, -1) > 0)
+ {
+ msg = g_strdup_printf (_("Selected files tagged with disc number '%s/%s'."),
+ string_to_set, string_to_set1);
+ }
+ else
+ {
+ msg = g_strdup_printf (_("Selected files tagged with disc number like 'xx'."));
+ }
+ }
+ else
+ {
+ msg = g_strdup (_("Removed disc number from selected files."));
+ }
+ }
+ else if (object == G_OBJECT (YearEntry))
+ {
+ string_to_set = gtk_editable_get_chars(GTK_EDITABLE(YearEntry),0,-1);
+
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item(&FileTag->year,string_to_set);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+ if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
+ msg = g_strdup_printf(_("Selected files tagged with year '%s'."),string_to_set);
+ else
+ msg = g_strdup(_("Removed year from selected files."));
+ }
+ else if (object == G_OBJECT (TrackTotalEntry))
+ {
+ /* Used of Track and Total Track values */
+ string_to_set = g_strdup(gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(TrackEntryCombo)))));
+ string_to_set1 = gtk_editable_get_chars(GTK_EDITABLE(TrackTotalEntry),0,-1);
+
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+
+ // We apply the TrackEntry field to all others files only if it is to delete
+ // the field (string=""). Else we don't overwrite the track number
+ if (!string_to_set || g_utf8_strlen(string_to_set, -1) == 0)
+ ET_Set_Field_File_Tag_Item(&FileTag->track,string_to_set);
+ ET_Set_Field_File_Tag_Item(&FileTag->track_total,string_to_set1);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+
+ if ( string_to_set && g_utf8_strlen(string_to_set, -1) > 0 ) //&& atoi(string_to_set)>0 )
+ {
+ if ( string_to_set1 != NULL && g_utf8_strlen(string_to_set1, -1)>0 ) //&& atoi(string_to_set1)>0
)
+ {
+ msg = g_strdup_printf(_("Selected files tagged with track like 'xx/%s'."),string_to_set1);
+ }else
+ {
+ msg = g_strdup_printf(_("Selected files tagged with track like 'xx'."));
+ }
+ }else
+ {
+ msg = g_strdup(_("Removed track number from selected files."));
+ }
+ }
+ else if (object == G_OBJECT (priv->track_sequence_button))
+ {
+ /* This part doesn't set the same track number to all files, but sequence the tracks.
+ * So we must browse the whole 'etfilelistfull' to get position of each selected file.
+ * Note : 'etfilelistfull' and 'etfilelist' must be sorted in the same order */
+ GList *etfilelistfull = NULL;
+ gchar *path = NULL;
+ gchar *path1 = NULL;
+ gint i = 0;
+
+ /* FIX ME!: see to fill also the Total Track (it's a good idea?) */
+ etfilelistfull = g_list_first(ETCore->ETFileList);
+
+ // Sort 'etfilelistfull' and 'etfilelist' in the same order
+ etfilelist = ET_Sort_File_List(etfilelist,SORTING_FILE_MODE);
+ etfilelistfull = ET_Sort_File_List(etfilelistfull,SORTING_FILE_MODE);
+
+ while (etfilelist && etfilelistfull)
+ {
+ // To get the path of the file
+ File_Name *FileNameCur = (File_Name *)((ET_File *)etfilelistfull->data)->FileNameCur->data;
+ // The ETFile in the selected file list
+ etfile = etfilelist->data;
+
+ // Restart counter when entering a new directory
+ g_free(path1);
+ path1 = g_path_get_dirname(FileNameCur->value);
+ if ( path && path1 && strcmp(path,path1)!=0 )
+ i = 0;
+
+ string_to_set = et_track_number_to_string (++i);
+
+ // The file is in the selection?
+ if ( (ET_File *)etfilelistfull->data == etfile )
+ {
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item(&FileTag->track,string_to_set);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+
+ if (!etfilelist->next) break;
+ etfilelist = g_list_next(etfilelist);
+ }
+
+ g_free(string_to_set);
+ g_free(path);
+ path = g_strdup(path1);
+
+ etfilelistfull = g_list_next(etfilelistfull);
+ }
+ g_free(path);
+ g_free(path1);
+ //msg = g_strdup_printf(_("All %d tracks numbered sequentially."),
ETCore->ETFileSelectionList_Length);
+ msg = g_strdup_printf(_("Selected tracks numbered sequentially."));
+ }
+ else if (object==G_OBJECT(priv->track_number_button))
+ {
+ /* Used of Track and Total Track values */
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ gchar *path_utf8, *filename_utf8;
+
+ etfile = (ET_File *)l->data;
+ filename_utf8 = ((File_Name *)etfile->FileNameNew->data)->value_utf8;
+ path_utf8 = g_path_get_dirname(filename_utf8);
+
+ string_to_set = et_track_number_to_string (ET_Get_Number_Of_Files_In_Directory (path_utf8));
+
+ g_free(path_utf8);
+ if (!string_to_set1)
+ string_to_set1 = g_strdup(string_to_set); // Just for the message below...
+
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item(&FileTag->track_total,string_to_set);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+
+ if ( string_to_set1 != NULL && g_utf8_strlen(string_to_set1, -1)>0 ) //&& atoi(string_to_set1)>0 )
+ {
+ msg = g_strdup_printf(_("Selected files tagged with track like 'xx/%s'."),string_to_set1);
+ }else
+ {
+ msg = g_strdup(_("Removed track number from selected files."));
+ }
+ }
+ else if (object == G_OBJECT (gtk_bin_get_child (GTK_BIN (GenreCombo))))
+ {
+ string_to_set = gtk_editable_get_chars(GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(GenreCombo))),0,-1);
+
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item(&FileTag->genre,string_to_set);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+ if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
+ msg = g_strdup_printf(_("Selected files tagged with genre '%s'."),string_to_set);
+ else
+ msg = g_strdup(_("Removed genre from selected files."));
+ }
+ else if (object == G_OBJECT (CommentEntry))
+ {
+ //GtkTextBuffer *textbuffer;
+ //GtkTextIter start_iter;
+ //GtkTextIter end_iter;
+ //textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(CommentView));
+ //gtk_text_buffer_get_bounds(GTK_TEXT_BUFFER(textbuffer),&start_iter,&end_iter);
+ //string_to_set = gtk_text_buffer_get_text(GTK_TEXT_BUFFER(textbuffer),&start_iter,&end_iter,TRUE);
+
+ string_to_set = gtk_editable_get_chars(GTK_EDITABLE(CommentEntry),0,-1);
+
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item(&FileTag->comment,string_to_set);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+ if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
+ msg = g_strdup_printf(_("Selected files tagged with comment '%s'."),string_to_set);
+ else
+ msg = g_strdup(_("Removed comment from selected files."));
+ }
+ else if (object == G_OBJECT (ComposerEntry))
+ {
+ string_to_set = gtk_editable_get_chars(GTK_EDITABLE(ComposerEntry),0,-1);
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item(&FileTag->composer,string_to_set);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+ if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
+ msg = g_strdup_printf(_("Selected files tagged with composer '%s'."),string_to_set);
+ else
+ msg = g_strdup(_("Removed composer from selected files."));
+ }
+ else if (object == G_OBJECT (OrigArtistEntry))
+ {
+ string_to_set = gtk_editable_get_chars(GTK_EDITABLE(OrigArtistEntry),0,-1);
+
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item(&FileTag->orig_artist,string_to_set);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+ if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
+ msg = g_strdup_printf(_("Selected files tagged with original artist '%s'."),string_to_set);
+ else
+ msg = g_strdup(_("Removed original artist from selected files."));
+ }
+ else if (object == G_OBJECT (CopyrightEntry))
+ {
+ string_to_set = gtk_editable_get_chars(GTK_EDITABLE(CopyrightEntry),0,-1);
+
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item(&FileTag->copyright,string_to_set);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+ if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
+ msg = g_strdup_printf(_("Selected files tagged with copyright '%s'."),string_to_set);
+ else
+ msg = g_strdup(_("Removed copyright from selected files."));
+ }
+ else if (object == G_OBJECT (URLEntry))
+ {
+ string_to_set = gtk_editable_get_chars(GTK_EDITABLE(URLEntry),0,-1);
+
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item(&FileTag->url,string_to_set);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+ if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
+ msg = g_strdup_printf(_("Selected files tagged with URL '%s'."),string_to_set);
+ else
+ msg = g_strdup(_("Removed URL from selected files."));
+ }
+ else if (object == G_OBJECT (EncodedByEntry))
+ {
+ string_to_set = gtk_editable_get_chars(GTK_EDITABLE(EncodedByEntry),0,-1);
+
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Item(&FileTag->encoded_by,string_to_set);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+ if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
+ msg = g_strdup_printf(_("Selected files tagged with encoder name '%s'."),string_to_set);
+ else
+ msg = g_strdup(_("Removed encoder name from selected files."));
+ }
+ else if (object == G_OBJECT (priv->apply_image_toolitem))
+ {
+ Picture *res = NULL, *pic, *prev_pic = NULL;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ model = gtk_tree_view_get_model(GTK_TREE_VIEW(PictureEntryView));
+ if (gtk_tree_model_get_iter_first(model, &iter))
+ {
+ do
+ {
+ gtk_tree_model_get(model, &iter, PICTURE_COLUMN_DATA, &pic, -1);
+ pic = Picture_Copy_One(pic);
+ if (!res)
+ res = pic;
+ else
+ prev_pic->next = pic;
+ prev_pic = pic;
+ } while (gtk_tree_model_iter_next(model, &iter));
+ }
+
+ for (l = etfilelist; l != NULL; l = g_list_next (l))
+ {
+ etfile = (ET_File *)l->data;
+ FileTag = ET_File_Tag_Item_New();
+ ET_Copy_File_Tag_Item(etfile,FileTag);
+ ET_Set_Field_File_Tag_Picture((Picture **)&FileTag->picture, res);
+ ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
+ }
+ if (res)
+ msg = g_strdup (_("Selected files tagged with images."));
+ else
+ msg = g_strdup (_("Removed images from selected files."));
+ Picture_Free(res);
+ }
+
+ g_list_free(etfilelist);
+
+ // Refresh the whole list (faster than file by file) to show changes
+ Browser_List_Refresh_Whole_List();
+
+ /* Display the current file (Needed when sequencing tracks) */
+ ET_Display_File_Data_To_UI(ETCore->ETFileDisplayed);
+
+ if (msg)
+ {
+ Log_Print(LOG_OK,"%s",msg);
+ Statusbar_Message(msg,TRUE);
+ g_free(msg);
+ }
+ g_free(string_to_set);
+ g_free(string_to_set1);
+
+ /* To update state of Undo button */
+ Update_Command_Buttons_Sensivity();
+}
+
+
+/*
+ * et_tag_field_connect_signals:
+ * @entry: the entry for which to connect signals
+ *
+ * Connect the GtkWidget::key-press-event and GtkEntry::icon-release signals
+ * of @entry to appropriate handlers for tag entry fields.
+ */
+static void
+et_tag_field_connect_signals (GtkEntry *entry)
+{
+ g_signal_connect_after (entry, "key-press-event",
+ G_CALLBACK (et_tag_field_on_key_press_event),
+ NULL);
+ g_signal_connect (entry, "icon-release", G_CALLBACK (Mini_Button_Clicked),
+ NULL);
+}
+
+/*
+ * et_tag_field_on_key_press_event:
+ * @entry: the tag entry field on which the event was generated
+ * @event: the generated event
+ * @user_data: user data set when the signal was connected
+ *
+ * Handle the Ctrl+Return combination being pressed in the tag field GtkEntrys
+ * and apply the tag to selected files.
+ *
+ * Returns: %TRUE if the event was handled, %FALSE if the event should
+ * propagate further
+ */
+static gboolean
+et_tag_field_on_key_press_event (GtkEntry *entry, GdkEventKey *event,
+ gpointer user_data)
+{
+ GdkModifierType modifiers = gtk_accelerator_get_default_mod_mask ();
+
+ switch (event->keyval)
+ {
+ case GDK_KEY_Return:
+ case GDK_KEY_KP_Enter:
+ case GDK_KEY_ISO_Enter:
+ if ((event->state & modifiers) == GDK_CONTROL_MASK)
+ {
+ Mini_Button_Clicked (G_OBJECT (entry));
+ }
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+static GtkWidget *
+create_browser_area (void)
+{
+ GtkWidget *frame;
+ GtkWidget *tree;
+
+ frame = gtk_frame_new (_("Browser"));
+ gtk_container_set_border_width (GTK_CONTAINER (frame), 2);
+
+ tree = Create_Browser_Items (MainWindow);
+ gtk_container_add (GTK_CONTAINER (frame), tree);
+
+ /* Don't load init dir here because Tag area hasn't been yet created!.
+ * It will be load at the end of the main function */
+ //Browser_Tree_Select_Dir(DEFAULT_PATH_TO_MP3);
+
+ return frame;
+}
+
+
+static GtkWidget *
+create_file_area (void)
+{
+ GtkWidget *vbox, *hbox;
+ GtkWidget *separator;
+
+ FileFrame = gtk_frame_new (_("File"));
+ gtk_container_set_border_width (GTK_CONTAINER (FileFrame), 2);
+
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_container_add (GTK_CONTAINER (FileFrame), vbox);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
+
+ /* HBox for FileEntry and IconBox */
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
+
+ /* File index (position in list + list length) */
+ FileIndex = gtk_label_new ("0/0:");
+ gtk_box_pack_start (GTK_BOX (hbox), FileIndex, FALSE, FALSE, 0);
+
+ /* Filename. */
+ FileEntry = gtk_entry_new ();
+ gtk_editable_set_editable (GTK_EDITABLE (FileEntry), TRUE);
+ gtk_box_pack_start (GTK_BOX (hbox), FileEntry, TRUE, TRUE, 2);
+
+ Attach_Popup_Menu_To_Tag_Entries (GTK_ENTRY (FileEntry));
+
+ /*
+ * File Infos
+ */
+ HeaderInfosTable = et_grid_new (3, 5);
+ gtk_container_add (GTK_CONTAINER (vbox), HeaderInfosTable);
+ gtk_container_set_border_width (GTK_CONTAINER (HeaderInfosTable), 2);
+ gtk_grid_set_row_spacing (GTK_GRID (HeaderInfosTable), 1);
+ gtk_grid_set_column_spacing (GTK_GRID (HeaderInfosTable), 2);
+
+ VersionLabel = gtk_label_new (_("Encoder:"));
+ gtk_grid_attach (GTK_GRID (HeaderInfosTable), VersionLabel, 0, 0, 1, 1);
+ VersionValueLabel = gtk_label_new ("");
+ gtk_grid_attach (GTK_GRID (HeaderInfosTable), VersionValueLabel, 1, 0, 1,
+ 1);
+ gtk_misc_set_alignment (GTK_MISC (VersionLabel), 1.0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (VersionValueLabel), 0.0, 0.5);
+
+ BitrateLabel = gtk_label_new (_("Bitrate:"));
+ gtk_grid_attach (GTK_GRID (HeaderInfosTable), BitrateLabel, 0, 1, 1, 1);
+ BitrateValueLabel = gtk_label_new ("");
+ gtk_grid_attach (GTK_GRID (HeaderInfosTable), BitrateValueLabel, 1, 1, 1,
+ 1);
+ gtk_misc_set_alignment (GTK_MISC (BitrateLabel), 1.0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (BitrateValueLabel), 0.0, 0.5);
+
+ /* Translators: Please try to keep this string as short as possible as it
+ * is shown in a narrow column. */
+ SampleRateLabel = gtk_label_new (_("Frequency:"));
+ gtk_grid_attach (GTK_GRID (HeaderInfosTable), SampleRateLabel, 0, 2, 1, 1);
+ SampleRateValueLabel = gtk_label_new("");
+ gtk_grid_attach (GTK_GRID (HeaderInfosTable), SampleRateValueLabel, 1, 2,
+ 1, 1);
+ gtk_misc_set_alignment (GTK_MISC (SampleRateLabel), 1.0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (SampleRateValueLabel), 0.0, 0.5);
+
+ separator = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
+ gtk_grid_attach (GTK_GRID (HeaderInfosTable), separator, 2, 0, 1, 4);
+
+ ModeLabel = gtk_label_new(_("Mode:"));
+ gtk_grid_attach (GTK_GRID (HeaderInfosTable), ModeLabel, 3, 0, 1, 1);
+ ModeValueLabel = gtk_label_new ("");
+ gtk_grid_attach (GTK_GRID (HeaderInfosTable), ModeValueLabel, 4, 0, 1, 1);
+ gtk_misc_set_alignment (GTK_MISC (ModeLabel), 1.0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (ModeValueLabel), 0.0, 0.5);
+
+ SizeLabel = gtk_label_new (_("Size:"));
+ gtk_grid_attach (GTK_GRID (HeaderInfosTable), SizeLabel, 3, 1, 1, 1);
+ SizeValueLabel = gtk_label_new ("");
+ gtk_grid_attach (GTK_GRID (HeaderInfosTable), SizeValueLabel, 4, 1, 1, 1);
+ gtk_misc_set_alignment (GTK_MISC (SizeLabel), 1.0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (SizeValueLabel), 0.0, 0.5);
+
+ DurationLabel = gtk_label_new (_("Duration:"));
+ gtk_grid_attach (GTK_GRID (HeaderInfosTable), DurationLabel, 3, 2, 1, 1);
+ DurationValueLabel = gtk_label_new ("");
+ gtk_grid_attach (GTK_GRID (HeaderInfosTable), DurationValueLabel, 4, 2, 1,
+ 1);
+ gtk_misc_set_alignment (GTK_MISC (DurationLabel), 1.0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (DurationValueLabel), 0.0, 0.5);
+
+ /* FIXME */
+ #if 0
+ if (SHOW_HEADER_INFO)
+ gtk_widget_show_all(HeaderInfosTable);
+ #endif
+ return FileFrame;
+}
+
+#include "data/pixmaps/sequence_track.xpm"
+static GtkWidget *
+create_tag_area (EtApplicationWindow *self)
+{
+ EtApplicationWindowPrivate *priv;
+ GtkWidget *separator;
+ GtkWidget *table;
+ GtkWidget *label;
+ GtkWidget *scrolled_window;
+ GtkWidget *toolbar;
+ GtkToolItem *toolitem;
+ GIcon *icon;
+ GtkWidget *image;
+ GtkWidget *vbox;
+ GList *focus_chain = NULL;
+ GtkEntryCompletion *completion;
+ gint MButtonSize = 13;
+ gint TablePadding = 2;
+
+ /* For Picture. */
+ static const GtkTargetEntry drops[] = { { "text/uri-list", 0,
+ TARGET_URI_LIST } };
+ GtkCellRenderer *renderer;
+ GtkTreeViewColumn *column;
+ GtkTreeSelection *selection;
+
+ priv = et_application_window_get_instance_private (self);
+
+ /* Main Frame */
+ TagFrame = gtk_frame_new (_("Tag"));
+ gtk_container_set_border_width (GTK_CONTAINER (TagFrame), 2);
+
+ /* Box for the notebook (only for setting a border) */
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL ,0);
+ gtk_container_add (GTK_CONTAINER (TagFrame), vbox);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
+
+ /*
+ * Note book
+ */
+ TagNoteBook = gtk_notebook_new ();
+ gtk_notebook_popup_enable (GTK_NOTEBOOK (TagNoteBook));
+ gtk_box_pack_start (GTK_BOX (vbox), TagNoteBook, TRUE, TRUE, 0);
+ gtk_notebook_set_tab_pos (GTK_NOTEBOOK (TagNoteBook), GTK_POS_TOP);
+ gtk_notebook_set_show_border (GTK_NOTEBOOK (TagNoteBook), FALSE);
+ gtk_notebook_popup_enable (GTK_NOTEBOOK (TagNoteBook));
+
+ /*
+ * 1 - Page for common tag fields
+ */
+ label = gtk_label_new (_("Common"));
+
+ table = et_grid_new (11, 11);
+ gtk_notebook_append_page (GTK_NOTEBOOK (TagNoteBook), table, label);
+ gtk_container_set_border_width (GTK_CONTAINER (table), 2);
+
+ /* Title */
+ priv->title_label = gtk_label_new (_("Title:"));
+ et_grid_attach_full (GTK_GRID (table), priv->title_label, 0, 0, 1, 1,
+ FALSE, FALSE, TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (priv->title_label), 1.0, 0.5);
+
+ TitleEntry = gtk_entry_new ();
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (TitleEntry),
+ GTK_ENTRY_ICON_SECONDARY, "insert-text");
+ et_grid_attach_full (GTK_GRID (table), TitleEntry, 1, 0, 9, 1, TRUE, TRUE,
+ TablePadding, TablePadding);
+
+ et_tag_field_connect_signals (GTK_ENTRY (TitleEntry));
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (TitleEntry),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Tag selected files with this title"));
+
+ Attach_Popup_Menu_To_Tag_Entries (GTK_ENTRY (TitleEntry));
+
+ /* Artist */
+ priv->artist_label = gtk_label_new (_("Artist:"));
+ et_grid_attach_full (GTK_GRID (table), priv->artist_label, 0, 1, 1, 1,
+ FALSE, FALSE, TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (priv->artist_label), 1.0, 0.5);
+
+ ArtistEntry = gtk_entry_new ();
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (ArtistEntry),
+ GTK_ENTRY_ICON_SECONDARY, "insert-text");
+ et_grid_attach_full (GTK_GRID (table), ArtistEntry, 1, 1, 9, 1, TRUE, TRUE,
+ TablePadding,TablePadding);
+
+ et_tag_field_connect_signals (GTK_ENTRY (ArtistEntry));
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (ArtistEntry),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Tag selected files with this artist"));
+
+ Attach_Popup_Menu_To_Tag_Entries (GTK_ENTRY (ArtistEntry));
+
+ /* Album Artist */
+ priv->album_artist_label = gtk_label_new (_("Album artist:"));
+ et_grid_attach_full (GTK_GRID (table), priv->album_artist_label, 0, 2, 1,
+ 1, FALSE, FALSE, TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (priv->album_artist_label), 1.0, 0.5);
+
+ AlbumArtistEntry = gtk_entry_new ();
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (AlbumArtistEntry),
+ GTK_ENTRY_ICON_SECONDARY, "insert-text");
+ et_grid_attach_full (GTK_GRID (table), AlbumArtistEntry, 1, 2, 9, 1, TRUE,
+ TRUE, TablePadding, TablePadding);
+
+ et_tag_field_connect_signals (GTK_ENTRY (AlbumArtistEntry));
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (AlbumArtistEntry),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Tag selected files with this album artist"));
+
+ Attach_Popup_Menu_To_Tag_Entries (GTK_ENTRY (AlbumArtistEntry));
+
+ /* Album */
+ priv->album_label = gtk_label_new (_("Album:"));
+ et_grid_attach_full (GTK_GRID (table), priv->album_label, 0, 3, 1, 1,
+ FALSE, FALSE, TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (priv->album_label), 1.0, 0.5);
+
+ AlbumEntry = gtk_entry_new ();
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (AlbumEntry),
+ GTK_ENTRY_ICON_SECONDARY, "insert-text");
+ et_grid_attach_full (GTK_GRID (table), AlbumEntry, 1, 3, 6, 1, TRUE, TRUE,
+ TablePadding, TablePadding);
+
+ et_tag_field_connect_signals (GTK_ENTRY (AlbumEntry));
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (AlbumEntry),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Tag selected files with this album name"));
+
+ Attach_Popup_Menu_To_Tag_Entries (GTK_ENTRY (AlbumEntry));
+
+ /* Disc Number */
+ priv->disc_number_label = gtk_label_new (_("CD:"));
+ et_grid_attach_full (GTK_GRID (table), priv->disc_number_label, 8, 3, 1, 1,
+ FALSE, FALSE, TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (priv->disc_number_label), 1.0, 0.5);
+
+ DiscNumberEntry = gtk_entry_new ();
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (DiscNumberEntry),
+ GTK_ENTRY_ICON_SECONDARY, "insert-text");
+ et_grid_attach_full (GTK_GRID (table), DiscNumberEntry, 9, 3, 1, 1, TRUE,
+ TRUE, TablePadding, TablePadding);
+ gtk_entry_set_width_chars (GTK_ENTRY (DiscNumberEntry), 3);
+ /* FIXME should allow to type only something like : 1/3. */
+
/*g_signal_connect(G_OBJECT(GTK_ENTRY(DiscNumberEntry)),"insert_text",G_CALLBACK(Insert_Only_Digit),NULL); */
+
+ et_tag_field_connect_signals (GTK_ENTRY (DiscNumberEntry));
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (DiscNumberEntry),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Tag selected files with this disc number"));
+
+ Attach_Popup_Menu_To_Tag_Entries (GTK_ENTRY (DiscNumberEntry));
+
+ /* Year */
+ priv->year_label = gtk_label_new (_("Year:"));
+ et_grid_attach_full (GTK_GRID (table), priv->year_label, 0, 4, 1, 1, FALSE,
+ FALSE, TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (priv->year_label), 1.0, 0.5);
+
+ YearEntry = gtk_entry_new ();
+ gtk_entry_set_max_length (GTK_ENTRY (YearEntry), 4);
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (YearEntry),
+ GTK_ENTRY_ICON_SECONDARY, "insert-text");
+ et_grid_attach_full (GTK_GRID (table), YearEntry, 1, 4, 1, 1, TRUE, TRUE,
+ TablePadding, TablePadding);
+ gtk_entry_set_width_chars (GTK_ENTRY (YearEntry), 5);
+ g_signal_connect (YearEntry, "insert-text", G_CALLBACK (Insert_Only_Digit),
+ NULL);
+ g_signal_connect (YearEntry, "activate", G_CALLBACK (Parse_Date), NULL);
+ g_signal_connect (YearEntry, "focus-out-event", G_CALLBACK (Parse_Date),
+ NULL);
+
+ et_tag_field_connect_signals (GTK_ENTRY (YearEntry));
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (YearEntry),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Tag selected files with this year"));
+
+ /* Small vertical separator */
+ separator = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
+ et_grid_attach_full (GTK_GRID (table), separator, 3, 4, 1, 1, FALSE, FALSE,
+ TablePadding,TablePadding);
+
+ /* Track and Track total */
+ priv->track_sequence_button = gtk_button_new ();
+ gtk_widget_set_size_request (priv->track_sequence_button, MButtonSize,
+ MButtonSize);
+ et_grid_attach_full (GTK_GRID (table), priv->track_sequence_button, 4, 4,
+ 1, 1, FALSE, FALSE, TablePadding, TablePadding);
+ g_signal_connect (priv->track_sequence_button, "clicked",
+ G_CALLBACK (Mini_Button_Clicked), NULL);
+ gtk_widget_set_tooltip_text (priv->track_sequence_button,
+ _("Number selected tracks sequentially. "
+ "Starts at 01 in each subdirectory."));
+ /* Pixmap into priv->track_sequence_button button. */
+ image = Create_Xpm_Image ((const char **)sequence_track_xpm);
+ gtk_container_add (GTK_CONTAINER (priv->track_sequence_button), image);
+ gtk_widget_set_can_default (priv->track_sequence_button, TRUE);
+ gtk_widget_set_can_focus (priv->track_sequence_button, FALSE);
+
+ priv->track_label = gtk_label_new (_("Track #:"));
+ et_grid_attach_full (GTK_GRID (table), priv->track_label, 5, 4, 1, 1,
+ FALSE, FALSE, TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (priv->track_label), 1.0, 0.5);
+
+ if (TrackEntryComboModel != NULL)
+ {
+ gtk_list_store_clear (TrackEntryComboModel);
+ }
+ else
+ {
+ TrackEntryComboModel = gtk_list_store_new (MISC_COMBO_COUNT,
+ G_TYPE_STRING);
+ }
+
+ TrackEntryCombo = gtk_combo_box_new_with_model_and_entry (GTK_TREE_MODEL (TrackEntryComboModel));
+ gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (TrackEntryCombo),
+ MISC_COMBO_TEXT);
+ et_grid_attach_full (GTK_GRID (table), TrackEntryCombo, 6, 4, 1, 1, TRUE,
+ TRUE, TablePadding, TablePadding);
+ gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (TrackEntryCombo), 3); // Three columns to display track
numbers list
+
+ gtk_entry_set_width_chars (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (TrackEntryCombo))),
+ 2);
+ g_signal_connect (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (TrackEntryCombo))),
+ "insert-text", G_CALLBACK (Insert_Only_Digit), NULL);
+
+ label = gtk_label_new ("/");
+ et_grid_attach_full (GTK_GRID (table), label, 7, 4, 1, 1, FALSE, FALSE,
+ TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
+
+ priv->track_number_button = gtk_button_new ();
+ gtk_widget_set_size_request (priv->track_number_button, MButtonSize,
+ MButtonSize);
+ et_grid_attach_full (GTK_GRID (table), priv->track_number_button, 8, 4, 1,
+ 1, FALSE, FALSE, TablePadding, TablePadding);
+ g_signal_connect (priv->track_number_button, "clicked",
+ G_CALLBACK (Mini_Button_Clicked), NULL);
+ gtk_widget_set_tooltip_text (priv->track_number_button,
+ _("Set the number of files, in the same directory of the displayed file, to
the selected tracks."));
+ /* Pixmap into priv->track_number_button button. */
+ image = Create_Xpm_Image ((const char **)sequence_track_xpm);
+ gtk_container_add (GTK_CONTAINER (priv->track_number_button), image);
+ gtk_widget_set_can_default (priv->track_number_button, TRUE);
+ gtk_widget_set_can_focus (priv->track_number_button, FALSE);
+
+ TrackTotalEntry = gtk_entry_new();
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (TrackTotalEntry),
+ GTK_ENTRY_ICON_SECONDARY, "insert-text");
+ et_grid_attach_full (GTK_GRID (table), TrackTotalEntry, 9, 4, 1, 1, TRUE,
+ TRUE, TablePadding, TablePadding);
+ gtk_entry_set_width_chars (GTK_ENTRY (TrackTotalEntry), 3);
+ g_signal_connect (GTK_ENTRY (TrackTotalEntry), "insert-text",
+ G_CALLBACK (Insert_Only_Digit), NULL);
+
+ et_tag_field_connect_signals (GTK_ENTRY (TrackTotalEntry));
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (TrackTotalEntry),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Tag selected files with this number of tracks"));
+
+ /* Genre */
+ priv->genre_label = gtk_label_new (_("Genre:"));
+ et_grid_attach_full (GTK_GRID (table), priv->genre_label, 0, 5, 1, 1,
+ FALSE, FALSE, TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (priv->genre_label), 1.0, 0.5);
+
+ if (GenreComboModel != NULL)
+ {
+ gtk_list_store_clear (GenreComboModel);
+ }
+ else
+ {
+ GenreComboModel = gtk_list_store_new (MISC_COMBO_COUNT, G_TYPE_STRING);
+ }
+ GenreCombo = gtk_combo_box_new_with_model_and_entry (GTK_TREE_MODEL (GenreComboModel));
+ gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (GenreCombo),
+ MISC_COMBO_TEXT);
+ completion = gtk_entry_completion_new ();
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (GenreCombo))),
+ GTK_ENTRY_ICON_SECONDARY, "insert-text");
+ gtk_entry_set_completion (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (GenreCombo))),
+ completion);
+ g_object_unref (completion);
+ gtk_entry_completion_set_model (completion,
+ GTK_TREE_MODEL (GenreComboModel));
+ gtk_entry_completion_set_text_column (completion, 0);
+ gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (GenreComboModel),
+ MISC_COMBO_TEXT, Combo_Alphabetic_Sort,
+ NULL, NULL);
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (GenreComboModel),
+ MISC_COMBO_TEXT, GTK_SORT_ASCENDING);
+ et_grid_attach_full (GTK_GRID (table), GenreCombo, 1, 5, 9, 1, TRUE, TRUE,
+ TablePadding, TablePadding);
+ Load_Genres_List_To_UI ();
+ gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (GenreCombo), 2); // Two columns to display genres list
+
+ et_tag_field_connect_signals (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (GenreCombo))));
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (GenreCombo))),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Tag selected files with this genre"));
+
+ Attach_Popup_Menu_To_Tag_Entries (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (GenreCombo))));
+
+ /* Comment */
+ priv->comment_label = gtk_label_new (_("Comment:"));
+ et_grid_attach_full (GTK_GRID (table), priv->comment_label, 0, 6, 1, 1,
+ FALSE, FALSE, TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (priv->comment_label), 1.0, 0.5);
+
+ CommentEntry = gtk_entry_new ();
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (CommentEntry),
+ GTK_ENTRY_ICON_SECONDARY, "insert-text");
+ et_grid_attach_full (GTK_GRID (table), CommentEntry, 1, 6, 9, 1, TRUE,
+ TRUE, TablePadding, TablePadding);
+
+ et_tag_field_connect_signals (GTK_ENTRY (CommentEntry));
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (CommentEntry),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Tag selected files with this comment"));
+
+ Attach_Popup_Menu_To_Tag_Entries (GTK_ENTRY (CommentEntry));
+
+ /* Composer (name of the composers) */
+ priv->composer_label = gtk_label_new (_("Composer:"));
+ et_grid_attach_full (GTK_GRID (table), priv->composer_label, 0, 7, 1, 1,
+ FALSE, FALSE, TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (priv->composer_label), 1.0, 0.5);
+
+ ComposerEntry = gtk_entry_new ();
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (ComposerEntry),
+ GTK_ENTRY_ICON_SECONDARY, "insert-text");
+ et_grid_attach_full (GTK_GRID (table), ComposerEntry, 1, 7, 9, 1, TRUE,
+ TRUE, TablePadding, TablePadding);
+
+ et_tag_field_connect_signals (GTK_ENTRY (ComposerEntry));
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (ComposerEntry),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Tag selected files with this composer"));
+
+ Attach_Popup_Menu_To_Tag_Entries (GTK_ENTRY (ComposerEntry));
+
+ /* Translators: Original Artist / Performer. Please try to keep this string
+ * as short as possible, as it must fit into a narrow column. */
+ priv->orig_artist_label = gtk_label_new (_("Orig. artist:"));
+ et_grid_attach_full (GTK_GRID (table), priv->orig_artist_label, 0, 8, 1, 1,
+ FALSE, FALSE, TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (priv->orig_artist_label), 1.0, 0.5);
+
+ OrigArtistEntry = gtk_entry_new ();
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (OrigArtistEntry),
+ GTK_ENTRY_ICON_SECONDARY, "insert-text");
+ et_grid_attach_full (GTK_GRID (table), OrigArtistEntry, 1, 8, 9, 1, TRUE,
+ TRUE, TablePadding, TablePadding);
+
+ et_tag_field_connect_signals (GTK_ENTRY (OrigArtistEntry));
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (OrigArtistEntry),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Tag selected files with this original artist"));
+
+ Attach_Popup_Menu_To_Tag_Entries (GTK_ENTRY (OrigArtistEntry));
+
+
+ /* Copyright */
+ priv->copyright_label = gtk_label_new (_("Copyright:"));
+ et_grid_attach_full (GTK_GRID (table), priv->copyright_label, 0, 9, 1, 1,
+ FALSE, FALSE, TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (priv->copyright_label), 1.0, 0.5);
+
+ CopyrightEntry = gtk_entry_new ();
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (CopyrightEntry),
+ GTK_ENTRY_ICON_SECONDARY, "insert-text");
+ et_grid_attach_full (GTK_GRID (table), CopyrightEntry, 1, 9, 9, 1, TRUE,
+ TRUE, TablePadding, TablePadding);
+
+ et_tag_field_connect_signals (GTK_ENTRY (CopyrightEntry));
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (CopyrightEntry),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Tag selected files with this copyright"));
+
+ Attach_Popup_Menu_To_Tag_Entries (GTK_ENTRY (CopyrightEntry));
+
+
+ /* URL */
+ priv->url_label = gtk_label_new (_("URL:"));
+ et_grid_attach_full (GTK_GRID (table), priv->url_label, 0, 10, 1, 1, FALSE,
+ FALSE, TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (priv->url_label), 1.0, 0.5);
+
+ URLEntry = gtk_entry_new ();
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (URLEntry),
+ GTK_ENTRY_ICON_SECONDARY, "insert-text");
+ et_grid_attach_full (GTK_GRID (table), URLEntry, 1, 10, 9, 1, TRUE, TRUE,
+ TablePadding, TablePadding);
+
+ et_tag_field_connect_signals (GTK_ENTRY (URLEntry));
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (URLEntry),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Tag selected files with this URL"));
+
+ Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(URLEntry));
+
+
+ /* Encoded by */
+ priv->encoded_by_label = gtk_label_new (_("Encoded by:"));
+ et_grid_attach_full (GTK_GRID (table), priv->encoded_by_label, 0, 11, 1, 1,
+ FALSE, FALSE, TablePadding, TablePadding);
+ gtk_misc_set_alignment (GTK_MISC (priv->encoded_by_label), 1.0, 0.5);
+
+ EncodedByEntry = gtk_entry_new ();
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (EncodedByEntry),
+ GTK_ENTRY_ICON_SECONDARY, "insert-text");
+ et_grid_attach_full (GTK_GRID (table), EncodedByEntry, 1, 11, 9, 1, TRUE,
+ TRUE, TablePadding, TablePadding);
+
+ et_tag_field_connect_signals (GTK_ENTRY (EncodedByEntry));
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (EncodedByEntry),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Tag selected files with this encoder name"));
+
+ Attach_Popup_Menu_To_Tag_Entries (GTK_ENTRY (EncodedByEntry));
+
+ /* Set focus chain. */
+ focus_chain = g_list_prepend (focus_chain, TitleEntry);
+ focus_chain = g_list_prepend (focus_chain, ArtistEntry);
+ focus_chain = g_list_prepend (focus_chain, AlbumArtistEntry);
+ focus_chain = g_list_prepend (focus_chain, AlbumEntry);
+ focus_chain = g_list_prepend (focus_chain, DiscNumberEntry);
+ focus_chain = g_list_prepend (focus_chain, YearEntry);
+ focus_chain = g_list_prepend (focus_chain, TrackEntryCombo);
+ focus_chain = g_list_prepend (focus_chain, TrackTotalEntry);
+ focus_chain = g_list_prepend (focus_chain, GenreCombo);
+ focus_chain = g_list_prepend (focus_chain, CommentEntry);
+ focus_chain = g_list_prepend (focus_chain, ComposerEntry);
+ focus_chain = g_list_prepend (focus_chain, OrigArtistEntry);
+ focus_chain = g_list_prepend (focus_chain, CopyrightEntry);
+ focus_chain = g_list_prepend (focus_chain, URLEntry);
+ focus_chain = g_list_prepend (focus_chain, EncodedByEntry);
+ /* To loop to the beginning. */
+ focus_chain = g_list_prepend (focus_chain, TitleEntry);
+ /* More efficient than using g_list_append(), which must traverse the
+ * whole list. */
+ focus_chain = g_list_reverse (focus_chain);
+ gtk_container_set_focus_chain (GTK_CONTAINER (table), focus_chain);
+
+
+ /*
+ * 2 - Page for extra tag fields
+ */
+ /* Also used in ET_Display_File_Tag_To_UI. */
+ label = gtk_label_new (_("Images"));
+
+ priv->images_tab = table = et_grid_new (1, 2);
+ gtk_notebook_append_page (GTK_NOTEBOOK (TagNoteBook), table, label);
+ gtk_container_set_border_width (GTK_CONTAINER (table), 2);
+
+ /* Scroll window for PictureEntryView. */
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
+ et_grid_attach_full (GTK_GRID (table), scrolled_window, 0, 0, 1, 1,
+ TRUE, TRUE, TablePadding, TablePadding);
+
+ priv->images_model = gtk_list_store_new (PICTURE_COLUMN_COUNT,
+ GDK_TYPE_PIXBUF, G_TYPE_STRING,
+ G_TYPE_POINTER);
+ PictureEntryView = gtk_tree_view_new_with_model (GTK_TREE_MODEL (priv->images_model));
+ g_object_unref (priv->images_model);
+ gtk_container_add (GTK_CONTAINER (scrolled_window), PictureEntryView);
+ gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (PictureEntryView), FALSE);
+ gtk_widget_set_size_request (PictureEntryView, -1, 200);
+ gtk_widget_set_tooltip_text (PictureEntryView,
+ _("You can use drag and drop to add an image"));
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (PictureEntryView));
+ gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
+
+ renderer = gtk_cell_renderer_pixbuf_new ();
+ column = gtk_tree_view_column_new ();
+ gtk_tree_view_column_pack_start (column, renderer, FALSE);
+ gtk_tree_view_column_set_attributes (column, renderer, "pixbuf",
+ PICTURE_COLUMN_PIC, NULL);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (PictureEntryView), column);
+ gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+
+ renderer = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new ();
+ gtk_tree_view_column_pack_start (column, renderer, FALSE);
+ gtk_tree_view_column_set_attributes (column, renderer, "text",
+ PICTURE_COLUMN_TEXT, NULL);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (PictureEntryView), column);
+ gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+
+ /* Activate Drag'n'Drop for the PictureEntryView. */
+ gtk_drag_dest_set(GTK_WIDGET(PictureEntryView),
+ GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
+ drops, sizeof(drops) / sizeof(GtkTargetEntry),
+ GDK_ACTION_COPY);
+ g_signal_connect (PictureEntryView, "drag-data-received",
+ G_CALLBACK (Tag_Area_Picture_Drag_Data), 0);
+ g_signal_connect (selection, "changed",
+ G_CALLBACK (Picture_Selection_Changed_cb), NULL);
+ g_signal_connect (PictureEntryView, "button-press-event",
+ G_CALLBACK (Picture_Entry_View_Button_Pressed), NULL);
+ g_signal_connect (PictureEntryView, "key-press-event",
+ G_CALLBACK (Picture_Entry_View_Key_Pressed), NULL);
+
+ /* Picture action toolbar. */
+ toolbar = gtk_toolbar_new ();
+ gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
+ gtk_toolbar_set_icon_size (GTK_TOOLBAR (toolbar), GTK_ICON_SIZE_MENU);
+ et_grid_attach_full (GTK_GRID (table), toolbar, 0, 1, 1, 1, FALSE, FALSE,
+ TablePadding, TablePadding);
+
+ /* TODO: Make the icons use the symbolic variants. */
+ icon = g_themed_icon_new_with_default_fallbacks ("list-add");
+ image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
+ add_image_toolitem = gtk_tool_button_new (image, NULL);
+ g_object_unref (icon);
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), add_image_toolitem, -1);
+ gtk_widget_set_tooltip_text (GTK_WIDGET (add_image_toolitem),
+ _("Add images to the tag"));
+ g_signal_connect (add_image_toolitem, "clicked",
+ G_CALLBACK (Picture_Add_Button_Clicked), NULL);
+
+ /* Activate Drag'n'Drop for the add_image_toolitem. */
+ gtk_drag_dest_set (GTK_WIDGET (add_image_toolitem),
+ GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
+ drops, sizeof(drops) / sizeof(GtkTargetEntry),
+ GDK_ACTION_COPY);
+ g_signal_connect (add_image_toolitem, "drag-data-received",
+ G_CALLBACK (Tag_Area_Picture_Drag_Data), 0);
+
+ icon = g_themed_icon_new_with_default_fallbacks ("list-remove");
+ image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
+ remove_image_toolitem = gtk_tool_button_new (image, NULL);
+ g_object_unref (icon);
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), remove_image_toolitem, -1);
+ gtk_widget_set_tooltip_text (GTK_WIDGET (remove_image_toolitem),
+ _("Remove selected images from the tag"));
+ gtk_widget_set_sensitive (GTK_WIDGET (remove_image_toolitem), FALSE);
+ g_signal_connect (remove_image_toolitem, "clicked",
+ G_CALLBACK (Picture_Clear_Button_Clicked), NULL);
+
+ toolitem = gtk_separator_tool_item_new ();
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitem, -1);
+
+ icon = g_themed_icon_new_with_default_fallbacks ("document-save");
+ image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
+ save_image_toolitem = gtk_tool_button_new (image, NULL);
+ g_object_unref (icon);
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), save_image_toolitem, -1);
+ gtk_widget_set_tooltip_text (GTK_WIDGET (save_image_toolitem),
+ _("Save the selected images to files"));
+ gtk_widget_set_sensitive (GTK_WIDGET (save_image_toolitem), FALSE);
+ g_signal_connect (save_image_toolitem, "clicked",
+ G_CALLBACK (Picture_Save_Button_Clicked), NULL);
+
+ icon = g_themed_icon_new_with_default_fallbacks ("document-properties");
+ image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
+ image_properties_toolitem = gtk_tool_button_new (image, NULL);
+ g_object_unref (icon);
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), image_properties_toolitem, -1);
+ gtk_widget_set_tooltip_text (GTK_WIDGET (image_properties_toolitem),
+ _("Edit image properties"));
+ gtk_widget_set_sensitive (GTK_WIDGET (image_properties_toolitem), FALSE);
+ g_signal_connect (image_properties_toolitem, "clicked",
+ G_CALLBACK (Picture_Properties_Button_Clicked), NULL);
+
+ toolitem = gtk_separator_tool_item_new ();
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitem, -1);
+
+ icon = g_themed_icon_new_with_default_fallbacks ("insert-image");
+ image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
+ priv->apply_image_toolitem = gtk_tool_button_new (image, NULL);
+ g_object_unref (icon);
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->apply_image_toolitem, -1);
+ gtk_widget_set_tooltip_text (GTK_WIDGET (priv->apply_image_toolitem),
+ _("Tag selected files with these images"));
+ g_signal_connect (priv->apply_image_toolitem, "clicked",
+ G_CALLBACK (Mini_Button_Clicked), NULL);
+
+ /*Attach_Popup_Menu_To_Tag_Entries (GTK_ENTRY (PictureEntryView));*/
+
+ gtk_widget_show_all (TagFrame);
+ return TagFrame;
+}
+
+
+static void
+et_application_window_finalize (GObject *object)
+{
+ G_OBJECT_CLASS (et_application_window_parent_class)->finalize (object);
+}
+
+static void
+et_application_window_init (EtApplicationWindow *self)
+{
+ EtApplicationWindowPrivate *priv;
+ GtkWindow *window;
+ GtkWidget *main_vbox;
+ GtkWidget *hbox, *vbox;
+ GtkWidget *widget;
+
+ priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
+ ET_TYPE_APPLICATION_WINDOW,
+ EtApplicationWindowPrivate);
+
+ window = GTK_WINDOW (self);
+
+ gtk_window_set_icon_name (window, PACKAGE_TARNAME);
+ gtk_window_set_title (window, PACKAGE_NAME);
+
+ g_signal_connect (self, "delete-event", G_CALLBACK(Quit_MainWindow), NULL);
+ g_signal_connect (self, "destroy", G_CALLBACK (Quit_MainWindow), NULL);
+
+ /* Mainvbox for Menu bar + Tool bar + "Browser Area & FileArea & TagArea" + Log Area + "Status bar &
Progress bar" */
+ main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_container_add (GTK_CONTAINER (self), main_vbox);
+
+ /* Menu bar and tool bar. */
+ {
+ GtkWidget *menu_area;
+ GtkWidget *tool_area;
+
+ Create_UI (window, &menu_area, &tool_area);
+ gtk_box_pack_start (GTK_BOX (main_vbox), menu_area, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (main_vbox), tool_area, FALSE, FALSE, 0);
+ }
+
+ /* The two panes: BrowserArea on the left, FileArea+TagArea on the right */
+ priv->hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
+
+ /* Browser (Tree + File list + Entry) */
+ widget = create_browser_area ();
+ gtk_paned_pack1 (GTK_PANED (priv->hpaned), widget, TRUE, TRUE);
+
+ /* Vertical box for FileArea + TagArea */
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_paned_pack2 (GTK_PANED (priv->hpaned), vbox, FALSE, FALSE);
+
+ /* File */
+ priv->file_area = create_file_area ();
+ gtk_box_pack_start (GTK_BOX (vbox), priv->file_area, FALSE, FALSE, 0);
+
+ /* Tag */
+ priv->tag_area = create_tag_area (self);
+ gtk_box_pack_start (GTK_BOX (vbox), priv->tag_area, FALSE, FALSE, 0);
+
+ /* Vertical pane for Browser Area + FileArea + TagArea */
+ priv->vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
+ gtk_box_pack_start (GTK_BOX (main_vbox), priv->vpaned, TRUE, TRUE, 0);
+ gtk_paned_pack1 (GTK_PANED (priv->vpaned), priv->hpaned, TRUE,
+ FALSE);
+
+
+ /* Log */
+ priv->log_area = Create_Log_Area ();
+ gtk_paned_pack2 (GTK_PANED (priv->vpaned), priv->log_area, FALSE, TRUE);
+
+ /* Horizontal box for Status bar + Progress bar */
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show (hbox);
+
+ /* Status bar */
+ widget = Create_Status_Bar ();
+ gtk_box_pack_start (GTK_BOX (hbox), widget, TRUE, TRUE, 0);
+
+ /* Progress bar */
+ widget = Create_Progress_Bar ();
+ gtk_box_pack_end (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
+
+ gtk_widget_show_all (GTK_WIDGET (self));
+}
+
+static void
+et_application_window_class_init (EtApplicationWindowClass *klass)
+{
+ G_OBJECT_CLASS (klass)->finalize = et_application_window_finalize;
+
+ g_type_class_add_private (klass, sizeof (EtApplicationWindowPrivate));
+}
+
+/*
+ * et_application_window_new:
+ *
+ * Create a new EtApplicationWindow instance.
+ *
+ * Returns: a new #EtApplicationWindow
+ */
+EtApplicationWindow *
+et_application_window_new (void)
+{
+ return g_object_new (ET_TYPE_APPLICATION_WINDOW, "type",
+ GTK_WINDOW_TOPLEVEL, NULL);
+}
+
+void
+et_application_window_hide_log_area (EtApplicationWindow *self)
+{
+ EtApplicationWindowPrivate *priv;
+
+ g_return_if_fail (self != NULL);
+
+ priv = et_application_window_get_instance_private (self);
+
+ gtk_widget_show_all (priv->log_area);
+}
+
+void
+et_application_window_show_log_area (EtApplicationWindow *self)
+{
+ EtApplicationWindowPrivate *priv;
+
+ g_return_if_fail (self != NULL);
+
+ priv = et_application_window_get_instance_private (self);
+
+ gtk_widget_hide (priv->log_area);
+}
+
+/*
+ * Disable (FALSE) / Enable (TRUE) all user widgets in the tag area
+ */
+void
+et_application_window_tag_area_set_sensitive (EtApplicationWindow *self,
+ gboolean sensitive)
+{
+ EtApplicationWindowPrivate *priv;
+
+ g_return_if_fail (ET_APPLICATION_WINDOW (self));
+
+ priv = et_application_window_get_instance_private (self);
+
+ g_return_if_fail (priv->tag_area != NULL);
+
+ /* TAG Area (entries + buttons). */
+ gtk_widget_set_sensitive (gtk_bin_get_child (GTK_BIN (priv->tag_area)),
+ sensitive);
+}
+
+/*
+ * Disable (FALSE) / Enable (TRUE) all user widgets in the file area
+ */
+void
+et_application_window_file_area_set_sensitive (EtApplicationWindow *self,
+ gboolean sensitive)
+{
+ EtApplicationWindowPrivate *priv;
+
+ g_return_if_fail (ET_APPLICATION_WINDOW (self));
+
+ priv = et_application_window_get_instance_private (self);
+
+ g_return_if_fail (priv->file_area != NULL);
+
+ /* File Area. */
+ gtk_widget_set_sensitive (gtk_bin_get_child (GTK_BIN (priv->file_area)),
+ sensitive);
+}
+
+static void
+et_application_window_hide_images_tab (EtApplicationWindow *self)
+{
+ EtApplicationWindowPrivate *priv;
+
+ priv = et_application_window_get_instance_private (self);
+
+ gtk_widget_hide (priv->images_tab);
+}
+
+static void
+et_application_window_show_images_tab (EtApplicationWindow *self)
+{
+ EtApplicationWindowPrivate *priv;
+
+ priv = et_application_window_get_instance_private (self);
+
+ gtk_widget_show (priv->images_tab);
+}
+
+/*
+ * Display controls according the kind of tag... (Hide some controls if not available for a tag type)
+ */
+void
+et_application_window_tag_area_display_controls (EtApplicationWindow *self,
+ ET_File *ETFile)
+{
+ EtApplicationWindowPrivate *priv;
+
+ g_return_if_fail (ET_APPLICATION_WINDOW (self));
+ g_return_if_fail (ETFile != NULL && ETFile->ETFileDescription != NULL);
+
+ priv = et_application_window_get_instance_private (self);
+
+ g_return_if_fail (priv->title_label != NULL);
+
+ /* Common controls for all tags. */
+ gtk_widget_show (GTK_WIDGET (priv->title_label));
+ gtk_widget_show(GTK_WIDGET(TitleEntry));
+ gtk_widget_show (GTK_WIDGET (priv->artist_label));
+ gtk_widget_show(GTK_WIDGET(ArtistEntry));
+ gtk_widget_show (GTK_WIDGET (priv->album_artist_label));
+ gtk_widget_show(GTK_WIDGET(AlbumArtistEntry));
+ gtk_widget_show (GTK_WIDGET (priv->album_label));
+ gtk_widget_show(GTK_WIDGET(AlbumEntry));
+ gtk_widget_show (GTK_WIDGET (priv->year_label));
+ gtk_widget_show(GTK_WIDGET(YearEntry));
+ gtk_widget_show (GTK_WIDGET (priv->track_label));
+ gtk_widget_show(GTK_WIDGET(TrackEntryCombo));
+ gtk_widget_show(GTK_WIDGET(TrackTotalEntry));
+ gtk_widget_show(GTK_WIDGET(priv->track_sequence_button));
+ gtk_widget_show(GTK_WIDGET(priv->track_number_button));
+ gtk_widget_show (GTK_WIDGET (priv->genre_label));
+ gtk_widget_show(GTK_WIDGET(GenreCombo));
+ gtk_widget_show (GTK_WIDGET (priv->comment_label));
+ gtk_widget_show(GTK_WIDGET(CommentEntry));
+
+ // Special controls to display or not!
+ switch (ETFile->ETFileDescription->TagType)
+ {
+ case ID3_TAG:
+ if (!FILE_WRITING_ID3V2_WRITE_TAG)
+ {
+ // ID3v1 : Hide specifics ID3v2 fields if not activated!
+ gtk_widget_hide (GTK_WIDGET (priv->disc_number_label));
+ gtk_widget_hide(GTK_WIDGET(DiscNumberEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->composer_label));
+ gtk_widget_hide(GTK_WIDGET(ComposerEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->orig_artist_label));
+ gtk_widget_hide(GTK_WIDGET(OrigArtistEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->copyright_label));
+ gtk_widget_hide(GTK_WIDGET(CopyrightEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->url_label));
+ gtk_widget_hide(GTK_WIDGET(URLEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->encoded_by_label));
+ gtk_widget_hide(GTK_WIDGET(EncodedByEntry));
+ et_application_window_hide_images_tab (self);
+ }else
+ {
+ gtk_widget_show (GTK_WIDGET (priv->disc_number_label));
+ gtk_widget_show(GTK_WIDGET(DiscNumberEntry));
+ gtk_widget_show (GTK_WIDGET (priv->composer_label));
+ gtk_widget_show(GTK_WIDGET(ComposerEntry));
+ gtk_widget_show (GTK_WIDGET (priv->orig_artist_label));
+ gtk_widget_show(GTK_WIDGET(OrigArtistEntry));
+ gtk_widget_show (GTK_WIDGET (priv->copyright_label));
+ gtk_widget_show(GTK_WIDGET(CopyrightEntry));
+ gtk_widget_show (GTK_WIDGET (priv->url_label));
+ gtk_widget_show(GTK_WIDGET(URLEntry));
+ gtk_widget_show (GTK_WIDGET (priv->encoded_by_label));
+ gtk_widget_show(GTK_WIDGET(EncodedByEntry));
+ et_application_window_show_images_tab (self);
+ }
+ break;
+
+#ifdef ENABLE_OGG
+ case OGG_TAG:
+ gtk_widget_show (GTK_WIDGET (priv->disc_number_label));
+ gtk_widget_show(GTK_WIDGET(DiscNumberEntry));
+ gtk_widget_show (GTK_WIDGET (priv->composer_label));
+ gtk_widget_show(GTK_WIDGET(ComposerEntry));
+ gtk_widget_show (GTK_WIDGET (priv->orig_artist_label));
+ gtk_widget_show(GTK_WIDGET(OrigArtistEntry));
+ gtk_widget_show (GTK_WIDGET (priv->copyright_label));
+ gtk_widget_show(GTK_WIDGET(CopyrightEntry));
+ gtk_widget_show (GTK_WIDGET (priv->url_label));
+ gtk_widget_show(GTK_WIDGET(URLEntry));
+ gtk_widget_show (GTK_WIDGET (priv->encoded_by_label));
+ gtk_widget_show(GTK_WIDGET(EncodedByEntry));
+ et_application_window_show_images_tab (self);
+ break;
+#endif
+
+#ifdef ENABLE_FLAC
+ case FLAC_TAG:
+ gtk_widget_show (GTK_WIDGET (priv->disc_number_label));
+ gtk_widget_show(GTK_WIDGET(DiscNumberEntry));
+ gtk_widget_show (GTK_WIDGET (priv->composer_label));
+ gtk_widget_show(GTK_WIDGET(ComposerEntry));
+ gtk_widget_show (GTK_WIDGET (priv->orig_artist_label));
+ gtk_widget_show(GTK_WIDGET(OrigArtistEntry));
+ gtk_widget_show (GTK_WIDGET (priv->copyright_label));
+ gtk_widget_show(GTK_WIDGET(CopyrightEntry));
+ gtk_widget_show (GTK_WIDGET (priv->url_label));
+ gtk_widget_show(GTK_WIDGET(URLEntry));
+ gtk_widget_show (GTK_WIDGET (priv->encoded_by_label));
+ gtk_widget_show(GTK_WIDGET(EncodedByEntry));
+ et_application_window_show_images_tab (self);
+ break;
+#endif
+
+ case APE_TAG:
+ gtk_widget_show (GTK_WIDGET (priv->disc_number_label));
+ gtk_widget_show(GTK_WIDGET(DiscNumberEntry));
+ gtk_widget_show (GTK_WIDGET (priv->composer_label));
+ gtk_widget_show(GTK_WIDGET(ComposerEntry));
+ gtk_widget_show (GTK_WIDGET (priv->orig_artist_label));
+ gtk_widget_show(GTK_WIDGET(OrigArtistEntry));
+ gtk_widget_show (GTK_WIDGET (priv->copyright_label));
+ gtk_widget_show(GTK_WIDGET(CopyrightEntry));
+ gtk_widget_show (GTK_WIDGET (priv->url_label));
+ gtk_widget_show(GTK_WIDGET(URLEntry));
+ gtk_widget_show (GTK_WIDGET (priv->encoded_by_label));
+ gtk_widget_show(GTK_WIDGET(EncodedByEntry));
+ et_application_window_show_images_tab (self);
+ break;
+
+#ifdef ENABLE_MP4
+ case MP4_TAG:
+ gtk_widget_hide (GTK_WIDGET (priv->disc_number_label));
+ gtk_widget_hide(GTK_WIDGET(DiscNumberEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->composer_label));
+ gtk_widget_hide(GTK_WIDGET(ComposerEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->orig_artist_label));
+ gtk_widget_hide(GTK_WIDGET(OrigArtistEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->copyright_label));
+ gtk_widget_hide(GTK_WIDGET(CopyrightEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->url_label));
+ gtk_widget_hide(GTK_WIDGET(URLEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->encoded_by_label));
+ gtk_widget_hide(GTK_WIDGET(EncodedByEntry));
+ et_application_window_hide_images_tab (self);
+ break;
+#endif
+
+#ifdef ENABLE_WAVPACK
+ case WAVPACK_TAG:
+ gtk_widget_show (GTK_WIDGET (priv->disc_number_label));
+ gtk_widget_show(GTK_WIDGET(DiscNumberEntry));
+ gtk_widget_show (GTK_WIDGET (priv->composer_label));
+ gtk_widget_show(GTK_WIDGET(ComposerEntry));
+ gtk_widget_show (GTK_WIDGET (priv->orig_artist_label));
+ gtk_widget_show(GTK_WIDGET(OrigArtistEntry));
+ gtk_widget_show (GTK_WIDGET (priv->copyright_label));
+ gtk_widget_show(GTK_WIDGET(CopyrightEntry));
+ gtk_widget_show (GTK_WIDGET (priv->url_label));
+ gtk_widget_show(GTK_WIDGET(URLEntry));
+ gtk_widget_show (GTK_WIDGET (priv->encoded_by_label));
+ gtk_widget_show(GTK_WIDGET(EncodedByEntry));
+ et_application_window_hide_images_tab (self);
+ break;
+#endif /* ENABLE_WAVPACK */
+
+ case UNKNOWN_TAG:
+ default:
+ gtk_widget_hide (GTK_WIDGET (priv->disc_number_label));
+ gtk_widget_hide(GTK_WIDGET(DiscNumberEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->composer_label));
+ gtk_widget_hide(GTK_WIDGET(ComposerEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->orig_artist_label));
+ gtk_widget_hide(GTK_WIDGET(OrigArtistEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->copyright_label));
+ gtk_widget_hide(GTK_WIDGET(CopyrightEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->url_label));
+ gtk_widget_hide(GTK_WIDGET(URLEntry));
+ gtk_widget_hide (GTK_WIDGET (priv->encoded_by_label));
+ gtk_widget_hide(GTK_WIDGET(EncodedByEntry));
+ et_application_window_hide_images_tab (self);
+ break;
+ }
+}
diff --git a/src/application_window.h b/src/application_window.h
new file mode 100644
index 0000000..1545d2c
--- /dev/null
+++ b/src/application_window.h
@@ -0,0 +1,58 @@
+/* EasyTAG - tag editor for audio files
+ * Copyright (C) 2013 David King <amigadave amigadave com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef ET_APPLICATION_WINDOW_H_
+#define ET_APPLICATION_WINDOW_H_
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#include "et_core.h"
+
+#define ET_TYPE_APPLICATION_WINDOW (et_application_window_get_type ())
+#define ET_APPLICATION_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), ET_TYPE_APPLICATION_WINDOW,
EtApplicationWindow))
+
+typedef struct _EtApplicationWindow EtApplicationWindow;
+typedef struct _EtApplicationWindowClass EtApplicationWindowClass;
+typedef struct _EtApplicationWindowPrivate EtApplicationWindowPrivate;
+
+struct _EtApplicationWindow
+{
+ /*< private >*/
+ GtkWindow parent_instance;
+ EtApplicationWindowPrivate *priv;
+};
+
+struct _EtApplicationWindowClass
+{
+ /*< private >*/
+ GtkWindowClass parent_class;
+};
+
+GType et_application_window_get_type (void);
+EtApplicationWindow *et_application_window_new (void);
+void et_application_window_tag_area_set_sensitive (EtApplicationWindow *self, gboolean sensitive);
+void et_application_window_file_area_set_sensitive (EtApplicationWindow *self, gboolean sensitive);
+void et_application_window_tag_area_display_controls (EtApplicationWindow *self, ET_File *ETFile);
+void et_application_window_hide_log_area (EtApplicationWindow *self);
+void et_application_window_show_log_area (EtApplicationWindow *self);
+
+G_END_DECLS
+
+#endif /* !ET_APPLICATION_WINDOW_H_ */
diff --git a/src/bar.c b/src/bar.c
index 1fe4f5d..d7c70c9 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -131,7 +131,8 @@ Menu_Sort_Action (GtkAction *item, gpointer data)
Browser_List_Refresh_Sort ();
}
-void Create_UI (GtkWidget **ppmenubar, GtkWidget **pptoolbar)
+void
+Create_UI (GtkWindow *window, GtkWidget **ppmenubar, GtkWidget **pptoolbar)
{
GtkWidget *menubar;
GtkWidget *toolbar;
@@ -423,7 +424,8 @@ void Create_UI (GtkWidget **ppmenubar, GtkWidget **pptoolbar)
g_error_free(error);
}
gtk_ui_manager_insert_action_group(UIManager, ActionGroup, 0);
- gtk_window_add_accel_group(GTK_WINDOW(MainWindow), gtk_ui_manager_get_accel_group(UIManager));
+ gtk_window_add_accel_group (window,
+ gtk_ui_manager_get_accel_group (UIManager));
menubar = gtk_ui_manager_get_widget(UIManager, "/MenuBar");
Init_Menu_Bar();
diff --git a/src/bar.h b/src/bar.h
index d189a4e..3562ada 100644
--- a/src/bar.h
+++ b/src/bar.h
@@ -162,7 +162,7 @@ struct _Action_Pair {
* Prototypes *
**************/
-void Create_UI (GtkWidget **menubar, GtkWidget **toolbar);
+void Create_UI (GtkWindow *window, GtkWidget **menubar, GtkWidget **toolbar);
GtkWidget *Create_Status_Bar (void);
void Statusbar_Message (const gchar *message, gboolean with_timer);
GtkWidget *Create_Progress_Bar (void);
diff --git a/src/browser.c b/src/browser.c
index 28783ff..94c2248 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -3344,7 +3344,6 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
gtk_paned_pack1(GTK_PANED(ArtistAlbumVPaned),ScrollWindowArtistList,TRUE,TRUE); // Top side
gtk_paned_pack2(GTK_PANED(ArtistAlbumVPaned),ScrollWindowAlbumList,TRUE,TRUE); // Bottom side
- gtk_paned_set_position(GTK_PANED(ArtistAlbumVPaned),PANE_HANDLE_POSITION3);
/*
@@ -3444,7 +3443,6 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
gtk_box_pack_start(GTK_BOX(VerticalBox),BrowserHPaned,TRUE,TRUE,0);
gtk_paned_pack1(GTK_PANED(BrowserHPaned),BrowserNoteBook,TRUE,TRUE); // Left side
gtk_paned_pack2(GTK_PANED(BrowserHPaned),ScrollWindowFileList,TRUE,TRUE); // Right side
- gtk_paned_set_position(GTK_PANED(BrowserHPaned),PANE_HANDLE_POSITION2);
gtk_widget_show_all(VerticalBox);
@@ -3591,7 +3589,6 @@ void Browser_Open_Rename_Directory_Window (void)
gtk_combo_box_text_prepend_text(GTK_COMBO_BOX_TEXT(RenameDirectoryCombo), directory_name_utf8);
gtk_combo_box_text_prepend_text(GTK_COMBO_BOX_TEXT(RenameDirectoryCombo), "");
gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(RenameDirectoryCombo))),directory_name_utf8);
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(RenameDirectoryCombo))));
/* Rename directory : check box + combo box + Status icon */
HBox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, BOX_SPACING);
diff --git a/src/easytag.c b/src/easytag.c
index 863ee3d..0fefb3e 100644
--- a/src/easytag.c
+++ b/src/easytag.c
@@ -67,40 +67,6 @@
****************/
static guint idle_handler_id;
-static GtkWidget *MenuArea;
-static GtkWidget *ToolArea;
-static GtkWidget *BrowseArea;
-static GtkWidget *FileArea;
-static GtkWidget *TagArea;
-static GtkWidget *StatusArea;
-static GtkWidget *ProgressArea;
-static GtkWidget *MainWindowHPaned;
-static GtkWidget *MainWindowVPaned;
-
-/* Labels. */
-static GtkWidget *TitleLabel;
-static GtkWidget *ArtistLabel;
-static GtkWidget *AlbumArtistLabel;
-static GtkWidget *AlbumLabel;
-static GtkWidget *DiscNumberLabel;
-static GtkWidget *YearLabel;
-static GtkWidget *TrackLabel;
-static GtkWidget *GenreLabel;
-static GtkWidget *CommentLabel;
-static GtkWidget *ComposerLabel;
-static GtkWidget *OrigArtistLabel;
-static GtkWidget *CopyrightLabel;
-static GtkWidget *URLLabel;
-static GtkWidget *EncodedByLabel;
-
-/* Mini buttons. */
-static GtkWidget *TrackMButtonSequence;
-static GtkWidget *TrackMButtonNbrFiles;
-
-static GtkListStore *PictureEntryModel;
-
-static GtkWidget *images_tab = NULL;
-static GtkToolItem *apply_image_toolitem = NULL;
static GtkWidget *QuitRecursionWindow = NULL;
/* Used to force to hide the msgbox when saving tag */
@@ -128,13 +94,7 @@ static gint SF_ButtonPressed_Delete_File;
static void Handle_Crash (gint signal_id);
#endif /* !G_OS_WIN32 */
-static GtkWidget *Create_Browser_Area (void);
-static GtkWidget *Create_File_Area (void);
-static GtkWidget *Create_Tag_Area (void);
-
-static void Mini_Button_Clicked (GObject *object);
static void Disable_Command_Buttons (void);
-
static gboolean Write_File_Tag (ET_File *ETFile, gboolean hide_msgbox);
static gint Save_File (ET_File *ETFile, gboolean multiple_files,
gboolean force_saving_files);
@@ -156,13 +116,6 @@ static void Open_Quit_Recursion_Function_Window (void);
static void Destroy_Quit_Recursion_Function_Window (void);
static void et_on_quit_recursion_response (GtkDialog *dialog, gint response_id,
gpointer user_data);
-static void File_Area_Set_Sensitive (gboolean activate);
-static void Tag_Area_Set_Sensitive (gboolean activate);
-
-static void et_tag_field_connect_signals (GtkEntry *entry);
-static gboolean et_tag_field_on_key_press_event (GtkEntry *entry,
- GdkEventKey *event,
- gpointer user_data);
#ifndef G_OS_WIN32
static void
@@ -204,8 +157,7 @@ setup_sigchld (void)
static void
common_init (GApplication *application)
{
- GtkWidget *MainVBox;
- GtkWidget *HBox, *VBox;
+ EtApplicationWindow *window;
/* Starting messages */
Log_Print(LOG_OK,_("Starting EasyTAG version %s (PID: %d)…"),PACKAGE_VERSION,getpid());
@@ -241,8 +193,6 @@ common_init (GApplication *application)
Read_Config();
/* Display_Config(); // <- for debugging */
-
-
/* Initialization */
ET_Core_Create();
Main_Stop_Button_Pressed = FALSE;
@@ -256,88 +206,16 @@ common_init (GApplication *application)
GenreComboModel = NULL;
/* The main window */
- MainWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- et_application_set_window (ET_APPLICATION (application),
- GTK_WINDOW (MainWindow));
- gtk_window_set_title (GTK_WINDOW (MainWindow), PACKAGE_NAME);
- // This part is needed to set correctly the position of handle panes
- gtk_window_set_default_size(GTK_WINDOW(MainWindow),MAIN_WINDOW_WIDTH,MAIN_WINDOW_HEIGHT);
-
- g_signal_connect(G_OBJECT(MainWindow),"delete_event",G_CALLBACK(Quit_MainWindow),NULL);
- g_signal_connect(G_OBJECT(MainWindow),"destroy",G_CALLBACK(Quit_MainWindow),NULL);
+ window = et_application_window_new ();
+ MainWindow = GTK_WIDGET (window);
+ et_application_set_window (ET_APPLICATION (application), window);
/* Minimised window icon */
gtk_widget_realize(MainWindow);
- gtk_window_set_icon_name (GTK_WINDOW (MainWindow), PACKAGE_TARNAME);
-
- /* MainVBox for Menu bar + Tool bar + "Browser Area & FileArea & TagArea" + Log Area + "Status bar &
Progress bar" */
- MainVBox = gtk_box_new(GTK_ORIENTATION_VERTICAL,0);
- gtk_container_add (GTK_CONTAINER(MainWindow),MainVBox);
- gtk_widget_show(MainVBox);
-
- /* Menu bar and tool bar */
- Create_UI(&MenuArea, &ToolArea);
- gtk_box_pack_start(GTK_BOX(MainVBox),MenuArea,FALSE,FALSE,0);
- gtk_box_pack_start(GTK_BOX(MainVBox),ToolArea,FALSE,FALSE,0);
-
-
- /* The two panes: BrowserArea on the left, FileArea+TagArea on the right */
- MainWindowHPaned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
- //gtk_box_pack_start(GTK_BOX(MainVBox),MainWindowHPaned,TRUE,TRUE,0);
- gtk_paned_set_position(GTK_PANED(MainWindowHPaned),PANE_HANDLE_POSITION1);
- gtk_widget_show(MainWindowHPaned);
-
- /* Browser (Tree + File list + Entry) */
- BrowseArea = Create_Browser_Area();
- gtk_paned_pack1(GTK_PANED(MainWindowHPaned),BrowseArea,TRUE,TRUE);
-
- /* Vertical box for FileArea + TagArea */
- VBox = gtk_box_new(GTK_ORIENTATION_VERTICAL,0);
- gtk_paned_pack2(GTK_PANED(MainWindowHPaned),VBox,FALSE,FALSE);
- gtk_widget_show(VBox);
-
- /* File */
- FileArea = Create_File_Area();
- gtk_box_pack_start(GTK_BOX(VBox),FileArea,FALSE,FALSE,0);
-
- /* Tag */
- TagArea = Create_Tag_Area();
- gtk_box_pack_start(GTK_BOX(VBox),TagArea,FALSE,FALSE,0);
-
- /* Vertical pane for Browser Area + FileArea + TagArea */
- MainWindowVPaned = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
- gtk_box_pack_start(GTK_BOX(MainVBox),MainWindowVPaned,TRUE,TRUE,0);
- gtk_paned_pack1(GTK_PANED(MainWindowVPaned),MainWindowHPaned,TRUE,FALSE);
- gtk_paned_set_position(GTK_PANED(MainWindowVPaned),PANE_HANDLE_POSITION4);
- gtk_widget_show(MainWindowVPaned);
-
-
- /* Log */
- LogArea = Create_Log_Area();
- gtk_paned_pack2(GTK_PANED(MainWindowVPaned),LogArea,FALSE,TRUE);
-
- /* Horizontal box for Status bar + Progress bar */
- HBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
- gtk_box_pack_start(GTK_BOX(MainVBox),HBox,FALSE,FALSE,0);
- gtk_widget_show(HBox);
-
- /* Status bar */
- StatusArea = Create_Status_Bar();
- gtk_box_pack_start(GTK_BOX(HBox),StatusArea,TRUE,TRUE,0);
-
- /* Progress bar */
- ProgressArea = Create_Progress_Bar();
- gtk_box_pack_end(GTK_BOX(HBox),ProgressArea,FALSE,FALSE,0);
-
- gtk_widget_show(MainWindow);
-
- if (SET_MAIN_WINDOW_POSITION)
- gtk_window_move(GTK_WINDOW(MainWindow), MAIN_WINDOW_X, MAIN_WINDOW_Y);
-
/* Load the default dir when the UI is created and displayed
* to the screen and open also the scanner window */
- idle_handler_id = g_idle_add((GSourceFunc)Init_Load_Default_Dir,NULL);
+ idle_handler_id = g_idle_add ((GSourceFunc)Init_Load_Default_Dir, NULL);
g_source_set_name_by_id (idle_handler_id, "Init idle function");
gtk_main ();
@@ -400,10 +278,7 @@ check_for_hidden_path_in_tree (GFile *arg)
}
while ((parent = g_file_get_parent (file)) != NULL);
- if (file)
- {
- g_clear_object (&file);
- }
+ g_clear_object (&file);
}
/*
@@ -423,7 +298,7 @@ static void
on_application_open (GApplication *application, GFile **files, gint n_files,
gchar *hint, gpointer user_data)
{
- GtkWindow *main_window;
+ EtApplicationWindow *window;
gboolean activated;
GFile *arg;
GFile *parent;
@@ -433,8 +308,8 @@ on_application_open (GApplication *application, GFile **files, gint n_files,
gchar *path;
gchar *path_utf8;
- main_window = et_application_get_window (ET_APPLICATION (application));
- activated = main_window ? TRUE : FALSE;
+ window = et_application_get_window (ET_APPLICATION (application));
+ activated = window ? TRUE : FALSE;
/* Only take the first file; ignore the rest. */
arg = files[0];
@@ -539,12 +414,13 @@ on_application_open (GApplication *application, GFile **files, gint n_files,
static void
on_application_activate (GApplication *application, gpointer user_data)
{
- GtkWindow *main_window;
+ EtApplicationWindow *window;
- main_window = et_application_get_window (ET_APPLICATION (application));
- if (main_window != NULL)
+ window = et_application_get_window (ET_APPLICATION (application));
+
+ if (window != NULL)
{
- gtk_window_present (main_window);
+ gtk_window_present (GTK_WINDOW (window));
}
else
{
@@ -609,1186 +485,6 @@ int main (int argc, char *argv[])
}
-static GtkWidget *
-Create_Browser_Area (void)
-{
- GtkWidget *Frame;
- GtkWidget *Tree;
-
- Frame = gtk_frame_new(_("Browser"));
- gtk_container_set_border_width(GTK_CONTAINER(Frame), 2);
-
- Tree = Create_Browser_Items(MainWindow);
- gtk_container_add(GTK_CONTAINER(Frame),Tree);
-
- /* Don't load init dir here because Tag area hasn't been yet created!.
- * It will be load at the end of the main function */
- //Browser_Tree_Select_Dir(DEFAULT_PATH_TO_MP3);
-
- gtk_widget_show(Frame);
- return Frame;
-}
-
-
-static GtkWidget *
-Create_File_Area (void)
-{
- GtkWidget *VBox, *HBox;
- GtkWidget *Separator;
-
-
- FileFrame = gtk_frame_new(_("File"));
- gtk_container_set_border_width(GTK_CONTAINER(FileFrame),2);
-
- VBox = gtk_box_new(GTK_ORIENTATION_VERTICAL,0);
- gtk_container_add(GTK_CONTAINER(FileFrame),VBox);
- gtk_container_set_border_width(GTK_CONTAINER(VBox),2);
-
- /* HBox for FileEntry and IconBox */
- HBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,2);
- gtk_box_pack_start(GTK_BOX(VBox),HBox,TRUE,TRUE,0);
-
- /* File index (position in list + list length) */
- FileIndex = gtk_label_new("0/0:");
- gtk_box_pack_start(GTK_BOX(HBox),FileIndex,FALSE,FALSE,0);
-
- /* Filename. */
- FileEntry = gtk_entry_new();
- gtk_editable_set_editable(GTK_EDITABLE(FileEntry), TRUE);
- gtk_box_pack_start(GTK_BOX(HBox),FileEntry,TRUE,TRUE,2);
-
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(FileEntry));
-
-
- /*
- * File Infos
- */
- HeaderInfosTable = et_grid_new(3,5);
- gtk_container_add(GTK_CONTAINER(VBox),HeaderInfosTable);
- gtk_container_set_border_width(GTK_CONTAINER(HeaderInfosTable),2);
- gtk_grid_set_row_spacing (GTK_GRID (HeaderInfosTable), 1);
- gtk_grid_set_column_spacing (GTK_GRID (HeaderInfosTable), 2);
-
- VersionLabel = gtk_label_new(_("Encoder:"));
- gtk_grid_attach (GTK_GRID (HeaderInfosTable), VersionLabel, 0, 0, 1, 1);
- VersionValueLabel = gtk_label_new("");
- gtk_grid_attach (GTK_GRID (HeaderInfosTable), VersionValueLabel, 1, 0, 1,
- 1);
- gtk_misc_set_alignment(GTK_MISC(VersionLabel),1,0.5);
- gtk_misc_set_alignment(GTK_MISC(VersionValueLabel),0,0.5);
-
- BitrateLabel = gtk_label_new(_("Bitrate:"));
- gtk_grid_attach (GTK_GRID (HeaderInfosTable), BitrateLabel, 0, 1, 1, 1);
- BitrateValueLabel = gtk_label_new("");
- gtk_grid_attach (GTK_GRID (HeaderInfosTable), BitrateValueLabel, 1, 1, 1,
- 1);
- gtk_misc_set_alignment(GTK_MISC(BitrateLabel),1,0.5);
- gtk_misc_set_alignment(GTK_MISC(BitrateValueLabel),0,0.5);
-
- /* Translators: Please try to keep this string as short as possible as it
- * is shown in a narrow column. */
- SampleRateLabel = gtk_label_new (_("Frequency:"));
- gtk_grid_attach (GTK_GRID (HeaderInfosTable), SampleRateLabel, 0, 2, 1, 1);
- SampleRateValueLabel = gtk_label_new("");
- gtk_grid_attach (GTK_GRID (HeaderInfosTable), SampleRateValueLabel, 1, 2,
- 1, 1);
- gtk_misc_set_alignment(GTK_MISC(SampleRateLabel),1,0.5);
- gtk_misc_set_alignment(GTK_MISC(SampleRateValueLabel),0,0.5);
-
- Separator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
- gtk_grid_attach (GTK_GRID (HeaderInfosTable), Separator, 2, 0, 1, 4);
-
- ModeLabel = gtk_label_new(_("Mode:"));
- gtk_grid_attach (GTK_GRID (HeaderInfosTable), ModeLabel, 3, 0, 1, 1);
- ModeValueLabel = gtk_label_new("");
- gtk_grid_attach (GTK_GRID (HeaderInfosTable), ModeValueLabel, 4, 0, 1, 1);
- gtk_misc_set_alignment(GTK_MISC(ModeLabel),1,0.5);
- gtk_misc_set_alignment(GTK_MISC(ModeValueLabel),0,0.5);
-
- SizeLabel = gtk_label_new(_("Size:"));
- gtk_grid_attach (GTK_GRID (HeaderInfosTable), SizeLabel, 3, 1, 1, 1);
- SizeValueLabel = gtk_label_new("");
- gtk_grid_attach (GTK_GRID (HeaderInfosTable), SizeValueLabel, 4, 1, 1, 1);
- gtk_misc_set_alignment(GTK_MISC(SizeLabel),1,0.5);
- gtk_misc_set_alignment(GTK_MISC(SizeValueLabel),0,0.5);
-
- DurationLabel = gtk_label_new(_("Duration:"));
- gtk_grid_attach (GTK_GRID (HeaderInfosTable), DurationLabel, 3, 2, 1, 1);
- DurationValueLabel = gtk_label_new("");
- gtk_grid_attach (GTK_GRID (HeaderInfosTable), DurationValueLabel, 4, 2, 1,
- 1);
- gtk_misc_set_alignment(GTK_MISC(DurationLabel),1,0.5);
- gtk_misc_set_alignment(GTK_MISC(DurationValueLabel),0,0.5);
-
- gtk_widget_show(FileFrame);
- gtk_widget_show(VBox);
- gtk_widget_show(HBox);
- gtk_widget_show(FileIndex);
- gtk_widget_show(FileEntry);
- if (SHOW_HEADER_INFO)
- gtk_widget_show_all(HeaderInfosTable);
- return FileFrame;
-}
-
-#include "data/pixmaps/sequence_track.xpm"
-static GtkWidget *
-Create_Tag_Area (void)
-{
- GtkWidget *Separator;
- GtkWidget *Table;
- GtkWidget *Label;
- GtkWidget *Icon;
- GtkWidget *PictureScrollWindow;
- GtkWidget *toolbar;
- GtkToolItem *toolitem;
- GIcon *icon;
- GtkWidget *image;
- GtkWidget *VBox;
- GList *focusable_widgets_list = NULL;
- //GtkWidget *ScrollWindow;
- //GtkTextBuffer *TextBuffer;
- GtkEntryCompletion *completion;
- gint MButtonSize = 13;
- gint TablePadding = 2;
-
- // For Picture
- static const GtkTargetEntry drops[] = { { "text/uri-list", 0, TARGET_URI_LIST } };
- GtkCellRenderer *renderer;
- GtkTreeViewColumn *column;
- GtkTreeSelection *selection;
-
-
- /* Main Frame */
- TagFrame = gtk_frame_new(_("Tag"));
- gtk_container_set_border_width(GTK_CONTAINER(TagFrame),2);
-
- /* Box for the notebook (only for setting a border) */
- VBox = gtk_box_new(GTK_ORIENTATION_VERTICAL,0);
- gtk_container_add(GTK_CONTAINER(TagFrame),VBox);
- gtk_container_set_border_width(GTK_CONTAINER(VBox),2);
-
- /*
- * Note book
- */
- TagNoteBook = gtk_notebook_new();
- gtk_notebook_popup_enable(GTK_NOTEBOOK(TagNoteBook));
- //gtk_container_add(GTK_CONTAINER(TagFrame),TagNoteBook);
- gtk_box_pack_start(GTK_BOX(VBox),TagNoteBook,TRUE,TRUE,0);
- gtk_notebook_set_tab_pos(GTK_NOTEBOOK(TagNoteBook),GTK_POS_TOP);
- gtk_notebook_set_show_border(GTK_NOTEBOOK(TagNoteBook),FALSE);
- gtk_notebook_popup_enable(GTK_NOTEBOOK(TagNoteBook));
-
- /*
- * 1 - Page for common tag fields
- */
- Label = gtk_label_new(_("Common"));
-
- Table = et_grid_new (11, 11);
- gtk_notebook_append_page (GTK_NOTEBOOK (TagNoteBook), Table, Label);
- gtk_container_set_border_width(GTK_CONTAINER(Table),2);
-
- /* Title */
- TitleLabel = gtk_label_new(_("Title:"));
- et_grid_attach_full (GTK_GRID (Table), TitleLabel, 0, 0, 1, 1, FALSE,
- FALSE, TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(TitleLabel),1,0.5);
-
- TitleEntry = gtk_entry_new();
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (TitleEntry),
- GTK_ENTRY_ICON_SECONDARY, "insert-text");
- et_grid_attach_full (GTK_GRID (Table), TitleEntry, 1, 0, 9, 1, TRUE, TRUE,
- TablePadding, TablePadding);
-
- et_tag_field_connect_signals (GTK_ENTRY (TitleEntry));
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (TitleEntry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Tag selected files with this title"));
-
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(TitleEntry));
-
- /* Artist */
- ArtistLabel = gtk_label_new(_("Artist:"));
- et_grid_attach_full (GTK_GRID (Table), ArtistLabel, 0, 1, 1, 1, FALSE,
- FALSE, TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(ArtistLabel),1,0.5);
-
- ArtistEntry = gtk_entry_new();
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (ArtistEntry),
- GTK_ENTRY_ICON_SECONDARY, "insert-text");
- et_grid_attach_full (GTK_GRID (Table), ArtistEntry, 1, 1, 9, 1, TRUE, TRUE,
- TablePadding,TablePadding);
-
- et_tag_field_connect_signals (GTK_ENTRY (ArtistEntry));
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (ArtistEntry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Tag selected files with this artist"));
-
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(ArtistEntry));
-
- /* Album Artist */
- AlbumArtistLabel = gtk_label_new(_("Album artist:"));
- et_grid_attach_full (GTK_GRID (Table), AlbumArtistLabel, 0, 2, 1, 1, FALSE,
- FALSE, TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(AlbumArtistLabel),1,0.5);
-
- AlbumArtistEntry = gtk_entry_new();
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (AlbumArtistEntry),
- GTK_ENTRY_ICON_SECONDARY, "insert-text");
- et_grid_attach_full (GTK_GRID (Table), AlbumArtistEntry, 1, 2, 9, 1, TRUE,
- TRUE, TablePadding, TablePadding);
-
- et_tag_field_connect_signals (GTK_ENTRY (AlbumArtistEntry));
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (AlbumArtistEntry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Tag selected files with this album artist"));
-
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(AlbumArtistEntry));
-
- /* Album */
- AlbumLabel = gtk_label_new(_("Album:"));
- et_grid_attach_full (GTK_GRID (Table), AlbumLabel, 0, 3, 1, 1, FALSE,
- FALSE, TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(AlbumLabel),1,0.5);
-
- AlbumEntry = gtk_entry_new();
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (AlbumEntry),
- GTK_ENTRY_ICON_SECONDARY, "insert-text");
- et_grid_attach_full (GTK_GRID (Table), AlbumEntry, 1, 3, 6, 1, TRUE, TRUE,
- TablePadding,TablePadding);
-
- et_tag_field_connect_signals (GTK_ENTRY (AlbumEntry));
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (AlbumEntry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Tag selected files with this album name"));
-
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(AlbumEntry));
-
- /* Disc Number */
- DiscNumberLabel = gtk_label_new(_("CD:"));
- et_grid_attach_full (GTK_GRID (Table), DiscNumberLabel, 8, 3, 1, 1, FALSE,
- FALSE, TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(DiscNumberLabel),1,0.5);
-
- DiscNumberEntry = gtk_entry_new();
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (DiscNumberEntry),
- GTK_ENTRY_ICON_SECONDARY, "insert-text");
- et_grid_attach_full (GTK_GRID (Table), DiscNumberEntry, 9, 3, 1, 1, TRUE,
- TRUE, TablePadding, TablePadding);
- gtk_entry_set_width_chars (GTK_ENTRY (DiscNumberEntry), 3);
- /* FIXME should allow to type only something like : 1/3. */
-
/*g_signal_connect(G_OBJECT(GTK_ENTRY(DiscNumberEntry)),"insert_text",G_CALLBACK(Insert_Only_Digit),NULL); */
-
- et_tag_field_connect_signals (GTK_ENTRY (DiscNumberEntry));
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (DiscNumberEntry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Tag selected files with this disc number"));
-
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(DiscNumberEntry));
-
- /* Year */
- YearLabel = gtk_label_new(_("Year:"));
- et_grid_attach_full (GTK_GRID (Table), YearLabel, 0, 4, 1, 1, FALSE, FALSE,
- TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(YearLabel),1,0.5);
-
- YearEntry = gtk_entry_new();
- gtk_entry_set_max_length(GTK_ENTRY(YearEntry), 4);
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (YearEntry),
- GTK_ENTRY_ICON_SECONDARY, "insert-text");
- et_grid_attach_full (GTK_GRID (Table), YearEntry, 1, 4, 1, 1, TRUE, TRUE,
- TablePadding, TablePadding);
- gtk_entry_set_width_chars (GTK_ENTRY (YearEntry), 5);
- g_signal_connect (G_OBJECT (YearEntry), "insert-text",
- G_CALLBACK (Insert_Only_Digit), NULL);
- g_signal_connect(G_OBJECT(YearEntry),"activate",G_CALLBACK(Parse_Date),NULL);
- g_signal_connect(G_OBJECT(YearEntry),"focus-out-event",G_CALLBACK(Parse_Date),NULL);
-
- et_tag_field_connect_signals (GTK_ENTRY (YearEntry));
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (YearEntry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Tag selected files with this year"));
-
- /* Small vertical separator */
- Separator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
- et_grid_attach_full (GTK_GRID (Table), Separator, 3, 4, 1, 1, FALSE, FALSE,
- TablePadding,TablePadding);
-
-
- /* Track and Track total */
- TrackMButtonSequence = gtk_button_new();
- gtk_widget_set_size_request(TrackMButtonSequence,MButtonSize,MButtonSize);
- et_grid_attach_full (GTK_GRID (Table), TrackMButtonSequence, 4, 4, 1, 1,
- FALSE, FALSE, TablePadding, TablePadding);
- g_signal_connect(G_OBJECT(TrackMButtonSequence),"clicked",G_CALLBACK(Mini_Button_Clicked),NULL);
- gtk_widget_set_tooltip_text(TrackMButtonSequence,_("Number selected tracks sequentially. "
- "Starts at 01 in each subdirectory."));
- // Pixmap into TrackMButtonSequence button
- //Icon = gtk_image_new_from_stock("easytag-sequence-track", GTK_ICON_SIZE_BUTTON); // FIX ME : it
doesn't display the good size of the '#'
- Icon = Create_Xpm_Image((const char **)sequence_track_xpm);
- gtk_container_add(GTK_CONTAINER(TrackMButtonSequence),Icon);
- gtk_widget_set_can_default(TrackMButtonSequence,TRUE); // To have enough space to display the icon
- gtk_widget_set_can_focus(TrackMButtonSequence,FALSE); // To have enough space to display the icon
-
- TrackLabel = gtk_label_new(_("Track #:"));
- et_grid_attach_full (GTK_GRID (Table), TrackLabel, 5, 4, 1, 1, FALSE,
- FALSE, TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(TrackLabel),1,0.5);
-
- if (TrackEntryComboModel != NULL)
- gtk_list_store_clear(TrackEntryComboModel);
- else
- TrackEntryComboModel = gtk_list_store_new(MISC_COMBO_COUNT, G_TYPE_STRING);
-
- TrackEntryCombo = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(TrackEntryComboModel));
- gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(TrackEntryCombo),MISC_COMBO_TEXT);
- et_grid_attach_full (GTK_GRID (Table), TrackEntryCombo, 6, 4, 1, 1, TRUE,
- TRUE, TablePadding, TablePadding);
- gtk_combo_box_set_wrap_width(GTK_COMBO_BOX(TrackEntryCombo),3); // Three columns to display track
numbers list
-
- gtk_entry_set_width_chars (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (TrackEntryCombo))),
- 2);
- g_signal_connect(G_OBJECT(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(TrackEntryCombo)))),"insert_text",
- G_CALLBACK(Insert_Only_Digit),NULL);
-
- Label = gtk_label_new("/");
- et_grid_attach_full (GTK_GRID (Table), Label, 7, 4, 1, 1, FALSE, FALSE,
- TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(Label),0.5,0.5);
-
- TrackMButtonNbrFiles = gtk_button_new();
- gtk_widget_set_size_request(TrackMButtonNbrFiles,MButtonSize,MButtonSize);
- et_grid_attach_full (GTK_GRID (Table), TrackMButtonNbrFiles, 8, 4, 1, 1,
- FALSE, FALSE, TablePadding, TablePadding);
- g_signal_connect(G_OBJECT(TrackMButtonNbrFiles),"clicked",G_CALLBACK(Mini_Button_Clicked),NULL);
- gtk_widget_set_tooltip_text(TrackMButtonNbrFiles,_("Set the number of files, in the same directory of
the displayed file, to the selected tracks."));
- // Pixmap into TrackMButtonNbrFiles button
- //Icon = gtk_image_new_from_stock("easytag-sequence-track", GTK_ICON_SIZE_BUTTON);
- Icon = Create_Xpm_Image((const char **)sequence_track_xpm);
- gtk_container_add(GTK_CONTAINER(TrackMButtonNbrFiles),Icon);
- gtk_widget_set_can_default(TrackMButtonNbrFiles,TRUE); // To have enough space to display the icon
- gtk_widget_set_can_focus(TrackMButtonNbrFiles,FALSE); // To have enough space to display the icon
-
- TrackTotalEntry = gtk_entry_new();
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (TrackTotalEntry),
- GTK_ENTRY_ICON_SECONDARY, "insert-text");
- et_grid_attach_full (GTK_GRID (Table), TrackTotalEntry, 9, 4, 1, 1, TRUE,
- TRUE, TablePadding, TablePadding);
- gtk_entry_set_width_chars (GTK_ENTRY (TrackTotalEntry), 3);
- g_signal_connect (G_OBJECT (GTK_ENTRY (TrackTotalEntry)), "insert-text",
- G_CALLBACK (Insert_Only_Digit), NULL);
-
- et_tag_field_connect_signals (GTK_ENTRY (TrackTotalEntry));
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (TrackTotalEntry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Tag selected files with this number of tracks"));
-
-
- /* Genre */
- GenreLabel = gtk_label_new(_("Genre:"));
- et_grid_attach_full (GTK_GRID (Table), GenreLabel, 0, 5, 1, 1, FALSE,
- FALSE, TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(GenreLabel),1,0.5);
-
- if (GenreComboModel != NULL)
- gtk_list_store_clear(GenreComboModel);
- else
- GenreComboModel = gtk_list_store_new(MISC_COMBO_COUNT, G_TYPE_STRING);
- GenreCombo = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(GenreComboModel));
- gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(GenreCombo),MISC_COMBO_TEXT);
- completion = gtk_entry_completion_new();
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (GenreCombo))),
- GTK_ENTRY_ICON_SECONDARY, "insert-text");
- gtk_entry_set_completion(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(GenreCombo))), completion);
- g_object_unref(completion);
- gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(GenreComboModel));
- gtk_entry_completion_set_text_column(completion, 0);
- gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(GenreComboModel), MISC_COMBO_TEXT,
Combo_Alphabetic_Sort, NULL, NULL);
- gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(GenreComboModel), MISC_COMBO_TEXT,
GTK_SORT_ASCENDING);
- et_grid_attach_full (GTK_GRID (Table), GenreCombo, 1, 5, 9, 1, TRUE, TRUE,
- TablePadding, TablePadding);
- Load_Genres_List_To_UI();
- gtk_combo_box_set_wrap_width(GTK_COMBO_BOX(GenreCombo),2); // Two columns to display genres list
-
- et_tag_field_connect_signals (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (GenreCombo))));
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (GenreCombo))),
- GTK_ENTRY_ICON_SECONDARY,
- _("Tag selected files with this genre"));
-
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(GenreCombo))));
-
- /* Comment */
- CommentLabel = gtk_label_new(_("Comment:"));
- et_grid_attach_full (GTK_GRID (Table), CommentLabel, 0, 6, 1, 1, FALSE,
- FALSE, TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(CommentLabel),1,0.5);
-
- CommentEntry = gtk_entry_new();
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (CommentEntry),
- GTK_ENTRY_ICON_SECONDARY, "insert-text");
- et_grid_attach_full (GTK_GRID (Table), CommentEntry, 1, 6, 9, 1, TRUE,
- TRUE, TablePadding, TablePadding);
-
- // Use of a text view instead of an entry...
- /******ScrollWindow = gtk_scrolled_window_new(NULL,NULL);
- et_grid_attach_full(GTK_GRID(Table),ScrollWindow,1,5,9,1,FALSE,FALSE,TablePadding,TablePadding);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(ScrollWindow),
GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(ScrollWindow), GTK_SHADOW_IN);
- gtk_widget_set_size_request(ScrollWindow,-1,52); // Display ~3 lines...
- TextBuffer = gtk_text_buffer_new(NULL);
- CommentView = gtk_text_view_new_with_buffer(TextBuffer);
- gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(CommentView), GTK_WRAP_WORD); // To not display the horizontal
scrollbar
- gtk_container_add(GTK_CONTAINER(ScrollWindow),CommentView);
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(CommentView));
- *******/
-
- et_tag_field_connect_signals (GTK_ENTRY (CommentEntry));
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (CommentEntry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Tag selected files with this comment"));
-
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(CommentEntry));
- //Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(CommentView));
-
-
- /* Composer (name of the composers) */
- ComposerLabel = gtk_label_new(_("Composer:"));
- et_grid_attach_full (GTK_GRID (Table), ComposerLabel, 0, 7, 1, 1, FALSE,
- FALSE, TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(ComposerLabel),1,0.5);
-
- ComposerEntry = gtk_entry_new();
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (ComposerEntry),
- GTK_ENTRY_ICON_SECONDARY, "insert-text");
- et_grid_attach_full (GTK_GRID (Table), ComposerEntry, 1, 7, 9, 1, TRUE,
- TRUE, TablePadding, TablePadding);
-
- et_tag_field_connect_signals (GTK_ENTRY (ComposerEntry));
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (ComposerEntry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Tag selected files with this composer"));
-
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(ComposerEntry));
-
-
- /* Translators: Original Artist / Performer. Please try to keep this string
- * as short as possible, as it must fit into a narrow column. */
- OrigArtistLabel = gtk_label_new(_("Orig. artist:"));
- et_grid_attach_full (GTK_GRID (Table), OrigArtistLabel, 0, 8, 1, 1, FALSE,
- FALSE, TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(OrigArtistLabel),1,0.5);
-
- OrigArtistEntry = gtk_entry_new();
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (OrigArtistEntry),
- GTK_ENTRY_ICON_SECONDARY, "insert-text");
- et_grid_attach_full (GTK_GRID (Table), OrigArtistEntry, 1, 8, 9, 1, TRUE,
- TRUE,TablePadding,TablePadding);
-
- et_tag_field_connect_signals (GTK_ENTRY (OrigArtistEntry));
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (OrigArtistEntry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Tag selected files with this original artist"));
-
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(OrigArtistEntry));
-
-
- /* Copyright */
- CopyrightLabel = gtk_label_new(_("Copyright:"));
- et_grid_attach_full (GTK_GRID (Table), CopyrightLabel, 0, 9, 1, 1, FALSE,
- FALSE, TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(CopyrightLabel),1,0.5);
-
- CopyrightEntry = gtk_entry_new();
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (CopyrightEntry),
- GTK_ENTRY_ICON_SECONDARY, "insert-text");
- et_grid_attach_full (GTK_GRID (Table), CopyrightEntry, 1, 9, 9, 1, TRUE,
- TRUE, TablePadding, TablePadding);
-
- et_tag_field_connect_signals (GTK_ENTRY (CopyrightEntry));
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (CopyrightEntry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Tag selected files with this copyright"));
-
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(CopyrightEntry));
-
-
- /* URL */
- URLLabel = gtk_label_new(_("URL:"));
- et_grid_attach_full (GTK_GRID (Table), URLLabel, 0, 10, 1, 1, FALSE, FALSE,
- TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(URLLabel),1,0.5);
-
- URLEntry = gtk_entry_new();
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (URLEntry),
- GTK_ENTRY_ICON_SECONDARY, "insert-text");
- et_grid_attach_full (GTK_GRID (Table), URLEntry, 1, 10, 9, 1, TRUE, TRUE,
- TablePadding, TablePadding);
-
- et_tag_field_connect_signals (GTK_ENTRY (URLEntry));
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (URLEntry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Tag selected files with this URL"));
-
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(URLEntry));
-
-
- /* Encoded by */
- EncodedByLabel = gtk_label_new(_("Encoded by:"));
- et_grid_attach_full (GTK_GRID (Table), EncodedByLabel, 0, 11, 1, 1, FALSE,
- FALSE, TablePadding, TablePadding);
- gtk_misc_set_alignment(GTK_MISC(EncodedByLabel),1,0.5);
-
- EncodedByEntry = gtk_entry_new();
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (EncodedByEntry),
- GTK_ENTRY_ICON_SECONDARY, "insert-text");
- et_grid_attach_full (GTK_GRID (Table), EncodedByEntry, 1, 11, 9, 1, TRUE,
- TRUE, TablePadding, TablePadding);
-
- et_tag_field_connect_signals (GTK_ENTRY (EncodedByEntry));
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (EncodedByEntry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Tag selected files with this encoder name"));
-
- Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(EncodedByEntry));
-
-
- // Set focus chain
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,TitleEntry);
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,ArtistEntry);
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,AlbumArtistEntry);
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,AlbumEntry);
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,DiscNumberEntry);
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,YearEntry);
- //focusable_widgets_list = g_list_prepend(focusable_widgets_list,TrackMButtonSequence); // Doesn't work
as focus disabled for this widget to have enought space to display icon
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,TrackEntryCombo);
- //focusable_widgets_list = g_list_prepend(focusable_widgets_list,TrackMButtonNbrFiles);
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,TrackTotalEntry);
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,GenreCombo);
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,CommentEntry);
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,ComposerEntry);
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,OrigArtistEntry);
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,CopyrightEntry);
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,URLEntry);
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,EncodedByEntry);
- focusable_widgets_list = g_list_prepend(focusable_widgets_list,TitleEntry); // To loop to the beginning
- /* More efficient than using g_list_append(), which must traverse the
- * whole list. */
- focusable_widgets_list = g_list_reverse(focusable_widgets_list);
- gtk_container_set_focus_chain(GTK_CONTAINER(Table),focusable_widgets_list);
-
-
-
- /*
- * 2 - Page for extra tag fields
- */
- Label = gtk_label_new (_("Images")); // As there is only the picture field... - also used in
ET_Display_File_Tag_To_UI
-
- images_tab = Table = et_grid_new (1, 2);
- gtk_notebook_append_page (GTK_NOTEBOOK (TagNoteBook), Table, Label);
- gtk_container_set_border_width(GTK_CONTAINER(Table),2);
-
- // Scroll window for PictureEntryView
- PictureScrollWindow = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(PictureScrollWindow),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- et_grid_attach_full (GTK_GRID (Table), PictureScrollWindow, 0, 0, 1, 1,
- TRUE, TRUE, TablePadding, TablePadding);
-
- PictureEntryModel = gtk_list_store_new(PICTURE_COLUMN_COUNT,
- GDK_TYPE_PIXBUF,
- G_TYPE_STRING,
- G_TYPE_POINTER);
- PictureEntryView = gtk_tree_view_new_with_model(GTK_TREE_MODEL(PictureEntryModel));
- g_object_unref (PictureEntryModel);
- //gtk_tree_view_set_reorderable(GTK_TREE_VIEW(PictureEntryView),TRUE);
- gtk_container_add(GTK_CONTAINER(PictureScrollWindow), PictureEntryView);
- gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(PictureEntryView), FALSE);
- gtk_widget_set_size_request(PictureEntryView, -1, 200);
- gtk_widget_set_tooltip_text (PictureEntryView,
- _("You can use drag and drop to add an image"));
-
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(PictureEntryView));
- gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
-
- renderer = gtk_cell_renderer_pixbuf_new();
- column = gtk_tree_view_column_new();
- gtk_tree_view_column_pack_start(column, renderer, FALSE);
- gtk_tree_view_column_set_attributes(column, renderer,
- "pixbuf", PICTURE_COLUMN_PIC,
- NULL);
- gtk_tree_view_append_column(GTK_TREE_VIEW(PictureEntryView), column);
- gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-
- renderer = gtk_cell_renderer_text_new();
- column = gtk_tree_view_column_new();
- gtk_tree_view_column_pack_start(column, renderer, FALSE);
- gtk_tree_view_column_set_attributes(column, renderer,
- "text", PICTURE_COLUMN_TEXT,
- NULL);
- gtk_tree_view_append_column(GTK_TREE_VIEW(PictureEntryView), column);
- gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-
- /* Activate Drag'n'Drop for the PictureEntryView. */
- gtk_drag_dest_set(GTK_WIDGET(PictureEntryView),
- GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
- drops, sizeof(drops) / sizeof(GtkTargetEntry),
- GDK_ACTION_COPY);
- g_signal_connect(G_OBJECT(PictureEntryView),"drag_data_received",
G_CALLBACK(Tag_Area_Picture_Drag_Data), 0);
- g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(Picture_Selection_Changed_cb), NULL);
- g_signal_connect(G_OBJECT(PictureEntryView),
"button_press_event",G_CALLBACK(Picture_Entry_View_Button_Pressed),NULL);
- g_signal_connect(G_OBJECT(PictureEntryView),"key_press_event",
G_CALLBACK(Picture_Entry_View_Key_Pressed),NULL);
-
- /* Picture action toolbar. */
- toolbar = gtk_toolbar_new ();
- gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
- gtk_toolbar_set_icon_size (GTK_TOOLBAR (toolbar), GTK_ICON_SIZE_MENU);
- et_grid_attach_full (GTK_GRID (Table), toolbar, 0, 1, 1, 1, FALSE, FALSE,
- TablePadding, TablePadding);
-
- /* TODO: Make the icons use the symbolic variants. */
- icon = g_themed_icon_new_with_default_fallbacks ("list-add");
- image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
- add_image_toolitem = gtk_tool_button_new (image, NULL);
- g_object_unref (icon);
- gtk_toolbar_insert (GTK_TOOLBAR (toolbar), add_image_toolitem, -1);
- gtk_widget_set_tooltip_text (GTK_WIDGET (add_image_toolitem),
- _("Add images to the tag"));
- g_signal_connect (G_OBJECT (add_image_toolitem), "clicked",
- G_CALLBACK (Picture_Add_Button_Clicked), NULL);
-
- /* Activate Drag'n'Drop for the add_image_toolitem. */
- gtk_drag_dest_set (GTK_WIDGET (add_image_toolitem),
- GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
- drops, sizeof(drops) / sizeof(GtkTargetEntry),
- GDK_ACTION_COPY);
- g_signal_connect (G_OBJECT (add_image_toolitem), "drag-data-received",
- G_CALLBACK (Tag_Area_Picture_Drag_Data), 0);
-
- icon = g_themed_icon_new_with_default_fallbacks ("list-remove");
- image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
- remove_image_toolitem = gtk_tool_button_new (image, NULL);
- g_object_unref (icon);
- gtk_toolbar_insert (GTK_TOOLBAR (toolbar), remove_image_toolitem, -1);
- gtk_widget_set_tooltip_text (GTK_WIDGET (remove_image_toolitem),
- _("Remove selected images from the tag"));
- gtk_widget_set_sensitive (GTK_WIDGET (remove_image_toolitem), FALSE);
- g_signal_connect (G_OBJECT (remove_image_toolitem), "clicked",
- G_CALLBACK (Picture_Clear_Button_Clicked), NULL);
-
- toolitem = gtk_separator_tool_item_new ();
- gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitem, -1);
-
- icon = g_themed_icon_new_with_default_fallbacks ("document-save");
- image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
- save_image_toolitem = gtk_tool_button_new (image, NULL);
- g_object_unref (icon);
- gtk_toolbar_insert (GTK_TOOLBAR (toolbar), save_image_toolitem, -1);
- gtk_widget_set_tooltip_text (GTK_WIDGET (save_image_toolitem),
- _("Save the selected images to files"));
- gtk_widget_set_sensitive (GTK_WIDGET (save_image_toolitem), FALSE);
- g_signal_connect (G_OBJECT (save_image_toolitem), "clicked",
- G_CALLBACK (Picture_Save_Button_Clicked), NULL);
-
- icon = g_themed_icon_new_with_default_fallbacks ("document-properties");
- image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
- image_properties_toolitem = gtk_tool_button_new (image, NULL);
- g_object_unref (icon);
- gtk_toolbar_insert (GTK_TOOLBAR (toolbar), image_properties_toolitem, -1);
- gtk_widget_set_tooltip_text (GTK_WIDGET (image_properties_toolitem),
- _("Edit image properties"));
- gtk_widget_set_sensitive (GTK_WIDGET (image_properties_toolitem), FALSE);
- g_signal_connect (G_OBJECT (image_properties_toolitem), "clicked",
- G_CALLBACK (Picture_Properties_Button_Clicked), NULL);
-
- toolitem = gtk_separator_tool_item_new ();
- gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitem, -1);
-
- icon = g_themed_icon_new_with_default_fallbacks ("insert-image");
- image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
- apply_image_toolitem = gtk_tool_button_new (image, NULL);
- g_object_unref (icon);
- gtk_toolbar_insert (GTK_TOOLBAR (toolbar), apply_image_toolitem, -1);
- gtk_widget_set_tooltip_text (GTK_WIDGET (apply_image_toolitem),
- _("Tag selected files with these images"));
- g_signal_connect (G_OBJECT (apply_image_toolitem), "clicked",
- G_CALLBACK (Mini_Button_Clicked), NULL);
-
- //Attach_Popup_Menu_To_Tag_Entries(GTK_ENTRY(PictureEntryView));
-
- gtk_widget_show_all(TagFrame);
- return TagFrame;
-}
-
-
-static void
-Mini_Button_Clicked (GObject *object)
-{
- GList *etfilelist = NULL;
- GList *selection_filelist = NULL;
- GList *l;
- gchar *string_to_set = NULL;
- gchar *string_to_set1 = NULL;
- gchar *msg = NULL;
- ET_File *etfile;
- File_Tag *FileTag;
- GtkTreeSelection *selection;
-
- g_return_if_fail (ETCore->ETFileDisplayedList != NULL ||
- BrowserList != NULL);
-
- // Save the current displayed data
- ET_Save_File_Data_From_UI(ETCore->ETFileDisplayed);
-
- // Warning : 'selection_filelist' is not a list of 'ETFile' items!
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(BrowserList));
- selection_filelist = gtk_tree_selection_get_selected_rows(selection, NULL);
-
- // Create an 'ETFile' list from 'selection_filelist'
- for (l = selection_filelist; l != NULL; l = g_list_next (l))
- {
- etfile = Browser_List_Get_ETFile_From_Path (l->data);
- etfilelist = g_list_prepend (etfilelist, etfile);
- }
-
- etfilelist = g_list_reverse (etfilelist);
- g_list_free_full (selection_filelist, (GDestroyNotify)gtk_tree_path_free);
-
-
- if (object == G_OBJECT (TitleEntry))
- {
- string_to_set = gtk_editable_get_chars(GTK_EDITABLE(TitleEntry),0,-1); // The string to apply to all
other files
-
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item(&FileTag->title,string_to_set);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
- if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
- msg = g_strdup_printf(_("Selected files tagged with title '%s'."),string_to_set);
- else
- msg = g_strdup(_("Removed title from selected files."));
- }
- else if (object == G_OBJECT (ArtistEntry))
- {
- string_to_set = gtk_editable_get_chars(GTK_EDITABLE(ArtistEntry),0,-1);
-
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item(&FileTag->artist,string_to_set);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
- if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
- msg = g_strdup_printf(_("Selected files tagged with artist '%s'."),string_to_set);
- else
- msg = g_strdup(_("Removed artist from selected files."));
- }
- else if (object == G_OBJECT (AlbumArtistEntry))
- {
- string_to_set = gtk_editable_get_chars(GTK_EDITABLE(AlbumArtistEntry),0,-1);
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item(&FileTag->album_artist,string_to_set);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
- if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
- msg = g_strdup_printf(_("Selected files tagged with album artist '%s'."),string_to_set);
- else
- msg = g_strdup(_("Removed album artist from selected files."));
- }
- else if (object == G_OBJECT (AlbumEntry))
- {
- string_to_set = gtk_editable_get_chars(GTK_EDITABLE(AlbumEntry),0,-1);
-
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item(&FileTag->album,string_to_set);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
- if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
- msg = g_strdup_printf(_("Selected files tagged with album '%s'."),string_to_set);
- else
- msg = g_strdup(_("Removed album name from selected files."));
- }
- else if (object == G_OBJECT (DiscNumberEntry))
- {
- const gchar *entry_text;
- gchar *separator;
-
- entry_text = gtk_entry_get_text (GTK_ENTRY (DiscNumberEntry));
- separator = g_utf8_strchr (entry_text, -1, '/');
-
- if (separator)
- {
- string_to_set1 = g_strdup (separator + 1);
- string_to_set = g_strndup (entry_text,
- separator - entry_text);
- }
- else
- {
- string_to_set = g_strdup (entry_text);
- string_to_set1 = NULL;
- }
-
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item (&FileTag->disc_number, string_to_set);
- ET_Set_Field_File_Tag_Item (&FileTag->disc_total, string_to_set1);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
-
- if (string_to_set != NULL && g_utf8_strlen (string_to_set, -1) > 0)
- {
- if (string_to_set1 != NULL
- && g_utf8_strlen (string_to_set1, -1) > 0)
- {
- msg = g_strdup_printf (_("Selected files tagged with disc number '%s/%s'."),
- string_to_set, string_to_set1);
- }
- else
- {
- msg = g_strdup_printf (_("Selected files tagged with disc number like 'xx'."));
- }
- }
- else
- {
- msg = g_strdup (_("Removed disc number from selected files."));
- }
- }
- else if (object == G_OBJECT (YearEntry))
- {
- string_to_set = gtk_editable_get_chars(GTK_EDITABLE(YearEntry),0,-1);
-
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item(&FileTag->year,string_to_set);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
- if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
- msg = g_strdup_printf(_("Selected files tagged with year '%s'."),string_to_set);
- else
- msg = g_strdup(_("Removed year from selected files."));
- }
- else if (object == G_OBJECT (TrackTotalEntry))
- {
- /* Used of Track and Total Track values */
- string_to_set = g_strdup(gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(TrackEntryCombo)))));
- string_to_set1 = gtk_editable_get_chars(GTK_EDITABLE(TrackTotalEntry),0,-1);
-
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
-
- // We apply the TrackEntry field to all others files only if it is to delete
- // the field (string=""). Else we don't overwrite the track number
- if (!string_to_set || g_utf8_strlen(string_to_set, -1) == 0)
- ET_Set_Field_File_Tag_Item(&FileTag->track,string_to_set);
- ET_Set_Field_File_Tag_Item(&FileTag->track_total,string_to_set1);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
-
- if ( string_to_set && g_utf8_strlen(string_to_set, -1) > 0 ) //&& atoi(string_to_set)>0 )
- {
- if ( string_to_set1 != NULL && g_utf8_strlen(string_to_set1, -1)>0 ) //&& atoi(string_to_set1)>0
)
- {
- msg = g_strdup_printf(_("Selected files tagged with track like 'xx/%s'."),string_to_set1);
- }else
- {
- msg = g_strdup_printf(_("Selected files tagged with track like 'xx'."));
- }
- }else
- {
- msg = g_strdup(_("Removed track number from selected files."));
- }
- }
- else if (object==G_OBJECT(TrackMButtonSequence))
- {
- /* This part doesn't set the same track number to all files, but sequence the tracks.
- * So we must browse the whole 'etfilelistfull' to get position of each selected file.
- * Note : 'etfilelistfull' and 'etfilelist' must be sorted in the same order */
- GList *etfilelistfull = NULL;
- gchar *path = NULL;
- gchar *path1 = NULL;
- gint i = 0;
-
- /* FIX ME!: see to fill also the Total Track (it's a good idea?) */
- etfilelistfull = g_list_first(ETCore->ETFileList);
-
- // Sort 'etfilelistfull' and 'etfilelist' in the same order
- etfilelist = ET_Sort_File_List(etfilelist,SORTING_FILE_MODE);
- etfilelistfull = ET_Sort_File_List(etfilelistfull,SORTING_FILE_MODE);
-
- while (etfilelist && etfilelistfull)
- {
- // To get the path of the file
- File_Name *FileNameCur = (File_Name *)((ET_File *)etfilelistfull->data)->FileNameCur->data;
- // The ETFile in the selected file list
- etfile = etfilelist->data;
-
- // Restart counter when entering a new directory
- g_free(path1);
- path1 = g_path_get_dirname(FileNameCur->value);
- if ( path && path1 && strcmp(path,path1)!=0 )
- i = 0;
-
- string_to_set = et_track_number_to_string (++i);
-
- // The file is in the selection?
- if ( (ET_File *)etfilelistfull->data == etfile )
- {
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item(&FileTag->track,string_to_set);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
-
- if (!etfilelist->next) break;
- etfilelist = g_list_next(etfilelist);
- }
-
- g_free(string_to_set);
- g_free(path);
- path = g_strdup(path1);
-
- etfilelistfull = g_list_next(etfilelistfull);
- }
- g_free(path);
- g_free(path1);
- //msg = g_strdup_printf(_("All %d tracks numbered sequentially."),
ETCore->ETFileSelectionList_Length);
- msg = g_strdup_printf(_("Selected tracks numbered sequentially."));
- }
- else if (object==G_OBJECT(TrackMButtonNbrFiles))
- {
- /* Used of Track and Total Track values */
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- gchar *path_utf8, *filename_utf8;
-
- etfile = (ET_File *)l->data;
- filename_utf8 = ((File_Name *)etfile->FileNameNew->data)->value_utf8;
- path_utf8 = g_path_get_dirname(filename_utf8);
-
- string_to_set = et_track_number_to_string (ET_Get_Number_Of_Files_In_Directory (path_utf8));
-
- g_free(path_utf8);
- if (!string_to_set1)
- string_to_set1 = g_strdup(string_to_set); // Just for the message below...
-
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item(&FileTag->track_total,string_to_set);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
-
- if ( string_to_set1 != NULL && g_utf8_strlen(string_to_set1, -1)>0 ) //&& atoi(string_to_set1)>0 )
- {
- msg = g_strdup_printf(_("Selected files tagged with track like 'xx/%s'."),string_to_set1);
- }else
- {
- msg = g_strdup(_("Removed track number from selected files."));
- }
- }
- else if (object == G_OBJECT (gtk_bin_get_child (GTK_BIN (GenreCombo))))
- {
- string_to_set = gtk_editable_get_chars(GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(GenreCombo))),0,-1);
-
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item(&FileTag->genre,string_to_set);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
- if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
- msg = g_strdup_printf(_("Selected files tagged with genre '%s'."),string_to_set);
- else
- msg = g_strdup(_("Removed genre from selected files."));
- }
- else if (object == G_OBJECT (CommentEntry))
- {
- //GtkTextBuffer *textbuffer;
- //GtkTextIter start_iter;
- //GtkTextIter end_iter;
- //textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(CommentView));
- //gtk_text_buffer_get_bounds(GTK_TEXT_BUFFER(textbuffer),&start_iter,&end_iter);
- //string_to_set = gtk_text_buffer_get_text(GTK_TEXT_BUFFER(textbuffer),&start_iter,&end_iter,TRUE);
-
- string_to_set = gtk_editable_get_chars(GTK_EDITABLE(CommentEntry),0,-1);
-
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item(&FileTag->comment,string_to_set);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
- if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
- msg = g_strdup_printf(_("Selected files tagged with comment '%s'."),string_to_set);
- else
- msg = g_strdup(_("Removed comment from selected files."));
- }
- else if (object == G_OBJECT (ComposerEntry))
- {
- string_to_set = gtk_editable_get_chars(GTK_EDITABLE(ComposerEntry),0,-1);
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item(&FileTag->composer,string_to_set);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
- if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
- msg = g_strdup_printf(_("Selected files tagged with composer '%s'."),string_to_set);
- else
- msg = g_strdup(_("Removed composer from selected files."));
- }
- else if (object == G_OBJECT (OrigArtistEntry))
- {
- string_to_set = gtk_editable_get_chars(GTK_EDITABLE(OrigArtistEntry),0,-1);
-
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item(&FileTag->orig_artist,string_to_set);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
- if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
- msg = g_strdup_printf(_("Selected files tagged with original artist '%s'."),string_to_set);
- else
- msg = g_strdup(_("Removed original artist from selected files."));
- }
- else if (object == G_OBJECT (CopyrightEntry))
- {
- string_to_set = gtk_editable_get_chars(GTK_EDITABLE(CopyrightEntry),0,-1);
-
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item(&FileTag->copyright,string_to_set);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
- if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
- msg = g_strdup_printf(_("Selected files tagged with copyright '%s'."),string_to_set);
- else
- msg = g_strdup(_("Removed copyright from selected files."));
- }
- else if (object == G_OBJECT (URLEntry))
- {
- string_to_set = gtk_editable_get_chars(GTK_EDITABLE(URLEntry),0,-1);
-
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item(&FileTag->url,string_to_set);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
- if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
- msg = g_strdup_printf(_("Selected files tagged with URL '%s'."),string_to_set);
- else
- msg = g_strdup(_("Removed URL from selected files."));
- }
- else if (object == G_OBJECT (EncodedByEntry))
- {
- string_to_set = gtk_editable_get_chars(GTK_EDITABLE(EncodedByEntry),0,-1);
-
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Item(&FileTag->encoded_by,string_to_set);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
- if (string_to_set != NULL && g_utf8_strlen(string_to_set, -1)>0)
- msg = g_strdup_printf(_("Selected files tagged with encoder name '%s'."),string_to_set);
- else
- msg = g_strdup(_("Removed encoder name from selected files."));
- }
- else if (object==G_OBJECT(apply_image_toolitem))
- {
- Picture *res = NULL, *pic, *prev_pic = NULL;
- GtkTreeModel *model;
- GtkTreeIter iter;
-
- model = gtk_tree_view_get_model(GTK_TREE_VIEW(PictureEntryView));
- if (gtk_tree_model_get_iter_first(model, &iter))
- {
- do
- {
- gtk_tree_model_get(model, &iter, PICTURE_COLUMN_DATA, &pic, -1);
- pic = Picture_Copy_One(pic);
- if (!res)
- res = pic;
- else
- prev_pic->next = pic;
- prev_pic = pic;
- } while (gtk_tree_model_iter_next(model, &iter));
- }
-
- for (l = etfilelist; l != NULL; l = g_list_next (l))
- {
- etfile = (ET_File *)l->data;
- FileTag = ET_File_Tag_Item_New();
- ET_Copy_File_Tag_Item(etfile,FileTag);
- ET_Set_Field_File_Tag_Picture((Picture **)&FileTag->picture, res);
- ET_Manage_Changes_Of_File_Data(etfile,NULL,FileTag);
- }
- if (res)
- msg = g_strdup (_("Selected files tagged with images."));
- else
- msg = g_strdup (_("Removed images from selected files."));
- Picture_Free(res);
- }
-
- g_list_free(etfilelist);
-
- // Refresh the whole list (faster than file by file) to show changes
- Browser_List_Refresh_Whole_List();
-
- /* Display the current file (Needed when sequencing tracks) */
- ET_Display_File_Data_To_UI(ETCore->ETFileDisplayed);
-
- if (msg)
- {
- Log_Print(LOG_OK,"%s",msg);
- Statusbar_Message(msg,TRUE);
- g_free(msg);
- }
- g_free(string_to_set);
- g_free(string_to_set1);
-
- /* To update state of Undo button */
- Update_Command_Buttons_Sensivity();
-}
-
-
-
/*
* Action when selecting all files
@@ -2355,6 +1051,7 @@ Save_Selected_Files_With_Answer (gboolean force_saving_files)
static gint
Save_List_Of_Files (GList *etfilelist, gboolean force_saving_files)
{
+ EtApplicationWindow *window;
gint progress_bar_index;
gint saving_answer;
gint nb_files_to_save;
@@ -2373,6 +1070,8 @@ Save_List_Of_Files (GList *etfilelist, gboolean force_saving_files)
g_return_val_if_fail (ETCore != NULL, FALSE);
+ window = ET_APPLICATION_WINDOW (MainWindow);
+
/* Save the current position in the list */
etfile_save_position = ETCore->ETFileDisplayed;
@@ -2417,8 +1116,8 @@ Save_List_Of_Files (GList *etfilelist, gboolean force_saving_files)
/* Set to unsensitive all command buttons (except Quit button) */
Disable_Command_Buttons();
Browser_Area_Set_Sensitive(FALSE);
- Tag_Area_Set_Sensitive(FALSE);
- File_Area_Set_Sensitive(FALSE);
+ et_application_window_tag_area_set_sensitive (window, FALSE);
+ et_application_window_file_area_set_sensitive (window, FALSE);
/* Show msgbox (if needed) to ask confirmation ('SF' for Save File) */
SF_HideMsgbox_Write_Tag = FALSE;
@@ -2505,8 +1204,8 @@ Save_List_Of_Files (GList *etfilelist, gboolean force_saving_files)
/* To update state of command buttons */
Update_Command_Buttons_Sensivity();
Browser_Area_Set_Sensitive(TRUE);
- Tag_Area_Set_Sensitive(TRUE);
- File_Area_Set_Sensitive(TRUE);
+ et_application_window_tag_area_set_sensitive (window, TRUE);
+ et_application_window_file_area_set_sensitive (window, TRUE);
if (currentPath)
{
@@ -2542,8 +1241,8 @@ Save_List_Of_Files (GList *etfilelist, gboolean force_saving_files)
/* To update state of command buttons */
Update_Command_Buttons_Sensivity();
Browser_Area_Set_Sensitive(TRUE);
- Tag_Area_Set_Sensitive(TRUE);
- File_Area_Set_Sensitive(TRUE);
+ et_application_window_tag_area_set_sensitive (window, TRUE);
+ et_application_window_file_area_set_sensitive (window, TRUE);
/* Give again focus to the first entry, else the focus is passed to another */
gtk_widget_grab_focus(GTK_WIDGET(widget_focused));
@@ -2570,6 +1269,7 @@ void Action_Delete_Selected_Files (void)
static gint
Delete_Selected_Files_With_Answer (void)
{
+ EtApplicationWindow *window;
GList *selfilelist;
GList *rowreflist = NULL;
GList *l;
@@ -2588,6 +1288,8 @@ Delete_Selected_Files_With_Answer (void)
g_return_val_if_fail (ETCore->ETFileDisplayedList != NULL
&& BrowserList != NULL, FALSE);
+ window = ET_APPLICATION_WINDOW (MainWindow);
+
/* Save the current displayed data */
ET_Save_File_Data_From_UI(ETCore->ETFileDisplayed);
@@ -2603,8 +1305,8 @@ Delete_Selected_Files_With_Answer (void)
/* Set to unsensitive all command buttons (except Quit button) */
Disable_Command_Buttons();
Browser_Area_Set_Sensitive(FALSE);
- Tag_Area_Set_Sensitive(FALSE);
- File_Area_Set_Sensitive(FALSE);
+ et_application_window_tag_area_set_sensitive (window, FALSE);
+ et_application_window_file_area_set_sensitive (window, FALSE);
/* Show msgbox (if needed) to ask confirmation */
SF_HideMsgbox_Delete_File = 0;
@@ -2664,8 +1366,8 @@ Delete_Selected_Files_With_Answer (void)
// To update state of command buttons
Update_Command_Buttons_Sensivity();
Browser_Area_Set_Sensitive(TRUE);
- Tag_Area_Set_Sensitive(TRUE);
- File_Area_Set_Sensitive(TRUE);
+ et_application_window_tag_area_set_sensitive (window, TRUE);
+ et_application_window_file_area_set_sensitive (window, TRUE);
return -1; // We stop all actions
}
@@ -2692,8 +1394,8 @@ Delete_Selected_Files_With_Answer (void)
/* To update state of command buttons */
Update_Command_Buttons_Sensivity();
Browser_Area_Set_Sensitive(TRUE);
- Tag_Area_Set_Sensitive(TRUE);
- File_Area_Set_Sensitive(TRUE);
+ et_application_window_tag_area_set_sensitive (window, TRUE);
+ et_application_window_file_area_set_sensitive (window, TRUE);
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ProgressBar), "");
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ProgressBar), 0);
@@ -3677,15 +2379,18 @@ ui_widget_set_sensitive (const gchar *menu, const gchar *action, gboolean sensit
*/
void Update_Command_Buttons_Sensivity (void)
{
+ EtApplicationWindow *window;
GtkAction *uiaction;
+ window = ET_APPLICATION_WINDOW (MainWindow);
+
if (!ETCore->ETFileDisplayedList)
{
/* No file found */
/* File and Tag frames */
- File_Area_Set_Sensitive(FALSE);
- Tag_Area_Set_Sensitive(FALSE);
+ et_application_window_file_area_set_sensitive (window, FALSE);
+ et_application_window_tag_area_set_sensitive (window, FALSE);
/* Tool bar buttons (the others are covered by the menu) */
uiaction = gtk_ui_manager_get_action(UIManager, "/ToolBar/Stop");
@@ -3763,8 +2468,8 @@ void Update_Command_Buttons_Sensivity (void)
GtkTreeSelection *selection;
/* File and Tag frames */
- File_Area_Set_Sensitive(TRUE);
- Tag_Area_Set_Sensitive(TRUE);
+ et_application_window_file_area_set_sensitive (window, TRUE);
+ et_application_window_tag_area_set_sensitive (window, TRUE);
/* Tool bar buttons */
uiaction = gtk_ui_manager_get_action(UIManager, "/ToolBar/Stop");
@@ -3935,280 +2640,6 @@ Disable_Command_Buttons (void)
}
-/*
- * Disable (FALSE) / Enable (TRUE) all user widgets in the tag area
- */
-static void
-Tag_Area_Set_Sensitive (gboolean activate)
-{
- g_return_if_fail (TagArea != NULL);
-
- /* TAG Area (entries + buttons). */
- gtk_widget_set_sensitive(gtk_bin_get_child(GTK_BIN(TagArea)),activate);
-}
-
-/*
- * Disable (FALSE) / Enable (TRUE) all user widgets in the file area
- */
-static void
-File_Area_Set_Sensitive (gboolean activate)
-{
- g_return_if_fail (FileArea != NULL);
-
- /* File Area. */
- gtk_widget_set_sensitive(gtk_bin_get_child(GTK_BIN(FileArea)),activate);
- /*gtk_widget_set_sensitive(GTK_WIDGET(FileEntry),activate);*/
-}
-
-static void
-et_tag_notebook_hide_images_tab (GtkWidget *tag_notebook)
-{
- gtk_widget_hide (images_tab);
-}
-
-static void
-et_tag_notebook_show_images_tab (GtkWidget *tag_notebook)
-{
- gtk_widget_show (images_tab);
-}
-
-/*
- * Display controls according the kind of tag... (Hide some controls if not available for a tag type)
- */
-void Tag_Area_Display_Controls (ET_File *ETFile)
-{
- g_return_if_fail (ETFile != NULL && ETFile->ETFileDescription != NULL);
- g_return_if_fail (TitleLabel != NULL);
-
- /* Common controls for all tags. */
- gtk_widget_show(GTK_WIDGET(TitleLabel));
- gtk_widget_show(GTK_WIDGET(TitleEntry));
- gtk_widget_show(GTK_WIDGET(ArtistLabel));
- gtk_widget_show(GTK_WIDGET(ArtistEntry));
- gtk_widget_show(GTK_WIDGET(AlbumArtistLabel));
- gtk_widget_show(GTK_WIDGET(AlbumArtistEntry));
- gtk_widget_show(GTK_WIDGET(AlbumLabel));
- gtk_widget_show(GTK_WIDGET(AlbumEntry));
- gtk_widget_show(GTK_WIDGET(YearLabel));
- gtk_widget_show(GTK_WIDGET(YearEntry));
- gtk_widget_show(GTK_WIDGET(TrackLabel));
- gtk_widget_show(GTK_WIDGET(TrackEntryCombo));
- gtk_widget_show(GTK_WIDGET(TrackTotalEntry));
- gtk_widget_show(GTK_WIDGET(TrackMButtonSequence));
- gtk_widget_show(GTK_WIDGET(TrackMButtonNbrFiles));
- gtk_widget_show(GTK_WIDGET(GenreLabel));
- gtk_widget_show(GTK_WIDGET(GenreCombo));
- gtk_widget_show(GTK_WIDGET(CommentLabel));
- gtk_widget_show(GTK_WIDGET(CommentEntry));
-
- // Special controls to display or not!
- switch (ETFile->ETFileDescription->TagType)
- {
- case ID3_TAG:
- if (!FILE_WRITING_ID3V2_WRITE_TAG)
- {
- // ID3v1 : Hide specifics ID3v2 fields if not activated!
- gtk_widget_hide(GTK_WIDGET(DiscNumberLabel));
- gtk_widget_hide(GTK_WIDGET(DiscNumberEntry));
- gtk_widget_hide(GTK_WIDGET(ComposerLabel));
- gtk_widget_hide(GTK_WIDGET(ComposerEntry));
- gtk_widget_hide(GTK_WIDGET(OrigArtistLabel));
- gtk_widget_hide(GTK_WIDGET(OrigArtistEntry));
- gtk_widget_hide(GTK_WIDGET(CopyrightLabel));
- gtk_widget_hide(GTK_WIDGET(CopyrightEntry));
- gtk_widget_hide(GTK_WIDGET(URLLabel));
- gtk_widget_hide(GTK_WIDGET(URLEntry));
- gtk_widget_hide(GTK_WIDGET(EncodedByLabel));
- gtk_widget_hide(GTK_WIDGET(EncodedByEntry));
- et_tag_notebook_hide_images_tab (TagNoteBook);
- }else
- {
- gtk_widget_show(GTK_WIDGET(DiscNumberLabel));
- gtk_widget_show(GTK_WIDGET(DiscNumberEntry));
- gtk_widget_show(GTK_WIDGET(ComposerLabel));
- gtk_widget_show(GTK_WIDGET(ComposerEntry));
- gtk_widget_show(GTK_WIDGET(OrigArtistLabel));
- gtk_widget_show(GTK_WIDGET(OrigArtistEntry));
- gtk_widget_show(GTK_WIDGET(CopyrightLabel));
- gtk_widget_show(GTK_WIDGET(CopyrightEntry));
- gtk_widget_show(GTK_WIDGET(URLLabel));
- gtk_widget_show(GTK_WIDGET(URLEntry));
- gtk_widget_show(GTK_WIDGET(EncodedByLabel));
- gtk_widget_show(GTK_WIDGET(EncodedByEntry));
- et_tag_notebook_show_images_tab (TagNoteBook);
- }
- break;
-
-#ifdef ENABLE_OGG
- case OGG_TAG:
- gtk_widget_show(GTK_WIDGET(DiscNumberLabel));
- gtk_widget_show(GTK_WIDGET(DiscNumberEntry));
- gtk_widget_show(GTK_WIDGET(ComposerLabel));
- gtk_widget_show(GTK_WIDGET(ComposerEntry));
- gtk_widget_show(GTK_WIDGET(OrigArtistLabel));
- gtk_widget_show(GTK_WIDGET(OrigArtistEntry));
- gtk_widget_show(GTK_WIDGET(CopyrightLabel));
- gtk_widget_show(GTK_WIDGET(CopyrightEntry));
- gtk_widget_show(GTK_WIDGET(URLLabel));
- gtk_widget_show(GTK_WIDGET(URLEntry));
- gtk_widget_show(GTK_WIDGET(EncodedByLabel));
- gtk_widget_show(GTK_WIDGET(EncodedByEntry));
- et_tag_notebook_show_images_tab (TagNoteBook);
- break;
-#endif
-
-#ifdef ENABLE_FLAC
- case FLAC_TAG:
- gtk_widget_show(GTK_WIDGET(DiscNumberLabel));
- gtk_widget_show(GTK_WIDGET(DiscNumberEntry));
- gtk_widget_show(GTK_WIDGET(ComposerLabel));
- gtk_widget_show(GTK_WIDGET(ComposerEntry));
- gtk_widget_show(GTK_WIDGET(OrigArtistLabel));
- gtk_widget_show(GTK_WIDGET(OrigArtistEntry));
- gtk_widget_show(GTK_WIDGET(CopyrightLabel));
- gtk_widget_show(GTK_WIDGET(CopyrightEntry));
- gtk_widget_show(GTK_WIDGET(URLLabel));
- gtk_widget_show(GTK_WIDGET(URLEntry));
- gtk_widget_show(GTK_WIDGET(EncodedByLabel));
- gtk_widget_show(GTK_WIDGET(EncodedByEntry));
- et_tag_notebook_show_images_tab (TagNoteBook);
- break;
-#endif
-
- case APE_TAG:
- gtk_widget_show(GTK_WIDGET(DiscNumberLabel));
- gtk_widget_show(GTK_WIDGET(DiscNumberEntry));
- gtk_widget_show(GTK_WIDGET(ComposerLabel));
- gtk_widget_show(GTK_WIDGET(ComposerEntry));
- gtk_widget_show(GTK_WIDGET(OrigArtistLabel));
- gtk_widget_show(GTK_WIDGET(OrigArtistEntry));
- gtk_widget_show(GTK_WIDGET(CopyrightLabel));
- gtk_widget_show(GTK_WIDGET(CopyrightEntry));
- gtk_widget_show(GTK_WIDGET(URLLabel));
- gtk_widget_show(GTK_WIDGET(URLEntry));
- gtk_widget_show(GTK_WIDGET(EncodedByLabel));
- gtk_widget_show(GTK_WIDGET(EncodedByEntry));
- et_tag_notebook_show_images_tab (TagNoteBook);
- break;
-
-#ifdef ENABLE_MP4
- case MP4_TAG:
- gtk_widget_hide(GTK_WIDGET(DiscNumberLabel));
- gtk_widget_hide(GTK_WIDGET(DiscNumberEntry));
- gtk_widget_hide(GTK_WIDGET(ComposerLabel));
- gtk_widget_hide(GTK_WIDGET(ComposerEntry));
- gtk_widget_hide(GTK_WIDGET(OrigArtistLabel));
- gtk_widget_hide(GTK_WIDGET(OrigArtistEntry));
- gtk_widget_hide(GTK_WIDGET(CopyrightLabel));
- gtk_widget_hide(GTK_WIDGET(CopyrightEntry));
- gtk_widget_hide(GTK_WIDGET(URLLabel));
- gtk_widget_hide(GTK_WIDGET(URLEntry));
- gtk_widget_hide(GTK_WIDGET(EncodedByLabel));
- gtk_widget_hide(GTK_WIDGET(EncodedByEntry));
- et_tag_notebook_hide_images_tab (TagNoteBook);
- break;
-#endif
-
-#ifdef ENABLE_WAVPACK
- case WAVPACK_TAG:
- gtk_widget_show(GTK_WIDGET(DiscNumberLabel));
- gtk_widget_show(GTK_WIDGET(DiscNumberEntry));
- gtk_widget_show(GTK_WIDGET(ComposerLabel));
- gtk_widget_show(GTK_WIDGET(ComposerEntry));
- gtk_widget_show(GTK_WIDGET(OrigArtistLabel));
- gtk_widget_show(GTK_WIDGET(OrigArtistEntry));
- gtk_widget_show(GTK_WIDGET(CopyrightLabel));
- gtk_widget_show(GTK_WIDGET(CopyrightEntry));
- gtk_widget_show(GTK_WIDGET(URLLabel));
- gtk_widget_show(GTK_WIDGET(URLEntry));
- gtk_widget_show(GTK_WIDGET(EncodedByLabel));
- gtk_widget_show(GTK_WIDGET(EncodedByEntry));
- et_tag_notebook_hide_images_tab (TagNoteBook);
- break;
-#endif /* ENABLE_WAVPACK */
-
- case UNKNOWN_TAG:
- default:
- gtk_widget_hide(GTK_WIDGET(DiscNumberLabel));
- gtk_widget_hide(GTK_WIDGET(DiscNumberEntry));
- gtk_widget_hide(GTK_WIDGET(ComposerLabel));
- gtk_widget_hide(GTK_WIDGET(ComposerEntry));
- gtk_widget_hide(GTK_WIDGET(OrigArtistLabel));
- gtk_widget_hide(GTK_WIDGET(OrigArtistEntry));
- gtk_widget_hide(GTK_WIDGET(CopyrightLabel));
- gtk_widget_hide(GTK_WIDGET(CopyrightEntry));
- gtk_widget_hide(GTK_WIDGET(URLLabel));
- gtk_widget_hide(GTK_WIDGET(URLEntry));
- gtk_widget_hide(GTK_WIDGET(EncodedByLabel));
- gtk_widget_hide(GTK_WIDGET(EncodedByEntry));
- et_tag_notebook_hide_images_tab (TagNoteBook);
- break;
- }
-}
-
-
-/*
- * Clear the entries of tag area
- */
-void Clear_Tag_Entry_Fields (void)
-{
- /* GtkTextBuffer *textbuffer; */
-
- g_return_if_fail (TitleEntry != NULL);
-
- gtk_entry_set_text(GTK_ENTRY(TitleEntry), "");
- gtk_entry_set_text(GTK_ENTRY(ArtistEntry), "");
- gtk_entry_set_text(GTK_ENTRY(AlbumArtistEntry), "");
- gtk_entry_set_text(GTK_ENTRY(AlbumEntry), "");
- gtk_entry_set_text(GTK_ENTRY(DiscNumberEntry), "");
- gtk_entry_set_text(GTK_ENTRY(YearEntry), "");
- gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(TrackEntryCombo))), "");
- gtk_entry_set_text(GTK_ENTRY(TrackTotalEntry), "");
- gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(GenreCombo))), "");
- gtk_entry_set_text(GTK_ENTRY(CommentEntry), "");
- /* textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(CommentView));
- * gtk_text_buffer_set_text(GTK_TEXT_BUFFER(textbuffer), "", -1); */
- gtk_entry_set_text(GTK_ENTRY(ComposerEntry), "");
- gtk_entry_set_text(GTK_ENTRY(OrigArtistEntry), "");
- gtk_entry_set_text(GTK_ENTRY(CopyrightEntry), "");
- gtk_entry_set_text(GTK_ENTRY(URLEntry), "");
- gtk_entry_set_text(GTK_ENTRY(EncodedByEntry), "");
- PictureEntry_Clear();
-}
-
-
-/*
- * Clear the entry of file area
- */
-void
-Clear_File_Entry_Field (void)
-{
- g_return_if_fail (FileEntry != NULL);
-
- gtk_entry_set_text (GTK_ENTRY (FileEntry),"");
-}
-
-
-/*
- * Clear the header information
- */
-void Clear_Header_Fields (void)
-{
- g_return_if_fail (VersionValueLabel != NULL);
-
- /* Default values are MPs data */
- gtk_label_set_text(GTK_LABEL(VersionLabel), _("Encoder:"));
- gtk_label_set_text(GTK_LABEL(VersionValueLabel), "");
- gtk_label_set_text(GTK_LABEL(BitrateValueLabel), "");
- gtk_label_set_text(GTK_LABEL(SampleRateValueLabel),"");
- gtk_label_set_text(GTK_LABEL(ModeLabel), _("Mode:"));
- gtk_label_set_text(GTK_LABEL(ModeValueLabel), "");
- gtk_label_set_text(GTK_LABEL(SizeValueLabel), "");
- gtk_label_set_text(GTK_LABEL(DurationValueLabel), "");
-}
-
-
-
/*
* Load the default directory when the user interface is completely displayed
@@ -4243,237 +2674,6 @@ Init_Load_Default_Dir (void)
-static void
-Convert_P20_And_Underscore_Into_Spaces (GtkWidget *entry)
-{
- gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
-
- Scan_Convert_Underscore_Into_Space(string);
- Scan_Convert_P20_Into_Space(string);
- gtk_entry_set_text(GTK_ENTRY(entry),string);
- g_free(string);
-}
-
-static void
-Convert_Space_Into_Underscore (GtkWidget *entry)
-{
- gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
-
- Scan_Convert_Space_Into_Undescore(string);
- gtk_entry_set_text(GTK_ENTRY(entry),string);
- g_free(string);
-}
-
-static void
-Convert_All_Uppercase (GtkWidget *entry)
-{
- gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
-
- Scan_Process_Fields_All_Uppercase(string);
- gtk_entry_set_text(GTK_ENTRY(entry),string);
- g_free(string);
-}
-
-static void
-Convert_All_Lowercase (GtkWidget *entry)
-{
- gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
-
- Scan_Process_Fields_All_Downcase(string);
- gtk_entry_set_text(GTK_ENTRY(entry),string);
- g_free(string);
-}
-
-static void
-Convert_Letter_Uppercase (GtkWidget *entry)
-{
- gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
-
- Scan_Process_Fields_Letter_Uppercase(string);
- gtk_entry_set_text(GTK_ENTRY(entry),string);
- g_free(string);
-}
-
-static void
-Convert_First_Letters_Uppercase (GtkWidget *entry)
-{
- gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
-
- Scan_Process_Fields_First_Letters_Uppercase(string);
- gtk_entry_set_text(GTK_ENTRY(entry),string);
- g_free(string);
-}
-
-static void
-Convert_Remove_Space (GtkWidget *entry)
-{
- gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
-
- Scan_Process_Fields_Remove_Space(string);
- gtk_entry_set_text(GTK_ENTRY(entry),string);
- g_free(string);
-}
-
-static void
-Convert_Insert_Space (GtkWidget *entry)
-{
- // FIX ME : we suppose that it will not grow more than 2 times its size...
- guint string_length = 2 * strlen(gtk_entry_get_text(GTK_ENTRY(entry)));
- gchar *string = g_malloc(string_length+1);
- strncpy(string,gtk_entry_get_text(GTK_ENTRY(entry)),string_length);
- string[string_length]='\0';
-
- Scan_Process_Fields_Insert_Space(&string);
- gtk_entry_set_text(GTK_ENTRY(entry),string);
- g_free(string);
-}
-
-static void
-Convert_Only_One_Space (GtkWidget *entry)
-{
- gchar *string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
-
- Scan_Process_Fields_Keep_One_Space(string);
- gtk_entry_set_text(GTK_ENTRY(entry),string);
- g_free(string);
-}
-
-static void
-Convert_Remove_All_Text (GtkWidget *entry)
-{
- gtk_entry_set_text (GTK_ENTRY (entry), "");
-}
-
-/*
- * Entry_Popup_Menu_Handler: show the popup menu when the third mouse button is pressed.
- */
-static gboolean
-Entry_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
-{
- if (event && (event->type==GDK_BUTTON_PRESS) && (event->button==3))
- {
- /* FIX ME : this is not very clean, but if we use 'event->button' (contains value of
- * the 3rd button) instead of '1', we need to click two times the left mouse button
- * to activate an item of the opened popup menu (when menu is attached to an entry). */
- //gtk_menu_popup(menu,NULL,NULL,NULL,NULL,event->button,event->time);
- gtk_menu_popup(menu,NULL,NULL,NULL,NULL,1,event->time);
- return TRUE;
- }
- return FALSE;
-}
-
-/*
- * Popup menu attached to all entries of tag + filename + rename combobox.
- * Displayed when pressing the right mouse button and contains functions to process ths strings.
- */
-void Attach_Popup_Menu_To_Tag_Entries (GtkEntry *entry)
-{
- GtkWidget *PopupMenu;
- GtkWidget *Image;
- GtkWidget *MenuItem;
-
-
- PopupMenu = gtk_menu_new();
- g_signal_connect_swapped(G_OBJECT(entry),"button_press_event",
- G_CALLBACK(Entry_Popup_Menu_Handler),G_OBJECT(PopupMenu));
-
- /* Menu items */
- MenuItem = gtk_image_menu_item_new_with_label(_("Tag selected files with this field"));
- Image = gtk_image_new_from_stock(GTK_STOCK_JUMP_TO,GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MenuItem),Image);
- gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
- g_signal_connect_swapped (G_OBJECT (MenuItem), "activate",
- G_CALLBACK (Mini_Button_Clicked),
- G_OBJECT (entry));
-
- /* Separator */
- MenuItem = gtk_menu_item_new();
- gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
-
- MenuItem = gtk_image_menu_item_new_with_label(_("Convert '_' and '%20' to spaces"));
- Image = gtk_image_new_from_stock(GTK_STOCK_CONVERT,GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MenuItem),Image);
- gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
- g_signal_connect_swapped(G_OBJECT(MenuItem),"activate",
- G_CALLBACK(Convert_P20_And_Underscore_Into_Spaces),G_OBJECT(entry));
-
- MenuItem = gtk_image_menu_item_new_with_label(_("Convert ' ' to '_'"));
- Image = gtk_image_new_from_stock(GTK_STOCK_CONVERT,GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MenuItem),Image);
- gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
- g_signal_connect_swapped(G_OBJECT(MenuItem),"activate",
- G_CALLBACK(Convert_Space_Into_Underscore),G_OBJECT(entry));
-
- /* Separator */
- MenuItem = gtk_menu_item_new();
- gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
-
- MenuItem = gtk_image_menu_item_new_with_label(_("All uppercase"));
- Image = gtk_image_new_from_stock("easytag-all-uppercase",GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MenuItem),Image);
- gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
- g_signal_connect_swapped(G_OBJECT(MenuItem),"activate",
- G_CALLBACK(Convert_All_Uppercase),G_OBJECT(entry));
-
- MenuItem = gtk_image_menu_item_new_with_label(_("All lowercase"));
- Image = gtk_image_new_from_stock("easytag-all-downcase",GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MenuItem),Image);
- gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
- g_signal_connect_swapped(G_OBJECT(MenuItem),"activate",
- G_CALLBACK(Convert_All_Lowercase),G_OBJECT(entry));
-
- MenuItem = gtk_image_menu_item_new_with_label(_("First letter uppercase"));
- Image = gtk_image_new_from_stock("easytag-first-letter-uppercase",GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MenuItem),Image);
- gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
- g_signal_connect_swapped(G_OBJECT(MenuItem),"activate",
- G_CALLBACK(Convert_Letter_Uppercase),G_OBJECT(entry));
-
- MenuItem = gtk_image_menu_item_new_with_label(_("First letter uppercase of each word"));
- Image = gtk_image_new_from_stock("easytag-first-letter-uppercase-word",GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MenuItem),Image);
- gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
- g_signal_connect_swapped(G_OBJECT(MenuItem),"activate",
- G_CALLBACK(Convert_First_Letters_Uppercase),G_OBJECT(entry));
-
- /* Separator */
- MenuItem = gtk_menu_item_new();
- gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
-
- MenuItem = gtk_image_menu_item_new_with_label(_("Remove spaces"));
- Image = gtk_image_new_from_stock(GTK_STOCK_REMOVE,GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MenuItem),Image);
- gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
- g_signal_connect_swapped(G_OBJECT(MenuItem),"activate",
- G_CALLBACK(Convert_Remove_Space),G_OBJECT(entry));
-
- MenuItem = gtk_image_menu_item_new_with_label(_("Insert space before uppercase letter"));
- Image = gtk_image_new_from_stock(GTK_STOCK_ADD,GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MenuItem),Image);
- gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
- g_signal_connect_swapped(G_OBJECT(MenuItem),"activate",
- G_CALLBACK(Convert_Insert_Space),G_OBJECT(entry));
-
- MenuItem = gtk_image_menu_item_new_with_label(_("Remove duplicate spaces or underscores"));
- Image = gtk_image_new_from_stock(GTK_STOCK_REMOVE,GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MenuItem),Image);
- gtk_menu_shell_append(GTK_MENU_SHELL(PopupMenu),MenuItem);
- g_signal_connect_swapped(G_OBJECT(MenuItem),"activate",
- G_CALLBACK(Convert_Only_One_Space),G_OBJECT(entry));
-
- MenuItem = gtk_image_menu_item_new_with_label (_("Remove all text"));
- Image = gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM(MenuItem), Image);
- gtk_menu_shell_append (GTK_MENU_SHELL(PopupMenu), MenuItem);
- g_signal_connect_swapped (G_OBJECT (MenuItem), "activate",
- G_CALLBACK (Convert_Remove_All_Text),
- G_OBJECT (entry));
-
- gtk_widget_show_all(PopupMenu);
-}
-
-
-
/*
* Function to manage the received signals (specially for segfaults)
* Handle crashs
@@ -4616,86 +2816,3 @@ void Quit_MainWindow (void)
}
}
-
-/*
- * For the configuration file...
- */
-void MainWindow_Apply_Changes (void)
-{
- GdkWindow *window;
-
- g_return_if_fail(MainWindow !=NULL);
-
- window = gtk_widget_get_window(MainWindow);
-
- if ( window && gdk_window_is_visible(window) && gdk_window_get_state(window)!=GDK_WINDOW_STATE_MAXIMIZED
)
- {
- gint x, y, width, height;
-
- // Position and Origin of the window
- gdk_window_get_root_origin(window,&x,&y);
- MAIN_WINDOW_X = x;
- MAIN_WINDOW_Y = y;
- width = gdk_window_get_width(window);
- height = gdk_window_get_height(window);
- MAIN_WINDOW_WIDTH = width;
- MAIN_WINDOW_HEIGHT = height;
-
- // Handle panes position
- PANE_HANDLE_POSITION1 = gtk_paned_get_position(GTK_PANED(MainWindowHPaned));
- PANE_HANDLE_POSITION2 = gtk_paned_get_position(GTK_PANED(BrowserHPaned));
- PANE_HANDLE_POSITION3 = gtk_paned_get_position(GTK_PANED(ArtistAlbumVPaned));
- PANE_HANDLE_POSITION4 = gtk_paned_get_position(GTK_PANED(MainWindowVPaned));
- }
-
-}
-
-/*
- * et_tag_field_connect_signals:
- * @entry: the entry for which to connect signals
- *
- * Connect the GtkWidget::key-press-event and GtkEntry::icon-release signals
- * of @entry to appropriate handlers for tag entry fields.
- */
-static void
-et_tag_field_connect_signals (GtkEntry *entry)
-{
- g_signal_connect_after (entry, "key-press-event",
- G_CALLBACK (et_tag_field_on_key_press_event),
- NULL);
- g_signal_connect (entry, "icon-release", G_CALLBACK (Mini_Button_Clicked),
- NULL);
-}
-
-/*
- * et_tag_field_on_key_press_event:
- * @entry: the tag entry field on which the event was generated
- * @event: the generated event
- * @user_data: user data set when the signal was connected
- *
- * Handle the Ctrl+Return combination being pressed in the tag field GtkEntrys
- * and apply the tag to selected files.
- *
- * Returns: %TRUE if the event was handled, %FALSE if the event should
- * propagate further
- */
-static gboolean
-et_tag_field_on_key_press_event (GtkEntry *entry, GdkEventKey *event,
- gpointer user_data)
-{
- GdkModifierType modifiers = gtk_accelerator_get_default_mod_mask ();
-
- switch (event->keyval)
- {
- case GDK_KEY_Return:
- case GDK_KEY_KP_Enter:
- case GDK_KEY_ISO_Enter:
- if ((event->state & modifiers) == GDK_CONTROL_MASK)
- {
- Mini_Button_Clicked (G_OBJECT (entry));
- }
- return TRUE;
- default:
- return FALSE;
- }
-}
diff --git a/src/easytag.h b/src/easytag.h
index 977b717..79bbd81 100644
--- a/src/easytag.h
+++ b/src/easytag.h
@@ -40,7 +40,6 @@
gboolean Main_Stop_Button_Pressed;
GtkWidget *MainWindow;
-GtkWidget *LogArea;
/* File Area */
GtkWidget *FileFrame;
@@ -131,13 +130,9 @@ void et_on_action_select_scan_mode (GtkRadioAction *action,
GtkRadioAction *current,
gpointer user_data);
-void Tag_Area_Display_Controls (ET_File *ETFile);
-
gboolean Read_Directory (gchar *path);
void Quit_MainWindow (void);
-void MainWindow_Apply_Changes (void);
void Update_Command_Buttons_Sensivity (void);
-void Attach_Popup_Menu_To_Tag_Entries (GtkEntry *entry);
void Clear_File_Entry_Field (void);
void Clear_Tag_Entry_Fields (void);
diff --git a/src/et_core.c b/src/et_core.c
index 3ba6191..9250ee3 100644
--- a/src/et_core.c
+++ b/src/et_core.c
@@ -32,6 +32,7 @@
#include <locale.h>
#include "errno.h"
+#include "application_window.h"
#include "easytag.h"
#include "et_core.h"
#include "mpeg_header.h"
@@ -2669,7 +2670,8 @@ void ET_Display_File_Data_To_UI (ET_File *ETFile)
}
/* Display controls in tag area */
- Tag_Area_Display_Controls(ETFile);
+ et_application_window_tag_area_display_controls (ET_APPLICATION_WINDOW (MainWindow),
+ ETFile);
/* Display file data, header data and file type */
switch (ETFileDescription->FileType)
diff --git a/src/setting.c b/src/setting.c
index 1186b4f..23c074b 100644
--- a/src/setting.c
+++ b/src/setting.c
@@ -33,6 +33,7 @@
#include <errno.h>
#include "setting.h"
+#include "application_window.h"
#include "prefs.h"
#include "bar.h"
#include "easytag.h"
@@ -119,15 +120,6 @@ static const tConfigVariable Config_Variables[] =
{"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 },
- {"main_window_width", CV_TYPE_INT, &MAIN_WINDOW_WIDTH },
- {"pane_handle_position1", CV_TYPE_INT, &PANE_HANDLE_POSITION1 },
- {"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 },
@@ -364,15 +356,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;
- MAIN_WINDOW_HEIGHT = -1;
- PANE_HANDLE_POSITION1 = 660;
- 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;
@@ -831,8 +814,14 @@ Apply_Changes_Of_Preferences_Window (void)
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);
+ if (SHOW_LOG_VIEW)
+ {
+ et_application_window_show_log_area (ET_APPLICATION_WINDOW (MainWindow));
+ }
+ else
+ {
+ et_application_window_hide_log_area (ET_APPLICATION_WINDOW (MainWindow));
+ }
/* Update state of check-menu-item into main/popup menu to browse subdirs */
Check_Menu_Item_Update_Browse_Subdir();
@@ -867,9 +856,6 @@ Apply_Changes_Of_UI (void)
* Changes in user interface
*/
- // Configuration of the main window (see easytag.c) - Function also called when destroying the window
- MainWindow_Apply_Changes();
-
// Configuration of the preference window (see prefs.c) - Function also called when destroying the window
OptionsWindow_Apply_Changes();
diff --git a/src/setting.h b/src/setting.h
index 3da0d8b..eaa1dcf 100644
--- a/src/setting.h
+++ b/src/setting.h
@@ -58,16 +58,6 @@ gint BROWSE_HIDDEN_DIR;
gint OPEN_SELECTED_BROWSER_NODE;
/* Misc */
-// User Interface
-gint SET_MAIN_WINDOW_POSITION;
-gint MAIN_WINDOW_X;
-gint MAIN_WINDOW_Y;
-gint MAIN_WINDOW_HEIGHT;
-gint MAIN_WINDOW_WIDTH;
-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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]