summaryrefslogtreecommitdiff
path: root/noncore/net/mail/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mail/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/mainwindow.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index 3689352..b587424 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -18,155 +18,162 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
{
setCaption( tr( "Mail" ) );
setToolBarsMovable( false );
toolBar = new QToolBar( this );
menuBar = new QMenuBar( toolBar );
mailMenu = new QPopupMenu( menuBar );
menuBar->insertItem( tr( "Mail" ), mailMenu );
settingsMenu = new QPopupMenu( menuBar );
menuBar->insertItem( tr( "Settings" ), settingsMenu );
if (QApplication::desktop()->width()<330) {
serverMenu = new QPopupMenu( mailMenu );
folderMenu = new QPopupMenu( mailMenu );
m_ServerMenuId = mailMenu->insertItem( tr( "Server" ), serverMenu );
m_FolderMenuId = mailMenu->insertItem( tr( "Folder" ), folderMenu );
} else {
serverMenu = new QPopupMenu( menuBar );
folderMenu = new QPopupMenu( menuBar );
m_FolderMenuId = menuBar->insertItem( tr( "Folder" ), folderMenu );
m_ServerMenuId = menuBar->insertItem( tr( "Server" ), serverMenu );
}
serverMenu->insertItem(tr("Disconnect"),SERVER_MENU_DISCONNECT);
serverMenu->insertItem(tr("Set on/offline"),SERVER_MENU_OFFLINE);
serverMenu->insertSeparator();
serverMenu->insertItem(tr("Refresh folder list"),SERVER_MENU_REFRESH_FOLDER);
serverMenu->insertItem(tr("Create new folder"),SERVER_MENU_CREATE_FOLDER);
serverMenu->insertSeparator();
serverMenu->insertItem(tr("(Un-)Subscribe groups"),SERVER_MENU_SUBSCRIBE);
folderMenu->insertItem(tr("Refresh headerlist"),FOLDER_MENU_REFRESH_HEADER);
folderMenu->insertItem(tr("Delete all mails"),FOLDER_MENU_DELETE_ALL_MAILS);
folderMenu->insertItem(tr("New subfolder"),FOLDER_MENU_NEW_SUBFOLDER);
folderMenu->insertItem(tr("Delete folder"),FOLDER_MENU_DELETE_FOLDER);
folderMenu->insertItem(tr("Move/Copie all mails"),FOLDER_MENU_MOVE_MAILS);
menuBar->setItemEnabled(m_ServerMenuId,false);
menuBar->setItemEnabled(m_FolderMenuId,false);
addToolBar( toolBar );
toolBar->setHorizontalStretchable( true );
QLabel *spacer = new QLabel( toolBar );
spacer->setBackgroundMode( QWidget::PaletteButton );
toolBar->setStretchableWidget( spacer );
+ readMail = new QAction(tr("Read current mail"),ICON_READMAIL,0,0,this);
+ readMail->addTo(toolBar);
+ readMail->addTo(mailMenu);
+ connect(readMail,SIGNAL(activated()),this,SLOT(displayMail()));
+
composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL,
0, 0, this );
composeMail->addTo( toolBar );
composeMail->addTo( mailMenu );
+
sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED,
0, 0, this );
sendQueued->addTo( toolBar );
sendQueued->addTo( mailMenu );
/*
syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC,
0, 0, this );
syncFolders->addTo( toolBar );
syncFolders->addTo( mailMenu );
*/
showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS,
0, 0, this, 0, true );
showFolders->addTo( toolBar );
showFolders->addTo( mailMenu );
showFolders->setOn( true );
connect(showFolders, SIGNAL( toggled(bool) ),
SLOT( slotShowFolders(bool) ) );
/*
searchMails = new QAction( tr( "Search mails" ), QIconSet( Resource::loadPixmap("find") ),
0, 0, this );
searchMails->addTo( toolBar );
searchMails->addTo( mailMenu );
*/
deleteMails = new QAction(tr("Delete Mail"), QIconSet( Resource::loadPixmap("trash")), 0, 0, this);
deleteMails->addTo( toolBar );
deleteMails->addTo( mailMenu );
connect( deleteMails, SIGNAL( activated() ),
SLOT( slotDeleteMail() ) );
editSettings = new QAction( tr( "Edit settings" ), QIconSet( Resource::loadPixmap("SettingsIcon") ) ,
0, 0, this );
editSettings->addTo( settingsMenu );
connect( editSettings, SIGNAL( activated() ),
SLOT( slotEditSettings() ) );
editAccounts = new QAction( tr( "Configure accounts" ), QIconSet( Resource::loadPixmap("mail/editaccounts") ) ,
0, 0, this );
editAccounts->addTo( settingsMenu );
QWidget *view = new QWidget( this );
setCentralWidget( view );
layout = new QBoxLayout ( view, QBoxLayout::LeftToRight );
folderView = new AccountView( view );
folderView->header()->hide();
folderView->setRootIsDecorated( true );
folderView->addColumn( tr( "Mailbox" ) );
connect(folderView,SIGNAL(serverSelected(int)),this,SLOT(serverSelected(int)));
connect(serverMenu,SIGNAL(activated(int)),folderView,SLOT(slotContextMenu(int)));
connect(folderMenu,SIGNAL(activated(int)),folderView,SLOT(slotContextMenu(int)));
+ connect(this,SIGNAL(settingsChanged()),folderView,SLOT(readSettings()));
layout->addWidget( folderView );
mailView = new QListView( view );
mailView->addColumn( "" );
mailView->addColumn( tr( "Subject" ),QListView::Manual );
mailView->addColumn( tr( "Sender" ),QListView::Manual );
mailView->addColumn( tr( "Size" ),QListView::Manual);
mailView->addColumn( tr( "Date" ));
mailView->setAllColumnsShowFocus(true);
mailView->setShowSortIndicator(true);
mailView->setSorting(4,false);
layout->addWidget( mailView );
layout->setStretchFactor( folderView, 1 );
layout->setStretchFactor( mailView, 2 );
m_Rotate = (QApplication::desktop()->width() > QApplication::desktop()->height()?0:90);
slotAdjustLayout();
QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold);
QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold);
connect( mailView, SIGNAL( mouseButtonClicked(int,QListViewItem*,const QPoint&,int) ),this,
SLOT( mailLeftClicked(int,QListViewItem*,const QPoint&,int) ) );
connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) );
connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)),
this,SLOT(refreshMailView(const QValueList<RecMailP>&)));
connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) );
connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) );
// Added by Stefan Eilers to allow starting by addressbook..
// copied from old mail2
#if !defined(QT_NO_COP)
connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ),
this, SLOT( appMessage(const QCString&,const QByteArray&) ) );
m_sysChannel = new QCopChannel( "QPE/System", this );
connect( m_sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ),
this, SLOT( systemMessage(const QCString&,const QByteArray&) ) );
#endif