wybieraczka

Jarek Woloszyn yossa w pld.org.pl
Pią, 22 Wrz 2000, 18:22:50 CEST


ok. skompilowalem sobie te nowe glibce i rpma i wszystko dziala.
Wybieraczka tez. W sumie to jestem pod wrazeniem :)
Jedyne co mi brakuje to przycisk QUIT :))))

Zrobilem pokazywanie wersji aktualnie zainstalowanej. No prawie zrobilem.
Cos jest nie tak. wyglada tak jakby w installedEVR nie zawsze byl dobry
wskaznik na stringa. Jest to powtarzalne. U mnie wykrzacza sie np. na
Clanlibie (z pld, ale troche starsza wersja). Prosba do Pawla zeby do
sprawdzil, bo ja teraz nie mam czasu, a nie wiem czy nie jest to wina rpmliba.
Sprawdz czy na pewno dobrze sa ustawiane te wskazniki.

Dolaczam patcha.

-- 
 ( Jarek Woloszyn ) ( yossa w pld.org.pl ) ( the GNU generation )
 ( HomePage   http://www.yossa.ko.pl   ) (  ICQ UIN: 1922941  )
-------------- następna część ---------
--- pkgssel/pkgssel.c	Thu Sep 21 14:30:53 2000
+++ pkgssel.new/pkgssel.c	Fri Sep 22 18:01:51 2000
@@ -141,7 +141,7 @@
 		       "t - Size type"));
 
     /*  checkbox list */
-    lbGrps = newtChecklist(-1, -1, 12, NEWT_FLAG_SCROLL |
+    lbGrps = newtChecklist(-1, -1, 13, NEWT_FLAG_SCROLL |
 			   NEWT_FLAG_RETURNEXIT);
     newtChecklistSetWidth(lbGrps, LISTWIDTH);
     newtChecklistSetMCType(lbGrps, 1);
@@ -154,8 +154,8 @@
     /*  this label will set window windth, so make it big */
     lblSummary = newtLabel(-1, -1, pkgsMkEmptyString('-', MAINWINWIDTH - 2));
 
-    labels = newtCreateGrid(1, 12);
-    for (i = 0; i < 12; i++) {
+    labels = newtCreateGrid(1, 13);
+    for (i = 0; i < 13; i++) {
 	lbls[i] = newtLabel(-1, -1, "");
 	newtGridSetField(labels, 0, i, NEWT_GRID_COMPONENT, lbls[i],
 			 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);
@@ -177,7 +177,7 @@
     newtGridSetField(grid, 0, 0, NEWT_GRID_COMPONENT, lblGrpName,
 		     0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);
     newtGridSetField(grid, 0, 1, NEWT_GRID_SUBGRID, middle,
-		     0, 0, 0, 1, NEWT_ANCHOR_LEFT, 0);
+		     0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);
     newtGridSetField(grid, 0, 2, NEWT_GRID_COMPONENT, lblSummary,
 		     0, 0, 0, 1, NEWT_ANCHOR_LEFT, 0);
     newtGridSetField(grid, 0, 3, NEWT_GRID_SUBGRID, buttons,
@@ -190,9 +190,10 @@
 
     /*  set information labels */
     newtLabelSetText(lbls[0], _("Package:"));
-    newtLabelSetText(lbls[1], _("  Size:"));
-    newtLabelSetText(lbls[2], _("Current Directory:"));
-    newtLabelSetText(lbls[7], _("All Packages:"));
+    newtLabelSetText(lbls[1], _("  Currently in ver:"));
+    newtLabelSetText(lbls[2], _("  Size:"));
+    newtLabelSetText(lbls[3], _("Current Directory:"));
+    newtLabelSetText(lbls[8], _("All Packages:"));
 
     for (i = 0; newtHotKeys[i]; i++)
 	newtFormAddHotKey(all, newtHotKeys[i]);
@@ -204,8 +205,8 @@
     /*  Fill the list */
     lbRefill(lbGrps, actDir, subdir_num);
     /*  and right panel  */
-    pkgsCountDir(actDir, &lbls[3], size_type);
-    pkgsCountAllDirs(&lbls[8], size_type);
+    pkgsCountDir(actDir, &lbls[4], size_type);
+    pkgsCountAllDirs(&lbls[9], size_type);
     newtRefresh();
     
     while (1) {
@@ -229,8 +230,8 @@
 	    case 'T':
 		size_type++;
 		size_type %= 3;
-		pkgsCountDir(actDir, &lbls[3], size_type);
-		pkgsCountAllDirs(&lbls[8], size_type);
+		pkgsCountDir(actDir, &lbls[4], size_type);
+		pkgsCountAllDirs(&lbls[9], size_type);
 		answer.u.co = lbGrps;
 		newtChecklistSetStatus(lbGrps, NEWT_CHECKLIST_MOVE);
 		break;
@@ -267,8 +268,8 @@
 						   *item->selptr);
 		    }
 		}
-		pkgsCountDir(actDir, &lbls[3], size_type);
-		pkgsCountAllDirs(&lbls[8], size_type);
+		pkgsCountDir(actDir, &lbls[4], size_type);
+		pkgsCountAllDirs(&lbls[9], size_type);
 		break;
 	    case NEWT_KEY_F1:
 	    case NEWT_KEY_F3:
@@ -356,7 +357,7 @@
 		    subdir_num--;
 		    lbRefill(lbGrps, actDir, subdir_num);
 		    newtChecklistSetCurrentByKey(lbGrps, item);
-		    pkgsCountDir(actDir, &lbls[3], size_type);
+		    pkgsCountDir(actDir, &lbls[4], size_type);
 		    /* handle directories */
 		} else if ((item->type & SEL_DIR) == SEL_DIR) {
 		    /* put current dir on the stack */
@@ -372,18 +373,23 @@
 			pkgsCreateActive(actDir);
 		    }
 		    lbRefill(lbGrps, actDir, subdir_num);
-		    pkgsCountDir(actDir, &lbls[3], size_type);
+		    pkgsCountDir(actDir, &lbls[4], size_type);
 		} else if ((item->type & SEL_PACKET) == SEL_PACKET)
 		    show_info(item);
 		break;
 		/* now play with all cursors, pgup, pgdown, etc */
 	    case NEWT_CHECKLIST_SELECT:
-		pkgsCountDir(actDir, &lbls[3], size_type);
-		pkgsCountAllDirs(&lbls[8], size_type);
+		pkgsCountDir(actDir, &lbls[4], size_type);
+		pkgsCountAllDirs(&lbls[9], size_type);
 		/*  change datas in right panel & summary */
 	    case NEWT_CHECKLIST_MOVE:
 		item = (TSelectorItem *) newtChecklistGetCurrent(lbGrps);
 		if (item && (item->type & SEL_PACKET) == SEL_PACKET) {
+                    TPkgSet *pkgs;
+                    TPkgInfo *pkg;
+                    pkgs=rpmpldi_getPkgsSet();
+                    pkg=pkgs_array_nth(pkgs,item->pkgnum);
+
 		    sprintf(tmpbuf, _("Package: %s %s"), item->nameptr,
 			    item->ver);
 		    newtLabelSetText(lbls[0], tmpbuf);
@@ -400,12 +406,17 @@
 		    rpmpldi_header_entry_free(tmpptr);
 		    tmpint = (int *) rpmpldi_header_entry_get(item->pkgnum,
 							    RPMTAG_SIZE);
-		    pkgsSetLabel(lbls[1], _("  Size: "),
+		    sprintf(tmpbuf, _("  Currently in ver: %s"), 
+                                     (pkg->installedEVR ? 
+                                      pkg->installedEVR : "") );
+		    newtLabelSetText(lbls[1], tmpbuf);
+			         
+		    pkgsSetLabel(lbls[2], _("  Size: "),
 				 (tmpint ? *tmpint : 0), size_type);
 		    rpmpldi_header_entry_free(tmpint);
 		} else {
 		    newtLabelSetText(lbls[0], _("Package: "));
-		    newtLabelSetText(lbls[1], _("  Size: "));
+		    newtLabelSetText(lbls[2], _("  Size: "));
 		    newtLabelSetText(lblSummary,
 			       pkgsMkEmptyString('-', MAINWINWIDTH - 2));
 		}


Więcej informacji o liście dyskusyjnej pld-installer