qtmobility/examples/servicebrowser/servicebrowser.cpp
changeset 8 71781823f776
parent 5 453da2cfceef
child 11 06b8e2af4411
equal deleted inserted replaced
5:453da2cfceef 8:71781823f776
    74     reloadAttributesList();
    74     reloadAttributesList();
    75     reloadAttributesRadioButtonText();
    75     reloadAttributesRadioButtonText();
    76 
    76 
    77     QServiceInterfaceDescriptor descriptor = current->data(Qt::UserRole).value<QServiceInterfaceDescriptor>();
    77     QServiceInterfaceDescriptor descriptor = current->data(Qt::UserRole).value<QServiceInterfaceDescriptor>();
    78     if (descriptor.isValid()) {
    78     if (descriptor.isValid()) {
    79         defaultInterfaceButton->setText(tr("Set as default implementation for %1") 
    79 #if defined(Q_WS_MAEMO_5)
       
    80         defaultInterfaceButton->setText(tr("Set as default implementation for \n%1")
       
    81 #else
       
    82         defaultInterfaceButton->setText(tr("Set as default implementation for %1")
       
    83 #endif
    80                 .arg(descriptor.interfaceName()));
    84                 .arg(descriptor.interfaceName()));
    81         defaultInterfaceButton->setEnabled(true);
    85         defaultInterfaceButton->setEnabled(true);
    82     }
    86     }
    83 }
    87 }
    84 
    88 
   223     interfacesListWidget = new QListWidget;
   227     interfacesListWidget = new QListWidget;
   224     interfacesListWidget->addItem(tr("(Select a service)"));
   228     interfacesListWidget->addItem(tr("(Select a service)"));
   225     attributesListWidget = new QListWidget;
   229     attributesListWidget = new QListWidget;
   226     attributesListWidget->addItem(tr("(Select an interface implementation)"));
   230     attributesListWidget->addItem(tr("(Select an interface implementation)"));
   227 
   231 
   228 #ifndef Q_OS_SYMBIAN
   232 #if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5)
   229     interfacesListWidget->setMinimumWidth(450);
   233     interfacesListWidget->setMinimumWidth(450);
   230 #endif
   234 #endif
   231 
   235 
   232     connect(servicesListWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
   236     connect(servicesListWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
   233             this, SLOT(reloadInterfaceImplementationsList()));
   237             this, SLOT(reloadInterfaceImplementationsList()));
   262     interfacesGroup->setLayout(interfacesLayout);
   266     interfacesGroup->setLayout(interfacesLayout);
   263 
   267 
   264     attributesGroup = new QGroupBox(tr("Invokable attributes"));
   268     attributesGroup = new QGroupBox(tr("Invokable attributes"));
   265     QVBoxLayout *attributesLayout = new QVBoxLayout;
   269     QVBoxLayout *attributesLayout = new QVBoxLayout;
   266     attributesLayout->addWidget(attributesListWidget);
   270     attributesLayout->addWidget(attributesListWidget);
       
   271 #if !defined(Q_WS_MAEMO_5)
       
   272     // No space on the screen to show following title in Maemo
   267     attributesLayout->addWidget(new QLabel(tr("Show attributes for:")));
   273     attributesLayout->addWidget(new QLabel(tr("Show attributes for:")));
       
   274 #endif
   268     attributesLayout->addWidget(selectedImplRadioButton);
   275     attributesLayout->addWidget(selectedImplRadioButton);
   269     attributesLayout->addWidget(defaultImplRadioButton);
   276     attributesLayout->addWidget(defaultImplRadioButton);
   270     attributesGroup->setLayout(attributesLayout);
   277     attributesGroup->setLayout(attributesLayout);
   271 
   278 
   272 #ifndef Q_OS_SYMBIAN
   279 #if defined(Q_WS_MAEMO_5)
       
   280     // Maemo 5 style doesn't take group box titles into account.
       
   281     int spacingHack = QFontMetrics(QFont()).height();
       
   282     interfacesLayout->setContentsMargins(0, spacingHack, 0, 0);
       
   283     attributesLayout->setContentsMargins(0, spacingHack, 0, 0);
       
   284     servicesLayout->setContentsMargins(0, spacingHack, 0, 0);
       
   285 #endif
       
   286 #if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5)
   273     QGridLayout *layout = new QGridLayout;
   287     QGridLayout *layout = new QGridLayout;
   274     layout->addWidget(servicesGroup, 0, 0);
   288     layout->addWidget(servicesGroup, 0, 0);
   275     layout->addWidget(attributesGroup, 0, 1, 2, 1);
   289     layout->addWidget(attributesGroup, 0, 1, 2, 1);
   276     layout->addWidget(interfacesGroup, 1, 0);
   290     layout->addWidget(interfacesGroup, 1, 0);
   277 #else
   291 #else