[longomatch] Show an error message when there are no capture devices
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Show an error message when there are no capture devices
- Date: Tue, 11 Nov 2014 17:58:46 +0000 (UTC)
commit e35125a18595217c8290ff0eba9bab1e49ffe91c
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Nov 6 18:58:45 2014 +0100
Show an error message when there are no capture devices
LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
index 3823cec..9393039 100644
--- a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
@@ -231,7 +231,7 @@ namespace LongoMatch.Gui.Panel
videoDevices = devices;
foreach (Device device in devices) {
- string deviceElement, deviceName;
+ string deviceName;
deviceName = (device.ID == "") ? Catalog.GetString ("Unknown") : device.ID;
devicecombobox.AppendText (deviceName);
devicecombobox.Active = 0;
@@ -402,6 +402,11 @@ namespace LongoMatch.Gui.Panel
if (sender == filebutton) {
projectType = ProjectType.FileProject;
} else if (sender == capturebutton) {
+ if (videoDevices == null || videoDevices.Count == 0) {
+ Config.GUIToolkit.ErrorMessage (Catalog.GetString ("No capture
devices found in the system"),
+ this);
+ return;
+ }
projectType = ProjectType.CaptureProject;
} else if (sender == fakebutton) {
projectType = ProjectType.FakeCaptureProject;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]