mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kio: implement interface to change the "StartupWMClass" key of .desktop files
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
1d2947b476
commit
14b62a7d3d
2 changed files with 41 additions and 2 deletions
|
@ -134,7 +134,27 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" colspan="3" >
|
<item row="1" column="0" >
|
||||||
|
<widget class="QLabel" name="startupClassLabel" >
|
||||||
|
<property name="whatsThis" >
|
||||||
|
<string>Enter the window class here.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text" >
|
||||||
|
<string>&Window class:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy" >
|
||||||
|
<cstring>startupClassEdit</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1" >
|
||||||
|
<widget class="KLineEdit" name="startupClassEdit" >
|
||||||
|
<property name="whatsThis" >
|
||||||
|
<string>Enter the window class here.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="3" >
|
||||||
<widget class="QCheckBox" name="systrayCheck" >
|
<widget class="QCheckBox" name="systrayCheck" >
|
||||||
<property name="whatsThis" >
|
<property name="whatsThis" >
|
||||||
<string>Check this option if you want to have a system tray handle for your application.</string>
|
<string>Check this option if you want to have a system tray handle for your application.</string>
|
||||||
|
@ -237,5 +257,17 @@
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>startupInfoCheck</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>startupClassEdit</receiver>
|
||||||
|
<slot>setEnabled(bool)</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>startupInfoCheck</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>startupClassLabel</receiver>
|
||||||
|
<slot>setEnabled(bool)</slot>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -3006,6 +3006,7 @@ public:
|
||||||
QString m_origCommandStr;
|
QString m_origCommandStr;
|
||||||
QString m_terminalOptionStr;
|
QString m_terminalOptionStr;
|
||||||
QString m_suidUserStr;
|
QString m_suidUserStr;
|
||||||
|
QString m_startupClassStr;
|
||||||
QString m_origDesktopFile;
|
QString m_origDesktopFile;
|
||||||
bool m_terminalBool;
|
bool m_terminalBool;
|
||||||
bool m_suidBool;
|
bool m_suidBool;
|
||||||
|
@ -3081,6 +3082,7 @@ KDesktopPropsPlugin::KDesktopPropsPlugin(KPropertiesDialog *props)
|
||||||
d->m_suidBool = config.readEntry("X-KDE-SubstituteUID", false);
|
d->m_suidBool = config.readEntry("X-KDE-SubstituteUID", false);
|
||||||
d->m_suidUserStr = config.readEntry("X-KDE-Username");
|
d->m_suidUserStr = config.readEntry("X-KDE-Username");
|
||||||
d->m_startupBool = config.readEntry("StartupNotify", false);
|
d->m_startupBool = config.readEntry("StartupNotify", false);
|
||||||
|
d->m_startupClassStr = config.readEntry("StartupWMClass", QString());
|
||||||
|
|
||||||
const QStringList mimeTypes = config.readXdgListEntry("MimeType");
|
const QStringList mimeTypes = config.readXdgListEntry("MimeType");
|
||||||
|
|
||||||
|
@ -3250,7 +3252,7 @@ void KDesktopPropsPlugin::applyChanges()
|
||||||
config.writeEntry("X-KDE-SubstituteUID", d->m_suidBool);
|
config.writeEntry("X-KDE-SubstituteUID", d->m_suidBool);
|
||||||
config.writeEntry("X-KDE-Username", d->m_suidUserStr);
|
config.writeEntry("X-KDE-Username", d->m_suidUserStr);
|
||||||
config.writeEntry("StartupNotify", d->m_startupBool);
|
config.writeEntry("StartupNotify", d->m_startupBool);
|
||||||
#warning TODO: StartupWMClass
|
config.writeEntry("StartupWMClass", d->m_startupClassStr);
|
||||||
config.sync();
|
config.sync();
|
||||||
|
|
||||||
// KSycoca update needed?
|
// KSycoca update needed?
|
||||||
|
@ -3320,6 +3322,9 @@ void KDesktopPropsPlugin::slotAdvanced()
|
||||||
w.suidEditLabel->setEnabled(d->m_suidBool);
|
w.suidEditLabel->setEnabled(d->m_suidBool);
|
||||||
|
|
||||||
w.startupInfoCheck->setChecked(d->m_startupBool);
|
w.startupInfoCheck->setChecked(d->m_startupBool);
|
||||||
|
w.startupClassEdit->setText(d->m_startupClassStr);
|
||||||
|
w.startupClassEdit->setEnabled(d->m_startupBool);
|
||||||
|
w.startupClassLabel->setEnabled(d->m_startupBool);
|
||||||
w.systrayCheck->setChecked(d->m_systrayBool);
|
w.systrayCheck->setChecked(d->m_systrayBool);
|
||||||
|
|
||||||
// Provide username completion up to 1000 users.
|
// Provide username completion up to 1000 users.
|
||||||
|
@ -3345,6 +3350,7 @@ void KDesktopPropsPlugin::slotAdvanced()
|
||||||
connect(w.suidCheck, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
|
connect(w.suidCheck, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
|
||||||
connect(w.suidEdit, SIGNAL(textChanged(QString)), this, SIGNAL(changed()) );
|
connect(w.suidEdit, SIGNAL(textChanged(QString)), this, SIGNAL(changed()) );
|
||||||
connect(w.startupInfoCheck, SIGNAL(toggled(bool)), this, SIGNAL(changed()) );
|
connect(w.startupInfoCheck, SIGNAL(toggled(bool)), this, SIGNAL(changed()) );
|
||||||
|
connect(w.startupClassEdit, SIGNAL(textChanged(QString)), this, SIGNAL(changed()) );
|
||||||
connect(w.systrayCheck, SIGNAL(toggled(bool)), this, SIGNAL(changed()) );
|
connect(w.systrayCheck, SIGNAL(toggled(bool)), this, SIGNAL(changed()) );
|
||||||
|
|
||||||
if (dlg.exec() == QDialog::Accepted) {
|
if (dlg.exec() == QDialog::Accepted) {
|
||||||
|
@ -3353,6 +3359,7 @@ void KDesktopPropsPlugin::slotAdvanced()
|
||||||
d->m_suidBool = w.suidCheck->isChecked();
|
d->m_suidBool = w.suidCheck->isChecked();
|
||||||
d->m_suidUserStr = w.suidEdit->text().trimmed();
|
d->m_suidUserStr = w.suidEdit->text().trimmed();
|
||||||
d->m_startupBool = w.startupInfoCheck->isChecked();
|
d->m_startupBool = w.startupInfoCheck->isChecked();
|
||||||
|
d->m_startupClassStr = w.startupClassEdit->text().trimmed();
|
||||||
d->m_systrayBool = w.systrayCheck->isChecked();
|
d->m_systrayBool = w.systrayCheck->isChecked();
|
||||||
|
|
||||||
if (w.terminalCloseCheck->isChecked()) {
|
if (w.terminalCloseCheck->isChecked()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue