void MainApp::showMainWindow(bool raise) { if (!m_bLoggedIn && m_iMode != MODE_OFFLINE) { showLogin(); } else { showMainForm(raise); } }
RegisterWindow::RegisterWindow(PCloudApp *a, QWidget *parent) : QMainWindow(parent), ui(new Ui::RegisterWindow) { app=a; setWindowIcon(QIcon(WINDOW_ICON)); ui->setupUi(this); connect(ui->registerButton, SIGNAL(clicked()), this, SLOT(doRegister())); // connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(hide())); connect(ui->email, SIGNAL(returnPressed()), this, SLOT(focusPass())); connect(ui->password, SIGNAL(returnPressed()), this, SLOT(focusConfirm())); connect(ui->confirmpassword, SIGNAL(returnPressed()), this, SLOT(focusTOS())); // connect(ui->accepttos, SIGNAL(returnPressed()), this, SLOT(doRegister())); connect(ui->loginButton, SIGNAL(clicked()), app, SLOT(showLogin())); }
void LoginSettingWidget::onOkButtonClicked() { QString ip_addr = dest_addr_edit->text(); QString port = dest_port_edit->text(); if(ip_addr.isEmpty() || port.isEmpty()) { emit showMsg(Util::EmptyTargetAddrOrPortMsg); } else { AppSettings settings; settings.beginGroup(QString(APP_PARAM_GROUP_TARGET)); settings.setValue(QString(APP_PARAM_ADDR), ip_addr); settings.setValue(QString(APP_PARAM_PORT), port); settings.endGroup(); emit showLogin(); } }
void MainApp::logOut(bool bShowLogin, bool autoLogin, bool webLoggedOut) { gcTrace(""); m_pInternalLink->closeAll(); safe_delete(m_pInternalLink); closeMainForm(); wxTheApp->ProcessIdle(); { std::lock_guard<std::mutex> a(m_UserLock); if (g_pUserHandle) { auto user = g_pUserHandle; g_pUserHandle = nullptr; DesuraJSBinding::gs_pItemManager = nullptr; user->getPipeDisconnectEvent() -= guiDelegate(this, &MainApp::onPipeDisconnect); user->logOut(!autoLogin); user->getAppUpdateProgEvent() -= guiDelegate(this, &MainApp::onAppUpdateProg); user->getAppUpdateCompleteEvent() -= guiDelegate(this, &MainApp::onAppUpdate); user->getWebCore()->getCookieUpdateEvent() -= guiDelegate(this, &MainApp::onCookieUpdate); user->getWebCore()->getLoggedOutEvent() -= delegate(&onLoggedOutEvent); user->destroy(); } } GetCVarManager()->saveAll(); GetCVarManager()->cleanUserCvars(); m_bLoggedIn = false; m_iMode = APP_MODE::MODE_UNINT; if (bShowLogin) showLogin(!autoLogin, webLoggedOut); HideLogForm(); DeleteCookies(); SetCrashDumpSettings(nullptr, true); }
int main(void) { int iChoice = 0; // size console window to 100x40 if(!initConsole()) { // show error box showError("Error", "Console Window could not be initialized.\nExiting program."); return EXIT_FAILURE; } // LogIn / Register Menu showStartScreen(); do { // choose between LogIn and Register getUserInput("%i", &iChoice, "\tChoose: ", "\n\tYour input is invalid. Please choose again.\n"); } while(iChoice != 1 && iChoice != 2); // LogIn / Register if(iChoice == 1) { // loop until valid login while(!showLogin()); } else { // loop until valid registration while(!showRegister()); } // loop until user quits manually while(startApplication()); return EXIT_SUCCESS; }
void MainApp::logOut(bool bShowLogin, bool autoLogin) { m_pInternalLink->closeAll(); safe_delete(m_pInternalLink); { Thread::AutoLock a(m_UserLock); if (g_pUserHandle) { UserCore::UserI* user = g_pUserHandle; g_pUserHandle = NULL; user->logOut(!autoLogin); *user->getAppUpdateProgEvent() -= guiDelegate(this, &MainApp::onAppUpdateProg); *user->getAppUpdateCompleteEvent() -= guiDelegate(this, &MainApp::onAppUpdate); *user->getWebCore()->getCookieUpdateEvent() -= guiDelegate(this, &MainApp::onCookieUpdate); *user->getPipeDisconnectEvent() -= guiDelegate(this, &MainApp::onPipeDisconnect); safe_delete(user); } } GetCVarManager()->saveAll(); GetCVarManager()->cleanUserCvars(); closeMainForm(); m_bLoggedIn = false; m_iMode = MODE_UNINT; if (bShowLogin) showLogin(!autoLogin); HideLogForm(); DeleteCookies(); SetCrashDumpSettings(NULL, true); }
void MainApp::run() { showLogin(); }
void Nexus::start() { qDebug() << "Starting up"; // Setup the environment qRegisterMetaType<Status>("Status"); qRegisterMetaType<vpx_image>("vpx_image"); qRegisterMetaType<uint8_t>("uint8_t"); qRegisterMetaType<uint16_t>("uint16_t"); qRegisterMetaType<uint32_t>("uint32_t"); qRegisterMetaType<const int16_t*>("const int16_t*"); qRegisterMetaType<int32_t>("int32_t"); qRegisterMetaType<int64_t>("int64_t"); qRegisterMetaType<QPixmap>("QPixmap"); qRegisterMetaType<Profile*>("Profile*"); qRegisterMetaType<ToxAV*>("ToxAV*"); qRegisterMetaType<ToxFile>("ToxFile"); qRegisterMetaType<ToxFile::FileDirection>("ToxFile::FileDirection"); qRegisterMetaType<std::shared_ptr<VideoFrame>>("std::shared_ptr<VideoFrame>"); loginScreen = new LoginScreen(); #ifdef Q_OS_MAC globalMenuBar = new QMenuBar(0); dockMenu = new QMenu(globalMenuBar); viewMenu = globalMenuBar->addMenu(QString()); windowMenu = globalMenuBar->addMenu(QString()); globalMenuBar->addAction(windowMenu->menuAction()); fullscreenAction = viewMenu->addAction(QString()); fullscreenAction->setShortcut(QKeySequence::FullScreen); connect(fullscreenAction, &QAction::triggered, this, &Nexus::toggleFullscreen); minimizeAction = windowMenu->addAction(QString()); minimizeAction->setShortcut(Qt::CTRL + Qt::Key_M); connect(minimizeAction, &QAction::triggered, [this]() { minimizeAction->setEnabled(false); QApplication::focusWindow()->showMinimized(); }); windowMenu->addSeparator(); frontAction = windowMenu->addAction(QString()); connect(frontAction, &QAction::triggered, this, &Nexus::bringAllToFront); QAction* quitAction = new QAction(globalMenuBar); quitAction->setMenuRole(QAction::QuitRole); connect(quitAction, &QAction::triggered, qApp, &QApplication::quit); windowMapper = new QSignalMapper(this); connect(windowMapper, SIGNAL(mapped(QObject*)), this, SLOT(onOpenWindow(QObject*))); connect(loginScreen, &LoginScreen::windowStateChanged, this, &Nexus::onWindowStateChanged); retranslateUi(); #endif if (profile) showMainGUI(); else showLogin(); }
void __fastcall TfrmExecutie::lblPercentageClick(TObject *Sender) { lblPercentage->Visible = false; showLogin(); }
void __fastcall TfrmExecutie::onTimered() { showLogin(); }
void CController::insertWidgets() { QWidget* pMainWidget = new CMainWidget(); m_mapWidget.insert(s_sigMainWidget, pMainWidget); bool VARIABLE_IS_NOT_USED bIsLogoutOK = connect( pMainWidget, SIGNAL(logout()), this, SLOT(logout())); Q_ASSERT(bIsLogoutOK); QWidget* pLoginWidget = new CLoginWidget(); bool VARIABLE_IS_NOT_USED bIsLoginConOK = connect( pLoginWidget, SIGNAL(request(const QString&, const QString&)), this, SLOT(showLogining(const QString&, const QString&))); Q_ASSERT(bIsLoginConOK); bool VARIABLE_IS_NOT_USED bIsLogin2RegisterConOK = connect( pLoginWidget, SIGNAL(switch2Register()), this, SLOT(showRegister())); Q_ASSERT(bIsLogin2RegisterConOK); m_mapWidget.insert(s_sigLoginWidget, pLoginWidget); QWidget* pLoginingWidget = new CLoginingWidget(); bool VARIABLE_IS_NOT_USED bIsLogingStatusConOK = connect( pLoginingWidget, SIGNAL(requestEnd(const GuiCommon::ERequestStatus&)), this, SLOT(endLogining(const GuiCommon::ERequestStatus&))); Q_ASSERT(bIsLogingStatusConOK); m_mapWidget.insert(s_sigLoginingWidget, pLoginingWidget); QWidget* pRegisterWidget = new CRegisterWidget(); bool VARIABLE_IS_NOT_USED bIsRegisterConOK = connect( pRegisterWidget, SIGNAL(request(const QString&, const QString&)), this, SLOT(showRegistering(const QString&, const QString&))); Q_ASSERT(bIsRegisterConOK); bool VARIABLE_IS_NOT_USED bIsRegister2LoginConOK = connect( pRegisterWidget, SIGNAL(switch2Login()), this, SLOT(showLogin())); Q_ASSERT(bIsRegister2LoginConOK); bool VARIABLE_IS_NOT_USED bIsRegister2VerifyConOK = connect( pRegisterWidget, SIGNAL(switch2Verify()), this, SLOT(showVerify())); Q_ASSERT(bIsRegister2VerifyConOK); m_mapWidget.insert(s_sigRegisterWidget, pRegisterWidget); QWidget* pRegisteringWidget = new CRegisteringWidget(); bool VARIABLE_IS_NOT_USED bIsReigsteringConOK = connect( pRegisteringWidget, SIGNAL(requestEnd(const GuiCommon::ERequestStatus&)), this, SLOT(endRegistering(const GuiCommon::ERequestStatus&))); Q_ASSERT(bIsReigsteringConOK); m_mapWidget.insert(s_sigRegisteringWidget, pRegisteringWidget); QWidget* pVerifyWidget = new CVerifyWidget(); bool VARIABLE_IS_NOT_USED bIsVerifyConOK = connect( pVerifyWidget, SIGNAL(request(const QString&, const QString&)), this, SLOT(showVerifying(const QString&, const QString&))); Q_ASSERT(bIsVerifyConOK); bool VARIABLE_IS_NOT_USED bIsVerify2Login = connect( pVerifyWidget, SIGNAL(switch2Login()), this, SLOT(showLogin())); Q_ASSERT(bIsVerify2Login); m_mapWidget.insert(s_sigVerifyWidget, pVerifyWidget); QWidget* pVerifyingWidget = new CVerifyingWidget(); bool VARIABLE_IS_NOT_USED bIsVerifyingConOK = connect( pVerifyingWidget, SIGNAL(requestEnd(const GuiCommon::ERequestStatus&)), this, SLOT(endVerifying(const GuiCommon::ERequestStatus&))); Q_ASSERT(bIsVerifyingConOK); m_mapWidget.insert(s_sigVerifyingWidget, pVerifyingWidget); }
void PCloudApp::createMenus(){ notloggedmenu=new QMenu(); registerAction=new QAction(tr ("Register"), this); connect(registerAction, SIGNAL(triggered()), this, SLOT(showRegister())); loginAction=new QAction(tr("Login"), this); connect(loginAction, SIGNAL(triggered()), this, SLOT(showLogin())); settingsAction=new QAction(tr("Settings"), this); connect(settingsAction, SIGNAL(triggered()), this, SLOT(showSettings())); helpAction = new QAction(tr("Help"),this); connect(helpAction, SIGNAL(triggered()), this, SLOT(showpcloudHelp())); aboutPCloudAction = new QAction(tr("About"), this); connect(aboutPCloudAction, SIGNAL(triggered()), this, SLOT(showpCloudAbout())); exitAction=new QAction(tr("Exit"), this); // to be hidden in account tab connect(exitAction, SIGNAL(triggered()), this, SLOT(doExit())); notloggedmenu->addAction(registerAction); notloggedmenu->addAction(loginAction); notloggedmenu->addAction(settingsAction); notloggedmenu->addAction(helpAction); notloggedmenu->addAction(aboutPCloudAction); notloggedmenu->addSeparator(); notloggedmenu->addAction(exitAction); // to be hidden in account tab or settings accountAction = new QAction(tr("Account"), this); // Account tab // to remove username from menu connect(accountAction, SIGNAL(triggered()),this, SLOT(showAccount())); openAction=new QAction("Open pCloud folder", this); connect(openAction, SIGNAL(triggered()), this, SLOT(openCloudDir())); //shareFolderAction=new QAction("Share folder", this); //to del //connect(shareFolderAction, SIGNAL(triggered()), this, SLOT(shareFolder())); outgoingSharesAction=new QAction("My Shares", this); //to del connect(outgoingSharesAction, SIGNAL(triggered()), this, SLOT(outgoingShares())); incomingSharesAction=new QAction("Shared with Me", this); //to del connect(incomingSharesAction, SIGNAL(triggered()), this, SLOT(incomingShares())); sharesAction = new QAction(tr("Shares"),this); connect(sharesAction, SIGNAL(triggered()), this, SLOT(showShares())); logoutAction=new QAction("Logout", this); connect(logoutAction, SIGNAL(triggered()), this, SLOT(logOut())); openPCloudWinAction = new QAction("Open PCloud Window", this); // to del connect(openPCloudWinAction, SIGNAL(triggered()), this, SLOT(openpCloudWindow())); loggedmenu = new QMenu(); loggedmenu->addAction(openAction); loggedmenu->addAction(accountAction); // loggedmenu->addSeparator(); //loggedmenu->addAction(shareFolderAction); // to del // loggedmenu->addAction(outgoingSharesAction); //loggedmenu->addAction(incomingSharesAction); loggedmenu->addAction(sharesAction); loggedmenu->addAction(settingsAction); loggedmenu->addAction(helpAction); loggedmenu->addAction(aboutPCloudAction); loggedmenu->addSeparator(); loggedmenu->addAction(logoutAction); // to hide in acc tab loggedmenu->addAction(exitAction); // loggedmenu->addAction(openpCloudFormAction); // first form }
void PCloudApp::showOnClick(){ if (loggedin) openCloudDir(); else showLogin(); }