2014-11-13 19:30:51 +02:00
|
|
|
|
/***************************************************************************
|
|
|
|
|
* Copyright (C) 2006-2007 by Stephen Leaf *
|
|
|
|
|
* smileaf@gmail.com *
|
|
|
|
|
* Copyright (C) 2008 by Montel Laurent <montel@kde.org> *
|
|
|
|
|
* *
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
|
* (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
|
* along with this program; if not, write to the *
|
|
|
|
|
* Free Software Foundation, Inc., *
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "autostart.h"
|
|
|
|
|
#include "autostartitem.h"
|
|
|
|
|
#include "advanceddialog.h"
|
|
|
|
|
|
|
|
|
|
#include <QDir>
|
|
|
|
|
#include <QTreeWidget>
|
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
|
|
#include <KLocale>
|
|
|
|
|
#include <KConfig>
|
|
|
|
|
#include <KConfigGroup>
|
|
|
|
|
#include <KGlobalSettings>
|
|
|
|
|
#include <KShell>
|
|
|
|
|
#include <KStandardDirs>
|
|
|
|
|
#include <KOpenWithDialog>
|
|
|
|
|
#include <KPropertiesDialog>
|
|
|
|
|
#include <KDesktopFile>
|
|
|
|
|
#include <KMessageBox>
|
|
|
|
|
#include <KAboutData>
|
|
|
|
|
#include <KDebug>
|
|
|
|
|
#include <KIO/NetAccess>
|
|
|
|
|
#include <KIO/DeleteJob>
|
|
|
|
|
#include <KIO/CopyJob>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
K_PLUGIN_FACTORY(AutostartFactory, registerPlugin<Autostart>();)
|
|
|
|
|
K_EXPORT_PLUGIN(AutostartFactory( "kcmautostart", "kcm_autostart" ))
|
|
|
|
|
|
|
|
|
|
Autostart::Autostart( QWidget* parent, const QVariantList& )
|
|
|
|
|
: KCModule( AutostartFactory::componentData(), parent )
|
|
|
|
|
{
|
|
|
|
|
widget = new Ui_AutostartConfig();
|
|
|
|
|
widget->setupUi(this);
|
|
|
|
|
|
|
|
|
|
QStringList lstHeader;
|
|
|
|
|
lstHeader << i18n( "Name" )
|
|
|
|
|
<< i18n( "Command" )
|
2021-08-04 13:51:48 +03:00
|
|
|
|
<< i18n( "Status" );
|
2014-11-13 19:30:51 +02:00
|
|
|
|
widget->listCMD->setHeaderLabels(lstHeader);
|
|
|
|
|
widget->listCMD->setFocus();
|
|
|
|
|
|
|
|
|
|
setButtons(Help);
|
|
|
|
|
|
|
|
|
|
connect( widget->btnAddProgram, SIGNAL(clicked()), SLOT(slotAddProgram()) );
|
|
|
|
|
connect( widget->btnRemove, SIGNAL(clicked()), SLOT(slotRemoveCMD()) );
|
|
|
|
|
connect( widget->btnAdvanced, SIGNAL(clicked()), SLOT(slotAdvanced()) );
|
|
|
|
|
connect( widget->listCMD, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), SLOT(slotEditCMD(QTreeWidgetItem*)) );
|
|
|
|
|
connect( widget->listCMD, SIGNAL(itemClicked(QTreeWidgetItem*,int)),this,SLOT(slotItemClicked(QTreeWidgetItem*,int)) );
|
|
|
|
|
connect( widget->btnProperties, SIGNAL(clicked()), SLOT(slotEditCMD()) );
|
|
|
|
|
connect( widget->listCMD, SIGNAL(itemSelectionChanged()), SLOT(slotSelectionChanged()) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
KAboutData* about = new KAboutData("Autostart", 0, ki18n("KDE Autostart Manager"), "1.0",
|
|
|
|
|
ki18n("KDE Autostart Manager Control Panel Module"),
|
|
|
|
|
KAboutData::License_GPL,
|
|
|
|
|
ki18n("Copyright © 2006–2010 Autostart Manager team"));
|
|
|
|
|
about->addAuthor(ki18n("Stephen Leaf"), KLocalizedString(), "smileaf@gmail.com");
|
2022-11-04 07:43:12 +02:00
|
|
|
|
about->addAuthor(ki18n("Montel Laurent"), KLocalizedString(), "montel@kde.org");
|
|
|
|
|
about->addAuthor(ki18n("Ivailo Monev"), ki18n( "Maintainer" ), "xakepa10@gmail.com");
|
2014-11-13 19:30:51 +02:00
|
|
|
|
setAboutData( about );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Autostart::~Autostart()
|
|
|
|
|
{
|
|
|
|
|
delete widget;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-11-04 12:47:53 +02:00
|
|
|
|
void Autostart::slotItemClicked(QTreeWidgetItem *item, int col)
|
2014-11-13 19:30:51 +02:00
|
|
|
|
{
|
|
|
|
|
if ( item && col == COL_STATUS ) {
|
2022-11-04 12:47:53 +02:00
|
|
|
|
AutoStartItem *entry = dynamic_cast<AutoStartItem*>(item);
|
|
|
|
|
if (entry) {
|
|
|
|
|
bool disable = (item->checkState(col) == Qt::Unchecked );
|
2014-11-13 19:30:51 +02:00
|
|
|
|
KDesktopFile kc(entry->fileName().path());
|
|
|
|
|
KConfigGroup grp = kc.desktopGroup();
|
2022-11-04 12:47:53 +02:00
|
|
|
|
if (grp.hasKey("Hidden") && !disable) {
|
|
|
|
|
grp.deleteEntry("Hidden");
|
|
|
|
|
} else {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
grp.writeEntry("Hidden", disable);
|
2022-11-04 12:47:53 +02:00
|
|
|
|
}
|
2014-11-13 19:30:51 +02:00
|
|
|
|
|
|
|
|
|
kc.sync();
|
2022-11-04 12:47:53 +02:00
|
|
|
|
if (disable) {
|
|
|
|
|
item->setText(COL_STATUS, i18nc("The program won't be run", "Disabled"));
|
|
|
|
|
} else {
|
|
|
|
|
item->setText(COL_STATUS, i18nc("The program will be run", "Enabled"));
|
|
|
|
|
}
|
2014-11-13 19:30:51 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-04 12:47:53 +02:00
|
|
|
|
void Autostart::addItem(AutoStartItem* item, const QString& name, const QString& command, bool disabled)
|
2014-11-13 19:30:51 +02:00
|
|
|
|
{
|
|
|
|
|
Q_ASSERT( item );
|
2022-11-04 08:19:26 +02:00
|
|
|
|
item->setText(COL_NAME, name);
|
|
|
|
|
item->setText(COL_COMMAND, command);
|
|
|
|
|
item->setCheckState( COL_STATUS, disabled ? Qt::Unchecked : Qt::Checked);
|
|
|
|
|
item->setText(COL_STATUS, disabled ? i18nc("The program won't be run", "Disabled") : i18nc("The program will be run", "Enabled"));
|
|
|
|
|
|
|
|
|
|
// It is important to ensure that we make an exact copy of an existing
|
|
|
|
|
// desktop file (if selected) to enable users to override global autostarts.
|
|
|
|
|
// Also see:
|
|
|
|
|
// https://bugs.launchpad.net/ubuntu/+source/kde-workspace/+bug/923360
|
|
|
|
|
//
|
|
|
|
|
// However, if program that has non-local .desktop file is uninstalled the
|
|
|
|
|
// local autostart .desktop will be invalid which is why it is not done and
|
|
|
|
|
// if the file is not writable it is simply disabled
|
|
|
|
|
const QFileInfo fileinfo(item->fileName().path());
|
|
|
|
|
item->setDisabled(!fileinfo.isWritable());
|
2014-11-13 19:30:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Autostart::load()
|
|
|
|
|
{
|
|
|
|
|
// share/autostart may *only* contain .desktop files
|
2022-11-04 09:21:28 +02:00
|
|
|
|
m_paths << componentData().dirs()->resourceDirs("autostart"); //xdg-config autostart dir
|
2014-11-13 19:30:51 +02:00
|
|
|
|
|
|
|
|
|
widget->listCMD->clear();
|
|
|
|
|
|
2022-11-04 12:47:53 +02:00
|
|
|
|
m_programItem = new QTreeWidgetItem(widget->listCMD);
|
2022-11-04 08:19:26 +02:00
|
|
|
|
m_programItem->setText(0, i18n( "Desktop File"));
|
|
|
|
|
m_programItem->setFlags(m_programItem->flags() ^ Qt::ItemIsSelectable);
|
2014-11-13 19:30:51 +02:00
|
|
|
|
|
|
|
|
|
QFont boldFont = m_programItem->font(0);
|
2022-11-04 08:19:26 +02:00
|
|
|
|
boldFont.setBold(true);
|
|
|
|
|
m_programItem->setData(0, Qt::FontRole, boldFont);
|
2014-11-13 19:30:51 +02:00
|
|
|
|
|
2022-11-04 08:19:26 +02:00
|
|
|
|
widget->listCMD->expandItem(m_programItem);
|
2014-11-13 19:30:51 +02:00
|
|
|
|
|
|
|
|
|
foreach (const QString& path, m_paths) {
|
2024-05-05 02:04:33 +03:00
|
|
|
|
if (!KStandardDirs::exists(path)) {
|
2022-11-04 07:43:12 +02:00
|
|
|
|
continue;
|
|
|
|
|
}
|
2014-11-13 19:30:51 +02:00
|
|
|
|
|
|
|
|
|
QDir autostartdir( path );
|
|
|
|
|
autostartdir.setFilter( QDir::Files );
|
|
|
|
|
const QFileInfoList list = autostartdir.entryInfoList();
|
|
|
|
|
for (int i = 0; i < list.size(); ++i) {
|
|
|
|
|
QFileInfo fi = list.at(i);
|
|
|
|
|
QString filename = fi.fileName();
|
|
|
|
|
bool desktopFile = filename.endsWith(".desktop");
|
2022-11-04 12:47:53 +02:00
|
|
|
|
if (desktopFile) {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
KDesktopFile config(fi.absoluteFilePath());
|
2022-11-04 08:19:26 +02:00
|
|
|
|
// kDebug() << fi.absoluteFilePath() << "trying" << config.desktopGroup().readEntry("Exec");
|
2014-11-13 19:30:51 +02:00
|
|
|
|
QStringList commandLine = KShell::splitArgs(config.desktopGroup().readEntry("Exec"));
|
|
|
|
|
if (commandLine.isEmpty()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QString exe = commandLine.first();
|
|
|
|
|
if (exe.isEmpty() || KStandardDirs::findExe(exe).isEmpty()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-04 12:47:53 +02:00
|
|
|
|
AutoStartItem *item = new AutoStartItem(fi.absoluteFilePath(), m_programItem);
|
2014-11-13 19:30:51 +02:00
|
|
|
|
|
|
|
|
|
const KConfigGroup grp = config.desktopGroup();
|
|
|
|
|
const bool hidden = grp.readEntry("Hidden", false);
|
|
|
|
|
const QStringList notShowList = grp.readXdgListEntry("NotShowIn");
|
|
|
|
|
const QStringList onlyShowList = grp.readXdgListEntry("OnlyShowIn");
|
|
|
|
|
|
|
|
|
|
const bool disabled = hidden ||
|
|
|
|
|
notShowList.contains("KDE") ||
|
|
|
|
|
(!onlyShowList.isEmpty() && !onlyShowList.contains("KDE"));
|
|
|
|
|
|
2022-11-04 12:47:53 +02:00
|
|
|
|
int indexPath = m_paths.indexOf(item->fileName().directory() + '/');
|
|
|
|
|
if (indexPath > 0) {
|
2022-11-04 07:43:12 +02:00
|
|
|
|
indexPath = 0; // .config/autostart load destkop at startup
|
2022-11-04 12:47:53 +02:00
|
|
|
|
}
|
|
|
|
|
addItem(item, config.readName(), grp.readEntry("Exec"), disabled);
|
2014-11-13 19:30:51 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-11-04 08:19:26 +02:00
|
|
|
|
// Update button
|
2014-11-13 19:30:51 +02:00
|
|
|
|
slotSelectionChanged();
|
|
|
|
|
widget->listCMD->resizeColumnToContents(COL_NAME);
|
2022-11-04 08:19:26 +02:00
|
|
|
|
// widget->listCMD->resizeColumnToContents(COL_COMMAND);
|
2014-11-13 19:30:51 +02:00
|
|
|
|
widget->listCMD->resizeColumnToContents(COL_STATUS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Autostart::slotAddProgram()
|
|
|
|
|
{
|
|
|
|
|
KOpenWithDialog owdlg( this );
|
2022-11-04 12:47:53 +02:00
|
|
|
|
if (owdlg.exec() != QDialog::Accepted) {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
return;
|
2022-11-04 12:47:53 +02:00
|
|
|
|
}
|
2014-11-13 19:30:51 +02:00
|
|
|
|
|
|
|
|
|
KService::Ptr service = owdlg.service();
|
|
|
|
|
|
|
|
|
|
Q_ASSERT(service);
|
|
|
|
|
if (!service) {
|
|
|
|
|
return; // Don't crash if KOpenWith wasn't able to create service.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString desktopPath;
|
|
|
|
|
KUrl desktopTemplate;
|
2022-11-04 08:07:16 +02:00
|
|
|
|
const QString localautostartdir = KGlobal::dirs()->saveLocation("autostart");
|
|
|
|
|
if (service->desktopEntryName().isEmpty() ) {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
// Build custom desktop file (e.g. when the user entered an executable
|
|
|
|
|
// name in the OpenWithDialog).
|
2022-11-04 08:07:16 +02:00
|
|
|
|
desktopPath = localautostartdir + service->name() + ".desktop";
|
|
|
|
|
desktopTemplate = KUrl(desktopPath);
|
2014-11-13 19:30:51 +02:00
|
|
|
|
KConfig kc(desktopTemplate.path(), KConfig::SimpleConfig);
|
|
|
|
|
KConfigGroup kcg = kc.group("Desktop Entry");
|
2022-11-04 11:48:13 +02:00
|
|
|
|
kcg.writeEntry("Name", service->exec());
|
|
|
|
|
kcg.writeEntry("Exec", service->exec());
|
2022-11-04 08:07:16 +02:00
|
|
|
|
kcg.writeEntry("Icon", "system-run");
|
|
|
|
|
kcg.writeEntry("Path", "");
|
|
|
|
|
kcg.writeEntry("Terminal", false);
|
|
|
|
|
kcg.writeEntry("Type", "Application");
|
2014-11-13 19:30:51 +02:00
|
|
|
|
kc.sync();
|
|
|
|
|
|
2022-11-04 08:07:16 +02:00
|
|
|
|
KPropertiesDialog dlg(desktopTemplate, this);
|
|
|
|
|
if (dlg.exec() != QDialog::Accepted) {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
2022-11-04 08:07:16 +02:00
|
|
|
|
} else {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
// Use existing desktop file and use same file name to enable overrides.
|
2022-11-04 08:07:16 +02:00
|
|
|
|
desktopPath = localautostartdir + service->desktopEntryName() + ".desktop";
|
2014-11-13 19:30:51 +02:00
|
|
|
|
desktopTemplate = KUrl( KStandardDirs::locate("apps", service->entryPath()) );
|
|
|
|
|
|
2022-11-04 08:07:16 +02:00
|
|
|
|
KPropertiesDialog dlg( desktopTemplate, KUrl(localautostartdir), service->desktopEntryName() + ".desktop", this );
|
|
|
|
|
if (dlg.exec() != QDialog::Accepted) {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
return;
|
2022-11-04 08:07:16 +02:00
|
|
|
|
}
|
2014-11-13 19:30:51 +02:00
|
|
|
|
}
|
2022-11-04 12:47:53 +02:00
|
|
|
|
AutoStartItem * item = new AutoStartItem(desktopPath, m_programItem);
|
2022-11-04 11:48:13 +02:00
|
|
|
|
addItem(item, service->name(), service->exec(), false);
|
2014-11-13 19:30:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Autostart::slotRemoveCMD()
|
|
|
|
|
{
|
|
|
|
|
QTreeWidgetItem* item = widget->listCMD->currentItem();
|
2022-11-04 08:19:26 +02:00
|
|
|
|
if (!item) {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
return;
|
2022-11-04 08:19:26 +02:00
|
|
|
|
}
|
2022-11-04 12:47:53 +02:00
|
|
|
|
AutoStartItem *startItem = dynamic_cast<AutoStartItem*>(item);
|
2022-11-04 08:19:26 +02:00
|
|
|
|
if (startItem) {
|
|
|
|
|
m_programItem->takeChild(m_programItem->indexOfChild(startItem));
|
2022-11-04 07:44:58 +02:00
|
|
|
|
KIO::DeleteJob* deljob = KIO::del(startItem->fileName().path());
|
|
|
|
|
deljob->setAutoDelete(false);
|
|
|
|
|
if (!deljob->exec()) {
|
|
|
|
|
KMessageBox::detailedError(
|
|
|
|
|
this,
|
2022-11-04 12:47:53 +02:00
|
|
|
|
i18n("Could not remove the autostart file."),
|
2022-11-04 07:44:58 +02:00
|
|
|
|
deljob->errorString()
|
|
|
|
|
);
|
|
|
|
|
delete deljob;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
delete deljob;
|
2014-11-13 19:30:51 +02:00
|
|
|
|
delete item;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Autostart::slotEditCMD(QTreeWidgetItem* ent)
|
|
|
|
|
{
|
|
|
|
|
if (!ent) return;
|
|
|
|
|
AutoStartItem *entry = dynamic_cast<AutoStartItem*>( ent );
|
2022-11-04 08:19:26 +02:00
|
|
|
|
if (entry) {
|
|
|
|
|
const KFileItem kfi = KFileItem( KFileItem::Unknown, KFileItem::Unknown, KUrl(entry->fileName()), true);
|
|
|
|
|
if (!slotEditCMD(kfi)) {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
return;
|
2022-11-04 08:19:26 +02:00
|
|
|
|
}
|
2022-11-04 12:47:53 +02:00
|
|
|
|
|
|
|
|
|
KService service(entry->fileName().path());
|
|
|
|
|
addItem(entry, service.name(), service.exec(), false);
|
2014-11-13 19:30:51 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-04 08:19:26 +02:00
|
|
|
|
bool Autostart::slotEditCMD(const KFileItem &item)
|
2014-11-13 19:30:51 +02:00
|
|
|
|
{
|
2022-11-04 08:19:26 +02:00
|
|
|
|
KPropertiesDialog dlg(item, this);
|
|
|
|
|
return (dlg.exec() == QDialog::Accepted);
|
2014-11-13 19:30:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Autostart::slotEditCMD()
|
|
|
|
|
{
|
2022-11-04 08:19:26 +02:00
|
|
|
|
if (widget->listCMD->currentItem() == 0) {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
return;
|
2022-11-04 08:19:26 +02:00
|
|
|
|
}
|
|
|
|
|
slotEditCMD((AutoStartItem*)widget->listCMD->currentItem());
|
2014-11-13 19:30:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Autostart::slotAdvanced()
|
|
|
|
|
{
|
2022-11-04 08:19:26 +02:00
|
|
|
|
if (widget->listCMD->currentItem() == 0) {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
return;
|
2022-11-04 08:19:26 +02:00
|
|
|
|
}
|
2014-11-13 19:30:51 +02:00
|
|
|
|
|
2022-11-04 12:47:53 +02:00
|
|
|
|
AutoStartItem *entry = static_cast<AutoStartItem *>(widget->listCMD->currentItem());
|
2014-11-13 19:30:51 +02:00
|
|
|
|
KDesktopFile kc(entry->fileName().path());
|
|
|
|
|
KConfigGroup grp = kc.desktopGroup();
|
|
|
|
|
bool status = false;
|
|
|
|
|
QStringList lstEntry;
|
2022-11-04 08:19:26 +02:00
|
|
|
|
if (grp.hasKey("OnlyShowIn")) {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
lstEntry = grp.readXdgListEntry("OnlyShowIn");
|
|
|
|
|
status = lstEntry.contains("KDE");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AdvancedDialog *dlg = new AdvancedDialog( this,status );
|
2022-11-04 08:19:26 +02:00
|
|
|
|
if (dlg->exec()) {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
status = dlg->onlyInKde();
|
2022-11-04 08:19:26 +02:00
|
|
|
|
if (lstEntry.contains( "KDE" ) && !status) {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
lstEntry.removeAll( "KDE" );
|
2022-11-04 08:19:26 +02:00
|
|
|
|
grp.writeXdgListEntry( "OnlyShowIn", lstEntry);
|
|
|
|
|
} else if (!lstEntry.contains( "KDE" ) && status) {
|
2014-11-13 19:30:51 +02:00
|
|
|
|
lstEntry.append( "KDE" );
|
2022-11-04 08:19:26 +02:00
|
|
|
|
grp.writeXdgListEntry("OnlyShowIn", lstEntry);
|
2014-11-13 19:30:51 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
delete dlg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Autostart::slotSelectionChanged()
|
|
|
|
|
{
|
2022-11-04 12:47:53 +02:00
|
|
|
|
const bool isDesktopItem = (dynamic_cast<AutoStartItem*>(widget->listCMD->currentItem()) != 0);
|
|
|
|
|
widget->btnRemove->setEnabled(isDesktopItem);
|
2014-11-13 19:30:51 +02:00
|
|
|
|
widget->btnProperties->setEnabled(isDesktopItem);
|
|
|
|
|
widget->btnAdvanced->setEnabled(isDesktopItem) ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Autostart::defaults()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Autostart::save()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-27 09:28:46 +00:00
|
|
|
|
#include "moc_autostart.cpp"
|