Skip to content

Commit

Permalink
Notify if qube tried to send large clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
alimirjamali committed Oct 7, 2024
1 parent bab3289 commit b4823b9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions qui/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,19 @@ def _copy(self, vmname: str = None):

size = clipboard_formatted_size()

body = _("Clipboard contents fetched from qube: <b>'{vmname}'</b>\n"
if not os.path.getsize(DATA):
body = _("Failed to fetch clipboard from qube: <b>'{vmname}'</b>!\n"
"Source clipboard too big to fit in Global clipboard buffer.\n"
"Use <b>qvm-copy</b> to transfer large data between qubes.\n"
"<small>Global clipboard is wiped</small>".format(
vmname=vmname))
size = 0
else:
body = _("Clipboard contents fetched from qube: <b>'{vmname}'</b>\n"
"Copied <b>{size}</b> to the global clipboard.\n"
"<small>Press {shortcut} in qube "
"to paste to local clipboard.</small>".format(
vmname=vmname, size=size, shortcut=self.gtk_app.paste_shortcut))
vmname=vmname, size=size, shortcut=self.gtk_app.paste_shortcut))

self.gtk_app.update_clipboard_contents(vmname, size, message=body)

Expand Down

0 comments on commit b4823b9

Please sign in to comment.