Showing a blocking dialog in init() is a bad idea, because then
initialization doesn't actually finish until the dialog is closed.
For example, this delays the setup of the tray icon.
Instead, go through the event loop before showing the initial
connection dialog.
// restore locked state of docks
QtUi::actionCollection("General")->action("LockLayout")->setChecked(s.value("LockLayout", false).toBool());
// restore locked state of docks
QtUi::actionCollection("General")->action("LockLayout")->setChecked(s.value("LockLayout", false).toBool());
- CoreConnection *conn = Client::coreConnection();
- if (!conn->connectToCore()) {
- // No autoconnect selected (or no accounts)
- showCoreConnectionDlg();
- }
+ QTimer::singleShot(0, this, SLOT(doAutoConnect()));
+void MainWin::doAutoConnect()
+{
+ if (!Client::coreConnection()->connectToCore()) {
+ // No autoconnect selected (or no accounts)
+ showCoreConnectionDlg();
+ }
+}
+
+
void MainWin::connectedToCore()
{
Q_CHECK_PTR(Client::bufferViewManager());
void MainWin::connectedToCore()
{
Q_CHECK_PTR(Client::bufferViewManager());
void showNewTransferDlg(const QUuid &transferId);
void onFullScreenToggled();
void showNewTransferDlg(const QUuid &transferId);
void onFullScreenToggled();
+ void doAutoConnect();
+
void handleCoreConnectionError(const QString &errorMsg);
void userAuthenticationRequired(CoreAccount *, bool *valid, const QString &errorMessage);
void handleNoSslInClient(bool *accepted);
void handleCoreConnectionError(const QString &errorMsg);
void userAuthenticationRequired(CoreAccount *, bool *valid, const QString &errorMessage);
void handleNoSslInClient(bool *accepted);