1
0
mirror of https://gitlab.gnome.org/GNOME/gparted synced 2024-06-30 23:05:09 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Shasheen Ediriweera
991a5fb15f 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
2024-06-16 02:22:29 +00:00
Scrambled 777
6588ff7835 Add Hindi translation 2024-06-15 14:18:44 +00:00
Shasheen Ediriweera
3e6f99ad69 Stop GParted launch if Rescuezilla running (#158)
Prevents GParted from launching when the Rescuezilla (Clonezilla GUI) is
running, which prevents conflicts between the two tools. Rescuezilla is a
popular GTK frontend to Partclone and Clonezilla (analogous to GParted and GNU
Parted).

Users running both GParted and Rescuezilla simultaneously are at risk of race
conditions and data corruption, so enforcing mutual exclusion is vital. A
similar mutual exclusion test is already used in GParted to prevent two
instances of GParted from running simultaneously.

Rescuezilla's launch script [1] is based on GParted's script due to its
identical need to shutdown automount services, and Rescuezilla's live
environment's GParted launch script already has this change applied as mutual
exclusion is vital for safe operation.

[1] https://github.com/rescuezilla/rescuezilla/blob/master/src/apps/rescuezilla/rescuezilla/usr/sbin/rescuezilla

Closes #158 - Mutual exclusion with Rescuezilla (Clonezilla GUI)
2021-06-16 16:39:30 +09:30
Shasheen Ediriweera
8e37b5067c Display 'already running' msg using yad (#157)
Display the "gpartedbin is already running" message as a graphical error box
using yad (Yet Another Dialog) if it's available, in addition to printing to
stdout.

GParted is a graphical tool so most users will not be launching the tool from a
terminal, so displaying a graphical dialog error box gives the user more
clarity.

Note: This commit does not add 'yad' as a dependency of GParted.

Also, the existing stdout message is not yet translated.

Closes #157 - Display 'GParted already running' error graphically
2021-06-16 16:39:23 +09:30
3 changed files with 2491 additions and 3 deletions

View File

@ -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

View File

@ -26,6 +26,7 @@ gd
gl
gu
he
hi
hr
hu
id

2470
po/hi.po Normal file

File diff suppressed because it is too large Load Diff