aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-15 09:23:49 +0200
committerMax Kellermann <max@duempel.org>2008-09-15 09:23:49 +0200
commit85fb21cc2bb75cd207d770c6ee7567ddb8e09fd4 (patch)
tree1e2316c2d4d9ad1b5c4e918281e2bb2508d030fe
parent3911da5c6169877988b061d1de9b475f5789ba69 (diff)
downloadmpd-85fb21cc2bb75cd207d770c6ee7567ddb8e09fd4.tar.gz
mpd-85fb21cc2bb75cd207d770c6ee7567ddb8e09fd4.tar.xz
mpd-85fb21cc2bb75cd207d770c6ee7567ddb8e09fd4.zip
splash: removed the useless splash screen
The code looks strange and spews lots of warnings. Since it does nothing useful, and wastes the user's precious time, simply remove it.
Diffstat (limited to '')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/conf.c10
-rw-r--r--src/main.c2
-rw-r--r--src/options.c3
-rw-r--r--src/options.h1
-rw-r--r--src/splash.c125
-rw-r--r--src/splash.h1
7 files changed, 2 insertions, 142 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 3ceef6a8c..e3ddc313d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -29,7 +29,6 @@ ncmpc_headers = \
utils.h\
ncmpc.h\
screen_browse.h\
- splash.h\
src_lyrics.h
# $Id$
@@ -62,7 +61,6 @@ ncmpc_SOURCES = \
wreadln.c\
strfsong.c\
utils.c\
- splash.c\
src_lyrics.c
if LEOSLYRICS_FIXED
diff --git a/src/conf.c b/src/conf.c
index df0ac5465..049671c24 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -560,15 +560,7 @@ read_rc_file(char *filename, options_t *options)
}
else if( !strcasecmp(CONF_SHOW_SPLASH, name) )
{
- options->show_splash = str2bool(value);
-
-#ifdef DEBUG
- D("screen-list:");
- j=0;
- while(options->screen_list[j])
- D(" %s", options->screen_list[j++]);
- D("\n");
-#endif
+ /* the splash screen was removed */
}
else if( !strcasecmp(CONF_HOST, name))
{
diff --git a/src/main.c b/src/main.c
index 5e978409f..2f01cab04 100644
--- a/src/main.c
+++ b/src/main.c
@@ -37,7 +37,6 @@
#include "screen.h"
#include "screen_utils.h"
#include "strfsong.h"
-#include "splash.h"
#define BUFSIZE 1024
@@ -266,7 +265,6 @@ main(int argc, const char *argv[])
atexit(exit_and_cleanup);
ncurses_init();
- if(options->show_splash == TRUE) draw_splash();
src_lyr_init ();
diff --git a/src/options.c b/src/options.c
index fbf079af7..0d3c2a6d0 100644
--- a/src/options.c
+++ b/src/options.c
@@ -217,7 +217,7 @@ handle_option(int c, char *arg)
options.key_file = g_strdup(arg);
break;
case 'S': /* --key-file */
- options.show_splash = FALSE;
+ /* the splash screen was removed */
break;
#ifdef DEBUG
case 'K': /* --dump-keys */
@@ -374,7 +374,6 @@ options_init( void )
options.screen_list = g_strsplit_set(DEFAULT_SCREEN_LIST, " ", 0);
options.timedisplay_type = DEFAULT_TIMEDISPLAY_TYPE;
options.lyrics_timeout = DEFAULT_LYRICS_TIMEOUT;
- options.show_splash = FALSE;
options.scroll = DEFAULT_SCROLL;
options.scroll_sep = g_strdup(DEFAULT_SCROLL_SEP);
diff --git a/src/options.h b/src/options.h
index 5547ff8dd..661d87440 100644
--- a/src/options.h
+++ b/src/options.h
@@ -33,7 +33,6 @@ typedef struct
gboolean visible_bell;
gboolean enable_xterm_title;
gboolean enable_mouse;
- gboolean show_splash;
gboolean scroll;
} options_t;
diff --git a/src/splash.c b/src/splash.c
deleted file mode 100644
index fbd545777..000000000
--- a/src/splash.c
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ncurses.h>
-#include <string.h>
-
-#include "ncmpc.h"
-#include "colors.h"
-
-
-gpointer get_input(void *null)
-{
- int key;
- while(key = getch())
- {
- if(key == 'q')
- {
- exit(0);
- }
- }
- return;
-}
-
-void draw_message(char *msg)
-{
- int rows, cols;
- getmaxyx(stdscr, rows, cols);
- mvaddstr(rows-1, (cols/2)-(strlen(msg)/2), msg);
- refresh();
-}
-
-
-/*void draw_title()
-{
- colors_use(stdscr, COLOR_TITLE_BOLD);
- mvaddstr(rows/2+1, COLS/2, VERSION);
- colors_use(stdscr, COLOR_TITLE_BOLD);
- mvaddstr(rows/2-1, x, PACKAGE);
- refresh();
-}
-*/
-gboolean advance_version()
-{
- int rows, cols;
- getmaxyx(stdscr, rows, cols);
- static int x = 0;
- if(x == 0)
- {
- x = cols - strlen(VERSION);
- }
- colors_use(stdscr, COLOR_TITLE_BOLD);
- mvaddstr(rows/2+1, x--, VERSION);
- mvhline(rows/2+1, x+strlen(VERSION)+1, ' ', cols);
- refresh();
- if(x == cols/2) return FALSE;
- return TRUE;
-}
-
-
-gboolean advance_name()
-{
- int rows, cols;
- getmaxyx(stdscr, rows, cols);
- static int x = 0;
- colors_use(stdscr, COLOR_TITLE_BOLD);
- mvaddstr(rows/2-1, x, PACKAGE);
- mvhline(rows/2-1, 0, ' ', x);
- refresh();
- if(x + strlen(PACKAGE) == cols/2) return FALSE;
- x++;
- return TRUE;
-}
-
-gboolean draw_animation(gpointer *data)
-{ //need this to execute both functions, even if one of them return TRUE
- if(advance_name() == FALSE && advance_version() == FALSE || advance_name() == TRUE && advance_version() == FALSE)
- {
- // system("sleep 8");
- g_main_loop_quit((GMainLoop*) data);
- // g_source_attach(((int*)data)[1], data);
- return FALSE;
- }
-
- return TRUE;
-}
-
-void drawx()
-{
- // g_thread_create(get_input, NULL, FALSE, NULL);
- int rows, cols;
- getmaxyx(stdscr, rows, cols);
-
- fprintf(stderr, "%d", rows/2);
-
- mvhline(rows/2, 0, ACS_HLINE , cols);
- draw_message("Connecting...");
- //advance_version();
- refresh();
-
- GMainContext *cont = g_main_context_new();
- GMainLoop *loop = g_main_loop_new(cont, FALSE);
-
- GSource *frame = g_timeout_source_new(3);
- GSource *state = g_timeout_source_new(100);
- GSource *stopper = g_timeout_source_new(200);
-
- void *blubb = malloc(sizeof(GMainLoop*)+sizeof(GSource*));
- blubb = loop;
- ((int*)blubb)[1] = stopper;
-
- g_source_set_callback(frame, draw_animation ,blubb, NULL);
- g_source_attach(frame, g_main_loop_get_context(loop));
-
- g_main_loop_run(loop);
-}
-
-
-void draw_splash()
-{
- drawx();
-}
-
-//int draw_frame
diff --git a/src/splash.h b/src/splash.h
deleted file mode 100644
index dbc7a3e9f..000000000
--- a/src/splash.h
+++ /dev/null
@@ -1 +0,0 @@
-void draw_splash();