Пример #1
0
void AuthPlugin::requestFacebookSession()
{
    PlexyDesk::DataSource *fbSource = dataSource();

    QVariantMap request;
    QVariant arg;
    request["command"] = QVariant("login");
    arg = request;

    if (fbSource)
        fbSource->setArguments(arg);
}
Пример #2
0
void AuthPlugin::onFacebookToken(const QString &token)
{
    PlexyDesk::DataSource *fbSource = dataSource();
    QVariantMap request;
    QVariant arg;
    request["command"] = QVariant("friends");
    request["token"] = token;
    arg = request;

    if (fbSource)
        fbSource->setArguments(arg);
}
Пример #3
0
void BlackBerryPlugin::onSetClicked() {
  if (dataSource()) {
    PlexyDesk::DataSource *source = dataSource();

    QVariant arg;
    QVariantMap dataMap;
    dataMap["key"] = d->mPinText->text();
    arg.setValue(dataMap);

    source->setArguments(arg);

    d->mPaneView->pop();
  }
}
Пример #4
0
void AuthPlugin::revokeSession(const QVariantMap &args)
{
    QString token = args["access_token"].toString();

    if (token.isNull() || token.isEmpty()) {
        requestFacebookSession();
        return;
    }
    mWidget->setVisible(false);

    PlexyDesk::DataSource *fbSource = dataSource();
    QVariantMap request;
    QVariant arg;
    request["command"] = QVariant("friends");
    request["token"] = args["access_token"];
    arg = request;

    if (fbSource)
        fbSource->setArguments(arg);
}
Пример #5
0
void BlackBerryPlugin::onNoteSave() {
  if (d->mNoteTextSubject->text().isEmpty()) {
    d->mDialog->setTitle("Error : Empty Subject");
    d->mDialog->setBody("Missing Subject: Add a subject to save the note");
    d->mDialog->show();
    return;
  } else {
    if (dataSource()) {
      PlexyDesk::DataSource *source = dataSource();

      QVariant arg;
      QVariantMap dataMap;

      dataMap["type"] = QString("save_note");
      dataMap["subject"] = d->mNoteTextSubject->text();
      dataMap["body"] = d->mNoteTextEditor->text();
      arg.setValue(dataMap);

      source->setArguments(arg);

      d->mPaneView->pop();
    }
  }
}