mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-28 22:52:37 +02:00
2016-06-07 Fred Gleason <fredg@paravelsystems.com>
* Made the 'Test Import' dialog resizeable in 'rdadmin/test_import.cpp' and 'rdadmin/test_import.h'.
This commit is contained in:
parent
adba9b1718
commit
5342d41f8d
@ -15206,3 +15206,6 @@
|
||||
2016-06-07 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Refactored 'rdlogmanager/generate_log.cpp' and
|
||||
'rdlogmanager/generate_log.h' to use 'QWidget::resizeEvent()'.
|
||||
2016-06-07 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Made the 'Test Import' dialog resizeable in
|
||||
'rdadmin/test_import.cpp' and 'rdadmin/test_import.h'.
|
||||
|
@ -19,7 +19,6 @@
|
||||
//
|
||||
|
||||
#include <qpushbutton.h>
|
||||
#include <qlabel.h>
|
||||
#include <qpainter.h>
|
||||
#include <qmessagebox.h>
|
||||
|
||||
@ -46,9 +45,7 @@ TestImport::TestImport(RDSvc *svc,RDSvc::ImportSource src,QWidget *parent)
|
||||
// Fix the Window Size
|
||||
//
|
||||
setMinimumWidth(sizeHint().width());
|
||||
setMaximumWidth(sizeHint().width());
|
||||
setMinimumHeight(sizeHint().height());
|
||||
setMaximumHeight(sizeHint().height());
|
||||
|
||||
switch(test_src) {
|
||||
case RDSvc::Traffic:
|
||||
@ -71,12 +68,10 @@ TestImport::TestImport(RDSvc *svc,RDSvc::ImportSource src,QWidget *parent)
|
||||
//
|
||||
// Date Selector
|
||||
//
|
||||
test_date_edit=new QDateEdit(this,"test_date_edit");
|
||||
test_date_edit->setGeometry(95,10,95,20);
|
||||
QLabel *label=new QLabel(test_date_edit,tr("Test Date:"),this,"test_date_label");
|
||||
label->setGeometry(5,10,85,20);
|
||||
label->setFont(font);
|
||||
label->setAlignment(AlignVCenter|AlignRight);
|
||||
test_date_edit=new QDateEdit(this);
|
||||
test_date_label=new QLabel(test_date_edit,tr("Test Date:"),this);
|
||||
test_date_label->setFont(font);
|
||||
test_date_label->setAlignment(AlignVCenter|AlignRight);
|
||||
test_date_edit->setDate(current_date);
|
||||
connect(test_date_edit,SIGNAL(valueChanged(const QDate &)),
|
||||
this,SLOT(dateChangedData(const QDate &)));
|
||||
@ -84,7 +79,7 @@ TestImport::TestImport(RDSvc *svc,RDSvc::ImportSource src,QWidget *parent)
|
||||
//
|
||||
// Select Date Button
|
||||
//
|
||||
QPushButton *button=new QPushButton(this,"select_date_button");
|
||||
QPushButton *button=new QPushButton(this);
|
||||
button->setGeometry(200,5,60,30);
|
||||
button->setFont(font);
|
||||
button->setText(tr("&Select"));
|
||||
@ -93,28 +88,25 @@ TestImport::TestImport(RDSvc *svc,RDSvc::ImportSource src,QWidget *parent)
|
||||
//
|
||||
// Import Button
|
||||
//
|
||||
button=new QPushButton(this,"import_button");
|
||||
button->setGeometry(30,45,sizeHint().width()-60,50);
|
||||
button->setFont(font);
|
||||
button->setText(tr("&Import"));
|
||||
connect(button,SIGNAL(clicked()),this,SLOT(importData()));
|
||||
test_import_button=new QPushButton(this);
|
||||
test_import_button->setFont(font);
|
||||
test_import_button->setText(tr("&Import"));
|
||||
connect(test_import_button,SIGNAL(clicked()),this,SLOT(importData()));
|
||||
|
||||
//
|
||||
// Import Filename
|
||||
//
|
||||
test_filename_edit=new QLineEdit(this);
|
||||
test_filename_edit->setReadOnly(true);
|
||||
test_filename_edit->setGeometry(10,133,sizeHint().width()-20,18);
|
||||
label=new QLabel(test_filename_edit,tr("Using source file:"),this);
|
||||
label->setGeometry(15,115,sizeHint().width()-30,18);
|
||||
label->setFont(font);
|
||||
test_filename_label=
|
||||
new QLabel(test_filename_edit,tr("Using source file:"),this);
|
||||
test_filename_label->setGeometry(15,115,sizeHint().width()-30,18);
|
||||
test_filename_label->setFont(font);
|
||||
|
||||
//
|
||||
// Events List
|
||||
//
|
||||
test_events_list=new RDListView(this);
|
||||
test_events_list->
|
||||
setGeometry(10,178,sizeHint().width()-20,sizeHint().height()-248);
|
||||
test_events_list->setItemMargin(2);
|
||||
test_events_list->addColumn(tr("Start Time"));
|
||||
test_events_list->setColumnAlignment(0,AlignCenter);
|
||||
@ -131,20 +123,17 @@ TestImport::TestImport(RDSvc *svc,RDSvc::ImportSource src,QWidget *parent)
|
||||
test_events_list->addColumn(tr("Announcement Type"));
|
||||
test_events_list->setColumnAlignment(6,AlignCenter);
|
||||
test_events_list->setColumnSortType(0,RDListView::LineSort);
|
||||
label=new QLabel(test_events_list,tr("Imported Events"),
|
||||
this,"test_events_label");
|
||||
label->setGeometry(15,160,sizeHint().width()-30,18);
|
||||
label->setFont(font);
|
||||
test_events_label=new QLabel(test_events_list,tr("Imported Events"),this);
|
||||
test_events_label->setGeometry(15,160,sizeHint().width()-30,18);
|
||||
test_events_label->setFont(font);
|
||||
|
||||
//
|
||||
// Close Button
|
||||
//
|
||||
button=new QPushButton(this);
|
||||
button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
|
||||
80,50);
|
||||
button->setFont(font);
|
||||
button->setText(tr("&Close"));
|
||||
connect(button,SIGNAL(clicked()),this,SLOT(closeData()));
|
||||
test_close_button=new QPushButton(this);
|
||||
test_close_button->setFont(font);
|
||||
test_close_button->setText(tr("&Close"));
|
||||
connect(test_close_button,SIGNAL(clicked()),this,SLOT(closeData()));
|
||||
|
||||
dateChangedData(current_date);
|
||||
}
|
||||
@ -157,7 +146,7 @@ TestImport::~TestImport()
|
||||
|
||||
QSize TestImport::sizeHint() const
|
||||
{
|
||||
return QSize(270,400);
|
||||
return QSize(700,400);
|
||||
}
|
||||
|
||||
|
||||
@ -279,7 +268,19 @@ void TestImport::paintEvent(QPaintEvent *e)
|
||||
QPainter *p=new QPainter(this);
|
||||
p->setPen(QColor(black));
|
||||
p->moveTo(10,105);
|
||||
p->lineTo(sizeHint().width()-20,105);
|
||||
p->lineTo(size().width()-20,105);
|
||||
p->end();
|
||||
delete p;
|
||||
}
|
||||
|
||||
|
||||
void TestImport::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
test_date_edit->setGeometry(95,10,95,20);
|
||||
test_date_label->setGeometry(5,10,85,20);
|
||||
test_filename_edit->setGeometry(10,133,size().width()-20,18);
|
||||
test_import_button->setGeometry(30,45,size().width()-60,50);
|
||||
test_events_list->
|
||||
setGeometry(10,178,size().width()-20,size().height()-248);
|
||||
test_close_button->setGeometry(size().width()-90,size().height()-60,80,50);
|
||||
}
|
||||
|
@ -23,7 +23,9 @@
|
||||
|
||||
#include <qdialog.h>
|
||||
#include <qsqldatabase.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qdatetimeedit.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
|
||||
#include <rdsvc.h>
|
||||
@ -46,13 +48,19 @@ class TestImport : public QDialog
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *e);
|
||||
void resizeEvent(QResizeEvent *e);
|
||||
|
||||
private:
|
||||
RDSvc *test_svc;
|
||||
RDSvc::ImportSource test_src;
|
||||
QLabel *test_date_label;
|
||||
QDateEdit *test_date_edit;
|
||||
QPushButton *test_import_button;
|
||||
QLabel *test_events_label;
|
||||
RDListView *test_events_list;
|
||||
QLabel *test_filename_label;
|
||||
QLineEdit *test_filename_edit;
|
||||
QPushButton *test_close_button;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user