source: subsurface/subsurface-mobile-main.cpp

Last change on this file was 751626e, checked in by Dirk Hohndel <dirk@…>, 3 weeks ago

QML UI: Fully port dive edit to Kirigami2

Completely adapt to the api changes of OverlaySheet? in Kirigami2
in order to achieve the same look and behavior for the dive
edits that had with kirigami1

Port most components to QtQuickContrls2, except comboboxes
in the dive edit sheet that will need a new control type

Signed-off-by: Marco Martin <notmart@…>

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/* main.c */
2#include <locale.h>
3#include <stdio.h>
4#include <string.h>
5#include <stdlib.h>
6#include <time.h>
7
8#include "core/dive.h"
9#include "core/qt-gui.h"
10#include "core/subsurfacestartup.h"
11#include "core/color.h"
12#include "core/qthelper.h"
13#include "core/helpers.h"
14
15#include <QStringList>
16#include <QApplication>
17#include <QLoggingCategory>
18#include <git2.h>
19
20int main(int argc, char **argv)
21{
22        int i;
23        QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
24        QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true"));
25        QApplication *application = new QApplication(argc, argv);
26        (void)application;
27        QStringList arguments = QCoreApplication::arguments();
28
29        bool dedicated_console = arguments.length() > 1 &&
30                                 (arguments.at(1) == QString("--win32console"));
31        subsurface_console_init(dedicated_console, false);
32
33        for (i = 1; i < arguments.length(); i++) {
34                QString a = arguments.at(i);
35                if (!a.isEmpty() && a.at(0) == '-') {
36                        parse_argument(a.toLocal8Bit().data());
37                        continue;
38                }
39        }
40        git_libgit2_init();
41        setup_system_prefs();
42        if (uiLanguage(0).contains("-US"))
43                default_prefs.units = IMPERIAL_units;
44        prefs = default_prefs;
45        fill_profile_color();
46        parse_xml_init();
47        taglist_init_global();
48        init_ui();
49        if (prefs.default_file_behavior == LOCAL_DEFAULT_FILE)
50                set_filename(prefs.default_filename, true);
51        else
52                set_filename(NULL, true);
53
54        // some hard coded settings
55        prefs.animation_speed = 0; // we render the profile to pixmap, no animations
56
57        // always show the divecomputer reported ceiling in red
58        prefs.redceiling = 1;
59
60        init_proxy();
61
62        if (!quit)
63                run_ui();
64        exit_ui();
65        taglist_free(g_tag_list);
66        parse_xml_exit();
67        subsurface_console_exit();
68        free_prefs();
69        return 0;
70}
Note: See TracBrowser for help on using the repository browser.