summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-30 17:07:04 (UTC)
committer zautrix <zautrix>2004-10-30 17:07:04 (UTC)
commit28df10a0eb5ff343191755a06391bc6ce2fd84b0 (patch) (side-by-side diff)
tree930882e7400006887d68fd434939e3a376b8631b
parentc8662dc632987a317386b923e24acb9507859528 (diff)
downloadkdepimpi-28df10a0eb5ff343191755a06391bc6ce2fd84b0.zip
kdepimpi-28df10a0eb5ff343191755a06391bc6ce2fd84b0.tar.gz
kdepimpi-28df10a0eb5ff343191755a06391bc6ce2fd84b0.tar.bz2
ompi fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/composemailui.ui11
-rw-r--r--kmicromail/libmailwrapper/libmailwrapper.pro2
-rw-r--r--kmicromail/mainwindow.cpp3
-rw-r--r--kmicromail/opiemail.cpp26
-rw-r--r--kmicromail/qpe/qdialog.h8
-rw-r--r--kmicromail/qpe/qdialog_hacked.cpp5
-rw-r--r--microkde/kapplication.cpp4
7 files changed, 38 insertions, 21 deletions
diff --git a/kmicromail/composemailui.ui b/kmicromail/composemailui.ui
index c66b0c8..029922c 100644
--- a/kmicromail/composemailui.ui
+++ b/kmicromail/composemailui.ui
@@ -1,51 +1,58 @@
<!DOCTYPE UI><UI>
<class>ComposeMailUI</class>
<include location="local">tr.h</include>
<widget>
<class>QDialog</class>
<property stdset="1">
<name>name</name>
<cstring>ComposeMailUI</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>276</width>
- <height>263</height>
+ <width>579</width>
+ <height>476</height>
</rect>
</property>
<property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
<name>caption</name>
<string>Compose Message</string>
</property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
<grid>
<property stdset="1">
<name>margin</name>
<number>2</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>1</number>
</property>
<widget row="1" column="0" rowspan="1" colspan="4" >
<class>QTabWidget</class>
<property stdset="1">
<name>name</name>
<cstring>tabWidget</cstring>
</property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
<widget>
<class>QWidget</class>
diff --git a/kmicromail/libmailwrapper/libmailwrapper.pro b/kmicromail/libmailwrapper/libmailwrapper.pro
index 10d45b1..0919cd2 100644
--- a/kmicromail/libmailwrapper/libmailwrapper.pro
+++ b/kmicromail/libmailwrapper/libmailwrapper.pro
@@ -6,60 +6,60 @@ HEADERS = mailwrapper.h \
mailtypes.h \
pop3wrapper.h \
abstractmail.h \
smtpwrapper.h \
genericwrapper.h \
mboxwrapper.h \
settings.h \
logindialog.h \
sendmailprogress.h \
statusmail.h \
mhwrapper.h \
nntpwrapper.h \
generatemail.h \
storemail.h \
../qpe/global.h
SOURCES = imapwrapper.cpp \
mailwrapper.cpp \
mailtypes.cpp \
pop3wrapper.cpp \
abstractmail.cpp \
smtpwrapper.cpp \
genericwrapper.cpp \
mboxwrapper.cpp \
settings.cpp \
logindialog.cpp \
sendmailprogress.cpp \
statusmail.cpp \
mhwrapper.cpp \
nntpwrapper.cpp \
generatemail.cpp \
storemail.cpp \
- ./qpe/qdialog_hacked.cpp \
+ ../qpe/qdialog_hacked.cpp \
../qpe/global.cpp
INTERFACES = logindialogui.ui \
sendmailprogressui.ui
INCLUDEPATH += ../qpe .. ../../microkde ../../microkde/kdecore ../libetpan/include
LIBS += -lssl -lcrypto
#-lqpe -letpan
DESTDIR = ../../bin
TARGET = micromailwrapper
DEFINES += DESKTOP_VERSION
unix : {
OBJECTS_DIR = obj/unix
MOC_DIR = moc/unix
}
win32: {
DEFINES += _WIN32_
LIBS += mfc71u.lib
QMAKE_LINK += /NODEFAULTLIB:LIBC
#QMAKE_LINK += /NODEFAULTLIB:MSVCRT
#QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib
OBJECTS_DIR = obj/win
MOC_DIR = moc/win
}
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index 7655385..4115276 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -150,64 +150,67 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
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);
+#ifdef DESKTOP_VERSION
+ resize ( 640, 480 );
+#endif
}
MainWindow::~MainWindow()
{
}
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"
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index e088b9e..ca3faaf 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -1,70 +1,66 @@
// CHANGED 2004-09-31 Lutz Rogowski
// CHANGED 2004-08-06 Lutz Rogowski
#include "koprefsdialog.h"
+#include <kapplication.h>
#include <libkdepim/externalapphandler.h>
#include <libkdepim/kpimglobalprefs.h>
#ifdef MINIKDE_KDIALOG_H
#undef MINIKDE_KDIALOG_H
#endif
#include "settingsdialog.h"
#include "opiemail.h"
#include "editaccounts.h"
#include "composemail.h"
#include "mailistviewitem.h"
#include "viewmail.h"
#include "selectstore.h"
#include "selectsmtp.h"
#include "accountitem.h"
#include "klocale.h"
#include <qmessagebox.h>
#include <qtimer.h>
#include <qcursor.h>
#include <qregexp.h>
#ifdef DESKTOP_VERSION
#include <qapplication.h>
#else
#include <qpe/qpeapplication.h>
#endif
#include <libmailwrapper/smtpwrapper.h>
#include <libmailwrapper/mailtypes.h>
#include <libmailwrapper/abstractmail.h>
-/* OPIE */
-//#include <qpe/resource.h>
-//#include <qpe/qpeapplication.h>
-
-/* QT */
//using namespace Opie::Core;
OpieMail::OpieMail( QWidget *parent, const char *name )
: MainWindow( parent, name) //, WStyle_ContextHelp )
{
settings = new Settings();
folderView->populate( settings->getAccounts() );
}
OpieMail::~OpieMail()
{
if (settings) delete settings;
}
void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
{
}
#include <stdlib.h>
void OpieMail::message(const QCString &msg, const QByteArray &data)
{
// copied from old mail2
static int ii = 0;
//qDebug("QCOP CALL ############################# %d ", ii);
//QString mess ( msg );
//qDebug("Message = %s ",mess.latin1());
++ii;
//qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this);
@@ -192,96 +188,102 @@ void OpieMail::slotSendQueued()
{
smtp = smtpList.at(0);
}
else
{
smtp = 0;
selectsmtp selsmtp;
selsmtp.setSelectionlist(&smtpList);
selsmtp.showMaximized();
if ( selsmtp.exec() == QDialog::Accepted )
{
smtp = selsmtp.selected_smtp();
}
}
if (smtp)
{
SMTPwrapper * wrap = new SMTPwrapper(smtp);
if ( wrap->flushOutbox() )
{
QMessageBox::information(0,i18n("Info"),i18n("Mail queue flushed"));
}
delete wrap;
}
}
void OpieMail::slotSearchMails()
{
qDebug("OpieMail::slotSearchMails():not implemented ");
}
void OpieMail::slotEditSettings()
{
-#if 0
- SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp );
- settingsDialog.showMaximized();
- settingsDialog.exec();
-#endif
+
KOPrefsDialog settingsDialog( this, "koprefs", true );
+#ifndef DESKTOP_VERSION
settingsDialog.showMaximized();
+#endif
settingsDialog.exec();
+
+ // KApplication::execDialog(settingsDialog);
}
void OpieMail::slotEditAccounts()
{
EditAccounts eaDialog( settings, this, 0, true );
eaDialog.slotAdjustColumns();
+#ifndef DESKTOP_VERSION
eaDialog.showMaximized();
+#endif
eaDialog.exec();
if ( settings ) delete settings;
settings = new Settings();
folderView->populate( settings->getAccounts() );
}
void OpieMail::displayMail()
{
QListViewItem*item = mailView->currentItem();
if (!item) return;
RecMailP mail = ((MailListViewItem*)item)->data();
RecBodyP body = folderView->fetchBody(mail);
ViewMail readMail( this,"", Qt::WType_Modal );
readMail.setBody( body );
readMail.setMail( mail );
+#ifndef DESKTOP_VERSION
readMail.showMaximized();
+#else
+ readMail.resize( 640, 480);
+#endif
readMail.exec();
if ( readMail.deleted )
{
folderView->refreshCurrent();
}
else
{
( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
}
}
void OpieMail::slotGetAllMail()
{
QListViewItem * item = folderView->firstChild();
while ( item ){
((AccountViewItem *)item)->contextMenuSelected( 101 );
item = item->nextSibling ();
}
}
void OpieMail::slotGetMail()
{
QListViewItem * item = folderView->currentItem();
if ( ! item ) return;
((AccountViewItem *)item)->contextMenuSelected( 101 );
}
void OpieMail::slotDeleteMail()
{
if (!mailView->currentItem()) return;
RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data();
if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
{
mail->Wrapper()->deleteMail( mail );
@@ -443,35 +445,39 @@ void OpieMail::slotMoveCopyAllMail()
AbstractMail*targetMail = 0;
QString targetFolder = "";
Selectstore sels;
folderView->setupFolderselect(&sels);
if (!sels.exec()) return;
targetMail = sels.currentMail();
targetFolder = sels.currentFolder();
if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) ||
targetFolder.isEmpty())
{
return;
}
if (sels.newFolder() && !targetMail->createMbox(targetFolder))
{
QMessageBox::critical(0,i18n("Error creating new Folder"),
i18n("<center>Error while creating<br>new folder - breaking.</center>"));
return;
}
sels.hide();
qApp->processEvents();
//qDebug("hiding sels ");
mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails());
folderView->refreshCurrent();
}
void OpieMail::reEditMail()
{
if (!mailView->currentItem()) return;
ComposeMail compose( settings, this, 0, true );
compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data());
compose.slotAdjustColumns();
+#ifndef DESKTOP_VERSION
compose.showMaximized();
+#else
+ compose.resize(640,480);
+#endif
compose.exec();
}
diff --git a/kmicromail/qpe/qdialog.h b/kmicromail/qpe/qdialog.h
index d671e34..aafdf80 100644
--- a/kmicromail/qpe/qdialog.h
+++ b/kmicromail/qpe/qdialog.h
@@ -1,35 +1,33 @@
#ifndef MINIKDE_KDIALOG_H
#ifndef DEFINE_QDIALOG_HACK
#define DEFINE_QDIALOG_HACK
#warning call of include <qdialog.h>
#warning including /usr/local/qt/include/qdialog.h
-#warning if you get an compiling error please adjust your path her
+#warning if you get a compiling error
+#warning please adjust your path here!
#include "/usr/local/qt/include/qdialog.h"
class QDialog_hacked : public QDialog
{
//Q__OBJECT
public:
QDialog_hacked ( QWidget * parent=0, const char * name=0, bool modal=true, WFlags f=0 );
};
#define QDialog QDialog_hacked
#endif
#else
#warning ******************************************
#warning ******************************************
#warning ******************************************
#warning ******************************************
-#warning ******************************************
-#warning ******************************************
-#warning ******************************************
-#warning ******************************************
+#warning "/usr/local/qt/include/qdialog.h" for KDialog
#include "/usr/local/qt/include/qdialog.h"
#endif
diff --git a/kmicromail/qpe/qdialog_hacked.cpp b/kmicromail/qpe/qdialog_hacked.cpp
index e2ce21a..3669312 100644
--- a/kmicromail/qpe/qdialog_hacked.cpp
+++ b/kmicromail/qpe/qdialog_hacked.cpp
@@ -1,30 +1,31 @@
#include <qdialog.h>
#include <qhbox.h>
#include <qpushbutton.h>
#include <klocale.h>
#ifdef QDialog
#undef QDialog
#endif
QDialog_hacked::QDialog_hacked ( QWidget * parent, const char * name, bool modal, WFlags f )
- : QDialog( parent,name,modal)
+ : QDialog( parent,name,modal, f)
{
qDebug("******************** ");
qDebug("******************** ");
qDebug("******************** ");
qDebug("******************** ");
- qDebug("New hacked QDialog == KDialogBase ");
+ qDebug("New hacked QDialog for ompi ");
//QTimer::singleShot( 1, this,SLOT(addaddbuttons()) );
setOrientation ( Vertical );
QHBox * hb = new QHBox ( this );
QPushButton *ok = new QPushButton( i18n("OK"), hb );
QPushButton *cancel = new QPushButton( i18n("Cancel"), hb );
setExtension ( hb );
showExtension ( true );
connect ( ok, SIGNAL ( clicked()),this, SLOT (accept() ) );
connect ( cancel, SIGNAL ( clicked()),this, SLOT (reject() ) );
+ //setWFlags(WStyle_MinMax );
}
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp
index 56c01af..d6f556d 100644
--- a/microkde/kapplication.cpp
+++ b/microkde/kapplication.cpp
@@ -7,69 +7,71 @@
#include <qfile.h>
#include <qtextstream.h>
#include <qdialog.h>
#include <qlayout.h>
#include <qtextbrowser.h>
int KApplication::random()
{
return rand();
}
//US
QString KApplication::randomString(int length)
{
if (length <=0 ) return QString::null;
QString str;
while (length--)
{
int r=random() % 62;
r+=48;
if (r>57) r+=7;
if (r>90) r+=6;
str += char(r);
// so what if I work backwards?
}
return str;
}
int KApplication::execDialog( QDialog* d )
{
if (QApplication::desktop()->width() <= 640 )
d->showMaximized();
+ else
+ ;//d->resize( 800, 600 );
return d->exec();
}
void KApplication::showLicence()
{
- KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/LICENCE.TXT" );
+ KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/licence.txt" );
}
void KApplication::showFile(QString caption, QString fn)
{
QString text;
QString fileName;
#ifndef DESKTOP_VERSION
fileName = getenv("QPEDIR");
fileName += "/pics/" + fn ;
#else
fileName = qApp->applicationDirPath () + "/" + fn;
#endif
QFile file( fileName );
if (!file.open( IO_ReadOnly ) ) {
return ;
}
QTextStream ts( &file );
text = ts.read();
file.close();
KApplication::showText( caption, text );
}
bool KApplication::convert2latin1(QString fileName)
{
QString text;
QFile file( fileName );
if (!file.open( IO_ReadOnly ) ) {
return false;
}
QTextStream ts( &file );