2021-01-26 Fred Gleason <fredg@paravelsystems.com>

* Added 'RDTableView' and 'RDTreeView' base viewer classes.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2021-01-26 20:37:26 -05:00
parent 2ea048a80b
commit d8f526119e
50 changed files with 222 additions and 171 deletions

View File

@ -20920,3 +20920,5 @@
* Added 'RDLogImportModel'. * Added 'RDLogImportModel'.
* Refactored the 'Test Import' dialog in rdadmin(1) to use the * Refactored the 'Test Import' dialog in rdadmin(1) to use the
model-based API. model-based API.
2021-01-26 Fred Gleason <fredg@paravelsystems.com>
* Added 'RDTableView' and 'RDTreeView' base viewer classes.

View File

@ -241,6 +241,7 @@ dist_librd_la_SOURCES = dbversion.h\
rdsvc.cpp rdsvc.h\ rdsvc.cpp rdsvc.h\
rdsystem.cpp rdsystem.h\ rdsystem.cpp rdsystem.h\
rdsystemuser.cpp rdsystemuser.h\ rdsystemuser.cpp rdsystemuser.h\
rdtableview.cpp rdtableview.h\
rdtempdirectory.cpp rdtempdirectory.h\ rdtempdirectory.cpp rdtempdirectory.h\
rdtextfile.cpp rdtextfile.h\ rdtextfile.cpp rdtextfile.h\
rdtextvalidator.cpp rdtextvalidator.h\ rdtextvalidator.cpp rdtextvalidator.h\
@ -249,6 +250,7 @@ dist_librd_la_SOURCES = dbversion.h\
rdtimeevent.cpp rdtimeevent.h\ rdtimeevent.cpp rdtimeevent.h\
rdtransportbutton.cpp rdtransportbutton.h\ rdtransportbutton.cpp rdtransportbutton.h\
rdtransfer.cpp rdtransfer.h\ rdtransfer.cpp rdtransfer.h\
rdtreeview.cpp rdtreeview.h\
rdtrimaudio.cpp rdtrimaudio.h\ rdtrimaudio.cpp rdtrimaudio.h\
rdtty.cpp rdtty.h\ rdtty.cpp rdtty.h\
rdttydevice.cpp rdttydevice.h\ rdttydevice.cpp rdttydevice.h\
@ -372,10 +374,12 @@ nodist_librd_la_SOURCES = moc_rdadd_cart.cpp\
moc_rdstationlistmodel.cpp\ moc_rdstationlistmodel.cpp\
moc_rdstereometer.cpp\ moc_rdstereometer.cpp\
moc_rdsvc.cpp\ moc_rdsvc.cpp\
moc_rdtableview.cpp\
moc_rdtimeedit.cpp\ moc_rdtimeedit.cpp\
moc_rdtimeengine.cpp\ moc_rdtimeengine.cpp\
moc_rdtransfer.cpp\ moc_rdtransfer.cpp\
moc_rdtransportbutton.cpp\ moc_rdtransportbutton.cpp\
moc_rdtreeview.cpp\
moc_rdtrimaudio.cpp\ moc_rdtrimaudio.cpp\
moc_rdttydevice.cpp\ moc_rdttydevice.cpp\
moc_rdunixserver.cpp\ moc_rdunixserver.cpp\

View File

@ -176,12 +176,14 @@ SOURCES += rdstatus.cpp
SOURCES += rdstereometer.cpp SOURCES += rdstereometer.cpp
SOURCES += rdsvc.cpp SOURCES += rdsvc.cpp
SOURCES += rdsystem.cpp SOURCES += rdsystem.cpp
SOURCES += rdtableview.cpp
SOURCES += rdtempdirectory.cpp SOURCES += rdtempdirectory.cpp
SOURCES += rdtextfile.cpp SOURCES += rdtextfile.cpp
SOURCES += rdtextvalidator.cpp SOURCES += rdtextvalidator.cpp
SOURCES += rdtimeedit.cpp SOURCES += rdtimeedit.cpp
SOURCES += rdtimeengine.cpp SOURCES += rdtimeengine.cpp
SOURCES += rdtransportbutton.cpp SOURCES += rdtransportbutton.cpp
SOURCES += rdtreeview.cpp
SOURCES += rdtty.cpp SOURCES += rdtty.cpp
SOURCES += rdttydevice.cpp SOURCES += rdttydevice.cpp
SOURCES += rdttyout.cpp SOURCES += rdttyout.cpp
@ -338,6 +340,7 @@ HEADERS += rdstatus.h
HEADERS += rdstereometer.h HEADERS += rdstereometer.h
HEADERS += rdsvc.h HEADERS += rdsvc.h
HEADERS += rdsystem.h HEADERS += rdsystem.h
HEADERS += rdtableview.h
HEADERS += rdtempdirectory.h HEADERS += rdtempdirectory.h
HEADERS += rdtextfile.h HEADERS += rdtextfile.h
HEADERS += rdtextvalidator.h HEADERS += rdtextvalidator.h
@ -345,6 +348,7 @@ HEADERS += rdtimeedit.h
HEADERS += rdtimeedit.h HEADERS += rdtimeedit.h
HEADERS += rdtimeengine.h HEADERS += rdtimeengine.h
HEADERS += rdtransportbutton.h HEADERS += rdtransportbutton.h
HEADERS += rdtreeview.h
HEADERS += rdtty.h HEADERS += rdtty.h
HEADERS += rdttydevice.h HEADERS += rdttydevice.h
HEADERS += rdttyout.h HEADERS += rdttyout.h

View File

@ -86,12 +86,7 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
// //
// Cart List // Cart List
// //
cart_cart_view=new QTableView(this); cart_cart_view=new RDTableView(this);
cart_cart_view->setSelectionBehavior(QAbstractItemView::SelectRows);
cart_cart_view->setSelectionMode(QAbstractItemView::SingleSelection);
cart_cart_view->setShowGrid(false);
cart_cart_view->setSortingEnabled(false);
cart_cart_view->setWordWrap(false);
cart_cart_model=new RDLibraryModel(this); cart_cart_model=new RDLibraryModel(this);
cart_cart_model->setFont(font()); cart_cart_model->setFont(font());
cart_cart_model->setPalette(palette()); cart_cart_model->setPalette(palette());

View File

@ -27,13 +27,13 @@
#include <QProgressDialog> #include <QProgressDialog>
#include <QPushButton> #include <QPushButton>
#include <QStringList> #include <QStringList>
#include <QTableView>
#include <rdbusydialog.h> #include <rdbusydialog.h>
#include <rdcart.h> #include <rdcart.h>
#include <rddialog.h> #include <rddialog.h>
#include <rdcartfilter.h> #include <rdcartfilter.h>
#include <rdlibrarymodel.h> #include <rdlibrarymodel.h>
#include <rdtableview.h>
#include <rdsimpleplayer.h> #include <rdsimpleplayer.h>
#define RDCART_DIALOG_STEP_SIZE 1000 #define RDCART_DIALOG_STEP_SIZE 1000
@ -78,7 +78,7 @@ class RDCartDialog : public RDDialog
void SaveState(); void SaveState();
int *cart_cartnum; int *cart_cartnum;
RDCartFilter *cart_cart_filter; RDCartFilter *cart_cart_filter;
QTableView *cart_cart_view; RDTableView *cart_cart_view;
RDLibraryModel *cart_cart_model; RDLibraryModel *cart_cart_model;
QPushButton *cart_ok_button; QPushButton *cart_ok_button;
QPushButton *cart_cancel_button; QPushButton *cart_cancel_button;

View File

@ -89,7 +89,7 @@ RDCutDialog::RDCutDialog(QString *filter,QString *group,QString *schedcode,
// //
// Cart List // Cart List
// //
cart_cart_view=new QTreeView(this); cart_cart_view=new RDTreeView(this);
cart_cart_view->setSelectionBehavior(QAbstractItemView::SelectRows); cart_cart_view->setSelectionBehavior(QAbstractItemView::SelectRows);
cart_cart_view->setSelectionMode(QAbstractItemView::SingleSelection); cart_cart_view->setSelectionMode(QAbstractItemView::SingleSelection);
cart_cart_view->setSortingEnabled(false); cart_cart_view->setSortingEnabled(false);

View File

@ -27,13 +27,13 @@
#include <QProgressDialog> #include <QProgressDialog>
#include <QPushButton> #include <QPushButton>
#include <QStringList> #include <QStringList>
#include <QTreeView>
#include <rdbusydialog.h> #include <rdbusydialog.h>
#include <rdcart.h> #include <rdcart.h>
#include <rddialog.h>
#include <rdcartfilter.h> #include <rdcartfilter.h>
#include <rddialog.h>
#include <rdlibrarymodel.h> #include <rdlibrarymodel.h>
#include <rdtreeview.h>
#define RDCUT_DIALOG_STEP_SIZE 1000 #define RDCUT_DIALOG_STEP_SIZE 1000
@ -70,7 +70,7 @@ class RDCutDialog : public RDDialog
void SaveState(); void SaveState();
QString *cart_cutname; QString *cart_cutname;
RDCartFilter *cart_cart_filter; RDCartFilter *cart_cart_filter;
QTreeView *cart_cart_view; RDTreeView *cart_cart_view;
RDLibraryModel *cart_cart_model; RDLibraryModel *cart_cart_model;
QPushButton *cart_ok_button; QPushButton *cart_ok_button;
QPushButton *cart_cancel_button; QPushButton *cart_cancel_button;

View File

@ -2,7 +2,7 @@
// //
// Select a Rivendell Log // Select a Rivendell Log
// //
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -44,12 +44,7 @@ RDListLogs::RDListLogs(QString *logname,RDLogFilter::FilterMode mode,
// //
// Log List // Log List
// //
list_log_view=new QTableView(this); list_log_view=new RDTableView(this);
list_log_view->setSelectionBehavior(QAbstractItemView::SelectRows);
list_log_view->setSelectionMode(QAbstractItemView::SingleSelection);
list_log_view->setShowGrid(false);
list_log_view->setSortingEnabled(false);
list_log_view->setWordWrap(false);
list_log_model=new RDLogListModel(this); list_log_model=new RDLogListModel(this);
list_log_model->setFont(defaultFont()); list_log_model->setFont(defaultFont());
list_log_model->setPalette(palette()); list_log_model->setPalette(palette());

View File

@ -2,7 +2,7 @@
// //
// Select a Rivendell Log // Select a Rivendell Log
// //
// (C) Copyright 2007-2020 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2007-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// The RDListLogs class creates a basic dialog that displays a list of logs // The RDListLogs class creates a basic dialog that displays a list of logs
// (log name, description, and service) and allows the user to select one. If // (log name, description, and service) and allows the user to select one. If
@ -27,11 +27,11 @@
#define RDLIST_LOGS_H #define RDLIST_LOGS_H
#include <QPushButton> #include <QPushButton>
#include <QTableView>
#include <rddialog.h> #include <rddialog.h>
#include <rdlogfilter.h> #include <rdlogfilter.h>
#include <rdloglistmodel.h> #include <rdloglistmodel.h>
#include <rdtableview.h>
class RDListLogs : public RDDialog class RDListLogs : public RDDialog
{ {
@ -53,7 +53,7 @@ class RDListLogs : public RDDialog
void resizeEvent(QResizeEvent *e); void resizeEvent(QResizeEvent *e);
private: private:
QTableView *list_log_view; RDTableView *list_log_view;
RDLogListModel *list_log_model; RDLogListModel *list_log_model;
QString *list_logname; QString *list_logname;
QPushButton *list_ok_button; QPushButton *list_ok_button;

35
lib/rdtableview.cpp Normal file
View File

@ -0,0 +1,35 @@
// rdtableview.cpp
//
// QTableView widget with consistent Rivendell defaults
//
// (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
//
// 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 <QHeaderView>
#include "rdtableview.h"
RDTableView::RDTableView(QWidget *parent)
:QTableView(parent)
{
setSelectionBehavior(QAbstractItemView::SelectRows);
setSelectionMode(QAbstractItemView::SingleSelection);
setShowGrid(false);
setSortingEnabled(false);
setWordWrap(false);
verticalHeader()->setVisible(false);
horizontalHeader()->setStretchLastSection(true);
}

34
lib/rdtableview.h Normal file
View File

@ -0,0 +1,34 @@
// rdtableview.h
//
// QTableView widget with consistent Rivendell defaults
//
// (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
//
// 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 RDTABLEVIEW_H
#define RDTABLEVIEW_H
#include <QTableView>
class RDTableView : public QTableView
{
Q_OBJECT
public:
RDTableView(QWidget *parent=0);
};
#endif // RDTABLEVIEW_H

29
lib/rdtreeview.cpp Normal file
View File

@ -0,0 +1,29 @@
// rdtreeview.cpp
//
// QTreeView widget with consistent Rivendell defaults
//
// (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
//
// 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 "rdtreeview.h"
RDTreeView::RDTreeView(QWidget *parent)
: QTreeView(parent)
{
setSelectionBehavior(QAbstractItemView::SelectRows);
setSortingEnabled(false);
setWordWrap(false);
}

34
lib/rdtreeview.h Normal file
View File

@ -0,0 +1,34 @@
// rdtreeview.h
//
// QTreeView widget with consistent Rivendell defaults
//
// (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
//
// 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 RDTREEVIEW_H
#define RDTREEVIEW_H
#include <QTreeView>
class RDTreeView : public QTreeView
{
Q_OBJECT
public:
RDTreeView(QWidget *parent=0);
};
#endif // RDTREEVIEW_H

View File

@ -90,12 +90,7 @@ EditJack::EditJack(RDStation *station,QWidget *parent)
// //
// JACK Client List // JACK Client List
// //
edit_jack_client_view=new QTableView(this); edit_jack_client_view=new RDTableView(this);
edit_jack_client_view->setSelectionBehavior(QAbstractItemView::SelectRows);
edit_jack_client_view->setSelectionMode(QAbstractItemView::SingleSelection);
edit_jack_client_view->setShowGrid(false);
edit_jack_client_view->setSortingEnabled(false);
edit_jack_client_view->setWordWrap(false);
edit_jack_client_label= edit_jack_client_label=
new QLabel(edit_jack_client_view,tr("JACK Clients to Start:"),this); new QLabel(edit_jack_client_view,tr("JACK Clients to Start:"),this);
edit_jack_client_label->setFont(labelFont()); edit_jack_client_label->setFont(labelFont());

View File

@ -25,13 +25,13 @@
#include <QLabel> #include <QLabel>
#include <QLineEdit> #include <QLineEdit>
#include <QPushButton> #include <QPushButton>
#include <QTableView>
#include <QSpinBox> #include <QSpinBox>
#include <rddialog.h> #include <rddialog.h>
#include <rdjackclientlistmodel.h> #include <rdjackclientlistmodel.h>
#include <rdlistview.h> #include <rdlistview.h>
#include <rdstation.h> #include <rdstation.h>
#include <rdtableview.h>
#define EDITJACK_DEFAULT_SERVERNAME QObject::tr("(default)") #define EDITJACK_DEFAULT_SERVERNAME QObject::tr("(default)")
@ -65,7 +65,7 @@ class EditJack : public RDDialog
QLabel *edit_jack_audio_ports_label; QLabel *edit_jack_audio_ports_label;
QSpinBox *edit_jack_audio_ports_spin; QSpinBox *edit_jack_audio_ports_spin;
QLabel *edit_jack_client_label; QLabel *edit_jack_client_label;
QTableView *edit_jack_client_view; RDTableView *edit_jack_client_view;
RDJackClientListModel *edit_jack_client_model; RDJackClientListModel *edit_jack_client_model;
RDStation *edit_station; RDStation *edit_station;
QPushButton *edit_add_button; QPushButton *edit_add_button;

View File

@ -83,12 +83,7 @@ ListDropboxes::ListDropboxes(const QString &stationname,QWidget *parent)
// //
// Dropbox List // Dropbox List
// //
list_dropboxes_view=new QTableView(this); list_dropboxes_view=new RDTableView(this);
list_dropboxes_view->setSelectionBehavior(QAbstractItemView::SelectRows);
list_dropboxes_view->setSelectionMode(QAbstractItemView::SingleSelection);
list_dropboxes_view->setShowGrid(false);
list_dropboxes_view->setSortingEnabled(false);
list_dropboxes_view->setWordWrap(false);
list_dropboxes_model=new RDDropboxListModel(stationname,this); list_dropboxes_model=new RDDropboxListModel(stationname,this);
list_dropboxes_model->setFont(defaultFont()); list_dropboxes_model->setFont(defaultFont());
list_dropboxes_model->setPalette(palette()); list_dropboxes_model->setPalette(palette());

View File

@ -22,11 +22,11 @@
#define LIST_DROPBOXES_H #define LIST_DROPBOXES_H
#include <QPushButton> #include <QPushButton>
#include <QTableView>
#include <rddb.h> #include <rddb.h>
#include <rddialog.h> #include <rddialog.h>
#include <rddropboxlistmodel.h> #include <rddropboxlistmodel.h>
#include <rdtableview.h>
class ListDropboxes : public RDDialog class ListDropboxes : public RDDialog
{ {
@ -49,7 +49,7 @@ class ListDropboxes : public RDDialog
void resizeEvent(QResizeEvent *e); void resizeEvent(QResizeEvent *e);
private: private:
QTableView *list_dropboxes_view; RDTableView *list_dropboxes_view;
RDDropboxListModel *list_dropboxes_model; RDDropboxListModel *list_dropboxes_model;
QPushButton *list_add_button; QPushButton *list_add_button;
QPushButton *list_edit_button; QPushButton *list_edit_button;

View File

@ -100,13 +100,7 @@ ListFeeds::ListFeeds(QWidget *parent)
// //
// Feed List // Feed List
// //
list_feeds_view=new QTableView(this); list_feeds_view=new RDTableView(this);
list_feeds_view->setSelectionBehavior(QAbstractItemView::SelectRows);
list_feeds_view->setSelectionMode(QAbstractItemView::SingleSelection);
list_feeds_view->setShowGrid(false);
list_feeds_view->setSortingEnabled(false);
list_feeds_view->setSortingEnabled(false);
list_feeds_view->setWordWrap(false);
list_feeds_model=new RDFeedListModel(true,this); list_feeds_model=new RDFeedListModel(true,this);
list_feeds_model->setFont(font()); list_feeds_model->setFont(font());
list_feeds_model->setPalette(palette()); list_feeds_model->setPalette(palette());

View File

@ -22,11 +22,11 @@
#define LIST_FEEDS_H #define LIST_FEEDS_H
#include <QPushButton> #include <QPushButton>
#include <QTableView>
#include <rddialog.h> #include <rddialog.h>
#include <rdfeedlistmodel.h> #include <rdfeedlistmodel.h>
#include <rdlistviewitem.h> #include <rdlistviewitem.h>
#include <rdtableview.h>
class ListFeeds : public RDDialog class ListFeeds : public RDDialog
{ {
@ -52,7 +52,7 @@ class ListFeeds : public RDDialog
private: private:
QLabel *list_box_label; QLabel *list_box_label;
QTableView *list_feeds_view; RDTableView *list_feeds_view;
RDFeedListModel *list_feeds_model; RDFeedListModel *list_feeds_model;
QPushButton *list_add_button; QPushButton *list_add_button;
QPushButton *list_edit_button; QPushButton *list_edit_button;

View File

@ -97,12 +97,7 @@ ListGroups::ListGroups(QWidget *parent)
// //
// Group List // Group List
// //
list_groups_view=new QTableView(this); list_groups_view=new RDTableView(this);
list_groups_view->setSelectionBehavior(QAbstractItemView::SelectRows);
list_groups_view->setSelectionMode(QAbstractItemView::SingleSelection);
list_groups_view->setShowGrid(false);
list_groups_view->setSortingEnabled(false);
list_groups_view->setWordWrap(false);
list_groups_model=new RDGroupListModel(false,true,this); list_groups_model=new RDGroupListModel(false,true,this);
list_groups_model->setFont(defaultFont()); list_groups_model->setFont(defaultFont());
list_groups_model->setPalette(palette()); list_groups_model->setPalette(palette());

View File

@ -22,11 +22,11 @@
#define LIST_GROUPS_H #define LIST_GROUPS_H
#include <QPushButton> #include <QPushButton>
#include <QTableView>
#include <rddb.h> #include <rddb.h>
#include <rddialog.h> #include <rddialog.h>
#include <rdgrouplistmodel.h> #include <rdgrouplistmodel.h>
#include <rdtableview.h>
class ListGroups : public RDDialog class ListGroups : public RDDialog
{ {
@ -52,7 +52,7 @@ class ListGroups : public RDDialog
void resizeEvent(QResizeEvent *e); void resizeEvent(QResizeEvent *e);
private: private:
QTableView *list_groups_view; RDTableView *list_groups_view;
RDGroupListModel *list_groups_model; RDGroupListModel *list_groups_model;
QPushButton *list_add_button; QPushButton *list_add_button;
QPushButton *list_edit_button; QPushButton *list_edit_button;

View File

@ -50,13 +50,7 @@ ListPypads::ListPypads(RDStation *station,QWidget *parent)
// //
// Instances List Box // Instances List Box
// //
list_list_view=new QTableView(this); list_list_view=new RDTableView(this);
list_list_view->setSelectionBehavior(QAbstractItemView::SelectRows);
list_list_view->setSelectionMode(QAbstractItemView::SingleSelection);
list_list_view->setShowGrid(false);
list_list_view->setSortingEnabled(false);
list_list_view->setWordWrap(false);
list_list_view->verticalHeader()->setVisible(false);
list_list_model=new RDPypadListModel(station->name(),this); list_list_model=new RDPypadListModel(station->name(),this);
list_list_view->setModel(list_list_model); list_list_view->setModel(list_list_model);
connect(list_list_view,SIGNAL(doubleClicked(const QModelIndex &)), connect(list_list_view,SIGNAL(doubleClicked(const QModelIndex &)),

View File

@ -22,12 +22,12 @@
#define LIST_PYPADS_H #define LIST_PYPADS_H
#include <QPushButton> #include <QPushButton>
#include <QTableView>
#include <rddialog.h> #include <rddialog.h>
#include <rdlistviewitem.h> #include <rdlistviewitem.h>
#include <rdpypadlistmodel.h> #include <rdpypadlistmodel.h>
#include <rdstation.h> #include <rdstation.h>
#include <rdtableview.h>
class ListPypads : public RDDialog class ListPypads : public RDDialog
{ {
@ -49,7 +49,7 @@ class ListPypads : public RDDialog
void resizeEvent(QResizeEvent *e); void resizeEvent(QResizeEvent *e);
private: private:
QTableView *list_list_view; RDTableView *list_list_view;
RDPypadListModel *list_list_model; RDPypadListModel *list_list_model;
QPushButton *list_add_button; QPushButton *list_add_button;
QPushButton *list_edit_button; QPushButton *list_edit_button;

View File

@ -74,15 +74,10 @@ ListStations::ListStations(QWidget *parent)
// //
// Station List Box // Station List Box
// //
list_stations_view=new QTableView(this); list_stations_view=new RDTableView(this);
list_title_label=new QLabel(list_stations_view,tr("H&osts:"),this); list_title_label=new QLabel(list_stations_view,tr("H&osts:"),this);
list_title_label->setFont(labelFont()); list_title_label->setFont(labelFont());
list_title_label->setGeometry(14,11,85,19); list_title_label->setGeometry(14,11,85,19);
list_stations_view->setSelectionBehavior(QAbstractItemView::SelectRows);
list_stations_view->setSelectionMode(QAbstractItemView::SingleSelection);
list_stations_view->setShowGrid(false);
list_stations_view->setSortingEnabled(false);
list_stations_view->setWordWrap(false);
list_stations_model=new RDStationListModel(false,"",this); list_stations_model=new RDStationListModel(false,"",this);
list_stations_model->setFont(defaultFont()); list_stations_model->setFont(defaultFont());
list_stations_model->setPalette(palette()); list_stations_model->setPalette(palette());

View File

@ -21,14 +21,12 @@
#ifndef LIST_STATIONS_H #ifndef LIST_STATIONS_H
#define LIST_STATIONS_H #define LIST_STATIONS_H
//#include <q3listbox.h>
#include <QLabel> #include <QLabel>
#include <QPushButton> #include <QPushButton>
#include <QTableView>
#include <rddialog.h> #include <rddialog.h>
#include <rdstationlistmodel.h> #include <rdstationlistmodel.h>
#include <rdtableview.h>
class ListStations : public RDDialog class ListStations : public RDDialog
{ {
@ -50,10 +48,8 @@ class ListStations : public RDDialog
void resizeEvent(QResizeEvent *e); void resizeEvent(QResizeEvent *e);
private: private:
// void RefreshList(QString stationname="");
QLabel *list_title_label; QLabel *list_title_label;
// Q3ListBox *list_box; RDTableView *list_stations_view;
QTableView *list_stations_view;
RDStationListModel *list_stations_model; RDStationListModel *list_stations_model;
QPushButton *list_add_button; QPushButton *list_add_button;
QPushButton *list_edit_button; QPushButton *list_edit_button;

View File

@ -80,15 +80,10 @@ ListSvcs::ListSvcs(QWidget *parent)
// //
// Services List Box // Services List Box
// //
list_services_view=new QTableView(this); list_services_view=new RDTableView(this);
list_title_label=new QLabel(list_services_view,tr("&Services:"),this); list_title_label=new QLabel(list_services_view,tr("&Services:"),this);
list_title_label->setFont(labelFont()); list_title_label->setFont(labelFont());
list_title_label->setGeometry(14,11,85,19); list_title_label->setGeometry(14,11,85,19);
list_services_view->setSelectionBehavior(QAbstractItemView::SelectRows);
list_services_view->setSelectionMode(QAbstractItemView::SingleSelection);
list_services_view->setShowGrid(false);
list_services_view->setSortingEnabled(false);
list_services_view->setWordWrap(false);
list_services_model=new RDServiceListModel(false,this); list_services_model=new RDServiceListModel(false,this);
list_services_model->setFont(defaultFont()); list_services_model->setFont(defaultFont());
list_services_model->setPalette(palette()); list_services_model->setPalette(palette());

View File

@ -23,10 +23,10 @@
#include <QLabel> #include <QLabel>
#include <QPushButton> #include <QPushButton>
#include <QTableView>
#include <rddialog.h> #include <rddialog.h>
#include <rdservicelistmodel.h> #include <rdservicelistmodel.h>
#include <rdtableview.h>
class ListSvcs : public RDDialog class ListSvcs : public RDDialog
{ {
@ -49,7 +49,7 @@ class ListSvcs : public RDDialog
private: private:
QLabel *list_title_label; QLabel *list_title_label;
QTableView *list_services_view; RDTableView *list_services_view;
RDServiceListModel *list_services_model; RDServiceListModel *list_services_model;
QPushButton *list_add_button; QPushButton *list_add_button;
QPushButton *list_edit_button; QPushButton *list_edit_button;

View File

@ -79,12 +79,7 @@ ListUsers::ListUsers(const QString &admin_name,QWidget *parent)
// //
// User List // User List
// //
list_users_view=new QTableView(this); list_users_view=new RDTableView(this);
list_users_view->setSelectionBehavior(QAbstractItemView::SelectRows);
list_users_view->setSelectionMode(QAbstractItemView::SingleSelection);
list_users_view->setShowGrid(false);
list_users_view->setSortingEnabled(false);
list_users_view->setWordWrap(false);
list_users_model=new RDUserListModel(this); list_users_model=new RDUserListModel(this);
list_users_model->setFont(defaultFont()); list_users_model->setFont(defaultFont());
list_users_model->setPalette(palette()); list_users_model->setPalette(palette());

View File

@ -23,11 +23,11 @@
#include <QPixmap> #include <QPixmap>
#include <QPushButton> #include <QPushButton>
#include <QTableView>
#include <rddb.h> #include <rddb.h>
#include <rddialog.h> #include <rddialog.h>
#include <rdlistviewitem.h> #include <rdlistviewitem.h>
#include <rdtableview.h>
#include <rduserlistmodel.h> #include <rduserlistmodel.h>
class ListUsers : public RDDialog class ListUsers : public RDDialog
@ -50,7 +50,7 @@ class ListUsers : public RDDialog
void resizeEvent(QResizeEvent *e); void resizeEvent(QResizeEvent *e);
private: private:
QTableView *list_users_view; RDTableView *list_users_view;
RDUserListModel *list_users_model; RDUserListModel *list_users_model;
QPushButton *list_add_button; QPushButton *list_add_button;
QPushButton *list_edit_button; QPushButton *list_edit_button;

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// //
#include <QHeaderView>
#include <QMessageBox> #include <QMessageBox>
#include <QPainter> #include <QPainter>
@ -101,14 +100,7 @@ TestImport::TestImport(RDSvc *svc,RDSvc::ImportSource src,QWidget *parent)
// //
// Events List // Events List
// //
test_events_view=new QTableView(this); test_events_view=new RDTableView(this);
test_events_view->setSelectionBehavior(QAbstractItemView::SelectRows);
test_events_view->setSelectionMode(QAbstractItemView::NoSelection);
test_events_view->setShowGrid(false);
test_events_view->setSortingEnabled(false);
test_events_view->setWordWrap(false);
test_events_view->verticalHeader()->setVisible(false);
test_events_view->horizontalHeader()->setStretchLastSection(true);
test_events_model=new RDLogImportModel(rda->station()->name(),getpid(),this); test_events_model=new RDLogImportModel(rda->station()->name(),getpid(),this);
test_events_view->setModel(test_events_model); test_events_view->setModel(test_events_model);
test_events_label=new QLabel(test_events_view,tr("Imported Events"),this); test_events_label=new QLabel(test_events_view,tr("Imported Events"),this);

View File

@ -25,11 +25,11 @@
#include <QLabel> #include <QLabel>
#include <QLineEdit> #include <QLineEdit>
#include <QPushButton> #include <QPushButton>
#include <QTableView>
#include <rddialog.h> #include <rddialog.h>
#include <rdlogimportmodel.h> #include <rdlogimportmodel.h>
#include <rdsvc.h> #include <rdsvc.h>
#include <rdtableview.h>
class TestImport : public RDDialog class TestImport : public RDDialog
{ {
@ -57,7 +57,7 @@ class TestImport : public RDDialog
QDateEdit *test_date_edit; QDateEdit *test_date_edit;
QPushButton *test_import_button; QPushButton *test_import_button;
QLabel *test_events_label; QLabel *test_events_label;
QTableView *test_events_view; RDTableView *test_events_view;
RDLogImportModel *test_events_model; RDLogImportModel *test_events_model;
QLabel *test_filename_label; QLabel *test_filename_label;
QLineEdit *test_filename_edit; QLineEdit *test_filename_edit;

View File

@ -2,7 +2,7 @@
// //
// Select a Rivendell Log // Select a Rivendell Log
// //
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -46,12 +46,7 @@ ListLogs::ListLogs(RDLogPlay *log,QWidget *parent)
// //
// Log List // Log List
// //
list_log_view=new QTableView(this); list_log_view=new RDTableView(this);
list_log_view->setSelectionBehavior(QAbstractItemView::SelectRows);
list_log_view->setSelectionMode(QAbstractItemView::SingleSelection);
list_log_view->setShowGrid(false);
list_log_view->setSortingEnabled(false);
list_log_view->setWordWrap(false);
list_log_model=new RDLogListModel(this); list_log_model=new RDLogListModel(this);
list_log_model->setFont(defaultFont()); list_log_model->setFont(defaultFont());
list_log_model->setPalette(palette()); list_log_model->setPalette(palette());

View File

@ -2,7 +2,7 @@
// //
// Select a Rivendell Log // Select a Rivendell Log
// //
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -22,13 +22,13 @@
#define LIST_LOGS_H #define LIST_LOGS_H
#include <QPushButton> #include <QPushButton>
#include <QTableView>
#include <rddialog.h> #include <rddialog.h>
#include <rdlogfilter.h> #include <rdlogfilter.h>
#include <rdloglistmodel.h> #include <rdloglistmodel.h>
#include <rdloglock.h> #include <rdloglock.h>
#include <rdlogplay.h> #include <rdlogplay.h>
#include <rdtableview.h>
class ListLogs : public RDDialog class ListLogs : public RDDialog
{ {
@ -59,7 +59,7 @@ class ListLogs : public RDDialog
private: private:
bool TryLock(RDLogLock *lock); bool TryLock(RDLogLock *lock);
RDLogFilter *list_filter_widget; RDLogFilter *list_filter_widget;
QTableView *list_log_view; RDTableView *list_log_view;
RDLogListModel *list_log_model; RDLogListModel *list_log_model;
QString *list_logname; QString *list_logname;
QString *list_svcname; QString *list_svcname;

View File

@ -25,7 +25,7 @@
#include "logtableview.h" #include "logtableview.h"
LogTableView::LogTableView(QWidget *parent) LogTableView::LogTableView(QWidget *parent)
: QTableView(parent) : RDTableView(parent)
{ {
setAcceptDrops(true); setAcceptDrops(true);
} }

View File

@ -2,7 +2,7 @@
// //
// The Log TableView widget for RDAirPlay // The Log TableView widget for RDAirPlay
// //
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -24,11 +24,11 @@
#include <QDropEvent> #include <QDropEvent>
#include <QDragEnterEvent> #include <QDragEnterEvent>
#include <QTableView>
#include <rdlog_line.h> #include <rdlog_line.h>
#include <rdtableview.h>
class LogTableView : public QTableView class LogTableView : public RDTableView
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -79,13 +79,7 @@ ListCasts::ListCasts(unsigned feed_id,QWidget *parent)
new QLabel(list_feed->channelTitle(),this); new QLabel(list_feed->channelTitle(),this);
list_casts_label->setFont(bigLabelFont()); list_casts_label->setFont(bigLabelFont());
list_casts_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); list_casts_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
list_casts_view=new QTableView(this); list_casts_view=new RDTableView(this);
list_casts_view->setSelectionBehavior(QAbstractItemView::SelectRows);
list_casts_view->setSelectionMode(QAbstractItemView::SingleSelection);
list_casts_view->setShowGrid(false);
list_casts_view->setSortingEnabled(false);
list_casts_view->setSortingEnabled(false);
list_casts_view->setWordWrap(false);
list_casts_model=new RDPodcastListModel(feed_id,this); list_casts_model=new RDPodcastListModel(feed_id,this);
list_casts_model->setFont(font()); list_casts_model->setFont(font());
list_casts_model->setPalette(palette()); list_casts_model->setPalette(palette());

View File

@ -23,13 +23,13 @@
#include <QCheckBox> #include <QCheckBox>
#include <QProgressDialog> #include <QProgressDialog>
#include <QTableView>
#include <rdcut_dialog.h> #include <rdcut_dialog.h>
#include <rddialog.h> #include <rddialog.h>
#include <rdfeed.h> #include <rdfeed.h>
#include <rdpodcastlistmodel.h> #include <rdpodcastlistmodel.h>
#include <rdpodcastfilter.h> #include <rdpodcastfilter.h>
#include <rdtableview.h>
#include "render_dialog.h" #include "render_dialog.h"
@ -62,7 +62,7 @@ class ListCasts : public RDDialog
private: private:
RDCutDialog *list_cut_dialog; RDCutDialog *list_cut_dialog;
QLabel *list_casts_label; QLabel *list_casts_label;
QTableView *list_casts_view; RDTableView *list_casts_view;
RDPodcastListModel *list_casts_model; RDPodcastListModel *list_casts_model;
QPushButton *list_cart_button; QPushButton *list_cart_button;
QPushButton *list_file_button; QPushButton *list_file_button;

View File

@ -2,7 +2,7 @@
// //
// Read-only log lister dialog for Rivendell // Read-only log lister dialog for Rivendell
// //
// (C) Copyright 2020 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2020-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -30,12 +30,8 @@ LogDialog::LogDialog(QWidget *parent)
{ {
setWindowTitle("RDCastManager - "+tr("List Log Events")); setWindowTitle("RDCastManager - "+tr("List Log Events"));
d_log_view=new QTableView(this); d_log_view=new RDTableView(this);
d_log_view->setSelectionBehavior(QAbstractItemView::SelectRows);
d_log_view->setSelectionMode(QAbstractItemView::ContiguousSelection); d_log_view->setSelectionMode(QAbstractItemView::ContiguousSelection);
d_log_view->setShowGrid(false);
d_log_view->setSortingEnabled(false);
d_log_view->setWordWrap(false);
d_model=NULL; d_model=NULL;
d_ok_button=new QPushButton(tr("OK"),this); d_ok_button=new QPushButton(tr("OK"),this);

View File

@ -2,7 +2,7 @@
// //
// Read-only log lister dialog for Rivendell // Read-only log lister dialog for Rivendell
// //
// (C) Copyright 2020 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2020-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -21,11 +21,11 @@
#ifndef LOGDIALOG_H #ifndef LOGDIALOG_H
#define LOGDIALOG_H #define LOGDIALOG_H
#include <qpushbutton.h> #include <QPushButton>
#include <qtableview.h>
#include <rddialog.h> #include <rddialog.h>
#include <rdlogmodel.h> #include <rdlogmodel.h>
#include <rdtableview.h>
class LogDialog : public RDDialog class LogDialog : public RDDialog
{ {
@ -46,7 +46,7 @@ class LogDialog : public RDDialog
void resizeEvent(QResizeEvent *e); void resizeEvent(QResizeEvent *e);
private: private:
QTableView *d_log_view; RDTableView *d_log_view;
QPushButton *d_ok_button; QPushButton *d_ok_button;
QPushButton *d_cancel_button; QPushButton *d_cancel_button;
RDLogModel *d_model; RDLogModel *d_model;

View File

@ -91,10 +91,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
// //
// Feed List // Feed List
// //
cast_feed_view=new QTreeView(this); cast_feed_view=new RDTreeView(this);
cast_feed_view->setSelectionBehavior(QAbstractItemView::SelectRows);
cast_feed_view->setSortingEnabled(false);
cast_feed_view->setWordWrap(false);
cast_feed_model=new RDFeedListModel(false,this); cast_feed_model=new RDFeedListModel(false,this);
cast_feed_model->setFont(font()); cast_feed_model->setFont(font());
cast_feed_model->setPalette(palette()); cast_feed_model->setPalette(palette());

View File

@ -22,11 +22,11 @@
#define RDCASTMANAGER_H #define RDCASTMANAGER_H
#include <QPushButton> #include <QPushButton>
#include <QTreeView>
#include <rdconfig.h> #include <rdconfig.h>
#include <rdfeedlistmodel.h> #include <rdfeedlistmodel.h>
#include <rdlog_line.h> #include <rdlog_line.h>
#include <rdtreeview.h>
#include <rdwidget.h> #include <rdwidget.h>
#define RDCASTMANAGER_USAGE "\n" #define RDCASTMANAGER_USAGE "\n"
@ -54,7 +54,7 @@ class MainWidget : public RDWidget
void resizeEvent(QResizeEvent *e); void resizeEvent(QResizeEvent *e);
private: private:
QTreeView *cast_feed_view; RDTreeView *cast_feed_view;
RDFeedListModel *cast_feed_model; RDFeedListModel *cast_feed_model;
QPushButton *cast_open_button; QPushButton *cast_open_button;
QPushButton *cast_copy_button; QPushButton *cast_copy_button;

View File

@ -100,13 +100,9 @@ AudioCart::AudioCart(AudioControls *controls,RDCart *cart,QString *path,
// //
// Cart Cut List // Cart Cut List
// //
rdcart_cut_view=new QTableView(this); rdcart_cut_view=new RDTableView(this);
rdcart_cut_view->setGeometry(100,0,430,sizeHint().height());
rdcart_cut_view->setSelectionBehavior(QAbstractItemView::SelectRows);
rdcart_cut_view->setSelectionMode(QAbstractItemView::ExtendedSelection); rdcart_cut_view->setSelectionMode(QAbstractItemView::ExtendedSelection);
rdcart_cut_view->setShowGrid(false); rdcart_cut_view->setGeometry(100,0,430,sizeHint().height());
rdcart_cut_view->setSortingEnabled(false);
rdcart_cut_view->setWordWrap(false);
rdcart_cut_model=NULL; rdcart_cut_model=NULL;
connect(rdcart_cut_view,SIGNAL(doubleClicked(const QModelIndex &)), connect(rdcart_cut_view,SIGNAL(doubleClicked(const QModelIndex &)),
this,SLOT(doubleClickedData(const QModelIndex &))); this,SLOT(doubleClickedData(const QModelIndex &)));

View File

@ -22,10 +22,10 @@
#define AUDIO_CART_H #define AUDIO_CART_H
#include <QProgressDialog> #include <QProgressDialog>
#include <QTableView>
#include <rdcart.h> #include <rdcart.h>
#include <rdcutlistmodel.h> #include <rdcutlistmodel.h>
#include <rdtableview.h>
#include <rdwidget.h> #include <rdwidget.h>
#include "audio_controls.h" #include "audio_controls.h"
@ -71,7 +71,7 @@ class AudioCart : public RDWidget
private: private:
QModelIndex SingleSelectedLine() const; QModelIndex SingleSelectedLine() const;
RDCart *rdcart_cart; RDCart *rdcart_cart;
QTableView *rdcart_cut_view; RDTableView *rdcart_cut_view;
RDCutListModel *rdcart_cut_model; RDCutListModel *rdcart_cut_model;
unsigned rdcart_average_length; unsigned rdcart_average_length;
QString *rdcart_import_path; QString *rdcart_import_path;

View File

@ -2,7 +2,7 @@
// //
// QTreeView widget that supports cart dragging. // QTreeView widget that supports cart dragging.
// //
// (C) Copyright 2020 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2020-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -28,7 +28,7 @@
#include "libraryview.h" #include "libraryview.h"
LibraryView::LibraryView(QWidget *parent) LibraryView::LibraryView(QWidget *parent)
: QTreeView(parent) : RDTreeView(parent)
{ {
} }

View File

@ -2,7 +2,7 @@
// //
// QTreeView widget that supports cart dragging. // QTreeView widget that supports cart dragging.
// //
// (C) Copyright 2020 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2020-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -21,9 +21,9 @@
#ifndef LIBRARYVIEW_H #ifndef LIBRARYVIEW_H
#define LIBRARYVIEW_H #define LIBRARYVIEW_H
#include <QTreeView> #include <rdtreeview.h>
class LibraryView : public QTreeView class LibraryView : public RDTreeView
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -2,7 +2,7 @@
// //
// Edit a Rivendell Log // Edit a Rivendell Log
// //
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -29,7 +29,6 @@
#include <QList> #include <QList>
#include <QStringList> #include <QStringList>
#include <QTableView>
#include "list_reports.h" #include "list_reports.h"
#include "logmodel.h" #include "logmodel.h"

View File

@ -25,7 +25,7 @@
#include "logmodel.h" #include "logmodel.h"
LogTableView::LogTableView(QWidget *parent) LogTableView::LogTableView(QWidget *parent)
: QTableView(parent) : RDTableView(parent)
{ {
d_mouse_row=-1; d_mouse_row=-1;

View File

@ -2,7 +2,7 @@
// //
// The Log TableView widget for RDLogEdit. // The Log TableView widget for RDLogEdit.
// //
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -25,11 +25,11 @@
#include <QDropEvent> #include <QDropEvent>
#include <QDragEnterEvent> #include <QDragEnterEvent>
#include <QMenu> #include <QMenu>
#include <QTableView>
#include <rdlog_line.h> #include <rdlog_line.h>
#include <rdtableview.h>
class LogTableView : public QTableView class LogTableView : public RDTableView
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -18,9 +18,9 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// //
#include <qapplication.h> #include <QApplication>
#include <qmessagebox.h> #include <QMessageBox>
#include <qtranslator.h> #include <QTranslator>
#include <rdadd_log.h> #include <rdadd_log.h>
#include <rdconf.h> #include <rdconf.h>
@ -113,12 +113,8 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
// //
// Log List // Log List
// //
log_log_view=new QTableView(this); log_log_view=new RDTableView(this);
log_log_view->setSelectionBehavior(QAbstractItemView::SelectRows);
log_log_view->setSelectionMode(QAbstractItemView::ExtendedSelection); log_log_view->setSelectionMode(QAbstractItemView::ExtendedSelection);
log_log_view->setShowGrid(false);
log_log_view->setSortingEnabled(false);
log_log_view->setWordWrap(false);
log_log_model=new RDLogListModel(this); log_log_model=new RDLogListModel(this);
log_log_model->setFont(defaultFont()); log_log_model->setFont(defaultFont());
log_log_model->setPalette(palette()); log_log_model->setPalette(palette());

View File

@ -22,12 +22,12 @@
#define RDLOGEDIT_H #define RDLOGEDIT_H
#include <QList> #include <QList>
#include <QTableView>
#include <rdlog_line.h> #include <rdlog_line.h>
#include <rdlogfilter.h> #include <rdlogfilter.h>
#include <rdloglistmodel.h> #include <rdloglistmodel.h>
#include <rdnotification.h> #include <rdnotification.h>
#include <rdtableview.h>
#include <rdwidget.h> #include <rdwidget.h>
#define RDLOGEDIT_POSITION_FILENAME ".rdlogedit" #define RDLOGEDIT_POSITION_FILENAME ".rdlogedit"
@ -74,7 +74,7 @@ class MainWidget : public RDWidget
int log_card_no; int log_card_no;
int log_stream_no; int log_stream_no;
RDLogFilter *log_filter_widget; RDLogFilter *log_filter_widget;
QTableView *log_log_view; RDTableView *log_log_view;
RDLogListModel *log_log_model; RDLogListModel *log_log_model;
QList<RDLogLine> log_clipboard; QList<RDLogLine> log_clipboard;
QPushButton *log_add_button; QPushButton *log_add_button;