-void AdopterWindow::show()
-{
- Trace t("AdopterWindow::show");
-#ifdef Q_OS_SYMBIAN
- foreach (QWidget *w, QApplication::allWidgets()) {
- w->setContextMenuPolicy(Qt::NoContextMenu);
- }
- showMaximized();
-#else
- QMainWindow::show();
-#endif
-}
-
-QAction *AdopterWindow::addToolBarAction(QObject *receiver,
- const char *member,
- const QString &iconName,
- const QString &text,
- bool important)
-{
- TRACE;
- qDebug() << "icon" << iconName << "text" << text;
- QAction *action;
-#ifndef Q_OS_SYMBIAN
- Q_UNUSED(important);
- action = toolBar->addAction(QIcon(Platform::instance()->icon(iconName)),
- text, receiver, member);
-#else
- if (!toolBar && important) {
- // Create tool bar if needed
- toolBar = new QToolBar("", this);
- // toolBar->setFixedHeight(63);
- toolBar->setStyleSheet("margin:0; border:0; padding:0");
- toolBar->setSizePolicy(QSizePolicy::MinimumExpanding,
- QSizePolicy::Maximum);
- addToolBar(Qt::BottomToolBarArea, toolBar);
- }
- if (important) {
- // Add tool bar action
- QPushButton *button = new QPushButton(this);
- button->setIconSize(QSize(60, 60));
- button->setFixedSize(89, 60);
- button->setIcon(QIcon(Platform::instance()->icon(iconName)));
- button->setSizePolicy(QSizePolicy::MinimumExpanding,
- QSizePolicy::Maximum);
- connect(button, SIGNAL(clicked()), receiver, member);
- toolBar->addWidget(button);
- }
- // Add menu action, too
- action = new QAction(text, this);
- menuBar()->addAction(action);
- connect(action, SIGNAL(triggered()), receiver, member);
-#endif
-
-#if defined Q_WS_MAEMO_5
- action->setText("");
- action->setToolTip("");
-#endif
-
- return action;
-}
-
-void AdopterWindow::addToolBarSpace()
-{
-#ifndef Q_OS_SYMBIAN
- QFrame *frame = new QFrame(toolBar);
- frame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
- toolBar->addWidget(frame);
-#endif
-}
-