mirror of
				https://github.com/liberatedsystems/openCom-Companion.git
				synced 2025-07-08 05:07:21 +02:00 
			
		
		
		
	Audio messaging feature dialogs
This commit is contained in:
		
							parent
							
								
									7e0a96f455
								
							
						
					
					
						commit
						11d73090ed
					
				| @ -239,6 +239,7 @@ class SidebandApp(MDApp): | ||||
|         self.last_msg_audio = None | ||||
|         self.msg_sound = None | ||||
|         self.audio_msg_mode = LXMF.AM_OPUS_OGG | ||||
|         self.compat_error_dialog = None | ||||
| 
 | ||||
|         Window.softinput_mode = "below_target" | ||||
|         self.icon = self.sideband.asset_dir+"/icon.png" | ||||
| @ -1520,6 +1521,41 @@ class SidebandApp(MDApp): | ||||
|                 ate_dialog.open() | ||||
| 
 | ||||
|     def play_audio_field(self, audio_field): | ||||
|         if RNS.vendor.platformutils.is_darwin(): | ||||
|             if self.compat_error_dialog == None: | ||||
|                 def cb(sender): | ||||
|                     self.compat_error_dialog.dismiss() | ||||
|                 self.compat_error_dialog = MDDialog( | ||||
|                     title="Unsupported Feature on macOS", | ||||
|                     text="Audio message functionality is currently only implemented on Linux and Android. Please support the development if you need this feature on macOS.", | ||||
|                     buttons=[ | ||||
|                         MDRectangleFlatButton( | ||||
|                             text="OK", | ||||
|                             font_size=dp(18), | ||||
|                             on_release=cb | ||||
|                         ) | ||||
|                     ], | ||||
|                 ) | ||||
|             self.compat_error_dialog.open() | ||||
|             return | ||||
|         elif RNS.vendor.platformutils.is_windows(): | ||||
|             if self.compat_error_dialog == None: | ||||
|                 def cb(sender): | ||||
|                     self.compat_error_dialog.dismiss() | ||||
|                 self.compat_error_dialog = MDDialog( | ||||
|                     title="Unsupported Feature on Windows", | ||||
|                     text="Audio message functionality is currently only implemented on Linux and Android. Please support the development if you need this feature on Windows.", | ||||
|                     buttons=[ | ||||
|                         MDRectangleFlatButton( | ||||
|                             text="OK", | ||||
|                             font_size=dp(18), | ||||
|                             on_release=cb | ||||
|                         ) | ||||
|                     ], | ||||
|                 ) | ||||
|             self.compat_error_dialog.open() | ||||
|             return | ||||
|         else: | ||||
|             try: | ||||
|                 temp_path = None | ||||
|                 if self.last_msg_audio != audio_field[1]: | ||||
| @ -1742,8 +1778,13 @@ class SidebandApp(MDApp): | ||||
|                         DialogItem(IconLeftWidget(icon="microphone-message", on_release=a_audio_hq), text="[size="+str(ss)+"]High-quality Voice[/size]", on_release=a_audio_hq), | ||||
|                         DialogItem(IconLeftWidget(icon="file-outline", on_release=a_file), text="[size="+str(ss)+"]File Attachment[/size]", on_release=a_file)] | ||||
|                  | ||||
|                 # if RNS.vendor.platformutils.is_linux(): | ||||
|                 #     ad_items.pop(3) | ||||
|                 if RNS.vendor.platformutils.is_windows(): | ||||
|                     ad_items.pop(3) | ||||
|                     ad_items.pop(3) | ||||
| 
 | ||||
|                 if RNS.vendor.platformutils.is_darwin(): | ||||
|                     ad_items.pop(3) | ||||
|                     ad_items.pop(3) | ||||
| 
 | ||||
|                 self.attach_dialog = MDDialog( | ||||
|                     title="Add Attachment", | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user