summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp6
-rw-r--r--kaddressbook/mainembedded.cpp124
-rw-r--r--kaddressbook/views/contactlistview.cpp2
-rw-r--r--korganizer/koeventviewer.cpp5
-rw-r--r--korganizer/kolistview.cpp13
-rw-r--r--korganizer/main.cpp2
-rw-r--r--pwmanager/pwmanager/getmasterpwwnd_emb.cpp11
7 files changed, 35 insertions, 128 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 1074a62..c4382d6 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -375,32 +375,34 @@ void KABCore::disableBR(bool b)
toggleBeamReceive( );
}
mBRdisabled = true;
} else {
if ( mBRdisabled ) {
mBRdisabled = false;
//toggleBeamReceive( );
}
}
#endif
}
void KABCore::recieve( QString fn )
{
//qDebug("KABCore::recieve ");
int count = mAddressBook->importFromFile( fn, true );
+ if ( count )
+ setModified( true );
mViewManager->refreshView();
message(i18n("%1 contact(s) received!").arg( count ));
topLevelWidget()->showMaximized();
topLevelWidget()->raise();
}
void KABCore::restoreSettings()
{
mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce;
bool state;
if (mMultipleViewsAtOnce)
state = KABPrefs::instance()->mDetailsPageVisible;
else
state = false;
@@ -2866,33 +2868,35 @@ bool KABCore::syncPhone()
//abLocal.preparePhoneSync( mCurrentSyncDevice, false );
abLocal.postExternSync( mAddressBook,mCurrentSyncDevice );
}
}
setModified();
}
if ( syncOK )
mViewManager->refreshView();
return syncOK;
}
void KABCore::getFile( bool success )
{
if ( ! success ) {
message( i18n("Error receiving file. Nothing changed!") );
return;
}
- mAddressBook->importFromFile( sentSyncFile() , false, true );
+ int count = mAddressBook->importFromFile( sentSyncFile() , false, true );
+ if ( count )
+ setModified( true );
message( i18n("Pi-Sync successful!") );
mViewManager->refreshView();
}
void KABCore::syncFileRequest()
{
mAddressBook->export2File( sentSyncFile() );
}
QString KABCore::sentSyncFile()
{
#ifdef DESKTOP_VERSION
return locateLocal( "tmp", "copysyncab.vcf" );
#else
return QString( "/tmp/copysyncab.vcf" );
#endif
}
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index a2ff1e9..40089a1 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -1,27 +1,28 @@
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#include <qcopchannel_qws.h>
#include <stdlib.h>
#else
#include <qapplication.h>
#include <qwindowsstyle.h>
#include <qplatinumstyle.h>
#include <qmainwindow.h>
#endif
+#include <qtextcodec.h>
#include <kstandarddirs.h>
#include <qregexp.h>
#include <kglobal.h>
#include <stdio.h>
#include <qdir.h>
#include "kaddressbookmain.h"
#include "externalapphandler.h"
#include <libkdepim/kpimglobalprefs.h>
int main( int argc, char **argv )
{
#ifndef DESKTOP_VERSION
QPEApplication a( argc, argv );
a.setKeepRunning ();
#else
QApplication a( argc, argv );
@@ -71,145 +72,24 @@ int main( int argc, char **argv )
#endif
KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
KAddressBookMain m ;
//US MainWindow m;
QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
{
KPimGlobalPrefs::instance()->setGlobalConfig();
}
#ifndef DESKTOP_VERSION
a.showMainWidget( &m );
#else
a.setMainWidget( &m );
m.resize (640, 480 );
m.show();
-#endif
+#endif
a.exec();
}
qDebug("KA: Bye! ");
}
-/*
-#include <stdlib.h>
-
-#include <qstring.h>
-
-#include <kabc/stdaddressbook.h>
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
-#include <kcrash.h>
-#include <kdebug.h>
-#include <klocale.h>
-#include <kstartupinfo.h>
-#include <kuniqueapplication.h>
-#include <kwin.h>
-
-#include "kaddressbookmain.h"
-#include "kabcore.h"
-
-extern "C" {
-
-void crashHandler( int )
-{
- KABC::StdAddressBook::handleCrash();
- ::exit( 0 );
-}
-
-}
-
-class KAddressBookApp : public KUniqueApplication {
- public:
- KAddressBookApp() : mMainWin( 0 ) {}
- ~KAddressBookApp() {}
-
- int newInstance();
-
- private:
- KAddressBookMain *mMainWin;
-};
-
-int KAddressBookApp::newInstance()
-{
- if ( isRestored() ) {
- // There can only be one main window
- if ( KMainWindow::canBeRestored( 1 ) ) {
- mMainWin = new KAddressBookMain;
- mMainWin->show();
- mMainWin->restore( 1 );
- }
- } else {
- KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
-
- QCString addrStr = args->getOption( "addr" );
- QCString uidStr = args->getOption( "uid" );
- QString addr;
- QString uid;
- if ( !addrStr.isEmpty() )
- addr = QString::fromLocal8Bit( addrStr );
- if ( !uidStr.isEmpty() )
- uid = QString::fromLocal8Bit( uidStr );
-
-
- if ( args->isSet( "editor-only" ) ) {
- if ( !mMainWin )
- mMainWin = new KAddressBookMain;
- KStartupInfo::appStarted();
- mMainWin->hide();
- } else {
- if ( mMainWin ) {
- mMainWin->show();
- KWin::setActiveWindow( mMainWin->winId() );
- } else {
- mMainWin = new KAddressBookMain;
- mMainWin->show();
- }
- }
- // Can not see why anyone would pass both a uid and an email address, so I'll leave it that two contact editors will show if they do
- if ( !addr.isEmpty() )
- mMainWin->addEmail( addr );
-
- if ( !uid.isEmpty() )
- mMainWin->showContactEditor( uid );
- if ( args->isSet( "new-contact" ) ) {
- mMainWin->newContact();
- }
- }
-
- KCrash::setEmergencySaveFunction( crashHandler );
-
- return 0;
-}
-
-// the dummy argument is required, because KMail apparently sends an empty
-// argument.
-static KCmdLineOptions kmoptions[] =
-{
- { "a", 0 , 0 },
- { "addr <email>", I18N_NOOP( "Shows contact editor with given email address" ), 0 },
- { "uid <uid>", I18N_NOOP( "Shows contact editor with given uid" ), 0 },
- { "editor-only", I18N_NOOP( "Launches in editor only mode" ), 0 },
- { "new-contact", I18N_NOOP( "Launches editor for the new contact" ), 0 },
- { "+[argument]", I18N_NOOP( "dummy argument" ), 0},
- { 0, 0, 0}
-};
-
-int main( int argc, char *argv[] )
-{
- KLocale::setMainCatalogue( "kaddressbook" );
-
- KCmdLineArgs::init( argc, argv, KABCore::createAboutData() );
- KCmdLineArgs::addCmdLineOptions( kmoptions );
- KUniqueApplication::addCmdLineOptions();
-
- if ( !KAddressBookApp::start() )
- exit( 0 );
-
- KAddressBookApp app;
- KGlobal::locale()->insertCatalogue( "libkdepim" );
-
- return app.exec();
-}
-*/
diff --git a/kaddressbook/views/contactlistview.cpp b/kaddressbook/views/contactlistview.cpp
index c74f8cf..5fb4163 100644
--- a/kaddressbook/views/contactlistview.cpp
+++ b/kaddressbook/views/contactlistview.cpp
@@ -155,58 +155,60 @@ void DynamicTip::maybeTip( const QPoint &pos )
///////////////////////////
// ContactListViewItem Methods
ContactListViewItem::ContactListViewItem(const KABC::Addressee &a,
ContactListView *parent,
KABC::AddressBook *doc,
const KABC::Field::List &fields )
: KListViewItem(parent), mAddressee(a), mFields( fields ),
parentListView( parent ), mDocument(doc)
{
refresh();
}
QString ContactListViewItem::key(int column, bool ascending) const
{
+#ifndef DESKTOP_VERSION
int lan = KGlobal::locale()->language();
//qDebug("language %d ", lan);
if ( lan == 1 ) { //GERMAN
QString ret = QListViewItem::key(column, ascending).utf8();
int start = -1;
while ( (start = ret.find( 'ä', start+1)) > 0 ) {
ret.at(start-1) = 'a';
}
start = -1;
while ( (start = ret.find( 'ö', start+1)) > 0 ) {
ret.at(start-1) = 'o';
}
start = -1;
while ( (start = ret.find( 'ü', start+1)) > 0 ) {
ret.at(start-1) = 'o';
}
start = -1;
while ( (start = ret.find( 'ß', start+1)) > 0 ) {
ret.at(start-1) = 's';
}
//qDebug("conv string %s ", ret.latin1());
return ret;
}
else
+#endif
return QListViewItem::key(column, ascending).lower();
}
void ContactListViewItem::paintCell(QPainter * p,
const QColorGroup & cg,
int column,
int width,
int align)
{
KListViewItem::paintCell(p, cg, column, width, align);
if ( !p )
return;
if (parentListView->singleLine()) {
p->setPen( parentListView->alternateColor() );
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index e938e4e..1fcc977 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -482,44 +482,45 @@ void KOEventViewer::formatAttendees(Incidence *event)
mText += "<IMG src=\"" + iconPath + "\">";
mText += "</a>\n";
}
}
if (a->status() != Attendee::NeedsAction )
mText +="[" + a->statusStr() + "] ";
if (a->role() == Attendee::Chair )
mText +="(" + a->roleStr().left(1) + ".)";
}
mText.append("</li></ul>");
}
}
void KOEventViewer::appendJournal(Journal *jour, int mode )
{
bool shortDate = KOPrefs::instance()->mShortDateInViewer;
- if (mode == 0 )
+ if (mode == 0 ) {
addTag("h2",i18n("Journal from: "));
+ }
else {
if ( mode == 1 ) {
addTag("h2",i18n( "Local: " ) +i18n("Journal from: "));
} else {
addTag("h2",i18n( "Remote: " ) +i18n("Journal from: "));
}
- addTag("h3",i18n( "Last modified " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) );
}
topLevelWidget()->setCaption("Journal Viewer");
mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer)));
+ addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) );
if (!jour->description().isEmpty()) {
addTag("p",jour->description());
}
setText(mText);
}
void KOEventViewer::formatReadOnly(Incidence *event)
{
if (event->isReadOnly()) {
addTag("p","<em>(" + i18n("read-only") + ")</em>");
}
}
void KOEventViewer::setSyncMode( bool b )
{
mSyncMode = b;
}
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 9a3ba73..bafd349 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -19,32 +19,33 @@
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qlistview.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qpopupmenu.h>
#include <qprogressbar.h>
#include <qfileinfo.h>
#include <qmessagebox.h>
#include <qdialog.h>
#include <qtextstream.h>
#include <qdir.h>
+#include <qregexp.h>
#include <klocale.h>
#include <kdebug.h>
#include <kiconloader.h>
#include <kglobal.h>
#include <libkcal/calendar.h>
#include <libkcal/calendarlocal.h>
#include <libkcal/icalformat.h>
#include <libkcal/vcalformat.h>
#include <libkcal/recurrence.h>
#include <libkcal/filestorage.h>
#include <libkdepim/categoryselectdialog.h>
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#else
@@ -152,42 +153,47 @@ bool ListItemVisitor::visit(Todo *t)
d = t->dtDue().date();
QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time();
key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute());
mItem->setSortKey(7,key);
}
if ( t->hasStartDate() ) {
d = t->dtStart().date();
QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time();
key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute());
mItem->setSortKey(1,key);
}
return true;
}
bool ListItemVisitor::visit(Journal * j)
{
- mItem->setText(0,i18n("Journal"));
+ QString des = j->description().left(50);
+ des = des.simplifyWhiteSpace ();
+ des.replace (QRegExp ("\\n"),"" );
+ des.replace (QRegExp ("\\r"),"" );
+ mItem->setText(0,i18n("Journal")+": "+des.left(25));
mItem->setText(1,j->dtStartDateStr());
mItem->setText(2,"---");
mItem->setText(3,"---");
mItem->setText(4,"---");
mItem->setText(5,"---");
mItem->setText(6,"---");
mItem->setText(7,j->dtStartDateStr());
mItem->setText(8,"---");
mItem->setText(9,"---");
+ mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) );
QString key;
QDate d = j->dtStart().date();
key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
mItem->setSortKey(1,key);
mItem->setSortKey(7,key);
return true;
}
KOListView::KOListView(Calendar *calendar, QWidget *parent,
const char *name)
: KOEventView(calendar, parent, name)
{
mActiveItem = 0;
mListView = new KOListViewListView(this);
@@ -676,37 +682,42 @@ void KOListView::updateConfig()
{
mListView->setFont ( KOPrefs::instance()->mListViewFont );
updateView();
}
void KOListView::setStartDate(const QDate &start)
{
mStartDate = start;
}
void KOListView::showDates(const QDate &start, const QDate &end)
{
clear();
mStartDate = start;
QDate date = start;
+ QPtrList<Journal> j_list;
while( date <= end ) {
addEvents(calendar()->events(date));
addTodos(calendar()->todos(date));
+ Journal* jo = calendar()->journal(date);
+ if ( jo )
+ j_list.append( jo );
date = date.addDays( 1 );
}
+ addJournals(j_list);
emit incidenceSelected( 0 );
updateView();
}
void KOListView::addEvents(QPtrList<Event> eventList)
{
Event *ev;
for(ev = eventList.first(); ev; ev = eventList.next()) {
addIncidence(ev);
}
if ( !mListView->currentItem() ){
updateView();
}
}
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index c8a55d2..ca53828 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -1,30 +1,31 @@
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#include <qcopchannel_qws.h>
#include <qpe/global.h>
#include <stdlib.h>
#else
#include <qapplication.h>
#include <qstring.h>
#include <qwindowsstyle.h>
#include <qplatinumstyle.h>
#include <qsgistyle.h>
#endif
+#include <qtextcodec.h>
#include <qdir.h>
#include <kstandarddirs.h>
#include <kglobal.h>
#include <stdio.h>
#include "mainwindow.h"
int main( int argc, char **argv )
{
#ifndef DESKTOP_VERSION
QPEApplication a( argc, argv );
a.setKeepRunning ();
#else
QApplication a( argc, argv );
QApplication::setStyle( new QPlatinumStyle ());
QString hdir = QDir::homeDirPath();
@@ -84,21 +85,22 @@ int main( int argc, char **argv )
QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
a.showMainWidget(&m );
#else
a.setMainWidget(&m );
m.show();
//m.resize( 800, 600 );
QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
#endif
if ( argc > 1 ) {
QCString command = argv[1];
if ( argc > 2 )
command += argv[2];
qApp->processEvents();
m.recieve(command, QByteArray() );
}
+
a.exec();
}
qDebug("KO: Bye! ");
}
diff --git a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
index 8b6dfbc..8404c3e 100644
--- a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
+++ b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
@@ -29,57 +29,64 @@ $Id$
/*
#include <qvariant.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
*/
#include <qwidget.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
+#include <qapplication.h>
/*
* Constructs a getMasterPwWnd as a child of 'parent', with the
* name 'name'
*/
getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name)
: KDialogBase( KDialogBase::Plain, i18n( "Master-password" ),
KDialogBase::Ok | KDialogBase::Cancel,
KDialogBase::Ok, parent, name, true )
{
QWidget *page = plainPage();
QVBoxLayout *pageLayout = new QVBoxLayout( page );
pwLineEdit = new QLineEdit( page, "pwLineEdit" );
pwLineEdit->setEchoMode( QLineEdit::Password );
QLabel* textLabel1 = new QLabel( pwLineEdit, i18n("Please enter the master-password:"), page, "textLabel1" );
textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
pageLayout->addWidget(textLabel1);
pageLayout->addWidget(pwLineEdit);
QWidget* numberBox = new QWidget( page );
#ifndef DESKTOP_VERSION
- numberBox->setFixedHeight(150);
- numberBox->setFixedWidth(150);
+ if ( QApplication::desktop()->width() > 320 ) {
+ numberBox->setFixedHeight(250);
+ numberBox->setFixedWidth(200);
+ }
+ else{
+ numberBox->setFixedHeight(150);
+ numberBox->setFixedWidth(150);
+ }
#endif
QGridLayout* numberLayout = new QGridLayout( numberBox, 4, 3 );
numberLayout->setMargin( 0 );
numberLayout->setSpacing( 0 );
QPushButton* p1 = new QPushButton( i18n("1"), numberBox );
numberLayout->addWidget( p1, 0, 0 );
QPushButton* p2 = new QPushButton( i18n("2"), numberBox );
numberLayout->addWidget( p2, 0, 1 );
QPushButton* p3 = new QPushButton( i18n("3"), numberBox );
numberLayout->addWidget( p3, 0, 2 );
QPushButton* p4 = new QPushButton( i18n("4"), numberBox );
numberLayout->addWidget( p4, 1, 0 );
QPushButton* p5 = new QPushButton( i18n("5"), numberBox );
numberLayout->addWidget( p5, 1, 1 );