mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 07:35:41 +08:00
Ref T180, setup loading dialog
* UI adjustments, style sheet * use connectOnce for QFileSystemModel::directoryLoaded
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
#include "blackmisc/settingscache.h"
|
#include "blackmisc/settingscache.h"
|
||||||
#include "blackmisc/datacache.h"
|
#include "blackmisc/datacache.h"
|
||||||
#include "blackmisc/logmessage.h"
|
#include "blackmisc/logmessage.h"
|
||||||
|
#include "blackmisc/slot.h"
|
||||||
|
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
#include <QFileInfoList>
|
#include <QFileInfoList>
|
||||||
@@ -179,9 +180,9 @@ namespace BlackGui
|
|||||||
void CCopyConfigurationComponent::initCurrentDirectories(bool preselectMissingOrOutdated)
|
void CCopyConfigurationComponent::initCurrentDirectories(bool preselectMissingOrOutdated)
|
||||||
{
|
{
|
||||||
const QString destinationDir = this->getThisVersionDirectory(); // cache or settings dir
|
const QString destinationDir = this->getThisVersionDirectory(); // cache or settings dir
|
||||||
if (this->m_initializedDestinationDir != destinationDir)
|
if (m_initializedDestinationDir != destinationDir)
|
||||||
{
|
{
|
||||||
this->m_initializedDestinationDir = destinationDir;
|
m_initializedDestinationDir = destinationDir;
|
||||||
const QDir thisVersionDirectory(destinationDir);
|
const QDir thisVersionDirectory(destinationDir);
|
||||||
if (!thisVersionDirectory.exists())
|
if (!thisVersionDirectory.exists())
|
||||||
{
|
{
|
||||||
@@ -204,7 +205,9 @@ namespace BlackGui
|
|||||||
destinationModel->setNameFilters(this->getSourceFileFilter());
|
destinationModel->setNameFilters(this->getSourceFileFilter());
|
||||||
ui->tv_Destination->setModel(destinationModel);
|
ui->tv_Destination->setModel(destinationModel);
|
||||||
ui->tv_Destination->setSortingEnabled(true);
|
ui->tv_Destination->setSortingEnabled(true);
|
||||||
connect(destinationModel, &QFileSystemModel::directoryLoaded, this, [ = ](const QString & path)
|
|
||||||
|
// disconnect when done, there have been problems that the lambda was called when the view was already destroyed
|
||||||
|
connectOnce(destinationModel, &QFileSystemModel::directoryLoaded, this, [ = ](const QString & path)
|
||||||
{
|
{
|
||||||
Q_UNUSED(path);
|
Q_UNUSED(path);
|
||||||
ui->tv_Destination->resizeColumnToContents(0);
|
ui->tv_Destination->resizeColumnToContents(0);
|
||||||
@@ -217,9 +220,9 @@ namespace BlackGui
|
|||||||
|
|
||||||
// source
|
// source
|
||||||
const QString sourceDir = this->getOtherVersionsSelectedDirectory();
|
const QString sourceDir = this->getOtherVersionsSelectedDirectory();
|
||||||
if (this->m_initializedSourceDir != sourceDir)
|
if (m_initializedSourceDir != sourceDir)
|
||||||
{
|
{
|
||||||
this->m_initializedSourceDir = sourceDir;
|
m_initializedSourceDir = sourceDir;
|
||||||
QFileSystemModel *sourceModel = qobject_cast<QFileSystemModel *>(ui->tv_Source->model());
|
QFileSystemModel *sourceModel = qobject_cast<QFileSystemModel *>(ui->tv_Source->model());
|
||||||
if (!sourceModel)
|
if (!sourceModel)
|
||||||
{
|
{
|
||||||
@@ -229,7 +232,7 @@ namespace BlackGui
|
|||||||
sourceModel->setNameFilters(this->getSourceFileFilter());
|
sourceModel->setNameFilters(this->getSourceFileFilter());
|
||||||
ui->tv_Source->setModel(sourceModel);
|
ui->tv_Source->setModel(sourceModel);
|
||||||
ui->tv_Source->setSortingEnabled(true); // hide/disable only
|
ui->tv_Source->setSortingEnabled(true); // hide/disable only
|
||||||
connect(sourceModel, &QFileSystemModel::directoryLoaded, this, [ = ](const QString & path)
|
connectOnce(sourceModel, &QFileSystemModel::directoryLoaded, this, [ = ](const QString & path)
|
||||||
{
|
{
|
||||||
Q_UNUSED(path);
|
Q_UNUSED(path);
|
||||||
ui->tv_Source->resizeColumnToContents(0);
|
ui->tv_Source->resizeColumnToContents(0);
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ namespace BlackGui
|
|||||||
if (!sApp || sApp->isShuttingDown()) { return; }
|
if (!sApp || sApp->isShuttingDown()) { return; }
|
||||||
if (!this->hasSetupReader()) { return; }
|
if (!this->hasSetupReader()) { return; }
|
||||||
sApp->getSetupReader()->prefillCacheWithLocalResourceBootstrapFile();
|
sApp->getSetupReader()->prefillCacheWithLocalResourceBootstrapFile();
|
||||||
|
this->displaySetupCacheInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSetupLoadingDialog::displaySetupCacheInfo()
|
void CSetupLoadingDialog::displaySetupCacheInfo()
|
||||||
|
|||||||
@@ -36,7 +36,10 @@
|
|||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="fr_Details">
|
<widget class="QGroupBox" name="gb_Details">
|
||||||
|
<property name="title">
|
||||||
|
<string>Setup and caches</string>
|
||||||
|
</property>
|
||||||
<layout class="QGridLayout" name="gl_Details" columnstretch="0,3,0,0,0">
|
<layout class="QGridLayout" name="gl_Details" columnstretch="0,3,0,0,0">
|
||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
@@ -49,18 +52,14 @@
|
|||||||
</property>
|
</property>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QLineEdit" name="le_SetupCache">
|
<widget class="QLineEdit" name="le_SetupCache">
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string>Timestamp of the setup cache.</string>
|
||||||
|
</property>
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="2">
|
|
||||||
<widget class="QPushButton" name="pb_LoadFromDisk">
|
|
||||||
<property name="text">
|
|
||||||
<string> load from disk </string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="lbl_CmdLine">
|
<widget class="QLabel" name="lbl_CmdLine">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -70,6 +69,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="2" column="4">
|
<item row="2" column="4">
|
||||||
<widget class="QLineEdit" name="le_BootstrapMode">
|
<widget class="QLineEdit" name="le_BootstrapMode">
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string><html><head/><body><p>The mode, implicit means no URL is provided and the value is obtained from an existing setup.</p></body></html></string>
|
||||||
|
</property>
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -77,6 +79,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="1" column="1" colspan="4">
|
<item row="1" column="1" colspan="4">
|
||||||
<widget class="QLineEdit" name="le_CmdLine">
|
<widget class="QLineEdit" name="le_CmdLine">
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string>The command line.</string>
|
||||||
|
</property>
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -101,6 +106,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QLineEdit" name="le_BootstrapUrl">
|
<widget class="QLineEdit" name="le_BootstrapUrl">
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string><html><head/><body><p>The bootstrap URL provided by command line options. This is where the setup data are loaded from.</p></body></html></string>
|
||||||
|
</property>
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -133,23 +141,39 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="2">
|
||||||
|
<widget class="QPushButton" name="pb_LoadFromDisk">
|
||||||
|
<property name="text">
|
||||||
|
<string> load from disk </string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="BlackGui::Components::CLogComponent" name="comp_Messages">
|
<widget class="QGroupBox" name="gb_Log">
|
||||||
<property name="sizePolicy">
|
<property name="title">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
<string>Log messages</string>
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>200</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="vl_LogMessages">
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::Components::CLogComponent" name="comp_Messages">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>200</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
@@ -77,6 +77,20 @@ BlackGui--Components--CCopyConfigurationComponent {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* setup load dialog */
|
||||||
|
BlackGui--Components--CSetupLoadingDialog {
|
||||||
|
background: black; /* background is background color here */
|
||||||
|
background-image: url(:/textures/icons/textures/texture-inner.jpg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* setup load dialog details frame */
|
||||||
|
/*
|
||||||
|
BlackGui--Components--CSetupLoadingDialog #fr_Details {
|
||||||
|
background-image: url(:/textures/icons/textures/texture-outer.jpg);
|
||||||
|
background-color: darkslategray;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
QFileDialog #sidebar {
|
QFileDialog #sidebar {
|
||||||
background: black;
|
background: black;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user