summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt41
-rw-r--r--android.cpp3
-rw-r--r--libdivecomputer.c6
-rw-r--r--packaging/android/build.sh23
-rw-r--r--qt-models/completionmodels.cpp13
-rw-r--r--qt-models/completionmodels.h6
-rw-r--r--qt-models/divelocationmodel.cpp23
-rw-r--r--qt-models/divelocationmodel.h7
-rw-r--r--qt-ui/maintab.cpp30
-rw-r--r--qt-ui/maintab.h2
-rw-r--r--qt-ui/modeldelegates.cpp69
-rw-r--r--qt-ui/modeldelegates.h9
-rw-r--r--qt-ui/printdialog.cpp2
-rw-r--r--qt-ui/printdialog.h2
14 files changed, 176 insertions, 60 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2424376d7..534e8e2b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,13 +14,13 @@ option(NO_MARBLE "disable the marble widget" OFF)
option(NO_TESTS "disable the tests" OFF)
option(NO_DOCS "disable the docs" OFF)
option(NO_PRINTING "disable the printing support" ON)
+option(NO_USERMANUAL "don't include a viewer for the user manual" OFF)
option(USE_LIBGIT23_API "allow building with libgit2 master" OFF)
option(SUBSURFACE_MOBILE "build the QtQuick version for mobile device" OFF)
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${${PROJECT_NAME}_SOURCE_DIR}/cmake/Modules
- ${${PROJECT_NAME}_SOURCE_SIR}/../install-root/lib/cmake/libssh2
)
include_directories(.
@@ -119,6 +119,17 @@ else()
printer.cpp
templatelayout.cpp
)
+ set(PRINTING_PKG PrintSupport)
+ set(PRINTING_LIB Qt5::PrintSupport)
+endif()
+
+if(NO_USERMANUAL)
+ message(STATUS "building without usermanual")
+ add_definitions(-DNO_USERMANUAL)
+else()
+ set(USERMANUAL qt-ui/usermanual.cpp)
+ set(WEBKIT_PKG WebKitWidgets)
+ set(WEBKIT_LIB Qt5::WebKitWidgets)
endif()
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${LIBDIVECOMPUTER_LIBRARIES} ${LIBGIT2_LIBRARIES} ${GRANTLEE_LIBRARIES} -lusb-1.0)
@@ -140,13 +151,15 @@ endif()
# configure Qt.
if(SUBSURFACE_MOBILE)
- set(QT_QUICK Quick)
+ set(QT_QUICK_PKG Quick)
+ set(QT_QUICK_LIB Qt5::Quick)
endif()
-find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network WebKitWidgets PrintSupport Svg Test LinguistTools ${QT_QUICK})
-set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network Qt5::WebKitWidgets Qt5::PrintSupport Qt5::Svg)
-if(SUBSURFACE_MOBILE)
- set(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Quick)
+if(CMAKE_SYSTEM_NAME STREQUAL "Android")
+ set(ANDROID_PKG AndroidExtras)
+ set(ANDROID_LIB Qt5::AndroidExtras)
endif()
+find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network ${WEBKIT_PKG} ${PRINTING_PKG} Svg Test LinguistTools ${QT_QUICK_PKG} ${ANDROID_PKG})
+set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network ${WEBKIT_LIB} ${PRINTING_LIB} Qt5::Svg ${QT_QUICK_PKG} ${ANDROID_LIB})
set(QT_TEST_LIBRARIES ${QT_LIBRARIES} Qt5::Test)
# Generate the ssrf-config.h every 'make'
@@ -213,6 +226,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# in some builds we appear to be missing libz for some strange reason...
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -lz)
endif()
+if(CMAKE_SYSTEM_NAME STREQUAL "Android")
+ set(PLATFORM_SRC android.cpp)
+ # FIXME: Shouldn't cmake/Qt add this automatically somehow?
+ add_definitions(-DQ_OS_ANDROID)
+ set(SUBSURFACE_TARGET subsurface)
+endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(FBSUPPORT 1)
set(SUBSURFACE_TARGET Subsurface)
@@ -353,7 +372,7 @@ set(SUBSURFACE_INTERFACE
qt-ui/divelogimportdialog.cpp
qt-ui/tagwidget.cpp
qt-ui/groupedlineedit.cpp
- qt-ui/usermanual.cpp
+ ${USERMANUAL}
qt-ui/divelogexportdialog.cpp
qt-ui/divepicturewidget.cpp
qt-ui/usersurvey.cpp
@@ -442,7 +461,13 @@ if(SUBSURFACE_MOBILE)
subsurface_corelib
${SUBSURFACE_LINK_LIBRARIES})
else()
- add_executable(${SUBSURFACE_TARGET} MACOSX_BUNDLE WIN32 ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
+ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
+ # FIXME: is this the right way to link somehting which
+ # androiddeployqt can work with?
+ add_library(${SUBSURFACE_TARGET} SHARED ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
+ else()
+ add_executable(${SUBSURFACE_TARGET} MACOSX_BUNDLE WIN32 ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
+ endif()
target_link_libraries(
${SUBSURFACE_TARGET}
subsurface_generated_ui
diff --git a/android.cpp b/android.cpp
index 0bb7db020..0b4aadb27 100644
--- a/android.cpp
+++ b/android.cpp
@@ -26,6 +26,9 @@ bool subsurface_ignore_font(const char *font)
return false;
}
+void subsurface_user_info(struct user_info *user)
+{ /* Encourage use of at least libgit2-0.20 */ }
+
const char *system_default_filename(void)
{
/* Replace this when QtCore/QStandardPaths getExternalStorageDirectory landed */
diff --git a/libdivecomputer.c b/libdivecomputer.c
index ef6e4f871..24f4d0ff5 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -137,6 +137,12 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
}
if (!IS_FP_SAME(tank.volume, 0.0))
no_volume = false;
+
+ // this new API also gives us the beginning and end pressure for the tank
+ if (!IS_FP_SAME(tank.beginpressure, 0.0) && !IS_FP_SAME(tank.endpressure, 0.0)) {
+ dive->cylinder[i].start.mbar = tank.beginpressure * 1000;
+ dive->cylinder[i].end.mbar = tank.endpressure * 1000;
+ }
#endif
if (no_volume) {
/* for the first tank, if there is no tanksize available from the
diff --git a/packaging/android/build.sh b/packaging/android/build.sh
index fa029e5e0..63c99ff7b 100644
--- a/packaging/android/build.sh
+++ b/packaging/android/build.sh
@@ -2,7 +2,7 @@
set -e
# Configure where we can find things here
-export ANDROID_NDK_ROOT=$PWD/../../../android-ndk-r10d
+export ANDROID_NDK_ROOT=$PWD/../../../android-ndk-r10e
export ANDROID_SDK_ROOT=$PWD/../../../android-sdk-linux
export QT5_ANDROID=$PWD/../../../Qt/5.4
export ANDROID_NDK_HOST=linux-x86
@@ -12,7 +12,7 @@ SQLITE_VERSION=3080704
LIBXML2_VERSION=2.9.2
LIBXSLT_VERSION=1.1.28
LIBZIP_VERSION=0.11.2
-LIBGIT2_VERSION=0.21.2
+LIBGIT2_VERSION=0.23.0-rc1
LIBUSB_VERSION=1.0.19
# arm or x86
@@ -34,8 +34,8 @@ export BUILDROOT=$PWD
export PATH=${BUILDROOT}/ndk-$ARCH/bin:$PATH
export PREFIX=${BUILDROOT}/ndk-$ARCH/sysroot/usr
export PKG_CONFIG_LIBDIR=${PREFIX}/lib/pkgconfig
-export CC=${BUILDCHAIN}-gcc
-export CXX=${BUILDCHAIN}-g++
+export CC=${BUILDROOT}/ndk-$ARCH/bin/${BUILDCHAIN}-gcc
+export CXX=${BUILDROOT}/ndk-$ARCH/bin/${BUILDCHAIN}-g++
if [ ! -e sqlite-autoconf-${SQLITE_VERSION}.tar.gz ] ; then
wget http://www.sqlite.org/2014/sqlite-autoconf-${SQLITE_VERSION}.tar.gz
@@ -110,8 +110,7 @@ fi
if [ ! -e $PKG_CONFIG_LIBDIR/libgit2.pc ] ; then
mkdir -p libgit2-build-$ARCH
pushd libgit2-build-$ARCH
- # -DCMAKE_CXX_COMPILER=arm-linux-androideabi-g++
- cmake -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=Android -DCMAKE_C_COMPILER=${CC} -DCMAKE_FIND_ROOT_PATH=${PREFIX} -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DANDROID=ON -DSHA1_TYPE=builtin -DBUILD_CLAR=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=${PREFIX} ../libgit2-${LIBGIT2_VERSION}/
+ cmake -DCMAKE_SYSTEM_NAME=Android -DSHA1_TYPE=builtin -DBUILD_CLAR=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=${PREFIX} ../libgit2-${LIBGIT2_VERSION}/
make
make install
# Patch away pkg-config dependency to zlib, its there, i promise
@@ -154,11 +153,9 @@ fi
mkdir -p subsurface-build-$ARCH
cd subsurface-build-$ARCH
-if [ ! -e Makefile ] ; then
- $QT5_ANDROID_BIN/qmake V=1 QT_CONFIG=+pkg-config ../../../
-fi
-make -j4
-make install INSTALL_ROOT=android_build
+cmake -DCMAKE_SYSTEM_NAME=Android -DLIBDC_FROM_PKGCONFIG=ON -DLIBGIT2_FROM_PKGCONFIG=ON -DUSE_LIBGIT23_API=ON -DNO_MARBLE=ON -DNO_PRINTING=ON -DNO_USERMANUAL=ON -DCMAKE_PREFIX_PATH:UNINITIALIZED=${QT5_ANDROID}/android_${QT_ARCH}/lib/cmake ../../../
+make
+#make install INSTALL_ROOT=android_build
# bug in androiddeployqt? why is it looking for something with the builddir in it?
-ln -fs android-libsubsurface.so-deployment-settings.json android-libsubsurface-build-${ARCH}.so-deployment-settings.json
-$QT5_ANDROID_BIN/androiddeployqt --output android_build
+#ln -fs android-libsubsurface.so-deployment-settings.json android-libsubsurface-build-${ARCH}.so-deployment-settings.json
+#$QT5_ANDROID_BIN/androiddeployqt --output android_build
diff --git a/qt-models/completionmodels.cpp b/qt-models/completionmodels.cpp
index f2e70afd1..ff2afd997 100644
--- a/qt-models/completionmodels.cpp
+++ b/qt-models/completionmodels.cpp
@@ -42,19 +42,6 @@ CREATE_CSV_UPDATE_METHOD(BuddyCompletionModel, buddy);
CREATE_CSV_UPDATE_METHOD(DiveMasterCompletionModel, divemaster);
CREATE_UPDATE_METHOD(SuitCompletionModel, suit);
-void LocationCompletionModel::updateModel()
-{
- QStringList list;
- struct dive_site *ds;
- int i = 0;
- for_each_dive_site(i, ds) {
- if (!list.contains(ds->name))
- list.append(ds->name);
- }
- std::sort(list.begin(), list.end());
- setStringList(list);
-}
-
void TagCompletionModel::updateModel()
{
if (g_tag_list == NULL)
diff --git a/qt-models/completionmodels.h b/qt-models/completionmodels.h
index 859b8c007..c4dfd2a58 100644
--- a/qt-models/completionmodels.h
+++ b/qt-models/completionmodels.h
@@ -15,12 +15,6 @@ public:
void updateModel();
};
-class LocationCompletionModel : public QStringListModel {
- Q_OBJECT
-public:
- void updateModel();
-};
-
class SuitCompletionModel : public QStringListModel {
Q_OBJECT
public:
diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp
index 32bccd5e1..3d3c77616 100644
--- a/qt-models/divelocationmodel.cpp
+++ b/qt-models/divelocationmodel.cpp
@@ -13,10 +13,15 @@ LocationInformationModel *LocationInformationModel::instance()
return self;
}
-LocationInformationModel::LocationInformationModel(QObject *obj) : QAbstractListModel(obj), internalRowCount(0)
+LocationInformationModel::LocationInformationModel(QObject *obj) : QAbstractTableModel(obj), internalRowCount(0)
{
}
+int LocationInformationModel::columnCount(const QModelIndex &parent) const
+{
+ return COLUMNS;
+}
+
int LocationInformationModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
@@ -33,8 +38,20 @@ QVariant LocationInformationModel::data(const QModelIndex &index, int role) cons
return QVariant();
switch(role) {
- case Qt::DisplayRole : return qPrintable(ds->name);
- case DIVE_SITE_UUID : return ds->uuid;
+ case Qt::DisplayRole :
+ switch(index.column()) {
+ case UUID: return ds->uuid;
+ case NAME: return ds->name;
+ case LATITUDE: return ds->latitude.udeg;
+ case LONGITUDE: return ds->longitude.udeg;
+ case COORDS: return "TODO";
+ case DESCRIPTION: return ds->description;
+ case NOTES: return ds->name;
+ case TAXONOMY_1: return "TODO";
+ case TAXONOMY_2: return "TODO";
+ case TAXONOMY_3: return "TODO";
+ }
+ break;
}
return QVariant();
diff --git a/qt-models/divelocationmodel.h b/qt-models/divelocationmodel.h
index c7d8c2ed5..8cae3a08a 100644
--- a/qt-models/divelocationmodel.h
+++ b/qt-models/divelocationmodel.h
@@ -1,15 +1,16 @@
#ifndef DIVELOCATIONMODEL_H
#define DIVELOCATIONMODEL_H
-#include <QAbstractListModel>
+#include <QAbstractTableModel>
#include <QStringListModel>
#include <stdint.h>
-class LocationInformationModel : public QAbstractListModel {
+class LocationInformationModel : public QAbstractTableModel {
Q_OBJECT
public:
- enum { DIVE_SITE_UUID = Qt::UserRole+1};
+ enum Columns { UUID, NAME, LATITUDE, LONGITUDE, COORDS, DESCRIPTION, NOTES, TAXONOMY_1, TAXONOMY_2, TAXONOMY_3, COLUMNS};
static LocationInformationModel *instance();
+ int columnCount(const QModelIndex &parent) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index = QModelIndex(), int role = Qt::DisplayRole) const;
int32_t addDiveSite(const QString& name, int lat = 0, int lon = 0);
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index dd6ce72b0..591f665d5 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -58,6 +58,24 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.extraData->setModel(extraDataModel);
closeMessage();
+ QCompleter *completer = new QCompleter();
+ completer->setModel(LocationInformationModel::instance());
+ completer->setCompletionColumn(LocationInformationModel::NAME);
+ completer->setCompletionRole(Qt::DisplayRole);
+ completer->setCompletionMode(QCompleter::PopupCompletion);
+ completer->setCaseSensitivity(Qt::CaseInsensitive);
+
+ QListView *completerListview = new QListView();
+ completerListview->setItemDelegate(new LocationFilterDelegate());
+ completer->setPopup(completerListview);
+
+ QListView *completerListView2 = new QListView();
+ completerListView2->setItemDelegate(new LocationFilterDelegate());
+ completerListView2->setModel(LocationInformationModel::instance());
+ completerListView2->setModelColumn(1);
+ completerListView2->show();
+
+ ui.location->setCompleter(completer);
connect(ui.addDiveSite, SIGNAL(clicked()), this, SLOT(showDiveSiteSimpleEdit()));
connect(ui.geocodeButton, SIGNAL(clicked()), this, SLOT(reverseGeocode()));
@@ -101,11 +119,6 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
connect(ui.cylinders->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editCylinderWidget(QModelIndex)));
connect(ui.weights->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editWeightWidget(QModelIndex)));
- LocationCompletionModel *locationCompletion = new LocationCompletionModel();
- ui.location->setCompleter(new QCompleter(locationCompletion));
- ui.location->completer()->setCaseSensitivity(Qt::CaseInsensitive);
- ui.location->completer()->setCompletionMode(QCompleter::PopupCompletion);
-
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::USE, new TankUseDelegate(this));
ui.weights->view()->setItemDelegateForColumn(WeightModel::TYPE, new WSInfoDelegate(this));
@@ -471,9 +484,6 @@ void MainTab::updateDiveInfo(bool clear)
struct dive *prevd;
char buf[1024];
- LocationCompletionModel *m = qobject_cast<LocationCompletionModel*>(ui.location->completer()->model());
- m->updateModel();
-
process_selected_dives();
process_all_dives(&displayed_dive, &prevd);
@@ -768,9 +778,9 @@ void MainTab::reload()
{
suitModel.updateModel();
buddyModel.updateModel();
- locationModel.updateModel();
diveMasterModel.updateModel();
tagModel.updateModel();
+ LocationInformationModel::instance()->update();
}
// tricky little macro to edit all the selected dives
@@ -1382,8 +1392,6 @@ void MainTab::on_location_editingFinished()
markChangedWidget(ui.location);
LocationInformationModel::instance()->update();
- LocationCompletionModel *m = qobject_cast<LocationCompletionModel*>(ui.location->completer()->model());
- m->updateModel();
emit diveSiteChanged(uuid);
return;
}
diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h
index eac1521cc..306aee66e 100644
--- a/qt-ui/maintab.h
+++ b/qt-ui/maintab.h
@@ -14,6 +14,7 @@
#include "ui_maintab.h"
#include "completionmodels.h"
+#include "divelocationmodel.h"
#include "dive.h"
class WeightModel;
@@ -106,7 +107,6 @@ private:
EditMode editMode;
BuddyCompletionModel buddyModel;
DiveMasterCompletionModel diveMasterModel;
- LocationCompletionModel locationModel;
SuitCompletionModel suitModel;
TagCompletionModel tagModel;
DivePictureModel *divePictureModel;
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp
index 827e6ab27..68e62a5cb 100644
--- a/qt-ui/modeldelegates.cpp
+++ b/qt-ui/modeldelegates.cpp
@@ -10,10 +10,15 @@
#include "weigthsysteminfomodel.h"
#include "weightmodel.h"
#include "divetripmodel.h"
+#include "qthelper.h"
#include <QCompleter>
#include <QKeyEvent>
#include <QTextDocument>
+#include <QApplication>
+#include <QFont>
+#include <QBrush>
+#include <QColor>
QSize DiveListDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
{
@@ -476,3 +481,67 @@ QSize HTMLDelegate::sizeHint ( const QStyleOptionViewItem & option, const QModel
doc.setTextWidth(options.rect.width());
return QSize(doc.idealWidth(), doc.size().height());
}
+
+LocationFilterDelegate::LocationFilterDelegate(QObject *parent)
+{
+}
+
+void LocationFilterDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
+{
+ QFont fontBigger = qApp->font();
+ QFont fontSmaller = qApp->font();
+ QFontMetrics fmBigger(fontBigger);
+ QStyleOptionViewItemV4 opt = option;
+ QStyledItemDelegate::initStyleOption(&opt, index);
+ QBrush bg;
+ QString diveSiteName = index.data().toString();
+
+ struct dive_site *ds = get_dive_site_by_uuid(
+ index.model()->data(index.model()->index(index.row(),0)).toInt()
+ );
+ if (!ds)
+ return;
+
+ const char *gpsCoords = printGPSCoords(displayed_dive_site.latitude.udeg, displayed_dive_site.longitude.udeg);
+ QString diveSiteCoords(gpsCoords);
+ free( (void*) gpsCoords);
+
+ fontBigger.setPointSize(fontBigger.pointSize() + 2);
+ fontBigger.setBold(true);
+
+ painter->save();
+ painter->setRenderHint(QPainter::Antialiasing);
+ if( ( option.state & QStyle::State_Selected ) || ( option.state & QStyle::State_MouseOver ) )
+ bg = option.palette.highlight();
+ else
+ bg = option.palette.window();
+ painter->setPen(QPen(Qt::NoPen));
+ painter->setBrush(bg);
+ painter->drawRect(option.rect);
+ painter->restore();
+
+ painter->save();
+ painter->setBrush(option.palette.text());
+ painter->setFont(fontBigger);
+ painter->drawText(option.rect.x(),option.rect.y() + fmBigger.boundingRect("YH").height(), diveSiteName);
+ painter->setFont(fontSmaller);
+ painter->setBrush(option.palette.brightText());
+ painter->drawText(option.rect.x(),option.rect.y() + fmBigger.boundingRect("YH").height() * 2, diveSiteCoords);
+ painter->restore();
+}
+
+QSize LocationFilterDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
+{
+ QFont fontBigger = qApp->font();
+ fontBigger.setPointSize(fontBigger.pointSize() + 2);
+ fontBigger.setBold(true);
+
+ QFontMetrics fmBigger(fontBigger);
+
+ QFont fontSmaller = qApp->font();
+ QFontMetrics fmSmaller(fontSmaller);
+
+ QSize retSize = QStyledItemDelegate::sizeHint(option, index);
+ retSize.setHeight(fmBigger.boundingRect("Yellow House").height() + 5 /*spacing*/ + fmSmaller.boundingRect("Yellow House").height());
+ return retSize;
+}
diff --git a/qt-ui/modeldelegates.h b/qt-ui/modeldelegates.h
index f501c5214..95701775a 100644
--- a/qt-ui/modeldelegates.h
+++ b/qt-ui/modeldelegates.h
@@ -129,4 +129,13 @@ public:
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
};
+
+class LocationFilterDelegate : public QStyledItemDelegate {
+ Q_OBJECT
+public:
+ LocationFilterDelegate(QObject *parent = 0);
+ void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
+ QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
+};
+
#endif // MODELDELEGATES_H
diff --git a/qt-ui/printdialog.cpp b/qt-ui/printdialog.cpp
index 4a3314691..6f30f89f5 100644
--- a/qt-ui/printdialog.cpp
+++ b/qt-ui/printdialog.cpp
@@ -2,6 +2,7 @@
#include "printoptions.h"
#include "mainwindow.h"
+#ifndef NO_PRINTING
#include <QProgressBar>
#include <QPrintPreviewDialog>
#include <QPrintDialog>
@@ -10,7 +11,6 @@
#define SETTINGS_GROUP "PrintDialog"
-#ifndef NO_PRINTING
PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
{
// check if the options were previously stored in the settings; if not use some defaults.
diff --git a/qt-ui/printdialog.h b/qt-ui/printdialog.h
index 9937cd549..a34037442 100644
--- a/qt-ui/printdialog.h
+++ b/qt-ui/printdialog.h
@@ -1,12 +1,12 @@
#ifndef PRINTDIALOG_H
#define PRINTDIALOG_H
+#ifndef NO_PRINTING
#include <QDialog>
#include <QPrinter>
#include "printoptions.h"
#include "printer.h"
-#ifndef NO_PRINTING
class QProgressBar;
class PrintOptions;
class PrintLayout;