Пример #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 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();
    }
}
Пример #3
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();
}
Пример #4
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();
    }
}