From 718140546e48d6c45ad9163be9823259716afee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Wed, 9 Jan 2008 18:50:59 +0000 Subject: [PATCH] sftp uploader seems to be working now :) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23320 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/codycam/CodyCam.cpp | 10 ++++++++-- src/apps/codycam/CodyCam.h | 1 + src/apps/codycam/VideoConsumer.cpp | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/apps/codycam/CodyCam.cpp b/src/apps/codycam/CodyCam.cpp index fe3b57b472..7d0b919eea 100644 --- a/src/apps/codycam/CodyCam.cpp +++ b/src/apps/codycam/CodyCam.cpp @@ -428,6 +428,7 @@ VideoWindow::VideoWindow (BRect frame, const char* title, window_type type, uint fFtpInfo.imageFormat = 0; fFtpInfo.translator = 0; fFtpInfo.passiveFtp = true; + fFtpInfo.uploadClient = 0; strcpy(fFtpInfo.fileNameText, "filename"); strcpy(fFtpInfo.serverText, "server"); strcpy(fFtpInfo.loginText, "login"); @@ -599,7 +600,7 @@ VideoWindow::MessageReceived(BMessage* message) if (control != NULL) { int32 client; message->FindInt32("client", &(fFtpInfo.uploadClient)); - FTPINFO("upl client = %d\n", fFtpInfo.uploadClient);//XXX + FTPINFO("upl client = %d\n", fFtpInfo.uploadClient); } break; @@ -752,7 +753,7 @@ VideoWindow::_BuildCaptureControls(BView* theView) fUploadClientMenu->AddItem(new BMenuItem(kUploadClient[i], m)); } fUploadClientMenu->SetTargetForItems(this); - //fUploadClientMenu->FindItem(fCaptureRateSetting->Value())->SetMarked(true); + fUploadClientMenu->FindItem(fUploadClientSetting->Value())->SetMarked(true); fUploadClientSelector = new BMenuField(aFrame, "UploadClient", "", fUploadClientMenu); fUploadClientSelector->SetDivider(0.0); @@ -832,6 +833,7 @@ VideoWindow::ApplyControls() fFileName->Invoke(); PostMessage(fImageFormatMenu->FindMarked()->Message()); PostMessage(fCaptureRateMenu->FindMarked()->Message()); + PostMessage(fUploadClientMenu->FindMarked()->Message()); fServerName->Invoke(); fLoginId->Invoke(); fPassword->Invoke(); @@ -861,6 +863,9 @@ VideoWindow::_SetUpSettings(const char* filename, const char* dirname) fSettings->Add(fCaptureRateSetting = new EnumeratedStringValueSetting("CaptureRate", "Every 5 minutes", kCaptureRate, "capture rate expected", "unrecognized capture rate specified")); + fSettings->Add(fUploadClientSetting = new EnumeratedStringValueSetting("UploadClient", + "FTP", kUploadClient, "upload client name expected", + "unrecognized upload client specified")); fSettings->TryReadingSettings(); } @@ -877,6 +882,7 @@ VideoWindow::_QuitSettings() fFilenameSetting->ValueChanged(fFileName->Text()); fImageFormatSettings->ValueChanged(fImageFormatMenu->FindMarked()->Label()); fCaptureRateSetting->ValueChanged(fCaptureRateMenu->FindMarked()->Label()); + fUploadClientSetting->ValueChanged(fUploadClientMenu->FindMarked()->Label()); fSettings->SaveSettings(); delete fSettings; diff --git a/src/apps/codycam/CodyCam.h b/src/apps/codycam/CodyCam.h index a1706194bd..242660a75f 100644 --- a/src/apps/codycam/CodyCam.h +++ b/src/apps/codycam/CodyCam.h @@ -164,6 +164,7 @@ class VideoWindow : public BWindow { BooleanValueSetting* fPassiveFtpSetting; StringValueSetting* fFilenameSetting; StringValueSetting* fImageFormatSettings; + EnumeratedStringValueSetting* fUploadClientSetting; EnumeratedStringValueSetting* fCaptureRateSetting; }; diff --git a/src/apps/codycam/VideoConsumer.cpp b/src/apps/codycam/VideoConsumer.cpp index 7d5953df22..aa95961e86 100644 --- a/src/apps/codycam/VideoConsumer.cpp +++ b/src/apps/codycam/VideoConsumer.cpp @@ -688,6 +688,7 @@ VideoConsumer::FtpSave(char* filename) ftp = new SftpClient; break; default: + fprintf(stderr, "invalid upload client %d\n", fUploadClient); return EINVAL; }