diff --git a/ChangeLog b/ChangeLog index 7d2bce90..583e509b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20949,3 +20949,6 @@ * Added 'RDVguestResourceListModel'. * Refactored the 'vGuest Switches'/'vGuest Displays' dialogs in rdadmin(1) to use the model-based API. +2021-01-31 Fred Gleason + * Renamed the 'RDVguestResourceListModel' model class to + 'RDResourceListModel'. diff --git a/lib/Makefile.am b/lib/Makefile.am index c7ae6187..e7ff5526 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -216,6 +216,7 @@ dist_librd_la_SOURCES = dbversion.h\ rdreplicator.cpp rdreplicator.h\ rdreplicatorlistmodel.cpp rdreplicatorlistmodel.h\ rdreport.cpp rdreport.h\ + rdresourcelistmodel.cpp rdresourcelistmodel.h\ rdringbuffer.cpp rdringbuffer.h\ rdripc.cpp rdripc.h\ rdrssschemas.cpp rdrssschemas.h\ @@ -265,7 +266,6 @@ dist_librd_la_SOURCES = dbversion.h\ rduser.cpp rduser.h\ rduserlistmodel.cpp rduserlistmodel.h\ rdversion.cpp rdversion.h\ - rdvguestresourcelistmodel.cpp rdvguestresourcelistmodel.h\ rdwavedata.cpp rdwavedata.h\ rdwavedata_dialog.cpp rdwavedata_dialog.h\ rdwavefile.cpp rdwavefile.h\ @@ -367,6 +367,7 @@ nodist_librd_la_SOURCES = moc_rd3emptycart.cpp\ moc_rdrehash.cpp\ moc_rdrenderer.cpp\ moc_rdreplicatorlistmodel.cpp\ + moc_rdresourcelistmodel.cpp\ moc_rdripc.cpp\ moc_rdschedcodes_dialog.cpp\ moc_rdrsscategorybox.cpp\ @@ -393,7 +394,6 @@ nodist_librd_la_SOURCES = moc_rd3emptycart.cpp\ moc_rdunixsocket.cpp\ moc_rduserlistmodel.cpp\ moc_rdupload.cpp\ - moc_rdvguestresourcelistmodel.cpp\ moc_rdwavedata_dialog.cpp\ moc_rdwidget.cpp diff --git a/lib/lib.pro b/lib/lib.pro index 15795629..199e09e8 100644 --- a/lib/lib.pro +++ b/lib/lib.pro @@ -160,6 +160,7 @@ SOURCES += rdrehash.cpp SOURCES += rdrenderer.cpp SOURCES += rdreplicatorlistmodel.cpp SOURCES += rdreport.cpp +SOURCES += rdresourcelistmodel.cpp SOURCES += rdripc.cpp SOURCES += rdrssschemas.cpp SOURCES += rdrsscategorybox.cpp @@ -193,7 +194,6 @@ SOURCES += rdttyout.cpp SOURCES += rduser.cpp SOURCES += rduserlistmodel.cpp SOURCES += rdversion.cpp -SOURCES += rdvguestresourcelistmodel.cpp SOURCES += rdwavedata.cpp SOURCES += rdwavefile.cpp SOURCES += rdweb.cpp @@ -328,6 +328,7 @@ HEADERS += rdrehash.h HEADERS += rdrenderer.h HEADERS += rdreplicatorlistmodel.h HEADERS += rdreport.h +HEADERS += rdresourcelistmodel.h HEADERS += rdripc.h HEADERS += rdrssschemas.h HEADERS += rdrsscategorybox.h @@ -362,7 +363,6 @@ HEADERS += rdttyout.h HEADERS += rduser.h HEADERS += rduserlistmodel.h HEADERS += rdversion.h -HEADERS += rdvguestresourcelistmodel.h HEADERS += rdwavedata.h HEADERS += rdweb.h HEADERS += rdwidget.h diff --git a/lib/librd_cs.ts b/lib/librd_cs.ts index 08c14267..cd83eb7a 100644 --- a/lib/librd_cs.ts +++ b/lib/librd_cs.ts @@ -3807,6 +3807,37 @@ Zkuste to, prosím, znovu! Music1 Reconciliation + + RDResourceListModel + + GPIO Line + + + + Engine + + + + Device (Hex) + + + + Surface + + + + Bus/Relay + + + + Display + + + + [none] + + + RDServiceListModel @@ -4078,35 +4109,4 @@ Zkuste to, prosím, znovu! - - RDVguestResourceListModel - - GPIO Line - - - - Engine - - - - Device (Hex) - - - - Surface - - - - Bus/Relay - - - - Display - - - - [none] - - - diff --git a/lib/librd_de.ts b/lib/librd_de.ts index a8c90917..f5bc0e1f 100644 --- a/lib/librd_de.ts +++ b/lib/librd_de.ts @@ -3788,6 +3788,37 @@ bitte erneut versuchen! Music1 Reconciliation + + RDResourceListModel + + GPIO Line + + + + Engine + + + + Device (Hex) + + + + Surface + + + + Bus/Relay + + + + Display + + + + [none] + + + RDServiceListModel @@ -4059,35 +4090,4 @@ bitte erneut versuchen! - - RDVguestResourceListModel - - GPIO Line - - - - Engine - - - - Device (Hex) - - - - Surface - - - - Bus/Relay - - - - Display - - - - [none] - - - diff --git a/lib/librd_es.ts b/lib/librd_es.ts index 5bb688eb..39c0930e 100644 --- a/lib/librd_es.ts +++ b/lib/librd_es.ts @@ -3767,6 +3767,37 @@ please try again! Reconciliación Music1 + + RDResourceListModel + + GPIO Line + + + + Engine + + + + Device (Hex) + + + + Surface + + + + Bus/Relay + + + + Display + + + + [none] + + + RDServiceListModel @@ -4040,35 +4071,4 @@ please try again! - - RDVguestResourceListModel - - GPIO Line - - - - Engine - - - - Device (Hex) - - - - Surface - - - - Bus/Relay - - - - Display - - - - [none] - - - diff --git a/lib/librd_fr.ts b/lib/librd_fr.ts index 8c5dfab7..729225df 100644 --- a/lib/librd_fr.ts +++ b/lib/librd_fr.ts @@ -3060,6 +3060,37 @@ please try again! + + RDResourceListModel + + GPIO Line + + + + Engine + + + + Device (Hex) + + + + Surface + + + + Bus/Relay + + + + Display + + + + [none] + + + RDServiceListModel @@ -3316,35 +3347,4 @@ please try again! - - RDVguestResourceListModel - - GPIO Line - - - - Engine - - - - Device (Hex) - - - - Surface - - - - Bus/Relay - - - - Display - - - - [none] - - - diff --git a/lib/librd_nb.ts b/lib/librd_nb.ts index fc6ad3ba..eae70965 100644 --- a/lib/librd_nb.ts +++ b/lib/librd_nb.ts @@ -3670,6 +3670,37 @@ prøv ein gong til! Greidde ikkje opna rapportfil! + + RDResourceListModel + + GPIO Line + + + + Engine + + + + Device (Hex) + + + + Surface + + + + Bus/Relay + + + + Display + + + + [none] + + + RDServiceListModel @@ -3948,35 +3979,4 @@ prøv ein gong til! - - RDVguestResourceListModel - - GPIO Line - - - - Engine - - - - Device (Hex) - - - - Surface - - - - Bus/Relay - - - - Display - - - - [none] - - - diff --git a/lib/librd_nn.ts b/lib/librd_nn.ts index fc6ad3ba..eae70965 100644 --- a/lib/librd_nn.ts +++ b/lib/librd_nn.ts @@ -3670,6 +3670,37 @@ prøv ein gong til! Greidde ikkje opna rapportfil! + + RDResourceListModel + + GPIO Line + + + + Engine + + + + Device (Hex) + + + + Surface + + + + Bus/Relay + + + + Display + + + + [none] + + + RDServiceListModel @@ -3948,35 +3979,4 @@ prøv ein gong til! - - RDVguestResourceListModel - - GPIO Line - - - - Engine - - - - Device (Hex) - - - - Surface - - - - Bus/Relay - - - - Display - - - - [none] - - - diff --git a/lib/librd_pt_BR.ts b/lib/librd_pt_BR.ts index ee56fd6d..cc7d7515 100644 --- a/lib/librd_pt_BR.ts +++ b/lib/librd_pt_BR.ts @@ -3721,6 +3721,37 @@ por favor, tente novamente! Não foi possível abrir o Relatório! + + RDResourceListModel + + GPIO Line + + + + Engine + + + + Device (Hex) + + + + Surface + + + + Bus/Relay + + + + Display + + + + [none] + + + RDServiceListModel @@ -3994,35 +4025,4 @@ por favor, tente novamente! - - RDVguestResourceListModel - - GPIO Line - - - - Engine - - - - Device (Hex) - - - - Surface - - - - Bus/Relay - - - - Display - - - - [none] - - - diff --git a/lib/rdvguestresourcelistmodel.cpp b/lib/rdresourcelistmodel.cpp similarity index 81% rename from lib/rdvguestresourcelistmodel.cpp rename to lib/rdresourcelistmodel.cpp index 2cc188be..18378152 100644 --- a/lib/rdvguestresourcelistmodel.cpp +++ b/lib/rdresourcelistmodel.cpp @@ -1,6 +1,6 @@ -// rdvguestresourcelistmodel.cpp +// rdresourcelistmodel.cpp // -// Data model for Rivendell Logitek vGuest resource settings +// Data model for Rivendell console router resource settings // // (C) Copyright 2021 Fred Gleason // @@ -21,11 +21,11 @@ #include "rdapplication.h" #include "rdescape_string.h" #include "rdmatrix.h" -#include "rdvguestresourcelistmodel.h" +#include "rdresourcelistmodel.h" -RDVguestResourceListModel::RDVguestResourceListModel(RDMatrix *mtx, - RDMatrix::VguestType type, - QObject *parent) +RDResourceListModel::RDResourceListModel(RDMatrix *mtx, + RDMatrix::VguestType type, + QObject *parent) : QAbstractTableModel(parent) { d_mtx=mtx; @@ -75,24 +75,24 @@ RDVguestResourceListModel::RDVguestResourceListModel(RDMatrix *mtx, } -RDVguestResourceListModel::~RDVguestResourceListModel() +RDResourceListModel::~RDResourceListModel() { } -QPalette RDVguestResourceListModel::palette() +QPalette RDResourceListModel::palette() { return d_palette; } -void RDVguestResourceListModel::setPalette(const QPalette &pal) +void RDResourceListModel::setPalette(const QPalette &pal) { d_palette=pal; } -void RDVguestResourceListModel::setFont(const QFont &font) +void RDResourceListModel::setFont(const QFont &font) { d_font=font; d_bold_font=font; @@ -100,19 +100,19 @@ void RDVguestResourceListModel::setFont(const QFont &font) } -int RDVguestResourceListModel::columnCount(const QModelIndex &parent) const +int RDResourceListModel::columnCount(const QModelIndex &parent) const { return d_headers.size(); } -int RDVguestResourceListModel::rowCount(const QModelIndex &parent) const +int RDResourceListModel::rowCount(const QModelIndex &parent) const { return d_texts.size(); } -QVariant RDVguestResourceListModel::headerData(int section, +QVariant RDResourceListModel::headerData(int section, Qt::Orientation orient, int role) const { @@ -123,7 +123,7 @@ QVariant RDVguestResourceListModel::headerData(int section, } -QVariant RDVguestResourceListModel::data(const QModelIndex &index,int role) const +QVariant RDResourceListModel::data(const QModelIndex &index,int role) const { QString str; int col=index.column(); @@ -164,19 +164,19 @@ QVariant RDVguestResourceListModel::data(const QModelIndex &index,int role) cons } -int RDVguestResourceListModel::resourceId(const QModelIndex &row) const +int RDResourceListModel::resourceId(const QModelIndex &row) const { return d_ids.at(row.row()); } -int RDVguestResourceListModel::resourceNumber(const QModelIndex &row) const +int RDResourceListModel::resourceNumber(const QModelIndex &row) const { return d_texts.at(row.row()).at(0).toInt(); } -void RDVguestResourceListModel::refresh(const QModelIndex &row) +void RDResourceListModel::refresh(const QModelIndex &row) { if(row.row() texts; @@ -238,7 +238,7 @@ void RDVguestResourceListModel::updateModel() } -void RDVguestResourceListModel::updateRowLine(int line) +void RDResourceListModel::updateRowLine(int line) { if(line texts; @@ -305,7 +305,7 @@ void RDVguestResourceListModel::updateRow(int row,RDSqlQuery *q) } -QString RDVguestResourceListModel::sqlFields() const +QString RDResourceListModel::sqlFields() const { QString sql=QString("select ")+ "ID,"+ // 00 diff --git a/lib/rdvguestresourcelistmodel.h b/lib/rdresourcelistmodel.h similarity index 84% rename from lib/rdvguestresourcelistmodel.h rename to lib/rdresourcelistmodel.h index 939c0d11..7c140eec 100644 --- a/lib/rdvguestresourcelistmodel.h +++ b/lib/rdresourcelistmodel.h @@ -1,6 +1,6 @@ -// rdvguestresourcelistmodel.h +// rdresourcelistmodel.h // -// Data model for Rivendell Logitek vGuest resource settings +// Data model for Rivendell console router resource settings // // (C) Copyright 2021 Fred Gleason // @@ -18,8 +18,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#ifndef RDVGUESTRESOURCELISTMODEL_H -#define RDVGUESTRESOURCELISTMODEL_H +#ifndef RDRESOURCELISTMODEL_H +#define RDRESOURCELISTMODEL_H #include #include @@ -31,13 +31,13 @@ #include #include -class RDVguestResourceListModel : public QAbstractTableModel +class RDResourceListModel : public QAbstractTableModel { Q_OBJECT public: - RDVguestResourceListModel(RDMatrix *mtx,RDMatrix::VguestType type, + RDResourceListModel(RDMatrix *mtx,RDMatrix::VguestType type, QObject *parent=0); - ~RDVguestResourceListModel(); + ~RDResourceListModel(); QPalette palette(); void setPalette(const QPalette &pal); void setFont(const QFont &font); @@ -71,4 +71,4 @@ class RDVguestResourceListModel : public QAbstractTableModel }; -#endif // RDVGUESTRESOURCELISTMODEL_H +#endif // RDRESOURCELISTMODEL_H diff --git a/rdadmin/list_vguest_resources.cpp b/rdadmin/list_vguest_resources.cpp index 32fd3dfc..59344106 100644 --- a/rdadmin/list_vguest_resources.cpp +++ b/rdadmin/list_vguest_resources.cpp @@ -63,7 +63,7 @@ ListVguestResources::ListVguestResources(RDMatrix *matrix, // Resources List Box // list_list_view=new RDTableView(this); - list_list_model=new RDVguestResourceListModel(list_matrix,type,this); + list_list_model=new RDResourceListModel(list_matrix,type,this); list_list_model->setFont(defaultFont()); list_list_model->setPalette(palette()); list_list_view->setModel(list_list_model); diff --git a/rdadmin/list_vguest_resources.h b/rdadmin/list_vguest_resources.h index 841b57c9..44b21710 100644 --- a/rdadmin/list_vguest_resources.h +++ b/rdadmin/list_vguest_resources.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "edit_vguest_resource.h" @@ -57,7 +57,7 @@ class ListVguestResources : public RDDialog RDMatrix::VguestType list_type; QLabel *list_title_label; RDTableView *list_list_view; - RDVguestResourceListModel *list_list_model; + RDResourceListModel *list_list_model; QPushButton *list_edit_button; QPushButton *list_close_button; int list_size;