Skip to content
Permalink
Browse files

Welcomepage: Add loading indicator and allow keyboard for project sel…

…ection
  • Loading branch information
m-kuhn committed Aug 19, 2015
1 parent c783f26 commit f955cf2eba9d942782bf43a2b59409c7f9d7d81b
Showing with 65 additions and 5 deletions.
  1. +60 −2 doc/whatsnew.html
  2. +4 −2 src/app/qgswelcomepage.cpp
  3. +1 −1 src/app/qgswelcomepage.h
@@ -13,12 +13,15 @@
color: #08c;
}

.feed-element {
.#feed {
margin: 1em;
background-color: #eee;
background-color: white;
border-radius: 9px;
padding: 1em;
border: 1px solid #999;
}

.feed-element {
overflow: auto;
}

@@ -36,6 +39,50 @@
float: left;
margin-right: 1em;
}


/* Spinner from http://tobiasahlin.com/spinkit */
.spinner {
margin: 100px auto 0;
width: 70px;
text-align: center;
}

.spinner > div {
width: 18px;
height: 18px;
background-color: #333;

border-radius: 100%;
display: inline-block;
-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.spinner .bounce1 {
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}

.spinner .bounce2 {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}

@-webkit-keyframes sk-bouncedelay {
0%, 80%, 100% { -webkit-transform: scale(0) }
40% { -webkit-transform: scale(1.0) }
}

@keyframes sk-bouncedelay {
0%, 80%, 100% {
-webkit-transform: scale(0);
transform: scale(0);
} 40% {
-webkit-transform: scale(1.0);
transform: scale(1.0);
}
}
</style>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
@@ -45,6 +92,8 @@
function initialize() {
var feed = new google.feeds.Feed('http://blog.qgis.org/feed/');
feed.load(function(result) {
var spinner = document.getElementById("loader");
spinner.parentNode.removeChild(spinner);
if (!result.error) {
var container = document.getElementById("feed");
result.feed.entries.forEach(
@@ -79,13 +128,22 @@
}
)
}
else {
container.innerHTML="<h1>No News</h1><p>Sorry, it seems that the news feed is unavailable. This indicates problems with the internet connection.</p>";
}
});
}
google.setOnLoadCallback(initialize);

</script>
</head>
<body>
<div id="loader" class="spinner">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
</div>

<div id="feed"></div>
</body>
</html>
@@ -74,6 +74,8 @@ QgsWelcomePage::QgsWelcomePage( QWidget* parent )
whatsNewPage->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
whatsNewPage->setContextMenuPolicy( Qt::NoContextMenu );
whatsNewPage->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding );
whatsNewPage->setStyleSheet( "background:transparent" );
whatsNewPage->setAttribute( Qt::WA_TranslucentBackground );

whatsNewContainer->layout()->addWidget( whatsNewPage );
whatsNewContainer->setMaximumWidth( 250 );
@@ -90,15 +92,15 @@ QgsWelcomePage::QgsWelcomePage( QWidget* parent )
connect( versionInfo, SIGNAL( versionInfoAvailable() ), this, SLOT( versionInfoReceived() ) );
versionInfo->checkVersion();

connect( recentProjectsListView, SIGNAL( doubleClicked( QModelIndex ) ), this, SLOT( itemDoubleClicked( QModelIndex ) ) );
connect( recentProjectsListView, SIGNAL( activated( QModelIndex ) ), this, SLOT( itemActivated( QModelIndex ) ) );
}

void QgsWelcomePage::setRecentProjects( const QList<QgsWelcomePageItemsModel::RecentProjectData>& recentProjects )
{
mModel->setRecentProjects( recentProjects );
}

void QgsWelcomePage::itemDoubleClicked( const QModelIndex& index )
void QgsWelcomePage::itemActivated( const QModelIndex& index )
{
QgisApp::instance()->openProject( mModel->data( index, Qt::ToolTipRole ).toString() );
}
@@ -31,7 +31,7 @@ class QgsWelcomePage : public QWidget
void setRecentProjects( const QList<QgsWelcomePageItemsModel::RecentProjectData>& recentProjects );

private slots:
void itemDoubleClicked( const QModelIndex& index );
void itemActivated( const QModelIndex& index );
void versionInfoReceived();
void whatsNewLinkClicked( const QUrl& url );

0 comments on commit f955cf2

Please sign in to comment.
You can’t perform that action at this time.