source: subsurface/subsurface-desktop-helper.cpp

Last change on this file was db8e8957, checked in by Dirk Hohndel <dirk@…>, 8 months ago

Settings update: Add "Dive Computer" settings to SettingsObjectWrapper?

For some reason, the dive computer settings weren't in the
settings prefs. This moves it, makes the boilerplate on Settings
ObjectWrapper? and make things compile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@…>
Signed-off-by: Dirk Hohndel <dirk@…>

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/* qt-gui.cpp */
2/* Qt UI implementation */
3#include "core/dive.h"
4#include "core/display.h"
5#include "desktop-widgets/mainwindow.h"
6#include "core/helpers.h"
7#include "core/pluginmanager.h"
8
9#include <QApplication>
10#include <QDesktopWidget>
11#include <QNetworkProxy>
12#include <QLibraryInfo>
13
14#include "core/qt-gui.h"
15
16#ifdef SUBSURFACE_MOBILE
17#include <QQuickWindow>
18#include <QQmlApplicationEngine>
19#include <QQmlContext>
20#include <QSortFilterProxyModel>
21#include "mobile-widgets/qmlmanager.h"
22#include "qt-models/divelistmodel.h"
23#include "mobile-widgets/qmlprofile.h"
24QObject *qqWindowObject = NULL;
25#endif
26
27static MainWindow *window = NULL;
28
29void init_ui()
30{
31        init_qt_late();
32
33        PluginManager::instance().loadPlugins();
34
35        window = new MainWindow();
36        if (existing_filename && existing_filename[0] != '\0')
37                window->setTitle(MWTF_FILENAME);
38        else
39                window->setTitle(MWTF_DEFAULT);
40}
41
42void run_ui()
43{
44        window->show();
45        qApp->exec();
46}
47
48void exit_ui()
49{
50        delete window;
51        delete qApp;
52        free((void *)existing_filename);
53}
54
55double get_screen_dpi()
56{
57        QDesktopWidget *mydesk = qApp->desktop();
58        return mydesk->physicalDpiX();
59}
60
61
Note: See TracBrowser for help on using the repository browser.