Re: Assign plasmoid global shortcut to custom action

2014-07-21 Thread Simone Gaiarin
Yes. It's kde4.


2014-07-21 10:29 GMT+02:00 Marco Martin :

> On Sunday 20 July 2014, Simone Gaiarin wrote:
> > Hi all,
> > I'm trying to use the global shortcut that the user can configure from
> the
> > "Shortcut configuration page" of a plasma applet, to trigger a KAction
> and
> > let the plasmoid do something.
> >
> > I've done this
> >
> > //Setup the action
> > m_toggleAction = new KAction("ToggleAction", this);
> > //Add action to the plasmoid action collection
> > addAction("ToggleAction", m_toggleAction);
> > m_toggleAction->setGlobalShortcut(globalShortcut());
> > connect(m_toggleAction, SIGNAL(triggered(bool)), this,
> SLOT(toggle()));
> >
> > but nothing happens when I trigger the shortcut. Do anyone know what I'm
> > missing?
> > Is there any plasmoid that is using the global shortcut feature?
> >
> > Thanks
>
> hmm, that's kde4, right?
>
> --
> Marco Martin
> ___
> Plasma-devel mailing list
> Plasma-devel@kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Assign plasmoid global shortcut to custom action

2014-07-21 Thread Marco Martin
On Sunday 20 July 2014, Simone Gaiarin wrote:
> Hi all,
> I'm trying to use the global shortcut that the user can configure from the
> "Shortcut configuration page" of a plasma applet, to trigger a KAction and
> let the plasmoid do something.
> 
> I've done this
> 
> //Setup the action
> m_toggleAction = new KAction("ToggleAction", this);
> //Add action to the plasmoid action collection
> addAction("ToggleAction", m_toggleAction);
> m_toggleAction->setGlobalShortcut(globalShortcut());
> connect(m_toggleAction, SIGNAL(triggered(bool)), this, SLOT(toggle()));
> 
> but nothing happens when I trigger the shortcut. Do anyone know what I'm
> missing?
> Is there any plasmoid that is using the global shortcut feature?
> 
> Thanks

hmm, that's kde4, right?

-- 
Marco Martin
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Assign plasmoid global shortcut to custom action

2014-07-20 Thread Simone Gaiarin
>From the documentation of Plasma Applet I've red that I need to run
addAssociatedWidget(someWidget) to make the actions work.

I've done this:

//Initialize the plasmoid using an IconWidget
m_button = new Plasma::IconWidget(this);
m_button->setIcon(KIcon("redshift-status-off"));

m_layout = new QGraphicsGridLayout(this);
m_layout->setContentsMargins(0, 0, 0, 0);
m_layout->addItem(m_button, 0, 0);

m_widget = new QWidget();
m_layout->addItem(m_widget->graphicsProxyWidget(), 1, 0);

addAssociatedWidget(m_widget);

but still doesn't work.


2014-07-20 17:01 GMT+02:00 Simone Gaiarin :

> Hi all,
> I'm trying to use the global shortcut that the user can configure from the
> "Shortcut configuration page" of a plasma applet, to trigger a KAction and
> let the plasmoid do something.
>
> I've done this
>
> //Setup the action
> m_toggleAction = new KAction("ToggleAction", this);
> //Add action to the plasmoid action collection
> addAction("ToggleAction", m_toggleAction);
> m_toggleAction->setGlobalShortcut(globalShortcut());
> connect(m_toggleAction, SIGNAL(triggered(bool)), this, SLOT(toggle()));
>
> but nothing happens when I trigger the shortcut. Do anyone know what I'm
> missing?
> Is there any plasmoid that is using the global shortcut feature?
>
> Thanks
>
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Assign plasmoid global shortcut to custom action

2014-07-20 Thread Simone Gaiarin
Hi all,
I'm trying to use the global shortcut that the user can configure from the
"Shortcut configuration page" of a plasma applet, to trigger a KAction and
let the plasmoid do something.

I've done this

//Setup the action
m_toggleAction = new KAction("ToggleAction", this);
//Add action to the plasmoid action collection
addAction("ToggleAction", m_toggleAction);
m_toggleAction->setGlobalShortcut(globalShortcut());
connect(m_toggleAction, SIGNAL(triggered(bool)), this, SLOT(toggle()));

but nothing happens when I trigger the shortcut. Do anyone know what I'm
missing?
Is there any plasmoid that is using the global shortcut feature?

Thanks
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel