예제 #1
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();
    }


}
예제 #2
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();
}
예제 #3
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();
        }
    }
}
예제 #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();
        }
    }
}
예제 #5
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();
    }
}
예제 #6
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();
    }
}