mirror of
https://gitflic.ru/project/astankevich/mtpview.git
synced 2024-11-23 06:58:25 +01:00
Show progress if file size is lager 10Mb
This commit is contained in:
parent
1f99ad5551
commit
5bf6edb8c4
4
App.cpp
4
App.cpp
@ -20,7 +20,9 @@ int progress (uint64_t const sent, uint64_t const total,
|
||||
void const * const data)
|
||||
{
|
||||
uint64_t progress_percent = (100*sent)/total;
|
||||
if (((progress_percent % 10) == 0) && (progress_percent > prev_progress)) {
|
||||
if (((progress_percent % 10) == 0) &&
|
||||
(progress_percent > prev_progress) &&
|
||||
(total>10*1024*1024)){
|
||||
|
||||
printf(" Progress %d\n", progress_percent);
|
||||
mainwin->uploadDownloadNotification->SetProgress((float)sent/total);
|
||||
|
@ -227,8 +227,8 @@ MainWindow::MessageReceived(BMessage *msg)
|
||||
uploadDownloadNotification->SetTitle("Uploading");
|
||||
uploadDownloadNotification->SetContent(openFileName);
|
||||
uploadDownloadNotification->SetMessageID("mainwindow_progress");
|
||||
uploadDownloadNotification->SetProgress(0.5);
|
||||
uploadDownloadNotification->Send();
|
||||
//uploadDownloadNotification->SetProgress(0.5);
|
||||
//uploadDownloadNotification->Send();
|
||||
|
||||
int send_res = sendfile_function(openFileName, selectedItem->fileId(), newFileId);
|
||||
if (send_res == 0)
|
||||
@ -274,8 +274,8 @@ MainWindow::MessageReceived(BMessage *msg)
|
||||
uploadDownloadNotification->SetTitle("Downloading");
|
||||
uploadDownloadNotification->SetContent(selectedItem->Text());
|
||||
uploadDownloadNotification->SetMessageID("mainwindow_progress");
|
||||
uploadDownloadNotification->SetProgress(0.5);
|
||||
uploadDownloadNotification->Send();
|
||||
//uploadDownloadNotification->SetProgress(0.5);
|
||||
//uploadDownloadNotification->Send();
|
||||
|
||||
if (LIBMTP_Get_File_To_File(selectedItem->device(), selectedItem->fileId(),
|
||||
/*selectedItem->Text()*/ fullSaveFileName, progress, NULL) != 0 ){
|
||||
|
Loading…
Reference in New Issue
Block a user