Skip to content

Commit

Permalink
More WITH_QTWEBKIT fixes
Browse files Browse the repository at this point in the history
Conflicts:
	src/app/CMakeLists.txt
  • Loading branch information
m-kuhn committed May 10, 2015
1 parent 7210c4a commit 5a6168e
Show file tree
Hide file tree
Showing 21 changed files with 270 additions and 102 deletions.
24 changes: 17 additions & 7 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ SET(QGIS_APP_SRCS
qgisapp.cpp
qgisappinterface.cpp
qgisappstylesheet.cpp
qgsabout.cpp
qgsapplayertreeviewmenuprovider.cpp
qgssponsors.cpp
qgsaddattrdialog.cpp
Expand Down Expand Up @@ -31,7 +30,6 @@ SET(QGIS_APP_SRCS
qgsdecorationgriddialog.cpp
qgsdxfexportdialog.cpp
qgsformannotationdialog.cpp
qgshtmlannotationdialog.cpp
qgsdelattrdialog.cpp
qgsdiagramproperties.cpp
qgsdisplayangle.cpp
Expand Down Expand Up @@ -62,7 +60,6 @@ SET(QGIS_APP_SRCS
qgsmaptooledit.cpp
qgsmaptoolfeatureaction.cpp
qgsmaptoolformannotation.cpp
qgsmaptoolhtmlannotation.cpp
qgsmaptoolpinlabels.cpp
qgsmaptoolshowhidelabels.cpp
qgsmaptoolidentifyaction.cpp
Expand Down Expand Up @@ -119,7 +116,6 @@ SET(QGIS_APP_SRCS
composer/qgscomposer.cpp
composer/qgscomposerarrowwidget.cpp
composer/qgscomposerattributetablewidget.cpp
composer/qgscomposerhtmlwidget.cpp
composer/qgscomposeritemwidget.cpp
composer/qgscomposerlabelwidget.cpp
composer/qgscomposerpicturewidget.cpp
Expand Down Expand Up @@ -157,11 +153,19 @@ SET(QGIS_APP_SRCS
qgsnewspatialitelayerdialog.cpp
)

IF (WITH_QTWEBKIT)
SET(QGIS_APP_SRCS ${QGIS_APP_SRCS}
qgsabout.cpp
qgshtmlannotationdialog.cpp
qgsmaptoolhtmlannotation.cpp
composer/qgscomposerhtmlwidget.cpp
)
ENDIF (WITH_QTWEBKIT)

SET (QGIS_APP_MOC_HDRS
qgisapp.h
qgisappinterface.h
qgisappstylesheet.h
qgsabout.h
qgsaddattrdialog.h
qgsaddjoindialog.h
qgsaddtaborgroup.h
Expand Down Expand Up @@ -193,7 +197,6 @@ SET (QGIS_APP_MOC_HDRS
qgsfieldcalculator.h
qgsfieldsproperties.h
qgsformannotationdialog.h
qgshtmlannotationdialog.h
qgsidentifyresultsdialog.h
qgslabeldialog.h
qgslabelengineconfigdialog.h
Expand Down Expand Up @@ -261,7 +264,6 @@ SET (QGIS_APP_MOC_HDRS
composer/qgscomposer.h
composer/qgscomposerarrowwidget.h
composer/qgscomposerattributetablewidget.h
composer/qgscomposerhtmlwidget.h
composer/qgscomposeritemwidget.h
composer/qgscomposerlabelwidget.h
composer/qgscomposerlegendwidget.h
Expand Down Expand Up @@ -292,7 +294,15 @@ SET (QGIS_APP_MOC_HDRS
pluginmanager/qgspluginitemdelegate.h

qgsnewspatialitelayerdialog.h
)

IF (WITH_QTWEBKIT)
SET( QGIS_APP_MOC_HDRS ${QGIS_APP_MOC_HDRS}
qgsabout.h
qgshtmlannotationdialog.h
composer/qgscomposerhtmlwidget.h
)
ENDIF (WITH_QTWEBKIT)

SET (WITH_QWTPOLAR TRUE CACHE BOOL "Determines whether QwtPolar should be built")

Expand Down
12 changes: 8 additions & 4 deletions src/app/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
#include "qgscomposerarrowwidget.h"
#include "qgscomposerattributetablewidget.h"
#include "qgscomposerframe.h"
#include "qgscomposerhtml.h"
#include "qgscomposerhtmlwidget.h"
#ifdef WITH_QTWEBKIT
#include "qgscomposerhtml.h"
#include "qgscomposerhtmlwidget.h"
#endif
#include "qgscomposerlabel.h"
#include "qgscomposerlabelwidget.h"
#include "qgscomposerlegend.h"
Expand Down Expand Up @@ -736,7 +738,9 @@ void QgsComposer::connectCompositionSlots()

connect( mComposition, SIGNAL( selectedItemChanged( QgsComposerItem* ) ), this, SLOT( showItemOptions( QgsComposerItem* ) ) );
connect( mComposition, SIGNAL( composerArrowAdded( QgsComposerArrow* ) ), this, SLOT( addComposerArrow( QgsComposerArrow* ) ) );
#ifdef WITH_QTWEBKIT
connect( mComposition, SIGNAL( composerHtmlFrameAdded( QgsComposerHtml*, QgsComposerFrame* ) ), this, SLOT( addComposerHtmlFrame( QgsComposerHtml*, QgsComposerFrame* ) ) );
#endif
connect( mComposition, SIGNAL( composerLabelAdded( QgsComposerLabel* ) ), this, SLOT( addComposerLabel( QgsComposerLabel* ) ) );
connect( mComposition, SIGNAL( composerMapAdded( QgsComposerMap* ) ), this, SLOT( addComposerMap( QgsComposerMap* ) ) );
connect( mComposition, SIGNAL( composerScaleBarAdded( QgsComposerScaleBar* ) ), this, SLOT( addComposerScaleBar( QgsComposerScaleBar* ) ) );
Expand Down Expand Up @@ -3365,7 +3369,7 @@ void QgsComposer::addComposerTableV2( QgsComposerAttributeTableV2 *table, QgsCom
QgsComposerAttributeTableWidget* tWidget = new QgsComposerAttributeTableWidget( table, frame );
mItemWidgetMap.insert( frame, tWidget );
}

#ifdef WITH_QTWEBKIT
void QgsComposer::addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame )
{
if ( !html )
Expand All @@ -3376,7 +3380,7 @@ void QgsComposer::addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame*
QgsComposerHtmlWidget* hWidget = new QgsComposerHtmlWidget( html, frame );
mItemWidgetMap.insert( frame, hWidget );
}

#endif
void QgsComposer::deleteItem( QgsComposerItem* item )
{
QMap<QgsComposerItem*, QWidget*>::iterator it = mItemWidgetMap.find( item );
Expand Down
2 changes: 2 additions & 0 deletions src/app/composer/qgscomposer.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,10 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
/**Adds a composer table v2 to the item/widget map and creates a configuration widget*/
void addComposerTableV2( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame );

#ifdef WITH_QTWEBKIT
/**Adds composer html and creates a configuration widget*/
void addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame );
#endif

/**Removes item from the item/widget map and deletes the configuration widget. Does not delete the item itself*/
void deleteItem( QgsComposerItem* item );
Expand Down
17 changes: 11 additions & 6 deletions src/app/pluginmanager/qgspluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
#include <QActionGroup>
#include <QTextStream>
#include <QTimer>
#include <QWebPage>
#ifdef WITH_QTWEBKIT
#include <QWebPage>
#endif
#include <QDesktopServices>

#include "qgis.h"
Expand Down Expand Up @@ -97,7 +99,10 @@ QgsPluginManager::QgsPluginManager( QWidget * parent, bool pluginsAreEnabled, Qt

// Preset widgets
leFilter->setFocus( Qt::MouseFocusReason );

#ifdef WITH_QTWEBKIT
wvDetails->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
#endif

// Don't restore the last used tab from QSettings
mOptionsListWidget->setCurrentRow( 0 );
Expand Down Expand Up @@ -473,7 +478,7 @@ void QgsPluginManager::reloadModelData()

if ( !mCurrentlyDisplayedPlugin.isEmpty() )
{
wvDetails->setHtml( "" );
wvDetails->setText( "" );
buttonInstall->setEnabled( false );
buttonUninstall->setEnabled( false );
}
Expand Down Expand Up @@ -839,7 +844,7 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item )

html += "</body>";

wvDetails->setHtml( html );
wvDetails->setText( html );

// Set buttonInstall text (and sometimes focus)
buttonInstall->setDefault( false );
Expand Down Expand Up @@ -1084,7 +1089,7 @@ void QgsPluginManager::setCurrentTab( int idx )
// tabInfoHTML += "<style>" + QgsApplication::reportStyleSheet() + "</style>";
tabInfoHTML += it.value();
}
wvDetails->setHtml( tabInfoHTML );
wvDetails->setText( tabInfoHTML );

// disable buttons
buttonInstall->setEnabled( false );
Expand Down Expand Up @@ -1151,7 +1156,7 @@ void QgsPluginManager::on_vwPlugins_doubleClicked( const QModelIndex & theIndex
}



#ifdef WITH_QTWEBKIT
void QgsPluginManager::on_wvDetails_linkClicked( const QUrl & url )
{
if ( url.scheme() == "rpc2" )
Expand All @@ -1178,7 +1183,7 @@ void QgsPluginManager::on_wvDetails_linkClicked( const QUrl & url )
QDesktopServices::openUrl( url );
}
}

#endif


void QgsPluginManager::on_leFilter_textChanged( QString theText )
Expand Down
2 changes: 2 additions & 0 deletions src/app/pluginmanager/qgspluginmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag
//! Load/unload plugin by double click
void on_vwPlugins_doubleClicked( const QModelIndex & index );

#ifdef WITH_QTWEBKIT
//! Handle click in the web wiew
void on_wvDetails_linkClicked( const QUrl & url );
#endif

//! Update the filter when user changes the filter expression
void on_leFilter_textChanged( QString theText );
Expand Down
15 changes: 13 additions & 2 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@
#include "qgisappstylesheet.h"
#include "qgis.h"
#include "qgisplugin.h"
#include "qgsabout.h"
#ifdef WITH_QTWEBKIT
#include "qgsabout.h"
#endif
#include "qgsapplayertreeviewmenuprovider.h"
#include "qgsapplication.h"
#include "qgsattributeaction.h"
Expand Down Expand Up @@ -1293,7 +1295,9 @@ void QgisApp::createActions()
connect( mActionNeedSupport, SIGNAL( triggered() ), this, SLOT( supportProviders() ) );
connect( mActionQgisHomePage, SIGNAL( triggered() ), this, SLOT( helpQgisHomePage() ) );
connect( mActionCheckQgisVersion, SIGNAL( triggered() ), this, SLOT( checkQgisVersion() ) );
#ifdef WITH_QTWEBKIT
connect( mActionAbout, SIGNAL( triggered() ), this, SLOT( about() ) );
#endif
connect( mActionSponsors, SIGNAL( triggered() ), this, SLOT( sponsors() ) );

connect( mActionShowPinnedLabels, SIGNAL( toggled( bool ) ), this, SLOT( showPinnedLabels( bool ) ) );
Expand Down Expand Up @@ -1979,7 +1983,9 @@ void QgisApp::setTheme( QString theThemeName )
mActionDecreaseContrast->setIcon( QgsApplication::getThemeIcon( "/mActionDecreaseContrast.svg" ) );
mActionZoomActualSize->setIcon( QgsApplication::getThemeIcon( "/mActionZoomNative.png" ) );
mActionQgisHomePage->setIcon( QgsApplication::getThemeIcon( "/mActionQgisHomePage.png" ) );
#ifdef WITH_QTWEBKIT
mActionAbout->setIcon( QgsApplication::getThemeIcon( "/mActionHelpAbout.png" ) );
#endif
mActionSponsors->setIcon( QgsApplication::getThemeIcon( "/mActionHelpSponsors.png" ) );
mActionDraw->setIcon( QgsApplication::getThemeIcon( "/mActionDraw.svg" ) );
mActionToggleEditing->setIcon( QgsApplication::getThemeIcon( "/mActionToggleEditing.svg" ) );
Expand Down Expand Up @@ -2212,8 +2218,10 @@ void QgisApp::createCanvasTools()
mMapTools.mTextAnnotation->setAction( mActionTextAnnotation );
mMapTools.mFormAnnotation = new QgsMapToolFormAnnotation( mMapCanvas );
mMapTools.mFormAnnotation->setAction( mActionFormAnnotation );
#ifdef WITH_QTWEBKIT
mMapTools.mHtmlAnnotation = new QgsMapToolHtmlAnnotation( mMapCanvas );
mMapTools.mHtmlAnnotation->setAction( mActionHtmlAnnotation );
#endif
mMapTools.mSvgAnnotation = new QgsMapToolSvgAnnotation( mMapCanvas );
mMapTools.mSvgAnnotation->setAction( mActionSvgAnnotation );
mMapTools.mAnnotation = new QgsMapToolAnnotation( mMapCanvas );
Expand Down Expand Up @@ -2724,6 +2732,7 @@ void QgisApp::sponsors()
sponsors->activateWindow();
}

#ifdef WITH_QTWEBKIT
void QgisApp::about()
{
static QgsAbout *abt = NULL;
Expand Down Expand Up @@ -2789,6 +2798,7 @@ void QgisApp::about()
abt->raise();
abt->activateWindow();
}
#endif

void QgisApp::addLayerDefinition()
{
Expand Down Expand Up @@ -5715,13 +5725,14 @@ bool QgisApp::loadAnnotationItemsFromProject( const QDomDocument& doc )
QgsFormAnnotationItem* newFormItem = new QgsFormAnnotationItem( mMapCanvas );
newFormItem->readXML( doc, formItemList.at( i ).toElement() );
}

#ifdef WITH_QTWEBKIT
QDomNodeList htmlItemList = doc.elementsByTagName( "HtmlAnnotationItem" );
for ( int i = 0; i < htmlItemList.size(); ++i )
{
QgsHtmlAnnotationItem* newHtmlItem = new QgsHtmlAnnotationItem( mMapCanvas );
newHtmlItem->readXML( doc, htmlItemList.at( i ).toElement() );
}
#endif

QDomNodeList svgItemList = doc.elementsByTagName( "SVGAnnotationItem" );
for ( int i = 0; i < svgItemList.size(); ++i )
Expand Down
4 changes: 4 additions & 0 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QAction *actionHelpAPI() { return mActionHelpAPI; }
QAction *actionQgisHomePage() { return mActionQgisHomePage; }
QAction *actionCheckQgisVersion() { return mActionCheckQgisVersion; }

QAction *actionAbout() { return mActionAbout; }
QAction *actionSponsors() { return mActionSponsors; }

Expand Down Expand Up @@ -666,8 +667,11 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow

//! QGis Sponsors
void sponsors();

#ifdef WITH_QTWEBKIT
//! About QGis
void about();
#endif
//! Add a raster layer to the map (will prompt user for file name using dlg )
void addRasterLayer();
//#ifdef HAVE_POSTGRESQL
Expand Down
Loading

0 comments on commit 5a6168e

Please sign in to comment.