5 DevTools::DevTools(QWidget *parent):
6 QDialog(parent, Qt::Dialog | Qt::WindowTitleHint |
7 Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint)
9 setWindowTitle(tr("Developer"));
10 QScrollArea *scroller = new QScrollArea(this);
11 scroller->setFrameStyle(QFrame::NoFrame);
13 scroller->setProperty("FingerScrollable", true);
14 scroller->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
16 scroller->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
17 setSizeGripEnabled(true);
18 #endif // Q_WS_MAEMO_5
19 scroller->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
21 QWidget *contents = new QWidget(scroller);
22 QVBoxLayout *layout = new QVBoxLayout(contents);
24 QPushButton *clearSettings = new QPushButton("Clear persistent data", this);
25 connect(clearSettings, SIGNAL(clicked()), this, SLOT(onClear()));
26 layout->addWidget(clearSettings);
28 contents->setLayout(layout);
29 scroller->setWidget(contents);
31 QHBoxLayout *dialogLayout = new QHBoxLayout();
32 dialogLayout->addWidget(scroller);
33 setLayout(dialogLayout);
36 void DevTools::onClear()
38 if (QMessageBox::Yes ==
39 QMessageBox::question(this, "Clear persistent data?",
40 "Library and settings data will be cleared, "
41 "application will be restarted. Continue?",
48 QApplication::exit(1000);