-ussd4all (0.0.3-1) unstable; urgency=low
+ussd4all (0.0.4-1) unstable; urgency=low
- * Fixed PR 1.3 issue. postinst does not break phone if library is not
- recognized. Multiple * can be entered.
+ * Word wrap in qussd. Text can be copyed. Better pnatd initialization in
+ ussdquery.py.
-- Alexey Guseynov <kibergus@gmail.com> Tue, 03 July 2010 16:21:05 +0003
connect(actLandscape, SIGNAL(changed()), this, SLOT(setOrientation()));
connect(actAuto, SIGNAL(changed()), this, SLOT(setOrientation()));
- replyLabel = new QLabel(message);
+ replyLabel = new QTextEdit(message);
replyLabel->setMinimumWidth(400);
- replyLabel->setMaximumHeight(100);
+ replyLabel->setMinimumHeight(200);
replyLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
-
+// replyLabel->setWordWrap(true);
+// replyLabel->setReadOnly(true);
+ replyLabel->setFrameStyle(QFrame::NoFrame);
+ QPalette pal = palette();
+ pal.setColor(QPalette::Base, Qt::transparent);
+ replyLabel->setPalette(pal);
+// replyLabel->setTextBackgroundColor(Qt::black);
+ replyLabel->setTextColor(Qt::white);
+ replyLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
+
numberLabel = new QLabel("");
- replyLabel->setMinimumWidth(400);
- replyLabel->setMinimumHeight(150);
- replyLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ numberLabel->setMinimumWidth(400);
+ numberLabel->setMaximumHeight(100);
+ numberLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
indicationLayout = new QVBoxLayout;
indicationLayout->addWidget(numberLabel);
+
indicationLayout->addWidget(replyLabel);
padDel = new QPushButton("C");
numberLabel->setText(QString("<p style=\"font-size: 30pt;\" align=\"center\">")+number+"</p>");
}
- QLabel *replyLabel;
+ QTextEdit *replyLabel;
QLabel *numberLabel;
QAction *actPortrait;
QAction *actLandscape;
fcntl.flock(lockf,fcntl.LOCK_UN)
lockf.close()
+def ensure_modem_listening (modem):
+ # We try to ger response for about 2 seconds
+ for i in range(20):
+ modem.send('at junk\r');
+ index = modem.expect (['ERROR\r', pexpect.TIMEOUT], 0.1);
+ if index == 0:
+ modem.send('at\r');
+ index = modem.expect (['OK\r'], 1);
+ return;
+ raise
+
def init_modem(modem):
# We have only one modem, simultaneous acces wouldn't bring anything good
gain_lock()
if modem == None :
# OK response should be recieved shortly
modem = pexpect.spawn('pnatd', [], 2)
- # FIXME This is a dirty hack. A better solution needed
- time.sleep(0.5)
- try :
- modem.send('at\r');
- # Read our "at" command
- modem.readline();
- # Read OK response
- response = modem.readline().strip()
- except pexpect.TIMEOUT:
- modem.kill(9)
- modem = None
- response = ""
- if response != "OK" :
- time.sleep(0.5)
- init_retry -= 1
+ try :
+ ensure_modem_listening (modem);
+ except :
+ modem.kill(9);
+ modem = None;
+ response = "";
else:
try:
# Switch output encoding to GSM default encoding