screenshot: Show a special error when screencast ran out of disk space
Since we now propagate error types back to gnome-shell now, let's start with showing a special error message in case the disk ran out of space, which is probably the most typical error. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2976>
This commit is contained in:
parent
7133fac91f
commit
ce613f5d15
@ -363,9 +363,15 @@ class Recorder extends Signals.EventEmitter {
|
|||||||
case PipelineState.PLAYING:
|
case PipelineState.PLAYING:
|
||||||
case PipelineState.FLUSHING: {
|
case PipelineState.FLUSHING: {
|
||||||
const [error] = message.parse_error();
|
const [error] = message.parse_error();
|
||||||
|
|
||||||
|
if (error.matches(Gst.ResourceError, Gst.ResourceError.NO_SPACE_LEFT)) {
|
||||||
|
this._handleFatalPipelineError('Out of disk space',
|
||||||
|
ScreencastErrors, ScreencastError.OUT_OF_DISK_SPACE);
|
||||||
|
} else {
|
||||||
this._handleFatalPipelineError(
|
this._handleFatalPipelineError(
|
||||||
`GStreamer error while in state ${this._pipelineState}: ${error.message}`,
|
`GStreamer error while in state ${this._pipelineState}: ${error.message}`,
|
||||||
ScreencastErrors, ScreencastError.PIPELINE_ERROR);
|
ScreencastErrors, ScreencastError.PIPELINE_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ export const ScreencastError = {
|
|||||||
ALREADY_RECORDING: 3,
|
ALREADY_RECORDING: 3,
|
||||||
RECORDER_ERROR: 4,
|
RECORDER_ERROR: 4,
|
||||||
SERVICE_CRASH: 5,
|
SERVICE_CRASH: 5,
|
||||||
|
OUT_OF_DISK_SPACE: 6,
|
||||||
};
|
};
|
||||||
export const ScreencastErrors =
|
export const ScreencastErrors =
|
||||||
registerErrorDomain('Screencast', ScreencastError);
|
registerErrorDomain('Screencast', ScreencastError);
|
||||||
|
@ -2039,7 +2039,14 @@ export const ScreenshotUI = GObject.registerClass({
|
|||||||
// Translators: notification title.
|
// Translators: notification title.
|
||||||
this._showNotification(_('Screencast failed to start'));
|
this._showNotification(_('Screencast failed to start'));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ScreencastPhase.RECORDING:
|
case ScreencastPhase.RECORDING:
|
||||||
|
if (error.matches(ScreencastErrors, ScreencastError.OUT_OF_DISK_SPACE)) {
|
||||||
|
// Translators: notification title.
|
||||||
|
this._showNotification(_('Screencast ended: Out of disk space'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Translators: notification title.
|
// Translators: notification title.
|
||||||
this._showNotification(_('Screencast ended unexpectedly'));
|
this._showNotification(_('Screencast ended unexpectedly'));
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user