mirror of
https://github.com/markqvist/Sideband.git
synced 2025-02-14 05:31:25 -05:00
Improved attachment feedback
This commit is contained in:
parent
4d7cb57d38
commit
dd1399d7ce
@ -274,9 +274,7 @@ else:
|
|||||||
import sbapp.pyogg as pyogg
|
import sbapp.pyogg as pyogg
|
||||||
from sbapp.pydub import AudioSegment
|
from sbapp.pydub import AudioSegment
|
||||||
|
|
||||||
class toast:
|
from kivymd.toast import toast
|
||||||
def __init__(self, *kwargs):
|
|
||||||
pass
|
|
||||||
|
|
||||||
from kivy.config import Config
|
from kivy.config import Config
|
||||||
Config.set('input', 'mouse', 'mouse,disable_multitouch')
|
Config.set('input', 'mouse', 'mouse,disable_multitouch')
|
||||||
@ -1804,17 +1802,7 @@ class SidebandApp(MDApp):
|
|||||||
if self.outbound_mode_command:
|
if self.outbound_mode_command:
|
||||||
self.outbound_mode_reset()
|
self.outbound_mode_reset()
|
||||||
|
|
||||||
if RNS.vendor.platformutils.is_android():
|
toast("Attached \""+str(fbn)+"\"")
|
||||||
toast("Attached \""+str(fbn)+"\"")
|
|
||||||
else:
|
|
||||||
ok_button = MDRectangleFlatButton(text="OK",font_size=dp(18))
|
|
||||||
ate_dialog = MDDialog(
|
|
||||||
title="File Attached",
|
|
||||||
text="The file \""+str(fbn)+"\" was attached, and will be included with the next message sent.",
|
|
||||||
buttons=[ ok_button ],
|
|
||||||
)
|
|
||||||
ok_button.bind(on_release=ate_dialog.dismiss)
|
|
||||||
ate_dialog.open()
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
RNS.log(f"Error while attaching \"{fbn}\": "+str(e), RNS.LOG_ERROR)
|
RNS.log(f"Error while attaching \"{fbn}\": "+str(e), RNS.LOG_ERROR)
|
||||||
@ -2332,18 +2320,7 @@ class SidebandApp(MDApp):
|
|||||||
self.attach_type = None
|
self.attach_type = None
|
||||||
self.update_message_widgets()
|
self.update_message_widgets()
|
||||||
|
|
||||||
if RNS.vendor.platformutils.get_platform() == "android":
|
toast("Attachment removed")
|
||||||
toast("Attachment removed")
|
|
||||||
else:
|
|
||||||
ok_button = MDRectangleFlatButton(text="OK",font_size=dp(18))
|
|
||||||
ate_dialog = MDDialog(
|
|
||||||
title="Attachment Removed",
|
|
||||||
text="The attached resource was removed from the message",
|
|
||||||
buttons=[ ok_button ],
|
|
||||||
)
|
|
||||||
ok_button.bind(on_release=ate_dialog.dismiss)
|
|
||||||
ate_dialog.open()
|
|
||||||
|
|
||||||
|
|
||||||
def shared_attachment_action(self, attachment_data):
|
def shared_attachment_action(self, attachment_data):
|
||||||
if not self.root.ids.screen_manager.current == "messages_screen":
|
if not self.root.ids.screen_manager.current == "messages_screen":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user