summaryrefslogtreecommitdiff
path: root/noncore/unsupported
Side-by-side diff
Diffstat (limited to 'noncore/unsupported') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/filebrowser/filebrowser.cpp12
-rw-r--r--noncore/unsupported/gsmtool/gsmtool.cpp4
-rw-r--r--noncore/unsupported/mail2/bend/bend.cpp4
-rw-r--r--noncore/unsupported/mail2/composer.cpp8
-rw-r--r--noncore/unsupported/mail2/folderwidget.cpp24
-rw-r--r--noncore/unsupported/mail2/libmail/imaphandler.cpp6
-rw-r--r--noncore/unsupported/mail2/listviewplus.cpp4
-rw-r--r--noncore/unsupported/mail2/mailtable.cpp12
-rw-r--r--noncore/unsupported/mail2/mainwindow.cpp14
-rw-r--r--noncore/unsupported/mail2/searchdiag.cpp14
-rw-r--r--noncore/unsupported/mail2/viewmail.cpp4
-rw-r--r--noncore/unsupported/mailit/addatt.cpp4
-rw-r--r--noncore/unsupported/mailit/emailclient.cpp32
-rw-r--r--noncore/unsupported/mailit/emailhandler.cpp22
-rw-r--r--noncore/unsupported/mailit/mailitwindow.cpp36
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp8
-rw-r--r--noncore/unsupported/oipkg/packagelistitem.cpp8
-rw-r--r--noncore/unsupported/oipkg/packagelistview.cpp8
-rw-r--r--noncore/unsupported/oipkg/pksettings.cpp2
-rw-r--r--noncore/unsupported/qpdf/qbusybar.cpp2
-rw-r--r--noncore/unsupported/qpdf/qpdf.cpp30
21 files changed, 129 insertions, 129 deletions
diff --git a/noncore/unsupported/filebrowser/filebrowser.cpp b/noncore/unsupported/filebrowser/filebrowser.cpp
index 8cf8a60..92a688a 100644
--- a/noncore/unsupported/filebrowser/filebrowser.cpp
+++ b/noncore/unsupported/filebrowser/filebrowser.cpp
@@ -215,100 +215,100 @@ QPixmap FileItem::drawThumbnail(const QFileInfo &file) {
if (!cachedFile.dir().exists()) {
QString cmd = "/bin/mkdir -p \"" + cachedFile.dirPath() +"\"";
system( (const char *) cmd );
}
if (thumb.save(cachedFile.filePath(), QPixmap::imageFormat(file.filePath()), 70)) {
// make thumbnail modify time the same as the image
QString cmd = "/bin/touch -r \"" + file.filePath() +"\" " +
"\"" + cachedFile.filePath() + "\"";
system( (const char *) cmd );
}
return thumb;
}
}
//
// FileView
//
FileView::FileView( const QString & dir, QWidget * parent,
const char * name,
bool hidden, bool symlinks, bool thumbnails )
: QListView( parent, name ),
menuTimer( this ),
le( NULL ),
itemToRename( NULL ),
showHidden( hidden ),
showSymlinks( symlinks ),
showThumbnails( thumbnails ),
menuKeepsOpen( FALSE )
{
addColumn( "Name" );
addColumn( "Size" );
addColumn( "Date" );
addColumn( "Type" );
setMultiSelection( TRUE );
//header()->hide();
setColumnWidthMode( 0, Manual );
setColumnWidthMode( 3, Manual );
// right align yize column
setColumnAlignment( 1, AlignRight );
generateDir( dir );
- connect( this, SIGNAL( clicked( QListViewItem * )),
- SLOT( itemClicked( QListViewItem * )) );
- connect( this, SIGNAL( doubleClicked( QListViewItem * )),
- SLOT( itemDblClicked( QListViewItem * )) );
+ connect( this, SIGNAL( clicked(QListViewItem*)),
+ SLOT( itemClicked(QListViewItem*)) );
+ connect( this, SIGNAL( doubleClicked(QListViewItem*)),
+ SLOT( itemDblClicked(QListViewItem*)) );
connect( this, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) );
connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) );
}
void FileView::resizeEvent( QResizeEvent *e )
{
setColumnWidth( 0, width() - 2 * lineWidth() - 20 - columnWidth( 1 ) - columnWidth( 2 ) );
// hide type column, we use it for "sort by type" only
//setColumnWidth( 3, 0 );
QListView::resizeEvent( e );
}
void FileView::updateDir()
{
generateDir( currentDir );
}
void FileView::setDir( const QString & dir )
{
if ( dir.startsWith( "/dev" ) ) {
QMessageBox::warning( this, tr( "File Manager" ),
tr( "Can't show /dev/ directory." ), tr( "&Ok" ) );
return;
}
dirHistory += currentDir;
generateDir( dir );
}
void FileView::generateDir( const QString & dir )
{
if(menuKeepsOpen){
cancelMenuTimer();
}
QDir d( dir );
if( d.exists() && !d.isReadable() ) return;
currentDir = d.canonicalPath();
if( !showHidden)
d.setFilter( QDir::Dirs | QDir::Files );
else
d.setFilter( QDir::Dirs | QDir::Files |QDir::Hidden | QDir::All);
d.setSorting( QDir::Name | QDir::DirsFirst | QDir::IgnoreCase | QDir::Reversed );
const QFileInfoList * list = d.entryInfoList();
@@ -863,98 +863,98 @@ void FileBrowser::init(const QString & dir)
viewMenu->insertItem( tr( "Hidden"), this, SLOT( updateShowHidden() ) );
viewMenu->insertItem( tr( "Symlinks"), this, SLOT( updateShowSymlinks() ) );
viewMenu->insertItem( tr( "Thumbnails"), this, SLOT( updateShowThumbnails() ) );
viewMenu->setItemChecked( viewMenu->idAt( 0 ), showHidden );
viewMenu->setItemChecked( viewMenu->idAt( 1 ), showSymlinks );
viewMenu->setItemChecked( viewMenu->idAt( 2 ), showThumbnails );
menuBar->insertItem( tr("View"), viewMenu );
toolBar = new QToolBar( this );
lastAction = new QAction( tr("Previous dir"), Resource::loadIconSet( "back" ),
QString::null, 0, this, 0 );
connect( lastAction, SIGNAL( activated() ), fileView, SLOT( lastDir() ) );
lastAction->addTo( toolBar );
lastAction->setEnabled( FALSE );
upAction = new QAction( tr("Parent dir"), Resource::loadIconSet( "up" ),
QString::null, 0, this, 0 );
connect( upAction, SIGNAL( activated() ), fileView, SLOT( parentDir() ) );
upAction->addTo( toolBar );
QAction *a = new QAction( tr("New folder"), Resource::loadPixmap( "newfolder" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), fileView, SLOT( newFolder() ) );
a->addTo( toolBar );
a = new QAction( tr("Cut"), Resource::loadPixmap( "cut" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), fileView, SLOT( cut() ) );
a->addTo( toolBar );
a = new QAction( tr("Copy"), Resource::loadPixmap( "copy" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), fileView, SLOT( copy() ) );
a->addTo( toolBar );
pasteAction = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ),
QString::null, 0, this, 0 );
connect( pasteAction, SIGNAL( activated() ), fileView, SLOT( paste() ) );
pasteAction->addTo( toolBar );
// dirLabel = new QLabel(this, "DirLabel");
connect( fileView, SIGNAL( dirChanged() ), SLOT( updateDirMenu() ) );
updateDirMenu();
QCopChannel* pcmciaChannel = new QCopChannel( "QPE/Card", this );
- connect( pcmciaChannel, SIGNAL(received(const QCString &, const QByteArray &)),
- this, SLOT(pcmciaMessage( const QCString &, const QByteArray &)) );
+ connect( pcmciaChannel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(pcmciaMessage(const QCString&,const QByteArray&)) );
}
void FileBrowser::pcmciaMessage( const QCString &msg, const QByteArray &)
{
if ( msg == "mtabChanged()" ) {
// ## Only really needed if current dir is on a card
fileView->updateDir();
}
}
void FileBrowser::changeCaption(const QString & dir) {
setCaption( dir);
}
void FileBrowser::dirSelected( int id )
{
int i = 0, j;
QString dir;
// Bulid target dir from menu
while( (j = dirMenu->idAt( i )) != id ){
dir += dirMenu->text( j ).stripWhiteSpace();
if( dirMenu->text( j ) != "/" ) dir += "/";
i++;
}
dir += dirMenu->text( dirMenu->idAt( i ) ).stripWhiteSpace();
fileView->setDir( dir );
}
void FileBrowser::updateDirMenu()
{
QString spc, cd = fileView->cd();
QStringList l = QStringList::split( "/", cd );
int i = 0;
dirMenu->clear();
dirMenu->insertItem( tr( "/" ), this, SLOT( dirSelected(int) ) );
for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) {
spc.fill( ' ', i++);
dirMenu->insertItem( spc + (*it), this,
SLOT( dirSelected(int) ) );
}
dirMenu->setItemChecked( dirMenu->idAt( l.count() ), TRUE );
lastAction->setEnabled( fileView->history().count() != 0 );
upAction->setEnabled( cd != "/" );
diff --git a/noncore/unsupported/gsmtool/gsmtool.cpp b/noncore/unsupported/gsmtool/gsmtool.cpp
index 5940b0e..47920e5 100644
--- a/noncore/unsupported/gsmtool/gsmtool.cpp
+++ b/noncore/unsupported/gsmtool/gsmtool.cpp
@@ -1,91 +1,91 @@
#include "gsmtool.h"
#include <qpushbutton.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qtabwidget.h>
#include <qlistview.h>
#include <qtextbrowser.h>
#include <qmultilineedit.h>
#include <termios.h>
#include <gsmlib/gsm_me_ta.h>
#include <gsmlib/gsm_unix_serial.h>
#include <gsmlib/gsm_sms.h>
#include <gsmlib/gsm_sorted_sms_store.h>
using namespace gsmlib;
/*
* Constructs a GSMTool which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*/
GSMTool::GSMTool( QWidget* parent, const char* name, WFlags fl )
: GSMToolBase( parent, name, fl )
{
devicelocked = 0;
me = NULL;
sms_store = NULL;
setConnected(FALSE);
/* FIXME: Persistent settings for device/baudrate */
connect(ConnectButton, SIGNAL(clicked()), this, SLOT(doConnectButton()));
connect(SMSDeleteButton, SIGNAL(clicked()), this, SLOT(doSMSDeleteButton()));
connect(SMSSendButton, SIGNAL(clicked()), this, SLOT(doSMSSendButton()));
connect(NewSMSClearButton, SIGNAL(clicked()), this, SLOT(doNewSMSClearButton()));
connect(NewSMSSaveButton, SIGNAL(clicked()), this, SLOT(doNewSMSSaveButton()));
connect(NewSMSSendButton, SIGNAL(clicked()), this, SLOT(doNewSMSSendButton()));
connect(ScanButton, SIGNAL(clicked()), this, SLOT(doScanButton()));
- connect(TabWidget2, SIGNAL(currentChanged(QWidget *)), this, SLOT(doTabChanged()));
+ connect(TabWidget2, SIGNAL(currentChanged(QWidget*)), this, SLOT(doTabChanged()));
connect(SMSStoreList, SIGNAL(activated(int)), this, SLOT(doSMSStoreChanged()));
connect(SMSViewType, SIGNAL(activated(int)), this, SLOT(doSMSTypeChanged()));
- connect(SMSList, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(doSelectedSMSChanged(QListViewItem *)));
+ connect(SMSList, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(doSelectedSMSChanged(QListViewItem*)));
timerid = -1; // Is this not possible normally?
}
/*
* Destroys the object and frees any allocated resources
*/
GSMTool::~GSMTool()
{
// no need to delete child widgets, Qt does it all for us
if (devicelocked)
unlockDevice();
}
const speed_t GSMTool::baudrates[12] = {
B300, B600, B1200, B2400, B4800, B9600, B19200,
B38400, B57600, B115200, B230400, B460800
};
int GSMTool::lockDevice( )
{
devicelocked = 1;
/* FIXME */
return 0;
}
void GSMTool::unlockDevice( )
{
devicelocked = 0;
}
void GSMTool::setConnected( bool conn )
{
TabWidget2->setTabEnabled(tab_2, conn);
TabWidget2->setTabEnabled(tab_3, conn);
//TabWidget2->setTabEnabled(tab_4, conn);
NewSMSSendButton->setEnabled(conn);
MfrLabel->setEnabled(conn);
MfrText->setEnabled(conn);
ModelLabel->setEnabled(conn);
ModelText->setEnabled(conn);
RevisionLabel->setEnabled(conn);
RevisionText->setEnabled(conn);
SerialLabel->setEnabled(conn);
SerialText->setEnabled(conn);
}
void GSMTool::doTabChanged()
{
int index = TabWidget2->currentPageIndex();
diff --git a/noncore/unsupported/mail2/bend/bend.cpp b/noncore/unsupported/mail2/bend/bend.cpp
index e2ece2a..ab6eb45 100644
--- a/noncore/unsupported/mail2/bend/bend.cpp
+++ b/noncore/unsupported/mail2/bend/bend.cpp
@@ -41,84 +41,84 @@ BenD::BenD(QWidget *parent, const char *name, WFlags fl)
_intervalMs = _config->readNumEntry("CheckEvery", 5) * 60000;
_intervalTimer = new QTimer();
_intervalTimer->start(_intervalMs);
connect(_intervalTimer, SIGNAL(timeout()), SLOT(slotCheck()));
QTimer::singleShot(0, this, SLOT(slotCheck()));
}
}
void BenD::drawButton(QPainter *) { }
void BenD::drawButtonText(QPainter *) { }
void BenD::slotClicked()
{
QCopEnvelope e("QPE/System", "execute(QString)");
e << QString("mail");
ODevice *device = ODevice::inst();
if ( !device-> ledList ( ). isEmpty ( )) {
OLed led = ( device-> ledList ( ). contains ( Led_Mail )) ? Led_Mail : device-> ledList ( ) [0];
device->setLedState(led, Led_Off);
}
}
void BenD::slotCheck()
{
// Check wether the check interval has been changed.
int newIntervalMs = _config->readNumEntry("CheckEvery", 5) * 60000;
if (newIntervalMs != _intervalMs) {
_intervalTimer->changeInterval(newIntervalMs);
_intervalMs = newIntervalMs;
#ifndef QT_NO_DEBUG
qWarning("BenD: Detected interval change");
#endif
}
QValueList<Account> acList = ConfigFile::getAccounts();
QValueList<Account>::Iterator ot;
for (ot = acList.begin(); ot != acList.end(); ot++) {
if (!((*ot).imapServer().isEmpty() ||
(*ot).imapPort().isEmpty() ||
(*ot).user().isEmpty() ||
(*ot).pass().isEmpty())) {
if (!((*ot).imapSsl() &&
(*ot).imapSslPort().isEmpty())) {
IMAPHandler *handler = new IMAPHandler(*ot);
handler->iStatus("INBOX", "RECENT");
- connect(handler, SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPStatus(IMAPResponse &)));
+ connect(handler, SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPStatus(IMAPResponse&)));
}
}
}
}
void BenD::slotIMAPStatus(IMAPResponse &response)
{
- disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPStatus(IMAPResponse &)));
+ disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPStatus(IMAPResponse&)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
if (response.STATUS()[0].recent().toInt() > 0) {
ODevice *device = ODevice::inst();
if (isHidden()) show();
if (_config->readBoolEntry("BlinkLed", true)) {
if ( !device-> ledList ( ). isEmpty ( )) {
OLed led = ( device-> ledList ( ). contains ( Led_Mail )) ? Led_Mail : device-> ledList ( ) [0];
device->setLedState(led, device-> ledStateList ( led ). contains ( Led_BlinkSlow ) ? Led_BlinkSlow : Led_On );
}
}
if (_config->readBoolEntry("PlaySound", false))
device->alarmSound();
} else {
ODevice *device = ODevice::inst();
if (!isHidden()) hide();
if ( !device-> ledList ( ). isEmpty ( )) {
OLed led = ( device-> ledList ( ). contains ( Led_Mail )) ? Led_Mail : device-> ledList ( ) [0];
device->setLedState(led, Led_Off);
}
}
response.imapHandler()->iLogout();
} else qWarning("BenD: WARNING: Couldn't retrieve INBOX status.");
}
diff --git a/noncore/unsupported/mail2/composer.cpp b/noncore/unsupported/mail2/composer.cpp
index cb80299..da1aee9 100644
--- a/noncore/unsupported/mail2/composer.cpp
+++ b/noncore/unsupported/mail2/composer.cpp
@@ -113,187 +113,187 @@ void Composer::slotPopupHandler(int itemid)
if (tmp != QString(0)) attachView->currentItem()->setText(1, tmp);
} else if (itemid == POPUP_ATTACH_REMOVE) {
attachView->takeItem(attachView->currentItem());
}
}
void Composer::slotSendMail()
{
if (to->text().find(QRegExp(".*\\@.*\\..*")) == -1) {
QMessageBox::information(this, tr("Error"), tr("<p>You have to specify a recipient.<br>(eg: foo@bar.org)</p>"), tr("Ok"));
return;
}
SendMail smail;
smail.setFrom(from->currentText());
smail.setReplyTo(replyto->text());
smail.setTo(to->text());
smail.setCc(cc->text());
smail.setBcc(bcc->text());
smail.setSubject(subject->text());
smail.setMessage(message->text());
smail.setNeedsMime(attachView->childCount() == 0 ? false : true);
smail.setAccount(accountsLoaded[from->currentItem()]);
if (priority->currentItem() == POPUP_PRIO_LOW) {
smail.setPriority("Low"); // No i18n on purpose
} else if (priority->currentItem() == POPUP_PRIO_NORMAL) {
smail.setPriority("Normal"); // No i18n on purpose
} else if (priority->currentItem() == POPUP_PRIO_HIGH) {
smail.setPriority("High"); // No i18n on purpose
}
QValueList<Attachment> attachments;
QListViewItem *item;
for (item = attachView->firstChild(); item != 0; item = item->itemBelow()) {
attachments.append(((AttachViewItem *)item)->attachment());
}
smail.setAttachments(attachments);
QString header, message;
MailFactory::genMail(header, message, smail, this);
if (header.isNull() || message.isNull()) return; // Aborted.
status->setStopEnabled(true);
SmtpHandler *handler = new SmtpHandler(header, message, accountsLoaded[from->currentItem()], to->text());
connect(handler, SIGNAL(finished()), SLOT(slotSendFinished()));
- connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendError(const QString &)));
- connect(handler, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &)));
+ connect(handler, SIGNAL(error(const QString&)), SLOT(slotSendError(const QString&)));
+ connect(handler, SIGNAL(status(const QString&)), status, SLOT(setStatusText(const QString&)));
}
void Composer::slotSendQueued()
{
int effSendCount = 0;
qDebug("Sending queued messages");
Config cfg( "mailqueue", Config::User );
cfg.setGroup( "Settings" );
_sendCount = 0;
_sendError = 0;
_toSend = cfg.readNumEntry( "count", 0 );
if (_toSend == 0) close();
qDebug("%i messages to send", _toSend);
QString str;
for (int i=1;i<=_toSend;i++)
{
qDebug("sending message %i",i);
cfg.setGroup( "Mail_" + QString::number(i) );
SendMail smail;
str = cfg.readEntry("from");
qDebug("setFrom %s",str.latin1());
smail.setFrom( str );
str = cfg.readEntry("reply");
qDebug("setReplyTo %s",str.latin1());
smail.setReplyTo( str );
QString toAdr = cfg.readEntry("to");
qDebug("to %s",toAdr.latin1());
smail.setTo( toAdr ); //to->text());
str = cfg.readEntry("cc");
qDebug("setCc %s",str.latin1());
smail.setCc( str ); //cc->text());
smail.setBcc( cfg.readEntry("bcc") ); //bcc->text());
str = cfg.readEntry("subject");
qDebug("setSubject %s",str.latin1());
smail.setSubject( str ); //subject->text());
str = cfg.readEntryCrypt("message");
qDebug("setMessage %s",str.latin1());
smail.setMessage( str ); //message->text());
smail.setNeedsMime( cfg.readBoolEntry("mime") ); //attachView->childCount() == 0 ? false : true);
qDebug("setting account [%i]",cfg.readNumEntry("account"));
Account accnt = accountsLoaded[ cfg.readNumEntry("account") ];
smail.setAccount( accnt ); //accountsLoaded[from->currentItem()]);
int prio = cfg.readNumEntry( "priority" );
qDebug("setting priority %i",prio);
if (prio == POPUP_PRIO_LOW) {
smail.setPriority("Low"); // No i18n on purpose
} else if (prio == POPUP_PRIO_NORMAL) {
smail.setPriority("Normal"); // No i18n on purpose
} else if (prio == POPUP_PRIO_HIGH) {
smail.setPriority("High"); // No i18n on purpose
}
QValueList<Attachment> attachments;
Attachment a;
QString an;
int ac = cfg.readNumEntry( "attachments", 0 );
qDebug("%i Attachments",ac);
for (int j = 0; i < ac; ac++) {
an = "Attachment_" + QString::number( j );
qDebug(an.latin1());
a.setFileName(cfg.readEntry( an + "fileName" ));
a.setNewName(cfg.readEntry( an + "newName" ));
a.setDescription(cfg.readEntry( an + "description" ));
a.setDocLnk( DocLnk( cfg.readEntry( an + "docLnk" )) );
attachments.append( a );
}
smail.setAttachments(attachments);
qDebug("putting mail together");
QString header, message;
MailFactory::genMail(header, message, smail, this);
if (header.isNull() || message.isNull()) continue;//return; // Aborted.
// abort->setEnabled(true);
qDebug("Sending to %s",toAdr.latin1());
SmtpHandler *handler = new SmtpHandler(header, message, accnt ,toAdr);
effSendCount++;
connect(handler, SIGNAL(finished()), SLOT(slotSendQueuedFinished()));
- connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendQueuedError(const QString &)));
- connect(handler, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &)));
+ connect(handler, SIGNAL(error(const QString&)), SLOT(slotSendQueuedError(const QString&)));
+ connect(handler, SIGNAL(status(const QString&)), status, SLOT(setStatusText(const QString&)));
}
if (effSendCount < _toSend)
{
_toSend = effSendCount;
QMessageBox::information(this, tr("Error"), tr("<p>There was a problem sending some of the queued mails.</p>"), tr("Ok"));
}
}
void Composer::slotQueueMail()
{
if (to->text().find(QRegExp(".*\\@.*\\..*")) == -1) {
QMessageBox::information(this, tr("Error"), tr("<p>You have to specify a recipient.<br>(eg: foo@bar.org)</p>"), tr("Ok"));
return;
}
Config cfg( "mailqueue", Config::User );
cfg.setGroup( "Settings" );
int count = cfg.readNumEntry( "count", 0 );
count++;
cfg.writeEntry( "count", count );
qDebug("queueing mail %i",count);
cfg.setGroup( "Mail_" + QString::number( count ));
cfg.writeEntry( "from", from->currentText() );
cfg.writeEntry( "reply", replyto->text());
cfg.writeEntry( "to", to->text());
cfg.writeEntry( "cc", cc->text());
cfg.writeEntry( "bcc", bcc->text());
cfg.writeEntry( "subject", subject->text());
cfg.writeEntryCrypt( "message", message->text());
cfg.writeEntry( "mime", attachView->childCount() == 0 );
cfg.writeEntry( "account", from->currentItem());
cfg.writeEntry( "priority", priority->currentItem() );
cfg.writeEntry( "attachments", attachView->childCount() );
Attachment a;
QListViewItem *item;
QString an;
int i = 0;
for (item = attachView->firstChild(); item != 0; item = item->itemBelow()) {
a = ((AttachViewItem *)item)->attachment();
an = "Attachment_" + QString::number( i++ );
cfg.writeEntry( an + "fileName", a.fileName() );
cfg.writeEntry( an + "newName", a.newName() );
cfg.writeEntry( an + "description", a.description() );
cfg.writeEntry( an + "docLnk", a.docLnk().file() );
diff --git a/noncore/unsupported/mail2/folderwidget.cpp b/noncore/unsupported/mail2/folderwidget.cpp
index d27968b..a0520b1 100644
--- a/noncore/unsupported/mail2/folderwidget.cpp
+++ b/noncore/unsupported/mail2/folderwidget.cpp
@@ -15,300 +15,300 @@
#include "rename.h"
FolderWidgetItem::FolderWidgetItem(Folder &folder, QListView *parent)
: QListViewItem(parent), _folder(folder)
{
setPixmap(0, QPixmap(Resource::loadPixmap("mail/inbox")));
setText(0, _folder.topFolder().account().user() + " (" + _folder.topFolder().account().imapServer() + ")");
setOpen(true);
}
FolderWidgetItem::FolderWidgetItem(Folder &folder, FolderWidgetItem *parent)
: QListViewItem(parent), _folder(folder)
{
if (_folder.noCache()) {
setText(0, QObject::tr("<Foldertree not known.>"));
} else {
if (folder.fullName().upper() == "INBOX") {
setPixmap(0, QPixmap(Resource::loadPixmap("mail/inbox")));
setText(0, QObject::tr("Inbox"));
} else {
setPixmap(0, QPixmap(Resource::loadPixmap("mail/folder")));
setText(0, folder.fullName());
}
setOpen(true);
}
}
FolderWidget::FolderWidget(QWidget *parent, const char *name, WFlags fl)
: ListViewPlus(parent, name, fl)
{
header()->hide();
addColumn("");
setSorting(-1);
QPopupMenu *menu = new QPopupMenu();
menu->insertItem(tr("Rename"), MENU_RENAME);
menu->insertItem(tr("Delete"), MENU_DELETE);
menu->insertItem(tr("Move"), MENU_MOVE);
menu->insertItem(tr("Copy"), MENU_COPY);
menu->insertSeparator();
menu->insertItem(tr("Create folder"), MENU_CREATE);
menu->insertSeparator();
menu->insertItem(tr("Rescan folder list"), MENU_RESCAN);
setPopup(menu);
getAccounts();
connect(menu, SIGNAL(activated(int)), SLOT(slotMenuActivated(int)));
- connect(this, SIGNAL(clicked(QListViewItem *)), SLOT(slotItemClicked(QListViewItem *)));
+ connect(this, SIGNAL(clicked(QListViewItem*)), SLOT(slotItemClicked(QListViewItem*)));
}
FolderWidget::~FolderWidget()
{
// TODO: Save folder tree.
}
void FolderWidget::update()
{
getAccounts();
}
void FolderWidget::getAccounts()
{
clear();
QValueList<Account> accounts = ConfigFile::getAccounts();
QValueList<Account>::Iterator it;
for (it = accounts.begin(); it != accounts.end(); it++) {
FolderWidgetItem *item = addAccount(*it);
QFile f((QString) getenv("HOME") + "/Applications/mail/foldercache/foldercache-" + (*it).accountName());
if (!f.open(IO_ReadOnly)) {
Folder folder;
folder.setNoCache(true);
addFolder(folder, item);
} else {
QTextStream t(&f);
while (!t.atEnd()) {
QString separator = t.readLine();
QString fullname = t.readLine();
Folder folder;
folder.setSeparator(separator);
folder.setFullName(fullname);
folder.setTopFolder(item->folder().topFolder());
addFolder(folder, item);
}
f.close();
}
}
}
FolderWidgetItem *FolderWidget::addAccount(Account &account)
{
TopFolder tf;
tf.setAccount(account);
// XXX This has to change!!! The folderwidget may not create an
// XXX IMAPHandler!!!! Do this in IMAPHandler!
tf.setIMAPHandler(new IMAPHandler(account));
Folder folder;
folder.setTopFolder(tf);
connect(tf.handler(), SIGNAL(IMAPLookingUpHost()), SLOT(slotIMAPLookingUpHost()));
connect(tf.handler(), SIGNAL(IMAPHostFound()), SLOT(slotIMAPHostFound()));
connect(tf.handler(), SIGNAL(IMAPConnected()), SLOT(slotIMAPConnected()));
connect(tf.handler(), SIGNAL(IMAPDisconnected()), SLOT(slotIMAPDisconnected()));
connect(tf.handler(), SIGNAL(IMAPError(int)), SLOT(slotIMAPError(int)));
return new FolderWidgetItem(folder, this);
}
FolderWidgetItem *FolderWidget::addFolder(Folder &folder, FolderWidgetItem *folderWidgetItem)
{
return new FolderWidgetItem(folder, folderWidgetItem);
}
void FolderWidget::slotMenuActivated(int itemid)
{
if (currentItem() == NULL) {
QMessageBox::information(this, tr("Error"), tr("<p>Please select an item first.</p>"), tr("Ok"));
return;
}
if (itemid == MENU_RENAME) {
if (((FolderWidgetItem *)currentItem())->folder().fullName().isEmpty()) return;
Folder folder = ((FolderWidgetItem *)currentItem())->folder();
QString newName = Rename::rename(folder.fullName(), this);
if (newName.isNull()) return;
folder.topFolder().handler()->iRename(folder.fullName(), newName);
- connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPRename(IMAPResponse &)));
+ connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPRename(IMAPResponse&)));
} else if (itemid == MENU_DELETE) {
if (((FolderWidgetItem *)currentItem())->folder().fullName().isEmpty()) return;
Folder folder = ((FolderWidgetItem *)currentItem())->folder();
int ret = QMessageBox::information(this, tr("Question"), tr("<p>Do you really want to delete <pre>%1</pre>?").arg(folder.fullName()), tr("Yes"), tr("No"));
if (ret == 1) return;
_createFolder = folder;
folder.topFolder().handler()->iDelete(folder.fullName());
- connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPDelete(IMAPResponse &)));
+ connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPDelete(IMAPResponse&)));
} else if (itemid == MENU_MOVE) {
} else if (itemid == MENU_COPY) {
} else if (itemid == MENU_CREATE) {
Folder folder = (((FolderWidgetItem *)currentItem())->folder());
_createFolder = folder;
QString folderName = Rename::getText(tr("Foldername"), tr("<p>Please enter the name of the new folder.</p>"), this);
if (folderName.isNull()) return;
folder.topFolder().handler()->iCreate(folder.fullName() + folder.separator() + folderName);
- connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPCreate(IMAPResponse &)));
+ connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPCreate(IMAPResponse&)));
} else if (itemid == MENU_RESCAN) {
Folder folder = (((FolderWidgetItem *)currentItem())->folder());
_rescanAccount = folder.topFolder().account();
folder.topFolder().handler()->iList("", "*");
- connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &)));
+ connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPList(IMAPResponse&)));
}
}
void FolderWidget::slotItemClicked(QListViewItem *item)
{
if (item == NULL) return;
Folder folder = ((FolderWidgetItem *)item)->folder();
if (folder.fullName().isEmpty()) return;
emit folderSelected(folder);
}
void FolderWidget::slotIMAPLookingUpHost()
{
emit status(tr("Looking up host..."));
emit connecting();
}
void FolderWidget::slotIMAPHostFound()
{
emit status(tr("Host found."));
}
void FolderWidget::slotIMAPConnected()
{
emit status(tr("Connected to host."));
emit connected();
}
void FolderWidget::slotIMAPError(int error)
{
if (error == IMAPBase::IMAPErrConnectionRefused) {
QMessageBox::warning(this, tr("Error"), tr("<p>The IMAP connection was refused.</p>"), tr("Ok"));
} else if (error == IMAPBase::IMAPErrHostNotFound) {
QMessageBox::warning(this, tr("Error"), tr("<p>The host was not found.</p>"), tr("Ok"));
} else if (error == IMAPBase::IMAPErrSocketRead) {
QMessageBox::warning(this, tr("Error"), tr("<p>There was an error while reading from the socket.</p>"), tr("Ok"));
} else if (error == IMAPBase::IMAPErrLoginFailed) {
QMessageBox::warning(this, tr("Error"), tr("<p>Login failed. Check your password/username.</p>"), tr("Ok"));
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>An unknown error was encountered.</p>"), tr("Ok"));
}
}
void FolderWidget::slotIMAPDisconnected()
{
emit status(tr("Disconnected."));
emit disconnected();
}
void FolderWidget::slotIMAPLogin(IMAPResponse &response)
{
- disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPLogin(IMAPResponse &)));
+ disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPLogin(IMAPResponse&)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
emit status(tr("Login successful!"));
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>Login failed. Go away.</p>"), tr("Ok"));
}
}
void FolderWidget::slotIMAPRename(IMAPResponse &response)
{
- disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPRename(IMAPResponse &)));
+ disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPRename(IMAPResponse&)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
emit status(tr("Renaming successful!"));
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>Renaming failed. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok"));
}
}
void FolderWidget::slotIMAPDelete(IMAPResponse &response)
{
- disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPDelete(IMAPResponse &)));
+ disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPDelete(IMAPResponse&)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
emit status(tr("Deletion successful!"));
_rescanAccount = _createFolder.topFolder().account();
_createFolder.topFolder().handler()->iList(".", "*");
- connect(_createFolder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &)));
+ connect(_createFolder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPList(IMAPResponse&)));
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>Delete failed. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok"));
}
}
void FolderWidget::slotIMAPCreate(IMAPResponse &response)
{
- disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPCreate(IMAPResponse &)));
+ disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPCreate(IMAPResponse&)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
emit status(tr("Folder created. Rescanning..."));
_rescanAccount = _createFolder.topFolder().account();
_createFolder.topFolder().handler()->iList(".", "*");
- connect(_createFolder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &)));
+ connect(_createFolder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPList(IMAPResponse&)));
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>The folder could not be created. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok"));
}
}
void FolderWidget::slotIMAPList(IMAPResponse &response)
{
- disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPList(IMAPResponse &)));
+ disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPList(IMAPResponse&)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
QDir d((QString) getenv("HOME") + "/Applications/mail/foldercache");
if (!d.exists()) {
system("mkdir -p $HOME/Applications/mail/foldercache");
qWarning("Created $HOME/Applications/mail/foldercache.");
}
QFile f((QString) getenv("HOME") + "/Applications/mail/foldercache/foldercache-" + _rescanAccount.accountName());
if (!f.open(IO_WriteOnly)) {
QMessageBox::critical(this, tr("Error"), tr("<p>Couldn't open folder cache file for writing!</p>"), tr("Ok"));
return;
}
QTextStream t(&f);
QValueList<IMAPResponseLIST>::Iterator it;
QValueList<IMAPResponseLIST> lists = response.LIST();
for (it = lists.begin(); it != lists.end(); it++) {
t << (*it).folderSeparator() << "\n";
t << (*it).folder() << "\n";
}
f.close();
emit status(tr("Got folder list."));
getAccounts();
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>Couldn't retrieve the folder list. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok"));
}
}
diff --git a/noncore/unsupported/mail2/libmail/imaphandler.cpp b/noncore/unsupported/mail2/libmail/imaphandler.cpp
index dc97b28..8da0acd 100644
--- a/noncore/unsupported/mail2/libmail/imaphandler.cpp
+++ b/noncore/unsupported/mail2/libmail/imaphandler.cpp
@@ -1,62 +1,62 @@
#include "imapresponse.h"
#include "imaphandler.h"
#include "imapbase.h"
IMAPHandler::IMAPHandler(const Account &account)
: QObject(), _account(account)
{
_ready = false;
_loggingin = false;
_loggedin = false;
_tag = 0;
_ibase = new IMAPBase(account);
- connect(_ibase, SIGNAL(dataReceived(const QString &)), SLOT(slotDataReceived(const QString &)));
+ connect(_ibase, SIGNAL(dataReceived(const QString&)), SLOT(slotDataReceived(const QString&)));
connect(_ibase, SIGNAL(lookingUpHost()), SLOT(slotLookingUpHost()));
connect(_ibase, SIGNAL(hostFound()), SLOT(slotHostFound()));
connect(_ibase, SIGNAL(connected()), SLOT(slotConnected()));
connect(_ibase, SIGNAL(disconnected()), SLOT(slotDisconnected()));
connect(_ibase, SIGNAL(error(int)), SLOT(slotError(int)));
}
void IMAPHandler::doLogin()
{
if (_loggedin) return;
if (_loggingin) return;
_loggingin = true;
iLogin(_account.user(), _account.pass());
}
QString IMAPHandler::iCapability()
{
_ibase->sendCommand(QString("%1 CAPABILITY\r\n")
.arg(tag()));
return tag(false);
}
QString IMAPHandler::iNoop()
{
_ibase->sendCommand(QString("%1 NOOP\r\n")
.arg(tag()));
return tag(false);
}
QString IMAPHandler::iLogout()
{
_ibase->sendCommand(QString("%1 LOGOUT\r\n")
.arg(tag()));
return tag(false);
}
QString IMAPHandler::iAuthenticate(const QString &mechanism)
{
_ibase->sendCommand(QString("%1 AUTHENTICATE \"%2\"\r\n")
.arg(tag())
.arg(escape(mechanism)));
return tag(false);
}
QString IMAPHandler::iLogin(const QString &user, const QString &pass)
{
_ibase->sendCommand(QString("%1 LOGIN \"%2\" \"%3\"\r\n")
@@ -254,93 +254,93 @@ QString IMAPHandler::iCopy(const QString &message, const QString &mailbox)
.arg(escape(mailbox)));
return tag(false);
}
QString IMAPHandler::iUid(const QString &command, const QString &arguments)
{
doLogin();
_ibase->sendCommand(QString("%1 UID %2 %3\r\n")
.arg(tag())
.arg(command)
.arg(arguments));
return tag(false);
}
QString IMAPHandler::iX(const QString &commandAtom, const QString &arguments)
{
doLogin();
_ibase->sendCommand(QString("%1 X%2 %3\r\n")
.arg(tag())
.arg(commandAtom)
.arg(arguments));
return tag(false);
}
QString IMAPHandler::escape(const QString &in)
{
QString in_ = in;
return in_.replace(QRegExp("\""), "\\\"");
}
QString IMAPHandler::tag(bool count)
{
return QString("a%1").arg(count ? _tag++ : _tag);
}
void IMAPHandler::slotDataReceived(const QString &data)
{
if (!_ready) {
// The first data is always the greeting string.
// We can ignore it.
_ready = true;
return;
}
IMAPResponseParser parser;
-// connect ( &parser, SIGNAL( needMoreData ( QString & )), _ibase, SLOT( tryRead ( QString & )));
+// connect ( &parser, SIGNAL( needMoreData(QString&)), _ibase, SLOT( tryRead(QString&)));
parser. parse ( data );
IMAPResponse response = parser.response();
-// disconnect ( &parser, SIGNAL( needMoreData ( QString & )), _ibase, SLOT( tryRead ( QString & )));
+// disconnect ( &parser, SIGNAL( needMoreData(QString&)), _ibase, SLOT( tryRead(QString&)));
response.setImapHandler(this);
if (!_loggingin) { qDebug("Emitting gotResponse!\n" ); emit gotResponse(response); }
else {
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
_loggingin = false;
_loggedin = true;
qWarning("OK. Logged in. Leaving loggingin state.");
} else {
_loggingin = false;
emit IMAPError(IMAPBase::IMAPErrLoginFailed);
}
}
}
void IMAPHandler::slotLookingUpHost()
{
emit IMAPLookingUpHost();
}
void IMAPHandler::slotHostFound()
{
emit IMAPHostFound();
}
void IMAPHandler::slotConnected()
{
emit IMAPConnected();
}
void IMAPHandler::slotDisconnected()
{
_loggedin = false;
emit IMAPDisconnected();
}
void IMAPHandler::slotError(int err)
{
emit IMAPError(err);
}
diff --git a/noncore/unsupported/mail2/listviewplus.cpp b/noncore/unsupported/mail2/listviewplus.cpp
index ce5f35f..722b347 100644
--- a/noncore/unsupported/mail2/listviewplus.cpp
+++ b/noncore/unsupported/mail2/listviewplus.cpp
@@ -1,54 +1,54 @@
#include <qpopupmenu.h>
#include <qtimer.h>
#include "listviewplus.h"
ListViewPlus::ListViewPlus(QWidget *parent, const char *name, WFlags fl)
: QListView(parent, name, fl)
{
}
void ListViewPlus::keyPressEvent(QKeyEvent *event)
{
switch(event->key()) {
case Qt::Key_Space: // FALLTHROUGH
case Qt::Key_Enter:
if (currentItem() != 0)
emit clicked(currentItem());
break;
default: break;
}
QListView::keyPressEvent(event);
}
void ListViewPlus::setPopup(QPopupMenu *popup, int delay)
{
_popup = popup;
_delay = delay;
- connect(this, SIGNAL(pressed(QListViewItem *, const QPoint &, int)), SLOT(_initPopup(QListViewItem *, const QPoint &, int)));
- connect(this, SIGNAL(clicked(QListViewItem *, const QPoint &, int)), SLOT(_cancelPopup(QListViewItem *, const QPoint &, int)));
+ connect(this, SIGNAL(pressed(QListViewItem*,const QPoint&,int)), SLOT(_initPopup(QListViewItem*,const QPoint&,int)));
+ connect(this, SIGNAL(clicked(QListViewItem*,const QPoint&,int)), SLOT(_cancelPopup(QListViewItem*,const QPoint&,int)));
}
void ListViewPlus::_initPopup(QListViewItem *, const QPoint &point, int)
{
_point = point;
_timer = new QTimer();
_timer->start(_delay, true);
connect(_timer, SIGNAL(timeout()), this, SLOT(_showPopup()));
}
void ListViewPlus::_cancelPopup(QListViewItem *, const QPoint &, int)
{
delete _timer;
}
void ListViewPlus::_showPopup()
{
_popup->popup(_point);
}
diff --git a/noncore/unsupported/mail2/mailtable.cpp b/noncore/unsupported/mail2/mailtable.cpp
index fd179f0..56feab0 100644
--- a/noncore/unsupported/mail2/mailtable.cpp
+++ b/noncore/unsupported/mail2/mailtable.cpp
@@ -29,143 +29,143 @@ MailTableItem::MailTableItem(QListView *parent, IMAPResponseFETCH fetch)
void MailTableItem::paintCell(QPainter *painter, const QColorGroup &cg, int col, int width, int align)
{
QColor color = cg.color(QColorGroup::Text);
QFont font = painter->font();
if (_draft) {
color = QColor("#707070");
} else if (_new) {
color = QColor("#ff0000");
font.setBold(true);
} else if (_unseen) {
font.setBold(true);
}
painter->setFont(font);
QColorGroup cg_(cg);
cg_.setColor(QColorGroup::Text, color);
QListViewItem::paintCell(painter, cg_, col, width, align);
}
MailTable::MailTable(QWidget *parent, const char *name, WFlags fl)
: ListViewPlus(parent, name, fl), _parent(parent)
{
_stopped = false;
setSorting(-1);
setAllColumnsShowFocus(true);
addColumn(tr("From"), 100);
addColumn(tr("Subject"), 100);
addColumn(tr("Date"), 100);
QPopupMenu *menu = new QPopupMenu(this);
menu->insertItem(tr("Copy"), MENU_COPY);
QPopupMenu *markMenu = new QPopupMenu(this);
markMenu->insertItem(tr("Seen"), MENU_MARK_READ);
markMenu->insertItem(tr("Unseen"), MENU_MARK_UNREAD);
markMenu->insertSeparator();
markMenu->insertItem(tr("Marked"), MENU_MARK_MARKED);
markMenu->insertItem(tr("Unmarked"), MENU_MARK_UNMARKED);
menu->insertItem(tr("Mark as..."), markMenu, MENU_MARK);
menu->insertSeparator();
menu->insertItem(tr("Delete Mail"), MENU_DELETE);
setPopup(menu);
- connect(this, SIGNAL(clicked(QListViewItem *)), SLOT(itemClicked(QListViewItem *)));
+ connect(this, SIGNAL(clicked(QListViewItem*)), SLOT(itemClicked(QListViewItem*)));
}
void MailTable::setFolder(Folder folder)
{
folder.topFolder().handler()->iSelect(folder.fullName());
_handler = folder.topFolder().handler();
- connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPSelect(IMAPResponse &)));
+ connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPSelect(IMAPResponse&)));
}
void MailTable::setHeaders(QValueList<IMAPResponseFETCH> response)
{
clear();
QValueList<IMAPResponseFETCH>::Iterator it;
for (it = response.begin(); it != response.end(); it++) {
(void) new MailTableItem(this, *it);
}
}
void MailTable::slotIMAPSelect(IMAPResponse &response)
{
- disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPSelect(IMAPResponse &)));
+ disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPSelect(IMAPResponse&)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
clear();
QString mails = response.EXISTS()[0].mails();
if (mails.toInt() == 0) {
emit status(tr("Mailbox contained no mails."));
return;
}
int a = mails.toInt() / 5;
int b = mails.toInt() % 5;
_downloadSteps = a;
if (b > 0) _downloadSteps++;
_lastStep = b;
_currentProgress = 0;
emit totalSteps(_downloadSteps);
emit progress(_currentProgress);
emit stopEnabled(true);
response.imapHandler()->iFetch(QString("1:%1").arg((a == 0) ? b : 5), "ENVELOPE FLAGS UID");
emit status(tr("Getting mail headers..."));
- connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPFetch(IMAPResponse &)));
+ connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPFetch(IMAPResponse&)));
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>An error occoured during the selection of the mailbox. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok"));
}
}
void MailTable::slotIMAPFetch(IMAPResponse &response)
{
- disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPFetch(IMAPResponse &)));
+ disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPFetch(IMAPResponse&)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
QValueList<IMAPResponseFETCH>::Iterator it;
QValueList<IMAPResponseFETCH> fetch = response.FETCH();
for (it = fetch.begin(); it != fetch.end(); it++) {
(void) new MailTableItem(this, *it);
}
emit progress(++_currentProgress);
if (_currentProgress != _downloadSteps) {
if (_stopped) {
_currentProgress = 0;
_downloadSteps = 0;
_lastStep = 0;
_stopped = false;
emit status(tr("Stopped"));
emit resetProgress();
emit stopEnabled(false);
} else {
response.imapHandler()->iFetch(QString("%1:%2").arg(_currentProgress * 5 + 1).arg((_currentProgress + 1 == _downloadSteps) ? _currentProgress * 5 + _lastStep : _currentProgress * 5 + 5), "ENVELOPE FLAGS UID");
- connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPFetch(IMAPResponse &)));
+ connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPFetch(IMAPResponse&)));
}
} else {
_currentProgress = 0;
_downloadSteps = 0;
_lastStep = 0;
emit status(tr("Got all mail headers."));
emit resetProgress();
emit stopEnabled(false);
}
} else {
emit status(tr("<font color=#ff0000>Couldn't fetch mail."));
}
}
void MailTable::itemClicked(QListViewItem *item)
{
if (item == NULL) return;
emit mailClicked(((MailTableItem *)item)->fetch(), _handler);
}
diff --git a/noncore/unsupported/mail2/mainwindow.cpp b/noncore/unsupported/mail2/mainwindow.cpp
index 0d09ec8..ce80391 100644
--- a/noncore/unsupported/mail2/mainwindow.cpp
+++ b/noncore/unsupported/mail2/mainwindow.cpp
@@ -1,94 +1,94 @@
#include <qmessagebox.h>
#include <qaction.h>
#include <qapplication.h>
#include <qpe/qcopenvelope_qws.h>
#include "mailstatusbar.h"
#include "folderwidget.h"
#include "mainwindow.h"
#include "configdiag.h"
#include "configfile.h"
#include "searchdiag.h"
#include "mailtable.h"
#include "composer.h"
#include "viewmail.h"
#include "mailfactory.h"
MainWindow::MainWindow(QWidget *parent, const char *name, WFlags fl)
: MainWindowBase(parent, name, fl)
{
status->setStopEnabled(false);
- connect(folderView, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &)));
+ connect(folderView, SIGNAL(status(const QString&)), status, SLOT(setStatusText(const QString&)));
connect(folderView, SIGNAL(folderSelected(Folder)), mailView, SLOT(setFolder(Folder)));
- connect(mailView, SIGNAL(mailClicked(IMAPResponseFETCH, IMAPHandler *)), SLOT(mailClicked(IMAPResponseFETCH, IMAPHandler *)));
- connect(mailView, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &)));
+ connect(mailView, SIGNAL(mailClicked(IMAPResponseFETCH,IMAPHandler*)), SLOT(mailClicked(IMAPResponseFETCH,IMAPHandler*)));
+ connect(mailView, SIGNAL(status(const QString&)), status, SLOT(setStatusText(const QString&)));
connect(mailView, SIGNAL(totalSteps(int)), status, SLOT(setProgressTotalSteps(int)));
connect(mailView, SIGNAL(progress(int)), status, SLOT(setProgress(int)));
connect(mailView, SIGNAL(resetProgress()), status, SLOT(resetProgress()));
connect(mailView, SIGNAL(stopEnabled(bool)), status, SLOT(setStopEnabled(bool)));
connect(status, SIGNAL(stop()), mailView, SLOT(stop()));
connect(compose, SIGNAL(activated()), SLOT(slotComposeNoParams()));
connect(sendQueue, SIGNAL(activated()), SLOT(slotSendQueued()));
connect(findmails, SIGNAL(activated()), SLOT(slotSearch()));
connect(configure, SIGNAL(activated()), SLOT(slotConfigure()));
// Added by Stefan Eilers to allow starting by addressbook..
#if !defined(QT_NO_COP)
// QCopChannel *addressChannel = new QCopChannel("QPE/Application/mail" , this );
-// connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)),
-// this, SLOT ( appMessage(const QCString &, const QByteArray &) ) );
- connect( qApp, SIGNAL( appMessage( const QCString&, const QByteArray& ) ),
- this, SLOT( appMessage( const QCString&, const QByteArray& ) ) );
+// connect (addressChannel, SIGNAL( received(const QCString&,const QByteArray&)),
+// this, SLOT ( appMessage(const QCString&,const QByteArray&) ) );
+ connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ),
+ this, SLOT( appMessage(const QCString&,const QByteArray&) ) );
#endif
}
// Added by Stefan Eilers to allow starting by addressbook..
void MainWindow::appMessage(const QCString &msg, const QByteArray &data)
{
if (msg == "writeMail(QString,QString)") {
QDataStream stream(data,IO_ReadOnly);
QString name, email;
stream >> name >> email;
qWarning("opie-mail:: Should send mail to %s with address %s", name.latin1(), email.latin1() );
slotCompose( name, email );
}else{
QString str_message = msg;
qWarning("opie-mail:: Received unknown QCop-Message: %s", str_message.latin1() );
}
}
void MainWindow::slotCompose( const QString& name, const QString& email )
{
Composer composer(this, 0, true);
// If there is a mailaddress given, create message..
if ( ! name.isEmpty() ){
qWarning("opie-mail:: Compose mail for %s with address %s", name.latin1(), email.latin1() );
SendMail compMail;
compMail.setTo( "\"" + name + "\"" + " " + "<"+ email + ">");
composer.setSendMail( compMail );
}
composer.showMaximized();
composer.exec();
}
void MainWindow::slotComposeNoParams()
{
slotCompose( 0l, 0l);
}
void MainWindow::slotSendQueued()
{
Composer composer(this, 0, true, true);
// composer.sendQueue();
composer.showMaximized();
composer.exec();
// composer.close();
diff --git a/noncore/unsupported/mail2/searchdiag.cpp b/noncore/unsupported/mail2/searchdiag.cpp
index 907f6ff..6fb4e4d 100644
--- a/noncore/unsupported/mail2/searchdiag.cpp
+++ b/noncore/unsupported/mail2/searchdiag.cpp
@@ -1,128 +1,128 @@
#include <qmessagebox.h>
#include <qpushbutton.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <qpe/qpeapplication.h>
#include "imaphandler.h"
#include "searchdiag.h"
#include "viewmail.h"
#define INMENU_BODY 0
#define INMENU_HEADERF 1
#define INMENU_SUBJECT 2
#define INMENU_FROM 3
#define INMENU_TO 4
SearchDiag::SearchDiag(QWidget *parent, const char *name, WFlags fl)
: SearchDiagBase(parent, name, fl)
{
_selected = false;
in->insertItem(tr("Body"), INMENU_BODY);
in->insertItem(tr("Header Field"), INMENU_HEADERF);
in->insertItem(tr("Subject"), INMENU_SUBJECT);
in->insertItem(tr("From"), INMENU_FROM);
in->insertItem(tr("To"), INMENU_TO);
connect(folderView, SIGNAL(folderSelected(Folder)), SLOT(folderSelected(Folder)));
connect(in, SIGNAL(activated(int)), SLOT(slotInItemActivated(int)));
- connect(mailTable, SIGNAL(mailClicked(IMAPResponseFETCH, IMAPHandler *)), SLOT(slotMailClicked(IMAPResponseFETCH, IMAPHandler *)));
+ connect(mailTable, SIGNAL(mailClicked(IMAPResponseFETCH,IMAPHandler*)), SLOT(slotMailClicked(IMAPResponseFETCH,IMAPHandler*)));
}
void SearchDiag::accept()
{
if (searchFor->text().isEmpty()) {
QMessageBox::information(this, tr("Error"), tr("<p>Please enter what to search for.</p>"), tr("Ok"));
return;
}
if (!_selected) {
QMessageBox::information(this, tr("Error"), tr("<p>Please select a folder.</p>"), tr("Ok"));
return;
}
if (in->currentItem() == INMENU_HEADERF && other->currentText().isEmpty()) {
QMessageBox::information(this, tr("Error"), tr("<p>Please enter a header field to search in.</p>"), tr("Ok"));
return;
}
_folder.topFolder().handler()->iSelect(_folder.fullName());
- connect(_folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPSelect(IMAPResponse &)));
+ connect(_folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPSelect(IMAPResponse&)));
}
void SearchDiag::folderSelected(Folder folder)
{
_selected = true;
_folder = folder;
}
void SearchDiag::slotIMAPSelect(IMAPResponse &response)
{
- disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPSelect(IMAPResponse &)));
+ disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPSelect(IMAPResponse&)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
if (in->currentItem() == INMENU_BODY) {
response.imapHandler()->iSearch("BODY \"" + searchFor->text() + "\"");
} else if (in->currentItem() == INMENU_HEADERF) {
response.imapHandler()->iSearch("HEADER \""+ other->currentText() + "\" \"" + searchFor->text() + "\"");
} else if (in->currentItem() == INMENU_SUBJECT) {
response.imapHandler()->iSearch("SUBJECT \"" + searchFor->text() + "\"");
} else if (in->currentItem() == INMENU_FROM) {
response.imapHandler()->iSearch("FROM \"" + searchFor->text() + "\"");
} else if (in->currentItem() == INMENU_TO) {
response.imapHandler()->iSearch("TO \"" + searchFor->text() + "\"");
} else return;
- connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPSearch(IMAPResponse &)));
+ connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPSearch(IMAPResponse&)));
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>Could not select the folder. Aborting. (Server said: %1)").arg(response.statusResponse().comment()), tr("Ok"));
}
}
void SearchDiag::slotIMAPSearch(IMAPResponse &response)
{
- disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPSearch(IMAPResponse &)));
+ disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPSearch(IMAPResponse&)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
IMAPResponseSEARCH results = response.SEARCH()[0];
if (results.mails().count() == 0) {
QMessageBox::information(this, tr("Results"), tr("<p>No mails match your criteria.</p>"), tr("Ok"));
return;
}
response.imapHandler()->iFetch(results.mails().join(","), "ENVELOPE FLAGS UID");
- connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPFetch(IMAPResponse &)));
+ connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPFetch(IMAPResponse&)));
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>Search failed. (Server said: %1)").arg(response.statusResponse().comment()), tr("Ok"));
}
}
void SearchDiag::slotIMAPFetch(IMAPResponse &response)
{
- disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPSearch(IMAPResponse &)));
+ disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPSearch(IMAPResponse&)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
mailTable->setHeaders(response.FETCH());
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>Couldn't fetch the mail headers. (Server said: %1)").arg(response.statusResponse().comment()));
}
}
void SearchDiag::slotMailClicked(IMAPResponseFETCH fetch, IMAPHandler *)
{
ViewMail viewMail(fetch, _folder.topFolder().handler(), this, 0, true);
viewMail.showMaximized();
viewMail.exec();
}
void SearchDiag::slotInItemActivated(int index)
{
if (index == INMENU_HEADERF) {
other->setEnabled(true);
} else {
other->setEnabled(false);
}
}
diff --git a/noncore/unsupported/mail2/viewmail.cpp b/noncore/unsupported/mail2/viewmail.cpp
index da6924d..0cfb6e5 100644
--- a/noncore/unsupported/mail2/viewmail.cpp
+++ b/noncore/unsupported/mail2/viewmail.cpp
@@ -14,97 +14,97 @@ AttachItem::AttachItem(QListView *parent, AttachItemStore &attachItemStore)
setText(1, _attachItemStore.fileName());
setText(2, _attachItemStore.description());
}
AttachItem::AttachItem(QListViewItem *parent, AttachItemStore &attachItemStore)
: QListViewItem(parent), _attachItemStore(attachItemStore)
{
setText(0, _attachItemStore.mimeType());
setText(1, _attachItemStore.fileName());
setText(2, _attachItemStore.description());
}
ViewMail::ViewMail(IMAPResponseFETCH &mail, IMAPHandler *handler, QWidget *parent, const char *name, WFlags fl)
: ViewMailBase(parent, name, fl), _inLoop(false), _mail(mail), _handler(handler)
{
setCaption(caption().arg(mail.envelope().from()[0].name()));
_gotBody = false;
_mailHtml = tr(
"<html><body>"
"<div align=center><b>%1</b></div>"
"<b>From:</b> %2<br>"
"<b>To:</b> %3<br>"
"%4"
"%5"
"<b>Date:</b> %6<hr>"
"<font face=fixed>%7</font>")
.arg(deHtml(mail.envelope().subject().isNull() ? tr("(no subject)")
: deHtml(mail.envelope().subject())))
.arg(deHtml(mail.envelope().from().toString().isNull() ? tr("(no from)")
: mail.envelope().from().toString()))
.arg(deHtml(mail.envelope().to().toString().isNull() ? tr("(no recipient)")
: mail.envelope().to().toString()))
.arg(mail.envelope().cc().toString().isNull() ? QString(0)
: tr("<b>Cc:</b> %1<br>").arg(deHtml(mail.envelope().cc().toString())))
.arg(mail.envelope().bcc().toString().isNull() ? QString(0)
: tr("<b>Bcc:</b> %1<br>").arg(deHtml(mail.envelope().bcc().toString())))
.arg(mail.envelope().mailDate().isNull() ? tr("(no date)")
: mail.envelope().mailDate())
.arg("%1");
connect(reply, SIGNAL(activated()), SLOT(slotReply()));
connect(forward, SIGNAL(activated()), SLOT(slotForward()));
attachments->setEnabled(_gotBody);
browser->setText(QString(_mailHtml).arg(tr("Getting mail body from server. Please wait...")));
_handler->iUid("FETCH", QString("%1 (BODY[1])").arg(mail.uid()));
- connect(_handler, SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPUid(IMAPResponse &)));
+ connect(_handler, SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPUid(IMAPResponse&)));
}
ViewMail::~ViewMail()
{
hide();
}
void ViewMail::hide()
{
QWidget::hide();
if (_inLoop) {
_inLoop = false;
qApp->exit_loop();
}
}
void ViewMail::exec()
{
show();
if (!_inLoop) {
_inLoop = true;
qApp->enter_loop();
}
}
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_;
}
void ViewMail::slotReply()
{
if (!_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(_mail.envelope().from()[0].toString())
.arg(_mail.envelope().mailDate());
@@ -134,65 +134,65 @@ void ViewMail::slotReply()
}
void ViewMail::slotForward()
{
if (!_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(_mail.envelope().from()[0].toString());
if (!_mail.envelope().mailDate().isNull())
ftext += QString("Date: %1\n")
.arg(_mail.envelope().mailDate());
if (!_mail.envelope().from()[0].toString().isNull())
ftext += QString("From: %1\n")
.arg(_mail.envelope().from()[0].toString());
if (!_mail.envelope().to().toString().isNull())
ftext += QString("To: %1\n")
.arg(_mail.envelope().to().toString());
if (!_mail.envelope().cc().toString().isNull())
ftext += QString("Cc: %1\n")
.arg(_mail.envelope().cc().toString());
if (!_mail.envelope().bcc().toString().isNull())
ftext += QString("Bcc: %1\n")
.arg(_mail.envelope().bcc().toString());
if (!_mail.envelope().subject().isNull())
ftext += QString("Subject: %1\n")
.arg(_mail.envelope().subject());
ftext += QString("\n%1\n")
.arg(_mail.bodyPart(1).data());
ftext += QString("----- End forwarded message -----\n");
SendMail sendMail;
sendMail.setSubject("Fwd: " + _mail.envelope().subject());
sendMail.setMessage(ftext);
Composer composer(this, 0, true);
composer.setSendMail(sendMail);
composer.showMaximized();
composer.exec();
}
void ViewMail::slotIMAPUid(IMAPResponse &response)
{
- disconnect(_handler, SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPUid(IMAPResponse &)));
+ disconnect(_handler, SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPUid(IMAPResponse&)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
QValueList<IMAPResponseBodyPart> bodyParts;
bodyParts.append(response.FETCH()[0].bodyPart(0));
_mail.setBodyParts(bodyParts);
browser->setText(QString(_mailHtml).arg(deHtml(response.FETCH()[0].bodyPart(0).data())));
// fillList(response.FETCH()[0].bodyStructure());
_gotBody = true;
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>I was unable to retrieve the mail from the server. You can try again later or give up.</p>"), tr("Ok"));
}
}
diff --git a/noncore/unsupported/mailit/addatt.cpp b/noncore/unsupported/mailit/addatt.cpp
index 19ac58f..420f84c 100644
--- a/noncore/unsupported/mailit/addatt.cpp
+++ b/noncore/unsupported/mailit/addatt.cpp
@@ -45,104 +45,104 @@ FileItem::FileItem(QListView *parent, DocLnk* dl)
} else if (fileType == "File") {
setPixmap(0, Resource::loadPixmap("exec"));
}*/
}
FileItem::~FileItem()
{
if (doclnk!=NULL) delete doclnk;
doclnk=NULL;
}
AddAtt::AddAtt(QWidget *parent, const char *name, WFlags f)
: QDialog(parent, name, f)
{
setCaption(tr("Adding attachments") );
QGridLayout *top = new QGridLayout(this, 1,1 );
QHBox *buttons=new QHBox(this);
/*fileCategoryButton = new QPushButton(this);*/
attachButton = new QPushButton(tr("attach..."), buttons);
removeButton = new QPushButton(tr("Remove"), buttons);
/*fileCategories = new QPopupMenu(fileCategoryButton);
fileCategoryButton->setPopup(fileCategories);
fileCategories->insertItem("Document");
fileCategories->insertItem("Picture");
fileCategories->insertItem("Sound");
fileCategories->insertItem("Movie");
fileCategories->insertItem("File");
fileCategoryButton->setText("Document");
top->addWidget(fileCategoryButton, 0, 0);*/
top->addWidget(buttons,1,0);
//buttons->addWidget(attachButton,0,0);
//buttons->addWidget(removeButton,0,1);
//connect(fileCategories, SIGNAL(activated(int)), this,
// SLOT(fileCategorySelected(int)) );*/
connect(attachButton, SIGNAL(clicked()), this,
SLOT(addattachment()) );
connect(removeButton, SIGNAL(clicked()), this,
SLOT(removeattachment()) );
/*listView = new QListView(this, "AttView");
listView->addColumn("Documents");*
- connect(listView, SIGNAL(doubleClicked(QListViewItem *)), this,
+ connect(listView, SIGNAL(doubleClicked(QListViewItem*)), this,
SLOT(addattachment()) );*/
attView = new QListView(this, "Selected");
attView->addColumn(tr("Attached"));
attView->addColumn(tr("File type"));
- connect(attView, SIGNAL(doubleClicked(QListViewItem *)), this,
+ connect(attView, SIGNAL(doubleClicked(QListViewItem*)), this,
SLOT(removeattachment()) );
//top->addWidget(ofs, 0,0);
top->addWidget(attView, 0,0);
clear();
}
void AddAtt::clear()
{
attView->clear();
//getFiles();
modified = FALSE;
}
/*void AddAtt::fileCategorySelected(int id)
{
fileCategoryButton->setText(fileCategories->text(id));
getFiles();
}*/
void AddAtt::addattachment()
{ // ### FIXME wrong use -zecke
OFileDialog ofs("Attachments",this,0,0,"/root/Documents");
ofs.showMaximized();
if (ofs.exec()==QDialog::Accepted)
{
DocLnk* dl=new DocLnk(ofs.selectedDocument());
FileItem* fi=new FileItem(attView,dl);
fi->setPixmap(0,dl->pixmap());
fi->setText(1,dl->type());
attView->insertItem(fi);
modified = TRUE;
}
}
void AddAtt::removeattachment()
{
if (attView->selectedItem() != NULL)
{
attView->takeItem(attView->selectedItem());
}
modified = TRUE;
}
diff --git a/noncore/unsupported/mailit/emailclient.cpp b/noncore/unsupported/mailit/emailclient.cpp
index 8359acf..86c7987 100644
--- a/noncore/unsupported/mailit/emailclient.cpp
+++ b/noncore/unsupported/mailit/emailclient.cpp
@@ -14,128 +14,128 @@
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <qapplication.h>
#include <qmessagebox.h>
#include <qvbox.h>
#include <qfile.h>
#include <qcheckbox.h>
#include <qmenubar.h>
#include <qaction.h>
#include <qwhatsthis.h>
#include <qpe/resource.h>
#include "emailclient.h"
#include "writemail.h"
QCollection::Item AccountList::newItem(QCollection::Item d)
{
return dupl( (MailAccount *) d);
}
MailAccount* AccountList::dupl(MailAccount *in)
{
ac = new MailAccount(*in);
return ac;
}
EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl )
: QMainWindow( parent, name, fl )
{
emailHandler = new EmailHandler();
addressList = new AddressList();
sending = FALSE;
receiving = FALSE;
previewingMail = FALSE;
mailIdCount = 1;
accountIdCount = 1;
allAccounts = FALSE;
init();
connect(emailHandler, SIGNAL(mailSent()), this, SLOT(mailSent()) );
- connect(emailHandler, SIGNAL(smtpError(int,const QString &)), this,
- SLOT(smtpError(int,const QString &)) );
- connect(emailHandler, SIGNAL(popError(int,const QString &)), this,
- SLOT(popError(int,const QString &)) );
+ connect(emailHandler, SIGNAL(smtpError(int,const QString&)), this,
+ SLOT(smtpError(int,const QString&)) );
+ connect(emailHandler, SIGNAL(popError(int,const QString&)), this,
+ SLOT(popError(int,const QString&)) );
- connect(inboxView, SIGNAL(doubleClicked(QListViewItem *)), this, SLOT(inboxItemSelected()) );
- connect(outboxView, SIGNAL(doubleClicked(QListViewItem *)), this, SLOT(outboxItemSelected()) );
+ connect(inboxView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(inboxItemSelected()) );
+ connect(outboxView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(outboxItemSelected()) );
- connect(inboxView, SIGNAL(pressed(QListViewItem *)), this, SLOT(inboxItemPressed()) );
- connect(inboxView, SIGNAL(clicked(QListViewItem *)), this, SLOT(inboxItemReleased()) );
+ connect(inboxView, SIGNAL(pressed(QListViewItem*)), this, SLOT(inboxItemPressed()) );
+ connect(inboxView, SIGNAL(clicked(QListViewItem*)), this, SLOT(inboxItemReleased()) );
- connect(emailHandler, SIGNAL(mailArrived(const Email &, bool)), this,
- SLOT(mailArrived(const Email &, bool)) );
+ connect(emailHandler, SIGNAL(mailArrived(const Email&,bool)), this,
+ SLOT(mailArrived(const Email&,bool)) );
connect(emailHandler, SIGNAL(mailTransfered(int)), this,
SLOT(allMailArrived(int)) );
mailconf = new Config("mailit");
//In case Synchronize is not defined in settings.txt
readSettings();
updateAccounts();
lineShift = "\n";
readMail();
lineShift = "\r\n";
mailboxView->setCurrentTab(0); //ensure that inbox has focus
/*channel = new QCopChannel( "QPE/Application/mailit", this );
- connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
- this, SLOT(receive(const QCString&, const QByteArray&)) );*/
+ connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(receive(const QCString&,const QByteArray&)) );*/
}
EmailClient::~EmailClient()
{
//needs to be moved from destructor to closewindow event
saveMail(getPath(FALSE) + "inbox.txt", inboxView);
//does not currently work. Defining outbox in the same
//format as inbox is not a good solution as they have
//different properties
saveMail(getPath(FALSE) + "outbox.txt", outboxView);
saveSettings();
mailconf->write();
delete mailconf;
}
void EmailClient::init()
{
initStatusBar(this);
setToolBarsMovable(FALSE);
bar = new QToolBar(this);
QWhatsThis::add(bar,tr("Main operation toolbar"));
bar->setHorizontalStretchable( TRUE );
mb = new QMenuBar( bar );
QPopupMenu *mail = new QPopupMenu(mb);
mb->insertItem( tr( "&Mail" ), mail);
QPopupMenu *configure = new QPopupMenu(mb);
mb->insertItem( tr( "Accounts" ), configure);
selectAccountMenu = new QPopupMenu(mb);
editAccountMenu = new QPopupMenu(mb);
deleteAccountMenu = new QPopupMenu(mb);
mail->insertItem(tr("Get Mail in"), selectAccountMenu);
configure->insertItem(tr("Edit account"), editAccountMenu);
configure->insertItem(tr("Delete account"), deleteAccountMenu);
bar = new QToolBar(this);
getMailButton = new QToolButton(Resource::loadPixmap("mailit/getmail"),tr("getMail"),tr("select account"), this,SLOT(getAllNewMail()),bar);
@@ -172,100 +172,100 @@ void EmailClient::init()
QWidget* widget = new QWidget( mailboxView, "widget" );
grid_2 = new QGridLayout( widget );
// grid_2->setSpacing(6);
// grid_2->setMargin( 11 );
inboxView = new QListView( widget, "inboxView" );
inboxView->addColumn( tr( "From" ) );
inboxView->addColumn( tr( "Subject" ) );
inboxView->addColumn( tr( "Date" ) );
inboxView->setMinimumSize( QSize( 0, 0 ) );
inboxView->setAllColumnsShowFocus(TRUE);
QWhatsThis::add(inboxView,QWidget::tr("This is the inbox view.\n"
"It keeps the fetched mail which can be \n"
"viewed by double clicking the entry.\n"
"blue attachment icon shows whether this \n"
"mailhas attachments.\n"));
grid_2->addWidget( inboxView, 2, 0 );
mailboxView->addTab( widget, "mailit/inbox", tr( "Inbox" ) );
QWidget* widget_2 = new QWidget( mailboxView, "widget_2" );
grid_3 = new QGridLayout( widget_2 );
// grid_3->setSpacing(6);
// grid_3->setMargin( 11 );
outboxView = new QListView( widget_2, "outboxView" );
outboxView->addColumn( tr( "To" ) );
outboxView->addColumn( tr( "Subject" ) );
outboxView->setAllColumnsShowFocus(TRUE);
QWhatsThis::add(outboxView,QWidget::tr("This is the outbox view.\n"
"It keeps the queued mails to send which can be \n"
"reviewed by double clicking the entry."));
grid_3->addWidget( outboxView, 0, 0 );
mailboxView->addTab( widget_2,"mailit/outbox", tr( "Outbox" ) );
setCentralWidget(mailboxView);
}
void EmailClient::initStatusBar(QWidget* parent)
{
statusBar = new QStatusBar(parent);
statusBar->setSizeGripEnabled(FALSE);
status1Label = new QLabel( tr("Idle"), statusBar);
status2Label = new QLabel("", statusBar);
- connect(emailHandler, SIGNAL(updatePopStatus(const QString &)),
- status2Label, SLOT(setText(const QString &)) );
- connect(emailHandler, SIGNAL(updateSmtpStatus(const QString &)),
- status2Label, SLOT(setText(const QString &)) );
+ connect(emailHandler, SIGNAL(updatePopStatus(const QString&)),
+ status2Label, SLOT(setText(const QString&)) );
+ connect(emailHandler, SIGNAL(updateSmtpStatus(const QString&)),
+ status2Label, SLOT(setText(const QString&)) );
progressBar = new QProgressBar(statusBar);
connect(emailHandler, SIGNAL(mailboxSize(int)),
this, SLOT(setTotalSize(int)) );
connect(emailHandler, SIGNAL(currentMailSize(int)),
this, SLOT(setMailSize(int)) );
connect(emailHandler, SIGNAL(downloadedSize(int)),
this, SLOT(setDownloadedSize(int)) );
statusBar->addWidget(status1Label);
statusBar->addWidget(progressBar);
statusBar->addWidget(status2Label);
}
void EmailClient::compose()
{
emit composeRequested();
}
void EmailClient::cancel()
{
emailHandler->cancel();
}
AddressList* EmailClient::getAdrListRef()
{
return addressList;
}
//this needs to be rewritten to syncronize with outboxView
void EmailClient::enqueMail(const Email &mail)
{
if (accountList.count() == 0) {
QMessageBox::warning(qApp->activeWindow(),
tr("No account selected"), tr("You must create an account"), "OK\n");
return;
}
if (accountList.count() > 0) {
currentAccount = accountList.first();
qWarning("using account " + currentAccount->name);
}
Email addMail = mail;
addMail.from = currentAccount->name;
addMail.fromMail = currentAccount->emailAddress;
diff --git a/noncore/unsupported/mailit/emailhandler.cpp b/noncore/unsupported/mailit/emailhandler.cpp
index 06e978d..02b3e9a 100644
--- a/noncore/unsupported/mailit/emailhandler.cpp
+++ b/noncore/unsupported/mailit/emailhandler.cpp
@@ -1,106 +1,106 @@
/**********************************************************************
** Copyright (C) 2001 Trolltech AS. All rights reserved.
**
** This file is part of Qt Palmtop Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <qfileinfo.h>
#include <stdlib.h>
#include <qapplication.h>
#include <qmessagebox.h>
#include <qcstring.h>
#include "emailhandler.h"
#include <qpe/applnk.h>
#include <qpe/filemanager.h>
QCollection::Item EnclosureList::newItem(QCollection::Item d)
{
return dupl( (Enclosure *) d);
}
Enclosure* EnclosureList::dupl(Enclosure *in)
{
ac = new Enclosure(*in);
return ac;
}
EmailHandler::EmailHandler()
{
qDebug("EMailHandler::EmailHandler");
smtpClient = new SmtpClient();
popClient = new PopClient();
- connect(smtpClient, SIGNAL(errorOccurred(int, const QString &)), this,
- SIGNAL(smtpError(int, const QString &)) );
+ connect(smtpClient, SIGNAL(errorOccurred(int,const QString&)), this,
+ SIGNAL(smtpError(int,const QString&)) );
connect(smtpClient, SIGNAL(mailSent()), this, SIGNAL(mailSent()) );
- connect(smtpClient, SIGNAL(updateStatus(const QString &)), this,
- SIGNAL(updateSmtpStatus(const QString &)) );
-
- connect(popClient, SIGNAL(errorOccurred(int, const QString &)), this,
- SIGNAL(popError(int, const QString &)) );
- connect(popClient, SIGNAL(newMessage(const QString &, int, uint, bool)),
- this, SLOT(messageArrived(const QString &, int, uint, bool)) );
- connect(popClient, SIGNAL(updateStatus(const QString &)), this,
- SIGNAL(updatePopStatus(const QString &)) );
+ connect(smtpClient, SIGNAL(updateStatus(const QString&)), this,
+ SIGNAL(updateSmtpStatus(const QString&)) );
+
+ connect(popClient, SIGNAL(errorOccurred(int,const QString&)), this,
+ SIGNAL(popError(int,const QString&)) );
+ connect(popClient, SIGNAL(newMessage(const QString&,int,uint,bool)),
+ this, SLOT(messageArrived(const QString&,int,uint,bool)) );
+ connect(popClient, SIGNAL(updateStatus(const QString&)), this,
+ SIGNAL(updatePopStatus(const QString&)) );
connect(popClient, SIGNAL(mailTransfered(int)), this,
SIGNAL(mailTransfered(int)) );
//relaying size information
connect(popClient, SIGNAL(currentMailSize(int)),
this, SIGNAL(currentMailSize(int)) );
connect(popClient, SIGNAL(downloadedSize(int)),
this, SIGNAL(downloadedSize(int)) );
}
void EmailHandler::sendMail(QList<Email> *mailList)
{
Email *currentMail;
QString temp;
QString userName = QString::null;
// not supported by ALL SMTP servers in the MAIL From field
// userName = "\""+mailAccount.name+"\"";
userName += "<" + mailAccount.emailAddress + ">";
for (currentMail = mailList->first(); currentMail != 0;
currentMail = mailList->next()) {
if (encodeMime(currentMail) == 0) {
smtpClient->addMail(userName, currentMail->subject,
currentMail->recipients, currentMail->rawMail);
} else { //error
temp = tr("Could not locate all files in \nmail with subject: ") +
currentMail->subject;
temp += tr("\nMail has NOT been sent");
QMessageBox::warning(qApp->activeWindow(), tr("Attachment error"), temp, tr("OK\n"));
}
}
smtpClient->newConnection(mailAccount.smtpServer, 25);
}
void EmailHandler::setAccount(MailAccount account)
{
mailAccount = account;
}
void EmailHandler::getMail()
{
popClient->setAccount(mailAccount.popUserName, mailAccount.popPasswd);
if (mailAccount.synchronize) {
popClient->setSynchronize(mailAccount.lastServerMailCount);
} else {
diff --git a/noncore/unsupported/mailit/mailitwindow.cpp b/noncore/unsupported/mailit/mailitwindow.cpp
index 6e298c7..fec4d78 100644
--- a/noncore/unsupported/mailit/mailitwindow.cpp
+++ b/noncore/unsupported/mailit/mailitwindow.cpp
@@ -1,113 +1,113 @@
/**********************************************************************
** Copyright (C) 2001 Trolltech AS. All rights reserved.
**
** This file is part of Qt Palmtop Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <qwhatsthis.h>
#include <qmessagebox.h>
#include "mailitwindow.h"
MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags /*fl*/)
: QMainWindow(parent, name, WStyle_ContextHelp)
{
currentCaption = tr("Mailit");
setCaption(tr(currentCaption));
views = new QWidgetStack(this);
setCentralWidget(views);
QWhatsThis::add(views,tr("Central view area"));
emailClient = new EmailClient(views, "client");
writeMail = new WriteMail(views, "writing");
readMail = new ReadMail(views, "reading");
views->raiseWidget(emailClient);
connect(emailClient, SIGNAL(composeRequested()),
this, SLOT(compose()) );
- connect(emailClient, SIGNAL(viewEmail(QListView *, Email *)), this,
- SLOT(viewMail(QListView *, Email *)) );
- connect(emailClient, SIGNAL(mailUpdated(Email *)), this,
- SLOT(updateMailView(Email *)) );
+ connect(emailClient, SIGNAL(viewEmail(QListView*,Email*)), this,
+ SLOT(viewMail(QListView*,Email*)) );
+ connect(emailClient, SIGNAL(mailUpdated(Email*)), this,
+ SLOT(updateMailView(Email*)) );
connect(writeMail, SIGNAL(cancelMail()), this, SLOT(showEmailClient()) );
- connect(writeMail, SIGNAL(sendMailRequested(const Email &)), this,
+ connect(writeMail, SIGNAL(sendMailRequested(const Email&)), this,
SLOT(showEmailClient()) );
- connect(writeMail, SIGNAL(sendMailRequested(const Email &)), emailClient,
- SLOT(enqueMail(const Email &)) );
+ connect(writeMail, SIGNAL(sendMailRequested(const Email&)), emailClient,
+ SLOT(enqueMail(const Email&)) );
connect(readMail, SIGNAL(cancelView()), this, SLOT(showEmailClient()) );
- connect(readMail, SIGNAL(replyRequested(Email &, bool&)), this,
- SLOT(composeReply(Email &, bool&)) );
- connect(readMail, SIGNAL(forwardRequested(Email &)), this,
- SLOT(composeForward(Email &)) );
+ connect(readMail, SIGNAL(replyRequested(Email&,bool&)), this,
+ SLOT(composeReply(Email&,bool&)) );
+ connect(readMail, SIGNAL(forwardRequested(Email&)), this,
+ SLOT(composeForward(Email&)) );
- connect(readMail, SIGNAL(removeItem(EmailListItem *, bool &)), emailClient,
- SLOT(deleteMail(EmailListItem *, bool &)) );
- connect(readMail, SIGNAL(viewingMail(Email *)), emailClient,
- SLOT(moveMailFront(Email *)) );
+ connect(readMail, SIGNAL(removeItem(EmailListItem*,bool&)), emailClient,
+ SLOT(deleteMail(EmailListItem*,bool&)) );
+ connect(readMail, SIGNAL(viewingMail(Email*)), emailClient,
+ SLOT(moveMailFront(Email*)) );
- connect(emailClient, SIGNAL(newCaption(const QString &)),
- this, SLOT(updateCaption(const QString &)) );
+ connect(emailClient, SIGNAL(newCaption(const QString&)),
+ this, SLOT(updateCaption(const QString&)) );
- connect(readMail, SIGNAL(download(Email *)), emailClient, SLOT(download(Email*)) );
+ connect(readMail, SIGNAL(download(Email*)), emailClient, SLOT(download(Email*)) );
viewingMail = FALSE;
}
MailItWindow::~MailItWindow()
{
}
void MailItWindow::closeEvent(QCloseEvent *e)
{
if (views->visibleWidget() == emailClient) {
e->accept();
} else {
showEmailClient();
}
}
void MailItWindow::compose()
{
viewingMail = FALSE;
emailClient->hide();
readMail->hide();
views->raiseWidget(writeMail);
writeMail->setAddressList(emailClient->getAdrListRef());
writeMail->newMail();
setCaption( tr( "Write mail" ) );
}
void MailItWindow::composeReply(Email &mail, bool& replyAll)
{
compose();
writeMail->reply(mail,replyAll) ;
}
void MailItWindow::composeForward(Email &mail)
{
compose();
writeMail->forward(mail) ;
}
void MailItWindow::showEmailClient()
{
viewingMail = FALSE;
writeMail->hide();
readMail->hide();
views->raiseWidget(emailClient);
setCaption( tr(currentCaption) );
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index a09bc30..7f1c0b8 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -131,118 +131,118 @@ void MainWindow::makeMenu()
cfgact = new QAction( tr( "Servers" ),
QString::null, 0, this, 0 );
connect( cfgact, SIGNAL( activated() ),
SLOT( showSettingsSrv() ) );
cfgact->addTo( cfgMenu );
cfgact = new QAction( tr( "Destinations" ),
QString::null, 0, this, 0 );
connect( cfgact, SIGNAL( activated() ),
SLOT( showSettingsDst() ) );
cfgact->addTo( cfgMenu );
QAction *a;
// SECTIONS
sectionBar = new QToolBar( this );
addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE );
sectionBar->setHorizontalStretchable( true );
QLabel *label = new QLabel( sectionBar, "section" );
// label->setBackgroundMode( NoBackground );
label->font().setPointSize( 8 );
label->setText( tr( "Section:" ) );
sectionBar->setStretchableWidget( label );
section = new QComboBox( false, sectionBar );
section->font().setPointSize( 8 );
label = new QLabel( " / ", sectionBar );
label->font().setPointSize( 8 );
// label->setBackgroundMode( PaletteForeground );
subsection = new QComboBox( false, sectionBar );
subsection->font().setPointSize( 8 );
a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) );
a->addTo( sectionBar );
setSections();
setSubSections();
sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 );
connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) );
sectionAction->setToggleAction( true );
sectionAction->addTo( viewMenu );
// sectionBar->setStretchableWidget( section );
//FIND
findBar = new QToolBar(this);
addToolBar( findBar, "Filter", QMainWindow::Top, TRUE );
label = new QLabel( tr("Filter: "), findBar );
// label->setBackgroundMode( PaletteForeground );
findBar->setHorizontalStretchable( TRUE );
findEdit = new QLineEdit( findBar, "findEdit" );
findBar->setStretchableWidget( findEdit );
- connect( findEdit, SIGNAL( textChanged( const QString & ) ),
+ connect( findEdit, SIGNAL( textChanged(const QString&) ),
this, SLOT( displayList() ) );
a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) );
a->addTo( findBar );
a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
a->addTo( findBar );
findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 );
connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) );
findAction->setToggleAction( true );
findAction->addTo( viewMenu );
//SEARCH
searchBar = new QToolBar(this);
addToolBar( searchBar, "Search", QMainWindow::Top, TRUE );
label = new QLabel( tr("Search: "), searchBar );
// label->setBackgroundMode( PaletteForeground );
searchBar->setHorizontalStretchable( TRUE );
searchEdit = new QLineEdit( searchBar, "seachEdit" );
searchBar->setStretchableWidget( searchEdit );
-// connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
+// connect( searchEdit, SIGNAL( textChanged(const QString&) ),
// this, SLOT( displayList() ) );
a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) );
a->addTo( searchBar );
searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 );
connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) );
searchCommit->addTo( searchBar );
a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) );
a->addTo( searchBar );
searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 );
connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) );
searchAction->setToggleAction( true );
searchAction->addTo( viewMenu );
//DEST
destBar = new QToolBar(this);
addToolBar( destBar, "Destination", QMainWindow::Top, TRUE );
label = new QLabel( tr("Destination: "), destBar );
// label->setBackgroundMode( PaletteForeground );
destBar->setHorizontalStretchable( TRUE );
destination = new QComboBox( false, destBar );
destination->insertStringList( settings->getDestinationNames() );
setComboName(destination,settings->getDestinationName());
connect( destination, SIGNAL(activated(int)),
settings, SLOT(activeDestinationChange(int)) );
// space->setBackgroundMode( PaletteForeground );
CheckBoxLink = new QCheckBox( tr("Link"), destBar);
// CheckBoxLink->setBackgroundMode( PaletteForeground );
CheckBoxLink->setChecked( settings->createLinks() );
connect( CheckBoxLink, SIGNAL(toggled(bool)),
settings, SLOT(linkEnabled(bool)) );
destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 );
connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) );
a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), SLOT( destClose() ) );
a->addTo( destBar );
destBar->setStretchableWidget( CheckBoxLink );
destAction->setToggleAction( true );
destAction->addTo( viewMenu );
// helpMenu
helpMenu->insertSeparator();
a = new QAction( tr( "Package Actions" ), QString::null, 0, this, 0 );
a->addTo( helpMenu );
helpMenu->insertSeparator();
a = new QAction( tr( "Install" ),
Resource::loadPixmap( "oipkg/install" ), QString::null, 0, this, 0 );
@@ -423,93 +423,93 @@ void MainWindow::findShow(bool b)
if (b) findBar->show();
else findBar->hide();
findAction->setOn( b );
}
void MainWindow::findClose()
{
findAction->setOn( false );
}
void MainWindow::searchShow(bool b)
{
if (b) searchBar->show();
else searchBar->hide();
searchAction->setOn( b );
}
void MainWindow::searchClose()
{
searchAction->setOn( false );
}
void MainWindow::destShow(bool b)
{
if (b) destBar->show();
else destBar->hide();
destAction->setOn( b );
}
void MainWindow::destClose()
{
destAction->setOn( false );
}
void MainWindow::setDocument(const QString &fileName)
{
if ( !QFile::exists( fileName ) ) return;
ipkg->installFile( fileName );
QCopEnvelope e("QPE/System", "linkChanged(QString)");
QString lf = QString::null;
e << lf;
}
void MainWindow::makeChannel()
{
channel = new QCopChannel( "QPE/Application/oipkg", this );
- connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
- this, SLOT(receive(const QCString&, const QByteArray&)) );
+ connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(receive(const QCString&,const QByteArray&)) );
}
void MainWindow::receive(const QCString &msg, const QByteArray &arg)
{
pvDebug(3, "QCop "+msg+" "+QCString(arg));
if ( msg == "installFile(QString)" )
{
ipkg->installFile( QString(arg) );
}else if( msg == "removeFile(QString)" )
{
ipkg->removeFile( QString(arg) );
}else if( msg == "createLinks(QString)" )
{
ipkg->createLinks( QString(arg) );
}else if( msg == "removeLinks(QString)" )
{
ipkg->removeLinks( QString(arg) );
}else{
pvDebug(2,"Huh what do ya want")
}
}
void MainWindow::createLinks()
{
pvDebug(2,"creating links...");
ipkg->createLinks( settings->destinationurl->text() );
}
void MainWindow::removeLinks()
{
pvDebug(2,"removing links...");
ipkg->removeLinks( settings->destinationurl->text() );
}
void MainWindow::remotePackageQuery()
{
packageListSearch.query( searchEdit->text() );
packageListSearch.update();
displayList();
}
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp
index 1610a37..1b4812d 100644
--- a/noncore/unsupported/oipkg/packagelistitem.cpp
+++ b/noncore/unsupported/oipkg/packagelistitem.cpp
@@ -166,75 +166,75 @@ QString PackageListItem::key( int column, bool ascending ) const
}
}
void PackageListItem::setOn( bool b )
{
QCheckListItem::setOn( b );
package->toggleProcess();
package->setLink( settings->createLinks() );
displayDetails();
}
void PackageListItem::displayDetails()
{
QString sod;
sod += package->sizeUnits().isEmpty()?QString(""):QString(package->sizeUnits());
//sod += QString(package->dest().isEmpty()?"":QObject::tr(" on ")+package->dest());
sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest());
sod = sod.isEmpty()?QString(""):QString(" ("+sod+")");
setText(0, package->name()+sod );
nameItem->setText( 0, QObject::tr("Name: ")+package->name());
linkItem->setText( 0, QObject::tr("Link: ")+(package->link()?QObject::tr("Yes"):QObject::tr("No")));
destItem->setText( 0, QObject::tr("Destination: ")+package->dest() );
statusItem->setText( 0, QObject::tr("Status: ")+package->status() );
repaint();
}
QPopupMenu* PackageListItem::getPopupMenu()
{
popupMenu->clear();
destsMenu->clear();
QAction *popupAction;
qDebug("PackageListItem::showPopup ");
if (!package->installed()){
popupMenu->insertItem( QObject::tr("Install to"), destsMenu );
QStringList dests = settings->getDestinationNames();
QString ad = settings->getDestinationName();
for (uint i = 0; i < dests.count(); i++ )
{
popupAction = new QAction( dests[i], QString::null, 0, popupMenu, 0 );
popupAction->addTo( destsMenu );
if ( dests[i] == ad && getPackage()->toInstall() )
{
popupAction->setToggleAction( true );
popupAction->setOn(true);
}
}
- connect( destsMenu, SIGNAL( activated( int ) ),
- this, SLOT( menuAction( int ) ) );
+ connect( destsMenu, SIGNAL( activated(int) ),
+ this, SLOT( menuAction(int) ) );
popupMenu->popup( QCursor::pos() );
}else{
popupMenu->insertItem( QObject::tr("Remove"));
- connect( popupMenu, SIGNAL( activated( int ) ),
- this, SLOT( menuAction( int ) ) );
+ connect( popupMenu, SIGNAL( activated(int) ),
+ this, SLOT( menuAction(int) ) );
popupMenu->popup( QCursor::pos() );
}
return popupMenu;
}
void PackageListItem::menuAction( int i )
{
if (!package->installed()){
package->setDest( destsMenu->text(i) );
package->setLink( settings->createLinks() );
}
package->setOn();
displayDetails();
}
//void PackageListItem::toggleProcess()
//{
// package->toggleProcess() ;
// displayDetails();
//}
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp
index 3c7435d..98ebf88 100644
--- a/noncore/unsupported/oipkg/packagelistview.cpp
+++ b/noncore/unsupported/oipkg/packagelistview.cpp
@@ -1,81 +1,81 @@
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
#include "packagelistview.h"
#include <qpopupmenu.h>
#include <qaction.h>
#include "listviewitemoipkg.h"
#include "packagelistitem.h"
#include "pksettings.h"
PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettings *s)
: QListView(p,n)
{
settings = s;
popupTimer = new QTimer( this );
setSelectionMode(QListView::NoSelection);
addColumn( tr("Package") );
setRootIsDecorated( true );
connect( popupTimer, SIGNAL(timeout()),
this, SLOT(showPopup()) );
- connect( this, SIGNAL( pressed( QListViewItem* ) ),
- this, SLOT( setCurrent( QListViewItem* ) ) );
- connect( this, SIGNAL( clicked( QListViewItem* ) ),
- this, SLOT( stopTimer( QListViewItem* ) ) );
+ connect( this, SIGNAL( pressed(QListViewItem*) ),
+ this, SLOT( setCurrent(QListViewItem*) ) );
+ connect( this, SIGNAL( clicked(QListViewItem*) ),
+ this, SLOT( stopTimer(QListViewItem*) ) );
}
//PackageListView::~PackageListView()
//{
//}
void PackageListView::setCurrent( QListViewItem* p )
{
qDebug("PackageListView::setCurrent ");
activeItem = (ListViewItemOipkg*)p;
if ( activeItem != 0 ) popupTimer->start( 750, true );
// if ( activeItem->getType() != ListViewItemOipkg::Package ){
// qDebug("PackageListView::setCurrent !p ");
// activePackage = 0;
// activePackageListItem = 0;
// qDebug("PackageListView::setCurrent returning ");
// return;
// };
// activePackageListItem = (PackageListItem*)p;
// activePackage = activePackageListItem->getPackage();
// if (activePackage == 0 )
// {
// qDebug("PackageListView::setCurrent if (!activePackage)");
// return;
// }
qDebug("PackageListView::setCurrent popupTimer->start");
}
void PackageListView::showPopup()
{
qDebug("PackageListView::showPopup");
QPopupMenu *popup = activeItem->getPopupMenu();
if (popup == 0) return;
popup->popup( QCursor::pos() );
qDebug("PackageListView::showPopup");
}
void PackageListView::stopTimer( QListViewItem* )
{
popupTimer->stop();
}
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp
index 063b018..aac011e 100644
--- a/noncore/unsupported/oipkg/pksettings.cpp
+++ b/noncore/unsupported/oipkg/pksettings.cpp
@@ -1,97 +1,97 @@
#include "pksettings.h"
#include <qpe/process.h>
#include <qpe/resource.h>
#include <qpe/stringutil.h>
#include <qpe/qpeapplication.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/applnk.h>
#include <qpe/config.h>
#include <qprogressbar.h>
#include <qcombobox.h>
#include <qdict.h>
#include <qfile.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qlistview.h>
#include <qlistbox.h>
#include <qcheckbox.h>
#include <qmessagebox.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <qregexp.h>
#include <qstring.h>
#include <qobject.h>
#include <qtextstream.h>
#include <qtextview.h>
#include <qtoolbutton.h>
#include <qtabwidget.h>
#include <stdlib.h>
#include <unistd.h>
#include "debug.h"
//#include "utils.h"
PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* name, WFlags fl )
: PackageManagerSettingsBase( parent, name, fl )
{
connect( newserver, SIGNAL(clicked()), this, SLOT(newServer()) );
connect( removeserver, SIGNAL(clicked()), this, SLOT(removeServer()) );
connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
connect( newdestination, SIGNAL(clicked()), this, SLOT(newDestination()) );
connect( removedestination, SIGNAL(clicked()), this, SLOT(removeDestination()) );
connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
// connect( CheckBoxLink, SIGNAL(toggled(bool)),
// activeLinkDestination, SLOT(setEnabled(bool)) );
// connect( settingName, SIGNAL(activated(int)), this, SLOT(installationSettingChange(int)) );
-// connect( settingName, SIGNAL(textChanged(const QString &)), this, SLOT(installationSettingSetName(const QString &)) );
+// connect( settingName, SIGNAL(textChanged(const QString&)), this, SLOT(installationSettingSetName(const QString&)) );
// connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) );
// connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) );
// connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) );
servername->setEnabled(FALSE);
serverurl->setEnabled(FALSE);
serverurlDic.setAutoDelete(TRUE);
destinationname->setEnabled(FALSE);
destinationurl->setEnabled(FALSE);
destinationurlDic.setAutoDelete(TRUE);
readSettings();
activeLinkDestination->hide();
serverChanged = false;
// get rid of setups
// Settings->hide();
// settingName->hide();
// newsetting->hide();
// renamesetting->hide();
// removesetting->hide();
}
PackageManagerSettings::~PackageManagerSettings()
{
}
void PackageManagerSettings::newServer()
{
int i = servers->count();
if ( servername->isEnabled() || serverurl->text().isEmpty() ) {
serverurlDic.insert(i,new QString("http://"));
servers->insertItem(tr("New"));
activeServers->insertItem(tr("New"));
} else {
// allows one-level undo
serverurlDic.insert(i,new QString(serverurl->text()));
servers->insertItem(servername->text());
activeServers->insertItem(servername->text());
}
changed = true;
servers->setSelected(i,TRUE);
editServer(i);
changed = true;
}
void PackageManagerSettings::newDestination()
{
int i = destinations->count();
diff --git a/noncore/unsupported/qpdf/qbusybar.cpp b/noncore/unsupported/qpdf/qbusybar.cpp
index ce7ab8e..e942f06 100644
--- a/noncore/unsupported/qpdf/qbusybar.cpp
+++ b/noncore/unsupported/qpdf/qbusybar.cpp
@@ -1,68 +1,68 @@
#include <qapplication.h>
#include <qtimer.h>
#include <qpainter.h>
#include "qbusybar.h"
QBusyBar::QBusyBar ( QWidget *parent, const char *name, int flags ) : QWidget ( parent, name, flags | WRepaintNoErase )
{
m_busy = 0;
m_div = 0;
m_pos = 0;
m_fade = 0;
m_fadecols = 0;
m_speed = 500;
m_timer = new QTimer ( this );
- connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( slotTimeout ( )));
+ connect ( m_timer, SIGNAL( timeout()), this, SLOT( slotTimeout()));
setParameters ( 12, 8, 200 );
}
void QBusyBar::setParameters ( int d, int s, int v )
{
bool running = m_timer-> isActive ( );
if ( running )
m_timer-> stop ( );
m_div = d;
m_speed = v;
delete [] m_fadecols;
m_fade = s;
m_fadecols = new QColor [m_fade];
int rt, gt, bt;
int rf, gf, bf;
colorGroup ( ). color ( QColorGroup::Highlight ). rgb ( &rf, &gf, &bf );
colorGroup ( ). color ( QColorGroup::Background ). rgb ( &rt, &gt, &bt );
for ( int i = 0; i < s; i++ )
m_fadecols [i]. setRgb ( rf + ( rt - rf ) * i / s, gf + ( gt - gf ) * i / s, bf + ( bt - bf ) * i / s );
if ( running ) {
m_pos = 0;
m_timer-> start ( m_speed );
}
}
QBusyBar::~QBusyBar ( )
{
delete [] m_fadecols;
}
bool QBusyBar::isBusy ( ) const
{
return m_busy;
}
void QBusyBar::beginBusy ( )
{
setBusy ( true );
}
diff --git a/noncore/unsupported/qpdf/qpdf.cpp b/noncore/unsupported/qpdf/qpdf.cpp
index 5cdcccf..75e86d0 100644
--- a/noncore/unsupported/qpdf/qpdf.cpp
+++ b/noncore/unsupported/qpdf/qpdf.cpp
@@ -40,155 +40,155 @@
#ifdef QPDF_QPE_ONLY
#include <qpe/fileselector.h>
#else
#include <opie/ofileselector.h>
#endif
int main ( int argc, char **argv )
{
QPEApplication app ( argc, argv );
// read config file
globalParams = new GlobalParams ( "" );
globalParams-> setErrQuiet ( true );
QPdfDlg *dlg = new QPdfDlg ( );
app. showMainDocumentWidget ( dlg );
if (( app. argc ( ) == 3 ) && ( app. argv ( ) [1] == QCString ( "-f" )))
dlg-> openFile ( app. argv ( ) [2] );
return app. exec ( );
}
QPdfDlg::QPdfDlg ( ) : QMainWindow ( )
{
setCaption ( tr( "QPdf" ));
setIcon ( Resource::loadPixmap ( "qpdf_icon" ));
m_busy = false;
m_doc = 0;
m_pages = 0;
m_zoom = 72;
m_currentpage = 0;
m_fullscreen = false;
m_renderok = false;
setToolBarsMovable ( false );
m_stack = new QWidgetStack ( this );
m_stack-> setSizePolicy ( QSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding ));
setCentralWidget ( m_stack );
m_outdev = new QPEOutputDev ( m_stack );
- connect ( m_outdev, SIGNAL( selectionChanged ( const QRect & )), this, SLOT( copyToClipboard ( const QRect & )));
+ connect ( m_outdev, SIGNAL( selectionChanged(const QRect&)), this, SLOT( copyToClipboard(const QRect&)));
#ifdef QPDF_QPE_ONLY
m_filesel = new FileSelector ( "application/pdf", m_stack, "fs", false, true );
#else
m_filesel = new OFileSelector ( "application/pdf", m_stack, "fs", false, true );
#endif
- connect ( m_filesel, SIGNAL( closeMe ( )), this, SLOT( closeFileSelector ( )));
- connect ( m_filesel, SIGNAL( fileSelected ( const DocLnk & )), this, SLOT( openFile ( const DocLnk & )));
+ connect ( m_filesel, SIGNAL( closeMe()), this, SLOT( closeFileSelector()));
+ connect ( m_filesel, SIGNAL( fileSelected(const DocLnk&)), this, SLOT( openFile(const DocLnk&)));
m_tb_menu = new QToolBar ( this );
m_tb_menu-> setHorizontalStretchable ( true );
QMenuBar *mb = new QMenuBar ( m_tb_menu );
m_pm_zoom = new QPopupMenu ( mb );
m_pm_zoom-> setCheckable ( true );
mb-> insertItem ( tr( "Zoom" ), m_pm_zoom );
m_pm_zoom-> insertItem ( tr( "Fit to width" ), 1 );
m_pm_zoom-> insertItem ( tr( "Fit to page" ), 2 );
m_pm_zoom-> insertSeparator ( );
m_pm_zoom-> insertItem ( tr( "50%" ), 50 );
m_pm_zoom-> insertItem ( tr( "75%" ), 75 );
m_pm_zoom-> insertItem ( tr( "100%" ), 100 );
m_pm_zoom-> insertItem ( tr( "125%" ), 125 );
m_pm_zoom-> insertItem ( tr( "150%" ), 150 );
m_pm_zoom-> insertItem ( tr( "200%" ), 200 );
- connect ( m_pm_zoom, SIGNAL( activated ( int )), this, SLOT( setZoom ( int )));
+ connect ( m_pm_zoom, SIGNAL( activated(int)), this, SLOT( setZoom(int)));
m_tb_tool = new QToolBar ( this );
- new QToolButton ( Resource::loadIconSet ( "fileopen" ), tr( "Open..." ), QString::null, this, SLOT( openFile ( )), m_tb_tool, "open" );
+ new QToolButton ( Resource::loadIconSet ( "fileopen" ), tr( "Open..." ), QString::null, this, SLOT( openFile()), m_tb_tool, "open" );
m_tb_tool-> addSeparator ( );
- m_to_find = new QToolButton ( Resource::loadIconSet ( "find" ), tr( "Find..." ), QString::null, this, SLOT( toggleFindBar ( )), m_tb_tool, "find" );
+ m_to_find = new QToolButton ( Resource::loadIconSet ( "find" ), tr( "Find..." ), QString::null, this, SLOT( toggleFindBar()), m_tb_tool, "find" );
m_to_find-> setToggleButton ( true );
m_tb_tool-> addSeparator ( );
- m_to_full = new QToolButton ( Resource::loadIconSet ( "fullscreen" ), tr( "Fullscreen" ), QString::null, this, SLOT( toggleFullscreen ( )), m_tb_tool, "fullscreen" );
+ m_to_full = new QToolButton ( Resource::loadIconSet ( "fullscreen" ), tr( "Fullscreen" ), QString::null, this, SLOT( toggleFullscreen()), m_tb_tool, "fullscreen" );
m_to_full-> setToggleButton ( true );
m_tb_tool-> addSeparator ( );
- new QToolButton ( Resource::loadIconSet ( "fastback" ), tr( "First page" ), QString::null, this, SLOT( firstPage ( )), m_tb_tool, "first" );
- new QToolButton ( Resource::loadIconSet ( "back" ), tr( "Previous page" ), QString::null, this, SLOT( prevPage ( )), m_tb_tool, "prev" );
- new QToolButton ( Resource::loadIconSet ( "down" ), tr( "Goto page..." ), QString::null, this, SLOT( gotoPageDialog ( )), m_tb_tool, "goto" );
- new QToolButton ( Resource::loadIconSet ( "forward" ), tr( "Next page" ), QString::null, this, SLOT( nextPage ( )), m_tb_tool, "next" );
- new QToolButton ( Resource::loadIconSet ( "fastforward" ), tr( "Last page" ), QString::null, this, SLOT( lastPage ( )), m_tb_tool, "last" );
+ new QToolButton ( Resource::loadIconSet ( "fastback" ), tr( "First page" ), QString::null, this, SLOT( firstPage()), m_tb_tool, "first" );
+ new QToolButton ( Resource::loadIconSet ( "back" ), tr( "Previous page" ), QString::null, this, SLOT( prevPage()), m_tb_tool, "prev" );
+ new QToolButton ( Resource::loadIconSet ( "down" ), tr( "Goto page..." ), QString::null, this, SLOT( gotoPageDialog()), m_tb_tool, "goto" );
+ new QToolButton ( Resource::loadIconSet ( "forward" ), tr( "Next page" ), QString::null, this, SLOT( nextPage()), m_tb_tool, "next" );
+ new QToolButton ( Resource::loadIconSet ( "fastforward" ), tr( "Last page" ), QString::null, this, SLOT( lastPage()), m_tb_tool, "last" );
m_tb_find = new QToolBar ( this );
addToolBar ( m_tb_find, "Search", QMainWindow::Top, true );
m_tb_find-> setHorizontalStretchable ( true );
m_tb_find-> hide ( );
m_findedit = new QLineEdit ( m_tb_find, "findedit" );
m_tb_find-> setStretchableWidget ( m_findedit );
- connect ( m_findedit, SIGNAL( textChanged ( const QString & )), this, SLOT( findText ( const QString & )));
+ connect ( m_findedit, SIGNAL( textChanged(const QString&)), this, SLOT( findText(const QString&)));
- new QToolButton ( Resource::loadIconSet ( "next" ), tr( "Next" ), QString::null, this, SLOT( findText ( )), m_tb_find, "findnext" );
+ new QToolButton ( Resource::loadIconSet ( "next" ), tr( "Next" ), QString::null, this, SLOT( findText()), m_tb_find, "findnext" );
openFile ( );
}
QPdfDlg::~QPdfDlg ( )
{
delete m_doc;
}
// vv Fullscreen handling (for broken QT-lib) [David Hedbor, www.eongames.com]
void QPdfDlg::resizeEvent ( QResizeEvent * )
{
if ( m_fullscreen && ( size ( ) != qApp-> desktop ( )-> size ( )))
setFullscreen ( true );
}
void QPdfDlg::focusInEvent ( QFocusEvent * )
{
if ( m_fullscreen )
setFullscreen ( true );
}
void QPdfDlg::toggleFullscreen ( )
{
if ( m_to_full-> isOn ( ) == m_fullscreen )
m_to_full-> setOn ( !m_fullscreen );
m_fullscreen = !m_fullscreen;
setFullscreen ( m_fullscreen );
}
void QPdfDlg::setFullscreen ( bool b )
{
static QSize normalsize;
if ( b ) {
if ( !normalsize. isValid ( ))
normalsize = size ( );
setFixedSize ( qApp-> desktop ( )-> size ( ));
showNormal ( );
reparent ( 0, WStyle_Customize | WStyle_NoBorder, QPoint ( 0, 0 ));
showFullScreen ( );
}
else {
showNormal ( );
reparent ( 0, 0, QPoint ( 0, 0 ));
@@ -450,91 +450,91 @@ void QPdfDlg::renderPage ( )
m_renderok = true;
}
}
void QPdfDlg::closeFileSelector ( )
{
m_tb_menu-> show ( );
m_tb_tool-> show ( );
m_stack-> raiseWidget ( m_outdev );
}
void QPdfDlg::openFile ( )
{
m_tb_menu-> hide ( );
m_tb_tool-> hide ( );
m_tb_find-> hide ( );
m_stack-> raiseWidget ( m_filesel );
}
void QPdfDlg::openFile ( const QString &f )
{
DocLnk nf;
nf. setType ( "application/pdf" );
nf. setFile ( f );
QFileInfo fi ( f );
nf. setName ( fi. baseName ( ));
openFile ( nf );
}
void QPdfDlg::openFile ( const DocLnk &f )
{
QString fn = f. file ( );
QFileInfo fi ( fn );
if ( fi. exists ( )) {
delete m_doc;
m_doc = new PDFDoc ( new GString ( fn. local8Bit ( )), 0, 0 );
if ( m_doc-> isOk ( )) {
m_currentdoc = f. name ( );
int sep = m_currentdoc. findRev ( '/' );
if ( sep > 0 )
m_currentdoc = m_currentdoc. mid ( sep + 1 );
m_pages = m_doc-> getNumPages ( );
m_currentpage = 0;
- QTimer::singleShot ( 0, this, SLOT( delayedInit ( )));
+ QTimer::singleShot ( 0, this, SLOT( delayedInit()));
}
else {
delete m_doc;
m_doc = 0;
m_currentdoc = QString::null;
}
updateCaption ( );
}
else
QMessageBox::warning ( this, tr( "Error" ), tr( "File does not exist!" ));
}
void QPdfDlg::setDocument ( const QString &f )
{
if ( f. find ( ".desktop", 0, true ) == -1 )
openFile ( f );
else
openFile ( DocLnk ( f ));
closeFileSelector ( );
}
void QPdfDlg::delayedInit ( )
{
closeFileSelector ( );
m_currentpage = 0;
m_zoom = 0;
m_renderok = false;
setZoom ( 100 );
gotoPage ( 1 );
m_renderok = true;
renderPage ( );
m_outdev-> setFocus ( );
}