예제 #1
0
WallClock::WallClock(QWidget *parent,const char *name)
  :QPushButton(parent,name)
{
  time_offset=rdstation_conf->timeOffset();
  previous_time=QTime::currentTime().addMSecs(time_offset);
  time_mode=RDAirPlayConf::TwentyFourHour;
  previous_time_mode = RDAirPlayConf::TwentyFourHour;
  show_date=true;
  check_sync=true;
  flash_state=false;

  //
  // Generate Fonts
  //
  label_font=QFont("Helvetica",10,QFont::Normal);
  label_font.setPixelSize(10);
  label_metrics=new QFontMetrics(label_font);
  time_font=QFont("Helvetica",26,QFont::Normal);
  time_font.setPixelSize(26);

  connect(this,SIGNAL(clicked()),this,SLOT(clickedData()));
}
예제 #2
0
int RDCartDialog::exec(int *cartnum,RDCart::Type type,QString *svcname,
		       int svc_quan,const QString &username,
		       const QString &passwd,bool *temp_allowed)
{
  LoadState();
  cart_cartnum=cartnum;
  cart_type=type;
  cart_service=svcname;
  cart_service_quan=svc_quan;
  cart_user_name=username;
  cart_user_password=passwd;
  cart_temp_allowed=temp_allowed;
  switch(cart_type) {
    case RDCart::All:
    case RDCart::Audio:
      if(rda->station()->editorPath().isEmpty()) {
	cart_editor_button->hide();
      }
      else {
	cart_editor_button->show();
      }
      if(temp_allowed==NULL) {
	cart_file_button->hide();
      }
      else {
	cart_file_button->show();
      }
#ifndef WIN32
      if(cart_player!=NULL) {
	cart_player->playButton()->show();
	cart_player->stopButton()->show();
      }
#endif  // WIN32
      break;

    case RDCart::Macro:
      cart_editor_button->hide();
#ifndef WIN32
      if(cart_player!=NULL) {
	cart_player->playButton()->hide();
	cart_player->stopButton()->hide();
      }
#endif  // WIN32
      break;
  }
  if(*cart_cartnum==0) {
    cart_ok_button->setDisabled(true);
  }
  switch(cart_filter_mode) {
    case RDStation::FilterAsynchronous:
      cart_search_button->setDefault(true);
      break;

    case RDStation::FilterSynchronous:
      cart_ok_button->setDefault(true);
      cart_search_button->hide();
  }
  BuildGroupList();
  cart_filter_edit->setText(*cart_filter);
  RefreshCarts();
  RDListViewItem *item=(RDListViewItem *)cart_cart_list->firstChild();
  while(item!=NULL) {
    if(item->text(1).toInt()==*cartnum) {
      cart_cart_list->setSelected(item,true);
      cart_cart_list->ensureItemVisible(item);
      clickedData(item);
      return QDialog::exec();
    }
    item=(RDListViewItem *)item->nextSibling();
  }
  return QDialog::exec();
}