summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2013-09-10 07:16:08 +0200
committerSven Eden <yamakuzure@gmx.net>2013-09-10 07:16:08 +0200
commit456a9d34fff548856cc1876253ca66db9abd0898 (patch)
tree0219e86d002728a5c7d127993628816f6f2bd929
parentPortage.pm: When scanning a make.conf directory, only skip files beginning wi... (diff)
downloadufed-456a9d34fff548856cc1876253ca66db9abd0898.tar.gz
ufed-456a9d34fff548856cc1876253ca66db9abd0898.tar.bz2
ufed-456a9d34fff548856cc1876253ca66db9abd0898.zip
Made the subtitle more descriptive presenting a possible read-only mode
-rw-r--r--ufed-curses-checklist.c6
-rw-r--r--ufed-curses.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/ufed-curses-checklist.c b/ufed-curses-checklist.c
index 4a12968..1586263 100644
--- a/ufed-curses-checklist.c
+++ b/ufed-curses-checklist.c
@@ -613,7 +613,9 @@ static int callback(sFlag** curr, int key)
int main(void)
{
- int result;
+ int result = EXIT_SUCCESS;
+ const char subtitle_ro[] = "USE flags can be browsed, but changes will NOT be saved!";
+ const char subtitle_rw[] = "Select desired USE flags from the list below:";
read_flags();
fayt = (char*) calloc(minwidth, sizeof(*fayt));
@@ -625,7 +627,7 @@ int main(void)
initcurses();
- result = maineventloop("Select desired USE flags from the list below:",
+ result = maineventloop(ro_mode ? subtitle_ro : subtitle_rw,
&callback, &drawflag, flags, keys, true);
cursesdone();
diff --git a/ufed-curses.c b/ufed-curses.c
index 6870e66..1c1970b 100644
--- a/ufed-curses.c
+++ b/ufed-curses.c
@@ -341,8 +341,8 @@ void drawTop(bool withSep)
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)");
+ sprintf(buf, " READ ONLY %-*.*s READ ONLY ", wWidth(Top) - 22, wWidth(Top) - 22,
+ "Gentoo USE flags editor " PACKAGE_VERSION);
} else {
wattrset(w, COLOR_PAIR(1) | A_BOLD);
sprintf(buf, "%-*.*s", wWidth(Top), wWidth(Top), "Gentoo USE flags editor " PACKAGE_VERSION);
@@ -360,7 +360,7 @@ void drawTop(bool withSep)
waddch(w, ACS_VLINE);
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);
+ sprintf(buf, " READ ONLY %-*.*s READ ONLY ", wWidth(Top)-24, wWidth(Top)-24, subtitle);
} else {
wattrset(w, COLOR_PAIR(3));
sprintf(buf, " %-*.*s ", wWidth(Top)-4, wWidth(Top)-4, subtitle);