Skip to content

Commit

Permalink
Merge pull request #444 from vojtechtrefny/main_device-info-all-mount…
Browse files Browse the repository at this point in the history
…points

Show all mountpoints in device info dialog
  • Loading branch information
vojtechtrefny authored Aug 4, 2024
2 parents d2e8b1f + e19a84c commit 3a535ba
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Daily builds of _blivet_, _libblockdev_ and _libbytesize_ are also in this repo.

#### OBS repository for Ubuntu and Debian

Official packages for Debian and Ubuntu (19.04 and newer) are available in our [Open Build Service repository](https://software.opensuse.org/download.html?project=home:vtrefny&package=blivet-gui).
Official packages for Debian and Ubuntu are available in our [Open Build Service repository](https://software.opensuse.org/download.html?project=home:vtrefny&package=blivet-gui).

This repository contains blivet-gui and its dependencies that are not available in the official Ubuntu/Debian repositories. We recommend adding the repository to your system, if you want to install the packages manually, you'll also need to install [blivet](https://software.opensuse.org/download.html?project=home:vtrefny&package=python3-blivet) and [pid](https://software.opensuse.org/download.html?project=home:vtrefny&package=python3-pid) from the same source.

Expand Down
3 changes: 2 additions & 1 deletion blivetgui/blivetgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ def device_information(self, _widget=None):

blivet_device = self.list_partitions.selected_partition[0]

dialog = device_info_dialog.DeviceInformationDialog(self.main_window, blivet_device)
dialog = device_info_dialog.DeviceInformationDialog(self.main_window, blivet_device,
self.client, self.installer_mode)
self.run_dialog(dialog)
dialog.destroy()

Expand Down
20 changes: 17 additions & 3 deletions blivetgui/dialogs/device_info_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class DeviceInformationDialog(Gtk.Dialog):
""" Dialog showing information about selected device
"""

def __init__(self, parent_window, device):
def __init__(self, parent_window, device, client, installer_mode=False):
"""
:param parent_window: parent window
Expand All @@ -57,6 +57,8 @@ def __init__(self, parent_window, device):

self.parent_window = parent_window
self.device = device
self.client = client
self.installer_mode = installer_mode

# Gtk.Dialog
Gtk.Dialog.__init__(self)
Expand Down Expand Up @@ -224,8 +226,20 @@ def add_format_info(self):
info += _(" • <i>UUID:</i> {uuid}\n").format(uuid=self.device.format.uuid)
if hasattr(self.device.format, "label") and self.device.format.label:
info += _(" • <i>Label:</i> {label}\n").format(label=self.device.format.label)
if hasattr(self.device.format, "system_mountpoint") and self.device.format.system_mountpoint:
info += _(" • <i>Mountpoint:</i> {mountpoint}\n").format(mountpoint=self.device.format.system_mountpoint)

if self.device.format.mountable:
if self.installer_mode:
mnt = self.device.format.mountpoint if (self.device.format and self.device.format.mountable) else None
else:
is_mounted = bool(self.device.format.system_mountpoint) if (self.device.format and self.device.format.mountable) else False
if is_mounted:
mnts = self.client.remote_call("get_system_mountpoints", self.device)
mnt = "\n ".join(mnts)
else:
mnt = None

if mnt:
info += _(" • <i>Mountpoints:</i>\n {mountpoints}").format(mountpoints=mnt)

else:
info = _(" • <i>Type:</i> None")
Expand Down

0 comments on commit 3a535ba

Please sign in to comment.