diff --git a/src/genericutils/qml/outlinebuttons.qml b/src/genericutils/qml/outlinebuttons.qml index e0cb39a8..07fa3610 100644 --- a/src/genericutils/qml/outlinebuttons.qml +++ b/src/genericutils/qml/outlinebuttons.qml @@ -1,60 +1,60 @@ /*************************************************************************** * Copyright (C) 2017-2018 by Bluesystems * * Author : Emmanuel Lepage Vallee * * * * 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 3 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, see . * **************************************************************************/ import QtQuick 2.9 import org.kde.ringkde.genericutils 1.0 as GenericUtils Item { id: button height: 50 * rows + 2*padding implicitHeight: 50 * rows + 2*padding property alias padding: buttonGrid.padding property alias model: repeater.model property alias rows: buttonGrid.rows property var actions: [] property var action: function(index) {} property bool _isButtons: true Grid { id: buttonGrid anchors.fill: parent rowSpacing: padding columnSpacing: padding rows: 1 Repeater { id: repeater Item { width: button.width / (repeater.count / buttonGrid.rows) implicitHeight: 50 implicitWidth: width height: 50 GenericUtils.OutlineButton { anchors.fill: parent label: display onClicked: { - if (actions.lenght >= index) { + if (actions.length >= index) { actions[index]() } action(index) } } } } } } diff --git a/src/jamikdeintegration/src/actioncollection.h b/src/jamikdeintegration/src/actioncollection.h index 5df685f5..7c48c906 100644 --- a/src/jamikdeintegration/src/actioncollection.h +++ b/src/jamikdeintegration/src/actioncollection.h @@ -1,211 +1,211 @@ /*************************************************************************** * Copyright (C) 2009-2015 by Savoir-Faire Linux * * Author : Emmanuel Lepage Vallee * * * * 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 3 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, see . * **************************************************************************/ #ifndef ACTIONCOLLECTION_H #define ACTIONCOLLECTION_H #include //Qt class QActionGroup; class QAction; // Ring class QmlAction; class KXmlGuiWindow; class PhoneWindow; class KActionCollection; ///Group action declaration under the same umbrella class Q_DECL_EXPORT ActionCollection : public QObject { Q_OBJECT public: //Constructor explicit ActionCollection(QObject* parent = nullptr); virtual ~ActionCollection(); static ActionCollection* instance(); void setupAction(); Q_PROPERTY(QmlAction* holdAction READ holdAction CONSTANT) Q_PROPERTY(QmlAction* recordAction READ recordAction CONSTANT) Q_PROPERTY(QmlAction* muteCaptureAction READ muteCaptureAction CONSTANT) Q_PROPERTY(QmlAction* mutePlaybackAction READ mutePlaybackAction CONSTANT) Q_PROPERTY(QmlAction* hangupAction READ hangupAction CONSTANT) Q_PROPERTY(QmlAction* transferAction READ transferAction CONSTANT) Q_PROPERTY(QmlAction* acceptAction READ acceptAction CONSTANT) Q_PROPERTY(QmlAction* newCallAction READ newCallAction CONSTANT) Q_PROPERTY(QmlAction* displayVolumeControlsAction READ displayVolumeControlsAction CONSTANT) Q_PROPERTY(QmlAction* displayDialpadAction READ displayDialpadAction CONSTANT) Q_PROPERTY(QmlAction* displayAccountCbbAction READ displayAccountCbbAction CONSTANT) Q_PROPERTY(QmlAction* showContactDockAction READ showContactDockAction CONSTANT) Q_PROPERTY(QmlAction* showHistoryDockAction READ showHistoryDockAction CONSTANT) Q_PROPERTY(QmlAction* showTimelineDockAction READ showTimelineDockAction CONSTANT) Q_PROPERTY(QmlAction* showDialDockAction READ showDialDockAction CONSTANT) Q_PROPERTY(QmlAction* showBookmarkDockAction READ showBookmarkDockAction CONSTANT) Q_PROPERTY(QmlAction* quitAction READ quitAction CONSTANT) Q_PROPERTY(QmlAction* closeAction READ closeAction CONSTANT) Q_PROPERTY(QmlAction* addPerson READ addPerson CONSTANT) Q_PROPERTY(QmlAction* focusHistory READ focusHistory CONSTANT) Q_PROPERTY(QmlAction* focusContact READ focusContact CONSTANT) Q_PROPERTY(QmlAction* focusCall READ focusCall CONSTANT) Q_PROPERTY(QmlAction* focusBookmark READ focusBookmark CONSTANT) Q_PROPERTY(QmlAction* showWizard READ showWizard CONSTANT) Q_PROPERTY(QmlAction* showMenu READ showMenu CONSTANT) Q_PROPERTY(QmlAction* newContact READ newContact CONSTANT) Q_PROPERTY(QmlAction* configureShortcut READ configureShortcut CONSTANT) Q_PROPERTY(QmlAction* configureNotification READ configureNotification CONSTANT) Q_PROPERTY(QmlAction* configureAccount READ configureAccount CONSTANT) Q_PROPERTY(QmlAction* videoRotateLeftAction READ videoRotateLeftAction CONSTANT) Q_PROPERTY(QmlAction* videoRotateRightAction READ videoRotateRightAction CONSTANT) Q_PROPERTY(QmlAction* videoFlipHorizontalAction READ videoFlipHorizontalAction CONSTANT) Q_PROPERTY(QmlAction* videoFlipVerticalAction READ videoFlipVerticalAction CONSTANT) Q_PROPERTY(QmlAction* videoMuteAction READ videoMuteAction CONSTANT) Q_PROPERTY(QmlAction* videoPreviewAction READ videoPreviewAction CONSTANT) Q_PROPERTY(QmlAction* vimw2deoScaleAction READ videoScaleAction CONSTANT) Q_PROPERTY(QmlAction* videoFullscreenAction READ videoFullscreenAction CONSTANT) Q_PROPERTY(QObject* fakeMainWindow READ fakeMainWindow CONSTANT) Q_PROPERTY(QObject* kactionCollection READ kactionCollection CONSTANT) //Actions QmlAction* holdAction (); QmlAction* recordAction (); QmlAction* muteCaptureAction (); QmlAction* mutePlaybackAction (); QmlAction* hangupAction (); QmlAction* transferAction (); QmlAction* acceptAction (); QmlAction* newCallAction (); QmlAction* displayVolumeControlsAction (); QmlAction* displayDialpadAction (); QmlAction* displayAccountCbbAction (); QmlAction* showContactDockAction (); QmlAction* showHistoryDockAction (); QmlAction* showBookmarkDockAction (); QmlAction* showTimelineDockAction (); QmlAction* showDialDockAction (); QmlAction* quitAction (); QmlAction* closeAction (); QmlAction* addPerson (); QmlAction* focusHistory (); QmlAction* focusContact (); QmlAction* focusCall (); QmlAction* focusBookmark (); QmlAction* showWizard (); QmlAction* showMenu (); QmlAction* newContact (); QmlAction* configureShortcut (); QmlAction* configureNotification (); QmlAction* configureAccount (); //Video actions QmlAction* videoRotateLeftAction (); QmlAction* videoRotateRightAction (); QmlAction* videoFlipHorizontalAction (); QmlAction* videoFlipVerticalAction (); QmlAction* videoMuteAction (); QmlAction* videoPreviewAction (); QmlAction* videoScaleAction (); QmlAction* videoFullscreenAction (); private: - //Selection dependant + //Selection dependent QmlAction* action_accept {nullptr}; QmlAction* action_new_call {nullptr}; QmlAction* action_hold {nullptr}; QmlAction* action_transfer {nullptr}; QmlAction* action_record {nullptr}; QmlAction* action_mute_capture {nullptr}; QmlAction* action_mute_playback {nullptr}; QmlAction* action_hangup {nullptr}; QmlAction* action_mute_video {nullptr}; QmlAction* action_join {nullptr}; QmlAction* action_toggle_video {nullptr}; QmlAction* action_add_contact {nullptr}; QmlAction* action_add_to_contact {nullptr}; QmlAction* action_delete_contact {nullptr}; QmlAction* action_email_contact {nullptr}; QmlAction* action_copy_contact {nullptr}; QmlAction* action_bookmark {nullptr}; QmlAction* action_view_chat_history {nullptr}; QmlAction* action_add_contact_method {nullptr}; QmlAction* action_call_contact {nullptr}; QmlAction* action_edit_contact {nullptr}; QmlAction* action_remove_history {nullptr}; //Video actions QmlAction* action_video_rotate_left {nullptr}; QmlAction* action_video_rotate_right {nullptr}; QmlAction* action_video_flip_horizontal {nullptr}; QmlAction* action_video_flip_vertical {nullptr}; QmlAction* action_video_mute {nullptr}; QmlAction* action_video_preview {nullptr}; QmlAction* action_video_scale {nullptr}; QmlAction* action_video_fullscreen {nullptr}; //Other actions QmlAction* action_new_contact {nullptr}; QmlAction* action_quit {nullptr}; QmlAction* action_close {nullptr}; QmlAction* action_displayVolumeControls {nullptr}; QmlAction* action_displayDialpad {nullptr}; QmlAction* action_displayAccountCbb {nullptr}; QmlAction* action_configureShortcut {nullptr}; QmlAction* action_configureNotifications {nullptr}; QmlAction* action_configureAccount {nullptr}; QmlAction* action_pastenumber {nullptr}; QmlAction* action_showContactDock {nullptr}; QmlAction* action_showHistoryDock {nullptr}; QmlAction* action_showBookmarkDock {nullptr}; QmlAction* action_showTimelineDock {nullptr}; QmlAction* action_showDialDock {nullptr}; QmlAction* action_addPerson {nullptr}; QmlAction* action_raise_client {nullptr}; QmlAction* action_focus_history {nullptr}; QmlAction* action_focus_contact {nullptr}; QmlAction* action_focus_call {nullptr}; QmlAction* action_focus_bookmark {nullptr}; QmlAction* action_show_wizard {nullptr}; QmlAction* action_show_directory {nullptr}; QmlAction* action_show_menu {nullptr}; QObject* fakeMainWindow() const; QObject* kactionCollection() const; public Q_SLOTS: void slotRaiseClient ( bool focus = false ); private Q_SLOTS: void showShortCutEditor (); void showNotificationEditor(); void slotAddPerson (); void updateRecordButton (); void updateVolumeButton (); void slotNewContact (); void slotClose (); void slotShowMenubar (bool s); Q_SIGNALS: void windowStateChanged(); }; #endif // kate: space-indent on; indent-width 3; replace-tabs on;