1 // Copyright 2010 Jochen Becher
3 // This file is part of MovieSchedule.
5 // MovieSchedule is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // MovieSchedule is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with MovieSchedule. If not, see <http://www.gnu.org/licenses/>.
18 #include "aboutdialog.h"
20 #include "ui_aboutdialog.h"
23 #include <QDesktopWidget>
25 AboutDialog::AboutDialog(QWidget *parent) :
27 ui(new Ui::AboutDialog)
30 ui->_button_box->addButton(ui->_done_button, QDialogButtonBox::AcceptRole);
31 ui->_button_box->addButton(ui->_contact_button, QDialogButtonBox::ActionRole);
32 //QPalette palette = ui->_about_text->palette();
33 //palette.setColor(QPalette::Base, palette.color(QPalette::Window));
34 //palette.setColor(QPalette::Text, palette.color(QPalette::WindowText));
35 //ui->_about_text->setPalette(palette);
36 connect(ui->_button_box, SIGNAL(accepted()), this, SLOT(deleteLater()));
37 connect(ui->_button_box, SIGNAL(rejected()), this, SLOT(deleteLater()));
38 connect(ui->_contact_button, SIGNAL(clicked()), this, SLOT(deleteLater()));
39 connect(ui->_contact_button, SIGNAL(clicked()), this, SIGNAL(ContactAuthor()));
40 connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(Rotate()));
44 AboutDialog::~AboutDialog()
49 void AboutDialog::Rotate()
51 bool landscape = UiUtils::IsLandscape();
52 ui->_dialog_layout->setDirection(landscape ? QBoxLayout::LeftToRight : QBoxLayout::TopToBottom);
53 ui->_button_box->setOrientation(landscape ? Qt::Vertical : Qt::Horizontal);