Changeset View
Changeset View
Standalone View
Standalone View
kcms/keyboard/layouts_menu.cpp
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #include "layouts_menu.h" | 19 | #include "layouts_menu.h" | ||
20 | #include "debug.h" | 20 | #include "debug.h" | ||
21 | 21 | | |||
22 | #include <ktoolinvocation.h> | | |||
23 | #include <klocalizedstring.h> | 22 | #include <klocalizedstring.h> | ||
24 | 23 | | |||
25 | #include <QAction> | 24 | #include <QAction> | ||
25 | #include <QProcess> | ||||
26 | 26 | | |||
27 | #include "keyboard_config.h" | 27 | #include "keyboard_config.h" | ||
28 | #include "x11_helper.h" | 28 | #include "x11_helper.h" | ||
29 | #include "xkb_helper.h" | 29 | #include "xkb_helper.h" | ||
30 | #include "flags.h" | 30 | #include "flags.h" | ||
31 | 31 | | |||
32 | 32 | | |||
33 | LayoutsMenu::LayoutsMenu(const KeyboardConfig& keyboardConfig_, const Rules& rules_, Flags& flags_): | 33 | LayoutsMenu::LayoutsMenu(const KeyboardConfig& keyboardConfig_, const Rules& rules_, Flags& flags_): | ||
Show All 16 Lines | |||||
50 | 50 | | |||
51 | void LayoutsMenu::actionTriggered(QAction* action) | 51 | void LayoutsMenu::actionTriggered(QAction* action) | ||
52 | { | 52 | { | ||
53 | QString data = action->data().toString(); | 53 | QString data = action->data().toString(); | ||
54 | if( data == QLatin1String("config") ) { | 54 | if( data == QLatin1String("config") ) { | ||
55 | QStringList args; | 55 | QStringList args; | ||
56 | args << QStringLiteral("--args=--tab=layouts"); | 56 | args << QStringLiteral("--args=--tab=layouts"); | ||
57 | args << QStringLiteral("kcm_keyboard"); | 57 | args << QStringLiteral("kcm_keyboard"); | ||
58 | KToolInvocation::kdeinitExec(QStringLiteral("kcmshell5"), args); | 58 | QProcess::startDetached(QStringLiteral("kcmshell5"), args); | ||
59 | } | 59 | } | ||
60 | else { | 60 | else { | ||
61 | LayoutUnit layoutUnit(LayoutUnit(action->data().toString())); | 61 | LayoutUnit layoutUnit(LayoutUnit(action->data().toString())); | ||
62 | switchToLayout(layoutUnit, keyboardConfig); | 62 | switchToLayout(layoutUnit, keyboardConfig); | ||
63 | } | 63 | } | ||
64 | } | 64 | } | ||
65 | 65 | | |||
66 | int LayoutsMenu::switchToLayout(const LayoutUnit& layoutUnit, const KeyboardConfig& keyboardConfig) | 66 | int LayoutsMenu::switchToLayout(const LayoutUnit& layoutUnit, const KeyboardConfig& keyboardConfig) | ||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |