From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 416721387D9 for ; Fri, 1 Feb 2013 21:12:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 880FE21C002; Fri, 1 Feb 2013 21:12:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CA75DE0508 for ; Fri, 1 Feb 2013 21:12:49 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A33FD33DCDF for ; Fri, 1 Feb 2013 21:12:48 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 1A694E4089 for ; Fri, 1 Feb 2013 21:12:47 +0000 (UTC) From: "Sven Eden" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Eden" Message-ID: <1359744407.fcb4e95407255f3191e2bafe8710ab0c1a6a69ea.yamakuzure@gentoo> Subject: [gentoo-commits] proj/ufed:master commit in: / X-VCS-Repository: proj/ufed X-VCS-Files: ufed-curses-checklist.c ufed-curses.c X-VCS-Directories: / X-VCS-Committer: yamakuzure X-VCS-Committer-Name: Sven Eden X-VCS-Revision: fcb4e95407255f3191e2bafe8710ab0c1a6a69ea X-VCS-Branch: master Date: Fri, 1 Feb 2013 21:12:47 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: bc8e6279-abae-4cd7-a42c-7e42a19687e7 X-Archives-Hash: d4666e12b87c80a390fde028289852e8 commit: fcb4e95407255f3191e2bafe8710ab0c1a6a69ea Author: Sven Eden gmx de> AuthorDate: Fri Feb 1 18:46:47 2013 +0000 Commit: Sven Eden gmx 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, ' ');