Skip to content

Commit

Permalink
feat:check in code
Browse files Browse the repository at this point in the history
  • Loading branch information
qucheng.shui committed Sep 27, 2019
1 parent eaeecfe commit 042fe93
Show file tree
Hide file tree
Showing 260 changed files with 213 additions and 36 deletions.
Empty file modified CHANGELOG.md
100644 → 100755
Empty file.
Empty file modified INSTALL.md
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified conanfile.py
100644 → 100755
Empty file.
Empty file modified copyright
100644 → 100755
Empty file.
Empty file modified debian/changelog
100644 → 100755
Empty file.
Empty file modified debian/compat
100644 → 100755
Empty file.
Empty file modified debian/control
100644 → 100755
Empty file.
Empty file modified debian/copyright
100644 → 100755
Empty file.
Empty file modified debian/source/format
100644 → 100755
Empty file.
Empty file modified deepin-boot-maker.pro
100644 → 100755
Empty file.
Empty file modified docs/deepin-boot-maker.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/app/app.pro
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ TARGET = deepin-boot-maker

QT += core gui widgets concurrent network svg

CONFIG += c++11
CONFIG += c++11 link_pkgconfig
PKGCONFIG += dtkwidget

RESOURCES += \
../translate.qrc \
Expand Down
4 changes: 2 additions & 2 deletions src/app/bmwindow.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ BMWindow::BMWindow(QWidget *parent)
auto title = titlebar();
auto flags = windowFlags() & ~Qt::WindowMaximizeButtonHint;
setWindowFlags(flags);
title->setMenuVisible(false);
// title->setMenuVisible(false);
// TODO: read it from parent
#ifdef Q_OS_MAC
titlebar()->setWindowFlags(flags);
Expand Down Expand Up @@ -191,6 +191,7 @@ BMWindow::BMWindow(QWidget *parent)
slideWidget(d->isoWidget, d->usbWidget);
setProperty("bmISOFilePath", d->isoWidget->isoFilePath());
wsib->setCurrentPage(1);
qDebug() << "iso path:" << d->isoWidget->isoFilePath();
});

connect(d->usbWidget, &UsbSelectView::deviceSelected, this, [ = ](const QString & partition, bool format) {
Expand All @@ -217,7 +218,6 @@ BMWindow::BMWindow(QWidget *parent)
slideWidget(d->progressWidget, d->resultWidget);
wsib->setCurrentPage(2);
});

connect(d->progressWidget, &ProgressView::finish,
this, [ = ](quint32 error, const QString & title, const QString & description) {
qDebug() << error << title << description;
Expand Down
Empty file modified src/app/linux/bmwindow.h
100644 → 100755
Empty file.
Empty file modified src/app/main.cpp
100644 → 100755
Empty file.
Empty file modified src/app/other/bmwindow.h
100644 → 100755
Empty file.
Empty file modified src/app/platform/linux/deepin-boot-maker.desktop
100644 → 100755
Empty file.
Empty file modified src/app/platform/mac/Contents/Resources/mbr.bin
100644 → 100755
Empty file.
Empty file modified src/app/platform/mac/deepin-boot-maker.icns
100644 → 100755
Empty file.
Empty file modified src/app/platform/windows/deepin-boot-maker.ico
100644 → 100755
Empty file.
Empty file modified src/app/platform/windows/deepin-boot-maker.manifest
100644 → 100755
Empty file.
Empty file modified src/app/platform/windows/deepin-boot-maker.rc
100644 → 100755
Empty file.
Empty file modified src/app/vendor.pri
100644 → 100755
Empty file.
22 changes: 21 additions & 1 deletion src/app/view/deviceinfoitem.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ DeviceInfoItem::DeviceInfoItem(const QString &name, const QString &device,
s_removeDevice = WidgetUtil::getDpiPixmap(":/theme/light/image/drive.svg", this);
s_selectDevice = WidgetUtil::getDpiPixmap(":/theme/light/image/drive-select.svg", this);

this->setStyleSheet(WidgetUtil::getQss(":/theme/light/DeviceInfoItem.theme"));
// this->setStyleSheet(WidgetUtil::getQss(":/theme/light/DeviceInfoItem.theme"));

auto mainLayout = new QHBoxLayout(this);
mainLayout->setContentsMargins(12, 0, 12, 0);
Expand All @@ -49,20 +49,40 @@ DeviceInfoItem::DeviceInfoItem(const QString &name, const QString &device,
auto m_deviceLabel = new QLabel;
m_deviceLabel->setObjectName("DeviceInfoLabel");
m_deviceLabel->setText(name);
QFont qf = m_deviceLabel->font();
qf.setPointSize(14);
m_deviceLabel->setFont(qf);
QPalette pa;
pa.setColor(QPalette::Text, QColor("#000000"));
m_deviceLabel->setPalette(pa);

auto m_deviceDevName = new QLabel;
m_deviceDevName->setObjectName("DeviceInfoDevName");
m_deviceDevName->setText(QString("(%1)").arg(device));
qf = m_deviceDevName->font();
qf.setPointSize(10);
m_deviceDevName->setFont(qf);
m_deviceDevName->setAlignment(Qt::AlignCenter);
pa.setColor(QPalette::Text, QColor("#797979"));
m_deviceDevName->setPalette(pa);

auto m_deviceCapacity = new QLabel;
m_deviceCapacity->setObjectName("DeviceInfoCapacity");
m_deviceCapacity->setText(cap);
qf = m_deviceCapacity->font();
qf.setPointSize(10);
m_deviceCapacity->setFont(qf);
m_deviceCapacity->setAlignment(Qt::AlignCenter);
pa.setColor(QPalette::Text, QColor("#797979"));
m_deviceCapacity->setPalette(pa);

auto m_deviceCapacityBar = new QProgressBar;
m_deviceCapacityBar->setObjectName("DeviceInfoCapacityBar");
m_deviceCapacityBar->setTextVisible(false);
m_deviceCapacityBar->setFixedSize(60, 6);
m_deviceCapacityBar->setValue(percent);
m_deviceCapacityBar->setStyleSheet(".QProgressBar{background - color: rgba(0, 0, 0, 0.05);border: solid 1px rgba(0, 0, 0, 0.03);border - radius: 3px;}"
".QProgressBar::chunk{background - color:#2ca7f8;border - radius: 3px;}");

mainLayout->addWidget(m_deviceIcon, 0, Qt::AlignCenter);
mainLayout->addSpacing(14);
Expand Down
Empty file modified src/app/view/deviceinfoitem.h
100644 → 100755
Empty file.
Empty file modified src/app/view/devicelistwidget.cpp
100644 → 100755
Empty file.
Empty file modified src/app/view/devicelistwidget.h
100644 → 100755
Empty file.
Empty file modified src/app/view/dropframe.cpp
100644 → 100755
Empty file.
Empty file modified src/app/view/dropframe.h
100644 → 100755
Empty file.
47 changes: 45 additions & 2 deletions src/app/view/isoselectview.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
#include "suggestbutton.h"
#include "widgetutil.h"
#include "dropframe.h"
#include "bminterface.h"

#include <DUtil>
DWIDGET_USE_NAMESPACE

const QString s_linkTemplate = "<a href='%1' style='text-decoration: none; color: #0066ec;'>%2</a>";
const QString s_stateTemplate = "<a style='text-decoration: none; color: #d73119;'>%1</a>";

ISOSelectView::ISOSelectView(QWidget *parent) : QFrame(parent)
{
Expand All @@ -45,7 +47,10 @@ ISOSelectView::ISOSelectView(QWidget *parent) : QFrame(parent)

QLabel *m_title = new QLabel(tr("Select an ISO image file"));
m_title->setFixedHeight(38);
m_title->setStyleSheet("font-size: 26px;");
QFont qf = m_title->font();
qf.setPointSize(26);
m_title->setFont(qf);
// m_title->setStyleSheet("font-size: 26px;");

QLabel *isoIcon = new QLabel(this);
isoIcon->setObjectName("ISOIcon");
Expand All @@ -61,17 +66,33 @@ ISOSelectView::ISOSelectView(QWidget *parent) : QFrame(parent)
DropFrame *isoPanel = new DropFrame;
isoPanel->setObjectName("IosPanel");
isoPanel->setFixedSize(412, 322);
QPalette pa;
// pa.setColor(QPalette::Background, QColor(255, 255, 255, 13));
// isoPanel->setPalette(pa);

QVBoxLayout *isoPanelLayout = new QVBoxLayout(isoPanel);
isoPanelLayout->setMargin(0);

m_fileLabel = new QLabel(tr("Drag an ISO image file and drop it here"));
m_fileLabel->setObjectName("IsoFileName");
qf = m_fileLabel->font();
qf.setPointSize(12);
m_fileLabel->setFont(qf);
pa.setColor(QPalette::Text, QColor("#303030"));
m_fileLabel->setPalette(pa);
// m_fileLabel->setFixedHeight(18);

m_stateLabel = new QLabel();
m_stateLabel->hide();

m_hits = new QLabel(tr("OR"));
m_hits->setObjectName("IsoHits");
m_hits->setFixedHeight(18);
qf = m_hits->font();
qf.setPointSize(10);
m_hits->setFont(qf);
pa.setColor(QPalette::Text, QColor("#848484"));
m_hits->setPalette(pa);

QLabel *spliter = new QLabel;
spliter->setObjectName("IsoSpliter");
Expand All @@ -84,12 +105,19 @@ ISOSelectView::ISOSelectView(QWidget *parent) : QFrame(parent)
QString selectText = tr("Select an ISO image file");
QString linkText = QString(s_linkTemplate).arg(selectText).arg(selectText);
m_fileSelect->setText(linkText);
qf = m_fileSelect->font();
qf.setPointSize(12);
m_fileSelect->setFont(qf);
pa.setColor(QPalette::Text, QColor("#0066ec"));
m_fileSelect->setPalette(pa);

isoPanelLayout->addSpacing(62);
isoPanelLayout->addWidget(isoIcon, 0, Qt::AlignCenter);
isoPanelLayout->addSpacing(5);
isoPanelLayout->addWidget(m_fileLabel, 0, Qt::AlignCenter);
isoPanelLayout->addSpacing(4);
isoPanelLayout->addWidget(m_stateLabel, 0, Qt::AlignCenter);
isoPanelLayout->addSpacing(4);
isoPanelLayout->addWidget(m_hits, 0, Qt::AlignCenter);
isoPanelLayout->addSpacing(7);
isoPanelLayout->addWidget(spliter, 0, Qt::AlignCenter);
Expand All @@ -108,7 +136,10 @@ ISOSelectView::ISOSelectView(QWidget *parent) : QFrame(parent)
mainLayout->addStretch();
mainLayout->addWidget(m_nextSetp, 0, Qt::AlignCenter);

this->setStyleSheet(WidgetUtil::getQss(":/theme/light/ISOSelectView.theme"));
// this->setStyleSheet(WidgetUtil::getQss(":/theme/light/ISOSelectView.theme"));
this->setStyleSheet("#IosPanel{background-color: rgba(255, 255, 255, 5%);}"
"#IosPanel[active=true] {border-image: url(:/theme/light/image/dash.svg);}"
"#IsoSpliter{background-image: url(:/theme/light/image/dash_line.svg);}");

#ifdef Q_OS_WIN
m_fileLabel->hide();
Expand Down Expand Up @@ -155,15 +186,27 @@ ISOSelectView::ISOSelectView(QWidget *parent) : QFrame(parent)

void ISOSelectView::onFileSelected(const QString &file)
{
bool checkok = BMInterface::instance()->checkfile(file);
QFileInfo info(file);
m_fileLabel->setText(info.fileName());
m_fileLabel->show();
m_hits->setText("");
QString selectText = tr("Reselect an ISO image file");
QString stateText = "";
if (!checkok)
stateText = tr("Illegal ISO file");
QString linkText = QString(s_linkTemplate).arg(selectText).arg(selectText);
m_fileSelect->setText(linkText);
m_nextSetp->setDisabled(false);
m_stateLabel->hide();
if ("" != stateText) {
QString stateTemplateText = QString(s_stateTemplate).arg(stateText);
m_stateLabel->setText(stateTemplateText);
m_stateLabel->show();
m_nextSetp->setDisabled(true);
}
m_isoFilePath = file;
qDebug() << "onFileSelected file:" << file;
}

void ISOSelectView::onFileVerfiyFinished(bool ok)
Expand Down
1 change: 1 addition & 0 deletions src/app/view/isoselectview.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public slots:
private:
QLabel *m_hits = nullptr;
QLabel *m_fileLabel = nullptr;
QLabel *m_stateLabel = nullptr;
QLabel *m_fileSelect = nullptr;
SuggestButton *m_nextSetp = nullptr;
QString m_isoFilePath;
Expand Down
16 changes: 14 additions & 2 deletions src/app/view/progressview.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,24 @@ ProgressView::ProgressView(QWidget *parent) : QWidget(parent)

QLabel *m_title = new QLabel(tr("Making"));
m_title->setFixedHeight(38);
m_title->setStyleSheet("font-size: 26px;");
QFont ft = m_title->font();
ft.setPointSize(26);
m_title->setFont(ft);
// m_title->setStyleSheet("font-size: 26px;");

auto waterProgress = new Dtk::Widget::DWaterProgress;
waterProgress->setFixedSize(100, 100);

QLabel *m_hitsTitle = new QLabel(tr("Making the disk, please wait..."));
m_hitsTitle->setObjectName("ProgressHitsTitle");
QFont qf;
qf = m_hitsTitle->font();
qf.setPointSize(14);
m_hitsTitle->setFont(qf);
QPalette pa;
pa.setColor(QPalette::Text, QColor("#000000"));
m_hitsTitle->setPalette(pa);
m_hitsTitle->setAlignment(Qt::AlignCenter);

QLabel *m_hits = new QLabel(tr("Do not remove the disk or shut down the computer during the process"));
m_hits->setObjectName("ProgressHits");
Expand All @@ -74,7 +85,8 @@ ProgressView::ProgressView(QWidget *parent) : QWidget(parent)
waterProgress->setValue(0);
waterProgress->start();

this->setStyleSheet(WidgetUtil::getQss(":/theme/light/ProgressView.theme"));
// this->setStyleSheet(WidgetUtil::getQss(":/theme/light/ProgressView.theme"));
this->setStyleSheet("#ProgressHits{line-height: 1.67;}");

// connect(start, &SuggestButton::clicked, this, &ProgressView::testCancel);
start->hide();
Expand Down
Empty file modified src/app/view/progressview.h
100644 → 100755
Empty file.
Empty file modified src/app/view/resource/resource.qrc
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/app/view/resource/theme/light/DeviceInfoItem.theme
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
font-size: 14px;
font-weight: normal;
font-style: normal;
color: #000000;
color: #ff0000;
}

#DeviceInfoDevName{
Expand Down
Empty file modified src/app/view/resource/theme/light/DeviceListWidget.theme
100644 → 100755
Empty file.
Empty file modified src/app/view/resource/theme/light/ISOSelectView.theme
100644 → 100755
Empty file.
Empty file modified src/app/view/resource/theme/light/ProgressView.theme
100644 → 100755
Empty file.
Empty file modified src/app/view/resource/theme/light/ResultView.theme
100644 → 100755
Empty file.
Empty file modified src/app/view/resource/theme/light/SuggestButton.theme
100644 → 100755
Empty file.
Empty file modified src/app/view/resource/theme/light/UsbSelectView.theme
100644 → 100755
Empty file.
Empty file modified src/app/view/resource/theme/light/image/button_normal.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/app/view/resource/theme/light/image/dash.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/app/view/resource/theme/light/image/dash_line.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/app/view/resource/theme/light/image/deepin-boot-maker.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/app/view/resource/theme/light/image/drive-select.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/app/view/resource/theme/light/image/drive.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/app/view/resource/theme/light/image/fail.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/app/view/resource/theme/light/image/glow.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/app/view/resource/theme/light/image/media-optical-96px.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/app/view/resource/theme/light/image/success.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 20 additions & 2 deletions src/app/view/resultview.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ ResultView::ResultView(QWidget *parent) : QWidget(parent)

m_title = new QLabel(tr("Successful"));
m_title->setFixedHeight(38);
m_title->setStyleSheet("font-size: 26px;");
QFont ft = m_title->font();
ft.setPointSize(26);
m_title->setFont(ft);
// m_title->setStyleSheet("font-size: 26px;");

m_resultIcon = new QLabel();
m_resultIcon->setObjectName("ResultIcon");
Expand All @@ -61,6 +64,15 @@ ResultView::ResultView(QWidget *parent) : QWidget(parent)
m_hitsTitle->setObjectName("ResulteHitsTitle");
m_hitsTitle->setFixedWidth(340);

QFont qf;
qf = m_hitsTitle->font();
qf.setPointSize(14);
m_hitsTitle->setFont(qf);
QPalette pa;
pa.setColor(QPalette::Text, QColor("#000000"));
m_hitsTitle->setPalette(pa);
m_hitsTitle->setAlignment(Qt::AlignCenter);

// QString hitsFormat = "<a style='color:#b4b4b4; font-size:11px'>%1</a>";
// QString tagBegin = "<a href='#show_log'><span style='text-decoration: underline; color:#1B85ff;'>";
// QString tagEnd = "</span></a>";
Expand All @@ -73,6 +85,12 @@ ResultView::ResultView(QWidget *parent) : QWidget(parent)
// connect(m_logHits, &QLabel::linkActivated, this, &ResultView::onLogLinkActivated);
// m_logHits->setOpenExternalLinks(false);
m_logHits->hide();
qf = m_logHits->font();
qf.setPointSize(12);
m_logHits->setFont(qf);
pa.setColor(QPalette::Text, QColor("#424242"));
m_logHits->setPalette(pa);
m_logHits->setAlignment(Qt::AlignCenter);

m_rebootLater = new SuggestButton();
m_rebootLater->setObjectName("RebootLater");
Expand All @@ -98,7 +116,7 @@ ResultView::ResultView(QWidget *parent) : QWidget(parent)
// m_rebootNow->hide();
// mainLayout->addWidget(m_rebootNow, 0, Qt::AlignCenter);

this->setStyleSheet(WidgetUtil::getQss(":/theme/light/ResultView.theme"));
// this->setStyleSheet(WidgetUtil::getQss(":/theme/light/ResultView.theme"));

connect(m_rebootNow, &SuggestButton::clicked,
this, [ = ]() {
Expand Down
Empty file modified src/app/view/resultview.h
100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion src/app/view/suggestbutton.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

#include "widgetutil.h"

SuggestButton::SuggestButton(QWidget *parent) : DBaseButton(parent)
SuggestButton::SuggestButton(DWidget *parent) :
DPushButton(parent)
{
this->setStyleSheet(WidgetUtil::getQss(":/theme/light/SuggestButton.theme"));
this->setFixedSize(QPixmap(":/theme/light/image/suggest_button_hover.svg").size());
Expand Down
12 changes: 9 additions & 3 deletions src/app/view/suggestbutton.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@

#pragma once

#include <dbasebutton.h>
//#include <dbasebutton.h>
#include <DWidget>
#include <DPushButton>
#include <DGuiApplicationHelper>

class SuggestButton : public DTK_WIDGET_NAMESPACE::DBaseButton
DWIDGET_USE_NAMESPACE
DGUI_USE_NAMESPACE

class SuggestButton : public DPushButton
{
Q_OBJECT
public:
explicit SuggestButton(QWidget *parent = 0);
explicit SuggestButton(DWidget *parent = 0);
};

5 changes: 4 additions & 1 deletion src/app/view/usbselectview.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ UsbSelectView::UsbSelectView(QWidget *parent) : QFrame(parent)

QLabel *m_title = new QLabel(tr("Select a disk"));
m_title->setFixedHeight(38);
m_title->setStyleSheet("font-size: 26px;");
QFont ft = m_title->font();
ft.setPointSize(26);
m_title->setFont(ft);
// m_title->setStyleSheet("font-size: 26px;");

QFrame *usbDeviceListPanel = new QFrame;
usbDeviceListPanel->setObjectName("UsbDeviceListPanel");
Expand Down
Empty file modified src/app/view/usbselectview.h
100644 → 100755
Empty file.
Empty file modified src/app/view/widgetutil.cpp
100644 → 100755
Empty file.
Empty file modified src/app/view/widgetutil.h
100644 → 100755
Empty file.
Empty file modified src/app/windows.qrc
100644 → 100755
Empty file.
Loading

0 comments on commit 042fe93

Please sign in to comment.