mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-23 06:38:07 +00:00
feat(app): supports Components
This commit is contained in:
parent
51c5694d4a
commit
7137e95d9d
8 changed files with 26 additions and 40 deletions
|
|
@ -2,10 +2,10 @@
|
|||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>main_window</name>
|
||||
<name>SearchBar</name>
|
||||
<message>
|
||||
<source>helloWorld</source>
|
||||
<translation>Hello World!</translation>
|
||||
<translation>Hello World</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>main_window</name>
|
||||
<name>SearchBar</name>
|
||||
<message>
|
||||
<source>helloWorld</source>
|
||||
<translation>Bonjour le monde !</translation>
|
||||
<translation>Bonjour le monde</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
QT += core gui quick widgets
|
||||
QT = core gui quick widgets
|
||||
|
||||
TARGET = linphone
|
||||
TEMPLATE = app
|
||||
|
||||
SOURCES += \
|
||||
SOURCES = \
|
||||
src/app.cpp \
|
||||
src/main.cpp \
|
||||
src/views/main_window.cpp
|
||||
|
||||
HEADERS += \
|
||||
HEADERS = \
|
||||
src/app.hpp \
|
||||
src/views/main_window.hpp
|
||||
|
||||
|
|
@ -17,8 +17,10 @@ TRANSLATIONS = \
|
|||
languages/fr.ts
|
||||
|
||||
lupdate_only{
|
||||
# Each component folder must be added explicitly.
|
||||
SOURCES = \
|
||||
ui/*.qml
|
||||
ui/components/SearchBar/*.qml \
|
||||
ui/views/*.qml
|
||||
}
|
||||
|
||||
RESOURCES += \
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
<file>languages/fr.qm</file>
|
||||
|
||||
<!-- UI. -->
|
||||
<file>ui/main_window.qml</file>
|
||||
<file>ui/components/SearchBar/SearchBar.qml</file>
|
||||
<file>ui/views/main_window.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
#define LANGUAGES_PATH ":/languages/"
|
||||
|
||||
// ===================================================================
|
||||
|
||||
App::App(int &argc, char **argv) : QGuiApplication(argc, argv) {
|
||||
// Try to enable system translation by default. (else english)
|
||||
if (m_translator.load(QString(LANGUAGES_PATH) + QLocale::system().name()) ||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
|
||||
#include "app.hpp"
|
||||
|
||||
int main (int argc, char *argv[]) {
|
||||
// Init main window.
|
||||
App app(argc, argv);
|
||||
QQmlApplicationEngine engine(QUrl("qrc:/ui/main_window.qml"));
|
||||
// ===================================================================
|
||||
|
||||
int main (int argc, char *argv[]) {
|
||||
App app(argc, argv);
|
||||
QQmlApplicationEngine engine(QUrl("qrc:/ui/views/main_window.qml"));
|
||||
|
||||
// File not found.
|
||||
if (engine.rootObjects().isEmpty())
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
#ifndef MAIN_WINDOW_H
|
||||
#define MAIN_WINDOW_H
|
||||
#ifndef MAIN_WINDOW_H_
|
||||
#define MAIN_WINDOW_H_
|
||||
|
||||
#endif // MAIN_WINDOW
|
||||
class MainWindow {
|
||||
// TODO.
|
||||
};
|
||||
|
||||
#endif // MAIN_WINDOW_
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
import QtQuick 2.5
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
ApplicationWindow {
|
||||
id: mainWindow
|
||||
visible: true
|
||||
|
||||
header: ToolBar {
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
|
||||
footer: TabBar {
|
||||
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: qsTr("helloWorld");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue