Base: fix compile errors in wino-mail-dtkqt (composeview UI, initializeComposition, startNewEmail, authenticator includes)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "core/models/account.h"
|
||||
#include "core/mailitem.h"
|
||||
#include "db/dao/mailitemdao.h"
|
||||
#include "ui/accountsetupdialog.h"
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QFrame>
|
||||
@@ -9,7 +10,7 @@
|
||||
#include <QLabel>
|
||||
|
||||
MainMainWindow::MainMainWindow(QWidget *parent)
|
||||
: QMainWindow(parent), m_currentFolderId(-1)
|
||||
: QMainWindow(parent), m_currentFolderId(-1), m_currentMailId(-1)
|
||||
{
|
||||
setupUI();
|
||||
connectModels();
|
||||
@@ -96,7 +97,8 @@ void MainMainWindow::setupUI() {
|
||||
// Page 2: Settings
|
||||
m_settingsView = new SettingsView();
|
||||
connect(m_settingsView, &SettingsView::accountAddRequested, [this]() {
|
||||
statusBar()->showMessage("Account setup dialog would open here", 3000);
|
||||
AccountSetupDialog dlg(m_accountService, this);
|
||||
dlg.exec();
|
||||
});
|
||||
connect(m_settingsView, &SettingsView::themeChanged, [this](const QString &theme) {
|
||||
statusBar()->showMessage(QString("Theme changed to: %1 (restart may be required)").arg(theme), 3000);
|
||||
@@ -174,9 +176,8 @@ void MainMainWindow::setupMailPage() {
|
||||
m_emailViewer->setMinimumWidth(350);
|
||||
connect(m_emailViewer, &ReaderView::replyRequested, this, &MainMainWindow::onReaderReplyRequested);
|
||||
connect(m_emailViewer, &ReaderView::detachRequested, this, [this]() {
|
||||
std::optional<MailItem> currentItem = MailItemDao::findById(m_emailModel->getCurrentMailId());
|
||||
if (currentItem) {
|
||||
openMailInIndependentWindow(currentItem->id());
|
||||
if (m_currentMailId >= 0) {
|
||||
openMailInIndependentWindow(m_currentMailId);
|
||||
}
|
||||
});
|
||||
m_folderSplitter->addWidget(m_emailViewer);
|
||||
@@ -227,6 +228,7 @@ void MainMainWindow::onFolderSelected(const QModelIndex &index) {
|
||||
}
|
||||
|
||||
void MainMainWindow::onEmailSelected(int mailId) {
|
||||
m_currentMailId = mailId;
|
||||
std::optional<MailItem> item = MailItemDao::findById(mailId);
|
||||
if (!item.has_value()) {
|
||||
m_emailViewer->setMailItem(nullptr);
|
||||
@@ -282,6 +284,7 @@ void MainMainWindow::createToolBar() {
|
||||
QAction *newMsgAction = m_toolBar->addAction("✉ New Message");
|
||||
m_toolBar->addSeparator();
|
||||
QAction *syncAction = m_toolBar->addAction("⟳ Sync/Refresh");
|
||||
QAction *openWinAction = m_toolBar->addAction("↗ Abrir en ventana");
|
||||
QAction *deleteAction = m_toolBar->addAction("🗑 Delete");
|
||||
|
||||
connect(newMsgAction, &QAction::triggered, this, &MainMainWindow::onNewMessage);
|
||||
@@ -291,6 +294,13 @@ void MainMainWindow::createToolBar() {
|
||||
statusBar()->showMessage("Refreshed", 2000);
|
||||
}
|
||||
});
|
||||
connect(openWinAction, &QAction::triggered, [this]() {
|
||||
if (m_currentMailId >= 0) {
|
||||
openMailInIndependentWindow(m_currentMailId);
|
||||
} else {
|
||||
statusBar()->showMessage("Selecciona un correo primero para abrirlo en una ventana", 3000);
|
||||
}
|
||||
});
|
||||
connect(deleteAction, &QAction::triggered, [this]() {
|
||||
statusBar()->showMessage("Delete would be implemented here", 3000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user