+++ /dev/null
-#############################################################################
-# Makefile for building: qussd
-# Generated by qmake (2.01a) (Qt 4.6.2) on: Tue Jun 1 12:19:45 2010
-# Project: qussd.pro
-# Template: app
-# Command: /usr/bin/qmake -unix -o Makefile qussd.pro
-#############################################################################
-
-####### Compiler, tools and options
-
-CC = gcc
-CXX = g++
-DEFINES = -DQT_GL_NO_SCISSOR_TEST -DQT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH=1024 -DQT_NO_DEBUG -DQT_MAEMO5_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
-CFLAGS = -pipe -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wall -W -D_REENTRANT $(DEFINES)
-CXXFLAGS = -pipe -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wall -W -D_REENTRANT $(DEFINES)
-INCPATH = -I/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/linux-g++-maemo5 -I. -I/targets/FREMANTLE_ARMEL/usr/include/QtCore -I/targets/FREMANTLE_ARMEL/usr/include/QtGui -I/targets/FREMANTLE_ARMEL/usr/include/QtDBus -I/targets/FREMANTLE_ARMEL/usr/include/QtMaemo5 -I/targets/FREMANTLE_ARMEL/usr/include -I.
-LINK = g++
-LFLAGS = -Wl,-rpath-link,/usr/lib -Wl,-O1 -Wl,--hash-style=gnu -Wl,-rpath,/usr/lib
-LIBS = $(SUBLIBS) -L/usr/lib -lQtMaemo5 -L/usr/lib -L/usr/X11R6/lib -lQtDBus -lQtXml -lQtGui -lQtCore -lpthread
-AR = ar cqs
-RANLIB =
-QMAKE = /usr/bin/qmake
-TAR = tar -cf
-COMPRESS = gzip -9f
-COPY = cp -f
-SED = sed
-COPY_FILE = $(COPY)
-COPY_DIR = $(COPY) -r
-STRIP = strip
-INSTALL_FILE = install -m 644 -p
-INSTALL_DIR = $(COPY_DIR)
-INSTALL_PROGRAM = install -m 755 -p
-DEL_FILE = rm -f
-SYMLINK = ln -f -s
-DEL_DIR = rmdir
-MOVE = mv -f
-CHK_DIR_EXISTS= test -d
-MKDIR = mkdir -p
-
-####### Output directory
-
-OBJECTS_DIR = ./
-
-####### Files
-
-SOURCES = main.cpp
-OBJECTS = main.o
-DIST = /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusinterfaces.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusadaptors.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf \
- qussd.pro
-QMAKE_TARGET = qussd
-DESTDIR =
-TARGET = qussd
-
-first: all
-####### Implicit rules
-
-.SUFFIXES: .o .c .cpp .cc .cxx .C
-
-.cpp.o:
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
-
-.cc.o:
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
-
-.cxx.o:
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
-
-.C.o:
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
-
-.c.o:
- $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
-
-####### Build rules
-
-all: Makefile $(TARGET)
-
-$(TARGET): $(OBJECTS)
- $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
-
-Makefile: qussd.pro /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/linux-g++-maemo5/qmake.conf /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusinterfaces.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusadaptors.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf \
- /usr/lib/libQtMaemo5.prl \
- /usr/lib/libQtDBus.prl \
- /usr/lib/libQtXml.prl \
- /usr/lib/libQtCore.prl \
- /usr/lib/libQtGui.prl
- $(QMAKE) -unix -o Makefile qussd.pro
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusinterfaces.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusadaptors.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf:
-/usr/lib/libQtMaemo5.prl:
-/usr/lib/libQtDBus.prl:
-/usr/lib/libQtXml.prl:
-/usr/lib/libQtCore.prl:
-/usr/lib/libQtGui.prl:
-qmake: FORCE
- @$(QMAKE) -unix -o Makefile qussd.pro
-
-dist:
- @$(CHK_DIR_EXISTS) .tmp/qussd1.0.0 || $(MKDIR) .tmp/qussd1.0.0
- $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/qussd1.0.0/ && $(COPY_FILE) --parents main.cpp .tmp/qussd1.0.0/ && (cd `dirname .tmp/qussd1.0.0` && $(TAR) qussd1.0.0.tar qussd1.0.0 && $(COMPRESS) qussd1.0.0.tar) && $(MOVE) `dirname .tmp/qussd1.0.0`/qussd1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/qussd1.0.0
-
-
-clean:compiler_clean
- -$(DEL_FILE) $(OBJECTS)
- -$(DEL_FILE) *~ core *.core
-
-
-####### Sub-libraries
-
-distclean: clean
- -$(DEL_FILE) $(TARGET)
- -$(DEL_FILE) Makefile
-
-
-mocclean: compiler_moc_header_clean compiler_moc_source_clean
-
-mocables: compiler_moc_header_make_all compiler_moc_source_make_all
-
-compiler_moc_header_make_all:
-compiler_moc_header_clean:
-compiler_dbus_interface_source_make_all:
-compiler_dbus_interface_source_clean:
-compiler_dbus_adaptor_source_make_all:
-compiler_dbus_adaptor_source_clean:
-compiler_rcc_make_all:
-compiler_rcc_clean:
-compiler_image_collection_make_all: qmake_image_collection.cpp
-compiler_image_collection_clean:
- -$(DEL_FILE) qmake_image_collection.cpp
-compiler_moc_source_make_all: main.moc
-compiler_moc_source_clean:
- -$(DEL_FILE) main.moc
-main.moc: main.cpp
- /usr/bin/moc $(DEFINES) $(INCPATH) main.cpp -o main.moc
-
-compiler_dbus_interface_header_make_all:
-compiler_dbus_interface_header_clean:
-compiler_dbus_interface_moc_make_all:
-compiler_dbus_interface_moc_clean:
-compiler_dbus_adaptor_header_make_all:
-compiler_dbus_adaptor_header_clean:
-compiler_dbus_adaptor_moc_make_all:
-compiler_dbus_adaptor_moc_clean:
-compiler_uic_make_all:
-compiler_uic_clean:
-compiler_yacc_decl_make_all:
-compiler_yacc_decl_clean:
-compiler_yacc_impl_make_all:
-compiler_yacc_impl_clean:
-compiler_lex_make_all:
-compiler_lex_clean:
-compiler_clean: compiler_moc_source_clean
-
-####### Compile
-
-main.o: main.cpp main.moc
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
-
-####### Install
-
-install_target: first FORCE
- @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/examples/opt/maemo/usr/bin/qussd/ || $(MKDIR) $(INSTALL_ROOT)/usr/examples/opt/maemo/usr/bin/qussd/
- -$(INSTALL_PROGRAM) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/examples/opt/maemo/usr/bin/qussd/$(QMAKE_TARGET)"
- -$(STRIP) "$(INSTALL_ROOT)/usr/examples/opt/maemo/usr/bin/qussd/$(QMAKE_TARGET)"
-
-uninstall_target: FORCE
- -$(DEL_FILE) "$(INSTALL_ROOT)/usr/examples/opt/maemo/usr/bin/qussd/$(QMAKE_TARGET)"
- -$(DEL_DIR) $(INSTALL_ROOT)/usr/examples/opt/maemo/usr/bin/qussd/
-
-
-install: install_target FORCE
-
-uninstall: uninstall_target FORCE
-
-FORCE:
-
+++ /dev/null
-#include <QtGui>
-#include <iostream>
-#include <string.h>
-#include <QtDBus/QtDBus>
-
-#define PROCESSING "Processing..."
-
-class QUssd : public QMainWindow {
- Q_OBJECT
-
- public:
- QUssd(QString message, bool lock = false) {
- number = "";
-
- QActionGroup *filterGroup = new QActionGroup(this);
- filterGroup->setExclusive(true);
-
- actPortrait = new QAction(tr("Portrait"), filterGroup);
- actPortrait->setCheckable(true);
-
- actLandscape = new QAction(tr("Landscape"), filterGroup);
- actLandscape->setCheckable(true);
-
- actAuto = new QAction(tr("Auto"), filterGroup);
- actAuto->setCheckable(true);
- actAuto->setChecked(true);
-
- menuBar()->addActions(filterGroup->actions());
-
- connect(actPortrait, SIGNAL(changed()), this, SLOT(setOrientation()));
- connect(actLandscape, SIGNAL(changed()), this, SLOT(setOrientation()));
- connect(actAuto, SIGNAL(changed()), this, SLOT(setOrientation()));
-
- replyLabel = new QLabel(message);
- replyLabel->setMinimumWidth(400);
- replyLabel->setMaximumHeight(100);
- replyLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
-
- numberLabel = new QLabel("");
- replyLabel->setMinimumWidth(400);
- replyLabel->setMinimumHeight(150);
- replyLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
-
- indicationLayout = new QVBoxLayout;
- indicationLayout->addWidget(numberLabel);
- indicationLayout->addWidget(replyLabel);
-
- padDel = new QPushButton("C");
- connect(padDel, SIGNAL(clicked()), this, SLOT(del()));
- padDel->setMaximumWidth(150);
- padDel->setMaximumHeight(72);
- padDel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- padSend = new QPushButton("SEND");
- connect(padSend, SIGNAL(clicked()), this, SLOT(send()));
- padSend->setMaximumWidth(300);
- padSend->setMaximumHeight(72);
- padSend->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
-
- btnLayout = new QHBoxLayout;
- btnLayout->addWidget(padSend);
- btnLayout->addWidget(padDel);
-
- numberPad = new QGridLayout();
- numberPad->setSpacing(2);
-
- padBtn1 = new QPushButton("1");
- connect(padBtn1, SIGNAL(clicked()), this, SLOT(add1()));
- padBtn1->setMaximumWidth(150);
- padBtn1->setMaximumHeight(72);
- padBtn1->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- numberPad->addWidget(padBtn1, 0, 0);
- padBtn2 = new QPushButton("2");
- connect(padBtn2, SIGNAL(clicked()), this, SLOT(add2()));
- padBtn2->setMaximumWidth(150);
- padBtn2->setMaximumHeight(72);
- padBtn2->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- numberPad->addWidget(padBtn2, 0, 1);
- padBtn3 = new QPushButton("3");
- connect(padBtn3, SIGNAL(clicked()), this, SLOT(add3()));
- padBtn3->setMaximumWidth(150);
- padBtn3->setMaximumHeight(72);
- padBtn3->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- numberPad->addWidget(padBtn3, 0, 2);
- padBtn4 = new QPushButton("4");
- connect(padBtn4, SIGNAL(clicked()), this, SLOT(add4()));
- padBtn4->setMaximumWidth(150);
- padBtn4->setMaximumHeight(72);
- padBtn4->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- numberPad->addWidget(padBtn4, 1, 0);
- padBtn5 = new QPushButton("5");
- connect(padBtn5, SIGNAL(clicked()), this, SLOT(add5()));
- padBtn5->setMaximumWidth(150);
- padBtn5->setMaximumHeight(72);
- padBtn5->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- numberPad->addWidget(padBtn5, 1, 1);
- padBtn6 = new QPushButton("6");
- connect(padBtn6, SIGNAL(clicked()), this, SLOT(add6()));
- padBtn6->setMaximumWidth(150);
- padBtn6->setMaximumHeight(72);
- padBtn6->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- numberPad->addWidget(padBtn6, 1, 2);
- padBtn7 = new QPushButton("7");
- connect(padBtn7, SIGNAL(clicked()), this, SLOT(add7()));
- padBtn7->setMaximumWidth(150);
- padBtn7->setMaximumHeight(72);
- padBtn7->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- numberPad->addWidget(padBtn7, 2, 0);
- padBtn8 = new QPushButton("8");
- connect(padBtn8, SIGNAL(clicked()), this, SLOT(add8()));
- padBtn8->setMaximumWidth(150);
- padBtn8->setMaximumHeight(72);
- padBtn8->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- numberPad->addWidget(padBtn8, 2, 1);
- padBtn9 = new QPushButton("9");
- connect(padBtn9, SIGNAL(clicked()), this, SLOT(add9()));
- padBtn9->setMaximumWidth(150);
- padBtn9->setMaximumHeight(72);
- padBtn9->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- numberPad->addWidget(padBtn9, 2, 2);
- padBtnStar = new QPushButton("*+");
- connect(padBtnStar, SIGNAL(clicked()), this, SLOT(addStar()));
- padBtnStar->setMaximumWidth(150);
- padBtnStar->setMaximumHeight(72);
- padBtnStar->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- numberPad->addWidget(padBtnStar, 3, 0);
- padBtn0 = new QPushButton("0");
- connect(padBtn0, SIGNAL(clicked()), this, SLOT(add0()));
- padBtn0->setMaximumWidth(150);
- padBtn0->setMaximumHeight(72);
- padBtn0->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- numberPad->addWidget(padBtn0, 3, 1);
- padBtnGrid = new QPushButton("#");
- connect(padBtnGrid, SIGNAL(clicked()), this, SLOT(addGrid()));
- padBtnGrid->setMaximumWidth(150);
- padBtnGrid->setMaximumHeight(72);
- padBtnGrid->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- numberPad->addWidget(padBtnGrid, 3, 2);
-
- centralWidget = new QWidget;
- setCentralWidget(centralWidget);
- mainLayout = new QGridLayout(centralWidget);
-
- connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(orientationChanged()));
- setOrientation();
- orientationChanged();
-
- startUSSD (lock);
- }
-
- ~QUssd () {
- USSDquery->write("exit\n");
- USSDquery->closeWriteChannel();
- USSDquery->waitForFinished();
-
- delete USSDquery;
- }
-
- public slots:
- void restartUSSD( int, QProcess::ExitStatus) {
- replyLabel->setText(QString("Error: ")+QString::fromUtf8(reply));
- reply = "";
- number = "";
- setNumber();
-
- delete USSDquery;
- startUSSD ();
- }
-
-
- void send() {
- QDBusInterface iface("su.kibergus.ussdd", "/su/kibergus/ussdd", "su.kibergus.ussdd", QDBusConnection::systemBus());
- if (iface.isValid())
- iface.call("skip_next");
- USSDquery->write(number.toUtf8().data());
- USSDquery->write("\n");
- number = tr(PROCESSING);
- setNumber();
- }
-
- void readData() {
- QByteArray line;
- for (line = USSDquery->readLine(); !line.isEmpty(); line = USSDquery->readLine()) {
- reply += line;
- if (reply.endsWith("\n==MESSAGE END ==\n")) {
- reply.chop(strlen("\n==MESSAGE END ==\n"));
- if (!reply.isEmpty())
- replyLabel->setText(QString::fromUtf8(reply));
- reply = "";
- number = "";
- setNumber();
- break;
- }
- }
- }
-
- void setOrientation() {
- if (actLandscape->isChecked())
- setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
- else if (actPortrait->isChecked())
- setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
- else
- setAttribute(Qt::WA_Maemo5AutoOrientation, true);
- }
-
- void orientationChanged() {
- QRect screenGeometry = QApplication::desktop()->screenGeometry();
- mainLayout->removeItem(indicationLayout);
- mainLayout->removeItem(numberPad);
- mainLayout->removeItem(btnLayout);
-
- if (screenGeometry.width() > screenGeometry.height()) {
- mainLayout->addLayout(indicationLayout, 0, 0);
- mainLayout->addLayout(btnLayout, 1, 0);
- mainLayout->addLayout(numberPad, 0, 1, -1, 1);
- } else {
- mainLayout->addLayout(indicationLayout, 0, 0);
- mainLayout->addLayout(numberPad, 1, 0);
- mainLayout->addLayout(btnLayout, 2, 0);
- }
- }
-
- void add1 () {
- if (number != tr(PROCESSING)) {
- number += "1";
- setNumber();
- }
- }
-
- void add2 () {
- if (number != tr(PROCESSING)) {
- number += "2";
- setNumber();
- }
- }
-
- void add3 () {
- if (number != tr(PROCESSING)) {
- number += "3";
- setNumber();
- }
- }
-
- void add4 () {
- if (number != tr(PROCESSING)) {
- number += "4";
- setNumber();
- }
- }
-
- void add5 () {
- if (number != tr(PROCESSING)) {
- number += "5";
- setNumber();
- }
- }
-
- void add6 () {
- if (number != tr(PROCESSING)) {
- number += "6";
- setNumber();
- }
- }
-
- void add7 () {
- if (number != tr(PROCESSING)) {
- number += "7";
- setNumber();
- }
- }
-
- void add8 () {
- if (number != tr(PROCESSING)) {
- number += "8";
- setNumber();
- }
- }
-
- void add9 () {
- if (number != tr(PROCESSING)) {
- number += "9";
- setNumber();
- }
- }
-
- void add0 () {
- if (number != tr(PROCESSING)) {
- number += "0";
- setNumber();
- }
- }
-
- void addGrid () {
- if (number != tr(PROCESSING)) {
- number += "#";
- setNumber();
- }
- }
-
- void addStar () {
- if (number != tr(PROCESSING)) {
- if (number[number.length()-1] == '*') {
- number[number.length()-1] = '+';
- } else
- number += "*";
- setNumber();
- }
- }
-
- void del () {
- if (number != tr(PROCESSING)) {
- number.chop(1);
- setNumber();
- }
- }
-
- private:
- void startUSSD (bool lock = false) {
- QString program = "ussdquery.py";
- QStringList arguments;
- arguments << "interactive" << "-d" << "\n==MESSAGE END ==\n";
- if (lock)
- arguments << "-m";
-
- USSDquery = new QProcess();
- USSDquery->setProcessChannelMode(QProcess::MergedChannels);
- connect(USSDquery, SIGNAL(readyReadStandardOutput()), this, SLOT(readData()));
- connect(USSDquery, SIGNAL(readyReadStandardError()), this, SLOT(readData()));
- connect(USSDquery, SIGNAL(finished( int, QProcess::ExitStatus )), this, SLOT(restartUSSD( int, QProcess::ExitStatus )));
-
- USSDquery->start(program, arguments);
- }
-
- void setNumber () {
- numberLabel->setText(QString("<p style=\"font-size: 30pt;\" align=\"center\">")+number+"</p>");
- }
-
- QLabel *replyLabel;
- QLabel *numberLabel;
- QAction *actPortrait;
- QAction *actLandscape;
- QAction *actAuto;
-
- QVBoxLayout *indicationLayout;
- QHBoxLayout *btnLayout;
- QGridLayout *numberPad;
- QGridLayout *mainLayout;
- QWidget* centralWidget;
-
- QPushButton *padBtn1;
- QPushButton *padBtn2;
- QPushButton *padBtn3;
- QPushButton *padBtn4;
- QPushButton *padBtn5;
- QPushButton *padBtn6;
- QPushButton *padBtn7;
- QPushButton *padBtn8;
- QPushButton *padBtn9;
- QPushButton *padBtn0;
- QPushButton *padBtnStar;
- QPushButton *padBtnGrid;
-
- QPushButton *padDel;
- QPushButton *padSend;
-
- QProcess *USSDquery;
-
- QString number;
- QByteArray reply;
-};
-
-int main(int argc, char *argv[]) {
- QApplication app(argc, argv);
-
- bool lock = false;
- QString message;
- if (argc >= 2)
- message = message.fromUtf8(argv[1]);
- if (argc >=3 && !strcmp(argv[2], "lock"))
- lock = true;
-
- QUssd w(message, lock);
- w.show();
-
- return app.exec();
-}
-
-#include "main.moc"
+++ /dev/null
-/****************************************************************************
-** Meta object code from reading C++ file 'main.cpp'
-**
-** Created: Tue Jun 1 15:18:19 2010
-** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
-**
-** WARNING! All changes made in this file will be lost!
-*****************************************************************************/
-
-#if !defined(Q_MOC_OUTPUT_REVISION)
-#error "The header file 'main.cpp' doesn't include <QObject>."
-#elif Q_MOC_OUTPUT_REVISION != 62
-#error "This file was generated using the moc from 4.6.2. It"
-#error "cannot be used with the include files from this version of Qt."
-#error "(The moc has changed too much.)"
-#endif
-
-QT_BEGIN_MOC_NAMESPACE
-static const uint qt_meta_data_QUssd[] = {
-
- // content:
- 4, // revision
- 0, // classname
- 0, 0, // classinfo
- 18, 14, // methods
- 0, 0, // properties
- 0, 0, // enums/sets
- 0, 0, // constructors
- 0, // flags
- 0, // signalCount
-
- // slots: signature, parameters, type, tag, flags
- 9, 7, 6, 6, 0x0a,
- 47, 6, 6, 6, 0x0a,
- 54, 6, 6, 6, 0x0a,
- 65, 6, 6, 6, 0x0a,
- 82, 6, 6, 6, 0x0a,
- 103, 6, 6, 6, 0x0a,
- 110, 6, 6, 6, 0x0a,
- 117, 6, 6, 6, 0x0a,
- 124, 6, 6, 6, 0x0a,
- 131, 6, 6, 6, 0x0a,
- 138, 6, 6, 6, 0x0a,
- 145, 6, 6, 6, 0x0a,
- 152, 6, 6, 6, 0x0a,
- 159, 6, 6, 6, 0x0a,
- 166, 6, 6, 6, 0x0a,
- 173, 6, 6, 6, 0x0a,
- 183, 6, 6, 6, 0x0a,
- 193, 6, 6, 6, 0x0a,
-
- 0 // eod
-};
-
-static const char qt_meta_stringdata_QUssd[] = {
- "QUssd\0\0,\0restartUSSD(int,QProcess::ExitStatus)\0"
- "send()\0readData()\0setOrientation()\0"
- "orientationChanged()\0add1()\0add2()\0"
- "add3()\0add4()\0add5()\0add6()\0add7()\0"
- "add8()\0add9()\0add0()\0addGrid()\0addStar()\0"
- "del()\0"
-};
-
-const QMetaObject QUssd::staticMetaObject = {
- { &QMainWindow::staticMetaObject, qt_meta_stringdata_QUssd,
- qt_meta_data_QUssd, 0 }
-};
-
-#ifdef Q_NO_DATA_RELOCATION
-const QMetaObject &QUssd::getStaticMetaObject() { return staticMetaObject; }
-#endif //Q_NO_DATA_RELOCATION
-
-const QMetaObject *QUssd::metaObject() const
-{
- return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
-}
-
-void *QUssd::qt_metacast(const char *_clname)
-{
- if (!_clname) return 0;
- if (!strcmp(_clname, qt_meta_stringdata_QUssd))
- return static_cast<void*>(const_cast< QUssd*>(this));
- return QMainWindow::qt_metacast(_clname);
-}
-
-int QUssd::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
-{
- _id = QMainWindow::qt_metacall(_c, _id, _a);
- if (_id < 0)
- return _id;
- if (_c == QMetaObject::InvokeMetaMethod) {
- switch (_id) {
- case 0: restartUSSD((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< QProcess::ExitStatus(*)>(_a[2]))); break;
- case 1: send(); break;
- case 2: readData(); break;
- case 3: setOrientation(); break;
- case 4: orientationChanged(); break;
- case 5: add1(); break;
- case 6: add2(); break;
- case 7: add3(); break;
- case 8: add4(); break;
- case 9: add5(); break;
- case 10: add6(); break;
- case 11: add7(); break;
- case 12: add8(); break;
- case 13: add9(); break;
- case 14: add0(); break;
- case 15: addGrid(); break;
- case 16: addStar(); break;
- case 17: del(); break;
- default: ;
- }
- _id -= 18;
- }
- return _id;
-}
-QT_END_MOC_NAMESPACE
+++ /dev/null
-TEMPLATE = app
-SOURCES = main.cpp
-
-QT += maemo5 dbus
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opt/maemo/usr/bin/qussd
-INSTALLS += target
+++ /dev/null
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-import subprocess
-import dbus
-import dbus.service
-from dbus import glib
-from dbus.mainloop.glib import DBusGMainLoop
-import gobject
-
-skip = False;
-
-def ussd_released (message, str):
- global skip
- if not skip:
- subprocess.Popen(["qussd", message])
- skip = False
- return True
-
-def ussd_request (message, str):
- global skip
- if not skip:
- subprocess.Popen(["qussd", message, "lock"])
- skip = False
- return True
-
-class DBusListener(dbus.service.Object):
- def __init__(self):
- bus_name = dbus.service.BusName('su.kibergus.ussdd', bus=dbus.SystemBus())
- dbus.service.Object.__init__(self, bus_name, '/su/kibergus/ussdd')
-
- @dbus.service.method(dbus_interface='su.kibergus.ussdd')
- def skip_next (self):
- print "TEST"
- global skip
- skip = True
- return True
-
-gobject.threads_init()
-glib.init_threads()
-
-bus = dbus.SystemBus()
-signal = bus.add_signal_receiver(ussd_released, path='/com/nokia/csd/ss', dbus_interface='com.nokia.csd.SS.USSD', signal_name='Released')
-signal = bus.add_signal_receiver(ussd_request, path='/com/nokia/csd/ss', dbus_interface='com.nokia.csd.SS.USSD', signal_name='Request')
-
-listener = DBusListener()
-
-loop = gobject.MainLoop()
-loop.run()
-
--- /dev/null
+ussd4all (0.0.0-1) unstable; urgency=low
+
+ * Reincarnation of ussd-common with GUI and hack, that disables nokia's USSD
+ implementation
+
+ -- Alexey Guseynov <kibergus@gmail.com> Tue, 8 Jun 2010 17:21:05 +0000
+
--- /dev/null
+Source: ussd4all
+Section: user/system
+Priority: extra
+Maintainer: Alexey Guseynov <kibergus@gmail.com>
+Build-Depends: debhelper (>= 5)
+Standards-Version: 3.7.2
+
+Package: ussd4all
+Architecture: any
+Depends: python2.5, pexpect, python-dbus, python-gobject, libc6 (>= 2.5.0-1), libgcc1 (>= 3.4.4), libqtcore4 (>= 4.4.0), libqtgui4 (>= 4.4.0), libstdc++6 (>= 3.4.4), ${shlibs:Depends}
+XB-Maemo-Display-Name: USSD for all
+Description: Command line and GUI utility for making USSD queries
+ This package fixes https://bugs.maemo.org/show_bug.cgi?id=10353 which nokia is unable to fix. This allows other applications to make USSD queries.
+XSBC-Bugtracker: https://garage.maemo.org/tracker/?group_id=1219
+Maemo-Icon-26:
+ iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A
+ /wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oBBRQWL9mpz0kAAAAZdEVYdENv
+ bW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAACUUlEQVRIx8WVPWgVQRSFvxtiUBD/EAkERKuJ
+ 0U6FV6mFgsiolaBNsPInIKiFhYJIjDaCgiAEBOGBUYtIEEbB1/jTRGMVITwmFkoEwxMtlPdAjXFs
+ bmRdd9ZsXiCnubszd/fcO3PmjKBwPgQAa0TIQNa882EPcBLYDCwDPgFPgV5rpJr8voU5wvnQDTwE
+ dgGrgFagHTgIjDgfNs4LEXBR42WgQ4k6taOlwKVkcmsTRGs0DlkjH/TZOx+OAOPAjvkiqgD7gGHn
+ wxBwG3hsjbwB/tnnZpbuGDCqxR4AHgA150O/82F9HlGYxc//5Fgjk6q2QyqKb8By4Cgw5nzYFiP6
+ rmpalKGwNn38kRy3RqatkXvWiAVWa2fPgSXA1RjRR42dGZ2s0/g5QV5zPgTnwwYlbVgjg8BeTdkU
+ E8MwsBa443w4AbwEfgJdwHXNGUnkPwIOA2XnQw/wGlgJnNX5dzGi88BOreRJRld14ELivVdVtxV4
+ lbGX5zKXzhoZ1829BUwAU8AvYBIYALZYI6OJ/LdACbgL1IBp4KsWudsauc9CQFLqmpVJzhhsaqka
+ QBW4YY2Uo0RqkuVIQXWgZI2MRYjSuGaNnI7Ju5BJzlwZem20qWLPqFJPOR+2x1RXyCRThFPAe+CK
+ 82GxKrIHeJZFVMgkczCgRKXY0hUyyRxMaGyPnaNCJlkULXM1yRx0pLzz7z1yPtRUEF3WSNUaaQCD
+ zocK8CVtkjnYr/FFTHWFTDJ10AVYAVigT4dvxogKmeR/Dm6/NVKJiaFZk6zrVdNtjRxnofAbC1T2
+ CPUkSeUAAAAASUVORK5CYII=
--- /dev/null
+This package was debianized by Alexey Guseynov <kibergus@gmail.com> on
+Tue, 8 Jun 2010 17:21:05 +0000.
+
+Upstream Author: Alexey Guseynov <kibergus@gmail.com>
+
+Copyright: Alexey Guseynov <kibergus@gmail.com> 2010
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2010, Alexey Guseynov <kibergus@gmail.com> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
--- /dev/null
+usr/bin
+usr/sbin
--- /dev/null
+#!/bin/sh
+# postinst script for ussd4all
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ configure)
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
--- /dev/null
+#!/bin/sh
+# postrm script for ussd4all
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <overwriter>
+# <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
--- /dev/null
+#!/usr/bin/make -f
+APPNAME := ussd4all
+builddir:
+ mkdir -p builddir
+
+builddir/Makefile: builddir
+ cd builddir && qmake-qt4 PREFIX=/usr ../$(APPNAME).pro
+
+build: build-stamp
+
+build-stamp: builddir/Makefile
+ dh_testdir
+ # Add here commands to compile the package.
+ cd builddir && $(MAKE)
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp
+ # Add here commands to clean up after the build process.
+ rm -rf builddir
+ dh_clean
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/your_appname
+ cd builddir && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/$(APPNAME) install
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installdocs
+ dh_installexamples
+ dh_installman
+ dh_link
+ dh_strip --dbg-package=my-application-dbg
+ dh_compress
+ dh_fixperms
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
--- /dev/null
+#############################################################################
+# Makefile for building: qussd
+# Generated by qmake (2.01a) (Qt 4.6.2) on: Tue Jun 1 12:19:45 2010
+# Project: qussd.pro
+# Template: app
+# Command: /usr/bin/qmake -unix -o Makefile qussd.pro
+#############################################################################
+
+####### Compiler, tools and options
+
+CC = gcc
+CXX = g++
+DEFINES = -DQT_GL_NO_SCISSOR_TEST -DQT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH=1024 -DQT_NO_DEBUG -DQT_MAEMO5_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
+CFLAGS = -pipe -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wall -W -D_REENTRANT $(DEFINES)
+CXXFLAGS = -pipe -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wall -W -D_REENTRANT $(DEFINES)
+INCPATH = -I/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/linux-g++-maemo5 -I. -I/targets/FREMANTLE_ARMEL/usr/include/QtCore -I/targets/FREMANTLE_ARMEL/usr/include/QtGui -I/targets/FREMANTLE_ARMEL/usr/include/QtDBus -I/targets/FREMANTLE_ARMEL/usr/include/QtMaemo5 -I/targets/FREMANTLE_ARMEL/usr/include -I.
+LINK = g++
+LFLAGS = -Wl,-rpath-link,/usr/lib -Wl,-O1 -Wl,--hash-style=gnu -Wl,-rpath,/usr/lib
+LIBS = $(SUBLIBS) -L/usr/lib -lQtMaemo5 -L/usr/lib -L/usr/X11R6/lib -lQtDBus -lQtXml -lQtGui -lQtCore -lpthread
+AR = ar cqs
+RANLIB =
+QMAKE = /usr/bin/qmake
+TAR = tar -cf
+COMPRESS = gzip -9f
+COPY = cp -f
+SED = sed
+COPY_FILE = $(COPY)
+COPY_DIR = $(COPY) -r
+STRIP = strip
+INSTALL_FILE = install -m 644 -p
+INSTALL_DIR = $(COPY_DIR)
+INSTALL_PROGRAM = install -m 755 -p
+DEL_FILE = rm -f
+SYMLINK = ln -f -s
+DEL_DIR = rmdir
+MOVE = mv -f
+CHK_DIR_EXISTS= test -d
+MKDIR = mkdir -p
+
+####### Output directory
+
+OBJECTS_DIR = ./
+
+####### Files
+
+SOURCES = main.cpp
+OBJECTS = main.o
+DIST = /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusinterfaces.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusadaptors.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf \
+ qussd.pro
+QMAKE_TARGET = qussd
+DESTDIR =
+TARGET = qussd
+
+first: all
+####### Implicit rules
+
+.SUFFIXES: .o .c .cpp .cc .cxx .C
+
+.cpp.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.cc.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.cxx.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.C.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.c.o:
+ $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
+
+####### Build rules
+
+all: Makefile $(TARGET)
+
+$(TARGET): $(OBJECTS)
+ $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
+
+Makefile: qussd.pro /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/linux-g++-maemo5/qmake.conf /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusinterfaces.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusadaptors.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf \
+ /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf \
+ /usr/lib/libQtMaemo5.prl \
+ /usr/lib/libQtDBus.prl \
+ /usr/lib/libQtXml.prl \
+ /usr/lib/libQtCore.prl \
+ /usr/lib/libQtGui.prl
+ $(QMAKE) -unix -o Makefile qussd.pro
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusinterfaces.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/dbusadaptors.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf:
+/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf:
+/usr/lib/libQtMaemo5.prl:
+/usr/lib/libQtDBus.prl:
+/usr/lib/libQtXml.prl:
+/usr/lib/libQtCore.prl:
+/usr/lib/libQtGui.prl:
+qmake: FORCE
+ @$(QMAKE) -unix -o Makefile qussd.pro
+
+dist:
+ @$(CHK_DIR_EXISTS) .tmp/qussd1.0.0 || $(MKDIR) .tmp/qussd1.0.0
+ $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/qussd1.0.0/ && $(COPY_FILE) --parents main.cpp .tmp/qussd1.0.0/ && (cd `dirname .tmp/qussd1.0.0` && $(TAR) qussd1.0.0.tar qussd1.0.0 && $(COMPRESS) qussd1.0.0.tar) && $(MOVE) `dirname .tmp/qussd1.0.0`/qussd1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/qussd1.0.0
+
+
+clean:compiler_clean
+ -$(DEL_FILE) $(OBJECTS)
+ -$(DEL_FILE) *~ core *.core
+
+
+####### Sub-libraries
+
+distclean: clean
+ -$(DEL_FILE) $(TARGET)
+ -$(DEL_FILE) Makefile
+
+
+mocclean: compiler_moc_header_clean compiler_moc_source_clean
+
+mocables: compiler_moc_header_make_all compiler_moc_source_make_all
+
+compiler_moc_header_make_all:
+compiler_moc_header_clean:
+compiler_dbus_interface_source_make_all:
+compiler_dbus_interface_source_clean:
+compiler_dbus_adaptor_source_make_all:
+compiler_dbus_adaptor_source_clean:
+compiler_rcc_make_all:
+compiler_rcc_clean:
+compiler_image_collection_make_all: qmake_image_collection.cpp
+compiler_image_collection_clean:
+ -$(DEL_FILE) qmake_image_collection.cpp
+compiler_moc_source_make_all: main.moc
+compiler_moc_source_clean:
+ -$(DEL_FILE) main.moc
+main.moc: main.cpp
+ /usr/bin/moc $(DEFINES) $(INCPATH) main.cpp -o main.moc
+
+compiler_dbus_interface_header_make_all:
+compiler_dbus_interface_header_clean:
+compiler_dbus_interface_moc_make_all:
+compiler_dbus_interface_moc_clean:
+compiler_dbus_adaptor_header_make_all:
+compiler_dbus_adaptor_header_clean:
+compiler_dbus_adaptor_moc_make_all:
+compiler_dbus_adaptor_moc_clean:
+compiler_uic_make_all:
+compiler_uic_clean:
+compiler_yacc_decl_make_all:
+compiler_yacc_decl_clean:
+compiler_yacc_impl_make_all:
+compiler_yacc_impl_clean:
+compiler_lex_make_all:
+compiler_lex_clean:
+compiler_clean: compiler_moc_source_clean
+
+####### Compile
+
+main.o: main.cpp main.moc
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
+
+####### Install
+
+install_target: first FORCE
+ @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/examples/opt/maemo/usr/bin/qussd/ || $(MKDIR) $(INSTALL_ROOT)/usr/examples/opt/maemo/usr/bin/qussd/
+ -$(INSTALL_PROGRAM) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/examples/opt/maemo/usr/bin/qussd/$(QMAKE_TARGET)"
+ -$(STRIP) "$(INSTALL_ROOT)/usr/examples/opt/maemo/usr/bin/qussd/$(QMAKE_TARGET)"
+
+uninstall_target: FORCE
+ -$(DEL_FILE) "$(INSTALL_ROOT)/usr/examples/opt/maemo/usr/bin/qussd/$(QMAKE_TARGET)"
+ -$(DEL_DIR) $(INSTALL_ROOT)/usr/examples/opt/maemo/usr/bin/qussd/
+
+
+install: install_target FORCE
+
+uninstall: uninstall_target FORCE
+
+FORCE:
+
--- /dev/null
+start on XSESSIONS_STARTING
+stop on stopped hal
+respawn
+respawn limit 15 3
+
+script
+ export DISPLAY=:0.0
+ exec su user -c "run-standalone.sh /usr/bin/ussdd"
+ sleep 5
+end script
--- /dev/null
+#include <QtGui>
+#include <iostream>
+#include <string.h>
+
+#define PROCESSING "Processing..."
+
+class QUssd : public QMainWindow {
+ Q_OBJECT
+
+ public:
+ QUssd(QString message, bool lock = false) {
+ number = "";
+
+ QActionGroup *filterGroup = new QActionGroup(this);
+ filterGroup->setExclusive(true);
+
+ actPortrait = new QAction(tr("Portrait"), filterGroup);
+ actPortrait->setCheckable(true);
+
+ actLandscape = new QAction(tr("Landscape"), filterGroup);
+ actLandscape->setCheckable(true);
+
+ actAuto = new QAction(tr("Auto"), filterGroup);
+ actAuto->setCheckable(true);
+ actAuto->setChecked(true);
+
+ menuBar()->addActions(filterGroup->actions());
+
+ connect(actPortrait, SIGNAL(changed()), this, SLOT(setOrientation()));
+ connect(actLandscape, SIGNAL(changed()), this, SLOT(setOrientation()));
+ connect(actAuto, SIGNAL(changed()), this, SLOT(setOrientation()));
+
+ replyLabel = new QLabel(message);
+ replyLabel->setMinimumWidth(400);
+ replyLabel->setMaximumHeight(100);
+ replyLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
+
+ numberLabel = new QLabel("");
+ replyLabel->setMinimumWidth(400);
+ replyLabel->setMinimumHeight(150);
+ replyLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+
+ indicationLayout = new QVBoxLayout;
+ indicationLayout->addWidget(numberLabel);
+ indicationLayout->addWidget(replyLabel);
+
+ padDel = new QPushButton("C");
+ connect(padDel, SIGNAL(clicked()), this, SLOT(del()));
+ padDel->setMaximumWidth(150);
+ padDel->setMaximumHeight(72);
+ padDel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+ padSend = new QPushButton("SEND");
+ connect(padSend, SIGNAL(clicked()), this, SLOT(send()));
+ padSend->setMaximumWidth(300);
+ padSend->setMaximumHeight(72);
+ padSend->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+
+ btnLayout = new QHBoxLayout;
+ btnLayout->addWidget(padSend);
+ btnLayout->addWidget(padDel);
+
+ numberPad = new QGridLayout();
+ numberPad->setSpacing(2);
+
+ padBtn1 = new QPushButton("1");
+ connect(padBtn1, SIGNAL(clicked()), this, SLOT(add1()));
+ padBtn1->setMaximumWidth(150);
+ padBtn1->setMaximumHeight(72);
+ padBtn1->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+ numberPad->addWidget(padBtn1, 0, 0);
+ padBtn2 = new QPushButton("2");
+ connect(padBtn2, SIGNAL(clicked()), this, SLOT(add2()));
+ padBtn2->setMaximumWidth(150);
+ padBtn2->setMaximumHeight(72);
+ padBtn2->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+ numberPad->addWidget(padBtn2, 0, 1);
+ padBtn3 = new QPushButton("3");
+ connect(padBtn3, SIGNAL(clicked()), this, SLOT(add3()));
+ padBtn3->setMaximumWidth(150);
+ padBtn3->setMaximumHeight(72);
+ padBtn3->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+ numberPad->addWidget(padBtn3, 0, 2);
+ padBtn4 = new QPushButton("4");
+ connect(padBtn4, SIGNAL(clicked()), this, SLOT(add4()));
+ padBtn4->setMaximumWidth(150);
+ padBtn4->setMaximumHeight(72);
+ padBtn4->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+ numberPad->addWidget(padBtn4, 1, 0);
+ padBtn5 = new QPushButton("5");
+ connect(padBtn5, SIGNAL(clicked()), this, SLOT(add5()));
+ padBtn5->setMaximumWidth(150);
+ padBtn5->setMaximumHeight(72);
+ padBtn5->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+ numberPad->addWidget(padBtn5, 1, 1);
+ padBtn6 = new QPushButton("6");
+ connect(padBtn6, SIGNAL(clicked()), this, SLOT(add6()));
+ padBtn6->setMaximumWidth(150);
+ padBtn6->setMaximumHeight(72);
+ padBtn6->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+ numberPad->addWidget(padBtn6, 1, 2);
+ padBtn7 = new QPushButton("7");
+ connect(padBtn7, SIGNAL(clicked()), this, SLOT(add7()));
+ padBtn7->setMaximumWidth(150);
+ padBtn7->setMaximumHeight(72);
+ padBtn7->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+ numberPad->addWidget(padBtn7, 2, 0);
+ padBtn8 = new QPushButton("8");
+ connect(padBtn8, SIGNAL(clicked()), this, SLOT(add8()));
+ padBtn8->setMaximumWidth(150);
+ padBtn8->setMaximumHeight(72);
+ padBtn8->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+ numberPad->addWidget(padBtn8, 2, 1);
+ padBtn9 = new QPushButton("9");
+ connect(padBtn9, SIGNAL(clicked()), this, SLOT(add9()));
+ padBtn9->setMaximumWidth(150);
+ padBtn9->setMaximumHeight(72);
+ padBtn9->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+ numberPad->addWidget(padBtn9, 2, 2);
+ padBtnStar = new QPushButton("*+");
+ connect(padBtnStar, SIGNAL(clicked()), this, SLOT(addStar()));
+ padBtnStar->setMaximumWidth(150);
+ padBtnStar->setMaximumHeight(72);
+ padBtnStar->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+ numberPad->addWidget(padBtnStar, 3, 0);
+ padBtn0 = new QPushButton("0");
+ connect(padBtn0, SIGNAL(clicked()), this, SLOT(add0()));
+ padBtn0->setMaximumWidth(150);
+ padBtn0->setMaximumHeight(72);
+ padBtn0->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+ numberPad->addWidget(padBtn0, 3, 1);
+ padBtnGrid = new QPushButton("#");
+ connect(padBtnGrid, SIGNAL(clicked()), this, SLOT(addGrid()));
+ padBtnGrid->setMaximumWidth(150);
+ padBtnGrid->setMaximumHeight(72);
+ padBtnGrid->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+ numberPad->addWidget(padBtnGrid, 3, 2);
+
+ centralWidget = new QWidget;
+ setCentralWidget(centralWidget);
+ mainLayout = new QGridLayout(centralWidget);
+
+ connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(orientationChanged()));
+ setOrientation();
+ orientationChanged();
+
+ startUSSD (lock);
+ }
+
+ ~QUssd () {
+ USSDquery->write("exit\n");
+ USSDquery->closeWriteChannel();
+ USSDquery->waitForFinished();
+
+ delete USSDquery;
+ }
+
+ public slots:
+ void restartUSSD( int, QProcess::ExitStatus) {
+ replyLabel->setText(QString("Error: ")+QString::fromUtf8(reply));
+ reply = "";
+ number = "";
+ setNumber();
+
+ delete USSDquery;
+ startUSSD ();
+ }
+
+
+ void send() {
+ USSDquery->write(number.toUtf8().data());
+ USSDquery->write("\n");
+ number = tr(PROCESSING);
+ setNumber();
+ }
+
+ void readData() {
+ QByteArray line;
+ for (line = USSDquery->readLine(); !line.isEmpty(); line = USSDquery->readLine()) {
+ reply += line;
+ if (reply.endsWith("\n==MESSAGE END ==\n")) {
+ reply.chop(strlen("\n==MESSAGE END ==\n"));
+ if (!reply.isEmpty())
+ replyLabel->setText(QString::fromUtf8(reply));
+ reply = "";
+ number = "";
+ setNumber();
+ break;
+ }
+ }
+ }
+
+ void setOrientation() {
+ if (actLandscape->isChecked())
+ setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
+ else if (actPortrait->isChecked())
+ setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
+ else
+ setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+ }
+
+ void orientationChanged() {
+ QRect screenGeometry = QApplication::desktop()->screenGeometry();
+ mainLayout->removeItem(indicationLayout);
+ mainLayout->removeItem(numberPad);
+ mainLayout->removeItem(btnLayout);
+
+ if (screenGeometry.width() > screenGeometry.height()) {
+ mainLayout->addLayout(indicationLayout, 0, 0);
+ mainLayout->addLayout(btnLayout, 1, 0);
+ mainLayout->addLayout(numberPad, 0, 1, -1, 1);
+ } else {
+ mainLayout->addLayout(indicationLayout, 0, 0);
+ mainLayout->addLayout(numberPad, 1, 0);
+ mainLayout->addLayout(btnLayout, 2, 0);
+ }
+ }
+
+ void add1 () {
+ if (number != tr(PROCESSING)) {
+ number += "1";
+ setNumber();
+ }
+ }
+
+ void add2 () {
+ if (number != tr(PROCESSING)) {
+ number += "2";
+ setNumber();
+ }
+ }
+
+ void add3 () {
+ if (number != tr(PROCESSING)) {
+ number += "3";
+ setNumber();
+ }
+ }
+
+ void add4 () {
+ if (number != tr(PROCESSING)) {
+ number += "4";
+ setNumber();
+ }
+ }
+
+ void add5 () {
+ if (number != tr(PROCESSING)) {
+ number += "5";
+ setNumber();
+ }
+ }
+
+ void add6 () {
+ if (number != tr(PROCESSING)) {
+ number += "6";
+ setNumber();
+ }
+ }
+
+ void add7 () {
+ if (number != tr(PROCESSING)) {
+ number += "7";
+ setNumber();
+ }
+ }
+
+ void add8 () {
+ if (number != tr(PROCESSING)) {
+ number += "8";
+ setNumber();
+ }
+ }
+
+ void add9 () {
+ if (number != tr(PROCESSING)) {
+ number += "9";
+ setNumber();
+ }
+ }
+
+ void add0 () {
+ if (number != tr(PROCESSING)) {
+ number += "0";
+ setNumber();
+ }
+ }
+
+ void addGrid () {
+ if (number != tr(PROCESSING)) {
+ number += "#";
+ setNumber();
+ }
+ }
+
+ void addStar () {
+ if (number != tr(PROCESSING)) {
+ if (number[number.length()-1] == '*') {
+ number[number.length()-1] = '+';
+ } else
+ number += "*";
+ setNumber();
+ }
+ }
+
+ void del () {
+ if (number != tr(PROCESSING)) {
+ number.chop(1);
+ setNumber();
+ }
+ }
+
+ private:
+ void startUSSD (bool lock = false) {
+ QString program = "ussdquery.py";
+ QStringList arguments;
+ arguments << "interactive" << "-d" << "\n==MESSAGE END ==\n";
+ if (lock)
+ arguments << "-m";
+
+ USSDquery = new QProcess();
+ USSDquery->setProcessChannelMode(QProcess::MergedChannels);
+ connect(USSDquery, SIGNAL(readyReadStandardOutput()), this, SLOT(readData()));
+ connect(USSDquery, SIGNAL(readyReadStandardError()), this, SLOT(readData()));
+ connect(USSDquery, SIGNAL(finished( int, QProcess::ExitStatus )), this, SLOT(restartUSSD( int, QProcess::ExitStatus )));
+
+ USSDquery->start(program, arguments);
+ }
+
+ void setNumber () {
+ numberLabel->setText(QString("<p style=\"font-size: 30pt;\" align=\"center\">")+number+"</p>");
+ }
+
+ QLabel *replyLabel;
+ QLabel *numberLabel;
+ QAction *actPortrait;
+ QAction *actLandscape;
+ QAction *actAuto;
+
+ QVBoxLayout *indicationLayout;
+ QHBoxLayout *btnLayout;
+ QGridLayout *numberPad;
+ QGridLayout *mainLayout;
+ QWidget* centralWidget;
+
+ QPushButton *padBtn1;
+ QPushButton *padBtn2;
+ QPushButton *padBtn3;
+ QPushButton *padBtn4;
+ QPushButton *padBtn5;
+ QPushButton *padBtn6;
+ QPushButton *padBtn7;
+ QPushButton *padBtn8;
+ QPushButton *padBtn9;
+ QPushButton *padBtn0;
+ QPushButton *padBtnStar;
+ QPushButton *padBtnGrid;
+
+ QPushButton *padDel;
+ QPushButton *padSend;
+
+ QProcess *USSDquery;
+
+ QString number;
+ QByteArray reply;
+};
+
+int main(int argc, char *argv[]) {
+ QApplication app(argc, argv);
+
+ bool lock = false;
+ QString message;
+ if (argc >= 2)
+ message = message.fromUtf8(argv[1]);
+ if (argc >=3 && !strcmp(argv[2], "lock"))
+ lock = true;
+
+ QUssd w(message, lock);
+ w.show();
+
+ return app.exec();
+}
+
+#include "qussd.moc"
--- /dev/null
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Name=QUSSD
+Exec=/usr/bin/qussd
+Icon=ussd
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
+
--- /dev/null
+TEMPLATE = app
+SOURCES = qussd.cpp
+TARGET = qussd
+
+QT += maemo5
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/opt/maemo/usr/bin/qussd
+INSTALLS += target
+
+ unix {
+ #VARIABLES
+ isEmpty(PREFIX) {
+ PREFIX = ""
+ }
+
+BINDIR = $$PREFIX/usr/bin
+DATADIR =$$PREFIX/usr/share
+
+DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\"
+
+#MAKE INSTALL
+INSTALLS += target desktop icon48 ussdd event
+
+ target.path = $$BINDIR
+
+ desktop.path = $$DATADIR/applications/hildon
+ desktop.files += $${TARGET}.desktop
+
+ icon48.path = $$DATADIR/icons/hicolor/48x48/apps
+ icon48.files += ussd.png
+
+ ussdd.path = $$BINDIR
+ ussdd.files = ussdd
+
+ event.path = $$PREFIX/etc/init.d
+ event.files = event.d/ussdd
+ }
--- /dev/null
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+import subprocess
+import dbus
+import dbus.service
+from dbus import glib
+from dbus.mainloop.glib import DBusGMainLoop
+import gobject
+
+skip = False;
+
+def ussd_released (message, str):
+ global skip
+ if not skip:
+ subprocess.Popen(["qussd", message])
+ skip = False
+ return True
+
+def ussd_request (message, str):
+ global skip
+ if not skip:
+ subprocess.Popen(["qussd", message, "lock"])
+ skip = False
+ return True
+
+class DBusListener(dbus.service.Object):
+ def __init__(self):
+ bus_name = dbus.service.BusName('su.kibergus.ussdd', bus=dbus.SystemBus())
+ dbus.service.Object.__init__(self, bus_name, '/su/kibergus/ussdd')
+
+ @dbus.service.method(dbus_interface='su.kibergus.ussdd')
+ def skip_next (self):
+ global skip
+ skip = True
+ return True
+
+ @dbus.service.method(dbus_interface='su.kibergus.ussdd')
+ def show_next (self):
+ global skip
+ skip = False
+ return True
+
+gobject.threads_init()
+glib.init_threads()
+
+bus = dbus.SystemBus()
+signal = bus.add_signal_receiver(ussd_released, path='/com/nokia/csd/ss', dbus_interface='com.nokia.csd.SS.USSD', signal_name='Released')
+signal = bus.add_signal_receiver(ussd_request, path='/com/nokia/csd/ss', dbus_interface='com.nokia.csd.SS.USSD', signal_name='Request')
+
+listener = DBusListener()
+
+loop = gobject.MainLoop()
+loop.run()
+
--- /dev/null
+QMAKEVERSION = $$[QMAKE_VERSION]
+ISQT4 = $$find(QMAKEVERSION, ^[2-9])
+isEmpty( ISQT4 ) {
+error("Use the qmake include with Qt4.4 or greater, on Debian that is qmake-qt4");
+}
+
+TEMPLATE = subdirs
+SUBDIRS = src