Exemple #1
0
/**********************************************************************
 * Fullscrenn control widget
 **********************************************************************/
FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i, QWidget *_parent )
                           : AbstractController( _p_i, _parent )
{
    RTL_UNAFFECTED_WIDGET
    i_mouse_last_x      = -1;
    i_mouse_last_y      = -1;
    b_mouse_over        = false;
    i_mouse_last_move_x = -1;
    i_mouse_last_move_y = -1;
#if HAVE_TRANSPARENCY
    b_slow_hide_begin   = false;
    i_slow_hide_timeout = 1;
#endif
    b_fullscreen        = false;
    i_hide_timeout      = 1;
    i_screennumber      = -1;

    vout.clear();

    setWindowFlags( Qt::ToolTip );
    setMinimumWidth( FSC_WIDTH );
    isWideFSC = false;

    setFrameShape( QFrame::StyledPanel );
    setFrameStyle( QFrame::Sunken );
    setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );

    QVBoxLayout *controlLayout2 = new QVBoxLayout( this );
    controlLayout2->setContentsMargins( 4, 6, 4, 2 );

    /* First line */
    InputControlsWidget *inputC = new InputControlsWidget( p_intf, this );
    controlLayout2->addWidget( inputC );

    controlLayout = new QHBoxLayout;
    QString line = getSettings()->value( "MainWindow/FSCtoolbar", FSC_TB_DEFAULT ).toString();
    parseAndCreate( line, controlLayout );
    controlLayout2->addLayout( controlLayout );

    /* hiding timer */
    p_hideTimer = new QTimer( this );
    p_hideTimer->setSingleShot( true );
    CONNECT( p_hideTimer, timeout(), this, hideFSC() );

    /* slow hiding timer */
#if HAVE_TRANSPARENCY
    p_slowHideTimer = new QTimer( this );
    CONNECT( p_slowHideTimer, timeout(), this, slowHideFSC() );
    f_opacity = var_InheritFloat( p_intf, "qt-fs-opacity" );
#endif

    i_sensitivity = var_InheritInteger( p_intf, "qt-fs-sensitivity" );

    vlc_mutex_init_recursive( &lock );

    DCONNECT( THEMIM->getIM(), voutListChanged( vout_thread_t **, int ),
              this, setVoutList( vout_thread_t **, int ) );

    /* First Move */
    previousPosition = getSettings()->value( "FullScreen/pos" ).toPoint();
    screenRes = getSettings()->value( "FullScreen/screen" ).toRect();
    isWideFSC = getSettings()->value( "FullScreen/wide" ).toBool();
    i_screennumber = var_InheritInteger( p_intf, "qt-fullscreen-screennumber" );
}
ListReports::ListReports(const QString &filter,const QString &type_filter,
			 const QString &group,const QString &schedcode,
			 QWidget *parent)
  : QDialog(parent,"",true)
{
  list_filter=filter;
  list_type_filter=type_filter;
  list_group=group;
  list_schedcode=schedcode;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  setCaption(tr("RDLibrary Reports"));

  //
  // Create Fonts
  //
  QFont font=QFont("Helvetica",12,QFont::Bold);
  font.setPixelSize(12);

  //
  // Reports List
  //
  list_reports_box=new QComboBox(this);
  list_reports_box->setGeometry(50,10,sizeHint().width()-60,19);
  list_reports_box->insertItem(tr("Cart Report"));
  list_reports_box->insertItem(tr("Cut Report"));
  list_reports_box->insertItem(tr("Cart Data Dump (fixed width)"));
  list_reports_box->insertItem(tr("Cart Data Dump (CSV)"));
  list_reports_label=new QLabel(list_reports_box,tr("Type:"),this);
  list_reports_label->setGeometry(10,10,35,19);
  list_reports_label->setFont(font);
  list_reports_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(list_reports_box,SIGNAL(activated(int)),
	  this,SLOT(typeActivatedData(int)));

  //
  // Field Names Checkbox
  //
  list_fieldnames_check=new QCheckBox(this);
  list_fieldnames_check->setGeometry(55,34,15,15);
  list_fieldnames_check->setChecked(true);
  list_fieldnames_check->setDisabled(true);
  list_fieldnames_label=
    new QLabel(list_fieldnames_check,tr("Prepend Field Names"),this);
  list_fieldnames_label->setGeometry(75,32,sizeHint().width()-75,19);
  list_fieldnames_label->setFont(font);
  list_fieldnames_label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);
  list_fieldnames_label->setDisabled(true);

  //
  //  Generate Button
  //
  QPushButton *generate_button=new QPushButton(this);
  generate_button->
    setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  generate_button->setDefault(true);
  generate_button->setFont(font);
  generate_button->setText(tr("&Generate"));
  connect(generate_button,SIGNAL(clicked()),this,SLOT(generateData()));

  //
  //  Close Button
  //
  QPushButton *close_button=new QPushButton(this);
  close_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			     80,50);
  close_button->setFont(font);
  close_button->setText(tr("&Close"));
  connect(close_button,SIGNAL(clicked()),this,SLOT(closeData()));
}
Exemple #3
0
void MainWindow::InitializeUi() {
    ui->setupUi(this);
    status_bar_label_ = new QLabel("Ready");
    statusBar()->addWidget(status_bar_label_);
    ui->itemLayout->setAlignment(Qt::AlignTop);
    ui->itemLayout->setAlignment(ui->minimapLabel, Qt::AlignHCenter);
    ui->itemLayout->setAlignment(ui->typeLineLabel, Qt::AlignHCenter);
    ui->itemLayout->setAlignment(ui->nameLabel, Qt::AlignHCenter);
    ui->itemLayout->setAlignment(ui->imageLabel, Qt::AlignHCenter);
    ui->itemLayout->setAlignment(ui->locationLabel, Qt::AlignHCenter);

    tab_bar_ = new QTabBar;
    tab_bar_->installEventFilter(this);
    tab_bar_->setExpanding(false);
    ui->mainLayout->insertWidget(0, tab_bar_);
    tab_bar_->addTab("+");
    connect(tab_bar_, SIGNAL(currentChanged(int)), this, SLOT(OnTabChange(int)));

    Util::PopulateBuyoutTypeComboBox(ui->buyoutTypeComboBox);
    Util::PopulateBuyoutCurrencyComboBox(ui->buyoutCurrencyComboBox);

    connect(ui->buyoutCurrencyComboBox, SIGNAL(activated(int)), this, SLOT(OnBuyoutChange()));
    connect(ui->buyoutTypeComboBox, SIGNAL(activated(int)), this, SLOT(OnBuyoutChange()));
    connect(ui->buyoutValueLineEdit, SIGNAL(textEdited(QString)), this, SLOT(OnBuyoutChange()));

    ui->actionAutomatically_refresh_items->setChecked(app_->items_manager().auto_update());
    UpdateShopMenu();

    search_form_layout_ = new QVBoxLayout;
    search_form_layout_->setAlignment(Qt::AlignTop);
    search_form_layout_->setContentsMargins(0, 0, 0, 0);

    auto search_form_container = new QWidget;
    search_form_container->setLayout(search_form_layout_);

    auto scroll_area = new VerticalScrollArea;
    scroll_area->setFrameShape(QFrame::NoFrame);
    scroll_area->setWidgetResizable(true);
    scroll_area->setWidget(search_form_container);
    scroll_area->setMinimumWidth(150); // TODO(xyz): remove magic numbers
    scroll_area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    ui->horizontalLayout_2->insertWidget(0, scroll_area);
    search_form_container->show();

    ui->horizontalLayout_2->setStretchFactor(scroll_area, 1);
    ui->horizontalLayout_2->setStretchFactor(ui->itemListAndSearchFormLayout, 4);
    ui->horizontalLayout_2->setStretchFactor(ui->itemLayout, 1);

    ui->treeView->setContextMenuPolicy(Qt::CustomContextMenu);
    context_menu_.addAction("Expand All", this, SLOT(OnExpandAll()));
    context_menu_.addAction("Collapse All", this, SLOT(OnCollapseAll()));

    connect(ui->treeView, &QTreeView::customContextMenuRequested, [&](const QPoint &pos) {
        context_menu_.popup(ui->treeView->viewport()->mapToGlobal(pos));
    });

    statusBar()->addPermanentWidget(&online_label_);
    UpdateOnlineGui();

    update_button_.setStyleSheet("color: blue; font-weight: bold;");
    update_button_.setFlat(true);
    update_button_.hide();
    statusBar()->addPermanentWidget(&update_button_);
    connect(&update_button_, &QPushButton::clicked, [=](){
        UpdateChecker::AskUserToUpdate(this);
    });
}
Exemple #4
0
EditJackClient::EditJackClient(RDStation *station,
			       QWidget *parent,const char *name)
  : QDialog(parent,name,true)
{
  QString sql;

  edit_station=station;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());

  setCaption(tr("JACK Client Configuration for ")+edit_station->name());

  //
  // Create Fonts
  //
  QFont normal_font=QFont("Helvetica",12,QFont::Normal);
  normal_font.setPixelSize(12);
  QFont font=QFont("Helvetica",12,QFont::Bold);
  font.setPixelSize(12);

  //
  // JACK Client Description
  //
  edit_jack_description_edit=new QLineEdit(this);
  edit_jack_description_label=
    new QLabel(edit_jack_description_edit,tr("Description:"),this);
  edit_jack_description_label->setFont(font);
  edit_jack_description_label->
    setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // JACK Client Description
  //
  edit_jack_command_line_edit=new QLineEdit(this);
  edit_jack_command_line_label=
    new QLabel(edit_jack_command_line_edit,tr("Command Line:"),this);
  edit_jack_command_line_label->setFont(font);
  edit_jack_command_line_label->
    setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  //  Ok Button
  //
  edit_ok_button=new QPushButton(this,"edit_ok_button");
  edit_ok_button->setDefault(true);
  edit_ok_button->setFont(font);
  edit_ok_button->setText(tr("&OK"));
  connect(edit_ok_button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  edit_cancel_button=new QPushButton(this,"edit_cancel_button");
  edit_cancel_button->setFont(font);
  edit_cancel_button->setText(tr("&Cancel"));
  connect(edit_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
}
EditFeed::EditFeed(const QString &feed,QWidget *parent)
  : QDialog(parent,"",true)
{
  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  feed_feed=new RDFeed(feed,this);

  setCaption(tr("Feed: ")+feed);

  //
  // Create Fonts
  //
  QFont font=QFont("Helvetica",12,QFont::Bold);
  font.setPixelSize(12);
  QFont small_font=QFont("Helvetica",12,QFont::Normal);
  small_font.setPixelSize(12);

  //
  // Feed Name
  //
  feed_keyname_edit=new QLineEdit(this);
  feed_keyname_edit->setGeometry(115,11,100,19);
  feed_keyname_edit->setMaxLength(8);
  feed_keyname_edit->setReadOnly(true);
  QLabel *feed_keyname_label=new QLabel(feed_keyname_edit,tr("Key Name:"),this);
  feed_keyname_label->setGeometry(10,11,100,19);
  feed_keyname_label->setFont(font);
  feed_keyname_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Channel Section
  //
  feed_channel_section_label=new QLabel(tr("CHANNEL VALUES"),this);
  feed_channel_section_label->setGeometry(30,41,130,20);
  feed_channel_section_label->setAlignment(AlignCenter);
  feed_channel_section_label->setFont(font);

  //
  // Channel Title
  //
  feed_channel_title_edit=new QLineEdit(this);
  feed_channel_title_edit->setGeometry(115,60,375,19);
  feed_channel_title_edit->setMaxLength(255);
  feed_channel_title_label=
    new QLabel(feed_channel_title_edit,tr("Title:"),this);
  feed_channel_title_label->setGeometry(20,60,90,19);
  feed_channel_title_label->setFont(font);
  feed_channel_title_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Channel Category
  //
  feed_channel_category_edit=new QLineEdit(this);
  feed_channel_category_edit->setGeometry(115,82,375,19);
  feed_channel_category_edit->setMaxLength(64);
  feed_channel_category_label=
    new QLabel(feed_channel_category_edit,tr("Category:"),this);
  feed_channel_category_label->setGeometry(20,82,90,19);
  feed_channel_category_label->setFont(font);
  feed_channel_category_label->
    setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Channel Link
  //
  feed_channel_link_edit=new QLineEdit(this);
  feed_channel_link_edit->setGeometry(115,104,375,19);
  feed_channel_link_edit->setMaxLength(255);
  feed_channel_link_label=
    new QLabel(feed_channel_link_edit,tr("Link:"),this);
  feed_channel_link_label->setGeometry(20,104,90,19);
  feed_channel_link_label->setFont(font);
  feed_channel_link_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Channel Copyright
  //
  feed_channel_copyright_edit=new QLineEdit(this);
  feed_channel_copyright_edit->setGeometry(115,126,375,19);
  feed_channel_copyright_edit->setMaxLength(64);
  feed_channel_copyright_label=
    new QLabel(feed_channel_copyright_edit,tr("Copyright:"),this);
  feed_channel_copyright_label->setGeometry(20,126,90,19);
  feed_channel_copyright_label->setFont(font);
  feed_channel_copyright_label->
    setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Channel Webmaster
  //
  feed_channel_webmaster_edit=new QLineEdit(this);
  feed_channel_webmaster_edit->setGeometry(115,148,375,19);
  feed_channel_webmaster_edit->setMaxLength(64);
  feed_channel_webmaster_label=
    new QLabel(feed_channel_webmaster_edit,tr("Webmaster:"),this);
  feed_channel_webmaster_label->setGeometry(20,148,90,19);
  feed_channel_webmaster_label->setFont(font);
  feed_channel_webmaster_label->
    setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Channel Language
  //
  feed_channel_language_edit=new QLineEdit(this);
  feed_channel_language_edit->
    setGeometry(115,170,60,19);
  feed_channel_language_edit->setMaxLength(5);
  feed_channel_language_label=
    new QLabel(feed_channel_language_edit,tr("Language:"),this);
  feed_channel_language_label->setGeometry(20,170,90,19);
  feed_channel_language_label->setFont(font);
  feed_channel_language_label->
    setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Channel Description
  //
  feed_channel_description_edit=new QTextEdit(this);
  feed_channel_description_edit->
    setGeometry(115,192,375,76);
  feed_channel_description_label=
    new QLabel(feed_channel_description_edit,tr("Description:"),this);
  feed_channel_description_label->setGeometry(20,192,90,19);
  feed_channel_description_label->setFont(font);
  feed_channel_description_label->
    setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Purge Audio URL
  //
  feed_purge_url_edit=new QLineEdit(this);
  feed_purge_url_edit->setGeometry(155,280,335,19);
  feed_purge_url_edit->setMaxLength(255);
  connect(feed_purge_url_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(purgeUrlChangedData(const QString &)));
  feed_purge_url_label=
    new QLabel(feed_purge_url_edit,tr("Audio Upload URL:"),this);
  feed_purge_url_label->setGeometry(20,280,130,19);
  feed_purge_url_label->setFont(font);
  feed_purge_url_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Purge Username
  //
  feed_purge_username_edit=new QLineEdit(this);
  feed_purge_username_edit->setGeometry(225,302,95,19);
  feed_purge_username_edit->setMaxLength(64);
  connect(feed_purge_username_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(purgeUsernameChangedData(const QString &)));
  feed_purge_username_label=
    new QLabel(feed_purge_username_edit,tr("Username:"******"Password:"******"Upload Format:"),this);
  feed_format_label->setGeometry(5,324,145,20);
  feed_format_label->setFont(font);
  feed_format_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  feed_format_button=new QPushButton(this);
  feed_format_button->setGeometry(450,324,40,24);
  feed_format_button->setFont(small_font);
  feed_format_button->setText(tr("S&et"));
  connect(feed_format_button,SIGNAL(clicked()),this,SLOT(setFormatData()));

  //
  // Normalize Check Box
  //
  feed_normalize_box=new QCheckBox(this);
  feed_normalize_box->setGeometry(155,348,15,15);
  feed_normalize_box->setChecked(true);
  feed_normalize_check_label=
    new QLabel(feed_normalize_box,tr("Normalize"),this);
  feed_normalize_check_label->setGeometry(175,346,83,20);
  feed_normalize_check_label->setFont(font);
  feed_normalize_check_label->setAlignment(AlignLeft|AlignVCenter);
  connect(feed_normalize_box,SIGNAL(toggled(bool)),
	  this,SLOT(normalizeCheckData(bool)));

  //
  // Normalize Level
  //
  feed_normalize_spin=new QSpinBox(this);
  feed_normalize_spin->setGeometry(295,346,40,20);
  feed_normalize_spin->setRange(-30,-1);
  feed_normalize_label=new QLabel(feed_normalize_spin,tr("Level:"),this);
  feed_normalize_label->setGeometry(245,346,45,20);
  feed_normalize_label->setFont(font);
  feed_normalize_label->setAlignment(AlignRight|AlignVCenter);
  feed_normalize_unit_label=new QLabel(tr("dBFS"),this);
  feed_normalize_unit_label->setGeometry(340,346,40,20);
  feed_normalize_unit_label->setFont(font);
  feed_normalize_unit_label->setAlignment(AlignLeft|AlignVCenter);

  //
  // Base Audio URL
  //
  feed_base_url_edit=new QLineEdit(this);
  feed_base_url_edit->setGeometry(155,368,335,19);
  feed_base_url_edit->setMaxLength(255);
  feed_base_url_label=
    new QLabel(feed_base_url_edit,tr("Audio Download URL:"),this);
  feed_base_url_label->setGeometry(20,368,130,19);
  feed_base_url_label->setFont(font);
  feed_base_url_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Keep Expired Metadata Checkbox
  //
  feed_keep_metadata_box=new QCheckBox(this);
  feed_keep_metadata_box->setGeometry(155,390,15,15);
  feed_keep_metadata_label=
    new QLabel(feed_keep_metadata_box,tr("Keep Expired Metadata"),this);
  feed_keep_metadata_label->setGeometry(175,390,180,19);
  feed_keep_metadata_label->setFont(font);
  feed_keep_metadata_label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);
 
  //
  // AutoPost Checkbox
  //
  feed_autopost_box=new QCheckBox(this);
  feed_autopost_box->setGeometry(365,390,15,15);
  feed_autopost_label=
    new QLabel(feed_autopost_box,tr("Enable AutoPost"),this);
  feed_autopost_label->setGeometry(385,390,200,19);
  feed_autopost_label->setFont(font);
  feed_autopost_label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);
 
  //
  // Enclosure Preamble
  //
  feed_base_preamble_edit=new QLineEdit(this);
  feed_base_preamble_edit->setGeometry(155,412,335,19);
  feed_base_preamble_edit->setMaxLength(255);
  feed_base_preamble_label=
    new QLabel(feed_base_preamble_edit,tr("Enclosure Preamble:"),this);
  feed_base_preamble_label->setGeometry(20,412,130,19);
  feed_base_preamble_label->setFont(font);
  feed_base_preamble_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Audio File Extension
  //
  feed_extension_edit=new QLineEdit(this);
  feed_extension_edit->setGeometry(155,434,70,19);
  feed_extension_edit->setMaxLength(16);
  feed_extension_label=
    new QLabel(feed_extension_edit,tr("Audio Extension:"),this);
  feed_extension_label->setGeometry(20,434,130,19);
  feed_extension_label->setFont(font);
  feed_extension_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Maximum Shelf Life
  //
  feed_max_shelf_life_spin=new QSpinBox(this);
  feed_max_shelf_life_spin->setGeometry(155,456,60,19);
  feed_max_shelf_life_spin->setRange(0,365);
  feed_max_shelf_life_spin->setSpecialValueText(tr("None"));
  feed_max_shelf_life_label=
    new QLabel(feed_max_shelf_life_spin,tr("Maximum Shelf Life:"),this);
  feed_max_shelf_life_label->setGeometry(20,456,130,19);
  feed_max_shelf_life_label->setFont(font);
  feed_max_shelf_life_label->
    setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  feed_max_shelf_life_unit_label=
    new QLabel(feed_max_shelf_life_spin,tr("days"),this);
  feed_max_shelf_life_unit_label->setGeometry(220,456,50,19);
  feed_max_shelf_life_unit_label->setFont(font);
  feed_max_shelf_life_unit_label->
    setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Episode Order
  //
  feed_castorder_box=new QComboBox(this);
  feed_castorder_box->setGeometry(155,478,100,19);
  feed_castorder_box->insertItem(tr("Descending"));
  feed_castorder_box->insertItem(tr("Ascending"));
  feed_castorder_label=
    new QLabel(feed_castorder_box,tr("Episode Sort Order:"),this);
  feed_castorder_label->setGeometry(20,478,130,19);
  feed_castorder_label->setFont(font);
  feed_castorder_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Media Link Mode
  //
  feed_media_link_mode_box=new QComboBox(this);
  feed_media_link_mode_box->setGeometry(155,500,100,19);
  feed_media_link_mode_box->insertItem(tr("None"));
  feed_media_link_mode_box->insertItem(tr("Direct"));
  feed_media_link_mode_box->insertItem(tr("Counted"));
  feed_media_link_mode_label=
    new QLabel(feed_media_link_mode_box,tr("Media Link Mode:"),this);
  feed_media_link_mode_label->setGeometry(20,500,130,19);
  feed_media_link_mode_label->setFont(font);
  feed_media_link_mode_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Feed Redirection
  //
  feed_redirect_check=new QCheckBox(this);
  feed_redirect_check->setGeometry(20,532,15,15);
  QLabel *label=
    new QLabel(feed_redirect_check,tr("Enable Feed Redirection"),this);
  label->setGeometry(40,532,200,19);
  label->setFont(font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  feed_redirect_edit=new QLineEdit(this);
  feed_redirect_edit->setGeometry(85,552,405,20);
  feed_redirect_label=new QLabel(feed_redirect_edit,tr("URL:"),this);
  feed_redirect_label->setGeometry(40,552,40,19);
  feed_redirect_label->setFont(font);
  feed_redirect_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Header XML
  //
  feed_header_xml_edit=new QTextEdit(this);
  feed_header_xml_edit->
    setGeometry(615,10,365,76);
  feed_header_xml_label=new QLabel(feed_header_xml_edit,tr("Header XML:"),this);
  feed_header_xml_label->setGeometry(520,10,90,19);
  feed_header_xml_label->setFont(font);
  feed_header_xml_label->
    setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Channel XML
  //
  feed_channel_xml_edit=new QTextEdit(this);
  feed_channel_xml_edit->
    setGeometry(615,88,365,176);
  feed_channel_xml_label=
    new QLabel(feed_channel_xml_edit,tr("Channel XML:"),this);
  feed_channel_xml_label->setGeometry(520,88,90,19);
  feed_channel_xml_label->setFont(font);
  feed_channel_xml_label->
    setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Item XML
  //
  feed_item_xml_edit=new QTextEdit(this);
  feed_item_xml_edit->
    setGeometry(615,270,365,176);
  feed_item_xml_label=new QLabel(feed_item_xml_edit,tr("Item XML:"),this);
  feed_item_xml_label->setGeometry(520,270,90,19);
  feed_item_xml_label->setFont(font);
  feed_item_xml_label->
    setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  //  Metadata Button
  //
  feed_metadata_button=new QPushButton(this);
  feed_metadata_button->setGeometry(615,460,150,50);
  feed_metadata_button->setDefault(true);
  feed_metadata_button->setFont(font);
  feed_metadata_button->setText(tr("&Define Auxiliary\nMetadata Fields"));
  connect(feed_metadata_button,SIGNAL(clicked()),this,SLOT(editData()));

  //
  //  Ok Button
  //
  QPushButton *ok_button=new QPushButton(this);
  ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  ok_button->setDefault(true);
  ok_button->setFont(font);
  ok_button->setText(tr("&OK"));
  connect(ok_button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  QPushButton *cancel_button=new QPushButton(this);
  cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			     80,50);
  cancel_button->setFont(font);
  cancel_button->setText(tr("&Cancel"));
  connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));

  //
  // Populate Values
  //
  feed_keyname_edit->setText(feed_feed->keyName());
  feed_channel_title_edit->setText(feed_feed->channelTitle());
  feed_channel_category_edit->setText(feed_feed->channelCategory());
  feed_channel_link_edit->setText(feed_feed->channelLink());
  feed_channel_copyright_edit->setText(feed_feed->channelCopyright());
  feed_channel_webmaster_edit->setText(feed_feed->channelWebmaster());
  feed_channel_description_edit->setText(feed_feed->channelDescription());
  feed_channel_language_edit->setText(feed_feed->channelLanguage());
  feed_base_url_edit->setText(feed_feed->baseUrl());
  feed_base_preamble_edit->setText(feed_feed->basePreamble());
  feed_purge_url_edit->setText(feed_feed->purgeUrl());
  feed_purge_username_edit->setText(feed_feed->purgeUsername());
  feed_purge_password_edit->setText(feed_feed->purgePassword());
  feed_header_xml_edit->setText(feed_feed->headerXml());
  feed_channel_xml_edit->setText(feed_feed->channelXml());
  feed_item_xml_edit->setText(feed_feed->itemXml());
  feed_max_shelf_life_spin->setValue(feed_feed->maxShelfLife());
  feed_autopost_box->setChecked(feed_feed->enableAutopost());
  feed_keep_metadata_box->setChecked(feed_feed->keepMetadata());
  feed_settings.setFormat(feed_feed->uploadFormat());
  feed_settings.setChannels(feed_feed->uploadChannels());
  feed_settings.setSampleRate(feed_feed->uploadSampleRate());
  feed_settings.setBitRate(feed_feed->uploadBitRate());
  feed_settings.setQuality(feed_feed->uploadQuality());
  feed_extension_edit->setText(feed_feed->uploadExtension());
  feed_format_edit->setText(feed_settings.description());
  if(feed_feed->normalizeLevel()>0) {
    feed_normalize_box->setChecked(false);
  }
  else {
    feed_normalize_box->setChecked(true);
    feed_normalize_spin->setValue(feed_feed->normalizeLevel()/1000);
  }
  feed_castorder_box->setCurrentItem(feed_feed->castOrder());
  feed_media_link_mode_box->setCurrentItem((int)feed_feed->mediaLinkMode());
  feed_redirect_edit->setText(feed_feed->redirectPath());
  feed_redirect_check->setChecked(!feed_redirect_edit->text().isEmpty());
  normalizeCheckData(feed_normalize_box->isChecked());

  RedirectChanged(feed_redirect_check->isChecked());
  connect(feed_redirect_check,SIGNAL(toggled(bool)),
	  this,SLOT(redirectToggledData(bool)));
}
EditSchedRules::EditSchedRules(QString clock,unsigned *artistsep,SchedRulesList *schedruleslist,bool *rules_modified,QWidget *parent)
  : QDialog(parent,"",true)
{
  edit_artistsep=artistsep;
  edit_rules_modified=rules_modified;
  sched_rules_list = schedruleslist;
  clockname = clock;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  setCaption(tr("Scheduler Rules"));

  //
  // Create Fonts
  //
  QFont font=QFont("Helvetica",12,QFont::Bold);
  font.setPixelSize(12);

  artistSepLabel = new QLabel( this, "artistSepLabel" );
  artistSepLabel->setGeometry( QRect( 10, 10, 130, 20 ) );
  artistSepLabel->setFont(font);
  artistSepLabel->setText(tr("Artist Separation:"));

  artistSepSpinBox = new QSpinBox( this, "artistSepSpinBox" );
  artistSepSpinBox->setGeometry( QRect( 160, 10, 70, 20 ) );
  artistSepSpinBox->setMaxValue( 10000 );
  artistSepSpinBox->setValue( *edit_artistsep );


  //
  //  Edit Button
  //
  QPushButton *list_edit_button=new QPushButton(this,"list_edit_button");
  list_edit_button->setGeometry(10,sizeHint().height()-60,80,50);
  list_edit_button->setFont(font);
  list_edit_button->setText(tr("&Edit"));
  connect(list_edit_button,SIGNAL(clicked()),this,SLOT(editData()));

  //
  //  Import Button
  //
  QPushButton *list_import_button=new QPushButton(this,"list_import_button");
  list_import_button->setGeometry(100,sizeHint().height()-60,80,50);
  list_import_button->setFont(font);
  list_import_button->setText(tr("&Import"));
  connect(list_import_button,SIGNAL(clicked()),this,SLOT(importData()));

  //  Ok Button
  //
  QPushButton *ok_button=new QPushButton(this,"ok_button");
  ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  ok_button->setDefault(true);
  ok_button->setFont(font);
  ok_button->setText(tr("&OK"));
  connect(ok_button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  QPushButton *cancel_button=new QPushButton(this,"cancel_button");
  cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			     80,50);
  cancel_button->setFont(font);
  cancel_button->setText(tr("&Cancel"));
  connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));


  // List
  list_schedCodes_view=new RDListView(this,"list_schedCodes_view");
  list_schedCodes_view->setGeometry(10,60,size().width()-20,size().height()-140);
  list_schedCodes_view->setAllColumnsShowFocus(true);
  list_schedCodes_view->addColumn(tr("CODE"));
  list_schedCodes_view->addColumn(tr("MAX. IN A ROW"));
  list_schedCodes_view->addColumn(tr("MIN. WAIT"));
  list_schedCodes_view->addColumn(tr("DO NOT SCHEDULE AFTER"));
  list_schedCodes_view->addColumn(tr("OR AFTER"));
  list_schedCodes_view->addColumn(tr("OR AFTER"));
  list_schedCodes_view->addColumn(tr("DESCRIPTION"));
  
  QLabel *list_box_label=new QLabel(list_schedCodes_view,tr("Scheduler Codes:"),this,"list_box_label");
  list_box_label->setFont(font);
  list_box_label->setGeometry(10,40,200,20);
  connect(list_schedCodes_view,
	  SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),
	  this,
	  SLOT(doubleClickedData(QListViewItem *,const QPoint &,int)));

 edit_modified=false;
 Load();
}
Exemple #7
0
void QILineEdit::setMinimumWidthByText (const QString &aText)
{
    setMinimumWidth (featTextWidth (aText).width());
}
EditSchedCode::EditSchedCode(QString schedCode,QString description,QWidget *parent,const char *name) : QDialog(parent,name,true)
{
  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  schedCode_code=new QString(schedCode);
  schedCode_description=new QString(description);
  
  setCaption(tr("Scheduler Code: ")+schedCode);

  //
  // Create Fonts
  //
  QFont font=QFont("Helvetica",12,QFont::Bold);
  font.setPixelSize(12);

  //
  // Text Validators
  //
  RDTextValidator *validator=new RDTextValidator(this,"validator");
  //
  // Code Name
  //
  schedCode_name_edit=new QLineEdit(this,"schedCode_name_edit");
  schedCode_name_edit->setGeometry(115,11,100,19);
  schedCode_name_edit->setMaxLength(10);
  schedCode_name_edit->setReadOnly(true);
  QLabel *schedCode_name_label=new QLabel(schedCode_name_edit,tr("Scheduler Code:"),this,"schedCode_name_label");
  schedCode_name_label->setGeometry(10,11,100,19);
  schedCode_name_label->setFont(font);
  schedCode_name_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Code Description
  //
  schedCode_description_edit=new QLineEdit(this,"schedCode_description_edit");
  schedCode_description_edit->setGeometry(115,32,sizeHint().width()-175,19);
  schedCode_description_edit->setMaxLength(255);
  schedCode_description_edit->setValidator(validator);
  QLabel *schedCode_description_label=new QLabel(schedCode_description_edit,
					     tr("Code Description:"),this,
					     "schedCode_description_label");
  schedCode_description_label->setGeometry(10,32,100,19);
  schedCode_description_label->setFont(font);
  schedCode_description_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  //  Ok Button
  //
  QPushButton *ok_button=new QPushButton(this,"ok_button");
  ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  ok_button->setDefault(true);
  ok_button->setFont(font);
  ok_button->setText(tr("&OK"));
  connect(ok_button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  QPushButton *cancel_button=new QPushButton(this,"cancel_button");
  cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			     80,50);
  cancel_button->setFont(font);
  cancel_button->setText(tr("&Cancel"));
  connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));

  //
  // Populate Fields
  //
  schedCode_name_edit->setText(*schedCode_code);
  schedCode_description_edit->setText(*schedCode_description);
}
Exemple #9
0
EditCartEvent::EditCartEvent(int id,std::vector<int> *adds,
			     QWidget *parent,const char *name)
  : QDialog(parent,name,true)
{
  QString sql;
  RDSqlQuery *q;
  QString temp;
  int cartnum;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  //
  // Generate Fonts
  //
  QFont button_font=QFont("Helvetica",12,QFont::Bold);
  button_font.setPixelSize(12);
  QFont label_font=QFont("Helvetica",12,QFont::Bold);
  label_font.setPixelSize(12);
  QFont day_font=QFont("Helvetica",10,QFont::Normal);
  day_font.setPixelSize(10);

  edit_deck=NULL;
  edit_added_events=adds;

  setCaption(tr("Edit Cart Event"));

  //
  // Text Validator
  //
  RDTextValidator *validator=new RDTextValidator(this,"validator");

  //
  // The Recording Record
  //
  edit_recording=new RDRecording(id);
  if((cartnum=edit_recording->macroCart())>=0) {
    edit_cart=new RDCart(cartnum);
  }
  else {
    edit_cart=NULL;
  }

  //
  // Active Button
  //
  edit_active_button=new QCheckBox(this,"edit_active_button");
  edit_active_button->setGeometry(10,11,20,20);
  QLabel *label=new QLabel(edit_active_button,
		   tr("Event Active"),this,"edit_active_label");
  label->setGeometry(30,11,125,20);
  label->setFont(label_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Station
  //
  edit_station_box=new QComboBox(this,"edit_station_box");
  edit_station_box->setGeometry(200,10,140,23);
  label=new QLabel(edit_station_box,tr("Location:"),this,
				       "edit_station_label");
  label->setGeometry(125,10,70,23);
  label->setFont(label_font);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Start Time
  //
  edit_starttime_edit=new QTimeEdit(this,"edit_starttime_edit");
  edit_starttime_edit->setGeometry(sizeHint().width()-90,12,80,20);
  label=new QLabel(edit_starttime_edit,
		   tr("Start Time:"),this,"edit_starttime_label");
  label->setGeometry(sizeHint().width()-175,12,80,20);
  label->setFont(label_font);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Description
  //
  edit_description_edit=new QLineEdit(this,"edit_description_edit");
  edit_description_edit->setGeometry(115,43,sizeHint().width()-125,20);
  edit_description_edit->setValidator(validator);
  label=new QLabel(edit_description_edit,
		   tr("Description:"),this,"edit_description_label");
  label->setGeometry(10,43,100,20);
  label->setFont(label_font);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Cart Number
  //
  edit_destination_edit=new QLineEdit(this,"edit_destination_edit");
  edit_destination_edit->setGeometry(115,70,60,20);
  edit_destination_edit->setReadOnly(false);
  label=new QLabel(edit_destination_edit,
		   tr("Cart Number:"),this,"edit_destination_label");
  label->setGeometry(10,73,100,19);
  label->setFont(label_font);
  label->setAlignment(AlignRight|ShowPrefix);
  QPushButton *button=new QPushButton(this,"destination_button");
  button->setGeometry(185,68,60,24);
  button->setFont(day_font);
  button->setText(tr("&Select"));
  connect(button,SIGNAL(clicked()),this,SLOT(selectCartData()));

  //
  // Button Label
  //
  label=new QLabel(tr("Active Days"),this,"active_days_label");
  label->setGeometry(47,101,90,19);
  label->setFont(label_font);
  label->setAlignment(AlignHCenter|ShowPrefix);

  //
  // Monday Button
  //
  edit_mon_button=new QCheckBox(this,"edit_mon_button");
  edit_mon_button->setGeometry(20,120,20,20);
  label=new QLabel(edit_mon_button,
		   tr("Monday"),this,"edit_mon_label");
  label->setGeometry(40,120,115,20);
  label->setFont(day_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Tuesday Button
  //
  edit_tue_button=new QCheckBox(this,"edit_tue_button");
  edit_tue_button->setGeometry(115,120,20,20);
  label=new QLabel(edit_tue_button,
		   tr("Tuesday"),this,"edit_tue_label");
  label->setGeometry(135,120,115,20);
  label->setFont(day_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Wednesday Button
  //
  edit_wed_button=new QCheckBox(this,"edit_wed_button");
  edit_wed_button->setGeometry(215,120,20,20);
  label=new QLabel(edit_wed_button,
		   tr("Wednesday"),this,"edit_wed_label");
  label->setGeometry(235,120,115,20);
  label->setFont(day_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Thursday Button
  //
  edit_thu_button=new QCheckBox(this,"edit_thu_button");
  edit_thu_button->setGeometry(335,120,20,20);
  label=new QLabel(edit_thu_button,
		   tr("Thursday"),this,"edit_thu_label");
  label->setGeometry(355,120,115,20);
  label->setFont(day_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Friday Button
  //
  edit_fri_button=new QCheckBox(this,"edit_fri_button");
  edit_fri_button->setGeometry(440,120,20,20);
  label=new QLabel(edit_fri_button,
		   tr("Friday"),this,"edit_fri_label");
  label->setGeometry(460,120,40,20);
  label->setFont(day_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Saturday Button
  //
  edit_sat_button=new QCheckBox(this,"edit_sat_button");
  edit_sat_button->setGeometry(130,145,20,20);
  label=new QLabel(edit_sat_button,
		   tr("Saturday"),this,"edit_sat_label");
  label->setGeometry(150,145,60,20);
  label->setFont(day_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Sunday Button
  //
  edit_sun_button=new QCheckBox(this,"edit_sun_button");
  edit_sun_button->setGeometry(300,145,20,20);
  label=new QLabel(edit_sun_button,
		   tr("Sunday"),this,"edit_sun_label");
  label->setGeometry(320,145,60,20);
  label->setFont(day_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // OneShot Button
  //
  edit_oneshot_box=new QCheckBox(this,"edit_oneshot_box");
  edit_oneshot_box->setGeometry(20,180,15,15);
  label=new QLabel(edit_oneshot_box,
		   tr("Make OneShot"),this,"edit_oneshot_label");
  label->setGeometry(40,178,115,20);
  label->setFont(label_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  //  Save As Button
  //
  button=new QPushButton(this,"saveas_button");
  button->setGeometry(sizeHint().width()-300,sizeHint().height()-60,80,50);
  button->setFont(button_font);
  button->setText(tr("&Save As\nNew"));
  connect(button,SIGNAL(clicked()),this,SLOT(saveasData()));
  if(adds==NULL) {
    button->hide();
  }

  //
  //  Ok Button
  //
  button=new QPushButton(this,"ok_button");
  button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  button->setDefault(true);
  button->setFont(button_font);
  button->setText(tr("&OK"));
  connect(button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  button=new QPushButton(this,"cancel_button");
  button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50);
  button->setFont(button_font);
  button->setText(tr("&Cancel"));
  connect(button,SIGNAL(clicked()),this,SLOT(cancelData()));

  //
  // Populate Data
  //
  q=new RDSqlQuery("select NAME from STATIONS where NAME!=\"DEFAULT\"");
  while(q->next()) {
    edit_station_box->insertItem(q->value(0).toString());
    if(edit_recording->station()==q->value(0).toString()) {
      edit_station_box->setCurrentItem(edit_station_box->count()-1);
    }
  }
  delete q;
  edit_active_button->setChecked(edit_recording->isActive());
  edit_starttime_edit->setTime(edit_recording->startTime());
  edit_description_edit->setText(edit_recording->description());
  if(edit_cart!=NULL) {
    edit_destination_edit->
      setText(QString().sprintf("%06d",edit_cart->number()));
  }
  edit_mon_button->setChecked(edit_recording->mon());
  edit_tue_button->setChecked(edit_recording->tue());
  edit_wed_button->setChecked(edit_recording->wed());
  edit_thu_button->setChecked(edit_recording->thu());
  edit_fri_button->setChecked(edit_recording->fri());
  edit_sat_button->setChecked(edit_recording->sat());
  edit_sun_button->setChecked(edit_recording->sun());
  edit_oneshot_box->setChecked(edit_recording->oneShot());
}
Exemple #10
0
void StatusLabel::setWidth(int width)
{
	setMinimumWidth(width);
	setMaximumHeight(width);
}
TransmitPAWidget::TransmitPAWidget(QWidget *parent)
	: QWidget(parent)
	, set(Settings::instance())
	, m_minimumWidgetWidth(set->getMinimumWidgetWidth())
	, m_minimumGroupBoxWidth(0)
{
	setMinimumWidth(m_minimumWidgetWidth);
	setContentsMargins(4, 8, 4, 0);
	setMouseTracking(true);
	
	createGainGroup();
	//createTransmitFilterGroup();
	//createPTTOptionsGroup();


	QBoxLayout *mainLayout = new QBoxLayout(QBoxLayout::TopToBottom, this);
	mainLayout->setSpacing(5);
	mainLayout->setMargin(0);
	mainLayout->addSpacing(8);

	QHBoxLayout *hbox1 = new QHBoxLayout();
	hbox1->setSpacing(0);
	hbox1->setContentsMargins(4, 0, 4, 0);
	hbox1->addWidget(gainGroup);

//	QHBoxLayout *hbox2 = new QHBoxLayout();
//	hbox2->setSpacing(0);
//	hbox2->setContentsMargins(4, 0, 4, 0);
//	hbox2->addWidget(transmitFilterGroup);
//
//	QHBoxLayout *hbox3 = new QHBoxLayout();
//	hbox3->setSpacing(0);
//	hbox3->setContentsMargins(4, 0, 4, 0);
//	hbox3->addWidget(pttOptionsGroup);

	/*QHBoxLayout *hbox4 = new QHBoxLayout();
	hbox4->setSpacing(0);
	hbox4->setContentsMargins(4, 0, 4, 0);
	hbox4->addWidget(searchNetworkDeviceGroupBox);

	if (m_hwInterface == QSDR::NoInterfaceMode) {
		
		deviceNIGroupBox->hide();
		searchNetworkDeviceGroupBox->hide();
	}

	QHBoxLayout *hbox5 = new QHBoxLayout();
	hbox5->setSpacing(0);
	hbox5->setContentsMargins(4, 0, 4, 0);
	hbox5->addWidget(source10MhzExclusiveGroup);

	QHBoxLayout *hbox6 = new QHBoxLayout();
	hbox6->setSpacing(0);
	hbox6->setContentsMargins(4, 0, 4, 0);
	hbox6->addWidget(source122_88MhzExclusiveGroup);

	QHBoxLayout *hbox7 = new QHBoxLayout();
	hbox7->setSpacing(0);
	hbox7->setContentsMargins(4, 0, 4, 0);
	hbox7->addWidget(numberOfReceiversGroup());*/

	mainLayout->addLayout(hbox1);
	//mainLayout->addLayout(hbox2);
	//mainLayout->addLayout(hbox3);
	/*mainLayout->addLayout(hbox4);
	mainLayout->addLayout(hbox5);
	mainLayout->addLayout(hbox6);
	mainLayout->addLayout(hbox7);*/
	mainLayout->addStretch();
	setLayout(mainLayout);

	setupConnections();
}
Exemple #12
0
void PinDialog::init( PinFlags flags, const QString &title, TokenData::TokenFlags token )
{
	setMinimumWidth( 350 );
	setWindowModality( Qt::ApplicationModal );

	QLabel *label = new QLabel( this );
	QVBoxLayout *l = new QVBoxLayout( this );
	l->addWidget( label );

	QString _title = title;
	QString text;

	if( token & TokenData::PinFinalTry )
		text += "<font color='red'><b>" + tr("PIN will be locked next failed attempt") + "</b></font><br />";
	else if( token & TokenData::PinCountLow )
		text += "<font color='red'><b>" + tr("PIN has been entered incorrectly one time") + "</b></font><br />";

	text += QString( "<b>%1</b><br />" ).arg( title );
	if( flags & Pin2Type )
	{
		_title = tr("Signing") + " - " + title;
		QString t = flags & PinpadFlag ?
			tr("For using sign certificate enter PIN2 at the reader") :
			tr("For using sign certificate enter PIN2");
		text += tr("Selected action requires sign certificate.") + "<br />" + t;
		regexp.setPattern( "\\d{5,12}" );
	}
	else
	{
		_title = tr("Authentication") + " - " + title;
		QString t = flags & PinpadFlag ?
			tr("For using authentication certificate enter PIN1 at the reader") :
			tr("For using authentication certificate enter PIN1");
		text += tr("Selected action requires authentication certificate.") + "<br />" + t;
		regexp.setPattern( "\\d{4,12}" );
	}
	setWindowTitle( _title );
	label->setText( text );
	Common::setAccessibleName( label );

	if( flags & PinpadFlag )
	{
		setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowCloseButtonHint );
		QProgressBar *progress = new QProgressBar( this );
		progress->setRange( 0, 30 );
		progress->setValue( progress->maximum() );
		progress->setTextVisible( false );
		l->addWidget( progress );
		QTimeLine *statusTimer = new QTimeLine( progress->maximum() * 1000, this );
		statusTimer->setCurveShape( QTimeLine::LinearCurve );
		statusTimer->setFrameRange( progress->maximum(), progress->minimum() );
		connect( statusTimer, SIGNAL(frameChanged(int)), progress, SLOT(setValue(int)) );
		connect( this, SIGNAL(startTimer()), statusTimer, SLOT(start()) );
	}
	else if( !(flags & PinpadNoProgressFlag) )
	{
		m_text = new QLineEdit( this );
		m_text->setEchoMode( QLineEdit::Password );
		m_text->setFocus();
		m_text->setValidator( new QRegExpValidator( regexp, m_text ) );
		connect( m_text, SIGNAL(textEdited(QString)), SLOT(textEdited(QString)) );
		l->addWidget( m_text );
		label->setBuddy( m_text );

		QDialogButtonBox *buttons = new QDialogButtonBox(
			QDialogButtonBox::Ok|QDialogButtonBox::Cancel, Qt::Horizontal, this );
		ok = buttons->button( QDialogButtonBox::Ok );
		ok->setAutoDefault( true );
		connect( buttons, SIGNAL(accepted()), SLOT(accept()) );
		connect( buttons, SIGNAL(rejected()), SLOT(reject()) );
		l->addWidget( buttons );

		textEdited( QString() );
	}
}
void KoListLevelProperties::loadOdf(KoShapeLoadingContext& scontext, const KoXmlElement& style)
{
    KoOdfLoadingContext &context = scontext.odfLoadingContext();

    // The text:level attribute specifies the level of the number list
    // style. It can be used on all list-level styles.
    const int level = qMax(1, style.attributeNS(KoXmlNS::text, "level", QString()).toInt());
    // The text:display-levels attribute specifies the number of
    // levels whose numbers are displayed at the current level.
    const QString displayLevel = style.attributeNS(KoXmlNS::text,
                                 "display-levels", QString());

    if (style.localName() == "list-level-style-bullet") {   // list with bullets

        //1.6: KoParagCounter::loadOasisListStyle
        QString bulletChar = style.isNull() ? QString() : style.attributeNS(KoXmlNS::text, "bullet-char", QString());
        kDebug(32500) << "style.localName()=" << style.localName() << "level=" << level << "displayLevel=" << displayLevel << "bulletChar=" << bulletChar;
        if (bulletChar.isEmpty()) {  // list without any visible bullets
            setStyle(KoListStyle::CustomCharItem);
            setBulletCharacter(QChar());
        } else { // try to determinate the bullet we should use
            switch (bulletChar[0].unicode()) {
            case 0x2022: // bullet, a small disc -> circle
                //TODO use BulletSize to differ between small and large discs
                setStyle(KoListStyle::DiscItem);
                break;
            case 0x25CF: // black circle, large disc -> disc
            case 0xF0B7: // #113361
                setStyle(KoListStyle::DiscItem);
                break;
            case 0xE00C: // losange => rhombus
                setStyle(KoListStyle::RhombusItem);
                break;
            case 0xE00A: // square. Not in OASIS (reserved Unicode area!), but used in both OOo and kotext.
                setStyle(KoListStyle::SquareItem);
                break;
            case 0x27A2: // two-colors right-pointing triangle
                setStyle(KoListStyle::RightArrowHeadItem);
                break;
            case 0x2794: // arrow to right
                setStyle(KoListStyle::RightArrowItem);
                break;
            case 0x2714: // checkmark
                setStyle(KoListStyle::HeavyCheckMarkItem);
                break;
            case 0x2d: // minus
                setStyle(KoListStyle::CustomCharItem);
                break;
            case 0x2717: // cross
                setStyle(KoListStyle::BallotXItem);
                break;
            default:
                QChar customBulletChar = bulletChar[0];
                kDebug(32500) << "Unhandled bullet code 0x" << QString::number((uint)customBulletChar.unicode(), 16);
                kDebug(32500) << "Should use the style =>" << style.attributeNS(KoXmlNS::text, "style-name", QString()) << "<=";
                setStyle(KoListStyle::CustomCharItem);
                /*
                QString customBulletFont;
                // often StarSymbol when it comes from OO; doesn't matter, Qt finds it in another font if needed.
                if ( listStyleProperties.hasAttributeNS( KoXmlNS::style, "font-name" ) )
                {
                    customBulletFont = listStyleProperties.attributeNS( KoXmlNS::style, "font-name", QString::null );
                    kDebug(32500) <<"customBulletFont style:font-name =" << listStyleProperties.attributeNS( KoXmlNS::style,"font-name", QString::null );
                }
                else if ( listStyleTextProperties.hasAttributeNS( KoXmlNS::fo, "font-family" ) )
                {
                    customBulletFont = listStyleTextProperties.attributeNS( KoXmlNS::fo, "font-family", QString::null );
                    kDebug(32500) <<"customBulletFont fo:font-family =" << listStyleTextProperties.attributeNS( KoXmlNS::fo,"font-family", QString::null );
                }
                // ## TODO in fact we're supposed to read it from the style pointed to by text:style-name
                */
//                     setStyle(KoListStyle::BoxItem); //fallback
                break;
            } // switch
            setBulletCharacter(bulletChar[0]);
        }

    } else if (style.localName() == "list-level-style-number" || style.localName() == "outline-level-style") { // it's a numbered list

        KoOdfNumberDefinition numberDefinition;
        numberDefinition.loadOdf(style);

        switch(numberDefinition.formatSpecification()) {
        case KoOdfNumberDefinition::Empty:
            setStyle(KoListStyle::CustomCharItem);
            setBulletCharacter(QChar());
            break;
        case KoOdfNumberDefinition::AlphabeticLowerCase:
            setStyle(KoListStyle::AlphaLowerItem);
            break;
        case KoOdfNumberDefinition::AlphabeticUpperCase:
            setStyle(KoListStyle::UpperAlphaItem);
            break;
        case KoOdfNumberDefinition::RomanLowerCase:
            setStyle(KoListStyle::RomanLowerItem);
            break;
        case KoOdfNumberDefinition::RomanUpperCase:
            setStyle(KoListStyle::UpperRomanItem);
            break;
        case KoOdfNumberDefinition::Numeric:
        default:
            setStyle(KoListStyle::DecimalItem);
        }

        if (!numberDefinition.prefix().isNull()) {
            setListItemPrefix(numberDefinition.prefix());
        }

        if (!numberDefinition.suffix().isNull()) {
            setListItemSuffix(numberDefinition.suffix());
        }
        const QString startValue = style.attributeNS(KoXmlNS::text, "start-value", QString("1"));
        setStartValue(startValue.toInt());
    }
    else if (style.localName() == "list-level-style-image") {   // list with image
        setStyle(KoListStyle::ImageItem);
        KoImageCollection *imageCollection = scontext.imageCollection();
        const QString href = style.attribute("href");
        if(imageCollection) {
            if (!href.isEmpty()) {
                KoStore *store = context.store();
                setBulletImage(imageCollection->createImageData(href, store));
            } else {
                // check if we have an office:binary data element containing the image data
                const KoXmlElement &binaryData(KoXml::namedItemNS(style, KoXmlNS::office, "binary-data"));
                if (!binaryData.isNull()) {
                    QImage image;
                    if (image.loadFromData(QByteArray::fromBase64(binaryData.text().toLatin1()))) {
                        setBulletImage(imageCollection->createImageData(image));
                    }
                }
            }
        }
    }
    else { // if not defined, we have do nothing
        kDebug(32500) << "stylename else:" << style.localName() << "level=" << level << "displayLevel=" << displayLevel;
        setStyle(KoListStyle::DecimalItem);
        setListItemSuffix(".");
    }

    setLevel(level);
    if (!displayLevel.isEmpty())
        setDisplayLevel(displayLevel.toInt());

    KoXmlElement property;
    forEachElement(property, style) {
        if (property.namespaceURI() != KoXmlNS::style)
            continue;
        const QString localName = property.localName();
        if (localName == "list-level-properties") {
            QString mode(property.attributeNS(KoXmlNS::text, "list-level-position-and-space-mode"));
            if (mode == "label-alignment") {
                KoXmlElement p;
                forEachElement(p, property) {
                     if (p.namespaceURI() == KoXmlNS::style && p.localName() == "list-level-label-alignment") {
                        // The <style:list-level-label-alignment> element and the fo:text-align attribute are used to define
                        // the position and spacing of the list label and the list item. The values of the attributes for
                        // text:space-before, text:min-label-width and text:min-label-distance are assumed to be 0.

                        QString textAlign(p.attributeNS(KoXmlNS::fo, "text-align"));
                        setAlignment(textAlign.isEmpty() ? Qt::AlignLeft : KoText::alignmentFromString(textAlign));

                        QString textindent(p.attributeNS(KoXmlNS::fo, "text-indent"));
                        QString marginleft(p.attributeNS(KoXmlNS::fo, "margin-left"));
                        qreal ti = textindent.isEmpty() ? 0 : KoUnit::parseValue(textindent);
                        qreal ml = marginleft.isEmpty() ? 0 : KoUnit::parseValue(marginleft);
                        setIndent(qMax(0.0, ti + ml));
                
                        setMinimumWidth(0);
                        setMinimumDistance(0);
                        
                        //TODO support ODF 18.829 text:label-followed-by and 18.832 text:list-tab-stop-position
                     }   
                }
            } else { // default is mode == "label-width-and-position"
EditSchedulerCodes::EditSchedulerCodes(QString *sched_codes,QString *remove_codes,QWidget *parent,const char *name)
  : QDialog(parent,name,true)
{
  edit_sched_codes=sched_codes;
  edit_remove_codes=remove_codes;

  QString sql;
  RDSqlQuery *q;
  QString str;

  //
  // Fix the Window Size
  //
  if(edit_remove_codes==NULL) {
    setMinimumWidth(sizeHint().width());
    setMaximumWidth(sizeHint().width());
    }
  else {
    setMinimumWidth(2*sizeHint().width());
    setMaximumWidth(2*sizeHint().width());
    }
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  setCaption(tr("Select Scheduler Codes"));

  //
  // Create Fonts
  //
  QFont font=QFont("Helvetica",11,QFont::Bold);
  font.setPixelSize(11);

  QFont listfont=QFont("Helvetica",11);
  font.setPixelSize(11);


  //
  // Services Selector
  //
  codes_sel=new RDListSelector(this,"codes_sel");
  codes_sel->setFont(listfont);
  codes_sel->setGeometry(10,10,380,200);
  codes_sel->sourceSetLabel(tr("Available Codes"));
  if(edit_remove_codes==NULL) {
    codes_sel->destSetLabel(tr("Assigned Codes"));
    }
  else {
    codes_sel->destSetLabel(tr("ASSIGN to Carts"));
    
    remove_codes_sel=new RDListSelector(this,"codes_sel");
    remove_codes_sel->setFont(listfont);
    remove_codes_sel->setGeometry(sizeHint().width()+10,10,380,200);
    remove_codes_sel->sourceSetLabel(tr("Available Codes"));
    remove_codes_sel->destSetLabel(tr("REMOVE from Carts"));
    }
  
  //
  //  Ok Button
  //
  QPushButton *ok_button=new QPushButton(this,"ok_button");
  if(edit_remove_codes==NULL) 
    ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  else  
    ok_button->setGeometry(2*sizeHint().width()-180,sizeHint().height()-60,80,50);
  ok_button->setDefault(true);
  ok_button->setFont(font);
  ok_button->setText(tr("&OK"));
  connect(ok_button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  QPushButton *cancel_button=new QPushButton(this,"cancel_button");
  if(edit_remove_codes==NULL) 
    cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			     80,50);
  else			     
    cancel_button->setGeometry(2*sizeHint().width()-90,sizeHint().height()-60,
			     80,50);
  cancel_button->setFont(font);
  cancel_button->setText(tr("&Cancel"));
  connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));


  for(unsigned i=0;i<edit_sched_codes->length()/11;i++) {
    codes_sel->destInsertItem(edit_sched_codes->mid(i*11,11).stripWhiteSpace());
    } 
  if(edit_remove_codes!=NULL) {
    for(unsigned i=0;i<edit_remove_codes->length()/11;i++) {
      remove_codes_sel->destInsertItem(remove_codes->mid(i*11,11).stripWhiteSpace());
      } 
    }
       
  sql=QString().sprintf("select CODE from SCHED_CODES");
  q=new RDSqlQuery(sql);
  while(q->next()) {
    if(codes_sel->destFindItem(q->value(0).toString())==0) {
      codes_sel->sourceInsertItem(q->value(0).toString());
    }
    if(edit_remove_codes!=NULL) {
      if(remove_codes_sel->destFindItem(q->value(0).toString())==0) {
        remove_codes_sel->sourceInsertItem(q->value(0).toString());
      }
    }
  }
  delete q;
}
SaveStreamDialog::SaveStreamDialog(StreamTableModel *model, const QHash<QString, QVariant> &settings, const QString &streamTitle, QWidget *parent):
    QDialog(parent)
{
    this->settings = settings;

    QVBoxLayout *mainLayout = new QVBoxLayout(this);
    QHBoxLayout *buttonLayout = new QHBoxLayout();
    QFormLayout *formLayout = new QFormLayout();

    QDataWidgetMapper *dataMapper = new QDataWidgetMapper(this);

    editFileName = new FilePathEdit(this);
    QLabel *suffixHint = new QLabel(this);
    checkSubtitles = new QCheckBox("Ladda ner undertexter till:", this);
    checkSubtitles->hide();
    editSubFileName = new FilePathEdit(this);
    editSubFileName->setEnabled(false);
    editSubFileName->hide();
    comboQuality = new QComboBox(this);
    editStreamUrl = new QLineEdit(this);
    editStreamUrl->hide();
    editSubUrl = new QLineEdit(this);
    editSubUrl->hide();
    editSubUrl->setEnabled(false);

    QFrame *line = new QFrame(this);
    line->setFrameShape(QFrame::HLine);
    line->setGeometry(QRect(320, 150, 118, 3));
    line->setFrameShadow(QFrame::Sunken);
    QCheckBox *checkEdit = new QCheckBox(QString::fromUtf8("Redigera addresser"), this);
    QPushButton *buttonPlay = new QPushButton("Spela upp", this);
    buttonSubmit = new QPushButton("Ladda ner", this);
    buttonSubmit->setDefault(true);
    QPushButton *buttonCancel = new QPushButton("Avbryt", this);

    connect(checkEdit, SIGNAL(clicked(bool)), editStreamUrl, SLOT(setVisible(bool)));
    connect(checkEdit, SIGNAL(clicked(bool)), editSubUrl, SLOT(setVisible(bool)));
    connect(buttonSubmit, SIGNAL(clicked()), this, SLOT(checkOverWrite()));
    connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
    connect(comboQuality, SIGNAL(currentIndexChanged(int)), dataMapper, SLOT(setCurrentIndex(int)));
    connect(comboQuality, SIGNAL(currentIndexChanged(int)), this, SLOT(comboActivated(int)));
    connect(checkSubtitles, SIGNAL(clicked(bool)), editSubFileName, SLOT(setEnabled(bool)));
    connect(checkSubtitles, SIGNAL(clicked(bool)), editSubUrl, SLOT(setEnabled(bool)));
    connect(checkSubtitles, SIGNAL(clicked(bool)), this, SLOT(enableSubmit()));
    connect(editFileName, SIGNAL(pathValid(bool)), this, SLOT(enableSubmit()));
    connect(editFileName, SIGNAL(dirChanged(QString)), editSubFileName, SLOT(setDir(QString)));
    connect(editSubFileName, SIGNAL(pathValid(bool)), this, SLOT(enableSubmit()));
    connect(buttonPlay, SIGNAL(clicked()), this, SLOT(play()));

    QString filenameTemplate = settings.value("filename_template").toString();
    const QStringList templateVars = QStringList() << "title" << "name" << "time" << "season" << "description";
    for (int i=0; i<templateVars.count(); i++)
        filenameTemplate.replace("%" % templateVars.at(i) % "%", "%" % QString::number(i));
    QString fileName = filenameTemplate;
    QVariantMap metaData = model->metaData();
    for (int i=0; i<templateVars.count(); i++)
        fileName = fileName.arg(metaData.value(templateVars.at(i), "").toString());
    QString nullFileName = filenameTemplate;
    for (int i=0; i<templateVars.count(); i++)
        nullFileName = nullFileName.arg("");
    if (fileName != nullFileName) {
        QString suffix = model->data(model->index(0, StreamTableModel::SuffixHintColumn), Qt::UserRole).toString();
        suffix = !suffix.isEmpty() ? '.' % suffix : suffix;
        bool addSlash = !settings["start_dir"].toString().endsWith(QDir::separator());
        editFileName->setFilePath(settings["start_dir"].toString() % (addSlash ? (QString)QDir::separator() : "") % fileName % suffix);
        editSubFileName->setFilePath(settings["start_dir"].toString() % (addSlash ? (QString)QDir::separator() : "") % fileName);
    }
    else {
        editFileName->setFilePath(settings["start_dir"].toString());
        editSubFileName->setFilePath(settings["start_dir"].toString());
    }

    dataMapper->setModel(model);
    dataMapper->setCurrentIndex(comboQuality->currentIndex());
    dataMapper->addMapping(editStreamUrl, StreamTableModel::UrlColumn);
    dataMapper->addMapping(editSubUrl, StreamTableModel::SubtitlesColumn);
    dataMapper->addMapping(suffixHint, StreamTableModel::SuffixHintColumn, "text");

    comboQuality->setModel(model);

    formLayout->addRow("Ladda ner till:", editFileName);
    formLayout->addRow("", suffixHint);
    formLayout->addRow("Kvalitet:", comboQuality);
    formLayout->addRow("", editStreamUrl);
    formLayout->addRow(checkSubtitles, editSubFileName);
    formLayout->addRow("", editSubUrl);

    buttonLayout->addWidget(checkEdit);
    buttonLayout->addStretch(1);
    buttonLayout->addWidget(buttonPlay);
    buttonLayout->addWidget(buttonSubmit);
    buttonLayout->addWidget(buttonCancel);

    mainLayout->addLayout(formLayout);
    mainLayout->addWidget(line);
    mainLayout->addLayout(buttonLayout);

    setLayout(mainLayout);
    setWindowTitle(QString::fromUtf8("Spara ström - ") + streamTitle);
    setMinimumWidth(500);
}
EditReport::EditReport(QString showcode,QString title,
		       QWidget *parent,const char *name)
  : QDialog(parent,name,true)
{
  edit_showcode=showcode;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumWidth(sizeHint().width());
  setMaximumHeight(sizeHint().height());

  setCaption("Call Manager - Edit Report");

  //
  // Create Fonts
  //
  QFont label_font=QFont("Helvetica",12,QFont::Bold);
  label_font.setPixelSize(12);
  QFont font=QFont("Helvetica",12,QFont::Normal);
  font.setPixelSize(12);

  //
  // Title
  //
  edit_title_edit=new QLineEdit(this,"edit_title_edit");
  edit_title_edit->setGeometry(100,10,sizeHint().width()-110,20);
  edit_title_edit->setFont(font);
  edit_title_edit->setReadOnly(true);
  QLabel *label=
    new QLabel(edit_title_edit,"Title:",this,"edit_title_label");
  label->setGeometry(10,10,85,20);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  label->setFont(label_font);

  //
  // Age
  //
  edit_startage_spin=new QSpinBox(this,"edit_startage_spin");
  edit_startage_spin->setGeometry(100,32,40,20);
  edit_startage_spin->setRange(0,120);
  label=new QLabel(edit_startage_spin,"Age:",this,"edit_age_label");
  label->setGeometry(10,32,85,20);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  label->setFont(label_font);

  edit_endage_spin=new QSpinBox(this,"edit_endage_spin");
  edit_endage_spin->setGeometry(215,32,40,20);
  edit_endage_spin->setRange(0,120);
  label=new QLabel(edit_endage_spin,"through",this,"edit_age_label");
  label->setGeometry(145,32,65,20);
  label->setAlignment(Qt::AlignCenter);
  label->setFont(label_font);

  //
  // City
  //
  edit_city_edit=new QLineEdit(this,"edit_city_edit");
  edit_city_edit->setGeometry(100,54,120,20);
  edit_city_edit->setFont(font);
  edit_city_edit->setMaxLength(20);
  label=new QLabel(edit_city_edit,"City:",this,"edit_city_label");
  label->setGeometry(10,54,85,20);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  label->setFont(label_font);

  //
  // State
  //
  edit_state_edit=new QLineEdit(this,"edit_state_edit");
  edit_state_edit->setGeometry(100,76,30,20);
  edit_state_edit->setFont(font);
  edit_state_edit->setMaxLength(2);
  label=new QLabel(edit_state_edit,"State:",
			      this,"edit_state_label");
  label->setGeometry(10,76,85,20);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  label->setFont(label_font);

  //
  // Zipcode
  //
  edit_zipcode_edit=new QLineEdit(this,"edit_zipcode_edit");
  edit_zipcode_edit->setGeometry(100,98,80,20);
  edit_zipcode_edit->setFont(font);
  edit_zipcode_edit->setMaxLength(10);
  label=new QLabel(edit_zipcode_edit,"Zip Code:",
				this,"edit_zipcode_label");
  label->setGeometry(10,98,85,20);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  label->setFont(label_font);

  //
  // Gender
  //
  edit_gender_box=new QComboBox(this,"edit_gender_box");
  edit_gender_box->setGeometry(100,120,120,22);
  edit_gender_box->setFont(font);
  label=new QLabel(edit_gender_box,"Gender:",this,"edit_gender_label");
  label->setGeometry(10,120,85,22);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  label->setFont(label_font);
  edit_gender_box->insertItem("Female");
  edit_gender_box->insertItem("Male");
  edit_gender_box->insertItem("All");

  //
  // Station
  //
  edit_station_edit=new QLineEdit(this,"edit_station_edit");
  edit_station_edit->setGeometry(100,142,70,20);
  edit_station_edit->setFont(font);
  edit_station_edit->setMaxLength(10);
  label=new QLabel(edit_station_edit,"Station:",
				this,"edit_station_label");
  label->setGeometry(10,142,85,20);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  label->setFont(label_font);

  //
  // Lines
  //
  label=new QLabel(edit_gender_box,"Use Lines:",this,"edit_lines_label");
  label->setGeometry(10,164,85,22);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  label->setFont(label_font);
  for(int i=0;i<(MAX_LINES/3);i++) {
    for(int j=0;j<3;j++) {
      
      edit_line_box[i*3+j]=new QCheckBox(this);
      edit_line_box[i*3+j]->setGeometry(125+65*i,167+22*j,15,15);
      label=
	new QLabel(edit_line_box[i*3+j],QString().sprintf("%d",i*3+j+1),this);
      label->setGeometry(100+65*i,164+22*j,20,22);
      label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
    }
  }

  //
  // Report Type
  //
  edit_reporttype_box=new QComboBox(this,"edit_reporttype_box");
  edit_reporttype_box->setGeometry(100,238,sizeHint().width()-110,22);
  edit_reporttype_box->setFont(font);
  label=new QLabel(edit_reporttype_box,"Type:",this,"edit_reporttype_label");
  label->setGeometry(10,238,85,22);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  label->setFont(label_font);
  edit_reporttype_box->insertItem("Age & Gender Report");
  edit_reporttype_box->insertItem("Source Numbers Report");

  //
  // Header 1
  //
  edit_header1_edit=new QLineEdit(this,"edit_header1_edit");
  edit_header1_edit->setGeometry(100,260,sizeHint().width()-110,20);
  edit_header1_edit->setFont(font);
  label=new QLabel(edit_header1_edit,"Header1:",this,"edit_header1_label");
  label->setGeometry(10,260,85,20);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  label->setFont(label_font);

  //
  // Header 2
  //
  edit_header2_edit=new QLineEdit(this,"edit_header2_edit");
  edit_header2_edit->setGeometry(100,282,sizeHint().width()-110,20);
  edit_header2_edit->setFont(font);
  label=new QLabel(edit_header2_edit,"Header2:",this,"edit_header2_label");
  label->setGeometry(10,282,85,20);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  label->setFont(label_font);

  //
  //  OK Button
  //
  QPushButton *button=new QPushButton(this,"ok_button");
  button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  button->setDefault(true);
  button->setFont(label_font);
  button->setText("&OK");
  connect(button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  button=new QPushButton(this,"cancel_button");
  button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50);
  button->setFont(label_font);
  button->setText("&Cancel");
  connect(button,SIGNAL(clicked()),this,SLOT(cancelData()));

  //
  // Load Data
  //
  QString sql=QString().sprintf("select START_AGE,END_AGE,\
                                 CITY,STATE,ZIPCODE,GENDER,\
                                 TYPE,HEADER1,HEADER2,\
                                 INCLUDE_LINE1,INCLUDE_LINE2,INCLUDE_LINE3,\
                                 INCLUDE_LINE4,INCLUDE_LINE5,INCLUDE_LINE6,\
                                 INCLUDE_LINE7,INCLUDE_LINE8,INCLUDE_LINE9,\
                                 INCLUDE_LINE10,INCLUDE_LINE11,INCLUDE_LINE12,\
                                 STATION from REPORTS where \
                                 (SHOW_CODE=\"%s\")&&(TITLE=\"%s\")",
				(const char *)edit_showcode,
				(const char *)title);
  QSqlQuery *q=new QSqlQuery(sql);
  if(q->first()) {
    edit_title_edit->setText(title);
    edit_startage_spin->setValue(q->value(0).toInt());
    edit_endage_spin->setValue(q->value(1).toInt());
    edit_city_edit->setText(q->value(2).toString());
    edit_state_edit->setText(q->value(3).toString());
    edit_zipcode_edit->setText(q->value(4).toString());
    if(q->value(5).isNull()) {
      edit_gender_box->setCurrentItem(2);
    }
    else {
      if(q->value(5).toString()=="M") {
	edit_gender_box->setCurrentItem(1);
      }
      else {
	edit_gender_box->setCurrentItem(0);
      }
    }
    edit_station_edit->setText(q->value(21).toString());
    edit_reporttype_box->setCurrentItem(q->value(6).toInt());
    edit_header1_edit->setText(q->value(7).toString());
    edit_header2_edit->setText(q->value(8).toString());
    for(int i=0;i<MAX_LINES;i++) {
      if(q->value(9+i).toString()=="Y") {
	edit_line_box[i]->setChecked(true);
      }
    }
  }
  delete q;
}
Exemple #17
0
CdRipper::CdRipper(QString cutname,RDCddbRecord *rec,RDLibraryConf *conf,
		   bool profile_rip,QWidget *parent) 
  : QDialog(parent)
{
  rip_profile_rip=profile_rip;
  rip_isrc_read=false;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());

  //
  // Generate Fonts
  //
  QFont button_font=QFont("Helvetica",12,QFont::Bold);
  button_font.setPixelSize(12);
  QFont label_font=QFont("Helvetica",12,QFont::Bold);
  label_font.setPixelSize(12);

  rip_conf=conf;
  rip_cddb_record=rec;
  rip_track[0]=-1;
  rip_track[1]=-1;
  rip_title=NULL;

  setCaption("Rip CD");

  //
  // Create Temporary Directory
  //
  char path[PATH_MAX];
  strncpy(path,RDTempDir(),PATH_MAX);
  strcat(path,"/XXXXXX");
  if(mkdtemp(path)==NULL) {
    QMessageBox::warning(this,"RDLibrary - "+tr("Ripper Error"),
			 tr("Unable to create temporary directory!"));
  }
  else {
    rip_cdda_dir.setPath(path);
  }

  //
  // Target Cut
  //
  rip_cut=new RDCut(cutname);

  //
  // The CDROM Drive
  //
  if(rip_profile_rip) {
    rip_cdrom=new RDCdPlayer(stdout,this);
  }
  else {
    rip_cdrom=new RDCdPlayer(NULL,this);
  }
  connect(rip_cdrom,SIGNAL(ejected()),this,SLOT(ejectedData()));
  connect(rip_cdrom,SIGNAL(mediaChanged()),this,SLOT(mediaChangedData()));
  connect(rip_cdrom,SIGNAL(played(int)),this,SLOT(playedData(int)));
  connect(rip_cdrom,SIGNAL(stopped()),this,SLOT(stoppedData()));
  rip_cdrom->setDevice(rip_conf->ripperDevice());
  rip_cdrom->open();

  //
  // CDDB Stuff
  //
  if(rip_profile_rip) {
    rip_cddb_lookup=new RDCddbLookup(stdout,this);
  }
  else {
    rip_cddb_lookup=new RDCddbLookup(NULL,this);
  }
  connect(rip_cddb_lookup,SIGNAL(done(RDCddbLookup::Result)),
	  this,SLOT(cddbDoneData(RDCddbLookup::Result)));

  //
  // Title Selector
  //
  rip_title_label=new QLabel(tr("Title:"),this);
  rip_title_label->setFont(label_font);
  rip_title_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  rip_title_box=new QComboBox(this);
  rip_title_box->insertItem(tr("[none]"));

  //
  // Artist Label
  //
  rip_artist_label=new QLabel(tr("Artist:"),this);
  rip_artist_label->setFont(label_font);
  rip_artist_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  rip_artist_edit=new QLineEdit(this);

  //
  // Album Edit
  //
  rip_album_label=new QLabel(tr("Album:"),this);
  rip_album_label->setFont(label_font);
  rip_album_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  rip_album_edit=new QLineEdit(this);

  //
  // Other Edit
  //
  rip_other_label=new QLabel(tr("Other:"),this);
  rip_other_label->setFont(label_font);
  rip_other_label->setAlignment(Qt::AlignRight);
  rip_other_edit=new Q3TextEdit(this);
  rip_other_edit->setReadOnly(true);

  //
  // Apply FreeDB Check Box
  //
  rip_apply_box=new QCheckBox(this);
  rip_apply_box->setChecked(true);
  rip_apply_box->setDisabled(true);
  rip_apply_label=
    new QLabel(rip_apply_box,tr("Apply FreeDB Values to Cart"),this);
  rip_apply_label->setFont(label_font);
  rip_apply_label->setAlignment(Qt::AlignLeft);
  rip_apply_box->setChecked(false);
  rip_apply_label->setDisabled(true);

  //
  // Track List
  //
  rip_track_list=new RDListView(this);
  rip_track_list->setAllColumnsShowFocus(true);
  rip_track_list->setSelectionMode(Q3ListView::Extended);
  rip_track_list->setItemMargin(5);
  rip_track_list->setSorting(-1);
  connect(rip_track_list,SIGNAL(selectionChanged()),
	  this,SLOT(trackSelectionChangedData()));
  rip_track_label=new QLabel(rip_track_list,tr("Tracks"),this);
  rip_track_label->setFont(label_font);
  rip_track_list->addColumn(tr("TRACK"));
  rip_track_list->setColumnAlignment(0,Qt::AlignHCenter);
  rip_track_list->addColumn(tr("LENGTH"));
  rip_track_list->setColumnAlignment(1,Qt::AlignRight);
  rip_track_list->addColumn(tr("TITLE"));
  rip_track_list->setColumnAlignment(2,Qt::AlignLeft);
  rip_track_list->addColumn(tr("OTHER"));
  rip_track_list->setColumnAlignment(3,Qt::AlignLeft);
  rip_track_list->addColumn(tr("TYPE"));
  rip_track_list->setColumnAlignment(4,Qt::AlignLeft);

  //
  // Progress Bar
  //
  rip_bar=new Q3ProgressBar(this);

  //
  // Eject Button
  //
  rip_eject_button=new RDTransportButton(RDTransportButton::Eject,this);
  connect(rip_eject_button,SIGNAL(clicked()),this,SLOT(ejectButtonData()));
  
  //
  // Play Button
  //
  rip_play_button=new RDTransportButton(RDTransportButton::Play,this);
  connect(rip_play_button,SIGNAL(clicked()),this,SLOT(playButtonData()));
  
  //
  // Stop Button
  //
  rip_stop_button=new RDTransportButton(RDTransportButton::Stop,this);
  rip_stop_button->setOnColor(Qt::red);
  rip_stop_button->on();
  connect(rip_stop_button,SIGNAL(clicked()),this,SLOT(stopButtonData()));
  
  //
  // Rip Track Button
  //
  rip_rip_button=new QPushButton(tr("&Rip\nTrack"),this);
  rip_rip_button->setFont(button_font);
  rip_rip_button->setDisabled(true);
  connect(rip_rip_button,SIGNAL(clicked()),this,SLOT(ripTrackButtonData()));

  //
  // Normalize Check Box
  //
  rip_normalize_box=new QCheckBox(this);
  rip_normalize_box->setChecked(true);
  rip_normalize_box_label=new QLabel(rip_normalize_box,tr("Normalize"),this);
  rip_normalize_box_label->setFont(label_font);
  rip_normalize_box_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
  connect(rip_normalize_box,SIGNAL(toggled(bool)),
	  this,SLOT(normalizeCheckData(bool)));

  //
  // Normalize Level
  //
  rip_normalize_spin=new QSpinBox(this);
  rip_normalize_spin->setRange(-30,0);
  rip_normalize_label=new QLabel(rip_normalize_spin,tr("Level:"),this);
  rip_normalize_label->setFont(label_font);
  rip_normalize_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  rip_normalize_unit=new QLabel(tr("dBFS"),this);
  rip_normalize_unit->setFont(label_font);
  rip_normalize_unit->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);

  //
  // Autotrim Check Box
  //
  rip_autotrim_box=new QCheckBox(this);
  rip_autotrim_box->setChecked(true);
  rip_autotrim_box_label=new QLabel(rip_autotrim_box,tr("Autotrim"),this);
  rip_autotrim_box_label->setFont(label_font);
  rip_autotrim_box_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
  connect(rip_autotrim_box,SIGNAL(toggled(bool)),
	  this,SLOT(autotrimCheckData(bool)));

  //
  // Autotrim Level
  //
  rip_autotrim_spin=new QSpinBox(this);
  rip_autotrim_spin->setRange(-99,0);
  rip_autotrim_label=new QLabel(rip_autotrim_spin,tr("Level:"),this);
  rip_autotrim_label->setFont(label_font);
  rip_autotrim_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  rip_autotrim_unit=new QLabel(tr("dBFS"),this);
  rip_autotrim_unit->setFont(label_font);
  rip_autotrim_unit->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);

  //
  // Channels
  //
  rip_channels_box=new QComboBox(this);
  rip_channels_label=new QLabel(rip_channels_box,tr("Channels:"),this);
  rip_channels_label->setFont(label_font);
  rip_channels_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);

  //
  // Close Button
  //
  rip_close_button=new QPushButton("&Close",this);
  rip_close_button->setFont(button_font);
  connect(rip_close_button,SIGNAL(clicked()),this,SLOT(closeData()));

  //
  // Populate Data
  //
  rip_normalize_spin->setValue(rip_conf->ripperLevel()/100);
  rip_autotrim_spin->setValue(rip_conf->trimThreshold()/100);
  rip_channels_box->insertItem("1");
  rip_channels_box->insertItem("2");
  rip_channels_box->setCurrentItem(rip_conf->defaultChannels()-1);
  rip_done=false;
}
Exemple #18
0
EditPerms::EditPerms(QString object_name,ObjectType type,QWidget *parent)
  : QDialog(parent,"",true)
{
  QString sql;
  RDSqlQuery *q;
  QString str;

  sel_type=type;
  sel_name=object_name;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  str=QString(tr("Service Associations"));
  setCaption(QString().sprintf("%s - %s",
			       (const char *)sel_name,(const char *)str));

  //
  // Create Fonts
  //
  QFont font=QFont("Helvetica",12,QFont::Bold);
  font.setPixelSize(12);

  //
  // Services Selector
  //
  svc_object_sel=new RDListSelector(this);
  svc_object_sel->setGeometry(10,10,380,130);
  svc_object_sel->sourceSetLabel(tr("Available Services"));
  svc_object_sel->destSetLabel(tr("Enabled Services"));

  //
  //  Ok Button
  //
  QPushButton *ok_button=new QPushButton(this);
  ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  ok_button->setDefault(true);
  ok_button->setFont(font);
  ok_button->setText(tr("&OK"));
  connect(ok_button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  QPushButton *cancel_button=new QPushButton(this);
  cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			     80,50);
  cancel_button->setFont(font);
  cancel_button->setText(tr("&Cancel"));
  connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));

  //
  // Populate Fields
  //
  switch(sel_type) {
      case EditPerms::ObjectEvent:
	object_type="EVENT";
	break;

      case EditPerms::ObjectClock:
	object_type="CLOCK";
	break;
  }
  sql=QString("select SERVICE_NAME from ")+object_type+"_PERMS where "+
    object_type+"_NAME=\""+RDEscapeString(object_name)+"\"";
  q=new RDSqlQuery(sql);
  while(q->next()) {
    svc_object_sel->destInsertItem(q->value(0).toString());
  }
  delete q;
  sql=QString().sprintf("select NAME from SERVICES");
  q=new RDSqlQuery(sql);
  while(q->next()) {
    if(svc_object_sel->destFindItem(q->value(0).toString())==0) {
      svc_object_sel->sourceInsertItem(q->value(0).toString());
    }
  }
  delete q;
}
Exemple #19
0
EditUpload::EditUpload(int id,std::vector<int> *adds,QString *filter,
		       QWidget *parent,const char *name)
  : QDialog(parent,name,true)
{
  QString sql;
  RDSqlQuery *q;
  QString temp;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  //
  // Generate Fonts
  //
  QFont button_font=QFont("Helvetica",12,QFont::Bold);
  button_font.setPixelSize(12);
  QFont label_font=QFont("Helvetica",12,QFont::Bold);
  label_font.setPixelSize(12);
  QFont day_font=QFont("Helvetica",10,QFont::Normal);
  day_font.setPixelSize(10);

  edit_deck=NULL;
  edit_added_events=adds;
  edit_filter=filter;

  setCaption(tr("Edit Upload"));

  //
  // Text Validator
  //
  RDTextValidator *validator=new RDTextValidator(this,"validator");

  //
  // The Recording Record
  //
  edit_recording=new RDRecording(id);

  //
  // Active Button
  //
  edit_active_button=new QCheckBox(this,"edit_active_button");
  edit_active_button->setGeometry(10,11,20,20);
  QLabel *label=new QLabel(edit_active_button,
		   tr("Event Active"),this,"edit_active_label");
  label->setGeometry(30,11,125,20);
  label->setFont(label_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Station
  //
  edit_station_box=new QComboBox(this,"edit_station_box");
  edit_station_box->setGeometry(200,10,140,23);
  connect(edit_station_box,SIGNAL(textChanged(const QString &)),
	  this,SLOT(stationChangedData(const QString &)));
  label=new QLabel(edit_station_box,tr("Location:"),this,
				       "edit_station_label");
  label->setGeometry(125,10,70,23);
  label->setFont(label_font);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Start Time
  //
  edit_starttime_edit=new QTimeEdit(this,"edit_starttime_edit");
  edit_starttime_edit->setGeometry(sizeHint().width()-90,12,80,20);
  label=new QLabel(edit_starttime_edit,
		   tr("Start Time:"),this,"edit_starttime_label");
  label->setGeometry(sizeHint().width()-175,12,80,20);
  label->setFont(label_font);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // RSS Feed
  //
  edit_feed_box=new QComboBox(this,"edit_feed_box");
  edit_feed_box->setGeometry(115,43,100,20);
  edit_feed_box->insertItem(tr("[none]"));
  label=new QLabel(edit_feed_box,
		   tr("RSS Feed:"),this,"edit_feed_label");
  label->setGeometry(10,43,100,19);
  label->setFont(label_font);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Source
  //
  edit_destination_edit=new QLineEdit(this,"edit_destination_edit");
  edit_destination_edit->setGeometry(115,70,sizeHint().width()-195,20);
  edit_destination_edit->setReadOnly(true);
  label=new QLabel(edit_destination_edit,
		   tr("Source:"),this,"edit_destination_label");
  label->setGeometry(10,70,100,19);
  label->setFont(label_font);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  QPushButton *button=new QPushButton(this,"destination_button");
  button->setGeometry(sizeHint().width()-70,68,60,24);
  button->setFont(day_font);
  button->setText(tr("&Select"));
  connect(button,SIGNAL(clicked()),this,SLOT(selectCartData()));

  //
  // Description
  //
  edit_description_edit=new QLineEdit(this,"edit_description_edit");
  edit_description_edit->setGeometry(115,97,sizeHint().width()-125,20);
  edit_description_edit->setValidator(validator);
  label=new QLabel(edit_description_edit,
		   tr("Description:"),this,"edit_description_label");
  label->setGeometry(10,97,100,20);
  label->setFont(label_font);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Url
  //
  edit_url_edit=new QLineEdit(this,"edit_url_edit");
  edit_url_edit->setGeometry(115,124,sizeHint().width()-125,20);
  edit_url_edit->setMaxLength(255);
  edit_url_edit->setValidator(validator);
  connect(edit_url_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(urlChangedData(const QString &)));
  label=new QLabel(edit_url_edit,tr("Url:"),this,"edit_url_label");
  label->setGeometry(10,124,100,20);
  label->setFont(label_font);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Username
  //
  edit_username_edit=new QLineEdit(this,"edit_username_edit");
  edit_username_edit->setGeometry(115,151,150,20);
  edit_username_edit->setMaxLength(64);
  edit_username_edit->setValidator(validator);
  edit_username_label=new QLabel(edit_username_edit,
		   tr("Username:"******"edit_username_label");
  edit_username_label->setGeometry(10,151,100,20);
  edit_username_label->setFont(label_font);
  edit_username_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Password
  //
  edit_password_edit=new QLineEdit(this,"edit_password_edit");
  edit_password_edit->setGeometry(360,151,sizeHint().width()-370,20);
  edit_password_edit->setEchoMode(QLineEdit::Password);
  edit_password_edit->setMaxLength(64);
  edit_username_edit->setValidator(validator);
  edit_password_label=new QLabel(edit_password_edit,
		   tr("Password:"******"edit_password_label");
  edit_password_label->setGeometry(275,151,80,20);
  edit_password_label->setFont(label_font);
  edit_password_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Audio Format
  //
  edit_format_edit=new QLineEdit(this,"edit_format_edit");
  edit_format_edit->setGeometry(115,178,sizeHint().width()-195,20);
  edit_format_edit->setReadOnly(true);
  label=new QLabel(edit_format_edit,
		   tr("Export Format:"),this,"edit_format_label");
  label->setGeometry(5,178,105,20);
  label->setFont(label_font);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  button=new QPushButton(this,"format_button");
  button->setGeometry(sizeHint().width()-70,176,60,24);
  button->setFont(day_font);
  button->setText(tr("S&et"));
  connect(button,SIGNAL(clicked()),this,SLOT(setFormatData()));

  //
  // Normalize Check Box
  //
  edit_normalize_box=new QCheckBox(this,"edit_normalize_box");
  edit_normalize_box->setGeometry(115,208,15,15);
  edit_normalize_box->setChecked(true);
  label=new QLabel(edit_normalize_box,tr("Normalize"),
		   this,"normalize_check_label");
  label->setGeometry(135,206,83,20);
  label->setFont(label_font);
  label->setAlignment(AlignLeft|AlignVCenter);
  connect(edit_normalize_box,SIGNAL(toggled(bool)),
	  this,SLOT(normalizeCheckData(bool)));

  //
  // Normalize Level
  //
  edit_normalize_spin=new QSpinBox(this,"edit_normalize_spin");
  edit_normalize_spin->setGeometry(265,206,40,20);
  edit_normalize_spin->setRange(-30,0);
  edit_normalize_label=new QLabel(edit_normalize_spin,tr("Level:"),
				 this,"normalize_spin_label");
  edit_normalize_label->setGeometry(215,206,45,20);
  edit_normalize_label->setFont(label_font);
  edit_normalize_label->setAlignment(AlignRight|AlignVCenter);
  edit_normalize_unit=new QLabel(tr("dBFS"),this,"normalize_unit_label");
  edit_normalize_unit->setGeometry(310,206,40,20);
  edit_normalize_unit->setFont(label_font);
  edit_normalize_unit->setAlignment(AlignLeft|AlignVCenter);

  //
  // Export Metadata Box
  //
  edit_metadata_box=new QCheckBox(this,"edit_metadata_box");
  edit_metadata_box->setGeometry(115,231,15,15);
  label=new QLabel(edit_metadata_box,tr("Export Library Metadata"),
		   this,"metadata_check_label");
  label->setGeometry(135,231,160,20);
  label->setFont(label_font);
  label->setAlignment(AlignLeft|AlignVCenter);

  //
  // Button Label
  //
  label=new QLabel(tr("Active Days"),this,"active_days_label");
  label->setGeometry(47,263,90,19);
  label->setFont(label_font);
  label->setAlignment(AlignHCenter|ShowPrefix);

  //
  // Monday Button
  //
  edit_mon_button=new QCheckBox(this,"edit_mon_button");
  edit_mon_button->setGeometry(20,282,20,20);
  label=new QLabel(edit_mon_button,
		   tr("Monday"),this,"edit_mon_label");
  label->setGeometry(40,282,115,20);
  label->setFont(day_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Tuesday Button
  //
  edit_tue_button=new QCheckBox(this,"edit_tue_button");
  edit_tue_button->setGeometry(115,282,20,20);
  label=new QLabel(edit_tue_button,
		   tr("Tuesday"),this,"edit_tue_label");
  label->setGeometry(135,282,115,20);
  label->setFont(day_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Wednesday Button
  //
  edit_wed_button=new QCheckBox(this,"edit_wed_button");
  edit_wed_button->setGeometry(215,282,20,20);
  label=new QLabel(edit_wed_button,
		   tr("Wednesday"),this,"edit_wed_label");
  label->setGeometry(235,282,115,20);
  label->setFont(day_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Thursday Button
  //
  edit_thu_button=new QCheckBox(this,"edit_thu_button");
  edit_thu_button->setGeometry(335,282,20,20);
  label=new QLabel(edit_thu_button,
		   tr("Thursday"),this,"edit_thu_label");
  label->setGeometry(355,282,115,20);
  label->setFont(day_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Friday Button
  //
  edit_fri_button=new QCheckBox(this,"edit_fri_button");
  edit_fri_button->setGeometry(440,282,20,20);
  label=new QLabel(edit_fri_button,
		   tr("Friday"),this,"edit_fri_label");
  label->setGeometry(460,282,40,20);
  label->setFont(day_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Saturday Button
  //
  edit_sat_button=new QCheckBox(this,"edit_sat_button");
  edit_sat_button->setGeometry(130,307,20,20);
  label=new QLabel(edit_sat_button,
		   tr("Saturday"),this,"edit_sat_label");
  label->setGeometry(150,307,60,20);
  label->setFont(day_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Sunday Button
  //
  edit_sun_button=new QCheckBox(this,"edit_sun_button");
  edit_sun_button->setGeometry(300,307,20,20);
  label=new QLabel(edit_sun_button,
		   tr("Sunday"),this,"edit_sun_label");
  label->setGeometry(320,307,60,20);
  label->setFont(day_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // OneShot Button
  //
  edit_oneshot_box=new QCheckBox(this,"edit_oneshot_box");
  edit_oneshot_box->setGeometry(20,342,15,15);
  label=new QLabel(edit_oneshot_box,
		   tr("Make OneShot"),this,"edit_oneshot_label");
  label->setGeometry(40,343,115,20);
  label->setFont(label_font);
  label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);

  //
  // Event Offset
  //
  edit_eventoffset_spin=new QSpinBox(this,"edit_eventoffset_spin");
  edit_eventoffset_spin->setGeometry(245,340,45,20);
  edit_eventoffset_spin->setRange(-30,30);
  label=new QLabel(edit_eventoffset_spin,tr("Event Offset:"),
		   this,"edit_eventoffset_label");
  label->setGeometry(140,340,100,20);
  label->setFont(label_font);
  label->setAlignment(AlignVCenter|AlignRight);
  label=new QLabel(edit_eventoffset_spin,tr("days"),
		   this,"edit_eventoffset_unit");
  label->setGeometry(295,335,40,20);
  label->setFont(label_font);
  label->setAlignment(AlignVCenter|AlignLeft);

  //
  //  Save As Button
  //
  button=new QPushButton(this,"saveas_button");
  button->setGeometry(sizeHint().width()-300,sizeHint().height()-60,80,50);
  button->setFont(button_font);
  button->setText(tr("&Save As\nNew"));
  connect(button,SIGNAL(clicked()),this,SLOT(saveasData()));
  if(adds==NULL) {
    button->hide();
  }

  //
  //  Ok Button
  //
  button=new QPushButton(this,"ok_button");
  button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  button->setDefault(true);
  button->setFont(button_font);
  button->setText(tr("&OK"));
  connect(button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  button=new QPushButton(this,"cancel_button");
  button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50);
  button->setFont(button_font);
  button->setText(tr("&Cancel"));
  connect(button,SIGNAL(clicked()),this,SLOT(cancelData()));

  //
  // Populate Data
  //
  q=new RDSqlQuery("select NAME from STATIONS where NAME!=\"DEFAULT\"");
  while(q->next()) {
    edit_station_box->insertItem(q->value(0).toString());
    if(edit_recording->station()==q->value(0).toString()) {
      edit_station_box->setCurrentItem(edit_station_box->count()-1);
    }
  }
  delete q;
  edit_active_button->setChecked(edit_recording->isActive());
  edit_starttime_edit->setTime(edit_recording->startTime());
  edit_description_edit->setText(edit_recording->description());
  edit_url_edit->setText(edit_recording->url());
  edit_username_edit->setText(edit_recording->urlUsername());
  edit_password_edit->setText(edit_recording->urlPassword());
  if(!edit_recording->cutName().isEmpty()) {
    edit_destination_edit->setText("Cut "+edit_recording->cutName());
  }
  edit_metadata_box->setChecked(edit_recording->enableMetadata());
  edit_mon_button->setChecked(edit_recording->mon());
  edit_tue_button->setChecked(edit_recording->tue());
  edit_wed_button->setChecked(edit_recording->wed());
  edit_thu_button->setChecked(edit_recording->thu());
  edit_fri_button->setChecked(edit_recording->fri());
  edit_sat_button->setChecked(edit_recording->sat());
  edit_sun_button->setChecked(edit_recording->sun());
  edit_eventoffset_spin->setValue(edit_recording->eventdateOffset());
  edit_oneshot_box->setChecked(edit_recording->oneShot());
  edit_settings.setFormat(edit_recording->format());
  edit_settings.setChannels(edit_recording->channels());
  edit_settings.setSampleRate(edit_recording->sampleRate());
  edit_settings.setBitRate(edit_recording->bitrate());
  edit_settings.setQuality(edit_recording->quality());
  edit_format_edit->setText(edit_settings.description());
  if(edit_recording->normalizationLevel()>0) {
    edit_normalize_box->setChecked(false);
  }
  else {
    edit_normalize_box->setChecked(true);
    edit_normalize_spin->setValue(edit_recording->normalizationLevel()/100);
  }
  normalizeCheckData(edit_normalize_box->isChecked());
  int feed_id=edit_recording->feedId();
  sql="select ID,KEY_NAME from FEEDS order by KEY_NAME";
  q=new RDSqlQuery(sql);
  while(q->next()) {
    edit_feed_box->insertItem(q->value(1).toString());
    if(q->value(0).toInt()==feed_id) {
      edit_feed_box->setCurrentItem(edit_feed_box->count()-1);
    }
  }
  delete q;
}
Exemple #20
0
PickFields::PickFields(QDate *start_date,QDate *end_date,
		       int *pgm_id,bool pgm_all,
		       int *affiliate_id,bool affiliate_all,
		       int *network_id,bool network_all,
		       PickFields::SortField *sort,
		       PickFields::MarketType market,
		       QWidget *parent,const char *name)
  : QDialog(parent,name,true)
{
  QString sql;
  QSqlQuery *q;

  report_ypos=10;
  report_start_date=start_date;
  report_end_date=end_date;
  report_program_id=pgm_id;
  report_affiliate_id=affiliate_id;
  report_program_id=pgm_id;
  report_network_id=network_id;
  report_sort=sort;

  setCaption("Davit");

  //
  // Create Fonts
  //
  QFont label_font=QFont("Helvetica",12,QFont::Bold);
  label_font.setPixelSize(12);
  QFont font=QFont("Helvetica",12,QFont::Normal);
  font.setPixelSize(12);

  //
  // Program
  //
  if(pgm_id!=NULL) {
    report_program_box=new QComboBox(this,"report_program_box");
    report_program_box->setGeometry(110,report_ypos,sizeHint().width()-120,20);
    report_program_box->setFont(font);
    report_program_label=
      new QLabel(report_program_box,tr("Program:"),this,"report_program_label");
    report_program_label->setGeometry(10,report_ypos,95,20);
    report_program_label->setFont(label_font);
    report_program_label->setAlignment(AlignVCenter|AlignRight);
    if(pgm_all) {
      report_program_ids.push_back(0);
      report_program_box->insertItem(tr("All Programs"));
    }
    QString sql="select ID,PROGRAM_NAME from PROGRAMS order by PROGRAM_NAME";
    QSqlQuery *q=new QSqlQuery(sql);
    while(q->next()) {
      report_program_box->insertItem(q->value(1).toString());
      report_program_ids.push_back(q->value(0).toInt());
      if(*pgm_id==q->value(0).toInt()) {
	report_program_box->setCurrentItem(report_program_box->count()-1);
      }
    }
    delete q;
    report_ypos+=22;
  }

  //
  // Affiliate
  //
  if(affiliate_id!=NULL) {
    report_affiliate_box=new QComboBox(this,"report_affiliate_box");
    report_affiliate_box->setGeometry(110,report_ypos,sizeHint().width()-120,20);
    report_affiliate_box->setFont(font);
    report_affiliate_label=new QLabel(report_affiliate_box,tr("Affiliate:"),
				      this,"report_affiliate_label");
    report_affiliate_label->setGeometry(10,report_ypos,95,20);
    report_affiliate_label->setFont(label_font);
    report_affiliate_label->setAlignment(AlignVCenter|AlignRight);
    if(affiliate_all) {
      report_affiliate_ids.push_back(0);
      report_affiliate_box->insertItem(tr("All Affiliates"));
    }
    QString sql="select ID,STATION_CALL,STATION_TYPE,LICENSE_CITY,\
                 LICENSE_STATE from AFFILIATES order by STATION_CALL";
    QSqlQuery *q=new QSqlQuery(sql);
    while(q->next()) {
      QString type;
      if(q->value(2).toString().lower()=="f") {
	type=tr("FM");
      }
      if(q->value(2).toString().lower()=="a") {
	type=tr("AM");
      }
      report_affiliate_ids.push_back(q->value(0).toInt());
      report_affiliate_box->insertItem(q->value(1).toString()+"-"+type+" -- "+
				  q->value(3).toString()+", "+
				  q->value(4).toString());
      if(*affiliate_id==q->value(0).toInt()) {
	report_affiliate_box->setCurrentItem(report_affiliate_box->count()-1);
      }
    }
    delete q;
    report_ypos+=30;
  }

  //
  // Network
  //
  if(network_id!=NULL) {
    report_network_box=new QComboBox(this,"report_network_box");
    report_network_box->setGeometry(110,report_ypos,sizeHint().width()-120,20);
    report_network_box->setFont(font);
    report_network_label=
      new QLabel(report_network_box,tr("Network:"),this,"report_network_label");
    report_network_label->setGeometry(10,report_ypos,95,20);
    report_network_label->setFont(label_font);
    report_network_label->setAlignment(AlignVCenter|AlignRight);
    if(network_all) {
      report_network_ids.push_back(0);
      report_network_box->insertItem(tr("All Networks"));
    }
    QString sql="select ID,NAME from NETWORKS order by NAME";
    QSqlQuery *q=new QSqlQuery(sql);
    while(q->next()) {
      report_network_box->insertItem(q->value(1).toString());
      report_network_ids.push_back(q->value(0).toInt());
      if(*network_id==q->value(0).toInt()) {
	report_network_box->setCurrentItem(report_network_box->count()-1);
      }
    }
    delete q;
    report_ypos+=30;
  }

  //
  // Start Date
  //
  if(start_date!=NULL) {
    report_start_date_edit=new QDateEdit(this,"report_start_date_edit");
    report_start_date_edit->setGeometry(110,report_ypos+3,100,20);
    report_start_date_edit->setDate(QDate::currentDate());
    report_start_date_label=new QLabel(report_start_date_edit,
				       tr("Start Date:"),
				       this,"report_start_date_label");
    report_start_date_label->setGeometry(10,report_ypos+3,95,20);
    report_start_date_label->setFont(label_font);
    report_start_date_label->setAlignment(AlignVCenter|AlignRight);
    if(start_date->isNull()) {
      *start_date=QDate::currentDate();
    }
    report_start_date_edit->setDate(*start_date);
    QPushButton *button=new QPushButton(tr("Select"),this);
    button->setFont(font);
    button->setGeometry(220,report_ypos,60,25);
    connect(button,SIGNAL(clicked()),this,SLOT(selectStartDateData()));
    report_ypos+=30;
  }

  //
  // End Date
  //
  if(end_date!=NULL) {
    report_end_date_edit=new QDateEdit(this,"report_end_date_edit");
    report_end_date_edit->setGeometry(110,report_ypos+3,100,20);
    report_end_date_edit->setDate(QDate::currentDate());
    report_end_date_label=new QLabel(report_end_date_edit,
				       tr("End Date:"),
				       this,"report_end_date_label");
    report_end_date_label->setGeometry(10,report_ypos+3,95,20);
    report_end_date_label->setFont(label_font);
    report_end_date_label->setAlignment(AlignVCenter|AlignRight);
    if(end_date->isNull()) {
      *end_date=QDate::currentDate();
    }
    report_end_date_edit->setDate(*end_date);
    QPushButton *button=new QPushButton(tr("Select"),this);
    button->setFont(font);
    button->setGeometry(220,report_ypos,60,25);
    connect(button,SIGNAL(clicked()),this,SLOT(selectEndDateData()));
    report_ypos+=30;
  }

  //
  // Affiliate
  //
  if(sort!=NULL) {
    report_sort_box=new QComboBox(this,"report_sort_box");
    report_sort_box->setGeometry(110,report_ypos,200,20);
    report_sort_box->setFont(font);
    report_sort_label=new QLabel(report_sort_box,tr("Sort By:"),
				      this,"report_sort_label");
    report_sort_label->setGeometry(10,report_ypos,95,20);
    report_sort_label->setFont(label_font);
    report_sort_label->setAlignment(AlignVCenter|AlignRight);
    report_ypos+=22;
    if(((*sort)&PickFields::SortAffiliate)!=0) {
      report_sort_box->insertItem(tr("Affiliate"));
    }
    if(((*sort)&PickFields::SortCityState)!=0) {
      report_sort_box->insertItem(tr("City/State"));
    }
    if(((*sort)&PickFields::SortMarket)!=0) {
      report_sort_box->insertItem(tr("Market"));
    }
  }

  //
  // Market
  //
  report_market_label=NULL;
  report_market_box=NULL;
  report_city_label=NULL;
  report_city_edit=NULL;
  report_state_label=NULL;
  report_state_box=NULL;
  QString market_table;
  switch(market) {
  case PickFields::StateMarket:
    report_city_edit=new QLineEdit(this);
    report_city_edit->setGeometry(110,report_ypos,sizeHint().width()-120,20);
    report_city_edit->setFont(font);
    report_city_label=new QLabel(report_city_edit,tr("City:"),this);
    report_city_label->setGeometry(10,report_ypos,95,20);
    report_city_label->setFont(label_font);
    report_city_label->setAlignment(AlignVCenter|AlignRight);
    report_ypos+=22;

    report_state_box=new StateComboBox(true,this);
    report_state_box->setGeometry(110,report_ypos,sizeHint().width()-120,20);
    report_state_box->setFont(font);
    report_state_label=new QLabel(report_state_box,tr("State:"),this);
    report_state_label->setGeometry(10,report_ypos,95,20);
    report_state_label->setFont(label_font);
    report_state_label->setAlignment(AlignVCenter|AlignRight);
    connect(report_state_box,SIGNAL(stateCodeChanged(const QString &)),
	    this,SLOT(stateCodeChangedData(const QString &)));
    stateCodeChangedData("aa");
    report_ypos+=22;
    break;

  case PickFields::DmaMarket:
  case PickFields::MsaMarket:
    report_market_box=new QComboBox(this);
    report_market_box->setGeometry(110,report_ypos,sizeHint().width()-120,20);
    report_market_box->setFont(font);
    report_market_label=new QLabel(report_market_box,tr("Market:"),this);
    report_market_label->setGeometry(10,report_ypos,95,20);
    report_market_label->setFont(label_font);
    report_market_label->setAlignment(AlignVCenter|AlignRight);
    report_ypos+=22;
    switch(market) {
    case PickFields::DmaMarket:
      market_table="DMA_MARKETS";
      break;

    case PickFields::MsaMarket:
      market_table="MSA_MARKETS";
      break;

    case PickFields::NoMarket:
    case PickFields::StateMarket:
      break;
    }
    sql=QString().sprintf("select NAME from %s order by NAME",
			  (const char *)market_table);
    q=new QSqlQuery(sql);
    while(q->next()) {
      if(!q->value(0).toString().isEmpty()) {
      report_market_box->insertItem(q->value(0).toString());
      }
    }
    delete q;
    break;

  case PickFields::NoMarket:
    break;
  }

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  //
  //  Ok Button
  //
  report_ok_button=new QPushButton(this,"report_ok_button");
  report_ok_button->setGeometry(size().width()-180,size().height()-60,80,50);
  report_ok_button->setFont(label_font);
  report_ok_button->setText("&Ok");
  connect(report_ok_button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  report_cancel_button=new QPushButton(this,"report_cancel_button");
  report_cancel_button->setGeometry(size().width()-90,size().height()-60,80,50);
  report_cancel_button->setFont(label_font);
  report_cancel_button->setText("&Cancel");
  connect(report_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
}
Exemple #21
0
RecordCut::RecordCut(RDCart *cart,QString cut,QWidget *parent,const char *name)
  : QDialog(parent,name,true)
{
  bool valid;
  bool is_track=cart->owner().isEmpty();
  bool allow_modification=lib_user->modifyCarts()&&is_track;
  bool allow_editing=lib_user->editAudio()&&is_track;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  //
  // Generate Fonts
  //
  QFont font=QFont("Helvetica",12,QFont::Bold);
  font.setPixelSize(12);
  QFont small_font=QFont("Helvetica",10,QFont::Bold);
  small_font.setPixelSize(10);
  QFont large_font=QFont("Helvetica",18,QFont::Bold);
  large_font.setPixelSize(18);
  QFont timer_font=QFont("Helvetica",20,QFont::Bold);
  timer_font.setPixelSize(20);
  QFont day_font=QFont("helvetica",10,QFont::Normal);
  day_font.setPixelSize(10);

  setCaption(tr("RDLibrary - Record"));
  rec_cut=new RDCut(cut);
  is_playing=false;
  is_ready=false;
  is_recording=false;
  is_closing=false;
  rec_timer_value=0;

  //
  // Load Audio Assignments
  //
  rec_card_no[0]=rdlibrary_conf->inputCard();
  rec_port_no[0]=rdlibrary_conf->inputPort();
  rec_card_no[1]=rdlibrary_conf->outputCard();
  rec_port_no[1]=rdlibrary_conf->outputPort();
  rec_play_handle=-1;

  //
  // CAE Connection
  //
  connect(rdcae,SIGNAL(isConnected(bool)),this,SLOT(initData(bool)));
  connect(rdcae,SIGNAL(playing(int)),this,SLOT(playedData(int)));
  connect(rdcae,SIGNAL(playStopped(int)),this,SLOT(playStoppedData(int)));
  connect(rdcae,SIGNAL(recordLoaded(int,int)),
	  this,SLOT(recordLoadedData(int,int)));
  connect(rdcae,SIGNAL(recordUnloaded(int,int,unsigned)),
	  this,SLOT(recordUnloadedData(int,int,unsigned)));
  connect(rdcae,SIGNAL(recording(int,int)),this,SLOT(recordedData(int,int)));
  connect(rdcae,SIGNAL(recordStopped(int,int)),
	  this,SLOT(recordStoppedData(int,int)));
  connect(rdcae,SIGNAL(inputStatusChanged(int,int,bool)),
	  this,SLOT(aesAlarmData(int,int,bool)));

  //
  // Audio Parameters
  //
  rec_card_no[0]=rdlibrary_conf->inputCard();
  rec_card_no[1]=rdlibrary_conf->outputCard();
  rec_name=rec_cut->cutName();
  switch(rec_cut->codingFormat()) {
      case 0:
	rec_format=RDCae::Pcm16;
	break;
	
      case 1:
	rec_format=RDCae::MpegL2;
	break;

      default:
	rec_format=RDCae::Pcm16;
	break;
  }	
  rec_channels=rec_cut->channels();
  rec_samprate=rec_cut->sampleRate();
  rec_bitrate=rec_cut->bitRate();
  rec_length=rec_cut->length();

  //
  // Cut Description
  //
  cut_description_edit=new QLineEdit(this,"cut_description_edit");
  cut_description_edit->setGeometry(10,30,355,19);
  cut_description_edit->setMaxLength(64);
  QLabel *cut_description_label=new QLabel(cut_description_edit,
					   tr("&Description"),this,
					   "cut_description_label");
  cut_description_label->setGeometry(15,11,120,19);
  cut_description_label->setFont(font);
  cut_description_label->setAlignment(AlignLeft|ShowPrefix);

  //
  // Cut Outcue
  //
  cut_outcue_edit=new QLineEdit(this,"cut_outcue_edit");
  cut_outcue_edit->setGeometry(10,75,355,19);
  cut_outcue_edit->setMaxLength(64);
  QLabel *cut_outcue_label=new QLabel(cut_outcue_edit,tr("&Outcue"),this,
				       "cut_outcue_label");
  cut_outcue_label->setGeometry(15,56,120,19);
  cut_outcue_label->setFont(font);
  cut_outcue_label->setAlignment(AlignLeft|ShowPrefix);

  //
  // Cut ISCI Code
  //
  cut_isci_edit=new QLineEdit(this,"cut_isci_edit");
  cut_isci_edit->setGeometry(10,120,355,19);
  cut_isci_edit->setMaxLength(32);
  QLabel *cut_isci_label=new QLabel(cut_isci_edit,tr("&ISCI Code"),this,
				       "cut_isci_label");
  cut_isci_label->setGeometry(15,101,120,19);
  cut_isci_label->setFont(font);
  cut_isci_label->setAlignment(AlignLeft|ShowPrefix);

  //
  // Cut Origin
  //
  cut_origin_edit=new QLineEdit(this,"cut_origin_edit");
  cut_origin_edit->setGeometry(10,165,190,19);
  cut_origin_edit->setReadOnly(true);
  cut_origin_edit->setMaxLength(64);
  QLabel *cut_origin_label=new QLabel(cut_origin_edit,tr("Origin"),this,
				       "cut_origin_label");
  cut_origin_label->setGeometry(15,146,120,19);
  cut_origin_label->setFont(font);
  cut_origin_label->setAlignment(AlignLeft|ShowPrefix);

  //
  // Cut ISRC
  //
  cut_isrc_edit=new QLineEdit(this,"cut_isrc_edit");
  cut_isrc_edit->setGeometry(220,165,145,19);
  cut_isrc_edit->setMaxLength(64);
  QLabel *cut_isrc_label=new QLabel(cut_isrc_edit,tr("ISRC"),this,
				       "cut_isrc_label");
  cut_isrc_label->setGeometry(225,146,120,19);
  cut_isrc_label->setFont(font);
  cut_isrc_label->setAlignment(AlignLeft|ShowPrefix);

  //
  // Cut Weight
  //
  cut_weight_box=new QSpinBox(this,"cut_weight_box");
  cut_weight_box->setGeometry(10,210,61,19);
  cut_weight_box->setRange(0,100);
  QLabel *cut_weight_label=new QLabel(cut_weight_box,tr("Weight"),this,
				       "cut_weight_label");
  cut_weight_label->setGeometry(10,191,61,19);
  cut_weight_label->setFont(font);
  cut_weight_label->setAlignment(AlignHCenter|ShowPrefix);

  //
  // Cut Play Date Time
  //
  cut_playdate_edit=new QLineEdit(this,"cut_playdate_edit");
  cut_playdate_edit->setGeometry(100,210,150,19);
  cut_playdate_edit->setReadOnly(true);
  cut_playdate_edit->setMaxLength(64);
  QLabel *cut_playdate_label=new QLabel(cut_playdate_edit,tr("Last Played"),
					this,"cut_playdate_label");
  cut_playdate_label->setGeometry(105,191,120,19);
  cut_playdate_label->setFont(font);
  cut_playdate_label->setAlignment(AlignLeft|ShowPrefix);

  //
  // Cut Play Counter
  //
  cut_playcounter_edit=new QLineEdit(this,"cut_playcounter_edit");
  cut_playcounter_edit->setGeometry(285,210,80,19);
  cut_playcounter_edit->setAlignment(AlignRight);
  cut_playcounter_edit->setReadOnly(true);
  cut_playcounter_edit->setMaxLength(64);
  QLabel *cut_playcounter_label=
    new QLabel(cut_playcounter_edit,tr("# of Plays"),
	       this,"cut_playcounter_label");
  cut_playcounter_label->setGeometry(290,191,120,19);
  cut_playcounter_label->setFont(font);
  cut_playcounter_label->setAlignment(AlignLeft|ShowPrefix);

  //
  // Evergreen Checkbox
  //
  rec_evergreen_box=new QCheckBox(this,"rec_evergreen_box");
  rec_evergreen_box->setGeometry(10,245,15,15);
  rec_evergreen_label=new QLabel(rec_evergreen_box,tr("Cut is EVERGREEN"),
				 this,"rec_evergreen_label");
  rec_evergreen_label->setGeometry(30,245,sizeHint().width()-40,15);
  rec_evergreen_label->setFont(font);
  rec_evergreen_label->setAlignment(AlignVCenter|AlignLeft);
  connect(rec_evergreen_box,SIGNAL(toggled(bool)),
	  this,SLOT(evergreenToggledData(bool)));

  //
  // Cut Air Date Times
  //
  cut_killdatetime_label=new QLabel(tr("Air Date/Time"),
				    this,"cut_killdatetime_label");
  cut_killdatetime_label->setGeometry(50,268,100,19);
  cut_killdatetime_label->setAlignment(Qt::AlignHCenter);
  cut_killdatetime_label->setFont(font);
  QButtonGroup *button_group=new QButtonGroup(this,"air_dates_group");
  button_group->hide();
  connect(button_group,SIGNAL(clicked(int)),this,SLOT(airDateButtonData(int)));
  cut_startdatetime_enable_button=new QRadioButton(tr("Enabled"),this,
					       "air_date_enabled_button");
  cut_startdatetime_enable_button->setGeometry(40,290,100,20);
  button_group->insert(cut_startdatetime_enable_button,true);
  cut_startdatetime_disable_button=new QRadioButton(tr("Disabled"),this,
						"air_date_disabled_button");
  cut_startdatetime_disable_button->setGeometry(40,310,100,20);
  button_group->insert(cut_startdatetime_disable_button,false);

  cut_startdatetime_edit=new QDateTimeEdit(this,"cut_startdatetime_edit");
  cut_startdatetime_edit->setGeometry(165,289,170,19);
  cut_startdatetime_label=new QLabel(cut_startdatetime_edit,tr("&Start"),this,
				       "cut_startdatetime_label");
  cut_startdatetime_label->setGeometry(120,293,40,12);
  cut_startdatetime_label->setFont(small_font);
  cut_startdatetime_label->setAlignment(AlignRight|ShowPrefix);

  cut_enddatetime_edit=new QDateTimeEdit(this,"cut_enddatetime_edit");
  cut_enddatetime_edit->setGeometry(165,309,170,19);
  cut_enddatetime_label=new QLabel(cut_enddatetime_edit,tr("End"),this,
				       "cut_enddatetime_label");
  cut_enddatetime_label->setGeometry(120,313,40,12);
  cut_enddatetime_label->setFont(small_font);
  cut_enddatetime_label->setAlignment(AlignRight|ShowPrefix);

  //
  // Cut Daypart
  //
  cut_daypart_label=new QLabel(tr("Daypart"),this);
  cut_daypart_label->setGeometry(50,348,65,19);
  cut_daypart_label->setAlignment(Qt::AlignHCenter);
  cut_daypart_label->setFont(font);
  button_group=new QButtonGroup(this,"daypart_group");
  button_group->hide();
  connect(button_group,SIGNAL(clicked(int)),this,SLOT(daypartButtonData(int)));
  cut_starttime_enable_button=new QRadioButton(tr("Enabled"),this,
					       "daypart_enabled_button");
  cut_starttime_enable_button->setGeometry(57,370,100,20);
  button_group->insert(cut_starttime_enable_button,true);
  cut_starttime_disable_button=new QRadioButton(tr("Disabled"),this,
				"daypart_disabled_button");
  cut_starttime_disable_button->setGeometry(57,390,100,20);
  button_group->insert(cut_starttime_disable_button,false);

  cut_starttime_edit=new RDTimeEdit(this,"cut_starttime_edit");
  cut_starttime_edit->setGeometry(222,369,90,19);
  cut_starttime_label=new QLabel(cut_starttime_edit,tr("&Start Time"),this,
				       "cut_starttime_label");
  cut_starttime_label->setGeometry(137,373,80,12);
  cut_starttime_label->setFont(small_font);
  cut_starttime_label->setAlignment(AlignRight|ShowPrefix);

  cut_endtime_edit=new RDTimeEdit(this,"cut_endtime_edit");
  cut_endtime_edit->setGeometry(222,389,90,19);
  cut_endtime_label=new QLabel(cut_endtime_edit,tr("End Time"),this,
				       "cut_endtime_label");
  cut_endtime_label->setGeometry(137,393,80,12);
  cut_endtime_label->setFont(small_font);
  cut_endtime_label->setAlignment(AlignRight|ShowPrefix);

  //
  // Days of the Week
  //
  rec_dayofweek_label=new QLabel(tr("Day of the Week"),this);
  rec_dayofweek_label->setGeometry(50,428,125,19);
  rec_dayofweek_label->setAlignment(Qt::AlignHCenter);
  rec_dayofweek_label->setFont(font);
  rec_weekpart_button[0]=new QCheckBox(this,"cut_weekpart_button[0]");
  rec_weekpart_button[0]->setGeometry(40,447,15,15);
  rec_weekpart_label[0]=new QLabel(rec_weekpart_button[0],tr("Monday"),
		   this,"rec_weekpart_label[0]");
  rec_weekpart_label[0]->setGeometry(62,445,80,20);
  rec_weekpart_label[0]->setFont(day_font);
  rec_weekpart_label[0]->setAlignment(AlignVCenter|AlignLeft);

  rec_weekpart_button[1]=new QCheckBox(this,"cut_weekpart_button[1]");
  rec_weekpart_button[1]->setGeometry(120,447,15,15);
  rec_weekpart_label[1]=new QLabel(rec_weekpart_button[1],tr("Tuesday"),
		   this,"rec_weekpart_label[0]");
  rec_weekpart_label[1]->setGeometry(142,445,80,20);
  rec_weekpart_label[1]->setFont(day_font);
  rec_weekpart_label[1]->setAlignment(AlignVCenter|AlignLeft);

  rec_weekpart_button[2]=new QCheckBox(this,"cut_weekpart_button[2]");
  rec_weekpart_button[2]->setGeometry(200,447,15,15);
  rec_weekpart_label[2]=new QLabel(rec_weekpart_button[2],tr("Wednesday"),
		   this,"rec_weekpart_label[0]");
  rec_weekpart_label[2]->setGeometry(222,445,80,20);
  rec_weekpart_label[2]->setFont(day_font);
  rec_weekpart_label[2]->setAlignment(AlignVCenter|AlignLeft);

  rec_weekpart_button[3]=new QCheckBox(this,"cut_weekpart_button[3]");
  rec_weekpart_button[3]->setGeometry(80,467,15,15);
  rec_weekpart_label[3]=new QLabel(rec_weekpart_button[3],tr("Thursday"),
		   this,"rec_weekpart_label[3]");
  rec_weekpart_label[3]->setGeometry(102,465,80,20);
  rec_weekpart_label[3]->setFont(day_font);
  rec_weekpart_label[3]->setAlignment(AlignVCenter|AlignLeft);

  rec_weekpart_button[4]=new QCheckBox(this,"cut_weekpart_button[4]");
  rec_weekpart_button[4]->setGeometry(180,467,15,15);
  rec_weekpart_label[4]=new QLabel(rec_weekpart_button[4],tr("Friday"),
		   this,"rec_weekpart_label[4]");
  rec_weekpart_label[4]->setGeometry(202,465,80,20);
  rec_weekpart_label[4]->setFont(day_font);
  rec_weekpart_label[4]->setAlignment(AlignVCenter|AlignLeft);

  rec_weekpart_button[5]=new QCheckBox(this,"cut_weekpart_button[5]");
  rec_weekpart_button[5]->setGeometry(80,487,15,15);
  rec_weekpart_label[5]=new QLabel(rec_weekpart_button[5],tr("Saturday"),
		   this,"rec_weekpart_label[5]");
  rec_weekpart_label[5]->setGeometry(102,485,80,20);
  rec_weekpart_label[5]->setFont(day_font);
  rec_weekpart_label[5]->setAlignment(AlignVCenter|AlignLeft);

  rec_weekpart_button[6]=new QCheckBox(this,"cut_weekpart_button[6]");
  rec_weekpart_button[6]->setGeometry(180,485,15,15);
  rec_weekpart_label[6]=new QLabel(rec_weekpart_button[6],tr("Sunday"),
		   this,"rec_weekpart_label[6]");
  rec_weekpart_label[6]->setGeometry(202,485,80,20);
  rec_weekpart_label[6]->setFont(day_font);
  rec_weekpart_label[6]->setAlignment(AlignVCenter|AlignLeft);

  rec_set_button=new QPushButton(tr("Set All"),this,"rec_set_button");
  rec_set_button->setGeometry(sizeHint().width()-80,441,55,30);
  rec_set_button->setFont(small_font);
  connect(rec_set_button,SIGNAL(clicked()),this,SLOT(setAllData()));

  rec_clear_button=new QPushButton(tr("Clear All"),this,"rec_clear_button");
  rec_clear_button->setGeometry(sizeHint().width()-80,476,55,30);
  rec_clear_button->setFont(small_font);
  connect(rec_clear_button,SIGNAL(clicked()),this,SLOT(clearAllData()));

  //
  // Audio Meter
  //
  rec_meter=new RDStereoMeter(this,"rec_meter");
  rec_meter->setGeometry(20,520,rec_meter->geometry().width(),
			 rec_meter->geometry().height());
  rec_meter->setReference(0);
  rec_meter->setMode(RDSegMeter::Independent);
  QTimer *timer=new QTimer(this,"meter_timer");
  connect(timer,SIGNAL(timeout()),this,SLOT(meterData()));
  timer->start(RD_METER_UPDATE_INTERVAL);

  //
  // AES Alarm
  //
  rec_aes_alarm_label=new QLabel(this,"rec_aes_alarm_label");
  rec_aes_alarm_label->setGeometry(15,592,110,22);
  rec_aes_alarm_label->setAlignment(AlignHCenter|AlignVCenter);
  rec_aes_alarm_label->setFont(large_font);
  rec_aes_alarm_label->setPalette(QColor(red));
  rec_aes_alarm_label->setText(tr("AES ALARM"));
  rec_aes_alarm_label->hide();

  //
  // Record Timer
  //
  rec_timer=new QTimer(this,"rec_timer");
  connect(rec_timer,SIGNAL(timeout()),this,SLOT(recTimerData()));
  rec_timer_label=new QLabel(this,"rec_timer_label");
  rec_timer_label->setGeometry(130,580,120,50);
  rec_timer_label->setFont(timer_font);
  rec_timer_label->setAlignment(AlignLeft|AlignVCenter);
  rec_timer_label->setText(RDGetTimeLength(rec_length,true));

  //
  // Channels
  //
  rec_channels_box=new QComboBox(this,"rec_channels_box");
  rec_channels_box->setGeometry(20,635,60,35);
  rec_channels_edit=new QLineEdit(this,"rec_channels_box");
  rec_channels_edit->setGeometry(20,635,60,35);
  QLabel *rec_channels_box_label=new QLabel(rec_channels_box,tr("Channels"),
					    this,"rec_channels_box_label");
  rec_channels_box_label->setGeometry(10,616,80,16);
  rec_channels_box_label->setAlignment(AlignHCenter);
  rec_channels_box_label->setFont(font);
  connect(rec_channels_box,SIGNAL(activated(int)),
	  this,SLOT(channelsData(int)));

  //
  //  Record Button
  //
  rec_record_button=new RDTransportButton(RDTransportButton::Record,
					this,"rec_record_button");
  rec_record_button->setGeometry(100,620,80,50);
  rec_record_button->setDefault(true);
  connect(rec_record_button,SIGNAL(clicked()),this,SLOT(recordData()));

  //
  //  Play Button
  //
  rec_play_button=new RDTransportButton(RDTransportButton::Play,
					this,"rec_play_button");
  rec_play_button->setGeometry(190,620,80,50);
  rec_play_button->setDefault(true);
  connect(rec_play_button,SIGNAL(clicked()),this,SLOT(playData()));

  //
  //  Stop Button
  //
  rec_stop_button=new RDTransportButton(RDTransportButton::Stop,
					this,"rec_stop_button");
  rec_stop_button->setGeometry(280,620,80,50);
  rec_stop_button->setDefault(true);
  rec_stop_button->setState(RDTransportButton::On);
  rec_stop_button->setOnColor(QColor(red));
  connect(rec_stop_button,SIGNAL(clicked()),this,SLOT(stopData()));

  //
  // Record Mode 
  //
  rec_mode_box=new QComboBox(this,"rec_mode_box");
  rec_mode_box->setGeometry(10,695,100,35);
  QLabel *rec_mode_box_label=new QLabel(rec_mode_box,tr("Record Mode"),this,
					"rec_mode_box_label");
  rec_mode_box_label->setGeometry(10,676,100,16);
  rec_mode_box_label->setAlignment(AlignHCenter);
  rec_mode_box_label->setFont(font);

  //
  // AutoTrim Mode 
  //
  rec_trim_box=new QComboBox(this,"rec_trim_box");
  rec_trim_box->setGeometry(145,695,70,35);
  QLabel *rec_trim_box_label=new QLabel(rec_trim_box,tr("AutoTrim"),this,
					"rec_trim_box_label");
  rec_trim_box_label->setGeometry(130,676,100,16);
  rec_trim_box_label->setAlignment(AlignHCenter);
  rec_trim_box_label->setFont(font);

  //
  //  Close Button
  //
  QPushButton *close_button=new QPushButton(this,"close_button");
  close_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			    80,50);
  close_button->setDefault(true);
  close_button->setFont(font);
  close_button->setText(tr("&Close"));
  connect(close_button,SIGNAL(clicked()),this,SLOT(closeData()));

  //
  // Populate Fields
  //
  cut_description_edit->setText(rec_cut->description());
  cut_outcue_edit->setText(rec_cut->outcue());
  cut_origin_name=rec_cut->originName();
  cut_origin_datetime=rec_cut->originDatetime(&valid);
  if(valid) {
    cut_origin_edit->setText(cut_origin_name+" - "+
	       	     cut_origin_datetime.toString("M/d/yyyy hh:mm:ss"));
  }
  cut_isci_edit->setText(rec_cut->isci());
  cut_isrc_edit->setText(rec_cut->isrc(RDCut::FormattedIsrc));
  cut_weight_box->setValue(rec_cut->weight());
  if(rec_cut->playCounter()>0) {
    cut_playdate_edit->
      setText(rec_cut->lastPlayDatetime(&valid).toString("M/d/yyyy hh:mm:ss"));
  }
  else {
    cut_playdate_edit->setText("Never");
  }
  cut_playcounter_edit->
    setText(QString().sprintf("%d",rec_cut->playCounter()));
  rec_evergreen_box->setChecked(rec_cut->evergreen());
  evergreenToggledData(rec_evergreen_box->isChecked());
  cut_startdatetime_edit->setDateTime(rec_cut->startDatetime(&valid));
  cut_enddatetime_edit->setDateTime(rec_cut->endDatetime(&valid));
  cut_startdatetime_enable_button->setChecked(valid);
  cut_startdatetime_disable_button->setChecked(!valid);
  airDateButtonData(valid);
  cut_starttime_edit->setTime(rec_cut->startDaypart(&valid));
  cut_endtime_edit->setTime(rec_cut->endDaypart(&valid));
  cut_starttime_enable_button->setChecked(valid);
  cut_starttime_disable_button->setChecked(!valid);
  daypartButtonData(valid);
  for(int i=0;i<7;i++) {
    if(rec_cut->weekPart(i+1)) {
      rec_weekpart_button[i]->setChecked(true);
    }
  }
  rec_channels_box->insertItem("1");
  rec_channels_box->insertItem("2");
  rec_channels_box->setCurrentItem(rec_cut->channels()-1);
  rec_channels_edit->setText(QString().sprintf("%d",rec_cut->channels()));
  rec_mode_box->insertItem(tr("Manual"));
  rec_mode_box->insertItem(tr("VOX"));
  switch(rdlibrary_conf->defaultRecordMode()) {
      case RDLibraryConf::Manual:
	rec_mode_box->setCurrentItem(0);
	break;

      case RDLibraryConf::Vox:
	rec_mode_box->setCurrentItem(1);
	break;
  }
  rec_trim_box->insertItem(tr("On"));
  rec_trim_box->insertItem(tr("Off"));
  if(rdlibrary_conf->defaultTrimState()) {
    rec_trim_box->setCurrentItem(0);
  }
  else {
    rec_trim_box->setCurrentItem(1);
  }
  aesAlarmData(rec_card_no[0],rec_port_no[0],
	       rdcae->inputStatus(rec_card_no[0],rec_port_no[0]));

  //
  // Set Control Perms
  //
  cut_description_edit->setReadOnly(!allow_modification);
  cut_outcue_edit->setReadOnly(!allow_modification);
  cut_isci_edit->setReadOnly(!allow_modification);
  cut_starttime_edit->setReadOnly(!allow_modification);
  cut_endtime_edit->setReadOnly(!allow_modification);
  if(!allow_modification) {
    cut_weight_box->setRange(cut_weight_box->value(),cut_weight_box->value());
    if(cut_startdatetime_enable_button->isChecked()) {
      cut_startdatetime_edit->dateEdit()->
	setRange(cut_startdatetime_edit->dateEdit()->date(),
		 cut_startdatetime_edit->dateEdit()->date());
      cut_startdatetime_edit->timeEdit()->
	setRange(cut_startdatetime_edit->timeEdit()->time(),
		 cut_startdatetime_edit->timeEdit()->time());
      cut_enddatetime_edit->dateEdit()->
	setRange(cut_enddatetime_edit->dateEdit()->date(),
		 cut_enddatetime_edit->dateEdit()->date());
    }
    if(cut_starttime_enable_button->isChecked()) {
      cut_enddatetime_edit->timeEdit()->
	setRange(cut_enddatetime_edit->timeEdit()->time(),
		 cut_enddatetime_edit->timeEdit()->time());
    }
  }
  rec_evergreen_box->setEnabled(allow_modification);
  if(!allow_modification) {
    cut_startdatetime_enable_button->setDisabled(true);
    cut_startdatetime_disable_button->setDisabled(true);
    cut_starttime_enable_button->setDisabled(true);
    cut_starttime_disable_button->setDisabled(true);
    rec_set_button->setDisabled(true);
    rec_clear_button->setDisabled(true);
  }
  for(int i=0;i<7;i++) {
    rec_weekpart_button[i]->setEnabled(allow_modification);
  }
  rec_record_button->
    setEnabled(allow_editing&&(rec_card_no[0]>=0)&&(rec_port_no[0]>=0));
  rec_mode_box->setEnabled(allow_editing);
  rec_trim_box->setEnabled(allow_editing);
  if(allow_editing) {
    rec_channels_edit->hide();
  }
  else {
    rec_channels_box->hide();
  }
}
EditEndpoint::EditEndpoint(RDMatrix::Type type,RDMatrix::Endpoint endpoint,
			   int pointnum,QString *pointname,QString *feedname,
			   RDMatrix::Mode *mode,int *enginenum,int *devicenum,
			   QWidget *parent)
  : QDialog(parent,"",true)
{
  edit_type=type;
  edit_endpoint=endpoint;
  edit_pointnum=pointnum;
  edit_pointname=pointname;
  edit_feedname=feedname;
  edit_mode=mode;
  edit_enginenum=enginenum;
  edit_devicenum=devicenum;

  switch(edit_endpoint) {
      case RDMatrix::Input:
	edit_table="INPUTS";
	setCaption(tr("Edit Input"));
	break;

      case RDMatrix::Output:
	edit_table="OUTPUTS";
	setCaption(tr("Edit Output"));
	break;
  }

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  //
  // Create Fonts
  //
  QFont bold_font=QFont("Helvetica",12,QFont::Bold);
  bold_font.setPixelSize(12);
  QFont font=QFont("Helvetica",12,QFont::Normal);
  font.setPixelSize(12);

  //
  // Text Validator
  //
  RDTextValidator *validator=new RDTextValidator(this);

  //
  // Endpoint Name
  //
  edit_endpoint_edit=new QLineEdit(this);
  edit_endpoint_edit->setGeometry(75,10,sizeHint().width()-85,20);
  edit_endpoint_edit->setValidator(validator);
  QLabel *label=new QLabel(edit_endpoint_edit,tr("Name: "),this);
  label->setGeometry(10,13,60,20);
  label->setFont(bold_font);
  label->setAlignment(AlignRight);

  //
  // Unity Feed
  //
  edit_feed_edit=new QLineEdit(this);
  edit_feed_edit->setGeometry(75,40,40,20);
  edit_feed_edit->setValidator(validator);
  label=new QLabel(edit_feed_edit,tr("Feed: "),this);
  label->setGeometry(10,43,60,20);
  label->setFont(bold_font);
  label->setAlignment(AlignRight);
  if((edit_type!=RDMatrix::Unity4000)||(edit_endpoint!=RDMatrix::Input)) {
    edit_feed_edit->hide();
    label->hide();
  }

  //
  // Unity Mode
  //
  edit_mode_box=new QComboBox(this);
  label=new QLabel(edit_mode_box,tr("Mode: "),this);
  if(edit_type==RDMatrix::StarGuideIII) {
    edit_mode_box->setGeometry(135,88,85,24);
    label->setGeometry(10,93,120,20);
  }
  else {
    edit_mode_box->setGeometry(195,40,85,24);
    label->setGeometry(130,43,60,20);
  }
  label->setFont(bold_font);
  label->setAlignment(AlignRight);
  if(((edit_type!=RDMatrix::Unity4000)&&(edit_type!=RDMatrix::StarGuideIII))||
     (edit_endpoint!=RDMatrix::Input)) {
    edit_mode_box->hide();
    label->hide();
  }
  edit_mode_box->insertItem(tr("Stereo"));
  edit_mode_box->insertItem(tr("Left"));
  edit_mode_box->insertItem(tr("Right"));

  //
  // Logitek Engine Number / StarGuide Provider ID
  //
  edit_enginenum_edit=new QLineEdit(this);
  edit_enginenum_edit->setGeometry(135,36,50,20);
  label=new QLabel(edit_enginenum_edit,tr("Engine (Hex): "),this);
  if(edit_type==RDMatrix::StarGuideIII) {
    label->setText(tr("Provider ID:"));
  }
  label->setGeometry(10,36,120,20);
  label->setFont(bold_font);
  label->setAlignment(AlignRight|AlignVCenter);
  if((edit_type!=RDMatrix::LogitekVguest)&&
     ((edit_type!=RDMatrix::StarGuideIII)||(edit_endpoint!=RDMatrix::Input))) {
    edit_enginenum_edit->hide();
    label->hide();
  }

  //
  // Logitek Device Number / StarGuide Service ID
  //
  edit_devicenum_edit=new QLineEdit(this);
  edit_devicenum_edit->setGeometry(135,62,50,20);
  label=new QLabel(edit_devicenum_edit,tr("Device (Hex): "),this);
  if(edit_type==RDMatrix::StarGuideIII) {
    label->setText(tr("Service ID:"));
  }
  label->setGeometry(10,62,120,20);
  label->setFont(bold_font);
  label->setAlignment(AlignRight|AlignVCenter);
  if((edit_type!=RDMatrix::LogitekVguest)&&
     ((edit_type!=RDMatrix::StarGuideIII)||(edit_endpoint!=RDMatrix::Input))) {
    edit_devicenum_edit->hide();
    label->hide();
  }

  //
  //  Ok Button
  //
  QPushButton *button=new QPushButton(this);
  button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  button->setDefault(true);
  button->setFont(bold_font);
  button->setText(tr("&OK"));
  connect(button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  button=new QPushButton(this);
  button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50);
  button->setFont(bold_font);
  button->setText(tr("&Cancel"));
  connect(button,SIGNAL(clicked()),this,SLOT(cancelData()));

  //
  // Load Data
  //
  edit_endpoint_edit->setText(*edit_pointname);
  edit_feed_edit->setText(*edit_feedname);
  edit_mode_box->setCurrentItem(*edit_mode);
  if(*enginenum>=0) {
    if(edit_type==RDMatrix::LogitekVguest) {
      edit_enginenum_edit->setText(QString().sprintf("%04X",*enginenum));
    }
    else {
      edit_enginenum_edit->setText(QString().sprintf("%d",*enginenum));
    }
  }
  if(*devicenum>=0) {
    if(edit_type==RDMatrix::LogitekVguest) {
      edit_devicenum_edit->setText(QString().sprintf("%04X",*devicenum));
    }
    else {
      edit_devicenum_edit->setText(QString().sprintf("%d",*devicenum));
    }
  }
}
EditDecks::EditDecks(RDStation *station,RDStation *cae_station,QWidget *parent)
  : QDialog(parent,"",true)
{
  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  edit_station=station;

  setCaption(tr("Configure RDCatch"));

  //
  // Create Fonts
  //
  QFont small_font=QFont("Helvetica",12,QFont::Bold);
  small_font.setPixelSize(12);
  QFont big_font=QFont("Helvetica",14,QFont::Bold);
  big_font.setPixelSize(14);

  //
  // Create RDCatchConf
  //
  edit_catch_conf=new RDCatchConf(station->name());

  //
  // Record Deck Selector
  //
  edit_record_deck_box=new QComboBox(this);
  edit_record_deck_box->setGeometry(140,10,60,24);
  edit_record_deck_box->setInsertionPolicy(QComboBox::NoInsertion);
  connect(edit_record_deck_box,SIGNAL(activated(int)),
	  this,SLOT(recordDeckActivatedData(int)));
  QLabel *label=new QLabel(edit_record_deck_box,tr("Record Deck"),this);
  label->setFont(small_font);
  label->setGeometry(35,14,100,22);
  label->setAlignment(AlignRight);

  //
  // Settings Label
  //
  label=new QLabel(tr("Settings"),this);
  label->setGeometry(10,40,100,24);
  label->setFont(big_font);

  //
  // Card Selector
  //
  edit_record_selector=new RDCardSelector(this);
  edit_record_selector->setGeometry(67,68,120,65);
  connect(edit_record_selector,SIGNAL(cardChanged(int)),
	  this,SLOT(recordCardChangedData(int)));

  //
  // Monitor Port Selector
  //
  edit_monitor_box=new QSpinBox(this);
  edit_monitor_box->setGeometry(127,112,50,19);
  edit_monitor_box->setRange(-1,RD_MAX_PORTS-1);
  edit_monitor_box->setSpecialValueText(tr("None"));
  connect(edit_monitor_box,SIGNAL(valueChanged(int)),
	  this,SLOT(monitorPortChangedData(int)));
  edit_monitor_label=new QLabel(edit_monitor_box,tr("Monitor Port:"),this);
  edit_monitor_label->setGeometry(10,112,112,19);
  edit_monitor_label->setAlignment(AlignRight|AlignVCenter);

  edit_default_on_box=new QComboBox(this);
  edit_default_on_box->setGeometry(305,112,60,19);
  edit_default_on_box->insertItem(tr("Off"));
  edit_default_on_box->insertItem(tr("On"));
  edit_default_on_label=
    new QLabel(edit_default_on_box,tr("Monitor defaults to"),this);
  edit_default_on_label->setGeometry(195,112,105,19);
  edit_default_on_label->setAlignment(AlignRight|AlignVCenter);

  //
  // Format
  //
  edit_format_box=new QComboBox(this);
  edit_format_box->setGeometry(125,136,150,24);
  edit_format_box->setInsertionPolicy(QComboBox::NoInsertion);
  connect(edit_format_box,SIGNAL(activated(int)),
	  this,SLOT(formatActivatedData(int)));
  label=new QLabel(edit_format_box,tr("Format:"),this);
  label->setGeometry(10,136,110,24);
  label->setAlignment(AlignRight|AlignVCenter);

  //
  // Bit Rate
  //
  edit_bitrate_box=new QComboBox(this,"edit_bitrate_box");
  edit_bitrate_box->setGeometry(125,160,140,24);
  edit_bitrate_box->setInsertionPolicy(QComboBox::NoInsertion);
  edit_bitrate_label=new QLabel(edit_bitrate_box,tr("Bit Rate:"),this);
  edit_bitrate_label->setGeometry(10,160,110,24);
  edit_bitrate_label->setAlignment(AlignRight|AlignVCenter);

  //
  // Switcher Station
  //
  edit_swstation_box=new QComboBox(this);
  edit_swstation_box->setGeometry(125,190,250,24);
  edit_swstation_box->setInsertionPolicy(QComboBox::NoInsertion);
  edit_swstation_label=new QLabel(edit_swstation_box,tr("Switcher Host:"),this);
  edit_swstation_label->setGeometry(10,190,110,24);
  edit_swstation_label->setAlignment(AlignRight|AlignVCenter);
  connect(edit_swstation_box,SIGNAL(activated(const QString &)),
	  this,SLOT(stationActivatedData(const QString &)));

  //
  // Switcher Matrix
  //
  edit_swmatrix_box=new QComboBox(this);
  edit_swmatrix_box->setGeometry(125,214,250,24);
  edit_swmatrix_box->setInsertionPolicy(QComboBox::NoInsertion);
  edit_swmatrix_box->setDisabled(true);
  edit_swmatrix_label=new QLabel(edit_swmatrix_box,tr("Switcher Matrix:"),this);
  edit_swmatrix_label->setGeometry(10,214,110,24);
  edit_swmatrix_label->setAlignment(AlignRight|AlignVCenter);
  edit_swmatrix_label->setDisabled(true);
  connect(edit_swmatrix_box,SIGNAL(activated(const QString &)),
	  this,SLOT(matrixActivatedData(const QString &)));

  //
  // Switcher Output
  //
  edit_swoutput_box=new QComboBox(this);
  edit_swoutput_box->setGeometry(125,238,250,24);
  edit_swoutput_box->setInsertionPolicy(QComboBox::NoInsertion);
  edit_swoutput_box->setDisabled(true);
  edit_swoutput_label=new QLabel(edit_swoutput_box,tr("Switcher Output:"),this);
  edit_swoutput_label->setGeometry(10,238,110,24);
  edit_swoutput_label->setAlignment(AlignRight|AlignVCenter);
  edit_swoutput_label->setDisabled(true);

  //
  // Switcher Delay
  //
  edit_swdelay_box=new QSpinBox(this);
  edit_swdelay_box->setGeometry(125,262,40,24);
  edit_swdelay_box->setRange(0,20);
  edit_swdelay_box->setDisabled(true);
  edit_swdelay_label=new QLabel(edit_swdelay_box,tr("Switcher Delay:"),this);
  edit_swdelay_label->setGeometry(10,262,110,24);
  edit_swdelay_label->setAlignment(AlignRight|AlignVCenter);
  edit_swdelay_label->setDisabled(true);
  edit_swdelay_unit=new QLabel(edit_swdelay_box,tr("1/10 sec"),this);
  edit_swdelay_unit->setGeometry(170,262,60,24);
  edit_swdelay_unit->setAlignment(AlignLeft|AlignVCenter);
  edit_swdelay_unit->setDisabled(true);
  edit_swdelay_box->hide();
  edit_swdelay_label->hide();
  edit_swdelay_unit->hide();

  //
  // Defaults Label
  //
  label=new QLabel(tr("Defaults"),this);
  label->setGeometry(10,276,100,24);
  label->setFont(big_font);

  //
  // Default Channels
  //
  edit_channels_box=new QComboBox(this);
  edit_channels_box->setGeometry(125,300,60,24);
  edit_channels_box->setInsertionPolicy(QComboBox::NoInsertion);
  label=new QLabel(edit_channels_box,tr("Channels:"),this);
  label->setGeometry(10,300,110,24);
  label->setAlignment(AlignRight|AlignVCenter);

  //
  // Default Autotrim Threshold
  //
  edit_threshold_box=new QSpinBox(this);
  edit_threshold_box->setGeometry(125,324,70,24);
  edit_threshold_box->setSuffix(" dB");
  edit_threshold_box->setRange(-100,0);
  label=new QLabel(edit_threshold_box,tr("Trim Threshold:"),this);
  label->setGeometry(10,324,110,24);
  label->setAlignment(AlignRight|AlignVCenter);

  //
  // Host-Wide Settings Label
  //
  label=new QLabel(tr("Host-Wide Settings"),this);
  label->setGeometry(10,369,200,24);
  label->setFont(big_font);

  edit_errorrml_edit=new QLineEdit(this);
  edit_errorrml_edit->setGeometry(125,393,248,24);
  label=new QLabel(edit_errorrml_edit,tr("Error RML:"),this);
  label->setGeometry(10,393,110,24);
  label->setAlignment(AlignRight|AlignVCenter);

  //
  // Play Deck Selector
  //
  edit_play_deck_box=new QComboBox(this);
  edit_play_deck_box->setGeometry(475,10,60,24);
  edit_play_deck_box->setInsertionPolicy(QComboBox::NoInsertion);
  connect(edit_play_deck_box,SIGNAL(activated(int)),
	  this,SLOT(playDeckActivatedData(int)));
  label=new QLabel(edit_play_deck_box,tr("Play Deck"),this);
  label->setFont(small_font);
  label->setGeometry(390,14,80,22);
  label->setAlignment(AlignRight);

  //
  // Play Deck Card Selector
  //
  edit_play_selector=new RDCardSelector(this);
  edit_play_selector->setGeometry(387,42,120,10);

  //
  //  Close Button
  //
  QPushButton *close_button=new QPushButton(this);
  close_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			    80,50);
  close_button->setFont(small_font);
  close_button->setText(tr("&Close"));
  close_button->setDefault(true);
  connect(close_button,SIGNAL(clicked()),this,SLOT(closeData()));

  //
  // Populate Data
  //
  if(cae_station->scanned()) {
    edit_record_selector->setMaxCards(cae_station->cards());
    edit_play_selector->setMaxCards(cae_station->cards());
    for(int i=0;i<edit_record_selector->maxCards();i++) {
      edit_record_selector->setMaxPorts(i,cae_station->cardInputs(i));
      edit_play_selector->setMaxPorts(i,cae_station->cardOutputs(i));
    }
  }
  else {
    QMessageBox::information(this,tr("No Audio Configuration Data"),
			     tr("Channel assignments will not be available for this host as audio resource data\nhas not yet been generated.  Please start the Rivendell daemons on the host\nconfigured to run the CAE service in order to populate the audio resources database."));
    edit_record_selector->setDisabled(true);
    edit_monitor_box->setDisabled(true);
    edit_monitor_label->setDisabled(true);
    edit_play_selector->setDisabled(true);
  }
  edit_errorrml_edit->setText(edit_catch_conf->errorRml());
  edit_record_deck=NULL;
  edit_play_deck=NULL;
  edit_audition_deck=NULL;
  for(int i=0;i<MAX_DECKS;i++) {
    edit_record_deck_box->insertItem(QString().sprintf("%d",i+1));
    edit_play_deck_box->insertItem(QString().sprintf("%d",i+1));
  }
  edit_record_channel=edit_record_deck_box->currentItem()+1;
  edit_play_channel=edit_play_deck_box->currentItem()+129;
  edit_format_box->insertItem(tr("PCM16"));
  edit_format_box->insertItem(tr("MPEG Layer 2"));
  edit_channels_box->insertItem("1");
  edit_channels_box->insertItem("2");
  edit_bitrate_box->insertItem(tr("32 kbps/chan"));
  edit_bitrate_box->insertItem(tr("48 kbps/chan"));
  edit_bitrate_box->insertItem(tr("56 kbps/chan"));
  edit_bitrate_box->insertItem(tr("64 kbps/chan"));
  edit_bitrate_box->insertItem(tr("80 kbps/chan"));
  edit_bitrate_box->insertItem(tr("96 kbps/chan"));
  edit_bitrate_box->insertItem(tr("112 kbps/chan"));
  edit_bitrate_box->insertItem(tr("128 kbps/chan"));
  edit_bitrate_box->insertItem(tr("160 kbps/chan"));
  edit_bitrate_box->insertItem(tr("192 kbps/chan"));
  edit_swstation_box->insertItem(tr("[none]"));
  RDSqlQuery *q=new RDSqlQuery("select NAME from STATIONS where \
                              NAME!=\"DEFAULT\"");
  while(q->next()) {
    edit_swstation_box->insertItem(q->value(0).toString());
  }
  delete q;
  ReadRecord(edit_record_channel);
  ReadRecord(edit_play_channel);
  ReadRecord(0);
  recordCardChangedData(edit_record_selector->card());
}
Exemple #24
0
LogBrowser::LogBrowser(QWidget *parent) :
    QDialog(parent),
    _logWidget( new LogWidget(parent) ),
    _doFileFlush(false)
{
    setObjectName("LogBrowser"); // for save/restoreGeometry()
    setWindowTitle(tr("Log Output"));
    setMinimumWidth(600);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    // mainLayout->setMargin(0);

    mainLayout->addWidget( _logWidget );

    QHBoxLayout *toolLayout = new QHBoxLayout;
    mainLayout->addLayout( toolLayout );

    // Search input field
    QLabel *lab = new QLabel(tr("&Search: "));
    _findTermEdit = new QLineEdit;
    lab->setBuddy( _findTermEdit );
    toolLayout->addWidget(lab);
    toolLayout->addWidget( _findTermEdit );

    // find button
    QPushButton *findBtn = new QPushButton;
    findBtn->setText( tr("&Find") );
    connect( findBtn, SIGNAL(clicked()), this, SLOT(slotFind()));
    toolLayout->addWidget( findBtn );

    // stretch
    toolLayout->addStretch(1);
    _statusLabel = new QLabel;
    toolLayout->addWidget( _statusLabel );
    toolLayout->addStretch(5);

    QDialogButtonBox *btnbox = new QDialogButtonBox;
    QPushButton *closeBtn = btnbox->addButton( QDialogButtonBox::Close );
    connect(closeBtn,SIGNAL(clicked()),this,SLOT(close()));

    mainLayout->addWidget( btnbox );

    // clear button
    _clearBtn = new QPushButton;
    _clearBtn->setText( tr("Clear") );
    _clearBtn->setToolTip( tr("Clear the log display.") );
    btnbox->addButton(_clearBtn, QDialogButtonBox::ActionRole);
    connect( _clearBtn, SIGNAL(clicked()), this, SLOT(slotClearLog()));

    // save Button
    _saveBtn = new QPushButton;
    _saveBtn->setText( tr("S&ave") );
    _saveBtn->setToolTip(tr("Save the log file to a file on disk for debugging."));
    btnbox->addButton(_saveBtn, QDialogButtonBox::ActionRole);
    connect( _saveBtn, SIGNAL(clicked()),this, SLOT(slotSave()));

    setLayout( mainLayout );

    setModal(false);

    // Direct connection for log comming from this thread, and queued for the one in a different thread
    connect(Logger::instance(), SIGNAL(newLog(QString)),this,SLOT(slotNewLog(QString)), Qt::AutoConnection);

    QAction *showLogWindow = new QAction(this);
    showLogWindow->setShortcut(QKeySequence("F12"));
    connect(showLogWindow, SIGNAL(triggered()), SLOT(close()));
    addAction(showLogWindow);

    MirallConfigFile cfg;
    cfg.restoreGeometry(this);
    int lines = cfg.maxLogLines();
    // qDebug() << "#        ##  Have " << lines << " Loglines!";
    _logWidget->document()->setMaximumBlockCount( lines );

}
int QWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 23)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 23;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = isModal(); break;
        case 1: *reinterpret_cast< Qt::WindowModality*>(_v) = windowModality(); break;
        case 2: *reinterpret_cast< bool*>(_v) = isEnabled(); break;
        case 3: *reinterpret_cast< QRect*>(_v) = geometry(); break;
        case 4: *reinterpret_cast< QRect*>(_v) = frameGeometry(); break;
        case 5: *reinterpret_cast< QRect*>(_v) = normalGeometry(); break;
        case 6: *reinterpret_cast< int*>(_v) = x(); break;
        case 7: *reinterpret_cast< int*>(_v) = y(); break;
        case 8: *reinterpret_cast< QPoint*>(_v) = pos(); break;
        case 9: *reinterpret_cast< QSize*>(_v) = frameSize(); break;
        case 10: *reinterpret_cast< QSize*>(_v) = size(); break;
        case 11: *reinterpret_cast< int*>(_v) = width(); break;
        case 12: *reinterpret_cast< int*>(_v) = height(); break;
        case 13: *reinterpret_cast< QRect*>(_v) = rect(); break;
        case 14: *reinterpret_cast< QRect*>(_v) = childrenRect(); break;
        case 15: *reinterpret_cast< QRegion*>(_v) = childrenRegion(); break;
        case 16: *reinterpret_cast< QSizePolicy*>(_v) = sizePolicy(); break;
        case 17: *reinterpret_cast< QSize*>(_v) = minimumSize(); break;
        case 18: *reinterpret_cast< QSize*>(_v) = maximumSize(); break;
        case 19: *reinterpret_cast< int*>(_v) = minimumWidth(); break;
        case 20: *reinterpret_cast< int*>(_v) = minimumHeight(); break;
        case 21: *reinterpret_cast< int*>(_v) = maximumWidth(); break;
        case 22: *reinterpret_cast< int*>(_v) = maximumHeight(); break;
        case 23: *reinterpret_cast< QSize*>(_v) = sizeIncrement(); break;
        case 24: *reinterpret_cast< QSize*>(_v) = baseSize(); break;
        case 25: *reinterpret_cast< QPalette*>(_v) = palette(); break;
        case 26: *reinterpret_cast< QFont*>(_v) = font(); break;
        case 27: *reinterpret_cast< QCursor*>(_v) = cursor(); break;
        case 28: *reinterpret_cast< bool*>(_v) = hasMouseTracking(); break;
        case 29: *reinterpret_cast< bool*>(_v) = isActiveWindow(); break;
        case 30: *reinterpret_cast< Qt::FocusPolicy*>(_v) = focusPolicy(); break;
        case 31: *reinterpret_cast< bool*>(_v) = hasFocus(); break;
        case 32: *reinterpret_cast< Qt::ContextMenuPolicy*>(_v) = contextMenuPolicy(); break;
        case 33: *reinterpret_cast< bool*>(_v) = updatesEnabled(); break;
        case 34: *reinterpret_cast< bool*>(_v) = isVisible(); break;
        case 35: *reinterpret_cast< bool*>(_v) = isMinimized(); break;
        case 36: *reinterpret_cast< bool*>(_v) = isMaximized(); break;
        case 37: *reinterpret_cast< bool*>(_v) = isFullScreen(); break;
        case 38: *reinterpret_cast< QSize*>(_v) = sizeHint(); break;
        case 39: *reinterpret_cast< QSize*>(_v) = minimumSizeHint(); break;
        case 40: *reinterpret_cast< bool*>(_v) = acceptDrops(); break;
        case 41: *reinterpret_cast< QString*>(_v) = windowTitle(); break;
        case 42: *reinterpret_cast< QIcon*>(_v) = windowIcon(); break;
        case 43: *reinterpret_cast< QString*>(_v) = windowIconText(); break;
        case 44: *reinterpret_cast< double*>(_v) = windowOpacity(); break;
        case 45: *reinterpret_cast< bool*>(_v) = isWindowModified(); break;
        case 46: *reinterpret_cast< QString*>(_v) = toolTip(); break;
        case 47: *reinterpret_cast< QString*>(_v) = statusTip(); break;
        case 48: *reinterpret_cast< QString*>(_v) = whatsThis(); break;
        case 49: *reinterpret_cast< QString*>(_v) = accessibleName(); break;
        case 50: *reinterpret_cast< QString*>(_v) = accessibleDescription(); break;
        case 51: *reinterpret_cast< Qt::LayoutDirection*>(_v) = layoutDirection(); break;
        case 52: *reinterpret_cast< bool*>(_v) = autoFillBackground(); break;
        case 53: *reinterpret_cast< QString*>(_v) = styleSheet(); break;
        case 54: *reinterpret_cast< QLocale*>(_v) = locale(); break;
        case 55: *reinterpret_cast< QString*>(_v) = windowFilePath(); break;
        case 56: *reinterpret_cast< Qt::InputMethodHints*>(_v) = inputMethodHints(); break;
        }
        _id -= 57;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 1: setWindowModality(*reinterpret_cast< Qt::WindowModality*>(_v)); break;
        case 2: setEnabled(*reinterpret_cast< bool*>(_v)); break;
        case 3: setGeometry(*reinterpret_cast< QRect*>(_v)); break;
        case 8: move(*reinterpret_cast< QPoint*>(_v)); break;
        case 10: resize(*reinterpret_cast< QSize*>(_v)); break;
        case 16: setSizePolicy(*reinterpret_cast< QSizePolicy*>(_v)); break;
        case 17: setMinimumSize(*reinterpret_cast< QSize*>(_v)); break;
        case 18: setMaximumSize(*reinterpret_cast< QSize*>(_v)); break;
        case 19: setMinimumWidth(*reinterpret_cast< int*>(_v)); break;
        case 20: setMinimumHeight(*reinterpret_cast< int*>(_v)); break;
        case 21: setMaximumWidth(*reinterpret_cast< int*>(_v)); break;
        case 22: setMaximumHeight(*reinterpret_cast< int*>(_v)); break;
        case 23: setSizeIncrement(*reinterpret_cast< QSize*>(_v)); break;
        case 24: setBaseSize(*reinterpret_cast< QSize*>(_v)); break;
        case 25: setPalette(*reinterpret_cast< QPalette*>(_v)); break;
        case 26: setFont(*reinterpret_cast< QFont*>(_v)); break;
        case 27: setCursor(*reinterpret_cast< QCursor*>(_v)); break;
        case 28: setMouseTracking(*reinterpret_cast< bool*>(_v)); break;
        case 30: setFocusPolicy(*reinterpret_cast< Qt::FocusPolicy*>(_v)); break;
        case 32: setContextMenuPolicy(*reinterpret_cast< Qt::ContextMenuPolicy*>(_v)); break;
        case 33: setUpdatesEnabled(*reinterpret_cast< bool*>(_v)); break;
        case 34: setVisible(*reinterpret_cast< bool*>(_v)); break;
        case 40: setAcceptDrops(*reinterpret_cast< bool*>(_v)); break;
        case 41: setWindowTitle(*reinterpret_cast< QString*>(_v)); break;
        case 42: setWindowIcon(*reinterpret_cast< QIcon*>(_v)); break;
        case 43: setWindowIconText(*reinterpret_cast< QString*>(_v)); break;
        case 44: setWindowOpacity(*reinterpret_cast< double*>(_v)); break;
        case 45: setWindowModified(*reinterpret_cast< bool*>(_v)); break;
        case 46: setToolTip(*reinterpret_cast< QString*>(_v)); break;
        case 47: setStatusTip(*reinterpret_cast< QString*>(_v)); break;
        case 48: setWhatsThis(*reinterpret_cast< QString*>(_v)); break;
        case 49: setAccessibleName(*reinterpret_cast< QString*>(_v)); break;
        case 50: setAccessibleDescription(*reinterpret_cast< QString*>(_v)); break;
        case 51: setLayoutDirection(*reinterpret_cast< Qt::LayoutDirection*>(_v)); break;
        case 52: setAutoFillBackground(*reinterpret_cast< bool*>(_v)); break;
        case 53: setStyleSheet(*reinterpret_cast< QString*>(_v)); break;
        case 54: setLocale(*reinterpret_cast< QLocale*>(_v)); break;
        case 55: setWindowFilePath(*reinterpret_cast< QString*>(_v)); break;
        case 56: setInputMethodHints(*reinterpret_cast< Qt::InputMethodHints*>(_v)); break;
        }
        _id -= 57;
    } else if (_c == QMetaObject::ResetProperty) {
        switch (_id) {
        case 27: unsetCursor(); break;
        case 51: unsetLayoutDirection(); break;
        case 54: unsetLocale(); break;
        }
        _id -= 57;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        bool *_b = reinterpret_cast<bool*>(_a[0]);
        switch (_id) {
        case 41: *_b = isWindow(); break;
        case 42: *_b = isWindow(); break;
        case 43: *_b = isWindow(); break;
        case 44: *_b = isWindow(); break;
        case 45: *_b = isWindow(); break;
        case 55: *_b = isWindow(); break;
        }
        _id -= 57;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 57;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 57;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 57;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 57;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Exemple #26
0
ToolbarEditDialog::ToolbarEditDialog( QWidget *_w, intf_thread_t *_p_intf)
                  : QVLCDialog( _w,  _p_intf )
{
    setWindowTitle( qtr( "Toolbars Editor" ) );
    setWindowRole( "vlc-toolbars-editor" );
    QGridLayout *mainLayout = new QGridLayout( this );
    setMinimumWidth( 600 );
    setAttribute( Qt::WA_DeleteOnClose );

    /* main GroupBox */
    QGroupBox *widgetBox = new QGroupBox( qtr( "Toolbar Elements") , this );
    widgetBox->setSizePolicy( QSizePolicy::Preferred,
                              QSizePolicy::MinimumExpanding );
    QGridLayout *boxLayout = new QGridLayout( widgetBox );

    flatBox = new QCheckBox( qtr( "Flat Button" ) );
    flatBox->setToolTip( qtr( "Next widget style" ) );
    bigBox = new QCheckBox( qtr( "Big Button" ) );
    bigBox->setToolTip( flatBox->toolTip() );
    shinyBox = new QCheckBox( qtr( "Native Slider" ) );
    shinyBox->setToolTip( flatBox->toolTip() );

    boxLayout->addWidget( new WidgetListing( p_intf, this ), 1, 0, 1, -1 );
    boxLayout->addWidget( flatBox, 0, 0 );
    boxLayout->addWidget( bigBox, 0, 1 );
    boxLayout->addWidget( shinyBox, 0, 2 );
    mainLayout->addWidget( widgetBox, 5, 0, 3, 6 );

    QTabWidget *tabWidget = new QTabWidget();
    mainLayout->addWidget( tabWidget, 1, 0, 4, 9 );

    /* Main ToolBar */
    QWidget *mainToolbarBox = new QWidget();
    tabWidget->addTab( mainToolbarBox, qtr( "Main Toolbar" ) );
    QFormLayout *mainTboxLayout = new QFormLayout( mainToolbarBox );

    positionCheckbox = new QCheckBox( qtr( "Above the Video" ) );
    positionCheckbox->setChecked(
                getSettings()->value( "MainWindow/ToolbarPos", 0 ).toInt() );
    mainTboxLayout->addRow( new QLabel( qtr( "Toolbar position:" ) ),
                            positionCheckbox );

    QString line1 = getSettings()->value( "MainWindow/MainToolbar1",
                                          MAIN_TB1_DEFAULT ).toString();
    controller1 = new DroppingController( p_intf, line1, this );
    mainTboxLayout->addRow( new QLabel( qtr("Line 1:") ), controller1 );

    QString line2 = getSettings()->value( "MainWindow/MainToolbar2",
                                          MAIN_TB2_DEFAULT ).toString();
    controller2 = new DroppingController( p_intf, line2, this );
    mainTboxLayout->addRow( new QLabel( qtr("Line 2:") ), controller2 );

    /* TimeToolBar */
    QString line = getSettings()->value( "MainWindow/InputToolbar",
                                         INPT_TB_DEFAULT ).toString();
    controller = new DroppingController( p_intf, line, this );
    QWidget *timeToolbarBox = new QWidget();
    timeToolbarBox->setLayout( new QVBoxLayout() );
    timeToolbarBox->layout()->addWidget( controller );
    tabWidget->addTab( timeToolbarBox, qtr( "Time Toolbar" ) );

    /* Advanced ToolBar */
    QString lineA = getSettings()->value( "MainWindow/AdvToolbar",
                                          ADV_TB_DEFAULT ).toString();
    controllerA = new DroppingController( p_intf, lineA, this );
    QWidget *advToolbarBox = new QWidget();
    advToolbarBox->setLayout( new QVBoxLayout() );
    advToolbarBox->layout()->addWidget( controllerA );
    tabWidget->addTab( advToolbarBox, qtr( "Advanced Widget" ) );

    /* FSCToolBar */
    QString lineFSC = getSettings()->value( "MainWindow/FSCtoolbar",
                                            FSC_TB_DEFAULT ).toString();
    controllerFSC = new DroppingController( p_intf, lineFSC, this );
    QWidget *FSCToolbarBox = new QWidget();
    FSCToolbarBox->setLayout( new QVBoxLayout() );
    FSCToolbarBox->layout()->addWidget( controllerFSC );
    tabWidget->addTab( FSCToolbarBox, qtr( "Fullscreen Controller" ) );

    /* Profile */
    QGridLayout *profileBoxLayout = new QGridLayout();

    profileCombo = new QComboBox;

    QToolButton *newButton = new QToolButton;
    newButton->setIcon( QIcon( ":/new" ) );
    newButton->setToolTip( qtr("New profile") );
    QToolButton *deleteButton = new QToolButton;
    deleteButton->setIcon( QIcon( ":/toolbar/clear" ) );
    deleteButton->setToolTip( qtr( "Delete the current profile" ) );

    profileBoxLayout->addWidget( new QLabel( qtr( "Select profile:" ) ), 0, 0 );
    profileBoxLayout->addWidget( profileCombo, 0, 1 );
    profileBoxLayout->addWidget( newButton, 0, 2 );
    profileBoxLayout->addWidget( deleteButton, 0, 3 );

    mainLayout->addLayout( profileBoxLayout, 0, 0, 1, 9 );

    /* Fill combos */
    int i_size = getSettings()->beginReadArray( "ToolbarProfiles" );
    for( int i = 0; i < i_size; i++ )
    {
        getSettings()->setArrayIndex(i);
        profileCombo->addItem( getSettings()->value( "ProfileName" ).toString(),
                               getSettings()->value( "Value" ).toString() );
    }
    getSettings()->endArray();

    /* Load defaults ones if we have no combos */
    /* We could decide that we load defaults on first launch of the dialog
       or when the combo is back to 0. I choose the second solution, because some clueless
       user might hit on delete a bit too much, but discussion is opened. -- jb */
    if( i_size == 0 )
    {
        profileCombo->addItem( PROFILE_NAME_6, QString( VALUE_6 ) );
        profileCombo->addItem( PROFILE_NAME_1, QString( VALUE_1 ) );
        profileCombo->addItem( PROFILE_NAME_2, QString( VALUE_2 ) );
        profileCombo->addItem( PROFILE_NAME_3, QString( VALUE_3 ) );
        profileCombo->addItem( PROFILE_NAME_4, QString( VALUE_4 ) );
        profileCombo->addItem( PROFILE_NAME_5, QString( VALUE_5 ) );
    }
    profileCombo->setCurrentIndex( -1 );

    /* Build and prepare our preview */
    PreviewWidget *previewWidget = new PreviewWidget( controller, controller1, controller2 );
    QGroupBox *previewBox = new QGroupBox( qtr("Preview"), this );
    previewBox->setLayout( new QVBoxLayout() );
    previewBox->layout()->addWidget( previewWidget );
    mainLayout->addWidget( previewBox, 5, 6, 3, 3 );
    CONNECT( positionCheckbox, stateChanged(int),
             previewWidget, setBarsTopPosition(int) );

    /* Buttons */
    QDialogButtonBox *okCancel = new QDialogButtonBox;
    QPushButton *okButton = new QPushButton( qtr( "Cl&ose" ), this );
    okButton->setDefault( true );
    QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ), this );
    okCancel->addButton( okButton, QDialogButtonBox::AcceptRole );
    okCancel->addButton( cancelButton, QDialogButtonBox::RejectRole );

    BUTTONACT( deleteButton, deleteProfile() );
    BUTTONACT( newButton, newProfile() );
    CONNECT( profileCombo, currentIndexChanged( int ), this, changeProfile( int ) );
    BUTTONACT( okButton, close() );
    BUTTONACT( cancelButton, cancel() );
    mainLayout->addWidget( okCancel, 8, 0, 1, 9 );
}
EditDropbox::EditDropbox(int id,bool duplicate,QWidget *parent)
  : QDialog(parent)
{
  setModal(true);

  QString sql;
  RDSqlQuery *q;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  box_dropbox=new RDDropbox(id);

  setWindowTitle("RDAdmin - "+tr("Dropbox Configuration")+" ["+
		 tr("ID")+QString().sprintf(": %d]",id));

  //
  // Create Fonts
  //
  QFont normal_font=QFont("Helvetica",12,QFont::Normal);
  normal_font.setPixelSize(12);
  QFont font=QFont("Helvetica",12,QFont::Bold);
  font.setPixelSize(12);

  //
  // Dialogs
  //
  box_schedcodes_dialog=new RDSchedCodesDialog(this);

  //
  // Group Name
  //
  box_group_name_box=new QComboBox(this);
  box_group_name_box->setGeometry(120,10,100,20);
  QLabel *label=new QLabel(box_group_name_box,tr("Default Group:"),this);
  label->setGeometry(10,10,105,20);
  label->setFont(font);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);

  //
  // Path
  //
  box_path_edit=new QLineEdit(this);
  box_path_edit->setGeometry(120,32,sizeHint().width()-190,19);
  box_path_edit->setMaxLength(255);
  label=new QLabel(box_path_edit,tr("&Path Spec:"),this);
  label->setGeometry(10,32,105,19);
  label->setFont(font);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  QPushButton *button=
    new QPushButton(tr("Select"),this);
  button->setGeometry(sizeHint().width()-60,30,50,23);
  button->setFont(normal_font);
  connect(button,SIGNAL(clicked()),this,SLOT(selectPathData()));

  //
  // To Cart
  //
  box_to_cart_edit=new QLineEdit(this);
  box_to_cart_edit->setGeometry(120,54,60,19);
  box_to_cart_edit->setValidator(new QIntValidator(1,999999,this));
  box_to_cart_edit->setMaxLength(6);
  label=new QLabel(box_to_cart_edit,tr("To &Cart:"),this);
  label->setGeometry(10,54,105,19);
  label->setFont(font);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  box_select_cart_button=
    new QPushButton(tr("Select"),this);
  box_select_cart_button->setGeometry(190,52,50,23);
  box_select_cart_button->setFont(normal_font);
  connect(box_select_cart_button,SIGNAL(clicked()),
	  this,SLOT(selectCartData()));

  //
  // Delete Cuts
  //
  box_delete_cuts_box=new QCheckBox(this);
  box_delete_cuts_box->setGeometry(260,56,15,15);
  box_delete_cuts_label=
    new QLabel(box_delete_cuts_box,tr("Delete cuts before importing"),this);
  box_delete_cuts_label->setGeometry(280,54,sizeHint().width()-150,20);
  box_delete_cuts_label->setFont(font);
  box_delete_cuts_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);

  //
  // Metadata Format
  //
  box_metadata_pattern_edit=new QLineEdit(this);
  box_metadata_pattern_edit->setGeometry(120,76,sizeHint().width()-170,19);
  box_metadata_pattern_edit->setMaxLength(64);
  label=new QLabel(box_metadata_pattern_edit,tr("&Metadata Pattern:"),this);
  label->setGeometry(10,76,105,19);
  label->setFont(font);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);

  //
  // User Defined Field
  //
  box_user_defined_edit=new QLineEdit(this);
  box_user_defined_edit->setGeometry(120,98,sizeHint().width()-170,19);
  box_user_defined_edit->setMaxLength(255);
  label=new QLabel(box_user_defined_edit,tr("&User Defined:"),this);
  label->setGeometry(10,98,105,19);
  label->setFont(font);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);

  //
  // Log Path
  //
  box_log_path_edit=new QLineEdit(this);
  box_log_path_edit->setGeometry(120,120,sizeHint().width()-190,19);
  box_log_path_edit->setMaxLength(255);
  label=
    new QLabel(box_log_path_edit,tr("&Log File:"),this);
  label->setGeometry(10,120,105,19);
  label->setFont(font);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
  button=new QPushButton(tr("Select"),this);
  button->setGeometry(sizeHint().width()-60,118,50,23);
  button->setFont(normal_font);
  connect(button,SIGNAL(clicked()),this,SLOT(selectLogPathData()));

  //
  // Scheduler Codes
  //
  box_schedcodes_button=new QPushButton(tr("Scheduler Codes"),this);
  box_schedcodes_button->setGeometry(110,145,200,25);
  box_schedcodes_button->setFont(font);
  connect(box_schedcodes_button,SIGNAL(clicked()),this,SLOT(schedcodesData()));

  //
  // Delete Source
  //
  box_delete_source_box=new QCheckBox(this);
  box_delete_source_box->setGeometry(90,177,15,15);
  label=new QLabel(box_delete_source_box,tr("Delete source files after import"),
		   this);
  label->setGeometry(110,175,sizeHint().width()-120,20);
  label->setFont(font);
  label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);

  //
  // Force To Mono
  //
  box_force_to_mono_box=new QCheckBox(this);
  box_force_to_mono_box->setGeometry(90,199,15,15);
  label=new QLabel(box_force_to_mono_box,tr("Force to Monaural"),this);
  label->setGeometry(110,197,sizeHint().width()-120,20);
  label->setFont(font);
  label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);

  //
  // Normalization
  //
  box_normalization_box=new QCheckBox(this);
  box_normalization_box->setGeometry(90,221,15,15);
  label=new QLabel(box_normalization_box,tr("Normalize Levels"),this);
  label->setGeometry(110,219,100,20);
  label->setFont(font);
  label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
  box_normalization_level_spin=new QSpinBox(this);
  box_normalization_level_spin->setGeometry(275,219,50,20);
  box_normalization_level_spin->setRange(-100,-1);
  box_normalization_level_label=new QLabel(tr("Level:"),this);
  box_normalization_level_label->setGeometry(210,219,60,20);
  box_normalization_level_label->setFont(font);
  box_normalization_level_label->setAlignment(Qt::AlignVCenter|Qt::AlignRight);
  box_normalization_level_unit=new QLabel(tr("dBFS"),this);
  box_normalization_level_unit->setGeometry(330,219,60,20);
  box_normalization_level_unit->setAlignment(Qt::AlignVCenter|Qt::AlignLeft);
  connect(box_normalization_box,SIGNAL(toggled(bool)),
	  this,SLOT(normalizationToggledData(bool)));

  //
  // Autotrim
  //
  box_autotrim_box=new QCheckBox(this);
  box_autotrim_box->setGeometry(90,245,15,15);
  label=new QLabel(box_autotrim_box,tr("Autotrim Cuts"),this);
  label->setGeometry(110,243,100,20);
  label->setFont(font);
  label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
  box_autotrim_level_spin=new QSpinBox(this);
  box_autotrim_level_spin->setGeometry(275,243,50,20);
  box_autotrim_level_spin->setRange(-100,-1);
  box_autotrim_level_label=new QLabel(tr("Level:"),this);
  box_autotrim_level_label->setGeometry(210,243,60,20);
  box_autotrim_level_label->setFont(font);
  box_autotrim_level_label->setAlignment(Qt::AlignVCenter|Qt::AlignRight);
  box_autotrim_level_unit=new QLabel(tr("dBFS"),this);
  box_autotrim_level_unit->setGeometry(330,243,60,20);
  box_autotrim_level_unit->setAlignment(Qt::AlignVCenter|Qt::AlignLeft);
  connect(box_autotrim_box,SIGNAL(toggled(bool)),
	  this,SLOT(autotrimToggledData(bool)));

  //
  // Segue
  //
  box_segue_box=new QCheckBox(this);
  box_segue_box->setGeometry(90,271,15,15);
  label=new QLabel(box_segue_box,tr("Insert Segue Markers"),
     this);
  label->setGeometry(110,269,sizeHint().width()-40,20);
  label->setFont(font);
  label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
  box_segue_level_spin=
    new QSpinBox(this);
  box_segue_level_spin->setGeometry(300,295,50,20);
  box_segue_level_spin->setRange(-100,0);
  box_segue_level_label=
    new QLabel(box_segue_level_spin,tr("Segue Level:"),
        this);
  box_segue_level_label->setGeometry(120,295,160,20);
  box_segue_level_label->setFont(font);
  box_segue_level_label->setAlignment(Qt::AlignVCenter|Qt::AlignRight);
  box_segue_level_unit=
    new QLabel(box_segue_level_spin,("dBFS"),this);
  box_segue_level_unit->setGeometry(360,296,60,20);
  box_segue_level_unit->setAlignment(Qt::AlignVCenter|Qt::AlignLeft);

  box_segue_length_spin=new QSpinBox(this);
  box_segue_length_spin->setGeometry(300,320,70,20);
  box_segue_length_spin->setRange(0,180000);
  box_segue_length_label=
     new QLabel(box_segue_length_spin,tr("Segue Length:"),
      this);
  box_segue_length_label->setGeometry(120,320,160,20);
  box_segue_length_label->setFont(font);
  box_segue_length_label->setAlignment(Qt::AlignVCenter|Qt::AlignRight);
  box_segue_length_unit=
    new QLabel(box_segue_length_spin,("msec"),this);
  box_segue_length_unit->setGeometry(375,321,60,20);
  box_segue_length_unit->setAlignment(Qt::AlignVCenter|Qt::AlignLeft);
  connect(box_segue_box,SIGNAL(toggled(bool)),
          this,SLOT(segueToggledData(bool)));

  //
  // Use CartChunk ID
  //
  box_use_cartchunk_id_box=new QCheckBox(this);
  box_use_cartchunk_id_box->setGeometry(90,350,15,15);
  label=new QLabel(box_use_cartchunk_id_box,
		   tr("Get cart number from CartChunk CutID"),this);
  label->setGeometry(110,348,sizeHint().width()-40,20);
  label->setFont(font);
  label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);

  //
  // Title from CartChunk ID
  //
  box_title_from_cartchunk_id_box=new QCheckBox(this);
  box_title_from_cartchunk_id_box->setGeometry(90,374,15,15);
  label=new QLabel(box_title_from_cartchunk_id_box,
		   tr("Get cart title from CartChunk CutID"),this);
  label->setGeometry(110,372,sizeHint().width()-40,20);
  label->setFont(font);
  label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);

  //
  // Fix Broken Formats
  //
  box_fix_broken_formats_box=new QCheckBox(this);
  box_fix_broken_formats_box->setGeometry(90,398,15,15);
  label=new QLabel(box_fix_broken_formats_box,
		   tr("Attempt to work around malformatted input files"),this);
  label->setGeometry(110,396,sizeHint().width()-40,20);
  label->setFont(font);
  label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);

  //
  // Start Date Offset
  //
  box_startoffset_spin=
    new QSpinBox(this);
  box_startoffset_spin->setGeometry(215,422,50,20);
  box_startoffset_spin->setRange(-7,7);
  label=new QLabel(box_startoffset_spin,tr("Offset start date by"),this);
  label->setGeometry(90,422,120,20);
  label->setFont(font);
  label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
  label=new QLabel(box_startoffset_spin,tr("days"),this);
  label->setGeometry(275,424,100,20);
  label->setFont(font);
  label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);

  //
  // End Date Offset
  //
  box_endoffset_spin=
    new QSpinBox(this);
  box_endoffset_spin->setGeometry(215,446,50,20);
  box_endoffset_spin->setRange(-7,7);
  label=new QLabel(box_endoffset_spin,tr("Offset end date by"),this);
  label->setGeometry(90,446,120,20);
  label->setFont(font);
  label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
  label=new QLabel(box_endoffset_spin,tr("days"),this);
  label->setGeometry(275,446,100,20);
  label->setFont(font);
  label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);

  //
  // Create Dates
  //
  box_create_dates_box=new QCheckBox(this);
  box_create_dates_box->setGeometry(90,470,15,15);
  label=new QLabel(box_create_dates_box,tr("Create Dates when no Dates Exist"),
		   this);
  label->setGeometry(110,468,sizeHint().width()-40,20);
  label->setFont(font);
  label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
  box_create_startdate_offset_spin=
    new QSpinBox(this);
  box_create_startdate_offset_spin->setGeometry(300,494,50,20);
  box_create_startdate_offset_spin->setRange(-180,180);
  box_create_startdate_label= 
    new QLabel(box_create_startdate_offset_spin,tr("Create start date offset:"),
	       this);
  box_create_startdate_label->setGeometry(120,494,160,20);
  box_create_startdate_label->setFont(font);
  box_create_startdate_label->setAlignment(Qt::AlignVCenter|Qt::AlignRight);
  box_create_startdate_unit=
    new QLabel(box_create_startdate_offset_spin,("days"),this);
  box_create_startdate_unit->setGeometry(360,495,60,20);
  box_create_startdate_unit->setAlignment(Qt::AlignVCenter|Qt::AlignLeft);
  box_create_enddate_offset_spin=new QSpinBox(this);
  box_create_enddate_offset_spin->setGeometry(300,524,50,20);
  box_create_enddate_offset_spin->setRange(-180,180);
  box_create_enddate_label= 
     new QLabel(box_create_enddate_offset_spin,tr("Create end date offset:"),
		this);
  box_create_enddate_label->setGeometry(120,524,160,20);
  box_create_enddate_label->setFont(font);
  box_create_enddate_label->setAlignment(Qt::AlignVCenter|Qt::AlignRight);
  box_create_enddate_unit=
    new QLabel(box_create_enddate_offset_spin,("days"),this);
  box_create_enddate_unit->setGeometry(360,524,60,20);
  box_create_enddate_unit->setAlignment(Qt::AlignVCenter|Qt::AlignLeft);
  connect(box_create_dates_box,SIGNAL(toggled(bool)),
          this,SLOT(createDatesToggledData(bool)));


  //
  //  Reset Button
  //
  QPushButton *reset_button=new QPushButton(this);
  reset_button->
    setGeometry(10,sizeHint().height()-60,80,50);
  reset_button->setDefault(true);
  reset_button->setFont(font);
  reset_button->setText(tr("&Reset"));
  connect(reset_button,SIGNAL(clicked()),this,SLOT(resetData()));

  //
  //  Ok Button
  //
  ok_button=new QPushButton(this);
  ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  ok_button->setDefault(true);
  ok_button->setFont(font);
  ok_button->setText(tr("&OK"));
  connect(ok_button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  QPushButton *cancel_button=new QPushButton(this);
  cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			     80,50);
  cancel_button->setFont(font);
  cancel_button->setText(tr("&Cancel"));
  connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));

  //
  // Populate Fields
  //
  sql="select NAME from GROUPS order by NAME";
  q=new RDSqlQuery(sql);
  QString groupname=box_dropbox->groupName();
  while(q->next()) {
    box_group_name_box->insertItem(q->value(0).toString());
    if(q->value(0).toString()==groupname) {
      box_group_name_box->setCurrentItem(box_group_name_box->count()-1);
    }
  }
  delete q;
  box_path_edit->setText(box_dropbox->path());
  if(box_dropbox->toCart()>0) {
    box_to_cart_edit->setText(QString().sprintf("%06u",box_dropbox->toCart()));
  }
  box_delete_cuts_box->setChecked(box_dropbox->deleteCuts());
  box_metadata_pattern_edit->setText(box_dropbox->metadataPattern());
  box_user_defined_edit->setText(box_dropbox->userDefined());
  box_delete_source_box->setChecked(box_dropbox->deleteSource());
  box_force_to_mono_box->setChecked(box_dropbox->forceToMono());
  box_normalization_box->setChecked(box_dropbox->normalizationLevel()<0);
  box_normalization_level_spin->
    setValue(box_dropbox->normalizationLevel()/100);
  box_autotrim_box->setChecked(box_dropbox->autotrimLevel()<0);
  box_autotrim_level_spin->setValue(box_dropbox->autotrimLevel()/100);
  box_use_cartchunk_id_box->setChecked(box_dropbox->useCartchunkId());
  box_title_from_cartchunk_id_box->setChecked(box_dropbox->titleFromCartchunkId());
  box_log_path_edit->setText(box_dropbox->logPath());
  box_fix_broken_formats_box->setChecked(box_dropbox->fixBrokenFormats());
  box_startoffset_spin->setValue(box_dropbox->startdateOffset());
  box_endoffset_spin->setValue(box_dropbox->enddateOffset());
  box_create_dates_box->setChecked(box_dropbox->createDates());
  box_create_startdate_offset_spin->setValue(box_dropbox->createStartdateOffset());
  box_create_enddate_offset_spin->setValue(box_dropbox->createEnddateOffset());
  normalizationToggledData(box_normalization_box->isChecked());
  autotrimToggledData(box_autotrim_box->isChecked());
  segueToggledData(box_segue_box->isChecked());
  createDatesToggledData(box_create_dates_box->isChecked());
  segueToggledData(box_segue_box->isChecked());
  box_segue_box->setChecked(box_dropbox->segueLevel()<1);
  box_segue_level_spin->setValue(box_dropbox->segueLevel()/100);
  box_segue_length_spin->setValue(box_dropbox->segueLength());

  sql=QString("select SCHED_CODE from DROPBOX_SCHED_CODES ")+
    QString().sprintf("where DROPBOX_ID=%d",box_dropbox->id());
  q=new RDSqlQuery(sql);
  while(q->next()) {
    box_schedcodes.push_back(q->value(0).toString());
  }
  delete q;

  if(duplicate) {
    box_path=box_dropbox->path();
    connect(box_path_edit,SIGNAL(textChanged(QString)),this,SLOT(pathChangedData(QString)));
    ok_button->setEnabled(false);
    box_path_edit->setFocus();
  }
}
Exemple #28
0
void Inspector::setElements(const QList<Element*>& l)
      {
      if (_inspectorEdit)     // if within an inspector-originated edit
            return;

      Element* e = l.isEmpty() ? 0 : l[0];
      if (e == 0 || _element == 0 || (_el != l)) {
            _el = l;
            if (ie)
                  ie->deleteLater();
            ie = 0;
            _element = e;

            if (_element == 0)
                  return;

            bool sameTypes = true;
            foreach(Element* ee, _el) {
                  if (_element->type() != ee->type())
                        sameTypes = false;
                  }
            if (!sameTypes)
                  ie = new InspectorGroupElement(this);
            else {
                  switch(_element->type()) {
                        case Element::FBOX:
                        case Element::TBOX:
                        case Element::VBOX:
                              ie = new InspectorVBox(this);
                              break;
                        case Element::HBOX:
                              ie = new InspectorHBox(this);
                              break;
                        case Element::ARTICULATION:
                              ie = new InspectorArticulation(this);
                              break;
                        case Element::SPACER:
                              ie = new InspectorSpacer(this);
                              break;
                        case Element::NOTE:
                              ie = new InspectorNote(this);
                              break;
                        case Element::ACCIDENTAL:
                              ie = new InspectorAccidental(this);
                              break;
                        case Element::REST:
                              ie = new InspectorRest(this);
                              break;
                        case Element::CLEF:
                              ie = new InspectorClef(this);
                              break;
                        case Element::TIMESIG:
                              ie = new InspectorTimeSig(this);
                              break;
                        case Element::KEYSIG:
                              ie = new InspectorKeySig(this);
                              break;
                        case Element::TUPLET:
                              ie = new InspectorTuplet(this);
                              break;
                        case Element::BEAM:
                              ie = new InspectorBeam(this);
                              break;
                        case Element::IMAGE:
                              ie = new InspectorImage(this);
                              break;
                        case Element::LASSO:
                              ie = new InspectorLasso(this);
                              break;
                        case Element::VOLTA_SEGMENT:
                              ie = new InspectorVolta(this);
                              break;
                        case Element::OTTAVA_SEGMENT:
                              ie = new InspectorOttava(this);
                              break;
                        case Element::TRILL_SEGMENT:
                              ie = new InspectorTrill(this);
                              break;
                        case Element::HAIRPIN_SEGMENT:
                              ie = new InspectorHairpin(this);
                              break;
                        case Element::TEXTLINE_SEGMENT:
                        case Element::PEDAL_SEGMENT:
                              ie = new InspectorTextLine(this);
                              break;
                        case Element::BAR_LINE:
                              ie = new InspectorBarLine(this);
                              break;
                        case Element::JUMP:
                              ie = new InspectorJump(this);
                              break;
                        case Element::MARKER:
                              ie = new InspectorMarker(this);
                              break;
                        case Element::GLISSANDO:
                              ie = new InspectorGlissando(this);
                              break;
                        case Element::TEMPO_TEXT:
                              ie = new InspectorTempoText(this);
                              break;
                        case Element::DYNAMIC:
                              ie = new InspectorDynamic(this);
                              break;
                        default:
                              ie = new InspectorElement(this);
                              break;
                        }
                  }
            sa->setWidget(ie);
            // setMinimumWidth(ie->width() + sa->frameWidth() * 2 + (width() - sa->width()) + 3);
            setMinimumWidth(ie->sizeHint().width() + sa->frameWidth() * 2 + (width() - sa->width()) + 3);
            }
ListEvents::ListEvents(QString *eventname,QWidget *parent)
  : QDialog(parent,"",true)
{
  QStringList services_list;
  QString str1=tr("Log Events - User: "******"%s%s",(const char *)str1,
			       (const char *)rda->ripc()->user()));
  edit_eventname=eventname;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());

  //
  // Create Fonts
  //
  QFont bold_font=QFont("Helvetica",12,QFont::Bold);
  bold_font.setPixelSize(12);
  QFont font=QFont("Helvetica",12,QFont::Normal);
  font.setPixelSize(12);

  //
  // Event Filter
  //
  edit_filter_box=new QComboBox(this);
  edit_filter_label=new QLabel(edit_filter_box,tr("Filter:"),this);
  edit_filter_label->setGeometry(10,10,50,20);
  edit_filter_label->setFont(bold_font);
  edit_filter_label->setAlignment(AlignRight|AlignVCenter);
  connect(edit_filter_box,SIGNAL(activated(int)),
	  this,SLOT(filterActivatedData(int)));

  //
  // Events List
  //
  edit_events_list=new QListView(this);
  edit_events_list->setAllColumnsShowFocus(true);
  edit_events_list->setItemMargin(5);
  edit_events_list->addColumn(tr("Name"));
  edit_events_list->addColumn(tr("Properties"));
  edit_events_list->addColumn(tr("Color"));
  edit_events_list->setColumnAlignment(2,AlignCenter);
  connect(edit_events_list,
	  SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),
	  this,SLOT(doubleClickedData(QListViewItem *,const QPoint &,int)));

  //
  //  Add Button
  //
  edit_add_button=new QPushButton(this);
  edit_add_button->setFont(bold_font);
  edit_add_button->setText(tr("&Add"));
  connect(edit_add_button,SIGNAL(clicked()),this,SLOT(addData()));
    
  //
  //  Edit Button
  //
  edit_edit_button=new QPushButton(this);
  edit_edit_button->setFont(bold_font);
  edit_edit_button->setText(tr("&Edit"));
  connect(edit_edit_button,SIGNAL(clicked()),this,SLOT(editData()));
    
  //
  //  Delete Button
  //
  edit_delete_button=new QPushButton(this);
  edit_delete_button->setFont(bold_font);
  edit_delete_button->setText(tr("&Delete"));
  connect(edit_delete_button,SIGNAL(clicked()),this,SLOT(deleteData()));
    
  //
  //  Rename Button
  //
  edit_rename_button=new QPushButton(this);
  edit_rename_button->setFont(bold_font);
  edit_rename_button->setText(tr("&Rename"));
  connect(edit_rename_button,SIGNAL(clicked()),this,SLOT(renameData()));
    
  //
  //  Close Button
  //
  edit_close_button=new QPushButton(this);
  edit_close_button->setFont(bold_font);
  edit_close_button->setText(tr("&OK"));
  connect(edit_close_button,SIGNAL(clicked()),this,SLOT(closeData()));

  //
  //  Ok Button
  //
  edit_ok_button=new QPushButton(this);
  edit_ok_button->setFont(bold_font);
  edit_ok_button->setText(tr("&Ok"));
  connect(edit_ok_button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  edit_cancel_button=new QPushButton(this);
  edit_cancel_button->setFont(bold_font);
  edit_cancel_button->setText(tr("&Cancel"));
  connect(edit_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));

  if(edit_eventname==NULL) {
    edit_close_button->setDefault(true);
    edit_ok_button->hide();
    edit_cancel_button->hide();
  }
  else {
    edit_ok_button->setDefault(true);
    edit_add_button->hide();
    edit_edit_button->hide();
    edit_delete_button->hide();
    edit_rename_button->hide();
    edit_close_button->hide();
  }

  //
  // Populate Data
  //
  edit_filter_box->insertItem(tr("ALL"));
  edit_filter_box->insertItem(tr("NONE"));

  QString sql="select NAME from SERVICES";
  RDSqlQuery *q=new RDSqlQuery(sql);
  while(q->next()) {
    services_list.append( q->value(0).toString() );
  }
  delete q;
  services_list.sort();
  for ( QStringList::Iterator it = services_list.begin(); 
        it != services_list.end();
        ++it ) {
    edit_filter_box->insertItem(*it);
    if(*event_filter==*it) {
      edit_filter_box->setCurrentItem(edit_filter_box->count()-1);
    }
  }

  RefreshList();
}
EditSvc::EditSvc(QString svc,QWidget *parent)
  : QDialog(parent,"",true)
{
  QString sql;
  RDSqlQuery *q;
  QString group;
  QString autospot;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  svc_svc=new RDSvc(svc);

  setCaption(tr("Edit Service"));

  //
  // Create Fonts
  //
  QFont font=QFont("Helvetica",12,QFont::Bold);
  font.setPixelSize(12);
  QFont section_font=QFont("Helvetica",14,QFont::Bold);
  section_font.setPixelSize(14);

  //
  // Text Validators
  //
  RDTextValidator *validator=new RDTextValidator(this);
  RDIdValidator *log_validator=new RDIdValidator(this);
  log_validator->addBannedChar(' ');

  //
  // General Section
  //
  QLabel *label=new QLabel("General",this);
  label->setGeometry(10,10,120,24);
  label->setFont(section_font);
  label->setAlignment(AlignLeft);

  //
  // Service Name
  //
  svc_name_edit=new QLineEdit(this);
  svc_name_edit->setGeometry(185,31,80,19);
  svc_name_edit->setMaxLength(10);
  svc_name_edit->setReadOnly(true);
  label=new QLabel(svc_name_edit,tr("&Service Name:"),this);
  label->setGeometry(10,33,170,19);
  label->setAlignment(AlignRight|ShowPrefix);

  //
  // Service Description
  //
  svc_description_edit=new QLineEdit(this);
  svc_description_edit->setGeometry(185,52,240,19);
  svc_description_edit->setMaxLength(255);
  svc_description_edit->setValidator(validator);
  label=new QLabel(svc_description_edit,tr("Service &Description:"),this);
  label->setGeometry(10,54,170,19);
  label->setAlignment(AlignRight|ShowPrefix);

  //
  // Service Program Code
  //
  svc_program_code_edit=new QLineEdit(this);
  svc_program_code_edit->setGeometry(185,73,240,19);
  svc_program_code_edit->setMaxLength(255);
  svc_program_code_edit->setValidator(validator);
  label=new QLabel(svc_program_code_edit,tr("&Program Code:"),this);
  label->setGeometry(10,73,170,19);
  label->setAlignment(AlignRight|ShowPrefix);

  //
  // Log Name Template
  //
  svc_name_template_edit=new QLineEdit(this);
  svc_name_template_edit->setGeometry(185,94,240,19);
  svc_name_template_edit->setMaxLength(255);
  svc_name_template_edit->setValidator(log_validator);
  label=new QLabel(svc_name_template_edit,tr("Log Name &Template:"),this);
  label->setGeometry(10,94,170,19);
  label->setAlignment(AlignRight|ShowPrefix);

  //
  // Log Description Template
  //
  svc_description_template_edit=new QLineEdit(this);
  svc_description_template_edit->setGeometry(185,115,240,19);
  svc_description_template_edit->setMaxLength(255);
  label=new QLabel(svc_description_template_edit,
		   tr("Log &Description Template:"),this);
  label->setGeometry(10,115,170,19);
  label->setAlignment(AlignRight|ShowPrefix);

  //
  // Voicetracking Group
  //
  svc_voice_group_box=new QComboBox(this);
  svc_voice_group_box->setGeometry(185,136,240,19);
  svc_voice_group_box->insertItem(tr("[none]"));
  label=new QLabel(svc_voice_group_box,tr("Voicetrack Group:"),this);
  label->setGeometry(10,136,170,19);
  label->setAlignment(AlignRight|ShowPrefix);

  //
  // Autospot Group
  //
  svc_autospot_group_box=new QComboBox(this);
  svc_autospot_group_box->setGeometry(185,157,240,19);
  svc_autospot_group_box->insertItem(tr("[none]"));
  label=new QLabel(svc_autospot_group_box,tr("AutoSpot Group:"),this);
  label->setGeometry(10,157,170,19);
  label->setAlignment(AlignRight|ShowPrefix);

  //
  // Chain Log
  //
  svc_chain_box=new QCheckBox(this);
  svc_chain_box->setGeometry(30,180,15,15);
  label=new QLabel(svc_chain_box,tr("Insert CHAIN TO at log end"),this);
  label->setGeometry(50,180,170,19);
  label->setAlignment(AlignLeft|ShowPrefix);

  //
  // Default Auto Refresh
  //
  svc_autorefresh_box=new QCheckBox(this);
  svc_autorefresh_box->setGeometry(230,180,15,15);
  label=
    new QLabel(svc_autorefresh_box,tr("Enable AutoRefresh By Default"),this);
  label->setGeometry(250,180,200,19);
  label->setAlignment(AlignLeft|ShowPrefix);

  //
  // Autofill Button
  //
  QPushButton *button=new QPushButton(this,"autofill_button");
  button->setGeometry(455,31,150,50);
  button->setFont(font);
  button->setText(tr("Configure \n&Autofill Carts"));
  connect(button,SIGNAL(clicked()),this,SLOT(autofillData()));

  //
  // Purge Expired Logs
  //
  svc_loglife_box=new QCheckBox(this,"svc_loglife_box");
  svc_loglife_box->setGeometry(460,95,15,15);
  label=new QLabel(svc_loglife_box,tr("Purge Logs after"),this);
  label->setGeometry(480,95,200,19);
  label->setAlignment(AlignLeft|ShowPrefix);
  svc_loglife_spin=new QSpinBox(this);
  svc_loglife_spin->setGeometry(585,93,50,19);
  svc_loglife_spin->setRange(0,365);
  connect(svc_loglife_box,SIGNAL(toggled(bool)),
	  svc_loglife_spin,SLOT(setEnabled(bool)));
  label=new QLabel(svc_loglife_box,tr("days"),this);
  label->setGeometry(645,95,40,19);
  label->setAlignment(AlignLeft|ShowPrefix);

  //
  // Purge Expired ELR Data
  //
  svc_shelflife_box=new QCheckBox(this);
  svc_shelflife_box->setGeometry(460,117,15,15);
  label=new QLabel(svc_shelflife_box,tr("Purge ELR Data after"),this);
  label->setGeometry(480,117,200,19);
  label->setAlignment(AlignLeft|ShowPrefix);
  svc_shelflife_spin=new QSpinBox(this);
  svc_shelflife_spin->setGeometry(610,115,50,19);
  svc_shelflife_spin->setRange(0,365);
  connect(svc_shelflife_box,SIGNAL(toggled(bool)),
	  svc_shelflife_spin,SLOT(setEnabled(bool)));
  label=new QLabel(svc_shelflife_box,tr("days"),this);
  label->setGeometry(670,117,40,19);
  label->setAlignment(AlignLeft|ShowPrefix);

  //
  // Enable Hosts Button
  //
  button=new QPushButton(this);
  button->setGeometry(625,31,150,50);
  button->setFont(font);
  button->setText(tr("Enable &Hosts"));
  connect(button,SIGNAL(clicked()),this,SLOT(enableHostsData()));



  //
  // Traffic Import Section
  //
  label=new QLabel(tr("Traffic Data Import"),this);
  label->setGeometry(10,213,160,24);
  label->setFont(section_font);
  label->setAlignment(AlignLeft);

  //
  // Linux Traffic Import Path
  //
  svc_tfc_path_edit=new QLineEdit(this);
  svc_tfc_path_edit->setGeometry(185,234,240,19);
  svc_tfc_path_edit->setMaxLength(255);
  svc_tfc_path_edit->setValidator(validator);
  label=new QLabel(svc_tfc_path_edit,tr("Linux Import Path:"),this);
  label->setGeometry(10,234,170,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_tfc_path_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(textChangedData(const QString &)));

  //
  // Linux Traffic Preimport Command
  //
  svc_tfc_preimport_cmd_edit=new QLineEdit(this);
  svc_tfc_preimport_cmd_edit->setGeometry(185,255,240,19);
  svc_tfc_preimport_cmd_edit->setValidator(validator);
  label=
    new QLabel(svc_tfc_preimport_cmd_edit,tr("Linux Preimport Command:"),this);
  label->setGeometry(10,255,170,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_tfc_preimport_cmd_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(textChangedData(const QString &)));

  //
  // Windows Traffic Import Path
  //
  svc_tfc_win_path_edit=new QLineEdit(this);
  svc_tfc_win_path_edit->setGeometry(185,276,240,19);
  svc_tfc_win_path_edit->setMaxLength(255);
  label=new QLabel(svc_tfc_win_path_edit,tr("Windows Import Path:"),this);
  label->setGeometry(10,276,170,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_tfc_win_path_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(textChangedData(const QString &)));

  //
  // Linux Traffic Preimport Command
  //
  svc_tfc_win_preimport_cmd_edit=new QLineEdit(this);
  svc_tfc_win_preimport_cmd_edit->setGeometry(185,297,240,19);
  label=new QLabel(svc_tfc_win_preimport_cmd_edit,
		   tr("Windows Preimport Command:"),this);
  label->setGeometry(10,297,170,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_tfc_win_preimport_cmd_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(textChangedData(const QString &)));

  //
  // Note Cart
  //
  svc_tfc_label_cart_edit=new QLineEdit(this);
  svc_tfc_label_cart_edit->setGeometry(185,318,240,19);
  svc_tfc_label_cart_edit->setMaxLength(32);
  label=new QLabel(svc_tfc_label_cart_edit,tr("Note Cart String:"),this);
  label->setGeometry(10,318,170,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_tfc_label_cart_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(textChangedData(const QString &)));

  //
  // Track String
  //
  svc_tfc_track_edit=new QLineEdit(this);
  svc_tfc_track_edit->setGeometry(185,339,240,19);
  svc_tfc_track_edit->setMaxLength(32);
  label=new QLabel(svc_tfc_track_edit,tr("Insert Voice Track String:"),this);
  label->setGeometry(10,339,170,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_tfc_track_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(textChangedData(const QString &)));

  //
  // Traffic Import Template
  //
  svc_tfc_import_template_box=new QComboBox(this);
  svc_tfc_import_template_box->setGeometry(185,360,240,19);
  label=new QLabel(svc_tfc_import_template_box,tr("Import Template:"),this);
  label->setGeometry(10,360,170,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_tfc_import_template_box,SIGNAL(activated(int)),
	  this,SLOT(tfcTemplateActivatedData(int)));

  //
  // Traffic Parser Settings
  //
  svc_tfc_fields=new ImportFields(this);
  svc_tfc_fields->setGeometry(10,381,svc_tfc_fields->sizeHint().width(),
			      svc_tfc_fields->sizeHint().height());

  //
  //  Traffic Test Button
  //
  button=new QPushButton(this);
  button->setGeometry(360,381,60,40);
  button->setFont(font);
  button->setText(tr("Test \n&Traffic"));
  connect(button,SIGNAL(clicked()),this,SLOT(trafficData()));

  //
  // Music Import Section
  //
  label=new QLabel(tr("Music Data Import"),this);
  label->setGeometry(445,213,160,24);
  label->setFont(section_font);
  label->setAlignment(AlignLeft);

  //
  // Linux Music Import Path
  //
  svc_mus_path_edit=new QLineEdit(this);
  svc_mus_path_edit->setGeometry(620,234,240,19);
  svc_mus_path_edit->setMaxLength(255);
  svc_mus_path_edit->setValidator(validator);
  label=new QLabel(svc_mus_path_edit,tr("Linux Import Path:"),this);
  label->setGeometry(450,234,165,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_mus_path_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(textChangedData(const QString &)));

  //
  // Linux Music Preimport Command
  //
  svc_mus_preimport_cmd_edit=new QLineEdit(this);
  svc_mus_preimport_cmd_edit->setGeometry(620,255,240,19);
  svc_mus_preimport_cmd_edit->setValidator(validator);
  label=
    new QLabel(svc_mus_preimport_cmd_edit,tr("Linux Preimport Command:"),this);
  label->setGeometry(450,255,170,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_mus_preimport_cmd_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(textChangedData(const QString &)));

  //
  // Windows Music Import Path
  //
  svc_mus_win_path_edit=new QLineEdit(this);
  svc_mus_win_path_edit->setGeometry(620,276,240,19);
  svc_mus_win_path_edit->setMaxLength(255);
  label=new QLabel(svc_mus_win_path_edit,tr("Windows Import Path:"),this);
  label->setGeometry(450,276,165,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_mus_win_path_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(textChangedData(const QString &)));

  //
  // Windows Music Preimport Command
  //
  svc_mus_win_preimport_cmd_edit=new QLineEdit(this);
  svc_mus_win_preimport_cmd_edit->setGeometry(620,297,240,19);
  label=new QLabel(svc_mus_win_preimport_cmd_edit,
		   tr("Windows Preimport Command:"),this);
  label->setGeometry(450,297,170,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_mus_win_preimport_cmd_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(textChangedData(const QString &)));

  //
  // Label Cart
  //
  svc_mus_label_cart_edit=new QLineEdit(this);
  svc_mus_label_cart_edit->setGeometry(620,318,240,19);
  svc_mus_label_cart_edit->setMaxLength(32);
  label=new QLabel(svc_mus_label_cart_edit,tr("Note Cart String:"),this);
  label->setGeometry(450,318,170,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_mus_label_cart_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(textChangedData(const QString &)));

  //
  // Insert Voice Track String
  //
  svc_mus_track_edit=new QLineEdit(this);
  svc_mus_track_edit->setGeometry(620,339,240,19);
  svc_mus_track_edit->setMaxLength(255);
  label=new QLabel(svc_mus_track_edit,tr("Insert Voice Track String:"),this);
  label->setGeometry(450,339,165,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_mus_track_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(textChangedData(const QString &)));

  //
  // Insert Spot Break String
  //
  svc_mus_break_edit=new QLineEdit(this);
  svc_mus_break_edit->setGeometry(620,360,240,19);
  svc_mus_break_edit->setMaxLength(255);
  label=new QLabel(svc_mus_break_edit,tr("Insert Traffic Break String:"),this);
  label->setGeometry(450,360,165,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_mus_break_edit,SIGNAL(textChanged(const QString &)),
	  this,SLOT(textChangedData(const QString &)));

  //
  // Music Import Template
  //
  svc_mus_import_template_box=new QComboBox(this);
  svc_mus_import_template_box->setGeometry(620,381,240,19);
  label=new QLabel(svc_mus_import_template_box,tr("Import Template:"),this);
  label->setGeometry(450,381,170,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(svc_mus_import_template_box,SIGNAL(activated(int)),
	  this,SLOT(musTemplateActivatedData(int)));

  //
  // Music Parser Settings
  //
  svc_mus_fields=new ImportFields(this);
  svc_mus_fields->setGeometry(445,402,svc_mus_fields->sizeHint().width(),
			      svc_mus_fields->sizeHint().height());

  //
  // Music Test Button
  //
  button=new QPushButton(this);
  button->setGeometry(795,402,60,40);
  button->setFont(font);
  button->setText(tr("Test \n&Music"));
  connect(button,SIGNAL(clicked()),this,SLOT(musicData()));

  //
  //  Ok Button
  //
  button=new QPushButton(this);
  button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  button->setDefault(true);
  button->setFont(font);
  button->setText(tr("&OK"));
  connect(button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  button=new QPushButton(this);
  button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			     80,50);
  button->setFont(font);
  button->setText(tr("&Cancel"));
  connect(button,SIGNAL(clicked()),this,SLOT(cancelData()));

  //
  // Load Group Lists
  //
  group=svc_svc->trackGroup();
  autospot=svc_svc->autospotGroup();
  sql="select NAME from GROUPS order by NAME";
  q=new RDSqlQuery(sql);
  while(q->next()) {
    svc_voice_group_box->insertItem(q->value(0).toString());
    if(q->value(0).toString()==group) {
      svc_voice_group_box->setCurrentItem(svc_voice_group_box->count()-1);
    }
    svc_autospot_group_box->insertItem(q->value(0).toString());
    if(q->value(0).toString()==autospot) {
      svc_autospot_group_box->setCurrentItem(svc_autospot_group_box->count()-1);
    }
  }
  delete q;

  //
  // Populate Fields
  //
  svc_name_edit->setText(svc_svc->name());
  svc_description_edit->setText(svc_svc->description());
  svc_program_code_edit->setText(svc_svc->programCode());
  svc_name_template_edit->setText(svc_svc->nameTemplate());
  svc_description_template_edit->setText(svc_svc->descriptionTemplate());
  svc_chain_box->setChecked(svc_svc->chainto());
  svc_autorefresh_box->setChecked(svc_svc->autoRefresh());
  if(svc_svc->defaultLogShelflife()>=0) {
    svc_loglife_box->setChecked(true);
    svc_loglife_spin->setValue(svc_svc->defaultLogShelflife());
  }
  else {
    svc_loglife_spin->setDisabled(true);
  }
  if(svc_svc->elrShelflife()>=0) {
    svc_shelflife_box->setChecked(true);
    svc_shelflife_spin->setValue(svc_svc->elrShelflife());
  }
  else {
    svc_shelflife_spin->setDisabled(true);
  }
  svc_tfc_path_edit->setText(svc_svc->importPath(RDSvc::Traffic,RDSvc::Linux));
  svc_tfc_preimport_cmd_edit->
    setText(svc_svc->preimportCommand(RDSvc::Traffic,RDSvc::Linux));
  svc_tfc_win_path_edit->
    setText(svc_svc->importPath(RDSvc::Traffic,RDSvc::Windows));  
  svc_tfc_win_preimport_cmd_edit->
    setText(svc_svc->preimportCommand(RDSvc::Traffic,RDSvc::Windows));  

  svc_tfc_import_template_box->insertItem(tr("[custom]"));
  svc_mus_import_template_box->insertItem(tr("[custom]"));
  sql="select NAME from IMPORT_TEMPLATES order by NAME";
  q=new RDSqlQuery(sql);
  while(q->next()) {
    svc_tfc_import_template_box->insertItem(q->value(0).toString());
    if(q->value(0).toString()==svc_svc->importTemplate(RDSvc::Traffic)) {
      svc_tfc_import_template_box->
	setCurrentItem(svc_tfc_import_template_box->count()-1);
    }
    svc_mus_import_template_box->insertItem(q->value(0).toString());
    if(q->value(0).toString()==svc_svc->importTemplate(RDSvc::Music)) {
      svc_mus_import_template_box->
	setCurrentItem(svc_mus_import_template_box->count()-1);
    }
  }
  delete q;
  svc_tfc_label_cart_edit->setText(svc_svc->labelCart(RDSvc::Traffic));
  svc_tfc_track_edit->setText(svc_svc->trackString(RDSvc::Traffic));
  svc_mus_path_edit->setText(svc_svc->importPath(RDSvc::Music,RDSvc::Linux));
  svc_mus_preimport_cmd_edit->
    setText(svc_svc->preimportCommand(RDSvc::Music,RDSvc::Linux));
  svc_mus_win_path_edit->
    setText(svc_svc->importPath(RDSvc::Music,RDSvc::Windows));  
  svc_mus_win_preimport_cmd_edit->
    setText(svc_svc->preimportCommand(RDSvc::Music,RDSvc::Windows));  
  svc_mus_label_cart_edit->setText(svc_svc->labelCart(RDSvc::Music));
  svc_mus_break_edit->
    setText(svc_svc->breakString());
  svc_mus_track_edit->
    setText(svc_svc->trackString(RDSvc::Music));
  svc_tfc_fields->setFields(svc_svc,RDSvc::Traffic);
  tfcTemplateActivatedData(svc_tfc_import_template_box->currentItem());
  musTemplateActivatedData(svc_mus_import_template_box->currentItem());
  svc_mus_fields->setFields(svc_svc,RDSvc::Music);
  import_changed=false;
}