Skip to content

Commit

Permalink
Qube Manager in working order
Browse files Browse the repository at this point in the history
Everything that should work works. Further improvements that would be nice:
- replace untidy multitude of QtGui Items with one generic type
- restore Qubes Network functionality
- add Boot From Device action (and easy way to install windows tool from there)

fixes QubesOS/qubes-issues#2966
QubesOS/qubes-issues#2132
  • Loading branch information
marmarta committed Jan 8, 2018
1 parent d57e58a commit 8b5e2a8
Show file tree
Hide file tree
Showing 7 changed files with 236 additions and 466 deletions.
9 changes: 9 additions & 0 deletions qubes-qube-manager.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Type=Application
Exec=qubes-qube-manager
Icon=qubes-manager
Terminal=false
Name=Qube Manager
GenericName=Qube Manager
StartupNotify=false
Categories=System;
40 changes: 18 additions & 22 deletions qubesmanager/log_dialog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/python2
# pylint: skip-file
#!/usr/bin/python3
#
# The Qubes OS Project, http://www.qubes-os.org
#
Expand All @@ -21,22 +20,17 @@
#
#

import sys
import os
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4 import QtCore
from PyQt4 import QtGui

from qubes.qubes import QubesException

import qubesmanager.resources_rc

from .ui_logdlg import *
from .clipboard import *
from . import ui_logdlg
from . import clipboard

# Display only this size of log
LOG_DISPLAY_SIZE = 1024*1024

class LogDialog(Ui_LogDialog, QDialog):

class LogDialog(ui_logdlg.Ui_LogDialog, QtGui.QDialog):

def __init__(self, app, log_path, parent=None):
super(LogDialog, self).__init__(parent)
Expand All @@ -46,24 +40,26 @@ def __init__(self, app, log_path, parent=None):

self.setupUi(self)
self.setWindowTitle(log_path)

self.connect(self.copy_to_qubes_clipboard, SIGNAL("clicked()"), self.copy_to_qubes_clipboard_triggered)


self.connect(self.copy_to_qubes_clipboard,
QtCore.SIGNAL("clicked()"),
self.copy_to_qubes_clipboard_triggered)

self.__init_log_text__()

def __init_log_text__(self):
self.displayed_text = ""
log = open(self.log_path)
log.seek(0, os.SEEK_END)
log.seek(0, clipboard.os.SEEK_END)
if log.tell() > LOG_DISPLAY_SIZE:
self.displayed_text = self.tr("(Showing only last %d bytes of file)\n") % LOG_DISPLAY_SIZE
log.seek(-LOG_DISPLAY_SIZE, os.SEEK_END)
self.displayed_text = self.tr(
"(Showing only last %d bytes of file)\n") % LOG_DISPLAY_SIZE
log.seek(-LOG_DISPLAY_SIZE, clipboard.os.SEEK_END)
else:
log.seek(0, os.SEEK_SET)
log.seek(0, clipboard.os.SEEK_SET)
self.displayed_text += log.read()
log.close()
self.log_text.setPlainText(self.displayed_text)


def copy_to_qubes_clipboard_triggered(self):
copy_text_to_qubes_clipboard(self.displayed_text)
clipboard.copy_text_to_qubes_clipboard(self.displayed_text)
Loading

0 comments on commit 8b5e2a8

Please sign in to comment.