Browse Source

Disable camera switch button if only one camera exists

Martijn Braam 4 years ago
parent
commit
6b775ba1f9
1 changed files with 10 additions and 0 deletions
  1. 10 0
      main.c

+ 10 - 0
main.c

@@ -1598,6 +1598,16 @@ main(int argc, char *argv[])
 		goto failed;
 		goto failed;
 	}
 	}
 
 
+	// Disable the camera switch button if only one camera exists
+	int camera_count = 0;
+	for (int i=0; i<NUM_CAMERAS; i++) {
+		if(cameras[i].exists)
+			camera_count++;
+	}
+	if (camera_count < 2) {
+		gtk_widget_set_sensitive(switch_btn, FALSE);
+	}
+
 	// Setup first defined camera
 	// Setup first defined camera
 	for(int i=0;i<NUM_CAMERAS; i++) {
 	for(int i=0;i<NUM_CAMERAS; i++) {
 		if(cameras[i].exists){
 		if(cameras[i].exists){