diff --git a/ChangeLog b/ChangeLog index d40a9bee..36f614e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20740,3 +20740,8 @@ * Added a 'RDLogListModel' class. * Added a 'RDLogIcons::listIcon()' method. * Refactored rdlogedit(1) to use 'RDLogListModel'. +2020-12-26 Fred Gleason + * Removed 'ListListViewItem' class from rdlogedit(1). + * Removed 'LogListView' class from rdlogedit(1). + * Removed dependency on 'Q3DateEdit' from rdlogedit(1). + * Removed dependency on 'Q3PointArray' from rdlogedit(1). diff --git a/rdlogedit/Makefile.am b/rdlogedit/Makefile.am index 8476c7ad..98e2809f 100644 --- a/rdlogedit/Makefile.am +++ b/rdlogedit/Makefile.am @@ -47,9 +47,7 @@ dist_rdlogedit_SOURCES = add_meta.cpp add_meta.h\ edit_logline.cpp edit_logline.h\ edit_marker.cpp edit_marker.h\ edit_track.cpp edit_track.h\ - list_listviewitem.cpp list_listviewitem.h\ list_reports.cpp list_reports.h\ - log_listview.cpp log_listview.h\ logmodel.cpp logmodel.h\ logtableview.cpp logtableview.h\ rdlogedit.cpp rdlogedit.h globals.h\ @@ -64,7 +62,6 @@ nodist_rdlogedit_SOURCES = moc_add_meta.cpp\ moc_edit_marker.cpp\ moc_edit_track.cpp\ moc_list_reports.cpp\ - moc_log_listview.cpp\ moc_logmodel.cpp\ moc_logtableview.cpp\ moc_rdlogedit.cpp\ diff --git a/rdlogedit/edit_event.cpp b/rdlogedit/edit_event.cpp index 3cfcd6dd..0c68d910 100644 --- a/rdlogedit/edit_event.cpp +++ b/rdlogedit/edit_event.cpp @@ -2,7 +2,7 @@ // // Base class for rdlogedit(1) event editor dialogs // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -74,7 +74,6 @@ EditEvent::EditEvent(RDLogLine *line,QWidget *parent) edit_grace_bgroup->addButton(radio_button,2); edit_grace_timeedit=new QTimeEdit(this); edit_grace_timeedit->setDisplayFormat("mm:ss"); - // edit_grace_timeedit->setDisplay(Q3TimeEdit::Minutes|Q3TimeEdit::Seconds); connect(edit_timetype_box,SIGNAL(toggled(bool)), this,SLOT(timeToggledData(bool))); connect(edit_grace_bgroup,SIGNAL(buttonClicked(int)), diff --git a/rdlogedit/edit_log.cpp b/rdlogedit/edit_log.cpp index 4d8a5678..5881447e 100644 --- a/rdlogedit/edit_log.cpp +++ b/rdlogedit/edit_log.cpp @@ -155,7 +155,8 @@ EditLog::EditLog(QString logname,QString *filter,QString *group, edit_purgedate_label=new QLabel(edit_purgedate_box,tr("Delete on"),this); edit_purgedate_label->setFont(labelFont()); edit_purgedate_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - edit_purgedate_edit=new Q3DateEdit(this); + edit_purgedate_edit=new QDateEdit(this); + edit_purgedate_edit->setDisplayFormat("MM/dd/yyyy"); edit_purgedate_button=new QPushButton(tr("Select"),this); edit_purgedate_button->setFont(buttonFont()); connect(edit_purgedate_box,SIGNAL(toggled(bool)), @@ -164,7 +165,7 @@ EditLog::EditLog(QString logname,QString *filter,QString *group, edit_purgedate_edit,SLOT(setEnabled(bool))); connect(edit_purgedate_box,SIGNAL(toggled(bool)), edit_purgedate_button,SLOT(setEnabled(bool))); - connect(edit_purgedate_edit,SIGNAL(valueChanged(const QDate &)), + connect(edit_purgedate_edit,SIGNAL(dateChanged(const QDate &)), this,SLOT(purgeDateChangedData(const QDate &))); connect(edit_purgedate_button,SIGNAL(clicked()), this,SLOT(selectPurgeDateData())); @@ -199,22 +200,24 @@ EditLog::EditLog(QString logname,QString *filter,QString *group, // // Start Date // - edit_startdate_edit=new Q3DateEdit(this); + edit_startdate_edit=new QDateEdit(this); + edit_startdate_edit->setDisplayFormat("MM/dd/yyyy"); edit_startdate_label=new QLabel(edit_startdate_edit,tr("Start Date:"),this); edit_startdate_label->setFont(labelFont()); edit_startdate_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - connect(edit_startdate_edit,SIGNAL(valueChanged(const QDate &)), + connect(edit_startdate_edit,SIGNAL(dateChanged(const QDate &)), this,SLOT(dateValueChangedData(const QDate &))); // // End Date // - edit_enddate_edit=new Q3DateEdit(this); + edit_enddate_edit=new QDateEdit(this); + edit_enddate_edit->setDisplayFormat("MM/dd/yyyy"); edit_enddate_label=new QLabel(edit_startdate_edit,tr("End Date:"),this); edit_enddate_label->setFont(labelFont()); edit_enddate_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - connect(edit_enddate_edit,SIGNAL(valueChanged(const QDate &)), + connect(edit_enddate_edit,SIGNAL(dateChanged(const QDate &)), this,SLOT(dateValueChangedData(const QDate &))); // @@ -533,12 +536,12 @@ EditLog::EditLog(QString logname,QString *filter,QString *group, } if(!editing_allowed) { if(edit_startdate_box->isChecked()) { - edit_startdate_edit->setRange(edit_startdate_edit->date(), - edit_startdate_edit->date()); + edit_startdate_edit->setMinimumDate(edit_startdate_edit->date()); + edit_startdate_edit->setMaximumDate(edit_startdate_edit->date()); } if(edit_enddate_box->isChecked()) { - edit_enddate_edit->setRange(edit_enddate_edit->date(), - edit_enddate_edit->date()); + edit_enddate_edit->setMinimumDate(edit_enddate_edit->date()); + edit_enddate_edit->setMaximumDate(edit_enddate_edit->date()); } } edit_startdate_box->setEnabled(editing_allowed); diff --git a/rdlogedit/edit_log.h b/rdlogedit/edit_log.h index b892076b..ac5c6ff1 100644 --- a/rdlogedit/edit_log.h +++ b/rdlogedit/edit_log.h @@ -118,8 +118,8 @@ class EditLog : public RDDialog QLabel *edit_autorefresh_label; QComboBox *edit_autorefresh_box; QLineEdit *edit_autorefresh_edit; - Q3DateEdit *edit_startdate_edit; - Q3DateEdit *edit_enddate_edit; + QDateEdit *edit_startdate_edit; + QDateEdit *edit_enddate_edit; QLabel *edit_startdate_label; QLabel *edit_startdate_box_label; QLabel *edit_enddate_box_label; @@ -165,7 +165,7 @@ class EditLog : public RDDialog QLineEdit *edit_endtime_edit; QCheckBox *edit_purgedate_box; QLabel *edit_purgedate_label; - Q3DateEdit *edit_purgedate_edit; + QDateEdit *edit_purgedate_edit; QPushButton *edit_purgedate_button; RDLogLock *edit_log_lock; QPushButton *edit_renderas_button; diff --git a/rdlogedit/list_listviewitem.cpp b/rdlogedit/list_listviewitem.cpp deleted file mode 100644 index 3e80eb91..00000000 --- a/rdlogedit/list_listviewitem.cpp +++ /dev/null @@ -1,116 +0,0 @@ -// list_listviewitem.cpp -// -// A QListViewItem class for RDLogEdit. -// -// (C) Copyright 2002-2006,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 - -#include "../icons/greenball.xpm" -#include "../icons/redball.xpm" -#include "../icons/whiteball.xpm" - -ListListViewItem::ListListViewItem(Q3ListView *parent) - : Q3ListViewItem(parent) -{ - list_track_column=-1; - list_tracks=-1; - list_total_tracks=0; - list_parent=parent; - - // - // Create Icons - // - list_whiteball_map=new QPixmap(whiteball_xpm); - list_greenball_map=new QPixmap(greenball_xpm); - list_redball_map=new QPixmap(redball_xpm); -} - - -int ListListViewItem::trackColumn() const -{ - return list_track_column; -} - - -void ListListViewItem::setTrackColumn(int col) -{ - list_track_column=col; -} - - -int ListListViewItem::tracks() const -{ - return list_tracks; -} - - -void ListListViewItem::setTracks(int quan) -{ - list_tracks=quan; -} - - -int ListListViewItem::totalTracks() const -{ - return list_total_tracks; -} - - -void ListListViewItem::setTotalTracks(int quan) -{ - list_total_tracks=quan; -} - - -void ListListViewItem::paintCell(QPainter *p,const QColorGroup &cg,int column, - int width,int align) -{ - if(column!=list_track_column) { - Q3ListViewItem::paintCell(p,cg,column,width,align); - return; - } - QColor fg=cg.text(); - QColor bg=cg.base(); - if(isSelected()) { - fg=cg.highlightedText(); - bg=cg.highlight(); - } - QString str=QString().sprintf("%u / %u",list_tracks,list_total_tracks); - QPixmap *icon=list_whiteball_map; - if(list_total_tracks>0) { - if(list_tracks==list_total_tracks) { - icon=list_greenball_map; - } - else { - icon=list_redball_map; - } - } - QFontMetrics *m=new QFontMetrics(p->font()); - p->setBackgroundColor(bg); - p->eraseRect(0,0,width,height()); - p->setPen(fg); - p->drawPixmap(list_parent->itemMargin(),(height()-icon->size().height())/2, - *icon); - p->drawText(icon->size().width()+10,3*(height()-m->height())/2,str); - delete m; -} diff --git a/rdlogedit/list_listviewitem.h b/rdlogedit/list_listviewitem.h deleted file mode 100644 index 4488b32d..00000000 --- a/rdlogedit/list_listviewitem.h +++ /dev/null @@ -1,53 +0,0 @@ -// list_listviewitem.h -// -// A QListViewItem class for RDLogEdit. -// -// (C) Copyright 2002-2006,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 LIST_LISTVIEWITEM_H -#define LIST_LISTVIEWITEM_H - -#include -#include - -#include - -class ListListViewItem : public Q3ListViewItem -{ - public: - ListListViewItem(Q3ListView *parent); - int trackColumn() const; - void setTrackColumn(int col); - int tracks() const; - void setTracks(int quan); - int totalTracks() const; - void setTotalTracks(int quan); - void paintCell(QPainter *p,const QColorGroup &cg,int column, - int width,int align); - - private: - int list_track_column; - int list_tracks; - int list_total_tracks; - QPixmap *list_whiteball_map; - QPixmap *list_redball_map; - QPixmap *list_greenball_map; - Q3ListView *list_parent; -}; - - -#endif // LIST_LISTVIEWITEM_H diff --git a/rdlogedit/list_reports.cpp b/rdlogedit/list_reports.cpp index 34aff566..044bc190 100644 --- a/rdlogedit/list_reports.cpp +++ b/rdlogedit/list_reports.cpp @@ -67,7 +67,8 @@ ListReports::ListReports(const QString &logname,const QString &description, // // Effective Date // - list_date_edit=new Q3DateEdit(this); + list_date_edit=new QDateEdit(this); + list_date_edit->setDisplayFormat("MM/dd/yyyy"); list_date_edit->setGeometry(110,34,100,19); QLabel *list_date_label=new QLabel(list_date_edit,tr("Effective Date:"),this); list_date_label->setGeometry(10,34,95,19); diff --git a/rdlogedit/list_reports.h b/rdlogedit/list_reports.h index 601c2299..4ff23808 100644 --- a/rdlogedit/list_reports.h +++ b/rdlogedit/list_reports.h @@ -21,7 +21,7 @@ #ifndef LIST_REPORTS_H #define LIST_REPORTS_H -#include +#include #include @@ -57,7 +57,7 @@ class ListReports : public RDDialog QDate list_end_date; bool list_auto_refresh; RDLogModel *list_model; - Q3DateEdit *list_date_edit; + QDateEdit *list_date_edit; }; diff --git a/rdlogedit/log_listview.cpp b/rdlogedit/log_listview.cpp deleted file mode 100644 index 16151b8e..00000000 --- a/rdlogedit/log_listview.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// log_listview.cpp -// -// The Log ListView widget for RDLogEdit. -// -// (C) Copyright 2002-2006,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 -//Added by qt3to4: -#include -#include - -#include - -LogListView::LogListView(QWidget *parent) - : RDListView(parent) -{ - log_parent=parent; - - // - // Right Button Menu - // - log_menu=new Q3PopupMenu(this,"log_menu"); - connect(log_menu,SIGNAL(aboutToShow()),this,SLOT(aboutToShowData())); - log_menu->insertItem(tr("PLAY Transition"),this,SLOT(playData()),0,0); - log_menu->insertItem(tr("SEGUE Transition"),this,SLOT(segueData()),0,1); - log_menu->insertItem(tr("STOP Transition"),this,SLOT(stopData()),0,2); -} - - -void LogListView::aboutToShowData() -{ - RDListViewItem *item=(RDListViewItem *)selectedItem(); - log_menu->setItemEnabled(0,item->line()!=TRACKER_MAX_LINENO); - log_menu->setItemEnabled(1,item->line()!=TRACKER_MAX_LINENO); - log_menu->setItemEnabled(2,item->line()!=TRACKER_MAX_LINENO); - log_transition_type=item->text(2).lower(); - log_menu->setItemChecked(0,log_transition_type==tr("play")); - log_menu->setItemChecked(1,log_transition_type==tr("segue")); - log_menu->setItemChecked(2,log_transition_type==tr("stop")); -} - - -void LogListView::playData() -{ - if(log_transition_type=="play") { - return; - } - emit transitionChanged(((RDListViewItem *)selectedItem())->line(), - RDLogLine::Play); -} - - -void LogListView::segueData() -{ - if(log_transition_type=="segue") { - return; - } - emit transitionChanged(((RDListViewItem *)selectedItem())->line(), - RDLogLine::Segue); -} - - -void LogListView::stopData() -{ - if(log_transition_type=="stop") { - return; - } - emit transitionChanged(((RDListViewItem *)selectedItem())->line(), - RDLogLine::Stop); -} - - -void LogListView::contentsMousePressEvent(QMouseEvent *e) -{ - Q3ListView::contentsMousePressEvent(e); - log_menu_item=(RDListViewItem *)selectedItem(); - switch(e->button()) { - case Qt::RightButton: - log_menu->setGeometry(e->globalX(),e->globalY(), - log_menu->sizeHint().width(), - log_menu->sizeHint().height()); - - log_menu->exec(); - break; - - default: - e->ignore(); - break; - } -} diff --git a/rdlogedit/log_listview.h b/rdlogedit/log_listview.h deleted file mode 100644 index a267878a..00000000 --- a/rdlogedit/log_listview.h +++ /dev/null @@ -1,63 +0,0 @@ -// log_listview.h -// -// The Log ListView widget for RDLogEdit. -// -// (C) Copyright 2002-2006,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 LOG_LISTVIEW_H -#define LOG_LISTVIEW_H - -#include -#include -#include -//Added by qt3to4: -#include - -#include -#include -#include - -#define TRACKER_MAX_LINENO 2147483647 - -class LogListView : public RDListView -{ - Q_OBJECT - - public: - LogListView(QWidget *parent); - - private slots: - void aboutToShowData(); - void playData(); - void segueData(); - void stopData(); - - signals: - void transitionChanged(int line,RDLogLine::TransType trans); - - protected: - void contentsMousePressEvent(QMouseEvent *e); - - private: - Q3PopupMenu *log_menu; - RDListViewItem *log_menu_item; - QWidget *log_parent; - QString log_transition_type; -}; - - -#endif // LOG_LISTVIEW_H diff --git a/rdlogedit/rdlogedit.pro b/rdlogedit/rdlogedit.pro index 3b407ee4..43bec796 100644 --- a/rdlogedit/rdlogedit.pro +++ b/rdlogedit/rdlogedit.pro @@ -30,7 +30,6 @@ SOURCES += edit_log.cpp SOURCES += edit_logline.cpp SOURCES += edit_marker.cpp SOURCES += edit_track.cpp -SOURCES += list_listviewitem.cpp SOURCES += list_reports.cpp SOURCES += logmodel.cpp SOURCES += logtableview.cpp @@ -45,7 +44,6 @@ HEADERS += edit_logline.h HEADERS += edit_marker.h HEADERS += edit_track.h HEADERS += globals.h -HEADERS += list_listviewitem.h HEADERS += list_reports.h HEADERS += logmodel.h HEADERS += logtableview.h diff --git a/rdlogedit/voice_tracker.cpp b/rdlogedit/voice_tracker.cpp index 403e544e..bc339cdf 100644 --- a/rdlogedit/voice_tracker.cpp +++ b/rdlogedit/voice_tracker.cpp @@ -3161,7 +3161,7 @@ void VoiceTracker::DrawCursor(RDWavePainter *wp,int height,int xpos, if(left_arrow) { arrow_x=-8; } - Q3PointArray *pa=new Q3PointArray(3); + QPolygon *pa=new QPolygon(3); pa->setPoint(0,xpos,arrow_offset); pa->setPoint(1,xpos+arrow_x,arrow_offset-5); pa->setPoint(2,xpos+arrow_x,arrow_offset+5);