mirror of
https://github.com/QuasarApp/QtDeployer.git
synced 2025-04-27 14:04:31 +00:00
qt 5.5 done
This commit is contained in:
parent
9faa3eca88
commit
88d18550ff
@ -1,13 +1,34 @@
|
||||
#include "about.h"
|
||||
#include "ui_about.h"
|
||||
#include <QPixmap>
|
||||
|
||||
About::About(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
QDialog(parent),
|
||||
ui(new Ui::About)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
this->setModal(true);
|
||||
|
||||
ui->logo->setText("<img align=middle height=100 width=110 src='://icon' />");
|
||||
QString text = QString("<p style='text-align: left;'> </p>"
|
||||
"<p style='text-align: left;'>%0<br />%1 <a href='https://github.com/ShahriarSS/QtLinuxDeployer' target='_blank' rel='noopener'><span style='color: #00ff00;'>QtLinuxDeployer</span></a></p>"
|
||||
"<p style='text-align: left;'><br /><span style='color: #00ff00;'>%2</span><br />* %3 <span style='color: #00ff00;'>%4</span>.<br />* %5<span style='color: #00ff00;'> %6</span>.</p>"
|
||||
"<p style='text-align: left;'>%7</p>"
|
||||
"<p style='text-align: left;'>%8<a href='https://github.com/EndrII' target='_blank' rel='noopener'><span style='color: #00ff00;'> EndrII </span></a><br /> Copyright (C) 12 Mar 2018 - Apr 10, 2018"
|
||||
" <span style='color: #00ff00;'>ShahriarSS</span>.<br /> Copyright (C) Apr 10, 2018<span style='color: #00ff00;'>QuasarApp</span>.</p>").
|
||||
arg(
|
||||
tr("This application forked by ShahriarSS"),
|
||||
tr("Page of original soft:"),
|
||||
tr("Developers of fork:"),
|
||||
tr("Programmer:"),
|
||||
tr("Yankovich Andrei"),
|
||||
tr("Designer:"),
|
||||
tr("Bakovets Alina"),
|
||||
tr("This application is distributed under the LGPLv3 license."),
|
||||
tr("Contact:"));
|
||||
ui->text->setText(text);
|
||||
}
|
||||
About::~About()
|
||||
{
|
||||
delete ui;
|
||||
|
@ -1,13 +1,13 @@
|
||||
#ifndef ABOUT_H
|
||||
#define ABOUT_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class About;
|
||||
}
|
||||
|
||||
class About : public QWidget
|
||||
class About : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -1,30 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>About</class>
|
||||
<widget class="QWidget" name="About">
|
||||
<widget class="QDialog" name="About">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>244</height>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>400</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>400</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
<string>About</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="logo">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>0</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>99999</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
|
@ -56,7 +56,7 @@ void MainManager::prepare(const QString &qtdir, const QString &projectdir)
|
||||
|
||||
void MainManager::deploy(const QStringList& list){
|
||||
m_cpp->setCppLibraries(list);
|
||||
start(false);
|
||||
start(true);
|
||||
}
|
||||
|
||||
void MainManager::start(bool erase)
|
||||
|
@ -41,13 +41,7 @@ SOURCES += \
|
||||
CPP/outputmanager.cpp \
|
||||
CPP/pluginmanager.cpp \
|
||||
CPP/qmlmanager.cpp \
|
||||
CPP/buildmanager.cpp \
|
||||
mainwindow.cpp \
|
||||
CPP/buildpage.cpp \
|
||||
CPP/deploypage.cpp \
|
||||
CPP/listmodel.cpp \
|
||||
CPP/listviewdelegate.cpp \
|
||||
CPP/about.cpp
|
||||
CPP/buildmanager.cpp
|
||||
|
||||
HEADERS += \
|
||||
CPP/baseclass.h \
|
||||
@ -56,13 +50,27 @@ HEADERS += \
|
||||
CPP/outputmanager.h \
|
||||
CPP/pluginmanager.h \
|
||||
CPP/qmlmanager.h \
|
||||
CPP/buildmanager.h \
|
||||
CPP/buildmanager.h
|
||||
|
||||
|
||||
lessThan(QT_MINOR_VERSION, 6){
|
||||
|
||||
SOURCES += \
|
||||
mainwindow.cpp \
|
||||
CPP/buildpage.cpp \
|
||||
CPP/deploypage.cpp \
|
||||
CPP/listmodel.cpp \
|
||||
CPP/listviewdelegate.cpp \
|
||||
CPP/about.cpp
|
||||
|
||||
HEADERS += \
|
||||
mainwindow.h \
|
||||
CPP/buildpage.h \
|
||||
CPP/deploypage.h \
|
||||
CPP/listmodel.h \
|
||||
CPP/listviewdelegate.h \
|
||||
CPP/about.h
|
||||
}
|
||||
|
||||
TRANSLATIONS += \
|
||||
languages/en.ts
|
||||
|
@ -1,4 +1,6 @@
|
||||
#if QT_VERSION > 0x050501
|
||||
#include <QtGlobal>
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0))
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
@ -16,22 +18,24 @@
|
||||
#include "CPP/pluginmanager.h"
|
||||
#include "CPP/qmlmanager.h"
|
||||
#include "CPP/buildmanager.h"
|
||||
#include <iostream>
|
||||
|
||||
|
||||
|
||||
bool loadTr(QGuiApplication *app){
|
||||
QTranslator translator;
|
||||
bool initLocale(const QString &locale, QGuiApplication& app, QTranslator &translator){
|
||||
|
||||
QString defaultLocale = QLocale::system().name();
|
||||
defaultLocale.truncate(defaultLocale.lastIndexOf('_'));
|
||||
|
||||
if(!locale.isEmpty() && translator.load(QString(":/languages/%0").arg(locale))){
|
||||
return app.installTranslator(&translator);
|
||||
}
|
||||
|
||||
if(!translator.load(QString(":/languages/%0").arg(defaultLocale))){
|
||||
return false;
|
||||
}
|
||||
app->installTranslator(&translator);
|
||||
|
||||
return true;
|
||||
|
||||
return app.installTranslator(&translator);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@ -39,7 +43,7 @@ int main(int argc, char *argv[])
|
||||
QGuiApplication *app;;
|
||||
|
||||
|
||||
#if QT_VERSION > 0x050501
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||
app = new QGuiApplication(argc, argv);
|
||||
#else
|
||||
app = new QApplication(argc, argv);
|
||||
@ -49,7 +53,17 @@ int main(int argc, char *argv[])
|
||||
|
||||
app->setWindowIcon(QIcon("://icon"));
|
||||
|
||||
loadTr(app);
|
||||
QTranslator translator;
|
||||
|
||||
QString locale = "";
|
||||
|
||||
if(argc > 1) {
|
||||
locale = QString::fromLatin1(argv[1]);
|
||||
}
|
||||
|
||||
if(!initLocale(locale, *app, translator)){
|
||||
std::cout << "error load language : " << locale.toStdString() <<std::endl;
|
||||
}
|
||||
|
||||
CppManager C;
|
||||
QmlManager Q;
|
||||
@ -60,7 +74,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
MainManager M(&C, &Q, &O, &P, &B);
|
||||
|
||||
#if QT_VERSION > 0x050501
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||
QQmlApplicationEngine engine;
|
||||
|
||||
auto *R = engine.rootContext();
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include <QMessageBox>
|
||||
#include "CPP/about.h"
|
||||
|
||||
MainWindow::MainWindow(MainManager * mainManager, QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
@ -9,6 +10,7 @@ MainWindow::MainWindow(MainManager * mainManager, QWidget *parent) :
|
||||
_mainManager = mainManager;
|
||||
ui->setupUi(this);
|
||||
|
||||
|
||||
buidlpage = new BuildPage(this);
|
||||
deployPage = new DeployPage(_mainManager->getCpp() ,this);
|
||||
|
||||
@ -17,8 +19,8 @@ MainWindow::MainWindow(MainManager * mainManager, QWidget *parent) :
|
||||
|
||||
ui->stackedWidget->setCurrentIndex(0);
|
||||
|
||||
initMenu();
|
||||
|
||||
connect(ui->menubar, SIGNAL(build(QString,QString)), _mainManager, SLOT(prepare(QString,QString)));
|
||||
connect(buidlpage, SIGNAL(build(QString,QString)), _mainManager, SLOT(prepare(QString,QString)));
|
||||
connect(_mainManager->getBuild(), SIGNAL(logChanged(QString)), buidlpage, SLOT(log(QString)));
|
||||
connect(_mainManager->getBuild(), SIGNAL(finished()), this, SLOT(buidlFinisfed()));
|
||||
@ -32,14 +34,23 @@ void MainWindow::newDeploy(){
|
||||
}
|
||||
|
||||
void MainWindow::initMenu(){
|
||||
QAction *deploy = new QAction(tr("new deploy"));
|
||||
|
||||
QMenu *file = new QMenu(tr("Qt-Deployer"));
|
||||
|
||||
QAction *deploy = new QAction(tr("new deploy"), this);
|
||||
connect(deploy, SIGNAL(triggered(bool)),SLOT(newDeploy()));
|
||||
ui->menubar->addAction(deploy);
|
||||
file->addAction(deploy);
|
||||
|
||||
QAction *about = new QAction(tr("about"));
|
||||
QAction *about = new QAction(tr("about"), this);
|
||||
connect(about, SIGNAL(triggered(bool)),SLOT(about()));
|
||||
ui->menubar->addAction(about);
|
||||
file->addAction(about);
|
||||
|
||||
ui->menubar->addMenu(file);
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::about(){
|
||||
(new About())->show();
|
||||
}
|
||||
|
||||
void MainWindow::buidlFinisfed(){
|
||||
|
@ -20,7 +20,7 @@ private:
|
||||
BuildPage *buidlpage;
|
||||
DeployPage *deployPage;
|
||||
|
||||
initMenu();
|
||||
void initMenu();
|
||||
|
||||
private slots:
|
||||
void buidlFinisfed();
|
||||
|
Loading…
x
Reference in New Issue
Block a user