Remove attach dialog
This was used when you pressed the "Attach file/image" button but had an image copied to your clipboard - allowing you to select from either source. This is a weird thing to ask, the button should always prompt you with a file dialog. It's still possible to paste an image from your clipboard with CTRL+V, but there isn't a way to do it via right-click yet. Fixes #712
This commit is contained in:
@@ -43,11 +43,7 @@ RowLayout {
|
||||
|
||||
function addAttachment(): void {
|
||||
if (!root.contentModel.hasRichFormatting) {
|
||||
if (LibNeoChat.Clipboard.hasImage) {
|
||||
attachDialog();
|
||||
} else {
|
||||
fileDialog();
|
||||
}
|
||||
fileDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -58,22 +54,11 @@ RowLayout {
|
||||
standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
|
||||
});
|
||||
warningDialog.onAccepted.connect(() => {
|
||||
if (LibNeoChat.Clipboard.hasImage) {
|
||||
attachmentButton.attachDialog();
|
||||
} else {
|
||||
attachmentButton.fileDialog();
|
||||
}
|
||||
attachmentButton.fileDialog();
|
||||
});
|
||||
warningDialog.open();
|
||||
}
|
||||
|
||||
function attachDialog(): void {
|
||||
let dialog = Qt.createComponent('org.kde.neochat.chatbar', 'AttachDialog').createObject(QQC2.Overlay.overlay) as AttachDialog;
|
||||
dialog.anchors.centerIn = QQC2.Overlay.overlay;
|
||||
dialog.chosen.connect(path => root.contentModel.addAttachment(path));
|
||||
dialog.open();
|
||||
}
|
||||
|
||||
function fileDialog(): void {
|
||||
let dialog = Qt.createComponent('org.kde.neochat.libneochat', 'OpenFileDialog').createObject(QQC2.Overlay.overlay, {
|
||||
parentWindow: Window.window,
|
||||
|
||||
Reference in New Issue
Block a user