-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index e466d9b..cab1a66 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -44,24 +44,25 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
44 | sendQueued->addTo( toolBar ); | 44 | sendQueued->addTo( toolBar ); |
45 | sendQueued->addTo( mailMenu ); | 45 | sendQueued->addTo( mailMenu ); |
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 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, | 52 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, |
53 | 0, 0, this, 0, true ); | 53 | 0, 0, this, 0, true ); |
54 | showFolders->addTo( toolBar ); | 54 | showFolders->addTo( toolBar ); |
55 | showFolders->addTo( mailMenu ); | 55 | showFolders->addTo( mailMenu ); |
56 | showFolders->setOn( true ); | ||
56 | connect(showFolders, SIGNAL( toggled( bool ) ), | 57 | connect(showFolders, SIGNAL( toggled( bool ) ), |
57 | SLOT( slotShowFolders( bool ) ) ); | 58 | SLOT( slotShowFolders( bool ) ) ); |
58 | 59 | ||
59 | searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS, | 60 | searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS, |
60 | 0, 0, this ); | 61 | 0, 0, this ); |
61 | searchMails->addTo( toolBar ); | 62 | searchMails->addTo( toolBar ); |
62 | searchMails->addTo( mailMenu ); | 63 | searchMails->addTo( mailMenu ); |
63 | 64 | ||
64 | deleteMails = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); | 65 | deleteMails = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); |
65 | deleteMails->addTo( toolBar ); | 66 | deleteMails->addTo( toolBar ); |
66 | deleteMails->addTo( mailMenu ); | 67 | deleteMails->addTo( mailMenu ); |
67 | connect( deleteMails, SIGNAL( activated() ), | 68 | connect( deleteMails, SIGNAL( activated() ), |
@@ -75,48 +76,49 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
75 | 0, 0, this ); | 76 | 0, 0, this ); |
76 | editAccounts->addTo( settingsMenu ); | 77 | editAccounts->addTo( settingsMenu ); |
77 | 78 | ||
78 | QWidget *view = new QWidget( this ); | 79 | QWidget *view = new QWidget( this ); |
79 | setCentralWidget( view ); | 80 | setCentralWidget( view ); |
80 | 81 | ||
81 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); | 82 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); |
82 | 83 | ||
83 | folderView = new AccountView( view ); | 84 | folderView = new AccountView( view ); |
84 | folderView->header()->hide(); | 85 | folderView->header()->hide(); |
85 | folderView->setRootIsDecorated( false ); | 86 | folderView->setRootIsDecorated( false ); |
86 | folderView->addColumn( tr( "Mailbox" ) ); | 87 | folderView->addColumn( tr( "Mailbox" ) ); |
87 | folderView->hide(); | 88 | //folderView->hide(); |
88 | 89 | ||
89 | layout->addWidget( folderView ); | 90 | layout->addWidget( folderView ); |
90 | 91 | ||
91 | mailView = new QListView( view ); | 92 | mailView = new QListView( view ); |
92 | mailView->addColumn( tr( "" ) ); | 93 | mailView->addColumn( tr( "" ) ); |
93 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); | 94 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); |
94 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); | 95 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); |
95 | mailView->addColumn( tr( "Date" )); | 96 | mailView->addColumn( tr( "Date" )); |
96 | mailView->setAllColumnsShowFocus(true); | 97 | mailView->setAllColumnsShowFocus(true); |
97 | mailView->setSorting(-1); | 98 | mailView->setSorting(-1); |
98 | 99 | ||
99 | layout->addWidget( mailView ); | 100 | layout->addWidget( mailView ); |
100 | layout->setStretchFactor( folderView, 1 ); | 101 | layout->setStretchFactor( folderView, 1 ); |
101 | layout->setStretchFactor( mailView, 2 ); | 102 | layout->setStretchFactor( mailView, 2 ); |
102 | 103 | ||
103 | slotAdjustLayout(); | 104 | slotAdjustLayout(); |
104 | 105 | ||
105 | connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, | 106 | connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, |
106 | SLOT( displayMail( QListViewItem * ) ) ); | 107 | SLOT( displayMail( QListViewItem * ) ) ); |
107 | 108 | ||
108 | connect(folderView, SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); | 109 | connect(folderView, SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); |
109 | 110 | ||
110 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 111 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
112 | |||
111 | } | 113 | } |
112 | 114 | ||
113 | 115 | ||
114 | void MainWindow::slotAdjustLayout() { | 116 | void MainWindow::slotAdjustLayout() { |
115 | 117 | ||
116 | QWidget *d = QApplication::desktop(); | 118 | QWidget *d = QApplication::desktop(); |
117 | 119 | ||
118 | if ( d->width() < d->height() ) { | 120 | if ( d->width() < d->height() ) { |
119 | layout->setDirection( QBoxLayout::TopToBottom ); | 121 | layout->setDirection( QBoxLayout::TopToBottom ); |
120 | } else { | 122 | } else { |
121 | layout->setDirection( QBoxLayout::LeftToRight ); | 123 | layout->setDirection( QBoxLayout::LeftToRight ); |
122 | } | 124 | } |