Index: choose.cc =================================================================== RCS file: /cvs/src/src/winsup/cinstall/choose.cc,v retrieving revision 2.11 diff -p -2 -r2.11 choose.cc *** choose.cc 2000/12/11 00:07:56 2.11 --- choose.cc 2001/02/08 03:11:49 *************** static char *cvsid = "\n%%% $Id: choose. *** 31,34 **** --- 31,35 ---- #include #include + #include #include *************** static char *cvsid = "\n%%% $Id: choose. *** 42,46 **** #include "find.h" ! #define HMARGIN 10 #define ROW_MARGIN 5 #define ICON_MARGIN 4 --- 43,49 ---- #include "find.h" ! #include "port.h" ! ! #define HMARGIN 10 #define ROW_MARGIN 5 #define ICON_MARGIN 4 *************** static int initialized = 0; *** 55,58 **** --- 58,62 ---- static int full_list = 0; + static int which_trust = TRUST_CURR; static int scroll_ulc_x, scroll_ulc_y; *************** paint (HWND hwnd) *** 181,184 **** --- 185,190 ---- { static char *msg = "Nothing to Install/Update"; + if (source == IDC_SOURCE_DOWNLOAD) + msg = "Nothing to Download"; TextOut (hdc, HMARGIN, header_height, msg, strlen (msg)); } *************** list_click (HWND hwnd, BOOL dblclk, int *** 281,284 **** --- 287,295 ---- { extra[p].pick ++; + while ((package[p].info[extra[p].chooser[extra[p].pick].trust].install_exists==0 && + source == IDC_SOURCE_CWD) && + package[p].info[extra[p].chooser[extra[p].pick].trust].install && + extra[p].chooser[extra[p].pick].caption != 0) + extra[p].pick ++; if (extra[p].chooser[extra[p].pick].caption == 0) extra[p].pick = 0; *************** list_click (HWND hwnd, BOOL dblclk, int *** 287,291 **** if (x >= headers[SRC_COL].x - HMARGIN/2 && x <= headers[SRC_COL+1].x - HMARGIN/2) { ! if (extra[p].chooser[extra[p].pick].src_avail) package[p].srcaction ^= (SRCACTION_NO^SRCACTION_YES); } --- 298,303 ---- if (x >= headers[SRC_COL].x - HMARGIN/2 && x <= headers[SRC_COL+1].x - HMARGIN/2) { ! if (extra[p].chooser[extra[p].pick].src_avail && ! package[p].info[extra[p].chooser[extra[p].pick].trust].source_exists) package[p].srcaction ^= (SRCACTION_NO^SRCACTION_YES); } *************** note_width (HDC dc, char *string, int ad *** 351,365 **** } static int best_trust (int p, int trust) { int t; ! for (t=trust; t>=0; t--) ! if (package[p].info[t].install) return t; ! for (t=trust+1; t<=NTRUST; t++) ! if (package[p].info[t].install) ! return t; ! if (extra[p].installed_file) return TRUST_KEEP; return TRUST_NONE; --- 363,437 ---- } + static int + check_existence (int p, int trust, int check_src) + { + if (source == IDC_SOURCE_NETINST) + return 1; + if (source == IDC_SOURCE_DOWNLOAD) + { + if ( check_src == 0 && _access(package[p].info[trust].install,0) == 0) + return 1; + else if ( check_src == 1 && _access(package[p].info[trust].source,0) == 0 ) + return 1; + else + return 0; + } + if (source == IDC_SOURCE_CWD) + { + if ( check_src == 0 && package[p].info[trust].install && + _access(package[p].info[trust].install,0) == 0 ) + return 1; + else if ( check_src == 1 && package[p].info[trust].source && + _access(package[p].info[trust].source,0) == 0 ) + return 1; + } + return 0; + } + + static void + set_existence () + { + for (int i=0; i=NTRUST-1) + if (!package[i].info[TRUST_CURR].install) + { + package[i].info[TRUST_CURR].version = 0; + package[i].info[TRUST_CURR].install = strdup(path); + package[i].info[TRUST_CURR].install_size = size; + package[i].info[TRUST_CURR].install_exists=1; + if (package[i].info[TRUST_CURR].version == 0) + get_package_version(i,TRUST_CURR); + break; + } + else if (!package[i].info[TRUST_PREV].install ) + { + package[i].info[TRUST_PREV].version = 0; + package[i].info[TRUST_PREV].install = strdup(path); + package[i].info[TRUST_PREV].install_size = size; + package[i].info[TRUST_PREV].install_exists=1; + if (package[i].info[TRUST_PREV].version == 0) + get_package_version(i,TRUST_PREV); + break; + } + break; + } + } + } } *************** read_installed_db () *** 685,688 **** --- 861,865 ---- extra[i].installed_file = inst; extra[i].installed_size = instsz; + get_package_version(i, -1); for (t=0; t",IDOK,175,185,45,15 PUSHBUTTON "Cancel",IDCANCEL,240,185,45,15 --- 233,239 ---- IDC_STATIC,65,170,220,8 PUSHBUTTON "Full/Part",IDC_CHOOSE_FULLPART,250,5,35,10 ! CONTROL "Exp",IDC_CHOOSE_EXP,"Button",BS_AUTORADIOBUTTON | WS_GROUP,215,5,25,10 ! CONTROL "Curr",IDC_CHOOSE_CURR,"Button",BS_AUTORADIOBUTTON,189,5,25,10 ! CONTROL "Prev",IDC_CHOOSE_PREV,"Button",BS_AUTORADIOBUTTON,161,5,27,10 DEFPUSHBUTTON "&Next -->",IDOK,175,185,45,15 PUSHBUTTON "Cancel",IDCANCEL,240,185,45,15