summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2013-09-09 16:55:18 +0200
committerSven Eden <yamakuzure@gmx.net>2013-09-09 16:55:18 +0200
commitb474c18106323db3d7dfe867c7598defe3f2ddd9 (patch)
tree70f8dbbb7aa826a44f040a63320a9bbc57cc1925 /ufed-curses.c
parentThe warning issued when make.conf is not writable is now prefixed with a "WAR... (diff)
downloadufed-b474c18106323db3d7dfe867c7598defe3f2ddd9.tar.gz
ufed-b474c18106323db3d7dfe867c7598defe3f2ddd9.tar.bz2
ufed-b474c18106323db3d7dfe867c7598defe3f2ddd9.zip
Added prefixing of predefined configuration values and added read-only-mode as the first in use. When read-only-mode is set, the interface now changes both header lines to other colors and to show the user that flags are not saved.
Diffstat (limited to 'ufed-curses.c')
-rw-r--r--ufed-curses.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/ufed-curses.c b/ufed-curses.c
index 1948f99..6870e66 100644
--- a/ufed-curses.c
+++ b/ufed-curses.c
@@ -339,8 +339,14 @@ void drawTop(bool withSep)
WINDOW* w = win(Top);
char buf[COLS + 1];
- wattrset(w, COLOR_PAIR(1) | A_BOLD);
- sprintf(buf, "%-*.*s", wWidth(Top), wWidth(Top), "Gentoo USE flags editor " PACKAGE_VERSION);
+ if (ro_mode) {
+ wattrset(w, COLOR_PAIR(4) | A_BOLD | A_REVERSE);
+ sprintf(buf, "%-*.*s", wWidth(Top), wWidth(Top),
+ "(RO) Gentoo USE flags editor " PACKAGE_VERSION " (RO)");
+ } else {
+ wattrset(w, COLOR_PAIR(1) | A_BOLD);
+ sprintf(buf, "%-*.*s", wWidth(Top), wWidth(Top), "Gentoo USE flags editor " PACKAGE_VERSION);
+ }
mvwaddstr(w, 0, 0, buf);
/// REMOVEME: Stop wasting space
@@ -352,8 +358,13 @@ void drawTop(bool withSep)
mvwaddch(w, 1, wWidth(Top)-1, ACS_URCORNER);
waddch(w, ACS_VLINE);
- wattrset(w, COLOR_PAIR(3));
- sprintf(buf, " %-*.*s ", wWidth(Top)-4, wWidth(Top)-4, subtitle);
+ if (ro_mode) {
+ wattrset(w, COLOR_PAIR(4) | A_REVERSE);
+ sprintf(buf, " READ-ONLY MODE! %-*.*s READ-ONLY MODE! ", wWidth(Top)-36, wWidth(Top)-36, subtitle);
+ } else {
+ wattrset(w, COLOR_PAIR(3));
+ sprintf(buf, " %-*.*s ", wWidth(Top)-4, wWidth(Top)-4, subtitle);
+ }
waddstr(w, buf);
wattrset(w, COLOR_PAIR(2) | A_BOLD);
waddch(w, ACS_VLINE);