summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-21 22:20:39 (UTC)
committer zautrix <zautrix>2004-10-21 22:20:39 (UTC)
commitd6f9bd535e8cabe653bdff329500f9153e5e11fb (patch) (unidiff)
tree6f83c692713c41896a165e399f259a744f125e5c
parentbb235c5a639b914574e1e247d2de6e479517585f (diff)
downloadkdepimpi-d6f9bd535e8cabe653bdff329500f9153e5e11fb.zip
kdepimpi-d6f9bd535e8cabe653bdff329500f9153e5e11fb.tar.gz
kdepimpi-d6f9bd535e8cabe653bdff329500f9153e5e11fb.tar.bz2
small fixes
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
@@ -388,6 +388,8 @@ void KABCore::recieve( QString fn )
388{ 388{
389 //qDebug("KABCore::recieve "); 389 //qDebug("KABCore::recieve ");
390 int count = mAddressBook->importFromFile( fn, true ); 390 int count = mAddressBook->importFromFile( fn, true );
391 if ( count )
392 setModified( true );
391 mViewManager->refreshView(); 393 mViewManager->refreshView();
392 message(i18n("%1 contact(s) received!").arg( count )); 394 message(i18n("%1 contact(s) received!").arg( count ));
393 topLevelWidget()->showMaximized(); 395 topLevelWidget()->showMaximized();
@@ -2879,7 +2881,9 @@ void KABCore::getFile( bool success )
2879 message( i18n("Error receiving file. Nothing changed!") ); 2881 message( i18n("Error receiving file. Nothing changed!") );
2880 return; 2882 return;
2881 } 2883 }
2882 mAddressBook->importFromFile( sentSyncFile() , false, true ); 2884 int count = mAddressBook->importFromFile( sentSyncFile() , false, true );
2885 if ( count )
2886 setModified( true );
2883 message( i18n("Pi-Sync successful!") ); 2887 message( i18n("Pi-Sync successful!") );
2884 mViewManager->refreshView(); 2888 mViewManager->refreshView();
2885} 2889}
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index a2ff1e9..40089a1 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -9,6 +9,7 @@
9#include <qmainwindow.h> 9#include <qmainwindow.h>
10#endif 10#endif
11 11
12#include <qtextcodec.h>
12#include <kstandarddirs.h> 13#include <kstandarddirs.h>
13#include <qregexp.h> 14#include <qregexp.h>
14#include <kglobal.h> 15#include <kglobal.h>
@@ -92,124 +93,3 @@ int main( int argc, char **argv )
92 qDebug("KA: Bye! "); 93 qDebug("KA: Bye! ");
93} 94}
94 95
95/*
96#include <stdlib.h>
97
98#include <qstring.h>
99
100#include <kabc/stdaddressbook.h>
101#include <kaboutdata.h>
102#include <kcmdlineargs.h>
103#include <kcrash.h>
104#include <kdebug.h>
105#include <klocale.h>
106#include <kstartupinfo.h>
107#include <kuniqueapplication.h>
108#include <kwin.h>
109
110#include "kaddressbookmain.h"
111#include "kabcore.h"
112
113extern "C" {
114
115void crashHandler( int )
116{
117 KABC::StdAddressBook::handleCrash();
118 ::exit( 0 );
119}
120
121}
122
123class KAddressBookApp : public KUniqueApplication {
124 public:
125 KAddressBookApp() : mMainWin( 0 ) {}
126 ~KAddressBookApp() {}
127
128 int newInstance();
129
130 private:
131 KAddressBookMain *mMainWin;
132};
133
134int KAddressBookApp::newInstance()
135{
136 if ( isRestored() ) {
137 // There can only be one main window
138 if ( KMainWindow::canBeRestored( 1 ) ) {
139 mMainWin = new KAddressBookMain;
140 mMainWin->show();
141 mMainWin->restore( 1 );
142 }
143 } else {
144 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
145
146 QCString addrStr = args->getOption( "addr" );
147 QCString uidStr = args->getOption( "uid" );
148 QString addr;
149 QString uid;
150 if ( !addrStr.isEmpty() )
151 addr = QString::fromLocal8Bit( addrStr );
152 if ( !uidStr.isEmpty() )
153 uid = QString::fromLocal8Bit( uidStr );
154
155
156 if ( args->isSet( "editor-only" ) ) {
157 if ( !mMainWin )
158 mMainWin = new KAddressBookMain;
159 KStartupInfo::appStarted();
160 mMainWin->hide();
161 } else {
162 if ( mMainWin ) {
163 mMainWin->show();
164 KWin::setActiveWindow( mMainWin->winId() );
165 } else {
166 mMainWin = new KAddressBookMain;
167 mMainWin->show();
168 }
169 }
170 // 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
171 if ( !addr.isEmpty() )
172 mMainWin->addEmail( addr );
173
174 if ( !uid.isEmpty() )
175 mMainWin->showContactEditor( uid );
176 if ( args->isSet( "new-contact" ) ) {
177 mMainWin->newContact();
178 }
179 }
180
181 KCrash::setEmergencySaveFunction( crashHandler );
182
183 return 0;
184}
185
186// the dummy argument is required, because KMail apparently sends an empty
187// argument.
188static KCmdLineOptions kmoptions[] =
189{
190 { "a", 0 , 0 },
191 { "addr <email>", I18N_NOOP( "Shows contact editor with given email address" ), 0 },
192 { "uid <uid>", I18N_NOOP( "Shows contact editor with given uid" ), 0 },
193 { "editor-only", I18N_NOOP( "Launches in editor only mode" ), 0 },
194 { "new-contact", I18N_NOOP( "Launches editor for the new contact" ), 0 },
195 { "+[argument]", I18N_NOOP( "dummy argument" ), 0},
196 { 0, 0, 0}
197};
198
199int main( int argc, char *argv[] )
200{
201 KLocale::setMainCatalogue( "kaddressbook" );
202
203 KCmdLineArgs::init( argc, argv, KABCore::createAboutData() );
204 KCmdLineArgs::addCmdLineOptions( kmoptions );
205 KUniqueApplication::addCmdLineOptions();
206
207 if ( !KAddressBookApp::start() )
208 exit( 0 );
209
210 KAddressBookApp app;
211 KGlobal::locale()->insertCatalogue( "libkdepim" );
212
213 return app.exec();
214}
215*/
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
@@ -168,6 +168,7 @@ ContactListViewItem::ContactListViewItem(const KABC::Addressee &a,
168 168
169QString ContactListViewItem::key(int column, bool ascending) const 169QString ContactListViewItem::key(int column, bool ascending) const
170{ 170{
171#ifndef DESKTOP_VERSION
171 int lan = KGlobal::locale()->language(); 172 int lan = KGlobal::locale()->language();
172 //qDebug("language %d ", lan); 173 //qDebug("language %d ", lan);
173 if ( lan == 1 ) { //GERMAN 174 if ( lan == 1 ) { //GERMAN
@@ -194,6 +195,7 @@ QString ContactListViewItem::key(int column, bool ascending) const
194 195
195 } 196 }
196 else 197 else
198#endif
197 return QListViewItem::key(column, ascending).lower(); 199 return QListViewItem::key(column, ascending).lower();
198} 200}
199 201
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index e938e4e..1fcc977 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -495,18 +495,19 @@ void KOEventViewer::formatAttendees(Incidence *event)
495void KOEventViewer::appendJournal(Journal *jour, int mode ) 495void KOEventViewer::appendJournal(Journal *jour, int mode )
496{ 496{
497 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 497 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
498 if (mode == 0 ) 498 if (mode == 0 ) {
499 addTag("h2",i18n("Journal from: ")); 499 addTag("h2",i18n("Journal from: "));
500 }
500 else { 501 else {
501 if ( mode == 1 ) { 502 if ( mode == 1 ) {
502 addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); 503 addTag("h2",i18n( "Local: " ) +i18n("Journal from: "));
503 } else { 504 } else {
504 addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); 505 addTag("h2",i18n( "Remote: " ) +i18n("Journal from: "));
505 } 506 }
506 addTag("h3",i18n( "Last modified " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) );
507 } 507 }
508 topLevelWidget()->setCaption("Journal Viewer"); 508 topLevelWidget()->setCaption("Journal Viewer");
509 mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); 509 mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer)));
510 addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) );
510 if (!jour->description().isEmpty()) { 511 if (!jour->description().isEmpty()) {
511 addTag("p",jour->description()); 512 addTag("p",jour->description());
512 } 513 }
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 9a3ba73..bafd349 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -32,6 +32,7 @@
32#include <qdialog.h> 32#include <qdialog.h>
33#include <qtextstream.h> 33#include <qtextstream.h>
34#include <qdir.h> 34#include <qdir.h>
35#include <qregexp.h>
35 36
36#include <klocale.h> 37#include <klocale.h>
37#include <kdebug.h> 38#include <kdebug.h>
@@ -165,7 +166,11 @@ bool ListItemVisitor::visit(Todo *t)
165 166
166bool ListItemVisitor::visit(Journal * j) 167bool ListItemVisitor::visit(Journal * j)
167{ 168{
168 mItem->setText(0,i18n("Journal")); 169 QString des = j->description().left(50);
170 des = des.simplifyWhiteSpace ();
171 des.replace (QRegExp ("\\n"),"" );
172 des.replace (QRegExp ("\\r"),"" );
173 mItem->setText(0,i18n("Journal")+": "+des.left(25));
169 mItem->setText(1,j->dtStartDateStr()); 174 mItem->setText(1,j->dtStartDateStr());
170 mItem->setText(2,"---"); 175 mItem->setText(2,"---");
171 mItem->setText(3,"---"); 176 mItem->setText(3,"---");
@@ -175,6 +180,7 @@ bool ListItemVisitor::visit(Journal * j)
175 mItem->setText(7,j->dtStartDateStr()); 180 mItem->setText(7,j->dtStartDateStr());
176 mItem->setText(8,"---"); 181 mItem->setText(8,"---");
177 mItem->setText(9,"---"); 182 mItem->setText(9,"---");
183 mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) );
178 184
179 QString key; 185 QString key;
180 QDate d = j->dtStart().date(); 186 QDate d = j->dtStart().date();
@@ -689,11 +695,16 @@ void KOListView::showDates(const QDate &start, const QDate &end)
689 clear(); 695 clear();
690 mStartDate = start; 696 mStartDate = start;
691 QDate date = start; 697 QDate date = start;
698 QPtrList<Journal> j_list;
692 while( date <= end ) { 699 while( date <= end ) {
693 addEvents(calendar()->events(date)); 700 addEvents(calendar()->events(date));
694 addTodos(calendar()->todos(date)); 701 addTodos(calendar()->todos(date));
702 Journal* jo = calendar()->journal(date);
703 if ( jo )
704 j_list.append( jo );
695 date = date.addDays( 1 ); 705 date = date.addDays( 1 );
696 } 706 }
707 addJournals(j_list);
697 emit incidenceSelected( 0 ); 708 emit incidenceSelected( 0 );
698 updateView(); 709 updateView();
699 710
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index c8a55d2..ca53828 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -12,6 +12,7 @@
12#include <qplatinumstyle.h> 12#include <qplatinumstyle.h>
13#include <qsgistyle.h> 13#include <qsgistyle.h>
14#endif 14#endif
15#include <qtextcodec.h>
15 16
16#include <qdir.h> 17#include <qdir.h>
17#include <kstandarddirs.h> 18#include <kstandarddirs.h>
@@ -97,6 +98,7 @@ int main( int argc, char **argv )
97 m.recieve(command, QByteArray() ); 98 m.recieve(command, QByteArray() );
98 99
99 } 100 }
101
100 a.exec(); 102 a.exec();
101 103
102 } 104 }
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
@@ -42,6 +42,7 @@ $Id$
42#include <qlabel.h> 42#include <qlabel.h>
43#include <qlineedit.h> 43#include <qlineedit.h>
44#include <qpushbutton.h> 44#include <qpushbutton.h>
45#include <qapplication.h>
45 46
46/* 47/*
47 * Constructs a getMasterPwWnd as a child of 'parent', with the 48 * Constructs a getMasterPwWnd as a child of 'parent', with the
@@ -65,8 +66,14 @@ getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name)
65 66
66 QWidget* numberBox = new QWidget( page ); 67 QWidget* numberBox = new QWidget( page );
67#ifndef DESKTOP_VERSION 68#ifndef DESKTOP_VERSION
69 if ( QApplication::desktop()->width() > 320 ) {
70 numberBox->setFixedHeight(250);
71 numberBox->setFixedWidth(200);
72 }
73 else{
68 numberBox->setFixedHeight(150); 74 numberBox->setFixedHeight(150);
69 numberBox->setFixedWidth(150); 75 numberBox->setFixedWidth(150);
76 }
70#endif 77#endif
71 78
72 QGridLayout* numberLayout = new QGridLayout( numberBox, 4, 3 ); 79 QGridLayout* numberLayout = new QGridLayout( numberBox, 4, 3 );