-rw-r--r-- | kmicromail/mainwindow.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index 0794e00..4c58909 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp @@ -142,192 +142,194 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; } infoBox->setMaximumHeight( infoBox->sizeHint().height() ); if ( !KOPrefs::instance()->mShowInfoStart ) { QTimer::singleShot( 1,splithor, SLOT ( toggle() ) ); } } folderView = new AccountView( split ); folderView->header()->hide(); folderView->setRootIsDecorated( false ); folderView->addColumn( i18n( "Mailbox" ) ); //layout->addWidget( folderView ); mailView = new QListView( split ); mailView->addColumn( i18n( " " ) ); mailView->addColumn( i18n( "Subject" ),QListView::Manual ); mailView->addColumn( i18n( "Sender" ),QListView::Manual ); mailView->addColumn( i18n( "Size" ),QListView::Manual); mailView->addColumn( i18n( "Date" ),QListView::Manual); if ( KOPrefs::instance()->mShowToField ) mailView->addColumn( i18n( "To" ),QListView::Manual); mailView->setAllColumnsShowFocus(true); //mailView->setSorting(-1); mailView->setRootIsDecorated( false ); statusWidget = new StatusWidget( wrapperBox ); statusWidget->hide(); //layout->addWidget( mailView ); //layout->setStretchFactor( folderView, 1 ); //layout->setStretchFactor( mailView, 2 ); slotAdjustLayout(); #ifndef DESKTOP_VERSION QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); if ( subLE ) QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); if ( fromLE ) QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); if ( toLE ) QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); #endif connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, SLOT( mailLeftClicked(QListViewItem*) ) ); connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, SLOT( mailLeftClicked(QListViewItem*) ) ); connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), this,SLOT(refreshMailView(const QValueList<RecMailP>&))); connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, SLOT( setInfoFields(QListViewItem*) ) ); connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); //mailView->setMultiSelection ( true ); mailView->setSelectionMode( QListView::Extended ); QValueList<int> list; int fw = 100; if ( QApplication::desktop()->width() > 320 ) fw = 50; list.append( fw ); list.append( 100 ); split->setSizes( list ); QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); mailView->setShowSortIndicator ( true ); QLabel *spacer = new QLabel( toolBar ); spacer->setBackgroundMode( QWidget::PaletteButton ); toolBar->setStretchableWidget( spacer ); QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); 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 ); + menuBar->setMaximumWidth( menuBar->sizeHint().width()); + //menuBar->setMaximumSize( menuBar->sizeHint()); #ifdef DESKTOP_VERSION resize ( 640, 480 ); #endif } MainWindow::~MainWindow() { } void MainWindow::setInfoFields(QListViewItem* item ) { if ( item == 0) { if ( subLE ) subLE->setText(""); if ( fromLE ) fromLE->setText(""); if ( toLE ) toLE->setText(""); return; } RecMailP mail = ((MailListViewItem*)item)->data(); if ( subLE ) subLE->setText(mail->getSubject()); if ( fromLE ) fromLE->setText(mail->getFrom()); if ( toLE ) toLE->setText(mail->To().join(";" )); if ( subLE ) subLE->setCursorPosition(0); if ( fromLE ) fromLE->setCursorPosition(0); if ( toLE ) toLE->setCursorPosition(0); } 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 "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" #endif "www.pi-sync.net\n\n" "Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n" "KOpieMail/Pi is based on Opie Mail\n" "Copyright (c) Rajko Albrecht and the Opie team\n" "KOpieMail/Pi is licensed under the GPL\n" "\n" "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" "libEtPan has its own licence - see LibEtPan licence\n"; KApplication::showText( cap, text ); } void MainWindow::showEtpanLicence() { KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); } void MainWindow::appMessage(const QCString &, const QByteArray &) |