-rw-r--r-- | kmicromail/mainwindow.cpp | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index 98eb9a5..3013931 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -14,2 +14,3 @@ | |||
14 | #include <qstatusbar.h> | 14 | #include <qstatusbar.h> |
15 | #include <kabc/stdaddressbook.h> | ||
15 | extern QStatusBar* globalSstatusBarMainWindow; | 16 | extern QStatusBar* globalSstatusBarMainWindow; |
@@ -22,3 +23,3 @@ extern QStatusBar* globalSstatusBarMainWindow; | |||
22 | 23 | ||
23 | #include <kabc/stdaddressbook.h> | 24 | #include "koprefs.h" |
24 | 25 | ||
@@ -101,3 +102,10 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
101 | editAccounts->addTo( settingsMenu ); | 102 | editAccounts->addTo( settingsMenu ); |
102 | 103 | codecMenu = new QPopupMenu( menuBar ); | |
104 | codecMenu->insertItem( "Western (iso-8859-1)",0,0); | ||
105 | codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); | ||
106 | codecMenu->insertItem( "Western (iso-8859-15)",2,2); | ||
107 | codecMenu->insertItem( "Chinese (big-5)",3,3); | ||
108 | codecMenu->insertItem( "Unicode (utf-8)",4,4); | ||
109 | codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); | ||
110 | settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); | ||
103 | //setCentralWidget( view ); | 111 | //setCentralWidget( view ); |
@@ -185,2 +193,4 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
185 | li->addTo(helpMenu); | 193 | li->addTo(helpMenu); |
194 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); | ||
195 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); | ||
186 | #ifdef DESKTOP_VERSION | 196 | #ifdef DESKTOP_VERSION |
@@ -194,2 +204,33 @@ MainWindow::~MainWindow() | |||
194 | 204 | ||
205 | void MainWindow::slotSetCodec( int codec ) | ||
206 | { | ||
207 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); | ||
208 | //qDebug("codec %d ", codec); | ||
209 | KOPrefs::instance()->mCurrentCodec = codec; | ||
210 | KOPrefs::instance()->isDirty = true; | ||
211 | QString name; | ||
212 | switch ( codec ) { | ||
213 | case 0: | ||
214 | name = "iso-8859-1"; | ||
215 | break; | ||
216 | case 1: | ||
217 | name = "iso-8859-5"; | ||
218 | break; | ||
219 | case 2: | ||
220 | name = "iso-8859-15"; | ||
221 | break; | ||
222 | case 3: | ||
223 | name = "big-5"; | ||
224 | break; | ||
225 | case 4: | ||
226 | name = "utf-8"; | ||
227 | break; | ||
228 | case 5: | ||
229 | name = KOPrefs::instance()->mSendCodec.lower(); | ||
230 | break; | ||
231 | } | ||
232 | KOPrefs::instance()->mCurrentCodeName = name ; | ||
233 | codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")"); | ||
234 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true ); | ||
235 | } | ||
195 | void MainWindow::showLicence() | 236 | void MainWindow::showLicence() |