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 471AE1389C0 for ; Tue, 12 Feb 2013 09:01:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A3BDD21C082; Tue, 12 Feb 2013 09:01:34 +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 D8A4221C082 for ; Tue, 12 Feb 2013 09:01:28 +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 C19BA33E6A0 for ; Tue, 12 Feb 2013 09:01:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id C14EEE4099 for ; Tue, 12 Feb 2013 09:01:18 +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: <1360574233.e4c3b690bd7e9a4b28fb59da05e54c8c75961664.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: e4c3b690bd7e9a4b28fb59da05e54c8c75961664 X-VCS-Branch: master Date: Tue, 12 Feb 2013 09:01:18 +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: 11a87264-3d8a-43d9-96bb-067dbf311411 X-Archives-Hash: 9ba7adc7c84d39d504b5ffcf6c8b176e commit: e4c3b690bd7e9a4b28fb59da05e54c8c75961664 Author: Sven Eden gmx de> AuthorDate: Mon Feb 11 09:17:08 2013 +0000 Commit: Sven Eden gmx de> CommitDate: Mon Feb 11 09:17:13 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=e4c3b690 Removed [M]asked column and updated display to the new column scheme. --- ufed-curses-checklist.c | 56 +++++++++++++++++++++++++++++++---------------- ufed-curses.c | 25 ++++++++++----------- 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/ufed-curses-checklist.c b/ufed-curses-checklist.c index a5baf44..934b92d 100644 --- a/ufed-curses-checklist.c +++ b/ufed-curses-checklist.c @@ -230,7 +230,7 @@ static int drawflag(sFlag* flag, bool highlight) if(idx < flag->ndesc) { WINDOW* wLst = win(List); int lHeight = wHeight(List); - int descLen = wWidth(List) - (minwidth + 9); + int descLen = wWidth(List) - (minwidth + 8); bool hasHead = false; char *p, special; @@ -241,9 +241,9 @@ static int drawflag(sFlag* flag, bool highlight) // Set special character if needed: if (isDescForced(flag, idx)) - special = 'F'; + special = 'f'; else if (isDescMasked(flag, idx)) - special = 'M'; + special = 'm'; else special = ' '; @@ -271,18 +271,17 @@ static int drawflag(sFlag* flag, bool highlight) /* Display flag state * The order in which the states are to be displayed is: - * 1. Masked/Forced special hint - * 2. make.defaults - * 3. package.use - * 4. make.conf - * 5. global/local - * 6. installed/not installed + * 1. [D]efaults (make.defaults, IUSE, package.mask, package.force) + * Note: Filled in later + * 2. [P]rofile package.use files + * 3. [C]onfiguration (make.conf, users package.use) + * 4. global/local + * 5. installed/not installed */ - sprintf(buf + minwidth, "%c %c%c%c %c%c ", - special, - flag->stateDefault, + sprintf(buf + minwidth, " %c%c %c%c ", flag->desc[idx].statePackage, - flag->stateConf, + ' ' == flag->desc[idx].statePkgUse ? + flag->stateConf : flag->desc[idx].statePkgUse, flag->desc[idx].isGlobal ? ' ' : 'L', flag->desc[idx].isInstalled ? 'i' : ' '); @@ -298,7 +297,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 + 9, "%-*.*s", descLen, descLen, + sprintf(buf + minwidth + 8, "%-*.*s", descLen, descLen, strlen(desc) > (size_t)descriptionleft ? &desc[descriptionleft] : ""); @@ -309,21 +308,40 @@ static int drawflag(sFlag* flag, bool highlight) else wattrset(wLst, COLOR_PAIR(3)); - // Finally put the line on the screen + // Put the line on the screen mvwaddstr(wLst, line, 0, buf); - mvwaddch(wLst, line, minwidth + 1, ACS_VLINE); // Before state - mvwaddch(wLst, line, minwidth + 5, ACS_VLINE); // Between state and scope - mvwaddch(wLst, line, minwidth + 8, ACS_VLINE); // After scope + mvwaddch(wLst, line, minwidth, ACS_VLINE); // Before state + mvwaddch(wLst, line, minwidth + 4, ACS_VLINE); // Between state and scope + mvwaddch(wLst, line, minwidth + 7, ACS_VLINE); // After scope + // Add (default) selection if this is the header line if (!hasHead) { hasHead = true; - if (' ' == flag->stateConf) { + if (flag->globalForced) { + wattrset(wLst, COLOR_PAIR(5) | A_BOLD); + mvwaddch(wLst, line, 2, '+'); + } else if (flag->globalMasked) { + wattrset(wLst, COLOR_PAIR(4) | A_BOLD); + mvwaddch(wLst, line, 2, '-'); + } else if (' ' == flag->stateConf) { wattrset(wLst, COLOR_PAIR(3) | A_BOLD); mvwaddch(wLst, line, 2, flag->stateDefault); } else mvwaddch(wLst, line, 2, flag->stateConf); } + // Add [D]efault column content + if ('f' == special) { + wattrset(wLst, COLOR_PAIR(5) | A_BOLD); + mvwaddch(wLst, line, minwidth + 1, special); + } else if ('m' == special) { + wattrset(wLst, COLOR_PAIR(4) | A_BOLD); + mvwaddch(wLst, line, minwidth + 1, special); + } else { + wattrset(wLst, COLOR_PAIR(3)); + mvwaddch(wLst, line, minwidth + 1, flag->stateDefault); + } + ++line; ++usedY; } diff --git a/ufed-curses.c b/ufed-curses.c index da47b66..e0eadfd 100644 --- a/ufed-curses.c +++ b/ufed-curses.c @@ -120,9 +120,9 @@ void drawBottom(bool withSep) waddch(w, ACS_LLCORNER); whline(w, ACS_HLINE, wWidth(Bottom)-6); if (withSep) { - 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, 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, wWidth(Bottom)-3, ACS_LRCORNER); waddch(w, ' '); @@ -283,15 +283,14 @@ void drawStatus(bool withSep) char buf[COLS+1]; // Add Status separators and explenation characters - 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 + mvwaddch (w, 0, minwidth , ACS_VLINE); // Before state + mvwaddstr(w, 0, minwidth + 1, "DPC"); // Default, Profile, Config + mvwaddch (w, 0, minwidth + 4, ACS_VLINE); // Between state and scope + mvwaddstr(w, 0, minwidth + 5, "Si"); // Scope, installed + mvwaddch (w, 0, minwidth + 7, ACS_VLINE); // After scope // Use the unused right side to show the filter status - sprintf(buf, "%-*s%-6s / %-6s / %-12s] ", + sprintf(buf, "%*s%-6s / %-6s / %-13s] ", max(2, iWidth - 40 - minwidth), " [", eMask_masked == e_mask ? "masked" : eMask_unmasked == e_mask ? "normal" : "all", @@ -345,9 +344,9 @@ void drawTop(bool withSep) waddch(w, ACS_ULCORNER); whline(w, ACS_HLINE, wWidth(Top)-6); if (withSep) { - 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, 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, wWidth(Top)-3, ACS_URCORNER); waddch(w, ' ');