Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use tab widget for welcome page. Move init to start of app
  • Loading branch information
NathanW2 committed Aug 26, 2015
1 parent 686fb71 commit 100a609
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
22 changes: 10 additions & 12 deletions src/app/qgisapp.cpp
Expand Up @@ -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 );
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/app/qgswelcomepage.cpp
Expand Up @@ -26,7 +26,7 @@
#include <QDesktopServices>

QgsWelcomePage::QgsWelcomePage( QWidget* parent )
: QWidget( parent )
: QTabWidget( parent )
{
QVBoxLayout* mainLayout = new QVBoxLayout;
mainLayout->setMargin( 0 );
Expand Down Expand Up @@ -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 );
Expand All @@ -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 ) ) );

Expand Down
3 changes: 2 additions & 1 deletion src/app/qgswelcomepage.h
Expand Up @@ -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

Expand Down

8 comments on commit 100a609

@slarosa
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Member Author

@NathanW2 NathanW2 commented on 100a609 Aug 29, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slarosa
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented on 100a609 Aug 29, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Member Author

@NathanW2 NathanW2 commented on 100a609 Aug 29, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

@nirvn nirvn commented on 100a609 Aug 30, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

@m-kuhn m-kuhn commented on 100a609 Aug 30, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.