#!/usr/bin/bash

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.

#-------------------------------------------------------
# Based on lxdecc from PCLinuxOS and lxcontrolcenter from Mandriva

export TEXTDOMAIN=magcc
export TEXTDOMAINDIR="/usr/share/locale"

# check of running magcc
RUN=`ps -e | grep -c magcc`
echo $RUN
if [ $RUN -gt 2 ];then
exit 0
fi

# Start main program
export magcc='
<window title="MagCC" icon-name="cc_icon" window-position="1">
<vbox> 
  <vbox>
  <frame>
	<hbox>
			<vbox>
				<hbox>
					<button>
						<input file>"/usr/share/pixmaps/magcc_mod_mnger.png"</input>
						<action>modmnger &</action>
					</button>
					<text use-markup="true" width-chars="17">
						<label>'$"Modules Manager"'</label>
					</text>
				</hbox>
				<hbox>
					<button>
						<input file>"/usr/share/pixmaps/magcc_cfg_mnger.png"</input>
						<action>cfgmnger &</action>
					</button>
					<text use-markup="true" width-chars="17">
						<label>'$"Configs Manager"'</label>
					</text>
				</hbox>
                <hbox>
					<button>
						<input file>"/usr/share/pixmaps/magcc_conv4mod.png"</input>
						<action>conv4mod &</action>
					</button>
					<text use-markup="true" width-chars="17">
						<label>'$"Convert modules"'</label>
					</text>
				</hbox>
				<hbox>
					<button>
						<input file>"/usr/share/pixmaps/magcc_rpmdrake2lzm.png"</input>
						<action>rpmdrake2lzm</action>
					</button>
					<text use-markup="true" width-chars="17">
						<label>'$"Create modules"'</label>
					</text>
				</hbox>
				<hbox>
					<button>
						<input file>"/usr/share/pixmaps/magcc_prof_resize.png"</input>
						<action>beesu "profiler_helper resize /mnt/livemedia/MagicOS-Data/MagicOS_save1.img"</action>
					</button>
					<text use-markup="true" width-chars="17">
						<label>'$"Resize profile"'</label>
					</text>
				</hbox>
			</vbox>
		</hbox>
    </frame>
  </vbox>
  <hbox>
		<button>
			<label>'$"Close"'</label>
			<input file>"/usr/share/pixmaps/magcc_close.png"</input>
			<action>EXIT:close</action>
		</button>
  </hbox>
</vbox>
</window>
'

gtkdialog --program=magcc
unset magcc
