Hi folks,
I was working on a patch for Message Redirection[1] and thought I'd take
feedback on a mock UI. Would you suggest creating a new widget class for
the message redirection widget?
Otherwise, I wanted to have a ComposeWidget::createRedirect(..) type
static, just as an addition to the newly built static API for
ComposeWidget's creation. As the UI for message redirection doesn't need
many elements of a normal compose window, I thought of hide()ing the
widgets not required. Please take a look at the attached screenshot. The
code for this (following the approach I mentioned above) is this for a
quick look:
ComposeWidget *ComposeWidget::createRedirect(MainWindow *mainWindow, const
QModelIndex &redirectingMessage)
{
MSA::MSAFactory *msaFactory = mainWindow->msaFactory();
if (!msaFactory)
return 0;
Q_UNUSED(redirectingMessage); // mock UI
ComposeWidget *w = new ComposeWidget(mainWindow, msaFactory);
w->ui->mailText->hide();
w->ui->groupBox->hide();
w->setWindowTitle(tr("Redirect Mail")); // mock UI
Util::centerWidgetOnScreen(w);
w->show();
return w;
}
I like this hack because it re-uses GUI code, and allows creation of the
redirection widget to be grouped with creation of composer widget for other
purposes (new, draft, reply, forward, etc). But let me know if this is a
bad way to go about it.
Also, if I stick with this approach, then I will have to differentiate the
functionality of send() for the redirection case from the normal behaviour
of send().
Regards,
Karan
[1] https://bugs.kde.org/show_bug.cgi?id=334091