Skip to content

Commit

Permalink
Merge pull request #411 from vojtechtrefny/main_keep-above
Browse files Browse the repository at this point in the history
Add cmdline option to force blivet-gui to keep above other apps
  • Loading branch information
vojtechtrefny committed Sep 12, 2023
2 parents a23f3e7 + bfaeac7 commit 5ca82ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion blivet-gui
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def parse_options():
parser = argparse.ArgumentParser(description="blivet-gui")
parser.add_argument("-v", "--version", action="store_true", dest="version", default=False,
help=_("show version information"))
parser.add_argument("--keep-above", action="store_true", dest="keep_above", default=False,
help=_("keep blivet-gui window above other windows"))
parser.add_argument("disks", metavar="disk", type=str, nargs="*",
help="run blivet-gui only on specified disk(s) (optional)")

Expand Down Expand Up @@ -106,7 +108,7 @@ def main():
sockfile = output.split()[0]

client = BlivetGUIClient(server_socket=sockfile)
BlivetGUI(client, exclusive_disks=options.disks)
BlivetGUI(client, exclusive_disks=options.disks, keep_above=options.keep_above)


if __name__ == '__main__':
Expand Down
4 changes: 3 additions & 1 deletion blivetgui/blivetgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class BlivetGUI(object):

installer_mode = False

def __init__(self, client, exclusive_disks=None):
def __init__(self, client, exclusive_disks=None, keep_above=False):

self.client = client

Expand Down Expand Up @@ -103,6 +103,8 @@ def __init__(self, client, exclusive_disks=None):
# MainWindow
self.main_window = self.builder.get_object("main_window")
self.main_window.connect("delete-event", self.quit)
if keep_above:
self.main_window.set_keep_above(True)

# Exception handling
self.exc = BlivetGUIExceptionHandler(self.main_window, sys.excepthook)
Expand Down
5 changes: 4 additions & 1 deletion man/blivet-gui.1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ show this help information and exit
.TP
.BR \-v ", " \-\-version
show version information and exit
.TP
.BR \-\-keep\-above
keep the blivet-gui window above other windows

.SH EXAMPLES
You can run blivet-gui from a command line and specify one or more disks.
Expand All @@ -28,4 +31,4 @@ blivet-gui /dev/sda /dev/sdb
Vojtech Trefny <vtrefny@redhat.com>

.SH COPYRIGHT
2020, Red Hat, Licensed under GPLv2+
2023, Red Hat, Licensed under GPLv2+

0 comments on commit 5ca82ad

Please sign in to comment.