| Commit message (Collapse) | Author | Files | Lines |
|
Return true/false instead of 1/0.
|
|
Don't repaint the screen after browser_cmd() if another screen has
been selected meanwhile.
|
|
All functions must receive UTF-8 file names. Delete all which still
work with locale strings, and remove the _utf8 suffix from the others.
|
|
Don't convert the character set of strings to and from the current
locale. This library cannot know what the strings are going to be
used for, so it should not mess with them.
|
|
When compiling with libncursesw, include <ncursesw/ncurses.h> instead
of <ncurses.h> (if available).
|
|
screen_t is a singleton. We do not have to pass it around
everywhere. Export the one global variable.
|
|
None of the paint() implementations acutally uses the mpdclient
pointer. Remove it from the method signature.
|
|
The artist screen shouldn't be marked "experimental" anymore.
Describe the current state of the screen in the title, instead of
always writing "Artist".
|
|
We do not need to save a stack of list window states. When we return
to a parent directory, we just have to find the directory which we
come from in the parent list. Note that this patch resets the cursor
when going to the root directory, but I think it's not that important,
and I will deal with that later.
|
|
The variable "album" was set to _("All tracks") when it was empty.
When reloading the songs, ncmpc was trying to find an album named "All
tracks", which didn't seem to work. Leave "album" in its canonical
form and generate the title text on demand.
|
|
Move everything which deals with UTF-8 strings and character set
conversion to charset.c, header charset.h.
|
|
Don't make everybody include ncmpc.h just to have generic features.
Move generic i18n macros to a separate header.
|
|
gdb is for debugging. We don't need D() calls littered all over.
|
|
Merge a lot of code from the 3 browser screen into browser_cmd().
|
|
By calling artist_lw_cmd() after the big switch, we can override
behaviour, and we can modify the command.
|
|
artist_repaint() calls wrefresh(), don't call it again after
that.
|
|
"metalist" can have different meanings, depending on the mode.
Replace it with two separate variables "artist_list" and "album_list".
This way, we can optimize screen updates later.
|
|
Replaced update_metalist() with three specialized functions for mode
switching.
|
|
Some callers of update_metalist() want to reload the list contents.
Add an optimized function reload_lists() which does not modify the
global variables "mode", "artist", "album".
|
|
Moved special cases for loading artist, album, song lists to separate
functions.
|
|
A linked list is quite uncomfortable here because there is a lot of
indexed access to the list. Use a GPtrArray of strings instead.
Note that mpdclient_get_artists_utf8() and mpdclient_get_albums_utf8()
return a linked list, and sorting is also performed on the linked
list. This will be optimized later.
|
|
Generate these special list entries on the fly.
|
|
To unify the code, wrap list_window_cmd() in artist_lw_cmd(), which
properly checks the current mode.
|
|
CMD_ADD ('a') appends a song to the playlist, no matter if it is
already there, i.e. unlike CMD_SELECT, it does not toggle the song.
|
|
Screen code shouldn't know anything about the screen ids (which will
be eliminated completely later). Instead of comparing ids, compare
the screen_functions pointer.
|
|
Instead of evaluating macros from config.h in the disabled source,
don't start the compiler on it at all.
|
|
Since all screen updating is now on demand, we don't need this flag
anymore.
|
|
Repaint the artist screen on demand. No need for the update() method
anymore.
|
|
None of the paint() implementations actually use the screen pointer -
remove it from the method signature.
|
|
screen_paint() and screen_update() are responsible for refreshing the
screen. We can remove all wrefresh() and wnoutrefresh() invocations
from all paint() and update() method implementations.
|
|
Without clearing previous screen contents, there may be corruptions,
make this mandatory and optimize screen clearing.
|
|
Follow the same code style als MPD itself.
|
|
Since screen.c has default code for CMD_SCREEN_UPDATE, return 0 from
the command handlers and let screen.c do the rest.
|
|
Several screens ignore the attribute list_window->repaint. Don't set
it there. It will be replaced with a more intelligent repaint
algorithm later.
|
|
There are several places where browser.filelist can become NULL.
Catch that everywhere and generate an empty filelist in this case.
|
|
Don't try to call add_query() with no valid selection, this causes a
segfault. This usually happens when ncmpc isn't connected.
|
|
Avoid direct accesses to the filelist struct, provide an API for that.
|
|
The separate filelist library does not depend on mpdclient, so the
prefix is superfluous.
|
|
Merge code from all 3 browser screens into one generic browser
function.
|
|
Isolate the generic browser code from the directory browser.
|
|
We are going to separate the browser functions from screen_file.c.
Move all variables which are going to be needed by this code.
|
|
|
|
Declaring empty methods is of no use. If a method is empty, we should
set it to NULL in the screen_functions struct.
|
|
Unfortunately when I fixed the GCC warnings and refactored lots of the
code, the "artist" screen was disabled. This patch applies all API
changes and fixes all warnings.
|
|
Follow the same code style als MPD itself.
|
|
Since the list_window code sets highlight to 0 before it calls the
list_callback, the callback itself doesn't have to reset the flag.
|
|
Compile time initialization saves resources, compared to run-time
initialization. Declare all screen_function structs as global
variables, and remove all get functions.
|
|
A header should include all headers which he needs. Move local
includes on top, and let foo.c include foo.h in the first line, to
automatically test its dependencies.
|
|
Also remove some commented code and unused function parameters.
|
|
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@5041 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|