public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "José María Alonso" <nimiux@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/conf-update:master commit in: /
Date: Sun,  5 Feb 2012 18:50:39 +0000 (UTC)	[thread overview]
Message-ID: <3a660867801a31659255a1a7a51ac4aa53ced1ce.nimiux@gentoo> (raw)

commit:     3a660867801a31659255a1a7a51ac4aa53ced1ce
Author:     José María Alonso <nimiux.gentoo.org>
AuthorDate: Sun Feb  5 18:48:41 2012 +0000
Commit:     José María Alonso <nimiux <AT> gentoo <DOT> org>
CommitDate: Sun Feb  5 18:48:41 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/conf-update.git;a=commit;h=3a660867

Keys alphabetically ordered

---
 conf-update.c |  125 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 64 insertions(+), 61 deletions(-)

diff --git a/conf-update.c b/conf-update.c
index 5143500..009f566 100644
--- a/conf-update.c
+++ b/conf-update.c
@@ -192,28 +192,6 @@ int main(int argc, char **argv) {
 	menu_changed = FALSE;
 	while ((item_count(mymenu) > 1) && (c = wgetch(inner)) != 'q' && c != 'Q') {
 		switch(c) {
-			// navigation 1up/down
-			case KEY_DOWN:
-				menu_driver(mymenu, REQ_DOWN_ITEM);
-				break;
-			case KEY_UP:
-				menu_driver(mymenu, REQ_UP_ITEM);
-				break;
-			//navigation 1 page up/down
-			case KEY_PPAGE:
-				menu_driver(mymenu, REQ_SCR_UPAGE);
-				break;
-			case KEY_NPAGE:
-				menu_driver(mymenu, REQ_SCR_DPAGE);
-				break;
-			// navigation top/bottom
-			case KEY_HOME:
-				menu_driver(mymenu, REQ_FIRST_ITEM);
-				break;
-			case KEY_END:
-				menu_driver(mymenu, REQ_LAST_ITEM);
-				break;
-			
 			// select single
 			case ' ':
 				if ((strrchr(item_name(current_item(mymenu)), '/'))) {
@@ -256,26 +234,28 @@ int main(int argc, char **argv) {
 				}
 				menu_driver(mymenu, REQ_FIRST_ITEM);
 				break;
-			// deselect all
-			case 'u':
-			case 'U':
-				menu_driver(mymenu, REQ_LAST_ITEM);
+			// delete update
+			case 'd':
+			case 'D':
+				firstrun = config.check_actions;
+				doit = TRUE;
 				for (i=0;i<item_count(mymenu);i++) {
-					menu_driver(mymenu, REQ_UP_ITEM);
-					set_item_value(current_item(mymenu), FALSE);
-				}
-				menu_driver(mymenu, REQ_FIRST_ITEM);
-				break;
-			// disp diff
-			case '\n':
-			case KEY_ENTER:
-				if (item_userptr(current_item(mymenu))) {
-					endwin();
-					int ret = show_diff(*((char **)item_userptr(current_item(mymenu))));
-					if (!ret) {
-						fprintf(stderr, "show_diff failed with error code: %d\n", ret);
+					if (item_value(items_list[i]) == TRUE || (current_item(mymenu) == items_list[i] && item_userptr(items_list[i]))) {
+						if (firstrun) {
+							doit = get_confirmation(inner, "delete");
+							firstrun = false;
+						}
+						if (doit) {
+							myupdate = (char **)item_userptr(items_list[i]);
+							exit_error(!unlink(*(myupdate)), *(myupdate));
+							removed_updates_ct++;
+							removed_updates_report = (char**)realloc(removed_updates_report, removed_updates_ct * sizeof(char *));
+							removed_updates_report[removed_updates_ct-1] = get_real_filename(*myupdate);
+							free(*myupdate);
+							*myupdate = SKIP_ENTRY;
+							menu_changed = TRUE;
+						}
 					}
-					reset_prog_mode();
 				}
 				break;
 			// edit update
@@ -290,6 +270,16 @@ int main(int argc, char **argv) {
 					reset_prog_mode();
 				}
 				break;
+			// down 
+			case KEY_DOWN:
+			case 'j':
+				menu_driver(mymenu, REQ_DOWN_ITEM);
+				break;
+			// up
+			case KEY_UP:
+			case 'k':
+				menu_driver(mymenu, REQ_UP_ITEM);
+				break;
 			// merge interactively
 			case 'm':
 			case 'M':
@@ -300,7 +290,6 @@ int main(int argc, char **argv) {
 					menu_changed = TRUE;
 				}
 				break;
-				
 			// merge/replace update
 			case 'r':
 			case 'R':
@@ -330,28 +319,42 @@ int main(int argc, char **argv) {
 					}
 				}
 				break;
-			// delete update
-			case 'd':
-			case 'D':
-				firstrun = config.check_actions;
-				doit = TRUE;
+			// deselect all
+			case 'u':
+			case 'U':
+				menu_driver(mymenu, REQ_LAST_ITEM);
 				for (i=0;i<item_count(mymenu);i++) {
-					if (item_value(items_list[i]) == TRUE || (current_item(mymenu) == items_list[i] && item_userptr(items_list[i]))) {
-						if (firstrun) {
-							doit = get_confirmation(inner, "delete");
-							firstrun = false;
-						}
-						if (doit) {
-							myupdate = (char **)item_userptr(items_list[i]);
-							exit_error(!unlink(*(myupdate)), *(myupdate));
-							removed_updates_ct++;
-							removed_updates_report = (char**)realloc(removed_updates_report, removed_updates_ct * sizeof(char *));
-							removed_updates_report[removed_updates_ct-1] = get_real_filename(*myupdate);
-							free(*myupdate);
-							*myupdate = SKIP_ENTRY;
-							menu_changed = TRUE;
-						}
+					menu_driver(mymenu, REQ_UP_ITEM);
+					set_item_value(current_item(mymenu), FALSE);
+				}
+				menu_driver(mymenu, REQ_FIRST_ITEM);
+				break;
+			// page up
+			case KEY_PPAGE:
+				menu_driver(mymenu, REQ_SCR_UPAGE);
+				break;
+			// page down 
+			case KEY_NPAGE:
+				menu_driver(mymenu, REQ_SCR_DPAGE);
+				break;
+			// top
+			case KEY_HOME:
+				menu_driver(mymenu, REQ_FIRST_ITEM);
+				break;
+			// bottom
+			case KEY_END:
+				menu_driver(mymenu, REQ_LAST_ITEM);
+				break;
+			// show differences
+			case '\n':
+			case KEY_ENTER:
+				if (item_userptr(current_item(mymenu))) {
+					endwin();
+					int ret = show_diff(*((char **)item_userptr(current_item(mymenu))));
+					if (!ret) {
+						fprintf(stderr, "show_diff failed with error code: %d\n", ret);
 					}
+					reset_prog_mode();
 				}
 				break;
 			case KEY_RESIZE:



             reply	other threads:[~2012-02-05 18:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-05 18:50 José María Alonso [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-08-29 11:33 [gentoo-commits] proj/conf-update:master commit in: / José María Alonso
2012-02-06 10:42 José María Alonso
2012-02-05 23:13 José María Alonso
2012-02-05 20:35 José María Alonso
2012-02-05 18:38 José María Alonso
2012-02-05 18:28 José María Alonso
2012-02-04 17:15 José María Alonso

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=3a660867801a31659255a1a7a51ac4aa53ced1ce.nimiux@gentoo \
    --to=nimiux@gentoo.org \
    --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