Exemple #1
0
    QmDeviceMode::QmDeviceMode(QObject *parent) : QObject(parent) {
        MEEGO_INITIALIZE(QmDeviceMode)

        connect(priv, SIGNAL(devicePSMStateChanged(MeeGo::QmDeviceMode::PSMState)), this,
                SIGNAL(devicePSMStateChanged(MeeGo::QmDeviceMode::PSMState)));
        connect(priv, SIGNAL(deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode)), this,
                SIGNAL(deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode)));
    }
Exemple #2
0
    QmDeviceMode::~QmDeviceMode() {
        MEEGO_PRIVATE(QmDeviceMode)

        disconnect(priv, SIGNAL(devicePSMStateChanged(MeeGo::QmDeviceMode::PSMState)), this,
                   SIGNAL(devicePSMStateChanged(MeeGo::QmDeviceMode::PSMState)));
        disconnect(priv, SIGNAL(deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode)), this,
                   SIGNAL(deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode)));

        MEEGO_UNINITIALIZE(QmDeviceMode);
    }
FlightToggle::FlightToggle(QObject *parent) :
    QObject(parent),
    m_deviceMode(new MeeGo::QmDeviceMode(this)),
    m_isWorking(false)
{
    connect(m_deviceMode, SIGNAL(deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode)),
            this, SLOT(onDeviceModeChanged(MeeGo::QmDeviceMode::DeviceMode)));
}
OfflineBrief::OfflineBrief () :
    m_DevMode (new QmDeviceMode()),
    m_infoBanner (0)
{
    connect (m_DevMode,
             SIGNAL (deviceModeChanged (MeeGo::QmDeviceMode::DeviceMode)),
             SLOT (devModeChanged (MeeGo::QmDeviceMode::DeviceMode)));
    m_LastMode = m_DevMode->getMode();
}
NS_IMETHODIMP
nsNativeAppSupportQt::Start(bool* aRetVal)
{
  NS_ASSERTION(gAppData, "gAppData must not be null.");

#ifdef MOZ_ENABLE_QMSYSTEM2
  connect(&mActivity, SIGNAL(activityChanged(MeeGo::QmActivity::Activity)), this, SLOT(activityChanged(MeeGo::QmActivity::Activity)));
  connect(&mDeviceMode, SIGNAL(deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode)), this, SLOT(deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode)));
  connect(&mDisplayState, SIGNAL(displayStateChanged(MeeGo::QmDisplayState::DisplayState)), this, SLOT(displayStateChanged(MeeGo::QmDisplayState::DisplayState)));
  // Init states withing next event loop iteration
  QTimer::singleShot(0, this, SLOT(RefreshStates()));
#endif

  *aRetVal = true;
#ifdef MOZ_ENABLE_LIBCONIC
  g_type_init();
#endif

#if (MOZ_PLATFORM_MAEMO == 5)
  /* Initialize maemo application

     The initalization name will be of the form "Vendor.Name".
     If a Vendor isn't given, then we will just use "Name".

     Note that this value must match your X-Osso-Service name
     defined in your desktop file.  If it doesn't, the OSSO
     system will happily kill your process.
  */
  nsCAutoString applicationName;
  if (gAppData->vendor) {
      applicationName.Append(gAppData->vendor);
      applicationName.Append(".");
  }
  applicationName.Append(gAppData->name);
  ToLowerCase(applicationName);

  m_osso_context = osso_initialize(applicationName.get(),
                                   gAppData->version ? gAppData->version : "1.0",
                                   true,
                                   nsnull);

  /* Check that initilialization was ok */
  if (m_osso_context == nsnull) {
      return NS_ERROR_FAILURE;
  }
#endif

  return NS_OK;
}
Exemple #6
0
    void QmDeviceMode::connectNotify(const QMetaMethod &signal) {
#else
    void QmDeviceMode::connectNotify(const char *signal) {
#endif
        MEEGO_PRIVATE(QmDeviceMode)

        /* QObject::connect() needs to be thread-safe */
        QMutexLocker locker(&priv->connectMutex);

#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
        if (signal == QMetaMethod::fromSignal(&QmDeviceMode::deviceModeChanged)) {
#else
        if (QLatin1String(signal) == QLatin1String(QMetaObject::normalizedSignature(SIGNAL(deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode))))) {
#endif
            if (0 == priv->connectCount[SIGNAL_DEVICE_MODE]) {
                #if HAVE_MCE
                    QDBusConnection::systemBus().connect(MCE_SERVICE,
                                                         MCE_SIGNAL_PATH,
                                                         MCE_SIGNAL_IF,
                                                         MCE_RADIO_STATES_SIG,
                                                         priv,
                                                         SLOT(deviceModeChangedSlot(const quint32)));
                #endif
            }
            priv->connectCount[SIGNAL_DEVICE_MODE]++;
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
        } else if (signal == QMetaMethod::fromSignal(&QmDeviceMode::devicePSMStateChanged)) {
void nsNativeAppSupportQt::RefreshStates()
{
  activityChanged(mActivity.get());
  displayStateChanged(mDisplayState.get());
  deviceModeChanged(mDeviceMode.getMode());
}