Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/ruqolacentralwidget.cpp
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 77 | { | |||
---|---|---|---|---|---|
78 | return mRuqolaMainWidget->roomId(); | 78 | return mRuqolaMainWidget->roomId(); | ||
79 | } | 79 | } | ||
80 | 80 | | |||
81 | QString RuqolaCentralWidget::roomType() const | 81 | QString RuqolaCentralWidget::roomType() const | ||
82 | { | 82 | { | ||
83 | return mRuqolaMainWidget->roomType(); | 83 | return mRuqolaMainWidget->roomType(); | ||
84 | } | 84 | } | ||
85 | 85 | | |||
86 | void RuqolaCentralWidget::setCurrentRocketChatAccount(RocketChatAccount *account) | 86 | void RuqolaCentralWidget::setCurrentRocketChatAccount(RocketChatAccount *account, bool showLastRoom) | ||
87 | { | 87 | { | ||
88 | if (mCurrentRocketChatAccount) { | 88 | if (mCurrentRocketChatAccount) { | ||
89 | disconnect(mCurrentRocketChatAccount, nullptr, this, nullptr); | 89 | disconnect(mCurrentRocketChatAccount, nullptr, this, nullptr); | ||
90 | } | 90 | } | ||
91 | mCurrentRocketChatAccount = account; | 91 | mCurrentRocketChatAccount = account; | ||
92 | connect(mCurrentRocketChatAccount, &RocketChatAccount::loginStatusChanged, this, &RuqolaCentralWidget::slotLoginStatusChanged); | 92 | connect(mCurrentRocketChatAccount, &RocketChatAccount::loginStatusChanged, this, &RuqolaCentralWidget::slotLoginStatusChanged); | ||
93 | connect(mCurrentRocketChatAccount, &RocketChatAccount::socketError, this, &RuqolaCentralWidget::slotSocketError); | 93 | connect(mCurrentRocketChatAccount, &RocketChatAccount::socketError, this, &RuqolaCentralWidget::slotSocketError); | ||
94 | connect(mCurrentRocketChatAccount, &RocketChatAccount::jobFailed, this, &RuqolaCentralWidget::slotJobFailedInfo); | 94 | connect(mCurrentRocketChatAccount, &RocketChatAccount::jobFailed, this, &RuqolaCentralWidget::slotJobFailedInfo); | ||
95 | mRuqolaMainWidget->setCurrentRocketChatAccount(account); | 95 | mRuqolaMainWidget->setCurrentRocketChatAccount(account, showLastRoom); | ||
96 | //Check if account is connected or not. | 96 | //Check if account is connected or not. | ||
97 | slotLoginStatusChanged(); | 97 | slotLoginStatusChanged(); | ||
98 | } | 98 | } | ||
99 | 99 | | |||
100 | void RuqolaCentralWidget::slotLoginStatusChanged() | 100 | void RuqolaCentralWidget::slotLoginStatusChanged() | ||
101 | { | 101 | { | ||
102 | const auto loginStatus = mCurrentRocketChatAccount->loginStatus(); | 102 | const auto loginStatus = mCurrentRocketChatAccount->loginStatus(); | ||
103 | mRuqolaLoginWidget->setLoginStatus(loginStatus); | 103 | mRuqolaLoginWidget->setLoginStatus(loginStatus); | ||
Show All 10 Lines |