X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=woller.cpp;h=529835d51d3f7259afbabbb7d80cc04773a20f6b;hb=dfb695173c41a1ec53b4c351d0c08b9f1b0d5572;hp=58d1e85b5dd47ef4bc3bb9df20731d434234d2f4;hpb=5c2b161963edcab6d2d03284b3d59623106c197c;p=woller diff --git a/woller.cpp b/woller.cpp index 58d1e85..529835d 100644 --- a/woller.cpp +++ b/woller.cpp @@ -16,8 +16,25 @@ // along with Woller. If not, see . +#ifdef Q_WS_MAEMO_5 + #include +#endif #include "woller.h" +MainWindow::MainWindow() +{ +//#ifdef Q_WS_MAEMO_5 +// this->setAttribute(Qt::WA_Maemo5StackedWindow); +//#endif + woller = new Woller; + this->setCentralWidget(woller); +} + +MainWindow::~MainWindow() +{ + delete woller; +} + Woller::Woller(QWidget *parent) : QWidget(parent) @@ -47,6 +64,11 @@ Woller::Woller(QWidget *parent) vlayout->addLayout(hlayout); this->setLayout(vlayout); this->setWindowTitle(tr("Woller-program")); +#ifdef Q_WS_MAEMO_5 + this->setAttribute(Qt::WA_Maemo5StackedWindow); +#else + this->setWindowModality(Qt::ApplicationModal); +#endif //populate CB load_config(); @@ -111,7 +133,6 @@ void Woller::targets_act(int i) // build the config widget qDebug() << "building the config" << endl; config_win = new ConfigWidget(0, hosts_list); - config_win->setWindowModality(Qt::ApplicationModal); connect(config_win, SIGNAL(hosts_changed()), this, SLOT(hosts_changed())); config_win->show(); } @@ -187,6 +208,12 @@ ConfigWidget::ConfigWidget(QWidget *parent, QList *hosts) //add buttons and the list this->setWindowTitle(tr("Woller Config")); +#ifdef Q_WS_MAEMO_5 + this->setAttribute(Qt::WA_Maemo5StackedWindow); + this->setWindowFlags(this->windowFlags() | Qt::Window); +#else + this->setWindowModality(Qt::ApplicationModal); +#endif add_host = new QPushButton(tr("&Add Host"), this); edit_host = new QPushButton(tr("&Edit Host"), this); del_host = new QPushButton(tr("&Delete Host"), this); @@ -244,7 +271,6 @@ void ConfigWidget::add_sig() host_tmp.ip.clear(); host_widget = new HostWidget(0, &host_tmp); - host_widget->setWindowModality(Qt::ApplicationModal); connect(host_widget, SIGNAL(change_host()), this, SLOT(host_added())); host_widget->show(); qDebug() << "conf add - exit" << endl; @@ -260,7 +286,6 @@ void ConfigWidget::edit_sig() host_widget = new HostWidget(0, &host_tmp); connect(host_widget, SIGNAL(change_host()), this, SLOT(host_edited())); - host_widget->setWindowModality(Qt::ApplicationModal); //hostWidget->hostname->setPlaceholderText("my_host_name"); //hostWidget->hostname->setText("edit1"); //hostWidget->mac->setPlaceholderText("001133aabbcc"); @@ -341,6 +366,12 @@ HostWidget::HostWidget(QWidget *parent, host_s *host) qDebug() << "host widget" << endl; new_host = host; this->setWindowTitle("Add new WOL target host"); +#ifdef Q_WS_MAEMO_5 + this->setAttribute(Qt::WA_Maemo5StackedWindow); + this->setWindowFlags(this->windowFlags() | Qt::Window); +#else + this->setWindowModality(Qt::ApplicationModal); +#endif vlayout = new QVBoxLayout(this); host_row = new QHBoxLayout;