Re: Review Request 122249: libksysguard: add Kill Window to End Process button and show correct keyboard shortcut

2015-03-09 Thread Gregor Mi


> On March 2, 2015, 7:47 a.m., Martin Gräßlin wrote:
> > processui/keyboardshortcututil.cpp, line 46
> > 
> >
> > This looks to complicated. It should be much easier to do with the 
> > KGlobalAccel API:
> > * create a KActionCollection for component "kwin"
> > * add a QAction with the shortcut name you want
> > * ask KGlobalAccel to load the shortcut for it.
> 
> Gregor Mi wrote:
> Thanks for the hint but I am not sure of how to use the API in such a 
> way. I tried two things:
> 
> 1)
> org::kde::KGlobalAccel kglobalaccel("org.kde.kglobalaccel", 
> "/kglobalaccel", bus);
> 
> auto kwinActions = 
> kglobalaccel.allActionsForComponent(QStringList("kwin"));
> Q_FOREACH(auto aaa, kwinActions.value()) {
> //qDebug() << aaa; // ("kwin", "Kill Window", "KWin", "Kill 
> Window")
> }
> Then I wonder how to feed the QStringList to a KActionCollection.
> 
> 2)
> KActionCollection ac(nullptr, QString());
> ac.setComponentName("kwin");
> // ac.importGlobalShortcuts();
> Q_FOREACH(auto bbb, ac.actions()) {
> if (bbb->text() == "Kill Window") {
> qDebug() << bbb;
> }
> }
> But the ac.actions() list is empty.
> 
> Which of the two ways should be used?
> 
> Thomas Lübking wrote:
> tried this?
> ---
> KActionCollection ac(this, "kwin");
> ac.setConfigGlobal(true);
> QAction *act  = ac.action("Kill Window");

I have no QObject* as parent. Can this be the cause?

KActionCollection ac(nullptr, "kwin");
ac.setConfigGlobal(true);
auto killWindowAction  = ac.action("Kill Window");
qDebug() << ac.actions().count();
qDebug() << killWindowAction;
/*
RESULT:
0
QObject(0x0)
*/


- Gregor


---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122249/#review76861
---


On Feb. 27, 2015, 1:18 a.m., Gregor Mi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122249/
> ---
> 
> (Updated Feb. 27, 2015, 1:18 a.m.)
> 
> 
> Review request for KDE Base Apps, Martin Gräßlin and John Tapsell.
> 
> 
> Repository: libksysguard
> 
> 
> Description
> ---
> 
> Current situation:
> The "End Process..." button has a tooltip which says "To target a specific 
> window to kill, press Ctrl+Alt+Esc at any time." The keyboard shortcut is 
> hardcoded.
> 
> RR:
> Add a drop down menu to the "End Process..." button with one action:
> i18n("Kill a specific window... (Global shortcut: %1)", killWindowShortcut)
> 
> 
> Diffs
> -
> 
>   processui/CMakeLists.txt 7f87b85e0201e63d69070a71203bbb34851a79c6 
>   processui/ProcessWidgetUI.ui e50f55cf1813b00d49b1716023df487ffbd536e3 
>   processui/keyboardshortcututil.h PRE-CREATION 
>   processui/keyboardshortcututil.cpp PRE-CREATION 
>   processui/ksysguardprocesslist.cpp 450ca600b8aed7ca611ec638610b6c524c96080c 
>   tests/CMakeLists.txt 967b03fae1e460bfb22e1a07ef05cf7b49412546 
>   tests/keyboardshortcututiltest.h PRE-CREATION 
>   tests/keyboardshortcututiltest.cpp PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/122249/diff/
> 
> 
> Testing
> ---
> 
> 
> File Attachments
> 
> 
> New End Process button with drop down arrow
>   
> https://git.reviewboard.kde.org/media/uploaded/files/2015/01/28/16301e88-e21b-4358-9a63-a85dae5722bd__screenshot_default1.png
> Drop down shows Kill Window
>   
> https://git.reviewboard.kde.org/media/uploaded/files/2015/01/28/58df12c5-7350-4bb0-b602-c5716caa9836__screenshot_default2.png
> 
> 
> Thanks,
> 
> Gregor Mi
> 
>



Re: Review Request 122826: Bug 339392 - krdc main window columns are not resizable

2015-03-09 Thread Luca
Hi Urs

That line is the problem. Reading at the doc about
QHeaderView::ResizeToContents
...
The size cannot be changed by the user or programmatically.

is enought resize the column manually after the model is populated and the
sort indicator is setted up.

Ps. I canno't commit into master

bye


On 6 March 2015 at 19:00, Urs Wolfer  wrote:

>This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122826/
>
> Will you commit this change into master?
>
>
>mainwindow.cpp
> 
>  (Diff
> revision 1)
>
> QWidget* MainWindow::newConnectionWidget()
>
>   1129
>
> 
> m_newConnectionTableView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
>
>Are you sure this line isn't needed anymore?
>
>
> - Urs Wolfer
>
> On March 5th, 2015, 4:57 p.m. UTC, Luca Sartorelli wrote:
>   Review request for KDE Base Apps, KDE Utils, Network Management, and
> Urs Wolfer.
> By Luca Sartorelli.
>
> *Updated March 5, 2015, 4:57 p.m.*
>  *Bugs: * 339392 
>  *Repository: * krdc
> Description
>
> Bug 339392 - krdc main window columns are not resizable
>
>   Testing
>
> The columns of the main grid in the main windows are resizable, and when the 
> application starts, are sized nicely as without the patch.
> On a new connect window, the column are not resize (same as before), but this 
> time is possible to resize them, by the mouse
>
>   Diffs
>
>- mainwindow.cpp (acc89ae)
>
> View Diff 
>



-- 
P Please consider the environment before printing this e-mail