Example #1
0
Nushabe::Nushabe(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::Nushabe)
{
    QVBoxLayout* layout = new QVBoxLayout();
    QWidget* centralWidget= new QWidget();
    dial = new QDial();
    progressbar = new QProgressBar();
    status = new QLabel("boom");
    layout->addWidget(dial);
    layout->addWidget(progressbar);
    layout->addWidget(status);
    setCentralWidget(centralWidget);
    centralWidget->setLayout(layout);
    resize(200, 300);
    QString localDeviceName;
    connect(dial,SIGNAL(sliderMoved(int)),this,SLOT(valueChangedSlot(int)));
    //QList<QBluetoothHostInfo> host;
    //QList<QBluetoothDeviceInfo> found_devices;
    if (localDevice.isValid()) {

        // Turn Bluetooth on
        localDevice.powerOn();
        status->setText("blue is on");
        // Make it visible to others
        localDevice.setHostMode(QBluetoothLocalDevice::HostDiscoverable);
    }
    startDeviceDiscovery();
}
void QuteMessenger::CreateActions()
{
    discoverDev = new QAction(QString(tr("Discover devices")), this);
    discoverDev->setSoftKeyRole(QAction::SelectSoftKey);
    connect(discoverDev, SIGNAL(triggered()), this, SLOT(startDeviceDiscovery()));

    sendFile = new QAction(QString(tr("Send file")),this);
    sendFile->setSoftKeyRole(QAction::SelectSoftKey);
    connect(sendFile, SIGNAL(triggered()), this, SLOT(sendFileToClient()));

    startChat = new QAction(QString(tr("Start chat")),this);
    startChat->setSoftKeyRole(QAction::SelectSoftKey);
    connect(startChat, SIGNAL(triggered()), this, SLOT(startChatReport()));
}
/*
#ifdef Q_OS_SYMBIAN // used only to hide status pane
#include <eikspane.h>
#include <aknappui.h>
#include <avkon.rsg>
#include <EIKENV.H>
#include <coemain.h>

#endif
*/
QuteMessenger::QuteMessenger(QWidget *parent) :
    QMainWindow(parent), previousSelectedTab(0), rfcommServer(NULL), devDisc(NULL), serviceDisc(
        NULL), obexClient(NULL), dialog(NULL), obexDialog(NULL)
{
    /*
     #ifdef Q_OS_SYMBIAN
     CEikStatusPane* statusPane = STATIC_CAST( CAknAppUi*, CEikonEnv::Static()->EikAppUi())->StatusPane();
     statusPane->MakeVisible(EFalse);
     #endif*/

    int deviceYourClass = qRegisterMetaType<QBtDevice> ("QBtDevice");
    int addressYourClass = qRegisterMetaType<QBtAddress> ("QBtAddress");

    ui.setupUi(this);

    //dialog = new QProgressDialog(ui.deviceListWidget);

    CreateActions();
    SetupMenu(true);

    //setup devSearchButton signal handler
    connect(ui.devSearchButton, SIGNAL(clicked()), this, SLOT(startDeviceDiscovery()));

    connect(ui.deviceListWidget, SIGNAL(itemActivated(QListWidgetItem*)), this,
            SLOT(deviceSelected(QListWidgetItem*)));

    connect(ui.deviceListWidget, SIGNAL(itemClicked(QListWidgetItem*)), this,
            SLOT(deviceSelected(QListWidgetItem*)));

    connect(ui.tabWidget, SIGNAL( tabCloseRequested ( int )), this, SLOT(closeCurrentTab()));

    //connect(ui.)

    InitializeBluetooth();

    this->setWindowFlags(Qt::WindowSoftkeysVisibleHint);
    this->showFullScreen();

    //    QRect screenSize = QApplication::desktop()->screenGeometry();
    //    this->setGeometry(25,25, screenSize.width()/2, screenSize.height()/2);
}