Browse Source

基本框架完成,完善一下细节,最好能完成批量上传

lennlouis 2 weeks ago
parent
commit
cc7c995549

+ 1 - 0
core_form/frmsetting/frmsetting.cpp

@@ -123,6 +123,7 @@ void FrmSetting::schEnableSsl(bool checked)
     ui->labEnableSslClose->setStyleSheet(checked?CLOSEQSS:OPENQSS);
 
     TCHttpService::getInstance()->setSsl(checked);
+
 }
 
 

+ 27 - 1
core_form/frmupload/frmupload.cpp

@@ -10,6 +10,7 @@ FrmUpload::FrmUpload(QWidget *parent)
     ui->setupUi(this);
     initFrom();
     initWidget();
+    connect(TCHttpService::getInstance(), &TCHttpService::signal_uploadFileSec, this, &FrmUpload::slot_uploadFileSec);
 }
 
 FrmUpload::~FrmUpload()
@@ -17,6 +18,18 @@ FrmUpload::~FrmUpload()
     delete ui;
 }
 
+void FrmUpload::slot_uploadFileSec(QString url)
+{
+    QClipboard* clipboard = QApplication::clipboard();
+
+    if (copyState == 0) {
+        clipboard->setText(QString("![](%1)").arg(url));
+    }
+    else {
+        clipboard->setText(url);
+    }
+}
+
 bool FrmUpload::eventFilter(QObject *watched, QEvent *event)
 {
     static bool mousePressed = false;
@@ -64,7 +77,7 @@ void FrmUpload::dropEvent(QDropEvent *event)
     QList<QUrl> urlList = mimeData->urls();
 
 
-#if DEBUG
+#if !DEBUG
     foreach (QUrl url, urlList) {
         qDebug() << url.toLocalFile();
     }
@@ -88,6 +101,11 @@ void FrmUpload::dropEvent(QDropEvent *event)
 void FrmUpload::initFrom()
 {
     ui->frmUpload->setMinimumSize(QSize(400, 200));
+    ui->btnHTML->setText("HTML");
+    ui->btnFastUpload->setText("剪贴板上传");
+    ui->btnMarkdown->setText("Markdown");
+    ui->btnUrl->setText("URL");
+    ui->btnUBB->setText("UBB");
 }
 
 void FrmUpload::initWidget()
@@ -99,5 +117,13 @@ void FrmUpload::initWidget()
 
 void FrmUpload::uploadFiles(QStringList fileList)
 {
+    if (!TCHttpService::getInstance()->getOnlineState())
+        return;
+    foreach (QString p, fileList) {
+        qDebug() << "upload:" << p;
+        TCHttpService::getInstance()->apiUpload(p);
+    }
+    // TCHttpService::getInstance()->apiMyfileCount();
+    // TCHttpService::getInstance()->apiMyfileNormal();
 
 }

+ 8 - 0
core_form/frmupload/frmupload.h

@@ -10,6 +10,9 @@
 #include <QMimeData>
 #include <QDragEnterEvent>
 #include <tchttpservice.h>
+#include <QFileInfo>
+#include <QClipboard>
+#include "tchttpservice.h"
 
 #define DEBUG   1
 
@@ -25,6 +28,9 @@ public:
     explicit FrmUpload(QWidget *parent = nullptr);
     ~FrmUpload();
 
+public slots:
+    void slot_uploadFileSec(QString url);
+
 protected:
     virtual bool eventFilter(QObject* watched, QEvent* event);
     virtual void dragEnterEvent(QDragEnterEvent *event) override;
@@ -34,6 +40,8 @@ private:
     void initFrom();
     void initWidget();
     void uploadFiles(QStringList fileList);
+    // 0 md 1 url
+    int copyState = 0;
 
 private:
     Ui::FrmUpload *ui;

+ 207 - 18
core_form/frmupload/frmupload.ui

@@ -13,43 +13,50 @@
   <property name="windowTitle">
    <string>Form</string>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <property name="leftMargin">
-    <number>0</number>
-   </property>
+  <layout class="QVBoxLayout" name="verticalLayout_4">
+   <item>
+    <widget class="QLabel" name="labTitle">
+     <property name="text">
+      <string>LennDFS 快捷助手</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignmentFlag::AlignCenter</set>
+     </property>
+    </widget>
+   </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout">
      <item>
       <widget class="QFrame" name="frmUpload">
        <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+        <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
-         <width>800</width>
-         <height>450</height>
+         <width>650</width>
+         <height>350</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
-         <width>800</width>
-         <height>450</height>
+         <width>650</width>
+         <height>350</height>
         </size>
        </property>
        <property name="styleSheet">
         <string notr="true"/>
        </property>
        <property name="frameShape">
-        <enum>QFrame::NoFrame</enum>
+        <enum>QFrame::Shape::NoFrame</enum>
        </property>
        <layout class="QVBoxLayout" name="verticalLayout_2">
         <item>
          <spacer name="verticalSpacer">
           <property name="orientation">
-           <enum>Qt::Vertical</enum>
+           <enum>Qt::Orientation::Vertical</enum>
           </property>
           <property name="sizeHint" stdset="0">
            <size>
@@ -64,7 +71,7 @@
           <item>
            <spacer name="horizontalSpacer_2">
             <property name="orientation">
-             <enum>Qt::Horizontal</enum>
+             <enum>Qt::Orientation::Horizontal</enum>
             </property>
             <property name="sizeHint" stdset="0">
              <size>
@@ -76,6 +83,12 @@
           </item>
           <item>
            <widget class="QLabel" name="labPixmap">
+            <property name="maximumSize">
+             <size>
+              <width>100</width>
+              <height>100</height>
+             </size>
+            </property>
             <property name="text">
              <string/>
             </property>
@@ -83,14 +96,14 @@
              <pixmap resource="../../image.qrc">:/qrc/image/upload_white.png</pixmap>
             </property>
             <property name="alignment">
-             <set>Qt::AlignCenter</set>
+             <set>Qt::AlignmentFlag::AlignCenter</set>
             </property>
            </widget>
           </item>
           <item>
            <spacer name="horizontalSpacer_3">
             <property name="orientation">
-             <enum>Qt::Horizontal</enum>
+             <enum>Qt::Orientation::Horizontal</enum>
             </property>
             <property name="sizeHint" stdset="0">
              <size>
@@ -107,7 +120,7 @@
           <property name="font">
            <font>
             <family>Microsoft YaHei UI</family>
-            <pointsize>26</pointsize>
+            <pointsize>16</pointsize>
            </font>
           </property>
           <property name="text">
@@ -118,7 +131,7 @@
         <item>
          <spacer name="verticalSpacer_2">
           <property name="orientation">
-           <enum>Qt::Vertical</enum>
+           <enum>Qt::Orientation::Vertical</enum>
           </property>
           <property name="sizeHint" stdset="0">
            <size>
@@ -134,10 +147,186 @@
      <item>
       <spacer name="horizontalSpacer">
        <property name="orientation">
-        <enum>Qt::Horizontal</enum>
+        <enum>Qt::Orientation::Horizontal</enum>
        </property>
        <property name="sizeType">
-        <enum>QSizePolicy::Fixed</enum>
+        <enum>QSizePolicy::Policy::Fixed</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_4">
+     <item>
+      <spacer name="horizontalSpacer_6">
+       <property name="orientation">
+        <enum>Qt::Orientation::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <item>
+        <widget class="QLabel" name="labLinkType">
+         <property name="styleSheet">
+          <string notr="true"/>
+         </property>
+         <property name="text">
+          <string>链接格式</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignmentFlag::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_3">
+         <property name="spacing">
+          <number>0</number>
+         </property>
+         <item>
+          <widget class="QPushButton" name="btnMarkdown">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+             <horstretch>100</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>100</width>
+             <height>20</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>PushButton</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="btnUrl">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>75</width>
+             <height>20</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>PushButton</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="btnHTML">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>75</width>
+             <height>20</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>PushButton</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="btnUBB">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>100</width>
+             <height>20</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>PushButton</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_4">
+       <property name="orientation">
+        <enum>Qt::Orientation::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <item>
+        <widget class="QLabel" name="labFastUpload">
+         <property name="text">
+          <string>快捷上传</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignmentFlag::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="btnFastUpload">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+           <horstretch>120</horstretch>
+           <verstretch>30</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="minimumSize">
+          <size>
+           <width>100</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>PushButton</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_5">
+       <property name="orientation">
+        <enum>Qt::Orientation::Horizontal</enum>
        </property>
        <property name="sizeHint" stdset="0">
         <size>

+ 153 - 49
core_support/tchttpservice/tchttpservice.cpp

@@ -46,6 +46,7 @@ void TCHttpService::apiLogin()
 
 void TCHttpService::apiMyfileCount()
 {
+
     QString urlStr;
     if (m_enableSsl)
         urlStr = "https://" + m_domain + "/api/myfiles";
@@ -77,7 +78,7 @@ void TCHttpService::apiMyfileCount()
     });
 }
 
-void TCHttpService::apiMyfileNormal()
+void TCHttpService::apiMyfileNormal(int start, int count)
 {
     QString urlStr;
     if (m_enableSsl)
@@ -100,16 +101,15 @@ void TCHttpService::apiMyfileNormal()
     QJsonObject jsonObj;
     jsonObj["token"] = m_token;
     jsonObj["user"] = m_userName;
-    jsonObj["count"] = m_total;
-    jsonObj["start"] = 0;
+    jsonObj["count"] = count;
+    jsonObj["start"] = start;
 
     QJsonDocument jsonDoc(jsonObj);
     QByteArray jsonData = jsonDoc.toJson();
 
     QNetworkReply* reply = nullptr;
     reply = m_manager.post(request, jsonData);
-    QObject::connect(reply, &QNetworkReply::finished, [this, reply](){
-
+    connect(reply, &QNetworkReply::finished, [this, reply](){
         emit requestFinished(reply, "myfilenormal");
     });
 }
@@ -137,73 +137,112 @@ void TCHttpService::apiMd5(const QString& filePath)
     QMap<QString, QString> headers;
     headers.insert("Content-Type", "application/json");
     QString md5Str = QString::fromUtf8(fileMd5);
-    QString bodyStr = QString("\"%1\":\"%2\",\"%3\":\"%4\",\"%5\":\"%6\",\"%7\":\"%8\"").arg("token").arg(m_token).
-            arg("md5").arg(md5Str).arg("filename").arg(QFileInfo(file).fileName()).arg("user").arg(m_userName);
+    QJsonObject jsonObj;
+    jsonObj["token"] = m_token;
+    jsonObj["md5"] = md5Str;
+    jsonObj["filename"] = QFileInfo(file).fileName();
+    jsonObj["user"] = m_userName;
     file.close();
 
+    QJsonDocument jsonDoc(jsonObj);
+    QByteArray jsonData = jsonDoc.toJson();
+    QNetworkReply* reply = nullptr;
+
+    QNetworkRequest request(urlStr);
+    reply = m_manager.post(request, jsonData);
+
+    QObject::connect(reply, &QNetworkReply::finished, [this, reply](){
+        emit requestFinished(reply, "md5");
+    });
 }
 
-void TCHttpService::apiUpload(const QString &filePath, const QString &md5Str)
+void TCHttpService::apiUpload(const QString &filePath)
 {
+
     QString urlStr;
     if (m_enableSsl)
         urlStr = "https://" + m_domain + "/api/upload";
     else
         urlStr = "http://" + m_domain + "/api/upload";
 
-    QFile file(filePath);
-    QFileInfo info(file);
 
-    QHttpMultiPart* multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType);
-    QHttpPart filePart;
-    QString contentTypeStrFile = QString("form-data; name=\"file\"; filename=\"%1\"").arg(info.fileName());
-    filePart.setHeader(QNetworkRequest::ContentDispositionHeader,
-                       QVariant(contentTypeStrFile));
-    filePart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/octet-stream"));
-    if (!file.open(QIODevice::ReadOnly)) {
+
+    QFile *file = new QFile(filePath);
+    if (!file->open(QIODevice::ReadOnly)) {
+        qDebug() << "无法打开文件:" << filePath;
+        delete file;
         return;
     }
 
-    filePart.setBodyDevice(&file);
-    file.setParent(multiPart);
+    // 计算文件 MD5
+    QCryptographicHash hash(QCryptographicHash::Md5);
+    hash.addData(file);
+    QString md5 = hash.result().toHex();
+
+    // 重置文件指针
+    file->seek(0);
+
+    // 获取文件大小
+    qint64 fileSize = file->size();
+
+    // 创建 multipart 请求
+#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
+    QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType);
+#else
+    QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::FormData);
+#endif
+    // 添加文件部分
+    QHttpPart filePart;
+    filePart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/octet-stream"));
+    filePart.setHeader(QNetworkRequest::ContentDispositionHeader,
+                       QVariant("form-data; name=\"file\"; filename=\"" + QFileInfo(filePath).fileName() + "\""));
+    filePart.setBodyDevice(file);
     multiPart->append(filePart);
 
-
+    // 添加用户信息部分
     QHttpPart userPart;
-    QString contentTypeStrUser = QString("form-data; name=\"user\"");
-    userPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant(contentTypeStrUser));
+    userPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"user\""));
     userPart.setBody(m_userName.toUtf8());
     multiPart->append(userPart);
 
+    // 添加 MD5 部分
     QHttpPart md5Part;
-    QString contentTypeStrMd5 = QString("form-data; name=\"md5\"");
-    md5Part.setHeader(QNetworkRequest::ContentTypeHeader, QVariant(contentTypeStrMd5));
-    md5Part.setBody(md5Str.toUtf8());
+    md5Part.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"md5\""));
+    md5Part.setBody(md5.toUtf8());
     multiPart->append(md5Part);
 
+    // 添加文件大小部分
     QHttpPart sizePart;
-    QString contentTypeStrSize = QString("form-data; name=\"size\"");
-    sizePart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant(contentTypeStrSize));
-    sizePart.setBody(QString::number(info.size()).toUtf8());
+    sizePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"size\""));
+    sizePart.setBody(QString::number(fileSize).toUtf8());
     multiPart->append(sizePart);
 
-    QUrl url(urlStr);
-    QNetworkRequest request(url);
-
-    QNetworkReply* reply = m_manager.post(request, multiPart);
-    multiPart->setParent(reply);
-
-    QObject::connect(reply, &QNetworkReply::finished, [this, reply]{
-        QJsonDocument jsonDoc = QJsonDocument::fromJson(reply->readAll());
-        QJsonObject jsonObj = jsonDoc.object();
-
-        int code = jsonObj["code"].toInt();
-        if (code == 0) {
-            emit signal_uploadSuc();
+    // 创建网络请求
+    QNetworkRequest request(urlStr); // 替换为实际的服务器地址
+    request.setHeader(QNetworkRequest::ContentTypeHeader, "multipart/form-data; boundary=" + multiPart->boundary());
+
+    // 发送请求
+    // QNetworkAccessManager *manager = new QNetworkAccessManager(this);
+    QNetworkReply *reply = m_manager.post(request, multiPart);
+
+    // 连接信号槽
+    connect(reply, &QNetworkReply::finished, this, [=]() {
+        if (reply->error() == QNetworkReply::NoError) {
+            qDebug() << "上传成功:";
+            apiMyfileCount();
+        } else {
+            qDebug() << "上传失败:" << reply->errorString();
         }
         reply->deleteLater();
+        multiPart->deleteLater();
     });
 
+    connect(reply, &QNetworkReply::uploadProgress, this, [](qint64 bytesSent, qint64 bytesTotal) {
+        if (bytesTotal > 0) {
+            int progress = (bytesSent * 100) / bytesTotal;
+            qDebug() << "上传进度:" << progress << "%";
+        }
+    });
 }
 
 void TCHttpService::apiSharePicShare(const QString &fileName, const QString &md5)
@@ -230,7 +269,6 @@ void TCHttpService::apiSharePicShare(const QString &fileName, const QString &md5
 
 void TCHttpService::setConfiguration(QString userName, QString firstPwd, QString domain)
 {
-    qDebug() << "setConfiguration";
     this->m_domain = domain;
     this->m_userName = userName;
     this->m_firstPwd = firstPwd;
@@ -246,6 +284,9 @@ 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();
+
             }
         }
         if (api == "myfilecount") {
@@ -258,11 +299,65 @@ void TCHttpService::setConfiguration(QString userName, QString firstPwd, QString
             if (code == 0) {
                 int total = jsonObj["total"].toInt();
                 this->m_total = total;
+                int n = total / 10 + 1;
+                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") {
+            QJsonDocument jsonDoc = QJsonDocument::fromJson(rawData);
+            if (jsonDoc.isEmpty())
+                return;
+            QJsonObject jsonObj = jsonDoc.object();
+
+            int code = jsonObj["code"].toInt();
+            if (code != 0)
+                return;
+                QJsonArray jsonArray = jsonObj["files"].toArray();
+            for (const QJsonValue& value : jsonArray) {
+                QJsonObject jsonObj = value.toObject();
+
+                QString file_name = jsonObj["file_name"].toString();
+                int share_status = jsonObj["share_status"].toInt();
+                QString url = jsonObj["url"].toString();
+                qint64 size = jsonObj["size"].toInt();
+                QString md5 = jsonObj["md5"].toString();
+
+                QMap<QString, file_info_t>::iterator ite;
+                ite = m_fileMap.find(file_name);
+                if (ite == m_fileMap.end()) {
+                    file_info_t info;
+                    info.share_status = share_status;
+                    info.size = size;
+                    info.url = url;
+                    info.file_name = file_name;
+                    emit signal_uploadFileSec(url);
+                    m_fileMap.insert(md5, info);
+                }
+#if !DEBUG
+                // for(auto ite = m_fileMap.constBegin(); ite != m_fileMap.constEnd(); ite++) {
+                //     qDebug() << "fileMap debug:" << ite.value().file_name;
+                // }
+                qDebug() << "fileMap size:" << m_fileMap.size();
+#endif
+            }
+
 
         }
+        // if (api == "upload") {
+        //     qDebug() <<"upload";
+        //     QJsonDocument jsondoc = QJsonDocument::fromJson(rawData);
+        //     QJsonObject jsonObj = jsondoc.object();
+
+        //     int code = jsonObj["code"].toInt();
+
+        //     if (code == 0)
+        //         this->apiMyfileCount();
+        // }
         reply->deleteLater();
     });
     apiLogin();
@@ -270,10 +365,19 @@ void TCHttpService::setConfiguration(QString userName, QString firstPwd, QString
 
 void TCHttpService::setSsl(bool enable)
 {
-    qDebug() << "setSsl:" <<enable;
     this->m_enableSsl = enable;
 }
 
+bool TCHttpService::getOnlineState()
+{
+    return m_isOnline;
+}
+
+void TCHttpService::setUploadNum(int nb)
+{
+    this->m_uploadNum = nb;
+}
+
 QUrl TCHttpService::encodeUrl(QString urlStr, QMap<QString, QString> params)
 {
     QUrlQuery query;
@@ -290,14 +394,14 @@ QUrl TCHttpService::encodeUrl(QString urlStr, QMap<QString, QString> params)
 
 void TCHttpService::updateFileMap(QJsonObject jsonObj)
 {
-    QString fileMD5 = jsonObj["md5"].toString();
-    QString fileUrl = jsonObj["http"].toString();
+    // QString fileMD5 = jsonObj["md5"].toString();
+    // QString fileUrl = jsonObj["http"].toString();
 
-    QMap<QString, QString>::iterator ite = m_fileMap.begin();
-    if (ite != m_fileMap.end())
-        return;
+    // QMap<QString, file_info_t>::iterator ite = m_fileMap.begin();
+    // if (ite != m_fileMap.end())
+    //     return;
 
-    m_fileMap.insert(fileMD5, fileUrl);
+    // m_fileMap.insert(fileMD5, fileUrl);
 }
 
 TCHttpService::TCHttpService(QObject *parent) : QObject(parent)

+ 21 - 4
core_support/tchttpservice/tchttpservice.h

@@ -1,6 +1,8 @@
 #ifndef TCHTTPSERVICE_H
 #define TCHTTPSERVICE_H
 
+#define DEBUG 1
+
 #include <QObject>
 #include <QNetworkAccessManager>
 #include <QUrlQuery>
@@ -14,21 +16,33 @@
 #include <QFileInfo>
 #include <QHttpMultiPart>
 #include <QHttpPart>
+#include <QHttpMultiPart>
 
 class TCHttpService : public QObject
 {
     Q_OBJECT
+private:
+    typedef struct {
+        QString file_name;
+        int share_status;
+        QString url;
+        qint64 size;
+    } file_info_t;
+
+    QMap<QString, file_info_t> m_fileMap;
 public:
     static TCHttpService* getInstance();
 
     void apiLogin();
     void apiMyfileCount();
-    void apiMyfileNormal();
+    void apiMyfileNormal(int start, int count);
     void apiMd5(const QString& filePath);
-    void apiUpload(const QString& filePath, const QString& md5);
+    void apiUpload(const QString& filePath);
     void apiSharePicShare(const QString& fileName, const QString& md5);
     void setConfiguration(QString userName, QString firstPwd, QString domain);
     void setSsl(bool enable);
+    bool getOnlineState();
+    void setUploadNum(int nb);
 
 private:
 
@@ -38,7 +52,7 @@ signals:
     void signal_loginSuc();
     void signal_uploadSuc();
     void signal_shareSuc();
-
+    void signal_uploadFileSec(QString url);
     void requestFinished(QNetworkReply* reply, QString api);
 private:
     explicit TCHttpService(QObject *parent = nullptr);
@@ -51,10 +65,13 @@ private:
     QString m_domain;
     QString m_firstPwd;
     QString m_userName;
-    QMap<QString, QString> m_fileMap;
     int m_total;
     bool m_enableSsl = true;
 
+    bool m_isOnline = false;
+
+    bool m_uploadNum = 0;
+
 signals:
 
 };

+ 17 - 17
picpanel.pro.user

@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 15.0.0, 2025-03-24T02:01:39. -->
+<!-- Written by QtCreator 14.0.2, 2025-03-24T18:42:47. -->
 <qtcreator>
  <data>
   <variable>EnvironmentId</variable>
-  <value type="QByteArray">{eff88622-f1f6-485c-90af-dd46e6d2c022}</value>
+  <value type="QByteArray">{631b5895-04c2-4f08-83d2-9e1277f189a1}</value>
  </data>
  <data>
   <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -33,7 +33,6 @@
    <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
    <value type="int" key="EditorConfiguration.IndentSize">4</value>
    <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
-   <value type="int" key="EditorConfiguration.LineEndingBehavior">0</value>
    <value type="int" key="EditorConfiguration.MarginColumn">80</value>
    <value type="bool" key="EditorConfiguration.MouseHiding">true</value>
    <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
@@ -79,7 +78,7 @@
     <value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
     <value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
     <value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
-    <value type="int" key="ClangTools.ParallelJobs">8</value>
+    <value type="int" key="ClangTools.ParallelJobs">12</value>
     <value type="bool" key="ClangTools.PreferConfigFile">true</value>
     <valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
     <valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
@@ -92,16 +91,16 @@
   <variable>ProjectExplorer.Project.Target.0</variable>
   <valuemap type="QVariantMap">
    <value type="QString" key="DeviceType">Desktop</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 6.7.3 for macOS</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt 6.7.3 for macOS</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.673.clang_64_kit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.7.3 MinGW 64-bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.7.3 MinGW 64-bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.673.win64_mingw_kit</value>
    <value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
    <value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
    <value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
     <value type="int" key="EnableQmlDebugging">0</value>
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/lenn/Workspace/picpanel/build/Qt_6_7_3_for_macOS-Debug</value>
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/Users/lenn/Workspace/picpanel/build/Qt_6_7_3_for_macOS-Debug</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Debug</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Debug</value>
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
      <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
       <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -139,8 +138,8 @@
     <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/lenn/Workspace/picpanel/build/Qt_6_7_3_for_macOS-Release</value>
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/Users/lenn/Workspace/picpanel/build/Qt_6_7_3_for_macOS-Release</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Release</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Release</value>
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
      <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
       <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -180,8 +179,8 @@
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
     <value type="int" key="EnableQmlDebugging">0</value>
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/lenn/Workspace/picpanel/build/Qt_6_7_3_for_macOS-Profile</value>
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/Users/lenn/Workspace/picpanel/build/Qt_6_7_3_for_macOS-Profile</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Profile</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Profile</value>
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
      <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
       <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -239,19 +238,20 @@
     <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
     <value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
     <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
+    <value type="QList&lt;int&gt;" key="Analyzer.Valgrind.VisibleErrorKinds"></value>
     <valuelist type="QVariantList" key="CustomOutputParsers"/>
     <value type="int" key="PE.EnvironmentAspect.Base">2</value>
     <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
     <value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
-    <value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
+    <value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph &quot;dwarf,4096&quot; -F 250</value>
     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:</value>
-    <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/Users/lenn/Workspace/picpanel/picpanel.pro</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:E:/picpanel/picpanel.pro</value>
+    <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">E:/picpanel/picpanel.pro</value>
     <value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
     <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
     <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
     <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
-    <value type="QString" key="RunConfiguration.WorkingDirectory.default">/Users/lenn/Workspace/picpanel/build/Qt_6_7_3_for_macOS-Debug/picpanel.app/Contents/MacOS</value>
+    <value type="QString" key="RunConfiguration.WorkingDirectory.default">E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Debug</value>
    </valuemap>
    <value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
   </valuemap>

+ 271 - 0
picpanel.pro.user.eff8862

@@ -0,0 +1,271 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE QtCreatorProject>
+<!-- Written by QtCreator 15.0.0, 2025-03-24T02:01:39. -->
+<qtcreator>
+ <data>
+  <variable>EnvironmentId</variable>
+  <value type="QByteArray">{eff88622-f1f6-485c-90af-dd46e6d2c022}</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.ActiveTarget</variable>
+  <value type="qlonglong">0</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.EditorSettings</variable>
+  <valuemap type="QVariantMap">
+   <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
+   <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
+   <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
+    <value type="QString" key="language">Cpp</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
+    </valuemap>
+   </valuemap>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
+    <value type="QString" key="language">QmlJS</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
+    </valuemap>
+   </valuemap>
+   <value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
+   <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
+   <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
+   <value type="int" key="EditorConfiguration.IndentSize">4</value>
+   <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
+   <value type="int" key="EditorConfiguration.LineEndingBehavior">0</value>
+   <value type="int" key="EditorConfiguration.MarginColumn">80</value>
+   <value type="bool" key="EditorConfiguration.MouseHiding">true</value>
+   <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
+   <value type="int" key="EditorConfiguration.PaddingMode">1</value>
+   <value type="int" key="EditorConfiguration.PreferAfterWhitespaceComments">0</value>
+   <value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
+   <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
+   <value type="bool" key="EditorConfiguration.ShowMargin">false</value>
+   <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">2</value>
+   <value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
+   <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
+   <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
+   <value type="int" key="EditorConfiguration.TabSize">8</value>
+   <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
+   <value type="bool" key="EditorConfiguration.UseIndenter">false</value>
+   <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
+   <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
+   <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
+   <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
+   <value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
+   <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
+   <value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
+   <value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.PluginSettings</variable>
+  <valuemap type="QVariantMap">
+   <valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
+    <value type="bool" key="AutoTest.Framework.Boost">true</value>
+    <value type="bool" key="AutoTest.Framework.CTest">false</value>
+    <value type="bool" key="AutoTest.Framework.Catch">true</value>
+    <value type="bool" key="AutoTest.Framework.GTest">true</value>
+    <value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
+    <value type="bool" key="AutoTest.Framework.QtTest">true</value>
+   </valuemap>
+   <value type="bool" key="AutoTest.ApplyFilter">false</value>
+   <valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
+   <valuelist type="QVariantList" key="AutoTest.PathFilters"/>
+   <value type="int" key="AutoTest.RunAfterBuild">0</value>
+   <value type="bool" key="AutoTest.UseGlobal">true</value>
+   <valuemap type="QVariantMap" key="ClangTools">
+    <value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
+    <value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
+    <value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
+    <value type="int" key="ClangTools.ParallelJobs">8</value>
+    <value type="bool" key="ClangTools.PreferConfigFile">true</value>
+    <valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
+    <valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
+    <valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
+    <value type="bool" key="ClangTools.UseGlobalSettings">true</value>
+   </valuemap>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.0</variable>
+  <valuemap type="QVariantMap">
+   <value type="QString" key="DeviceType">Desktop</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 6.7.3 for macOS</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt 6.7.3 for macOS</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.673.clang_64_kit</value>
+   <value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
+   <value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+   <value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
+    <value type="int" key="EnableQmlDebugging">0</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/lenn/Workspace/picpanel/build/Qt_6_7_3_for_macOS-Debug</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/Users/lenn/Workspace/picpanel/build/Qt_6_7_3_for_macOS-Debug</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+     </valuemap>
+     <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/lenn/Workspace/picpanel/build/Qt_6_7_3_for_macOS-Release</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/Users/lenn/Workspace/picpanel/build/Qt_6_7_3_for_macOS-Release</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+     </valuemap>
+     <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="int" key="QtQuickCompiler">0</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
+    <value type="int" key="EnableQmlDebugging">0</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/lenn/Workspace/picpanel/build/Qt_6_7_3_for_macOS-Profile</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/Users/lenn/Workspace/picpanel/build/Qt_6_7_3_for_macOS-Profile</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+     </valuemap>
+     <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="int" key="QtQuickCompiler">0</value>
+    <value type="int" key="SeparateDebugInfo">0</value>
+   </valuemap>
+   <value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">部署</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">部署</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
+    <value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
+   </valuemap>
+   <value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+    <value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
+    <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
+    <value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
+    <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
+    <valuelist type="QVariantList" key="CustomOutputParsers"/>
+    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
+    <value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
+    <value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:</value>
+    <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/Users/lenn/Workspace/picpanel/picpanel.pro</value>
+    <value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
+    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+    <value type="QString" key="RunConfiguration.WorkingDirectory.default">/Users/lenn/Workspace/picpanel/build/Qt_6_7_3_for_macOS-Debug/picpanel.app/Contents/MacOS</value>
+   </valuemap>
+   <value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.TargetCount</variable>
+  <value type="qlonglong">1</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+  <value type="int">22</value>
+ </data>
+ <data>
+  <variable>Version</variable>
+  <value type="int">22</value>
+ </data>
+</qtcreator>

BIN
qrc/image/upload_white.png


BIN
qrc/image/upload_white_bak.png


+ 53 - 2
qrc/qss/blacksoft.qss

@@ -36,7 +36,7 @@ QPushButton#btnMin:pressed {
 
 QFrame#frame > QPushButton {
     font-family: 'Microsoft YaHei UI';
-    font-size: 20px;
+    font-size: 15px;
     color: white;
 }
 
@@ -189,4 +189,55 @@ QWidget#ServerSetting > QLineEdit {
     border: 2px solid #DCDFE6;
     background-color: white;
     color: black;
-}
+}
+
+QWidget#FrmUpload > QPushButton {
+    font-family: 'Microsoft YaHei UI';
+    border: 1px solid 5E6B71;
+    color: #5E6B71;
+    background-color: white;
+}
+
+QWidget#FrmUpload > QLabel#labFastUpload {
+    color: white;
+    font-size: 15px;
+}
+
+QWidget#FrmUpload > QLabel#labLinkType {
+    color: white;
+    font-size: 15px;
+}
+
+QWidget#FrmUpload > QPushButton#btnMarkdown {
+    border-top-left-radius: 10px;
+    border-bottom-left-radius: 10px;
+}
+
+QWidget#FrmUpload > QPushButton#btnUBB {
+    border-top-right-radius: 10px;
+    border-bottom-right-radius: 10px;
+}
+
+
+QWidget#FrmUpload > QPushButton#btnFastUpload {
+    border-radius: 10px;
+    border: 1px solid #409EFF;
+    background-color: #409EFF;
+    font-family: 'Microsoft YaHei UI';
+    font-size: 15px;
+    color: white;
+}
+
+QWidget#FrmUpload > QPushButton#btnFastUpload:hover {
+    background-color: #79BBFF;
+}
+
+QWidget#FrmUpload > QPushButton#btnFastUpload:pressed {
+    border: none;
+    background-color: #337ECC;
+}
+
+QWidget#FrmUpload > QLabel#labTitle {
+    color: white;
+    font-size: 30px;
+}

+ 11 - 3
widget.cpp

@@ -10,7 +10,8 @@ Widget::Widget(QWidget *parent)
     initWidgetForm();
     initWidget();
     initSignalSlot();
-
+    // this->btnPageUpload->setChecked(true);
+    // this->btnPageUpload->setStyleSheet("{border: none;border-right: 4px solid #409EFF;color: #409EFF;}");
 }
 
 Widget::~Widget()
@@ -144,7 +145,8 @@ void Widget::paintEvent(QPaintEvent *event)
 
 void Widget::initWidgetForm()
 {
-    this->setFixedSize(QSize(1000, 550));
+    // this->setFixedSize(QSize(1000, 550));
+    this->setFixedSize(800, 450);
     this->setWindowFlag(Qt::FramelessWindowHint);
     this->setWindowFlags(this->windowFlags() | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint);
     this->setWindowIcon(QIcon(QPixmap(":/qrc/image/icon.png")));
@@ -162,6 +164,7 @@ void Widget::initWidgetForm()
     IconHelper::setIcon(ui->btnClose, QString("F00D").toInt(nullptr, 16), 16);
 
     ui->labTitle->setText("PicPanel");
+
 }
 
 void Widget::initWidget()
@@ -187,6 +190,8 @@ void Widget::initWidget()
 
     btnPageUpload->setChecked(true);
     ui->stackedWidget->setCurrentIndex(0);
+
+    ui->horizontalLayout_2->setSizeConstraint(QLayout::SetFixedSize);
 }
 
 void Widget::initSignalSlot()
@@ -217,9 +222,10 @@ void Widget::initLeftMenu()
     btnPageUpload->setMinimumWidth(160);
     btnPageUpload->setMinimumHeight(30);
     btnPageUpload->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
-    QIcon iconUpload(QPixmap(":/qrc/image/upload_white.png"));
+    QIcon iconUpload(QPixmap(":/qrc/image/upload_blue.png"));
     btnPageUpload->setIconSize(QSize(24, 24));
     btnPageUpload->setIcon(iconUpload);
+    btnPageUpload->setCheckable(true);
 
     btnPageAlbum = new QPushButton(ui->frame);
     btnPageAlbum->setObjectName("btnPageAlbum");
@@ -232,6 +238,7 @@ void Widget::initLeftMenu()
     QIcon iconAlbum(QPixmap(":/qrc/image/album_white.png"));
     btnPageAlbum->setIconSize(QSize(24, 24));
     btnPageAlbum->setIcon(iconAlbum);
+    btnPageAlbum->setCheckable(true);
 
     btnPageSetting = new QPushButton(ui->frame);
     btnPageSetting->setObjectName("btnPageSetting");
@@ -244,6 +251,7 @@ void Widget::initLeftMenu()
     QIcon iconSetting(QPixmap(":/qrc/image/setting_white.png"));
     btnPageSetting->setIconSize(QSize(24, 24));
     btnPageSetting->setIcon(iconSetting);
+    btnPageSetting->setCheckable(true);
 
     ui->stackedWidget->addWidget(frmupload);
     ui->stackedWidget->addWidget(frmalbum);

+ 31 - 7
widget.ui

@@ -6,10 +6,28 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>800</width>
-    <height>600</height>
+    <width>999</width>
+    <height>564</height>
    </rect>
   </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>999</width>
+    <height>564</height>
+   </size>
+  </property>
+  <property name="maximumSize">
+   <size>
+    <width>999</width>
+    <height>564</height>
+   </size>
+  </property>
   <property name="windowTitle">
    <string>Widget</string>
   </property>
@@ -38,7 +56,7 @@
       </size>
      </property>
      <property name="frameShape">
-      <enum>QFrame::NoFrame</enum>
+      <enum>QFrame::Shape::NoFrame</enum>
      </property>
      <layout class="QHBoxLayout" name="horizontalLayout">
       <property name="spacing">
@@ -59,7 +77,7 @@
       <item>
        <spacer name="horizontalSpacer">
         <property name="orientation">
-         <enum>Qt::Horizontal</enum>
+         <enum>Qt::Orientation::Horizontal</enum>
         </property>
         <property name="sizeHint" stdset="0">
          <size>
@@ -79,7 +97,7 @@
       <item>
        <spacer name="horizontalSpacer_2">
         <property name="orientation">
-         <enum>Qt::Horizontal</enum>
+         <enum>Qt::Orientation::Horizontal</enum>
         </property>
         <property name="sizeHint" stdset="0">
          <size>
@@ -153,18 +171,24 @@
         </size>
        </property>
        <property name="frameShape">
-        <enum>QFrame::NoFrame</enum>
+        <enum>QFrame::Shape::NoFrame</enum>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QStackedWidget" name="stackedWidget">
        <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
+       <property name="maximumSize">
+        <size>
+         <width>999</width>
+         <height>564</height>
+        </size>
+       </property>
       </widget>
      </item>
     </layout>