From 9731277786628569d860466c666cd013c2b88b56 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 25 Jun 2001 05:48:38 +0000 Subject: [PATCH] * choose.cc (set_action): Only clear srcpicked when moving to next state. Allow source installation if it exists in the current "trust" state. Don't move to skip state when package is installed. (list_click): Don't allow source clicking when no source is available. (set_full_list): Display package when not is_full_action. * ini.h (is_full_action): Define. --- ChangeLog | 9 +++++++++ choose.cc | 28 +++++++++++++++++++--------- ini.h | 4 ++++ 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62cca39f..9ad306e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Mon Jun 25 00:56:37 2001 Christopher Faylor + + * choose.cc (set_action): Only clear srcpicked when moving to next state. + Allow source installation if it exists in the current "trust" state. + Don't move to skip state when package is installed. + (list_click): Don't allow source clicking when no source is available. + (set_full_list): Display package when not is_full_action. + * ini.h (is_full_action): Define. + Sun Jun 17 12:06:14 2001 Christopher Faylor * install.cc (check_for_old_cygwin): New function. First stab at diff --git a/choose.cc b/choose.cc index ba7b65c4..170dd3d6 100644 --- a/choose.cc +++ b/choose.cc @@ -100,9 +100,11 @@ isinstalled (Package *pkg, int trust) static void set_action (Package *pkg, bool preinc) { - pkg->srcpicked = 0; if (!pkg->action || preinc) - ((int) pkg->action)++; + { + ((int) pkg->action)++; + pkg->srcpicked = 0; + } /* Exercise the action state machine. */ for (;; ((int) pkg->action)++) @@ -145,21 +147,28 @@ set_action (Package *pkg, bool preinc) case ACTION_UNINSTALL: if (pkg->installed) return; + break; case ACTION_REDO: - if (pkg->installed) + if (pkg->installed && pkg->info[pkg->installed_ix].install_exists) { pkg->trust = pkg->installed_ix; return; } + break; case ACTION_SRC_ONLY: - if (pkg->installed && pkg->installed->source_exists) - return; + if (pkg->info[pkg->trust].source_exists) + { + pkg->srcpicked = 1; + return; + } break; case ACTION_SAME_LAST: pkg->action = ACTION_SKIP; /* Fall through intentionally */ case ACTION_SKIP: - return; + if (!pkg->installed || !pkg->info[pkg->installed_ix].install_exists) + return; + break; default: log (0, "should never get here %d\n", pkg->action); } @@ -370,7 +379,8 @@ list_click (HWND hwnd, BOOL dblclk, int x, int y, UINT hitCode) if (x >= headers[NEW_COL].x - (HMARGIN / 2) && x <= headers[NEW_COL + 1].x - HMARGIN/2) set_action (pkg, 1); - if (x >= headers[SRC_COL].x - HMARGIN/2 && x <= headers[SRC_COL + 1].x - HMARGIN/2) + if (pkg->info[pkg->trust].source_exists && + x >= headers[SRC_COL].x - HMARGIN/2 && x <= headers[SRC_COL + 1].x - HMARGIN/2) pkg->srcpicked ^= 1; RECT rect; @@ -504,7 +514,7 @@ set_full_list (HWND h, int isfull) if (!pkg->exclude) { set_action (pkg, 0); - if ((isfull || is_download_action (pkg))) + if (isfull || !is_full_action (pkg)) package_indexes[nindexes++] = pkg - package; } @@ -983,7 +993,7 @@ do_choose (HINSTANCE h) (pkg->info[t].install_exists) ? "yes":"no", pkg->info[t].source ?: "(none)", pkg->info[t].source_size, - (pkg->info[t].source_exists == 1) ? "yes":"no"); + (pkg->info[t].source_exists == 1) ? "yes" : "no"); } } } diff --git a/ini.h b/ini.h index c50773cf..730935c5 100644 --- a/ini.h +++ b/ini.h @@ -79,6 +79,10 @@ typedef enum (pkg)->action == ACTION_PREV || \ (pkg)->action == ACTION_UNINSTALL) +#define is_full_action(pkg) \ + (((pkg)->action >= ACTION_SAME_PREV && (pkg)->action <= ACTION_SAME_TEST) \ + || (pkg)->action == ACTION_SKIP) + #define SRCACTION_NO 0 #define SRCACTION_YES 1 typedef struct _Info -- 2.43.5