Exemplo n.º 1
0
void ListNodes::RefreshList()
{
  QString sql;
  RDSqlQuery *q;
  RDListViewItem *item;

  list_list_view->clear();
  sql=QString().sprintf("select ID,HOSTNAME,DESCRIPTION,BASE_OUTPUT,TCP_PORT \
                         from SWITCHER_NODES \
                         where (STATION_NAME=\"%s\")&&(MATRIX=%d)",
			(const char *)list_matrix->station(),
			list_matrix->matrix());
  q=new RDSqlQuery(sql);
  while(q->next()) {
    item=new RDListViewItem(list_list_view);
    item->setId(q->value(0).toInt());
    item->setText(0,q->value(1).toString());
    item->setText(1,q->value(2).toString());
    if(q->value(3).toInt()==0) {
      item->setText(2,tr("[none]"));
    }
    else {
      item->setText(2,QString().sprintf("%d",q->value(3).toInt()));
    }
    item->setText(3,q->value(4).toString());
  }
  delete q;
}
Exemplo n.º 2
0
void ListNodes::addData()
{
  RDListViewItem *item;
  int id=-1;
  EditNode *node=new EditNode(&id,list_matrix,this);
  if(node->exec()==0) {
    item=new RDListViewItem(list_list_view);
    item->setId(id);
    RefreshItem(item);
    list_list_view->setSelected(item,true);
    list_list_view->ensureItemVisible(item);
  }
  delete node;
}
Exemplo n.º 3
0
void ListAuxFields::RefreshList()
{
  QString sql;
  RDSqlQuery *q;
  RDListViewItem *item;

  list_list_view->clear();
  sql=QString().sprintf("select ID,VAR_NAME,CAPTION from AUX_METADATA \
                         where FEED_ID=%u order by CAPTION",list_feed_id);
  q=new RDSqlQuery(sql);
  while(q->next()) {
    item=new RDListViewItem(list_list_view);
    item->setId(q->value(0).toInt());
    item->setText(0,q->value(1).toString());
    item->setText(1,q->value(2).toString());
  }
  delete q;
}
Exemplo n.º 4
0
void EditJack::RefreshList()
{
  RDListViewItem *l;

  edit_jack_client_view->clear();
  QString sql=QString().
    sprintf("select ID,DESCRIPTION,COMMAND_LINE from JACK_CLIENTS \
             where STATION_NAME=\"%s\" order by DESCRIPTION",
	    (const char *)edit_station->name());
  RDSqlQuery *q=new RDSqlQuery(sql);
  while(q->next()) {
    l=new RDListViewItem(edit_jack_client_view);
    l->setId(q->value(0).toInt());
    l->setText(0,q->value(1).toString());
    l->setText(1,q->value(2).toString());
  }
  delete q;
}
Exemplo n.º 5
0
void EditSchedRules::importData()
{
  QString clockname = "";
  QString str;
  RDListViewItem *item;
  QString sql;
  RDSqlQuery *q;

  ListClocks *listclocks=new ListClocks(&clockname,this);
  listclocks->setCaption(tr("Import Rules from Clock"));
  if(listclocks->exec()<0) {
    delete listclocks;
    return;
  }
  delete listclocks;
  SchedRulesList *import_list=new SchedRulesList(clockname); 

  list_schedCodes_view->clear();
  for (int i=0; i<import_list->getNumberOfItems(); i++)  
    {
    item=new RDListViewItem(list_schedCodes_view);
    item->setId(i);
    item->setText(0,import_list->getItemSchedCode(i));
    str=QString().sprintf("%d",import_list->getItemMaxRow(i));
    item->setText(1,str);
    str=QString().sprintf("%d",import_list->getItemMinWait(i));
    item->setText(2,str);
    item->setText(3,import_list->getItemNotAfter(i));
    item->setText(4,import_list->getItemOrAfter(i));
    item->setText(5,import_list->getItemOrAfterII(i));
    item->setText(6,import_list->getItemDescription(i));
    }
  delete import_list;

  sql=QString().sprintf("select ARTISTSEP from CLOCKS where NAME=\"%s\"",(const char *)clockname); 
  q=new RDSqlQuery(sql);
  if (q->first())
    {
    *edit_artistsep = q->value(0).toUInt();
    artistSepSpinBox->setValue( *edit_artistsep );
    }
  delete q; 
  edit_modified=true;
}
Exemplo n.º 6
0
void EditSchedRules::Load()
{
  QString str;
  RDListViewItem *item;

  list_schedCodes_view->clear();
  for (int i=0; i<sched_rules_list->getNumberOfItems(); i++) {
    item=new RDListViewItem(list_schedCodes_view);
    item->setId(i);
    item->setText(0,sched_rules_list->getItemSchedCode(i));
    str=QString().sprintf("%d",sched_rules_list->getItemMaxRow(i));
    item->setText(1,str);
    str=QString().sprintf("%d",sched_rules_list->getItemMinWait(i));
    item->setText(2,str);
    item->setText(3,sched_rules_list->getItemNotAfter(i));
    item->setText(4,sched_rules_list->getItemOrAfter(i));
    item->setText(5,sched_rules_list->getItemOrAfterII(i));
    item->setText(6,sched_rules_list->getItemDescription(i));
  }
}
Exemplo n.º 7
0
void ListCasts::RefreshList()
{
  QString sql;
  RDSqlQuery *q;
  RDListViewItem *item;

  list_casts_view->clear();
  sql=QString().sprintf("select ID from PODCASTS %s \
                         order by ORIGIN_DATETIME",
       (const char *)RDCastSearch(list_feed_id,list_filter_edit->text(),
				  list_unexpired_check->isChecked(),
				  list_active_check->isChecked()));
  q=new RDSqlQuery(sql);
  while (q->next()) {
    item=new RDListViewItem(list_casts_view);
    item->setId(q->value(0).toInt());
    RefreshItem(item);
  }
  delete q;
}
Exemplo n.º 8
0
void ListReplicatorCarts::RefreshList()
{
  QString sql;
  RDSqlQuery *q;
  RDListViewItem *item;

  list_view->clear();
  sql=QString("select ")+
    "REPL_CART_STATE.ID,"+
    "CART.TYPE,"+
    "REPL_CART_STATE.CART_NUMBER,"+
    "CART.TITLE,"+
    "REPL_CART_STATE.ITEM_DATETIME,"+
    "REPL_CART_STATE.POSTED_FILENAME "+
    "from REPL_CART_STATE left join CART "+
    "on REPL_CART_STATE.CART_NUMBER=CART.NUMBER where "+
    "REPLICATOR_NAME=\""+RDEscapeString(list_replicator_name)+"\"";
  q=new RDSqlQuery(sql);
  while (q->next()) {
    item=new RDListViewItem(list_view);
    item->setId(q->value(0).toInt());
    item->setText(1,QString().sprintf("%06u",q->value(2).toUInt()));
    switch((RDCart::Type)q->value(1).toInt()) {
    case RDCart::Audio:
      item->setPixmap(0,*list_playout_map);
      break;

    case RDCart::Macro:
      item->setPixmap(0,*list_macro_map);
      break;

    case RDCart::All:
      break;
    }
    item->setText(2,q->value(3).toString());
    item->setText(3,q->value(4).toDateTime().toString("hh:mm:ss dd/MM/yyyy"));
    item->setText(4,q->value(5).toString());
  }
  delete q;
}
Exemplo n.º 9
0
void RDCartDialog::RefreshCarts()
{
  QString sql;
  RDSqlQuery *q;
  RDListViewItem *l;

  cart_cart_list->clear();
  QString group=cart_group_box->currentText();
  if(group==QString(tr("ALL"))) {
    group="";
  }
  QString schedcode=cart_schedcode_box->currentText();
  if(group==QString(tr("ALL"))) {
    schedcode="";
  }
  if(cart_type==RDCart::All) {
    sql=QString("select ")+
      "CART.NUMBER,"+          // 00
      "CART.TITLE,"+           // 01
      "CART.ARTIST,"+          // 02
      "CART.CLIENT,"+          // 03
      "CART.AGENCY,"+          // 04
      "CART.USER_DEFINED,"+    // 05
      "CART.COMPOSER,"+        // 06
      "CART.CONDUCTOR,"+       // 07
      "CART.START_DATETIME,"+  // 08
      "CART.END_DATETIME,"+    // 09
      "CART.TYPE,"+            // 10
      "CART.FORCED_LENGTH,"+   // 11
      "CART.GROUP_NAME,"+      // 12
      "GROUPS.COLOR "+         // 13
      "from CART left join GROUPS "+
      "on CART.GROUP_NAME=GROUPS.NAME where "+
      GetSearchFilter(cart_filter_edit->text(),group,schedcode);
  }
  else {
    sql=QString("select ")+
      "CART.NUMBER,"+          // 00
      "CART.TITLE,"+           // 01
      "CART.ARTIST,"+          // 02
      "CART.CLIENT,"+          // 03
      "CART.AGENCY,"+          // 04
      "CART.USER_DEFINED,"+    // 05
      "CART.COMPOSER,"+        // 06
      "CART.CONDUCTOR,"+       // 07
      "CART.START_DATETIME,"+  // 08
      "CART.END_DATETIME,"+    // 09
      "CART.TYPE,"+            // 10
      "CART.FORCED_LENGTH,"+   // 11
      "CART.GROUP_NAME,"+      // 12
      "GROUPS.COLOR "+         // 13
      "from CART left join GROUPS "+
      "on CART.GROUP_NAME=GROUPS.NAME where "+
      "("+GetSearchFilter(cart_filter_edit->text(),group,schedcode)+")&&"+
      QString().sprintf("(TYPE=%d)",cart_type);
  }
  if(cart_limit_box->isChecked()) {
    sql+=QString().sprintf(" limit %d",RD_LIMITED_CART_SEARCH_QUANTITY);
  }
  q=new RDSqlQuery(sql);
  int step=0;
  int count=0;
  cart_progress_dialog->setTotalSteps(q->size()/RDCART_DIALOG_STEP_SIZE);
  cart_progress_dialog->setProgress(0);
  while(q->next()) {
    l=new RDListViewItem(cart_cart_list);
    l->setId(q->value(10).toUInt());
    switch((RDCart::Type)q->value(10).toUInt()) {
	case RDCart::Audio:
	  l->setPixmap(0,*cart_playout_map);
	  break;

	case RDCart::Macro:
	  l->setPixmap(0,*cart_macro_map);
	  break;

	default:
	  break;
    }
    l->setText(1,QString().sprintf("%06d",q->value(0).toUInt())); // Number
    l->setText(2,RDGetTimeLength(q->value(11).toInt(),false,true)); // Length
    l->setText(3,q->value(1).toString());                       // Title
    l->setText(4,q->value(2).toString());                       // Artist
    l->setText(5,q->value(12).toString());                      // Group
    l->setText(6,q->value(6).toString());                      // Composer
    l->setText(7,q->value(7).toString());                      // Conductor
    l->setTextColor(5,q->value(13).toString(),QFont::Bold);
    l->setText(8,q->value(3).toString());                       // Client
    l->setText(9,q->value(4).toString());                       // Agency
    l->setText(10,q->value(5).toString());                       // User Defined
    if(!q->value(8).toDate().isNull()) {
      l->setText(11,q->value(8).toDate().toString("MM/dd/yyyy"));  // Start Date
    }
    if(!q->value(10).toDate().isNull()) {
      l->setText(12,q->value(9).toDate().toString("MM/dd/yyyy"));  // End Date
    }
    else {
      l->setText(12,"TFN");
    }
    if(count++>RDCART_DIALOG_STEP_SIZE) {
      cart_progress_dialog->setProgress(++step);
      count=0;
      qApp->processEvents(QEventLoop::ExcludeUserInput);
    }
  }
  cart_progress_dialog->reset();
  delete q;
  cart_search_button->setDisabled(true);
}