I have made the following changes intended for :
  CE:UX:MTF / meegotouchcp-bluetooth

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.pub.meego.com//request/show/7259

Thank You,
Juho Hämäläinen

[This message was auto-generated]

---

Request # 7259:

Messages from BOSS:

State: review at 2012-11-02T12:58:08 by bossbot

Reviews:
       accepted by bossbot : Prechecks succeeded.
       new for CE-maintainers : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: home:jhamalai:branches:CE:UX:MTF / meegotouchcp-bluetooth -> 
CE:UX:MTF / meegotouchcp-bluetooth
  
changes files:
--------------
--- meegotouchcp-bluetooth.changes
+++ meegotouchcp-bluetooth.changes
@@ -0,0 +1,3 @@
+* Fri Nov 02 2012 Juho Hamalainen <[email protected]> - 0.0.9
+- Fixes NEMO#549: Workaround to PIN query dialog to get usable text entry.
+

new:
----
  workaround-pin-query.patch

spec files:
-----------
--- meegotouchcp-bluetooth.spec
+++ meegotouchcp-bluetooth.spec
@@ -1,6 +1,6 @@
 # 
 # Do NOT Edit the Auto-generated Part!
-# Generated by: spectacle version 0.24.1
+# Generated by: spectacle version 0.25
 # 
 
 Name:       meegotouchcp-bluetooth
@@ -22,6 +22,7 @@
 Patch4:     disable_test.patch
 Patch5:     desktop-file-changes.patch
 Patch6:     meegotouchcp-bluetooth-0.0.9-drop-connman-dependencies.patch
+Patch7:     workaround-pin-query.patch
 BuildRequires:  pkgconfig(QtGui)
 BuildRequires:  pkgconfig(libpulse)
 BuildRequires:  pkgconfig(libpulse-mainloop-glib)
@@ -74,6 +75,8 @@
 %patch5 -p1
 # meegotouchcp-bluetooth-0.0.9-drop-connman-dependencies.patch
 %patch6 -p1
+# workaround-pin-query.patch
+%patch7 -p1
 # >> setup
 # << setup
 

other changes:
--------------

++++++ meegotouchcp-bluetooth.yaml
--- meegotouchcp-bluetooth.yaml
+++ meegotouchcp-bluetooth.yaml
@@ -14,6 +14,7 @@
     - disable_test.patch
     - desktop-file-changes.patch
     - meegotouchcp-bluetooth-0.0.9-drop-connman-dependencies.patch
+    - workaround-pin-query.patch
 Description: |
     This is a meegotouch-controlpanel plugin that allows the setup of bluetooth
     devices in MeeGo.

++++++ workaround-pin-query.patch (new)
--- workaround-pin-query.patch
+++ workaround-pin-query.patch
@@ -0,0 +1,117 @@
+diff --git a/bluetooth/src/bluetoothagent.cpp 
b/bluetooth/src/bluetoothagent.cpp
+index 48eb61b..885b1ce 100644
+--- a/bluetooth/src/bluetoothagent.cpp
++++ b/bluetooth/src/bluetoothagent.cpp
+@@ -22,6 +22,11 @@
+ #include <MTextEdit>
+ #include <QGraphicsLinearLayout>
+ 
++#include <QTimer>
++#include <MButton>
++#include <MApplicationWindow>
++#include <MApplicationPage>
++
+ BluetoothAgent::BluetoothAgent(QString path, QObject 
*parent):QObject(parent),requestAccepted(false)
+ {
+       new AgentAdaptor(this);
+@@ -128,36 +133,68 @@ uint 
BluetoothAgent::requestPasskey(OrgBluezDeviceInterface &device)
+       return (uint)textEdit->text().toInt();
+ }
+ 
+-QString BluetoothAgent::requestPidCode(OrgBluezDeviceInterface &device)
++QString BluetoothAgent::getTextEntry(QString &labelText, int timeoutSeconds)
+ {
+-      Q_UNUSED(device);
+-      MWidget *centralWidget = new MWidget;
++      MApplicationPage page;
+       QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
+-      QVariantMap props = device.GetProperties();
++      page.centralWidget()->setLayout(layout);
+ 
+-      //%"Please enter the PIN for %1:" where %1 is the device alias.
+-      QString text = qtTrId("Please enter the PIN for 
%1:").arg(props["Alias"].toString());
+-      MLabel *label = new MLabel(text, centralWidget);
+-      label->setStyleName("CommonBodyTextInverted");
++      MLabel *label = new MLabel(labelText, page.centralWidget());
++      //label->setStyleName("CommonBodyTextInverted");
+       label->setWordWrap(true);
+ 
+       MTextEdit *textEdit = new MTextEdit(MTextEditModel::SingleLine,
+-                                              QString(),
+-                                              centralWidget);
+-      centralWidget->setLayout(layout);
++                                          QString(),
++                                          page.centralWidget());
+ 
++      MButton *button_ok = new MButton("Ok", page.centralWidget());
++      MButton *button_cancel = new MButton("Cancel", page.centralWidget());
++
++      layout->addStretch();
+       layout->addItem(label);
+       layout->addItem(textEdit);
++      layout->addItem(button_ok);
++      layout->addItem(button_cancel);
++      layout->addStretch();
++
++      QTimer timer;
++      QEventLoop q;
++      connect(&page, SIGNAL(destroyed()),
++              &q, SLOT(quit()));
++      connect(&page, SIGNAL(backButtonClicked()),
++              textEdit, SLOT(clear()));
++      connect(&page, SIGNAL(backButtonClicked()),
++              &q, SLOT(quit()));
++      connect(&page, SIGNAL(closeButtonClicked()),
++              &q, SLOT(quit()));
++      connect(button_ok, SIGNAL(clicked()),
++              &q, SLOT(quit()));
++      connect(button_cancel, SIGNAL(clicked()),
++              textEdit, SLOT(clear()));
++      connect(button_cancel, SIGNAL(clicked()),
++              &q, SLOT(quit()));
++      connect(&timer, SIGNAL(timeout()),
++              &q, SLOT(quit()));
++
++      page.appear(MSceneWindow::DestroyWhenDone);
++
++      timer.setSingleShot(true);
++      timer.start(timeoutSeconds * 1000);
++      q.exec();
++      timer.stop();
++
++      QString result = textEdit->text();
++
++      page.dismiss();
++
++      return result;
++}
+ 
+-      //% "Device PIN Entry"
+-      MDialog *dialog = new MDialog(qtTrId("Device PIN Entry"),
+-                             M::OkButton | M::CancelButton);
+-
+-      dialog->setCentralWidget(centralWidget);
+-
+-      dialog->exec();
+-
+-      return textEdit->text();
++QString BluetoothAgent::requestPidCode(OrgBluezDeviceInterface &device)
++{
++      QVariantMap props = device.GetProperties();
++      QString text = qtTrId("Please enter the PIN for 
%1:").arg(props["Alias"].toString());
++      return getTextEntry(text);
+ }
+ 
+ void BluetoothAgent::accept()
+diff --git a/bluetooth/src/bluetoothagent.h b/bluetooth/src/bluetoothagent.h
+index 35e5b21..931f3d1 100644
+--- a/bluetooth/src/bluetoothagent.h
++++ b/bluetooth/src/bluetoothagent.h
+@@ -40,6 +40,7 @@ public slots:
+       void accept();
+       void doReject();
+ private:
++      QString getTextEntry(QString &labelText, int timeoutSeconds=45);
+       bool requestAccepted;
+ };
+ 



Reply via email to