Esempio n. 1
0
void Bb10Ui::onPromptFinished(bb::system::SystemUiResult::Type type)
{
	SystemPrompt *prompt = qobject_cast<SystemPrompt *>(sender());
    if (type == SystemUiResult::ConfirmButtonSelection) {
        	QString text = prompt->inputFieldTextEntry();
        	switchToOrJoinChat(text, false);
    }
    prompt->deleteLater();
}
Esempio n. 2
0
void DriveController::onPromptFinishedRenameFile(bb::system::SystemUiResult::Type result) {
    using namespace bb::cascades;
    using namespace bb::system;

    if(result == bb::system::SystemUiResult::ConfirmButtonSelection) {
        SystemPrompt* prompt = qobject_cast<SystemPrompt*>(sender());
        if(prompt != NULL) {
            m_Google->setFileName(m_SelectedItemForSharing, prompt->inputFieldTextEntry());
            prompt->deleteLater();
        }
    }
}
Esempio n. 3
0
void ListDataModel::onPromptFinished(bb::system::SystemUiResult::Type type)
{
	if (type == SystemUiResult::ConfirmButtonSelection) {

		SystemPrompt* prompt = qobject_cast<SystemPrompt*>(sender());
		const QString name = prompt->inputFieldTextEntry();
		const QString link = prompt->body();
		addObject(name, link);

	} else {
		qDebug() << "Saving Cancelled";
	}
}
Esempio n. 4
0
void DriveController::onPromptFinishedChooseName(bb::system::SystemUiResult::Type result) {
    using namespace bb::cascades;
    using namespace bb::system;

    if(result == bb::system::SystemUiResult::ConfirmButtonSelection) {
        SystemPrompt* prompt = qobject_cast<SystemPrompt*>(sender());
        if(prompt != NULL) {
            QString directory = QDir::homePath() + QLatin1String("/ApplicationData/AudioMessages/");
            m_AudioName = directory + prompt->inputFieldTextEntry() + ".m4a";
            emit startRecording();
            prompt->deleteLater();
        }
    }
}
Esempio n. 5
0
void ListDataModel::promptName(const QString &message, const QString &link)
{
	SystemPrompt *prompt = new SystemPrompt();
	prompt->setTitle(message);
	prompt->setDismissAutomatically(true);
	prompt->inputField()->setEmptyText("Enter a name for your bookmark");
	prompt->setBody(link);

/*
	QLineEdit *lineedit = new QLineEdit(link);
	lineedit->setText(link);
	QSignalMapper *signalMapper = new QSignalMapper(this);
	connect(prompt,SIGNAL(finished(bb::system::SystemUiResult::Type)),signalMapper,SLOT(map()));
	signalMapper->setMapping(lineedit,link);
	connect(signalMapper,SIGNAL(mapped(const QString &)),this, SIGNAL(onPromptFinished(const QString &,bb::system::SystemUiResult::Type)));
*/

	bool success = QObject::connect(prompt,
	         SIGNAL(finished(bb::system::SystemUiResult::Type)),
	         this,
	         SLOT(onPromptFinished(bb::system::SystemUiResult::Type)));

	if (success) {
		prompt->show();
	} else {
        prompt->deleteLater();
    }


}
Esempio n. 6
0
void Bb10Ui::showJoinChannelDlg()
{
    const Network *net = Client::network(m_networkInfo.networkId);
    if (net->connectionState() != Network::Initialized) {
        SystemToast* toast = new SystemToast(this);
        toast->setBody("Please connect to a network to join channel.");
        toast->setPosition(SystemUiPosition::MiddleCenter);
        toast->show();
        return;
    }
    SystemPrompt* prompt = new SystemPrompt();
    prompt->setModality(SystemUiModality::Application);
    prompt->setTitle("Join a channel");
    prompt->inputField()->setDefaultText("#");
    prompt->confirmButton()->setLabel("Join");
    connect(prompt, SIGNAL(finished(bb::system::SystemUiResult::Type)), this, SLOT(onPromptFinished(bb::system::SystemUiResult::Type)));
    prompt->show();
}
Esempio n. 7
0
void DriveController::renameFile(const QString &id, const QString &title) {
    using namespace bb::cascades;
    using namespace bb::system;

    SystemPrompt *prompt = new SystemPrompt();
    prompt->setTitle(tr("Rename"));
    prompt->setDismissAutomatically(true);
    prompt->inputField()->setEmptyText(tr("name..."));
    prompt->inputField()->setDefaultText(title);


    bool success = QObject::connect(prompt,
        SIGNAL(finished(bb::system::SystemUiResult::Type)),
        this,
        SLOT(onPromptFinishedRenameFile(bb::system::SystemUiResult::Type)));

    if (success) {
        m_SelectedItemForSharing = id;
        prompt->show();
     } else {
        prompt->deleteLater();
    }
}
Esempio n. 8
0
void DriveController::createNewFolder() {
    using namespace bb::cascades;
    using namespace bb::system;

    SystemPrompt *prompt = new SystemPrompt();
    prompt->setTitle(tr("Create new folder"));
    prompt->setDismissAutomatically(true);
    prompt->inputField()->setEmptyText(tr("name..."));


    bool success = QObject::connect(prompt,
        SIGNAL(finished(bb::system::SystemUiResult::Type)),
        this,
        SLOT(onPromptFinishedCreateFolder(bb::system::SystemUiResult::Type)));

    if (success) {
        prompt->show();
     } else {
        prompt->deleteLater();
    }
}