From c84b88a422c9bbdee42cc271cade8ea299f2b15e Mon Sep 17 00:00:00 2001 From: lennlouis Date: Tue, 25 Mar 2025 02:44:59 +0800 Subject: [PATCH] 1.0 finish --- core_form/frmsetting/frmsetting.cpp | 45 ++- core_form/frmsetting/frmsetting.h | 6 +- core_form/frmsetting/frmsetting.ui | 39 +-- core_form/frmupload/frmupload.cpp | 152 +++++++++- core_form/frmupload/frmupload.h | 29 +- core_form/frmupload/frmupload.ui | 39 ++- core_form/serversetting/serversetting.cpp | 43 ++- core_form/serversetting/serversetting.h | 14 + core_form/serversetting/serversetting.ui | 100 +++++-- .../fileconfigdecode/fileconfigdecode.cpp | 100 ++++++- .../fileconfigdecode/fileconfigdecode.h | 32 +- core_support/tchttpservice/tchttpservice.cpp | 28 +- core_support/tchttpservice/tchttpservice.h | 2 - main.cpp | 5 +- picpanel.pro | 2 +- picpanel.pro.user | 277 +++++++++++++++++- picpanel.pro.user.631b589 | 271 +++++++++++++++++ qrc/image/info_blue.png | Bin 580 -> 608 bytes qrc/image/info_blue_bak.png | Bin 0 -> 580 bytes qrc/image/info_grey.png | Bin 643 -> 571 bytes qrc/image/info_grey_bak.png | Bin 0 -> 643 bytes qrc/qss/blacksoft.qss | 61 +++- widget.cpp | 8 +- 23 files changed, 1126 insertions(+), 127 deletions(-) create mode 100644 picpanel.pro.user.631b589 create mode 100644 qrc/image/info_blue_bak.png create mode 100644 qrc/image/info_grey_bak.png diff --git a/core_form/frmsetting/frmsetting.cpp b/core_form/frmsetting/frmsetting.cpp index 0316f5e..a397894 100644 --- a/core_form/frmsetting/frmsetting.cpp +++ b/core_form/frmsetting/frmsetting.cpp @@ -2,12 +2,11 @@ #include "ui_frmsetting.h" #include -FrmSetting::FrmSetting(FileConfigDecode* fileConfig, QWidget *parent) +FrmSetting::FrmSetting(QWidget *parent) : QWidget(parent) , ui(new Ui::FrmSetting) { ui->setupUi(this); - this->fileConfig = fileConfig; initForm(); initWidget(); } @@ -43,13 +42,21 @@ void FrmSetting::initForm() serversetting = new ServerSetting(); + connect(serversetting, &ServerSetting::signal_updateServerConfig, this, &FrmSetting::slot_updateServerConfig); serversetting->hide(); + QString address = FileConfigDecode::getInstance()->getAddress(); + QString username = FileConfigDecode::getInstance()->getUserName(); + QString password = FileConfigDecode::getInstance()->getPassword(); + + serversetting->setAddress(address); + serversetting->setPassword(password); + serversetting->setUserName(username); } void FrmSetting::initWidget() { - if (fileConfig->getRename()) { + if (FileConfigDecode::getInstance()->getRename()) { ui->labRenameOpen->setStyleSheet(OPENQSS); ui->labRenameClose->setStyleSheet(CLOSEQSS); } @@ -57,7 +64,7 @@ void FrmSetting::initWidget() ui->labRenameOpen->setStyleSheet(CLOSEQSS); ui->labRenameClose->setStyleSheet(OPENQSS); } - if (fileConfig->getAutoSetup()) { + if (FileConfigDecode::getInstance()->getAutoSetup()) { ui->labAutoSetupOpen->setStyleSheet(OPENQSS); ui->labAutoSetupClose->setStyleSheet(CLOSEQSS); } @@ -65,7 +72,7 @@ void FrmSetting::initWidget() ui->labAutoSetupOpen->setStyleSheet(CLOSEQSS); ui->labAutoSetupClose->setStyleSheet(OPENQSS); } - if (fileConfig->getTimeRename()) { + if (FileConfigDecode::getInstance()->getTimeRename()) { ui->labTimeRenameOpen->setStyleSheet(OPENQSS); ui->labTimeRenameClose->setStyleSheet(CLOSEQSS); } @@ -73,7 +80,7 @@ void FrmSetting::initWidget() ui->labTimeRenameOpen->setStyleSheet(CLOSEQSS); ui->labTimeRenameClose->setStyleSheet(OPENQSS); } - if (fileConfig->getAutoCopy()) { + if (FileConfigDecode::getInstance()->getAutoCopy()) { ui->labEnableSsl->setStyleSheet(OPENQSS); ui->labEnableSsl->setStyleSheet(CLOSEQSS); } @@ -82,10 +89,10 @@ void FrmSetting::initWidget() ui->labEnableSsl->setStyleSheet(OPENQSS); } - ui->schRename->setChecked(fileConfig->getRename()); - ui->schAutoSetup->setChecked(fileConfig->getAutoSetup()); - ui->schTimeRename->setChecked(fileConfig->getTimeRename()); - ui->schEnableSsl->setChecked(fileConfig->getAutoCopy()); + ui->schRename->setChecked(FileConfigDecode::getInstance()->getRename()); + ui->schAutoSetup->setChecked(FileConfigDecode::getInstance()->getAutoSetup()); + ui->schTimeRename->setChecked(FileConfigDecode::getInstance()->getTimeRename()); + ui->schEnableSsl->setChecked(FileConfigDecode::getInstance()->getAutoCopy()); connect(ui->schRename, &SwitchButton::checkedChanged, this, &FrmSetting::schRenameSlot); connect(ui->schAutoSetup, &SwitchButton::checkedChanged, this, &FrmSetting::schAutoSetup); @@ -97,28 +104,31 @@ void FrmSetting::initWidget() void FrmSetting::schRenameSlot(bool checked) { - fileConfig->setRename(checked); + FileConfigDecode::getInstance()->setRename(checked); ui->labRenameOpen->setStyleSheet(checked?OPENQSS:CLOSEQSS); ui->labRenameClose->setStyleSheet(checked?CLOSEQSS:OPENQSS); } void FrmSetting::schAutoSetup(bool checked) { - fileConfig->setAutoSetup(checked); + FileConfigDecode::getInstance()->setAutoSetup(checked); ui->labAutoSetupOpen->setStyleSheet(checked?OPENQSS:CLOSEQSS); ui->labAutoSetupClose->setStyleSheet(checked?CLOSEQSS:OPENQSS); } void FrmSetting::schTimeRename(bool checked) { - fileConfig->setTimeRename(checked); + if (ui->schRename->getChecked()) + FileConfigDecode::getInstance()->setTimeRename(checked, 1); + else + FileConfigDecode::getInstance()->setTimeRename(checked, 0); ui->labTimeRenameOpen->setStyleSheet(checked?OPENQSS:CLOSEQSS); ui->labTimeRenameClose->setStyleSheet(checked?CLOSEQSS:OPENQSS); } void FrmSetting::schEnableSsl(bool checked) { - fileConfig->setAutoCopy(checked); + FileConfigDecode::getInstance()->setAutoCopy(checked); ui->labEnableSslOpen->setStyleSheet(checked?OPENQSS:CLOSEQSS); ui->labEnableSslClose->setStyleSheet(checked?CLOSEQSS:OPENQSS); @@ -126,5 +136,12 @@ void FrmSetting::schEnableSsl(bool checked) } +void FrmSetting::slot_updateServerConfig(QString address, QString username, QString password) +{ + FileConfigDecode::getInstance()->setAddress(address); + FileConfigDecode::getInstance()->setUserName(username); + FileConfigDecode::getInstance()->setPassword(password); +} + diff --git a/core_form/frmsetting/frmsetting.h b/core_form/frmsetting/frmsetting.h index 2ed8f8e..9ac0809 100644 --- a/core_form/frmsetting/frmsetting.h +++ b/core_form/frmsetting/frmsetting.h @@ -24,7 +24,7 @@ class FrmSetting : public QWidget Q_OBJECT public: - explicit FrmSetting(FileConfigDecode* fileConfig, QWidget *parent = nullptr); + explicit FrmSetting(QWidget *parent = nullptr); ~FrmSetting(); private: @@ -38,9 +38,11 @@ private slots: void schTimeRename(bool checked); void schEnableSsl(bool checked); + void slot_updateServerConfig(QString address, QString username, QString password); + private: Ui::FrmSetting *ui; - FileConfigDecode* fileConfig = nullptr; + // FileConfigDecode* fileConfig = nullptr; ServerSetting* serversetting; }; diff --git a/core_form/frmsetting/frmsetting.ui b/core_form/frmsetting/frmsetting.ui index 64db6c0..cd360d6 100644 --- a/core_form/frmsetting/frmsetting.ui +++ b/core_form/frmsetting/frmsetting.ui @@ -26,7 +26,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -47,7 +47,7 @@ 100 - 35 + 25 @@ -66,7 +66,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -82,7 +82,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -115,8 +115,8 @@ - 200 - 30 + 100 + 25 @@ -139,7 +139,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -155,7 +155,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -188,8 +188,8 @@ - 200 - 30 + 100 + 25 @@ -212,7 +212,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -228,7 +228,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -261,8 +261,8 @@ - 200 - 30 + 100 + 25 @@ -285,7 +285,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -293,6 +293,9 @@ + + color: rgb(255, 255, 255); + 开启SSL @@ -301,7 +304,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -334,8 +337,8 @@ - 200 - 30 + 100 + 25 diff --git a/core_form/frmupload/frmupload.cpp b/core_form/frmupload/frmupload.cpp index 9f33d6c..c2d3ae8 100644 --- a/core_form/frmupload/frmupload.cpp +++ b/core_form/frmupload/frmupload.cpp @@ -2,6 +2,7 @@ #include "ui_frmupload.h" #include #include +#include FrmUpload::FrmUpload(QWidget *parent) : QWidget(parent) @@ -11,6 +12,29 @@ FrmUpload::FrmUpload(QWidget *parent) initFrom(); initWidget(); connect(TCHttpService::getInstance(), &TCHttpService::signal_uploadFileSec, this, &FrmUpload::slot_uploadFileSec); + + QButtonGroup *buttonGroup = new QButtonGroup(this); + buttonGroup->setExclusive(true); // 确保每次只有一个按钮被选中 + + // 添加按钮到组中 + buttonGroup->addButton(ui->btnHTML); + buttonGroup->addButton(ui->btnMarkdown); + buttonGroup->addButton(ui->btnUBB); + buttonGroup->addButton(ui->btnUrl); + + // 设置样式表 + QString buttonStyle = R"( + QPushButton { + color: black; + } + QPushButton:checked { + color: #409EFF + } +)"; + ui->btnHTML->setStyleSheet(buttonStyle); + ui->btnMarkdown->setStyleSheet(buttonStyle); + ui->btnUBB->setStyleSheet(buttonStyle); + ui->btnUrl->setStyleSheet(buttonStyle); } FrmUpload::~FrmUpload() @@ -20,14 +44,26 @@ FrmUpload::~FrmUpload() void FrmUpload::slot_uploadFileSec(QString url) { + qDebug() << "slot_uploadFileSec:" << url; QClipboard* clipboard = QApplication::clipboard(); - if (copyState == 0) { + + if (copyType == COPY_TYPE_MARKDOWN) { clipboard->setText(QString("![](%1)").arg(url)); } - else { + if (copyType == COPY_TYPE_URL) { clipboard->setText(url); } + if (copyType == COPY_TYPE_UBB) { + // [IMG]https://imagehyj.oss-cn-hangzhou.aliyuncs.com/blog/logo512.png[/IMG] + clipboard->setText(QString("[IMG]%1[/IMG]").arg(url)); + } + if (copyType == COPY_TYPE_HTML) { + clipboard->setText(QString("").arg(url)); + + // QThread::sleep(50); + } + } bool FrmUpload::eventFilter(QObject *watched, QEvent *event) @@ -106,12 +142,19 @@ void FrmUpload::initFrom() ui->btnMarkdown->setText("Markdown"); ui->btnUrl->setText("URL"); ui->btnUBB->setText("UBB"); + + ui->btnMarkdown->setChecked(true); + ui->btnHTML->setChecked(false); + ui->btnUBB->setChecked(false); + ui->btnUrl->setChecked(false); } void FrmUpload::initWidget() { ui->frmUpload->installEventFilter(this); this->setAcceptDrops(true); + setWindowFlags(Qt::FramelessWindowHint); // 移除系统边框 + setAttribute(Qt::WA_TranslucentBackground); // 启用透明背景 // ui->frmUpload->setAcceptDrops(true); } @@ -127,3 +170,108 @@ void FrmUpload::uploadFiles(QStringList fileList) // TCHttpService::getInstance()->apiMyfileNormal(); } + +void FrmUpload::on_btnFastUpload_clicked() +{ + // QString addDataPath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation); + // QString cacheDirPath = addDataPath + "/cache/"; + QDir cacheDir(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)); + if (!cacheDir.exists()) { + cacheDir.mkpath("."); + } + QClipboard* clipboard = QApplication::clipboard(); + const QMimeData* mimeData = clipboard->mimeData(); + + if (mimeData->hasImage()) { + QImage image = clipboard->image(); + if (!image.isNull()) { + RenameType renametype = FileConfigDecode::getInstance()->getRenameType(); + qDebug() << "renameType:" << renametype; + if (renametype == RENAME_TYPE_NORMAL) { + bool ok; + QString timestamp = QDateTime::currentDateTime().toString("yyyyMMdd_hhmmsszzz"); + QString text = QInputDialog::getText(this, "重命名图片", "输入文件名", QLineEdit::Normal, timestamp, &ok); + if (ok && !text.isEmpty()) { + QString filePath = cacheDir.filePath(text + ".png"); + + if (image.save(filePath, "PNG")) { + TCHttpService::getInstance()->apiUpload(filePath); + } + } + } + + if (renametype == RENAME_TYPE_TIME) { + qDebug() << "time rename"; + QString timestamp = QDateTime::currentDateTime().toString("yyyyMMdd_hhmmsszzz"); + QString filePath = cacheDir.filePath(timestamp + ".png"); + + if (image.save(filePath, "PNG")) { + TCHttpService::getInstance()->apiUpload(filePath); + } + } + else { + QString timestamp = QDateTime::currentDateTime().toString("yyyyMMdd_hhmmsszzz"); + QString filePath = cacheDir.filePath("clipboard_" + timestamp + ".png"); + + if (image.save(filePath, "PNG")) { + TCHttpService::getInstance()->apiUpload(filePath); + } + } + + } + clipboard->clear(); + } +} + + +void FrmUpload::on_btnMarkdown_clicked() +{ + if (!ui->btnMarkdown->isChecked()) + return; + copyType = COPY_TYPE_MARKDOWN; + ui->btnMarkdown->setChecked(true); + ui->btnUrl->setChecked(false); + ui->btnHTML->setChecked(false); + ui->btnUBB->setChecked(false); + qDebug() << copyType; +} + + +void FrmUpload::on_btnUrl_clicked() +{ + if (!ui->btnUrl->isChecked()) + return; + copyType = COPY_TYPE_URL; + ui->btnMarkdown->setChecked(false); + ui->btnUrl->setChecked(true); + ui->btnHTML->setChecked(false); + ui->btnUBB->setChecked(false); + qDebug() << copyType; +} + + +void FrmUpload::on_btnHTML_clicked() +{ + if (!ui->btnHTML->isChecked()) + return; + copyType = COPY_TYPE_HTML; + ui->btnMarkdown->setChecked(false); + ui->btnUrl->setChecked(false); + ui->btnHTML->setChecked(true); + ui->btnUBB->setChecked(false); + qDebug() << copyType; +} + + +void FrmUpload::on_btnUBB_clicked() +{ + if (!ui->btnUBB->isChecked()) + return; + copyType = COPY_TYPE_UBB; + ui->btnMarkdown->setChecked(false); + ui->btnUrl->setChecked(false); + ui->btnHTML->setChecked(false); + ui->btnUBB->setChecked(true); + qDebug() << copyType; +} + diff --git a/core_form/frmupload/frmupload.h b/core_form/frmupload/frmupload.h index c283e7e..258720c 100644 --- a/core_form/frmupload/frmupload.h +++ b/core_form/frmupload/frmupload.h @@ -12,10 +12,26 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include "fileconfigdecode.h" #include "tchttpservice.h" #define DEBUG 1 +typedef enum{ + COPY_TYPE_MARKDOWN = 0, + COPY_TYPE_URL, + COPY_TYPE_UBB, + COPY_TYPE_HTML +} CopyType; + namespace Ui { class FrmUpload; } @@ -36,12 +52,23 @@ protected: virtual void dragEnterEvent(QDragEnterEvent *event) override; virtual void dropEvent(QDropEvent *event) override; +private slots: + void on_btnFastUpload_clicked(); + + void on_btnMarkdown_clicked(); + + void on_btnUrl_clicked(); + + void on_btnHTML_clicked(); + + void on_btnUBB_clicked(); + private: void initFrom(); void initWidget(); void uploadFiles(QStringList fileList); // 0 md 1 url - int copyState = 0; + CopyType copyType = COPY_TYPE_MARKDOWN; private: Ui::FrmUpload *ui; diff --git a/core_form/frmupload/frmupload.ui b/core_form/frmupload/frmupload.ui index 7c24e30..ded2ac7 100644 --- a/core_form/frmupload/frmupload.ui +++ b/core_form/frmupload/frmupload.ui @@ -17,7 +17,7 @@ - LennDFS 快捷助手 + LennDFS PicPanel Qt::AlignmentFlag::AlignCenter @@ -208,12 +208,18 @@ 100 - 20 + 25 + + PointingHandCursor + PushButton + + true + @@ -227,12 +233,18 @@ 75 - 20 + 25 + + PointingHandCursor + PushButton + + true + @@ -246,12 +258,18 @@ 75 - 20 + 25 + + PointingHandCursor + PushButton + + true + @@ -265,12 +283,18 @@ 100 - 20 + 25 + + PointingHandCursor + PushButton + + true + @@ -313,9 +337,12 @@ 100 - 20 + 25 + + PointingHandCursor + PushButton diff --git a/core_form/serversetting/serversetting.cpp b/core_form/serversetting/serversetting.cpp index 129a75f..5119ef3 100644 --- a/core_form/serversetting/serversetting.cpp +++ b/core_form/serversetting/serversetting.cpp @@ -15,10 +15,27 @@ ServerSetting::~ServerSetting() delete ui; } +void ServerSetting::setAddress(QString address) +{ + ui->ledAddress->setText(address); +} + +void ServerSetting::setUserName(QString username) +{ + ui->ledPort->setText(username); +} + +void ServerSetting::setPassword(QString password) +{ + ui->ledPwd->setText(password); +} + void ServerSetting::initForm() { + this->setWindowFlag(Qt::FramelessWindowHint); - this->setWindowFlags(this->windowFlags() | Qt::WindowSystemMenuHint | Qt::WindowMaximizeButtonHint); + this->setWindowFlags(this->windowFlags() | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint); + setAttribute(Qt::WA_TranslucentBackground); ui->ledAddress->setPlaceholderText("example.com/ip:port"); ui->ledPort->setPlaceholderText("admin"); } @@ -32,6 +49,8 @@ void ServerSetting::initWidget() emit okClicked(ui->ledAddress->text(), ui->ledPort->text().toInt()); this->hide(); }); + + this->setWindowModality(Qt::ApplicationModal); } void ServerSetting::on_btnOk_clicked() @@ -44,5 +63,27 @@ void ServerSetting::on_btnOk_clicked() QString userName = ui->ledPort->text(); QString password = ui->ledPwd->text(); + emit signal_updateServerConfig(address, userName, password); + TCHttpService::getInstance()->setConfiguration(userName, password, address); } + +void ServerSetting::paintEvent(__attribute__((unused))QPaintEvent *event) +{ +// QStyleOption opt; +// #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) +// opt.init(this); +// #else +// opt.initFrom(this); +// #endif +// QPainter painter(this); +// style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this); + + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); // 抗锯齿 + + // 绘制圆角背景 + QPainterPath path; + path.addRoundedRect(rect(), 15, 15); // 30px 圆角半径 + painter.fillPath(path, Qt::white); // 填充白色 +} diff --git a/core_form/serversetting/serversetting.h b/core_form/serversetting/serversetting.h index e7223e6..2b661d2 100644 --- a/core_form/serversetting/serversetting.h +++ b/core_form/serversetting/serversetting.h @@ -2,6 +2,11 @@ #define SERVERSETTING_H #include +#include +#include +#include +#include +#include #include "tchttpservice.h" namespace Ui { @@ -16,15 +21,24 @@ public: explicit ServerSetting(QWidget *parent = nullptr); ~ServerSetting(); + void setAddress(QString address); + void setUserName(QString username); + void setPassword(QString password); + signals: void okClicked(QString addr, quint16 port); + void signal_updateServerConfig(QString address, QString username, QString password); + private slots: void on_btnOk_clicked(); private: Ui::ServerSetting *ui; +protected: + virtual void paintEvent(QPaintEvent* event); + private: void initForm(); void initWidget(); diff --git a/core_form/serversetting/serversetting.ui b/core_form/serversetting/serversetting.ui index 3354b1b..2beec36 100644 --- a/core_form/serversetting/serversetting.ui +++ b/core_form/serversetting/serversetting.ui @@ -7,12 +7,15 @@ 0 0 281 - 188 + 121 Form + + + @@ -44,16 +47,23 @@ - + + + Qt::InputMethodHint::ImhHiddenText|Qt::InputMethodHint::ImhNoAutoUppercase|Qt::InputMethodHint::ImhNoPredictiveText|Qt::InputMethodHint::ImhSensitiveData + + + QLineEdit::EchoMode::Password + + - + - Qt::Horizontal + Qt::Orientation::Horizontal @@ -64,33 +74,61 @@ - - - - 0 - 0 - - - - 取消 - - - - - - - - 0 - 0 - - - - - - - 确定 - - + + + + + + 0 + 0 + + + + + 50 + 35 + + + + + 100 + 50 + + + + 取消 + + + + + + + + 0 + 0 + + + + + 50 + 35 + + + + + 100 + 50 + + + + + + + 确定 + + + + diff --git a/core_support/fileconfigdecode/fileconfigdecode.cpp b/core_support/fileconfigdecode/fileconfigdecode.cpp index cc065dc..3650c91 100644 --- a/core_support/fileconfigdecode/fileconfigdecode.cpp +++ b/core_support/fileconfigdecode/fileconfigdecode.cpp @@ -1,15 +1,30 @@ #include "fileconfigdecode.h" #include +QScopedPointer FileConfigDecode::m_instance; + FileConfigDecode::FileConfigDecode() { + // if (m_instance.isNull()) { + // m_instance.reset(new FileConfigDecode); + + // } initFile(); - qDebug() << "read:" << autoSetup << rename << timeRename << autoCopy; +} + +FileConfigDecode *FileConfigDecode::getInstance() +{ + if (m_instance.isNull()) { + m_instance.reset(new FileConfigDecode); + + } + + return m_instance.data(); } FileConfigDecode::~FileConfigDecode() { - updateFile(); + // updateFile(); // qDebug() << "write:" << autoSetup << rename << timeRename << autoCopy; } @@ -43,6 +58,21 @@ bool FileConfigDecode::getAutoCopy() return autoCopy; } +QString FileConfigDecode::getUserName() +{ + return userName; +} + +QString FileConfigDecode::getPassword() +{ + return password; +} + +RenameType FileConfigDecode::getRenameType() +{ + return renameType; +} + void FileConfigDecode::setAddress(QString value) { this->address = value; @@ -58,28 +88,64 @@ void FileConfigDecode::setPort(quint16 value) void FileConfigDecode::setAutoSetup(bool value) { this->autoSetup = value; + updateFile(); // updateFile(); } void FileConfigDecode::setRename(bool value) { this->rename = value; + if (value == true) { + renameType = (renameType == RENAME_TYPE_TIME) ? RENAME_TYPE_TIME : RENAME_TYPE_NORMAL; + } + else { + renameType = (renameType == RENAME_TYPE_TIME) ? RENAME_TYPE_TIME : RENAME_TYPE_NORMAL; + } + qDebug() << renameType; + updateFile(); // updateFile(); } -void FileConfigDecode::setTimeRename(bool value) +void FileConfigDecode::setTimeRename(bool value, int flag) { this->timeRename = value; + if (value) { + renameType = RENAME_TYPE_TIME; + } + + if (!value && flag == 1) { + renameType = RENAME_TYPE_NORMAL; + } + + if (!value && flag == 0) { + renameType = RENAME_TYPE_NONE; + } + qDebug() << renameType; + updateFile(); // updateFile(); } void FileConfigDecode::setAutoCopy(bool value) { this->autoCopy = value; + updateFile(); // updateFile(); } -void FileConfigDecode::fileWrite(QString path, QString address, quint16 port, bool autosetup, bool rename, bool timerename, bool autocopy) +void FileConfigDecode::setUserName(QString username) +{ + this->userName = username; + updateFile(); +} + +void FileConfigDecode::setPassword(QString password) +{ + this->password = password; + updateFile(); +} + +void FileConfigDecode::fileWrite(QString path, QString address, bool autosetup, + bool rename, bool timerename, bool autocopy, QString username, QString password) { #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) QSettings* config = new QSettings(path, QSettings::IniFormat); @@ -105,6 +171,8 @@ void FileConfigDecode::fileWrite(QString path, QString address, quint16 port, bo config->setValue("rename", rename); config->setValue("timerename", timerename); config->setValue("autocopy", autocopy); + config->setValue("username", username); + config->setValue("password", password); config->endGroup(); delete config; #endif @@ -113,7 +181,7 @@ void FileConfigDecode::fileWrite(QString path, QString address, quint16 port, bo void FileConfigDecode::initFile() { QString addDataPath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation); - QString addFilePath = addDataPath + "config.ini"; + QString addFilePath = addDataPath + "/config.ini"; qDebug() << addFilePath; QFile file(addFilePath); if (file.exists()) { @@ -126,6 +194,8 @@ void FileConfigDecode::initFile() this->rename = config->value(section + "rename").toBool(); this->timeRename = config->value(section + "timerename").toBool(); this->autoCopy = config->value(section + "autocopy").toBool(); + this->userName = config->value(section+"username").toString(); + this->password = config->value(section+"password").toString(); checkConfig(); @@ -134,30 +204,38 @@ void FileConfigDecode::initFile() else { this->firstCreate = true; - this->address = "127.0.0.1"; - this->port = 0; + this->address = "127.0.0.1:8080"; this->autoSetup = false; this->rename = false; this->timeRename = false; this->autoCopy = false; + this->userName = "admin"; + this->password = "admin"; - fileWrite(addFilePath, address, port, autoSetup, rename, timeRename, autoCopy); + fileWrite(addFilePath, address, autoSetup, rename, timeRename, autoCopy, userName, password); } } void FileConfigDecode::checkConfig() { if (address.isEmpty()) { - address = "127.0.0.1"; + address = "127.0.0.1:8080"; } + + if (rename) + renameType = RENAME_TYPE_NORMAL; + + if (timeRename) + renameType = RENAME_TYPE_TIME; + qDebug() << renameType; } void FileConfigDecode::updateFile() { QString addDataPath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation); - QString addFilePath = addDataPath + "config.ini"; + QString addFilePath = addDataPath + "/config.ini"; qDebug() << "write" << autoSetup << rename << timeRename << autoCopy; - fileWrite(addFilePath, address, port, autoSetup, rename, timeRename, autoCopy); + fileWrite(addFilePath, address, autoSetup, rename, timeRename, autoCopy, userName, password); } diff --git a/core_support/fileconfigdecode/fileconfigdecode.h b/core_support/fileconfigdecode/fileconfigdecode.h index 5a8694f..05accd7 100644 --- a/core_support/fileconfigdecode/fileconfigdecode.h +++ b/core_support/fileconfigdecode/fileconfigdecode.h @@ -6,14 +6,21 @@ #include #include #include +#include #if (QT_VERSION <= QT_VERSION_CHECK(6, 0, 0)) #include #endif +typedef enum { + RENAME_TYPE_NONE = 0, + RENAME_TYPE_NORMAL, + RENAME_TYPE_TIME +} RenameType; + class FileConfigDecode { public: - FileConfigDecode(); + static FileConfigDecode* getInstance(); ~FileConfigDecode(); QString getAddress(); @@ -22,13 +29,21 @@ public: bool getRename(); bool getTimeRename(); bool getAutoCopy(); + QString getUserName(); + QString getPassword(); + RenameType getRenameType(); void setAddress(QString value); void setPort(quint16 value); void setAutoSetup(bool value); void setRename(bool value); - void setTimeRename(bool value); + void setTimeRename(bool value, int flag); void setAutoCopy(bool value); + void setUserName(QString username); + void setPassword(QString password); + + void initFile(); + void updateFile(); private: QString address; @@ -37,15 +52,22 @@ private: bool rename; bool timeRename; bool autoCopy; + QString userName; + QString password; bool firstCreate; - void fileWrite(QString path, QString address, quint16 port, bool autosetup, bool rename, bool timerename, bool autocopy); + RenameType renameType = RENAME_TYPE_NONE; + + void fileWrite(QString path, QString address, bool autosetup, bool rename, bool timerename, bool autocopy, QString username, QString password); + + static QScopedPointer m_instance; private: - void initFile(); + FileConfigDecode(); + void checkConfig(); - void updateFile(); + // void initForm(); }; diff --git a/core_support/tchttpservice/tchttpservice.cpp b/core_support/tchttpservice/tchttpservice.cpp index d78199e..d3618da 100644 --- a/core_support/tchttpservice/tchttpservice.cpp +++ b/core_support/tchttpservice/tchttpservice.cpp @@ -284,7 +284,7 @@ void TCHttpService::setConfiguration(QString userName, QString firstPwd, QString if (code == 0) { this->m_token = jsonObj["token"].toString(); qDebug() << this->m_token; - this->m_isOnline = true; + apiMyfileCount(); } @@ -300,15 +300,18 @@ void TCHttpService::setConfiguration(QString userName, QString firstPwd, QString int total = jsonObj["total"].toInt(); this->m_total = total; int n = total / 10 + 1; + int pendingRequests = n; for (int i = 0; i < n; i++) { - //0 10 20 int count = (total - i * 10 >= 10) ? 10 : (total - i * 10); apiMyfileNormal(i*10, count); } + } } if (api == "myfilenormal") { + static int loginCnt = 0; + QJsonDocument jsonDoc = QJsonDocument::fromJson(rawData); if (jsonDoc.isEmpty()) return; @@ -328,15 +331,23 @@ void TCHttpService::setConfiguration(QString userName, QString firstPwd, QString QString md5 = jsonObj["md5"].toString(); QMap::iterator ite; - ite = m_fileMap.find(file_name); + ite = m_fileMap.find(md5); if (ite == m_fileMap.end()) { + qDebug() << file_name; file_info_t info; info.share_status = share_status; info.size = size; info.url = url; info.file_name = file_name; - emit signal_uploadFileSec(url); + if (m_isOnline) { + qDebug() << "now upload"; + emit signal_uploadFileSec(url); + + } m_fileMap.insert(md5, info); + // if (m_fileMap.size() == m_total && m_isOnline == false) + + } #if !DEBUG // for(auto ite = m_fileMap.constBegin(); ite != m_fileMap.constEnd(); ite++) { @@ -345,7 +356,14 @@ void TCHttpService::setConfiguration(QString userName, QString firstPwd, QString qDebug() << "fileMap size:" << m_fileMap.size(); #endif } - + if (!m_isOnline) { + loginCnt++; + qDebug() << "loginCnt:" << loginCnt; + if (loginCnt == m_total/10+1) { + m_isOnline = true; + qDebug() << "login success"; + } + } } // if (api == "upload") { diff --git a/core_support/tchttpservice/tchttpservice.h b/core_support/tchttpservice/tchttpservice.h index 0e66f0f..b3e3e36 100644 --- a/core_support/tchttpservice/tchttpservice.h +++ b/core_support/tchttpservice/tchttpservice.h @@ -72,8 +72,6 @@ private: bool m_uploadNum = 0; -signals: - }; #endif // TCHTTPSERVICE_H diff --git a/main.cpp b/main.cpp index c5ee9ea..1b7e802 100644 --- a/main.cpp +++ b/main.cpp @@ -1,12 +1,15 @@ #include "widget.h" #include +#include +#include #include int main(int argc, char *argv[]) { - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + // QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication a(argc, argv); + a.setFont(QFont("Microsoft YaHei UI")); Widget w; w.setWindowIcon(QIcon(QPixmap(":/qrc/image/icon.png"))); diff --git a/picpanel.pro b/picpanel.pro index efa5d07..f8e5437 100644 --- a/picpanel.pro +++ b/picpanel.pro @@ -2,7 +2,7 @@ QT += core gui network greaterThan(QT_MAJOR_VERSION, 4): QT += widgets -CONFIG += c++17 console +CONFIG += c++17 # You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. diff --git a/picpanel.pro.user b/picpanel.pro.user index c75f21e..328a1f8 100644 --- a/picpanel.pro.user +++ b/picpanel.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {631b5895-04c2-4f08-83d2-9e1277f189a1} + {4f2ec396-c2e0-4f3d-a369-5968ecaf5cee} ProjectExplorer.Project.ActiveTarget @@ -41,7 +41,7 @@ false true false - 2 + 0 true true 0 @@ -74,11 +74,15 @@ 0 true + + -fno-delayed-template-parsing + + true true true Builtin.DefaultTidyAndClazy - 12 + 16 true @@ -94,13 +98,13 @@ Desktop Qt 6.7.3 MinGW 64-bit Desktop Qt 6.7.3 MinGW 64-bit qt.qt6.673.win64_mingw_kit - 0 + 1 0 0 0 - E:\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Debug - E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Debug + D:\Workspaces\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Debug + D:/Workspaces/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Debug true @@ -138,8 +142,8 @@ 2 - E:\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Release - E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Release + D:\Workspaces\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Release + D:/Workspaces/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Release true @@ -179,8 +183,8 @@ 0 - E:\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Profile - E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Profile + D:\Workspaces\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Profile + D:/Workspaces/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Profile true @@ -245,20 +249,263 @@ false -e cpu-cycles --call-graph "dwarf,4096" -F 250 - Qt4ProjectManager.Qt4RunConfiguration:E:/picpanel/picpanel.pro - E:/picpanel/picpanel.pro + Qt4ProjectManager.Qt4RunConfiguration:D:/Workspaces/picpanel/picpanel.pro + D:/Workspaces/picpanel/picpanel.pro false true true true - E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Debug + D:/Workspaces/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Release 1 + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + D:/Workspaces/build-picpanel-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + D:/Workspaces/build-picpanel-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + D:/Workspaces/build-picpanel-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:D:/Workspaces/picpanel/picpanel.pro + D:/Workspaces/picpanel/picpanel.pro + + false + + false + true + true + false + false + true + + + + 1 + + ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion diff --git a/picpanel.pro.user.631b589 b/picpanel.pro.user.631b589 new file mode 100644 index 0000000..c75f21e --- /dev/null +++ b/picpanel.pro.user.631b589 @@ -0,0 +1,271 @@ + + + + + + EnvironmentId + {631b5895-04c2-4f08-83d2-9e1277f189a1} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + 0 + false + true + false + 2 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + false + + + 0 + true + + true + true + Builtin.DefaultTidyAndClazy + 12 + true + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop Qt 6.7.3 MinGW 64-bit + Desktop Qt 6.7.3 MinGW 64-bit + qt.qt6.673.win64_mingw_kit + 0 + 0 + 0 + + 0 + E:\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Debug + E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + 构建 + 构建 + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + 清除 + 清除 + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + E:\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Release + E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + 构建 + 构建 + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + 清除 + 清除 + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + + + 0 + E:\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Profile + E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + 构建 + 构建 + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + 清除 + 清除 + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 0 + + 3 + + + 0 + 部署 + 部署 + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + 0 + true + + + 2 + + false + -e cpu-cycles --call-graph "dwarf,4096" -F 250 + + Qt4ProjectManager.Qt4RunConfiguration:E:/picpanel/picpanel.pro + E:/picpanel/picpanel.pro + false + true + true + true + E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/qrc/image/info_blue.png b/qrc/image/info_blue.png index 8d354df4df0170dae83f7ec72d091e2df34aa036..9019454f161749472be97dd9e99280ba1d2225e4 100644 GIT binary patch literal 608 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 JPDHLkV1liD{1X5G literal 643 zcmV-}0(||6P)Px%JxN4CR9HvFSFuvtKoET^kE(nGJ>LMS!#Bh&BMK@+ft{3zOo6E=(9r51pa#By z9{wRk#)CGqicemjCEuPgV>h-(cYAN&d%M~r?D#`FJ|9s4eqG({4JaJ~I1u0rd?ny@ zo`ifqGbNAXv*RagVkQ8^_1z(HT{5s|2`r!pTwLTQRcQTM0P~D*CDTx#uIB>eoo7cs z&rcmoE6aKTNY>!`VUvUP9s$9WWPP%90@&8!4#+wXD*%M{gwhvl<^()4B}HBTeH$Ph zGeJz+MRlhfD*z_b@;*lM1e`gug}@6FqdeR9BwGBvoZb#=P-)Fx))Au`ooAW+Htnb6 zoA$#J1Cwd_Vl6eTFBnfCyfH8if%jQx0c>i##$d+&(1KGev;a)>sq}QS32E=MLO?Of zv)_$`?&0LBEc+b15`a;0l2lsD81qWyjPmSg8GuoLF`WbC%qRaN0kqYyV899hD8y{K z`~*NTE&qfJsEzB&abd!U01~L?*}m)XvHp?$<2?J~OJHt5y7n9TBm6Tzv{M2zfRE7c zH!tmhAC^Y44f=HgEr6I>cKU5Xzn_5Lii0xv`iuLeuA6b}Bdxe8CBqP+-S0*BT5$PCCtZIJFI@8_o dbB_KW^&jv5S1^2Dwvhk;002ovPDHLkV1kb2C*}YE diff --git a/qrc/image/info_grey_bak.png b/qrc/image/info_grey_bak.png new file mode 100644 index 0000000000000000000000000000000000000000..8e90a71dfee9d8f181ba7d97b9b574d3c6af96f2 GIT binary patch literal 643 zcmV-}0(||6P)Px%JxN4CR9HvFSFuvtKoET^kE(nGJ>LMS!#Bh&BMK@+ft{3zOo6E=(9r51pa#By z9{wRk#)CGqicemjCEuPgV>h-(cYAN&d%M~r?D#`FJ|9s4eqG({4JaJ~I1u0rd?ny@ zo`ifqGbNAXv*RagVkQ8^_1z(HT{5s|2`r!pTwLTQRcQTM0P~D*CDTx#uIB>eoo7cs z&rcmoE6aKTNY>!`VUvUP9s$9WWPP%90@&8!4#+wXD*%M{gwhvl<^()4B}HBTeH$Ph zGeJz+MRlhfD*z_b@;*lM1e`gug}@6FqdeR9BwGBvoZb#=P-)Fx))Au`ooAW+Htnb6 zoA$#J1Cwd_Vl6eTFBnfCyfH8if%jQx0c>i##$d+&(1KGev;a)>sq}QS32E=MLO?Of zv)_$`?&0LBEc+b15`a;0l2lsD81qWyjPmSg8GuoLF`WbC%qRaN0kqYyV899hD8y{K z`~*NTE&qfJsEzB&abd!U01~L?*}m)XvHp?$<2?J~OJHt5y7n9TBm6Tzv{M2zfRE7c zH!tmhAC^Y44f=HgEr6I>cKU5Xzn_5Lii0xv`iuLeuA6b}Bdxe8CBqP+-S0*BT5$PCCtZIJFI@8_o dbB_KW^&jv5S1^2Dwvhk;002ovPDHLkV1kb2C*}YE literal 0 HcmV?d00001 diff --git a/qrc/qss/blacksoft.qss b/qrc/qss/blacksoft.qss index 2ea878c..4ceded4 100644 --- a/qrc/qss/blacksoft.qss +++ b/qrc/qss/blacksoft.qss @@ -140,7 +140,7 @@ QWidget#FrmSetting > QLabel { } QWidget#FrmSetting > QPushButton { - border-radius: 15px; + border-radius: 10px; border: none; background-color: #409EFF; font-family: 'Microsoft YaHei UI'; @@ -152,11 +152,24 @@ QPushButton#btnServer:hover { background-color: #79BBFF; } +QPushButton#btnServer:pressed { + background-color: #337ECC; +} + /* server设置 */ QWidget#ServerSetting { + + /* border: 1px solid white; + border-radius: 8px; + background-color: white; */ + /* background-color: rgb(63, 60, 55); border: none; - border: 1px solid white; - border-radius: 15px; + border: 1px solid rgb(63, 60, 55); + border-radius: 15px; */ +} + +QWidget#ServerSetting > QLineEdit { + border-radius: 8px; } QWidget#ServerSetting > QPushButton#btnOk { @@ -165,10 +178,16 @@ QWidget#ServerSetting > QPushButton#btnOk { border: 2px solid #66B1FF; border-radius: 10px;; color: white; - padding-left: 20px; - padding-right: 20px; - padding-top: 8px; - padding-bottom: 8px; + + font-size: 15px; +} + +QWidget#ServerSetting > QPushButton#btnOk:hover { + background-color: #79BBFF; +} + +QWidget#ServerSetting > QPushButton#btnOk:pressed { + background-color: #337ECC; } QWidget#ServerSetting > QPushButton#btnCencel { @@ -177,6 +196,7 @@ QWidget#ServerSetting > QPushButton#btnCencel { border: 2px solid #DCDFE6; border-radius: 10px; color: black; + font-size: 15px; } QWidget#ServerSetting > QLabel { @@ -208,16 +228,38 @@ QWidget#FrmUpload > QLabel#labLinkType { font-size: 15px; } -QWidget#FrmUpload > QPushButton#btnMarkdown { +QPushButton#btnMarkdown { border-top-left-radius: 10px; border-bottom-left-radius: 10px; } -QWidget#FrmUpload > QPushButton#btnUBB { +QPushButton#btnUBB { border-top-right-radius: 10px; border-bottom-right-radius: 10px; } +QPushButton#btnHTML { + color: #5E6B71; + background-color: white; +} + +QPushButton#btnUrl { + color: #5E6B71; + background-color: white; +} + +QPushButton#btnHTML:checked { + color: #409EFF; +} +QPushButton#btnMarkdown:checked { + color: #409EFF; +} +QPushButton#btnUBB:checked { + color: #409EFF; +} +QPushButton#btnUrl:checked { + color: #409EFF; +} QWidget#FrmUpload > QPushButton#btnFastUpload { border-radius: 10px; @@ -241,3 +283,4 @@ QWidget#FrmUpload > QLabel#labTitle { color: white; font-size: 30px; } + diff --git a/widget.cpp b/widget.cpp index 2caf1ca..1f4adba 100644 --- a/widget.cpp +++ b/widget.cpp @@ -123,8 +123,11 @@ bool Widget::eventFilter(QObject *watched, QEvent *event) return QWidget::eventFilter(watched, event); } -void Widget::paintEvent(QPaintEvent *event) + + +void Widget::paintEvent(__attribute__((unused))QPaintEvent *event) { + // QPainter painter(this); // painter.setRenderHint(QPainter::Antialiasing); // painter.setPen(Qt::NoPen); @@ -209,8 +212,7 @@ void Widget::initLeftMenu() { frmupload = new FrmUpload; frmalbum = new FrmAlbum; - fileConfig = new FileConfigDecode(); - frmsetting = new FrmSetting(fileConfig); + frmsetting = new FrmSetting(this); ui->frmTop->setPalette(QPalette(QColor(63, 60, 55)));