diff --git a/ChangeLog b/ChangeLog index dfffbffe..1c838e3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19181,3 +19181,6 @@ 2019-10-07 Fred Gleason * Refactored rmlsend(1) to use the 'RDDialog' and 'RDWidget' base classes. +2019-10-07 Fred Gleason + * Replaced references to 'helvetica' fonts to use font engine + values in 'lib/'. diff --git a/lib/Makefile.am b/lib/Makefile.am index a8808e9f..16af208c 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -121,7 +121,6 @@ dist_librd_la_SOURCES = dbversion.h\ rdevent_line.cpp rdevent_line.h\ rdevent_player.cpp rdevent_player.h\ rdeventimportlist.cpp rdeventimportlist.h\ - rdexception_dialog.cpp rdexception_dialog.h\ rdexport_settings_dialog.cpp rdexport_settings_dialog.h\ rdfeed.cpp rdfeed.h\ rdfeedlog.cpp rdfeedlog.h\ @@ -143,8 +142,6 @@ dist_librd_la_SOURCES = dbversion.h\ rdidvalidator.cpp rdidvalidator.h\ rdimport_audio.cpp rdimport_audio.h\ rdinstancelock.cpp rdinstancelock.h\ - rdintegeredit.cpp rdintegeredit.h\ - rdintegerdialog.cpp rdintegerdialog.h\ rd.h\ rdkernelgpio.cpp rdkernelgpio.h\ rdlabel.cpp rdlabel.h\ @@ -280,7 +277,6 @@ nodist_librd_la_SOURCES = moc_rdadd_cart.cpp\ moc_rdedit_panel_name.cpp\ moc_rdemptycart.cpp\ moc_rdevent_player.cpp\ - moc_rdexception_dialog.cpp\ moc_rdexport_settings_dialog.cpp\ moc_rdfeed.cpp\ moc_rdframe.cpp\ @@ -291,8 +287,6 @@ nodist_librd_la_SOURCES = moc_rdadd_cart.cpp\ moc_rdhotkeys.cpp\ moc_rdhotkeylist.cpp\ moc_rdimport_audio.cpp\ - moc_rdintegeredit.cpp\ - moc_rdintegerdialog.cpp\ moc_rdkernelgpio.cpp\ moc_rdlabel.cpp\ moc_rdlineedit.cpp\ diff --git a/lib/lib.pro b/lib/lib.pro index af0b6009..b0f91d23 100644 --- a/lib/lib.pro +++ b/lib/lib.pro @@ -87,7 +87,6 @@ SOURCES += rdescape_string.cpp SOURCES += rdevent.cpp SOURCES += rdevent_line.cpp SOURCES += rdeventimportlist.cpp -SOURCES += rdexception_dialog.cpp SOURCES += rdexport_settings_dialog.cpp SOURCES += rdframe.cpp SOURCES += rdfontset.cpp @@ -100,8 +99,6 @@ SOURCES += rdgroup_list.cpp SOURCES += rdhash.cpp SOURCES += rdidvalidator.cpp SOURCES += rdimport_audio.cpp -SOURCES += rdintegeredit.cpp -SOURCES += rdintegerdialog.cpp SOURCES += rdkernelgpio.cpp SOURCES += rdlabel.cpp SOURCES += rdlibrary_conf.cpp @@ -222,7 +219,6 @@ HEADERS += rdescape_string.h HEADERS += rdevent.h HEADERS += rdevent_line.h HEADERS += rdeventimportlist.h -HEADERS += rdexception_dialog.h HEADERS += rdexport_settings_dialog.h HEADERS += rdframe.h HEADERS += rdfontset.h @@ -236,8 +232,6 @@ HEADERS += rdgroup.h HEADERS += rdhash.h HEADERS += rdidvalidator.h HEADERS += rdimport_audio.h -HEADERS += rdintegeredit.h -HEADERS += rdintegerdialog.h HEADERS += rdkernelgpio.h HEADERS += rdlabel.h HEADERS += rdlibrary_conf.h diff --git a/lib/librd_cs.ts b/lib/librd_cs.ts index b8714948..1f2f3a24 100644 --- a/lib/librd_cs.ts +++ b/lib/librd_cs.ts @@ -1677,59 +1677,51 @@ Opravdu chcete uložit? RDExceptionDialog Rivendell Exception Report - Zpráva o chybě Rivendellu + Zpráva o chybě Rivendellu &Save - &Uložit + &Uložit &Close - &Zavřít + &Zavřít Text (*.txt *.TXT) All Files (*.*) - Text (*.txt *.TXT) + Text (*.txt *.TXT) Všechny soubory (*.*) Export File - Vyvést soubor + Vyvést soubor The file - Soubor + Soubor already exists! Overwrite? - Již existuje! + Již existuje! Přepsat? File Exists - Soubor již existuje + Soubor již existuje Unable to open file - Nelze otevřít soubor + Nelze otevřít soubor for writing! - pro zápis! + pro zápis! File Error - Chyba souboru - - - already exists! - - - - Overwrite? - + Chyba souboru @@ -2157,30 +2149,30 @@ Bitte Kofiguration prüfen und erneut versuchen. RDIntegerDialog &OK - &OK + &OK &Cancel - &Zrušit + &Zrušit Set Value - Nastavit hodnotu + Nastavit hodnotu RDIntegerEdit Add - Přidat + Přidat Delete - Smazat + Smazat Set Value - Nastavit hodnotu + Nastavit hodnotu diff --git a/lib/librd_de.ts b/lib/librd_de.ts index 3dd85978..51e1b4d5 100644 --- a/lib/librd_de.ts +++ b/lib/librd_de.ts @@ -1664,59 +1664,51 @@ Are you sure you want to save? RDExceptionDialog Rivendell Exception Report - Rivendell Fehlerreport + Rivendell Fehlerreport &Save - &Speichern + &Speichern &Close - &Schliessen + &Schliessen Text (*.txt *.TXT) All Files (*.*) - Text (*.txt *.TXT) + Text (*.txt *.TXT) Alle Dateien (*.*) Export File - Datei Exportieren + Datei Exportieren The file - Die Datei + Die Datei already exists! Overwrite? - existiert bereits! + existiert bereits! Überschreiben? File Exists - Datei existiert + Datei existiert Unable to open file - Kann die Datei nicht öffnen + Kann die Datei nicht öffnen for writing! - zum schreiben! + zum schreiben! File Error - Dateifehler - - - already exists! - - - - Overwrite? - + Dateifehler @@ -2144,30 +2136,30 @@ Bitte Kofiguration prüfen und erneut versuchen. RDIntegerDialog &OK - &OK + &OK &Cancel - &Abbrechen + &Abbrechen Set Value - Wert setzen + Wert setzen RDIntegerEdit Add - Hinzufügen + Hinzufügen Delete - Löschen + Löschen Set Value - Wert setzen + Wert setzen diff --git a/lib/librd_es.ts b/lib/librd_es.ts index 1f5e61f0..c7e20624 100644 --- a/lib/librd_es.ts +++ b/lib/librd_es.ts @@ -1670,59 +1670,51 @@ Are you sure you want to save? RDExceptionDialog Rivendell Exception Report - Reporte de excepciones + Reporte de excepciones &Save - &Guardar + &Guardar &Close - &Cerrar + &Cerrar Text (*.txt *.TXT) All Files (*.*) - Texto (*.txt *.TXT) + Texto (*.txt *.TXT) Todos los archivos (*.*) Export File - Exportar archivo + Exportar archivo The file - El archivo + El archivo already exists! Overwrite? - ya existe. + ya existe. ¿Sobreescribir? File Exists - El archivo ya existe + El archivo ya existe Unable to open file - ¡No es posible abrir el archivo + ¡No es posible abrir el archivo for writing! - para escritura! + para escritura! File Error - Error de archivo - - - already exists! - - - - Overwrite? - + Error de archivo @@ -2150,30 +2142,30 @@ Do you still want to proceed? RDIntegerDialog &OK - &Aceptar + &Aceptar &Cancel - &Cancelar + &Cancelar Set Value - Asignar valor + Asignar valor RDIntegerEdit Add - Añadir + Añadir Delete - Borrar + Borrar Set Value - Colocar valor + Colocar valor diff --git a/lib/librd_fr.ts b/lib/librd_fr.ts index 25c2abd5..701e7a69 100644 --- a/lib/librd_fr.ts +++ b/lib/librd_fr.ts @@ -1480,63 +1480,6 @@ Are you sure you want to save? &Annuler - - RDExceptionDialog - - Rivendell Exception Report - - - - &Save - - - - &Close - - - - Text (*.txt *.TXT) -All Files (*.*) - - - - Export File - - - - The file - - - - already exists! -Overwrite? - - - - File Exists - - - - Unable to open file - - - - for writing! - - - - File Error - - - - already exists! - - - - Overwrite? - - - RDExportSettingsDialog @@ -1871,30 +1814,11 @@ Do you want to overwrite it? RDIntegerDialog &OK - &OK + &OK &Cancel - &Annuler - - - Set Value - - - - - RDIntegerEdit - - Add - - - - Delete - - - - Set Value - + &Annuler diff --git a/lib/librd_nb.ts b/lib/librd_nb.ts index e240ba25..4cd46dd1 100644 --- a/lib/librd_nb.ts +++ b/lib/librd_nb.ts @@ -1666,59 +1666,51 @@ Are you sure you want to save? RDExceptionDialog Rivendell Exception Report - Unntaksrapport frå Rivendell + Unntaksrapport frå Rivendell &Save - &Lagre + &Lagre &Close - Lu&kk + Lu&kk Text (*.txt *.TXT) All Files (*.*) - Tekst (*.txt *.TXT) + Tekst (*.txt *.TXT) Alle filer (*.*) Export File - Eksporter fil + Eksporter fil The file - Fila + Fila already exists! Overwrite? - finst frå før! + finst frå før! Skriv over? File Exists - Fila finst + Fila finst Unable to open file - Greier ikkje opna fila + Greier ikkje opna fila for writing! - for skriving! + for skriving! File Error - Filfeil - - - already exists! - - - - Overwrite? - + Filfeil @@ -2144,32 +2136,13 @@ Sjekk eksportoppsettet ditt og prøv att. RDIntegerDialog - - Set Value - - &OK - &OK + &OK &Cancel - &Avbryt - - - - RDIntegerEdit - - Set Value - - - - Add - - - - Delete - + &Avbryt diff --git a/lib/librd_nn.ts b/lib/librd_nn.ts index e240ba25..4cd46dd1 100644 --- a/lib/librd_nn.ts +++ b/lib/librd_nn.ts @@ -1666,59 +1666,51 @@ Are you sure you want to save? RDExceptionDialog Rivendell Exception Report - Unntaksrapport frå Rivendell + Unntaksrapport frå Rivendell &Save - &Lagre + &Lagre &Close - Lu&kk + Lu&kk Text (*.txt *.TXT) All Files (*.*) - Tekst (*.txt *.TXT) + Tekst (*.txt *.TXT) Alle filer (*.*) Export File - Eksporter fil + Eksporter fil The file - Fila + Fila already exists! Overwrite? - finst frå før! + finst frå før! Skriv over? File Exists - Fila finst + Fila finst Unable to open file - Greier ikkje opna fila + Greier ikkje opna fila for writing! - for skriving! + for skriving! File Error - Filfeil - - - already exists! - - - - Overwrite? - + Filfeil @@ -2144,32 +2136,13 @@ Sjekk eksportoppsettet ditt og prøv att. RDIntegerDialog - - Set Value - - &OK - &OK + &OK &Cancel - &Avbryt - - - - RDIntegerEdit - - Set Value - - - - Add - - - - Delete - + &Avbryt diff --git a/lib/librd_pt_BR.ts b/lib/librd_pt_BR.ts index dbb04631..358080c1 100644 --- a/lib/librd_pt_BR.ts +++ b/lib/librd_pt_BR.ts @@ -1668,59 +1668,51 @@ Are you sure you want to save? RDExceptionDialog Rivendell Exception Report - Relatório de Exceções do Rivendell + Relatório de Exceções do Rivendell &Save - &Salvar + &Salvar &Close - &Fechar + &Fechar Text (*.txt *.TXT) All Files (*.*) - Textos (*.txt *.TXT) + Textos (*.txt *.TXT) Todos os Arquivos (*.*) Export File - Exportar Arquivo + Exportar Arquivo The file - O Arquivo + O Arquivo already exists! Overwrite? - já Existe! + já Existe! Sobreescrever? File Exists - Arquivo Existente + Arquivo Existente Unable to open file - Não foi Possível abrir o arquivo + Não foi Possível abrir o arquivo for writing! - para escrita! + para escrita! File Error - Erro no Arquivo - - - already exists! - - - - Overwrite? - + Erro no Arquivo @@ -2148,30 +2140,30 @@ Por Favor, cheque suas configurações e tenbte outra vez. RDIntegerDialog Set Value - Selecionar Valor + Selecionar Valor &OK - &OK + &OK &Cancel - &Cancelar + &Cancelar RDIntegerEdit Set Value - Selecionar Valor + Selecionar Valor Add - Adicionar + Adicionar Delete - Deletar + Deletar diff --git a/lib/rdbusydialog.cpp b/lib/rdbusydialog.cpp index 390a0574..97a84994 100644 --- a/lib/rdbusydialog.cpp +++ b/lib/rdbusydialog.cpp @@ -2,7 +2,7 @@ // // A 'progress dialog' widget that shows busy state. // -// (C) Copyright 2010,2016 Fred Gleason +// (C) Copyright 2010-2019 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU Library General Public License @@ -19,19 +19,13 @@ // // -#include -//Added by qt3to4: -#include -#include +#include "rdbusydialog.h" RDBusyDialog::RDBusyDialog(QWidget *parent,Qt::WFlags f) - : QDialog(parent,"",true,f) + : RDDialog(parent) { - QFont font("helvetica",16,QFont::Bold); - font.setPixelSize(16); - bar_label=new QLabel(this); - bar_label->setFont(font); + bar_label->setFont(progressFont()); bar_label->setAlignment(Qt::AlignCenter); bar_bar=new RDBusyBar(this); diff --git a/lib/rdbusydialog.h b/lib/rdbusydialog.h index be63da6c..223be1d1 100644 --- a/lib/rdbusydialog.h +++ b/lib/rdbusydialog.h @@ -2,7 +2,7 @@ // // A 'progress dialog' widget that shows busy state. // -// (C) Copyright 2010,2016 Fred Gleason +// (C) Copyright 2010-2019 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU Library General Public License @@ -21,14 +21,10 @@ #ifndef RDBUSYDIALOG_H #define RDBUSYDIALOG_H -#include -#include -//Added by qt3to4: -#include - #include +#include -class RDBusyDialog : public QDialog +class RDBusyDialog : public RDDialog { Q_OBJECT; public: diff --git a/lib/rdcartslot.cpp b/lib/rdcartslot.cpp index bc7cb4af..61920a73 100644 --- a/lib/rdcartslot.cpp +++ b/lib/rdcartslot.cpp @@ -35,7 +35,7 @@ RDCartSlot::RDCartSlot(int slotnum,RDRipc *ripc,RDCae *cae,RDStation *station, RDCueEditDialog *cue_dialog, const QString &caption,RDAirPlayConf *conf, QWidget *parent) - : QWidget(parent) + : RDWidget(parent) { slot_number=slotnum; slot_ripc=ripc; @@ -48,7 +48,6 @@ RDCartSlot::RDCartSlot(int slotnum,RDRipc *ripc,RDCae *cae,RDStation *station, slot_cue_dialog=cue_dialog; slot_caption=caption; slot_airplay_conf=conf; - slot_svc_names=NULL; slot_stop_requested=false; slot_logline=new RDLogLine(); @@ -60,14 +59,6 @@ RDCartSlot::RDCartSlot(int slotnum,RDRipc *ripc,RDCae *cae,RDStation *station, slot_timescaling_active=false; slot_temp_cart=false; - // - // Fonts - // - QFont big_font("helvetica",36,QFont::Bold); - big_font.setPixelSize(36); - QFont mid_font("helvetica",14,QFont::Bold); - mid_font.setPixelSize(14); - // // Palettes // @@ -99,7 +90,7 @@ RDCartSlot::RDCartSlot(int slotnum,RDRipc *ripc,RDCae *cae,RDStation *station, // slot_start_button=new QPushButton(QString().sprintf("%d",slotnum+1),this); slot_start_button->setGeometry(0,0,sizeHint().height(),sizeHint().height()); - slot_start_button->setFont(big_font); + slot_start_button->setFont(hugeButtonFont()); slot_start_button->setDisabled(true); connect(slot_start_button,SIGNAL(clicked()),this,SLOT(startData())); @@ -124,7 +115,7 @@ RDCartSlot::RDCartSlot(int slotnum,RDRipc *ripc,RDCae *cae,RDStation *station, slot_load_button-> setGeometry(sizeHint().height()+5+slot_box->sizeHint().width()+5,0, sizeHint().height(),sizeHint().height()); - slot_load_button->setFont(mid_font); + slot_load_button->setFont(buttonFont()); connect(slot_load_button,SIGNAL(clicked()),this,SLOT(loadData())); // @@ -134,7 +125,7 @@ RDCartSlot::RDCartSlot(int slotnum,RDRipc *ripc,RDCae *cae,RDStation *station, slot_options_button-> setGeometry(2*sizeHint().height()+10+slot_box->sizeHint().width()+5,0, sizeHint().height(),sizeHint().height()); - slot_options_button->setFont(mid_font); + slot_options_button->setFont(buttonFont()); connect(slot_options_button,SIGNAL(clicked()),this,SLOT(optionsData())); updateOptions(); diff --git a/lib/rdcartslot.h b/lib/rdcartslot.h index f2db589e..9debccbf 100644 --- a/lib/rdcartslot.h +++ b/lib/rdcartslot.h @@ -21,35 +21,14 @@ #ifndef RDCARTSLOT_H #define RDCARTSLOT_H -#include - -#include -#include -#include -#include -#include - -#include - #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include +#include +#include +#include -class RDCartSlot : public QWidget +class RDCartSlot : public RDWidget { Q_OBJECT public: diff --git a/lib/rdedit_audio.cpp b/lib/rdedit_audio.cpp index 3b413d9f..2e66a739 100644 --- a/lib/rdedit_audio.cpp +++ b/lib/rdedit_audio.cpp @@ -2749,7 +2749,7 @@ void RDEditAudio::DrawWave(int xsize,int ysize,int chan,QString label, // // Time Tick Marks // - p->setFont(QFont("Helvetica",8,QFont::Normal)); + p->setFont(subLabelFont()); for(unsigned i=0;i<2*edit_peaks->energySize(); i+=(int)(edit_factor_x*(double)edit_sample_rate/576.0)) { offset=(int)((double)(i-origin_x)/edit_factor_x); @@ -2809,14 +2809,14 @@ void RDEditAudio::DrawWave(int xsize,int ysize,int chan,QString label, p->setPen(QColor(Qt::red)); if(!label.isEmpty()) { - p->setFont(QFont("Helvetica",24,QFont::Normal)); + p->setFont(bannerFont()); p->drawText(10,28-ysize/2,label); } p->setPen(QColor(Qt::black)); p->drawLine(0,0,xsize-3,0); } else { - p->setFont(QFont("Helvetica",24,QFont::Bold)); + p->setFont(bannerFont()); p->drawText(270,0,"No Energy Data"); } delete p; diff --git a/lib/rdexception_dialog.cpp b/lib/rdexception_dialog.cpp deleted file mode 100644 index 40712f72..00000000 --- a/lib/rdexception_dialog.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// rdexception_dialog.cpp -// -// A dialog for displaying exception reports. -// -// (C) Copyright 2002-2005,2016 Fred Gleason -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2 as -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#include -#include -#include - -#include -#include - - -RDExceptionDialog::RDExceptionDialog(QString report,QWidget *parent) - : QDialog(parent,"",true) -{ - setCaption(tr("Rivendell Exception Report")); - - // - // Generate Fonts - // - QFont button_font("helvetica",12,QFont::Bold); - button_font.setPixelSize(12); - - // - // Report Viewer - // - report_view=new Q3TextView(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())); -} - - -RDExceptionDialog::~RDExceptionDialog() -{ -} - - -QSize RDExceptionDialog::sizeHint() const -{ - return QSize(400,300); -} - - -QSizePolicy RDExceptionDialog::sizePolicy() const -{ - return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); -} - - -void RDExceptionDialog::saveData() -{ - QString str1; - QString str2; - QString filename=Q3FileDialog::getSaveFileName(RDGetHomeDir(), - tr("Text (*.txt *.TXT)\nAll Files (*.*)"), - this,tr("Export File")); - if(filename.isEmpty()) { - return; - } - if(filename.find(".")<0) { - filename+=".txt"; - } - QFile file(filename); - if(file.exists()) { - str1=QString(tr("The file")); - str2=QString(tr("already exists!\nOverwrite?")); - if(QMessageBox::question(this,tr("File Exists"), - tr("The file")+" \""+filename+"\" "+ - tr("already exists!")+"\n"+tr("Overwrite?"), - QMessageBox::Yes,QMessageBox::No)== - QMessageBox::No) { - return; - } - } - FILE *fh=fopen((const char *)filename,"w"); - if(fh==NULL) { - str1=QString(tr("Unable to open file")); - str2=QString(tr("for writing!")); - QMessageBox:: - warning(this,tr("File Error"),tr("Unable to open file")+ - " \""+filename+"\" "+tr("for writing!")); - return; - } - fprintf(fh,(const char *)report_view->text()); - fclose(fh); -} - - -void RDExceptionDialog::closeData() -{ - done(0); -} diff --git a/lib/rdexception_dialog.h b/lib/rdexception_dialog.h deleted file mode 100644 index 58b2046f..00000000 --- a/lib/rdexception_dialog.h +++ /dev/null @@ -1,45 +0,0 @@ -// rdexception_dialog.h -// -// A dialog for displaying exception reports. -// -// (C) Copyright 2002-2005,2016 Fred Gleason -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2 as -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#ifndef RDEXCEPTION_DIALOG_H -#define RDEXCEPTION_DIALOG_H - -#include -#include - -class RDExceptionDialog : public QDialog -{ - Q_OBJECT - public: - RDExceptionDialog(QString report,QWidget *parent=0); - ~RDExceptionDialog(); - QSize sizeHint() const; - QSizePolicy sizePolicy() const; - - private slots: - void saveData(); - void closeData(); - - private: - Q3TextView *report_view; -}; - - -#endif diff --git a/lib/rdexport_settings_dialog.cpp b/lib/rdexport_settings_dialog.cpp index 75ccc351..a8cd73cc 100644 --- a/lib/rdexport_settings_dialog.cpp +++ b/lib/rdexport_settings_dialog.cpp @@ -2,7 +2,7 @@ // // Edit Audio Export Settings // -// (C) Copyright 2002-2018 Fred Gleason +// (C) Copyright 2002-2019 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -18,35 +18,20 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#include - -#include -#include -#include -#include #include -//Added by qt3to4: -#include -#include "rdapplication.h" #include "rdexport_settings_dialog.h" RDExportSettingsDialog::RDExportSettingsDialog(RDSettings *settings, QWidget *parent) - : QDialog(parent,"",true) + : RDDialog(parent) { lib_settings=settings; - // - // Generate Fonts - // - QFont button_font("helvetica",12,QFont::Bold); - button_font.setPixelSize(12); - // // Dialog Name // - setCaption(tr("Edit Export Settings")); + setWindowTitle(tr("Edit Export Settings")); // // Default Format @@ -108,7 +93,7 @@ RDExportSettingsDialog::RDExportSettingsDialog(RDSettings *settings, QPushButton *ok_button=new QPushButton(this); ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50); ok_button->setDefault(true); - ok_button->setFont(button_font); + ok_button->setFont(buttonFont()); ok_button->setText(tr("&OK")); connect(ok_button,SIGNAL(clicked()),this,SLOT(okData())); @@ -118,7 +103,7 @@ RDExportSettingsDialog::RDExportSettingsDialog(RDSettings *settings, QPushButton *cancel_button=new QPushButton(this); cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60, 80,50); - cancel_button->setFont(button_font); + cancel_button->setFont(buttonFont()); cancel_button->setText(tr("&Cancel")); connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData())); diff --git a/lib/rdexport_settings_dialog.h b/lib/rdexport_settings_dialog.h index f2cec1d8..8250af55 100644 --- a/lib/rdexport_settings_dialog.h +++ b/lib/rdexport_settings_dialog.h @@ -2,7 +2,7 @@ // // Edit Rivendell Audio Settings // -// (C) Copyright 2002-2018 Fred Gleason +// (C) Copyright 2002-2019 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -21,15 +21,14 @@ #ifndef RDEXPORT_SETTINGS_DIALOG_H #define RDEXPORT_SETTINGS_DIALOG_H -#include -#include #include -#include #include +#include +#include #include -class RDExportSettingsDialog : public QDialog +class RDExportSettingsDialog : public RDDialog { Q_OBJECT public: diff --git a/lib/rdfontset.cpp b/lib/rdfontset.cpp index 440bfef4..10341101 100644 --- a/lib/rdfontset.cpp +++ b/lib/rdfontset.cpp @@ -53,6 +53,12 @@ QFont RDFontSet::buttonFont() const } +QFont RDFontSet::hugeButtonFont() const +{ + return font_huge_button_font; +} + + QFont RDFontSet::bigButtonFont() const { return font_big_button_font; @@ -101,6 +107,12 @@ QFont RDFontSet::timerFont() const } +QFont RDFontSet::smallTimerFont() const +{ + return font_small_timer_font; +} + + QFont RDFontSet::defaultFont() const { return font_default_font; @@ -130,6 +142,9 @@ void RDFontSet::MakeFonts(const QFont &default_font) font_button_font=QFont(family,button_size,QFont::Bold); font_button_font.setPixelSize(button_size); + font_huge_button_font=QFont(family,button_size+24,QFont::DemiBold); + font_huge_button_font.setPixelSize(button_size+24); + font_big_button_font=QFont(family,button_size+4,QFont::DemiBold); font_big_button_font.setPixelSize(button_size+4); @@ -154,6 +169,9 @@ void RDFontSet::MakeFonts(const QFont &default_font) font_timer_font=QFont(family,20,QFont::Normal); font_timer_font.setPixelSize(20); + font_small_timer_font=QFont(family,default_size+2,QFont::Normal); + font_small_timer_font.setPixelSize(default_size+2); + font_default_font=QFont(family,default_size,QFont::Normal); font_default_font.setPixelSize(default_size); } diff --git a/lib/rdfontset.h b/lib/rdfontset.h index ec6a43ac..a40d7c1f 100644 --- a/lib/rdfontset.h +++ b/lib/rdfontset.h @@ -31,6 +31,7 @@ class RDFontSet RDFontSet(const QFont &default_font,RDConfig *c=NULL); RDFontSet(RDConfig *c=NULL); QFont buttonFont() const; + QFont hugeButtonFont() const; QFont bigButtonFont() const; QFont subButtonFont() const; QFont sectionLabelFont() const; @@ -39,11 +40,13 @@ class RDFontSet QFont progressFont() const; QFont bannerFont() const; QFont timerFont() const; + QFont smallTimerFont() const; QFont defaultFont() const; private: void MakeFonts(const QFont &default_font); QFont font_button_font; + QFont font_huge_button_font; QFont font_big_button_font; QFont font_sub_button_font; QFont font_section_label_font; @@ -52,6 +55,7 @@ class RDFontSet QFont font_progress_font; QFont font_banner_font; QFont font_timer_font; + QFont font_small_timer_font; QFont font_default_font; RDConfig *font_config; }; diff --git a/lib/rdintegerdialog.cpp b/lib/rdintegerdialog.cpp deleted file mode 100644 index 74941d3b..00000000 --- a/lib/rdintegerdialog.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// rdintegerdialog.cpp -// -// A widget to set an integer value. -// -// (C) Copyright 2008,2016 Fred Gleason -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2 as -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#include -#include -//Added by qt3to4: -#include - -#include - -RDIntegerDialog::RDIntegerDialog(int *value,const QString &lbl,int low,int high, - QWidget *parent) - : QDialog(parent,"",false) -{ - int_value=value; - - // - // Fix the Window Size - // - setCaption(tr("Set Value")); - setMinimumWidth(sizeHint().width()); - setMaximumWidth(sizeHint().width()); - setMinimumHeight(sizeHint().height()); - setMaximumHeight(sizeHint().height()); - - // - // Generate Fonts - // - QFont font=QFont("helvetica",12,QFont::Bold); - font.setPixelSize(12); - - // - // Value Control - // - int_value_box=new QSpinBox(this); - int_value_box->setGeometry(125,10,80,20); - int_value_box->setRange(low,high); - int_value_box->setValue(*value); - QLabel *label=new QLabel(int_value_box,lbl,this); - label->setGeometry(10,10,110,20); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - // - // OK Button - // - QPushButton *button=new QPushButton(tr("&OK"),this); - button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50); - button->setFont(font); - connect(button,SIGNAL(clicked()),this,SLOT(okData())); - - // - // Cancel Button - // - button=new QPushButton(tr("&Cancel"),this); - button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50); - button->setFont(font); - connect(button,SIGNAL(clicked()),this,SLOT(cancelData())); -} - - -RDIntegerDialog::~RDIntegerDialog() -{ -} - - -QSize RDIntegerDialog::sizeHint() const -{ - return QSize(240,100); -} - - -QSizePolicy RDIntegerDialog::sizePolicy() const -{ - return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); -} - - -void RDIntegerDialog::okData() -{ - *int_value=int_value_box->value(); - done(0); -} - - -void RDIntegerDialog::cancelData() -{ - done(-1); -} - - -void RDIntegerDialog::closeEvent(QCloseEvent *e) -{ - done(-1); -} diff --git a/lib/rdintegerdialog.h b/lib/rdintegerdialog.h deleted file mode 100644 index 170507e6..00000000 --- a/lib/rdintegerdialog.h +++ /dev/null @@ -1,52 +0,0 @@ -// rdintegerdialog.h -// -// A widget to set an integer value. -// -// (C) Copyright 2008,2016 Fred Gleason -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2 as -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#ifndef RDINTEGERDIALOG_H -#define RDINTEGERDIALOG_H - -#include -#include -//Added by qt3to4: -#include - -class RDIntegerDialog : public QDialog -{ - Q_OBJECT - public: - RDIntegerDialog(int *value,const QString &lbl,int low,int high, - QWidget *parent=0); - ~RDIntegerDialog(); - QSize sizeHint() const; - QSizePolicy sizePolicy() const; - - private slots: - void okData(); - void cancelData(); - - protected: - void closeEvent(QCloseEvent *e); - - private: - QSpinBox *int_value_box; - int *int_value; -}; - - -#endif diff --git a/lib/rdintegeredit.cpp b/lib/rdintegeredit.cpp deleted file mode 100644 index b4078e74..00000000 --- a/lib/rdintegeredit.cpp +++ /dev/null @@ -1,143 +0,0 @@ -// rdintegeredit.cpp -// -// A widget for editing a list of integer values. -// -// (C) Copyright 2008-2019 Fred Gleason -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU Library General Public License -// version 2 as published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#include "rdintegerdialog.h" -#include "rdintegeredit.h" - -RDIntegerEdit::RDIntegerEdit(const QString &lbl,int low,int high, - QWidget *parent) - : RDWidget(parent) -{ - edit_low=low; - edit_high=high; - - setWindowTitle(tr("Set Value")); - - // - // Values List - // - edit_values_box=new Q3ListBox(this); - - // - // Title Label - // - edit_label=new QLabel(edit_values_box,lbl,this); - edit_label->setAlignment(Qt::AlignCenter); - edit_label->setFont(labelFont()); - - // - // Add Button - // - edit_add_button=new QPushButton(tr("Add"),this); - edit_add_button->setFont(buttonFont()); - connect(edit_add_button,SIGNAL(clicked()),this,SLOT(addData())); - - // - // Delete Button - // - edit_delete_button=new QPushButton(tr("Delete"),this); - edit_delete_button->setFont(buttonFont()); - connect(edit_delete_button,SIGNAL(clicked()),this,SLOT(deleteData())); -} - - -QSize RDIntegerEdit::sizeHint() const -{ - return QSize(300,100); -} - - -QSizePolicy RDIntegerEdit::sizePolicy() const -{ - return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); -} - - -unsigned RDIntegerEdit::values(std::vector *v) const -{ - v->clear(); - for(int i=0;inumRows();i++) { - v->push_back(edit_values_box->text(i).toInt()); - } - return v->size(); -} - - -void RDIntegerEdit::setValues(std::vector *v) -{ - for(unsigned i=0;isize();i++) { - edit_values_box->insertItem(QString().sprintf("%d",v->at(i))); - } -} - - -void RDIntegerEdit::setGeometry(int x,int y,int w,int h) -{ - QWidget::setGeometry(x,y,w,h); - edit_label->setGeometry(0,0,width(),20); - edit_values_box->setGeometry(0,20,width(),height()-60); - edit_add_button->setGeometry(0,height()-35,width()/2-5,30); - edit_delete_button->setGeometry(width()/2+5,height()-35,width()/2-5,30); -} - - -void RDIntegerEdit::addData() -{ - int value=edit_low; - int index=-1; - - RDIntegerDialog *ie= - new RDIntegerDialog(&value,edit_label->text(),edit_low,edit_high,this); - if(ie->exec()==0) { - for(unsigned i=0;icount();i++) { - if(edit_values_box->item(i)->text().toInt()item(i)->text().toInt()==value) { - delete ie; - return; - } - } - edit_values_box->insertItem(QString().sprintf("%d",value),index+1); - } - delete ie; -} - - -void RDIntegerEdit::deleteData() -{ - Q3ListBoxItem *item=edit_values_box->selectedItem(); - if(item==NULL) { - return; - } - delete item; -} - - -Q3ListBoxItem *RDIntegerEdit::GetItem(int value) -{ - for(unsigned i=0;icount();i++) { - if(edit_values_box->item(i)->text().toInt()==value) { - return edit_values_box->item(i); - } - } - - return NULL; -} diff --git a/lib/rdintegeredit.h b/lib/rdintegeredit.h deleted file mode 100644 index 5de47387..00000000 --- a/lib/rdintegeredit.h +++ /dev/null @@ -1,59 +0,0 @@ -// rdintegeredit.h -// -// A widget for editing a list of integer values. -// -// (C) Copyright 2008-2019 Fred Gleason -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU Library General Public License -// version 2 as published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#ifndef RDINTEGEREDIT_H -#define RDINTEGEREDIT_H - -#include - -#include -#include - -#include - -class RDIntegerEdit : public RDWidget -{ - Q_OBJECT - public: - RDIntegerEdit(const QString &lbl,int low,int high,QWidget *parent); - QSize sizeHint() const; - QSizePolicy sizePolicy() const; - unsigned values(std::vector *v) const; - void setValues(std::vector *v); - - public slots: - void setGeometry(int x,int y,int w,int h); - - private slots: - void addData(); - void deleteData(); - - private: - Q3ListBoxItem *GetItem(int value); - QLabel *edit_label; - Q3ListBox *edit_values_box; - QPushButton *edit_add_button; - QPushButton *edit_delete_button; - int edit_low; - int edit_high; -}; - - -#endif // RDINTEGEREDIT_H diff --git a/lib/rdlistsvcs.cpp b/lib/rdlistsvcs.cpp index 96f12d88..8c59c53c 100644 --- a/lib/rdlistsvcs.cpp +++ b/lib/rdlistsvcs.cpp @@ -2,7 +2,7 @@ // // Service Picker dialog // -// (C) Copyright 2012,2016 Fred Gleason +// (C) Copyright 2012-2019 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -18,36 +18,19 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#include -//Added by qt3to4: -#include - -#include -#include -#include -#include -#include - #include "rdlistsvcs.h" RDListSvcs::RDListSvcs(const QString &caption,QWidget *parent) - : QDialog(parent) + : RDDialog(parent) { edit_caption=caption; // // Fix the Window Size // - setMinimumWidth(sizeHint().width()); - setMinimumHeight(sizeHint().height()); + setMinimumSize(sizeHint()); - setCaption(caption+" - "+tr("Rivendell Services")); - - // - // Fonts - // - QFont label_font("helvetica",12,QFont::Bold); - label_font.setPixelSize(12); + setWindowTitle(caption+" - "+tr("Rivendell Services")); // // Services @@ -61,7 +44,7 @@ RDListSvcs::RDListSvcs(const QString &caption,QWidget *parent) // edit_ok_button=new QPushButton(this); edit_ok_button->setDefault(true); - edit_ok_button->setFont(label_font); + edit_ok_button->setFont(buttonFont()); edit_ok_button->setText(tr("&OK")); connect(edit_ok_button,SIGNAL(clicked()),this,SLOT(okData())); @@ -69,7 +52,7 @@ RDListSvcs::RDListSvcs(const QString &caption,QWidget *parent) // Cancel Button // edit_cancel_button=new QPushButton(this); - edit_cancel_button->setFont(label_font); + edit_cancel_button->setFont(buttonFont()); edit_cancel_button->setText(tr("&Cancel")); connect(edit_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData())); } diff --git a/lib/rdlistsvcs.h b/lib/rdlistsvcs.h index 3b91288b..b5222a60 100644 --- a/lib/rdlistsvcs.h +++ b/lib/rdlistsvcs.h @@ -21,13 +21,12 @@ #ifndef RDLISTSVCS_H #define RDLISTSVCS_H -#include #include #include -//Added by qt3to4: -#include -class RDListSvcs : public QDialog +#include + +class RDListSvcs : public RDDialog { Q_OBJECT public: diff --git a/lib/rdpanel_button.cpp b/lib/rdpanel_button.cpp index 6e3d9e21..0ec927df 100644 --- a/lib/rdpanel_button.cpp +++ b/lib/rdpanel_button.cpp @@ -2,7 +2,7 @@ // // The SoundPanel Button for RDAirPlay. // -// (C) Copyright 2002-2004,2016 Fred Gleason +// (C) Copyright 2002-2019 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -18,21 +18,17 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#include -#include -#include #include -#include -#include -#include -#include #include +#include + +#include "rdpanel_button.h" RDPanelButton::RDPanelButton(int row,int col,RDStation *station,bool flash, QWidget *parent) - : QPushButton(parent) + : RDPushButton(parent) { button_row=row; button_col=col; @@ -432,10 +428,8 @@ void RDPanelButton::WriteKeycap(int secs) // // Button Title // - QFont font("helvetica",13,QFont::Normal); - font.setPixelSize(13); - QFontMetrics m(font); - p->setFont(font); + QFontMetrics m(buttonFont()); + p->setFont(buttonFont()); p->drawText(RDPANEL_BUTTON_MARGIN,m.lineSpacing(), GetNextLine(&text,m,size().width()-2-3*RDPANEL_BUTTON_MARGIN)); p->drawText(RDPANEL_BUTTON_MARGIN,2*m.lineSpacing(), @@ -448,9 +442,7 @@ void RDPanelButton::WriteKeycap(int secs) // if(!button_text.isEmpty()) { if(secs<0) { - QFont out_font("helvetica",13,QFont::Normal); - out_font.setPixelSize(13); - p->setFont(out_font); + p->setFont(smallTimerFont()); if(button_pause_when_finished) { p->drawText(RDPANEL_BUTTON_MARGIN,size().height()-2-RDPANEL_BUTTON_MARGIN,"Finished"); } @@ -469,19 +461,15 @@ void RDPanelButton::WriteKeycap(int secs) else { if(secs>8) { p->drawText(RDPANEL_BUTTON_MARGIN,size().height()-2-RDPANEL_BUTTON_MARGIN, - RDGetTimeLength(1000*(secs+1),true,false)); - } + RDGetTimeLength(1000*(secs+1),true,false)); + } else { - QFont out_font("helvetica",18,QFont::Bold); - out_font.setPixelSize(18); - p->setFont(out_font); + p->setFont(timerFont()); QString secstr=QString().sprintf(":%d",secs+1); p->drawText(RDPANEL_BUTTON_MARGIN,size().height()-2-RDPANEL_BUTTON_MARGIN,secstr); } - QFont out_font("helvetica",18,QFont::Bold); - out_font.setPixelSize(18); - p->setFont(out_font); - QFontMetrics om(out_font); + p->setFont(bannerFont()); + QFontMetrics om(timerFont()); p->drawText(size().width()-2-om.width(button_output_text)- RDPANEL_BUTTON_MARGIN, size().height()-2-RDPANEL_BUTTON_MARGIN,button_output_text); diff --git a/lib/rdpanel_button.h b/lib/rdpanel_button.h index 541d06c5..cb97dfff 100644 --- a/lib/rdpanel_button.h +++ b/lib/rdpanel_button.h @@ -2,7 +2,7 @@ // // The SoundPanel Button for RDAirPlay. // -// (C) Copyright 2002-2003,2016 Fred Gleason +// (C) Copyright 2002-2019 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -21,26 +21,12 @@ #ifndef RDPANEL_BUTTON_H #define RDPANEL_BUTTON_H -#include -#include -#include -#include -#include -//Added by qt3to4: -#include -#include -#include -#include - -#include -#include +#include #include -#include -#include #define RDPANEL_BUTTON_MARGIN 5 -class RDPanelButton : public QPushButton +class RDPanelButton : public RDPushButton { Q_OBJECT public: diff --git a/lib/rdplaymeter.cpp b/lib/rdplaymeter.cpp index dc16357e..526ba1f7 100644 --- a/lib/rdplaymeter.cpp +++ b/lib/rdplaymeter.cpp @@ -3,7 +3,7 @@ // This implements a widget that represents a stereo audio level meter, // complete with labels and scale. // -// (C) Copyright 2002-2018 Fred Gleason +// (C) Copyright 2002-2019 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU Library General Public License @@ -19,19 +19,10 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#include - -#include -#include -#include -#include -#include -#include - #include "rdplaymeter.h" RDPlayMeter::RDPlayMeter(RDSegMeter::Orientation orient,QWidget *parent) - : QWidget(parent) + : RDWidget(parent) { meter_label=QString(""); orientation=orient; @@ -132,22 +123,22 @@ void RDPlayMeter::setGeometry(int x,int y,int w,int h) switch(orientation) { case RDSegMeter::Left: meter->setGeometry(2,2,w-4-h,h-4); - label_font=QFont("helvetica",height()-2,QFont::Bold); + label_font=QFont(font().family(),height()-2,QFont::Bold); label_font.setPixelSize(height()-2); break; case RDSegMeter::Right: meter->setGeometry(2+h,2,w-4-h,h-4); - label_font=QFont("helvetica",height()-2,QFont::Bold); + label_font=QFont(font().family(),height()-2,QFont::Bold); label_font.setPixelSize(height()-2); break; case RDSegMeter::Up: meter->setGeometry(2,2,w-4,h-4-w); - label_font=QFont("helvetica",width()-2,QFont::Bold); + label_font=QFont(font().family(),width()-2,QFont::Bold); label_font.setPixelSize(width()-2); break; case RDSegMeter::Down: meter->setGeometry(2,2+width(),w-4,h-4-w); - label_font=QFont("helvetica",width()-2,QFont::Bold); + label_font=QFont(font().family(),width()-2,QFont::Bold); label_font.setPixelSize(width()-2); break; } @@ -241,25 +232,25 @@ void RDPlayMeter::makeFont() { switch(orientation) { case RDSegMeter::Left: - label_font=QFont("helvetica",height()-2,QFont::Bold); + label_font=QFont(font().family(),height()-2,QFont::Bold); label_font.setPixelSize(height()-2); meter_label_x=(height()-QFontMetrics(label_font).width(meter_label))/2; break; case RDSegMeter::Right: - label_font=QFont("helvetica",height()-2,QFont::Bold); + label_font=QFont(font().family(),height()-2,QFont::Bold); label_font.setPixelSize(height()-2); meter_label_x=(height()-QFontMetrics(label_font).width(meter_label))/2; break; case RDSegMeter::Up: - label_font=QFont("helvetica",width()-2,QFont::Bold); + label_font=QFont(font().family(),width()-2,QFont::Bold); label_font.setPixelSize(width()-2); meter_label_x=(width()-QFontMetrics(label_font).width(meter_label))/2; break; case RDSegMeter::Down: - label_font=QFont("helvetica",width()-2,QFont::Bold); + label_font=QFont(font().family(),width()-2,QFont::Bold); label_font.setPixelSize(width()-2); meter_label_x=(width()-QFontMetrics(label_font).width(meter_label))/2; break; diff --git a/lib/rdplaymeter.h b/lib/rdplaymeter.h index aafb6a4c..9efe6332 100644 --- a/lib/rdplaymeter.h +++ b/lib/rdplaymeter.h @@ -2,7 +2,7 @@ // // A playback audio meter widget. // -// (C) Copyright 2002-2018 Fred Gleason +// (C) Copyright 2002-2019 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU Library General Public License @@ -21,17 +21,10 @@ #ifndef RDPLAYMETER_H #define RDPLAYMETER_H -#include -#include -#include -#include -#include -#include -#include - #include +#include -class RDPlayMeter : public QWidget +class RDPlayMeter : public RDWidget { Q_OBJECT public: diff --git a/lib/rdwavedata_dialog.cpp b/lib/rdwavedata_dialog.cpp index 360c5a6c..94ce3431 100644 --- a/lib/rdwavedata_dialog.cpp +++ b/lib/rdwavedata_dialog.cpp @@ -2,7 +2,7 @@ // // A dialog to edit the contents of an RDWaveData. // -// (C) Copyright 2014,2016 Fred Gleason +// (C) Copyright 2014-2019 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -18,25 +18,14 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#include -//Added by qt3to4: -#include -#include -#include - #include "rdwavedata_dialog.h" RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) - : QDialog(parent,"",true) + : RDDialog(parent) { wave_caption=caption; - setCaption(caption+" - "+tr("Edit Cart Label")); - // - // Fonts - // - QFont label_font("helvetica",12,QFont::Bold); - label_font.setPixelSize(12); + setWindowTitle(caption+" - "+tr("Edit Cart Label")); // // Dialogs @@ -47,7 +36,7 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // Title // wave_title_label=new QLabel(tr("Title")+":",this); - wave_title_label->setFont(label_font); + wave_title_label->setFont(labelFont()); wave_title_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); wave_title_edit=new QLineEdit(this); wave_title_edit->setMaxLength(255); @@ -56,7 +45,7 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // Artist // wave_artist_label=new QLabel(tr("Artist")+":",this); - wave_artist_label->setFont(label_font); + wave_artist_label->setFont(labelFont()); wave_artist_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); wave_artist_edit=new QLineEdit(this); wave_artist_edit->setMaxLength(255); @@ -65,7 +54,7 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // Year // wave_year_label=new QLabel(tr("Year")+":",this); - wave_year_label->setFont(label_font); + wave_year_label->setFont(labelFont()); wave_year_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); wave_year_edit=new QLineEdit(this); wave_year_edit->setMaxLength(4); @@ -75,7 +64,7 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // Usage // wave_usage_label=new QLabel(tr("Usage")+":",this); - wave_usage_label->setFont(label_font); + wave_usage_label->setFont(labelFont()); wave_usage_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); wave_usage_box=new QComboBox(this); for(int i=0;i<(int)RDCart::UsageLast;i++) { @@ -86,14 +75,14 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // Scheduler Codes // wave_sched_button=new QPushButton(tr("Scheduler Codes"),this); - wave_sched_button->setFont(label_font); + wave_sched_button->setFont(buttonFont()); connect(wave_sched_button,SIGNAL(clicked()),this,SLOT(schedClickedData())); // // Song ID // wave_songid_label=new QLabel(tr("Song ID")+":",this); - wave_songid_label->setFont(label_font); + wave_songid_label->setFont(labelFont()); wave_songid_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); wave_songid_edit=new QLineEdit(this); wave_songid_edit->setMaxLength(32); @@ -102,7 +91,7 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // Beats Per Minute // wave_bpm_label=new QLabel(tr("Beats per Minute")+":",this); - wave_bpm_label->setFont(label_font); + wave_bpm_label->setFont(labelFont()); wave_bpm_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); wave_bpm_spin=new QSpinBox(this); wave_bpm_spin->setRange(0,300); @@ -112,7 +101,7 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // Album // wave_album_label=new QLabel(tr("Album")+":",this); - wave_album_label->setFont(label_font); + wave_album_label->setFont(labelFont()); wave_album_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); wave_album_edit=new QLineEdit(this); wave_album_edit->setMaxLength(255); @@ -121,7 +110,7 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // Label // wave_label_label=new QLabel(tr("Label")+":",this); - wave_label_label->setFont(label_font); + wave_label_label->setFont(labelFont()); wave_label_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); wave_label_edit=new QLineEdit(this); wave_label_edit->setMaxLength(64); @@ -130,7 +119,7 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // Client // wave_client_label=new QLabel(tr("Client")+":",this); - wave_client_label->setFont(label_font); + wave_client_label->setFont(labelFont()); wave_client_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); wave_client_edit=new QLineEdit(this); wave_client_edit->setMaxLength(64); @@ -139,7 +128,7 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // Agency // wave_agency_label=new QLabel(tr("Agency")+":",this); - wave_agency_label->setFont(label_font); + wave_agency_label->setFont(labelFont()); wave_agency_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); wave_agency_edit=new QLineEdit(this); wave_agency_edit->setMaxLength(64); @@ -148,7 +137,7 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // Publisher // wave_publisher_label=new QLabel(tr("Publisher")+":",this); - wave_publisher_label->setFont(label_font); + wave_publisher_label->setFont(labelFont()); wave_publisher_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); wave_publisher_edit=new QLineEdit(this); wave_publisher_edit->setMaxLength(64); @@ -157,7 +146,7 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // Composer // wave_composer_label=new QLabel(tr("Composer")+":",this); - wave_composer_label->setFont(label_font); + wave_composer_label->setFont(labelFont()); wave_composer_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); wave_composer_edit=new QLineEdit(this); wave_composer_edit->setMaxLength(64); @@ -166,7 +155,7 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // Conductor // wave_conductor_label=new QLabel(tr("Conductor")+":",this); - wave_conductor_label->setFont(label_font); + wave_conductor_label->setFont(labelFont()); wave_conductor_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); wave_conductor_edit=new QLineEdit(this); wave_conductor_edit->setMaxLength(64); @@ -175,7 +164,7 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // User Defined // wave_userdef_label=new QLabel(tr("User Defined")+":",this); - wave_userdef_label->setFont(label_font); + wave_userdef_label->setFont(labelFont()); wave_userdef_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); wave_userdef_edit=new QLineEdit(this); wave_userdef_edit->setMaxLength(255); @@ -184,14 +173,14 @@ RDWaveDataDialog::RDWaveDataDialog(const QString &caption,QWidget *parent) // OK Button // wave_ok_button=new QPushButton(tr("OK"),this); - wave_ok_button->setFont(label_font); + wave_ok_button->setFont(buttonFont()); connect(wave_ok_button,SIGNAL(clicked()),this,SLOT(okData())); // // Cancel Button // wave_cancel_button=new QPushButton(tr("Cancel"),this); - wave_cancel_button->setFont(label_font); + wave_cancel_button->setFont(buttonFont()); connect(wave_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData())); } diff --git a/lib/rdwavedata_dialog.h b/lib/rdwavedata_dialog.h index 6cf6b5bf..c4306531 100644 --- a/lib/rdwavedata_dialog.h +++ b/lib/rdwavedata_dialog.h @@ -2,7 +2,7 @@ // // A dialog to edit the contents of an RDWaveData. // -// (C) Copyright 2014,2016 Fred Gleason +// (C) Copyright 2014-2019 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -21,21 +21,14 @@ #ifndef RDWAVEDATA_DIALOG_H #define RDWAVEDATA_DIALOG_H -#include #include -#include -#include -#include #include -//Added by qt3to4: -#include -#include #include -#include +#include #include -class RDWaveDataDialog : public QDialog +class RDWaveDataDialog : public RDDialog { Q_OBJECT public: