fix some error

This commit is contained in:
likehomedream 2023-12-19 15:44:04 +08:00
parent 7a8094548e
commit 8a25a47674
6 changed files with 41 additions and 3 deletions

View File

@ -390,6 +390,17 @@ void MainWindow::onGoHomeClicked()
connect(m_cacheConfirmedWidget, &cacheConfirmedWidget::cacheCancel, this, [=](){
m_titlebar->setGoHomeBtn(true);
});
connect(m_cacheConfirmedWidget, &cacheConfirmedWidget::visibilityChanged, this, [=](bool visible) {
if (!visible) {
if(m_stackedWidget->currentIndex() == 0){
m_titlebar->setGoHomeBtn(false);
} else {
m_titlebar->setGoHomeBtn(true);
}
} else {
qDebug() << "m_cacheConfirmedWidget is visible";
}
});
} else {
if(!m_ishistory){
//无修改时,删除时间戳目录

View File

@ -50,3 +50,9 @@ cacheConfirmedWidget::cacheConfirmedWidget(QWidget *parent)
this->close();
});
}
void cacheConfirmedWidget::closeEvent(QCloseEvent *event)
{
emit visibilityChanged(false);
QWidget::closeEvent(event);
}

View File

@ -16,11 +16,13 @@ class cacheConfirmedWidget : public QWidget
Q_OBJECT
public:
explicit cacheConfirmedWidget(QWidget *parent = nullptr);
protected:
void closeEvent(QCloseEvent *event) override;
signals:
void cacheSave();
void cacheClean();
void cacheCancel();
void visibilityChanged(bool visible);
private:
QVBoxLayout *m_cacheConfirmedWidget;
QLabel *m_questionMessage;

View File

@ -170,6 +170,8 @@ HistoryButton::HistoryButton(QWidget* parent): QPushButton(parent)
void HistoryButton::setHistoryTime(const QString &text)
{
m_historytime = text;
QDateTime dateTime = QDateTime::fromString(text, "yyyyMMddhhmmss");
m_showhistorytime = dateTime.toString("yyyy/MM/dd/hh:mm:ss");
}
void HistoryButton::setCover(const QString & covePath)
@ -222,14 +224,28 @@ void HistoryButton::initUI()
}
layout->addWidget(label1);
QLabel* label2 = new QLabel(m_historytime);
QLabel* label2 = new QLabel(m_showhistorytime);
layout->addWidget(label2);
QWidget * btnwidget = new QWidget(this);
QHBoxLayout * btnwidgetlayout = new QHBoxLayout(btnwidget);
btnwidgetlayout->setContentsMargins(0,0,0,0);
QPushButton* button = new QPushButton(m_themetype);
QPushButton* button;
QString buttonText;
if (m_themetype == "globalTheme") {
buttonText = tr("globalTheme");
} else if (m_themetype == "iconTheme") {
buttonText = tr("iconTheme");
} else if (m_themetype == "cursorTheme") {
buttonText = tr("cursorTheme");
} else if (m_themetype == "plymouthTheme") {
buttonText = tr("plymouthTheme");
} else {
buttonText = tr("grubTheme");
}
button = new QPushButton(buttonText, this);
QPushButton* btn_menu = new QPushButton("···");
btn_menu->setFixedWidth(50);
btnwidgetlayout->addWidget(button);

View File

@ -34,6 +34,7 @@ signals:
void startBuild(QString &historytime);
private:
QString m_historytime = nullptr;
QString m_showhistorytime = nullptr;
QString m_coverpath = nullptr;
QString m_themename = nullptr;
QString m_themetype = nullptr;

View File

@ -297,6 +297,8 @@ void InfoCreateWidget::InfoProcess(){
//创建control/changelog文件
connect(m_recogniseBtn, &QPushButton::clicked,this,[=](){
//判断是否为空不为空设置值为未命名x
createControlChangelog(FileProcess::g_date);
createMeson(FileProcess::g_date);
emit readytoSave();