Skip to content
Permalink
Browse files

Use tab widget for welcome page. Move init to start of app

  • Loading branch information
NathanW2 committed Aug 26, 2015
1 parent 686fb71 commit 100a60981c1c7278924d98c9d0cc17f97e63d520
Showing with 18 additions and 19 deletions.
  1. +10 −12 src/app/qgisapp.cpp
  2. +6 −6 src/app/qgswelcomepage.cpp
  3. +2 −1 src/app/qgswelcomepage.h
@@ -582,7 +582,16 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
int myBlue = settings.value( "/qgis/default_canvas_color_blue", 255 ).toInt();
mMapCanvas->setCanvasColor( QColor( myRed, myGreen, myBlue ) );

centralLayout->addWidget( mMapCanvas, 0, 0, 2, 1 );
mWelcomePage = new QgsWelcomePage;

mCentralContainer = new QStackedWidget;
mCentralContainer->insertWidget( 0, mMapCanvas );
mCentralContainer->insertWidget( 1, mWelcomePage );

qobject_cast<QGridLayout *>( centralWidget->layout() )->addWidget( mCentralContainer, 0, 0, 2, 1 );

mCentralContainer->setCurrentIndex( 1 );


// a bar to warn the user with non-blocking messages
mInfoBar = new QgsMessageBar( centralWidget );
@@ -3913,19 +3922,8 @@ void QgisApp::fileOpenAfterLaunch()
QString projPath = QString();
if ( projOpen == 0 ) // welcome page
{
mWelcomePage = new QgsWelcomePage;

mCentralContainer = new QStackedWidget;
mCentralContainer->insertWidget( 0, mMapCanvas );
mCentralContainer->insertWidget( 1, mWelcomePage );

connect( mMapCanvas, SIGNAL( layersChanged() ), this, SLOT( showMapCanvas() ) );
connect( this, SIGNAL( newProject() ), this, SLOT( showMapCanvas() ) );

qobject_cast<QGridLayout *>( centralWidget()->layout() )->addWidget( mCentralContainer, 0, 0, 2, 1 );

mCentralContainer->setCurrentIndex( 1 );

return;
}
if ( projOpen == 1 && mRecentProjects.size() > 0 ) // most recent project
@@ -26,7 +26,7 @@
#include <QDesktopServices>

QgsWelcomePage::QgsWelcomePage( QWidget* parent )
: QWidget( parent )
: QTabWidget( parent )
{
QVBoxLayout* mainLayout = new QVBoxLayout;
mainLayout->setMargin( 0 );
@@ -62,7 +62,7 @@ QgsWelcomePage::QgsWelcomePage( QWidget* parent )

recentProjctsContainer->layout()->addWidget( recentProjectsListView );

layout->addWidget( recentProjctsContainer );
addTab( recentProjctsContainer, "Recent Projects" );

QWidget* whatsNewContainer = new QWidget;
whatsNewContainer->setLayout( new QVBoxLayout );
@@ -73,14 +73,14 @@ QgsWelcomePage::QgsWelcomePage( QWidget* parent )
whatsNewPage->setUrl( QUrl::fromLocalFile( QgsApplication::whatsNewFilePath() ) );
whatsNewPage->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
whatsNewPage->setContextMenuPolicy( Qt::NoContextMenu );
whatsNewPage->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding );
whatsNewPage->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
whatsNewPage->setStyleSheet( "background:transparent" );
whatsNewPage->setAttribute( Qt::WA_TranslucentBackground );

whatsNewContainer->layout()->addWidget( whatsNewPage );
whatsNewContainer->setMaximumWidth( 250 );
whatsNewContainer->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
layout->addWidget( whatsNewContainer );
// whatsNewContainer->setMaximumWidth( 250 );
// whatsNewContainer->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
addTab( whatsNewContainer, "News" );

connect( whatsNewPage, SIGNAL( linkClicked( QUrl ) ), this, SLOT( whatsNewLinkClicked( QUrl ) ) );

@@ -16,12 +16,13 @@
#ifndef QGSWELCOMEDIALOG_H
#define QGSWELCOMEDIALOG_H

#include <QTabWidget>
#include <QWidget>
#include <QLabel>

#include "qgswelcomepageitemsmodel.h"

class QgsWelcomePage : public QWidget
class QgsWelcomePage : public QTabWidget
{
Q_OBJECT

8 comments on commit 100a609

@slarosa

This comment has been minimized.

Copy link
Member

@slarosa slarosa replied Aug 29, 2015

@NathanW2 why you moved the initialization of welcome page to the start of app?
as it is now I never see the Welcome Page on start of qgis.

@NathanW2

This comment has been minimized.

Copy link
Member Author

@NathanW2 NathanW2 replied Aug 29, 2015

@slarosa

This comment has been minimized.

Copy link
Member

@slarosa slarosa replied Aug 29, 2015

@NathanW2 ok, thanks for fixing it. (and for all the other cool stuff :))

@m-kuhn

This comment has been minimized.

Copy link
Member

@m-kuhn m-kuhn replied Aug 29, 2015

@NathanW2

Do you think the News page still has value if it is on a separate tab?

The original idea was to be able to push information to the user, but who will ever click on the tab if it only changes once every 2 months? I think if the news page is not on the front page, we better remove it completely and replace it with a link which opens a browser.

Or we could also think about the possibilities it offers as a push notifications system. This includes creating a new rss feed of which the PSC is in control and can publish:

  • New release information
  • Conferences
  • Relevant project informatoin (Like: yay, we now have an LTR release)
@NathanW2

This comment has been minimized.

Copy link
Member Author

@NathanW2 NathanW2 replied Aug 29, 2015

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson replied Aug 29, 2015

I'm against the idea of the blog always shown on the front page (so shoving it away in a tab is fine by me :p ). But a push system would be a good approach so that new content is only shown once. ..

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn replied Aug 30, 2015

I'm also not a super fan of blog content shown on the front page as it was before.

As a source of inspiration, I find the way Firefox pushes updates on its browser homepage very, very good (i.e. the small tips and updates that appear below the search box). It's very subtle and works very well.

@m-kuhn

This comment has been minimized.

Copy link
Member

@m-kuhn m-kuhn replied Aug 30, 2015

If nobody likes the blog there I think it should be removed completely.
If some kind of push notification should be shown instead, I still think that it should either

  • be on the front page
  • or have a notification icon "unread news" on the tab (or a similar non-pull approach)
Please sign in to comment.
You can’t perform that action at this time.