diff --git a/ChangeLog b/ChangeLog index b32afe22..77048f94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16331,3 +16331,6 @@ * Removed vestigal remnants of Host Security mode. 2017-11-08 Fred Gleason * Added a filter widget to the 'RDListLog' dialog. +2017-11-08 Fred Gleason + * Replaced the custom 'List Logs' dialog in rdlogedit(1) with + RDListLog. diff --git a/rdlogedit/Makefile.am b/rdlogedit/Makefile.am index c2fd4d25..e040cd98 100644 --- a/rdlogedit/Makefile.am +++ b/rdlogedit/Makefile.am @@ -52,7 +52,6 @@ dist_rdlogedit_SOURCES = add_meta.cpp add_meta.h\ import_track.cpp import_track.h\ list_listviewitem.cpp list_listviewitem.h\ list_reports.cpp list_reports.h\ - list_logs.cpp list_logs.h\ log_listview.cpp log_listview.h\ rdlogedit.cpp rdlogedit.h globals.h\ render_dialog.cpp render_dialog.h\ @@ -66,7 +65,6 @@ nodist_rdlogedit_SOURCES = moc_add_meta.cpp\ moc_edit_marker.cpp\ moc_edit_track.cpp\ moc_import_track.cpp\ - moc_list_logs.cpp\ moc_list_reports.cpp\ moc_log_listview.cpp\ moc_rdlogedit.cpp\ diff --git a/rdlogedit/edit_chain.cpp b/rdlogedit/edit_chain.cpp index 7302c080..f8c44db3 100644 --- a/rdlogedit/edit_chain.cpp +++ b/rdlogedit/edit_chain.cpp @@ -20,9 +20,13 @@ #include #include + #include +#include + #include -#include + +#include "globals.h" EditChain::EditChain(RDLogLine *line,QWidget *parent) : QDialog(parent,"",true) @@ -285,12 +289,12 @@ void EditChain::selectLogData() { QString logname; - ListLogs *list=new ListLogs(&logname,this); - if(list->exec()<0) { - delete list; + RDListLogs *d=new RDListLogs(&logname,log_config->stationName(),this); + if(d->exec()!=0) { + delete d; return; } - delete list; + delete d; edit_label_edit->setText(logname); labelChangedData(logname); } diff --git a/rdlogedit/list_logs.cpp b/rdlogedit/list_logs.cpp deleted file mode 100644 index 3ce6a820..00000000 --- a/rdlogedit/list_logs.cpp +++ /dev/null @@ -1,147 +0,0 @@ -// list_logs.cpp -// -// Select a Rivendell Log -// -// (C) Copyright 2002-2004,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 - -ListLogs::ListLogs(QString *logname,QWidget *parent) - : QDialog(parent,"",true) -{ - // - // Fix the Window Size - // - setMinimumWidth(sizeHint().width()); - setMaximumWidth(sizeHint().width()); - setMinimumHeight(sizeHint().height()); - setMaximumHeight(sizeHint().height()); - - // - // Generate Fonts - // - QFont button_font("Helvetica",12,QFont::Bold); - button_font.setPixelSize(12); - - list_logname=logname; - - setCaption(tr("Select a Log")); - - // - // Log List - // - list_log_list=new QListView(this); - list_log_list->setGeometry(10,10, - sizeHint().width()-20,sizeHint().height()-80); - list_log_list->setAllColumnsShowFocus(true); - list_log_list->setItemMargin(5); - connect(list_log_list, - SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)), - this, - SLOT(doubleClickedData(QListViewItem *,const QPoint &,int))); - list_log_list->addColumn(tr("NAME")); - list_log_list->setColumnAlignment(0,Qt::AlignLeft); - list_log_list->addColumn(tr("DESCRIPTION")); - list_log_list->setColumnAlignment(1,Qt::AlignLeft); - list_log_list->addColumn(tr("SERVICE")); - list_log_list->setColumnAlignment(2,Qt::AlignLeft); - - // - // Load Button - // - QPushButton *button=new QPushButton(this); - button->setGeometry(10,sizeHint().height()-60,80,50); - button->setFont(button_font); - button->setText(tr("&OK")); - connect(button,SIGNAL(clicked()),this,SLOT(okButtonData())); - - // - // Cancel Button - // - button=new QPushButton(this); - button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50); - button->setFont(button_font); - button->setText(tr("&Cancel")); - button->setDefault(true); - connect(button,SIGNAL(clicked()),this,SLOT(cancelButtonData())); - - RefreshList(); -} - - -QSize ListLogs::sizeHint() const -{ - return QSize(400,300); -} - - -QSizePolicy ListLogs::sizePolicy() const -{ - return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); -} - - -void ListLogs::closeEvent(QCloseEvent *e) -{ - done(1); -} - - -void ListLogs::doubleClickedData(QListViewItem *,const QPoint &,int) -{ - okButtonData(); -} - - -void ListLogs::okButtonData() -{ - QListViewItem *item=list_log_list->selectedItem(); - if(item==NULL) { - return; - } - *list_logname=item->text(0); - done(0); -} - - -void ListLogs::cancelButtonData() -{ - done(-1); -} - - -void ListLogs::RefreshList() -{ - RDSqlQuery *q; - QString sql; - QListViewItem *l; - - list_log_list->clear(); // Note: clear here, in case user has no perms. - - sql="select NAME,DESCRIPTION,SERVICE from LOGS where TYPE=0"; - q=new RDSqlQuery(sql); - while(q->next()) { - l=new QListViewItem(list_log_list); - l->setText(0,q->value(0).toString()); - l->setText(1,q->value(1).toString()); - l->setText(2,q->value(2).toString()); - } - delete q; -} diff --git a/rdlogedit/list_logs.h b/rdlogedit/list_logs.h deleted file mode 100644 index 122db8dc..00000000 --- a/rdlogedit/list_logs.h +++ /dev/null @@ -1,51 +0,0 @@ -// list_logs.h -// -// Select a Rivendell Log -// -// (C) Copyright 2002-2004,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_LOGS_H -#define LIST_LOGS_H - -#include -#include -#include -#include - -class ListLogs : public QDialog -{ - Q_OBJECT - - public: - ListLogs(QString *logname,QWidget *parent=0); - QSize sizeHint() const; - QSizePolicy sizePolicy() const; - - private slots: - void doubleClickedData(QListViewItem *,const QPoint &,int); - void closeEvent(QCloseEvent *); - void okButtonData(); - void cancelButtonData(); - - private: - void RefreshList(); - QListView *list_log_list; - QString *list_logname; -}; - - -#endif diff --git a/rdlogedit/rdlogedit.pro b/rdlogedit/rdlogedit.pro index a0ee72e2..5c9685a0 100644 --- a/rdlogedit/rdlogedit.pro +++ b/rdlogedit/rdlogedit.pro @@ -38,7 +38,6 @@ SOURCES += edit_logline.cpp SOURCES += edit_marker.cpp SOURCES += edit_track.cpp SOURCES += list_listviewitem.cpp -SOURCES += list_logs.cpp SOURCES += list_reports.cpp SOURCES += rdlogedit.cpp x11 { @@ -55,7 +54,6 @@ HEADERS += edit_marker.h HEADERS += edit_track.h HEADERS += globals.h HEADERS += list_listviewitem.h -HEADERS += list_logs.h HEADERS += list_reports.h HEADERS += rdlogedit.h x11 { diff --git a/rdlogedit/rdlogedit_cs.ts b/rdlogedit/rdlogedit_cs.ts index 7ef7a99b..62e0d364 100644 --- a/rdlogedit/rdlogedit_cs.ts +++ b/rdlogedit/rdlogedit_cs.ts @@ -651,27 +651,27 @@ vybrané služby! ListLogs Select a Log - Vybrat zápis + Vybrat zápis NAME - NÁZEV + NÁZEV DESCRIPTION - POPIS + POPIS SERVICE - SLUŽBA + SLUŽBA &OK - &OK + &OK &Cancel - Z&rušit + Z&rušit diff --git a/rdlogedit/rdlogedit_de.ts b/rdlogedit/rdlogedit_de.ts index 388effed..fb877752 100644 --- a/rdlogedit/rdlogedit_de.ts +++ b/rdlogedit/rdlogedit_de.ts @@ -651,27 +651,27 @@ Gruppe des ausgewählten Service! ListLogs Select a Log - Ein Log auswählen + Ein Log auswählen NAME - NAME + NAME DESCRIPTION - BESCHREIBUNG + BESCHREIBUNG SERVICE - SERVICE + SERVICE &OK - &OK + &OK &Cancel - Abbre&chen + Abbre&chen diff --git a/rdlogedit/rdlogedit_es.ts b/rdlogedit/rdlogedit_es.ts index 443133c5..dca8b09d 100644 --- a/rdlogedit/rdlogedit_es.ts +++ b/rdlogedit/rdlogedit_es.ts @@ -651,27 +651,27 @@ desactivado para el servicio especificado! ListLogs Select a Log - Seleccione una Lista + Seleccione una Lista NAME - NOMBRE + NOMBRE DESCRIPTION - DESCRIPCIÓN + DESCRIPCIÓN SERVICE - SERVICIO + SERVICIO &OK - &Aceptar + &Aceptar &Cancel - &Cancelar + &Cancelar diff --git a/rdlogedit/rdlogedit_fr.ts b/rdlogedit/rdlogedit_fr.ts index 01c749fd..29c17faf 100644 --- a/rdlogedit/rdlogedit_fr.ts +++ b/rdlogedit/rdlogedit_fr.ts @@ -631,33 +631,6 @@ group for the specified service! - - ListLogs - - Select a Log - - - - NAME - - - - DESCRIPTION - - - - SERVICE - - - - &OK - - - - &Cancel - - - ListReports diff --git a/rdlogedit/rdlogedit_nb.ts b/rdlogedit/rdlogedit_nb.ts index e4447616..8ceecb25 100644 --- a/rdlogedit/rdlogedit_nb.ts +++ b/rdlogedit/rdlogedit_nb.ts @@ -673,27 +673,27 @@ som er skrudd av for denne tenesta! ListLogs Select a Log - Vel ein logg + Vel ein logg NAME - NAMN + NAMN DESCRIPTION - SKILDRING + SKILDRING SERVICE - TENEST + TENEST &OK - &OK + &OK &Cancel - &Avbryt + &Avbryt diff --git a/rdlogedit/rdlogedit_nn.ts b/rdlogedit/rdlogedit_nn.ts index e4447616..8ceecb25 100644 --- a/rdlogedit/rdlogedit_nn.ts +++ b/rdlogedit/rdlogedit_nn.ts @@ -673,27 +673,27 @@ som er skrudd av for denne tenesta! ListLogs Select a Log - Vel ein logg + Vel ein logg NAME - NAMN + NAMN DESCRIPTION - SKILDRING + SKILDRING SERVICE - TENEST + TENEST &OK - &OK + &OK &Cancel - &Avbryt + &Avbryt diff --git a/rdlogedit/rdlogedit_pt_BR.ts b/rdlogedit/rdlogedit_pt_BR.ts index 0ef196c0..777837f5 100644 --- a/rdlogedit/rdlogedit_pt_BR.ts +++ b/rdlogedit/rdlogedit_pt_BR.ts @@ -653,27 +653,27 @@ Ação se Evento anterior estiver sendo executado ListLogs Select a Log - Selecionar a Lista + Selecionar a Lista NAME - NOME + NOME DESCRIPTION - DESCRIÇÃO + DESCRIÇÃO SERVICE - SERVIÇO + SERVIÇO &OK - &OK + &OK &Cancel - &Cancelar + &Cancelar