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 BB40D138827 for ; Sun, 3 Feb 2013 14:32:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5109321C07A; Sun, 3 Feb 2013 14:32:31 +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 D3A8121C06F for ; Sun, 3 Feb 2013 14:32:30 +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 AEEBA33DD7F for ; Sun, 3 Feb 2013 14:32:29 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 58B5DE4083 for ; Sun, 3 Feb 2013 14:32:28 +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: <1359901775.9c30fd54d7f7d47c85607a1955aa4ddb1a8b89c7.yamakuzure@gentoo> Subject: [gentoo-commits] proj/ufed:master commit in: / X-VCS-Repository: proj/ufed X-VCS-Files: ufed-curses-checklist.c X-VCS-Directories: / X-VCS-Committer: yamakuzure X-VCS-Committer-Name: Sven Eden X-VCS-Revision: 9c30fd54d7f7d47c85607a1955aa4ddb1a8b89c7 X-VCS-Branch: master Date: Sun, 3 Feb 2013 14:32:28 +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: 5733b037-bf54-4c69-9866-51e528f5519f X-Archives-Hash: e19793814a57eec77b263b0ce9f9fcd7 commit: 9c30fd54d7f7d47c85607a1955aa4ddb1a8b89c7 Author: Sven Eden gmx de> AuthorDate: Sun Feb 3 14:29:35 2013 +0000 Commit: Sven Eden gmx de> CommitDate: Sun Feb 3 14:29:35 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=9c30fd54 Moved function key detection and handling to flags callback() function. It is no longer possible to toggle filters while reading the help screen now. --- ufed-curses-checklist.c | 53 +++++++++++++++++++++++++++++++++++++++------- 1 files changed, 45 insertions(+), 8 deletions(-) diff --git a/ufed-curses-checklist.c b/ufed-curses-checklist.c index ac6c60f..a58d60c 100644 --- a/ufed-curses-checklist.c +++ b/ufed-curses-checklist.c @@ -39,14 +39,6 @@ static const sKey keys[] = { static void free_flags(void); -/* external members */ -eMask e_mask = eMask_unmasked; -eOrder e_order = eOrder_left; -eScope e_scope = eScope_all; -eState e_state = eState_all; -sListStats listStats = { 0, 0, 0, 0, 0, 0 }; -extern int bottomline, minwidth; - /* static functions */ static char *getline(FILE *fp) { @@ -427,6 +419,51 @@ static int callback(sFlag** curr, int key) wmove(wLst, (*curr)->currline, 2); wrefresh(wLst); break; + case KEY_F(5): + if (eMask_masked == e_mask) e_mask = eMask_unmasked; + else if (eMask_unmasked == e_mask) e_mask = eMask_both; + else e_mask = eMask_masked; + + if ( !isFlagLegal(*curr) + && !setNextItem(1, true) + && !setPrevItem(1, true) ) + resetDisplay(true); + else + draw(true); + + break; + + case KEY_F(6): + if (eScope_local == e_scope) e_scope = eScope_all; + else if (eScope_global == e_scope) e_scope = eScope_local; + else e_scope = eScope_global; + + if ( !isFlagLegal(*curr) + && !setNextItem(1, true) + && !setPrevItem(1, true) ) + resetDisplay(true); + else + draw(true); + break; + + case KEY_F(7): + if (eState_installed == e_state) e_state = eState_notinstalled; + else if (eState_notinstalled == e_state) e_state = eState_all; + else e_state = eState_installed; + + if ( !isFlagLegal(*curr) + && !setNextItem(1, true) + && !setPrevItem(1, true) ) + resetDisplay(true); + else + draw(true); + break; + + case KEY_F(8): + if (eOrder_left == e_order) e_order = eOrder_right; + else e_order = eOrder_left; + drawFlags(); + break; #ifdef NCURSES_MOUSE_VERSION case KEY_MOUSE: // Masked flags can be turned off, nothing else