Merge lp:~psgenfan/do-plugins/forcequit into lp:do-plugins

Proposed by Marcus
Status: Needs review
Proposed branch: lp:~psgenfan/do-plugins/forcequit
Merge into: lp:do-plugins
Diff against target: 74 lines (+58/-0)
2 files modified
WindowManager/Resources/WindowManager.addin.xml.in (+1/-0)
WindowManager/src/WindowActions/WindowForceQuit.cs (+57/-0)
To merge this branch: bzr merge lp:~psgenfan/do-plugins/forcequit
Reviewer Review Type Date Requested Status
Do Plugins Team Pending
Review via email: mp+16938@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Marcus (psgenfan) wrote :

I fixed the tree so only relevent modifications to code should exist. Sorry for any trouble that caused.

THIS IS BUILT OFF OF THE WINDOW MANAGER...IT SHOULD BE MERGED WITH IT!!!!! All modified and new files live there.

It is a lot like the force quit applet found on Gnome's panel. It runs the command kill with the selected window's process ID.

All and all only one line of code is originally written by me.

Perhaps a possible addition would be to add dialog box asking if the use really wants to end the process. But then again, when I want a process terminated, I want it terminated.

Revision history for this message
Chris S. (cszikszoy) wrote :

In Action, why not use a foreach (Window ...) to allow the action to be performed on multiple windows?

Unmerged revisions

675. By marcus <marcus@marcus-desktop>

Added WindowMager/scr/WindowActions/WindowForceQuit.cs

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'WindowManager/Resources/WindowManager.addin.xml.in'
2--- WindowManager/Resources/WindowManager.addin.xml.in 2009-06-26 15:20:14 +0000
3+++ WindowManager/Resources/WindowManager.addin.xml.in 2010-01-07 00:44:13 +0000
4@@ -23,6 +23,7 @@
5 <!-- Extensions included in this assembly -->
6 <Extension path="/Do/Action">
7 <Action type="WindowManager.WindowMinimizeAction" />
8+ <Action type="WindowManager.WindowForceQuitAction" />
9 <Action type="WindowManager.WindowMaximizeAction" />
10 <Action type="WindowManager.WindowCloseAction" />
11 <Action type="WindowManager.WindowFocusAction" />
12
13=== added file 'WindowManager/src/WindowActions/WindowForceQuit.cs'
14--- WindowManager/src/WindowActions/WindowForceQuit.cs 1970-01-01 00:00:00 +0000
15+++ WindowManager/src/WindowActions/WindowForceQuit.cs 2010-01-07 00:44:13 +0000
16@@ -0,0 +1,57 @@
17+//
18+// Copyright (C) 2009 GNOME Do
19+//
20+// This program is free software: you can redistribute it and/or modify
21+// it under the terms of the GNU General Public License as published by
22+// the Free Software Foundation, either version 3 of the License, or
23+// (at your option) any later version.
24+//
25+// This program is distributed in the hope that it will be useful,
26+// but WITHOUT ANY WARRANTY; without even the implied warranty of
27+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28+// GNU General Public License for more details.
29+//
30+// You should have received a copy of the GNU General Public License
31+// along with this program. If not, see <http://www.gnu.org/licenses/>.
32+//
33+
34+
35+//This simply calls the command kill using the process id of the selected
36+//window.
37+
38+using System;
39+using System.Collections.Generic;
40+using System.Linq;
41+
42+using Do.Universe;
43+using Do.Interface.Wink;
44+
45+using Wnck;
46+using Mono.Addins;
47+
48+namespace WindowManager
49+{
50+
51+
52+ public class WindowForceQuitAction : WindowActionAction
53+ {
54+ public override string Name {
55+ get { return AddinManager.CurrentLocalizer.GetString ("Force Quit"); }
56+ }
57+
58+ public override string Description {
59+ get { return AddinManager.CurrentLocalizer.GetString ("Force a misbehaving Application To Quit"); }
60+ }
61+
62+ public override string Icon {
63+ get { return "gnome-panel-force-quit"; }
64+ }
65+
66+ public override void Action (IEnumerable<Window> windows)
67+ {
68+ if (!windows.Any ())
69+ return;
70+ System.Diagnostics.Process.Start ("kill " + (windows.First ().Pid));
71+ }
72+ }
73+}
74\ No newline at end of file

Subscribers

People subscribed via source and target branches