Skip to content

Commit

Permalink
Retire old qubes-vm-create dialog
Browse files Browse the repository at this point in the history
Retire the the old PyQt based `qubes-vm-create` dialog and replace it
with GTK based `qubes-new-qube` for Qube Manager.

resolves: QubesOS/qubes-issues#6561
  • Loading branch information
alimirjamali committed Nov 16, 2024
1 parent 291421e commit c79cbf5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ install:
cp qubesmanager/qvm_about.sh $(DESTDIR)/usr/libexec/qubes-manager/

mkdir -p $(DESTDIR)/usr/share/applications
cp qubes-vm-create.desktop $(DESTDIR)/usr/share/applications/
cp qubes-backup.desktop $(DESTDIR)/usr/share/applications/
cp qubes-backup-restore.desktop $(DESTDIR)/usr/share/applications/
cp qubes-qube-manager.desktop $(DESTDIR)/usr/share/applications/
Expand Down
1 change: 0 additions & 1 deletion debian/install
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@

/usr/lib/*/dist-packages/qubesmanager-*.egg-info/*

/usr/share/applications/qubes-vm-create.desktop
/usr/share/applications/qubes-backup.desktop
/usr/share/applications/qubes-backup-restore.desktop
/usr/share/applications/qubes-qube-manager.desktop
Expand Down
18 changes: 14 additions & 4 deletions qubesmanager/qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# pylint: disable=import-error
from PyQt6.QtCore import (Qt, QAbstractTableModel, QObject, pyqtSlot, QEvent,
QSettings, QRegularExpression, QSortFilterProxyModel,
QSize, QPoint, QTimer)
QSize, QProcess, QPoint, QTimer)

# pylint: disable=import-error
from PyQt6.QtWidgets import (QLineEdit, QStyledItemDelegate, QToolTip,
Expand Down Expand Up @@ -903,6 +903,8 @@ def __init__(self, qt_app, qubes_app, dispatcher, _parent=None):
self.size_on_disk_timer.setInterval(1000 * 60 * 5) # every 5 mins
self.size_on_disk_timer.start()

self.new_qube = QProcess()

def eventFilter(self, _object, event):
''' refresh disk usage every 60s if focused & every 5m in background '''
if event.type() == QEvent.Type.WindowActivate:
Expand Down Expand Up @@ -1398,10 +1400,16 @@ def update_network_menu(self):
# noinspection PyArgumentList
@pyqtSlot(name='on_action_createvm_triggered')
def action_createvm_triggered(self):
with common_threads.busy_cursor():
create_window = create_new_vm.NewVmDlg(
if self.new_qube.state() == QProcess.ProcessState.Running:
return
if path.isfile("/usr/bin/qubes-new-qube"):
self.new_qube.start("/usr/bin/qubes-new-qube")
else:
# for stubborn users who might uninstall `desktop-linux-manager`
with common_threads.busy_cursor():
create_window = create_new_vm.NewVmDlg(
self.qt_app, self.qubes_app, self)
create_window.exec()
create_window.exec()

# noinspection PyArgumentList
@pyqtSlot(name='on_action_removevm_triggered')
Expand Down Expand Up @@ -1671,6 +1679,8 @@ def open_settings(self, vm, tab='basic'):
"\nError: {}".format(str(ex))))

def closeEvent(self, _):
if self.new_qube.state() == QProcess.ProcessState.Running:
self.new_qube.terminate()
self.save_showing()

# noinspection PyArgumentList
Expand Down
1 change: 0 additions & 1 deletion rpm_spec/qmgr.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ rm -rf $RPM_BUILD_ROOT
%dir %{python3_sitelib}/qubesmanager-*.egg-info
%{python3_sitelib}/qubesmanager-*.egg-info/*

/usr/share/applications/qubes-vm-create.desktop
/usr/share/applications/qubes-backup.desktop
/usr/share/applications/qubes-backup-restore.desktop
/usr/share/applications/qubes-qube-manager.desktop
Expand Down

0 comments on commit c79cbf5

Please sign in to comment.