Update of /cvsroot/bidwatcher/bidwatcher In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10552 Modified Files: Tag: STABLE_1_3 bidgroup.cpp bidgroup.h bidgui.cpp bidgui.h bidwatcher.cpp helpers.cpp Log Message: - dutch-auction-patch by T.E. - bidgroup/bidgui comments changed to GPL Index: bidgui.h =================================================================== RCS file: /cvsroot/bidwatcher/bidwatcher/Attic/bidgui.h,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -d -r1.1.2.4 -r1.1.2.5 --- bidgui.h 16 Aug 2004 15:48:55 -0000 1.1.2.4 +++ bidgui.h 25 Aug 2004 07:45:07 -0000 1.1.2.5 @@ -1,58 +1,24 @@ - /* - * Copyright (C) 2004 Planet Intelligent Systems GmbH - * Residence Park 1-7, 19065 Raben Steinfeld, Germany, Europe, Earth - * All rights reserved - * + * part of bidwatcher * Author: Jan Starzynski + * use of this code is restricted to the terms + * of the GNU GPL, which should have been included in this + * distribution. If not, see www.gnu.org/copyleft/gpl.html. + * Here is the short version: * - * $Id$ - * - * $Log$ - * Revision 1.1.2.4 2004/08/16 15:48:55 sturnus - * several bugfixes: - * - return code of auction_info::getinfo() - * - Bids were sent twice (not snipes) - * - "Pre-bid failed" message instead "Bid failed" - * - auction_info::BuitNow -> isBuitNow - * - reset ButItNow after first bid - * - * Revision 1.1.2.3 2004/08/09 14:17:13 sturnus - * considering HAVE_STL: disable BidGroups if not available - * - * Revision 1.1.2.2 2004/06/25 14:22:02 sturnus - * finished remote control via ~/.bidwatcher/item.add - * - * Revision 1.1.2.1 2004/06/10 09:02:09 sturnus - * files for bidgroups and extensions - * - * Revision 1.9 2004/06/03 12:50:19 js02 - * add items from ~/.bidwatcher/item.add - * - * Revision 1.8 2004/05/28 06:50:56 js02 - * failed getkeys are stored - * - * Revision 1.7 2004/05/25 15:14:34 js02 - * Bugfix: wrong parameter type for call to delBidGroupItem - * - * Revision 1.6 2004/05/18 14:45:19 js02 - * *** empty log message *** - * - * Revision 1.5 2004/05/18 13:29:50 js02 - * integration continued - * - * Revision 1.4 2004/05/17 23:33:33 js02 - * bid groups continued + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * Revision 1.3 2004/05/15 13:12:24 js02 - * rebuild function: do not depend on global variables anymore + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * Revision 1.2 2004/05/14 16:30:39 js02 - * bidgroup control via middle mouse button implemented + * $Id$ * - * Revision 1.1 2004/05/13 21:54:57 js02 * View and Control for Bidgroups - * */ #ifndef BIDWATCHER_BIDGUI_H Index: bidgui.cpp =================================================================== RCS file: /cvsroot/bidwatcher/bidwatcher/Attic/bidgui.cpp,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -u -d -r1.1.2.10 -r1.1.2.11 --- bidgui.cpp 24 Aug 2004 10:22:04 -0000 1.1.2.10 +++ bidgui.cpp 25 Aug 2004 07:44:58 -0000 1.1.2.11 @@ -1,97 +1,25 @@ - -// Copyright (C) 2004 Planet Intelligent Systems GmbH -// Residence Park 1-7, 19065 Raben Steinfeld, Germany, Europe, Earth -// All rights reserved -// -// Author: Jan Starzynski -// -// $Id$ -// -// $Log$ -// Revision 1.1.2.10 2004/08/24 10:22:04 sturnus -// check for underflow -// -// Revision 1.1.2.9 2004/08/24 10:12:37 sturnus -// Bugifx: -// - FirstBid marked by just '(' could be fooled by '(Approximately $xxx' -// -// Improvements: -// - Determination of Shipping + Handling -// - Shipping + Handling in DetailsWindow -// - Shipping + Handling considered in copySnipe(): total costs keep constant -// -// Revision 1.1.2.8 2004/08/16 15:48:55 sturnus -// several bugfixes: -// - return code of auction_info::getinfo() -// - Bids were sent twice (not snipes) -// - "Pre-bid failed" message instead "Bid failed" -// - auction_info::BuitNow -> isBuitNow -// - reset ButItNow after first bid -// -// Revision 1.1.2.7 2004/08/13 13:54:58 sturnus -// - many bugfixes for update/update-timer (T.E. and me) -// - bugfix for feedback-parser (T.E.) -// -// Revision 1.1.2.6 2004/08/10 09:22:59 sturnus -// minor enhancements: -// - replaced flock() with fcntl() -// - heuristic for BuyItNow-only items -// - snipe key out of sight for user -// -// Revision 1.1.2.5 2004/08/09 14:17:13 sturnus -// considering HAVE_STL: disable BidGroups if not available -// -// Revision 1.1.2.4 2004/07/12 08:02:55 sturnus -// accelerating snipe setting: don't get snipe key, it's done again later anyway -// -// Revision 1.1.2.3 2004/06/25 14:22:02 sturnus -// finished remote control via ~/.bidwatcher/item.add -// -// Revision 1.1.2.2 2004/06/10 16:31:08 sturnus -// continued work on commando file parser -// -// Revision 1.1.2.1 2004/06/10 09:02:08 sturnus -// files for bidgroups and extensions -// -// Revision 1.14 2004/06/03 12:52:03 js02 -// *** empty log message *** -// -// Revision 1.13 2004/06/03 12:50:19 js02 -// add items from ~/.bidwatcher/item.add -// -// Revision 1.12 2004/05/28 06:50:56 js02 -// failed getkeys are stored -// -// Revision 1.11 2004/05/25 15:14:34 js02 -// Bugfix: wrong parameter type for call to delBidGroupItem -// -// Revision 1.10 2004/05/19 08:46:52 js02 -// Bugfixes -// -// Revision 1.9 2004/05/18 14:45:19 js02 -// *** empty log message *** -// -// Revision 1.8 2004/05/18 14:36:20 js02 -// copying of snipe data at creation -// -// Revision 1.7 2004/05/18 14:10:33 js02 -// Bidgroups work -// -// Revision 1.6 2004/05/18 13:29:50 js02 -// integration continued -// -// Revision 1.5 2004/05/17 23:33:33 js02 -// bid groups continued -// -// Revision 1.3 2004/05/15 13:12:24 js02 -// rebuild function: do not depend on global variables anymore -// -// Revision 1.2 2004/05/14 16:30:39 js02 -// bidgroup control via middle mouse button implemented -// -// Revision 1.1 2004/05/13 21:54:57 js02 -// View and Control for Bidgroups -// +/* + * part of bidwatcher + * Author: Jan Starzynski + * use of this code is restricted to the terms + * of the GNU GPL, which should have been included in this + * distribution. If not, see www.gnu.org/copyleft/gpl.html. + * Here is the short version: + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * $Id$ + * + * View and Control for Bidgroups + */ #include "config.h" Index: bidgroup.cpp =================================================================== RCS file: /cvsroot/bidwatcher/bidwatcher/Attic/bidgroup.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- bidgroup.cpp 9 Aug 2004 14:17:13 -0000 1.1.2.2 +++ bidgroup.cpp 25 Aug 2004 07:44:57 -0000 1.1.2.3 @@ -1,40 +1,25 @@ - -// Copyright (C) 2004 Planet Intelligent Systems GmbH -// Residence Park 1-7, 19065 Raben Steinfeld, Germany, Europe, Earth -// All rights reserved -// -// Author: Jan Starzynski -// -// $Id$ -// -// $Log$ -// Revision 1.1.2.2 2004/08/09 14:17:13 sturnus -// considering HAVE_STL: disable BidGroups if not available -// -// Revision 1.1.2.1 2004/06/10 09:02:08 sturnus -// files for bidgroups and extensions -// -// Revision 1.13 2004/05/18 13:29:50 js02 -// integration continued -// -// Revision 1.12 2004/05/17 23:33:33 js02 -// bid groups continued -// -// Revision 1.10 2004/05/14 16:30:39 js02 -// bidgroup control via middle mouse button implemented -// -// Revision 1.9 2004/05/13 21:54:57 js02 -// View and Control for Bidgroups -// -// Revision 1.8 2004/05/13 15:38:07 js02 -// new function groupId -// -// Revision 1.7 2004/05/13 11:31:39 js02 -// Load/Save of BidGroups -// -// Revision 1.6 2004/05/13 09:56:29 js02 -// vereinfachte Version -// +/* + * part of bidwatcher + * Author: Jan Starzynski + * use of this code is restricted to the terms + * of the GNU GPL, which should have been included in this + * distribution. If not, see www.gnu.org/copyleft/gpl.html. + * Here is the short version: + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * $Id$ + * + * Handling of Bidgroups + */ #include "config.h" Index: bidwatcher.cpp =================================================================== RCS file: /cvsroot/bidwatcher/bidwatcher/Attic/bidwatcher.cpp,v retrieving revision 1.171.2.51 retrieving revision 1.171.2.52 diff -u -d -r1.171.2.51 -r1.171.2.52 --- bidwatcher.cpp 24 Aug 2004 10:12:37 -0000 1.171.2.51 +++ bidwatcher.cpp 25 Aug 2004 07:45:07 -0000 1.171.2.52 @@ -2091,7 +2091,7 @@ /* This doesn't make sense, since some buyitnows can be bid on, while * others can't. We must distinguish. // if (auc->reserveMet == 'b') - if (auc->BuyitNow == TRUE) + if (auc->isBuyitNow == TRUE) // Disallow bidding on buyitnow only listings gtk_widget_set_sensitive(okbutton, FALSE); */ @@ -3921,11 +3921,12 @@ static void PrintPrice(char *price, struct auctioninfo *auction) { char curbid[40]; + bool is_dutch = strcmp(auction->HighBidder, "Dutch Auction") == 0; + if(auction->CurrentBid > 0) { char flags[10] = ""; if (auction->reserveMet == 'n') strcat(flags, "R"); - //if (auction->isBuyitNow == TRUE) strcat(flags, "B"); - if (strcmp(auction->HighBidder, "Dutch Auction") == 0) strcat(flags, "D" ); + if (is_dutch) strcat(flags, "D" ); sprintf(curbid,"%s%.2f(%d%s)", auction->currency, auction->CurrentBid, auction->BidCount, flags); @@ -3942,7 +3943,11 @@ } if(auction->BuyitNowPrice > 0) { - sprintf(price, "Buy %s", buynow); + if (is_dutch) { + sprintf(price, "Buy %s(D)", buynow); + }else{ + sprintf(price, "Buy %s", buynow); + } return; } @@ -4473,8 +4478,6 @@ // if the grab was a success, check to see if it is a user // called auction. if (myBidQuantity) stat = '3'; -//printf("%s\n",HighBidder); -//printf("%s\n",authID); if (strcmp(Seller, authID) == 0) { stat = '1'; } @@ -4713,10 +4716,10 @@ MakeFileName(fnstring, fileName, TRUE); reportOut.open(fileName, ios::app); char truncDesc[300]; - sprintf(truncDesc,"%llu - %s\nHigh Bidder: %s%s\n High Bid: %s %.2f", + sprintf(truncDesc,"%llu - %s\nHigh Bidder: %s%s\n High Bid: %s %.2f\nComments: %s", auction[index]->ItemNumber,auction[index]->Description, auction[index]->HighBidder,auction[index]->BidderRate, - auction[index]->currency,auction[index]->CurrentBid); + auction[index]->currency,auction[index]->CurrentBid,auction[index]->Comments); strcat(truncDesc, "\n-----------------------------------------------------\n"); reportOut << truncDesc; reportOut.close(); Index: bidgroup.h =================================================================== RCS file: /cvsroot/bidwatcher/bidwatcher/Attic/bidgroup.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -d -r1.1.2.3 -r1.1.2.4 --- bidgroup.h 9 Aug 2004 14:17:13 -0000 1.1.2.3 +++ bidgroup.h 25 Aug 2004 07:44:58 -0000 1.1.2.4 @@ -1,44 +1,24 @@ - /* - * Copyright (C) 2004 Planet Intelligent Systems GmbH - * Residence Park 1-7, 19065 Raben Steinfeld, Germany, Europe, Earth - * All rights reserved - * + * part of bidwatcher * Author: Jan Starzynski + * use of this code is restricted to the terms + * of the GNU GPL, which should have been included in this + * distribution. If not, see www.gnu.org/copyleft/gpl.html. + * Here is the short version: * - * $Id$ - * - * $Log$ - * Revision 1.1.2.3 2004/08/09 14:17:13 sturnus - * considering HAVE_STL: disable BidGroups if not available - * - * Revision 1.1.2.2 2004/07/15 14:27:30 sturnus - * #include <cstdio> + std::FILE added - * - * Revision 1.1.2.1 2004/06/10 09:02:08 sturnus - * files for bidgroups and extensions - * - * Revision 1.12 2004/05/18 13:29:50 js02 - * integration continued - * - * Revision 1.11 2004/05/17 23:33:33 js02 - * bid groups continued - * - * Revision 1.9 2004/05/14 16:30:39 js02 - * bidgroup control via middle mouse button implemented - * - * Revision 1.8 2004/05/13 21:54:57 js02 - * View and Control for Bidgroups - * - * Revision 1.7 2004/05/13 15:38:07 js02 - * new function groupId + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * Revision 1.6 2004/05/13 11:31:39 js02 - * Load/Save of BidGroups + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * Revision 1.5 2004/05/13 09:56:29 js02 - * vereinfachte Version + * $Id$ * + * Handling of Bidgroups */ #ifndef BIDWATCHER_BIDGROUP_H Index: helpers.cpp =================================================================== RCS file: /cvsroot/bidwatcher/bidwatcher/Attic/helpers.cpp,v retrieving revision 1.90.2.41 retrieving revision 1.90.2.42 diff -u -d -r1.90.2.41 -r1.90.2.42 --- helpers.cpp 24 Aug 2004 10:12:38 -0000 1.90.2.41 +++ helpers.cpp 25 Aug 2004 07:45:07 -0000 1.90.2.42 @@ -1203,6 +1203,7 @@ if (strchr(LineData, ':')) streamBuff.getline(LineData, 1024, '\n'); CheckBadChars(LineData, "0123456789"); Quantity = atoi(LineData); + DPRINTF(DLOW, ("LDBC: %s\n", LineData)); } break; @@ -1212,13 +1213,7 @@ DPRINTF(DLOW, ("LDBC: %s\n", LineData)); // if instead of the number of bids an item has "Purchases" and // there was no time left in the auction the auction is not endless - if (!strncmp(LineData, "Purchases", strlen("Purchases")) && - strlen(TimeLeft) == 0) { - isEndless = 1; - } else if (strstr(LineData, "Winning bidders list")) { - strcpy(HighBidder, "Dutch Auction"); - dutch_flag=1; - } else { + if (strlen(TimeLeft) == 0) isEndless = 1; scratch = strchr(LineData, ':'); if(scratch) { int limit = strlen(scratch); @@ -1234,7 +1229,6 @@ } DPRINTF(DLOW, ("BidCount: %i\n", BidCount)); } - } break; case 6: // time left if (!TimeLeft[0]) { @@ -1254,6 +1248,13 @@ if (!Location[0]) { streamBuff.getline(LineData, 1024, '\n'); STRNZCPY(Location, LineData); + // Dutch Auctions + if (Quantity > 1 ) { + strcpy(HighBidder, "Dutch Auction"); + strcpy(BidderRate, ""); + dutch_flag=1; + } + if (strlen(TimeLeft) == 0) isEndless = 1; } break; case 8: // time started |