-rw-r--r-- | kaddressbook/kabcore.cpp | 6 | ||||
-rw-r--r-- | kaddressbook/mainembedded.cpp | 122 | ||||
-rw-r--r-- | kaddressbook/views/contactlistview.cpp | 2 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 5 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 13 | ||||
-rw-r--r-- | korganizer/main.cpp | 2 | ||||
-rw-r--r-- | pwmanager/pwmanager/getmasterpwwnd_emb.cpp | 7 |
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 @@ -385,12 +385,14 @@ void KABCore::disableBR(bool b) } 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() @@ -2876,13 +2878,15 @@ bool KABCore::syncPhone() 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() ); diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index a2ff1e9..40089a1 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp @@ -6,12 +6,13 @@ #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" @@ -89,127 +90,6 @@ int main( int argc, char **argv ) } 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 @@ -165,12 +165,13 @@ ContactListViewItem::ContactListViewItem(const KABC::Addressee &a, { 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 ) { @@ -191,12 +192,13 @@ QString ContactListViewItem::key(int column, bool ascending) const //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, diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index e938e4e..1fcc977 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -492,24 +492,25 @@ void KOEventViewer::formatAttendees(Incidence *event) } } 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); } diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 9a3ba73..bafd349 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -29,12 +29,13 @@ #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> @@ -162,22 +163,27 @@ bool ListItemVisitor::visit(Todo *t) } 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); @@ -686,17 +692,22 @@ void KOListView::setStartDate(const QDate &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) diff --git a/korganizer/main.cpp b/korganizer/main.cpp index c8a55d2..ca53828 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp @@ -9,12 +9,13 @@ #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" @@ -94,11 +95,12 @@ int main( int argc, char **argv ) 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 @@ -39,12 +39,13 @@ $Id$ #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) @@ -62,14 +63,20 @@ getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name) 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 ); |