wok diff lxpanel/stuff/configure_desktop_number.patch @ rev 11747
merge
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Wed Feb 22 02:51:12 2012 +0100 (2012-02-22) |
parents | |
children | 8eb408167604 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/lxpanel/stuff/configure_desktop_number.patch Wed Feb 22 02:51:12 2012 +0100 1.3 @@ -0,0 +1,95 @@ 1.4 +Description: Add configuration for desktop number for the pager plugin. 1.5 +Author: Julien Lavergne <gilir@ubuntu.com> 1.6 + 1.7 +--- a/src/plugins/pager.c 1.8 ++++ b/src/plugins/pager.c 1.9 +@@ -811,6 +811,80 @@ 1.10 + g_free(pg); 1.11 + } 1.12 + 1.13 ++/* Callback when the configuration dialog is to be shown. */ 1.14 ++static void deskno_configure(Plugin * p, GtkWindow * parent) 1.15 ++{ 1.16 ++ 1.17 ++ GdkScreen *screen = gdk_screen_get_default(); 1.18 ++ const char *wm_name = gdk_x11_screen_get_window_manager_name(screen); 1.19 ++ GError *error = NULL; 1.20 ++ const gchar *command_line = NULL; 1.21 ++ 1.22 ++ if(g_strcmp0(wm_name, "Openbox") == 0) 1.23 ++ { 1.24 ++ if (g_find_program_in_path("obconf")) 1.25 ++ { 1.26 ++ command_line = "obconf --tab 6"; 1.27 ++ } 1.28 ++ } 1.29 ++ else if (g_strcmp0(wm_name, "compiz") == 0) 1.30 ++ { 1.31 ++ if (g_find_program_in_path("ccsm")) 1.32 ++ { 1.33 ++ command_line = "ccsm"; 1.34 ++ 1.35 ++ } 1.36 ++ else if (g_find_program_in_path("simple-ccsm")) 1.37 ++ { 1.38 ++ command_line = "simple-ccsm"; 1.39 ++ } 1.40 ++ } 1.41 ++ else 1.42 ++ { 1.43 ++ 1.44 ++ GtkWidget* msg; 1.45 ++ 1.46 ++ msg = gtk_message_dialog_new( NULL, 1.47 ++ 0, 1.48 ++ GTK_MESSAGE_ERROR, 1.49 ++ GTK_BUTTONS_OK, 1.50 ++ _("Error, only openbox and compiz are supported") ); 1.51 ++ gtk_dialog_run( GTK_DIALOG(msg) ); 1.52 ++ gtk_widget_destroy( msg ); 1.53 ++ 1.54 ++ } 1.55 ++ 1.56 ++ if (command_line) 1.57 ++ { 1.58 ++ gdk_spawn_command_line_on_screen(screen, 1.59 ++ command_line, 1.60 ++ &error); 1.61 ++ } 1.62 ++ 1.63 ++ else 1.64 ++ { 1.65 ++ 1.66 ++ GtkWidget* msg; 1.67 ++ 1.68 ++ msg = gtk_message_dialog_new( NULL, 1.69 ++ 0, 1.70 ++ GTK_MESSAGE_ERROR, 1.71 ++ GTK_BUTTONS_OK, 1.72 ++ _("Error, you need to install obconf, ccsm of simple-ccsm") ); 1.73 ++ gtk_dialog_run( GTK_DIALOG(msg) ); 1.74 ++ gtk_widget_destroy( msg ); 1.75 ++ 1.76 ++ } 1.77 ++ 1.78 ++ if (error) 1.79 ++ { 1.80 ++ g_print("%s\n", error->message); 1.81 ++ 1.82 ++ g_free (error); 1.83 ++ } 1.84 ++ 1.85 ++} 1.86 ++ 1.87 + /* Callback when panel configuration changes. */ 1.88 + static void pager_panel_configuration_changed(Plugin * p) 1.89 + { 1.90 +@@ -836,7 +910,7 @@ 1.91 + 1.92 + constructor : pager_constructor, 1.93 + destructor : pager_destructor, 1.94 +- config : NULL, 1.95 ++ config : deskno_configure, 1.96 + save : NULL, 1.97 + panel_configuration_changed : pager_panel_configuration_changed 1.98 + };