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))); }
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; }