You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

52 lines
1.6 KiB

  1. #include "stream_unavailable.h"
  2. #include "ui_stream_unavailable.h"
  3. stream_unavailable::stream_unavailable(QVector<episode_t> unavailable,QWidget *parent) :
  4. QDialog(parent),
  5. ui(new Ui::stream_unavailable)
  6. {
  7. ui->setupUi(this);
  8. for(auto e:unavailable){
  9. ui->unavailable_eps->insertRow(ui->unavailable_eps->rowCount());
  10. collection_t c = e.collection;
  11. for(int i = 0; i < 7;i++){
  12. QTableWidgetItem* item = new QTableWidgetItem();
  13. switch (i) {
  14. case 0:
  15. item->setText(c.name);
  16. break;
  17. case 1:
  18. item->setText("Season " + c.season);
  19. break;
  20. case 2:
  21. item->setText("E"+QString::number(e.number));
  22. break;
  23. case 3:
  24. item->setText(e.name);
  25. break;
  26. case 4:
  27. item->setText(e.premium_only ? "true" : "false");
  28. break;
  29. case 5:
  30. item->setText(e.available ? "true" : "false");
  31. break;
  32. }
  33. ui->unavailable_eps->setItem(ui->unavailable_eps->rowCount()-1,i,item);
  34. }
  35. }
  36. ui->unavailable_eps->horizontalHeader()->resizeSection(0,200);
  37. ui->unavailable_eps->horizontalHeader()->resizeSection(1,75);
  38. ui->unavailable_eps->horizontalHeader()->resizeSection(2,50);
  39. ui->unavailable_eps->horizontalHeader()->resizeSection(3,200);
  40. ui->unavailable_eps->horizontalHeader()->resizeSection(4,90);
  41. ui->unavailable_eps->horizontalHeader()->resizeSection(5,75);
  42. }
  43. stream_unavailable::~stream_unavailable()
  44. {
  45. delete ui;
  46. }