2017-11-08 Fred Gleason <fredg@paravelsystems.com>

* Replaced the custom 'List Logs' dialog in rdlogedit(1) with
	RDListLog.
This commit is contained in:
Fred Gleason 2017-11-08 09:06:41 -05:00
parent 8d690a6296
commit 78c722e99b
13 changed files with 48 additions and 270 deletions

View File

@ -16331,3 +16331,6 @@
* Removed vestigal remnants of Host Security mode.
2017-11-08 Fred Gleason <fredg@paravelsystems.com>
* Added a filter widget to the 'RDListLog' dialog.
2017-11-08 Fred Gleason <fredg@paravelsystems.com>
* Replaced the custom 'List Logs' dialog in rdlogedit(1) with
RDListLog.

View File

@ -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\

View File

@ -20,9 +20,13 @@
#include <qpushbutton.h>
#include <qmessagebox.h>
#include <rddb.h>
#include <rdlist_logs.h>
#include <edit_chain.h>
#include <list_logs.h>
#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);
}

View File

@ -1,147 +0,0 @@
// list_logs.cpp
//
// Select a Rivendell Log
//
// (C) Copyright 2002-2004,2016 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 <qpushbutton.h>
#include <rddb.h>
#include <list_logs.h>
#include <globals.h>
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;
}

View File

@ -1,51 +0,0 @@
// list_logs.h
//
// Select a Rivendell Log
//
// (C) Copyright 2002-2004,2016 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 LIST_LOGS_H
#define LIST_LOGS_H
#include <qsqldatabase.h>
#include <qdialog.h>
#include <qlistview.h>
#include <qpushbutton.h>
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

View File

@ -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 {

View File

@ -651,27 +651,27 @@ vybrané služby!</translation>
<name>ListLogs</name>
<message>
<source>Select a Log</source>
<translation>Vybrat zápis</translation>
<translation type="obsolete">Vybrat zápis</translation>
</message>
<message>
<source>NAME</source>
<translation>NÁZEV</translation>
<translation type="obsolete">NÁZEV</translation>
</message>
<message>
<source>DESCRIPTION</source>
<translation>POPIS</translation>
<translation type="obsolete">POPIS</translation>
</message>
<message>
<source>SERVICE</source>
<translation>SLUŽBA</translation>
<translation type="obsolete">SLUŽBA</translation>
</message>
<message>
<source>&amp;OK</source>
<translation>&amp;OK</translation>
<translation type="obsolete">&amp;OK</translation>
</message>
<message>
<source>&amp;Cancel</source>
<translation>Z&amp;rušit</translation>
<translation type="obsolete">Z&amp;rušit</translation>
</message>
</context>
<context>

View File

@ -651,27 +651,27 @@ Gruppe des ausgewählten Service!</translation>
<name>ListLogs</name>
<message>
<source>Select a Log</source>
<translation>Ein Log auswählen</translation>
<translation type="obsolete">Ein Log auswählen</translation>
</message>
<message>
<source>NAME</source>
<translation>NAME</translation>
<translation type="obsolete">NAME</translation>
</message>
<message>
<source>DESCRIPTION</source>
<translation>BESCHREIBUNG</translation>
<translation type="obsolete">BESCHREIBUNG</translation>
</message>
<message>
<source>SERVICE</source>
<translation>SERVICE</translation>
<translation type="obsolete">SERVICE</translation>
</message>
<message>
<source>&amp;OK</source>
<translation>&amp;OK</translation>
<translation type="obsolete">&amp;OK</translation>
</message>
<message>
<source>&amp;Cancel</source>
<translation>Abbre&amp;chen</translation>
<translation type="obsolete">Abbre&amp;chen</translation>
</message>
</context>
<context>

View File

@ -651,27 +651,27 @@ desactivado para el servicio especificado!</translation>
<name>ListLogs</name>
<message>
<source>Select a Log</source>
<translation>Seleccione una Lista</translation>
<translation type="obsolete">Seleccione una Lista</translation>
</message>
<message>
<source>NAME</source>
<translation>NOMBRE</translation>
<translation type="obsolete">NOMBRE</translation>
</message>
<message>
<source>DESCRIPTION</source>
<translation>DESCRIPCIÓN</translation>
<translation type="obsolete">DESCRIPCIÓN</translation>
</message>
<message>
<source>SERVICE</source>
<translation>SERVICIO</translation>
<translation type="obsolete">SERVICIO</translation>
</message>
<message>
<source>&amp;OK</source>
<translation>&amp;Aceptar</translation>
<translation type="obsolete">&amp;Aceptar</translation>
</message>
<message>
<source>&amp;Cancel</source>
<translation>&amp;Cancelar</translation>
<translation type="obsolete">&amp;Cancelar</translation>
</message>
</context>
<context>

View File

@ -631,33 +631,6 @@ group for the specified service!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListLogs</name>
<message>
<source>Select a Log</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>NAME</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>DESCRIPTION</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>SERVICE</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;Cancel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListReports</name>
<message>

View File

@ -673,27 +673,27 @@ som er skrudd av for denne tenesta!</translation>
<name>ListLogs</name>
<message>
<source>Select a Log</source>
<translation>Vel ein logg</translation>
<translation type="obsolete">Vel ein logg</translation>
</message>
<message>
<source>NAME</source>
<translation>NAMN</translation>
<translation type="obsolete">NAMN</translation>
</message>
<message>
<source>DESCRIPTION</source>
<translation>SKILDRING</translation>
<translation type="obsolete">SKILDRING</translation>
</message>
<message>
<source>SERVICE</source>
<translation>TENEST</translation>
<translation type="obsolete">TENEST</translation>
</message>
<message>
<source>&amp;OK</source>
<translation>&amp;OK</translation>
<translation type="obsolete">&amp;OK</translation>
</message>
<message>
<source>&amp;Cancel</source>
<translation>&amp;Avbryt</translation>
<translation type="obsolete">&amp;Avbryt</translation>
</message>
</context>
<context>

View File

@ -673,27 +673,27 @@ som er skrudd av for denne tenesta!</translation>
<name>ListLogs</name>
<message>
<source>Select a Log</source>
<translation>Vel ein logg</translation>
<translation type="obsolete">Vel ein logg</translation>
</message>
<message>
<source>NAME</source>
<translation>NAMN</translation>
<translation type="obsolete">NAMN</translation>
</message>
<message>
<source>DESCRIPTION</source>
<translation>SKILDRING</translation>
<translation type="obsolete">SKILDRING</translation>
</message>
<message>
<source>SERVICE</source>
<translation>TENEST</translation>
<translation type="obsolete">TENEST</translation>
</message>
<message>
<source>&amp;OK</source>
<translation>&amp;OK</translation>
<translation type="obsolete">&amp;OK</translation>
</message>
<message>
<source>&amp;Cancel</source>
<translation>&amp;Avbryt</translation>
<translation type="obsolete">&amp;Avbryt</translation>
</message>
</context>
<context>

View File

@ -653,27 +653,27 @@ Ação se Evento anterior estiver sendo executado</translation>
<name>ListLogs</name>
<message>
<source>Select a Log</source>
<translation>Selecionar a Lista</translation>
<translation type="obsolete">Selecionar a Lista</translation>
</message>
<message>
<source>NAME</source>
<translation>NOME</translation>
<translation type="obsolete">NOME</translation>
</message>
<message>
<source>DESCRIPTION</source>
<translation>DESCRIÇÃO</translation>
<translation type="obsolete">DESCRIÇÃO</translation>
</message>
<message>
<source>SERVICE</source>
<translation>SERVIÇO</translation>
<translation type="obsolete">SERVIÇO</translation>
</message>
<message>
<source>&amp;OK</source>
<translation>&amp;OK</translation>
<translation type="obsolete">&amp;OK</translation>
</message>
<message>
<source>&amp;Cancel</source>
<translation>&amp;Cancelar</translation>
<translation type="obsolete">&amp;Cancelar</translation>
</message>
</context>
<context>