From 9ee608891ccf913f73ce1f2718b0f4b21711fe44 Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Thu, 2 Sep 2021 16:46:53 +0800 Subject: [PATCH] work save --- RedPandaIDE/settings.cpp | 69 ++++++++++++++++++++++++++++++++++++++++ RedPandaIDE/settings.h | 19 +++++++++++ 2 files changed, 88 insertions(+) diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 76687670..227962e4 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -3587,6 +3587,66 @@ void Settings::UI::setMainWindowGeometry(const QByteArray &newMainWindowGeometry mMainWindowGeometry = newMainWindowGeometry; } +bool Settings::UI::bottomPanelOpenned() const +{ + return mBottomPanelOpenned; +} + +void Settings::UI::setBottomPanelOpenned(bool newBottomPanelOpenned) +{ + mBottomPanelOpenned = newBottomPanelOpenned; +} + +int Settings::UI::bottomPanelHeight() const +{ + return mBottomPanelHeight; +} + +void Settings::UI::setBottomPanelHeight(int newBottomPanelHeight) +{ + mBottomPanelHeight = newBottomPanelHeight; +} + +int Settings::UI::bottomPanelIndex() const +{ + return mBottomPanelIndex; +} + +void Settings::UI::setBottomPanelIndex(int newBottomPanelIndex) +{ + mBottomPanelIndex = newBottomPanelIndex; +} + +bool Settings::UI::leftPanelOpenned() const +{ + return mLeftPanelOpenned; +} + +void Settings::UI::setLeftPanelOpenned(bool newLeftPanelOpenned) +{ + mLeftPanelOpenned = newLeftPanelOpenned; +} + +int Settings::UI::leftPanelWidth() const +{ + return mLeftPanelWidth; +} + +void Settings::UI::setLeftPanelWidth(int newLeftPanelWidth) +{ + mLeftPanelWidth = newLeftPanelWidth; +} + +int Settings::UI::leftPanelIndex() const +{ + return mLeftPanelIndex; +} + +void Settings::UI::setLeftPanelIndex(int newLeftPanelIndex) +{ + mLeftPanelIndex = newLeftPanelIndex; +} + const QByteArray &Settings::UI::mainWindowState() const { return mMainWindowState; @@ -3601,10 +3661,19 @@ void Settings::UI::doSave() { saveValue("main_window_state",mMainWindowState); saveValue("main_window_geometry",mMainWindowGeometry); + saveValue("bottom_panel_openned",mBottomPanelOpenned); + saveValue("bottom_panel_height",mBottomPanelHeight); + saveValue() + saveValue("left_panel_openned",mLeftPanelOpenned); + saveValue("left_panel_width",mLeftPanelWidth); } void Settings::UI::doLoad() { mMainWindowState = value("main_window_state",QByteArray()).toByteArray(); mMainWindowGeometry = value("main_window_geometry",QByteArray()).toByteArray(); + mBottomPanelOpenned = boolValue("bottom_panel_openned",false); + mBottomPanelHeight = intValue("bottom_panel_height",220); + mLeftPanelOpenned = boolValue("left_panel_openned",true); + mLeftPanelWidth = intValue("left_panel_width",250); } diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h index ac96832b..539edd7f 100644 --- a/RedPandaIDE/settings.h +++ b/RedPandaIDE/settings.h @@ -695,9 +695,28 @@ public: const QByteArray &mainWindowGeometry() const; void setMainWindowGeometry(const QByteArray &newMainWindowGeometry); + bool bottomPanelOpenned() const; + void setBottomPanelOpenned(bool newBottomPanelOpenned); + int bottomPanelHeight() const; + void setBottomPanelHeight(int newBottomPanelHeight); + int bottomPanelIndex() const; + void setBottomPanelIndex(int newBottomPanelIndex); + bool leftPanelOpenned() const; + void setLeftPanelOpenned(bool newLeftPanelOpenned); + int leftPanelWidth() const; + void setLeftPanelWidth(int newLeftPanelWidth); + int leftPanelIndex() const; + void setLeftPanelIndex(int newLeftPanelIndex); + private: QByteArray mMainWindowState; QByteArray mMainWindowGeometry; + bool mBottomPanelOpenned; + int mBottomPanelHeight; + int mBottomPanelIndex; + bool mLeftPanelOpenned; + int mLeftPanelWidth; + int mLeftPanelIndex; protected: void doSave() override;