Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/modules/fluxbox/fluxbox.control.class.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2546 by niro, Wed Sep 16 11:16:27 2015 UTC revision 2567 by niro, Thu Sep 17 10:09:41 2015 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
3    push_config fluxbox_menuitem
4    
5  help_fluxbox_menuitem()  help_fluxbox_menuitem()
6  {  {
7   local serial="${CLASS_ARGV[0]}"   local serial="${CLASS_ARGV[0]}"
# Line 26  set_fluxbox_menuitem() Line 28  set_fluxbox_menuitem()
28   ;;   ;;
29   esac   esac
30    
31     if [[ -z ${name} ]]
32     then
33     eecho "No name given"
34     return 1
35     fi
36    
37   id=$(mysqldo "select id from cfg_fluxbox_menuitem where serial='${serial}' and name='${name}';")   id=$(mysqldo "select id from cfg_fluxbox_menuitem where serial='${serial}' and name='${name}';")
38   if [[ -n ${id} ]]   if [[ -n ${id} ]]
39   then   then
# Line 38  set_fluxbox_menuitem() Line 46  set_fluxbox_menuitem()
46  control_fluxbox_menuitem()  control_fluxbox_menuitem()
47  {  {
48   local serial="${CLASS_ARGV[0]}"   local serial="${CLASS_ARGV[0]}"
49     push_config_fluxbox_menuitem "${serial}"
50    }
51    
52    push_config_fluxbox_menuitem()
53    {
54     local serial="$1"
55   local values   local values
56   local id   local id
57    
# Line 50  control_fluxbox_menuitem() Line 64  control_fluxbox_menuitem()
64   eecho "Name must not be empty id->'${id}'"   eecho "Name must not be empty id->'${id}'"
65   continue   continue
66   fi   fi
  if [[ -z ${cfg_fluxbox_menuitem_exec} ]]  
  then  
  eecho "Exec must not be empty id->'${id}'"  
  continue  
  fi  
67   if [[ -z ${cfg_fluxbox_menuitem_enabled} ]]   if [[ -z ${cfg_fluxbox_menuitem_enabled} ]]
68   then   then
69   eecho "Enabled must not be empty id->'${id}'"   eecho "Enabled must not be empty id->'${id}'"
# Line 64  control_fluxbox_menuitem() Line 73  control_fluxbox_menuitem()
73   then   then
74   control_client "${serial}" set fluxbox.menuitem add "${cfg_fluxbox_menuitem_name}" "${cfg_fluxbox_menuitem_exec}" "${cfg_fluxbox_menuitem_workdir}" "${cfg_fluxbox_menuitem_icon}"   control_client "${serial}" set fluxbox.menuitem add "${cfg_fluxbox_menuitem_name}" "${cfg_fluxbox_menuitem_exec}" "${cfg_fluxbox_menuitem_workdir}" "${cfg_fluxbox_menuitem_icon}"
75   elif [[ ${cfg_fluxbox_menuitem_enabled} = 0 ]]   elif [[ ${cfg_fluxbox_menuitem_enabled} = 0 ]]
76     then
77   control_client "${serial}" set fluxbox.menuitem del "${cfg_fluxbox_menuitem_name}"   control_client "${serial}" set fluxbox.menuitem del "${cfg_fluxbox_menuitem_name}"
78   # remove from database too   # remove from database too
79   mysqldo "delete from cfg_fluxbox_menuitem where id='${id}';"   mysqldo "delete from cfg_fluxbox_menuitem where id='${id}';"
# Line 91  set_fluxbox_theme() Line 101  set_fluxbox_theme()
101  control_fluxbox_theme()  control_fluxbox_theme()
102  {  {
103   local serial="${CLASS_ARGV[0]}"   local serial="${CLASS_ARGV[0]}"
104     push_config_fluxbox_theme "${serial}"
105    }
106    
107    push_config_fluxbox_theme()
108    {
109     local serial="$1"
110   local value   local value
111    
112   value=$(mysqldo "select theme from cfg_fluxbox.menuitem where serial='${serial}'")   value=$(mysqldo "select theme from cfg_fluxbox.menuitem where serial='${serial}'")

Legend:
Removed from v.2546  
changed lines
  Added in v.2567