mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-11 09:03:40 +02:00
2021-08-11 Fred Gleason <fredg@paravelsystems.com>
* Added an 'RDDateEdit' widget. * Adjusted layout in the 'Test Import' dialog in rdadmin(1) to be compatible with short date format. * Adjusted layout in the 'Cut Info/Record' dialog in rdlibrary(1) to be compatible with short date format. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -25,4 +25,26 @@ RDDateEdit::RDDateEdit(QWidget *parent)
|
||||
: QDateEdit(parent)
|
||||
{
|
||||
setDisplayFormat(rda->shortDateFormat());
|
||||
|
||||
d_read_only=false;
|
||||
}
|
||||
|
||||
|
||||
bool RDDateEdit::isReadOnly()
|
||||
{
|
||||
return d_read_only;
|
||||
}
|
||||
|
||||
|
||||
void RDDateEdit::setReadOnly(bool state)
|
||||
{
|
||||
if(d_read_only!=state) {
|
||||
if(state) {
|
||||
setDateRange(date(),date());
|
||||
}
|
||||
else {
|
||||
setDateRange(QDate(),QDate());
|
||||
}
|
||||
d_read_only=state;
|
||||
}
|
||||
}
|
||||
|
@@ -28,6 +28,13 @@ class RDDateEdit : public QDateEdit
|
||||
Q_OBJECT
|
||||
public:
|
||||
RDDateEdit(QWidget *parent=0);
|
||||
bool isReadOnly();
|
||||
|
||||
public slots:
|
||||
void setReadOnly(bool state);
|
||||
|
||||
private:
|
||||
bool d_read_only;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -31,6 +31,7 @@ RDTimeEdit::RDTimeEdit(QWidget *parent)
|
||||
d_show_tenths=false;
|
||||
d_step_enabled=StepDownEnabled|StepUpEnabled;
|
||||
d_width_variance=0;
|
||||
d_read_only=false;
|
||||
|
||||
SetFormat();
|
||||
}
|
||||
@@ -66,6 +67,26 @@ void RDTimeEdit::setShowTenths(bool state)
|
||||
}
|
||||
|
||||
|
||||
bool RDTimeEdit::isReadOnly() const
|
||||
{
|
||||
return d_read_only;
|
||||
}
|
||||
|
||||
|
||||
void RDTimeEdit::setReadOnly(bool state)
|
||||
{
|
||||
if(d_read_only!=state) {
|
||||
if(state) {
|
||||
setTimeRange(time(),time());
|
||||
}
|
||||
else {
|
||||
setTimeRange(QTime(),QTime());
|
||||
}
|
||||
d_read_only=state;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QValidator::State RDTimeEdit::validate(QString &input,int &pos) const
|
||||
{
|
||||
QValidator::State ret=QTimeEdit::validate(input,pos);
|
||||
|
@@ -33,6 +33,10 @@ class RDTimeEdit : public QTimeEdit
|
||||
void setShowHours(bool state);
|
||||
bool showTenths() const;
|
||||
void setShowTenths(bool state);
|
||||
bool isReadOnly() const;
|
||||
|
||||
public slots:
|
||||
void setReadOnly(bool state);
|
||||
|
||||
protected:
|
||||
QValidator::State validate(QString &input,int &pos) const;
|
||||
@@ -46,6 +50,7 @@ class RDTimeEdit : public QTimeEdit
|
||||
bool d_show_tenths;
|
||||
int d_width_variance;
|
||||
QAbstractSpinBox::StepEnabled d_step_enabled;
|
||||
bool d_read_only;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user