summaryrefslogtreecommitdiff
authorar <ar>2004-02-21 15:27:41 (UTC)
committer ar <ar>2004-02-21 15:27:41 (UTC)
commit460258f203be746ff79e14f32a823f381b8ea513 (patch) (side-by-side diff)
tree87dddbacda3050027d343730cf021b53045e80cb
parent76b70b355d2c1c32c0f74e844e0654e39db2a175 (diff)
downloadopie-460258f203be746ff79e14f32a823f381b8ea513.zip
opie-460258f203be746ff79e14f32a823f381b8ea513.tar.gz
opie-460258f203be746ff79e14f32a823f381b8ea513.tar.bz2
improve support for BigScreen
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/accountitem.cpp309
-rw-r--r--noncore/net/mail/accountview.cpp48
-rw-r--r--noncore/net/mail/addresspicker.cpp120
-rw-r--r--noncore/net/mail/editaccounts.cpp183
-rw-r--r--noncore/net/mail/opiemail.cpp113
-rw-r--r--noncore/net/mail/viewmail.cpp513
-rw-r--r--noncore/net/opieirc/ircservereditor.cpp10
-rw-r--r--noncore/net/opieirc/ircserverlist.cpp76
-rw-r--r--noncore/net/opieirc/ircsettings.cpp22
-rw-r--r--noncore/net/opietooth/blue-pin/pindlg.cc41
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp261
-rw-r--r--noncore/net/opietooth/manager/obexpopup.cpp22
-rw-r--r--noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp51
-rw-r--r--noncore/net/opietooth/manager/rfcpopup.cpp49
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp5
15 files changed, 1100 insertions, 723 deletions
diff --git a/noncore/net/mail/accountitem.cpp b/noncore/net/mail/accountitem.cpp
index 2d3cd4b..c8f6ec4 100644
--- a/noncore/net/mail/accountitem.cpp
+++ b/noncore/net/mail/accountitem.cpp
@@ -1,7 +1,9 @@
+
#include "accountitem.h"
#include "accountview.h"
-#include <qpopupmenu.h>
-#include <qmessagebox.h>
#include "selectstore.h"
#include "newmaildir.h"
+#include "defines.h"
+
+/* OPIE */
#include <libmailwrapper/mailtypes.h>
@@ -9,3 +11,7 @@
#include <libmailwrapper/mailwrapper.h>
-#include "defines.h"
+#include <qpe/qpeapplication.h>
+
+/* QT */
+#include <qpopupmenu.h>
+#include <qmessagebox.h>
@@ -16,3 +22,3 @@
POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent )
- : AccountViewItem( parent )
+ : AccountViewItem( parent )
{
@@ -22,5 +28,8 @@ POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent )
#if 0
- if (!account->getOffline()) {
+ if (!account->getOffline())
+ {
setPixmap( 0, );
- } else {
+ }
+ else
+ {
setPixmap( 0, PIXMAP_OFFLINE );
@@ -52,3 +61,4 @@ void POP3viewItem::refresh()
QListViewItem *child = firstChild();
- while ( child ) {
+ while ( child )
+ {
QListViewItem *tmp = child;
@@ -59,3 +69,4 @@ void POP3viewItem::refresh()
QListViewItem*item = 0;
- for ( it = folders->first(); it; it = folders->next() ) {
+ for ( it = folders->first(); it; it = folders->next() )
+ {
item = new POP3folderItem( it, this , item );
@@ -77,7 +88,11 @@ QPopupMenu * POP3viewItem::getContextMenu()
QPopupMenu *m = new QPopupMenu(0);
- if (m) {
- if (!account->getOffline()) {
+ if (m)
+ {
+ if (!account->getOffline())
+ {
m->insertItem(QObject::tr("Disconnect",contextName),0);
m->insertItem(QObject::tr("Set offline",contextName),1);
- } else {
+ }
+ else
+ {
m->insertItem(QObject::tr("Set online",contextName),1);
@@ -91,3 +106,4 @@ void POP3viewItem::disconnect()
QListViewItem *child = firstChild();
- while ( child ) {
+ while ( child )
+ {
QListViewItem *tmp = child;
@@ -101,3 +117,4 @@ void POP3viewItem::setOnOffline()
{
- if (!account->getOffline()) {
+ if (!account->getOffline())
+ {
disconnect();
@@ -112,3 +129,4 @@ void POP3viewItem::contextMenuSelected(int which)
{
- switch (which) {
+ switch (which)
+ {
case 0:
@@ -123,7 +141,6 @@ void POP3viewItem::contextMenuSelected(int which)
POP3folderItem::~POP3folderItem()
-{
-}
+{}
POP3folderItem::POP3folderItem( Folder *folderInit, POP3viewItem *parent , QListViewItem*after )
- : AccountViewItem( parent,after )
+ : AccountViewItem( parent,after )
{
@@ -131,5 +148,8 @@ POP3folderItem::POP3folderItem( Folder *folderInit, POP3viewItem *parent , QList
pop3 = parent;
- if (folder->getDisplayName().lower()!="inbox") {
+ if (folder->getDisplayName().lower()!="inbox")
+ {
setPixmap( 0, PIXMAP_POP3FOLDER );
- } else {
+ }
+ else
+ {
setPixmap( 0, PIXMAP_INBOXFOLDER);
@@ -153,3 +173,4 @@ QPopupMenu * POP3folderItem::getContextMenu()
QPopupMenu *m = new QPopupMenu(0);
- if (m) {
+ if (m)
+ {
m->insertItem(QObject::tr("Refresh header list",contextName),0);
@@ -171,3 +192,4 @@ void POP3folderItem::contextMenuSelected(int which)
AccountView * view = (AccountView*)listView();
- switch (which) {
+ switch (which)
+ {
case 0:
@@ -192,3 +214,3 @@ void POP3folderItem::contextMenuSelected(int which)
IMAPviewItem::IMAPviewItem( IMAPaccount *a, AccountView *parent )
- : AccountViewItem( parent )
+ : AccountViewItem( parent )
{
@@ -224,3 +246,3 @@ void IMAPviewItem::refreshFolders(bool force)
if (childCount()>0 && force==false) return;
- if (account->getOffline()) return;
+ if (account->getOffline()) return;
@@ -238,4 +260,6 @@ void IMAPviewItem::refreshFolders(bool force)
- for ( it = folders->first(); it; it = folders->next() ) {
- if (it->getDisplayName().lower()=="inbox") {
+ for ( it = folders->first(); it; it = folders->next() )
+ {
+ if (it->getDisplayName().lower()=="inbox")
+ {
item = new IMAPfolderItem( it, this , item );
@@ -246,3 +270,4 @@ void IMAPviewItem::refreshFolders(bool force)
}
- for ( it = folders->first(); it; it = folders->next() ) {
+ for ( it = folders->first(); it; it = folders->next() )
+ {
fname = it->getDisplayName();
@@ -250,3 +275,4 @@ void IMAPviewItem::refreshFolders(bool force)
pos = fname.findRev(it->Separator());
- if (pos != -1) {
+ if (pos != -1)
+ {
fname = fname.left(pos);
@@ -254,3 +280,4 @@ void IMAPviewItem::refreshFolders(bool force)
IMAPfolderItem*pitem = (IMAPfolderItem*)findSubItem(fname);
- if (pitem) {
+ if (pitem)
+ {
titem = item;
@@ -260,3 +287,5 @@ void IMAPviewItem::refreshFolders(bool force)
item = titem;
- } else {
+ }
+ else
+ {
item = new IMAPfolderItem( it, this , item );
@@ -270,4 +299,6 @@ QPopupMenu * IMAPviewItem::getContextMenu()
QPopupMenu *m = new QPopupMenu(0);
- if (m) {
- if (!account->getOffline()) {
+ if (m)
+ {
+ if (!account->getOffline())
+ {
m->insertItem(QObject::tr("Refresh folder list",contextName),0);
@@ -277,3 +308,5 @@ QPopupMenu * IMAPviewItem::getContextMenu()
m->insertItem(QObject::tr("Set offline",contextName),3);
- } else {
+ }
+ else
+ {
m->insertItem(QObject::tr("Set online",contextName),3);
@@ -287,4 +320,4 @@ void IMAPviewItem::createNewFolder()
Newmdirdlg ndirdlg;
- ndirdlg.showMaximized();
- if (ndirdlg.exec()) {
+ if ( QPEApplication::execDialog( &ndirdlg ))
+ {
QString ndir = ndirdlg.Newdir();
@@ -293,6 +326,8 @@ void IMAPviewItem::createNewFolder()
IMAPfolderItem*item = (IMAPfolderItem*)firstChild();
- if (item) {
+ if (item)
+ {
delemiter = item->Delemiter();
}
- if (wrapper->createMbox(ndir,0,delemiter,makesubs)) {
+ if (wrapper->createMbox(ndir,0,delemiter,makesubs))
+ {
refreshFolders(true);
@@ -305,3 +340,4 @@ void IMAPviewItem::contextMenuSelected(int id)
qDebug("Id selected: %i",id);
- switch (id) {
+ switch (id)
+ {
case 0:
@@ -317,3 +353,4 @@ void IMAPviewItem::contextMenuSelected(int id)
case 3:
- if (account->getOffline()==false) {
+ if (account->getOffline()==false)
+ {
removeChilds();
@@ -325,3 +362,3 @@ void IMAPviewItem::contextMenuSelected(int id)
refreshFolders(false);
- break;
+ break;
default:
@@ -342,3 +379,3 @@ bool IMAPviewItem::offline()
IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent , QListViewItem*after )
- : AccountViewItem( parent , after )
+ : AccountViewItem( parent , after )
{
@@ -346,5 +383,8 @@ IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent , QList
imap = parent;
- if (folder->getDisplayName().lower()!="inbox") {
+ if (folder->getDisplayName().lower()!="inbox")
+ {
setPixmap( 0, PIXMAP_IMAPFOLDER );
- } else {
+ }
+ else
+ {
setPixmap( 0, PIXMAP_INBOXFOLDER);
@@ -355,3 +395,3 @@ IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent , QList
IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master )
- : AccountViewItem( parent,after )
+ : AccountViewItem( parent,after )
{
@@ -359,5 +399,8 @@ IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPfolderItem *parent , QLi
imap = master;
- if (folder->getDisplayName().lower()!="inbox") {
+ if (folder->getDisplayName().lower()!="inbox")
+ {
setPixmap( 0, PIXMAP_IMAPFOLDER );
- } else {
+ }
+ else
+ {
setPixmap( 0, PIXMAP_INBOXFOLDER);
@@ -368,4 +411,3 @@ IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPfolderItem *parent , QLi
IMAPfolderItem::~IMAPfolderItem()
-{
-}
+{}
@@ -378,5 +420,8 @@ void IMAPfolderItem::refresh(QList<RecMail>&target)
{
- if (folder->may_select()) {
+ if (folder->may_select())
+ {
imap->getWrapper()->listMessages( folder->getName(),target );
- } else {
+ }
+ else
+ {
target.clear();
@@ -393,4 +438,6 @@ QPopupMenu * IMAPfolderItem::getContextMenu()
QPopupMenu *m = new QPopupMenu(0);
- if (m) {
- if (folder->may_select()) {
+ if (m)
+ {
+ if (folder->may_select())
+ {
m->insertItem(QObject::tr("Refresh header list",contextName),0);
@@ -399,6 +446,8 @@ QPopupMenu * IMAPfolderItem::getContextMenu()
}
- if (folder->no_inferior()==false) {
+ if (folder->no_inferior()==false)
+ {
m->insertItem(QObject::tr("Create new subfolder",contextName),2);
}
- if (folder->getDisplayName().lower()!="inbox") {
+ if (folder->getDisplayName().lower()!="inbox")
+ {
m->insertItem(QObject::tr("Delete folder",contextName),3);
@@ -412,4 +461,4 @@ void IMAPfolderItem::createNewFolder()
Newmdirdlg ndirdlg;
- ndirdlg.showMaximized();
- if (ndirdlg.exec()) {
+ if ( QPEApplication::execDialog( &ndirdlg ) )
+ {
QString ndir = ndirdlg.Newdir();
@@ -417,3 +466,4 @@ void IMAPfolderItem::createNewFolder()
QString delemiter = Delemiter();
- if (imap->wrapper->createMbox(ndir,folder,delemiter,makesubs)) {
+ if (imap->wrapper->createMbox(ndir,folder,delemiter,makesubs))
+ {
imap->refreshFolders(true);
@@ -426,8 +476,10 @@ void IMAPfolderItem::deleteFolder()
int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName),
- QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()),
- QObject::tr("Yes",contextName),
- QObject::tr("No",contextName),QString::null,1,1);
+ QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()),
+ QObject::tr("Yes",contextName),
+ QObject::tr("No",contextName),QString::null,1,1);
qDebug("Auswahl: %i",yesno);
- if (yesno == 0) {
- if (imap->getWrapper()->deleteMbox(folder)) {
+ if (yesno == 0)
+ {
+ if (imap->getWrapper()->deleteMbox(folder))
+ {
QListView*v=listView();
@@ -437,3 +489,4 @@ void IMAPfolderItem::deleteFolder()
imap->refreshFolders(true);
- if (v) {
+ if (v)
+ {
v->setSelected(box,true);
@@ -455,3 +508,4 @@ void IMAPfolderItem::contextMenuSelected(int id)
AccountView * view = (AccountView*)listView();
- switch(id) {
+ switch(id)
+ {
case 0:
@@ -482,3 +536,3 @@ void IMAPfolderItem::contextMenuSelected(int id)
MHviewItem::MHviewItem( const QString&aPath, AccountView *parent )
- : AccountViewItem( parent )
+ : AccountViewItem( parent )
{
@@ -520,6 +574,8 @@ void MHviewItem::refresh(bool force)
int pos;
- for ( it = folders->first(); it; it = folders->next() ) {
+ for ( it = folders->first(); it; it = folders->next() )
+ {
fname = it->getDisplayName();
/* this folder itself */
- if (fname=="/") {
+ if (fname=="/")
+ {
currentFolders.append(fname);
@@ -530,11 +586,17 @@ void MHviewItem::refresh(bool force)
pos = fname.findRev("/");
- if (pos > 0) {
+ if (pos > 0)
+ {
fname = fname.left(pos);
pmaster = (MHfolderItem*)findSubItem(fname);
- } else {
+ }
+ else
+ {
pmaster = 0;
}
- if (pmaster) {
+ if (pmaster)
+ {
item = new MHfolderItem( it, pmaster, item, this );
- } else {
+ }
+ else
+ {
item = new MHfolderItem( it, this , item );
@@ -557,3 +619,4 @@ QPopupMenu * MHviewItem::getContextMenu()
QPopupMenu *m = new QPopupMenu(0);
- if (m) {
+ if (m)
+ {
m->insertItem(QObject::tr("Refresh folder list",contextName),0);
@@ -569,6 +632,7 @@ void MHviewItem::createFolder()
Newmdirdlg ndirdlg(0,0,true);
- ndirdlg.showMaximized();
- if (ndirdlg.exec()) {
+ if ( QPEApplication::execDialog( &ndirdlg ) )
+ {
QString ndir = ndirdlg.Newdir();
- if (wrapper->createMbox(ndir)) {
+ if (wrapper->createMbox(ndir))
+ {
refresh(true);
@@ -592,3 +656,4 @@ void MHviewItem::contextMenuSelected(int which)
{
- switch (which) {
+ switch (which)
+ {
case 0:
@@ -611,7 +676,6 @@ void MHviewItem::contextMenuSelected(int which)
MHfolderItem::~MHfolderItem()
-{
-}
+{}
MHfolderItem::MHfolderItem( Folder *folderInit, MHviewItem *parent , QListViewItem*after )
- : AccountViewItem( parent,after )
+ : AccountViewItem( parent,after )
{
@@ -623,3 +687,3 @@ MHfolderItem::MHfolderItem( Folder *folderInit, MHviewItem *parent , QListViewIt
MHfolderItem::MHfolderItem( Folder *folderInit, MHfolderItem *parent, QListViewItem*after, MHviewItem*master)
- : AccountViewItem( parent,after )
+ : AccountViewItem( parent,after )
{
@@ -633,3 +697,4 @@ void MHfolderItem::initName()
QString bName = folder->getDisplayName();
- if (bName.startsWith("/")&&bName.length()>1) {
+ if (bName.startsWith("/")&&bName.length()>1)
+ {
bName.replace(0,1,"");
@@ -637,12 +702,18 @@ void MHfolderItem::initName()
int pos = bName.findRev("/");
- if (pos > 0) {
+ if (pos > 0)
+ {
bName.replace(0,pos+1,"");
}
- if (bName.lower() == "outgoing") {
+ if (bName.lower() == "outgoing")
+ {
setPixmap( 0, PIXMAP_OUTBOXFOLDER );
- } else if (bName.lower() == "inbox") {
+ }
+ else if (bName.lower() == "inbox")
+ {
setPixmap( 0, PIXMAP_INBOXFOLDER);
- } else {
+ }
+ else
+ {
setPixmap( 0, PIXMAP_MBOXFOLDER );
- }
+ }
setText( 0, bName );
@@ -669,8 +740,10 @@ void MHfolderItem::deleteFolder()
int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName),
- QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()),
- QObject::tr("Yes",contextName),
- QObject::tr("No",contextName),QString::null,1,1);
+ QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()),
+ QObject::tr("Yes",contextName),
+ QObject::tr("No",contextName),QString::null,1,1);
qDebug("Auswahl: %i",yesno);
- if (yesno == 0) {
- if (mbox->getWrapper()->deleteMbox(folder)) {
+ if (yesno == 0)
+ {
+ if (mbox->getWrapper()->deleteMbox(folder))
+ {
QListView*v=listView();
@@ -680,3 +753,4 @@ void MHfolderItem::deleteFolder()
mbox->refresh(true);
- if (v) {
+ if (v)
+ {
v->setSelected(box,true);
@@ -690,3 +764,4 @@ QPopupMenu * MHfolderItem::getContextMenu()
QPopupMenu *m = new QPopupMenu(0);
- if (m) {
+ if (m)
+ {
m->insertItem(QObject::tr("Move/Copie all mails",contextName),2);
@@ -709,6 +784,7 @@ void MHfolderItem::createFolder()
Newmdirdlg ndirdlg(0,0,true);
- ndirdlg.showMaximized();
- if (ndirdlg.exec()) {
+ if ( QPEApplication::execDialog( &ndirdlg ) )
+ {
QString ndir = ndirdlg.Newdir();
- if (mbox->getWrapper()->createMbox(ndir,folder)) {
+ if (mbox->getWrapper()->createMbox(ndir,folder))
+ {
QListView*v=listView();
@@ -718,3 +794,4 @@ void MHfolderItem::createFolder()
mbox->refresh(true);
- if (v) {
+ if (v)
+ {
v->setSelected(box,true);
@@ -727,3 +804,4 @@ void MHfolderItem::contextMenuSelected(int which)
{
- switch(which) {
+ switch(which)
+ {
case 0:
@@ -751,4 +829,4 @@ const QString AccountViewItem::contextName="AccountViewItem";
-AccountViewItem::AccountViewItem( AccountView *parent )
- : QListViewItem( parent )
+AccountViewItem::AccountViewItem( AccountView *parent )
+ : QListViewItem( parent )
{
@@ -759,3 +837,3 @@ AccountViewItem::AccountViewItem( AccountView *parent )
AccountViewItem::AccountViewItem( QListViewItem *parent)
- : QListViewItem( parent)
+ : QListViewItem( parent)
{
@@ -765,3 +843,3 @@ AccountViewItem::AccountViewItem( QListViewItem *parent)
AccountViewItem::AccountViewItem( QListViewItem *parent , QListViewItem*after )
- :QListViewItem( parent,after )
+ :QListViewItem( parent,after )
{
@@ -792,9 +870,11 @@ void AccountViewItem::deleteAllMail(AbstractMail*wrapper,Folder*folder)
int yesno = QMessageBox::warning(0,QObject::tr("Delete all mails",contextName),
- QObject::tr("<center>Realy delete all mails in box <br>%1</center>",contextName).
- arg(fname),
- QObject::tr("Yes",contextName),
- QObject::tr("No",contextName),QString::null,1,1);
+ QObject::tr("<center>Realy delete all mails in box <br>%1</center>",contextName).
+ arg(fname),
+ QObject::tr("Yes",contextName),
+ QObject::tr("No",contextName),QString::null,1,1);
qDebug("Auswahl: %i",yesno);
- if (yesno == 0) {
- if (wrapper->deleteAllMail(folder)) {
+ if (yesno == 0)
+ {
+ if (wrapper->deleteAllMail(folder))
+ {
AccountView * view = (AccountView*)listView();
@@ -808,3 +888,4 @@ void AccountViewItem::removeChilds()
QListViewItem *child = firstChild();
- while ( child ) {
+ while ( child )
+ {
QListViewItem *tmp = child;
@@ -827,9 +908,13 @@ AccountViewItem*AccountViewItem::findSubItem(const QString&path,AccountViewItem*
else pitem = (AccountViewItem*)start->firstChild();
- while (pitem) {
- if (pitem->matchName(path)) {
+ while (pitem)
+ {
+ if (pitem->matchName(path))
+ {
break;
}
- if (pitem->childCount()>0) {
+ if (pitem->childCount()>0)
+ {
sitem = findSubItem(path,pitem);
- if (sitem) {
+ if (sitem)
+ {
pitem = sitem;
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index d9792d4..2ddf834 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -1 +1,2 @@
+
#include "accountview.h"
@@ -3,4 +4,4 @@
#include "selectstore.h"
-#include <qmessagebox.h>
-#include <qpopupmenu.h>
+
+/* OPIE */
#include <libmailwrapper/settings.h>
@@ -9,11 +10,15 @@
#include <libmailwrapper/abstractmail.h>
+#include <qpe/qpeapplication.h>
+/* QT */
+#include <qmessagebox.h>
+#include <qpopupmenu.h>
AccountView::AccountView( QWidget *parent, const char *name, WFlags flags )
- : QListView( parent, name, flags )
+ : QListView( parent, name, flags )
{
connect( this, SIGNAL( selectionChanged( QListViewItem * ) ),
- SLOT( refresh( QListViewItem * ) ) );
+ SLOT( refresh( QListViewItem * ) ) );
connect( this, SIGNAL( mouseButtonPressed(int, QListViewItem *,const QPoint&,int ) ),this,
- SLOT( slotHold( int, QListViewItem *,const QPoint&,int ) ) );
+ SLOT( slotHold( int, QListViewItem *,const QPoint&,int ) ) );
setSorting(0);
@@ -57,4 +62,6 @@ void AccountView::populate( QList<Account> list )
Account *it;
- for ( it = list.first(); it; it = list.next() ) {
- if ( it->getType().compare( "IMAP" ) == 0 ) {
+ for ( it = list.first(); it; it = list.next() )
+ {
+ if ( it->getType().compare( "IMAP" ) == 0 )
+ {
IMAPaccount *imap = static_cast<IMAPaccount *>(it);
@@ -62,3 +69,5 @@ void AccountView::populate( QList<Account> list )
imapAccounts.append(new IMAPviewItem( imap, this ));
- } else if ( it->getType().compare( "POP3" ) == 0 ) {
+ }
+ else if ( it->getType().compare( "POP3" ) == 0 )
+ {
POP3account *pop3 = static_cast<POP3account *>(it);
@@ -71,6 +80,8 @@ void AccountView::populate( QList<Account> list )
-void AccountView::refresh(QListViewItem *item) {
+void AccountView::refresh(QListViewItem *item)
+{
qDebug("AccountView refresh...");
- if ( item ) {
+ if ( item )
+ {
m_currentItem = item;
@@ -97,3 +108,2 @@ void AccountView::refreshAll()
{
-
}
@@ -110,6 +120,7 @@ void AccountView::setupFolderselect(Selectstore*sels)
{
- sels->showMaximized();
+ QPEApplication::showDialog( sels );
QStringList sFolders;
unsigned int i = 0;
- for (i=0; i < mhAccounts.count();++i) {
+ for (i=0; i < mhAccounts.count();++i)
+ {
mhAccounts[i]->refresh(false);
@@ -118,3 +129,4 @@ void AccountView::setupFolderselect(Selectstore*sels)
}
- for (i=0; i < imapAccounts.count();++i) {
+ for (i=0; i < imapAccounts.count();++i)
+ {
if (imapAccounts[i]->offline())
@@ -136,8 +148,10 @@ void AccountView::downloadMails(Folder*fromFolder,AbstractMail*fromWrapper)
if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) ||
- targetFolder.isEmpty()) {
+ targetFolder.isEmpty())
+ {
return;
}
- if (sels.newFolder() && !targetMail->createMbox(targetFolder)) {
+ if (sels.newFolder() && !targetMail->createMbox(targetFolder))
+ {
QMessageBox::critical(0,tr("Error creating new Folder"),
- tr("<center>Error while creating<br>new folder - breaking.</center>"));
+ tr("<center>Error while creating<br>new folder - breaking.</center>"));
return;
diff --git a/noncore/net/mail/addresspicker.cpp b/noncore/net/mail/addresspicker.cpp
index f4f4cea..8cdabde 100644
--- a/noncore/net/mail/addresspicker.cpp
+++ b/noncore/net/mail/addresspicker.cpp
@@ -1 +1,11 @@
+
+#include "composemail.h"
+
+/* OPIE */
+#include <opie2/ocontactaccess.h>
+#include <opie2/ocontact.h>
+#include <qpe/resource.h>
+#include <qpe/qpeapplication.h>
+
+/* QT */
#include <qpushbutton.h>
@@ -6,13 +16,7 @@
-#include <qpe/resource.h>
-#include <opie2/ocontactaccess.h>
-#include <opie2/ocontact.h>
-
-
+/* STD */
#include <stdlib.h>
-#include "composemail.h"
-
-AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFlags flags )
- : AddressPickerUI( parent, name, modal, flags )
+AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFlags flags )
+ : AddressPickerUI( parent, name, modal, flags )
{
@@ -28,3 +32,3 @@ AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFl
Opie::OContactAccess m_contactdb("opiemail");
-
+
QStringList mails;
@@ -32,9 +36,14 @@ AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFl
Opie::OContactAccess::List m_list = m_contactdb.sorted( true, 0, 0, 0 );
- for ( it = m_list.begin(); it != m_list.end(); ++it ) {
- if ((*it).defaultEmail().length()!=0) {
+ for ( it = m_list.begin(); it != m_list.end(); ++it )
+ {
+ if ((*it).defaultEmail().length()!=0)
+ {
mails = (*it).emailList();
- if ((*it).fileAs().length()>0) {
+ if ((*it).fileAs().length()>0)
+ {
pre = "\""+(*it).firstName()+" "+(*it).lastName()+"\" <";
suf = ">";
- } else {
+ }
+ else
+ {
pre = "";
@@ -43,18 +52,22 @@ AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFl
QStringList::ConstIterator sit = mails.begin();
- for (;sit!=mails.end();++sit) {
+ for (;sit!=mails.end();++sit)
+ {
contactLine=pre+(*sit)+suf;
addressList->insertItem(contactLine);
- }
+ }
}
}
- if ( addressList->count() <= 0 ) {
+ if ( addressList->count() <= 0 )
+ {
#if 0
- // makes this realy sense??
- addressList->insertItem(
+ // makes this realy sense??
+ addressList->insertItem(
tr( "There are no entries in the addressbook." ) );
#endif
- addressList->setEnabled( false );
- okButton->setEnabled( false );
- } else {
-// addressList->sort();
+ addressList->setEnabled( false );
+ okButton->setEnabled( false );
+ }
+ else
+ {
+ // addressList->sort();
}
@@ -64,20 +77,22 @@ void AddressPicker::accept()
{
- QListBoxItem *item = addressList->firstItem();
- QString names;
-
- while ( item ) {
- if ( item->selected() )
- names += item->text() + ", ";
- item = item->next();
- }
- names.replace( names.length() - 2, 2, "" );
-
- if ( names.isEmpty() ) {
- QMessageBox::information(this, tr("Error"), tr("<p>You have to select"
- " at least one address entry.</p>"), tr("Ok"));
- return;
- }
-
- selectedNames = names;
- QDialog::accept();
+ QListBoxItem *item = addressList->firstItem();
+ QString names;
+
+ while ( item )
+ {
+ if ( item->selected() )
+ names += item->text() + ", ";
+ item = item->next();
+ }
+ names.replace( names.length() - 2, 2, "" );
+
+ if ( names.isEmpty() )
+ {
+ QMessageBox::information(this, tr("Error"), tr("<p>You have to select"
+ " at least one address entry.</p>"), tr("Ok"));
+ return;
+ }
+
+ selectedNames = names;
+ QDialog::accept();
}
@@ -86,14 +101,13 @@ QString AddressPicker::getNames()
{
- QString names = 0;
-
- AddressPicker picker(0, 0, true);
- picker.showMaximized();
- picker.show();
-
- int ret = picker.exec();
- if ( QDialog::Accepted == ret ) {
- return picker.selectedNames;
- }
-
- return 0;
+ QString names = 0;
+
+ AddressPicker picker(0, 0, true);
+
+ int ret = QPEApplication::execDialog( &picker );
+ if ( QDialog::Accepted == ret )
+ {
+ return picker.selectedNames;
+ }
+
+ return 0;
}
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp
index 1cb202e..60bffa5 100644
--- a/noncore/net/mail/editaccounts.cpp
+++ b/noncore/net/mail/editaccounts.cpp
@@ -1,2 +1 @@
-#include <qt.h>
@@ -5,4 +4,10 @@
+/* OPIE */
+#include <qpe/qpeapplication.h>
+
+/* QT */
+#include <qt.h>
+
AccountListItem::AccountListItem( QListView *parent, Account *a)
- : QListViewItem( parent )
+ : QListViewItem( parent )
{
@@ -14,3 +19,3 @@ AccountListItem::AccountListItem( QListView *parent, Account *a)
EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
- : EditAccountsUI( parent, name, modal, flags )
+ : EditAccountsUI( parent, name, modal, flags )
{
@@ -41,6 +46,10 @@ void EditAccounts::slotFillLists()
Account *it;
- for ( it = accounts.first(); it; it = accounts.next() ) {
- if ( it->getType().compare( "NNTP" ) == 0 ) {
+ for ( it = accounts.first(); it; it = accounts.next() )
+ {
+ if ( it->getType().compare( "NNTP" ) == 0 )
+ {
(void) new AccountListItem( newsList, it );
- } else {
+ }
+ else
+ {
(void) new AccountListItem( mailList, it );
@@ -56,3 +65,4 @@ void EditAccounts::slotNewMail()
selType.show();
- if ( QDialog::Accepted == selType.exec() ) {
+ if ( QDialog::Accepted == selType.exec() )
+ {
slotNewAccount( *selection );
@@ -63,3 +73,4 @@ void EditAccounts::slotNewAccount( const QString &type )
{
- if ( type.compare( "IMAP" ) == 0 ) {
+ if ( type.compare( "IMAP" ) == 0 )
+ {
qDebug( "-> config IMAP" );
@@ -67,4 +78,4 @@ void EditAccounts::slotNewAccount( const QString &type )
IMAPconfig imap( account, this, 0, true );
- imap.showMaximized();
- if ( QDialog::Accepted == imap.exec() ) {
+ if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) )
+ {
settings->addAccount( account );
@@ -72,6 +83,10 @@ void EditAccounts::slotNewAccount( const QString &type )
slotFillLists();
- } else {
+ }
+ else
+ {
account->remove();
}
- } else if ( type.compare( "POP3" ) == 0 ) {
+ }
+ else if ( type.compare( "POP3" ) == 0 )
+ {
qDebug( "-> config POP3" );
@@ -79,4 +94,4 @@ void EditAccounts::slotNewAccount( const QString &type )
POP3config pop3( account, this, 0, true, WStyle_ContextHelp );
- pop3.showMaximized();
- if ( QDialog::Accepted == pop3.exec() ) {
+ if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) )
+ {
settings->addAccount( account );
@@ -84,6 +99,10 @@ void EditAccounts::slotNewAccount( const QString &type )
slotFillLists();
- } else {
+ }
+ else
+ {
account->remove();
}
- } else if ( type.compare( "SMTP" ) == 0 ) {
+ }
+ else if ( type.compare( "SMTP" ) == 0 )
+ {
qDebug( "-> config SMTP" );
@@ -91,4 +110,4 @@ void EditAccounts::slotNewAccount( const QString &type )
SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp );
- smtp.showMaximized();
- if ( QDialog::Accepted == smtp.exec() ) {
+ if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) )
+ {
settings->addAccount( account );
@@ -97,6 +116,10 @@ void EditAccounts::slotNewAccount( const QString &type )
- } else {
+ }
+ else
+ {
account->remove();
}
- } else if ( type.compare( "NNTP" ) == 0 ) {
+ }
+ else if ( type.compare( "NNTP" ) == 0 )
+ {
qDebug( "-> config NNTP" );
@@ -104,4 +127,4 @@ void EditAccounts::slotNewAccount( const QString &type )
NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp );
- nntp.showMaximized();
- if ( QDialog::Accepted == nntp.exec() ) {
+ if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) )
+ {
settings->addAccount( account );
@@ -109,3 +132,5 @@ void EditAccounts::slotNewAccount( const QString &type )
slotFillLists();
- } else {
+ }
+ else
+ {
account->remove();
@@ -117,29 +142,36 @@ void EditAccounts::slotEditAccount( Account *account )
{
- if ( account->getType().compare( "IMAP" ) == 0 ) {
+ if ( account->getType().compare( "IMAP" ) == 0 )
+ {
IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account);
IMAPconfig imap( imapAcc, this, 0, true, WStyle_ContextHelp );
- imap.showMaximized();
- if ( QDialog::Accepted == imap.exec() ) {
- slotFillLists();
+ if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) )
+ {
+ slotFillLists();
}
- } else if ( account->getType().compare( "POP3" ) == 0 ) {
+ }
+ else if ( account->getType().compare( "POP3" ) == 0 )
+ {
POP3account *pop3Acc = static_cast<POP3account *>(account);
POP3config pop3( pop3Acc, this, 0, true, WStyle_ContextHelp );
- pop3.showMaximized();
- if ( QDialog::Accepted == pop3.exec() ) {
- slotFillLists();
+ if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) )
+ {
+ slotFillLists();
}
- } else if ( account->getType().compare( "SMTP" ) == 0 ) {
+ }
+ else if ( account->getType().compare( "SMTP" ) == 0 )
+ {
SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account);
SMTPconfig smtp( smtpAcc, this, 0, true, WStyle_ContextHelp );
- smtp.showMaximized();
- if ( QDialog::Accepted == smtp.exec() ) {
- slotFillLists();
+ if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) )
+ {
+ slotFillLists();
}
- } else if ( account->getType().compare( "NNTP" ) == 0 ) {
+ }
+ else if ( account->getType().compare( "NNTP" ) == 0 )
+ {
NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account);
NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp );
- nntp.showMaximized();
- if ( QDialog::Accepted == nntp.exec() ) {
- slotFillLists();
+ if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) )
+ {
+ slotFillLists();
}
@@ -151,4 +183,5 @@ void EditAccounts::slotDeleteAccount( Account *account )
if ( QMessageBox::information( this, tr( "Question" ),
- tr( "<p>Do you really want to delete the selected Account?</p>" ),
- tr( "Yes" ), tr( "No" ) ) == 0 ) {
+ tr( "<p>Do you really want to delete the selected Account?</p>" ),
+ tr( "Yes" ), tr( "No" ) ) == 0 )
+ {
settings->delAccount( account );
@@ -161,3 +194,4 @@ void EditAccounts::slotEditMail()
qDebug( "Edit Mail Account" );
- if ( !mailList->currentItem() ) {
+ if ( !mailList->currentItem() )
+ {
QMessageBox::information( this, tr( "Error" ),
@@ -174,3 +208,4 @@ void EditAccounts::slotDeleteMail()
{
- if ( !mailList->currentItem() ) {
+ if ( !mailList->currentItem() )
+ {
QMessageBox::information( this, tr( "Error" ),
@@ -194,3 +229,4 @@ void EditAccounts::slotEditNews()
qDebug( "Edit News Account" );
- if ( !newsList->currentItem() ) {
+ if ( !newsList->currentItem() )
+ {
QMessageBox::information( this, tr( "Error" ),
@@ -208,3 +244,4 @@ void EditAccounts::slotDeleteNews()
qDebug( "Delete News Account" );
- if ( !newsList->currentItem() ) {
+ if ( !newsList->currentItem() )
+ {
QMessageBox::information( this, tr( "Error" ),
@@ -245,3 +282,3 @@ void EditAccounts::accept()
SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags )
- : SelectMailTypeUI( parent, name, modal, flags )
+ : SelectMailTypeUI( parent, name, modal, flags )
{
@@ -262,3 +299,3 @@ void SelectMailType::slotSelection( const QString &sel )
IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags )
- : IMAPconfigUI( parent, name, modal, flags )
+ : IMAPconfigUI( parent, name, modal, flags )
{
@@ -279,8 +316,13 @@ void IMAPconfig::slotConnectionToggle( int index )
{
- if ( index == 2 ) {
- portLine->setText( IMAP_SSL_PORT );
- } else if ( index == 3 ) {
+ if ( index == 2 )
+ {
+ portLine->setText( IMAP_SSL_PORT );
+ }
+ else if ( index == 3 )
+ {
portLine->setText( IMAP_PORT );
CommandEdit->show();
- } else {
+ }
+ else
+ {
portLine->setText( IMAP_PORT );
@@ -318,3 +360,3 @@ void IMAPconfig::accept()
POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags )
- : POP3configUI( parent, name, modal, flags )
+ : POP3configUI( parent, name, modal, flags )
{
@@ -335,8 +377,13 @@ void POP3config::slotConnectionToggle( int index )
// 2 is ssl connection
- if ( index == 2 ) {
- portLine->setText( POP3_SSL_PORT );
- } else if ( index == 3 ) {
+ if ( index == 2 )
+ {
+ portLine->setText( POP3_SSL_PORT );
+ }
+ else if ( index == 3 )
+ {
portLine->setText( POP3_PORT );
CommandEdit->show();
- } else {
+ }
+ else
+ {
portLine->setText( POP3_PORT );
@@ -372,3 +419,3 @@ void POP3config::accept()
SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags )
- : SMTPconfigUI( parent, name, modal, flags )
+ : SMTPconfigUI( parent, name, modal, flags )
{
@@ -393,8 +440,13 @@ void SMTPconfig::slotConnectionToggle( int index )
// 2 is ssl connection
- if ( index == 2 ) {
- portLine->setText( SMTP_SSL_PORT );
- } else if ( index == 3 ) {
+ if ( index == 2 )
+ {
+ portLine->setText( SMTP_SSL_PORT );
+ }
+ else if ( index == 3 )
+ {
portLine->setText( SMTP_PORT );
CommandEdit->show();
- } else {
+ }
+ else
+ {
portLine->setText( SMTP_PORT );
@@ -432,3 +484,3 @@ void SMTPconfig::accept()
NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags )
- : NNTPconfigUI( parent, name, modal, flags )
+ : NNTPconfigUI( parent, name, modal, flags )
{
@@ -446,5 +498,8 @@ void NNTPconfig::slotSSL( bool enabled )
{
- if ( enabled ) {
+ if ( enabled )
+ {
portLine->setText( NNTP_SSL_PORT );
- } else {
+ }
+ else
+ {
portLine->setText( NNTP_PORT );
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp
index 0795436..abf93dc 100644
--- a/noncore/net/mail/opiemail.cpp
+++ b/noncore/net/mail/opiemail.cpp
@@ -1,2 +1,2 @@
-#include <qmessagebox.h>
+
#include "settingsdialog.h"
@@ -5,16 +5,22 @@
#include "composemail.h"
+#include "mailistviewitem.h"
+#include "viewmail.h"
+#include "selectstore.h"
+#include "selectsmtp.h"
+
+/* OPIE */
#include <libmailwrapper/smtpwrapper.h>
+#include <libmailwrapper/mailtypes.h>
+#include <libmailwrapper/abstractmail.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/resource.h>
+#include <qpe/qpeapplication.h>
+
+/* QT */
+#include <qmessagebox.h>
#include <qaction.h>
#include <qapplication.h>
-#include <libmailwrapper/mailtypes.h>
-#include <libmailwrapper/abstractmail.h>
-#include "mailistviewitem.h"
-#include "viewmail.h"
-#include "selectstore.h"
-#include "selectsmtp.h"
OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags )
- : MainWindow( parent, name, WStyle_ContextHelp )
+ : MainWindow( parent, name, WStyle_ContextHelp )
{
@@ -33,3 +39,4 @@ void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
// copied from old mail2
- if (msg == "writeMail(QString,QString)") {
+ if (msg == "writeMail(QString,QString)")
+ {
QDataStream stream(data,IO_ReadOnly);
@@ -39,3 +46,5 @@ void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace());
- } else if (msg == "newMail()") {
+ }
+ else if (msg == "newMail()")
+ {
slotComposeMail();
@@ -47,6 +56,10 @@ void OpieMail::slotwriteMail(const QString&name,const QString&email)
ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp );
- if (!email.isEmpty()) {
- if (!name.isEmpty()) {
+ if (!email.isEmpty())
+ {
+ if (!name.isEmpty())
+ {
compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">");
- } else {
+ }
+ else
+ {
compose.setTo(email);
@@ -54,5 +67,4 @@ void OpieMail::slotwriteMail(const QString&name,const QString&email)
}
- compose.showMaximized();
compose.slotAdjustColumns();
- compose.exec();
+ QPEApplication::execDialog( &compose );
}
@@ -74,4 +86,6 @@ void OpieMail::slotSendQueued()
Account *it;
- for ( it = list.first(); it; it = list.next() ) {
- if ( it->getType().compare( "SMTP" ) == 0 ) {
+ for ( it = list.first(); it; it = list.next() )
+ {
+ if ( it->getType().compare( "SMTP" ) == 0 )
+ {
smtp = static_cast<SMTPaccount *>(it);
@@ -80,3 +94,4 @@ void OpieMail::slotSendQueued()
}
- if (smtpList.count()==0) {
+ if (smtpList.count()==0)
+ {
QMessageBox::information(0,tr("Info"),tr("Define a smtp account first"));
@@ -84,5 +99,8 @@ void OpieMail::slotSendQueued()
}
- if (smtpList.count()==1) {
+ if (smtpList.count()==1)
+ {
smtp = smtpList.at(0);
- } else {
+ }
+ else
+ {
smtp = 0;
@@ -90,4 +108,4 @@ void OpieMail::slotSendQueued()
selsmtp.setSelectionlist(&smtpList);
- selsmtp.showMaximized();
- if (selsmtp.exec()==QDialog::Accepted) {
+ if ( QPEApplication::execDialog( &selsmtp ) == QDialog::Accepted )
+ {
smtp = selsmtp.selected_smtp();
@@ -95,5 +113,7 @@ void OpieMail::slotSendQueued()
}
- if (smtp) {
+ if (smtp)
+ {
SMTPwrapper * wrap = new SMTPwrapper(smtp);
- if ( wrap->flushOutbox() ) {
+ if ( wrap->flushOutbox() )
+ {
QMessageBox::information(0,tr("Info"),tr("Mail queue flushed"));
@@ -112,4 +132,3 @@ void OpieMail::slotEditSettings()
SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp );
- settingsDialog.showMaximized();
- settingsDialog.exec();
+ QPEApplication::execDialog( &settingsDialog );
}
@@ -120,5 +139,4 @@ void OpieMail::slotEditAccounts()
EditAccounts eaDialog( settings, this, 0, true, WStyle_ContextHelp );
- eaDialog.showMaximized();
eaDialog.slotAdjustColumns();
- eaDialog.exec();
+ QPEApplication::execDialog( &eaDialog );
if ( settings ) delete settings;
@@ -141,5 +159,8 @@ void OpieMail::displayMail()
- if ( readMail.deleted ) {
- folderView->refreshCurrent();
- } else {
+ if ( readMail.deleted )
+ {
+ folderView->refreshCurrent();
+ }
+ else
+ {
( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "" ) );
@@ -152,5 +173,6 @@ void OpieMail::slotDeleteMail()
RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data();
- if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<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 );
- folderView->refreshCurrent();
+ if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<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 );
+ folderView->refreshCurrent();
}
@@ -165,3 +187,4 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
QPopupMenu *m = new QPopupMenu(0);
- if (m) {
+ if (m)
+ {
m->insertItem(tr("Read this mail"),this,SLOT(displayMail()));
@@ -177,7 +200,10 @@ void OpieMail::slotShowFolders( bool show )
{
- qDebug( "Show Folders" );
- if ( show && folderView->isHidden() ) {
+ qDebug( "Show Folders" );
+ if ( show && folderView->isHidden() )
+ {
qDebug( "-> showing" );
folderView->show();
- } else if ( !show && !folderView->isHidden() ) {
+ }
+ else if ( !show && !folderView->isHidden() )
+ {
qDebug( "-> hiding" );
@@ -191,3 +217,4 @@ void OpieMail::refreshMailView(QList<RecMail>*list)
mailView->clear();
- for (unsigned int i = 0; i < list->count();++i) {
+ for (unsigned int i = 0; i < list->count();++i)
+ {
item = new MailListViewItem(mailView,item);
@@ -218,8 +245,10 @@ void OpieMail::slotMoveCopyMail()
if ( (mail.Wrapper()==targetMail && mail.getMbox()==targetFolder) ||
- targetFolder.isEmpty()) {
+ targetFolder.isEmpty())
+ {
return;
}
- if (sels.newFolder() && !targetMail->createMbox(targetFolder)) {
+ if (sels.newFolder() && !targetMail->createMbox(targetFolder))
+ {
QMessageBox::critical(0,tr("Error creating new Folder"),
- tr("<center>Error while creating<br>new folder - breaking.</center>"));
+ tr("<center>Error while creating<br>new folder - breaking.</center>"));
return;
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index 99965d4..f015228 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -1 +1,15 @@
+#include "composemail.h"
+#include "viewmail.h"
+#include "accountview.h"
+
+/* OPIE */
+#include <libmailwrapper/settings.h>
+#include <libmailwrapper/abstractmail.h>
+#include <libmailwrapper/mailtypes.h>
+
+#include <opie2/ofiledialog.h>
+#include <qpe/config.h>
+#include <qpe/qpeapplication.h>
+
+/* QT */
#include <qtextbrowser.h>
@@ -9,21 +23,10 @@
-#include <qpe/config.h>
-
-#include <opie2/ofiledialog.h>
-
-#include <libmailwrapper/settings.h>
-#include "composemail.h"
-#include "viewmail.h"
-#include <libmailwrapper/abstractmail.h>
-#include "accountview.h"
-#include <libmailwrapper/mailtypes.h>
-
AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
- const QString&fsize,int num,const QValueList<int>&path)
- : QListViewItem(parent,after),_partNum(num)
+ const QString&fsize,int num,const QValueList<int>&path)
+ : QListViewItem(parent,after),_partNum(num)
{
_path=path;
- setText(0, mime);
- setText(1, desc);
- setText(2, file);
+ setText(0, mime);
+ setText(1, desc);
+ setText(2, file);
setText(3, fsize);
@@ -32,9 +35,9 @@ AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mi
AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
- const QString&fsize,int num,const QValueList<int>&path)
- : QListViewItem(parent,after),_partNum(num)
+ const QString&fsize,int num,const QValueList<int>&path)
+ : QListViewItem(parent,after),_partNum(num)
{
_path=path;
- setText(0, mime);
- setText(1, desc);
- setText(2, file);
+ setText(0, mime);
+ setText(1, desc);
+ setText(2, file);
setText(3, fsize);
@@ -48,3 +51,4 @@ bool AttachItem::isParentof(const QValueList<int>&path)
if (path.count()!=_path.count()+1) return false;
- for (unsigned int i=0; i < _path.count();++i) {
+ for (unsigned int i=0; i < _path.count();++i)
+ {
if (_path[i]!=path[i]) return false;
@@ -57,3 +61,4 @@ AttachItem* ViewMail::searchParent(const QValueList<int>&path)
QListViewItemIterator it( attachments );
- for ( ; it.current(); ++it ) {
+ for ( ; it.current(); ++it )
+ {
AttachItem*ati = (AttachItem*)it.current();
@@ -70,3 +75,4 @@ AttachItem* ViewMail::lastChild(AttachItem*parent)
AttachItem*temp=0;
- while( (temp=(AttachItem*)item->nextSibling())) {
+ while( (temp=(AttachItem*)item->nextSibling()))
+ {
item = temp;
@@ -76,64 +82,23 @@ AttachItem* ViewMail::lastChild(AttachItem*parent)
-void ViewMail::setBody( RecBody body ) {
-
-m_body = body;
-m_mail[2] = body.Bodytext();
-attachbutton->setEnabled(body.Parts().count()>0);
-attachments->setEnabled(body.Parts().count()>0);
-if (body.Parts().count()==0) {
- return;
-}
-AttachItem * curItem=0;
-AttachItem * parentItem = 0;
-QString type=body.Description().Type()+"/"+body.Description().Subtype();
-QString desc,fsize;
-double s = body.Description().Size();
-int w;
-w=0;
-
-while (s>1024) {
- s/=1024;
- ++w;
- if (w>=2) break;
-}
-
-QString q="";
-switch(w) {
-case 1:
- q="k";
- break;
-case 2:
- q="M";
- break;
-default:
- break;
-}
-
+void ViewMail::setBody( RecBody body )
{
- /* I did not found a method to make a CONTENT reset on a QTextStream
- so I use this construct that the stream will re-constructed in each
- loop. To let it work, the textstream is packed into a own area of
- code is it will be destructed after finishing its small job.
- */
- QTextOStream o(&fsize);
- if (w>0) o.precision(2); else o.precision(0);
- o.setf(QTextStream::fixed);
- o << s << " " << q << "Byte";
-}
-
-curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1,body.Description().Positionlist());
-QString filename = "";
-for (unsigned int i = 0; i < body.Parts().count();++i) {
- type = body.Parts()[i].Type()+"/"+body.Parts()[i].Subtype();
- part_plist_t::ConstIterator it = body.Parts()[i].Parameters().begin();
- for (;it!=body.Parts()[i].Parameters().end();++it) {
- qDebug(it.key());
- if (it.key().lower()=="name") {
- filename=it.data();
- }
+ m_body = body;
+ m_mail[2] = body.Bodytext();
+ attachbutton->setEnabled(body.Parts().count()>0);
+ attachments->setEnabled(body.Parts().count()>0);
+ if (body.Parts().count()==0)
+ {
+ return;
}
- s = body.Parts()[i].Size();
- w = 0;
- while (s>1024) {
+ AttachItem * curItem=0;
+ AttachItem * parentItem = 0;
+ QString type=body.Description().Type()+"/"+body.Description().Subtype();
+ QString desc,fsize;
+ double s = body.Description().Size();
+ int w;
+ w=0;
+
+ while (s>1024)
+ {
s/=1024;
@@ -142,3 +107,6 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
}
- switch(w) {
+
+ QString q="";
+ switch(w)
+ {
case 1:
@@ -150,21 +118,71 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
default:
- q="";
break;
}
- QTextOStream o(&fsize);
- if (w>0) o.precision(2); else o.precision(0);
- o.setf(QTextStream::fixed);
- o << s << " " << q << "Byte";
- desc = body.Parts()[i].Description();
- parentItem = searchParent(body.Parts()[i].Positionlist());
- if (parentItem) {
- AttachItem*temp = lastChild(parentItem);
- if (temp) curItem = temp;
- curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist());
- attachments->setRootIsDecorated(true);
- curItem = parentItem;
- } else {
- curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist());
+
+ {
+ /* I did not found a method to make a CONTENT reset on a QTextStream
+ so I use this construct that the stream will re-constructed in each
+ loop. To let it work, the textstream is packed into a own area of
+ code is it will be destructed after finishing its small job.
+ */
+ QTextOStream o(&fsize);
+ if (w>0) o.precision(2); else o.precision(0);
+ o.setf(QTextStream::fixed);
+ o << s << " " << q << "Byte";
+ }
+
+ curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1,body.Description().Positionlist());
+ QString filename = "";
+
+ for (unsigned int i = 0; i < body.Parts().count();++i)
+ {
+ type = body.Parts()[i].Type()+"/"+body.Parts()[i].Subtype();
+ part_plist_t::ConstIterator it = body.Parts()[i].Parameters().begin();
+ for (;it!=body.Parts()[i].Parameters().end();++it)
+ {
+ qDebug(it.key());
+ if (it.key().lower()=="name")
+ {
+ filename=it.data();
+ }
+ }
+ s = body.Parts()[i].Size();
+ w = 0;
+ while (s>1024)
+ {
+ s/=1024;
+ ++w;
+ if (w>=2) break;
+ }
+ switch(w)
+ {
+ case 1:
+ q="k";
+ break;
+ case 2:
+ q="M";
+ break;
+ default:
+ q="";
+ break;
+ }
+ QTextOStream o(&fsize);
+ if (w>0) o.precision(2); else o.precision(0);
+ o.setf(QTextStream::fixed);
+ o << s << " " << q << "Byte";
+ desc = body.Parts()[i].Description();
+ parentItem = searchParent(body.Parts()[i].Positionlist());
+ if (parentItem)
+ {
+ AttachItem*temp = lastChild(parentItem);
+ if (temp) curItem = temp;
+ curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist());
+ attachments->setRootIsDecorated(true);
+ curItem = parentItem;
+ }
+ else
+ {
+ curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist());
+ }
}
-}
}
@@ -172,3 +190,4 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
-void ViewMail::slotShowHtml( bool state ) {
+void ViewMail::slotShowHtml( bool state )
+{
m_showHtml = state;
@@ -177,3 +196,4 @@ void ViewMail::slotShowHtml( bool state ) {
-void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) {
+void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int )
+{
if (!item )
@@ -181,3 +201,4 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
- if ( ( ( AttachItem* )item )->Partnumber() == -1 ) {
+ if ( ( ( AttachItem* )item )->Partnumber() == -1 )
+ {
setText();
@@ -186,43 +207,52 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
QPopupMenu *menu = new QPopupMenu();
- int ret=0;
-
- if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) {
- menu->insertItem( tr( "Show Text" ), 1 );
- }
- menu->insertItem( tr( "Save Attachment" ), 0 );
- menu->insertSeparator(1);
-
- ret = menu->exec( point, 0 );
-
- switch(ret) {
- case 0:
- { MimeTypes types;
- types.insert( "all", "*" );
- QString str = Opie::OFileDialog::getSaveFileName( 1,
- "/", item->text( 2 ) , types, 0 );
-
- if( !str.isEmpty() ) {
- encodedString*content = m_recMail.Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
- if (content) {
- QFile output(str);
- output.open(IO_WriteOnly);
- output.writeBlock(content->Content(),content->Length());
- output.close();
- delete content;
- }
- }
- }
+ int ret=0;
+
+ if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" )
+ {
+ menu->insertItem( tr( "Show Text" ), 1 );
+ }
+ menu->insertItem( tr( "Save Attachment" ), 0 );
+ menu->insertSeparator(1);
+
+ ret = menu->exec( point, 0 );
+
+ switch(ret)
+ {
+ case 0:
+ {
+ MimeTypes types;
+ types.insert( "all", "*" );
+ QString str = Opie::OFileDialog::getSaveFileName( 1,
+ "/", item->text( 2 ) , types, 0 );
+
+ if( !str.isEmpty() )
+ {
+ encodedString*content = m_recMail.Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
+ if (content)
+ {
+ QFile output(str);
+ output.open(IO_WriteOnly);
+ output.writeBlock(content->Content(),content->Length());
+ output.close();
+ delete content;
+ }
+ }
+ }
break ;
- case 1:
- if ( ( ( AttachItem* )item )->Partnumber() == -1 ) {
- setText();
- } else {
- if ( m_recMail.Wrapper() != 0l ) { // make sure that there is a wrapper , even after delete or simular actions
+ case 1:
+ if ( ( ( AttachItem* )item )->Partnumber() == -1 )
+ {
+ setText();
+ }
+ else
+ {
+ if ( m_recMail.Wrapper() != 0l )
+ { // make sure that there is a wrapper , even after delete or simular actions
browser->setText( m_recMail.Wrapper()->fetchTextPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) );
- }
- }
+ }
+ }
break;
- }
- delete menu;
+ }
+ delete menu;
}
@@ -230,3 +260,4 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
-void ViewMail::setMail( RecMail mail ) {
+void ViewMail::setMail( RecMail mail )
+{
@@ -249,16 +280,16 @@ void ViewMail::setMail( RecMail mail ) {
ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
- : ViewMailBase(parent, name, fl), _inLoop(false)
+ : ViewMailBase(parent, name, fl), _inLoop(false)
{
- m_gotBody = false;
- deleted = false;
+ m_gotBody = false;
+ deleted = false;
- connect( reply, SIGNAL(activated()), SLOT(slotReply()));
- connect( forward, SIGNAL(activated()), SLOT(slotForward()));
- connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail( ) ) );
- connect( showHtml, SIGNAL( toggled( bool ) ), SLOT( slotShowHtml( bool ) ) );
+ connect( reply, SIGNAL(activated()), SLOT(slotReply()));
+ connect( forward, SIGNAL(activated()), SLOT(slotForward()));
+ connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail( ) ) );
+ connect( showHtml, SIGNAL( toggled( bool ) ), SLOT( slotShowHtml( bool ) ) );
- attachments->setEnabled(m_gotBody);
- connect( attachments, SIGNAL( clicked ( QListViewItem *, const QPoint & , int ) ), SLOT( slotItemClicked( QListViewItem *, const QPoint & , int ) ) );
+ attachments->setEnabled(m_gotBody);
+ connect( attachments, SIGNAL( clicked ( QListViewItem *, const QPoint & , int ) ), SLOT( slotItemClicked( QListViewItem *, const QPoint & , int ) ) );
- readConfig();
+ readConfig();
attachments->setSorting(-1);
@@ -266,3 +297,4 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
-void ViewMail::readConfig() {
+void ViewMail::readConfig()
+{
Config cfg( "mail" );
@@ -280,9 +312,12 @@ void ViewMail::setText()
- for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) {
+ for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it )
+ {
toString += (*it);
}
- for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) {
+ for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it )
+ {
ccString += (*it);
}
- for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) {
+ for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it )
+ {
bccString += (*it);
@@ -302,6 +337,9 @@ void ViewMail::setText()
- if ( !m_showHtml ) {
- browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" );
- } else {
- browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" );
+ if ( !m_showHtml )
+ {
+ browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" );
+ }
+ else
+ {
+ browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" );
}
@@ -315,3 +353,3 @@ ViewMail::~ViewMail()
m_recMail.Wrapper()->cleanMimeCache();
- hide();
+ hide();
}
@@ -320,9 +358,10 @@ void ViewMail::hide()
{
- QWidget::hide();
+ QWidget::hide();
- if (_inLoop) {
- _inLoop = false;
- qApp->exit_loop();
+ if (_inLoop)
+ {
+ _inLoop = false;
+ qApp->exit_loop();
- }
+ }
@@ -332,8 +371,9 @@ void ViewMail::exec()
{
- show();
+ show();
- if (!_inLoop) {
- _inLoop = true;
- qApp->enter_loop();
- }
+ if (!_inLoop)
+ {
+ _inLoop = true;
+ qApp->enter_loop();
+ }
@@ -343,8 +383,8 @@ QString ViewMail::deHtml(const QString &string)
{
- QString string_ = string;
- string_.replace(QRegExp("&"), "&amp;");
- string_.replace(QRegExp("<"), "&lt;");
- string_.replace(QRegExp(">"), "&gt;");
- string_.replace(QRegExp("\\n"), "<br>");
- return string_;
+ QString string_ = string;
+ string_.replace(QRegExp("&"), "&amp;");
+ string_.replace(QRegExp("<"), "&lt;");
+ string_.replace(QRegExp(">"), "&gt;");
+ string_.replace(QRegExp("\\n"), "<br>");
+ return string_;
}
@@ -353,31 +393,33 @@ void ViewMail::slotReply()
{
- if (!m_gotBody) {
- QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot reply yet."), tr("Ok"));
- return;
- }
-
- QString rtext;
- rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
- .arg( m_mail[0] )
- .arg( m_mail[3] );
-
- QString text = m_mail[2];
- QStringList lines = QStringList::split(QRegExp("\\n"), text);
- QStringList::Iterator it;
- for (it = lines.begin(); it != lines.end(); it++) {
- rtext += "> " + *it + "\n";
- }
- rtext += "\n";
-
- QString prefix;
- if ( m_mail[1].find(QRegExp("^Re: *$")) != -1) prefix = "";
- else prefix = "Re: "; // no i18n on purpose
-
- Settings *settings = new Settings();
- ComposeMail composer( settings ,this, 0, true);
- composer.setTo( m_mail[0] );
- composer.setSubject( "Re: " + m_mail[1] );
- composer.setMessage( rtext );
- composer.showMaximized();
- if ( QDialog::Accepted==composer.exec()) {
+ if (!m_gotBody)
+ {
+ QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot reply yet."), tr("Ok"));
+ return;
+ }
+
+ QString rtext;
+ rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
+ .arg( m_mail[0] )
+ .arg( m_mail[3] );
+
+ QString text = m_mail[2];
+ QStringList lines = QStringList::split(QRegExp("\\n"), text);
+ QStringList::Iterator it;
+ for (it = lines.begin(); it != lines.end(); it++)
+ {
+ rtext += "> " + *it + "\n";
+ }
+ rtext += "\n";
+
+ QString prefix;
+ if ( m_mail[1].find(QRegExp("^Re: *$")) != -1) prefix = "";
+ else prefix = "Re: "; // no i18n on purpose
+
+ Settings *settings = new Settings();
+ ComposeMail composer( settings ,this, 0, true);
+ composer.setTo( m_mail[0] );
+ composer.setSubject( "Re: " + m_mail[1] );
+ composer.setMessage( rtext );
+ if ( QDialog::Accepted == QPEApplication::execDialog( &composer ) )
+ {
m_recMail.Wrapper()->answeredMail(m_recMail);
@@ -388,32 +430,32 @@ void ViewMail::slotForward()
{
- if (!m_gotBody) {
- QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok"));
- return;
- }
-
- QString ftext;
- ftext += QString("\n----- Forwarded message from %1 -----\n\n")
- .arg( m_mail[0] );
- if (!m_mail[3].isNull())
- ftext += QString("Date: %1\n")
- .arg( m_mail[3] );
- if (!m_mail[0].isNull())
- ftext += QString("From: %1\n")
- .arg( m_mail[0] );
- if (!m_mail[1].isNull())
- ftext += QString("Subject: %1\n")
- .arg( m_mail[1] );
-
- ftext += QString("\n%1\n")
- .arg( m_mail[2]);
-
- ftext += QString("----- End forwarded message -----\n");
-
- Settings *settings = new Settings();
- ComposeMail composer( settings ,this, 0, true);
- composer.setSubject( "Fwd: " + m_mail[1] );
- composer.setMessage( ftext );
- composer.showMaximized();
- if ( QDialog::Accepted==composer.exec()) {
+ if (!m_gotBody)
+ {
+ QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok"));
+ return;
+ }
+ QString ftext;
+ ftext += QString("\n----- Forwarded message from %1 -----\n\n")
+ .arg( m_mail[0] );
+ if (!m_mail[3].isNull())
+ ftext += QString("Date: %1\n")
+ .arg( m_mail[3] );
+ if (!m_mail[0].isNull())
+ ftext += QString("From: %1\n")
+ .arg( m_mail[0] );
+ if (!m_mail[1].isNull())
+ ftext += QString("Subject: %1\n")
+ .arg( m_mail[1] );
+
+ ftext += QString("\n%1\n")
+ .arg( m_mail[2]);
+
+ ftext += QString("----- End forwarded message -----\n");
+
+ Settings *settings = new Settings();
+ ComposeMail composer( settings ,this, 0, true);
+ composer.setSubject( "Fwd: " + m_mail[1] );
+ composer.setMessage( ftext );
+ if ( QDialog::Accepted == QPEApplication::execDialog( &composer ))
+ {
}
@@ -423,3 +465,4 @@ void ViewMail::slotDeleteMail( )
{
- if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) {
+ if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
+ {
m_recMail.Wrapper()->deleteMail( m_recMail );
diff --git a/noncore/net/opieirc/ircservereditor.cpp b/noncore/net/opieirc/ircservereditor.cpp
index 60274d1..2d11bf0 100644
--- a/noncore/net/opieirc/ircservereditor.cpp
+++ b/noncore/net/opieirc/ircservereditor.cpp
@@ -1 +1,7 @@
+#include "ircservereditor.h"
+
+/* OPIE */
+#include <qpe/qpeapplication.h>
+
+/* QT */
#include <qmessagebox.h>
@@ -4,3 +10,2 @@
#include <qwhatsthis.h>
-#include "ircservereditor.h"
@@ -45,3 +50,4 @@ IRCServerEditor::IRCServerEditor(IRCServer server, QWidget* parent, const char*
setCaption(tr("Edit server information"));
- showMaximized();
+
+ QPEApplication::showDialog( this );
}
diff --git a/noncore/net/opieirc/ircserverlist.cpp b/noncore/net/opieirc/ircserverlist.cpp
index 595ae3e..62bfc17 100644
--- a/noncore/net/opieirc/ircserverlist.cpp
+++ b/noncore/net/opieirc/ircserverlist.cpp
@@ -1 +1,9 @@
+
+#include "ircserverlist.h"
+#include "ircservereditor.h"
+
+/* OPIE */
+#include <qpe/qpeapplication.h>
+
+/* QT */
#include <qlayout.h>
@@ -5,8 +13,8 @@
#include <qwhatsthis.h>
-#include "ircserverlist.h"
-#include "ircservereditor.h"
-class IRCListBoxServer : public QListBoxText {
+class IRCListBoxServer : public QListBoxText
+{
public:
- IRCListBoxServer(IRCServer server) : QListBoxText(server.name()) {
+ IRCListBoxServer(IRCServer server) : QListBoxText(server.name())
+ {
m_server = server;
@@ -14,7 +22,9 @@ public:
- IRCServer server() {
+ IRCServer server()
+ {
return m_server;
}
-
- void setServer(IRCServer server) {
+
+ void setServer(IRCServer server)
+ {
m_server = server;
@@ -26,3 +36,4 @@ protected:
-IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) {
+IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp)
+{
QVBoxLayout *layout = new QVBoxLayout(this, 5, 5);
@@ -50,7 +61,10 @@ IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFla
int count = m_config->readNumEntry("ServerCount", 0);
- if (count) {
- for (int i=0; i<count; i++) {
+ if (count)
+ {
+ for (int i=0; i<count; i++)
+ {
m_config->setGroup("OpieIRC");
QString name = m_config->readEntry("Server"+QString::number(i));
- if (name.length() > 0) {
+ if (name.length() > 0)
+ {
IRCServer server;
@@ -69,10 +83,12 @@ IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFla
}
-
- showMaximized();
+
+ QPEApplication::showDialog( this );
}
-void IRCServerList::addServer() {
+void IRCServerList::addServer()
+{
IRCServer server;
IRCServerEditor editor(server, this, "ServerEditor", TRUE);
- if (editor.exec() == QDialog::Accepted) {
+ if (editor.exec() == QDialog::Accepted)
+ {
server = editor.getServer();
@@ -83,5 +99,7 @@ void IRCServerList::addServer() {
-void IRCServerList::delServer() {
+void IRCServerList::delServer()
+{
int index = m_list->currentItem();
- if (index != -1) {
+ if (index != -1)
+ {
m_list->removeItem(index);
@@ -90,5 +108,7 @@ void IRCServerList::delServer() {
-void IRCServerList::editServer() {
+void IRCServerList::editServer()
+{
int index = m_list->currentItem();
- if (index != -1) {
+ if (index != -1)
+ {
IRCListBoxServer *item = (IRCListBoxServer *)m_list->item(index);
@@ -96,3 +116,4 @@ void IRCServerList::editServer() {
IRCServerEditor editor(server, this, "ServerEditor", TRUE);
- if (editor.exec() == QDialog::Accepted) {
+ if (editor.exec() == QDialog::Accepted)
+ {
server = editor.getServer();
@@ -103,3 +124,4 @@ void IRCServerList::editServer() {
-int IRCServerList::exec() {
+int IRCServerList::exec()
+{
int returncode = QDialog::exec();
@@ -108,3 +130,4 @@ int IRCServerList::exec() {
m_config->writeEntry("ServerCount", QString::number(m_list->count()));
- for (unsigned int i=0; i<m_list->count(); i++) {
+ for (unsigned int i=0; i<m_list->count(); i++)
+ {
IRCServer server = ((IRCListBoxServer *)m_list->item(i))->server();
@@ -124,3 +147,4 @@ int IRCServerList::exec() {
-bool IRCServerList::hasServer() {
+bool IRCServerList::hasServer()
+{
return (m_list->currentItem() != -1);
@@ -128,3 +152,4 @@ bool IRCServerList::hasServer() {
-IRCServer IRCServerList::server() {
+IRCServer IRCServerList::server()
+{
return ((IRCListBoxServer *)m_list->item(m_list->currentItem()))->server();
@@ -132,3 +157,4 @@ IRCServer IRCServerList::server() {
-IRCServerList::~IRCServerList() {
+IRCServerList::~IRCServerList()
+{
delete m_config;
diff --git a/noncore/net/opieirc/ircsettings.cpp b/noncore/net/opieirc/ircsettings.cpp
index 2862296..f69d2c4 100644
--- a/noncore/net/opieirc/ircsettings.cpp
+++ b/noncore/net/opieirc/ircsettings.cpp
@@ -1,9 +1,16 @@
+
+#include "ircsettings.h"
+#include "irctab.h"
+
+/* OPIE */
#include <opie/ocolorbutton.h>
#include <opie/otabwidget.h>
+#include <qpe/qpeapplication.h>
+
+/* QT */
#include <qvalidator.h>
#include <qwhatsthis.h>
-#include "ircsettings.h"
-#include "irctab.h"
-IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) {
+IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp)
+{
setCaption(tr("Settings") );
@@ -72,6 +79,8 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags)
tw->setCurrentTab( genwidget );
- showMaximized();
+
+ QPEApplication::showDialog( this );
}
-void IRCSettings::accept() {
+void IRCSettings::accept()
+{
IRCTab::m_backgroundColor = m_background->color().name();
@@ -95,3 +104,4 @@ void IRCSettings::accept() {
-IRCSettings::~IRCSettings() {
+IRCSettings::~IRCSettings()
+{
delete m_config;
diff --git a/noncore/net/opietooth/blue-pin/pindlg.cc b/noncore/net/opietooth/blue-pin/pindlg.cc
index 7d60d6c..9418a20 100644
--- a/noncore/net/opietooth/blue-pin/pindlg.cc
+++ b/noncore/net/opietooth/blue-pin/pindlg.cc
@@ -1,4 +1,9 @@
-#include <stdio.h>
+#include "pindlg.h"
+
+/* OPIE */
+#include <qpe/config.h>
+#include <qpe/qpeapplication.h>
+/* QT */
#include <qcheckbox.h>
@@ -8,5 +13,4 @@
-#include <qpe/config.h>
-
-#include "pindlg.h"
+/* STD */
+#include <stdio.h>
@@ -17,3 +21,3 @@ PinDlg::PinDlg( const QString& status,
const char* name )
- : PinDlgBase( parent, name, WType_Modal )
+ : PinDlgBase( parent, name, WType_Modal )
{
@@ -22,11 +26,13 @@ PinDlg::PinDlg( const QString& status,
txtStatus->setText(status);
- showMaximized();
+ QPEApplication::showDialog( this );
}
-PinDlg::~PinDlg() {
-}
-void PinDlg::setMac( const QString& mac ) {
+PinDlg::~PinDlg()
+{}
+void PinDlg::setMac( const QString& mac )
+{
txtStatus->setText( mac );
}
-QString PinDlg::pin() const{
+QString PinDlg::pin() const
+{
return lnePin->text();
@@ -34,4 +40,6 @@ QString PinDlg::pin() const{
-void PinDlg::test( const QString& mac ) {
- if (!mac.isEmpty() ) {
+void PinDlg::test( const QString& mac )
+{
+ if (!mac.isEmpty() )
+ {
Config cfg("bluepin");
@@ -39,3 +47,4 @@ void PinDlg::test( const QString& mac ) {
lnePin->setText(cfg.readEntryCrypt("pin", QString::null ) );
- if ( !lnePin->text().isEmpty() ) {
+ if ( !lnePin->text().isEmpty() )
+ {
//QTimer::singleShot(100, this, SLOT(accept() ) );
@@ -46,4 +55,6 @@ void PinDlg::test( const QString& mac ) {
}
-void PinDlg::accept() {
- if ( ckbPin->isChecked() ) {
+void PinDlg::accept()
+{
+ if ( ckbPin->isChecked() )
+ {
Config cfg("bluepin");
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 2e68984..0ea45d2 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -24,7 +24,8 @@
-#include <remotedevice.h>
-#include <services.h>
-
-#include <stdlib.h>
+/* OPIE */
+#include <qpe/qpeapplication.h>
+#include <qpe/resource.h>
+#include <qpe/config.h>
+/* QT */
#include <qframe.h>
@@ -48,6 +49,6 @@
-#include <qpe/qpeapplication.h>
-#include <qpe/resource.h>
-#include <qpe/config.h>
-
+/* STD */
+#include <remotedevice.h>
+#include <services.h>
+#include <stdlib.h>
@@ -56,3 +57,4 @@ using namespace OpieTooth;
BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
- : BluetoothBase( parent, name, fl ) {
+ : BluetoothBase( parent, name, fl )
+{
@@ -64,3 +66,3 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
connect( rfcommBindButton, SIGNAL( clicked() ), this, SLOT( rfcommDialog() ) );
-// not good since lib is async
+ // not good since lib is async
// connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ),
@@ -78,3 +80,3 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
connect( m_localDevice, SIGNAL( signalStrength( const QString&, const QString& ) ),
- this, SLOT( addSignalStrength( const QString&, const QString& ) ) );
+ this, SLOT( addSignalStrength( const QString&, const QString& ) ) );
@@ -117,3 +119,4 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
*/
-void BlueBase::readConfig() {
+void BlueBase::readConfig()
+{
@@ -133,3 +136,4 @@ void BlueBase::readConfig() {
*/
-void BlueBase::writeConfig() {
+void BlueBase::writeConfig()
+{
@@ -151,3 +155,4 @@ void BlueBase::writeConfig() {
*/
-void BlueBase::writeToHciConfig() {
+void BlueBase::writeToHciConfig()
+{
qWarning("writeToHciConfig");
@@ -168,3 +173,4 @@ void BlueBase::writeToHciConfig() {
*/
-void BlueBase::readSavedDevices() {
+void BlueBase::readSavedDevices()
+{
@@ -181,3 +187,4 @@ void BlueBase::readSavedDevices() {
*/
-void BlueBase::writeSavedDevices() {
+void BlueBase::writeSavedDevices()
+{
QListViewItemIterator it( ListView2 );
@@ -186,3 +193,4 @@ void BlueBase::writeSavedDevices() {
RemoteDevice::ValueList list;
- for ( ; it.current(); ++it ) {
+ for ( ; it.current(); ++it )
+ {
item = (BTListItem*)it.current();
@@ -207,3 +215,4 @@ void BlueBase::writeSavedDevices() {
*/
-void BlueBase::initGui() {
+void BlueBase::initGui()
+{
StatusLabel->setText( status() ); // maybe move it to getStatus()
@@ -224,3 +233,4 @@ void BlueBase::initGui() {
*/
-QString BlueBase::status()const{
+QString BlueBase::status()const
+{
QString infoString = tr( "<b>Device name : </b> Ipaq" );
@@ -236,3 +246,4 @@ QString BlueBase::status()const{
*/
-void BlueBase::applyConfigChanges() {
+void BlueBase::applyConfigChanges()
+{
m_deviceName = deviceNameLine->text();
@@ -253,8 +264,8 @@ void BlueBase::applyConfigChanges() {
*/
-void BlueBase::rfcommDialog() {
+void BlueBase::rfcommDialog()
+{
RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp );
- rfcommAssign.showMaximized();
-
- if ( rfcommAssign.exec() == QDialog::Accepted ) {
+ if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted )
+ {
rfcommAssign.saveConfig();
@@ -267,3 +278,4 @@ void BlueBase::rfcommDialog() {
*/
-void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) {
+void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices )
+{
BTDeviceItem * deviceItem;
@@ -271,3 +283,4 @@ void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices )
- for( it = newDevices.begin(); it != newDevices.end() ; ++it ) {
+ for( it = newDevices.begin(); it != newDevices.end() ; ++it )
+ {
@@ -292,4 +305,4 @@ void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices )
*/
-void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) {
-}
+void BlueBase::startServiceActionClicked( QListViewItem */*item*/ )
+{}
@@ -299,3 +312,4 @@ void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) {
*/
-void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) {
+void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ )
+{
if (!item )
@@ -306,3 +320,4 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
- if ( ((BTListItem*)item)->type() == "device") {
+ if ( ((BTListItem*)item)->type() == "device")
+ {
@@ -318,3 +333,4 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
- switch(ret) {
+ switch(ret)
+ {
case -1:
@@ -345,3 +361,4 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
*/
- else if ( ((BTListItem*)item)->type() == "service") {
+ else if ( ((BTListItem*)item)->type() == "service")
+ {
BTServiceItem* service = (BTServiceItem*)item;
@@ -350,4 +367,5 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
QPopupMenu *popup =0l;
- if ( it != list.end() ) {
- qWarning("Searching id %d %s", it.key(), it.data().latin1() );
+ if ( it != list.end() )
+ {
+ qWarning("Searching id %d %s", it.key(), it.data().latin1() );
popup = m_popHelper.find( it.key(),
@@ -355,7 +373,10 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
(BTDeviceItem*)service->parent() );
- }else {
- qWarning("Empty");
- }
+ }
+ else
+ {
+ qWarning("Empty");
+ }
- if ( popup == 0l ) {
+ if ( popup == 0l )
+ {
qWarning("factory returned 0l");
@@ -367,5 +388,8 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
qWarning("returned from exec() ");
- if ( ret == -1 ) {
+ if ( ret == -1 )
+ {
;
- } else if ( ret == test1 ) {
+ }
+ else if ( ret == test1 )
+ {
;
@@ -382,3 +406,4 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
*/
-void BlueBase::addServicesToDevice( BTDeviceItem * item ) {
+void BlueBase::addServicesToDevice( BTDeviceItem * item )
+{
qDebug("addServicesToDevice");
@@ -398,3 +423,4 @@ void BlueBase::addServicesToDevice( BTDeviceItem * item ) {
*/
-void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) {
+void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList )
+{
qDebug("fill services list");
@@ -414,5 +440,6 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s
QListViewItem * child = deviceItem->firstChild();
- while( child ) {
- tempList.append( child );
- child = child->nextSibling();
+ while( child )
+ {
+ tempList.append( child );
+ child = child->nextSibling();
}
@@ -424,3 +451,4 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s
- if (!servicesList.isEmpty() ) {
+ if (!servicesList.isEmpty() )
+ {
// add services
@@ -428,3 +456,4 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s
QMap<int, QString>::Iterator classIt;
- for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) {
+ for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 )
+ {
serviceItem = new BTServiceItem( deviceItem, (*it2) );
@@ -433,3 +462,4 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s
int classId=0;
- if ( classIt != list.end() ) {
+ if ( classIt != list.end() )
+ {
classId = classIt.key();
@@ -439,3 +469,5 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s
}
- } else {
+ }
+ else
+ {
Services s1;
@@ -452,20 +484,25 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s
-void BlueBase::addSignalStrength() {
+void BlueBase::addSignalStrength()
+{
- QListViewItemIterator it( ListView4 );
- for ( ; it.current(); ++it ) {
- m_localDevice->signalStrength( ((BTConnectionItem*)it.current() )->connection().mac() );
- }
+ QListViewItemIterator it( ListView4 );
+ for ( ; it.current(); ++it )
+ {
+ m_localDevice->signalStrength( ((BTConnectionItem*)it.current() )->connection().mac() );
+ }
- QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) );
+ QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) );
}
-void BlueBase::addSignalStrength( const QString& mac, const QString& strength ) {
+void BlueBase::addSignalStrength( const QString& mac, const QString& strength )
+{
- QListViewItemIterator it( ListView4 );
- for ( ; it.current(); ++it ) {
- if( ((BTConnectionItem*)it.current())->connection().mac() == mac ) {
- ((BTConnectionItem*)it.current() )->setSignalStrength( strength );
- }
- }
+ QListViewItemIterator it( ListView4 );
+ for ( ; it.current(); ++it )
+ {
+ if( ((BTConnectionItem*)it.current())->connection().mac() == mac )
+ {
+ ((BTConnectionItem*)it.current() )->setSignalStrength( strength );
+ }
+ }
}
@@ -476,4 +513,5 @@ void BlueBase::addSignalStrength( const QString& mac, const QString& strength )
*/
-void BlueBase::addConnectedDevices() {
- m_localDevice->searchConnections();
+void BlueBase::addConnectedDevices()
+{
+ m_localDevice->searchConnections();
}
@@ -484,3 +522,4 @@ void BlueBase::addConnectedDevices() {
*/
-void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) {
+void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList )
+{
@@ -489,36 +528,46 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList )
- if ( !connectionList.isEmpty() ) {
+ if ( !connectionList.isEmpty() )
+ {
- for (it = connectionList.begin(); it != connectionList.end(); ++it) {
+ for (it = connectionList.begin(); it != connectionList.end(); ++it)
+ {
QListViewItemIterator it2( ListView4 );
- bool found = false;
- for ( ; it2.current(); ++it2 ) {
- if( ( (BTConnectionItem*)it2.current())->connection().mac() == (*it).mac() ) {
- found = true;
- }
- }
+ bool found = false;
+ for ( ; it2.current(); ++it2 )
+ {
+ if( ( (BTConnectionItem*)it2.current())->connection().mac() == (*it).mac() )
+ {
+ found = true;
+ }
+ }
- if ( found == false ) {
- connectionItem = new BTConnectionItem( ListView4, (*it) );
+ if ( found == false )
+ {
+ connectionItem = new BTConnectionItem( ListView4, (*it) );
- if( m_deviceList.find((*it).mac()).data() ) {
- connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() );
- }
- }
+ if( m_deviceList.find((*it).mac()).data() )
+ {
+ connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() );
+ }
+ }
- }
+ }
QListViewItemIterator it2( ListView4 );
- for ( ; it2.current(); ++it2 ) {
- bool found = false;
- for (it = connectionList.begin(); it != connectionList.end(); ++it) {
- if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() ) {
- found = true;
- }
+ for ( ; it2.current(); ++it2 )
+ {
+ bool found = false;
+ for (it = connectionList.begin(); it != connectionList.end(); ++it)
+ {
+ if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() )
+ {
+ found = true;
+ }
}
- if ( !found ) {
- delete it2.current();
- }
+ if ( !found )
+ {
+ delete it2.current();
+ }
@@ -527,3 +576,5 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList )
- } else {
+ }
+ else
+ {
ListView4->clear();
@@ -543,3 +594,4 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList )
*/
-void BlueBase::deviceActive( const RemoteDevice &device ) {
+void BlueBase::deviceActive( const RemoteDevice &device )
+{
// search by mac, async, gets a signal back
@@ -555,3 +607,4 @@ void BlueBase::deviceActive( const RemoteDevice &device ) {
*/
-void BlueBase::deviceActive( const QString& device, bool connected ) {
+void BlueBase::deviceActive( const QString& device, bool connected )
+{
qDebug("deviceActive slot");
@@ -567,5 +620,8 @@ void BlueBase::deviceActive( const QString& device, bool connected ) {
- if ( connected ) {
+ if ( connected )
+ {
deviceItem->setPixmap( 1, m_onPix );
- } else {
+ }
+ else
+ {
deviceItem->setPixmap( 1, m_offPix );
@@ -579,3 +635,4 @@ void BlueBase::deviceActive( const QString& device, bool connected ) {
*/
-void BlueBase::startScan() {
+void BlueBase::startScan()
+{
ScanDialog *scan = new ScanDialog( this, "ScanDialog",
@@ -585,3 +642,3 @@ void BlueBase::startScan() {
- scan->showMaximized();
+ QPEApplication::showDialog( scan );
}
@@ -592,3 +649,4 @@ void BlueBase::startScan() {
*/
-void BlueBase::setInfo() {
+void BlueBase::setInfo()
+{
StatusLabel->setText( status() );
@@ -600,3 +658,4 @@ void BlueBase::setInfo() {
*/
-BlueBase::~BlueBase() {
+BlueBase::~BlueBase()
+{
writeSavedDevices();
@@ -612,3 +671,4 @@ BlueBase::~BlueBase() {
*/
-bool BlueBase::find( const RemoteDevice& rem ) {
+bool BlueBase::find( const RemoteDevice& rem )
+{
QListViewItemIterator it( ListView2 );
@@ -616,3 +676,4 @@ bool BlueBase::find( const RemoteDevice& rem ) {
BTDeviceItem* device;
- for (; it.current(); ++it ) {
+ for (; it.current(); ++it )
+ {
item = (BTListItem*) it.current();
diff --git a/noncore/net/opietooth/manager/obexpopup.cpp b/noncore/net/opietooth/manager/obexpopup.cpp
index a550648..d147d52 100644
--- a/noncore/net/opietooth/manager/obexpopup.cpp
+++ b/noncore/net/opietooth/manager/obexpopup.cpp
@@ -1,4 +1,2 @@
-#include <qtimer.h>
-
#include "obexdialog.h"
@@ -6,2 +4,8 @@
+/* OPIE */
+#include <qpe/qpeapplication.h>
+
+/* QT */
+#include <qtimer.h>
+
using namespace OpieTooth;
@@ -12,3 +16,4 @@ using namespace OpieTooth;
ObexPopup::ObexPopup()
- : QPopupMenu() {
+ : QPopupMenu()
+{
qWarning("RfcCommPopup c'tor");
@@ -26,7 +31,8 @@ ObexPopup::ObexPopup()
-ObexPopup::~ObexPopup() {
-}
+ObexPopup::~ObexPopup()
+{}
-void ObexPopup::slotPush() {
+void ObexPopup::slotPush()
+{
@@ -34,6 +40,4 @@ void ObexPopup::slotPush() {
-
ObexDialog obexDialog;
- obexDialog.showMaximized();
- obexDialog.exec();
+ QPEApplication::execDialog( &obexDialog );
}
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
index b5cc074..fc76301 100644
--- a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
+++ b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
@@ -5,4 +5,7 @@
+/* OPIE */
#include <qpe/config.h>
+#include <qpe/qpeapplication.h>
+/* QT */
#include <qlayout.h>
@@ -17,3 +20,4 @@ using namespace OpieTooth;
RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
- : RfcommAssignDialogBase( parent, name, modal, fl ) {
+ : RfcommAssignDialogBase( parent, name, modal, fl )
+{
@@ -35,4 +39,6 @@ RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool
-RfcommAssignDialog::~RfcommAssignDialog() {
- if ( confHandler ) {
+RfcommAssignDialog::~RfcommAssignDialog()
+{
+ if ( confHandler )
+ {
delete confHandler;
@@ -42,5 +48,7 @@ RfcommAssignDialog::~RfcommAssignDialog() {
-void RfcommAssignDialog::newDevice( const QString & mac ) {
+void RfcommAssignDialog::newDevice( const QString & mac )
+{
- for ( int i = 0 ; i < m_range; i++ ) {
+ for ( int i = 0 ; i < m_range; i++ )
+ {
@@ -49,5 +57,6 @@ void RfcommAssignDialog::newDevice( const QString & mac ) {
// make sure that rfcommX is not assigned yet
- if ( it == confHandler->foundEntries().end() ) {
+ if ( it == confHandler->foundEntries().end() )
+ {
QDialog dialog( this, "newdevice", true, WStyle_ContextHelp );
- dialog.showMaximized();
+
RfcommDialogItem *newDev = new RfcommDialogItem( &dialog );
@@ -56,3 +65,4 @@ void RfcommAssignDialog::newDevice( const QString & mac ) {
- if ( dialog.exec() == QDialog::Accepted ) {
+ if ( QPEApplication::execDialog( &dialog ) == QDialog::Accepted )
+ {
RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box );
@@ -69,3 +79,4 @@ void RfcommAssignDialog::newDevice( const QString & mac ) {
-void RfcommAssignDialog::loadConfig() {
+void RfcommAssignDialog::loadConfig()
+{
@@ -73,3 +84,4 @@ void RfcommAssignDialog::loadConfig() {
- for ( int i = 0 ; i < m_range; i++ ) {
+ for ( int i = 0 ; i < m_range; i++ )
+ {
// cfg.setGroup( QString("%1").arg( i ) );
@@ -80,3 +92,4 @@ void RfcommAssignDialog::loadConfig() {
it = confHandler->foundEntries().find( QString("%1").arg( i ) );
- if ( it != confHandler->foundEntries().end() ) {
+ if ( it != confHandler->foundEntries().end() )
+ {
qDebug( "Found key in foundEntries() " );
@@ -86,7 +99,7 @@ void RfcommAssignDialog::loadConfig() {
}
- /* Use rfcomm.conf directly for now
- * rfcomm->setMac( cfg.readEntry( "mac", "" ) );
- * rfcomm->setChannel( cfg.readNumEntry( "channel", 1 ) );
- * rfcomm->setComment( cfg.readEntry( "comment", "" ) );
- */
+ /* Use rfcomm.conf directly for now
+ * rfcomm->setMac( cfg.readEntry( "mac", "" ) );
+ * rfcomm->setChannel( cfg.readNumEntry( "channel", 1 ) );
+ * rfcomm->setComment( cfg.readEntry( "comment", "" ) );
+ */
}
@@ -95,3 +108,4 @@ void RfcommAssignDialog::loadConfig() {
-void RfcommAssignDialog::saveConfig() {
+void RfcommAssignDialog::saveConfig()
+{
@@ -103,3 +117,4 @@ void RfcommAssignDialog::saveConfig() {
- for( it = m_itemList.begin(); it != m_itemList.end(); ++it ) {
+ for( it = m_itemList.begin(); it != m_itemList.end(); ++it )
+ {
diff --git a/noncore/net/opietooth/manager/rfcpopup.cpp b/noncore/net/opietooth/manager/rfcpopup.cpp
index d95f14b..04bfe48 100644
--- a/noncore/net/opietooth/manager/rfcpopup.cpp
+++ b/noncore/net/opietooth/manager/rfcpopup.cpp
@@ -1,4 +1,2 @@
-#include <qtimer.h>
-
#include "pppdialog.h"
@@ -7,2 +5,8 @@
+/* OPIE */
+#include <qpe/qpeapplication.h>
+
+/* QT */
+#include <qtimer.h>
+
using namespace OpieTooth;
@@ -13,3 +17,4 @@ using namespace OpieTooth;
RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item )
- : QPopupMenu() {
+ : QPopupMenu()
+{
qWarning("RfcCommPopup c'tor");
@@ -34,3 +39,3 @@ RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item )
connect( a, SIGNAL( activated() ) ,
- this, SLOT( slotDisconnect() ) );
+ this, SLOT( slotDisconnect() ) );
@@ -42,3 +47,3 @@ RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item )
connect( a, SIGNAL( activated() ),
- this, SLOT( slotBind() ) );
+ this, SLOT( slotBind() ) );
@@ -50,3 +55,3 @@ RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item )
connect( a, SIGNAL( activated() ),
- this, SLOT( slotBar() ) );
+ this, SLOT( slotBar() ) );
@@ -55,7 +60,8 @@ RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item )
-RfcCommPopup::~RfcCommPopup() {
-/* delete m_con;
- delete m_dis;
- delete m_foo;
- delete m_bar; */
+RfcCommPopup::~RfcCommPopup()
+{
+ /* delete m_con;
+ delete m_dis;
+ delete m_foo;
+ delete m_bar; */
}
@@ -63,3 +69,4 @@ RfcCommPopup::~RfcCommPopup() {
-void RfcCommPopup::slotConnect() {
+void RfcCommPopup::slotConnect()
+{
@@ -67,7 +74,4 @@ void RfcCommPopup::slotConnect() {
-
-
PPPDialog pppDialog;
- pppDialog.showMaximized();
- pppDialog.exec();
+ QPEApplication::execDialog( &pppDialog );
}
@@ -75,3 +79,4 @@ void RfcCommPopup::slotConnect() {
-void RfcCommPopup::slotDisconnect() {
+void RfcCommPopup::slotDisconnect()
+{
qWarning("slot disconnected");
@@ -80,9 +85,10 @@ void RfcCommPopup::slotDisconnect() {
-void RfcCommPopup::slotBind() {
+void RfcCommPopup::slotBind()
+{
RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp );
- rfcommAssign.showMaximized();
rfcommAssign.newDevice( m_item->mac() );
- if ( rfcommAssign.exec() == QDialog::Accepted ) {
+ if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted )
+ {
rfcommAssign.saveConfig();
@@ -92,3 +98,4 @@ void RfcCommPopup::slotBind() {
-void RfcCommPopup::slotBar() {
+void RfcCommPopup::slotBar()
+{
qWarning("slotBar");
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp
index 3729ed0..95a8294 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.cpp
+++ b/noncore/net/wellenreiter/gui/mainwindow.cpp
@@ -179,6 +179,3 @@ void WellenreiterMainWindow::showConfigure()
cw->setCaption( tr( "Configure" ) );
- #ifdef QWS
- cw->showMaximized();
- #endif
- int result = cw->exec();
+ int result = QPEApplication::execDialog( cw );