[qt] Added Close button to Downloader

This commit is contained in:
Alex Zolotarev 2011-03-25 16:53:10 +00:00 committed by Alex Zolotarev
parent 1074e27244
commit d9f0eb0f28
2 changed files with 14 additions and 1 deletions

View file

@ -66,8 +66,13 @@ namespace qt
m_label = new QLabel(QString(QObject::tr(LAST_UPDATE_CHECK)) + timeString.c_str(), this);
m_updateButton = new QPushButton(QObject::tr(CHECK_FOR_UPDATE), this);
m_updateButton->setDefault(false);
connect(m_updateButton, SIGNAL(clicked()), this, SLOT(OnUpdateClick()));
QPushButton * closeButton = new QPushButton(QObject::tr("Close"), this);
closeButton->setDefault(true);
connect(closeButton, SIGNAL(clicked()), this, SLOT(OnCloseClick()));
m_tree = new QTreeWidget(this);
m_tree->setColumnCount(KNumberOfColumns);
QStringList columnLabels;
@ -78,9 +83,11 @@ namespace qt
QHBoxLayout * horizontalLayout = new QHBoxLayout();
horizontalLayout->addWidget(m_label);
horizontalLayout->addWidget(m_updateButton);
horizontalLayout->addWidget(closeButton);
QVBoxLayout * verticalLayout = new QVBoxLayout();
verticalLayout->addLayout(horizontalLayout);
verticalLayout->addWidget(m_tree);
verticalLayout->addLayout(horizontalLayout);
setLayout(verticalLayout);
setWindowTitle(tr("Geographical Regions"));
@ -189,6 +196,11 @@ namespace qt
m_storage.CheckForUpdate();
}
void UpdateDialog::OnCloseClick()
{
done(0);
}
/// Changes row's text color
void SetRowColor(QTreeWidgetItem & item, QColor const & color)
{

View file

@ -32,6 +32,7 @@ namespace qt
private slots:
void OnItemClick(QTreeWidgetItem * item, int column);
void OnUpdateClick();
void OnCloseClick();
private:
void FillTree();