summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: efcebe2)
raw | patch | inline | side by side (parent: efcebe2)
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Sat, 17 Dec 2011 20:58:01 +0000 (21:58 +0100) | ||
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Thu, 22 Dec 2011 12:01:22 +0000 (13:01 +0100) |
doc/config.sample | patch | blob | history | |
doc/ncmpc.1 | patch | blob | history | |
src/conf.c | patch | blob | history | |
src/options.c | patch | blob | history | |
src/options.h | patch | blob | history | |
src/screen_lyrics.c | patch | blob | history |
diff --git a/doc/config.sample b/doc/config.sample
index 6ad6809feeffb6d6f9bb9780754813d1d1b0c4ab..c833d5af0650051f569c4cc1af42d1c005d72236 100644 (file)
--- a/doc/config.sample
+++ b/doc/config.sample
## The text editor used for editing lyrics.
#text-editor = emacs
+## Ask before starting an editor.
+#text-editor-ask = yes
+
## Display song length in second column
#second-column = yes
diff --git a/doc/ncmpc.1 b/doc/ncmpc.1
index f09defa4d1e58f699d1b4986f57ef4341abb6106..d3e3c03fa844f7872edf5322e45b90a8b957e217 100644 (file)
--- a/doc/ncmpc.1
+++ b/doc/ncmpc.1
.B text\-editor = EDITOR
The text editor used for editing lyrics.
.TP
+.B text\-editor\-ask = yes|no
+Ask before starting an editor.
+.TP
.B second-column = yes|no
Display song length in a second column.
.SS Display
diff --git a/src/conf.c b/src/conf.c
index 9754fbd4b31df78615ccc28c539e9e7d835fabc2..7f3ddd51814b4750c4052a9e0a70c481cc7f75ff 100644 (file)
--- a/src/conf.c
+++ b/src/conf.c
#define CONF_LYRICS_AUTOSAVE "lyrics-autosave"
#define CONF_LYRICS_SHOW_PLUGIN "lyrics-show-plugin"
#define CONF_TEXT_EDITOR "text-editor"
+#define CONF_TEXT_EDITOR_ASK "text-editor-ask"
#define CONF_SECOND_COLUMN "second-column"
static bool
}
#else
{}
+#endif
+ else if (!strcasecmp(name, CONF_TEXT_EDITOR_ASK))
+#ifdef ENABLE_LYRICS_SCREEN
+ options.text_editor_ask = str2bool(value);
+#else
+ {}
#endif
else if (!strcasecmp(CONF_SECOND_COLUMN, name))
#ifdef NCMPC_MINI
diff --git a/src/options.c b/src/options.c
index 9bc338ebf30d5aa15c68b8646d5669a114540db3..35de128e1e602a4b7aed0d5008120471d10ac1ca 100644 (file)
--- a/src/options.c
+++ b/src/options.c
.lyrics_timeout = DEFAULT_LYRICS_TIMEOUT,
.lyrics_autosave = false,
.lyrics_show_plugin = false,
+ .text_editor_ask = true,
#endif
.find_wrap = true,
.scroll_offset = 0,
diff --git a/src/options.h b/src/options.h
index 6b1da8bfcc3f110b6925687056cd60369bc65704..c1a833d01066c3157e5badfd5421ac84f87d1213 100644 (file)
--- a/src/options.h
+++ b/src/options.h
bool lyrics_autosave;
bool lyrics_show_plugin;
char *text_editor;
+ bool text_editor_ask;
#endif
bool find_wrap;
bool find_show_last_pattern;
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c
index 676ea151e478e36e6f32b2edb78e30a0cb888f60..ee76e28b45134563715e378f7d9655a500a88d5c 100644 (file)
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
#include "screen.h"
#include "lyrics.h"
#include "screen_text.h"
+#include "screen_utils.h"
#include "ncu.h"
#include <assert.h>
return;
}
+ if (options.text_editor_ask) {
+ char *buf = g_strdup_printf(
+ _("Do you really want to start an editor and edit these lyrics [%s/%s]? "),
+ YES, NO);
+ bool really = screen_get_yesno(buf, false);
+ g_free(buf);
+ if (!really) {
+ screen_status_message(_("Aborted"));
+ return;
+ }
+ }
+
if (store_lyr_hd() < 0)
return;