Commit 7ab0ebb4 authored by JanKusanagi's avatar JanKusanagi

Disable specific widgets while sending comment, not the whole CommenterBlock

parent 493c1689
......@@ -461,6 +461,15 @@ bool CommenterBlock::isFullMode()
}
void CommenterBlock::toggleWidgetsWhileSending(bool widgetsEnabled)
{
m_showAllCommentsLinkLabel->setEnabled(widgetsEnabled);
m_commentComposer->setEnabled(widgetsEnabled);
m_toolsButton->setEnabled(widgetsEnabled);
m_commentButton->setEnabled(widgetsEnabled);
}
int CommenterBlock::getCommentCount()
{
return m_currentCommentCount;
......@@ -503,6 +512,9 @@ void CommenterBlock::setMinimumMode()
}
m_fullMode = false;
// Re-enable stuff just in case a POST request never finished and comment was cancelled
this->toggleWidgetsWhileSending(true);
}
......@@ -596,7 +608,7 @@ void CommenterBlock::onPostingCommentOk(QString postId)
m_statusInfoLabel->clear();
// Comment was added successfully, so we can re-enable things
this->setEnabled(true);
this->toggleWidgetsWhileSending(true);
// Erase the text from the comment box...
m_commentComposer->erase();
......@@ -638,7 +650,7 @@ void CommenterBlock::onPostingCommentFailed(QString postId)
m_statusInfoLabel->setText(tr("Posting comment failed.\n\nTry again."));
// Re-enable things, so user can try again
this->setEnabled(true);
this->toggleWidgetsWhileSending(true);
m_commentComposer->setFocus();
disconnect(m_pumpController, &PumpController::commentPostingFailed,
......@@ -686,7 +698,7 @@ void CommenterBlock::sendComment()
m_commentComposer->toHtml());
}
this->setDisabled(true);
this->toggleWidgetsWhileSending(false);
}
else
{
......
......@@ -68,6 +68,7 @@ public:
void redrawComments();
bool isFullMode();
void toggleWidgetsWhileSending(bool widgetsEnabled);
int getCommentCount();
......
......@@ -47,10 +47,10 @@ void customMessageHandler(QtMsgType type,
int main(int argc, char *argv[])
{
QApplication dianaraApp(argc, argv);
dianaraApp.setApplicationName("Dianara");
dianaraApp.setApplicationVersion("1.4.2-dev+9");
dianaraApp.setOrganizationName("JanCoding");
dianaraApp.setOrganizationDomain("jancoding.wordpress.com");
dianaraApp.setApplicationName(QStringLiteral("Dianara"));
dianaraApp.setApplicationVersion(QStringLiteral("1.4.2-dev+10"));
dianaraApp.setOrganizationName(QStringLiteral("JanCoding"));
dianaraApp.setOrganizationDomain(QStringLiteral("jancoding.wordpress.com"));
std::cout << QString("Dianara v%1 - JanKusanagi 2012-2018\n"
"https://jancoding.wordpress.com/dianara\n\n")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment