author | alwin <alwin> | 2004-01-08 14:16:42 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-01-08 14:16:42 (UTC) |
commit | 76dc6aa8f7bced18048430602b33f512742cbfce (patch) (unidiff) | |
tree | 2da923c1e8523b0622453bdc9b4f20fac9d0decd | |
parent | ab6a32266c8fb625e782c601c9729af7f98904f6 (diff) | |
download | opie-76dc6aa8f7bced18048430602b33f512742cbfce.zip opie-76dc6aa8f7bced18048430602b33f512742cbfce.tar.gz opie-76dc6aa8f7bced18048430602b33f512742cbfce.tar.bz2 |
unified interface - forgot some slots
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index c38392c..2a1f90d 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -1,205 +1,217 @@ | |||
1 | #include <qlabel.h> | 1 | #include <qlabel.h> |
2 | #include <qvbox.h> | 2 | #include <qvbox.h> |
3 | #include <qheader.h> | 3 | #include <qheader.h> |
4 | #include <qtimer.h> | 4 | #include <qtimer.h> |
5 | #include <qlayout.h> | 5 | #include <qlayout.h> |
6 | #include <qmessagebox.h> | 6 | #include <qmessagebox.h> |
7 | 7 | ||
8 | #include <qpe/qpeapplication.h> | 8 | #include <qpe/qpeapplication.h> |
9 | #include <qpe/resource.h> | 9 | #include <qpe/resource.h> |
10 | 10 | ||
11 | #include "defines.h" | 11 | #include "defines.h" |
12 | #include "mainwindow.h" | 12 | #include "mainwindow.h" |
13 | 13 | ||
14 | 14 | ||
15 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 15 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
16 | : QMainWindow( parent, name, flags ) | 16 | : QMainWindow( parent, name, flags ) |
17 | { | 17 | { |
18 | 18 | ||
19 | setCaption( tr( "Mail" ) ); | 19 | setCaption( tr( "Mail" ) ); |
20 | setToolBarsMovable( false ); | 20 | setToolBarsMovable( false ); |
21 | 21 | ||
22 | toolBar = new QToolBar( this ); | 22 | toolBar = new QToolBar( this ); |
23 | menuBar = new QMenuBar( toolBar ); | 23 | menuBar = new QMenuBar( toolBar ); |
24 | mailMenu = new QPopupMenu( menuBar ); | 24 | mailMenu = new QPopupMenu( menuBar ); |
25 | menuBar->insertItem( tr( "Mail" ), mailMenu ); | 25 | menuBar->insertItem( tr( "Mail" ), mailMenu ); |
26 | settingsMenu = new QPopupMenu( menuBar ); | 26 | settingsMenu = new QPopupMenu( menuBar ); |
27 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); | 27 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); |
28 | 28 | ||
29 | addToolBar( toolBar ); | 29 | addToolBar( toolBar ); |
30 | toolBar->setHorizontalStretchable( true ); | 30 | toolBar->setHorizontalStretchable( true ); |
31 | 31 | ||
32 | QLabel *spacer = new QLabel( toolBar ); | 32 | QLabel *spacer = new QLabel( toolBar ); |
33 | spacer->setBackgroundMode( QWidget::PaletteButton ); | 33 | spacer->setBackgroundMode( QWidget::PaletteButton ); |
34 | toolBar->setStretchableWidget( spacer ); | 34 | toolBar->setStretchableWidget( spacer ); |
35 | 35 | ||
36 | composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, | 36 | composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, |
37 | 0, 0, this ); | 37 | 0, 0, this ); |
38 | composeMail->addTo( toolBar ); | 38 | composeMail->addTo( toolBar ); |
39 | composeMail->addTo( mailMenu ); | 39 | composeMail->addTo( mailMenu ); |
40 | 40 | ||
41 | sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, | 41 | sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, |
42 | 0, 0, this ); | 42 | 0, 0, this ); |
43 | sendQueued->addTo( toolBar ); | 43 | sendQueued->addTo( toolBar ); |
44 | sendQueued->addTo( mailMenu ); | 44 | sendQueued->addTo( mailMenu ); |
45 | 45 | ||
46 | /* | 46 | /* |
47 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, | 47 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, |
48 | 0, 0, this ); | 48 | 0, 0, this ); |
49 | syncFolders->addTo( toolBar ); | 49 | syncFolders->addTo( toolBar ); |
50 | syncFolders->addTo( mailMenu ); | 50 | syncFolders->addTo( mailMenu ); |
51 | */ | 51 | */ |
52 | 52 | ||
53 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, | 53 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, |
54 | 0, 0, this, 0, true ); | 54 | 0, 0, this, 0, true ); |
55 | showFolders->addTo( toolBar ); | 55 | showFolders->addTo( toolBar ); |
56 | showFolders->addTo( mailMenu ); | 56 | showFolders->addTo( mailMenu ); |
57 | showFolders->setOn( true ); | 57 | showFolders->setOn( true ); |
58 | connect(showFolders, SIGNAL( toggled( bool ) ), | 58 | connect(showFolders, SIGNAL( toggled( bool ) ), |
59 | SLOT( slotShowFolders( bool ) ) ); | 59 | SLOT( slotShowFolders( bool ) ) ); |
60 | 60 | ||
61 | /* | 61 | /* |
62 | searchMails = new QAction( tr( "Search mails" ), QIconSet( Resource::loadPixmap("find") ), | 62 | searchMails = new QAction( tr( "Search mails" ), QIconSet( Resource::loadPixmap("find") ), |
63 | 0, 0, this ); | 63 | 0, 0, this ); |
64 | searchMails->addTo( toolBar ); | 64 | searchMails->addTo( toolBar ); |
65 | searchMails->addTo( mailMenu ); | 65 | searchMails->addTo( mailMenu ); |
66 | */ | 66 | */ |
67 | 67 | ||
68 | deleteMails = new QAction(tr("Delete Mail"), QIconSet( Resource::loadPixmap("trash")), 0, 0, this); | 68 | deleteMails = new QAction(tr("Delete Mail"), QIconSet( Resource::loadPixmap("trash")), 0, 0, this); |
69 | deleteMails->addTo( toolBar ); | 69 | deleteMails->addTo( toolBar ); |
70 | deleteMails->addTo( mailMenu ); | 70 | deleteMails->addTo( mailMenu ); |
71 | connect( deleteMails, SIGNAL( activated() ), | 71 | connect( deleteMails, SIGNAL( activated() ), |
72 | SLOT( slotDeleteMail() ) ); | 72 | SLOT( slotDeleteMail() ) ); |
73 | 73 | ||
74 | editSettings = new QAction( tr( "Edit settings" ), QIconSet( Resource::loadPixmap("SettingsIcon") ) , | 74 | editSettings = new QAction( tr( "Edit settings" ), QIconSet( Resource::loadPixmap("SettingsIcon") ) , |
75 | 0, 0, this ); | 75 | 0, 0, this ); |
76 | editSettings->addTo( settingsMenu ); | 76 | editSettings->addTo( settingsMenu ); |
77 | connect( editSettings, SIGNAL( activated() ), | 77 | connect( editSettings, SIGNAL( activated() ), |
78 | SLOT( slotEditSettings() ) ); | 78 | SLOT( slotEditSettings() ) ); |
79 | editAccounts = new QAction( tr( "Configure accounts" ), QIconSet( Resource::loadPixmap("mail/editaccounts") ) , | 79 | editAccounts = new QAction( tr( "Configure accounts" ), QIconSet( Resource::loadPixmap("mail/editaccounts") ) , |
80 | 0, 0, this ); | 80 | 0, 0, this ); |
81 | editAccounts->addTo( settingsMenu ); | 81 | editAccounts->addTo( settingsMenu ); |
82 | 82 | ||
83 | //setCentralWidget( view ); | 83 | //setCentralWidget( view ); |
84 | 84 | ||
85 | QVBox* wrapperBox = new QVBox( this ); | 85 | QVBox* wrapperBox = new QVBox( this ); |
86 | setCentralWidget( wrapperBox ); | 86 | setCentralWidget( wrapperBox ); |
87 | 87 | ||
88 | QWidget *view = new QWidget( wrapperBox ); | 88 | QWidget *view = new QWidget( wrapperBox ); |
89 | 89 | ||
90 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); | 90 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); |
91 | 91 | ||
92 | folderView = new AccountView( view ); | 92 | folderView = new AccountView( view ); |
93 | folderView->header()->hide(); | 93 | folderView->header()->hide(); |
94 | folderView->setRootIsDecorated( true ); | 94 | folderView->setRootIsDecorated( true ); |
95 | folderView->addColumn( tr( "Mailbox" ) ); | 95 | folderView->addColumn( tr( "Mailbox" ) ); |
96 | 96 | ||
97 | layout->addWidget( folderView ); | 97 | layout->addWidget( folderView ); |
98 | 98 | ||
99 | mailView = new QListView( view ); | 99 | mailView = new QListView( view ); |
100 | mailView->addColumn( tr( "" ) ); | 100 | mailView->addColumn( tr( "" ) ); |
101 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); | 101 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); |
102 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); | 102 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); |
103 | mailView->addColumn( tr( "Size" ),QListView::Manual); | 103 | mailView->addColumn( tr( "Size" ),QListView::Manual); |
104 | mailView->addColumn( tr( "Date" )); | 104 | mailView->addColumn( tr( "Date" )); |
105 | mailView->setAllColumnsShowFocus(true); | 105 | mailView->setAllColumnsShowFocus(true); |
106 | mailView->setSorting(-1); | 106 | mailView->setSorting(-1); |
107 | 107 | ||
108 | statusWidget = new StatusWidget( wrapperBox ); | 108 | statusWidget = new StatusWidget( wrapperBox ); |
109 | statusWidget->hide(); | 109 | statusWidget->hide(); |
110 | 110 | ||
111 | layout->addWidget( mailView ); | 111 | layout->addWidget( mailView ); |
112 | layout->setStretchFactor( folderView, 1 ); | 112 | layout->setStretchFactor( folderView, 1 ); |
113 | layout->setStretchFactor( mailView, 2 ); | 113 | layout->setStretchFactor( mailView, 2 ); |
114 | 114 | ||
115 | slotAdjustLayout(); | 115 | slotAdjustLayout(); |
116 | 116 | ||
117 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); | 117 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); |
118 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); | 118 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); |
119 | 119 | ||
120 | connect( mailView, SIGNAL( mouseButtonClicked(int, QListViewItem *,const QPoint&,int ) ),this, | 120 | connect( mailView, SIGNAL( mouseButtonClicked(int, QListViewItem *,const QPoint&,int ) ),this, |
121 | SLOT( mailLeftClicked( int, QListViewItem *,const QPoint&,int ) ) ); | 121 | SLOT( mailLeftClicked( int, QListViewItem *,const QPoint&,int ) ) ); |
122 | connect( mailView, SIGNAL( mouseButtonPressed(int, QListViewItem *,const QPoint&,int ) ),this, | 122 | connect( mailView, SIGNAL( mouseButtonPressed(int, QListViewItem *,const QPoint&,int ) ),this, |
123 | SLOT( mailHold( int, QListViewItem *,const QPoint&,int ) ) ); | 123 | SLOT( mailHold( int, QListViewItem *,const QPoint&,int ) ) ); |
124 | connect(folderView, SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); | 124 | connect(folderView, SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); |
125 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 125 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
126 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 126 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
127 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 127 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
128 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 128 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
129 | // Added by Stefan Eilers to allow starting by addressbook.. | 129 | // Added by Stefan Eilers to allow starting by addressbook.. |
130 | // copied from old mail2 | 130 | // copied from old mail2 |
131 | #if !defined(QT_NO_COP) | 131 | #if !defined(QT_NO_COP) |
132 | connect( qApp, SIGNAL( appMessage( const QCString&, const QByteArray& ) ), | 132 | connect( qApp, SIGNAL( appMessage( const QCString&, const QByteArray& ) ), |
133 | this, SLOT( appMessage( const QCString&, const QByteArray& ) ) ); | 133 | this, SLOT( appMessage( const QCString&, const QByteArray& ) ) ); |
134 | #endif | 134 | #endif |
135 | 135 | ||
136 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 136 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
137 | } | 137 | } |
138 | 138 | ||
139 | MainWindow::~MainWindow() | 139 | MainWindow::~MainWindow() |
140 | { | 140 | { |
141 | } | 141 | } |
142 | 142 | ||
143 | void MainWindow::appMessage(const QCString &, const QByteArray &) | 143 | void MainWindow::appMessage(const QCString &, const QByteArray &) |
144 | { | 144 | { |
145 | qDebug("appMessage not reached"); | 145 | qDebug("appMessage not reached"); |
146 | } | 146 | } |
147 | 147 | ||
148 | void MainWindow::slotAdjustLayout() { | 148 | void MainWindow::slotAdjustLayout() { |
149 | 149 | ||
150 | QWidget *d = QApplication::desktop(); | 150 | QWidget *d = QApplication::desktop(); |
151 | 151 | ||
152 | if ( d->width() < d->height() ) { | 152 | if ( d->width() < d->height() ) { |
153 | layout->setDirection( QBoxLayout::TopToBottom ); | 153 | layout->setDirection( QBoxLayout::TopToBottom ); |
154 | } else { | 154 | } else { |
155 | layout->setDirection( QBoxLayout::LeftToRight ); | 155 | layout->setDirection( QBoxLayout::LeftToRight ); |
156 | } | 156 | } |
157 | } | 157 | } |
158 | 158 | ||
159 | void MainWindow::slotAdjustColumns() | 159 | void MainWindow::slotAdjustColumns() |
160 | { | 160 | { |
161 | bool hidden = folderView->isHidden(); | 161 | bool hidden = folderView->isHidden(); |
162 | if ( hidden ) folderView->show(); | 162 | if ( hidden ) folderView->show(); |
163 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 163 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
164 | if ( hidden ) folderView->hide(); | 164 | if ( hidden ) folderView->hide(); |
165 | 165 | ||
166 | mailView->setColumnWidth( 0, 10 ); | 166 | mailView->setColumnWidth( 0, 10 ); |
167 | mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); | 167 | mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); |
168 | mailView->setColumnWidth( 2, 80 ); | 168 | mailView->setColumnWidth( 2, 80 ); |
169 | mailView->setColumnWidth( 3, 50 ); | 169 | mailView->setColumnWidth( 3, 50 ); |
170 | mailView->setColumnWidth( 4, 50 ); | 170 | mailView->setColumnWidth( 4, 50 ); |
171 | } | 171 | } |
172 | 172 | ||
173 | void MainWindow::slotEditSettings() | 173 | void MainWindow::slotEditSettings() |
174 | { | 174 | { |
175 | } | 175 | } |
176 | 176 | ||
177 | void MainWindow::slotShowFolders( bool ) | 177 | void MainWindow::slotShowFolders( bool ) |
178 | { | 178 | { |
179 | qDebug( "slotShowFolders not reached" ); | 179 | qDebug( "slotShowFolders not reached" ); |
180 | } | 180 | } |
181 | 181 | ||
182 | void MainWindow::refreshMailView(QList<RecMail>*) | 182 | void MainWindow::refreshMailView(QList<RecMail>*) |
183 | { | 183 | { |
184 | qDebug( "refreshMailView not reached" ); | 184 | qDebug( "refreshMailView not reached" ); |
185 | } | 185 | } |
186 | 186 | ||
187 | void MainWindow::mailLeftClicked(int, QListViewItem *,const QPoint&,int ) | 187 | void MainWindow::mailLeftClicked(int, QListViewItem *,const QPoint&,int ) |
188 | { | 188 | { |
189 | qDebug( "mailLeftClicked not reached" ); | 189 | qDebug( "mailLeftClicked not reached" ); |
190 | } | 190 | } |
191 | 191 | ||
192 | void MainWindow::displayMail() | 192 | void MainWindow::displayMail() |
193 | { | 193 | { |
194 | qDebug("displayMail not reached"); | 194 | qDebug("displayMail not reached"); |
195 | } | 195 | } |
196 | 196 | ||
197 | void MainWindow::slotDeleteMail() | 197 | void MainWindow::slotDeleteMail() |
198 | { | 198 | { |
199 | qDebug("deleteMail not reached"); | 199 | qDebug("deleteMail not reached"); |
200 | } | 200 | } |
201 | 201 | ||
202 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) | 202 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) |
203 | { | 203 | { |
204 | qDebug("mailHold not reached"); | 204 | qDebug("mailHold not reached"); |
205 | } | 205 | } |
206 | |||
207 | void MainWindow::slotSendQueued() | ||
208 | { | ||
209 | } | ||
210 | |||
211 | void MainWindow::slotEditAccounts() | ||
212 | { | ||
213 | } | ||
214 | |||
215 | void MainWindow::slotComposeMail() | ||
216 | { | ||
217 | } | ||
diff --git a/noncore/net/mail/mainwindow.h b/noncore/net/mail/mainwindow.h index 20614cc..1ba6299 100644 --- a/noncore/net/mail/mainwindow.h +++ b/noncore/net/mail/mainwindow.h | |||
@@ -1,50 +1,53 @@ | |||
1 | #ifndef MAINWINDOW_H | 1 | #ifndef MAINWINDOW_H |
2 | #define MAINWINDOW_H | 2 | #define MAINWINDOW_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | #include <qlistview.h> | 5 | #include <qlistview.h> |
6 | #include <qaction.h> | 6 | #include <qaction.h> |
7 | 7 | ||
8 | #include <qtoolbar.h> | 8 | #include <qtoolbar.h> |
9 | #include <qmenubar.h> | 9 | #include <qmenubar.h> |
10 | 10 | ||
11 | #include "accountview.h" | 11 | #include "accountview.h" |
12 | #include "statuswidget.h" | 12 | #include "statuswidget.h" |
13 | 13 | ||
14 | class RecMail; | 14 | class RecMail; |
15 | 15 | ||
16 | class MainWindow : public QMainWindow | 16 | class MainWindow : public QMainWindow |
17 | { | 17 | { |
18 | Q_OBJECT | 18 | Q_OBJECT |
19 | 19 | ||
20 | public: | 20 | public: |
21 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); | 21 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); |
22 | virtual ~MainWindow(); | 22 | virtual ~MainWindow(); |
23 | 23 | ||
24 | public slots: | 24 | public slots: |
25 | virtual void slotAdjustColumns(); | 25 | virtual void slotAdjustColumns(); |
26 | virtual void appMessage(const QCString &msg, const QByteArray &data); | 26 | virtual void appMessage(const QCString &msg, const QByteArray &data); |
27 | virtual void slotComposeMail(); | ||
27 | 28 | ||
28 | protected slots: | 29 | protected slots: |
30 | virtual void slotSendQueued(); | ||
31 | virtual void slotEditAccounts(); | ||
29 | virtual void slotShowFolders( bool show ); | 32 | virtual void slotShowFolders( bool show ); |
30 | virtual void refreshMailView(QList<RecMail>*); | 33 | virtual void refreshMailView(QList<RecMail>*); |
31 | virtual void displayMail(); | 34 | virtual void displayMail(); |
32 | virtual void slotDeleteMail(); | 35 | virtual void slotDeleteMail(); |
33 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); | 36 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); |
34 | virtual void slotAdjustLayout(); | 37 | virtual void slotAdjustLayout(); |
35 | virtual void slotEditSettings(); | 38 | virtual void slotEditSettings(); |
36 | virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int ); | 39 | virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int ); |
37 | 40 | ||
38 | protected: | 41 | protected: |
39 | QToolBar *toolBar; | 42 | QToolBar *toolBar; |
40 | StatusWidget *statusWidget; | 43 | StatusWidget *statusWidget; |
41 | QMenuBar *menuBar; | 44 | QMenuBar *menuBar; |
42 | QPopupMenu *mailMenu, *settingsMenu; | 45 | QPopupMenu *mailMenu, *settingsMenu; |
43 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, | 46 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, |
44 | *editSettings, *editAccounts, *syncFolders; | 47 | *editSettings, *editAccounts, *syncFolders; |
45 | AccountView *folderView; | 48 | AccountView *folderView; |
46 | QListView *mailView; | 49 | QListView *mailView; |
47 | QBoxLayout *layout; | 50 | QBoxLayout *layout; |
48 | }; | 51 | }; |
49 | 52 | ||
50 | #endif | 53 | #endif |