feat: Online search button

- MailListView: new '🌐 Online' button in search bar
- Clicking button emits onlineSearchRequested(query)
- If search box empty, shows QInputDialog for query entry
- MainMainWindow::onOnlineSearchRequested() handler:
  - Validates current folder selected
  - Gets account for folder
  - Shows status message
  - Shows info dialog with query/folder/account (placeholder for IMAP SEARCH)
- Signal: onlineSearchRequested(const QString& query)
- Button styled in blue (online theme)
This commit is contained in:
2026-08-26 04:45:10 +02:00
parent 6d1feabfc5
commit 6f348b17f0
14 changed files with 6066 additions and 7566 deletions
+31
View File
@@ -1118,3 +1118,34 @@ void MainMainWindow::onEmbeddedDetachRequested(QWidget *widget)
statusBar()->showMessage(tr("Compose view detached to separate window"), 3000);
}
void MainMainWindow::onOnlineSearchRequested(const QString& query)
{
if (m_currentFolderId < 0) {
QMessageBox::warning(this, "Buscar online", "Selecciona una carpeta primero");
return;
}
std::optional<Folder> optFolder = FolderDao::findById(m_currentFolderId);
if (!optFolder.has_value()) return;
Folder folder = optFolder.value();
Account* account = m_accountService->findAccountById(folder.accountId());
if (!account) {
QMessageBox::warning(this, "Buscar online", "No se encontró la cuenta para esta carpeta");
return;
}
// Use MailService to search online (IMAP SEARCH)
statusBar()->showMessage(tr("Buscando en servidor: %1").arg(query), 3000);
// TODO: Implement IMAP SEARCH in MailService
// For now, show a message
QMessageBox::information(this, "Buscar online",
QString("Búsqueda en servidor para: '%1'\nCarpeta: %2\nCuenta: %3")
.arg(query)
.arg(folder.name())
.arg(account->email()));
delete account;
}