Diffstat (limited to 'noncore/net/mail/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index 2b5870a..391b55e 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -36,96 +36,97 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
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 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, | 46 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, |
47 | 0, 0, this ); | 47 | 0, 0, this ); |
48 | syncFolders->addTo( toolBar ); | 48 | syncFolders->addTo( toolBar ); |
49 | syncFolders->addTo( mailMenu ); | 49 | syncFolders->addTo( mailMenu ); |
50 | 50 | ||
51 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, | 51 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, |
52 | 0, 0, this, 0, true ); | 52 | 0, 0, this, 0, true ); |
53 | showFolders->addTo( toolBar ); | 53 | showFolders->addTo( toolBar ); |
54 | showFolders->addTo( mailMenu ); | 54 | showFolders->addTo( mailMenu ); |
55 | connect(showFolders, SIGNAL( toggled( bool ) ), | 55 | connect(showFolders, SIGNAL( toggled( bool ) ), |
56 | SLOT( slotShowFolders( bool ) ) ); | 56 | SLOT( slotShowFolders( bool ) ) ); |
57 | 57 | ||
58 | searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS, | 58 | searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS, |
59 | 0, 0, this ); | 59 | 0, 0, this ); |
60 | searchMails->addTo( toolBar ); | 60 | searchMails->addTo( toolBar ); |
61 | searchMails->addTo( mailMenu ); | 61 | searchMails->addTo( mailMenu ); |
62 | 62 | ||
63 | deleteMails = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); | 63 | deleteMails = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); |
64 | deleteMails->addTo( toolBar ); | 64 | deleteMails->addTo( toolBar ); |
65 | deleteMails->addTo( mailMenu ); | 65 | deleteMails->addTo( mailMenu ); |
66 | connect( deleteMails, SIGNAL( activated() ), | 66 | connect( deleteMails, SIGNAL( activated() ), |
67 | SLOT( slotDeleteMail() ) ); | 67 | SLOT( slotDeleteMail() ) ); |
68 | 68 | ||
69 | editSettings = new QAction( tr( "Edit settings" ), ICON_EDITSETTINGS, | 69 | editSettings = new QAction( tr( "Edit settings" ), ICON_EDITSETTINGS, |
70 | 0, 0, this ); | 70 | 0, 0, this ); |
71 | editSettings->addTo( settingsMenu ); | 71 | editSettings->addTo( settingsMenu ); |
72 | 72 | ||
73 | editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS, | 73 | editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS, |
74 | 0, 0, this ); | 74 | 0, 0, this ); |
75 | editAccounts->addTo( settingsMenu ); | 75 | editAccounts->addTo( settingsMenu ); |
76 | 76 | ||
77 | QWidget *view = new QWidget( this ); | 77 | QWidget *view = new QWidget( this ); |
78 | setCentralWidget( view ); | 78 | setCentralWidget( view ); |
79 | 79 | ||
80 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); | 80 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); |
81 | 81 | ||
82 | folderView = new AccountView( view ); | 82 | folderView = new AccountView( view ); |
83 | folderView->header()->hide(); | 83 | folderView->header()->hide(); |
84 | folderView->setRootIsDecorated( false ); | ||
84 | folderView->addColumn( tr( "Mailbox" ) ); | 85 | folderView->addColumn( tr( "Mailbox" ) ); |
85 | folderView->hide(); | 86 | folderView->hide(); |
86 | 87 | ||
87 | layout->addWidget( folderView ); | 88 | layout->addWidget( folderView ); |
88 | 89 | ||
89 | mailView = new QListView( view ); | 90 | mailView = new QListView( view ); |
90 | mailView->addColumn( tr( "" ) ); | 91 | mailView->addColumn( tr( "" ) ); |
91 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); | 92 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); |
92 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); | 93 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); |
93 | mailView->addColumn( tr( "Date" )); | 94 | mailView->addColumn( tr( "Date" )); |
94 | mailView->setAllColumnsShowFocus(true); | 95 | mailView->setAllColumnsShowFocus(true); |
95 | mailView->setSorting(-1); | 96 | mailView->setSorting(-1); |
96 | 97 | ||
97 | layout->addWidget( mailView ); | 98 | layout->addWidget( mailView ); |
98 | layout->setStretchFactor( folderView, 1 ); | 99 | layout->setStretchFactor( folderView, 1 ); |
99 | layout->setStretchFactor( mailView, 2 ); | 100 | layout->setStretchFactor( mailView, 2 ); |
100 | 101 | ||
101 | slotAdjustLayout(); | 102 | slotAdjustLayout(); |
102 | 103 | ||
103 | connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, | 104 | connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, |
104 | SLOT( displayMail( QListViewItem * ) ) ); | 105 | SLOT( displayMail( QListViewItem * ) ) ); |
105 | 106 | ||
106 | connect(folderView, SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); | 107 | connect(folderView, SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); |
107 | 108 | ||
108 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 109 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
109 | } | 110 | } |
110 | 111 | ||
111 | 112 | ||
112 | void MainWindow::slotAdjustLayout() { | 113 | void MainWindow::slotAdjustLayout() { |
113 | 114 | ||
114 | QWidget *d = QApplication::desktop(); | 115 | QWidget *d = QApplication::desktop(); |
115 | 116 | ||
116 | if ( d->width() < d->height() ) { | 117 | if ( d->width() < d->height() ) { |
117 | layout->setDirection( QBoxLayout::TopToBottom ); | 118 | layout->setDirection( QBoxLayout::TopToBottom ); |
118 | } else { | 119 | } else { |
119 | layout->setDirection( QBoxLayout::LeftToRight ); | 120 | layout->setDirection( QBoxLayout::LeftToRight ); |
120 | } | 121 | } |
121 | delete d; | 122 | delete d; |
122 | } | 123 | } |
123 | 124 | ||
124 | void MainWindow::slotAdjustColumns() | 125 | void MainWindow::slotAdjustColumns() |
125 | { | 126 | { |
126 | bool hidden = folderView->isHidden(); | 127 | bool hidden = folderView->isHidden(); |
127 | if ( hidden ) folderView->show(); | 128 | if ( hidden ) folderView->show(); |
128 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 129 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
129 | if ( hidden ) folderView->hide(); | 130 | if ( hidden ) folderView->hide(); |
130 | 131 | ||
131 | mailView->setColumnWidth( 0, 10 ); | 132 | mailView->setColumnWidth( 0, 10 ); |