Merge branch 'dev' of gitee.com:deepin-community-store/spark-store into dev

This commit is contained in:
uniartisan 2023-01-01 11:02:04 +08:00
commit d5248f4c1b
6 changed files with 83 additions and 41 deletions

View File

@ -71,12 +71,11 @@ int main(int argc, char *argv[])
// Check UOS developer mode.
QFile UOSDevelopFile(UOSCheckFile);
if (UOSDevelopFile.exists() && isDeepinOS)
if (isDeepinOS && UOSDevelopFile.exists() && UOSDevelopFile.open(QFile::ReadOnly | QFile::Text))
{
config.setValue("UOS/isUOS", true);
QTextStream UOStextStream(&UOSDevelopFile);
QString lineData = UOStextStream.readLine();
bool devmode = lineData.toInt();
QString lineData = UOSDevelopFile.readLine();
bool devmode = lineData.trimmed().toInt();
qDebug() << "UOS Developer Mode Status:" << devmode;
config.setValue("UOS/EnableDeveloperMode", devmode);
}
@ -88,6 +87,7 @@ int main(int argc, char *argv[])
config.remove("UOS/EnableDeveloperMode");
}
}
UOSDevelopFile.close();
config.sync(); // 写入更改至 config.ini并同步最新内容
// 龙芯机器配置,使得 DApplication 能正确加载 QTWEBENGINE

View File

@ -363,7 +363,7 @@ void AppIntoPage::on_pushButton_3_clicked()
if (check.readAllStandardOutput().isEmpty())
{
ui->downloadButton->setText(tr("Install"));
ui->downloadButton->setText(tr("Download"));
ui->pushButton_3->hide();
updatesEnabled();
@ -386,11 +386,11 @@ void AppIntoPage::on_shareButton_clicked()
void AppIntoPage::on_updateButton_clicked()
{
QString feedbackSpk = "spk://store/chat/store.spark-app.feedback";
QFile actionSubmissionClientStatus("/opt/durapps/store.spark-app.feedback");
if (actionSubmissionClientStatus.exists())
QFileInfo actionSubmissionClientStatus("/opt/durapps/store.spark-app.feedback");
if (actionSubmissionClientStatus.exists() && actionSubmissionClientStatus.isDir())
{
qDebug() << "反馈器存在";
QProcess::startDetached("sh /opt/durapps/store.spark-app.feedback/launch.sh", QStringList());
QProcess::startDetached("sh", QStringList() << "/opt/durapps/store.spark-app.feedback/launch.sh");
}
else
{

View File

@ -22,6 +22,8 @@ DownloadItem::DownloadItem(QWidget *parent) : QWidget(parent),
ui->pushButton_3->hide();
ui->widget_spinner->start();
ui->widget_spinner->hide();
ui->label->setElideMode(Qt::TextElideMode::ElideRight);
}
DownloadItem::~DownloadItem()
@ -48,6 +50,7 @@ void DownloadItem::setMax(qint64 max)
void DownloadItem::setName(QString name)
{
ui->label->setText(name);
ui->label->setToolTip(name);
}
QString DownloadItem::getName()

View File

@ -7,13 +7,25 @@
<x>0</x>
<y>0</y>
<width>666</width>
<height>54</height>
<height>56</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>56</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>54</height>
<height>56</height>
</size>
</property>
<property name="windowTitle">
@ -40,10 +52,22 @@
</property>
<item>
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>48</width>
<height>48</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>48</width>
<height>16777215</height>
<height>48</height>
</size>
</property>
<property name="text">
@ -52,6 +76,9 @@
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
@ -70,6 +97,31 @@
</property>
</spacer>
</item>
<item>
<widget class="DLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>48</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>48</height>
</size>
</property>
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_filename">
<property name="maximumSize">
@ -83,33 +135,6 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<pointsize>13</pointsize>
</font>
</property>
<property name="text">
<string>Name</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
@ -153,11 +178,14 @@
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>8</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
<number>8</number>
</property>
<item>
<widget class="QProgressBar" name="progressBar">
@ -297,6 +325,11 @@
<header location="global">dspinner.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>DLabel</class>
<extends>QLabel</extends>
<header>dlabel.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>

View File

@ -91,7 +91,7 @@ void DownloadListWidget::addItem(QString name, QString fileName, QString pkgName
di->pkgName = pkgName;
di->seticon(icon);
QListWidgetItem *pItem = new QListWidgetItem();
pItem->setSizeHint(QSize(240, 50));
pItem->setSizeHint(QSize(240, 56)); // ui 中单个 downloaditem 高度固定 56px上下 margin 8px图片固定 48x48
ui->listWidget->addItem(pItem);
ui->listWidget->setItemWidget(pItem, di);
if (!isBusy)

View File

@ -85,7 +85,7 @@ QListWidget::item::selected
}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
@ -99,9 +99,15 @@ QListWidget::item::selected
<property name="autoScrollMargin">
<number>10</number>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="resizeMode">
<enum>QListView::Fixed</enum>
</property>
<property name="spacing">
<number>4</number>
</property>
</widget>
</item>
<item>