Logo Search packages:      
Sourcecode: ultracopier version File versions  Download package

void Main_window::updateTheCopyStat (  ) [private, slot]

Update the copy stat and the progress bar.

Update only the progress bar if copyIsRunning is at true Update only the information of the current file if copy is runing

See also:
copyIsRunning

Definition at line 936 of file Mwindow.cpp.

References CopyThread, dynaIcon(), copyThread::getCurrentFileCopied(), copyThread::getNumberOfItemRemoved(), getOldProgression, copyThread::getProgressionPercent(), copyThread::getSyntetizedStringFrom(), copyThread::getSyntetizedStringTo(), copyThread::getTextOverall(), copyThread::intToQtringSize(), and sysTrayIcon.

Referenced by closeEvent(), ListingIsFinish(), Main_window(), PauseButton(), Playlist_management_del(), and SkipButton().

{
      //put at end
      QList<copyItemInternal> listToPutAtEnd;
      listToPutAtEnd=CopyThread->putAtEndAfterError();
      for (int i = 0; i < listToPutAtEnd.size(); ++i) {
            removeIdItem(listToPutAtEnd.at(i).id);
            copyItemExternal tempItem;
            tempItem.id=listToPutAtEnd.at(i).id;
            QStringList newItem;
            newItem << listToPutAtEnd.at(i).source.absoluteFilePath();
            newItem << copyThread::intToQtringSize(listToPutAtEnd.at(i).size);
            newItem << listToPutAtEnd.at(i).destination.absoluteFilePath();
            QTreeWidgetItem *item = new QTreeWidgetItem(newItem);
            CopyList->insertTopLevelItem((CopyList->topLevelItemCount()-1),item);
            tempItem.theGraphicIndex=item;
            DEBUGCONSOLE(90,"Main_window::updateTheCopyStat","new: "+graphicPointer(tempItem.theGraphicIndex)+" id: "+QString::number(tempItem.id));
            theCopyItemExternal.append(tempItem);
      }
      //remove the right item
      int numberOfItemToRemove=CopyThread->getNumberOfItemRemoved();
      //if it just update the progression, numberOfItemToRemove=0
      while(numberOfItemToRemove>0)
      {
            QTreeWidgetItem * item=CopyList->topLevelItem(0);
            for (int i = 0; i < theCopyItemExternal.size(); ++i) {
                  if(theCopyItemExternal.at(i).theGraphicIndex==item)
                  {
                        DEBUGCONSOLE(90,"Main_window::updateTheCopyStat","remove: "+graphicPointer(theCopyItemExternal.at(i).theGraphicIndex)+" id: "+QString::number(theCopyItemExternal.at(i).id));
                        if(CopyList->indexOfTopLevelItem(theCopyItemExternal.at(i).theGraphicIndex)==-1)
                        {
                              DEBUGCONSOLE(10,"Main_window::removeIdItem","unable to locate the item in copy list with the id: "+QString::number(theCopyItemExternal.at(i).id));
                        }
                        else
                              delete theCopyItemExternal.at(i).theGraphicIndex;
                        theCopyItemExternal.removeAt(i);
                        break;
                  }
            }
            numberOfItemToRemove--;
      }
      //if iconised
      if(this->isHidden())
      {
            //update systray icon
            int getVarProgression=CopyThread->getProgressionPercentTotal();
            if(getOldProgression!=getVarProgression)
            {
                  getOldProgression=getVarProgression;
                  sysTrayIcon->setIcon(dynaIcon(getVarProgression));
            }
      }
      //if windowsed
      else
      {
            //update current file
            QString text=CopyThread->getCurrentFileCopied();
            if(text!="")
                  current_file->setText(text);
            //update progress bar file
            progressBar_file->setValue(CopyThread->getProgressionPercent(32767));
            //update overall text
            text=CopyThread->getTextOverall();
            if(text!="")
                  overall->setText(text);
            //update to and from
            text=CopyThread->getSyntetizedStringTo();
            if(text!="")
                  to->setText(text);
            text=CopyThread->getSyntetizedStringFrom();
            if(text!="")
                  from->setText(text);
            //update progress bar total
            int tempValue=CopyThread->getProgressionPercentTotal(32767);
            if(tempValue<0)
            {
                  DEBUGCONSOLE(90,"Main_window::updateTheCopyStat","CopyThread->getProgressionPercentTotal(32767) return "+QString::number(tempValue));
            }
            else
            {
                  #ifdef Q_OS_WIN32
                  //SpecWindowsCurWindow;
                  /*
                    ptl->SetProgressState(hmainwnd, TBPF_NORMAL)
                    ptl->SetProgressValue(hmainwnd, tempValue, 32767);
                    ptl->SetProgressState(hmainwnd, TBPF_PAUSED);
                    ptl->SetProgressState(hmainwnd, TBPF_ERROR);
                    ptl->SetProgressState(hmainwnd, TBPF_INDETERMINATE);
                  */
                  #endif
                  progressBar_all->setValue(tempValue);
            }
      }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index