| 189 | } |
| 190 | |
| 191 | void SimpleChatTab::ctxMenuImageFromFileOnClick() { |
| 192 | QString filename = QFileDialog::getOpenFileName(this, tr("Select an Image to Send"), QString(), tr("Images (*.png *.jpg)")); |
| 193 | if (!filename.isNull() && !filename.isEmpty()) { |
| 194 | QFile imageFile(filename); |
| 195 | if (imageFile.open(QFile::ReadOnly)) { |
| 196 | prepareAndSendImage(imageFile.readAll()); |
| 197 | } else { |
| 198 | QMessageBox::warning(this, tr("Error loading image"), tr("Could not open selected image.\nInsufficient rights or I/O error."), QMessageBox::Ok, QMessageBox::NoButton); |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | void SimpleChatTab::ctxMenuImageFromUrlOnClick() { |
| 204 | bool ok = false; |