mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-19 01:22:20 +08:00
添加了Debian使用的几种包管理器
This commit is contained in:
parent
28e2c0d082
commit
f655d0d94d
@ -18,6 +18,9 @@ class SpkPkgMgrApt : public SpkPkgMgrBase
|
|||||||
// APT backend specific
|
// APT backend specific
|
||||||
bool ChangeServerRepository(QString content);
|
bool ChangeServerRepository(QString content);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void CheckInstallerAvailability();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QAction *mActAptitudeTerm,
|
QAction *mActAptitudeTerm,
|
||||||
*mActAptTerm,
|
*mActAptTerm,
|
||||||
|
@ -8,6 +8,15 @@ SpkPkgMgrApt::SpkPkgMgrApt(QObject *parent) :
|
|||||||
mActDesc = new QAction("Debian APT", this);
|
mActDesc = new QAction("Debian APT", this);
|
||||||
mActDesc->setDisabled(true);
|
mActDesc->setDisabled(true);
|
||||||
|
|
||||||
|
mActAptTerm = new QAction(tr("APT (in terminal)"), this);
|
||||||
|
mActAptitudeTerm = new QAction(tr("Aptitude (in terminal)"), this);
|
||||||
|
mActGdebi = new QAction(tr("GDebi"), this);
|
||||||
|
mActDeepinPkgInst = new QAction(tr("Deepin Package Installer"), this);
|
||||||
|
|
||||||
|
mMenu->addAction(mActAptTerm);
|
||||||
|
mMenu->addAction(mActAptitudeTerm);
|
||||||
|
mMenu->addAction(mActGdebi);
|
||||||
|
mMenu->addAction(mActDeepinPkgInst);
|
||||||
mMenu->addSeparator();
|
mMenu->addSeparator();
|
||||||
mMenu->addAction(mActDesc);
|
mMenu->addAction(mActDesc);
|
||||||
}
|
}
|
||||||
@ -15,13 +24,21 @@ SpkPkgMgrApt::SpkPkgMgrApt(QObject *parent) :
|
|||||||
bool SpkPkgMgrApt::DetectRequirements()
|
bool SpkPkgMgrApt::DetectRequirements()
|
||||||
{
|
{
|
||||||
return QFile::exists("/usr/bin/apt") &&
|
return QFile::exists("/usr/bin/apt") &&
|
||||||
QFile::exists("/etc/apt/apt.conf");
|
QFile::exists("/usr/bin/dpkg");
|
||||||
}
|
}
|
||||||
|
|
||||||
SpkPkgMgrBase::PkgInstallResult
|
SpkPkgMgrBase::PkgInstallResult
|
||||||
SpkPkgMgrApt::ExecuteInstallation(QString pkgPath, int entryId)
|
SpkPkgMgrApt::ExecuteInstallation(QString pkgPath, int entryId)
|
||||||
{
|
{
|
||||||
|
CheckInstallerAvailability();
|
||||||
return SpkPkgMgrBase::ExecuteInstallation(pkgPath, entryId);
|
return SpkPkgMgrBase::ExecuteInstallation(pkgPath, entryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SpkPkgMgrApt::CheckInstallerAvailability()
|
||||||
|
{
|
||||||
|
mActAptitudeTerm->setEnabled(QFile::exists("/usr/bin/aptitude"));
|
||||||
|
mActGdebi->setEnabled(QFile::exists("/usr/bin/gdebi"));
|
||||||
|
mActDeepinPkgInst->setEnabled(QFile::exists("/usr/bin/deepin-deb-installer"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user