ListReports::ListReports(bool today_only,bool active_only,int dow, QWidget *parent) : QDialog(parent,"",true) { list_today_only=today_only; list_active_only=active_only; list_dow=dow; // // 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("Event Report")); list_reports_box->insertItem(tr("Upload/Download Report")); QLabel *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(Qt::AlignRight|Qt::AlignVCenter|Qt::TextShowMnemonic); // // 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())); }
ListGrids::ListGrids(QWidget *parent) : QDialog(parent,"",true) { setCaption(tr("Log Grids")); // // 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); // // Grids List // edit_grids_list=new QListView(this); edit_grids_list->setGeometry(10,10, sizeHint().width()-20,sizeHint().height()-80); edit_grids_list->setAllColumnsShowFocus(true); edit_grids_list->setItemMargin(5); edit_grids_list->addColumn(tr("Name")); edit_grids_list->addColumn(tr("Description")); connect(edit_grids_list, SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)), this,SLOT(doubleClickedData(QListViewItem *,const QPoint &,int))); // // Edit Button // QPushButton *button=new QPushButton(this); button->setGeometry(10,sizeHint().height()-60,80,50); button->setFont(bold_font); button->setText(tr("&Edit")); connect(button,SIGNAL(clicked()),this,SLOT(editData())); // // Close Button // button=new QPushButton(this); button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50); button->setDefault(true); button->setFont(bold_font); button->setText(tr("C&lose")); connect(button,SIGNAL(clicked()),this,SLOT(closeData())); RefreshList(); }
CodeViewer::CodeViewer(QWidget *parent) : QDialog(parent) { setWindowTitle("GlassGui - "+tr("View Code")); QFont button_font(font().family(),font().pointSize(),QFont::Bold); view_text=new QTextEdit(this); view_text->setReadOnly(true); view_close_button=new QPushButton(tr("Close"),this); view_close_button->setFont(button_font); connect(view_close_button,SIGNAL(clicked()),this,SLOT(closeData())); }
__declspec(dllexport) void ExtRelease(void *ctx, void* dummy){ ContextInfo *ci; ci = (ContextInfo *) ctx; FILE* log = ci->log; fputs("[framehook/close]closing...\n",log); if (ctx) { closeData(&ci->data); fputs("[framehook/close]closed.\n",log); fclose(log); //コンテキスト全体 free(ctx); } //ライブラリの終了 close(); }
void RecordCut::playStoppedData(int handle) { rda->cae()->unloadPlay(rec_play_handle); rec_timer->stop(); rec_play_button->off(); rec_stop_button->on(); rec_meter->resetClipLight(); is_playing=false; is_recording=false; rec_meter->setLeftSolidBar(-10000); rec_meter->setRightSolidBar(-10000); if(is_closing) { is_closing=false; closeData(); } }
// // Global Classes // SvcRecDialog::SvcRecDialog(const QString &svcname, QWidget *parent,const char *name) :QDialog(parent,name,true) { QFont font; font=QFont("Helvetica",12,QFont::Bold); font.setPixelSize(12); setCaption(QString().sprintf("%s %s",(const char *)svcname, (const char *)tr("Report Data"))); // // Datepicker // date_picker=new SvcRec(svcname,this,"date_picker"); date_picker->setGeometry(10,10, date_picker->sizeHint().width(), date_picker->sizeHint().height()); connect(date_picker,SIGNAL(dateSelected(const QDate &,bool)), this,SLOT(dateSelectedData(const QDate &,bool))); // // Delete Button // date_delete_button=new QPushButton(this,"date_delete_button"); date_delete_button-> setGeometry(10,sizeHint().height()-60,80,50); date_delete_button->setFont(font); date_delete_button->setText(tr("&Purge\nData")); connect(date_delete_button,SIGNAL(clicked()),this,SLOT(deleteData())); #ifndef WIN32 date_delete_button->setEnabled(rduser->deleteRec()&& date_picker->dayActive(date_picker->date().day())); #endif // WIN32 // // Close Button // QPushButton *button=new QPushButton(this,"close_button"); button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50); button->setFont(font);\ button->setText(tr("&Close")); button->setDefault(true); connect(button,SIGNAL(clicked()),this,SLOT(closeData())); }
RDExceptionDialog::RDExceptionDialog(QString report, QWidget *parent,const char *name) : QDialog(parent,name,true) { setCaption(tr("Rivendell Exception Report")); // // Generate Fonts // QFont button_font("helvetica",12,QFont::Bold); button_font.setPixelSize(12); // // Report Viewer // report_view=new QTextView(this,"report_view"); report_view->setGeometry(10,10,sizeHint().width()-20,sizeHint().height()-80); report_view->setText(report); // // Save Button // QPushButton *button=new QPushButton(this,"save_button"); button->setGeometry(10,sizeHint().height()-60,80,50); button->setDefault(true); button->setText(tr("&Save")); button->setFont(button_font); connect(button,SIGNAL(clicked()),this,SLOT(saveData())); // // Close Button // button=new QPushButton(this,"close_button"); button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50); button->setDefault(true); button->setText(tr("&Close")); button->setFont(button_font); connect(button,SIGNAL(clicked()),this,SLOT(closeData())); }
void RecordCut::recordUnloadedData(int card,int stream,unsigned len) { //printf("recordUnloadedData(%d,%d,%u)\n",card,stream,len); QString filename; rec_meter->setLeftSolidBar(-100000); rec_meter->setRightSolidBar(-100000); RDSettings *s=new RDSettings(); s->setSampleRate(rec_samprate); s->setBitRate(rec_bitrate); s->setChannels(rec_channels); s->setFormat((RDSettings::Format)rec_format); rec_cut->checkInRecording(rda->station()->name(),s,len); if(rec_trim_box->currentItem()==0) { rec_cut->autoTrim(RDCut::AudioBoth,rda->libraryConf()->trimThreshold()); } rec_length=rec_cut->length(); if(is_closing) { is_closing=false; closeData(); } }
ListReports::ListReports(QWidget *parent) : QDialog(parent,"",true) { // // Fix the Window Size // setMinimumWidth(sizeHint().width()); setMaximumWidth(sizeHint().width()); setMinimumHeight(sizeHint().height()); setMaximumHeight(sizeHint().height()); setCaption(tr("Rivendell Report List")); // // Create Fonts // QFont font=QFont("Helvetica",12,QFont::Bold); font.setPixelSize(12); QFont small_font=QFont("Helvetica",10,QFont::Normal); small_font.setPixelSize(10); // // Add Button // QPushButton *add_button=new QPushButton(this); add_button->setGeometry(410,30,80,50); add_button->setFont(font); add_button->setText(tr("&Add")); connect(add_button,SIGNAL(clicked()),this,SLOT(addData())); // // Edit Button // QPushButton *edit_button=new QPushButton(this); edit_button->setGeometry(410,90,80,50); edit_button->setFont(font); edit_button->setText(tr("&Edit")); connect(edit_button,SIGNAL(clicked()),this,SLOT(editData())); // // Delete Button // QPushButton *delete_button=new QPushButton(this); delete_button->setGeometry(410,150,80,50); delete_button->setFont(font); delete_button->setText(tr("&Delete")); connect(delete_button,SIGNAL(clicked()),this,SLOT(deleteData())); // // Close Button // QPushButton *close_button=new QPushButton(this); close_button->setGeometry(410,240,80,50); close_button->setDefault(true); close_button->setFont(font); close_button->setText(tr("&Close")); connect(close_button,SIGNAL(clicked()),this,SLOT(closeData())); // // Report List Box // list_box=new QListBox(this); list_box->setGeometry(10,30,390,260); QLabel *list_box_label=new QLabel(list_box,tr("R&eports:"),this); list_box_label->setFont(font); list_box_label->setGeometry(14,10,85,19); connect(list_box,SIGNAL(doubleClicked(QListBoxItem *)), this,SLOT(doubleClickedData(QListBoxItem *))); RefreshList(); }
/** Load a single bank into the workspace * * @param nexusfilename :: file to open * @param entry_name :: NXentry name * @param bankName :: NXdata bank name * @param WS :: workspace to modify * @param id_to_wi :: det ID to workspace index mapping */ void LoadTOFRawNexus::loadBank(const std::string &nexusfilename, const std::string &entry_name, const std::string &bankName, API::MatrixWorkspace_sptr WS, const detid2index_map &id_to_wi) { g_log.debug() << "Loading bank " << bankName << std::endl; // To avoid segfaults on RHEL5/6 and Fedora m_fileMutex.lock(); // Navigate to the point in the file auto file = new ::NeXus::File(nexusfilename); file->openGroup(entry_name, "NXentry"); file->openGroup("instrument", "NXinstrument"); file->openGroup(bankName, "NXdetector"); size_t m_numPixels = 0; std::vector<uint32_t> pixel_id; if (!m_assumeOldFile) { // Load the pixel IDs file->readData("pixel_id", pixel_id); m_numPixels = pixel_id.size(); if (m_numPixels == 0) { file->close(); m_fileMutex.unlock(); g_log.warning() << "Invalid pixel_id data in " << bankName << std::endl; return; } } else { // Load the x and y pixel offsets std::vector<float> xoffsets; std::vector<float> yoffsets; file->readData("x_pixel_offset", xoffsets); file->readData("y_pixel_offset", yoffsets); m_numPixels = xoffsets.size() * yoffsets.size(); if (0 == m_numPixels) { file->close(); m_fileMutex.unlock(); g_log.warning() << "Invalid (x,y) offsets in " << bankName << std::endl; return; } size_t bankNum = 0; if (bankName.size() > 4) { if (bankName.substr(0, 4) == "bank") { bankNum = boost::lexical_cast<size_t>(bankName.substr(4)); bankNum--; } else { file->close(); m_fileMutex.unlock(); g_log.warning() << "Invalid bank number for " << bankName << std::endl; return; } } // All good, so construct the pixel ID listing size_t numX = xoffsets.size(); size_t numY = yoffsets.size(); for (size_t i = 0; i < numX; i++) { for (size_t j = 0; j < numY; j++) { pixel_id.push_back( static_cast<uint32_t>(j + numY * (i + numX * bankNum))); } } } size_t iPart = 0; if (m_spec_max != Mantid::EMPTY_INT()) { uint32_t ifirst = pixel_id[0]; range_check out_range(m_spec_min, m_spec_max, id_to_wi); auto newEnd = std::remove_if(pixel_id.begin(), pixel_id.end(), out_range); pixel_id.erase(newEnd, pixel_id.end()); // check if beginning or end of array was erased if (ifirst != pixel_id[0]) iPart = m_numPixels - pixel_id.size(); m_numPixels = pixel_id.size(); if (m_numPixels == 0) { file->close(); m_fileMutex.unlock(); g_log.warning() << "No pixels from " << bankName << std::endl; return; }; } // Load the TOF vector std::vector<float> tof; file->readData(m_axisField, tof); size_t m_numBins = tof.size() - 1; if (tof.size() <= 1) { file->close(); m_fileMutex.unlock(); g_log.warning() << "Invalid " << m_axisField << " data in " << bankName << std::endl; return; } // Make a shared pointer MantidVecPtr Xptr; MantidVec &X = Xptr.access(); X.resize(tof.size(), 0); X.assign(tof.begin(), tof.end()); // Load the data. Coerce ints into double. std::string errorsField = ""; std::vector<double> data; file->openData(m_dataField); file->getDataCoerce(data); if (file->hasAttr("errors")) file->getAttr("errors", errorsField); file->closeData(); // Load the errors bool hasErrors = !errorsField.empty(); std::vector<double> errors; if (hasErrors) { try { file->openData(errorsField); file->getDataCoerce(errors); file->closeData(); } catch (...) { g_log.information() << "Error loading the errors field, '" << errorsField << "' for bank " << bankName << ". Will use sqrt(counts). " << std::endl; hasErrors = false; } } /*if (data.size() != m_numBins * m_numPixels) { file->close(); m_fileMutex.unlock(); g_log.warning() << "Invalid size of '" << m_dataField << "' data in " << bankName << std::endl; return; } if (hasErrors && (errors.size() != m_numBins * m_numPixels)) { file->close(); m_fileMutex.unlock(); g_log.warning() << "Invalid size of '" << errorsField << "' errors in " << bankName << std::endl; return; } */ // Have all the data I need m_fileMutex.unlock(); file->close(); for (size_t i = iPart; i < iPart + m_numPixels; i++) { // Find the workspace index for this detector detid_t pixelID = pixel_id[i - iPart]; size_t wi = id_to_wi.find(pixelID)->second; // Set the basic info of that spectrum ISpectrum *spec = WS->getSpectrum(wi); spec->setSpectrumNo(specid_t(wi + 1)); spec->setDetectorID(pixel_id[i - iPart]); // Set the shared X pointer spec->setX(X); // Extract the Y MantidVec &Y = spec->dataY(); Y.assign(data.begin() + i * m_numBins, data.begin() + (i + 1) * m_numBins); MantidVec &E = spec->dataE(); if (hasErrors) { // Copy the errors from the loaded document E.assign(errors.begin() + i * m_numBins, errors.begin() + (i + 1) * m_numBins); } else { // Now take the sqrt(Y) to give E E = Y; std::transform(E.begin(), E.end(), E.begin(), (double (*)(double))sqrt); } } // Done! }
/** Goes thoguh a histogram NXS file and counts the number of pixels. * It also determines the name of the data field and axis to load * * @param nexusfilename :: nxs file path * @param entry_name :: name of the entry * @param bankNames :: returns the list of bank names */ void LoadTOFRawNexus::countPixels(const std::string &nexusfilename, const std::string &entry_name, std::vector<std::string> &bankNames) { m_numPixels = 0; m_numBins = 0; m_dataField = ""; m_axisField = ""; bankNames.clear(); // Create the root Nexus class auto file = new ::NeXus::File(nexusfilename); // Open the default data group 'entry' file->openGroup(entry_name, "NXentry"); // Also pop into the instrument file->openGroup("instrument", "NXinstrument"); // Look for all the banks std::map<std::string, std::string> entries = file->getEntries(); std::map<std::string, std::string>::iterator it; for (it = entries.begin(); it != entries.end(); ++it) { std::string name = it->first; if (name.size() > 4) { if (name.substr(0, 4) == "bank") { // OK, this is some bank data file->openGroup(name, it->second); // -------------- Find the data field name ---------------------------- if (m_dataField.empty()) { std::map<std::string, std::string> entries = file->getEntries(); std::map<std::string, std::string>::iterator it; for (it = entries.begin(); it != entries.end(); ++it) { if (it->second == "SDS") { file->openData(it->first); if (file->hasAttr("signal")) { int signal = 0; file->getAttr("signal", signal); if (signal == m_signalNo) { // That's the right signal! m_dataField = it->first; // Find the corresponding X axis std::string axes; m_assumeOldFile = false; if (!file->hasAttr("axes")) { if (1 != m_signalNo) { throw std::runtime_error( "Your chosen signal number, " + Strings::toString(m_signalNo) + ", corresponds to the data field '" + m_dataField + "' has no 'axes' attribute specifying."); } else { m_assumeOldFile = true; axes = "x_pixel_offset,y_pixel_offset,time_of_flight"; } } if (!m_assumeOldFile) { file->getAttr("axes", axes); } std::vector<std::string> allAxes; boost::split(allAxes, axes, boost::algorithm::detail::is_any_ofF<char>(",")); if (allAxes.size() != 3) throw std::runtime_error( "Your chosen signal number, " + Strings::toString(m_signalNo) + ", corresponds to the data field '" + m_dataField + "' which has only " + Strings::toString(allAxes.size()) + " dimension. Expected 3 dimensions."); m_axisField = allAxes.back(); g_log.information() << "Loading signal " << m_signalNo << ", " << m_dataField << " with axis " << m_axisField << std::endl; file->closeData(); break; } // Data has a 'signal' attribute } // Yes, it is a data field file->closeData(); } // each entry in the group } } file->closeGroup(); } // bankX name } } // each entry if (m_dataField.empty()) throw std::runtime_error("Your chosen signal number, " + Strings::toString(m_signalNo) + ", was not found in any of the data fields of any " "'bankX' group. Cannot load file."); for (it = entries.begin(); it != entries.end(); ++it) { std::string name = it->first; if (name.size() > 4) { if (name.substr(0, 4) == "bank") { // OK, this is some bank data file->openGroup(name, it->second); std::map<std::string, std::string> entries = file->getEntries(); if (entries.find("pixel_id") != entries.end()) { bankNames.push_back(name); // Count how many pixels in the bank file->openData("pixel_id"); std::vector<int64_t> dims = file->getInfo().dims; file->closeData(); if (!dims.empty()) { size_t newPixels = 1; for (auto dim : dims) newPixels *= dim; m_numPixels += newPixels; } } else { bankNames.push_back(name); // Get the number of pixels from the offsets arrays file->openData("x_pixel_offset"); std::vector<int64_t> xdim = file->getInfo().dims; file->closeData(); file->openData("y_pixel_offset"); std::vector<int64_t> ydim = file->getInfo().dims; file->closeData(); if (!xdim.empty() && !ydim.empty()) { m_numPixels += (xdim[0] * ydim[0]); } } if (entries.find(m_axisField) != entries.end()) { // Get the size of the X vector file->openData(m_axisField); std::vector<int64_t> dims = file->getInfo().dims; // Find the units, if available if (file->hasAttr("units")) file->getAttr("units", m_xUnits); else m_xUnits = "microsecond"; // use default file->closeData(); if (!dims.empty()) m_numBins = dims[0] - 1; } file->closeGroup(); } // bankX name } } // each entry file->close(); delete file; }
ListEvents::ListEvents(QString *eventname,QWidget *parent,const char *name) : QDialog(parent,name,true) { QStringList services_list; QString str1=tr("Log Events - User: "******"%s%s",(const char *)str1, (const char *)rdripc->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"); 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")); if (rdstation_conf->broadcastSecurity() == RDStation::UserSec) { services_list = rduser->services(); } else { // RDStation::HostSec 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(); }
/*! Destructs the memory mapped file */ QMemoryFile::~QMemoryFile() { closeData(d); }
void CdRipper::closeEvent(QCloseEvent *e) { if(!ripper_running) { closeData(); } }
ListEncoders::ListEncoders(const QString &stationname,QWidget *parent) : QDialog(parent,"",true) { list_stationname=stationname; setCaption(tr("RDAdmin - List Encoders")); // // 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); // // Encoders List Box // list_list_view=new RDListView(this); list_list_label= new QLabel(list_list_view,tr("Encoders on")+" "+stationname,this); list_list_label->setFont(bold_font); list_list_view->setAllColumnsShowFocus(true); list_list_view->setItemMargin(5); list_list_view->addColumn(tr("Format Name")); list_list_view->setColumnAlignment(0,Qt::AlignHCenter); list_list_view->addColumn(tr("Extension")); list_list_view->setColumnAlignment(1,Qt::AlignHCenter); list_list_view->addColumn(tr("Valid Channels")); list_list_view->setColumnAlignment(2,Qt::AlignLeft); list_list_view->addColumn(tr("Valid Sample Rates")); list_list_view->setColumnAlignment(3,Qt::AlignLeft); list_list_view->addColumn(tr("Valid Bit Rates")); list_list_view->setColumnAlignment(4,Qt::AlignLeft); connect(list_list_view, SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)), this,SLOT(doubleClickedData(QListViewItem *,const QPoint &,int))); // // Add Button // list_add_button=new QPushButton(this); list_add_button->setFont(bold_font); list_add_button->setText(tr("&Add")); connect(list_add_button,SIGNAL(clicked()),this,SLOT(addData())); // // Edit Button // list_edit_button=new QPushButton(this); list_edit_button->setFont(bold_font); list_edit_button->setText(tr("&Edit")); connect(list_edit_button,SIGNAL(clicked()),this,SLOT(editData())); // // Delete Button // list_delete_button=new QPushButton(this); list_delete_button->setFont(bold_font); list_delete_button->setText(tr("&Delete")); connect(list_delete_button,SIGNAL(clicked()),this,SLOT(deleteData())); // // Close Button // list_close_button=new QPushButton(this); list_close_button->setDefault(true); list_close_button->setFont(bold_font); list_close_button->setText(tr("&Close")); connect(list_close_button,SIGNAL(clicked()),this,SLOT(closeData())); RefreshList(); }
bool ApplyLedgerChainWork::applyHistoryOfSingleLedger() { LedgerHeaderHistoryEntry hHeader; LedgerHeader& header = hHeader.header; if (!mHdrIn || !mHdrIn.readOne(hHeader)) { return false; } auto& lm = mApp.getLedgerManager(); auto const& lclHeader = lm.getLastClosedLedgerHeader(); // If we are >1 before LCL, skip if (header.ledgerSeq + 1 < lclHeader.header.ledgerSeq) { CLOG(DEBUG, "History") << "Catchup skipping old ledger " << header.ledgerSeq; return true; } // If we are one before LCL, check that we knit up with it if (header.ledgerSeq + 1 == lclHeader.header.ledgerSeq) { if (hHeader.hash != lclHeader.header.previousLedgerHash) { throw std::runtime_error( fmt::format("replay of {:s} failed to connect on hash of LCL " "predecessor {:s}", LedgerManager::ledgerAbbrev(hHeader), LedgerManager::ledgerAbbrev( lclHeader.header.ledgerSeq - 1, lclHeader.header.previousLedgerHash))); } CLOG(DEBUG, "History") << "Catchup at 1-before LCL (" << header.ledgerSeq << "), hash correct"; return true; } // If we are at LCL, check that we knit up with it if (header.ledgerSeq == lclHeader.header.ledgerSeq) { if (hHeader.hash != lm.getLastClosedLedgerHeader().hash) { mApplyLedgerFailure.Mark(); throw std::runtime_error( fmt::format("replay of {:s} at LCL {:s} disagreed on hash", LedgerManager::ledgerAbbrev(hHeader), LedgerManager::ledgerAbbrev(lclHeader))); } CLOG(DEBUG, "History") << "Catchup at LCL=" << header.ledgerSeq << ", hash correct"; return true; } // If we are past current, we can't catch up: fail. if (header.ledgerSeq != lclHeader.header.ledgerSeq + 1) { mApplyLedgerFailure.Mark(); throw std::runtime_error( fmt::format("replay overshot current ledger: {:d} > {:d}", header.ledgerSeq, lclHeader.header.ledgerSeq + 1)); } // If we do not agree about LCL hash, we can't catch up: fail. if (header.previousLedgerHash != lm.getLastClosedLedgerHeader().hash) { mApplyLedgerFailure.Mark(); throw std::runtime_error(fmt::format( "replay at current ledger {:s} disagreed on LCL hash {:s}", LedgerManager::ledgerAbbrev(header.ledgerSeq - 1, header.previousLedgerHash), LedgerManager::ledgerAbbrev(lclHeader))); } auto txset = getCurrentTxSet(); CLOG(DEBUG, "History") << "Ledger " << header.ledgerSeq << " has " << txset->size() << " transactions"; // We've verified the ledgerHeader (in the "trusted part of history" // sense) in CATCHUP_VERIFY phase; we now need to check that the // txhash we're about to apply is the one denoted by that ledger // header. if (header.scpValue.txSetHash != txset->getContentsHash()) { mApplyLedgerFailure.Mark(); throw std::runtime_error(fmt::format( "replay txset hash differs from txset hash in replay ledger: hash " "for txset for {:d} is {:s}, expected {:s}", header.ledgerSeq, hexAbbrev(txset->getContentsHash()), hexAbbrev(header.scpValue.txSetHash))); } LedgerCloseData closeData(header.ledgerSeq, txset, header.scpValue); lm.closeLedger(closeData); CLOG(DEBUG, "History") << "LedgerManager LCL:\n" << xdr::xdr_to_string( lm.getLastClosedLedgerHeader()); CLOG(DEBUG, "History") << "Replay header:\n" << xdr::xdr_to_string(hHeader); if (lm.getLastClosedLedgerHeader().hash != hHeader.hash) { mApplyLedgerFailure.Mark(); throw std::runtime_error(fmt::format( "replay of {:s} produced mismatched ledger hash {:s}", LedgerManager::ledgerAbbrev(hHeader), LedgerManager::ledgerAbbrev(lm.getLastClosedLedgerHeader()))); } mApplyLedgerSuccess.Mark(); mLastApplied = hHeader; return true; }
RecordCut::RecordCut(RDCart *cart,QString cut,bool use_weight, QWidget *parent) : QDialog(parent,"",true) { bool valid; bool is_track=cart->owner().isEmpty(); bool allow_modification=rda->user()->modifyCarts()&&is_track; bool allow_editing=rda->user()->editAudio()&&is_track; rec_use_weighting=use_weight; // // 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]=rda->libraryConf()->inputCard(); rec_port_no[0]=rda->libraryConf()->inputPort(); rec_card_no[1]=rda->libraryConf()->outputCard(); rec_port_no[1]=rda->libraryConf()->outputPort(); rec_play_handle=-1; // // CAE Connection // connect(rda->cae(),SIGNAL(isConnected(bool)),this,SLOT(initData(bool))); connect(rda->cae(),SIGNAL(playing(int)),this,SLOT(playedData(int))); connect(rda->cae(),SIGNAL(playStopped(int)),this,SLOT(playStoppedData(int))); connect(rda->cae(),SIGNAL(recordLoaded(int,int)), this,SLOT(recordLoadedData(int,int))); connect(rda->cae(),SIGNAL(recordUnloaded(int,int,unsigned)), this,SLOT(recordUnloadedData(int,int,unsigned))); connect(rda->cae(),SIGNAL(recording(int,int)),this,SLOT(recordedData(int,int))); connect(rda->cae(),SIGNAL(recordStopped(int,int)), this,SLOT(recordStoppedData(int,int))); connect(rda->cae(),SIGNAL(inputStatusChanged(int,int,bool)), this,SLOT(aesAlarmData(int,int,bool))); // // Audio Parameters // rec_card_no[0]=rda->libraryConf()->inputCard(); rec_card_no[1]=rda->libraryConf()->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->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->setGeometry(15,11,120,19); cut_description_label->setFont(font); cut_description_label->setAlignment(Qt::AlignLeft|Qt::TextShowMnemonic); // // Cut Outcue // cut_outcue_edit=new QLineEdit(this); 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->setGeometry(15,56,120,19); cut_outcue_label->setFont(font); cut_outcue_label->setAlignment(Qt::AlignLeft|Qt::TextShowMnemonic); // // Cut ISCI Code // cut_isci_edit=new QLineEdit(this); 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->setGeometry(15,101,120,19); cut_isci_label->setFont(font); cut_isci_label->setAlignment(Qt::AlignLeft|Qt::TextShowMnemonic); // // Cut Origin // cut_origin_edit=new QLineEdit(this); 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->setGeometry(15,146,120,19); cut_origin_label->setFont(font); cut_origin_label->setAlignment(Qt::AlignLeft|Qt::TextShowMnemonic); // // Cut ISRC // cut_isrc_edit=new QLineEdit(this); 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->setGeometry(225,146,120,19); cut_isrc_label->setFont(font); cut_isrc_label->setAlignment(Qt::AlignLeft|Qt::TextShowMnemonic); // // Cut Weight // cut_weight_box=new QSpinBox(this); 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->setGeometry(10,191,61,19); cut_weight_label->setFont(font); cut_weight_label->setAlignment(Qt::AlignHCenter|Qt::TextShowMnemonic); // // Cut Play Date Time // cut_playdate_edit=new QLineEdit(this); 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->setGeometry(105,191,120,19); cut_playdate_label->setFont(font); cut_playdate_label->setAlignment(Qt::AlignLeft|Qt::TextShowMnemonic); // // Cut Play Counter // cut_playcounter_edit=new QLineEdit(this); cut_playcounter_edit->setGeometry(285,210,80,19); cut_playcounter_edit->setAlignment(Qt::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->setGeometry(290,191,120,19); cut_playcounter_label->setFont(font); cut_playcounter_label->setAlignment(Qt::AlignLeft|Qt::TextShowMnemonic); // // Evergreen Checkbox // rec_evergreen_box=new QCheckBox(this); rec_evergreen_box->setGeometry(10,245,15,15); rec_evergreen_label=new QLabel(rec_evergreen_box,tr("Cut is EVERGREEN"),this); rec_evergreen_label->setGeometry(30,245,sizeHint().width()-40,15); rec_evergreen_label->setFont(font); rec_evergreen_label->setAlignment(Qt::AlignVCenter|Qt::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->setGeometry(50,268,100,19); cut_killdatetime_label->setAlignment(Qt::AlignHCenter); cut_killdatetime_label->setFont(font); Q3ButtonGroup *button_group=new Q3ButtonGroup(this); 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); cut_startdatetime_disable_button->setGeometry(40,310,100,20); button_group->insert(cut_startdatetime_disable_button,false); cut_startdatetime_edit=new Q3DateTimeEdit(this); cut_startdatetime_edit->setGeometry(165,289,170,19); cut_startdatetime_label=new QLabel(cut_startdatetime_edit,tr("&Start"),this); cut_startdatetime_label->setGeometry(120,293,40,12); cut_startdatetime_label->setFont(small_font); cut_startdatetime_label->setAlignment(Qt::AlignRight|Qt::TextShowMnemonic); cut_enddatetime_edit=new Q3DateTimeEdit(this); cut_enddatetime_edit->setGeometry(165,309,170,19); cut_enddatetime_label=new QLabel(cut_enddatetime_edit,tr("End"),this); cut_enddatetime_label->setGeometry(120,313,40,12); cut_enddatetime_label->setFont(small_font); cut_enddatetime_label->setAlignment(Qt::AlignRight|Qt::TextShowMnemonic); // // 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 Q3ButtonGroup(this); button_group->hide(); connect(button_group,SIGNAL(clicked(int)),this,SLOT(daypartButtonData(int))); cut_starttime_enable_button=new QRadioButton(tr("Enabled"),this); 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); 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->setGeometry(222,369,90,19); cut_starttime_label=new QLabel(cut_starttime_edit,tr("&Start Time"),this); cut_starttime_label->setGeometry(137,373,80,12); cut_starttime_label->setFont(small_font); cut_starttime_label->setAlignment(Qt::AlignRight|Qt::TextShowMnemonic); cut_endtime_edit=new RDTimeEdit(this); cut_endtime_edit->setGeometry(222,389,90,19); cut_endtime_label=new QLabel(cut_endtime_edit,tr("End Time"),this); cut_endtime_label->setGeometry(137,393,80,12); cut_endtime_label->setFont(small_font); cut_endtime_label->setAlignment(Qt::AlignRight|Qt::TextShowMnemonic); // // 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); 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(Qt::AlignVCenter|Qt::AlignLeft); rec_weekpart_button[1]=new QCheckBox(this); 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[1]->setGeometry(142,445,80,20); rec_weekpart_label[1]->setFont(day_font); rec_weekpart_label[1]->setAlignment(Qt::AlignVCenter|Qt::AlignLeft); rec_weekpart_button[2]=new QCheckBox(this); 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[2]->setGeometry(222,445,80,20); rec_weekpart_label[2]->setFont(day_font); rec_weekpart_label[2]->setAlignment(Qt::AlignVCenter|Qt::AlignLeft); rec_weekpart_button[3]=new QCheckBox(this); 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]->setGeometry(102,465,80,20); rec_weekpart_label[3]->setFont(day_font); rec_weekpart_label[3]->setAlignment(Qt::AlignVCenter|Qt::AlignLeft); rec_weekpart_button[4]=new QCheckBox(this); 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]->setGeometry(202,465,80,20); rec_weekpart_label[4]->setFont(day_font); rec_weekpart_label[4]->setAlignment(Qt::AlignVCenter|Qt::AlignLeft); rec_weekpart_button[5]=new QCheckBox(this); 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]->setGeometry(102,485,80,20); rec_weekpart_label[5]->setFont(day_font); rec_weekpart_label[5]->setAlignment(Qt::AlignVCenter|Qt::AlignLeft); rec_weekpart_button[6]=new QCheckBox(this); 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]->setGeometry(202,485,80,20); rec_weekpart_label[6]->setFont(day_font); rec_weekpart_label[6]->setAlignment(Qt::AlignVCenter|Qt::AlignLeft); rec_set_button=new QPushButton(tr("Set All"),this); 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->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->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); 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->setGeometry(15,592,110,22); rec_aes_alarm_label->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter); rec_aes_alarm_label->setFont(large_font); rec_aes_alarm_label->setPalette(QColor(Qt::red)); rec_aes_alarm_label->setText(tr("AES ALARM")); rec_aes_alarm_label->hide(); // // Record Timer // rec_timer=new QTimer(this); connect(rec_timer,SIGNAL(timeout()),this,SLOT(recTimerData())); rec_timer_label=new QLabel(this); rec_timer_label->setGeometry(130,580,120,50); rec_timer_label->setFont(timer_font); rec_timer_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); rec_timer_label->setText(RDGetTimeLength(rec_length,true)); // // Channels // rec_channels_box=new QComboBox(this); rec_channels_box->setGeometry(20,635,60,35); rec_channels_edit=new QLineEdit(this); 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->setGeometry(10,616,80,16); rec_channels_box_label->setAlignment(Qt::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->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->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->setGeometry(280,620,80,50); rec_stop_button->setDefault(true); rec_stop_button->setState(RDTransportButton::On); rec_stop_button->setOnColor(QColor(Qt::red)); connect(rec_stop_button,SIGNAL(clicked()),this,SLOT(stopData())); // // Record Mode // rec_mode_box=new QComboBox(this); 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->setGeometry(10,676,100,16); rec_mode_box_label->setAlignment(Qt::AlignHCenter); rec_mode_box_label->setFont(font); // // AutoTrim Mode // rec_trim_box=new QComboBox(this); 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->setGeometry(130,676,100,16); rec_trim_box_label->setAlignment(Qt::AlignHCenter); rec_trim_box_label->setFont(font); // // Close Button // QPushButton *close_button=new QPushButton(this); 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)); if(use_weight) { cut_weight_label->setText(tr("Weight")); cut_weight_box->setValue(rec_cut->weight()); } else { cut_weight_label->setText(tr("Order")); cut_weight_box->setValue(rec_cut->playOrder()); } 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(rda->libraryConf()->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(rda->libraryConf()->defaultTrimState()) { rec_trim_box->setCurrentItem(0); } else { rec_trim_box->setCurrentItem(1); } aesAlarmData(rec_card_no[0],rec_port_no[0], rda->cae()->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(); } }
ListNodes::ListNodes(RDMatrix *matrix,QWidget *parent,const char *name) : QDialog(parent,name,true) { list_matrix=matrix; setCaption(tr("LiveWire Node List")); // // 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); // // Nodes List Box // list_list_view=new RDListView(this,"list_box"); list_list_view-> setGeometry(10,10,sizeHint().width()-20,sizeHint().height()-80); list_list_view->setAllColumnsShowFocus(true); list_list_view->setItemMargin(5); list_list_view->addColumn(tr("HOSTNAME")); list_list_view->setColumnAlignment(0,Qt::AlignLeft); list_list_view->addColumn(tr("DESCRIPTION")); list_list_view->setColumnAlignment(1,Qt::AlignLeft); list_list_view->addColumn(tr("FIRST OUTPUT")); list_list_view->setColumnAlignment(2,Qt::AlignLeft); list_list_view->addColumn(tr("TCP PORT")); list_list_view->setColumnAlignment(3,Qt::AlignCenter); connect(list_list_view, SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)), this, SLOT(doubleClickedData(QListViewItem *,const QPoint &,int))); // // Add Button // QPushButton *button=new QPushButton(this,"add_button"); button->setGeometry(10,sizeHint().height()-60,80,50); button->setFont(bold_font); button->setText(tr("&Add")); connect(button,SIGNAL(clicked()),this,SLOT(addData())); // // Edit Button // button=new QPushButton(this,"edit_button"); button->setGeometry(100,sizeHint().height()-60,80,50); button->setFont(bold_font); button->setText(tr("&Edit")); connect(button,SIGNAL(clicked()),this,SLOT(editData())); // // Delete Button // button=new QPushButton(this,"delete_button"); button->setGeometry(190,sizeHint().height()-60,80,50); button->setFont(bold_font); button->setText(tr("&Delete")); connect(button,SIGNAL(clicked()),this,SLOT(deleteData())); // // Close Button // button=new QPushButton(this,"close_button"); button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50); button->setDefault(true); button->setFont(bold_font); button->setText(tr("&Close")); connect(button,SIGNAL(clicked()),this,SLOT(closeData())); // // Load Values // RefreshList(); }
ViewAdapters::ViewAdapters(RDStation *rdstation, QWidget *parent,const char *name) : QDialog(parent,name,true) { QString str1; QString str2; // // Fix the Window Size // setMinimumWidth(sizeHint().width()); setMaximumWidth(sizeHint().width()); setMinimumHeight(sizeHint().height()); setMaximumHeight(sizeHint().height()); setCaption(tr("Audio Resource Information")); // // Create Fonts // QFont font=QFont("Helvetica",16,QFont::Bold); font.setPixelSize(16); QFont button_font=QFont("Helvetica",14,QFont::Bold); button_font.setPixelSize(14); // // Title // str1=tr("Audio Resources on"); QLabel *label= new QLabel(QString().sprintf("%s %s",(const char *)str1, (const char *)rdstation->name()), this,"title_label"); label->setGeometry(15,10,sizeHint().width()-20,16); label->setFont(font); // // Resource List // QTextEdit *text_edit=new QTextEdit(this,"adapter_edit"); text_edit->setGeometry(10,28,sizeHint().width()-20,sizeHint().height()-98); text_edit->setReadOnly(true); QString text; if(rdstation->scanned()) { text+=tr("SUPPORTED AUDIO DRIVERS\n"); if(!rdstation->driverVersion(RDStation::Hpi).isEmpty()) { text+=QString().sprintf(" AudioScience HPI [%s]\n", (const char *)rdstation->driverVersion(RDStation::Hpi)); } if(!rdstation->driverVersion(RDStation::Jack).isEmpty()) { text+=QString().sprintf(" JACK Audio Connection Kit [%s]\n", (const char *)rdstation->driverVersion(RDStation::Jack)); } if(!rdstation->driverVersion(RDStation::Alsa).isEmpty()) { text+=QString().sprintf(" Advanced Linux Sound Architecture (ALSA) [%s]\n", (const char *)rdstation->driverVersion(RDStation::Alsa)); } text+="\n"; text+=tr("SUPPORTED IMPORT FORMATS\n"); if(rdstation->haveCapability(RDStation::HaveFlac)) { text+=tr(" Free Lossless Audio Codec (FLAC)\n"); } if(rdstation->haveCapability(RDStation::HaveMpg321)) { text+=tr(" MPEG Layer 1\n"); text+=tr(" MPEG Layer 2\n"); text+=tr(" MPEG Layer 3\n"); } if(rdstation->haveCapability(RDStation::HaveMp4Decode)) { text+=tr(" MP-4/AAC\n"); } if(rdstation->haveCapability(RDStation::HaveOgg123)) { text+=tr(" OggVorbis\n"); } text+=tr(" PCM16 Linear\n"); text+="\n"; text+=tr("SUPPORTED EXPORT FORMATS\n"); if(rdstation->haveCapability(RDStation::HaveFlac)) { text+=tr(" Free Lossless Audio Codec (FLAC)\n"); } if(rdstation->haveCapability(RDStation::HaveTwoLame)) { text+=tr(" MPEG Layer 2\n"); } if(rdstation->haveCapability(RDStation::HaveLame)) { text+=tr(" MPEG Layer 3\n"); } if(rdstation->haveCapability(RDStation::HaveOggenc)) { text+=tr(" OggVorbis\n"); } text+=tr(" PCM16 Linear\n"); RDEncoderList *encoders=new RDEncoderList(rdstation->name()); for(unsigned i=0;i<encoders->encoderQuantity();i++) { text+=" "+encoders->encoder(i)->name()+" [Custom]\n"; } delete encoders; text+="\n"; text+=tr("AUDIO ADAPTERS\n"); for(int i=0;i<RD_MAX_CARDS;i++) { str1=QString(tr("Card")); str2=QString(tr("Not present")); if(rdstation->cardName(i).isEmpty()) { text+=QString().sprintf(" %s %d: %s\n\n",(const char *)str1,i, (const char *)str2); } else { text+=QString().sprintf(" %s %d: %s\n",(const char *)str1,i, (const char *)rdstation->cardName(i)); switch(rdstation->cardDriver(i)) { case RDStation::Hpi: text+=QString(tr(" Driver: AudioScience HPI\n")); break; case RDStation::Jack: text+=QString(tr(" Driver: JACK Audio Connection Kit\n")); break; case RDStation::Alsa: text+=QString( tr(" Driver: Advanced Linux Sound Architecture (ALSA)\n")); break; case RDStation::None: text+=QString(tr(" Driver: UNKNOWN\n")); break; } str1=QString(tr("Inputs:")); text+=QString().sprintf(" %s %d\n",(const char *)str1, rdstation->cardInputs(i)); str1=QString(tr("Outputs:")); text+=QString().sprintf(" %s %d\n\n",(const char *)str1, rdstation->cardOutputs(i)); } } } else { text=tr("NO DATA AVAILABLE\n\n"); text+=tr("Please start the Rivendell daemons on this host (by executing, as user 'root', the command \"/etc/init.d/rivendell start\") in order to populate the audio resources database."); } text_edit->setText(text); // // Close Button // QPushButton *button=new QPushButton(this,"close_button"); button->setGeometry(sizeHint().width()-90,sizeHint().height()-60, 80,50); button->setFont(button_font); button->setText(tr("&Close")); button->setDefault(true); connect(button,SIGNAL(clicked()),this,SLOT(closeData())); }
ListReports::ListReports(const QString &filter,const QString &type_filter, const QString &group,const QString &schedcode, QWidget *parent,const char *name) : QDialog(parent,name,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"); 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"); 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"); 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())); }
ListSvcs::ListSvcs(QWidget *parent,const char *name) : QDialog(parent,name,true) { setCaption(tr("Rivendell Services")); // // 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); // // Log List // list_log_list=new QListView(this,"list_log_list"); list_log_list->setAllColumnsShowFocus(true); list_log_list->setItemMargin(5); list_log_list->addColumn(tr("SERVICE")); list_log_list->setColumnAlignment(0,Qt::AlignLeft); list_log_list->addColumn(tr("OLDEST REPORT")); list_log_list->setColumnAlignment(1,Qt::AlignCenter); connect(list_log_list, SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)), this, SLOT(listDoubleClickedData(QListViewItem *,const QPoint &,int))); // // Generate Report Button // list_generate_button=new QPushButton(this,"list_generate_button"); list_generate_button->setFont(bold_font); list_generate_button->setText(tr("&Generate\nReports")); connect(list_generate_button,SIGNAL(clicked()),this,SLOT(generateData())); // // Purge Button // list_purge_button=new QPushButton(this,"list_purge_button"); list_purge_button->setFont(bold_font); list_purge_button->setText(tr("&Purge\nData")); connect(list_purge_button,SIGNAL(clicked()),this,SLOT(purgeData())); // // Close Button // list_close_button=new QPushButton(this,"close_button"); list_close_button->setDefault(true); list_close_button->setFont(bold_font); list_close_button->setText(tr("C&lose")); connect(list_close_button,SIGNAL(clicked()),this,SLOT(closeData())); RefreshList(); }
TestImport::TestImport(RDSvc *svc,RDSvc::ImportSource src,QWidget *parent, const char *name) : QDialog(parent,name,true) { QString sql; QDate current_date=QDate::currentDate(); test_svc=svc; test_src=src; // // Fix the Window Size // setMinimumWidth(sizeHint().width()); setMinimumHeight(sizeHint().height()); switch(test_src) { case RDSvc::Traffic: setCaption(tr("Test Traffic Import")); break; case RDSvc::Music: setCaption(tr("Test Music Import")); break; case RDSvc::NoSource: break; } // // Create Fonts // QFont font=QFont("Helvetica",12,QFont::Bold); font.setPixelSize(12); QFont section_font=QFont("Helvetica",14,QFont::Bold); section_font.setPixelSize(14); // // Date Selector // test_date_edit=new QDateEdit(this,"test_date_edit"); test_date_label=new QLabel(test_date_edit,tr("Test Date:"),this); test_date_label->setFont(font); test_date_label->setAlignment(AlignVCenter|AlignRight); test_date_edit->setDate(current_date); connect(test_date_edit,SIGNAL(valueChanged(const QDate &)), this,SLOT(dateChangedData(const QDate &))); // // Select Date Button // test_select_button=new QPushButton(this); test_select_button->setFont(font); test_select_button->setText(tr("&Select")); connect(test_select_button,SIGNAL(clicked()),this,SLOT(selectData())); // // Import Button // test_import_button=new QPushButton(this); test_import_button->setFont(font); test_import_button->setText(tr("&Import")); connect(test_import_button,SIGNAL(clicked()),this,SLOT(importData())); // // Import Filename // test_filename_edit=new QLineEdit(this); test_filename_edit->setReadOnly(true); test_filename_label= new QLabel(test_filename_edit,tr("Using source file:"),this); test_filename_label->setFont(font); // // Events List // test_events_list=new RDListView(this); test_events_list->setItemMargin(2); test_events_list->addColumn(tr("Start Time")); test_events_list->setColumnAlignment(0,AlignCenter); test_events_list->addColumn(tr("Cart")); test_events_list->setColumnAlignment(1,AlignCenter); test_events_list->addColumn(tr("Len")); test_events_list->setColumnAlignment(2,AlignRight); test_events_list->addColumn(tr("Title")); test_events_list->setColumnAlignment(3,AlignLeft); test_events_list->addColumn(tr("Trans")); test_events_list->setColumnAlignment(4,AlignCenter); test_events_list->addColumn(tr("Time Type")); test_events_list->setColumnAlignment(5,AlignCenter); test_events_list->addColumn(tr("Wait Time")); test_events_list->setColumnAlignment(6,AlignCenter); test_events_list->addColumn(tr("Contract #")); test_events_list->setColumnAlignment(7,AlignCenter); test_events_list->addColumn(tr("Event ID")); test_events_list->setColumnAlignment(8,AlignCenter); test_events_list->addColumn(tr("Announcement Type")); test_events_list->setColumnAlignment(9,AlignCenter); test_events_list->setColumnSortType(0,RDListView::LineSort); test_events_label=new QLabel(test_events_list,tr("Imported Events"),this); test_events_label->setFont(font); // // Close Button // test_close_button=new QPushButton(this); test_close_button->setFont(font); test_close_button->setText(tr("&Close")); connect(test_close_button,SIGNAL(clicked()),this,SLOT(closeData())); dateChangedData(current_date); }
void RecordCut::closeEvent(QCloseEvent *e) { closeData(); }
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; }
EditDecks::EditDecks(RDStation *station,RDStation *cae_station,QWidget *parent) : QDialog(parent) { // // Fix the Window Size // setMinimumSize(sizeHint()); setMaximumHeight(sizeHint().height()); edit_station=station; setWindowTitle("RDAdmin - "+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::NoInsert); 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(Qt::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(Qt::AlignRight|Qt::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(Qt::AlignRight|Qt::AlignVCenter); // // Format // edit_format_box=new QComboBox(this); edit_format_box->setGeometry(125,136,150,24); edit_format_box->setInsertionPolicy(QComboBox::NoInsert); 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(Qt::AlignRight|Qt::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::NoInsert); edit_bitrate_label=new QLabel(edit_bitrate_box,tr("Bit Rate:"),this); edit_bitrate_label->setGeometry(10,160,110,24); edit_bitrate_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); // // Switcher Station // edit_swstation_box=new QComboBox(this); edit_swstation_box->setGeometry(125,190,250,24); edit_swstation_box->setInsertionPolicy(QComboBox::NoInsert); edit_swstation_label=new QLabel(edit_swstation_box,tr("Switcher Host:"),this); edit_swstation_label->setGeometry(10,190,110,24); edit_swstation_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); connect(edit_swstation_box,SIGNAL(activated(const QString &)), this,SLOT(stationActivatedData(const QString &))); // // Switcher Matrix // edit_swmatrix_box=new RDComboBox(this); edit_swmatrix_box->setGeometry(125,214,250,24); edit_swmatrix_box->setInsertionPolicy(QComboBox::NoInsert); 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(Qt::AlignRight|Qt::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::NoInsert); 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(Qt::AlignRight|Qt::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(Qt::AlignRight|Qt::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(Qt::AlignLeft|Qt::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::NoInsert); label=new QLabel(edit_channels_box,tr("Channels:"),this); label->setGeometry(10,300,110,24); label->setAlignment(Qt::AlignRight|Qt::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(Qt::AlignRight|Qt::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(Qt::AlignRight|Qt::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::NoInsert); 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(Qt::AlignRight); // // Play Deck Card Selector // edit_play_selector=new RDCardSelector(this); edit_play_selector->setGeometry(392,37,120,10); connect(edit_play_selector,SIGNAL(settingsChanged(int,int,int)), this,SLOT(playSettingsChangedData(int,int,int))); // // Deck Event Carts // edit_event_section_label=new QLabel(tr("Event Carts"),this); edit_event_section_label->setGeometry(395,99,100,24); edit_event_section_label->setFont(big_font); QSignalMapper *mapper=new QSignalMapper(this); connect(mapper,SIGNAL(mapped(int)),this,SLOT(eventCartSelectedData(int))); for(unsigned i=0;i<RD_CUT_EVENT_ID_QUAN;i+=2) { for(unsigned j=0;j<2;j++) { edit_event_labels[i+j]=new QLabel(QString().sprintf("%u:",i+j+1),this); edit_event_labels[i+j]->setAlignment(Qt::AlignRight|Qt::AlignVCenter); edit_event_labels[i+j]->setGeometry(387+165*j,126+14*i,20,20); edit_event_edits[i+j]=new QLineEdit(this); edit_event_edits[i+j]->setGeometry(412+165*j,126+14*i,60,20); edit_event_edits[i+j]-> setValidator(new QIntValidator(1,RD_MAX_CART_NUMBER,this)); edit_event_buttons[i+j]=new QPushButton(tr("Select"),this); edit_event_buttons[i+j]->setGeometry(477+165*j,124+14*i,60,24); mapper->setMapping(edit_event_buttons[i+j],i+j); connect(edit_event_buttons[i+j],SIGNAL(clicked()), mapper,SLOT(map())); } } // // 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("PCM24")); 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()); }
Vlasov::~Vlasov() { closeData(); }
ListAuxFields::ListAuxFields(unsigned feed_id,QWidget *parent,const char *name) : QDialog(parent,name,true) { list_feed_id=feed_id; setCaption(tr("Auxiliary Metadata Fields")); // // 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); // // Fields List Box // list_list_view=new QListView(this,"list_box"); list_list_view-> setGeometry(10,24,sizeHint().width()-20,sizeHint().height()-94); QLabel *label= new QLabel(list_list_view,tr("Auxiliary Metadata Fields"), this,"list_list_view_label"); label->setFont(bold_font); label->setGeometry(14,5,sizeHint().width()-28,19); list_list_view->setAllColumnsShowFocus(true); list_list_view->setItemMargin(5); list_list_view->addColumn(tr("Var Name")); list_list_view->setColumnAlignment(0,Qt::AlignHCenter); list_list_view->addColumn(tr("Caption")); list_list_view->setColumnAlignment(1,Qt::AlignLeft); connect(list_list_view, SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)), this, SLOT(doubleClickedData(QListViewItem *,const QPoint &,int))); // // Add Button // QPushButton *button=new QPushButton(this,"add_button"); button->setGeometry(10,sizeHint().height()-60,80,50); button->setFont(bold_font); button->setText(tr("&Add")); connect(button,SIGNAL(clicked()),this,SLOT(addData())); // // Edit Button // button=new QPushButton(this,"edit_button"); button->setGeometry(100,sizeHint().height()-60,80,50); button->setFont(bold_font); button->setText(tr("&Edit")); connect(button,SIGNAL(clicked()),this,SLOT(editData())); // // Delete Button // button=new QPushButton(this,"delete_button"); button->setGeometry(190,sizeHint().height()-60,80,50); button->setFont(bold_font); button->setText(tr("&Delete")); connect(button,SIGNAL(clicked()),this,SLOT(deleteData())); // // Close Button // button=new QPushButton(this,"close_button"); button->setGeometry(sizeHint().width()-90,sizeHint().height()-60, 80,50); button->setFont(bold_font); button->setText(tr("&Close")); connect(button,SIGNAL(clicked()),this,SLOT(closeData())); RefreshList(); }
ListUsers::ListUsers(const QString &admin_name,QWidget *parent,const char *name) : QDialog(parent,name,true) { list_admin_name=admin_name; // // Fix the Window Size // setMinimumWidth(sizeHint().width()); setMinimumHeight(sizeHint().height()); setCaption(tr("Rivendell User List")); // // Create Fonts // QFont font=QFont("Helvetica",12,QFont::Bold); font.setPixelSize(12); QFont list_font=QFont("Helvetica",12,QFont::Normal); list_font.setPixelSize(12); QFont small_font=QFont("Helvetica",10,QFont::Normal); small_font.setPixelSize(10); // // Create Icons // list_admin_map=new QPixmap(admin_xpm); list_user_map=new QPixmap(user_xpm); // // Add Button // list_add_button=new QPushButton(this,"list_add_button"); list_add_button->setFont(font); list_add_button->setText(tr("&Add")); connect(list_add_button,SIGNAL(clicked()),this,SLOT(addData())); // // Edit Button // list_edit_button=new QPushButton(this,"list_edit_button"); list_edit_button->setFont(font); list_edit_button->setText(tr("&Edit")); connect(list_edit_button,SIGNAL(clicked()),this,SLOT(editData())); // // Delete Button // list_delete_button=new QPushButton(this,"list_delete_button"); list_delete_button->setFont(font); list_delete_button->setText(tr("&Delete")); connect(list_delete_button,SIGNAL(clicked()),this,SLOT(deleteData())); // // Close Button // list_close_button=new QPushButton(this,"list_close_button"); list_close_button->setDefault(true); list_close_button->setFont(font); list_close_button->setText(tr("&Close")); connect(list_close_button,SIGNAL(clicked()),this,SLOT(closeData())); // // User List // list_users_view=new RDListView(this,"list_users_view"); list_users_view->setFont(list_font); list_users_view->setAllColumnsShowFocus(true); list_users_view->setItemMargin(5); list_users_view->addColumn(""); list_users_view->addColumn(tr("USER NAME")); list_users_view->addColumn(tr("FULL NAME")); list_users_view->addColumn(tr("DESCRIPTION")); QLabel *list_box_label=new QLabel(list_users_view,tr("&Users:"), this,"list_box_label"); list_box_label->setFont(font); list_box_label->setGeometry(14,11,85,19); connect(list_users_view, SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)), this, SLOT(doubleClickedData(QListViewItem *,const QPoint &,int))); RefreshList(); }
ListAuxFields::ListAuxFields(unsigned feed_id,QWidget *parent) : QDialog(parent) { list_feed_id=feed_id; setWindowTitle("RDAdmin - "+tr("Auxiliary Metadata Fields")); // // Fix the Window Size // setMinimumSize(sizeHint()); // // Create Fonts // QFont bold_font=QFont("Helvetica",12,QFont::Bold); bold_font.setPixelSize(12); QFont font=QFont("Helvetica",12,QFont::Normal); font.setPixelSize(12); // // Fields List Box // list_label=new QLabel(tr("Auxiliary Metadata Fields"),this); list_label->setFont(bold_font); list_model=new RDSqlTableModel(this); QString sql=QString("select ")+ "ID,"+ "VAR_NAME,"+ "CAPTION "+ "from AUX_METADATA where "+ QString().sprintf("FEED_ID=%u ",list_feed_id)+ "order by CAPTION"; list_model->setQuery(sql); list_model->setHeaderData(1,Qt::Horizontal,tr("Variable Name")); list_model->setHeaderData(2,Qt::Horizontal,tr("Caption")); list_view=new RDTableView(this); list_view->setModel(list_model); list_view->hideColumn(0); list_view->resizeColumnsToContents(); connect(list_view,SIGNAL(doubleClicked(const QModelIndex &)), this,SLOT(doubleClickedData(const QModelIndex &))); // // Add Button // list_add_button=new QPushButton(this); list_add_button->setFont(bold_font); list_add_button->setText(tr("&Add")); connect(list_add_button,SIGNAL(clicked()),this,SLOT(addData())); // // Edit Button // list_edit_button=new QPushButton(this); list_edit_button->setFont(bold_font); list_edit_button->setText(tr("&Edit")); connect(list_edit_button,SIGNAL(clicked()),this,SLOT(editData())); // // Delete Button // list_delete_button=new QPushButton(this); list_delete_button->setFont(bold_font); list_delete_button->setText(tr("&Delete")); connect(list_delete_button,SIGNAL(clicked()),this,SLOT(deleteData())); // // Close Button // list_close_button=new QPushButton(this); list_close_button->setFont(bold_font); list_close_button->setText(tr("&Close")); connect(list_close_button,SIGNAL(clicked()),this,SLOT(closeData())); }
ListMatrices::ListMatrices(QString station,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()); list_station=station; setCaption(tr("Rivendell Switcher List")); // // Create Fonts // QFont font=QFont("Helvetica",12,QFont::Bold); font.setPixelSize(12); QFont small_font=QFont("Helvetica",10,QFont::Bold); small_font.setPixelSize(10); // // Initialize Data Structures // for(int i=0; i<MAX_MATRICES; i++) { list_matrix_modified[i]=false; } // // Matrix List Box // list_view=new QListView(this,"list_box"); list_view->setGeometry(10,24,sizeHint().width()-20,sizeHint().height()-94); QLabel *label=new QLabel(list_view,tr("Switchers:"),this,"list_view_label"); label->setFont(font); label->setGeometry(14,5,85,19); list_view->setAllColumnsShowFocus(true); list_view->setItemMargin(5); list_view->addColumn(tr("MATRIX")); list_view->setColumnAlignment(0,Qt::AlignHCenter); list_view->addColumn(tr("DESCRIPTION")); list_view->setColumnAlignment(1,Qt::AlignLeft); list_view->addColumn(tr("TYPE")); list_view->setColumnAlignment(2,Qt::AlignLeft); connect(list_view,SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)), this,SLOT(doubleClickedData(QListViewItem *,const QPoint &,int))); RefreshList(); // // Add Button // QPushButton *add_button=new QPushButton(this,"add_button"); add_button->setGeometry(10,sizeHint().height()-60,80,50); add_button->setFont(font); add_button->setText(tr("&Add")); connect(add_button,SIGNAL(clicked()),this,SLOT(addData())); // // Edit Button // QPushButton *edit_button=new QPushButton(this,"edit_button"); edit_button->setGeometry(100,sizeHint().height()-60,80,50); edit_button->setFont(font); edit_button->setText(tr("&Edit")); connect(edit_button,SIGNAL(clicked()),this,SLOT(editData())); // // Delete Button // QPushButton *delete_button=new QPushButton(this,"delete_button"); delete_button->setGeometry(190,sizeHint().height()-60,80,50); delete_button->setFont(font); delete_button->setText(tr("&Delete")); connect(delete_button,SIGNAL(clicked()),this,SLOT(deleteData())); // // 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())); }