commit 1245541a3bfed69c62c278aa654918378455e90d Author: Andrey Date: Mon Oct 24 20:41:50 2022 +0300 first diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..882d8b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/build* +/bin +/release +CMakeLists.txt.user* +*.7z +.vscode +/logs diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..d31666f --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,17 @@ +pipeline { + agent none + stages { + stage('Windows x64') { + agent { docker { image 'windows-shstk' } } + steps { + sh 'mkdir -p build/windows' + sh "cd build/windows && rm -rf ./* && cmake -DCMAKE_TOOLCHAIN_FILE=/soft/toolchain-Windows.cmake -DBUILD_NUMBER=${env.BUILD_NUMBER} ../../src" + sh 'cd build/windows && make -j4' + sh 'cd build/windows && make install -j4' + sh 'cd build/windows && make deploy' + archiveArtifacts 'release/*.zip' + sh 'rm -rf ./build ./bin ./release' + } + } + } +} \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..ade73b3 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.12) +project(strata_test) +cmake_policy(SET CMP0020 NEW) +find_package(QAD REQUIRED) +qad_find_qt(Qt5 Core Gui Widgets OpenGL) +set(INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../) +set(TARGET_SUFFIX_Qt5 "") +if(NOT DEFINED BUILD_NUMBER) + set(BUILD_NUMBER 9999) +endif() +set_version(${PROJECT_NAME} + MAJOR 0 + MINOR 1 + REVISION 0 + BUILD ${BUILD_NUMBER}) +set_deploy_property(${PROJECT_NAME} + LABEL "${PROJECT_NAME}" + FULLNAME "${PROJECT_NAME}" + COMPANY "Strata Solutions") +set_lang(${PROJECT_NAME} "ru") + +make_rc(${PROJECT_NAME} out_RC) +qad_sources(SRC) +qad_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) +qad_add_executable(${PROJECT_NAME} out_CPP ${out_RC} ${MSSDCPP} ${MSSDH}) +qad_target_link_libraries(${PROJECT_NAME} QAD::Graphic) +qad_install(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_DIR}/bin) +qad_install(LANG out_QM DESTINATION ${INSTALL_DIR}/bin/lang) +qad_install_lang(${PROJECT_NAME} DESTINATION ${INSTALL_DIR}/bin/lang) +deploy_target(${PROJECT_NAME} + DEPLOY_DIR ${INSTALL_DIR}/bin + DESTINATION ${INSTALL_DIR}/release + RESOURCES lang/ + ) diff --git a/src/lang/stata_test_ru.ts b/src/lang/stata_test_ru.ts new file mode 100644 index 0000000..f62cf2e --- /dev/null +++ b/src/lang/stata_test_ru.ts @@ -0,0 +1,4 @@ + + + + diff --git a/src/lang/update.bat b/src/lang/update.bat new file mode 100644 index 0000000..1a4c786 --- /dev/null +++ b/src/lang/update.bat @@ -0,0 +1 @@ +lupdate ../ -ts stata_test_ru.ts diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..27d790f --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +#include +#include +#include "mainwindow.h" + + +int main(int argc, char *argv[]) { + QApplication a(argc, argv); + QAD_SETUP_APPLICATION + a.setWindowIcon(QIcon(":/icons/logo.ico")); +#if QT_VERSION >= 0x050000 + a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); +#endif + QStringList trs = QDir(a.applicationDirPath() + "/lang").entryList(QDir::Files); + for(const QString & i : trs) { + QTranslator * tr = new QTranslator(); + if (tr->load("lang/" + i)) { + a.installTranslator(tr); + } else { + qDebug() << "Can`t load translation" << i; + delete tr; + } + } + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp new file mode 100644 index 0000000..49d64fc --- /dev/null +++ b/src/mainwindow.cpp @@ -0,0 +1,14 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} diff --git a/src/mainwindow.h b/src/mainwindow.h new file mode 100644 index 0000000..9353441 --- /dev/null +++ b/src/mainwindow.h @@ -0,0 +1,22 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + +private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/src/mainwindow.ui b/src/mainwindow.ui new file mode 100644 index 0000000..0a06936 --- /dev/null +++ b/src/mainwindow.ui @@ -0,0 +1,24 @@ + + + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + + +