Merge branch 'table' into 'upstream'

Table

See merge request kylinos-src/kylin-connectivity!40
This commit is contained in:
赵杨 2022-10-19 11:26:51 +00:00
commit 1acf670d4f
4 changed files with 51 additions and 15 deletions

View File

@ -927,6 +927,8 @@ void MainWindow::slotDownTempFileFinish(QString filePath)
stopLoadUI();
if (m_isPcSearchInfo) {
m_isPcSearchInfo = false;
m_isUpdated = true;
m_searchInfoPath = filePath;
} else if (!filePath.isEmpty()) {
FileInfo::fileOpen(filePath);
} else {
@ -1718,5 +1720,16 @@ void MainWindow::connectMobileStorage()
connect(m_mobileStorageWidget, &MobileStorageWidget::sigSearchResult, this, &MainWindow::onRecvSearchResult);
connect(m_mobileStorageWidget, &MobileStorageWidget::sigSearchInitFail, this, &MainWindow::slotSearchInitFail);
connect(this, &MainWindow::sigSearchUpdate, m_mobileStorageWidget, &MobileStorageWidget::onReturnPressed);
connect(m_mobileStorageWidget, &MobileStorageWidget::sigForwardButtonEnabled, this, [=](QString indexPath) {
m_saveListPath << indexPath;
});
connect(m_mobileStorageWidget, &MobileStorageWidget::sigForwardButtonClicked, this, [=]() {
if (m_saveListPath.size() > 0) {
QString lastPath = m_saveListPath.last();
slotCdMobileStorageDirectory(lastPath);
m_saveListPath.removeLast();
}
});
m_mobileStorageWidget->setMode(m_storageMode);
}

View File

@ -199,6 +199,7 @@ private:
bool m_isUpdated;
QString m_searchInfoPath;
QString m_searchKeyword;
QStringList m_saveListPath;
Q_SIGNALS:
// 提供dbus服务
void sigConnected(QString);

View File

@ -76,11 +76,11 @@ void MobileStorageWidget::initUI()
retreatButton->setFlat(true);
retreatButton->setCursor(Qt::PointingHandCursor);
// QPushButton *forwardButton = new QPushButton(this);
// forwardButton->setIcon(QIcon::fromTheme("go-next-symbolic"));
// forwardButton->setFixedSize(16, 16);
// forwardButton->setFlat(true);
// forwardButton->setCursor(Qt::PointingHandCursor);
QPushButton *forwardButton = new QPushButton(this);
forwardButton->setIcon(QIcon::fromTheme("go-next-symbolic"));
forwardButton->setFixedSize(16, 16);
forwardButton->setFlat(true);
forwardButton->setCursor(Qt::PointingHandCursor);
QFont font;
font.setBold(true);
@ -143,7 +143,7 @@ void MobileStorageWidget::initUI()
refreshButton->setFlat(true);
fileListHLayout->addWidget(retreatButton);
// fileListHLayout->addWidget(forwardButton);
fileListHLayout->addWidget(forwardButton);
// fileListHLayout->addSpacing(28);
fileListHLayout->addWidget(crumb);
fileListHLayout->addStretch();
@ -195,12 +195,22 @@ void MobileStorageWidget::initUI()
this->setBackgroundRole(QPalette::Base);
connect(retreatButton, &QPushButton::clicked, this, [=]() {
QString indexPath;
for (int i = 2; i < crumb->currentIndex() + 1; i++) {
indexPath += "/" + crumb->tabText(i);
}
Q_EMIT sigForwardButtonEnabled(indexPath);
int currentIndex = crumb->currentIndex();
if (currentIndex > 0) {
crumb->setCurrentIndex(currentIndex - 1);
}
});
connect(forwardButton, &QPushButton::clicked, this, [=]() {
Q_EMIT sigForwardButtonClicked();
});
connect(refreshButton, &QPushButton::clicked, this, [=]() {
for (int i = 2; i < crumb->currentIndex() + 1; i++) {
m_currentIndexPath += "/" + crumb->tabText(i);
@ -250,7 +260,6 @@ void MobileStorageWidget::initUI()
}
slotHideCopyToComputerWidget();
//当前索引路径 刷新界面
Q_EMIT sigCurrentIndexPath(m_currentIndexPath);
}
@ -279,11 +288,11 @@ void MobileStorageWidget::initPcUI()
retreatButton->setFlat(true);
retreatButton->setCursor(Qt::PointingHandCursor);
// QPushButton *forwardButton = new QPushButton(this);
// forwardButton->setIcon(QIcon::fromTheme("go-next-symbolic"));
// forwardButton->setFixedSize(16, 16);
// forwardButton->setFlat(true);
// forwardButton->setCursor(Qt::PointingHandCursor);
QPushButton *forwardButton = new QPushButton(this);
forwardButton->setIcon(QIcon::fromTheme("go-next-symbolic"));
forwardButton->setFixedSize(16, 16);
forwardButton->setFlat(true);
forwardButton->setCursor(Qt::PointingHandCursor);
QFont font;
font.setBold(true);
@ -339,7 +348,7 @@ void MobileStorageWidget::initPcUI()
fileListHLayout->addWidget(retreatButton);
fileListHLayout->addSpacing(20);
// fileListHLayout->addWidget(forwardButton);
fileListHLayout->addWidget(forwardButton);
// fileListHLayout->addSpacing(28);
fileListHLayout->addWidget(crumb);
fileListHLayout->addStretch();
@ -387,16 +396,27 @@ void MobileStorageWidget::initPcUI()
this->setBackgroundRole(QPalette::Base);
connect(retreatButton, &QPushButton::clicked, this, [=]() {
QString indexPath;
for (int i = 0; i < crumb->currentIndex() + 1; i++) {
indexPath += "/" + crumb->tabText(i);
}
Q_EMIT sigForwardButtonEnabled(indexPath);
int currentIndex = crumb->currentIndex();
if (currentIndex > 0) {
crumb->setCurrentIndex(currentIndex - 1);
}
});
connect(forwardButton, &QPushButton::clicked, this, [=]() {
Q_EMIT sigForwardButtonClicked();
});
connect(refreshButton, &QPushButton::clicked, this, [=]() {
for (int i = 2; i < crumb->currentIndex() + 1; i++) {
m_currentIndexPath += "/" + crumb->tabText(i);
for (int i = 0; i < crumb->currentIndex() + 1; i++) {
m_currentIndexPath += crumb->tabText(i);
}
Q_EMIT sigUpdateClicked(m_currentIndexPath);
});

View File

@ -64,6 +64,8 @@ Q_SIGNALS:
void sigSearchInitFail();
void sigSearchInstalled(bool isUpdated, QString searchInfoPath);
void sigSearchKeyword(QString query);
void sigForwardButtonEnabled(QString indexPath);
void sigForwardButtonClicked();
private:
MobileStorageViewWidget *m_mobileStorageViewWidget = nullptr;