mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 18:23:22 +02:00
Merge pull request #3331 from ctrlaltdavid/19961
Code Review for Job #19961
This commit is contained in:
commit
29ed1b3fcd
3 changed files with 20 additions and 3 deletions
|
@ -246,7 +246,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
|||
connect(&domainHandler, SIGNAL(connectedToDomain(const QString&)), SLOT(updateWindowTitle()));
|
||||
connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(updateWindowTitle()));
|
||||
connect(&domainHandler, &DomainHandler::settingsReceived, this, &Application::domainSettingsReceived);
|
||||
|
||||
connect(&domainHandler, &DomainHandler::hostnameChanged, Menu::getInstance(), &Menu::clearLoginDialogDisplayedFlag);
|
||||
|
||||
// hookup VoxelEditSender to PaymentManager so we can pay for octree edits
|
||||
const PaymentManager& paymentManager = PaymentManager::getInstance();
|
||||
connect(&_voxelEditSender, &VoxelEditPacketSender::octreePaymentRequired,
|
||||
|
|
|
@ -114,6 +114,7 @@ Menu::Menu() :
|
|||
_loginAction(NULL),
|
||||
_preferencesDialog(NULL),
|
||||
_loginDialog(NULL),
|
||||
_hasLoginDialogDisplayed(false),
|
||||
_snapshotsLocation(),
|
||||
_scriptsLocation(),
|
||||
_walletPrivateKey()
|
||||
|
@ -1052,12 +1053,24 @@ void sendFakeEnterEvent() {
|
|||
|
||||
const float DIALOG_RATIO_OF_WINDOW = 0.30f;
|
||||
|
||||
void Menu::clearLoginDialogDisplayedFlag() {
|
||||
// Needed for domains that don't require login.
|
||||
_hasLoginDialogDisplayed = false;
|
||||
}
|
||||
|
||||
void Menu::loginForCurrentDomain() {
|
||||
if (!_loginDialog) {
|
||||
if (!_loginDialog && !_hasLoginDialogDisplayed) {
|
||||
_loginDialog = new LoginDialog(Application::getInstance()->getWindow());
|
||||
_loginDialog->show();
|
||||
_loginDialog->resizeAndPosition(false);
|
||||
}
|
||||
|
||||
_hasLoginDialogDisplayed = true;
|
||||
}
|
||||
|
||||
void Menu::showLoginForCurrentDomain() {
|
||||
_hasLoginDialogDisplayed = false;
|
||||
loginForCurrentDomain();
|
||||
}
|
||||
|
||||
void Menu::editPreferences() {
|
||||
|
@ -1404,7 +1417,7 @@ void Menu::toggleLoginMenuItem() {
|
|||
// change the menu item to login
|
||||
_loginAction->setText("Login");
|
||||
|
||||
connect(_loginAction, &QAction::triggered, this, &Menu::loginForCurrentDomain);
|
||||
connect(_loginAction, &QAction::triggered, this, &Menu::showLoginForCurrentDomain);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -175,7 +175,9 @@ signals:
|
|||
|
||||
public slots:
|
||||
|
||||
void clearLoginDialogDisplayedFlag();
|
||||
void loginForCurrentDomain();
|
||||
void showLoginForCurrentDomain();
|
||||
void bandwidthDetails();
|
||||
void octreeStatsDetails();
|
||||
void lodTools();
|
||||
|
@ -302,6 +304,7 @@ private:
|
|||
QPointer<AttachmentsDialog> _attachmentsDialog;
|
||||
QPointer<AnimationsDialog> _animationsDialog;
|
||||
QPointer<LoginDialog> _loginDialog;
|
||||
bool _hasLoginDialogDisplayed;
|
||||
QAction* _chatAction;
|
||||
QString _snapshotsLocation;
|
||||
QString _scriptsLocation;
|
||||
|
|
Loading…
Reference in a new issue