Skip to content

Commit

Permalink
WelcomTab: Fixing a problem where main header text gets hidden at fir…
Browse files Browse the repository at this point in the history
…st launch
  • Loading branch information
simsekgokhan committed Jun 14, 2017
1 parent 36dbc07 commit c93c6b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
# Project version
set(PROJECT_VERSION_MAJOR "1")
set(PROJECT_VERSION_MINOR "1")
set(PROJECT_VERSION_PATCH "0")
set(PROJECT_VERSION_PATCH "1")
set(PROJECT_VERSION_BUILD "")
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${PROJECT_VERSION_BUILD}")

Expand Down
14 changes: 9 additions & 5 deletions src/robomongo/gui/widgets/workarea/WelcomeTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ namespace Robomongo
void WelcomeTab::on_downloadTextReply(QNetworkReply* reply)
{
auto hideOrShowWhatsNewHeader = [this]() {
_whatsNewHeader->setHidden( (!_pic1->pixmap() || _pic1->pixmap()->isNull())
&& _whatsNewText->text().isEmpty() ? true : false);
if ((!_pic1->pixmap() || _pic1->pixmap()->isNull()) && _whatsNewText->text().isEmpty())
_whatsNewHeader->setHidden(true);
else
_whatsNewHeader->setVisible(true);
};

if (reply->operation() == QNetworkAccessManager::HeadOperation) {
Expand Down Expand Up @@ -315,6 +317,7 @@ namespace Robomongo
}

setWhatsNewHeaderAndText(str);
hideOrShowWhatsNewHeader();
saveIntoCache(Text1_URL.fileName(), str, Text1_LastModifiedDateKey,
reply->header(QNetworkRequest::LastModifiedHeader).toString());
}
Expand All @@ -326,8 +329,10 @@ namespace Robomongo

QPixmap image;
auto hideOrShowWhatsNewHeader = [this]() {
_whatsNewHeader->setHidden( (!_pic1->pixmap() || _pic1->pixmap()->isNull())
&& _whatsNewText->text().isEmpty() ? true : false);
if ((!_pic1->pixmap() || _pic1->pixmap()->isNull()) && _whatsNewText->text().isEmpty())
_whatsNewHeader->setHidden(true);
else
_whatsNewHeader->setVisible(true);
};

// Network error, load from cache
Expand Down Expand Up @@ -359,7 +364,6 @@ namespace Robomongo
}
else { // Get from internet
reply->manager()->get(QNetworkRequest(Pic1_URL));
hideOrShowWhatsNewHeader();
return;
}
}
Expand Down

0 comments on commit c93c6b0

Please sign in to comment.