Ejemplo n.º 1
0
int main(int argc, char * argv[])
{
    QApplication app(argc, argv);
    SELController controller;
    SELMainWindow window(controller);
    SELLoginDialog loginDialog(controller);
    
    /**
    - Instantiate the login dialog.
    - Show the login dialog.
    - Obtain results of login from login dialog
    - If login successful -> proceed.
    - Else -> exit
    */
    
    window.setAttribute(Qt::WA_QuitOnClose);
    loginDialog.show();
    
    QObject::connect(&loginDialog, SIGNAL(loginSuccessful()),
                     &window, SLOT(show()));
    QObject::connect(&loginDialog, SIGNAL(loginSuccessful()),
                     &window, SIGNAL(idAvailable()));
    
    app.exec();
    
    DBConnection::deleteInstance();
    
    return 0;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//  Login Dialog Dialog
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void MainWindow::on_loginButton_clicked()
{
    enableStatus(false);

    ui->accountList->clear();
    ui->nameLabel->setText("");
    ui->accountEdit->setText("");
    ui->passEdit->setText("");

    loginDialog();
}
Ejemplo n.º 3
0
void PreferencesDialog::on_button_login_clicked()
{
    if(!loggedIn)
    {
        LoginDialog loginDialog(this);
        if(loginDialog.exec() == QDialog::Accepted)
        {
            //Refresh after login
            loadSettings();
            setupUi();
            getUserInfo();
        }
    }
}
Ejemplo n.º 4
0
void GreenThumbFrame::Login() {
    dialog::LoginDialog loginDialog(NULL, wxID_ANY, "Login");

    if (loginDialog.ShowModal() == wxID_OK) {
        eventTree->SyncMenu(false);

        // get account currency if we don't already have it.
        wxString currencySymbol = GetCurrencySymbol(
            entity::Config::GetConfigValue<wxString>("accountCurrency", "?")
        );
        if (currencySymbol == "?") {
            workerManager.RunWorker(new worker::GetAccountDetails(&workerManager));
        }
    }
}
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    std::string message = "This program is a simple solution to password management\n"
                          "As a user you will be able to enter username and password combo's that will be encrypted in storage for security\n\n"
                            "You'll be prompted to login to the program on startup\n"
                            "You can register a new account and return to the login screen by selecting the \"Register\" button\n\n"
                            "Once you enter the application you'll be able to add new account/password combos";
    invalidDialog(message);

    //
    //runs loginBuuton call which opens the login dialog
    //
    loginDialog();
}
Ejemplo n.º 6
0
void AccountListDialog::addAccount(const QString& errMsg)
{
	// TODO: We can use the login dialog for this for now, but we'll have to make something better for it eventually.
	EditAccountDialog loginDialog(errMsg, this, EditAccountDialog::UsernameField | EditAccountDialog::PasswordField);
	loginDialog.exec();

	if (loginDialog.result() == QDialog::Accepted)
	{
		QString username(loginDialog.username());
		QString password(loginDialog.password());

		MojangAccountPtr account = MojangAccountPtr(new MojangAccount(username));

		ProgressDialog progDialog(this);
		AuthenticateTask authTask(account, password, &progDialog);
		if (progDialog.exec(&authTask))
		{
			// Add the authenticated account to the accounts list.
			MojangAccountPtr account = authTask.getMojangAccount();
			m_accounts->addAccount(account);

			// Grab associated player skins
			auto job = new NetJob("Player skins: " + account->username());

			for(AccountProfile profile : account->profiles())
			{
				auto meta = MMC->metacache()->resolveEntry("skins", profile.name() + ".png");
				auto action = CacheDownload::make(
					QUrl("http://skins.minecraft.net/MinecraftSkins/" + profile.name() + ".png"),
					meta);
				job->addNetAction(action);
				meta->stale = true;
			}

			job->start();
		}
	}
}