• R/O
  • SSH
  • HTTPS

mmaid: Commit


Commit MetaInfo

Revision140 (tree)
Time2012-12-17 19:56:20
Authoriwm

Log Message

add newline code and path separator

Change Summary

Incremental Difference

--- mmaid/trunk/src/sigmain.c (revision 139)
+++ mmaid/trunk/src/sigmain.c (revision 140)
@@ -113,13 +113,13 @@
113113 {
114114 switch (file_is_type (file))
115115 {
116- case FILE_KIND_ERROR:
117- case FILE_KIND_DB:
118- case FILE_KIND_LIST:
116+ case FILE_TYPE_ERROR:
117+ case FILE_TYPE_DB:
118+ case FILE_TYPE_LIST:
119119 mmaid = file_open_edit (file);
120120 break;
121- case FILE_KIND_UNKNOWN:
122- case FILE_KIND_TAG:
121+ case FILE_TYPE_MUSIC:
122+ case FILE_TYPE_TAG:
123123 {
124124 ID3Tag *id3tag;
125125
@@ -201,13 +201,13 @@
201201 if (arg_files[i])
202202 switch (file_is_type (argv[i]))
203203 {
204- case FILE_KIND_ERROR:
205- case FILE_KIND_DB:
206- case FILE_KIND_LIST:
204+ case FILE_TYPE_ERROR:
205+ case FILE_TYPE_DB:
206+ case FILE_TYPE_LIST:
207207 mmaid = file_open_edit (argv[i]);
208208 break;
209- case FILE_KIND_UNKNOWN:
210- case FILE_KIND_TAG:
209+ case FILE_TYPE_MUSIC:
210+ case FILE_TYPE_TAG:
211211 {
212212 ID3Tag *id3tag;
213213
--- mmaid/trunk/src/mmaid.c (revision 139)
+++ mmaid/trunk/src/mmaid.c (revision 140)
@@ -1,6 +1,6 @@
11 /*
22 Melody maid
3- copyright (c) 1998-2011 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
3+ copyright (c) 1998-2012 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
44
55 This program is free software: you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
@@ -49,7 +49,14 @@
4949 gint def_gnum = 192; /* ja:デフォルトのジャンル */
5050 gint def_width, def_height; /* ja:デフォルトのウインドウのサイズ */
5151 gint license = -1; /* ja:ライセンス */
52-gint playlist = 0; /* ja:プレイリスト */
52+gint def_plist = PLAYLIST_RELATIVE; /* ja:プレイリスト */
53+gint def_sep = G_DIR_SEPARATOR; /* ja:パスの区切り */
54+#ifdef G_OS_WIN32
55+gint def_crlf = CODE_CRLF; /* ja:改行コード */
56+#else /* not G_OS_WIN32 */
57+gint def_crlf = CODE_LF; /* ja:改行コード */
58+#endif /* not G_OS_WIN32 */
59+gboolean def_head = TRUE; /* ja:ヘッダ */
5360 GObject *history; /* ja:ファイルの履歴 */
5461 GdkAtom atom_targets; /* ja:ターゲット */
5562 GdkAtom atom_id3tag; /* ja:ID3タグ */
@@ -98,6 +105,9 @@
98105 {NULL, '\0', NULL, NULL, 0, NULL}};
99106
100107 /* 初期化 */
108+#ifdef G_OS_WIN32
109+ SetErrorMode (SetErrorMode (0) | SEM_FAILCRITICALERRORS);
110+#endif /* G_OS_WIN32 */
101111 setlocale (LC_ALL, "");
102112 #if ! GTK_CHECK_VERSION(3,0,0)
103113 gtk_set_locale ();
@@ -278,14 +288,14 @@
278288
279289 switch (file_is_type (argv[i]))
280290 {
281- case FILE_KIND_ERROR:
282- case FILE_KIND_DB:
283- case FILE_KIND_LIST:
291+ case FILE_TYPE_ERROR:
292+ case FILE_TYPE_DB:
293+ case FILE_TYPE_LIST:
284294 mmaid = file_open_edit (argv[i]);
285295 count++;
286296 break;
287- case FILE_KIND_UNKNOWN:
288- case FILE_KIND_TAG:
297+ case FILE_TYPE_MUSIC:
298+ case FILE_TYPE_TAG:
289299 {
290300 ID3Tag *id3tag;
291301
--- mmaid/trunk/src/keyfile.c (revision 139)
+++ mmaid/trunk/src/keyfile.c (revision 140)
@@ -1,6 +1,6 @@
11 /*
22 Melody maid
3- copyright (c) 1998-2010 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
3+ copyright (c) 1998-2012 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
44
55 This program is free software: you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
@@ -51,7 +51,10 @@
5151 n_pos = g_key_file_get_integer (key_file, "pref", "npos", NULL);
5252 def_hold = g_key_file_get_boolean (key_file, "mmaid", "defhold", NULL);
5353 def_gnum = g_key_file_get_integer (key_file, "mmaid", "defgnum", NULL);
54- playlist = g_key_file_get_integer (key_file, "mmaid", "playlist", NULL);
54+ def_plist = g_key_file_get_integer (key_file, "mmaid", "playlist", NULL);
55+ def_sep = g_key_file_get_integer (key_file, "mmaid", "separator", NULL);
56+ def_crlf = g_key_file_get_integer (key_file, "mmaid", "crlf", NULL);
57+ def_head = g_key_file_get_boolean (key_file, "mmaid", "header", NULL);
5558 cmd_play = g_key_file_get_string (key_file, "mmaid", "cmdplay", NULL);
5659 cmd_stop = g_key_file_get_string (key_file, "mmaid", "cmdstop", NULL);
5760 charset_list = g_key_file_get_string (key_file, "mmaid", "charsetlist",
@@ -187,7 +190,10 @@
187190 g_key_file_set_integer (key_file, "pref", "npos", n_pos);
188191 g_key_file_set_boolean (key_file, "mmaid", "defhold", def_hold);
189192 g_key_file_set_integer (key_file, "mmaid", "defgnum", def_gnum);
190- g_key_file_set_integer (key_file, "mmaid", "playlist", playlist);
193+ g_key_file_set_integer (key_file, "mmaid", "playlist", def_plist);
194+ g_key_file_set_integer (key_file, "mmaid", "separator", def_sep);
195+ g_key_file_set_integer (key_file, "mmaid", "crlf", def_crlf);
196+ g_key_file_set_boolean (key_file, "mmaid", "header", def_head);
191197 g_key_file_set_string (key_file, "mmaid", "charsetlist", charset_list);
192198 if (cmd_play)
193199 g_key_file_set_string (key_file, "mmaid", "cmdplay", cmd_play);
--- mmaid/trunk/src/mm_dialog.c (revision 139)
+++ mmaid/trunk/src/mm_dialog.c (revision 140)
@@ -1,6 +1,6 @@
11 /*
22 Melody maid
3- copyright (c) 1998-2011 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
3+ copyright (c) 1998-2012 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
44
55 This program is free software: you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
@@ -129,8 +129,8 @@
129129 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
130130 gtk_container_set_border_width (GTK_CONTAINER (scroll), SPACING);
131131 /* ja:フレームとボックス */
132- gtk_container_add (GTK_CONTAINER
133- (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), scroll);
132+ gtk_box_pack_end (GTK_BOX (gtk_dialog_get_content_area
133+ (GTK_DIALOG (dialog))), scroll, TRUE, TRUE, 0);
134134
135135 /* ja:表示 */
136136 gtk_widget_show_all (scroll);
--- mmaid/trunk/src/mmaid.h (revision 139)
+++ mmaid/trunk/src/mmaid.h (revision 140)
@@ -33,11 +33,24 @@
3333 #define MMAID_COPYRIGHT_NOTICE "Copyright (C) 1998-2012 Kazuki Iwamoto"
3434
3535
36+#define PLAYLIST_RELATIVE 0
37+#define PLAYLIST_ABSOLUTE 1
38+#define PLAYLIST_BASENAME 2
39+
40+
41+#define CODE_CRLF 0
42+#define CODE_CR 1
43+#define CODE_LF 2
44+
45+
3646 typedef struct _MmaidWindow
3747 {
3848 gchar *charset; /* ja:キャラクターセット */
39- guint filekind; /* ja:ファイルの種類 */
40- gint playlist; /* ja:プレイリスト(0:相対,1:絶対,2:名前) */
49+ guint filetype; /* ja:ファイルの種類 */
50+ gint playlist; /* ja:プレイリスト */
51+ gint separator; /* ja:パスの区切り */
52+ gint crlf; /* ja:改行コード */
53+ gboolean header; /* ja:ヘッダ */
4154 GtkWidget *list; /* ja:描画領域 */
4255 } MmaidWindow;
4356 typedef struct _ID3Tag
@@ -74,7 +87,10 @@
7487 extern gint def_gnum; /* ja:デフォルトのジャンル */
7588 extern gint def_width, def_height; /* ja:デフォルトのウインドウのサイズ */
7689 extern gint license; /* ja:ライセンス */
77-extern gint playlist; /* ja:プレイリスト */
90+extern gint def_plist; /* ja:プレイリスト */
91+extern gint def_sep; /* ja:パスの区切り */
92+extern gint def_crlf; /* ja:改行コード */
93+extern gboolean def_head; /* ja:ヘッダ */
7894 extern GObject *history; /* ja:ファイルの履歴 */
7995 extern GdkAtom atom_id3tag; /* ja:ID3タグ */
8096 extern GtkPositionType n_pos; /* ja:ノートブックの位置 */
--- mmaid/trunk/src/command.c (revision 139)
+++ mmaid/trunk/src/command.c (revision 140)
@@ -1,6 +1,6 @@
11 /*
22 Melody maid
3- copyright (c) 1998-2011 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
3+ copyright (c) 1998-2012 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
44
55 This program is free software: you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
@@ -60,7 +60,7 @@
6060 command_open (GtkWidget *widget,
6161 gpointer user_data)
6262 {
63- gchar *file = NULL, *path, *title;
63+ gchar *file = NULL, *title;
6464 GtkStockItem stock_item;
6565 GtkWidget *dialog;
6666
@@ -85,6 +85,8 @@
8585 dialog = gtk_file_selection_new (title);
8686 if (open_path)
8787 {
88+ gchar *path;
89+
8890 path = g_strconcat (open_path, G_SEARCHPATH_SEPARATOR_S, NULL);
8991 gtk_file_selection_set_filename (GTK_FILE_SELECTION (dialog), path);
9092 g_free (path);
@@ -98,6 +100,8 @@
98100 gtk_widget_destroy (dialog);
99101 if (file)
100102 {
103+ gchar *path;
104+
101105 g_free (open_path);
102106 path = fileio_get_full_path (file);
103107 open_path = g_path_get_dirname (path);
@@ -176,11 +180,12 @@
176180 result = gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES;
177181 gtk_widget_destroy (dialog);
178182 }
179- if (result && (mmaid->filekind == FILE_KIND_DB
180- ? file_save_db (file, mmaid, root, mmaid->charset)
181- : file_save_list (file, mmaid, root, mmaid->charset,
182- mmaid->playlist))
183- && (mmaid->filekind == FILE_KIND_DB || mmaid->playlist != 2))
183+ if (result && (mmaid->filetype == FILE_TYPE_DB
184+ ? file_save_db (file, mmaid, root, mmaid->charset)
185+ : file_save_list (file, mmaid, mmaid->charset,
186+ mmaid->playlist, mmaid->separator, mmaid->crlf, mmaid->header))
187+ && (mmaid->filetype == FILE_TYPE_DB
188+ || mmaid->playlist != PLAYLIST_BASENAME))
184189 orz_mdi_set_edited (ORZ_MDI (mdi), page_num, FALSE);
185190 }
186191 g_free (root);
@@ -187,21 +192,45 @@
187192 }
188193
189194
195+typedef struct _SaveDialog
196+{
197+ GtkWidget *radio_db, *radio_plist;
198+ GtkWidget *frame_path, *radio_relative, *radio_absolute, *radio_basename;
199+ GtkWidget *frame_sep, *radio_slash, *radio_yen;
200+ GtkWidget *check_header;
201+ GtkWidget *combo_encoding, *radio_crlf, *radio_cr, *radio_lf;
202+ GtkWidget *label_root, *combo_root;
203+} SaveDialog;
204+
205+
190206 /* ja:ラジオボタンが変更された */
191207 static void
192-command_save_toggled_radio0 (GtkWidget *widget,
193- GtkWidget *hbox)
208+command_save_toggled_radio_db (GtkWidget *widget,
209+ SaveDialog *savedlg)
194210 {
195- gtk_widget_set_sensitive (hbox, FALSE);
211+ gboolean active;
212+
213+ active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
214+ gtk_widget_set_sensitive (savedlg->frame_path, !active);
215+ gtk_widget_set_sensitive (savedlg->frame_sep, !active
216+ && !gtk_toggle_button_get_active
217+ (GTK_TOGGLE_BUTTON (savedlg->radio_basename)));
218+ gtk_widget_set_sensitive (savedlg->radio_crlf, !active);
219+ gtk_widget_set_sensitive (savedlg->radio_cr, !active);
220+ gtk_widget_set_sensitive (savedlg->radio_lf, !active);
221+ gtk_widget_set_sensitive (savedlg->check_header, !active);
222+ gtk_widget_set_sensitive (savedlg->label_root, active);
223+ gtk_widget_set_sensitive (savedlg->combo_root, active);
196224 }
197225
198226
199227 /* ja:ラジオボタンが変更された */
200228 static void
201-command_save_toggled_radio1 (GtkWidget *widget,
202- GtkWidget *hbox)
229+command_save_toggled_radio_basename (GtkWidget *widget,
230+ SaveDialog *savedlg)
203231 {
204- gtk_widget_set_sensitive (hbox, TRUE);
232+ gtk_widget_set_sensitive (savedlg->frame_sep,
233+ !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
205234 }
206235
207236
@@ -262,15 +291,16 @@
262291 command_saveas (GtkWidget *widget,
263292 gpointer user_data)
264293 {
265- gchar *file, *root = NULL, *charset, *name, *path, *tmp, **ary, *title;
266- gint i, playlist, page_num;
267- guint filekind;
294+ gboolean header;
295+ gchar *file, *root = NULL, *charset, *path, **ary, *title;
296+ gint i, playlist, separator, crlf, page_num;
297+ guint filetype;
268298 GList *gl, *glist = NULL;
269299 GtkStockItem stock_item;
270- GtkWidget *dialog, *hbox0, *hbox1, *vbox;
271- GtkWidget *combo0, *combo1, *label0, *label1;
272- GtkWidget *radio0, *radio1, *radio2, *radio3, *radio4;
300+ GtkWidget *dialog, *frame, *hbox, *vbox;
301+ GtkWidget *label_path, *label_sep, *label_encoding;
273302 MmaidWindow *mmaid;
303+ SaveDialog savedlg;
274304
275305 page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (mdi));
276306 mmaid = orz_mdi_get_data (ORZ_MDI (mdi), page_num);
@@ -309,15 +339,15 @@
309339 }
310340 *path = '\0';
311341 #ifdef G_OS_WIN32
312- if (g_strlen (root) > 2
313- && G_IS_DIR_SEPARATOR (root[0]) && G_IS_DIR_SEPARATOR (root[1]))
342+ if (G_IS_DIR_SEPARATOR (root[0]) && G_IS_DIR_SEPARATOR (root[1]))
314343 {
344+ ary = g_strsplit (root + 2, G_DIR_SEPARATOR_S, 0);
315345 path = g_strdup (G_DIR_SEPARATOR_S G_DIR_SEPARATOR_S);
316- ary = g_strsplit (root + 2, G_DIR_SEPARATOR_S, 0);
317346 }
318347 else
319348 {
320349 ary = g_strsplit (root, G_DIR_SEPARATOR_S, 0);
350+ path = NULL;
321351 }
322352 #else /* not G_OS_WIN32 */
323353 ary = g_strsplit (root, G_DIR_SEPARATOR_S, 0);
@@ -361,118 +391,175 @@
361391 dialog = gtk_file_selection_new (title);
362392 #endif /* not GTK_CHECK_VERSION(2,4,0) */
363393 g_free (title);
394+ /* ja:チェックボタン */
395+ savedlg.check_header = gtk_check_button_new_with_mnemonic (_("_Header"));
396+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (savedlg.check_header),
397+ mmaid->header);
364398 /* ja:ラジオボタン */
365- radio0 = gtk_radio_button_new_with_mnemonic (NULL, _("_iDB File"));
366- radio1 = gtk_radio_button_new_with_mnemonic_from_widget
367- (GTK_RADIO_BUTTON (radio0), _("_Play List"));
368- radio2 = gtk_radio_button_new_with_mnemonic (NULL, _("Rela_tive Path"));
369- radio3 = gtk_radio_button_new_with_mnemonic_from_widget
370- (GTK_RADIO_BUTTON (radio2), _("Ab_solute Path"));
371- radio4 = gtk_radio_button_new_with_mnemonic_from_widget
372- (GTK_RADIO_BUTTON (radio3), _("File Name _Only"));
373- hbox0 = gtk_hbox_new (FALSE, 0);
374- if (mmaid->filekind == FILE_KIND_DB)
399+ savedlg.radio_db = gtk_radio_button_new_with_mnemonic (NULL, _("_iDB File"));
400+ savedlg.radio_plist = gtk_radio_button_new_with_mnemonic_from_widget
401+ (GTK_RADIO_BUTTON (savedlg.radio_db), _("_Play List"));
402+ savedlg.radio_relative = gtk_radio_button_new_with_label
403+ (NULL, _("Relative"));
404+ savedlg.radio_absolute = gtk_radio_button_new_with_label_from_widget
405+ (GTK_RADIO_BUTTON (savedlg.radio_relative), _("Absolute"));
406+ savedlg.radio_basename = gtk_radio_button_new_with_label_from_widget
407+ (GTK_RADIO_BUTTON (savedlg.radio_absolute), _("File Name"));
408+
409+ savedlg.radio_slash = gtk_radio_button_new_with_label (NULL, "/");
410+ savedlg.radio_yen = gtk_radio_button_new_with_label_from_widget
411+ (GTK_RADIO_BUTTON (savedlg.radio_slash), "\\");
412+ savedlg.radio_crlf = gtk_radio_button_new_with_label (NULL, "CR+LF");
413+ savedlg.radio_cr = gtk_radio_button_new_with_label_from_widget
414+ (GTK_RADIO_BUTTON (savedlg.radio_crlf), "CR");
415+ savedlg.radio_lf = gtk_radio_button_new_with_label_from_widget
416+ (GTK_RADIO_BUTTON (savedlg.radio_cr), "LF");
417+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
418+ (mmaid->filetype == FILE_TYPE_DB ? savedlg.radio_db
419+ : savedlg.radio_plist), TRUE);
420+ switch (mmaid->playlist)
375421 {
376- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio0), TRUE);
377- gtk_widget_set_sensitive (hbox0, FALSE);
422+ case PLAYLIST_RELATIVE:
423+ gtk_toggle_button_set_active
424+ (GTK_TOGGLE_BUTTON (savedlg.radio_relative), TRUE);
425+ break;
426+ case PLAYLIST_ABSOLUTE:
427+ gtk_toggle_button_set_active
428+ (GTK_TOGGLE_BUTTON (savedlg.radio_absolute), TRUE);
429+ break;
430+ default:
431+ gtk_toggle_button_set_active
432+ (GTK_TOGGLE_BUTTON (savedlg.radio_basename), TRUE);
378433 }
379- else
434+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
435+ (mmaid->separator == '/' ? savedlg.radio_slash
436+ : savedlg.radio_yen), TRUE);
437+ switch (mmaid->crlf)
380438 {
381- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio1), TRUE);
439+ case CODE_CRLF:
440+ gtk_toggle_button_set_active
441+ (GTK_TOGGLE_BUTTON (savedlg.radio_crlf), TRUE);
442+ break;
443+ case CODE_CR:
444+ gtk_toggle_button_set_active
445+ (GTK_TOGGLE_BUTTON (savedlg.radio_cr), TRUE);
446+ break;
447+ default:
448+ gtk_toggle_button_set_active
449+ (GTK_TOGGLE_BUTTON (savedlg.radio_lf), TRUE);
382450 }
383- switch (mmaid->playlist)
384- {
385- case 1: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio3), TRUE);
386- break;
387- case 2: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio4), TRUE);
388- break;
389- default: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio2), TRUE);
390- }
391- g_signal_connect (G_OBJECT (radio0), "toggled",
392- G_CALLBACK (command_save_toggled_radio0), hbox0);
393- g_signal_connect (G_OBJECT (radio1), "toggled",
394- G_CALLBACK (command_save_toggled_radio1), hbox0);
451+ g_signal_connect (G_OBJECT (savedlg.radio_db), "toggled",
452+ G_CALLBACK (command_save_toggled_radio_db), &savedlg);
453+ g_signal_connect (G_OBJECT (savedlg.radio_basename), "toggled",
454+ G_CALLBACK (command_save_toggled_radio_basename), &savedlg);
455+ /* ja:文字符号化方式 */
456+ savedlg.combo_encoding = orz_charset_new ();
457+ orz_charset_add_candidate (ORZ_CHARSET (savedlg.combo_encoding),
458+ charset_list);
459+ orz_charset_set_charset (ORZ_CHARSET (savedlg.combo_encoding),
460+ mmaid->charset);
461+ g_signal_connect (G_OBJECT (savedlg.combo_encoding), "edited",
462+ G_CALLBACK (command_save_edited), dialog);
395463 /* ja:コンボボックス */
396464 #if GTK_CHECK_VERSION(2,24,0)
397- combo0 = gtk_combo_box_text_new ();
465+ savedlg.combo_root = gtk_combo_box_text_new ();
398466 for (gl = g_list_first (glist); gl; gl = g_list_next (gl))
399467 {
400- gtk_combo_box_text_prepend_text (GTK_COMBO_BOX_TEXT (combo0), gl->data);
468+ gtk_combo_box_text_prepend_text (GTK_COMBO_BOX_TEXT (savedlg.combo_root),
469+ gl->data);
401470 if (g_strfilecmp (gl->data, root) == 0)
402- gtk_combo_box_set_active (GTK_COMBO_BOX (combo0), 0);
471+ gtk_combo_box_set_active (GTK_COMBO_BOX (savedlg.combo_root), 0);
403472 }
404- g_signal_connect (G_OBJECT (combo0), "changed",
473+ g_signal_connect (G_OBJECT (savedlg.combo_root), "changed",
405474 G_CALLBACK (command_save_changed), dialog);
406475 #elif GTK_CHECK_VERSION(2,4,0)
407- combo0 = gtk_combo_box_new_text ();
476+ savedlg.combo_root = gtk_combo_box_new_text ();
408477 for (gl = g_list_first (glist); gl; gl = g_list_next (gl))
409478 {
410- gtk_combo_box_prepend_text (GTK_COMBO_BOX (combo0), gl->data);
479+ gtk_combo_box_prepend_text (GTK_COMBO_BOX (savedlg.combo_root),
480+ gl->data);
411481 if (g_strfilecmp (gl->data, root) == 0)
412- gtk_combo_box_set_active (GTK_COMBO_BOX (combo0), 0);
482+ gtk_combo_box_set_active (GTK_COMBO_BOX (savedlg.combo_root), 0);
413483 }
414- g_signal_connect (G_OBJECT (combo0), "changed",
484+ g_signal_connect (G_OBJECT (savedlg.combo_root), "changed",
415485 G_CALLBACK (command_save_changed), dialog);
416486 #else /* not GTK_CHECK_VERSION(2,4,0) */
417- combo0 = gtk_combo_new ();
418- gtk_combo_set_popdown_strings (GTK_COMBO (combo0), glist);
419- gtk_combo_set_value_in_list (GTK_COMBO (combo0), FALSE, FALSE);
420- gtk_combo_set_case_sensitive (GTK_COMBO (combo0), TRUE);
421- gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (combo0)->entry), FALSE);
422- gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (combo0)->entry), root);
423- g_signal_connect (G_OBJECT (GTK_COMBO (combo0)->entry), "changed",
424- G_CALLBACK (command_save_changed), dialog);
487+ savedlg.combo_root = gtk_combo_new ();
488+ gtk_combo_set_popdown_strings (GTK_COMBO (savedlg.combo_root), glist);
489+ gtk_combo_set_value_in_list (GTK_COMBO (savedlg.combo_root), FALSE, FALSE);
490+ gtk_combo_set_case_sensitive (GTK_COMBO (savedlg.combo_root), TRUE);
491+ gtk_editable_set_editable
492+ (GTK_EDITABLE (GTK_COMBO (savedlg.combo_root)->entry), FALSE);
493+ gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (savedlg.combo_root)->entry), root);
494+ g_signal_connect (G_OBJECT (GTK_COMBO (savedlg.combo_root)->entry),
495+ "changed", G_CALLBACK (command_save_changed), dialog);
425496 #endif /* not GTK_CHECK_VERSION(2,4,0) */
426- g_list_find_custom (glist, (GFunc)g_free, NULL);
497+ g_list_foreach (glist, (GFunc)g_free, NULL);
427498 g_list_free (glist);
428- /* ja:文字符号化方式 */
429- combo1 = orz_charset_new ();
430- orz_charset_add_candidate (ORZ_CHARSET (combo1), charset_list);
431- orz_charset_set_charset (ORZ_CHARSET (combo1), mmaid->charset);
432- g_signal_connect (G_OBJECT (combo1), "edited",
433- G_CALLBACK (command_save_edited), dialog);
434499 /* ja:ラベル */
435- label0 = gtk_label_new_with_mnemonic (_("_Root"));
436- label1 = gtk_label_new_with_mnemonic (_("Character _Encoding"));
500+ label_path = gtk_label_new_with_mnemonic (_("_Path"));
501+ gtk_label_set_mnemonic_widget (GTK_LABEL (label_path),
502+ savedlg.radio_relative);
503+ label_sep = gtk_label_new_with_mnemonic (_("_Separator"));
504+ gtk_label_set_mnemonic_widget (GTK_LABEL (label_sep), savedlg.radio_slash);
505+ label_encoding = gtk_label_new_with_mnemonic (_("Character _Encoding"));
506+ gtk_label_set_mnemonic_widget (GTK_LABEL (label_encoding),
507+ savedlg.combo_encoding);
508+ savedlg.label_root = gtk_label_new_with_mnemonic (_("_Root"));
437509 #if GTK_CHECK_VERSION(2,4,0)
438- gtk_label_set_mnemonic_widget (GTK_LABEL(label0), combo0);
510+ gtk_label_set_mnemonic_widget (GTK_LABEL (savedlg.label_root),
511+ savedlg.combo_root);
439512 #else /* not GTK_CHECK_VERSION(2,4,0) */
440- gtk_label_set_mnemonic_widget (GTK_LABEL(label0), GTK_COMBO (combo0)->entry);
513+ gtk_label_set_mnemonic_widget (GTK_LABEL (savedlg.label_root),
514+ GTK_COMBO (savedlg.combo_root)->entry);
441515 #endif /* not GTK_CHECK_VERSION(2,4,0) */
442- gtk_label_set_mnemonic_widget (GTK_LABEL(label1), combo1);
443516 /* ja:フレームとボックス */
444517 vbox = gtk_vbox_new (FALSE, SPACING);
445518 gtk_container_set_border_width (GTK_CONTAINER (vbox), SPACING);
446- hbox1 = gtk_hbox_new (FALSE, 0);
447- gtk_box_pack_start (GTK_BOX (hbox1), radio0, FALSE, FALSE, 0);
448- gtk_box_pack_start (GTK_BOX (hbox1), radio1, FALSE, FALSE, 0);
449- gtk_box_pack_start (GTK_BOX (hbox0), gtk_label_new ("("), FALSE, FALSE, 0);
450- gtk_box_pack_start (GTK_BOX (hbox0), radio2, FALSE, FALSE, 0);
451- gtk_box_pack_start (GTK_BOX (hbox0), radio3, FALSE, FALSE, 0);
452- gtk_box_pack_start (GTK_BOX (hbox0), radio4, FALSE, FALSE, 0);
453- gtk_box_pack_start (GTK_BOX (hbox0), gtk_label_new (")"), FALSE, FALSE, 0);
454- gtk_box_pack_start (GTK_BOX (hbox1), hbox0, FALSE, FALSE, 0);
455- gtk_box_pack_start (GTK_BOX (vbox), hbox1, TRUE, TRUE, 0);
456- hbox0 = gtk_hbox_new (FALSE, 0);
457- gtk_box_pack_start (GTK_BOX (hbox0), label0, FALSE, FALSE, 0);
458- gtk_box_pack_start (GTK_BOX (hbox0), combo0, TRUE, TRUE, 0);
459- gtk_box_pack_start (GTK_BOX (vbox), hbox0, TRUE, TRUE, 0);
460- hbox0 = gtk_hbox_new (FALSE, 0);
461- gtk_box_pack_start (GTK_BOX (hbox0), label1, FALSE, FALSE, 0);
462- gtk_box_pack_start (GTK_BOX (hbox0), combo1, TRUE, TRUE, 0);
463- gtk_box_pack_start (GTK_BOX (vbox), hbox0, TRUE, TRUE, 0);
519+ savedlg.frame_path = gtk_frame_new (NULL);
520+ gtk_frame_set_label_widget (GTK_FRAME (savedlg.frame_path), label_path);
521+ hbox = gtk_hbox_new (FALSE, SPACING);
522+ gtk_container_set_border_width (GTK_CONTAINER (hbox), SPACING);
523+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.radio_relative, FALSE, FALSE, 0);
524+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.radio_absolute, FALSE, FALSE, 0);
525+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.radio_basename, FALSE, FALSE, 0);
526+ gtk_container_add (GTK_CONTAINER (savedlg.frame_path), hbox);
527+ savedlg.frame_sep = gtk_frame_new (NULL);
528+ gtk_frame_set_label_widget (GTK_FRAME (savedlg.frame_sep), label_sep);
529+ hbox = gtk_hbox_new (FALSE, SPACING);
530+ gtk_container_set_border_width (GTK_CONTAINER (hbox), SPACING);
531+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.radio_slash, FALSE, FALSE, 0);
532+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.radio_yen, FALSE, FALSE, 0);
533+ gtk_container_add (GTK_CONTAINER (savedlg.frame_sep), hbox);
534+ hbox = gtk_hbox_new (FALSE, SPACING);
535+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.radio_db, FALSE, FALSE, 0);
536+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.radio_plist, FALSE, FALSE, 0);
537+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.frame_path, FALSE, FALSE, 0);
538+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.frame_sep, FALSE, FALSE, 0);
539+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.check_header, FALSE, FALSE, 0);
540+ gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
541+ frame = gtk_frame_new (NULL);
542+ gtk_frame_set_label_widget (GTK_FRAME (frame), label_encoding);
543+ hbox = gtk_hbox_new (FALSE, SPACING);
544+ gtk_container_set_border_width (GTK_CONTAINER (hbox), SPACING);
545+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.combo_encoding, TRUE, TRUE, 0);
546+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.radio_crlf, FALSE, FALSE, 0);
547+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.radio_cr, FALSE, FALSE, 0);
548+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.radio_lf, FALSE, FALSE, 0);
549+ gtk_container_add (GTK_CONTAINER (frame), hbox);
550+ gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
551+ hbox = gtk_hbox_new (FALSE, SPACING);
552+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.label_root, FALSE, FALSE, 0);
553+ gtk_box_pack_start (GTK_BOX (hbox), savedlg.combo_root, TRUE, TRUE, 0);
554+ gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
555+ /* ja:表示 */
556+ command_save_toggled_radio_db (savedlg.radio_db, &savedlg);
464557 gtk_widget_show_all (vbox);
465558 /* ja:ダイアログ */
466559 #if GTK_CHECK_VERSION(2,4,0)
467560 gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), vbox);
468- if (root)
469- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), root);
470- name = g_path_get_basename (orz_mdi_get_file (ORZ_MDI (mdi), page_num));
471- tmp = g_filename_to_utf8 (name, -1, NULL, NULL, NULL);
472- gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), tmp);
473- g_free (root);
474- g_free (tmp);
475- g_free (name);
561+ if (save_path)
562+ gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), save_path);
476563 if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
477564 {
478565 # if ! GTK_CHECK_VERSION(2,6,0)
@@ -481,34 +568,26 @@
481568
482569 file = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
483570 # if GTK_CHECK_VERSION(2,24,0)
484- root = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo0));
571+ root = gtk_combo_box_text_get_active_text
572+ (GTK_COMBO_BOX_TEXT (savedlg.combo_root));
485573 # elif GTK_CHECK_VERSION(2,6,0)
486- root = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combo0));
574+ root = gtk_combo_box_get_active_text
575+ (GTK_COMBO_BOX (savedlg.combo_root));
487576 # else /* not GTK_CHECK_VERSION(2,6,0) */
488- if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo0), &iter))
489- gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (combo0)),
490- &iter, 0, &root, -1);
577+ if (gtk_combo_box_get_active_iter
578+ (GTK_COMBO_BOX (savedlg.combo_root), &iter))
579+ gtk_tree_model_get (gtk_combo_box_get_model
580+ (GTK_COMBO_BOX (savedlg.combo_root)), &iter, 0, &root, -1);
491581 # endif /* not GTK_CHECK_VERSION(2,6,0) */
492- charset = orz_charset_get_charset (ORZ_CHARSET (combo1));
493- filekind = gtk_toggle_button_get_active
494- (GTK_TOGGLE_BUTTON (radio0)) ? FILE_KIND_DB : FILE_KIND_LIST;
495- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio3)))
496- playlist = 1;
497- else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio4)))
498- playlist = 2;
499- else
500- playlist = 0;
501- }
502582 #else /* not GTK_CHECK_VERSION(2,4,0) */
503583 gtk_box_pack_end (GTK_BOX (GTK_FILE_SELECTION (dialog)->main_vbox),
504584 vbox, FALSE, FALSE, 0);
505- name = g_path_get_basename (orz_mdi_get_file (ORZ_MDI (mdi), page_num));
506- tmp = root ? g_strconcat (root, name, NULL)
507- : g_build_filename (save_path, name, NULL);
508- gtk_file_selection_set_filename (GTK_FILE_SELECTION (dialog), tmp);
509- g_free (root);
510- g_free (tmp);
511- g_free (name);
585+ if (save_path)
586+ {
587+ path = g_strconcat (save_path, G_SEARCHPATH_SEPARATOR_S, NULL);
588+ gtk_file_selection_set_filename (GTK_FILE_SELECTION (dialog), path);
589+ g_free (path);
590+ }
512591 gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (dialog));
513592 if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
514593 {
@@ -515,26 +594,47 @@
515594 file = g_strdup (gtk_file_selection_get_filename
516595 (GTK_FILE_SELECTION (dialog)));
517596 root = g_strdup (gtk_entry_get_text
518- (GTK_ENTRY (GTK_COMBO (combo0)->entry)));
519- charset = orz_charset_get_charset (ORZ_CHARSET (combo1));
520- filekind = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio0))
521- ? FILE_KIND_DB : FILE_KIND_LIST;
522- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio3)))
523- playlist = 1;
524- else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio4)))
525- playlist = 2;
597+ (GTK_ENTRY (GTK_COMBO (savedlg.combo_root)->entry)));
598+#endif /* not GTK_CHECK_VERSION(2,4,0) */
599+ charset = orz_charset_get_charset (ORZ_CHARSET (savedlg.combo_encoding));
600+ filetype = gtk_toggle_button_get_active
601+ (GTK_TOGGLE_BUTTON (savedlg.radio_db)) ? FILE_TYPE_DB : FILE_TYPE_LIST;
602+ if (gtk_toggle_button_get_active
603+ (GTK_TOGGLE_BUTTON (savedlg.radio_relative)))
604+ playlist = PLAYLIST_RELATIVE;
605+ else if (gtk_toggle_button_get_active
606+ (GTK_TOGGLE_BUTTON (savedlg.radio_absolute)))
607+ playlist = PLAYLIST_ABSOLUTE;
526608 else
527- playlist = 0;
609+ playlist = PLAYLIST_BASENAME;
610+ separator = gtk_toggle_button_get_active
611+ (GTK_TOGGLE_BUTTON (savedlg.radio_slash)) ? '/' : '\\';
612+ if (gtk_toggle_button_get_active
613+ (GTK_TOGGLE_BUTTON (savedlg.radio_crlf)))
614+ crlf = CODE_CRLF;
615+ else if (gtk_toggle_button_get_active
616+ (GTK_TOGGLE_BUTTON (savedlg.radio_cr)))
617+ crlf = CODE_CR;
618+ else
619+ crlf = CODE_LF;
620+ header = gtk_toggle_button_get_active
621+ (GTK_TOGGLE_BUTTON (savedlg.check_header));
528622 }
529-#endif /* not GTK_CHECK_VERSION(2,4,0) */
530623 else
531624 {
532625 file = root = charset = NULL;
533- filekind = FILE_KIND_DB;
534- playlist = 0;
626+ filetype = FILE_TYPE_DB;
627+ playlist = PLAYLIST_RELATIVE;
628+ separator = G_DIR_SEPARATOR;
629+#ifdef G_OS_WIN32
630+ crlf = CODE_CRLF;
631+#else /* not G_OS_WIN32 */
632+ crlf = CODE_LF;
633+#endif /* not G_OS_WIN32 */
634+ header = TRUE;
535635 }
536636 gtk_widget_destroy (dialog);
537- if (file)
637+ if (file && root && charset)
538638 {
539639 gboolean result = TRUE;
540640
@@ -553,12 +653,11 @@
553653 result = gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES;
554654 gtk_widget_destroy (dialog);
555655 }
556- if (result && (filekind == FILE_KIND_DB
557- ? file_save_db (file, mmaid, root, charset)
558- : file_save_list (file, mmaid, root, charset, playlist)))
656+ if (result && (filetype == FILE_TYPE_DB
657+ ? file_save_db (file, mmaid, root, charset)
658+ : file_save_list (file, mmaid, charset,
659+ playlist, separator, crlf, header)))
559660 {
560- gchar *path;
561-
562661 g_free (save_path);
563662 path = fileio_get_full_path (file);
564663 save_path = g_path_get_dirname (path);
@@ -566,7 +665,7 @@
566665 /* ja:キャラクターセット */
567666 g_free (mmaid->charset);
568667 mmaid->charset = g_strdup (charset);
569- if (filekind == FILE_KIND_DB || playlist != 2)
668+ if (filetype == FILE_TYPE_DB || playlist != PLAYLIST_BASENAME)
570669 {
571670 /* ja:諸設定 */
572671 orz_mdi_set_created (ORZ_MDI (mdi), page_num, FALSE);
@@ -573,15 +672,20 @@
573672 orz_mdi_set_edited (ORZ_MDI (mdi), page_num, FALSE);
574673 orz_mdi_set_file (ORZ_MDI (mdi), page_num, file);
575674 }
576- mmaid->filekind = filekind;
577- if (filekind == FILE_KIND_LIST)
578- playlist = mmaid->playlist = playlist;
675+ mmaid->filetype = filetype;
676+ if (filetype == FILE_TYPE_LIST)
677+ {
678+ def_plist = mmaid->playlist = playlist;
679+ def_sep = mmaid->separator = separator;
680+ def_crlf = mmaid->crlf = crlf;
681+ def_head = mmaid->header = header;
682+ }
579683 orz_history_add_file (ORZ_HISTORY (history), file);
580684 }
581- g_free (file);
582- g_free (root);
583- g_free (charset);
584685 }
686+ g_free (file);
687+ g_free (root);
688+ g_free (charset);
585689 }
586690
587691
@@ -665,11 +769,11 @@
665769 file = g_filename_from_utf8 (id3tag->file, -1, NULL, NULL, NULL);
666770 switch (file_is_type (file))
667771 {
668- case FILE_KIND_ERROR:
772+ case FILE_TYPE_ERROR:
669773 /* ja:ファイルが存在しないとき */
670774 str = _("File Open Error");
671775 break;
672- case FILE_KIND_TAG:
776+ case FILE_TYPE_TAG:
673777 if (expinfo->hold)
674778 {
675779 /* ja:既存のタグを保持し、かつ既にタグがあるとき */
@@ -913,7 +1017,7 @@
9131017 file = g_filename_from_utf8 (id3tag0->file, -1, NULL, NULL, NULL);
9141018 switch (file_is_type (file))
9151019 {
916- case FILE_KIND_UNKNOWN:
1020+ case FILE_TYPE_MUSIC:
9171021 id3tag1 = file_open_id3tag (file, id3tag0->charset
9181022 ? id3tag0->charset : charset_list);
9191023 n = mm_list_append (MM_LIST (MM_DIALOG (dialog)->list),
@@ -922,7 +1026,7 @@
9221026 mm_list_show_refresh (MM_LIST (MM_DIALOG (dialog)->list), n);
9231027 mm_list_show_delete (MM_LIST (MM_DIALOG (dialog)->list), n);
9241028 break;
925- case FILE_KIND_TAG:
1029+ case FILE_TYPE_TAG:
9261030 id3tag1 = file_open_id3tag (file, id3tag0->charset
9271031 ? id3tag0->charset : charset_list);
9281032 n = mm_list_append (MM_LIST (MM_DIALOG (dialog)->list),
@@ -1024,7 +1128,7 @@
10241128 : NULL;
10251129 switch (file_is_type (file))
10261130 {
1027- case FILE_KIND_UNKNOWN:
1131+ case FILE_TYPE_MUSIC:
10281132 id3tag1 = file_open_id3tag (file, charset_list);
10291133 n1 = mm_list_append (MM_LIST (MM_DIALOG (dialog)->list),
10301134 id3tag1);
@@ -1046,7 +1150,7 @@
10461150 (MM_LIST (MM_DIALOG (dialog)->list), n1, TRUE);
10471151 }
10481152 break;
1049- case FILE_KIND_TAG:
1153+ case FILE_TYPE_TAG:
10501154 id3tag1 = file_open_id3tag (file, charset_list);
10511155 n1 = mm_list_append (MM_LIST (MM_DIALOG (dialog)->list),
10521156 id3tag1);
--- mmaid/trunk/src/file.c (revision 139)
+++ mmaid/trunk/src/file.c (revision 140)
@@ -68,31 +68,36 @@
6868
6969
7070 /* ja:パスのキャラクターセットを変換する
71- file,ファイル名
72- length,バイト数
73- charset,キャラクターセット
74- err,TRUE:エラー中断,FALSE:エラー強行
75- RET,変換されたファイル名,NULL:エラー */
71+ file,ファイル名
72+ length,バイト数
73+ charset,キャラクターセット
74+ err,TRUE:エラー中断,FALSE:エラー強行
75+ separator,パスの区切り
76+ RET,変換されたファイル名,NULL:エラー */
7677 static gchar *
7778 file_path_convert (const gchar *file,
7879 const gsize length,
7980 const gchar *charset,
80- const gboolean err)
81+ const gboolean err,
82+ gint *separator)
8183 {
8284 gchar *result = NULL;
8385 gsize bytes_done = 0, leng;
86+ gint sep = '\0';
8487
8588 if (!file || length == 0 || !charset)
8689 return NULL;
87- leng = MIN (length == (gsize)-1 ? g_strlen (file) : length, 260);
90+ leng = (gssize)length < 0 ? g_strlen (file) : length;
8891 while (bytes_done < leng)
8992 {
9093 gchar *tmp;
9194
92- if (file[bytes_done] == '\\')
95+ if (file[bytes_done] == '/' || file[bytes_done] == '\\')
9396 {
9497 tmp = result ? g_strconcat (result, G_DIR_SEPARATOR_S, NULL)
9598 : g_strdup (G_DIR_SEPARATOR_S);
99+ if (sep == '\0')
100+ sep = file[bytes_done];
96101 bytes_done++;
97102 }
98103 else
@@ -127,6 +132,8 @@
127132 g_free (result);
128133 result = tmp;
129134 }
135+ if (result && separator)
136+ *separator = sep != '\0' ? sep : G_DIR_SEPARATOR;
130137 return result;
131138 }
132139
@@ -133,13 +140,13 @@
133140
134141 /* ja:ファイルの種類を取得する
135142 file,ファイル名
136- RET,FILE_KIND_TAG:ID3TAG,FILE_KIND_DB:db,FILE_KIND_LIST:プレイリスト */
143+ RET,FILE_TYPE_TAG:ID3TAG,FILE_TYPE_DB:db,FILE_TYPE_LIST:プレイリスト */
137144 guint
138145 file_is_type (const gchar *file)
139146 {
140147 gchar *buf = NULL, *dir, **ary, **charset;
141148 guint8 header[0xa0c0], tag[128];
142- gint i;
149+ gint i, j = 0;
143150 gssize fsize;
144151 FileIO *fio;
145152
@@ -146,13 +153,13 @@
146153 fio = fileio_open (file, FILEIO_ACCESS_READ, FILEIO_SHARE_READ,
147154 FILEIO_MODE_OPEN_EXISTING);
148155 if (!fio)
149- return FILE_KIND_ERROR;
156+ return FILE_TYPE_ERROR;
150157 if (fileio_read (fio, header, sizeof (header)) == sizeof (header)
151158 && g_memcmp (irivdb_header0, header, sizeof (irivdb_header0)) == 0
152159 && g_memcmp (irivdb_header1, header + 0xa080, sizeof (irivdb_header1))== 0)
153160 {
154161 fileio_close (fio);
155- return FILE_KIND_DB;
162+ return FILE_TYPE_DB;
156163 }
157164 if (fileio_seek (fio, -128, FILEIO_SEEK_END) != -1
158165 && fileio_read (fio, tag, sizeof (tag)) == sizeof (tag)
@@ -161,7 +168,7 @@
161168 {
162169 g_free (buf);
163170 fileio_close (fio);
164- return FILE_KIND_TAG;
171+ return FILE_TYPE_TAG;
165172 }
166173 fsize = fileio_seek (fio, 0, FILEIO_SEEK_END);
167174 if (fsize < 0 || !(buf = g_malloc0 (fsize + sizeof (gchar)))
@@ -170,34 +177,54 @@
170177 {
171178 g_free (buf);
172179 fileio_close (fio);
173- return FILE_KIND_UNKNOWN;
180+ return FILE_TYPE_MUSIC;
174181 }
175182 fileio_close (fio);
183+ /* ja:CRLFをLFに変換する */
184+ for (i = 0; buf[i] != '\0'; i++)
185+ if (buf[i] != '\r' || buf[i + 1] != '\n')
186+ buf[j++] = buf[i];
187+ buf[j] = '\0';
188+ /* ja:CRをLFに変換する */
189+ for (i = 0; buf[i] != '\0'; i++)
190+ if (buf[i] == '\r')
191+ buf[i] = '\n';
176192 /* ja:キャラクターセット変換 */
193+ ary = g_strsplit (buf, "\n", 0);
194+ g_free (buf);
195+ for (i = 0; ary[i]; i++)
196+ g_strstrip (ary[i]);
197+ /* ja:ヘッダ */
198+ for (i = 0; ary[i]
199+ && (*(ary[i]) == '\0' || *(ary[i]) == '#' || *(ary[i]) == ';'); i++)
200+ if (g_ascii_strcasecmp (ary[i], "#EXTM3U") == 0)
201+ {
202+ g_strfreev (ary);
203+ return FILE_TYPE_LIST;
204+ }
177205 dir = g_path_get_dirname (file);
178- ary = g_strsplit (buf, "\r\n", 0);
179206 charset = g_strsplit (charset_list, ",", 0);
180- g_free (buf);
181207 for (i = 0; charset[i]; i++)
182208 {
183- gint j;
184-
185209 for (j = 0; ary[j]; j++)
186210 if (*(ary[j]) != '\0' && *(ary[j]) != '#' && *(ary[j]) != ';')
187211 {
188212 gboolean result;
189- gchar *str;
213+ gchar *path;
190214
191- str = file_path_convert (ary[j], -1, charset[i], TRUE);
192- if (str)
215+ path = file_path_convert (ary[j], -1, charset[i], TRUE, NULL);
216+ if (path)
193217 {
194- gchar *path;
218+ if (!g_path_is_absolute (path))
219+ {
220+ gchar *tmp;
195221
196- path = g_path_is_absolute (str) ? g_strdup (str)
197- : g_build_filename (dir, str, NULL);
222+ tmp = g_build_filename (dir, path, NULL);
223+ g_free (path);
224+ path = tmp;
225+ }
198226 result = g_file_test (path, G_FILE_TEST_EXISTS);
199227 g_free (path);
200- g_free (str);
201228 }
202229 else
203230 {
@@ -211,13 +238,13 @@
211238 g_strfreev (charset);
212239 g_strfreev (ary);
213240 g_free (dir);
214- return FILE_KIND_LIST;
241+ return FILE_TYPE_LIST;
215242 }
216243 }
217244 g_strfreev (charset);
245+ g_free (dir);
218246 g_strfreev (ary);
219- g_free (dir);
220- return FILE_KIND_UNKNOWN;
247+ return FILE_TYPE_MUSIC;
221248 }
222249
223250
@@ -456,7 +483,7 @@
456483 while (gtk_events_pending ())
457484 gtk_main_iteration ();
458485 str = file_path_convert (mi_r[j].str[0], mi_r[j].len[0] - 1,
459- charset[i], TRUE);
486+ charset[i], TRUE, NULL);
460487 if (!str)
461488 break;
462489 mi_c[j].str[0] = str;
@@ -490,7 +517,7 @@
490517 gtk_main_iteration ();
491518 mi_c[i].str[0]
492519 = file_path_convert (mi_r[i].str[0], mi_r[i].len[0] - 1,
493- charset[0], FALSE);
520+ charset[0], FALSE, NULL);
494521 if (!mi_c[i].str[0])
495522 break;
496523 for (j = 1; j < 5; j++)
@@ -582,7 +609,11 @@
582609 MmaidWindow *mmaid)
583610 {
584611 gchar *buf = NULL, *dir, **ary, **charset;
585- gint i, plist = 0;
612+ gint i, j = 0;
613+ gint playlist = PLAYLIST_RELATIVE;
614+ gint separator = G_DIR_SEPARATOR;
615+ gint crlf = CODE_LF;
616+ gboolean header = FALSE;
586617 gssize fsize;
587618 FileIO *fio;
588619 GList *glist = NULL;
@@ -608,59 +639,80 @@
608639 return;
609640 }
610641 fileio_close (fio);
642+ /* ja:CRLFをLFに変換する */
643+ for (i = 0; buf[i] != '\0'; i++)
644+ if (buf[i] != '\r' || buf[i + 1] != '\n')
645+ buf[j++] = buf[i];
646+ else
647+ crlf = CODE_CRLF;
648+ buf[j] = '\0';
649+ /* ja:CRをLFに変換する */
650+ for (i = 0; buf[i] != '\0'; i++)
651+ if (buf[i] == '\r')
652+ {
653+ buf[i] = '\n';
654+ crlf = CODE_CR;
655+ }
611656 /* ja:キャラクターセット変換 */
657+ ary = g_strsplit (buf, "\n", 0);
658+ g_free (buf);
659+ for (i = 0; ary[i]; i++)
660+ g_strstrip (ary[i]);
661+ /* ja:ヘッダ */
662+ for (i = 0; ary[i]
663+ && (*(ary[i]) == '\0' || *(ary[i]) == '#' || *(ary[i]) == ';'); i++)
664+ if (g_ascii_strcasecmp (ary[i], "#EXTM3U") == 0)
665+ header = TRUE;
612666 dir = g_path_get_dirname (file);
613- ary = g_strsplit (buf, "\r\n", 0);
614667 charset = g_strsplit (mmaid->charset, ",", 0);
615668 g_free (mmaid->charset);
616- g_free (buf);
617669 for (i = 0; charset[i]; i++)
618670 {
619671 gint j;
620672
621- plist = 0;
673+ playlist = PLAYLIST_RELATIVE;
622674 for (j = 0; ary[j]; j++)
623675 if (*(ary[j]) != '\0' && *(ary[j]) != '#' && *(ary[j]) != ';')
624676 {
625- gchar *str, *path;
677+ gchar *path;
626678
627679 while (gtk_events_pending ())
628680 gtk_main_iteration ();
629- str = file_path_convert (ary[j], -1, charset[i], TRUE);
630- if (!str)
681+ path = file_path_convert (ary[j], -1,
682+ charset[i], TRUE, &separator);
683+ if (!path)
631684 break;
632- if (g_path_is_absolute (str))
685+ if (g_path_is_absolute (path))
633686 {
634- path = g_strdup (str);
635- plist = 1;
687+ playlist = PLAYLIST_ABSOLUTE;
636688 }
637689 else
638690 {
639- path = g_build_filename (dir, str, NULL);
640- }
641- g_free (str);
642- if (g_file_test (path, G_FILE_TEST_EXISTS))
643- {
644- glist = g_list_append (glist, path);
645- }
646- else
647- {
691+ gchar *tmp;
692+
693+ tmp = g_build_filename (dir, path, NULL);
648694 g_free (path);
649- break;
695+ path = tmp;
650696 }
697+ glist = g_list_append (glist, path);
651698 }
652699 if (!ary[j])
653700 break;
654- g_list_find_custom (glist, (GFunc)g_free, NULL);
701+ g_list_foreach (glist, (GFunc)g_free, NULL);
655702 g_list_free (glist);
656703 glist = NULL;
657704 }
658705 mmaid->charset = g_strdup (charset[i] ? charset[i] : charset[0]);
659706 g_strfreev (charset);
707+ g_free (dir);
660708 g_strfreev (ary);
661- g_free (dir);
662709 if (g_list_length (glist) > 0)
663- mmaid->playlist = plist;
710+ {
711+ mmaid->playlist = playlist;
712+ mmaid->separator = separator;
713+ mmaid->crlf = crlf;
714+ mmaid->header = header;
715+ }
664716 for (glist = g_list_first (glist);
665717 glist; glist = g_list_delete_link (glist, glist))
666718 {
@@ -692,7 +744,10 @@
692744 GtkWidget *scroll;
693745
694746 mmaid = g_malloc0 (sizeof (MmaidWindow));
695- mmaid->playlist = playlist;
747+ mmaid->playlist = def_plist;
748+ mmaid->separator = def_sep;
749+ mmaid->crlf = def_crlf;
750+ mmaid->header = def_head;
696751 /* ja:リスト */
697752 mmaid->list = mm_list_new ();
698753 mm_list_set_editable (MM_LIST (mmaid->list), TRUE);
@@ -707,14 +762,14 @@
707762 charset = g_strsplit (charset_list, ",", 0);
708763 mmaid->charset = g_strdup (charset[0]);
709764 g_strfreev (charset);
710- mmaid->filekind = FILE_KIND_DB;
765+ mmaid->filetype = FILE_TYPE_DB;
711766 }
712767 else
713768 {
714769 filename = fileio_get_full_path (file);
715770 mmaid->charset = g_strdup (charset_list);
716- mmaid->filekind = file_is_type (file);
717- if (mmaid->filekind == FILE_KIND_LIST)
771+ mmaid->filetype = file_is_type (file);
772+ if (mmaid->filetype == FILE_TYPE_LIST)
718773 file_open_list (file, mmaid);
719774 else
720775 file_open_db (file, mmaid);
@@ -1082,36 +1137,75 @@
10821137
10831138
10841139 /* ja:プレイリストを保存する
1085- file,ファイル名
1086- mmaid,ウインドウ情報
1087- root,ルート
1088- charset,キャラクターセット
1089- playlist.プレイリスト(0:相対,1:絶対,2:名前)
1090- RET,TRUE:正常終了,FALSE:エラー */
1140+ file,ファイル名
1141+ mmaid,ウインドウ情報
1142+ charset,キャラクターセット
1143+ playlist,プレイリスト
1144+ separator,パスの区切り
1145+ crlf,改行コード
1146+ header,ヘッダ
1147+ RET,TRUE:正常終了,FALSE:エラー */
10911148 gboolean
1092-file_save_list (const gchar *file,
1093- MmaidWindow *mmaid,
1094- const gchar *root,
1095- const gchar *charset,
1096- const gint playlist)
1149+file_save_list (const gchar *file,
1150+ MmaidWindow *mmaid,
1151+ const gchar *charset,
1152+ const gint playlist,
1153+ const gint separater,
1154+ const gint crlf,
1155+ const gboolean header)
10971156 {
10981157 FileIO *fio;
1099- GtkWidget *dialog;
11001158
11011159 fio = fileio_open (file, FILEIO_ACCESS_READ | FILEIO_ACCESS_WRITE,
11021160 FILEIO_SHARE_READ, FILEIO_MODE_CREATE_ALWAYS);
11031161 if (fio)
11041162 {
1163+ char *root;
1164+ const char *sep, *newline;
11051165 gint i, count;
1166+ GtkWidget *dialog;
11061167
1168+ sep = separater == '/' ? "/" : "\\";
1169+ switch (crlf)
1170+ {
1171+ case CODE_CRLF: newline = "\r\n"; break;
1172+ case CODE_CR: newline = "\r"; break;
1173+ default: newline = "\n";
1174+ }
1175+ root = g_path_get_dirname (file);
11071176 /* ja:ダイアログボックス */
11081177 userbreak = TRUE;
11091178 dialog = abort_dialog (_("Writing"));
11101179 gtk_grab_add (dialog);
1180+ /* ja:ヘッダ */
1181+ if (header)
1182+ {
1183+ gsize leng;
1184+ gchar *tmp;
1185+
1186+ tmp = g_strconcat ("#EXTM3U", newline, NULL);
1187+ leng = g_strlen (tmp) * sizeof (gchar);
1188+ if (fileio_write (fio, tmp, leng) != leng)
1189+ {
1190+ gtk_grab_remove (dialog);
1191+ gtk_widget_destroy (dialog);
1192+ dialog = gtk_message_dialog_new (GTK_WINDOW (window),
1193+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
1194+ GTK_MESSAGE_WARNING, GTK_BUTTONS_OK,
1195+ _("Can not write"));
1196+ g_signal_connect (G_OBJECT (dialog), "key-press-event",
1197+ G_CALLBACK (misc_dialog_key_press), NULL);
1198+ gtk_dialog_run (GTK_DIALOG (dialog));
1199+ gtk_widget_destroy (dialog);
1200+ dialog = NULL;
1201+ userbreak = FALSE;
1202+ }
1203+ g_free (tmp);
1204+ }
11111205 count = mm_list_length (MM_LIST (mmaid->list));
11121206 for (i = 0; i < count && userbreak; i++)
11131207 {
1114- gchar *element, *tmp, **ary;
1208+ gchar *element, **ary;
11151209 gint j;
11161210 const ID3Tag *id3tag;
11171211
@@ -1120,7 +1214,7 @@
11201214 id3tag = mm_list_get_nth (MM_LIST (mmaid->list), i);
11211215 switch (playlist)
11221216 {
1123- case 0:/* ja:相対パス */
1217+ case PLAYLIST_RELATIVE:/* ja:相対パス */
11241218 {
11251219 gchar *file, *relative;
11261220
@@ -1133,7 +1227,7 @@
11331227 g_free (relative);
11341228 }
11351229 break;
1136- case 1:/* ja:絶対パス */
1230+ case PLAYLIST_ABSOLUTE:/* ja:絶対パス */
11371231 element = g_strdup (id3tag->file);
11381232 break;
11391233 default:/* ja:ファイル名のみ */
@@ -1148,11 +1242,9 @@
11481242 g_free (name);
11491243 }
11501244 }
1151- tmp = g_strconcat (element, "\r\n", NULL);
1245+ ary = g_strsplit (element, G_DIR_SEPARATOR_S, 0);
11521246 g_free (element);
11531247 element = NULL;
1154- ary = g_strsplit (tmp, G_DIR_SEPARATOR_S, 0);
1155- g_free (tmp);
11561248 for (j = 0; ary[j]; j++)
11571249 {
11581250 gchar *name;
@@ -1179,7 +1271,9 @@
11791271 }
11801272 if (element)
11811273 {
1182- tmp = g_strconcat (element, "\\", name, NULL);
1274+ gchar *tmp;
1275+
1276+ tmp = g_strconcat (element, sep, name, NULL);
11831277 g_free (name);
11841278 g_free (element);
11851279 element = tmp;
@@ -1193,9 +1287,12 @@
11931287 if (element)
11941288 {
11951289 gsize leng;
1290+ gchar *tmp;
11961291
1197- leng = g_strlen (element) * sizeof (gchar);
1198- if (fileio_write (fio, element, leng) != leng)
1292+ tmp = g_strconcat (element, newline, NULL);
1293+ g_free (element);
1294+ leng = g_strlen (tmp) * sizeof (gchar);
1295+ if (fileio_write (fio, tmp, leng) != leng)
11991296 {
12001297 gtk_grab_remove (dialog);
12011298 gtk_widget_destroy (dialog);
@@ -1210,7 +1307,7 @@
12101307 dialog = NULL;
12111308 userbreak = FALSE;
12121309 }
1213- g_free (element);
1310+ g_free (tmp);
12141311 }
12151312 }
12161313 /* ja:終了処理 */
@@ -1219,10 +1316,13 @@
12191316 gtk_grab_remove (dialog);
12201317 gtk_widget_destroy (dialog);
12211318 }
1319+ g_free (root);
12221320 fileio_close (fio);
12231321 }
12241322 else
12251323 {
1324+ GtkWidget *dialog;
1325+
12261326 dialog = gtk_message_dialog_new (GTK_WINDOW (window),
12271327 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
12281328 GTK_MESSAGE_WARNING, GTK_BUTTONS_OK,
--- mmaid/trunk/src/root.c (revision 139)
+++ mmaid/trunk/src/root.c (revision 140)
@@ -1,6 +1,6 @@
11 /*
22 Melody maid
3- copyright (c) 1998-2011 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
3+ copyright (c) 1998-2012 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
44
55 This program is free software: you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
@@ -264,9 +264,9 @@
264264 glist = g_list_insert_sorted (glist, g_strdup (path),
265265 (GCompareFunc)g_ascii_strcasecmp);
266266 #else /* not G_OS_WIN32 */
267- if (!g_list_find_custom (glist, path, (GCompareFunc)strcmp))
267+ if (!g_list_find_custom (glist, path, (GCompareFunc)g_strcmp))
268268 glist = g_list_insert_sorted (glist, g_strdup (path),
269- (GCompareFunc)strcmp);
269+ (GCompareFunc)g_strcmp);
270270 #endif /* not G_OS_WIN32 */
271271 }
272272 g_strfreev (dir);
@@ -305,7 +305,7 @@
305305 G_CALLBACK (root_dialog_activate), &rtdlg);
306306 g_signal_connect (G_OBJECT (GTK_COMBO (rtdlg.combo)->entry), "changed",
307307 G_CALLBACK (root_dialog_changed), &rtdlg);
308- g_list_find_custom (glist, (GFunc)g_free, NULL);
308+ g_list_foreach (glist, (GFunc)g_free, NULL);
309309 g_list_free (glist);
310310 #endif /* not GTK_CHECK_VERSION(2,4,0) */
311311 /* ja:エントリー */
--- mmaid/trunk/src/file.h (revision 139)
+++ mmaid/trunk/src/file.h (revision 140)
@@ -1,6 +1,6 @@
11 /*
22 Melody maid
3- copyright (c) 1998-2008 Kazuki IWAMOTO http://www.maid.org/ iwm@maid.org
3+ copyright (c) 1998-2012 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
44
55 This program is free software: you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
@@ -25,11 +25,11 @@
2525 G_BEGIN_DECLS
2626
2727
28-#define FILE_KIND_ERROR 0
29-#define FILE_KIND_UNKNOWN 1
30-#define FILE_KIND_TAG 2
31-#define FILE_KIND_DB 3
32-#define FILE_KIND_LIST 4
28+#define FILE_TYPE_ERROR 0
29+#define FILE_TYPE_MUSIC 1
30+#define FILE_TYPE_TAG 2
31+#define FILE_TYPE_DB 3
32+#define FILE_TYPE_LIST 4
3333
3434
3535 #define FILE_SAVE_SUCCESS 0
@@ -53,7 +53,7 @@
5353 ******************************************************************************/
5454 /* ja:ファイルの種類を取得する
5555 file,ファイル名
56- RET,FILE_KIND_TAG:ID3TAG,FILE_KIND_DB:db,FILE_KIND_LIST:プレイリスト */
56+ RET,FILE_TYPE_TAG:ID3TAG,FILE_TYPE_DB:db,FILE_TYPE_LIST:プレイリスト */
5757 guint
5858 file_is_type (const gchar *file);
5959
@@ -120,18 +120,22 @@
120120
121121
122122 /* ja:プレイリストを保存する
123- file,ファイル名
124- mmaid,ウインドウ情報
125- root,ルート
126- charset,キャラクターセット
127- playlist.プレイリスト(0:相対,1:絶対,2:名前)
128- RET,TRUE:正常終了,FALSE:エラー */
123+ file,ファイル名
124+ mmaid,ウインドウ情報
125+ charset,キャラクターセット
126+ playlist,プレイリスト
127+ separator,パスの区切り
128+ crlf,改行コード
129+ header,ヘッダ
130+ RET,TRUE:正常終了,FALSE:エラー */
129131 gboolean
130-file_save_list (const gchar *file,
131- MmaidWindow *mmaid,
132- const gchar *root,
133- const gchar *charset,
134- const gint playlist);
132+file_save_list (const gchar *file,
133+ MmaidWindow *mmaid,
134+ const gchar *charset,
135+ const gint playlist,
136+ const gint separater,
137+ const gint crlf,
138+ const gboolean header);
135139
136140
137141 G_END_DECLS
--- mmaid/trunk/src/edit.c (revision 139)
+++ mmaid/trunk/src/edit.c (revision 140)
@@ -1,6 +1,6 @@
11 /*
22 Melody maid
3- copyright (c) 1998-2011 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
3+ copyright (c) 1998-2012 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
44
55 This program is free software: you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
@@ -234,25 +234,25 @@
234234 {
235235 id3tag = mm_list_get_nth (MM_LIST (mmaid->list), i);
236236 if (id3tag->title && !g_list_find_custom (glist_title, id3tag->title,
237- (GCompareFunc)strcmp))
237+ (GCompareFunc)g_strcmp))
238238 glist_title = g_list_insert_sorted (glist_title,
239- g_strdup (id3tag->title), (GCompareFunc)strcmp);
239+ g_strdup (id3tag->title), (GCompareFunc)g_strcmp);
240240 if (id3tag->artist && !g_list_find_custom (glist_artist, id3tag->artist,
241- (GCompareFunc)strcmp))
241+ (GCompareFunc)g_strcmp))
242242 glist_artist = g_list_insert_sorted (glist_artist,
243- g_strdup (id3tag->artist), (GCompareFunc)strcmp);
243+ g_strdup (id3tag->artist), (GCompareFunc)g_strcmp);
244244 if (id3tag->album && !g_list_find_custom (glist_album, id3tag->album,
245- (GCompareFunc)strcmp))
245+ (GCompareFunc)g_strcmp))
246246 glist_album = g_list_insert_sorted (glist_album,
247- g_strdup (id3tag->album), (GCompareFunc)strcmp);
247+ g_strdup (id3tag->album), (GCompareFunc)g_strcmp);
248248 if (id3tag->comment && !g_list_find_custom (glist_comment,
249- id3tag->comment, (GCompareFunc)strcmp))
249+ id3tag->comment, (GCompareFunc)g_strcmp))
250250 glist_comment = g_list_insert_sorted (glist_comment,
251- g_strdup (id3tag->comment), (GCompareFunc)strcmp);
251+ g_strdup (id3tag->comment), (GCompareFunc)g_strcmp);
252252 }
253253 for (i = 0; i < 256; i++)
254254 if (genre[0][i] && !g_list_find_custom (glist_genre, genre[0][i],
255- (GCompareFunc)strcmp))
255+ (GCompareFunc)g_strcmp))
256256 glist_genre = g_list_append (glist_genre, g_strdup (genre[0][i]));
257257 /* ja:選択の数を数える */
258258 for (i = 0; i < count; i++)
@@ -344,31 +344,31 @@
344344 if (glist_title)
345345 {
346346 gtk_combo_set_popdown_strings (GTK_COMBO (combo_title), glist_title);
347- g_list_find_custom (glist_title, (GFunc)g_free, NULL);
347+ g_list_foreach (glist_title, (GFunc)g_free, NULL);
348348 g_list_free (glist_title);
349349 }
350350 if (glist_artist)
351351 {
352352 gtk_combo_set_popdown_strings (GTK_COMBO (combo_artist), glist_artist);
353- g_list_find_custom (glist_artist, (GFunc)g_free, NULL);
353+ g_list_foreach (glist_artist, (GFunc)g_free, NULL);
354354 g_list_free (glist_artist);
355355 }
356356 if (glist_album)
357357 {
358358 gtk_combo_set_popdown_strings (GTK_COMBO (combo_album), glist_album);
359- g_list_find_custom (glist_album, (GFunc)g_free, NULL);
359+ g_list_foreach (glist_album, (GFunc)g_free, NULL);
360360 g_list_free (glist_album);
361361 }
362362 if (glist_comment)
363363 {
364364 gtk_combo_set_popdown_strings (GTK_COMBO (combo_comment), glist_comment);
365- g_list_find_custom (glist_comment, (GFunc)g_free, NULL);
365+ g_list_foreach (glist_comment, (GFunc)g_free, NULL);
366366 g_list_free (glist_comment);
367367 }
368368 if (glist_genre)
369369 {
370370 gtk_combo_set_popdown_strings (GTK_COMBO (combo_genre), glist_genre);
371- g_list_find_custom (glist_genre, (GFunc)g_free, NULL);
371+ g_list_foreach (glist_genre, (GFunc)g_free, NULL);
372372 g_list_free (glist_genre);
373373 }
374374 gtk_combo_set_value_in_list (GTK_COMBO (combo_title), FALSE, FALSE);
--- mmaid/trunk/src/add.c (revision 139)
+++ mmaid/trunk/src/add.c (revision 140)
@@ -1,6 +1,6 @@
11 /*
22 Melody maid
3- copyright (c) 1998-2011 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
3+ copyright (c) 1998-2013 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
44
55 This program is free software: you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
@@ -289,31 +289,31 @@
289289 if (glist_title)
290290 {
291291 gtk_combo_set_popdown_strings (GTK_COMBO (combo_title), glist_title);
292- g_list_find_custom (glist_title, (GFunc)g_free, NULL);
292+ g_list_foreach (glist_title, (GFunc)g_free, NULL);
293293 g_list_free (glist_title);
294294 }
295295 if (glist_artist)
296296 {
297297 gtk_combo_set_popdown_strings (GTK_COMBO (combo_artist), glist_artist);
298- g_list_find_custom (glist_artist, (GFunc)g_free, NULL);
298+ g_list_foreach (glist_artist, (GFunc)g_free, NULL);
299299 g_list_free (glist_artist);
300300 }
301301 if (glist_album)
302302 {
303303 gtk_combo_set_popdown_strings (GTK_COMBO (combo_album), glist_album);
304- g_list_find_custom (glist_album, (GFunc)g_free, NULL);
304+ g_list_foreach (glist_album, (GFunc)g_free, NULL);
305305 g_list_free (glist_album);
306306 }
307307 if (glist_comment)
308308 {
309309 gtk_combo_set_popdown_strings (GTK_COMBO (combo_comment), glist_comment);
310- g_list_find_custom (glist_comment, (GFunc)g_free, NULL);
310+ g_list_foreach (glist_comment, (GFunc)g_free, NULL);
311311 g_list_free (glist_comment);
312312 }
313313 if (glist_genre)
314314 {
315315 gtk_combo_set_popdown_strings (GTK_COMBO (combo_genre), glist_genre);
316- g_list_find_custom (glist_genre, (GFunc)g_free, NULL);
316+ g_list_foreach (glist_genre, (GFunc)g_free, NULL);
317317 g_list_free (glist_genre);
318318 }
319319 gtk_combo_set_value_in_list (GTK_COMBO (combo_title), FALSE, FALSE);
--- mmaid/trunk/ChangeLog (revision 139)
+++ mmaid/trunk/ChangeLog (revision 140)
@@ -1,3 +1,36 @@
1+2012-12-29 Kazuki Iwamoto <iwm@maid.org>
2+
3+ * version 0.4.1
4+
5+2012-12-17 Kazuki Iwamoto <iwm@maid.org>
6+
7+ * misc/fileio.c: delete MAX_PATH
8+
9+ * orz/orzmdi.c: modify tooltip
10+
11+ * src/add.c
12+ * src/command.c
13+ * src/edit.c
14+ * src/file.c
15+ * src/root.c: replace g_list_find_custom to g_list_foreach
16+
17+ * src/command.c
18+ * src/file.[ch]
19+ * src/mmaid.[ch]
20+ * src/sigmain.c: rename kind to type
21+
22+ * src/command.c
23+ * src/file.[ch]
24+ * src/keyfile.c
25+ * src/mmaid.[ch]: modify playlist
26+
27+ * src/mm_dialog.c: modify vbox
28+
29+ * src/command.c
30+ * src/file.[ch]
31+ * src/keyfile.c
32+ * src/mmaid.[ch]: add newline code and path separator
33+
134 2012-08-29 Kazuki Iwamoto <iwm@maid.org>
235
336 * version 0.4.0
--- mmaid/trunk/misc/fileio.c (revision 139)
+++ mmaid/trunk/misc/fileio.c (revision 140)
@@ -57,12 +57,10 @@
5757 {
5858 #ifdef G_OS_WIN32
5959 gchar *utf8str, *filename;
60- gint i = 0, j, s;
60+ gint i = 0, j;
6161 DWORD dwSize; /* ja:フルパスの長さ */
6262 HANDLE hFind; /* ja:検索ハンドル */
63- LPTSTR p, lpszFile;
64- TCHAR szFile[MAX_PATH]; /* ja:フルパス */
65- TCHAR szLongName[MAX_PATH];
63+ LPTSTR p, lpszFile, lpszTemp, lpszLongName;
6664
6765 if (!file)
6866 return NULL;
@@ -77,8 +75,8 @@
7775 # endif /* not UNICODE */
7876 if (PathIsRelative (lpszFile))
7977 {
80- gint leng;
81- LPSTR lpszPath = NULL, lpszTemp;
78+ int nLeng;
79+ LPTSTR lpszPath = NULL;
8280
8381 if (path)
8482 {
@@ -96,34 +94,52 @@
9694 if (!lpszPath || PathIsRelative (lpszPath))
9795 {
9896 g_free (lpszPath);
99- lpszPath = g_malloc (MAX_PATH * sizeof (TCHAR));
100- GetCurrentDirectory (MAX_PATH, lpszPath);
97+ dwSize = GetCurrentDirectory (0, NULL);
98+ lpszPath = g_malloc (dwSize * sizeof (TCHAR));
99+ if (GetCurrentDirectory (dwSize, lpszPath) != dwSize - 1)
100+ {
101+ g_free (lpszPath);
102+ g_free (lpszFile);
103+ return g_strdup (file);
104+ }
101105 }
102- leng = lstrlen (lpszPath);
103- if (leng > 0 && G_IS_DIR_SEPARATOR (lpszPath[leng - 1]))
104- lpszPath[--leng] = '\0';
105- lpszTemp = g_malloc ((leng + lstrlen (lpszFile) + 2) * sizeof (TCHAR));
106+ PathRemoveBackslash (lpszPath);
107+ nLeng = lstrlen (lpszPath);
108+ lpszTemp = g_malloc ((nLeng + lstrlen (lpszFile) + 2) * sizeof (TCHAR));
106109 lstrcpy (lpszTemp, lpszPath);
107- lpszTemp[leng] = G_DIR_SEPARATOR;
108- lpszTemp[leng + 1] = '\0';
110+ lpszTemp[nLeng] = G_DIR_SEPARATOR;
111+ lpszTemp[nLeng + 1] = '\0';
109112 lstrcat (lpszTemp, lpszFile);
110113 g_free (lpszPath);
111114 g_free (lpszFile);
112115 lpszFile = lpszTemp;
113116 }
114- dwSize = GetFullPathName (lpszFile, MAX_PATH, szFile, &p);
117+ dwSize = GetFullPathName (lpszFile, 0, NULL, &p);
118+ if (dwSize == 0)
119+ {
120+ g_free (lpszFile);
121+ return g_strdup (file);
122+ }
123+ lpszTemp = g_malloc (dwSize * sizeof (TCHAR));
124+ if (GetFullPathName (lpszFile, dwSize, lpszTemp, &p) != dwSize - 1)
125+ {
126+ g_free (lpszTemp);
127+ g_free (lpszFile);
128+ return g_strdup (file);
129+ }
130+ dwSize--;
115131 g_free (lpszFile);
116- if (dwSize == 0 || dwSize >= MAX_PATH)
117- return g_strdup (file);
132+ lpszFile = lpszTemp;
118133 if (dwSize >= 2)
119134 {
120- if (szFile[1] == ':')
135+ if (lpszFile[1] == ':')
121136 {
122- szLongName[0] = (TCHAR)CharUpper ((LPTSTR)szFile[0]);
123- szLongName[1] = ':';
124- if (G_IS_DIR_SEPARATOR (szFile[2]))
137+ lpszLongName = g_malloc (sizeof (TCHAR) * 4);
138+ lpszLongName[0] = (TCHAR)CharUpper ((LPTSTR)lpszFile[0]);
139+ lpszLongName[1] = ':';
140+ if (G_IS_DIR_SEPARATOR (lpszFile[2]))
125141 {
126- szLongName[2] = G_DIR_SEPARATOR;
142+ lpszLongName[2] = G_DIR_SEPARATOR;
127143 i = 3;
128144 }
129145 else
@@ -131,36 +147,41 @@
131147 i = 2;
132148 }
133149 }
134- else if (G_IS_DIR_SEPARATOR (szFile[0])
135- && G_IS_DIR_SEPARATOR (szFile[1]))
150+ else if (G_IS_DIR_SEPARATOR (lpszFile[0])
151+ && G_IS_DIR_SEPARATOR (lpszFile[1]))
136152 {
137153 i = 2;
138154 while (i < dwSize)
139155 {
140- if (G_IS_DIR_SEPARATOR (szFile[i]))
156+ if (G_IS_DIR_SEPARATOR (lpszFile[i]))
141157 break;
142158 # ifdef UNICODE
143159 i++;
144160 # else /* not UNICODE */
145- i += IsDBCSLeadByteEx (CP_ACP, szFile[i]) ? 2 : 1;
161+ i += IsDBCSLeadByteEx (CP_ACP, lpszFile[i]) ? 2 : 1;
146162 # endif /* not UNICODE */
147163 }
148164 i++;
149- g_memmove (szLongName, szFile, i * sizeof (TCHAR));
165+ lpszLongName = g_malloc ((i + 1) * sizeof (TCHAR));
166+ g_memmove (lpszLongName, lpszFile, i * sizeof (TCHAR));
150167 }
151168 }
152- szLongName[i] = '\0';
169+ lpszLongName[i] = '\0';
153170 j = i;
154171 while (i <= dwSize)
155172 {
156- if (szFile[i] == '\0' || G_IS_DIR_SEPARATOR (szFile[i]))
173+ if (lpszFile[i] == '\0' || G_IS_DIR_SEPARATOR (lpszFile[i]))
157174 {
175+ int nLeng;
158176 WIN32_FIND_DATA rcf;
159177
160- s = lstrlen (szLongName);
161- g_memmove (szLongName + s, szFile + j, (i - j) * sizeof (TCHAR));
162- szLongName[s + i - j] = '\0';
163- hFind = FindFirstFile (szLongName, &rcf);
178+ nLeng = lstrlen (lpszLongName);
179+ lpszLongName = g_realloc (lpszLongName,
180+ (nLeng + i - j + 2) * sizeof (TCHAR));
181+ g_memmove (lpszLongName + nLeng, lpszFile + j,
182+ (i - j) * sizeof (TCHAR));
183+ lpszLongName[nLeng + i - j] = '\0';
184+ hFind = FindFirstFile (lpszLongName, &rcf);
164185 if (hFind != INVALID_HANDLE_VALUE)
165186 FindClose (hFind);
166187 else
@@ -167,30 +188,37 @@
167188 lstrcpy (rcf.cFileName, _T("."));
168189 if (lstrcmp (rcf.cFileName, _T(".")) != 0)
169190 {
170- g_memmove (szLongName + s, rcf.cFileName,
171- lstrlen (rcf.cFileName) * sizeof (TCHAR));
172- s += lstrlen (rcf.cFileName);
191+ int nLen;
192+
193+ nLen = lstrlen (rcf.cFileName);
194+ lpszLongName = g_realloc (lpszLongName,
195+ (nLeng + nLen + 2) * sizeof (TCHAR));
196+ g_memmove (lpszLongName + nLeng, rcf.cFileName,
197+ nLen * sizeof (TCHAR));
198+ nLeng += nLen;
173199 }
174200 else
175201 {
176- s += i - j;
202+ nLeng += i - j;
177203 }
178- if (G_IS_DIR_SEPARATOR (szFile[i]))
179- szLongName[s++] = G_DIR_SEPARATOR;
180- szLongName[s] = '\0';
204+ if (G_IS_DIR_SEPARATOR (lpszFile[i]))
205+ lpszLongName[nLeng++] = G_DIR_SEPARATOR;
206+ lpszLongName[nLeng] = '\0';
181207 j = i + 1;
182208 }
183209 # ifdef UNICODE
184210 i++;
185211 # else /* not UNICODE */
186- i += IsDBCSLeadByteEx (CP_ACP, szFile[i]) ? 2 : 1;
212+ i += IsDBCSLeadByteEx (CP_ACP, lpszFile[i]) ? 2 : 1;
187213 # endif /* not UNICODE */
188214 }
215+ g_free (lpszFile);
189216 # ifdef UNICODE
190- utf8str = g_utf16_to_utf8 (szLongName, -1, NULL, NULL, NULL);
217+ utf8str = g_utf16_to_utf8 (lpszLongName, -1, NULL, NULL, NULL);
191218 # else /* not UNICODE */
192- utf8str = g_locale_to_utf8 (szLongName, -1, NULL, NULL, NULL);
219+ utf8str = g_locale_to_utf8 (lpszLongName, -1, NULL, NULL, NULL);
193220 # endif /* not UNICODE */
221+ g_free (lpszLongName);
194222 if (!utf8str)
195223 return g_strdup (file);
196224 filename = g_filename_from_utf8 (utf8str, -1, NULL, NULL, NULL);
@@ -1274,7 +1302,8 @@
12741302 # else /* not UNICODE */
12751303 lpszFile = g_win32_locale_filename_from_utf8 (file);
12761304 # endif /* not UNICODE */
1277- if ((BOOL)SHGetFileInfo (lpszFile, 0, &shfi, sizeof (SHFILEINFOW),
1305+ shfi.dwAttributes = FILE_ATTRIBUTE_NORMAL;
1306+ if ((BOOL)SHGetFileInfo (lpszFile, 0, &shfi, sizeof (SHFILEINFO),
12781307 SHGFI_ICON | SHGFI_USEFILEATTRIBUTES | uFlags)
12791308 && GetIconInfo (shfi.hIcon, &ii))
12801309 {
--- mmaid/trunk/misc/misc.c (revision 139)
+++ mmaid/trunk/misc/misc.c (revision 140)
@@ -712,10 +712,15 @@
712712 cr = gdk_cairo_create (window);
713713 w = width - ABS (dx);
714714 h = height - ABS (dy);
715+# if GTK_CHECK_VERSION(3,0,0)
716+ pixbuf = gdk_pixbuf_get_from_window (window,
717+ dx > 0 ? x : x - dx, dy > 0 ? y : y - dy, w, h);
718+# else /* not GTK_CHECK_VERSION(3,0,0) */
715719 pixbuf = gdk_pixbuf_get_from_drawable (NULL, window,
716720 gdk_colormap_get_system (),
717721 dx > 0 ? x : x - dx, dy > 0 ? y : y - dy,
718722 0, 0, w, h);
723+# endif /* not GTK_CHECK_VERSION(3,0,0) */
719724 xx = dx > 0 ? x + dx : x;
720725 yy = dy > 0 ? y + dy : y;
721726 gdk_cairo_set_source_pixbuf (cr, pixbuf, xx, yy);
--- mmaid/trunk/Makefile.msc.in (revision 139)
+++ mmaid/trunk/Makefile.msc.in (revision 140)
@@ -46,7 +46,7 @@
4646 misc\gcommon.obj \
4747 misc\gnugpl.obj \
4848 misc\license.obj \
49- misc\misc.obj \
49+ misc\misc.obj \
5050 misc\profile.obj \
5151 misc\winmain.obj \
5252 orz\orzaccel.obj \
@@ -80,7 +80,7 @@
8080 src\version.obj
8181
8282 mmaid.exe: iwmcrt\iwmcrt.lib $(mmaid_OBJECTS)
83- $(LINK) $(LNFLAGS) $(ICFLAGS) /SUBSYSTEM:WINDOWS cairo.lib gdk_pixbuf-2.0.lib gdk-win32-2.0.lib gio-2.0.lib glib-2.0.lib gobject-2.0.lib gtk-win32-2.0.lib intl.lib pango-1.0.lib gdi32.lib ole32.lib shell32.lib shlwapi.lib user32.lib $(mmaid_OBJECTS)
83+ $(LINK) $(LNFLAGS) $(ICFLAGS) /SUBSYSTEM:WINDOWS cairo.lib gdk_pixbuf-2.0.lib gdk-win32-3.0.lib gio-2.0.lib glib-2.0.lib gobject-2.0.lib gtk-win32-3.0.lib intl.lib pango-1.0.lib gdi32.lib ole32.lib shell32.lib shlwapi.lib user32.lib $(mmaid_OBJECTS)
8484 if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#1
8585
8686 misc\argument.obj: $(TOP)\$*.c $(TOP)\$*.h $(TOP)\misc\gcommon.h $(TOP)\misc\gkeysyms.h $(TOP)\misc\misc.h $(TOP)\misc\profile.h
--- mmaid/trunk/configure.ac (revision 139)
+++ mmaid/trunk/configure.ac (revision 140)
@@ -5,7 +5,7 @@
55 dnl version number
66 MAJOR_VERSION=0
77 MINOR_VERSION=4
8-MICRO_VERSION=0
8+MICRO_VERSION=1
99 EXTRA_VERSION=
1010 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
1111
--- mmaid/trunk/orz/orzmdi.c (revision 139)
+++ mmaid/trunk/orz/orzmdi.c (revision 140)
@@ -1,6 +1,6 @@
11 /*
22 orzmdi
3- copyright (c) 1998-2011 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
3+ copyright (c) 1998-2012 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org
44
55 This program is free software: you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
@@ -614,6 +614,7 @@
614614 gtk_container_add (GTK_CONTAINER (event), hbox);
615615 #if GTK_CHECK_VERSION(2,12,0)
616616 gtk_widget_set_has_tooltip (event, TRUE);
617+ gtk_widget_set_tooltip_text (event, tab->file);
617618 #else /* not GTK_CHECK_VERSION(2,12,0) */
618619 gtk_tooltips_set_tip (mdi->tooltips, event, tab->file, tab->file);
619620 #endif /* not GTK_CHECK_VERSION(2,12,0) */
--- mmaid/trunk/po/ja.po (revision 139)
+++ mmaid/trunk/po/ja.po (revision 140)
@@ -4,9 +4,9 @@
44 #
55 msgid ""
66 msgstr ""
7-"Project-Id-Version: mmaid 0.4.0\n"
8-"Report-Msgid-Bugs-To: http://www.maid.org/\n"
9-"POT-Creation-Date: 2012-03-29 04:53+0900\n"
7+"Project-Id-Version: mmaid 0.4.1\n"
8+"Report-Msgid-Bugs-To: \n"
9+"POT-Creation-Date: 2012-12-13 15:28+0900\n"
1010 "PO-Revision-Date: 2004-01-04 23:14+0900\n"
1111 "Last-Translator: Kazuki Iwamoto <iwm@maid.org>\n"
1212 "Language-Team: Kazuki Iwamoto <iwm@maid.org>\n"
@@ -14,6 +14,7 @@
1414 "Content-Type: text/plain; charset=UTF-8\n"
1515 "Content-Transfer-Encoding: 8bit\n"
1616
17+#. ja:中途半端にライセンスが表示されているとき
1718 #: misc/license.c:75
1819 msgid "Scroll is too fast! Do you really view the license?"
1920 msgstr "スクロールが速すぎます! 本当にライセンスを読みましたか?"
@@ -22,6 +23,7 @@
2223 msgid "License"
2324 msgstr "ライセンス"
2425
26+#. ja:ラベル
2527 #: misc/license.c:132
2628 msgid "View the license. Please scroll to view the entire license text."
2729 msgstr ""
@@ -28,6 +30,7 @@
2830 "ライセンスをお読みください。すべてのライセンス文を読むためにスクロールしてく"
2931 "ださい。"
3032
33+#. ja:ラジオボタン
3134 #: misc/license.c:135
3235 msgid "I agree."
3336 msgstr "同意する"
@@ -36,6 +39,7 @@
3639 msgid "I deny."
3740 msgstr "同意しない"
3841
42+#. ja:メインウインドウ
3943 #: orz/orzcharlist.c:326 src/mm_list.c:378
4044 msgid "Character Encoding"
4145 msgstr "文字符号化方式"
@@ -44,6 +48,7 @@
4448 msgid "Registered Character Encoding"
4549 msgstr "登録されている文字符号化方式"
4650
51+#. ja:チェックボタン
4752 #: orz/orzpref.c:137
4853 msgid "_New File"
4954 msgstr "新規ファイルを開く(_N)"
@@ -52,6 +57,7 @@
5257 msgid "_Open Window"
5358 msgstr "新規ウインドウを開く(_O)"
5459
60+#. ja:ラベル
5561 #: orz/orzpref.c:168
5662 msgid "H_istory"
5763 msgstr "ファイルの履歴(_I)"
@@ -64,6 +70,7 @@
6470 msgid "_Height"
6571 msgstr "高さ(_H)"
6672
73+#. ja:ラジオボタン
6774 #: orz/orzpref.c:175
6875 msgid "_Top"
6976 msgstr "上(_T)"
@@ -80,7 +87,8 @@
8087 msgid "_Bottom"
8188 msgstr "下(_B)"
8289
83-#: orz/orzpref.c:191 src/mmaid.c:93 src/sigmain.c:165
90+#. ja:フレームとボックス
91+#: orz/orzpref.c:191 src/mmaid.c:100 src/sigmain.c:165
8492 msgid "Window Size"
8593 msgstr "ウインドウのサイズ"
8694
@@ -88,31 +96,31 @@
8896 msgid "Tab Position"
8997 msgstr "タブの位置"
9098
91-#: src/mmaid.c:90 src/sigmain.c:163
99+#: src/mmaid.c:97 src/sigmain.c:163
92100 msgid "History"
93101 msgstr "ファイルの履歴"
94102
95-#: src/mmaid.c:91 src/sigmain.c:164
103+#: src/mmaid.c:98 src/sigmain.c:164
96104 msgid "New File"
97105 msgstr "新規ファイルを開く"
98106
99-#: src/mmaid.c:92
107+#: src/mmaid.c:99
100108 msgid "Profile"
101109 msgstr "プロファイル"
102110
103-#: src/mmaid.c:94 src/sigmain.c:166
111+#: src/mmaid.c:101 src/sigmain.c:166
104112 msgid "Open Window"
105113 msgstr "新規ウインドウを開く"
106114
107-#: src/mmaid.c:95
115+#: src/mmaid.c:102
108116 msgid "GNU GENERAL PUBLIC LICENSE"
109117 msgstr "GNU GENERAL PUBLIC LICENSE"
110118
111-#: src/mmaid.c:96
119+#: src/mmaid.c:103
112120 msgid "About"
113121 msgstr "バージョン情報"
114122
115-#: src/mmaid.c:97
123+#: src/mmaid.c:104
116124 msgid "Help"
117125 msgstr "ヘルプ"
118126
@@ -120,23 +128,27 @@
120128 msgid "Abort"
121129 msgstr "中断"
122130
123-#: src/add.c:49 src/add.c:88 src/command.c:1114 src/command.c:1134
131+#: src/add.c:49 src/add.c:88 src/command.c:1223 src/command.c:1243
124132 #: src/edit.c:48 src/edit.c:82 src/root.c:73 src/root.c:93
125133 msgid "Browse"
126134 msgstr "参照"
127135
136+#. ja:ボタン
128137 #: src/add.c:184 src/edit.c:585 src/root.c:219
129138 msgid "_Browse..."
130139 msgstr "参照(_B)..."
131140
141+#. ja:チェックボタン
132142 #: src/add.c:423 src/edit.c:535
133143 msgid "T_rack"
134144 msgstr "トラック(_R)"
135145
146+#. ja:ラベル
136147 #: src/add.c:439 src/edit.c:589 src/menu.c:30
137148 msgid "_File"
138149 msgstr "ファイル(_F)"
139150
151+#. ja:ラベル
140152 #: src/add.c:440 src/edit.c:217
141153 msgid "_Title"
142154 msgstr "タイトル(_T)"
@@ -161,12 +173,12 @@
161173 msgid "_Genre"
162174 msgstr "ジャンル(_G)"
163175
164-#: src/add.c:446 src/command.c:436 src/edit.c:223 src/export.c:146
176+#: src/add.c:446 src/command.c:501 src/edit.c:223 src/export.c:146
165177 #: src/menu.c:71
166178 msgid "Character _Encoding"
167179 msgstr "文字符号化方式(_E)"
168180
169-#: src/command.c:172 src/command.c:549
181+#: src/command.c:172 src/command.c:652
170182 #, c-format
171183 msgid ""
172184 "%s\n"
@@ -179,35 +191,50 @@
179191 "\n"
180192 "上書きしますか?"
181193
182-#: src/command.c:303
194+#: src/command.c:329
183195 msgid "Root Directory Error"
184196 msgstr "ルートディレクトリエラー"
185197
186-#: src/command.c:365
198+#. ja:チェックボタン
199+#: src/command.c:391
200+msgid "_Header"
201+msgstr "ヘッダ(_H)"
202+
203+#. ja:ラジオボタン
204+#: src/command.c:395
187205 msgid "_iDB File"
188206 msgstr "iDBファイル(_I)"
189207
190-#: src/command.c:367
208+#: src/command.c:397
191209 msgid "_Play List"
192210 msgstr "プレイリスト(_P)"
193211
194-#: src/command.c:368
195-msgid "Rela_tive Path"
196-msgstr "相対パス(_T)"
212+#: src/command.c:399
213+msgid "Relative"
214+msgstr "相対"
197215
198-#: src/command.c:370
199-msgid "Ab_solute Path"
200-msgstr "絶対パス(_S)"
216+#: src/command.c:401
217+msgid "Absolute"
218+msgstr "絶対"
201219
202-#: src/command.c:372
203-msgid "File Name _Only"
204-msgstr "ファイル名のみ(_O)"
220+#: src/command.c:403
221+msgid "File Name"
222+msgstr "ファイル名"
205223
206-#: src/command.c:435
224+#. ja:ラベル
225+#: src/command.c:496
226+msgid "_Path"
227+msgstr "パス(_P)"
228+
229+#: src/command.c:499
230+msgid "_Separator"
231+msgstr "区切り(_S)"
232+
233+#: src/command.c:504
207234 msgid "_Root"
208235 msgstr "ルート(_R)"
209236
210-#: src/command.c:601
237+#: src/command.c:710
211238 #, c-format
212239 msgid ""
213240 "File %s was edited.\n"
@@ -216,67 +243,69 @@
216243 "ファイル %s の内容が変更されています。\n"
217244 "保存されている状態に戻しますか?"
218245
219-#: src/command.c:640 src/export.c:104
246+#: src/command.c:749 src/export.c:104
220247 msgid "Export"
221248 msgstr "エクスポート"
222249
223-#: src/command.c:670
250+#. ja:ファイルが存在しないとき
251+#: src/command.c:779
224252 msgid "File Open Error"
225253 msgstr "ファイルオープンエラー"
226254
227-#: src/command.c:676
255+#. ja:既存のタグを保持し、かつ既にタグがあるとき
256+#: src/command.c:785
228257 msgid "Have Tag"
229258 msgstr "タグがある"
230259
231-#: src/command.c:708
260+#: src/command.c:817
232261 msgid "Success"
233262 msgstr "成功"
234263
235-#: src/command.c:711
264+#: src/command.c:820
236265 msgid "Invalid Character Encoding of Title"
237266 msgstr "タイトルが不正な文字符号化方式"
238267
239-#: src/command.c:714
268+#: src/command.c:823
240269 msgid "Invalid Character Encoding of Artist"
241270 msgstr "アーチストが不正な文字符号化方式"
242271
243-#: src/command.c:717
272+#: src/command.c:826
244273 msgid "Invalid Character Encoding of Album"
245274 msgstr "アルバムが不正な文字符号化方式"
246275
247-#: src/command.c:720
276+#: src/command.c:829
248277 msgid "Invalid Character Encoding of Year"
249278 msgstr "西暦が不正な文字符号化方式"
250279
251-#: src/command.c:723
280+#: src/command.c:832
252281 msgid "Invalid Character Encoding of Comment"
253282 msgstr "コメントが不正な文字符号化方式"
254283
255-#: src/command.c:726
284+#: src/command.c:835
256285 msgid "Invalid Length of Title"
257286 msgstr "タイトルが長すぎる"
258287
259-#: src/command.c:729
288+#: src/command.c:838
260289 msgid "Invalid Length of Artist"
261290 msgstr "アーチストが長すぎる"
262291
263-#: src/command.c:732
292+#: src/command.c:841
264293 msgid "Invalid Length of Album"
265294 msgstr "アルバムが長すぎる"
266295
267-#: src/command.c:735
296+#: src/command.c:844
268297 msgid "Invalid Length of Year"
269298 msgstr "西暦が長すぎる"
270299
271-#: src/command.c:738
300+#: src/command.c:847
272301 msgid "Invalid Length of Comment"
273302 msgstr "コメントが長すぎる"
274303
275-#: src/command.c:741
304+#: src/command.c:850
276305 msgid "Error"
277306 msgstr "エラー"
278307
279-#: src/command.c:1179
308+#: src/command.c:1288
280309 msgid "Search"
281310 msgstr "検索"
282311
@@ -284,24 +313,25 @@
284313 msgid "Edit"
285314 msgstr "編集"
286315
316+#. ja:チェックボタン
287317 #: src/export.c:126
288318 msgid "_Hold existing tags"
289319 msgstr "既存のタグを保持する(_H)"
290320
291-#: src/file.c:385 src/file.c:593
321+#: src/file.c:412 src/file.c:624
292322 msgid "Reading"
293323 msgstr "ファイルを読み込み中"
294324
295-#: src/file.c:914 src/file.c:1109
325+#: src/file.c:969 src/file.c:1178
296326 msgid "Writing"
297327 msgstr "ファイルに書き込み中"
298328
299-#: src/file.c:991 src/file.c:1170
329+#: src/file.c:1046 src/file.c:1262
300330 #, c-format
301331 msgid "Conversion from character encoding 'UTF-8' to '%s' is not supported"
302332 msgstr "'UTF-8'から'%s'への文字符号化方式の変換に対応していません"
303333
304-#: src/file.c:995
334+#: src/file.c:1050
305335 #, c-format
306336 msgid ""
307337 "%s\n"
@@ -310,7 +340,7 @@
310340 "%s\n"
311341 "ファイル : %s"
312342
313-#: src/file.c:1001
343+#: src/file.c:1056
314344 #, c-format
315345 msgid ""
316346 "%s\n"
@@ -319,7 +349,7 @@
319349 "%s\n"
320350 "タイトル : %s"
321351
322-#: src/file.c:1007
352+#: src/file.c:1062
323353 #, c-format
324354 msgid ""
325355 "%s\n"
@@ -328,7 +358,7 @@
328358 "%s\n"
329359 "アーチスト : %s"
330360
331-#: src/file.c:1014
361+#: src/file.c:1069
332362 #, c-format
333363 msgid ""
334364 "%s\n"
@@ -337,7 +367,7 @@
337367 "%s\n"
338368 "アルバム : %s"
339369
340-#: src/file.c:1020
370+#: src/file.c:1075
341371 #, c-format
342372 msgid ""
343373 "%s\n"
@@ -346,11 +376,11 @@
346376 "%s\n"
347377 "ジャンル : %s"
348378
349-#: src/file.c:1058 src/file.c:1229
379+#: src/file.c:1113 src/file.c:1329
350380 msgid "Can not open file"
351381 msgstr "ファイルが開けません"
352382
353-#: src/file.c:1070 src/file.c:1205
383+#: src/file.c:1125 src/file.c:1195 src/file.c:1302
354384 msgid "Can not write"
355385 msgstr "ファイルに書き込みできません"
356386
@@ -363,6 +393,7 @@
363393 "ファイル %s の内容が変更されています\n"
364394 "保存しますか?"
365395
396+#. 000
366397 #: src/genre.c:23
367398 msgid "Blues"
368399 msgstr "ブルース"
@@ -379,6 +410,7 @@
379410 msgid "Dance"
380411 msgstr "ダンス"
381412
413+#. 004
382414 #: src/genre.c:24
383415 msgid "Disco"
384416 msgstr "ディスコ"
@@ -395,6 +427,7 @@
395427 msgid "Hip-Hop"
396428 msgstr "ヒップ・ホップ"
397429
430+#. 008
398431 #: src/genre.c:25
399432 msgid "Jazz"
400433 msgstr "ジャズ"
@@ -411,6 +444,7 @@
411444 msgid "Oldies"
412445 msgstr "オールディーズ"
413446
447+#. 012
414448 #: src/genre.c:26
415449 msgid "Other"
416450 msgstr "その他"
@@ -427,6 +461,7 @@
427461 msgid "Rap"
428462 msgstr "ラップ"
429463
464+#. 016
430465 #: src/genre.c:27
431466 msgid "Reggae"
432467 msgstr "レゲエ"
@@ -443,6 +478,7 @@
443478 msgid "Industrial"
444479 msgstr "インダストリアル"
445480
481+#. 020
446482 #: src/genre.c:28
447483 msgid "Alternative"
448484 msgstr "オルタナティヴ"
@@ -459,6 +495,7 @@
459495 msgid "Pranks"
460496 msgstr "プランクス"
461497
498+#. 024
462499 #: src/genre.c:29
463500 msgid "Soundtrack"
464501 msgstr "サウンドトラック"
@@ -475,6 +512,7 @@
475512 msgid "Trip-Hop"
476513 msgstr "トリップ・ホップ"
477514
515+#. 028
478516 #: src/genre.c:30
479517 msgid "Vocal"
480518 msgstr "ボーカル"
@@ -491,6 +529,7 @@
491529 msgid "Trance"
492530 msgstr "トランス"
493531
532+#. 032
494533 #: src/genre.c:31
495534 msgid "Classical"
496535 msgstr "クラシカル"
@@ -507,6 +546,7 @@
507546 msgid "House"
508547 msgstr "ハウス"
509548
549+#. 036
510550 #: src/genre.c:32
511551 msgid "Game"
512552 msgstr "ゲーム"
@@ -523,6 +563,7 @@
523563 msgid "Noise"
524564 msgstr "ノイズ"
525565
566+#. 040
526567 #: src/genre.c:33
527568 msgid "AlternRock"
528569 msgstr "アルターンロック"
@@ -539,6 +580,7 @@
539580 msgid "Punk"
540581 msgstr "パンク"
541582
583+#. 044
542584 #: src/genre.c:34
543585 msgid "Space"
544586 msgstr "スペース"
@@ -555,6 +597,7 @@
555597 msgid "Instrumental Rock"
556598 msgstr "インストゥルメンタルロック"
557599
600+#. 048
558601 #: src/genre.c:35
559602 msgid "Ethnic"
560603 msgstr "エスニック"
@@ -571,6 +614,7 @@
571614 msgid "Techno-Industrial"
572615 msgstr "テクノ・インダストリアル"
573616
617+#. 052
574618 #: src/genre.c:36
575619 msgid "Electronic"
576620 msgstr "エレクトロニック"
@@ -587,6 +631,7 @@
587631 msgid "Dream"
588632 msgstr "ドリーム"
589633
634+#. 056
590635 #: src/genre.c:37
591636 msgid "Southern Rock"
592637 msgstr "サザンロック"
@@ -603,6 +648,7 @@
603648 msgid "Gangsta"
604649 msgstr "ガングスタ"
605650
651+#. 060
606652 #: src/genre.c:38
607653 msgid "Top 40"
608654 msgstr "トップ40"
@@ -619,6 +665,7 @@
619665 msgid "Jungle"
620666 msgstr "ジャングル"
621667
668+#. 064
622669 #: src/genre.c:39
623670 msgid "Native American"
624671 msgstr "ネイティブアメリカン"
@@ -635,6 +682,7 @@
635682 msgid "Psychadelic"
636683 msgstr "サイケデリック"
637684
685+#. 068
638686 #: src/genre.c:40
639687 msgid "Rave"
640688 msgstr "レイブ"
@@ -651,6 +699,7 @@
651699 msgid "Lo-Fi"
652700 msgstr "ローファイ"
653701
702+#. 072
654703 #: src/genre.c:41
655704 msgid "Tribal"
656705 msgstr "トライバル"
@@ -667,6 +716,7 @@
667716 msgid "Polka"
668717 msgstr "ポルカ"
669718
719+#. 076
670720 #: src/genre.c:42
671721 msgid "Retro"
672722 msgstr "レトロ"
@@ -683,6 +733,49 @@
683733 msgid "Hard Rock"
684734 msgstr "ハードロック"
685735
736+#. 080
737+#. 084
738+#. 088
739+#. 092
740+#. 096
741+#. 100
742+#. 104
743+#. 108
744+#. 112
745+#. 116
746+#. 120
747+#. 124
748+#. 128
749+#. 132
750+#. 136
751+#. 140
752+#. 144
753+#. 148
754+#. 152
755+#. 156
756+#. 160
757+#. 164
758+#. 168
759+#. 172
760+#. 176
761+#. 180
762+#. 184
763+#. 188
764+#. 192
765+#. 196
766+#. 200
767+#. 204
768+#. 208
769+#. 212
770+#. 216
771+#. 220
772+#. 224
773+#. 228
774+#. 232
775+#. 236
776+#. 240
777+#. 244
778+#. 248
686779 #: src/genre.c:85
687780 msgid "Heavy Rock"
688781 msgstr "ヘビーロック"
@@ -699,6 +792,7 @@
699792 msgid "Seiyu"
700793 msgstr "声優"
701794
795+#. 252
702796 #: src/genre.c:86
703797 msgid "Tecno Ambient"
704798 msgstr "テクノアンビエント"
@@ -823,6 +917,7 @@
823917 msgid "Process"
824918 msgstr "プロセス"
825919
920+#. ja:ラベル
826921 #: src/process.c:89
827922 msgid "_Play"
828923 msgstr "演奏(_P)"
@@ -831,6 +926,7 @@
831926 msgid "_Stop"
832927 msgstr "停止(_S)"
833928
929+#. ja:ラベル
834930 #: src/root.c:318
835931 msgid "_Find Path"
836932 msgstr "検索パス(_F)"
Show on old repository browser