diff options
author | Ross Burton <rburton@src.gnome.org> | 2003-04-11 09:53:51 +0000 |
---|---|---|
committer | Ross Burton <rburton@src.gnome.org> | 2003-04-11 09:53:51 +0000 |
commit | 1f243f41e82df56a592077e3ccbfe82c058eef7c (patch) | |
tree | 97189d147cdb0113941701208ddd387978a539a7 | |
parent | 929ec9deb71359be17a8e08d8b7ec7b283a910ae (diff) |
More work
-rw-r--r-- | AUTHORS | 4 | ||||
-rw-r--r-- | ChangeLog | 40 | ||||
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | README | 36 | ||||
-rw-r--r-- | TODO | 31 | ||||
-rwxr-xr-x | autogen.sh | 2 | ||||
-rw-r--r-- | configure.in | 8 | ||||
-rw-r--r-- | data/Makefile.am | 22 | ||||
-rw-r--r-- | data/sound-juicer.glade | 11 | ||||
-rw-r--r-- | po/POTFILES | 9 | ||||
-rw-r--r-- | po/POTFILES.in | 9 | ||||
-rw-r--r-- | po/sound-juicer.pot | 232 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/sj-extractor.c | 4 | ||||
-rw-r--r-- | src/sj-gstreamer-fake.c | 63 | ||||
-rw-r--r-- | src/sj-main.c | 56 | ||||
-rw-r--r-- | tests/Makefile.am | 4 |
17 files changed, 406 insertions, 131 deletions
@@ -1,3 +1,5 @@ Ross Burton <ross@burtonini.com> -Thanks to Bastien Nocera for interface feedback (and libbacon) +Thanks to: +Bastien Nocera for interface feedback (and libbacon) +Frederic Crozat for Glade and i18n fixes @@ -1,3 +1,43 @@ +2003-04-11 Ross Burton <ross@burtonini.com> + + * acinclude.m4: + Copy the GStreamer element check macro from GStreamer CVS until + 0.6.1 is released. + * configure.in: + Check for the elements we use. + + * data/sound-juicer.schemas.in: + Add a GConf schemas file. + * data/Makefile.am: + Install the GConf schemas. + + * Makefile.am (SUBDIRS): + Mention the po/ directory, and hack in the removal of the intltool + cache (should be done in intltool I guess). + + * po/POTFILES.in: + Update for new sources. + + * src/sj-gstreamer-fake.c: + Remove old code. + + * src/sj-main.c: + Remove the gconf_init() call as it is deprecated. + Add an access check for the selected CD-ROM device. + Realize the main window when setting the window icon so it works + when a dialog pops up. Odd. + + * src/sj-extractor.c: + Use g_warning instead of g_print, and clean the messages. + + * tests/Makefile.am: + Use $(top_srcdir) so that out-of-source builds (and thus + distcheck) work. + + * README: + * TODO: + Updated. + 2003-04-10 Frederic Crozat <fcrozat@mandrakesoft.com> * data/sound-juicer.glade: diff --git a/Makefile.am b/Makefile.am index 1392770..24a9ef5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = data src tests +SUBDIRS = po data src tests INTLTOOL_BUILT = \ intltool-extract \ @@ -10,3 +10,5 @@ EXTRA_DIST = \ $(INTLTOOL_BUILT:=.in) CLEANFILES = $(INTLTOOL_BUILT) + +DISTCLEANFILES = po/.intltool-merge-cache @@ -1,5 +1,7 @@ -Sound Juicer +Sound Juicer 0.1 Copyright (C) 2003 Ross Burton +Licensed under the GPL, version 2 or greater. + This is Sound Juicer, a CD ripping tool using GTK+ and GStreamer. @@ -7,5 +9,33 @@ Do the usual configure/make/make install malarky, and run "sound-juicer" in $(prefix)/bin or "CD Ripper" in Applications -> Sound & Video. -GStreamer 0.6.1 (in CVS atm) is required for the Ogg tagging to work -correctly -- you'll get invalid tag messages with 0.6.0. + +Known Issues: + +For a complete To Do list, see the file TODO. + +GStreamer 0.6.1 (in CVS currently) is required for the Ogg tagging to +work correctly -- with 0.6.0 the comment field is encoded incorrectly +and will give an error message, but the other fields are written +correctly. + +There is no way in the UI to select the output path. It defaults to +$HOME, and can be changed by editing the GConf key +/apps/sound-juicer/base_path. + +There is no way in the UI to change the filename of music. It +currently uses "(basepath)/(album title)/(song title).ogg". To edit +this change pop_and_rip() in sj-extracting.c + +Musicbrainz 2.0.1 is required. It should be a 10 minute hack to make +it work for 2.0.0, and maybe even for 1.1.0. + +You need to have the 'cdparanoia' and 'vorbisenc' GStreamer elements +installed. The configure script will look for these and issue a +warning if they are not found. At the moment if they are not available +at run time Sound Juicer just exits. This will be fixed, don't panic. + +It is recommended to run Sound Juicer first in a terminal, there are +still many messages which are not displayed in a dialog, but printed +to the console. Until you know it works for you, run in a terminal to +check. @@ -1,9 +1,3 @@ -Create a GConf schema file. - -I'd like to be able to check for cdparanoia, vorbisenc, etc GST -plugins at configure time. Get the m4 macro to do this from -gst-plugins. - Do a CD lookup using gnome-media's CDDB library GObjectify the CD lookup code. @@ -18,7 +12,32 @@ For the future, add a button to submit the current titles Play/stop track. Not a full CD player, but simple play/stop should be enough. +Maybe add a button to start the users CD player (as determined by +magicdev?) + SjExtractor's constructor wants to return a GError if it fails. How do I do this with GObject? Watch the CD drive so the UI updates when a disk is inserted/removed. + +Now I do the sensible thing and select all tracks by default, do I need Select All? + +Depend on gstreamer 0.6.1 + +UI to set base path + +UI to set filename format + +Handle libmusicbrainz 2.0.0 by looking for the headers manually. + +See if I use the new features of libmusicbrainz 2, or if 1.10 is enough. + +Write some user documentation. + +Remove every g_print and replace with groovy dialogs. + +Find out why when an error dialog pops up before the main window, I get: + (sound-juicer:28417): Gtk-CRITICAL **: file gtkwindow.c: line 2426 + (gtk_window_realize_icon): assertion `info->icon_pixmap == NULL' + failed +when the main window appears unless I can gtk_widget_realize(main_window) first? @@ -254,7 +254,7 @@ if $want_gettext; then require_m4macro gettext.m4 fi -if $want_glib_gettextize; then +if $want_glib_gettext; then version_check glib-gettext GLIB_GETTEXTIZE glib-gettextize $REQUIRED_GLIB_GETTEXT_VERSION \ "ftp://ftp.gtk.org/pub/gtk/v2.2/glib-$REQUIRED_GLIB_GETTEXT_VERSION.tar.gz" || DIE=1 require_m4macro glib-gettext.m4 diff --git a/configure.in b/configure.in index a96e0ad..ca339e1 100644 --- a/configure.in +++ b/configure.in @@ -21,6 +21,9 @@ AM_PROG_CC_STDC AC_HEADER_STDC AC_PROG_INTLTOOL([0.20]) +ALL_LINGUAS="ca" +AM_GLIB_GNU_GETTEXT dnl TODO: is this still required? + PKG_CHECK_MODULES(GLIB, glib-2.0) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) @@ -52,8 +55,9 @@ if test x"$GCONFTOOL" = xno; then fi AM_GCONF_SOURCE_2 -ALL_LINGUAS="ca" -AM_GLIB_GNU_GETTEXT +AM_GST_ELEMENT_CHECK(cdparanoia,,AC_MSG_ERROR([The 'cdparanoa' element was not found. This will cause Sound Juicer to fail at runtime.])) +AM_GST_ELEMENT_CHECK(vorbisenc,,AC_MSG_ERROR([The 'vorbisenc' element was not found. This will cause Sound Juicer to fail at runtime.])) +AM_GST_ELEMENT_CHECK(filesink,,AC_MSG_WARN([The 'filesink' element was not found. This will cause Sound Juicer to fail at runtime.])) AC_OUTPUT([ Makefile diff --git a/data/Makefile.am b/data/Makefile.am index 1788b97..78c9019 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -5,5 +5,25 @@ privatedatadir = $(datadir)/sound-juicer/ privatedata_DATA = sound-juicer.glade orange-slice.png desktopdir = $(datadir)/applications -desktop_DATA = sound-juicer.desktop +desktop_in_files = sound-juicer.desktop.in +desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) @INTLTOOL_DESKTOP_RULE@ + +schemadir = $(GCONF_SCHEMA_FILE_DIR) +schema_in_files = sound-juicer.schemas.in +schema_DATA = $(schema_in_files:.schemas.in=.schemas) +@INTLTOOL_SCHEMAS_RULE@ + +install-data-local: + GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \ + gconftool-2 --makefile-install-rule $(schema_DATA) + +CLEANFILES = \ + $(desktop_DATA) \ + $(schema_DATA) + +EXTRA_DIST = \ + $(pixmap_DATA) \ + $(privatedata_DATA) \ + $(desktop_in_files) \ + $(schema_in_files) diff --git a/data/sound-juicer.glade b/data/sound-juicer.glade index ae5e43a..8657c0b 100644 --- a/data/sound-juicer.glade +++ b/data/sound-juicer.glade @@ -2,7 +2,6 @@ <!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> <glade-interface> -<requires lib="gnome"/> <widget class="GtkWindow" id="main_window"> <property name="width_request">350</property> @@ -28,8 +27,8 @@ <child> <widget class="GtkMenuItem" id="menuitem1"> - <property name="visible">True</property> - <property name="stock_item">GNOMEUIINFO_MENU_FILES_TREE</property> + <property name="visible">True</property> + <property name="stock_item">GNOMEUIINFO_MENU_FILE_TREE</property> <child> <widget class="GtkMenu" id="menuitem1_menu"> @@ -43,7 +42,7 @@ <accelerator key="E" modifiers="GDK_CONTROL_MASK" signal="activate"/> <child internal-child="image"> - <widget class="GtkImage" id="image53"> + <widget class="GtkImage" id="image54"> <property name="visible">True</property> <property name="stock">gtk-cdrom</property> <property name="icon_size">1</property> @@ -65,7 +64,7 @@ <accelerator key="R" modifiers="GDK_CONTROL_MASK" signal="activate"/> <child internal-child="image"> - <widget class="GtkImage" id="image54"> + <widget class="GtkImage" id="image55"> <property name="visible">True</property> <property name="stock">gtk-refresh</property> <property name="icon_size">1</property> @@ -133,7 +132,7 @@ <child> <widget class="GtkMenuItem" id="menuitem4"> <property name="visible">True</property> - <property name="stock_item">GNOMEUIINFO_MENU_HELP_TREE</property> + <property name="stock_item">GNOMEUIINFO_MENU_HELP_TREE</property> <child> <widget class="GtkMenu" id="menuitem4_menu"> diff --git a/po/POTFILES b/po/POTFILES index 03e5ee2..7c2ff8a 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -1,6 +1,13 @@ ../data/sound-juicer.glade \ ../data/sound-juicer.desktop.in \ + ../data/sound-juicer.schemas.in \ ../src/cd-drive.c \ ../src/bacon-cd-selection.c \ ../src/sj-musicbrainz.c \ - ../src/sj-gstreamer.c + ../src/sj-extractor.c \ + ../src/sj-error.c \ + ../src/sj-util.c \ + ../src/sj-about.c \ + ../src/sj-prefs.c \ + ../src/sj-extracting.c \ + ../src/sj-main.c diff --git a/po/POTFILES.in b/po/POTFILES.in index 3379cc2..7f69675 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,7 +1,14 @@ data/sound-juicer.glade data/sound-juicer.desktop.in +data/sound-juicer.schemas.in src/cd-drive.c src/bacon-cd-selection.c src/sj-musicbrainz.c -src/sj-gstreamer.c +src/sj-extractor.c +src/sj-error.c +src/sj-util.c +src/sj-about.c +src/sj-prefs.c +src/sj-extracting.c +src/sj-main.c diff --git a/po/sound-juicer.pot b/po/sound-juicer.pot index 3e7afc9..4a5557b 100644 --- a/po/sound-juicer.pot +++ b/po/sound-juicer.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2003-03-25 13:06+0000\n" +"POT-Creation-Date: 2003-04-10 18:54+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -16,79 +16,267 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: data/sound-juicer.glade.h:1 -msgid "<b>Artist:</b>" +msgid "<b>Album Progress</b>" msgstr "" #: data/sound-juicer.glade.h:2 -msgid "<b>CD Drive</b>" +msgid "<b>Artist:</b>" msgstr "" #: data/sound-juicer.glade.h:3 -msgid "<b>CD Info</b>" +msgid "<b>CD Drive</b>" msgstr "" #: data/sound-juicer.glade.h:4 -msgid "<b>Duration:</b>" +msgid "<b>CD Info</b>" msgstr "" #: data/sound-juicer.glade.h:5 -msgid "<b>Output Path</b>" +msgid "<b>Duration:</b>" msgstr "" #: data/sound-juicer.glade.h:6 -msgid "<b>Title:</b>" +msgid "<b>Output Format</b>" msgstr "" #: data/sound-juicer.glade.h:7 -msgid "Multiple Albums Found" +msgid "<b>Output Name</b>" msgstr "" #: data/sound-juicer.glade.h:8 -msgid "Prefere_nces" +msgid "<b>Output Path</b>" msgstr "" #: data/sound-juicer.glade.h:9 -msgid "Preferences" +msgid "<b>Title:</b>" msgstr "" #: data/sound-juicer.glade.h:10 -msgid "Re-read" +msgid "<b>Track Progress</b>" msgstr "" #: data/sound-juicer.glade.h:11 -msgid "Sound Juicer" +msgid "FLAC" msgstr "" #: data/sound-juicer.glade.h:12 -msgid "" -"This CD could be more than one album. Please select which album it is below " -"and press OK." +msgid "MPEG" msgstr "" #: data/sound-juicer.glade.h:13 -msgid "_About" +msgid "Multiple Albums Found" msgstr "" #: data/sound-juicer.glade.h:14 -msgid "_Edit" +msgid "Ogg Vorbis" msgstr "" #: data/sound-juicer.glade.h:15 -msgid "_Extract" +msgid "Preferences" msgstr "" #: data/sound-juicer.glade.h:16 -msgid "_File" +msgid "Progress" msgstr "" -#: data/sound-juicer.glade.h:17 -msgid "_Help" +#: data/sound-juicer.glade.h:17 src/sj-about.c:49 +msgid "Sound Juicer" msgstr "" #: data/sound-juicer.glade.h:18 -msgid "_Quit" +msgid "" +"This CD could be more than one album. Please select which album it is below " +"and press <i>Continue</i>." msgstr "" #: data/sound-juicer.glade.h:19 +msgid "Wave" +msgstr "" + +#: data/sound-juicer.glade.h:20 +msgid "_Browse..." +msgstr "" + +#: data/sound-juicer.glade.h:21 +msgid "_Continue" +msgstr "" + +#: data/sound-juicer.glade.h:22 +msgid "_Extract" +msgstr "" + +#: data/sound-juicer.glade.h:23 +msgid "_Re-read" +msgstr "" + +#: data/sound-juicer.glade.h:24 msgid "label" msgstr "" + +#: data/sound-juicer.desktop.in.h:1 +msgid "CD Ripper" +msgstr "" + +#: data/sound-juicer.desktop.in.h:2 +msgid "Rip music from your CDs" +msgstr "" + +#: data/sound-juicer.schemas.in.h:1 +msgid "TODO: describe valid symbols" +msgstr "" + +#: data/sound-juicer.schemas.in.h:2 +msgid "The filename pattern to write to." +msgstr "" + +#: src/cd-drive.c:274 +#, c-format +msgid "Unnamed SCSI CDROM (%s)" +msgstr "" + +#: src/cd-drive.c:573 +msgid "File image" +msgstr "" + +#: src/bacon-cd-selection.c:233 +msgid "Unnamed CDROM" +msgstr "" + +#: src/bacon-cd-selection.c:275 +msgid "Select the drive" +msgstr "" + +#: src/sj-musicbrainz.c:60 +#, c-format +msgid "Cannot read CD: %s" +msgstr "" + +#: src/sj-musicbrainz.c:65 +msgid "Unknown Artist" +msgstr "" + +#: src/sj-musicbrainz.c:66 +msgid "Unknown Title" +msgstr "" + +#: src/sj-musicbrainz.c:71 +#, c-format +msgid "Track %d" +msgstr "" + +#: src/sj-musicbrainz.c:89 +msgid "Cannot create MusicBrainz client" +msgstr "" + +#: src/sj-musicbrainz.c:100 +msgid "This CD was not found.\n" +msgstr "" + +#: src/sj-extractor.c:140 +#, c-format +msgid "Could not create pipeline: %s" +msgstr "" + +#: src/sj-extractor.c:192 +msgid "Could not create cdparanoia element" +msgstr "" + +#: src/sj-extractor.c:208 +msgid "Could not create Vorbis encoding element" +msgstr "" + +#: src/sj-extractor.c:219 +msgid "Could not create file sink element" +msgstr "" + +#: src/sj-extractor.c:311 +msgid "Ripped with Sound Juicer" +msgstr "" + +#: src/sj-extractor.c:325 +msgid "Could not seek to track" +msgstr "" + +#: src/sj-util.c:63 +#, c-format +msgid "Could not create directory %s: %s" +msgstr "" + +#: src/sj-about.c:50 +msgid "Copyright (C) 2003 Ross Burton" +msgstr "" + +#: src/sj-about.c:51 +msgid "A CD Ripper" +msgstr "" + +#: src/sj-extracting.c:62 +#, c-format +msgid "Currently extracting '%s'" +msgstr "" + +#: src/sj-extracting.c:69 +#, c-format +msgid "mkdir() failed: %s" +msgstr "" + +#: src/sj-main.c:79 +msgid "You are currently extracting a CD. Do you want to quit now or contine?" +msgstr "" + +#: src/sj-main.c:81 +msgid "Continue" +msgstr "" + +#: src/sj-main.c:127 src/sj-main.c:177 +msgid "(unknown)" +msgstr "" + +#: src/sj-main.c:219 src/sj-main.c:457 +msgid "Title" +msgstr "" + +#: src/sj-main.c:225 src/sj-main.c:465 +msgid "Artist" +msgstr "" + +#: src/sj-main.c:287 +#, c-format +msgid "Cannot list albums: %s\n" +msgstr "" + +#: src/sj-main.c:316 +msgid "" +"<b>No CD-ROMs found</b>\n" +"\n" +"Sound Juicer could not find any CD-ROM drives to read." +msgstr "" + +#: src/sj-main.c:361 +#, c-format +msgid "Unknown format '%s'" +msgstr "" + +#: src/sj-main.c:392 +msgid "Sound Juicer CD Ripper" +msgstr "" + +#: src/sj-main.c:403 +#, c-format +msgid "" +"Sound-Juicer couln't initialise the \n" +"configuration engine:\n" +"%s" +msgstr "" + +#: src/sj-main.c:442 +msgid "Extract?" +msgstr "" + +#: src/sj-main.c:449 +msgid "Track" +msgstr "" + +#: src/sj-main.c:473 +msgid "Duration" +msgstr "" diff --git a/src/Makefile.am b/src/Makefile.am index 0822c3a..2bf3e0f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -14,6 +14,8 @@ INCLUDES = @LIBGLADE_CFLAGS@ @GSTREAMER_CFLAGS@ @MUSICBRAINZ_CFLAGS@ @GNOME_CFLA bin_PROGRAMS = sound-juicer sound_juicer_SOURCES = \ + sound-juicer.h \ + sj-structures.h \ sj-main.c \ sj-prefs.h \ sj-prefs.c \ diff --git a/src/sj-extractor.c b/src/sj-extractor.c index 542db1f..bc599d9 100644 --- a/src/sj-extractor.c +++ b/src/sj-extractor.c @@ -243,7 +243,7 @@ static gboolean tick_timeout_cb(SjExtractor *extractor) } if (!gst_pad_query (extractor->priv->source_pad, GST_QUERY_POSITION, &format, &nanos)) { - g_print ("pad_query failed!\n"); + g_warning (_("Could not get current track position")); return TRUE; } @@ -327,7 +327,7 @@ void sj_extractor_extract_track (SjExtractor *extractor, const TrackDetails *tra } if (!gst_pad_query (priv->source_pad, GST_QUERY_POSITION, &format, &nanos)) { - g_print ("pad_query failed!\n"); + g_warning (_("Could not get track start position")); return; } priv->track_start = nanos / GST_SECOND; diff --git a/src/sj-gstreamer-fake.c b/src/sj-gstreamer-fake.c deleted file mode 100644 index f2c68e3..0000000 --- a/src/sj-gstreamer-fake.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2003 Ross Burton <ross@burtonini.com> - * - * Sound Juicer - sj-musicbrainz-fake.c - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Authors: Ross Burton <ross@burtonini.com> - */ - -#include <glib/gerror.h> -#include <glib/gmessages.h> -#include <glib/gtimer.h> -#include <glib/gmain.h> -#include "sj-gstreamer.h" - -void sj_gstreamer_init (int argc, char **argv, GError **error) -{ - g_print ("gstreamer-fake: init()\n"); -} - -void sj_gstreamer_shutdown (void) -{ - g_print ("gstreamer-fake: shutdown()\n"); -} - -void sj_gstreamer_set_cdrom (const char* device) -{ - g_print ("gstreamer-fake: set_cdrom(\"%s\")\n", device == NULL ? "NULL" : device); -} - -static int counter; - -static gboolean idle_callback(gpointer data) -{ - g_print("."); - g_usleep(100); - counter++; - if (counter > 100) { - /* fire finish */ - } else if (counter % 10 == 0) { - /* fire progress event */ - } - return TRUE; -} - -void sj_gstreamer_extract_track (const TrackDetails *track, const char* path, GError **error) -{ - g_print ("gstreamer-fake: extract_track()\n"); - g_idle_add (idle_callback, NULL); -} diff --git a/src/sj-main.c b/src/sj-main.c index ecf9832..29dde6e 100644 --- a/src/sj-main.c +++ b/src/sj-main.c @@ -23,6 +23,7 @@ #include "sound-juicer.h" #include <string.h> +#include <unistd.h> #include <gnome.h> #include <gtk/gtk.h> #include <glade/glade.h> @@ -64,6 +65,7 @@ gboolean extracting = FALSE; void on_quit_activate (GtkMenuItem *item, gpointer user_data) { g_object_unref (extractor); + g_object_unref (gconf_client); gtk_main_quit (); } @@ -160,7 +162,8 @@ static void update_ui_for_album (AlbumDetails *album) album_duration += track->duration; gtk_list_store_append (track_store, &iter); gtk_list_store_set (track_store, &iter, - COLUMN_NUMBER, track->number, + COLUMN_EXTRACT, TRUE, + COLUMN_NUMBER, track->number, COLUMN_TITLE, track->title, COLUMN_ARTIST, track->artist, COLUMN_DURATION, track->duration, @@ -283,7 +286,16 @@ void reread_cd (void) albums = sj_musicbrainz_list_albums(&error); if (error) { - g_print (_("Cannot list albums: %s\n"), error->message); + GtkWidget *dialog; + dialog = gtk_message_dialog_new (GTK_WINDOW (main_window), 0, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("<b>Could not read CD</b>\n\n" + "Sound Juicer could not read the track listing on this CD.\n" + "Reason: %s"), error->message); + gtk_label_set_use_markup (GTK_LABEL (GTK_MESSAGE_DIALOG (dialog)->label), TRUE); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); g_error_free (error); update_ui_for_album (NULL); return; @@ -309,7 +321,7 @@ void device_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, g if (device == NULL) { #if 0 GtkWidget *dialog; - dialog = gtk_message_dialog_new (NULL, 0, + dialog = gtk_message_dialog_new (GTK_WINDOW (main_window), 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("<b>No CD-ROMs found</b>\n\n" @@ -322,7 +334,20 @@ void device_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, g } } else { device = gconf_value_get_string (entry->value); - /* TODO: sanity check device */ + if (access (device, R_OK) != 0) { + GtkWidget *dialog; + dialog = gtk_message_dialog_new (GTK_WINDOW (main_window), 0, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("<b>Could not access CD-ROM</b>\n\n" + "Sound Juicer could not access the CD-ROM device '%s'.\n" + "Reason: %s"), device, strerror (errno)); + gtk_label_set_use_markup (GTK_LABEL (GTK_MESSAGE_DIALOG (dialog)->label), TRUE); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + /* Set a null device */ + device = NULL; + } } sj_musicbrainz_set_cdrom (device); sj_extractor_set_device (extractor, device); @@ -377,8 +402,6 @@ static void on_extract_toggled (GtkCellRendererToggle *cellrenderertoggle, int main (int argc, char **argv) { - GError *err = NULL; - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); @@ -394,19 +417,11 @@ int main (int argc, char **argv) extractor = SJ_EXTRACTOR (sj_extractor_new()); - gconf_init (argc, argv, &err); - if (err != NULL || (gconf_client = gconf_client_get_default ()) == NULL) - { - char *str; - - str = g_strdup_printf (_("Sound-Juicer couln't initialise the \n" - "configuration engine:\n%s"), - err->message); - g_error_free (err); - g_free (str); - exit (1); - } - + gconf_client = gconf_client_get_default (); + if (gconf_client == NULL) { + g_print (_("Could not create GConf client.\n")); + exit (1); + } gconf_client_add_dir (gconf_client, GCONF_ROOT, GCONF_CLIENT_PRELOAD_RECURSIVE, NULL); gconf_client_notify_add (gconf_client, GCONF_DEVICE, device_changed_cb, NULL, NULL, NULL); @@ -419,6 +434,9 @@ int main (int argc, char **argv) glade_xml_signal_autoconnect (glade); main_window = glade_xml_get_widget (glade, "main_window"); + /* TODO: weird. Need this here so that the icon is displayed when an + error dialog pops up first. */ + gtk_widget_realize (main_window); gtk_window_set_icon_from_file (GTK_WINDOW (main_window), PIXMAPDIR"/sound-juicer.png", NULL); select_all_menuitem = glade_xml_get_widget (glade, "select_all"); diff --git a/tests/Makefile.am b/tests/Makefile.am index e36fa97..9ae7216 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,10 +1,10 @@ -INCLUDES = -I../src/ @LIBGLADE_CFLAGS@ @GSTREAMER_CFLAGS@ @MUSICBRAINZ_CFLAGS@ @GNOME_CFLAGS@ +INCLUDES = -I$(top_srcdir)/src @LIBGLADE_CFLAGS@ @GSTREAMER_CFLAGS@ @MUSICBRAINZ_CFLAGS@ @GNOME_CFLAGS@ AM_CFLAGS = -g -Wall -export-dynamic -Wunused AM_DEFS = -DGNOME_DISABLE_DEPRECATED=1 -DGTK_DISABLE_DEPRECATED=1 -DGDK_DISABLE_DEPRECATED=1 -DG_DISABLE_DEPRECATED=1 noinst_PROGRAMS = mb-test -mb_test_SOURCES = mb-test.c ../src/sj-musicbrainz.c ../src/sj-error.c +mb_test_SOURCES = mb-test.c $(top_srcdir)/src/sj-musicbrainz.c $(top_srcdir)/src/sj-error.c mb_test_LDADD = @GLIB_LIBS@ @MUSICBRAINZ_LIBS@ enum.c: enum.h |