mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-07-04 04:35:58 +08:00
添加了Debian使用的几种包管理器
This commit is contained in:
parent
28e2c0d082
commit
f655d0d94d
@ -18,6 +18,9 @@ class SpkPkgMgrApt : public SpkPkgMgrBase
|
||||
// APT backend specific
|
||||
bool ChangeServerRepository(QString content);
|
||||
|
||||
private:
|
||||
void CheckInstallerAvailability();
|
||||
|
||||
private:
|
||||
QAction *mActAptitudeTerm,
|
||||
*mActAptTerm,
|
||||
|
@ -8,6 +8,15 @@ SpkPkgMgrApt::SpkPkgMgrApt(QObject *parent) :
|
||||
mActDesc = new QAction("Debian APT", this);
|
||||
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->addAction(mActDesc);
|
||||
}
|
||||
@ -15,13 +24,21 @@ SpkPkgMgrApt::SpkPkgMgrApt(QObject *parent) :
|
||||
bool SpkPkgMgrApt::DetectRequirements()
|
||||
{
|
||||
return QFile::exists("/usr/bin/apt") &&
|
||||
QFile::exists("/etc/apt/apt.conf");
|
||||
QFile::exists("/usr/bin/dpkg");
|
||||
}
|
||||
|
||||
SpkPkgMgrBase::PkgInstallResult
|
||||
SpkPkgMgrApt::ExecuteInstallation(QString pkgPath, int entryId)
|
||||
{
|
||||
CheckInstallerAvailability();
|
||||
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