~ubuntu-branches/ubuntu/raring/lxpanel/raring-proposed

« back to all changes in this revision

Viewing changes to debian/patches/configure_desktop_number.patch

  • Committer: Package Import Robot
  • Author(s): Julien Lavergne
  • Date: 2012-05-04 19:33:50 UTC
  • mfrom: (1.1.11) (4.1.15 sid)
  • Revision ID: package-import@ubuntu.com-20120504193350-k4y9tr1hjvey5927
Tags: 0.5.9-3ubuntu1
* Merge from Debian, Ubuntu remaining changes :
* debian/control:
 - Add libindicator-dev build-depends.
 - Add a recommend on xterm | pavucontrol | gnome-alsamixer to enable the
   mixer on the sound applet. (LP: #957749)
 - Add indicator plugin binary.
 - Add a debug package.
* debian/local/source_lxpanel.py:
 - Add apport hook.
* debian/lxpanel.install:
 - Install all files except indicators.
* debian/lxpanel-indicator-applet-plugin.install:
 - Install indicator plugin.
* debian/rules:
 - Install apport hook only on Ubuntu.
 - Add override for dh_strip.
 - Add --enable-indicator-support flag.
* debian/copyright:
 - Update copyright for xkb plugin.
 - Update copyright for indicator plugin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: Add configuration for desktop number for the pager plugin.
2
 
Author: Julien Lavergne <gilir@ubuntu.com>
3
 
 
4
 
Index: lxpanel-0.5.8+git20120112/src/plugins/pager.c
5
 
===================================================================
6
 
--- lxpanel-0.5.8+git20120112.orig/src/plugins/pager.c  2012-02-13 22:49:56.000000000 +0100
7
 
+++ lxpanel-0.5.8+git20120112/src/plugins/pager.c       2012-02-13 22:50:07.000000000 +0100
8
 
@@ -815,6 +815,80 @@
9
 
     g_free(pg);
10
 
 }
11
 
 
12
 
+/* Callback when the configuration dialog is to be shown. */
13
 
+static void deskno_configure(Plugin * p, GtkWindow * parent)
14
 
+{
15
 
+
16
 
+    GdkScreen *screen = gdk_screen_get_default();
17
 
+    const char *wm_name = gdk_x11_screen_get_window_manager_name(screen);
18
 
+    GError *error = NULL;
19
 
+    const gchar *command_line = NULL;
20
 
+
21
 
+    if(g_strcmp0(wm_name, "Openbox") == 0)
22
 
+    {
23
 
+        if (g_find_program_in_path("obconf"))
24
 
+        {
25
 
+            command_line = "obconf --tab 6";
26
 
+        }
27
 
+    }
28
 
+    else if (g_strcmp0(wm_name, "compiz") == 0)
29
 
+    {
30
 
+         if (g_find_program_in_path("ccsm"))
31
 
+         {
32
 
+              command_line = "ccsm";
33
 
+
34
 
+         }
35
 
+         else if (g_find_program_in_path("simple-ccsm"))
36
 
+         {
37
 
+              command_line = "simple-ccsm";
38
 
+         }
39
 
+    }
40
 
+    else
41
 
+    {
42
 
+    
43
 
+        GtkWidget* msg;
44
 
+
45
 
+        msg = gtk_message_dialog_new( NULL, 
46
 
+                                      0, 
47
 
+                                      GTK_MESSAGE_ERROR, 
48
 
+                                      GTK_BUTTONS_OK, 
49
 
+                                      _("Error, only openbox and compiz are supported") );
50
 
+        gtk_dialog_run( GTK_DIALOG(msg) );
51
 
+        gtk_widget_destroy( msg );
52
 
+    
53
 
+    }
54
 
+
55
 
+    if (command_line)
56
 
+    {
57
 
+        gdk_spawn_command_line_on_screen(screen,
58
 
+                                         command_line,
59
 
+                                         &error);
60
 
+    }
61
 
+
62
 
+    else
63
 
+    {
64
 
+    
65
 
+        GtkWidget* msg;
66
 
+
67
 
+        msg = gtk_message_dialog_new( NULL, 
68
 
+                                      0, 
69
 
+                                      GTK_MESSAGE_ERROR, 
70
 
+                                      GTK_BUTTONS_OK, 
71
 
+                                      _("Error, you need to install obconf, ccsm of simple-ccsm") );
72
 
+        gtk_dialog_run( GTK_DIALOG(msg) );
73
 
+        gtk_widget_destroy( msg );
74
 
+    
75
 
+    }
76
 
+
77
 
+       if (error)
78
 
+       {
79
 
+           g_print("%s\n", error->message);
80
 
+               
81
 
+               g_free (error);
82
 
+    }
83
 
+
84
 
+}
85
 
+
86
 
 /* Callback when panel configuration changes. */
87
 
 static void pager_panel_configuration_changed(Plugin * p)
88
 
 {
89
 
@@ -840,7 +914,7 @@
90
 
 
91
 
     constructor : pager_constructor,
92
 
     destructor  : pager_destructor,
93
 
-    config : NULL,
94
 
+    config : deskno_configure,
95
 
     save : NULL,
96
 
     panel_configuration_changed : pager_panel_configuration_changed
97
 
 };