Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to 'block' characters for bar graph display #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ case $host_os in
esac

dnl Checks for libraries.
AC_CHECK_LIB(ncurses, initscr)
AC_CHECK_LIB(ncursesw, initscr)
AC_CHECK_LIB(form, new_form)

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([limits.h stdlib.h string.h unistd.h curses.h form.h ncurses/form.h math.h sys/param.h sys/socket.h sys/time.h sys/ioctl.h arpa/inet.h netinet/in.h])

if test "$ac_cv_lib_ncurses_initscr" != "yes"; then
AC_MSG_ERROR([ncurses library not found. ncurses is required for $PACKAGE_NAME.])
if test "$ac_cv_lib_ncursesw_initscr" != "yes"; then
AC_MSG_ERROR([ncursesw library not found. ncursesw is required for $PACKAGE_NAME.])
fi
if test "$ac_cv_header_curses_h" != "yes"; then
AC_MSG_ERROR([ncurses development files not found. ncurses is required for $PACKAGE_NAME.])
Expand Down
6 changes: 3 additions & 3 deletions src/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ void Graph::print(Window& window, int x, int y)
unsigned long long restOfTraffic = *r - lowerLimit;

if(restOfTraffic >= trafficPerLine)
window.print('#');
window.print("█");
else if(restOfTraffic >= trafficPerLine * 7 / 10)
window.print('|');
window.print("▟");
else if(restOfTraffic >= trafficPerLine * 3 / 10)
window.print('.');
window.print("▗");
else
window.print(' ');
}
Expand Down
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <vector>

#include <signal.h>
#include <locale.h>

using namespace std;

Expand All @@ -35,6 +36,7 @@ static void signalHandler(int signal);

int main(int argc, char *argv[])
{
setlocale(LC_ALL, "");
App application;
m_application = &application;

Expand Down