[sword-cvs] sword/apps/windoze/CBuilder5/InstallMgr MainFrm.cpp,1.20,1.21

sword@www.crosswire.org sword@www.crosswire.org
Sun, 6 Jul 2003 19:50:07 -0700


Update of /usr/local/cvsroot/sword/apps/windoze/CBuilder5/InstallMgr
In directory www:/tmp/cvs-serv6997/apps/windoze/CBuilder5/InstallMgr

Modified Files:
	MainFrm.cpp 
Log Message:
no message

Index: MainFrm.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/InstallMgr/MainFrm.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** MainFrm.cpp	7 Jul 2003 00:25:59 -0000	1.20
--- MainFrm.cpp	7 Jul 2003 02:50:05 -0000	1.21
***************
*** 3,9 ****
  #pragma hdrstop
  
- extern "C" {
- #include <untgz.h>
- }
  
  #include "MainFrm.h"
--- 3,6 ----
***************
*** 51,55 ****
  
  void InstallMgrWin::statusUpdate(double dltotal, double dlnow) {
! 	if (!dltotal)
  		return;	// prevent division by zero error below
  	int filePercent  = (int)((float)(dlnow + 1) / (float)(dltotal) * 100);
--- 48,52 ----
  
  void InstallMgrWin::statusUpdate(double dltotal, double dlnow) {
! 	if (!dltotal || !StatusForm->totalBytes)
  		return;	// prevent division by zero error below
  	int filePercent  = (int)((float)(dlnow + 1) / (float)(dltotal) * 100);
***************
*** 249,255 ****
  	else {
  		InstallSourceTab *ist = (InstallSourceTab *) tree->Parent->Controls[0];
! 		if (ist->is->mgr)
! 			delete ist->is->mgr;
! 		mgr = ist->is->mgr = new SWMgr(is->localShadow.c_str());
  	}
  	
--- 246,250 ----
  	else {
  		InstallSourceTab *ist = (InstallSourceTab *) tree->Parent->Controls[0];
! 		mgr = ist->is->getMgr();
  	}
  	
***************
*** 505,542 ****
  
  
! void __fastcall TMainForm::RefreshRemoteSource(TObject *Sender)
! {
  	InstallSourceTab *ist = (InstallSourceTab *) MainForm->PageControl1->ActivePage->Controls[0];
! 	DIR *dir;
! 	struct dirent *ent;
! 	ConfigEntMap::iterator entry;
! 	SWBuf modDir;
! 	SWBuf modFile;
! 	SWBuf root = "./installMgr/";
! 	root += ist->is->source.c_str();
! 	SWBuf target = root + "/mods.d";
! 
! 	if (dir = opendir(target.c_str())) {
! 		rewinddir(dir);
! 		while ((ent = readdir(dir))) {
! 			if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
! 				modFile = target;
! 				modFile += "/";
! 				modFile += ent->d_name;
! 				remove(modFile.c_str());
! 			}
! 		}
! 		closedir(dir);
! 	}
! 
! 
! 	SWBuf archive = root + "/mods.d.tar.gz";
! 	if (!installMgr->FTPCopy(ist->is, "mods.d.tar.gz", archive.c_str(), false)) {
! 		int fd = open(archive.c_str(), O_RDONLY|O_BINARY);
! 		untargz(fd, root.c_str());
! 		close(fd);
! 	}
! 	else	installMgr->FTPCopy(ist->is, "mods.d", target.c_str(), true, ".conf");
! 
  	fillSourceTree(ist->tree, ist->is);	
  }
--- 500,506 ----
  
  
! void __fastcall TMainForm::RefreshRemoteSource(TObject *Sender) {
  	InstallSourceTab *ist = (InstallSourceTab *) MainForm->PageControl1->ActivePage->Controls[0];
! 	installMgr->refreshRemoteSource(ist->is);
  	fillSourceTree(ist->tree, ist->is);	
  }
***************
*** 558,563 ****
  }
  
! void __fastcall TMainForm::SpeedButton5Click(TObject *Sender)
! {
  	TTreeView *tree;
  	InstallSourceTab *ist = 0;
--- 522,527 ----
  }
  
! 
! void __fastcall TMainForm::SpeedButton5Click(TObject *Sender) {
  	TTreeView *tree;
  	InstallSourceTab *ist = 0;