This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Reset Played count Mixxx

By: a guest on Feb 17th, 2012  |  syntax: Diff  |  size: 2.41 KB  |  views: 77  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff -urN ./mixxx-1.10.0final/src/widget/wtracktableview.cpp ./mixxx-1.10.0/src/widget/wtracktableview.cpp
  2. --- ./mixxx-1.10.0final/src/widget/wtracktableview.cpp  2011-12-24 08:23:20.000000000 +0530
  3. +++ ./mixxx-1.10.0/src/widget/wtracktableview.cpp       2012-02-17 23:54:12.601950874 +0530
  4. @@ -261,6 +261,10 @@
  5.  
  6.      m_pReloadMetadataAct = new QAction(tr("Reload Track Metadata"), this);
  7.      connect(m_pReloadMetadataAct, SIGNAL(triggered()), this, SLOT(slotReloadTrackMetadata()));
  8. +
  9. +    m_pResetPlayed = new QAction(tr("Reset Played Count"), this);
  10. +    connect(m_pResetPlayed, SIGNAL(triggered()), this, SLOT(slotResetPlayed()));
  11. +
  12.  }
  13.  
  14.  void WTrackTableView::slotMouseDoubleClicked(const QModelIndex &index) {
  15. @@ -310,6 +314,25 @@
  16.      }
  17.  }
  18.  
  19. +void WTrackTableView::slotResetPlayed(){
  20. +    //qDebug()<<"slotResetPlayed called";
  21. +    QModelIndexList indices = selectionModel()->selectedRows();
  22. +
  23. +    TrackModel* trackModel = getTrackModel();
  24. +
  25. +    if (trackModel == NULL) {
  26. +        return;
  27. +    }
  28. +
  29. +    foreach (QModelIndex index, indices) {
  30. +        TrackPointer pTrack = trackModel->getTrack(index);
  31. +        if (pTrack) {
  32. +            pTrack->setTimesPlayed(0);
  33. +        }
  34. +    }
  35. +
  36. +}
  37. +
  38.  void WTrackTableView::slotShowTrackInfo() {
  39.      QModelIndexList indices = selectionModel()->selectedRows();
  40.  
  41. @@ -453,6 +476,12 @@
  42.      m_pPropertiesAct->setEnabled(oneSongSelected);
  43.      m_pMenu->addAction(m_pPropertiesAct);
  44.  
  45. +    if(modelHasCapabilities(TrackModel::TRACKMODELCAPS_RESETPLAYED)){
  46. +       m_pMenu->addAction(m_pResetPlayed);
  47. +    }
  48. +    else{
  49. +       qDebug()<<"Couldnt get flag i guess";
  50. +    }
  51.      //Create the right-click menu
  52.      m_pMenu->popup(event->globalPos());
  53.  }
  54. diff -urN ./mixxx-1.10.0final/src/widget/wtracktableview.h ./mixxx-1.10.0/src/widget/wtracktableview.h
  55. --- ./mixxx-1.10.0final/src/widget/wtracktableview.h    2011-12-24 08:23:20.000000000 +0530
  56. +++ ./mixxx-1.10.0/src/widget/wtracktableview.h 2012-02-16 17:21:01.537726060 +0530
  57. @@ -46,6 +46,7 @@
  58.      void slotNextTrackInfo();
  59.      void slotPrevTrackInfo();
  60.      void slotSendToAutoDJ();
  61. +    void slotResetPlayed();
  62.      void slotReloadTrackMetadata();
  63.      void addSelectionToPlaylist(int iPlaylistId);
  64.      void addSelectionToCrate(int iCrateId);
  65. @@ -95,6 +96,9 @@
  66.  
  67.      // Show track-editor action
  68.      QAction *m_pPropertiesAct;
  69. +
  70. +    //Reset played count action
  71. +    QAction *m_pResetPlayed;
  72.  };
  73.  
  74.  #endif
clone this paste RAW Paste Data