Drop KDE4Support in kde-workspace/kwin

REVIEW: 114316
This commit is contained in:
Aleix Pol 2013-12-05 20:22:31 +01:00
parent f7ff03f30b
commit f8468b4043
28 changed files with 313 additions and 273 deletions

View file

@ -33,7 +33,6 @@ target_link_libraries(kcm_kwindecoration
KF5::KCompletion
KF5::KI18n
KF5::KNewStuff
KF5::KDE4Support
)
install(TARGETS kcm_kwindecoration DESTINATION ${PLUGIN_INSTALL_DIR} )

View file

@ -36,13 +36,13 @@
#include <QApplication>
#include <QDrag>
#include <QPainter>
#include <QFontDatabase>
#include <QLabel>
#include <QLayout>
#include <QMimeData>
#include <QScrollBar>
#include <KDE/KLocalizedString>
#include <kglobalsettings.h>
#ifdef KWIN_BUILD_KAPPMENU
#include <KConfigGroup>
@ -616,7 +616,7 @@ void ButtonDropSite::paintEvent(QPaintEvent* /*pe*/)
QColor c1(palette().color(QPalette::Mid));
p.fillRect(r, c1);
p.setPen(palette().color(QPalette::WindowText));
p.setFont(KGlobalSettings::windowTitleFont());
p.setFont(QFontDatabase::systemFont(QFontDatabase::TitleFont));
p.drawText(r.adjusted(4, 0, -4, 0), Qt::AlignLeft | Qt::AlignVCenter, i18n("KDE"));
offset = geometry().width() - 3 - rightoffset;

View file

@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "kwindecoration.h"
#include <QVBoxLayout>
#include <QDialogButtonBox>
#include <KDE/KLocalizedString>
#include <kdecoration.h>
@ -35,27 +36,30 @@ KWinDecorationButtonsConfigForm::KWinDecorationButtonsConfigForm(QWidget* parent
}
KWinDecorationButtonsConfigDialog::KWinDecorationButtonsConfigDialog(DecorationButtons const *buttons, bool showTooltips, QWidget* parent, Qt::WFlags flags)
: KDialog(parent, flags)
: QDialog(parent, flags)
, m_ui(new KWinDecorationButtonsConfigForm(this))
, m_showTooltip(showTooltips)
, m_buttons(buttons)
{
m_ui = new KWinDecorationButtonsConfigForm(this);
setWindowTitle(i18n("Buttons"));
setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Default | KDialog::Reset);
enableButton(KDialog::Reset, false);
m_buttonBox = new QDialogButtonBox(this);
m_buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Reset);
m_buttonBox->button(QDialogButtonBox::RestoreDefaults)->setEnabled(false);
QVBoxLayout* layout = new QVBoxLayout;
layout->addWidget(m_buttonBox);
layout->addWidget(m_ui);
m_ui->buttonPositionWidget->setEnabled(buttons->customPositions());
QWidget* main = new QWidget(this);
main->setLayout(layout);
setMainWidget(main);
setLayout(layout);
connect(m_ui->buttonPositionWidget, SIGNAL(changed()), this, SLOT(changed()));
connect(m_ui->showToolTipsCheckBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->useCustomButtonPositionsCheckBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(this, SIGNAL(defaultClicked()), this, SLOT(slotDefaultClicked()));
connect(this, SIGNAL(resetClicked()), this, SLOT(slotResetClicked()));
connect(m_buttonBox->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked(bool)), this, SLOT(slotDefaultClicked()));
connect(m_buttonBox->button(QDialogButtonBox::Reset), SIGNAL(clicked(bool)), this, SLOT(slotResetClicked()));
connect(m_buttonBox, SIGNAL(accepted()), SLOT(accept()));
connect(m_buttonBox, SIGNAL(rejected()), SLOT(reject()));
slotResetClicked();
}
@ -86,7 +90,7 @@ QList<KDecorationDefines::DecorationButton> KWinDecorationButtonsConfigDialog::b
void KWinDecorationButtonsConfigDialog::changed()
{
enableButton(KDialog::Reset, true);
m_buttonBox->button(QDialogButtonBox::RestoreDefaults)->setEnabled(true);
}
void KWinDecorationButtonsConfigDialog::slotDefaultClicked()
@ -105,7 +109,8 @@ void KWinDecorationButtonsConfigDialog::slotResetClicked()
m_ui->buttonPositionWidget->setButtonsLeft(m_buttons->leftButtons());
m_ui->buttonPositionWidget->setButtonsRight(m_buttons->rightButtons());
changed();
enableButton(KDialog::Reset, false);
m_buttonBox->button(QDialogButtonBox::Reset)->setEnabled(false);
}
} // namespace KWin

View file

@ -21,10 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define KWINDECORATIONBUTTONSCONFIGDIALOG_H
#include <QWidget>
#include <KDialog>
#include <QDialog>
#include "ui_buttons.h"
class QDialogButtonBox;
namespace KWin
{
@ -38,7 +39,7 @@ public:
explicit KWinDecorationButtonsConfigForm(QWidget* parent);
};
class KWinDecorationButtonsConfigDialog : public KDialog
class KWinDecorationButtonsConfigDialog : public QDialog
{
Q_OBJECT
public:
@ -59,6 +60,7 @@ private:
KWinDecorationButtonsConfigForm* m_ui;
bool m_showTooltip;
DecorationButtons const *m_buttons;
QDialogButtonBox* m_buttonBox;
};
} // namespace KWin

View file

@ -23,9 +23,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QDBusMessage>
#include <KLibrary>
#include <KVBox>
#include <KSharedConfig>
#include <KLocalizedString>
#include <KConfigGroup>
#include <QDialogButtonBox>
#include <QPushButton>
namespace KWin
{
@ -69,7 +71,7 @@ KWinDecorationConfigForm::KWinDecorationConfigForm(QWidget* parent)
KWinDecorationConfigDialog::KWinDecorationConfigDialog(QString deco, const QList<QVariant>& borderSizes,
KDecorationDefines::BorderSize size,
QWidget* parent, Qt::WFlags flags)
: KDialog(parent, flags)
: QDialog(parent, flags)
, m_borderSizes(borderSizes)
, m_kwinConfig(KSharedConfig::openConfig("kwinrc"))
, m_pluginObject(0)
@ -77,10 +79,15 @@ KWinDecorationConfigDialog::KWinDecorationConfigDialog(QString deco, const QList
{
m_ui = new KWinDecorationConfigForm(this);
setWindowTitle(i18n("Decoration Options"));
setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Default | KDialog::Reset);
enableButton(KDialog::Reset, false);
m_buttons = new QDialogButtonBox(this);
m_buttons->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Reset);
m_buttons->button(QDialogButtonBox::Reset)->setEnabled(false);
QVBoxLayout* layout = new QVBoxLayout;
layout->addWidget(m_ui);
layout->addWidget(m_buttons);
connect(m_buttons, SIGNAL(accepted()), SLOT(accept()));
connect(m_buttons, SIGNAL(rejected()), SLOT(reject()));
KLibrary library(styleToConfigLib(deco));
if (library.load()) {
@ -88,15 +95,16 @@ KWinDecorationConfigDialog::KWinDecorationConfigDialog(QString deco, const QList
if (alloc_ptr != NULL) {
allocatePlugin = (QObject * (*)(KConfigGroup & conf, QWidget * parent))alloc_ptr;
KConfigGroup config(m_kwinConfig, "Style");
m_pluginConfigWidget = new KVBox(this);
m_pluginConfigWidget = new QWidget(this);
m_pluginConfigWidget->setLayout(new QVBoxLayout);
m_pluginObject = (QObject*)(allocatePlugin(config, m_pluginConfigWidget));
// connect required signals and slots together...
connect(this, SIGNAL(accepted()), this, SLOT(slotAccepted()));
connect(m_pluginObject, SIGNAL(changed()), this, SLOT(slotSelectionChanged()));
connect(this, SIGNAL(pluginSave(KConfigGroup&)), m_pluginObject, SLOT(save(KConfigGroup&)));
connect(this, SIGNAL(defaultClicked()), m_pluginObject, SLOT(defaults()));
connect(this, SIGNAL(defaultClicked()), SLOT(slotDefault()));
connect(m_buttons->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked(bool)), m_pluginObject, SLOT(defaults()));
connect(m_buttons->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked(bool)), SLOT(slotDefault()));
}
}
@ -116,9 +124,7 @@ KWinDecorationConfigDialog::KWinDecorationConfigDialog(QString deco, const QList
m_ui->borderLabel->hide();
}
QWidget* main = new QWidget(this);
main->setLayout(layout);
setMainWidget(main);
setLayout(layout);
}
KWinDecorationConfigDialog::~KWinDecorationConfigDialog()
@ -153,7 +159,7 @@ void KWinDecorationConfigDialog::slotAccepted()
void KWinDecorationConfigDialog::slotSelectionChanged()
{
enableButton(KDialog::Reset, true);
m_buttons->button(QDialogButtonBox::Reset)->setEnabled(true);
}
QString KWinDecorationConfigDialog::styleToConfigLib(const QString& styleLib) const

View file

@ -20,11 +20,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef KWINDECORATIONCONFIGDIALOG_H
#define KWINDECORATIONCONFIGDIALOG_H
#include <QWidget>
#include <kdialog.h>
#include <QDialog>
#include <kdecoration.h>
#include <KSharedConfig>
#include "ui_config.h"
#include "ui_auroraeconfig.h"
class QDialogButtonBox;
namespace KWin
{
@ -47,7 +49,7 @@ public:
explicit KWinDecorationConfigForm(QWidget* parent);
};
class KWinDecorationConfigDialog : public KDialog, public KDecorationDefines
class KWinDecorationConfigDialog : public QDialog, public KDecorationDefines
{
Q_OBJECT
public:
@ -78,6 +80,7 @@ private:
QObject*(*allocatePlugin)(KConfigGroup& conf, QWidget* parent);
QObject* m_pluginObject;
QWidget* m_pluginConfigWidget;
QDialogButtonBox* m_buttons;
};
} // namespace KWin

View file

@ -13,7 +13,7 @@
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,100,1">
<item>
<widget class="KLineEdit" name="searchEdit">
<property name="clickMessage">
<property name="clickMessage" stdset="0">
<string>Search</string>
</property>
<property name="showClearButton" stdset="0">
@ -53,21 +53,21 @@
</spacer>
</item>
<item>
<widget class="KPushButton" name="configureDecorationButton">
<widget class="QPushButton" name="configureDecorationButton">
<property name="text">
<string>Configure Decoration...</string>
</property>
</widget>
</item>
<item>
<widget class="KPushButton" name="configureButtonsButton">
<widget class="QPushButton" name="configureButtonsButton">
<property name="text">
<string>Configure Buttons...</string>
</property>
</widget>
</item>
<item>
<widget class="KPushButton" name="ghnsButton">
<widget class="QPushButton" name="ghnsButton">
<property name="text">
<string>Get New Decorations...</string>
</property>
@ -78,21 +78,11 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QDeclarativeView</class>
<extends>QGraphicsView</extends>
<header>QtDeclarative/QDeclarativeView</header>
</customwidget>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>searchEdit</tabstop>

View file

@ -367,12 +367,17 @@ void KWinDecorationModule::slotConfigureDecoration()
bool reload = false;
if (index.data(DecorationModel::TypeRole).toInt() == DecorationModelData::AuroraeDecoration ||
index.data(DecorationModel::TypeRole).toInt() == DecorationModelData::QmlDecoration) {
QPointer< KDialog > dlg = new KDialog(this);
dlg->setCaption(i18n("Decoration Options"));
dlg->setButtons(KDialog::Ok | KDialog::Cancel);
QPointer<QDialog> dlg = new QDialog(this);
dlg->setWindowTitle(i18n("Decoration Options"));
KWinAuroraeConfigForm *form = new KWinAuroraeConfigForm(dlg);
form->enableNoSideBorderSupport(index.data(DecorationModel::TypeRole).toInt() == DecorationModelData::QmlDecoration);
dlg->setMainWidget(form);
setLayout(new QVBoxLayout);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, dlg.data());
connect(buttons, SIGNAL(accepted()), dlg, SLOT(accept()));
connect(buttons, SIGNAL(rejected()), dlg, SLOT(reject()));
layout()->addWidget(form);
layout()->addWidget(buttons);
form->borderSizesCombo->setCurrentIndex(index.data(DecorationModel::BorderSizeRole).toInt());
form->buttonSizesCombo->setCurrentIndex(index.data(DecorationModel::ButtonSizeRole).toInt());
form->closeWindowsDoubleClick->setChecked(index.data(DecorationModel::CloseOnDblClickRole).toBool());
@ -400,7 +405,7 @@ void KWinDecorationModule::slotConfigureDecoration()
configManager->updateWidgets();
}
}
if (dlg->exec() == KDialog::Accepted) {
if (dlg->exec() == QDialog::Accepted) {
m_model->setData(index, form->borderSizesCombo->currentIndex(), DecorationModel::BorderSizeRole);
m_model->setData(index, form->buttonSizesCombo->currentIndex(), DecorationModel::ButtonSizeRole);
m_model->setData(index, form->closeWindowsDoubleClick->isChecked(), DecorationModel::CloseOnDblClickRole);
@ -419,7 +424,7 @@ void KWinDecorationModule::slotConfigureDecoration()
static_cast<KDecorationDefines::BorderSize>(index.data(DecorationModel::BorderSizeRole).toInt());
QPointer< KWinDecorationConfigDialog > configDialog =
new KWinDecorationConfigDialog(name, borderSizes, size, this);
if (configDialog->exec() == KDialog::Accepted) {
if (configDialog->exec() == QDialog::Accepted) {
m_model->setData(index, configDialog->borderSize(), DecorationModel::BorderSizeRole);
reload = true;
}

View file

@ -13,7 +13,6 @@ target_link_libraries(kcm_kwindesktop
KF5::KI18n
KF5::KWindowSystem
KF5::XmlGui
KF5::KDE4Support
${X11_LIBRARIES}
)

View file

@ -43,6 +43,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <fixx11h.h>
#include <netwm.h>
#include <QDialogButtonBox>
K_PLUGIN_FACTORY(KWinDesktopConfigFactory, registerPlugin<KWin::KWinDesktopConfig>();)
@ -575,17 +576,20 @@ void KWinDesktopConfig::slotConfigureEffectClicked()
return;
}
KCModuleProxy* proxy = new KCModuleProxy(effect);
QPointer< KDialog > configDialog = new KDialog(this);
QPointer<QDialog> configDialog = new QDialog(this);
configDialog->setWindowTitle(m_ui->effectComboBox->currentText());
configDialog->setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Default);
connect(configDialog, SIGNAL(defaultClicked()), proxy, SLOT(defaults()));
configDialog->setLayout(new QVBoxLayout);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::RestoreDefaults, configDialog);
connect(buttons, SIGNAL(accepted()), configDialog, SLOT(accept()));
connect(buttons, SIGNAL(rejected()), configDialog, SLOT(reject()));
connect(buttons->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked(bool)), proxy, SLOT(defaults()));
QWidget *showWidget = new QWidget(configDialog);
QVBoxLayout *layout = new QVBoxLayout;
showWidget->setLayout(layout);
layout->addWidget(proxy);
layout->insertSpacing(-1, KDialog::marginHint());
configDialog->setMainWidget(showWidget);
configDialog->layout()->addWidget(showWidget);
configDialog->layout()->addWidget(buttons);
if (configDialog->exec() == QDialog::Accepted) {
proxy->save();

View file

@ -11,7 +11,16 @@
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -50,7 +59,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="KIntSpinBox" name="numberSpinBox">
<widget class="QSpinBox" name="numberSpinBox">
<property name="whatsThis">
<string>Here you can set how many virtual desktops you want on your KDE desktop.</string>
</property>
@ -79,7 +88,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="KIntSpinBox" name="rowsSpinBox">
<widget class="QSpinBox" name="rowsSpinBox">
<property name="enabled">
<bool>true</bool>
</property>
@ -169,7 +178,7 @@
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="KComboBox" name="effectComboBox">
<widget class="QComboBox" name="effectComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -179,7 +188,7 @@
</widget>
</item>
<item>
<widget class="KPushButton" name="effectConfigButton">
<widget class="QPushButton" name="effectConfigButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -189,7 +198,7 @@
</widget>
</item>
<item>
<widget class="KPushButton" name="effectInfoButton"/>
<widget class="QPushButton" name="effectInfoButton"/>
</item>
</layout>
</item>
@ -225,7 +234,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="KIntSpinBox" name="popupHideSpinBox">
<widget class="QSpinBox" name="popupHideSpinBox">
<property name="suffix">
<string> msec</string>
</property>
@ -286,21 +295,6 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KIntSpinBox</class>
<extends>QSpinBox</extends>
<header>knuminput.h</header>
</customwidget>
<customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
</customwidget>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>KWin::DesktopNamesWidget</class>
<extends>QWidget</extends>

View file

@ -25,7 +25,6 @@ set(kcm_libs
KF5::KI18n
KF5::KWindowSystem
KF5::XmlGui
KF5::KDE4Support
${X11_LIBRARIES}
)

View file

@ -16,18 +16,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <KDialog>
#include "detectwidget.h"
#include "../../cursor.h"
#include <kapplication.h>
#include <KDE/KLocalizedString>
#include <QDebug>
#include <kwindowsystem.h>
#include <QLabel>
#include <QRadioButton>
#include <QCheckBox>
//Added by qt3to4:
#include <QDialogButtonBox>
#include <QMouseEvent>
#include <QEvent>
#include <QByteArray>
@ -49,15 +47,21 @@ DetectWidget::DetectWidget(QWidget* parent)
}
DetectDialog::DetectDialog(QWidget* parent, const char* name)
: KDialog(parent),
: QDialog(parent),
grabber()
{
setObjectName(name);
setModal(true);
setButtons(Ok | Cancel);
setLayout(new QVBoxLayout);
widget = new DetectWidget(this);
setMainWidget(widget);
layout()->addWidget(widget);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, this);
layout()->addWidget(buttons);
connect(buttons, SIGNAL(accepted()), SLOT(accept()));
connect(buttons, SIGNAL(rejected()), SLOT(reject()));
}
void DetectDialog::detect(WId window, int secs)
@ -117,7 +121,7 @@ void DetectDialog::executeDialog()
adjustSize();
if (width() < 4*height()/3)
resize(4*height()/3, height());
emit detectionDone(exec() == KDialog::Accepted);
emit detectionDone(exec() == QDialog::Accepted);
}
QByteArray DetectDialog::selectedClass() const
@ -172,7 +176,7 @@ void DetectDialog::selectWindow()
// use a dialog, so that all user input is blocked
// use WX11BypassWM and moving away so that it's not actually visible
// grab only mouse, so that keyboard can be used e.g. for switching windows
grabber.reset(new KDialog(0, Qt::X11BypassWindowManagerHint));
grabber.reset(new QDialog(0, Qt::X11BypassWindowManagerHint));
grabber->move(-1000, -1000);
grabber->setModal(true);
grabber->show();

View file

@ -20,7 +20,7 @@
#ifndef __DETECTWIDGET_H__
#define __DETECTWIDGET_H__
#include <KDialog>
#include <QDialog>
#include <kwindowsystem.h>
#include <QAbstractNativeEventFilter>
@ -43,7 +43,7 @@ public:
};
class DetectDialog
: public KDialog, public QAbstractNativeEventFilter
: public QDialog, public QAbstractNativeEventFilter
{
Q_OBJECT
public:
@ -76,7 +76,7 @@ private:
QByteArray extrarole;
QByteArray machine;
DetectWidget* widget;
QScopedPointer<KDialog> grabber;
QScopedPointer<QDialog> grabber;
KWindowInfo info;
};

View file

@ -16,8 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <kcmdlineargs.h>
#include <kapplication.h>
#include <QCommandLineParser>
#include <QApplication>
#include <kconfig.h>
#include <KDE/KLocalizedString>
#include <kwindowsystem.h>
@ -241,21 +241,26 @@ static int edit(Window wid, bool whole_app)
extern "C"
KDE_EXPORT int kdemain(int argc, char* argv[])
{
KCmdLineArgs::init(argc, argv, "kwin_rules_dialog", "kcmkwinrules", ki18n("KWin"), "1.0" ,
ki18n("KWin helper utility"));
KCmdLineOptions options;
options.add("wid <wid>", ki18n("WId of the window for special window settings."));
options.add("whole-app", ki18n("Whether the settings should affect all windows of the application."));
KCmdLineArgs::addCmdLineOptions(options);
KApplication app;
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
QApplication app(argc, argv);
app.setApplicationDisplayName(i18n("KWin"));
app.setApplicationName("kwin_rules_dialog");
app.setApplicationVersion("1.0");
bool whole_app = false;
bool id_ok = false;
Window id = args->getOption("wid").toULongLong(&id_ok);
bool whole_app = args->isSet("whole-app");
args->clear();
Window id = None;
{
QCommandLineParser parser;
parser.setApplicationDescription(i18n("KWin helper utility"));
parser.addOption(QCommandLineOption("wid", i18n("WId of the window for special window settings."), "wid"));
parser.addOption(QCommandLineOption("whole-app", i18n("Whether the settings should affect all windows of the application.")));
parser.process(app);
id = parser.value("wid").toULongLong(&id_ok);
whole_app = parser.isSet("whole-app");
}
if (!id_ok || id == None) {
KCmdLineArgs::usageError(i18n("This helper utility is not supposed to be called directly."));
printf("%s\n", qPrintable(i18n("This helper utility is not supposed to be called directly.")));
return 1;
}
return KWin::edit(id, whole_app);

View file

@ -11,28 +11,37 @@
</rect>
</property>
<layout class="QGridLayout">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0" rowspan="14">
<widget class="KListWidget" name="rules_listbox"/>
<widget class="QListWidget" name="rules_listbox"/>
</item>
<item row="0" column="1">
<widget class="KPushButton" name="new_button">
<widget class="QPushButton" name="new_button">
<property name="text">
<string>&amp;New...</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="KPushButton" name="modify_button">
<widget class="QPushButton" name="modify_button">
<property name="text">
<string>&amp;Modify...</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="KPushButton" name="delete_button">
<widget class="QPushButton" name="delete_button">
<property name="text">
<string>Delete</string>
</property>
@ -42,14 +51,14 @@
</widget>
</item>
<item row="8" column="1">
<widget class="KPushButton" name="moveup_button">
<widget class="QPushButton" name="moveup_button">
<property name="text">
<string>Move &amp;Up</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="KPushButton" name="movedown_button">
<widget class="QPushButton" name="movedown_button">
<property name="text">
<string>Move &amp;Down</string>
</property>
@ -108,18 +117,6 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KListWidget</class>
<extends>QListWidget</extends>
<header>klistwidget.h</header>
</customwidget>
<customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
</customwidget>
</customwidgets>
<includes>
<include location="local">kdialog.h</include>
</includes>

View file

@ -57,6 +57,11 @@ RulesWidget::RulesWidget(QWidget* parent)
: detect_dlg(NULL)
{
Q_UNUSED(parent);
QRegularExpressionValidator* validator = new QRegularExpressionValidator(QRegularExpression("[0-9\-+,xX:]*"), this);
maxsize->setValidator(validator);
minsize->setValidator(validator);
position->setValidator(validator);
Ui::RulesWidgetBase::size->setValidator(validator);
setupUi(this);
QString enableDesc =
@ -410,11 +415,11 @@ static NET::WindowType comboToType(int val)
}
#define CHECKBOX_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setChecked, setChecked( false ))
#define LINEEDIT_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setText, setText( "" ))
#define LINEEDIT_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setText, setText( QString() ))
#define COMBOBOX_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setCurrentIndex, setCurrentIndex( 0 ))
#define SPINBOX_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setValue, setValue(0))
#define CHECKBOX_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setChecked, setChecked( false ))
#define LINEEDIT_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setText, setText( "" ))
#define LINEEDIT_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setText, setText( QString() ))
#define COMBOBOX_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setCurrentIndex, setCurrentIndex( 0 ))
#define SPINBOX_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setValue, setValue(0))
@ -770,16 +775,21 @@ void RulesWidget::shortcutEditClicked()
}
RulesDialog::RulesDialog(QWidget* parent, const char* name)
: KDialog(parent)
: QDialog(parent)
{
setObjectName(name);
setModal(true);
setCaption(i18n("Edit Window-Specific Settings"));
setButtons(Ok | Cancel);
setWindowTitle(i18n("Edit Window-Specific Settings"));
setWindowIcon(QIcon::fromTheme("preferences-system-windows-actions"));
setLayout(new QVBoxLayout);
widget = new RulesWidget(this);
setMainWidget(widget);
layout()->addWidget(widget);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
connect(buttons, SIGNAL(accepted()), SLOT(accept()));
connect(buttons, SIGNAL(rejected()), SLOT(reject()));
layout()->addWidget(buttons);
}
// window is set only for Alt+F3/Window-specific settings, because the dialog
@ -814,7 +824,7 @@ void RulesDialog::accept()
if (!widget->finalCheck())
return;
rules = widget->rules();
KDialog::accept();
QDialog::accept();
}
EditShortcut::EditShortcut(QWidget* parent)
@ -833,19 +843,25 @@ void EditShortcut::editShortcut()
void EditShortcut::clearShortcut()
{
shortcut->setText(QLatin1String(""));
shortcut->clear();
}
EditShortcutDialog::EditShortcutDialog(QWidget* parent, const char* name)
: KDialog(parent)
: QDialog(parent)
, widget(new EditShortcut(this))
{
setObjectName(name);
setModal(true);
setCaption(i18n("Edit Shortcut"));
setButtons(Ok | Cancel);
setWindowTitle(i18n("Edit Shortcut"));
widget = new EditShortcut(this);
setMainWidget(widget);
setLayout(new QVBoxLayout);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
connect(buttons, SIGNAL(accepted()), SLOT(accept()));
connect(buttons, SIGNAL(rejected()), SLOT(reject()));
layout()->addWidget(buttons);
layout()->addWidget(widget);
}
void EditShortcutDialog::setShortcut(const QString& cut)
@ -859,13 +875,20 @@ QString EditShortcutDialog::shortcut() const
}
ShortcutDialog::ShortcutDialog(const QKeySequence& cut, QWidget* parent)
: KDialog(parent)
: QDialog(parent)
, widget(new KKeySequenceWidget(this))
{
widget->setKeySequence(cut);
// It's a global shortcut so don't allow multikey shortcuts
widget->setMultiKeyShortcutsAllowed(false);
setMainWidget(widget);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Close, this);
connect(buttons, SIGNAL(accepted()), SLOT(accept()));
connect(buttons, SIGNAL(rejected()), SLOT(reject()));
setLayout(new QVBoxLayout);
layout()->addWidget(widget);
layout()->addWidget(buttons);
}
void ShortcutDialog::accept()
@ -880,11 +903,11 @@ void ShortcutDialog::accept()
|| (seq[0] & Qt::KeyboardModifierMask) == 0) {
// clear
widget->clearKeySequence();
KDialog::accept();
QDialog::accept();
return;
}
}
KDialog::accept();
QDialog::accept();
}
QKeySequence ShortcutDialog::shortcut() const

View file

@ -22,7 +22,7 @@
#include <config-kwin.h>
#include <kdialog.h>
#include <QDialog>
#include <kwindowsystem.h>
#include <kkeysequencewidget.h>
@ -112,7 +112,7 @@ private:
};
class RulesDialog
: public KDialog
: public QDialog
{
Q_OBJECT
public:
@ -139,7 +139,7 @@ protected Q_SLOTS:
};
class EditShortcutDialog
: public KDialog
: public QDialog
{
Q_OBJECT
public:
@ -152,7 +152,7 @@ private:
// slightly duped from utils.cpp
class ShortcutDialog
: public KDialog
: public QDialog
{
Q_OBJECT
public:

View file

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>486</width>
<width>584</width>
<height>588</height>
</rect>
</property>
@ -57,7 +57,7 @@
</widget>
</item>
<item row="4" column="1">
<widget class="KComboBox" name="wmclass_match">
<widget class="QComboBox" name="wmclass_match">
<item>
<property name="text">
<string>Unimportant</string>
@ -84,7 +84,7 @@
<widget class="KLineEdit" name="wmclass"/>
</item>
<item row="4" column="4">
<widget class="KPushButton" name="edit_reg_wmclass">
<widget class="QPushButton" name="edit_reg_wmclass">
<property name="enabled">
<bool>false</bool>
</property>
@ -147,7 +147,7 @@
<widget class="KLineEdit" name="role"/>
</item>
<item row="6" column="4">
<widget class="KPushButton" name="edit_reg_role">
<widget class="QPushButton" name="edit_reg_role">
<property name="enabled">
<bool>false</bool>
</property>
@ -189,7 +189,7 @@
</widget>
</item>
<item row="10" column="1">
<widget class="KComboBox" name="title_match">
<widget class="QComboBox" name="title_match">
<item>
<property name="text">
<string>Unimportant</string>
@ -213,7 +213,7 @@
</widget>
</item>
<item row="10" column="4">
<widget class="KPushButton" name="edit_reg_title">
<widget class="QPushButton" name="edit_reg_title">
<property name="enabled">
<bool>false</bool>
</property>
@ -266,7 +266,7 @@
</widget>
</item>
<item row="11" column="4">
<widget class="KPushButton" name="edit_reg_machine">
<widget class="QPushButton" name="edit_reg_machine">
<property name="enabled">
<bool>false</bool>
</property>
@ -313,7 +313,7 @@
</spacer>
</item>
<item>
<widget class="KPushButton" name="detect">
<widget class="QPushButton" name="detect">
<property name="text">
<string>&amp;Detect Window Properties</string>
</property>
@ -497,7 +497,7 @@
</widget>
</item>
<item row="0" column="3">
<widget class="KComboBox" name="rule_position">
<widget class="QComboBox" name="rule_position">
<property name="enabled">
<bool>false</bool>
</property>
@ -534,14 +534,14 @@
</widget>
</item>
<item row="0" column="4">
<widget class="KRestrictedLine" name="position">
<widget class="QLineEdit" name="position">
<property name="enabled">
<bool>false</bool>
</property>
<property name="placeholderText">
<string>x,y</string>
</property>
<property name="validChars">
<property name="validChars" stdset="0">
<string>0123456789-+,xX:</string>
</property>
</widget>
@ -554,7 +554,7 @@
</widget>
</item>
<item row="1" column="3">
<widget class="KComboBox" name="rule_size">
<widget class="QComboBox" name="rule_size">
<property name="enabled">
<bool>false</bool>
</property>
@ -591,14 +591,14 @@
</widget>
</item>
<item row="1" column="4">
<widget class="KRestrictedLine" name="size">
<widget class="QLineEdit" name="size">
<property name="enabled">
<bool>false</bool>
</property>
<property name="placeholderText">
<string>width,height</string>
</property>
<property name="validChars">
<property name="validChars" stdset="0">
<string>0123456789-+,xX:</string>
</property>
</widget>
@ -618,7 +618,7 @@
</widget>
</item>
<item row="3" column="3">
<widget class="KComboBox" name="rule_maximizehoriz">
<widget class="QComboBox" name="rule_maximizehoriz">
<property name="enabled">
<bool>false</bool>
</property>
@ -669,7 +669,7 @@
</widget>
</item>
<item row="4" column="3">
<widget class="KComboBox" name="rule_maximizevert">
<widget class="QComboBox" name="rule_maximizevert">
<property name="enabled">
<bool>false</bool>
</property>
@ -740,7 +740,7 @@
</widget>
</item>
<item row="6" column="3">
<widget class="KComboBox" name="rule_desktop">
<widget class="QComboBox" name="rule_desktop">
<property name="enabled">
<bool>false</bool>
</property>
@ -777,7 +777,7 @@
</widget>
</item>
<item row="6" column="4">
<widget class="KComboBox" name="desktop">
<widget class="QComboBox" name="desktop">
<property name="enabled">
<bool>false</bool>
</property>
@ -804,7 +804,7 @@
</widget>
</item>
<item row="7" column="3">
<widget class="KComboBox" name="rule_activity">
<widget class="QComboBox" name="rule_activity">
<property name="enabled">
<bool>false</bool>
</property>
@ -841,7 +841,7 @@
</widget>
</item>
<item row="7" column="4">
<widget class="KComboBox" name="activity">
<widget class="QComboBox" name="activity">
<property name="enabled">
<bool>false</bool>
</property>
@ -872,7 +872,7 @@
</widget>
</item>
<item row="10" column="3">
<widget class="KComboBox" name="rule_fullscreen">
<widget class="QComboBox" name="rule_fullscreen">
<property name="enabled">
<bool>false</bool>
</property>
@ -923,7 +923,7 @@
</widget>
</item>
<item row="11" column="3">
<widget class="KComboBox" name="rule_minimize">
<widget class="QComboBox" name="rule_minimize">
<property name="enabled">
<bool>false</bool>
</property>
@ -974,7 +974,7 @@
</widget>
</item>
<item row="12" column="3">
<widget class="KComboBox" name="rule_shade">
<widget class="QComboBox" name="rule_shade">
<property name="enabled">
<bool>false</bool>
</property>
@ -1025,7 +1025,7 @@
</widget>
</item>
<item row="14" column="3" rowspan="2">
<widget class="KComboBox" name="rule_placement">
<widget class="QComboBox" name="rule_placement">
<property name="enabled">
<bool>false</bool>
</property>
@ -1047,7 +1047,7 @@
</widget>
</item>
<item row="14" column="4" rowspan="2">
<widget class="KComboBox" name="placement">
<widget class="QComboBox" name="placement">
<property name="enabled">
<bool>false</bool>
</property>
@ -1127,7 +1127,7 @@ to unconditionally popup in the middle of your screen.</string>
</widget>
</item>
<item row="16" column="3">
<widget class="KComboBox" name="rule_ignoregeometry">
<widget class="QComboBox" name="rule_ignoregeometry">
<property name="enabled">
<bool>false</bool>
</property>
@ -1178,7 +1178,7 @@ to unconditionally popup in the middle of your screen.</string>
</widget>
</item>
<item row="18" column="3" rowspan="2">
<widget class="KComboBox" name="rule_minsize">
<widget class="QComboBox" name="rule_minsize">
<property name="enabled">
<bool>false</bool>
</property>
@ -1207,14 +1207,14 @@ to unconditionally popup in the middle of your screen.</string>
</widget>
</item>
<item row="19" column="4">
<widget class="KRestrictedLine" name="minsize">
<widget class="QLineEdit" name="minsize">
<property name="enabled">
<bool>false</bool>
</property>
<property name="placeholderText">
<string>width,height</string>
</property>
<property name="validChars">
<property name="validChars" stdset="0">
<string>0123456789-+,xX:</string>
</property>
</widget>
@ -1227,7 +1227,7 @@ to unconditionally popup in the middle of your screen.</string>
</widget>
</item>
<item row="20" column="3">
<widget class="KComboBox" name="rule_maxsize">
<widget class="QComboBox" name="rule_maxsize">
<property name="enabled">
<bool>false</bool>
</property>
@ -1249,14 +1249,14 @@ to unconditionally popup in the middle of your screen.</string>
</widget>
</item>
<item row="20" column="4">
<widget class="KRestrictedLine" name="maxsize">
<widget class="QLineEdit" name="maxsize">
<property name="enabled">
<bool>false</bool>
</property>
<property name="placeholderText">
<string>width,height</string>
</property>
<property name="validChars">
<property name="validChars" stdset="0">
<string>0123456789-+,xX:</string>
</property>
</widget>
@ -1282,7 +1282,7 @@ like your complete screen area.</string>
</widget>
</item>
<item row="21" column="3">
<widget class="KComboBox" name="rule_strictgeometry">
<widget class="QComboBox" name="rule_strictgeometry">
<property name="enabled">
<bool>false</bool>
</property>
@ -1327,7 +1327,7 @@ like your complete screen area.</string>
</spacer>
</item>
<item row="8" column="3">
<widget class="KComboBox" name="rule_screen">
<widget class="QComboBox" name="rule_screen">
<property name="enabled">
<bool>false</bool>
</property>
@ -1378,7 +1378,7 @@ like your complete screen area.</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="2" colspan="2">
<widget class="KComboBox" name="rule_below">
<widget class="QComboBox" name="rule_below">
<property name="enabled">
<bool>false</bool>
</property>
@ -1425,7 +1425,7 @@ like your complete screen area.</string>
</widget>
</item>
<item row="16" column="2" colspan="2">
<widget class="KComboBox" name="rule_shortcut">
<widget class="QComboBox" name="rule_shortcut">
<property name="enabled">
<bool>false</bool>
</property>
@ -1526,7 +1526,7 @@ like your complete screen area.</string>
</spacer>
</item>
<item row="5" column="2" colspan="2">
<widget class="KComboBox" name="rule_autogroup">
<widget class="QComboBox" name="rule_autogroup">
<property name="enabled">
<bool>false</bool>
</property>
@ -1548,7 +1548,7 @@ like your complete screen area.</string>
</widget>
</item>
<item row="13" column="2" colspan="2">
<widget class="KComboBox" name="rule_skippager">
<widget class="QComboBox" name="rule_skippager">
<property name="enabled">
<bool>false</bool>
</property>
@ -1632,7 +1632,7 @@ like your complete screen area.</string>
</widget>
</item>
<item row="14" column="2" colspan="2">
<widget class="KComboBox" name="rule_skipswitcher">
<widget class="QComboBox" name="rule_skipswitcher">
<property name="enabled">
<bool>false</bool>
</property>
@ -1669,7 +1669,7 @@ like your complete screen area.</string>
</widget>
</item>
<item row="12" column="2" colspan="2">
<widget class="KComboBox" name="rule_skiptaskbar">
<widget class="QComboBox" name="rule_skiptaskbar">
<property name="enabled">
<bool>false</bool>
</property>
@ -1706,7 +1706,7 @@ like your complete screen area.</string>
</widget>
</item>
<item row="16" column="4" colspan="2">
<widget class="KRestrictedLine" name="shortcut">
<widget class="QLineEdit" name="shortcut">
<property name="enabled">
<bool>false</bool>
</property>
@ -1747,7 +1747,7 @@ like your complete screen area.</string>
</widget>
</item>
<item row="6" column="2" colspan="2">
<widget class="KComboBox" name="rule_autogroupfg">
<widget class="QComboBox" name="rule_autogroupfg">
<property name="enabled">
<bool>false</bool>
</property>
@ -1803,7 +1803,7 @@ like your complete screen area.</string>
</spacer>
</item>
<item row="7" column="2" colspan="2">
<widget class="KComboBox" name="rule_autogroupid">
<widget class="QComboBox" name="rule_autogroupid">
<property name="enabled">
<bool>false</bool>
</property>
@ -1852,7 +1852,7 @@ like your complete screen area.</string>
</widget>
</item>
<item row="0" column="2" colspan="2">
<widget class="KComboBox" name="rule_above">
<widget class="QComboBox" name="rule_above">
<property name="enabled">
<bool>false</bool>
</property>
@ -1910,7 +1910,7 @@ like your complete screen area.</string>
</widget>
</item>
<item row="3" column="2" rowspan="2" colspan="3">
<widget class="KComboBox" name="rule_opacityactive">
<widget class="QComboBox" name="rule_opacityactive">
<property name="enabled">
<bool>false</bool>
</property>
@ -1946,7 +1946,7 @@ like your complete screen area.</string>
</widget>
</item>
<item row="0" column="2" colspan="3">
<widget class="KComboBox" name="rule_noborder">
<widget class="QComboBox" name="rule_noborder">
<property name="enabled">
<bool>false</bool>
</property>
@ -2033,7 +2033,7 @@ like your complete screen area.</string>
</widget>
</item>
<item row="5" column="2" colspan="3">
<widget class="KComboBox" name="rule_opacityinactive">
<widget class="QComboBox" name="rule_opacityinactive">
<property name="enabled">
<bool>false</bool>
</property>
@ -2099,7 +2099,7 @@ from getting focused on a mouse click.</string>
</widget>
</item>
<item row="11" column="2" rowspan="2" colspan="3">
<widget class="KComboBox" name="rule_acceptfocus">
<widget class="QComboBox" name="rule_acceptfocus">
<property name="enabled">
<bool>false</bool>
</property>
@ -2148,7 +2148,7 @@ while it's active!</string>
</widget>
</item>
<item row="13" column="2" colspan="3">
<widget class="KComboBox" name="rule_disableglobalshortcuts">
<widget class="QComboBox" name="rule_disableglobalshortcuts">
<property name="enabled">
<bool>false</bool>
</property>
@ -2198,7 +2198,7 @@ while it's active!</string>
</widget>
</item>
<item row="19" column="2" colspan="3">
<widget class="KComboBox" name="rule_type">
<widget class="QComboBox" name="rule_type">
<property name="enabled">
<bool>false</bool>
</property>
@ -2220,7 +2220,7 @@ while it's active!</string>
</widget>
</item>
<item row="19" column="5" colspan="2">
<widget class="KComboBox" name="type">
<widget class="QComboBox" name="type">
<property name="enabled">
<bool>false</bool>
</property>
@ -2342,7 +2342,7 @@ while it's active!</string>
</widget>
</item>
<item row="17" column="2" rowspan="2" colspan="3">
<widget class="KComboBox" name="rule_closeable">
<widget class="QComboBox" name="rule_closeable">
<property name="enabled">
<bool>false</bool>
</property>
@ -2396,7 +2396,7 @@ while it's active!</string>
</widget>
</item>
<item row="23" column="2" rowspan="2" colspan="3">
<widget class="KComboBox" name="rule_blockcompositing">
<widget class="QComboBox" name="rule_blockcompositing">
<property name="enabled">
<bool>false</bool>
</property>
@ -2418,7 +2418,7 @@ while it's active!</string>
</widget>
</item>
<item row="10" column="2" colspan="3">
<widget class="KComboBox" name="rule_fsplevel">
<widget class="QComboBox" name="rule_fsplevel">
<property name="enabled">
<bool>false</bool>
</property>
@ -2461,14 +2461,14 @@ but this may sometimes fail or superact.
</widget>
</item>
<item row="1" column="5" colspan="2">
<widget class="KComboBox" name="decocolor">
<widget class="QComboBox" name="decocolor">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="KComboBox" name="rule_decocolor">
<widget class="QComboBox" name="rule_decocolor">
<property name="enabled">
<bool>false</bool>
</property>
@ -2496,16 +2496,6 @@ but this may sometimes fail or superact.
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KRestrictedLine</class>
<extends>KLineEdit</extends>
<header>krestrictedline.h</header>
</customwidget>
<customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
</customwidget>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>

View file

@ -7,7 +7,7 @@ set(
screenpreviewwidget.cpp
)
kde4_add_ui_files( kcm_kwinscreenedges_PART_SRCS main.ui )
kde4_add_plugin( kcm_kwinscreenedges ${kcm_kwinscreenedges_PART_SRCS} )
add_library( kcm_kwinscreenedges MODULE ${kcm_kwinscreenedges_PART_SRCS} )
target_link_libraries( kcm_kwinscreenedges ${X11_LIBRARIES}
Qt5::DBus
KF5::KCompletion
@ -16,7 +16,6 @@ target_link_libraries( kcm_kwinscreenedges ${X11_LIBRARIES}
KF5::KI18n
KF5::KService
KF5::Plasma
KF5::KDE4Support
)
install( TARGETS kcm_kwinscreenedges DESTINATION ${PLUGIN_INSTALL_DIR} )

View file

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>461</width>
<width>488</width>
<height>511</height>
</rect>
</property>
@ -202,7 +202,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="KIntSpinBox" name="activationDelaySpin">
<widget class="QSpinBox" name="activationDelaySpin">
<property name="suffix">
<string> ms</string>
</property>
@ -234,7 +234,7 @@
</widget>
</item>
<item row="3" column="1">
<widget class="KIntSpinBox" name="triggerCooldownSpin">
<widget class="QSpinBox" name="triggerCooldownSpin">
<property name="enabled">
<bool>true</bool>
</property>
@ -289,11 +289,6 @@
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>KIntSpinBox</class>
<extends>QSpinBox</extends>
<header>knuminput.h</header>
</customwidget>
<customwidget>
<class>KWin::Monitor</class>
<extends>QWidget</extends>

View file

@ -25,9 +25,10 @@
#include <QPainter>
#include <QDebug>
#include <KUrl>
#include <QMimeData>
#include <Plasma/FrameSvg>
#include <kurlmimedata.h>
class ScreenPreviewWidgetPrivate
@ -147,10 +148,10 @@ void ScreenPreviewWidget::paintEvent(QPaintEvent *event)
void ScreenPreviewWidget::dropEvent(QDropEvent *e)
{
if (!KUrl::List::canDecode(e->mimeData()))
if (!e->mimeData()->hasUrls())
return;
const KUrl::List uris(KUrl::List::fromMimeData(e->mimeData()));
QList<QUrl> uris(KUrlMimeData::urlsFromMimeData(e->mimeData()));
if (!uris.isEmpty()) {
// TODO: Download remote file
if (uris.first().isLocalFile())

View file

@ -16,7 +16,6 @@ target_link_libraries(kcm_kwin_scripts
KF5::KIOCore
KF5::KI18n
KF5::Plasma
KF5::KDE4Support
KF5::KNewStuff
)

View file

@ -43,7 +43,7 @@
</widget>
</item>
<item>
<widget class="KPushButton" name="ghnsButton">
<widget class="QPushButton" name="ghnsButton">
<property name="text">
<string>Get New Script...</string>
</property>
@ -69,11 +69,6 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
</customwidget>
<customwidget>
<class>KPluginSelector</class>
<extends>QWidget</extends>

View file

@ -32,7 +32,6 @@ target_link_libraries(kcm_kwintabbox
KF5::Plasma
KF5::XmlGui
KF5::KNewStuff
KF5::KDE4Support
${XCB_XCB_LIBRARY})
install(TARGETS kcm_kwintabbox DESTINATION ${PLUGIN_INSTALL_DIR} )

View file

@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QtCore/QStandardPaths>
#include <KDE/KConfigGroup>
#include <KDE/KDesktopFile>
#include <KDE/KIcon>
#include <KDE/KIconEffect>
#include <KDE/KIconLoader>
#include <KDE/KLocalizedString>
@ -82,7 +81,7 @@ QPixmap TabBoxImageProvider::requestPixmap(const QString &id, QSize *size, const
s = requestedSize;
}
*size = s;
QPixmap icon(KIcon(m_model->data(m_model->index(index), Qt::UserRole+3).toString()).pixmap(s));
QPixmap icon(QIcon::fromTheme(m_model->data(m_model->index(index), Qt::UserRole+3).toString()).pixmap(s));
if (parts.size() > 2) {
KIconEffect *effect = KIconLoader::global()->iconEffect();
KIconLoader::States state = KIconLoader::DefaultState;

View file

@ -23,13 +23,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QtDBus/QtDBus>
#include <QDesktopWidget>
#include <QVBoxLayout>
#include <QDialogButtonBox>
#include <QStandardPaths>
#include <QPointer>
// KDE
#include <KActionCollection>
#include <KCModuleProxy>
#include <KDialog>
#include <KGlobalAccel>
//#include <KLocalizedString>
#include <KPluginFactory>
@ -63,7 +63,7 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args)
, m_config(KSharedConfig::openConfig("kwinrc"))
, m_layoutPreview(NULL)
{
KTabWidget* tabWidget = new KTabWidget(this);
QTabWidget* tabWidget = new QTabWidget(this);
m_primaryTabBoxUi = new KWinTabBoxConfigForm(tabWidget);
m_alternativeTabBoxUi = new KWinTabBoxConfigForm(tabWidget);
tabWidget->addTab(m_primaryTabBoxUi, i18n("Main"));
@ -504,9 +504,13 @@ void KWinTabBoxConfig::configureEffectClicked()
m_layoutPreview->setLayout(ui->effectCombo->itemData(effect, Qt::UserRole+1).toString(), ui->effectCombo->itemText(effect));
m_layoutPreview->show();
} else {
QPointer< KDialog > configDialog = new KDialog(this);
configDialog->setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Default);
QPointer<QDialog> configDialog = new QDialog(this);
configDialog->setLayout(new QVBoxLayout);
configDialog->setWindowTitle(ui->effectCombo->currentText());
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::RestoreDefaults, configDialog);
connect(buttonBox, SIGNAL(accepted()), configDialog, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), configDialog, SLOT(reject()));
KCModuleProxy* proxy = new KCModuleProxy(effect == CoverSwitch ? "coverswitch_config" : "flipswitch_config");
connect(configDialog, SIGNAL(defaultClicked()), proxy, SLOT(defaults()));
@ -514,8 +518,8 @@ void KWinTabBoxConfig::configureEffectClicked()
QVBoxLayout *layout = new QVBoxLayout;
showWidget->setLayout(layout);
layout->addWidget(proxy);
layout->insertSpacing(-1, KDialog::marginHint());
configDialog->setMainWidget(showWidget);
configDialog->layout()->addWidget(showWidget);
configDialog->layout()->addWidget(buttonBox);
if (configDialog->exec() == QDialog::Accepted) {
proxy->save();

View file

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>630</width>
<width>658</width>
<height>418</height>
</rect>
</property>
@ -123,7 +123,16 @@
<bool>false</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -175,7 +184,16 @@
<bool>false</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -227,7 +245,16 @@
<bool>false</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -279,7 +306,16 @@
<bool>false</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -417,18 +453,10 @@
</widget>
</item>
<item row="6" column="1" colspan="3">
<widget class="KKeySequenceWidget" name="scCurrentReverse">
<property name="checkForConflictsAgainst">
<set>KKeySequenceWidget::GlobalShortcuts</set>
</property>
</widget>
<widget class="KKeySequenceWidget" name="scCurrentReverse" native="true"/>
</item>
<item row="5" column="1" colspan="3">
<widget class="KKeySequenceWidget" name="scCurrent">
<property name="checkForConflictsAgainst">
<set>KKeySequenceWidget::GlobalShortcuts</set>
</property>
</widget>
<widget class="KKeySequenceWidget" name="scCurrent" native="true"/>
</item>
<item row="4" column="0" colspan="4">
<widget class="QLabel" name="label_2">
@ -447,18 +475,10 @@
</widget>
</item>
<item row="2" column="1" colspan="3">
<widget class="KKeySequenceWidget" name="scAllReverse">
<property name="checkForConflictsAgainst">
<set>KKeySequenceWidget::GlobalShortcuts</set>
</property>
</widget>
<widget class="KKeySequenceWidget" name="scAllReverse" native="true"/>
</item>
<item row="1" column="1" colspan="3">
<widget class="KKeySequenceWidget" name="scAll">
<property name="checkForConflictsAgainst">
<set>KKeySequenceWidget::GlobalShortcuts</set>
</property>
</widget>
<widget class="KKeySequenceWidget" name="scAll" native="true"/>
</item>
</layout>
</widget>
@ -475,11 +495,20 @@
<item row="1" column="1">
<widget class="QWidget" name="widget_6" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="KComboBox" name="effectCombo">
<widget class="QComboBox" name="effectCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -492,7 +521,7 @@
</widget>
</item>
<item>
<widget class="KPushButton" name="effectConfigButton">
<widget class="QPushButton" name="effectConfigButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -538,7 +567,7 @@
</spacer>
</item>
<item row="1" column="3">
<widget class="KPushButton" name="ghns">
<widget class="QPushButton" name="ghns">
<property name="toolTip">
<string>Get New Window Switcher Layout</string>
</property>
@ -582,11 +611,6 @@
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>highlightWindowCheck</tabstop>