summaryrefslogtreecommitdiffabout
path: root/kmicromail/mainwindow.cpp
authorzautrix <zautrix>2004-11-06 23:30:02 (UTC)
committer zautrix <zautrix>2004-11-06 23:30:02 (UTC)
commit023e0e82dd8bf6421d12492a2dd25534fc43ad31 (patch) (side-by-side diff)
treecf0533e3ccc642cb57a41953f184f457fa5365ba /kmicromail/mainwindow.cpp
parentf8841c92d5251f713eb7a025af8fdee52de45b3d (diff)
downloadkdepimpi-023e0e82dd8bf6421d12492a2dd25534fc43ad31.zip
kdepimpi-023e0e82dd8bf6421d12492a2dd25534fc43ad31.tar.gz
kdepimpi-023e0e82dd8bf6421d12492a2dd25534fc43ad31.tar.bz2
many ompi fixes
Diffstat (limited to 'kmicromail/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/mainwindow.cpp45
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
@@ -1,39 +1,40 @@
// CHANGED 2004-08-06 Lutz Rogowski
#include <qlabel.h>
#include <qvbox.h>
#include <qheader.h>
#include <qtimer.h>
#include <qlayout.h>
//#include <kdialog.h>
#include <kiconloader.h>
#include <kapplication.h>
#ifdef DESKTOP_VERSION
#include <qapplication.h>
#include <qstatusbar.h>
+#include <kabc/stdaddressbook.h>
extern QStatusBar* globalSstatusBarMainWindow;
#else
#include <qpe/qpeapplication.h>
#endif
#include "defines.h"
#include "mainwindow.h"
#include <KDGanttMinimizeSplitter.h>
-#include <kabc/stdaddressbook.h>
+#include "koprefs.h"
MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
: QMainWindow( parent, name ) //, flags )
{
#ifdef DESKTOP_VERSION
globalSstatusBarMainWindow = statusBar();
#endif
setCaption( i18n( "KOpieMail/Pi" ) );
setToolBarsMovable( false );
//KABC::StdAddressBook::self();
toolBar = new QToolBar( this );
menuBar = new QPEMenuBar( toolBar );
mailMenu = new QPopupMenu( menuBar );
menuBar->insertItem( i18n( "Mail" ), mailMenu );
settingsMenu = new QPopupMenu( menuBar );
menuBar->insertItem( i18n( "Settings" ), settingsMenu );
@@ -86,33 +87,40 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
*/
deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this);
deleteMails->addTo( toolBar );
deleteMails->addTo( mailMenu );
connect( deleteMails, SIGNAL( activated() ),
SLOT( slotDeleteMail() ) );
editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") ,
0, 0, this );
editSettings->addTo( settingsMenu );
connect( editSettings, SIGNAL( activated() ),
SLOT( slotEditSettings() ) );
editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") ,
0, 0, this );
editAccounts->addTo( settingsMenu );
-
+ codecMenu = new QPopupMenu( menuBar );
+ codecMenu->insertItem( "Western (iso-8859-1)",0,0);
+ codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1);
+ codecMenu->insertItem( "Western (iso-8859-15)",2,2);
+ codecMenu->insertItem( "Chinese (big-5)",3,3);
+ codecMenu->insertItem( "Unicode (utf-8)",4,4);
+ codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5);
+ settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu);
//setCentralWidget( view );
QVBox* wrapperBox = new QVBox( this );
setCentralWidget( wrapperBox );
// QWidget *view = new QWidget( wrapperBox );
KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox);
split->setMinimizeDirection( KDGanttMinimizeSplitter::Left);
//layout = new QBoxLayout ( split, QBoxLayout::LeftToRight );
folderView = new AccountView( split );
folderView->header()->hide();
folderView->setRootIsDecorated( false );
folderView->addColumn( i18n( "Mailbox" ) );
//layout->addWidget( folderView );
@@ -170,41 +178,74 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
if ( QApplication::desktop()->width() > 320 )
closeMail->addTo(toolBar);
closeMail->addTo(mailMenu);
QPopupMenu* helpMenu = new QPopupMenu( menuBar );
menuBar->insertItem( i18n( "Help" ), helpMenu );
QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this);
connect( li, SIGNAL( activated() ), SLOT( showAbout()) );
li->addTo(helpMenu);
li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this);
connect( li, SIGNAL( activated() ), SLOT( showLicence()) );
li->addTo(helpMenu);
li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this);
connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) );
li->addTo(helpMenu);
+ connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) );
+ slotSetCodec( KOPrefs::instance()->mCurrentCodec );
#ifdef DESKTOP_VERSION
resize ( 640, 480 );
#endif
}
MainWindow::~MainWindow()
{
}
+void MainWindow::slotSetCodec( int codec )
+{
+ codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false );
+ //qDebug("codec %d ", codec);
+ KOPrefs::instance()->mCurrentCodec = codec;
+ KOPrefs::instance()->isDirty = true;
+ QString name;
+ switch ( codec ) {
+ case 0:
+ name = "iso-8859-1";
+ break;
+ case 1:
+ name = "iso-8859-5";
+ break;
+ case 2:
+ name = "iso-8859-15";
+ break;
+ case 3:
+ name = "big-5";
+ break;
+ case 4:
+ name = "utf-8";
+ break;
+ case 5:
+ name = KOPrefs::instance()->mSendCodec.lower();
+ break;
+ }
+ KOPrefs::instance()->mCurrentCodeName = name ;
+ codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")");
+ codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true );
+}
void MainWindow::showLicence()
{
KApplication::showLicence();
}
void MainWindow::showAbout()
{
QString version;
#include <../version>
QString cap = "About KOpieMail/Pi";
QString text = i18n("KOpieMail/Platform-independent\n") +
"(OM/Pi) " + version + " - "
#ifdef DESKTOP_VERSION
"Desktop Edition\n"
#else