public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sven Eden" <sven.eden@gmx.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/ufed:master commit in: /
Date: Fri,  1 Feb 2013 21:12:47 +0000 (UTC)	[thread overview]
Message-ID: <1359744407.fcb4e95407255f3191e2bafe8710ab0c1a6a69ea.yamakuzure@gentoo> (raw)

commit:     fcb4e95407255f3191e2bafe8710ab0c1a6a69ea
Author:     Sven Eden <sven.eden <AT> gmx <DOT> de>
AuthorDate: Fri Feb  1 18:46:47 2013 +0000
Commit:     Sven Eden <sven.eden <AT> gmx <DOT> de>
CommitDate: Fri Feb  1 18:46:47 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=fcb4e954

Added a new Char to show local Masked/Forced status.

---
 ufed-curses-checklist.c |   52 +++++++++++++++++++++++++++++-----------------
 ufed-curses.c           |   22 ++++++++++---------
 2 files changed, 45 insertions(+), 29 deletions(-)

diff --git a/ufed-curses-checklist.c b/ufed-curses-checklist.c
index c28a824..31a2294 100644
--- a/ufed-curses-checklist.c
+++ b/ufed-curses-checklist.c
@@ -233,13 +233,31 @@ static int drawflag(sFlag* flag, bool highlight)
 
 	// print descriptions according to filters
 	if(idx < flag->ndesc) {
-		int lHeight = wHeight(List);
+		int  lHeight = wHeight(List);
+		int  descLen = wWidth(List) - (minwidth + 9);
+		bool hasHead = false;
+		char special = ' ';
+		char *p;
 		for( ; (idx < flag->ndesc) && (line < lHeight); ++idx) {
 			// Continue if any of the filters apply:
 			if (!isDescLegal(flag, idx))
 				continue;
 
-			if (!buf[0]) {
+			// Set special character if needed:
+			if ( (flag->globalForced && ('-' != flag->desc[idx].stateForced))
+			  || isDescForced(flag, idx))
+				special = 'F';
+			else if ( (flag->globalMasked && ('-' != flag->desc[idx].stateMasked))
+				   || isDescMasked(flag, idx))
+				special = 'M';
+			else
+				special = ' ';
+
+			if (hasHead) {
+				// Add spaces under the flag display
+				for(p = buf; p != buf + minwidth; ++p)
+					*p = ' ';
+			} else {
 				/* print the selection, name and state of the flag */
 				char prefix[2]  = { 0, 0 };
 				char postfix[2] = { 0, 0 };
@@ -263,17 +281,20 @@ static int drawflag(sFlag* flag, bool highlight)
 					/* distance */
 					(int)(minwidth - postlen - strlen(flag->name)), " ");
 					// At this point buf is filled up to minwidth
+				hasHead = true;
 			} // End of generating left side mask display
 
 			/* Display flag state
 			 * The order in which the states are to be displayed is:
-			 * 1. make.defaults
-			 * 2. package.use
-			 * 3. make.conf
-			 * 4. global/local
-			 * 5. installed/not installed
+			 * 1. Masked/Forced special hint
+			 * 2. make.defaults
+			 * 3. package.use
+			 * 4. make.conf
+			 * 5. global/local
+			 * 6. installed/not installed
 			 */
-			sprintf(buf + minwidth, " %c%c%c %c%c ",
+			sprintf(buf + minwidth, "%c %c%c%c %c%c ",
+				special,
 				flag->stateDefault,
 				flag->desc[idx].statePackage,
 				flag->stateConf,
@@ -292,9 +313,7 @@ static int drawflag(sFlag* flag, bool highlight)
 				sprintf(desc, "%s", flag->desc[idx].desc);
 
 			// Now display the description line according to its horizontal position
-			sprintf(buf + minwidth + 8, "%-*.*s",
-				wWidth(List)-minwidth - 8,
-				wWidth(List)-minwidth - 8,
+			sprintf(buf + minwidth + 9, "%-*.*s", descLen, descLen,
 				strlen(desc) > (size_t)descriptionleft
 					? &desc[descriptionleft]
 					: "");
@@ -307,16 +326,11 @@ static int drawflag(sFlag* flag, bool highlight)
 
 			// Finally put the line on the screen
 			mvwaddstr(win(List), line, 0, buf);
-			mvwaddch(win(List), line, minwidth,     ACS_VLINE); // Before state
-			mvwaddch(win(List), line, minwidth + 4, ACS_VLINE); // Between state and scope
-			mvwaddch(win(List), line, minwidth + 7, ACS_VLINE); // After scope
+			mvwaddch(win(List), line, minwidth + 1, ACS_VLINE); // Before state
+			mvwaddch(win(List), line, minwidth + 5, ACS_VLINE); // Between state and scope
+			mvwaddch(win(List), line, minwidth + 8, ACS_VLINE); // After scope
 			++line;
 			++usedY;
-			if(((idx + 1) < flag->ndesc) && (line < lHeight) ) {
-				char *p;
-				for(p = buf; p != buf + minwidth; p++)
-					*p = ' ';
-			}
 		}
 	} else {
 		memset(buf+minwidth, ' ', wWidth(List)-minwidth);

diff --git a/ufed-curses.c b/ufed-curses.c
index d14cd38..0c3fd56 100644
--- a/ufed-curses.c
+++ b/ufed-curses.c
@@ -141,9 +141,9 @@ void drawBottom(bool withSep)
 	waddch(w, ACS_LLCORNER);
 	whline(w, ACS_HLINE, wWidth(Bottom)-6);
 	if (withSep) {
-		mvwaddch(w, 0, minwidth + 3, ACS_BTEE); // Before state
-		mvwaddch(w, 0, minwidth + 7, ACS_BTEE); // Between state and scope
-		mvwaddch(w, 0, minwidth + 10, ACS_BTEE); // After scope
+		mvwaddch(w, 0, minwidth + 4, ACS_BTEE); // Before state
+		mvwaddch(w, 0, minwidth + 8, ACS_BTEE); // Between state and scope
+		mvwaddch(w, 0, minwidth + 11, ACS_BTEE); // After scope
 	}
 	mvwaddch(w, 0, wWidth(Bottom)-3, ACS_LRCORNER);
 	waddch(w, ' ');
@@ -304,10 +304,12 @@ void drawStatus(bool withSep)
 		char buf[COLS+1];
 
 		// Add Status separators and explenation characters
-		mvwaddstr(w, 0, minwidth, " DPC Si");
-		mvwaddch(w, 0, minwidth,     ACS_VLINE); // Before state
-		mvwaddch(w, 0, minwidth + 4, ACS_VLINE); // Between state and scope
-		mvwaddch(w, 0, minwidth + 7, ACS_VLINE); // After scope
+		mvwaddch (w, 0, minwidth,     'M');       // Masked / Forced
+		mvwaddch (w, 0, minwidth + 1, ACS_VLINE); // Before state
+		mvwaddstr(w, 0, minwidth + 2, "DPC");     // Default, Package, Config
+		mvwaddch (w, 0, minwidth + 5, ACS_VLINE); // Between state and scope
+		mvwaddstr(w, 0, minwidth + 6, "Si");      // Scope, installed
+		mvwaddch (w, 0, minwidth + 8, ACS_VLINE); // After scope
 
 		// Use the unused right side to show the filter status
 		sprintf(buf, "%-*s%-6s / %-6s / %-12s] ",
@@ -364,9 +366,9 @@ void drawTop(bool withSep)
 	waddch(w, ACS_ULCORNER);
 	whline(w, ACS_HLINE, wWidth(Top)-6);
 	if (withSep) {
-		mvwaddch(w, 4, minwidth + 3, ACS_TTEE); // Before state
-		mvwaddch(w, 4, minwidth + 7, ACS_TTEE); // Between state and scope
-		mvwaddch(w, 4, minwidth + 10, ACS_TTEE); // After scope
+		mvwaddch(w, 4, minwidth + 4, ACS_TTEE); // Before state
+		mvwaddch(w, 4, minwidth + 8, ACS_TTEE); // Between state and scope
+		mvwaddch(w, 4, minwidth + 11, ACS_TTEE); // After scope
 	}
 	mvwaddch(w, 4, wWidth(Top)-3, ACS_URCORNER);
 	waddch(w, ' ');


             reply	other threads:[~2013-02-01 21:12 UTC|newest]

Thread overview: 238+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-01 21:12 Sven Eden [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-11-07 14:25 [gentoo-commits] proj/ufed:master commit in: / Sven Eden
2020-05-02  8:38 Ulrich Müller
2019-09-27  6:42 Sven Eden
2019-09-27  6:39 Sven Eden
2019-09-24 17:57 Sven Eden
2019-09-24 17:56 Sven Eden
2019-04-07 15:17 David Seifert
2019-04-07 13:56 David Seifert
2019-04-07 13:19 David Seifert
2019-04-07 13:19 David Seifert
2019-04-07 13:19 David Seifert
2019-04-07 13:19 David Seifert
2019-04-07 13:19 David Seifert
2015-02-12 15:47 Sven Eden
2015-02-11  9:03 Sven Eden
2014-11-10  9:59 Sven Eden
2014-10-28 11:43 Sven Eden
2014-02-26 10:26 Sven Eden
2014-02-26 10:26 Sven Eden
2014-02-26 10:26 Sven Eden
2014-02-26 10:26 Sven Eden
2014-02-26 10:26 Sven Eden
2014-02-26 10:26 Sven Eden
2014-02-25  8:18 Sven Eden
2014-02-25  8:18 Sven Eden
2014-02-25  8:18 Sven Eden
2014-02-25  8:18 Sven Eden
2013-11-25 21:43 Sven Eden
2013-11-25 21:43 Sven Eden
2013-11-25 21:43 Sven Eden
2013-11-25 21:43 Sven Eden
2013-11-25 21:43 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-20  8:30 Sven Eden
2013-09-11  7:09 Sven Eden
2013-09-11  6:31 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-11  6:04 Sven Eden
2013-09-10 12:37 Sven Eden
2013-09-10  6:36 Sven Eden
2013-09-10  6:36 Sven Eden
2013-09-10  6:36 Sven Eden
2013-09-10  6:36 Sven Eden
2013-09-10  6:36 Sven Eden
2013-09-10  6:36 Sven Eden
2013-09-10  6:36 Sven Eden
2013-07-22  9:34 Sven Eden
2013-07-22  6:09 Sven Eden
2013-07-22  6:09 Sven Eden
2013-04-09  7:22 Sven Eden
2013-04-09  7:22 Sven Eden
2013-04-09  7:22 Sven Eden
2013-04-08  7:18 Sven Eden
2013-04-03 13:39 Sven Eden
2013-03-05 16:53 Sven Eden
2013-03-05 16:49 Sven Eden
2013-03-05 16:49 Sven Eden
2013-03-05 16:49 Sven Eden
2013-03-05 16:49 Sven Eden
2013-03-05 16:49 Sven Eden
2013-02-21 10:02 Sven Eden
2013-02-19 15:16 Sven Eden
2013-02-19 13:34 Sven Eden
2013-02-18  7:22 Sven Eden
2013-02-15  8:36 Sven Eden
2013-02-15  8:36 Sven Eden
2013-02-15  8:36 Sven Eden
2013-02-14  8:35 Sven Eden
2013-02-14  8:35 Sven Eden
2013-02-14  8:35 Sven Eden
2013-02-13  9:23 Sven Eden
2013-02-13  9:23 Sven Eden
2013-02-13  9:23 Sven Eden
2013-02-13  9:23 Sven Eden
2013-02-13  9:23 Sven Eden
2013-02-12 10:51 Sven Eden
2013-02-12 10:51 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-12  9:01 Sven Eden
2013-02-06  9:09 Sven Eden
2013-02-06  9:09 Sven Eden
2013-02-05 18:06 Paul Varner
2013-02-05 13:53 Sven Eden
2013-02-05 13:53 Sven Eden
2013-02-05 11:24 Sven Eden
2013-02-03 14:32 Sven Eden
2013-02-03 14:32 Sven Eden
2013-02-03 14:32 Sven Eden
2013-02-03 14:32 Sven Eden
2013-02-03 14:32 Sven Eden
2013-02-02 20:49 Sven Eden
2013-02-02 10:11 Sven Eden
2013-02-02  9:47 Sven Eden
2013-02-02  9:47 Sven Eden
2013-02-02  9:47 Sven Eden
2013-02-01 21:12 Sven Eden
2013-02-01 21:12 Sven Eden
2013-02-01 16:04 Sven Eden
2013-02-01 15:55 Sven Eden
2013-02-01 15:26 Sven Eden
2013-02-01 14:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-01-24 10:15 Sven Eden
2013-01-24 10:15 Sven Eden
2013-01-24 10:15 Sven Eden
2013-01-24 10:15 Sven Eden
2013-01-24 10:15 Sven Eden
2013-01-23 14:44 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-16 13:43 Sven Eden
2013-01-16 12:56 Sven Eden
2013-01-16 12:56 Sven Eden
2013-01-16 12:56 Sven Eden
2013-01-16 12:56 Sven Eden
2013-01-16 12:56 Sven Eden
2013-01-16 12:56 Sven Eden
2013-01-08 11:02 Sven Eden
2013-01-02  8:47 Sven Eden
2013-01-02  8:01 Sven Eden
2013-01-02  8:01 Sven Eden
2012-11-20 17:31 Paul Varner
2012-11-20 17:25 Paul Varner
2012-10-23 16:13 Paul Varner
2012-10-23 16:13 Paul Varner
2012-10-23 16:13 Paul Varner
2012-10-23 16:01 Paul Varner
2012-10-22 20:42 Paul Varner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359744407.fcb4e95407255f3191e2bafe8710ab0c1a6a69ea.yamakuzure@gentoo \
    --to=sven.eden@gmx.de \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox