@@ -96,20 +96,21 @@ AccountSettings::AccountSettings(const AccountStatePtr &accountState, QWidget *p
96
96
});
97
97
}
98
98
99
- ui->connectLabel ->clear ();
99
+ ui->connectionStatusLabel ->clear ();
100
100
101
101
connect (_accountState.data (), &AccountState::stateChanged, this , &AccountSettings::slotAccountStateChanged);
102
102
slotAccountStateChanged ();
103
103
104
- connect (ui->accountToolButton , &QToolButton::clicked, this , [this ] {
104
+ connect (ui->manageAccountButton , &QToolButton::clicked, this , [this ] {
105
105
QMenu *menu = new QMenu (this );
106
106
menu->setAttribute (Qt::WA_DeleteOnClose);
107
107
menu->setAccessibleName (tr (" Account options menu" ));
108
108
menu->addAction (_accountState->isSignedOut () ? tr (" Log in" ) : tr (" Log out" ), this , &AccountSettings::slotToggleSignInState);
109
109
auto *reconnectAction = menu->addAction (tr (" Reconnect" ), this , [this ] { _accountState->checkConnectivity (true ); });
110
110
reconnectAction->setEnabled (!_accountState->isConnected () && !_accountState->isSignedOut ());
111
+ menu->addAction (CommonStrings::showInWebBrowser (), this , [this ] { QDesktopServices::openUrl (_accountState->account ()->url ()); });
111
112
menu->addAction (tr (" Remove" ), this , &AccountSettings::slotDeleteAccount);
112
- menu->popup (mapToGlobal (ui->accountToolButton ->pos ()));
113
+ menu->popup (mapToGlobal (ui->manageAccountButton ->pos ()));
113
114
114
115
// set the focus for accessability
115
116
menu->setFocus ();
@@ -125,7 +126,7 @@ AccountSettings::AccountSettings(const AccountStatePtr &accountState, QWidget *p
125
126
}
126
127
});
127
128
connect (ui->stackedWidget , &QStackedWidget::currentChanged, this ,
128
- [this ] { ui->accountToolButton ->setEnabled (ui->stackedWidget ->currentWidget () == ui->quickWidget ); });
129
+ [this ] { ui->manageAccountButton ->setEnabled (ui->stackedWidget ->currentWidget () == ui->quickWidget ); });
129
130
ui->stackedWidget ->setCurrentWidget (ui->quickWidget );
130
131
}
131
132
@@ -357,14 +358,14 @@ void AccountSettings::slotDisableVfsCurrentFolder(Folder *folder)
357
358
void AccountSettings::showConnectionLabel (const QString &message, QStringList errors)
358
359
{
359
360
if (errors.isEmpty ()) {
360
- ui->connectLabel ->setText (message);
361
- ui->connectLabel ->setToolTip (QString ());
361
+ ui->connectionStatusLabel ->setText (message);
362
+ ui->connectionStatusLabel ->setToolTip (QString ());
362
363
} else {
363
364
errors.prepend (message);
364
365
const QString msg = errors.join (QLatin1String (" \n " ));
365
366
qCDebug (lcAccountSettings) << msg;
366
- ui->connectLabel ->setText (msg);
367
- ui->connectLabel ->setToolTip (QString ());
367
+ ui->connectionStatusLabel ->setText (msg);
368
+ ui->connectionStatusLabel ->setToolTip (QString ());
368
369
}
369
370
ui->accountStatus ->setVisible (!message.isEmpty ());
370
371
ui->warningLabel ->setVisible (!errors.isEmpty ());
@@ -471,42 +472,40 @@ void AccountSettings::slotAccountStateChanged()
471
472
472
473
switch (state) {
473
474
case AccountState::PausedDueToMetered:
474
- showConnectionLabel (tr (" Sync to %1 is paused due to metered internet connection. " ). arg (server ));
475
+ showConnectionLabel (tr (" Sync is paused due to metered internet connection" ));
475
476
break ;
476
477
case AccountState::Connected: {
477
478
QStringList errors;
478
479
if (account->serverSupportLevel () != Account::ServerSupportLevel::Supported) {
479
480
errors << tr (" The server version %1 is unsupported! Proceed at your own risk." ).arg (account->capabilities ().status ().versionString ());
480
481
}
481
- showConnectionLabel (tr (" Connected to %1. " ). arg (server ), errors);
482
+ showConnectionLabel (tr (" Connected" ), errors);
482
483
break ;
483
484
}
484
485
case AccountState::ServiceUnavailable:
485
- showConnectionLabel (tr (" Server %1 is temporarily unavailable. " ). arg (server ));
486
+ showConnectionLabel (tr (" Server is temporarily unavailable" ));
486
487
break ;
487
488
case AccountState::MaintenanceMode:
488
- showConnectionLabel (tr (" Server %1 is currently in maintenance mode. " ). arg (server ));
489
+ showConnectionLabel (tr (" Server is currently in maintenance mode" ));
489
490
break ;
490
491
case AccountState::SignedOut:
491
- showConnectionLabel (tr (" Signed out from %1. " ). arg (server ));
492
+ showConnectionLabel (tr (" Signed out" ));
492
493
break ;
493
494
case AccountState::AskingCredentials: {
494
- showConnectionLabel (tr (" Updating credentials for %1 ..." ). arg (server ));
495
+ showConnectionLabel (tr (" Updating credentials..." ));
495
496
break ;
496
497
}
497
498
case AccountState::Connecting:
498
- showConnectionLabel (tr (" Connecting to: %1. " ). arg (server ));
499
+ showConnectionLabel (tr (" Connecting... " ));
499
500
break ;
500
501
case AccountState::ConfigurationError:
501
- showConnectionLabel (tr (" Server configuration error: %1." )
502
- .arg (server),
503
- _accountState->connectionErrors ());
502
+ showConnectionLabel (tr (" Server configuration error" ), _accountState->connectionErrors ());
504
503
break ;
505
504
case AccountState::NetworkError:
506
505
// don't display the error to the user, https://github.com/owncloud/client/issues/9790
507
506
[[fallthrough]];
508
507
case AccountState::Disconnected:
509
- showConnectionLabel (tr (" Disconnected from: %1. " ). arg (server ));
508
+ showConnectionLabel (tr (" Disconnected" ));
510
509
break ;
511
510
}
512
511
}
0 commit comments