Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Firefly-26710 committed Jul 8, 2024
2 parents e2fb3ea + 8b6eb11 commit 4eb7abf
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ CMakeLists.txt.user
.vs
CMakeUserPresets.json
CMakePresets.json
.vscode/settings.json
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
avatarImage.qrc
filequeue.h filequeue.cpp
storage.h storage.cpp
linknewfolder_window.h linknewfolder_window.cpp
tasktoken.h tasktoken.cpp
filecard.h filecard.cpp
historycard.h historycard.cpp
Expand Down
3 changes: 3 additions & 0 deletions filemange_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ FileManagePage::FileManagePage(QWidget* parent):ElaScrollPage(parent)
pushButtonLayout->addWidget(_pushButton3);
// 在布局中添加一个弹性空间,使得所有控件靠左对齐
pushButtonLayout->addStretch();
connect(_pushButton3,&ElaPushButton::clicked,[=](){
linknewfolderwindow->show();
});

QWidget* catalogueArea = new QWidget();
catalogueArea->setWindowFlags(Qt::FramelessWindowHint); // 去除窗口边框
Expand Down
2 changes: 2 additions & 0 deletions filemange_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "ElaScrollPage.h"
#include "ElaProgressBar.h"
#include "linknewfolder_window.h"

class ElaToggleButton;
class ElaPushButton;
Expand All @@ -21,6 +22,7 @@ class FileManagePage:public ElaScrollPage
ElaPushButton* _pushButton2{nullptr};
ElaPushButton* _pushButton3{nullptr};
ElaToggleButton* _toggleButton{nullptr};
linkNewFolder_window* linknewfolderwindow=new linkNewFolder_window();
};

#endif // FILEMANGE_VIEW_H
23 changes: 23 additions & 0 deletions linknewfolder_window.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "linknewfolder_window.h"
#include <QVBoxLayout>
#include <QHBoxLayout>

linkNewFolder_window::linkNewFolder_window(QWidget *parent)
: ElaWidget(parent,600,400)
{
this->setWindowTitle("珞珈云"); // 设置窗口标题
this->setWindowModality(Qt::ApplicationModal); // 设置窗口模态
this->hide(); // 初始隐藏当前窗口
this->setWindowFlags(Qt::WindowMinimizeButtonHint); // 设置窗口标志,允许最小化
QWidget*centerarea=new QWidget(); // 创建一个新的QWidget对象作为主区域
QVBoxLayout* centerVLayout = new QVBoxLayout(centerarea); // 为中心部件设置垂直布局
centerVLayout->setContentsMargins(0, 0, 0, 0); // 设置布局边距,5为到右边的距离
centerarea->setWindowTitle("链接新文件夹"); // 设置窗口标题

this->setCentralWidget(centerarea);// 将中心部件添加到窗口
}

linkNewFolder_window::~linkNewFolder_window()
{

}
15 changes: 15 additions & 0 deletions linknewfolder_window.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef LINKNEWFOLDER_WINDOW_H
#define LINKNEWFOLDER_WINDOW_H

#include <QWidget>
#include "ElaWidget.h"

class linkNewFolder_window : public ElaWidget
{
public:
linkNewFolder_window(QWidget *parent = nullptr);
~linkNewFolder_window();

};

#endif // LINKNEWFOLDER_WINDOW_H
4 changes: 2 additions & 2 deletions loginwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include"ElaText.h"
#include"ElaImageCard.h"

loginwin::loginwin(QWidget* parent):ElaWidget(parent)
loginwin::loginwin(QWidget* parent):ElaWidget(parent,400,500)
{
setWindowTitle("珞珈云");
connect(resetWin,&resetwin::goback,this,[=](){
Expand All @@ -32,7 +32,7 @@ loginwin::loginwin(QWidget* parent):ElaWidget(parent)
this->setWindowModality(Qt::ApplicationModal);
this->setCentralWidget(area);
this->hide();
this->setFixedSize(250,700);
//this->setFixedSize(250,700);
this->setWindowFlags(Qt::WindowMinimizeButtonHint);

QImage image;
Expand Down
2 changes: 1 addition & 1 deletion mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ MainWindow::MainWindow(QWidget *parent)
_historysyncPage = new HistorysyncPage(this);
_userinfopage = new UserInfoPage(this);

connect(this, &ElaWindow::userInfoCardClicked, this, [=]() {
connect(this, &ElaWindow::userInfoCardClicked, [=]() {
if(CurrentUser==nullptr)
login->show();
});
Expand Down
2 changes: 1 addition & 1 deletion resetwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include"ElaText.h"
#include"ElaImageCard.h"

resetwin::resetwin(QWidget* parent):ElaWidget(parent)
resetwin::resetwin(QWidget* parent):ElaWidget(parent,400,500)
{
setWindowTitle("珞珈云");
QWidget*area=new QWidget();
Expand Down
2 changes: 1 addition & 1 deletion signinwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include"ElaText.h"
#include"ElaInteractiveCard.h"

signinwin::signinwin(QWidget* parent):ElaWidget(parent)
signinwin::signinwin(QWidget* parent):ElaWidget(parent,400,500)
{
setWindowTitle("珞珈云");
QWidget*area=new QWidget();
Expand Down
4 changes: 2 additions & 2 deletions thirdParty/ElaWidgetTools/ElaWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
#include "ElaAppBar.h"
#include "ElaApplication.h"
#include "private/ElaWidgetPrivate.h"
ElaWidget::ElaWidget(QWidget* parent)
ElaWidget::ElaWidget(QWidget* parent, int wi, int he)
: QWidget{parent}, d_ptr(new ElaWidgetPrivate())
{
Q_D(ElaWidget);
d->q_ptr = this;
resize(500, 500); // 默认宽高
resize(wi, he); // 默认宽高
setObjectName("ElaWidget");

d->_windowLinearGradient = new QLinearGradient(0, 0, width(), height());
Expand Down
2 changes: 1 addition & 1 deletion thirdParty/ElaWidgetTools/include/ElaWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ELA_EXPORT ElaWidget : public QWidget
Q_OBJECT
Q_Q_CREATE(ElaWidget)
public:
explicit ElaWidget(QWidget* parent = nullptr);
explicit ElaWidget(QWidget* parent = nullptr,int wi=500,int he=500);
~ElaWidget();
void setCentralWidget(QWidget* centralWidget);

Expand Down
9 changes: 9 additions & 0 deletions user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ User::User(const User &user)


bool User::enroll()
{
QString postData
= QString("username=%1&email=%2&password=%3").arg(username).arg(account).arg(hashedPassword);
ApiResponse response=apiRequest->post("/register",postData.toUtf8());
emit enrollResponse(response.getCode(),response.getData(),response.getMessage());
return response.isSuccess();
}

bool User::enroll(const QString &avatarpath)
{
QImageReader reader(avatarpath);
if (!reader.canRead()) {
Expand Down
2 changes: 1 addition & 1 deletion user.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class User : public QObject
QString hashedPassword; //password
bool isLogin=false;
ApiRequest *apiRequest;
public:
QString avatarpath;

public:
Expand All @@ -37,6 +36,7 @@ class User : public QObject
QObject *parent = nullptr);
User(const User &user);
bool enroll(); //执行post请求,实现注册功能
bool enroll(const QString &avatarpath);//注册带头像
bool login(); //执行post请求,实现登录功能
bool forgetPassword(); //执行post请求,实现找回密码功能
bool updateAvatar(const QString &filePath);//更新头像
Expand Down

0 comments on commit 4eb7abf

Please sign in to comment.