mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-16 23:51:20 +02:00
2024-08-26 Fred Gleason <fredg@paravelsystems.com>
* Modified the 'Select Log' dialog in the voice tracker in rdairplay(1) so as to retain previous service selection across invocations. * Modified the 'Podcast Item List' dialog in rdcastmanager(1) so as to retain previous service selection across invocations. * Modified the 'Edit Log Chain' dialog in rdlogedit(1) so as to retain previous user group selection across invocations. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Select a Rivendell Log
|
||||
//
|
||||
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2024 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
|
||||
@@ -23,12 +23,10 @@
|
||||
#include "rdescape_string.h"
|
||||
#include "rdlist_logs.h"
|
||||
|
||||
RDListLogs::RDListLogs(QString *logname,RDLogFilter::FilterMode mode,
|
||||
const QString &caption,QWidget *parent)
|
||||
RDListLogs::RDListLogs(RDLogFilter::FilterMode mode,const QString &caption,
|
||||
QWidget *parent)
|
||||
: RDDialog(parent)
|
||||
{
|
||||
list_logname=logname;
|
||||
|
||||
//
|
||||
// Fix the Window Size
|
||||
//
|
||||
@@ -73,9 +71,6 @@ RDListLogs::RDListLogs(QString *logname,RDLogFilter::FilterMode mode,
|
||||
list_cancel_button->setText(tr("Cancel"));
|
||||
list_cancel_button->setDefault(true);
|
||||
connect(list_cancel_button,SIGNAL(clicked()),this,SLOT(cancelButtonData()));
|
||||
|
||||
list_log_model->setFilterSql(list_filter_widget->whereSql(),
|
||||
list_filter_widget->limitSql());
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +86,18 @@ QSizePolicy RDListLogs::sizePolicy() const
|
||||
}
|
||||
|
||||
|
||||
int RDListLogs::exec(QString *logname)
|
||||
{
|
||||
list_logname=logname;
|
||||
|
||||
list_filter_widget->changeUser();
|
||||
list_log_model->setFilterSql(list_filter_widget->whereSql(),
|
||||
list_filter_widget->limitSql());
|
||||
|
||||
return QDialog::exec();
|
||||
}
|
||||
|
||||
|
||||
void RDListLogs::closeEvent(QCloseEvent *e)
|
||||
{
|
||||
cancelButtonData();
|
||||
@@ -114,7 +121,8 @@ void RDListLogs::okButtonData()
|
||||
if(list_log_view->selectionModel()->selectedRows().size()!=1) {
|
||||
return;
|
||||
}
|
||||
*list_logname=list_log_model->logName(list_log_view->selectionModel()->selectedRows().at(0));
|
||||
*list_logname=list_log_model->
|
||||
logName(list_log_view->selectionModel()->selectedRows().at(0));
|
||||
|
||||
done(true);
|
||||
}
|
||||
|
@@ -37,11 +37,14 @@ class RDListLogs : public RDDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
RDListLogs(QString *logname,RDLogFilter::FilterMode mode,
|
||||
const QString &caption,QWidget *parent=0);
|
||||
RDListLogs(RDLogFilter::FilterMode mode,const QString &caption,
|
||||
QWidget *parent);
|
||||
QSize sizeHint() const;
|
||||
QSizePolicy sizePolicy() const;
|
||||
|
||||
public slots:
|
||||
int exec(QString *logname);
|
||||
|
||||
private slots:
|
||||
void doubleClickedData(const QModelIndex &index);
|
||||
void closeEvent(QCloseEvent *);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Filter widget for picking Rivendell logs.
|
||||
//
|
||||
// (C) Copyright 2017-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2017-2024 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
|
||||
@@ -184,18 +184,22 @@ QString RDLogFilter::limitSql() const
|
||||
void RDLogFilter::changeUser()
|
||||
{
|
||||
if(filter_filter_mode==RDLogFilter::UserFilter) {
|
||||
filter_service_box->clear();
|
||||
filter_service_box->insertItem(filter_service_box->count(),tr("ALL"));
|
||||
QString sql=QString("select `SERVICE_NAME` from `USER_SERVICE_PERMS` where ")+
|
||||
"`USER_NAME`='"+RDEscapeString(rda->user()->name())+"' "+
|
||||
"order by `SERVICE_NAME`";
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
filter_service_box->
|
||||
insertItem(filter_service_box->count(),rda->iconEngine()->serviceIcon(),
|
||||
q->value(0).toString());
|
||||
if(filter_current_username!=rda->user()->name()) {
|
||||
filter_service_box->clear();
|
||||
filter_service_box->insertItem(filter_service_box->count(),tr("ALL"));
|
||||
QString sql=
|
||||
QString("select `SERVICE_NAME` from `USER_SERVICE_PERMS` where ")+
|
||||
"`USER_NAME`='"+RDEscapeString(rda->user()->name())+"' "+
|
||||
"order by `SERVICE_NAME`";
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
filter_service_box->insertItem(filter_service_box->count(),
|
||||
rda->iconEngine()->serviceIcon(),
|
||||
q->value(0).toString());
|
||||
}
|
||||
delete q;
|
||||
filter_current_username=rda->user()->name();
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Filter widget for picking Rivendell logs.
|
||||
//
|
||||
// (C) Copyright 2017-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2017-2024 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
|
||||
@@ -69,6 +69,7 @@ class RDLogFilter : public QWidget
|
||||
QPushButton *filter_clear_button;
|
||||
QCheckBox *filter_recent_check;
|
||||
QLabel *filter_recent_label;
|
||||
QString filter_current_username;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user