diff --git a/icons/copy.png b/icons/copy.png new file mode 100644 index 0000000..20b1ace Binary files /dev/null and b/icons/copy.png differ diff --git a/mainwindow.ui b/mainwindow.ui index 90afebb..2f716e0 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -229,7 +229,7 @@ 0 0 769 - 23 + 25 @@ -239,6 +239,7 @@ + @@ -345,6 +346,7 @@ + @@ -725,6 +727,18 @@ Size on Disk + + + + :/copy.png:/copy.png + + + Copy clipboard to Qubes clipboard + + + Copy Dom0 clipboard to Qubes clipboard + + diff --git a/qubesmanager/main.py b/qubesmanager/main.py index 040a974..bc29047 100755 --- a/qubesmanager/main.py +++ b/qubesmanager/main.py @@ -22,6 +22,7 @@ import sys import os +import fcntl import dbus from PyQt4.QtCore import * from PyQt4.QtGui import * @@ -273,7 +274,7 @@ class VmTemplateItem (QTableWidgetItem): else: self.setText("---") - self.setTextAlignment(Qt.AlignCenter) + self.setTextAlignment(Qt.AlignVCenter) class VmNetvmItem (QTableWidgetItem): @@ -287,7 +288,7 @@ class VmNetvmItem (QTableWidgetItem): else: self.setText("---") - self.setTextAlignment(Qt.AlignCenter) + self.setTextAlignment(Qt.AlignVCenter) class VmUsageBarWidget (QWidget): @@ -422,8 +423,6 @@ class VmUpdateInfoWidget(QWidget): self.value = 30 elif value == "update": self.value = 20 - elif value == "ok": - self.value = 10 else: self.value = 0 @@ -469,7 +468,7 @@ class VmUpdateInfoWidget(QWidget): else: update_recommended = False if not self.show_text and self.previous_update_recommended != False: - self.update_status_widget("ok") + self.update_status_widget(None) if update_recommended and not self.previous_update_recommended: self.update_status_widget("update") @@ -480,11 +479,7 @@ class VmUpdateInfoWidget(QWidget): def update_status_widget(self, state): self.value = state self.tableItem.set_value(state) - if state == "ok": - label_text = "" - icon_path = ":/flag-green.png" - tooltip_text = "VM up to date." - elif state == "update": + if state == "update": label_text = "Check updates" icon_path = ":/update-recommended.png" tooltip_text = "Update recommended." @@ -517,7 +512,7 @@ class VmSizeOnDiskItem (QTableWidgetItem): self.vm = vm self.value = 0 self.update() - self.setTextAlignment(Qt.AlignCenter) + self.setTextAlignment(Qt.AlignVCenter) def update(self): if self.vm.qid == 0: @@ -1499,7 +1494,34 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): def action_about_qubes_triggered(self): QMessageBox.about(self, "About...", "Qubes OS

Release 1.0") + @pyqtSlot(name='on_action_copy_clipboard_triggered') + def action_copy_clipboard_triggered(self): + clipboard = app.clipboard().text() + #inter-appviewer lock + try: + fd = os.open("/var/run/qubes/appviewer.lock", os.O_RDWR|os.O_CREAT, 0600); + fcntl.flock(fd, fcntl.LOCK_EX); + except IOError: + QMessageBox.warning (None, "Warning!", "Error while accessing Qubes clipboard!") + return + + qubes_clipboard = open("/var/run/qubes/qubes_clipboard.bin", 'w') + qubes_clipboard.write(clipboard) + qubes_clipboard.close() + + qubes_clip_source = open("/var/run/qubes/qubes_clipboard.bin.source", 'w') + qubes_clip_source.write("dom0") + qubes_clip_source.close() + + try: + fcntl.flock(fd, fcntl.LOCK_UN) + os.close(fd) + except IOError: + QMessageBox.warning (None, "Warning!", "Error while writing to Qubes clipboard!") + return + + def createPopupMenu(self): menu = QMenu() menu.addAction(self.action_toolbar) diff --git a/resources.qrc b/resources.qrc index a0ddc41..0ca3594 100644 --- a/resources.qrc +++ b/resources.qrc @@ -13,6 +13,7 @@ icons/mount.png icons/log.png icons/kbd-layout.png + icons/copy.png icons/pencil.png icons/edit.png icons/add.png