mirror of
https://gitlab.gnome.org/GNOME/gparted
synced 2024-10-01 05:33:51 +00:00
Merge branch 'master' into 'master'
Display launcher script messages graphically and adds mutual exclusion with Rescuezilla (Clonezilla GUI) Closes #158 and #157 See merge request GNOME/gparted!86
This commit is contained in:
commit
991a5fb15f
23
gparted.in
23
gparted.in
|
@ -27,12 +27,29 @@
|
|||
# along with GParted. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
display_msg() {
|
||||
MESSAGE="$1"
|
||||
TITLE="$2"
|
||||
printf "$MESSAGE\n"
|
||||
which yad >/dev/null
|
||||
yad_exists=$?
|
||||
if [ $yad_exists -eq 0 ]; then
|
||||
yad --center --width 300 --title="$TITLE" --button="OK:0" --text "$MESSAGE"
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Only permit one instance of GParted to execute at a time
|
||||
#
|
||||
if pidof gpartedbin 1> /dev/null; then
|
||||
echo "The process gpartedbin is already running."
|
||||
echo "Only one gpartedbin process is permitted."
|
||||
display_msg "The process gpartedbin is already running.\n\nOnly one gpartedbin process is permitted."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Only permit GParted to launch if Rescuezilla (Clonezilla GUI) is not running.
|
||||
#
|
||||
if test "x`ps -e | grep rescuezillapy`" != "x"; then
|
||||
display_msg "Cannot launch GParted because the process rescuezillapy is running.\n\nClose Rescuezilla then try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -51,7 +68,7 @@ if test "x`id -u`" != "x0"; then
|
|||
# privileges.
|
||||
#
|
||||
if test "x@gksuprog@" = "x"; then
|
||||
echo "Root privileges are required for running gparted."
|
||||
display_msg "Root privileges are required for running gparted."
|
||||
$BASE_CMD
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue