mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2026-01-12 07:35:55 +01:00
2021-08-03 Fred Gleason <fredg@paravelsystems.com>
* Added 'SYSTEM.LONG_DATE_FORMAT', 'SYSTEM.SHORT_DATE_FORMAT' and 'SYSTEM.TIME_FORMAT' fields to the database. * Incremented the database version to 351. * Added 'RDSystem::longDateFormat()', 'RDSystem'setLongDateFormat()', 'RDSystem::shortDateFormat()', 'RDSystem::setShortDateFormat()', 'RDSystem::timeFormat()' and 'RDSystem::setTimeFormat()' methods. * Added a 'Date/Time Formats' section to the 'System-Wide Settings' dialog in rdadmin(1). Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// The Current Database Schema Version for Rivendell
|
||||
//
|
||||
// (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
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@@ -24,7 +24,7 @@
|
||||
/*
|
||||
* Current Database Version
|
||||
*/
|
||||
#define RD_VERSION_DATABASE 350
|
||||
#define RD_VERSION_DATABASE 351
|
||||
|
||||
|
||||
#endif // DBVERSION_H
|
||||
|
||||
9
lib/rd.h
9
lib/rd.h
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// System-Wide Values for Rivendell
|
||||
//
|
||||
// (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
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@@ -649,5 +649,12 @@
|
||||
#define RD_LISTWIDGET_ITEM_HEIGHT 25
|
||||
#define RD_LISTWIDGET_ITEM_WIDTH_PADDING 20
|
||||
|
||||
/*
|
||||
* Default Date/Time Formats
|
||||
*/
|
||||
#define RD_DEFAULT_LONG_DATE_FORMAT "dddd, MMMM d yyyy"
|
||||
#define RD_DEFAULT_SHORT_DATE_FORMAT "MM/dd/yy"
|
||||
#define RD_DEFAULT_TIME_FORMAT "hh:mm:ss"
|
||||
|
||||
|
||||
#endif // RD_H
|
||||
|
||||
@@ -205,6 +205,42 @@ void RDSystem::setRssProcessorStation(const QString &str) const
|
||||
}
|
||||
|
||||
|
||||
QString RDSystem::longDateFormat() const
|
||||
{
|
||||
return GetValue("LONG_DATE_FORMAT").toString();
|
||||
}
|
||||
|
||||
|
||||
void RDSystem::setLongDateFormat(const QString &str)
|
||||
{
|
||||
SetRow("LONG_DATE_FORMAT",str);
|
||||
}
|
||||
|
||||
|
||||
QString RDSystem::shortDateFormat() const
|
||||
{
|
||||
return GetValue("SHORT_DATE_FORMAT").toString();
|
||||
}
|
||||
|
||||
|
||||
void RDSystem::setShortDateFormat(const QString &str)
|
||||
{
|
||||
SetRow("SHORT_DATE_FORMAT",str);
|
||||
}
|
||||
|
||||
|
||||
QString RDSystem::timeFormat() const
|
||||
{
|
||||
return GetValue("TIME_FORMAT").toString();
|
||||
}
|
||||
|
||||
|
||||
void RDSystem::setTimeFormat(const QString &str)
|
||||
{
|
||||
SetRow("TIME_FORMAT",str);
|
||||
}
|
||||
|
||||
|
||||
QString RDSystem::xml() const
|
||||
{
|
||||
QString xml="<systemSettings>\n";
|
||||
@@ -214,6 +250,9 @@ QString RDSystem::xml() const
|
||||
xml+=RDXmlField("maxPostLength",maxPostLength());
|
||||
xml+=RDXmlField("isciXreferencePath",isciXreferencePath());
|
||||
xml+=RDXmlField("tempCartGroup",tempCartGroup());
|
||||
xml+=RDXmlField("longDateFormat",longDateFormat());
|
||||
xml+=RDXmlField("shortDateFormat",shortDateFormat());
|
||||
xml+=RDXmlField("timeFormat",timeFormat());
|
||||
xml+="</systemSettings>\n";
|
||||
|
||||
return xml;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// System-wide Rivendell settings
|
||||
//
|
||||
// (C) Copyright 2009,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2009-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
|
||||
@@ -48,6 +48,12 @@ class RDSystem
|
||||
void setNotificationAddress(const QHostAddress &addr);
|
||||
QString rssProcessorStation() const;
|
||||
void setRssProcessorStation(const QString &str=QString()) const;
|
||||
QString longDateFormat() const;
|
||||
void setLongDateFormat(const QString &str);
|
||||
QString shortDateFormat() const;
|
||||
void setShortDateFormat(const QString &str);
|
||||
QString timeFormat() const;
|
||||
void setTimeFormat(const QString &str);
|
||||
QString xml() const;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user