Skip to content

Commit

Permalink
add option "show-server-address", disabled by default
Browse files Browse the repository at this point in the history
Closes #151
  • Loading branch information
MaxKellermann committed Jan 1, 2025
1 parent 3dda9ce commit 74260bf
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ ncmpc 0.52 - not yet released
* fix searching on Help and Song page
* fix scroll bug after resizing window
* do not overwrite time/bitrate with song text in status bar
* add option "show-server-address", disabled by default
* build: require Meson 1.0

ncmpc 0.51 - (2024-09-23)
Expand Down
3 changes: 3 additions & 0 deletions doc/config.sample
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
## Show a title bar at the top of the screen
#show-title-bar = yes

## Show the server address at the top
#show-server-address = no

## Show a list of the screens in the top line.
#welcome-screen-list = yes

Expand Down
4 changes: 4 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ Interface

:command:`show-title-bar = yes|no` - "no" allows hiding the title bar.

:command:`show-server-address = yes|no` - "yes" shows the server
address in the title bar. This is disabled by default because most
people use only one MPD instance.

:command:`enable-mouse = yes|no` - Enable mouse support (if enabled at compile time).

:command:`screen-list = SCREEN1 SCREEN2...` - A list of screens to
Expand Down
2 changes: 2 additions & 0 deletions src/ConfigParser.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@ parse_line(char *line)
parse_key_definition(value);
else if (StringIsEqualIgnoreCase("show-title-bar", name))
options.show_title_bar = str2bool(value);
else if (StringIsEqualIgnoreCase("show-server-address", name))
options.show_server_address = str2bool(value);
/* enable colors */
else if(StringIsEqualIgnoreCase(CONF_ENABLE_COLORS, name))
#ifdef ENABLE_COLORS
Expand Down
1 change: 1 addition & 0 deletions src/Options.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct Options {
#endif

bool show_title_bar = true;
bool show_server_address = false;

bool auto_center = false;

Expand Down
2 changes: 1 addition & 1 deletion src/QueuePage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ QueuePage::OnClose() noexcept
std::string_view
QueuePage::GetTitle(std::span<char> buffer) const noexcept
{
if (connection_name.empty())
if (connection_name.empty() || !options.show_server_address)
return _("Queue");

return SPrintf(buffer, _("Queue on %s"), connection_name.c_str());
Expand Down

0 comments on commit 74260bf

Please sign in to comment.