summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp6
-rw-r--r--kaddressbook/mainembedded.cpp122
-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.cpp7
7 files changed, 32 insertions, 125 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 1074a62..c4382d6 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -343,96 +343,98 @@ void KABCore::receive( const QCString& cmsg, const QByteArray& data )
QString fileName;
stream >> fileName;
recieve( fileName );
return;
}
}
void KABCore::toggleBeamReceive( )
{
if ( mBRdisabled )
return;
#ifndef DESKTOP_VERSION
if ( infrared ) {
qDebug("AB disable BeamReceive ");
delete infrared;
infrared = 0;
mActionBR->setChecked(false);
return;
}
qDebug("AB enable BeamReceive ");
mActionBR->setChecked(true);
infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ;
QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& )));
#endif
}
void KABCore::disableBR(bool b)
{
#ifndef DESKTOP_VERSION
if ( b ) {
if ( infrared ) {
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;
mActionDetails->setChecked( state );
setDetailsVisible( state );
state = KABPrefs::instance()->mJumpButtonBarVisible;
mActionJumpBar->setChecked( state );
setJumpButtonBarVisible( state );
/*US
QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter;
if ( splitterSize.count() == 0 ) {
splitterSize.append( width() / 2 );
splitterSize.append( width() / 2 );
}
mMiniSplitter->setSizes( splitterSize );
if ( mExtensionBarSplitter ) {
splitterSize = KABPrefs::instance()->mExtensionsSplitter;
if ( splitterSize.count() == 0 ) {
splitterSize.append( width() / 2 );
splitterSize.append( width() / 2 );
}
mExtensionBarSplitter->setSizes( splitterSize );
}
*/
mViewManager->restoreSettings();
mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField );
mExtensionManager->restoreSettings();
#ifdef DESKTOP_VERSION
int wid = width();
if ( wid < 10 )
wid = 400;
#else
@@ -2834,70 +2836,72 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource)
mViewManager->refreshView();
disableBR( false );
return syncOK;
}
void KABCore::message( QString m )
{
topLevelWidget()->setCaption( m );
mMessageTimer->start( 15000, true );
}
bool KABCore::syncPhone()
{
QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
QString fileName = getPhoneFile();
if ( !PhoneAccess::readFromPhone( fileName) ) {
message(i18n("Phone access failed!"));
return false;
}
AddressBook abLocal( fileName,"syncContact");
bool syncOK = false;
{
abLocal.importFromFile( fileName );
qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1());
mGlobalSyncMode = SYNC_MODE_EXTERNAL;
abLocal.preparePhoneSync( mCurrentSyncDevice, true );
abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
if ( syncOK ) {
if ( syncManager->mWriteBackFile ) {
abLocal.removeSyncAddressees( true );
abLocal.saveABphone( fileName );
abLocal.findNewExtIds( fileName, mCurrentSyncDevice );
//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
}
void KABCore::setCaptionBack()
{
mMessageTimer->stop();
topLevelWidget()->setCaption( i18n("KAddressbook/Pi") );
}
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index a2ff1e9..40089a1 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -1,215 +1,95 @@
#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 );
QApplication::setStyle( new QPlatinumStyle ());
QString hdir = QDir::homeDirPath();
// there is a bug when creating dirs for WIN 98
// it is difficult to fix, because we have no WIN 98 runnung
// such that we try it to create the dirs at startup here
if ( hdir == "C:\\" ) { // win 98 or ME
QDir app_dir;
if ( !app_dir.exists("C:\\kdepim") )
app_dir.mkdir ("C:\\kdepim");
if ( !app_dir.exists("C:\\kdepim\\apps") )
app_dir.mkdir ("C:\\kdepim\\apps");
if ( !app_dir.exists("C:\\kdepim\\config") )
app_dir.mkdir ("C:\\kdepim\\config");
if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") )
app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook");
}
#endif
bool exitHelp = false;
if ( argc > 1 ) {
QString command = argv[1];
if ( command == "-help" ){
printf("KA/E command line commands:\n");
printf(" no command: Start KA/E in usual way\n");
printf(" -help: This output\n");
printf(" KA/E is exiting now. Bye!\n");
exitHelp = true;
}
}
if ( ! exitHelp ) {
KGlobal::setAppName( "kaddressbook" );
#ifndef DESKTOP_VERSION
if ( QApplication::desktop()->width() > 320 )
KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/");
else
KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
#else
QString fileName ;
fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
QApplication::addLibraryPath ( qApp->applicationDirPath () );
#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
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
@@ -123,122 +123,124 @@ void DynamicTip::maybeTip( const QPoint &pos )
else
i = QMAX( a, i-1 );
}
if ( notes[i] == '\n' || doBreak ) {
s += notes.mid( a, i - a + (doBreak?1:0) ) +"\n";
a = i + 1;
lastSpace = a;
linew = 0;
}
if ( notes[i].isSpace() ) {
lastSpace = i;
lastw = linew;
}
if ( lastSpace <= a ) {
lastw = linew;
}
++i;
}
}
tip( r, s );
}
else
hide();
ishidden = !ishidden;
}
///////////////////////////
// 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() );
p->drawLine( 0, height() - 1, width, height() - 1 );
}
}
ContactListView *ContactListViewItem::parent()
{
return parentListView;
}
void ContactListViewItem::refresh()
{
// Update our addressee, since it may have changed else were
mAddressee = mDocument->findByUid(mAddressee.uid());
if (mAddressee.isEmpty())
return;
int i = 0;
KABC::Field::List::ConstIterator it;
for( it = mFields.begin(); it != mFields.end(); ++it ) {
setText( i++, (*it)->value( mAddressee ) );
}
}
///////////////////////////////
// ContactListView
ContactListView::ContactListView(KAddressBookTableView *view,
KABC::AddressBook* /* doc */,
QWidget *parent,
const char *name )
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index e938e4e..1fcc977 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -450,108 +450,109 @@ void KOEventViewer::formatAttendees(Incidence *event)
mText += "<a href=\"uid:" + o.uid() + "\">";
mText += o.formattedName();
mText += "</a>\n";
} else {
mText += "<li>";
mText.append(a->email());
mText += "\n";
}
} else {
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
}
#else //DESKTOP_VERSION
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
#endif //DESKTOP_VERSION
#else
//qDebug("nokabc ");
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
#endif
if (!a->email().isEmpty()) {
if (iconPath) {
mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">";
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;
}
void KOEventViewer::setTodo(Todo *event, bool clearV )
{
if ( clearV )
clearEvents();
if ( mSyncMode ) {
if ( clearV )
appendTodo(event,1 );
else
appendTodo(event,2);
} else
appendTodo(event);
}
void KOEventViewer::setJournal(Journal *event, bool clearV )
{
if ( clearV )
clearEvents();
if ( mSyncMode ) {
if ( clearV )
appendJournal(event, 1);
else
appendJournal(event, 2);
} else
appendJournal(event);
}
void KOEventViewer::setEvent(Event *event)
{
clearEvents();
if ( mSyncMode )
appendEvent(event, 1);
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 9a3ba73..bafd349 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -1,82 +1,83 @@
/*
This file is part of KOrganizer.
Copyright (c) 1999 Preston Brown
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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
#include <qapplication.h>
#endif
#ifndef KORG_NOPRINTER
#include "calprinter.h"
#endif
#include "koglobals.h"
#include "koprefs.h"
#include "kfiledialog.h"
#include "kolistview.h"
ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date )
{
mItem = item;
mDate = date;
}
ListItemVisitor::~ListItemVisitor()
{
}
bool ListItemVisitor::visit(Event *e)
{
bool ok = false;
QString start, end;
if ( e->doesRecur() ) {
QDate d = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date();
if ( ok ) {
int days = e->dtStart().date().daysTo(e->dtEnd().date() );
start = KGlobal::locale()->formatDate(d,true);
@@ -120,106 +121,111 @@ bool ListItemVisitor::visit(Todo *t)
if (t->hasStartDate()) {
mItem->setText(1,t->dtStartDateStr());
if (t->doesFloat()) {
mItem->setText(2,"---");
} else {
mItem->setText(2,t->dtStartTimeStr());
}
} else {
mItem->setText(1,"---");
mItem->setText(2,"---");
}
mItem->setText(3,"---");
mItem->setText(4,"---");
mItem->setText(5,"---");
mItem->setText(6,"---");
if (t->hasDueDate()) {
mItem->setText(7,t->dtDueDateStr());
if (t->doesFloat()) {
mItem->setText(8,"---");
} else {
mItem->setText(8,t->dtDueTimeStr());
}
} else {
mItem->setText(7,"---");
mItem->setText(8,"---");
}
mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No"));
mItem->setText(10,t->categoriesStr());
QString key;
QDate d;
if (t->hasDueDate()) {
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);
mListView->addColumn(i18n("Summary"));
mListView->addColumn(i18n("Start Date"));
mListView->addColumn(i18n("Start Time"));
mListView->addColumn(i18n("End Date"));
mListView->addColumn(i18n("End Time"));
mListView->addColumn(i18n("Alarm")); // alarm set?
mListView->addColumn(i18n("Recurs")); // recurs?
mListView->addColumn(i18n("Due Date"));
mListView->addColumn(i18n("Due Time"));
mListView->addColumn(i18n("Cancelled"));
mListView->addColumn(i18n("Categories"));
mListView->setColumnAlignment(0,AlignLeft);
mListView->setColumnAlignment(1,AlignLeft);
mListView->setColumnAlignment(2,AlignHCenter);
mListView->setColumnAlignment(3,AlignLeft);
mListView->setColumnAlignment(4,AlignHCenter);
mListView->setColumnAlignment(5,AlignLeft);
mListView->setColumnAlignment(6,AlignLeft);
mListView->setColumnAlignment(7,AlignLeft);
mListView->setColumnAlignment(8,AlignLeft);
mListView->setColumnAlignment(9,AlignLeft);
mListView->setColumnAlignment(10,AlignLeft);
int iii = 0;
for ( iii = 0; iii< 10 ; ++iii )
mListView->setColumnWidthMode( iii, QListView::Manual );
QBoxLayout *layoutTop = new QVBoxLayout(this);
layoutTop->addWidget(mListView);
mListView->setFont ( KOPrefs::instance()->mListViewFont );
mPopupMenu = eventPopup();
@@ -644,101 +650,106 @@ void KOListView::showDates(bool show)
} else {
mListView->setColumnWidth(1, oldColWidth1);
mListView->setColumnWidth(3, oldColWidth3);
}
mListView->repaint();
}
void KOListView::printPreview(CalPrinter *calPrinter, const QDate &fd,
const QDate &td)
{
#ifndef KORG_NOPRINTER
calPrinter->preview(CalPrinter::Day, fd, td);
#endif
}
void KOListView::showDates()
{
showDates(true);
}
void KOListView::hideDates()
{
showDates(false);
}
void KOListView::updateView()
{
mListView->setFocus();
if ( mListView->firstChild () )
mListView->setCurrentItem( mListView->firstChild () );
}
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();
}
}
void KOListView::addTodos(QPtrList<Todo> eventList)
{
Todo *ev;
for(ev = eventList.first(); ev; ev = eventList.next()) {
addIncidence(ev);
}
if ( !mListView->currentItem() ){
updateView();
}
}
void KOListView::addJournals(QPtrList<Journal> eventList)
{
Journal *ev;
for(ev = eventList.first(); ev; ev = eventList.next()) {
addIncidence(ev);
}
if ( !mListView->currentItem() ){
updateView();
}
}
void KOListView::addIncidence(Incidence *incidence)
{
if ( mUidDict.find( incidence->uid() ) ) return;
// mListView->setFont ( KOPrefs::instance()->mListViewFont );
mUidDict.insert( incidence->uid(), incidence );
KOListViewItem *item = new KOListViewItem( incidence, mListView );
ListItemVisitor v(item, mStartDate );
if (incidence->accept(v)) return;
else delete item;
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index c8a55d2..ca53828 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -1,104 +1,106 @@
#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();
// there is a bug when creating dirs for WIN 98
// it is difficult to fix, because we have no WIN 98 runnung
// such that we try it to create the dirs at startup here
if ( hdir == "C:\\" ) { // win 98 or ME
QDir app_dir;
if ( !app_dir.exists("C:\\kdepim") )
app_dir.mkdir ("C:\\kdepim");
if ( !app_dir.exists("C:\\kdepim\\apps") )
app_dir.mkdir ("C:\\kdepim\\apps");
if ( !app_dir.exists("C:\\kdepim\\config") )
app_dir.mkdir ("C:\\kdepim\\config");
if ( !app_dir.exists("C:\\kdepim\\apps\\korganizer") )
app_dir.mkdir ("C:\\kdepim\\apps\\korganizer");
}
#endif
bool exitHelp = false;
if ( argc > 1 ) {
QString command = argv[1];
if ( command == "-help" ){
printf("KO/Pi command line commands:\n");
printf(" no command: Start KO/Pi in usual way\n");
printf(" -help: This output\n");
printf("Next Option: Open or Show after start:\n");
printf(" -newTodo: New Todo dialog\n");
printf(" -newEvent: New Event dialog\n");
printf(" -showList: List view\n");
printf(" -showDay: Day view\n");
printf(" -showWWeek: Work Week view\n");
printf(" -showWeek: Week view\n");
printf(" -showTodo: Todo view\n");
printf(" -showJournal: Journal view\n");
printf(" -showKO: Next Days view\n");
printf(" -showWNext: What's Next view\n");
printf(" -showNextXView: Next X View\n");
printf(" -new[Y] and -show[X] may be used togehther\n");
printf(" KO/Pi is exiting now. Bye!\n");
exitHelp = true;
}
}
if ( ! exitHelp ) {
KGlobal::setAppName( "korganizer" );
QString fileName ;
#ifndef DESKTOP_VERSION
fileName = getenv("QPEDIR");
KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/");
#else
fileName = qApp->applicationDirPath () + "/kdepim/korganizer/";
KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
#endif
KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer")));
MainWindow m;
#ifndef DESKTOP_VERSION
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
@@ -1,117 +1,124 @@
/*
This file is part of PwManager/Platform independent.
Copyright (c) 2004 Ulf Schenk
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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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.
$Id$
*/
#include "getmasterpwwnd_emb.h"
#include "klocale.h"
/*
#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
+ 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 );
QPushButton* p6 = new QPushButton( i18n("6"), numberBox );
numberLayout->addWidget( p6, 1, 2 );
QPushButton* p7 = new QPushButton( i18n("7"), numberBox );
numberLayout->addWidget( p7, 2, 0 );
QPushButton* p8 = new QPushButton( i18n("8"), numberBox );
numberLayout->addWidget( p8, 2, 1 );
QPushButton* p9 = new QPushButton( i18n("9"), numberBox );
numberLayout->addWidget( p9, 2, 2 );
QPushButton* clear = new QPushButton( i18n("x"), numberBox );
numberLayout->addWidget( clear, 3, 0 );
QPushButton* p0 = new QPushButton( i18n("0"), numberBox );
numberLayout->addWidget( p0, 3, 1 );
QPushButton* backspace = new QPushButton( i18n("-"), numberBox );
numberLayout->addWidget( backspace, 3, 2 );
pageLayout->addWidget(numberBox);
#ifdef DESKTOP_VERSION
resize( sizeHint() );
#else
resize( 200,sizeHint().height() );
#endif
connect( p0, SIGNAL( clicked() ), this, SLOT( add0() ) );
connect( p1, SIGNAL( clicked() ), this, SLOT( add1() ) );
connect( p2, SIGNAL( clicked() ), this, SLOT( add2() ) );
connect( p3, SIGNAL( clicked() ), this, SLOT( add3() ) );
connect( p4, SIGNAL( clicked() ), this, SLOT( add4() ) );
connect( p5, SIGNAL( clicked() ), this, SLOT( add5() ) );
connect( p6, SIGNAL( clicked() ), this, SLOT( add6() ) );
connect( p7, SIGNAL( clicked() ), this, SLOT( add7() ) );
connect( p8, SIGNAL( clicked() ), this, SLOT( add8() ) );