diff --git a/dom0/restore/qfile-daemon-dvm b/dom0/restore/qfile-daemon-dvm index 973a1681..fcc05956 100755 --- a/dom0/restore/qfile-daemon-dvm +++ b/dom0/restore/qfile-daemon-dvm @@ -46,7 +46,10 @@ class QfileDaemonDvm: qmemman_client.close() errmsg = 'Not enough memory to create DVM. ' errmsg +='Terminate some appVM and retry.' - subprocess.call(['/usr/bin/kdialog', '--sorry', errmsg]) + if os.path.exists('/usr/bin/kdialog'): + subprocess.call(['/usr/bin/kdialog', '--sorry', errmsg]) + else: + subprocess.call(['/usr/bin/zenity', '--warning', errmsg]) return None self.tray_notify("Starting new DispVM...") @@ -74,7 +77,10 @@ class QfileDaemonDvm: '-l', str(label.index)]) qmemman_client.close() if retcode != 0: - subprocess.call(['/usr/bin/kdialog', '--sorry', 'DisposableVM creation failed, see qubes_restore.log']) + if os.path.exists('/usr/bin/kdialog'): + subprocess.call(['/usr/bin/kdialog', '--sorry', 'DisposableVM creation failed, see qubes_restore.log']) + else: + subprocess.call(['/usr/bin/zenity', '--warning', 'DisposableVM creation failed, see qubes_restore.log']) qvm_collection.unlock_db() return None f = open('/var/run/qubes/dispVM_xid', 'r'); diff --git a/dom0/restore/qubes_update_dispvm_savefile_with_progress.sh b/dom0/restore/qubes_update_dispvm_savefile_with_progress.sh index 9410478b..f6df5437 100755 --- a/dom0/restore/qubes_update_dispvm_savefile_with_progress.sh +++ b/dom0/restore/qubes_update_dispvm_savefile_with_progress.sh @@ -1,19 +1,29 @@ #!/bin/sh -ref=`kdialog --title="Updating default DispVM savefile" \ ---progressbar \ +line1="Please wait (up to 120s) while the DispVM savefile is being updated." +line2="This only happens when you have updated the template." +line3="Next time will be much faster." + +if type kdialog &> /dev/null; then + ref=`kdialog --title="Updating default DispVM savefile" \ + --progressbar \ "
- Please wait (up to 120s) while the DispVM savefile is being updated. -
- - This only happens when you have updated the template.
- Next time will be much faster. -
+ $line1
+ $line2
+ $line3
" 0`; -trap "qdbus $ref close" EXIT + trap "qdbus $ref close" EXIT +else + pipe=/tmp/qvm-create-default-dvm-$$.progress + mkfifo $pipe + zenity --progress --pulsate --auto-close --text "$line1\n$line2\n$line3" < $pipe & + exec 5>$pipe + echo 0 >&5 + trap "echo 100 >&5" EXIT +fi #qdbus $ref showCancelButton true; diff --git a/qrexec/qrexec_daemon.c b/qrexec/qrexec_daemon.c index 7b24e502..fea4475f 100644 --- a/qrexec/qrexec_daemon.c +++ b/qrexec/qrexec_daemon.c @@ -94,10 +94,16 @@ int ask_on_connect_timeout(int xid, int timeout) { char text[1024]; int ret; + struct stat buf; + ret=stat("/usr/bin/kdialog", &buf); +#define KDIALOG_CMD "kdialog --title 'Qrexec daemon' --warningyesno " +#define ZENITY_CMD "zenity --title 'Qrexec daemon' --question --text " snprintf(text, sizeof(text), - "kdialog --title 'Qrexec daemon' --warningyesno " + ret==0 ? KDIALOG_CMD : ZENITY_CMD "'Timeout while trying connecting to qrexec agent (Xen domain ID: %d). Do you want to wait next %d seconds?'", xid, timeout); +#undef KDIALOG_CMD +#undef ZENITY_CMD ret = system(text); ret = WEXITSTATUS(ret); // fprintf(stderr, "ret=%d\n", ret);