summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-03 11:18:44 (UTC)
committer zautrix <zautrix>2005-04-03 11:18:44 (UTC)
commitcb1fed5a15e31386048fc7fdf56cdaacb3cfa86f (patch) (unidiff)
tree944bc4999a8d7575333d8bc484ce90350f048a50
parent4f800d49800f8d0b1e7b0af8aacea6dbeb78e67c (diff)
downloadkdepimpi-cb1fed5a15e31386048fc7fdf56cdaacb3cfa86f.zip
kdepimpi-cb1fed5a15e31386048fc7fdf56cdaacb3cfa86f.tar.gz
kdepimpi-cb1fed5a15e31386048fc7fdf56cdaacb3cfa86f.tar.bz2
storage howto
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/storagehowto.txt80
-rw-r--r--desktop/rpm/kdepim_rpm2
-rw-r--r--kaddressbook/kabcore.cpp13
-rw-r--r--kaddressbook/kabcore.h2
-rw-r--r--korganizer/mainwindow.cpp10
-rw-r--r--korganizer/mainwindow.h1
-rw-r--r--version2
7 files changed, 106 insertions, 4 deletions
diff --git a/bin/kdepim/storagehowto.txt b/bin/kdepim/storagehowto.txt
new file mode 100644
index 0000000..4bb036b
--- a/dev/null
+++ b/bin/kdepim/storagehowto.txt
@@ -0,0 +1,80 @@
1
2KDE-Pim/Pi Storage HowTo
3
4As a default KDE-Pim/Pi is storing it's configuration and application (contacts and calendar) data in the directory <yourHome>/kdepim/.
5This Howto is about to change these settings.
6
7CONTENT:
8
90) General problems
101) Zaurus and desktop settings
112) Additional settings for the desktop
123) Technical background information
13
14********************************************
150) General problems
16********************************************
17
18There is no problem if you start KDE-Pim/Pi, set the storage dir and restart KDE-Pim/Pi and import all your data.
19In general you can copy your data to another directory and set this a the new storage dir. The only problem are the absolute paths in the KA/Pi resource configuration.
20KA/Pi stores it's resource information in the file <storageDir>/config/kabcrc.
21Change the absolute paths there if you changed your storageDir or (that is recommended) change the path of the resources in the KA/Pi resource configuration directly.
22
23********************************************
241) Zaurus and desktop settings
25********************************************
26
27You can access the global settings from KA/Pi and from KO/Pi.
28To change the storage dir go to configure dialog. Choose there the "Global" TAB and there the "Data storage path" TAB.
29Change the value of the current storage path to a new (absolute) path and press the button "Save settings".
30Restart the application.
31Import your data to the application or copy the old storage dir to the new dir. Solve the KA/Pi resource path problem as in 0).
32
33********************************************
342) Additional settings for the desktop
35********************************************
36
37The LOCAL option:
38In the desktop versions (NOT on the Zaurus) you have the possibility to set the storage dir relative to the executable binary.
39That does mean: You can copy all the data (binaries, config data, application data) of the directory where the binaries are to another directory and it will find all files without needing to change anything. NO resource path change is needed.
40In this LOCAL mode only resource files are supported (no resource directories) and only in the <storageDir>/apps/kabc/ directory (the default directory).
41
42To set the LOCAL mode go to configure dialog. Choose there the "Global" TAB and there the "Data storage path" TAB.
43Press there the button "Save using LOCAL storage".
44Restart the application.
45
46This LOCAL mode makes it possible to run KO/Pi and KA/Pi from a USB stick:
47All data is read from and written to the stick.
48Just put KDE-Pim/Pi on a memory stick and you can access all your PIM data on every computer with Windows XP. It will work with the ME and Linux versions as well.
49
50********************************************
513) Technical background information
52********************************************
53
54Directly after the start KDE-Pim/Pi looks for the evironment variable MICROKDEHOME.
55If the variable is set, the path in the MICROKDEHOME is used as the storage dir. End.
56
57If MICROKDEHOME is not set ( what is usually the case ), then
58
59###DESKTOP_VERSION ONLY###
60It looks for the file .microkdehome in the directory of the binary.
61(That file is written by pressing the "Save using LOCAL storage" button in the "Data storage path" TAB ).
62If this file is found, it sets the path in the this file as the storage dir.End.
63If the path starts with a LOCAL:
64it sets the environment variable LOCALMICROKDEHOME to the path of the binary
65and takes that path as storage dir.End.
66
67If the file .microkdehome in the directory of the binary is not found:
68###DESKTOP_VERSION ONLY END###
69
70It looks for the file .microkdehome in the home directory of the user.
71(That file is written by pressing the "Save settings" button in the "Data storage path" TAB ).
72If this file is found, it sets the path in this file as the storage dir.End.
73
74If the file .microkdehome in the home directory of the user is not found, it sets the
75<yourHome>/kdepim/ directory as the storage dir.
76End of setting the storage dir.
77
78If KA/Pi opens a resource it looks for the environment variable LOCALMICROKDEHOME.
79If the variable is set, the file resource takes the path in LOCALMICROKDEHOME to find it's file.
80
diff --git a/desktop/rpm/kdepim_rpm b/desktop/rpm/kdepim_rpm
index 088d3fe..5e7783b 100644
--- a/desktop/rpm/kdepim_rpm
+++ b/desktop/rpm/kdepim_rpm
@@ -1,84 +1,84 @@
1Summary: A collection of PIM programs 1Summary: A collection of PIM programs
2Name: KDE-Pim-Pi 2Name: KDE-Pim-Pi
3Version: 2.0.23 3Version: 2.0.24
4Release: SuSE_9.2 4Release: SuSE_9.2
5Copyright:GPL 5Copyright:GPL
6Group: Productivity/Pim 6Group: Productivity/Pim
7Source:http://sourceforge.net/projects/kdepimpi/ 7Source:http://sourceforge.net/projects/kdepimpi/
8URL:http://sourceforge.net/projects/kdepimpi/ 8URL:http://sourceforge.net/projects/kdepimpi/
9Packager: zautrix 9Packager: zautrix
10 10
11%description 11%description
12This package contains the platform-independent PIM programs from 12This package contains the platform-independent PIM programs from
13www.pi-sync.info, compiled for SuSE 9.2: 13www.pi-sync.info, compiled for SuSE 9.2:
14KTimeTacker/Pi 14KTimeTacker/Pi
15KPhone/Pi 15KPhone/Pi
16KAddressbook/Pi 16KAddressbook/Pi
17KOrganizer/Pi 17KOrganizer/Pi
18PasswordManager/Pi 18PasswordManager/Pi
19KOPieMail/Pi 19KOPieMail/Pi
20 20
21These applications do not need anything from the KDE-desktop 21These applications do not need anything from the KDE-desktop
22at all to run on Linux. However, there is a dependency from 22at all to run on Linux. However, there is a dependency from
23two KDE libs, because a small command line program is included 23two KDE libs, because a small command line program is included
24to make it possible to sync with the KDE-desktop applications. 24to make it possible to sync with the KDE-desktop applications.
25 25
26These applications are independent from the KDE-desktop 26These applications are independent from the KDE-desktop
27environment. That means, nothing of your existing 27environment. That means, nothing of your existing
28KDE-desktop setup will be changed, or any data 28KDE-desktop setup will be changed, or any data
29(calendar-addressbook) used by the KDE-desktop 29(calendar-addressbook) used by the KDE-desktop
30applications will be changed or accessed. 30applications will be changed or accessed.
31These applications stores their data and config in 31These applications stores their data and config in
32$HOME/kdepim/ 32$HOME/kdepim/
33However, because the same file format is used, 33However, because the same file format is used,
34an easy exchange of data with the KDE-desktop 34an easy exchange of data with the KDE-desktop
35is possible. 35is possible.
36A small command line program is included 36A small command line program is included
37to make it possible to sync with the KDE-desktop applications. 37to make it possible to sync with the KDE-desktop applications.
38You do not need to call this program from the commandline, 38You do not need to call this program from the commandline,
39it is called from the KDE-Pim/Pi apps when you choose there: 39it is called from the KDE-Pim/Pi apps when you choose there:
40Sync with KDE_Desktop. 40Sync with KDE_Desktop.
41If something is going wrong, please start the 41If something is going wrong, please start the
42KDE-Pim/Pi program itself from the console to get detailed output. 42KDE-Pim/Pi program itself from the console to get detailed output.
43 43
44After installation, you should have a 44After installation, you should have a
45PIM-pi 45PIM-pi
46folder in your KDE start menu, where you can 46folder in your KDE start menu, where you can
47start the applications from. 47start the applications from.
48 48
49These programs makes it possible to sync your Zaurus easily 49These programs makes it possible to sync your Zaurus easily
50(with the KDE-Pim/Pi programs running on the Zaurus) 50(with the KDE-Pim/Pi programs running on the Zaurus)
51with the KDE-desktop calendar/addressbook data. 51with the KDE-desktop calendar/addressbook data.
52If you want to use that, you have to update your 52If you want to use that, you have to update your
53KDE-desktop to version 3.3.0 or higher. 53KDE-desktop to version 3.3.0 or higher.
54SuSE 9.2 contains KDE 3.3.0 such that no update is needed. 54SuSE 9.2 contains KDE 3.3.0 such that no update is needed.
55Actually - after the (non difficult) configuration is set up - 55Actually - after the (non difficult) configuration is set up -
56with two mouseklicks on the Zaurus, 56with two mouseklicks on the Zaurus,
57the Zaurus syncs with the corresponding KDE-Pim/Pi 57the Zaurus syncs with the corresponding KDE-Pim/Pi
58program on the Linux Desktop which syncs automatically 58program on the Linux Desktop which syncs automatically
59with the KDE-desktop data. 59with the KDE-desktop data.
60 60
61If you want to use the KDE-desktop calendar/addressbook applications, 61If you want to use the KDE-desktop calendar/addressbook applications,
62just install these apps in this package and use them as a syncing tool for the 62just install these apps in this package and use them as a syncing tool for the
63Zaurus <-> KDE-desktop sync. 63Zaurus <-> KDE-desktop sync.
64The sync requires a network connection from your Zaurus to 64The sync requires a network connection from your Zaurus to
65the PC. A detailed Sync HowTo is available in the 65the PC. A detailed Sync HowTo is available in the
66Help menu of the applications. 66Help menu of the applications.
67 67
68These applications makes it also possible, that you can sync 68These applications makes it also possible, that you can sync
69(or just export the data to) your mobile phone with your 69(or just export the data to) your mobile phone with your
70data of the KDE-desktop calendar/addressbook applications. 70data of the KDE-desktop calendar/addressbook applications.
71This is tested and working for Nokia mobile phones, 71This is tested and working for Nokia mobile phones,
72it may work with others as well. 72it may work with others as well.
73(More info about that: -> Sync HowTo) 73(More info about that: -> Sync HowTo)
74 74
75NOTE: 75NOTE:
76When using SuSE 9.1 you have to update your KDE to 3.3.x 76When using SuSE 9.1 you have to update your KDE to 3.3.x
77and you have to make an online update in SuSE 9.1 to make it 77and you have to make an online update in SuSE 9.1 to make it
78possible to get the infrared connection working, such that 78possible to get the infrared connection working, such that
79you can sync your (Nokia) mobile phone via infrared. 79you can sync your (Nokia) mobile phone via infrared.
80 80
81%files 81%files
82/opt/kde3/share/applnk/PIM-pi/ 82/opt/kde3/share/applnk/PIM-pi/
83/opt/kdepimpi/ 83/opt/kdepimpi/
84/usr/lib/libmicro* 84/usr/lib/libmicro*
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index ce5c755..eba74a6 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1909,559 +1909,567 @@ void KABCore::initGUI()
1909 1909
1910} 1910}
1911void KABCore::initActions() 1911void KABCore::initActions()
1912{ 1912{
1913//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 1913//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
1914 1914
1915#ifndef KAB_EMBEDDED 1915#ifndef KAB_EMBEDDED
1916 connect( QApplication::clipboard(), SIGNAL( dataChanged() ), 1916 connect( QApplication::clipboard(), SIGNAL( dataChanged() ),
1917 SLOT( clipboardDataChanged() ) ); 1917 SLOT( clipboardDataChanged() ) );
1918#endif //KAB_EMBEDDED 1918#endif //KAB_EMBEDDED
1919 1919
1920 // file menu 1920 // file menu
1921 1921
1922 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); 1922 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() );
1923 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); 1923 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() );
1924 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager, 1924 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager,
1925 SLOT( printView() ), actionCollection(), "kaddressbook_print" ); 1925 SLOT( printView() ), actionCollection(), "kaddressbook_print" );
1926 1926
1927 1927
1928 mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails, 1928 mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails,
1929 SLOT( printView() ), actionCollection(), "kaddressbook_print2" ); 1929 SLOT( printView() ), actionCollection(), "kaddressbook_print2" );
1930 1930
1931 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, 1931 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this,
1932 SLOT( save() ), actionCollection(), "file_sync" ); 1932 SLOT( save() ), actionCollection(), "file_sync" );
1933 1933
1934 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, 1934 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this,
1935 SLOT( newContact() ), actionCollection(), "file_new_contact" ); 1935 SLOT( newContact() ), actionCollection(), "file_new_contact" );
1936 1936
1937 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, 1937 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0,
1938 this, SLOT( mailVCard() ), 1938 this, SLOT( mailVCard() ),
1939 actionCollection(), "file_mail_vcard"); 1939 actionCollection(), "file_mail_vcard");
1940 1940
1941 mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this, 1941 mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this,
1942 SLOT( export2phone() ), actionCollection(), 1942 SLOT( export2phone() ), actionCollection(),
1943 "kaddressbook_ex2phone" ); 1943 "kaddressbook_ex2phone" );
1944 1944
1945 mActionBeamVCard = 0; 1945 mActionBeamVCard = 0;
1946 mActionBeam = 0; 1946 mActionBeam = 0;
1947 1947
1948#ifndef DESKTOP_VERSION 1948#ifndef DESKTOP_VERSION
1949 if ( Ir::supported() ) { 1949 if ( Ir::supported() ) {
1950 mActionBeamVCard = new KAction( i18n( "Beam v&Card(s)..." ), "beam", 0, this, 1950 mActionBeamVCard = new KAction( i18n( "Beam v&Card(s)..." ), "beam", 0, this,
1951 SLOT( beamVCard() ), actionCollection(), 1951 SLOT( beamVCard() ), actionCollection(),
1952 "kaddressbook_beam_vcard" ); 1952 "kaddressbook_beam_vcard" );
1953 1953
1954 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, 1954 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this,
1955 SLOT( beamMySelf() ), actionCollection(), 1955 SLOT( beamMySelf() ), actionCollection(),
1956 "kaddressbook_beam_myself" ); 1956 "kaddressbook_beam_myself" );
1957 } 1957 }
1958#endif 1958#endif
1959 1959
1960 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, 1960 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0,
1961 this, SLOT( editContact2() ), 1961 this, SLOT( editContact2() ),
1962 actionCollection(), "file_properties" ); 1962 actionCollection(), "file_properties" );
1963 1963
1964#ifdef KAB_EMBEDDED 1964#ifdef KAB_EMBEDDED
1965 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); 1965 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() );
1966 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, 1966 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0,
1967 mMainWindow, SLOT( exit() ), 1967 mMainWindow, SLOT( exit() ),
1968 actionCollection(), "quit" ); 1968 actionCollection(), "quit" );
1969#endif //KAB_EMBEDDED 1969#endif //KAB_EMBEDDED
1970 1970
1971 // edit menu 1971 // edit menu
1972 if ( mIsPart ) { 1972 if ( mIsPart ) {
1973 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, 1973 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this,
1974 SLOT( copyContacts() ), actionCollection(), 1974 SLOT( copyContacts() ), actionCollection(),
1975 "kaddressbook_copy" ); 1975 "kaddressbook_copy" );
1976 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, 1976 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this,
1977 SLOT( cutContacts() ), actionCollection(), 1977 SLOT( cutContacts() ), actionCollection(),
1978 "kaddressbook_cut" ); 1978 "kaddressbook_cut" );
1979 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, 1979 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this,
1980 SLOT( pasteContacts() ), actionCollection(), 1980 SLOT( pasteContacts() ), actionCollection(),
1981 "kaddressbook_paste" ); 1981 "kaddressbook_paste" );
1982 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, 1982 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this,
1983 SLOT( selectAllContacts() ), actionCollection(), 1983 SLOT( selectAllContacts() ), actionCollection(),
1984 "kaddressbook_select_all" ); 1984 "kaddressbook_select_all" );
1985 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, 1985 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this,
1986 SLOT( undo() ), actionCollection(), 1986 SLOT( undo() ), actionCollection(),
1987 "kaddressbook_undo" ); 1987 "kaddressbook_undo" );
1988 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, 1988 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z,
1989 this, SLOT( redo() ), actionCollection(), 1989 this, SLOT( redo() ), actionCollection(),
1990 "kaddressbook_redo" ); 1990 "kaddressbook_redo" );
1991 } else { 1991 } else {
1992 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); 1992 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() );
1993 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); 1993 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() );
1994 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); 1994 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() );
1995 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); 1995 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() );
1996 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); 1996 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() );
1997 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); 1997 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() );
1998 } 1998 }
1999 1999
2000 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", 2000 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete",
2001 Key_Delete, this, SLOT( deleteContacts() ), 2001 Key_Delete, this, SLOT( deleteContacts() ),
2002 actionCollection(), "edit_delete" ); 2002 actionCollection(), "edit_delete" );
2003 2003
2004 mActionUndo->setEnabled( false ); 2004 mActionUndo->setEnabled( false );
2005 mActionRedo->setEnabled( false ); 2005 mActionRedo->setEnabled( false );
2006 2006
2007 // settings menu 2007 // settings menu
2008#ifdef KAB_EMBEDDED 2008#ifdef KAB_EMBEDDED
2009//US special menuentry to configure the addressbook resources. On KDE 2009//US special menuentry to configure the addressbook resources. On KDE
2010// you do that through the control center !!! 2010// you do that through the control center !!!
2011 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, 2011 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this,
2012 SLOT( configureResources() ), actionCollection(), 2012 SLOT( configureResources() ), actionCollection(),
2013 "kaddressbook_configure_resources" ); 2013 "kaddressbook_configure_resources" );
2014#endif //KAB_EMBEDDED 2014#endif //KAB_EMBEDDED
2015 2015
2016 if ( mIsPart ) { 2016 if ( mIsPart ) {
2017 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, 2017 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this,
2018 SLOT( openConfigDialog() ), actionCollection(), 2018 SLOT( openConfigDialog() ), actionCollection(),
2019 "kaddressbook_configure" ); 2019 "kaddressbook_configure" );
2020 2020
2021 //US not implemented yet 2021 //US not implemented yet
2022 //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, 2022 //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0,
2023 // this, SLOT( configureKeyBindings() ), actionCollection(), 2023 // this, SLOT( configureKeyBindings() ), actionCollection(),
2024 // "kaddressbook_configure_shortcuts" ); 2024 // "kaddressbook_configure_shortcuts" );
2025#ifdef KAB_EMBEDDED 2025#ifdef KAB_EMBEDDED
2026 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); 2026 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() );
2027 mActionConfigureToolbars->setEnabled( false ); 2027 mActionConfigureToolbars->setEnabled( false );
2028#endif //KAB_EMBEDDED 2028#endif //KAB_EMBEDDED
2029 2029
2030 } else { 2030 } else {
2031 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); 2031 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() );
2032 2032
2033 //US not implemented yet 2033 //US not implemented yet
2034 //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); 2034 //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() );
2035 } 2035 }
2036 2036
2037 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, 2037 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0,
2038 actionCollection(), "options_show_jump_bar" ); 2038 actionCollection(), "options_show_jump_bar" );
2039 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBar( bool ) ) ); 2039 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBar( bool ) ) );
2040 2040
2041 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, 2041 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0,
2042 actionCollection(), "options_show_details" ); 2042 actionCollection(), "options_show_details" );
2043 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); 2043 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) );
2044 2044
2045 2045
2046 mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, 2046 mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this,
2047 SLOT( toggleBeamReceive() ), actionCollection(), 2047 SLOT( toggleBeamReceive() ), actionCollection(),
2048 "kaddressbook_beam_rec" ); 2048 "kaddressbook_beam_rec" );
2049 2049
2050 2050
2051 // misc 2051 // misc
2052 // only enable LDAP lookup if we can handle the protocol 2052 // only enable LDAP lookup if we can handle the protocol
2053#ifndef KAB_EMBEDDED 2053#ifndef KAB_EMBEDDED
2054 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { 2054 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) {
2055 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, 2055 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0,
2056 this, SLOT( openLDAPDialog() ), actionCollection(), 2056 this, SLOT( openLDAPDialog() ), actionCollection(),
2057 "ldap_lookup" ); 2057 "ldap_lookup" );
2058 } 2058 }
2059#else //KAB_EMBEDDED 2059#else //KAB_EMBEDDED
2060 //qDebug("KABCore::initActions() LDAP has to be implemented"); 2060 //qDebug("KABCore::initActions() LDAP has to be implemented");
2061#endif //KAB_EMBEDDED 2061#endif //KAB_EMBEDDED
2062 2062
2063 2063
2064 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, 2064 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this,
2065 SLOT( setWhoAmI() ), actionCollection(), 2065 SLOT( setWhoAmI() ), actionCollection(),
2066 "set_personal" ); 2066 "set_personal" );
2067 2067
2068 2068
2069 mActionCategories = new KAction( i18n( "Set Categories for Contacts..." ), 0, this, 2069 mActionCategories = new KAction( i18n( "Set Categories for Contacts..." ), 0, this,
2070 SLOT( setCategories() ), actionCollection(), 2070 SLOT( setCategories() ), actionCollection(),
2071 "edit_set_categories" ); 2071 "edit_set_categories" );
2072 mActionEditCategories = new KAction( i18n( "Edit Category List..." ), 0, this, 2072 mActionEditCategories = new KAction( i18n( "Edit Category List..." ), 0, this,
2073 SLOT( editCategories() ), actionCollection(), 2073 SLOT( editCategories() ), actionCollection(),
2074 "edit__categories" ); 2074 "edit__categories" );
2075 2075
2076 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, 2076 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this,
2077 SLOT( removeVoice() ), actionCollection(), 2077 SLOT( removeVoice() ), actionCollection(),
2078 "remove_voice" ); 2078 "remove_voice" );
2079 mActionSetFormattedName = new KAction( i18n( "Set formatted name..." ), 0, this, 2079 mActionSetFormattedName = new KAction( i18n( "Set formatted name..." ), 0, this,
2080 SLOT( setFormattedName() ), actionCollection(), 2080 SLOT( setFormattedName() ), actionCollection(),
2081 "set_formatted" ); 2081 "set_formatted" );
2082 2082
2083 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this, 2083 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this,
2084 SLOT( manageCategories() ), actionCollection(), 2084 SLOT( manageCategories() ), actionCollection(),
2085 "remove_voice" ); 2085 "remove_voice" );
2086 2086
2087 2087
2088 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, 2088 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this,
2089 SLOT( importFromOL() ), actionCollection(), 2089 SLOT( importFromOL() ), actionCollection(),
2090 "import_OL" ); 2090 "import_OL" );
2091#ifdef KAB_EMBEDDED 2091#ifdef KAB_EMBEDDED
2092 mActionLicence = new KAction( i18n( "Licence" ), 0, 2092 mActionLicence = new KAction( i18n( "Licence" ), 0,
2093 this, SLOT( showLicence() ), actionCollection(), 2093 this, SLOT( showLicence() ), actionCollection(),
2094 "licence_about_data" ); 2094 "licence_about_data" );
2095 mActionFaq = new KAction( i18n( "Faq" ), 0, 2095 mActionFaq = new KAction( i18n( "Faq" ), 0,
2096 this, SLOT( faq() ), actionCollection(), 2096 this, SLOT( faq() ), actionCollection(),
2097 "faq_about_data" ); 2097 "faq_about_data" );
2098 mActionWN = new KAction( i18n( "What's New?" ), 0, 2098 mActionWN = new KAction( i18n( "What's New?" ), 0,
2099 this, SLOT( whatsnew() ), actionCollection(), 2099 this, SLOT( whatsnew() ), actionCollection(),
2100 "wn" ); 2100 "wn" );
2101
2102
2103
2104 mActionStorageHowto = new KAction( i18n( "Storage HowTo" ), 0,
2105 this, SLOT( storagehowto() ), actionCollection(),
2106 "storage" );
2107
2101 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, 2108 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0,
2102 this, SLOT( synchowto() ), actionCollection(), 2109 this, SLOT( synchowto() ), actionCollection(),
2103 "sync" ); 2110 "sync" );
2104 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, 2111 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0,
2105 this, SLOT( kdesynchowto() ), actionCollection(), 2112 this, SLOT( kdesynchowto() ), actionCollection(),
2106 "kdesync" ); 2113 "kdesync" );
2107 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, 2114 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0,
2108 this, SLOT( multisynchowto() ), actionCollection(), 2115 this, SLOT( multisynchowto() ), actionCollection(),
2109 "multisync" ); 2116 "multisync" );
2110 2117
2111 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, 2118 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0,
2112 this, SLOT( createAboutData() ), actionCollection(), 2119 this, SLOT( createAboutData() ), actionCollection(),
2113 "kaddressbook_about_data" ); 2120 "kaddressbook_about_data" );
2114#endif //KAB_EMBEDDED 2121#endif //KAB_EMBEDDED
2115 2122
2116 clipboardDataChanged(); 2123 clipboardDataChanged();
2117 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2124 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2118 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2125 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2119} 2126}
2120 2127
2121//US we need this function, to plug all actions into the correct menues. 2128//US we need this function, to plug all actions into the correct menues.
2122// KDE uses a XML format to plug the actions, but we work her without this overhead. 2129// KDE uses a XML format to plug the actions, but we work her without this overhead.
2123void KABCore::addActionsManually() 2130void KABCore::addActionsManually()
2124{ 2131{
2125//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 2132//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
2126 2133
2127#ifdef KAB_EMBEDDED 2134#ifdef KAB_EMBEDDED
2128 QPopupMenu *fileMenu = new QPopupMenu( this ); 2135 QPopupMenu *fileMenu = new QPopupMenu( this );
2129 QPopupMenu *editMenu = new QPopupMenu( this ); 2136 QPopupMenu *editMenu = new QPopupMenu( this );
2130 QPopupMenu *helpMenu = new QPopupMenu( this ); 2137 QPopupMenu *helpMenu = new QPopupMenu( this );
2131 2138
2132 KToolBar* tb = mMainWindow->toolBar(); 2139 KToolBar* tb = mMainWindow->toolBar();
2133 mMainWindow->setToolBarsMovable (false ); 2140 mMainWindow->setToolBarsMovable (false );
2134#ifndef DESKTOP_VERSION 2141#ifndef DESKTOP_VERSION
2135 if ( KABPrefs::instance()->mFullMenuBarVisible ) { 2142 if ( KABPrefs::instance()->mFullMenuBarVisible ) {
2136#endif 2143#endif
2137 QMenuBar* mb = mMainWindow->menuBar(); 2144 QMenuBar* mb = mMainWindow->menuBar();
2138 2145
2139 //US setup menubar. 2146 //US setup menubar.
2140 //Disable the following block if you do not want to have a menubar. 2147 //Disable the following block if you do not want to have a menubar.
2141 mb->insertItem( i18n("&File"), fileMenu ); 2148 mb->insertItem( i18n("&File"), fileMenu );
2142 mb->insertItem( i18n("&Edit"), editMenu ); 2149 mb->insertItem( i18n("&Edit"), editMenu );
2143 mb->insertItem( i18n("&View"), viewMenu ); 2150 mb->insertItem( i18n("&View"), viewMenu );
2144 mb->insertItem( i18n("&Settings"), settingsMenu ); 2151 mb->insertItem( i18n("&Settings"), settingsMenu );
2145#ifdef DESKTOP_VERSION 2152#ifdef DESKTOP_VERSION
2146 mb->insertItem( i18n("Synchronize"), syncMenu ); 2153 mb->insertItem( i18n("Synchronize"), syncMenu );
2147#else 2154#else
2148 mb->insertItem( i18n("Sync"), syncMenu ); 2155 mb->insertItem( i18n("Sync"), syncMenu );
2149#endif 2156#endif
2150 //mb->insertItem( i18n("&Change"), changeMenu ); 2157 //mb->insertItem( i18n("&Change"), changeMenu );
2151 mb->insertItem( i18n("&Help"), helpMenu ); 2158 mb->insertItem( i18n("&Help"), helpMenu );
2152 mIncSearchWidget = new IncSearchWidget( tb ); 2159 mIncSearchWidget = new IncSearchWidget( tb );
2153 // tb->insertWidget(-1, 0, mIncSearchWidget); 2160 // tb->insertWidget(-1, 0, mIncSearchWidget);
2154#ifndef DESKTOP_VERSION 2161#ifndef DESKTOP_VERSION
2155 } else { 2162 } else {
2156 //US setup toolbar 2163 //US setup toolbar
2157 QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); 2164 QPEMenuBar *menuBarTB = new QPEMenuBar( tb );
2158 QPopupMenu *popupBarTB = new QPopupMenu( this ); 2165 QPopupMenu *popupBarTB = new QPopupMenu( this );
2159 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB); 2166 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB);
2160 tb->insertWidget(-1, 0, menuBarTB); 2167 tb->insertWidget(-1, 0, menuBarTB);
2161 mIncSearchWidget = new IncSearchWidget( tb ); 2168 mIncSearchWidget = new IncSearchWidget( tb );
2162 tb->enableMoving(false); 2169 tb->enableMoving(false);
2163 popupBarTB->insertItem( i18n("&File"), fileMenu ); 2170 popupBarTB->insertItem( i18n("&File"), fileMenu );
2164 popupBarTB->insertItem( i18n("&Edit"), editMenu ); 2171 popupBarTB->insertItem( i18n("&Edit"), editMenu );
2165 popupBarTB->insertItem( i18n("&View"), viewMenu ); 2172 popupBarTB->insertItem( i18n("&View"), viewMenu );
2166 popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); 2173 popupBarTB->insertItem( i18n("&Settings"), settingsMenu );
2167 popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); 2174 popupBarTB->insertItem( i18n("Synchronize"), syncMenu );
2168 mViewManager->getFilterAction()->plug ( popupBarTB); 2175 mViewManager->getFilterAction()->plug ( popupBarTB);
2169 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu ); 2176 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu );
2170 popupBarTB->insertItem( i18n("&Help"), helpMenu ); 2177 popupBarTB->insertItem( i18n("&Help"), helpMenu );
2171 if (QApplication::desktop()->width() > 320 ) { 2178 if (QApplication::desktop()->width() > 320 ) {
2172 // mViewManager->getFilterAction()->plug ( tb); 2179 // mViewManager->getFilterAction()->plug ( tb);
2173 } 2180 }
2174 } 2181 }
2175#endif 2182#endif
2176 mIncSearchWidget->setSize(); 2183 mIncSearchWidget->setSize();
2177 // mActionQuit->plug ( mMainWindow->toolBar()); 2184 // mActionQuit->plug ( mMainWindow->toolBar());
2178 2185
2179 2186
2180 2187
2181 //US Now connect the actions with the menue entries. 2188 //US Now connect the actions with the menue entries.
2182#ifdef DESKTOP_VERSION 2189#ifdef DESKTOP_VERSION
2183 mActionPrint->plug( fileMenu ); 2190 mActionPrint->plug( fileMenu );
2184 mActionPrintDetails->plug( fileMenu ); 2191 mActionPrintDetails->plug( fileMenu );
2185 fileMenu->insertSeparator(); 2192 fileMenu->insertSeparator();
2186#endif 2193#endif
2187 mActionMail->plug( fileMenu ); 2194 mActionMail->plug( fileMenu );
2188 fileMenu->insertSeparator(); 2195 fileMenu->insertSeparator();
2189 2196
2190 mActionNewContact->plug( editMenu ); 2197 mActionNewContact->plug( editMenu );
2191 mActionNewContact->plug( tb ); 2198 mActionNewContact->plug( tb );
2192 2199
2193 mActionEditAddressee->plug( editMenu ); 2200 mActionEditAddressee->plug( editMenu );
2194 editMenu->insertSeparator(); 2201 editMenu->insertSeparator();
2195 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || 2202 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
2196 // (!KABPrefs::instance()->mMultipleViewsAtOnce )) 2203 // (!KABPrefs::instance()->mMultipleViewsAtOnce ))
2197 mActionEditAddressee->plug( tb ); 2204 mActionEditAddressee->plug( tb );
2198 2205
2199 // fileMenu->insertSeparator(); 2206 // fileMenu->insertSeparator();
2200 mActionSave->plug( fileMenu ); 2207 mActionSave->plug( fileMenu );
2201 fileMenu->insertItem( "&Import", ImportMenu ); 2208 fileMenu->insertItem( "&Import", ImportMenu );
2202 fileMenu->insertItem( "&Export", ExportMenu ); 2209 fileMenu->insertItem( "&Export", ExportMenu );
2203 editMenu->insertItem( i18n("&Change"), changeMenu ); 2210 editMenu->insertItem( i18n("&Change"), changeMenu );
2204 editMenu->insertSeparator(); 2211 editMenu->insertSeparator();
2205#ifndef DESKTOP_VERSION 2212#ifndef DESKTOP_VERSION
2206 if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu ); 2213 if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu );
2207#endif 2214#endif
2208#if 0 2215#if 0
2209 // PENDING fix MailVCard 2216 // PENDING fix MailVCard
2210 fileMenu->insertSeparator(); 2217 fileMenu->insertSeparator();
2211 mActionMailVCard->plug( fileMenu ); 2218 mActionMailVCard->plug( fileMenu );
2212#endif 2219#endif
2213#ifndef DESKTOP_VERSION 2220#ifndef DESKTOP_VERSION
2214 if ( Ir::supported() ) mActionBR->plug( beamMenu ); 2221 if ( Ir::supported() ) mActionBR->plug( beamMenu );
2215 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu ); 2222 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu );
2216 if ( Ir::supported() ) mActionBeam->plug( beamMenu ); 2223 if ( Ir::supported() ) mActionBeam->plug( beamMenu );
2217#endif 2224#endif
2218 fileMenu->insertSeparator(); 2225 fileMenu->insertSeparator();
2219 mActionQuit->plug( fileMenu ); 2226 mActionQuit->plug( fileMenu );
2220#ifdef _OL_IMPORT_ 2227#ifdef _OL_IMPORT_
2221 mActionImportOL->plug( ImportMenu ); 2228 mActionImportOL->plug( ImportMenu );
2222#endif 2229#endif
2223 // edit menu 2230 // edit menu
2224 mActionUndo->plug( editMenu ); 2231 mActionUndo->plug( editMenu );
2225 mActionRedo->plug( editMenu ); 2232 mActionRedo->plug( editMenu );
2226 editMenu->insertSeparator(); 2233 editMenu->insertSeparator();
2227 mActionCut->plug( editMenu ); 2234 mActionCut->plug( editMenu );
2228 mActionCopy->plug( editMenu ); 2235 mActionCopy->plug( editMenu );
2229 mActionPaste->plug( editMenu ); 2236 mActionPaste->plug( editMenu );
2230 mActionDelete->plug( editMenu ); 2237 mActionDelete->plug( editMenu );
2231 editMenu->insertSeparator(); 2238 editMenu->insertSeparator();
2232 mActionSelectAll->plug( editMenu ); 2239 mActionSelectAll->plug( editMenu );
2233 2240
2234 mActionSetFormattedName->plug( changeMenu ); 2241 mActionSetFormattedName->plug( changeMenu );
2235 mActionRemoveVoice->plug( changeMenu ); 2242 mActionRemoveVoice->plug( changeMenu );
2236 // settingsmings menu 2243 // settingsmings menu
2237//US special menuentry to configure the addressbook resources. On KDE 2244//US special menuentry to configure the addressbook resources. On KDE
2238// you do that through the control center !!! 2245// you do that through the control center !!!
2239 // settingsMenu->insertSeparator(); 2246 // settingsMenu->insertSeparator();
2240 2247
2241 mActionConfigKAddressbook->plug( settingsMenu, 0 ); 2248 mActionConfigKAddressbook->plug( settingsMenu, 0 );
2242 mActionConfigResources->plug( settingsMenu,1 ); 2249 mActionConfigResources->plug( settingsMenu,1 );
2243 settingsMenu->insertSeparator(2); 2250 settingsMenu->insertSeparator(2);
2244 2251
2245 if ( mIsPart ) { 2252 if ( mIsPart ) {
2246 //US not implemented yet 2253 //US not implemented yet
2247 //mActionConfigShortcuts->plug( settingsMenu ); 2254 //mActionConfigShortcuts->plug( settingsMenu );
2248 //mActionConfigureToolbars->plug( settingsMenu ); 2255 //mActionConfigureToolbars->plug( settingsMenu );
2249 2256
2250 } else { 2257 } else {
2251 //US not implemented yet 2258 //US not implemented yet
2252 //mActionKeyBindings->plug( settingsMenu ); 2259 //mActionKeyBindings->plug( settingsMenu );
2253 } 2260 }
2254 2261
2255 mActionEditCategories->plug( settingsMenu ); 2262 mActionEditCategories->plug( settingsMenu );
2256 mActionManageCategories->plug( settingsMenu ); 2263 mActionManageCategories->plug( settingsMenu );
2257 mActionJumpBar->plug( viewMenu,0 ); 2264 mActionJumpBar->plug( viewMenu,0 );
2258 mActionDetails->plug( viewMenu,0 ); 2265 mActionDetails->plug( viewMenu,0 );
2259 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) 2266 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop )
2260 mActionDetails->plug( tb ); 2267 mActionDetails->plug( tb );
2261 settingsMenu->insertSeparator(); 2268 settingsMenu->insertSeparator();
2262#ifndef DESKTOP_VERSION 2269#ifndef DESKTOP_VERSION
2263 if ( Ir::supported() ) mActionBR->plug(settingsMenu ); 2270 if ( Ir::supported() ) mActionBR->plug(settingsMenu );
2264 settingsMenu->insertSeparator(); 2271 settingsMenu->insertSeparator();
2265#endif 2272#endif
2266 2273
2267 mActionWhoAmI->plug( settingsMenu ); 2274 mActionWhoAmI->plug( settingsMenu );
2268 //mActionEditCategories->plug( changeMenu ); 2275 //mActionEditCategories->plug( changeMenu );
2269 mActionCategories->plug( changeMenu ); 2276 mActionCategories->plug( changeMenu );
2270 //mActionManageCategories->plug( changeMenu ); 2277 //mActionManageCategories->plug( changeMenu );
2271 2278
2272 //mActionCategories->plug( settingsMenu ); 2279 //mActionCategories->plug( settingsMenu );
2273 2280
2274 2281
2275 mActionWN->plug( helpMenu ); 2282 mActionWN->plug( helpMenu );
2283 mActionStorageHowto->plug( helpMenu );
2276 mActionSyncHowto->plug( helpMenu ); 2284 mActionSyncHowto->plug( helpMenu );
2277 mActionKdeSyncHowto->plug( helpMenu ); 2285 mActionKdeSyncHowto->plug( helpMenu );
2278 mActionMultiSyncHowto->plug( helpMenu ); 2286 mActionMultiSyncHowto->plug( helpMenu );
2279 mActionFaq->plug( helpMenu ); 2287 mActionFaq->plug( helpMenu );
2280 mActionLicence->plug( helpMenu ); 2288 mActionLicence->plug( helpMenu );
2281 mActionAboutKAddressbook->plug( helpMenu ); 2289 mActionAboutKAddressbook->plug( helpMenu );
2282 2290
2283 if (KGlobal::getDesktopSize() > KGlobal::Small ) { 2291 if (KGlobal::getDesktopSize() > KGlobal::Small ) {
2284 2292
2285 mActionSave->plug( tb ); 2293 mActionSave->plug( tb );
2286 mViewManager->getFilterAction()->plug ( tb); 2294 mViewManager->getFilterAction()->plug ( tb);
2287 //LR hide filteraction on started in 480x640 2295 //LR hide filteraction on started in 480x640
2288 if (QApplication::desktop()->width() == 480 ) { 2296 if (QApplication::desktop()->width() == 480 ) {
2289 mViewManager->getFilterAction()->setComboWidth( 0 ); 2297 mViewManager->getFilterAction()->setComboWidth( 0 );
2290 } 2298 }
2291 mActionUndo->plug( tb ); 2299 mActionUndo->plug( tb );
2292 mActionDelete->plug( tb ); 2300 mActionDelete->plug( tb );
2293 mActionRedo->plug( tb ); 2301 mActionRedo->plug( tb );
2294 } else { 2302 } else {
2295 mActionSave->plug( tb ); 2303 mActionSave->plug( tb );
2296 tb->enableMoving(false); 2304 tb->enableMoving(false);
2297 } 2305 }
2298 //mActionQuit->plug ( tb ); 2306 //mActionQuit->plug ( tb );
2299 //tb->insertWidget(-1, 0, mIncSearchWidget, 6); 2307 //tb->insertWidget(-1, 0, mIncSearchWidget, 6);
2300 2308
2301 //US link the searchwidget first to this. 2309 //US link the searchwidget first to this.
2302 // The real linkage to the toolbar happens later. 2310 // The real linkage to the toolbar happens later.
2303//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 2311//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
2304//US tb->insertItem( mIncSearchWidget ); 2312//US tb->insertItem( mIncSearchWidget );
2305/*US 2313/*US
2306 mIncSearchWidget = new IncSearchWidget( tb ); 2314 mIncSearchWidget = new IncSearchWidget( tb );
2307 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 2315 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
2308 SLOT( incrementalSearch( const QString& ) ) ); 2316 SLOT( incrementalSearch( const QString& ) ) );
2309 2317
2310 mJumpButtonBar = new JumpButtonBar( this, this ); 2318 mJumpButtonBar = new JumpButtonBar( this, this );
2311 2319
2312//US topLayout->addWidget( mJumpButtonBar ); 2320//US topLayout->addWidget( mJumpButtonBar );
2313 this->layout()->add( mJumpButtonBar ); 2321 this->layout()->add( mJumpButtonBar );
2314*/ 2322*/
2315 2323
2316#endif //KAB_EMBEDDED 2324#endif //KAB_EMBEDDED
2317 2325
2318 mActionExport2phone->plug( ExportMenu ); 2326 mActionExport2phone->plug( ExportMenu );
2319 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); 2327 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) );
2320 syncManager->fillSyncMenu(); 2328 syncManager->fillSyncMenu();
2321 2329
2322} 2330}
2323void KABCore::showLicence() 2331void KABCore::showLicence()
2324{ 2332{
2325 KApplication::showLicence(); 2333 KApplication::showLicence();
2326} 2334}
2327 2335
2328void KABCore::manageCategories( ) 2336void KABCore::manageCategories( )
2329{ 2337{
2330 KABCatPrefs* cp = new KABCatPrefs(); 2338 KABCatPrefs* cp = new KABCatPrefs();
2331 cp->show(); 2339 cp->show();
2332 int w =cp->sizeHint().width() ; 2340 int w =cp->sizeHint().width() ;
2333 int h = cp->sizeHint().height() ; 2341 int h = cp->sizeHint().height() ;
2334 int dw = QApplication::desktop()->width(); 2342 int dw = QApplication::desktop()->width();
2335 int dh = QApplication::desktop()->height(); 2343 int dh = QApplication::desktop()->height();
2336 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2344 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2337 if ( !cp->exec() ) { 2345 if ( !cp->exec() ) {
2338 delete cp; 2346 delete cp;
2339 return; 2347 return;
2340 } 2348 }
2341 int count = 0; 2349 int count = 0;
2342 int cc = 0; 2350 int cc = 0;
2343 message( i18n("Please wait, processing categories...")); 2351 message( i18n("Please wait, processing categories..."));
2344 if ( cp->addCat() ) { 2352 if ( cp->addCat() ) {
2345 KABC::AddressBook::Iterator it; 2353 KABC::AddressBook::Iterator it;
2346 QStringList catList = KABPrefs::instance()->mCustomCategories; 2354 QStringList catList = KABPrefs::instance()->mCustomCategories;
2347 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2355 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2348 ++cc; 2356 ++cc;
2349 if ( cc %10 == 0) 2357 if ( cc %10 == 0)
2350 message(i18n("Processing contact #%1").arg(cc)); 2358 message(i18n("Processing contact #%1").arg(cc));
2351 QStringList catIncList = (*it).categories(); 2359 QStringList catIncList = (*it).categories();
2352 int i; 2360 int i;
2353 for( i = 0; i< catIncList.count(); ++i ) { 2361 for( i = 0; i< catIncList.count(); ++i ) {
2354 if ( !catList.contains (catIncList[i])) { 2362 if ( !catList.contains (catIncList[i])) {
2355 catList.append( catIncList[i] ); 2363 catList.append( catIncList[i] );
2356 //qDebug("add cat %s ", catIncList[i].latin1()); 2364 //qDebug("add cat %s ", catIncList[i].latin1());
2357 ++count; 2365 ++count;
2358 } 2366 }
2359 } 2367 }
2360 } 2368 }
2361 catList.sort(); 2369 catList.sort();
2362 KABPrefs::instance()->mCustomCategories = catList; 2370 KABPrefs::instance()->mCustomCategories = catList;
2363 KABPrefs::instance()->writeConfig(); 2371 KABPrefs::instance()->writeConfig();
2364 message(QString::number( count )+ i18n(" categories added to list! ")); 2372 message(QString::number( count )+ i18n(" categories added to list! "));
2365 } else { 2373 } else {
2366 QStringList catList = KABPrefs::instance()->mCustomCategories; 2374 QStringList catList = KABPrefs::instance()->mCustomCategories;
2367 QStringList catIncList; 2375 QStringList catIncList;
2368 QStringList newCatList; 2376 QStringList newCatList;
2369 KABC::AddressBook::Iterator it; 2377 KABC::AddressBook::Iterator it;
2370 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2378 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2371 ++cc; 2379 ++cc;
2372 if ( cc %10 == 0) 2380 if ( cc %10 == 0)
2373 message(i18n("Processing contact #%1").arg(cc)); 2381 message(i18n("Processing contact #%1").arg(cc));
2374 QStringList catIncList = (*it).categories(); 2382 QStringList catIncList = (*it).categories();
2375 int i; 2383 int i;
2376 if ( catIncList.count() ) { 2384 if ( catIncList.count() ) {
2377 newCatList.clear(); 2385 newCatList.clear();
2378 for( i = 0; i< catIncList.count(); ++i ) { 2386 for( i = 0; i< catIncList.count(); ++i ) {
2379 if ( catList.contains (catIncList[i])) { 2387 if ( catList.contains (catIncList[i])) {
2380 newCatList.append( catIncList[i] ); 2388 newCatList.append( catIncList[i] );
2381 } 2389 }
2382 } 2390 }
2383 newCatList.sort(); 2391 newCatList.sort();
2384 (*it).setCategories( newCatList ); 2392 (*it).setCategories( newCatList );
2385 mAddressBook->insertAddressee( (*it) ); 2393 mAddressBook->insertAddressee( (*it) );
2386 } 2394 }
2387 } 2395 }
2388 setModified( true ); 2396 setModified( true );
2389 mViewManager->refreshView(); 2397 mViewManager->refreshView();
2390 message( i18n("Removing categories done!")); 2398 message( i18n("Removing categories done!"));
2391 } 2399 }
2392 delete cp; 2400 delete cp;
2393} 2401}
2394void KABCore::removeVoice() 2402void KABCore::removeVoice()
2395{ 2403{
2396 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) 2404 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No )
2397 return; 2405 return;
2398 XXPortSelectDialog dlg( this, false, this ); 2406 XXPortSelectDialog dlg( this, false, this );
2399 if ( !dlg.exec() ) 2407 if ( !dlg.exec() )
2400 return; 2408 return;
2401 mAddressBook->setUntagged(); 2409 mAddressBook->setUntagged();
2402 dlg.tagSelected(); 2410 dlg.tagSelected();
2403 message(i18n("Removing voice..."), false ); 2411 message(i18n("Removing voice..."), false );
2404 KABC::AddressBook::Iterator it; 2412 KABC::AddressBook::Iterator it;
2405 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2413 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2406 if ( (*it).tagged() ) { 2414 if ( (*it).tagged() ) {
2407 (*it).removeVoice(); 2415 (*it).removeVoice();
2408 } 2416 }
2409 } 2417 }
2410 message(i18n("Refreshing view...") ); 2418 message(i18n("Refreshing view...") );
2411 qApp->processEvents(); 2419 qApp->processEvents();
2412 mViewManager->refreshView( "" ); 2420 mViewManager->refreshView( "" );
2413 Addressee add; 2421 Addressee add;
2414 mDetails->setAddressee( add ); 2422 mDetails->setAddressee( add );
2415 message(i18n("Remove voice completed!") ); 2423 message(i18n("Remove voice completed!") );
2416 2424
2417 2425
2418 2426
2419} 2427}
2420 2428
2421void KABCore::setFormattedName() 2429void KABCore::setFormattedName()
2422{ 2430{
2423 KABFormatPrefs setpref; 2431 KABFormatPrefs setpref;
2424 if ( !setpref.exec() ) { 2432 if ( !setpref.exec() ) {
2425 return; 2433 return;
2426 } 2434 }
2427 XXPortSelectDialog dlg( this, false, this ); 2435 XXPortSelectDialog dlg( this, false, this );
2428 if ( !dlg.exec() ) 2436 if ( !dlg.exec() )
2429 return; 2437 return;
2430 mAddressBook->setUntagged(); 2438 mAddressBook->setUntagged();
2431 dlg.tagSelected(); 2439 dlg.tagSelected();
2432 int count = 0; 2440 int count = 0;
2433 KABC::AddressBook::Iterator it; 2441 KABC::AddressBook::Iterator it;
2434 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2442 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2435 if ( (*it).tagged() ) { 2443 if ( (*it).tagged() ) {
2436 ++count; 2444 ++count;
2437 if ( count %10 == 0 ) 2445 if ( count %10 == 0 )
2438 message(i18n("Changing contact #%1").arg( count ) ); 2446 message(i18n("Changing contact #%1").arg( count ) );
2439 qApp->processEvents(); 2447 qApp->processEvents();
2440 QString fName; 2448 QString fName;
2441 if ( setpref.simple->isChecked() ) 2449 if ( setpref.simple->isChecked() )
2442 fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName ); 2450 fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName );
2443 else if ( setpref.full->isChecked() ) 2451 else if ( setpref.full->isChecked() )
2444 fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName ); 2452 fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName );
2445 else if ( setpref.reverse->isChecked() ) 2453 else if ( setpref.reverse->isChecked() )
2446 fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName ); 2454 fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName );
2447 else 2455 else
2448 fName = (*it).organization(); 2456 fName = (*it).organization();
2449 if ( setpref.setCompany->isChecked() ) 2457 if ( setpref.setCompany->isChecked() )
2450 if ( fName.isEmpty() || fName =="," ) 2458 if ( fName.isEmpty() || fName =="," )
2451 fName = (*it).organization(); 2459 fName = (*it).organization();
2452 (*it).setFormattedName( fName ); 2460 (*it).setFormattedName( fName );
2453 } 2461 }
2454 } 2462 }
2455 message(i18n("Refreshing view...") ); 2463 message(i18n("Refreshing view...") );
2456 qApp->processEvents(); 2464 qApp->processEvents();
2457 mViewManager->refreshView( "" ); 2465 mViewManager->refreshView( "" );
2458 Addressee add; 2466 Addressee add;
2459 mDetails->setAddressee( add ); 2467 mDetails->setAddressee( add );
2460 message(i18n("Setting formatted name completed!") ); 2468 message(i18n("Setting formatted name completed!") );
2461} 2469}
2462 2470
2463void KABCore::clipboardDataChanged() 2471void KABCore::clipboardDataChanged()
2464{ 2472{
2465 2473
2466 if ( mReadWrite ) 2474 if ( mReadWrite )
2467 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); 2475 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
@@ -2537,385 +2545,388 @@ void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QSt
2537 } 2545 }
2538 2546
2539 } else { 2547 } else {
2540 qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid "); 2548 qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid ");
2541 } 2549 }
2542 callContactdialog(); 2550 callContactdialog();
2543 //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); 2551 //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()");
2544#endif 2552#endif
2545} 2553}
2546void KABCore::resizeAndCallContactdialog() 2554void KABCore::resizeAndCallContactdialog()
2547{ 2555{
2548 updateMainWindow(); 2556 updateMainWindow();
2549 QTimer::singleShot( 100,this, SLOT ( callContactdialog() ) ); 2557 QTimer::singleShot( 100,this, SLOT ( callContactdialog() ) );
2550} 2558}
2551 2559
2552void KABCore::callContactdialog() 2560void KABCore::callContactdialog()
2553{ 2561{
2554 QStringList nameList; 2562 QStringList nameList;
2555 QStringList emailList; 2563 QStringList emailList;
2556 QStringList uidList; 2564 QStringList uidList;
2557 qDebug(" KABCore::callContactdialog:DESKTOP WIDTH %d ", QApplication::desktop()->width() ); 2565 qDebug(" KABCore::callContactdialog:DESKTOP WIDTH %d ", QApplication::desktop()->width() );
2558 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 2566 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
2559 uint i=0; 2567 uint i=0;
2560 for (i=0; i < list.count(); i++) 2568 for (i=0; i < list.count(); i++)
2561 { 2569 {
2562 nameList.append(list[i].realName()); 2570 nameList.append(list[i].realName());
2563 emailList.append(list[i].preferredEmail()); 2571 emailList.append(list[i].preferredEmail());
2564 uidList.append(list[i].uid()); 2572 uidList.append(list[i].uid());
2565 } 2573 }
2566 QString uid = mEmailSourceUID; 2574 QString uid = mEmailSourceUID;
2567 //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1()); 2575 //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1());
2568 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList); 2576 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList);
2569 2577
2570} 2578}
2571/* this method will be called through the QCop interface from Ko/Pi to select birthdays 2579/* this method will be called through the QCop interface from Ko/Pi to select birthdays
2572 * to put them into the calendar. 2580 * to put them into the calendar.
2573 */ 2581 */
2574void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) 2582void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid)
2575{ 2583{
2576 // qDebug("KABCore::requestForBirthdayList"); 2584 // qDebug("KABCore::requestForBirthdayList");
2577 QStringList birthdayList; 2585 QStringList birthdayList;
2578 QStringList anniversaryList; 2586 QStringList anniversaryList;
2579 QStringList realNameList; 2587 QStringList realNameList;
2580 QStringList preferredEmailList; 2588 QStringList preferredEmailList;
2581 QStringList assembledNameList; 2589 QStringList assembledNameList;
2582 QStringList uidList; 2590 QStringList uidList;
2583 2591
2584 KABC::AddressBook::Iterator it; 2592 KABC::AddressBook::Iterator it;
2585 2593
2586 int count = 0; 2594 int count = 0;
2587 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2595 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2588 ++count; 2596 ++count;
2589 } 2597 }
2590 QProgressBar bar(count,0 ); 2598 QProgressBar bar(count,0 );
2591 int w = 300; 2599 int w = 300;
2592 if ( QApplication::desktop()->width() < 320 ) 2600 if ( QApplication::desktop()->width() < 320 )
2593 w = 220; 2601 w = 220;
2594 int h = bar.sizeHint().height() ; 2602 int h = bar.sizeHint().height() ;
2595 int dw = QApplication::desktop()->width(); 2603 int dw = QApplication::desktop()->width();
2596 int dh = QApplication::desktop()->height(); 2604 int dh = QApplication::desktop()->height();
2597 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2605 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2598 bar.show(); 2606 bar.show();
2599 bar.setCaption (i18n("Collecting birthdays - close to abort!") ); 2607 bar.setCaption (i18n("Collecting birthdays - close to abort!") );
2600 qApp->processEvents(); 2608 qApp->processEvents();
2601 2609
2602 QDate bday; 2610 QDate bday;
2603 QString anni; 2611 QString anni;
2604 QString formattedbday; 2612 QString formattedbday;
2605 2613
2606 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) 2614 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it )
2607 { 2615 {
2608 if ( ! bar.isVisible() ) 2616 if ( ! bar.isVisible() )
2609 return; 2617 return;
2610 bar.setProgress( count++ ); 2618 bar.setProgress( count++ );
2611 qApp->processEvents(); 2619 qApp->processEvents();
2612 bday = (*it).birthday().date(); 2620 bday = (*it).birthday().date();
2613 anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); 2621 anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" );
2614 2622
2615 if ( bday.isValid() || !anni.isEmpty()) 2623 if ( bday.isValid() || !anni.isEmpty())
2616 { 2624 {
2617 if (bday.isValid()) 2625 if (bday.isValid())
2618 formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); 2626 formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate);
2619 else 2627 else
2620 formattedbday = "NOTVALID"; 2628 formattedbday = "NOTVALID";
2621 if (anni.isEmpty()) 2629 if (anni.isEmpty())
2622 anni = "INVALID"; 2630 anni = "INVALID";
2623 2631
2624 birthdayList.append(formattedbday); 2632 birthdayList.append(formattedbday);
2625 anniversaryList.append(anni); //should be ISODate 2633 anniversaryList.append(anni); //should be ISODate
2626 realNameList.append((*it).realName()); 2634 realNameList.append((*it).realName());
2627 preferredEmailList.append((*it).preferredEmail()); 2635 preferredEmailList.append((*it).preferredEmail());
2628 assembledNameList.append((*it).assembledName()); 2636 assembledNameList.append((*it).assembledName());
2629 uidList.append((*it).uid()); 2637 uidList.append((*it).uid());
2630 2638
2631 //qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() ); 2639 //qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() );
2632 } 2640 }
2633 } 2641 }
2634 2642
2635 bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); 2643 bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList);
2636 2644
2637} 2645}
2638 2646
2639/* this method will be called through the QCop interface from other apps to show details of a contact. 2647/* this method will be called through the QCop interface from other apps to show details of a contact.
2640 */ 2648 */
2641void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) 2649void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
2642{ 2650{
2643 //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); 2651 //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1());
2644 2652
2645 QString foundUid = QString::null; 2653 QString foundUid = QString::null;
2646 if ( ! uid.isEmpty() ) { 2654 if ( ! uid.isEmpty() ) {
2647 Addressee adrr = mAddressBook->findByUid( uid ); 2655 Addressee adrr = mAddressBook->findByUid( uid );
2648 if ( !adrr.isEmpty() ) { 2656 if ( !adrr.isEmpty() ) {
2649 foundUid = uid; 2657 foundUid = uid;
2650 } 2658 }
2651 if ( email == "sendbacklist" ) { 2659 if ( email == "sendbacklist" ) {
2652 //qDebug("ssssssssssssssssssssssend "); 2660 //qDebug("ssssssssssssssssssssssend ");
2653 QStringList nameList; 2661 QStringList nameList;
2654 QStringList emailList; 2662 QStringList emailList;
2655 QStringList uidList; 2663 QStringList uidList;
2656 nameList.append(adrr.realName()); 2664 nameList.append(adrr.realName());
2657 emailList = adrr.emails(); 2665 emailList = adrr.emails();
2658 uidList.append( adrr.preferredEmail()); 2666 uidList.append( adrr.preferredEmail());
2659 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); 2667 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
2660 return; 2668 return;
2661 } 2669 }
2662 2670
2663 } 2671 }
2664 2672
2665 if ( email == "sendbacklist" ) 2673 if ( email == "sendbacklist" )
2666 return; 2674 return;
2667 if (foundUid.isEmpty()) 2675 if (foundUid.isEmpty())
2668 { 2676 {
2669 //find the uid of the person first 2677 //find the uid of the person first
2670 Addressee::List namelist; 2678 Addressee::List namelist;
2671 Addressee::List emaillist; 2679 Addressee::List emaillist;
2672 2680
2673 if (!name.isEmpty()) 2681 if (!name.isEmpty())
2674 namelist = mAddressBook->findByName( name ); 2682 namelist = mAddressBook->findByName( name );
2675 2683
2676 if (!email.isEmpty()) 2684 if (!email.isEmpty())
2677 emaillist = mAddressBook->findByEmail( email ); 2685 emaillist = mAddressBook->findByEmail( email );
2678 //qDebug("count %d %d ", namelist.count(),emaillist.count() ); 2686 //qDebug("count %d %d ", namelist.count(),emaillist.count() );
2679 //check if we have a match in Namelist and Emaillist 2687 //check if we have a match in Namelist and Emaillist
2680 if ((namelist.count() == 0) && (emaillist.count() > 0)) { 2688 if ((namelist.count() == 0) && (emaillist.count() > 0)) {
2681 foundUid = emaillist[0].uid(); 2689 foundUid = emaillist[0].uid();
2682 } 2690 }
2683 else if ((namelist.count() > 0) && (emaillist.count() == 0)) 2691 else if ((namelist.count() > 0) && (emaillist.count() == 0))
2684 foundUid = namelist[0].uid(); 2692 foundUid = namelist[0].uid();
2685 else 2693 else
2686 { 2694 {
2687 for (int i = 0; i < namelist.count(); i++) 2695 for (int i = 0; i < namelist.count(); i++)
2688 { 2696 {
2689 for (int j = 0; j < emaillist.count(); j++) 2697 for (int j = 0; j < emaillist.count(); j++)
2690 { 2698 {
2691 if (namelist[i] == emaillist[j]) 2699 if (namelist[i] == emaillist[j])
2692 { 2700 {
2693 foundUid = namelist[i].uid(); 2701 foundUid = namelist[i].uid();
2694 } 2702 }
2695 } 2703 }
2696 } 2704 }
2697 } 2705 }
2698 } 2706 }
2699 else 2707 else
2700 { 2708 {
2701 foundUid = uid; 2709 foundUid = uid;
2702 } 2710 }
2703 2711
2704 if (!foundUid.isEmpty()) 2712 if (!foundUid.isEmpty())
2705 { 2713 {
2706 2714
2707 // raise Ka/Pi if it is in the background 2715 // raise Ka/Pi if it is in the background
2708#ifndef DESKTOP_VERSION 2716#ifndef DESKTOP_VERSION
2709#ifndef KORG_NODCOP 2717#ifndef KORG_NODCOP
2710 //QCopEnvelope e("QPE/Application/kapi", "raise()"); 2718 //QCopEnvelope e("QPE/Application/kapi", "raise()");
2711#endif 2719#endif
2712#endif 2720#endif
2713 2721
2714 mMainWindow->showMaximized(); 2722 mMainWindow->showMaximized();
2715 mMainWindow-> raise(); 2723 mMainWindow-> raise();
2716 2724
2717 mViewManager->setSelected( "", false); 2725 mViewManager->setSelected( "", false);
2718 mViewManager->refreshView( "" ); 2726 mViewManager->refreshView( "" );
2719 mViewManager->setSelected( foundUid, true ); 2727 mViewManager->setSelected( foundUid, true );
2720 mViewManager->refreshView( foundUid ); 2728 mViewManager->refreshView( foundUid );
2721 2729
2722 if ( !mMultipleViewsAtOnce ) 2730 if ( !mMultipleViewsAtOnce )
2723 { 2731 {
2724 setDetailsVisible( true ); 2732 setDetailsVisible( true );
2725 mActionDetails->setChecked(true); 2733 mActionDetails->setChecked(true);
2726 } 2734 }
2727 } 2735 }
2728} 2736}
2729 2737void KABCore::storagehowto()
2738{
2739 KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" );
2740}
2730void KABCore::whatsnew() 2741void KABCore::whatsnew()
2731{ 2742{
2732 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 2743 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
2733} 2744}
2734void KABCore::synchowto() 2745void KABCore::synchowto()
2735{ 2746{
2736 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 2747 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
2737} 2748}
2738void KABCore::kdesynchowto() 2749void KABCore::kdesynchowto()
2739{ 2750{
2740 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); 2751 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
2741} 2752}
2742void KABCore::multisynchowto() 2753void KABCore::multisynchowto()
2743{ 2754{
2744 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); 2755 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
2745} 2756}
2746void KABCore::faq() 2757void KABCore::faq()
2747{ 2758{
2748 KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); 2759 KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" );
2749} 2760}
2750 2761
2751#include <libkcal/syncdefines.h> 2762#include <libkcal/syncdefines.h>
2752 2763
2753KABC::Addressee KABCore::getLastSyncAddressee() 2764KABC::Addressee KABCore::getLastSyncAddressee()
2754{ 2765{
2755 Addressee lse; 2766 Addressee lse;
2756 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2767 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2757 2768
2758 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); 2769 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() );
2759 lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); 2770 lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice );
2760 if (lse.isEmpty()) { 2771 if (lse.isEmpty()) {
2761 qDebug("KA: Creating new last-syncAddressee "); 2772 qDebug("KA: Creating new last-syncAddressee ");
2762 lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); 2773 lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice );
2763 QString sum = ""; 2774 QString sum = "";
2764 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) 2775 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
2765 sum = "E: "; 2776 sum = "E: ";
2766 lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); 2777 lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event"));
2767 lse.setRevision( mLastAddressbookSync ); 2778 lse.setRevision( mLastAddressbookSync );
2768 lse.setCategories( i18n("SyncEvent") ); 2779 lse.setCategories( i18n("SyncEvent") );
2769 mAddressBook->insertAddressee( lse ); 2780 mAddressBook->insertAddressee( lse );
2770 } 2781 }
2771 return lse; 2782 return lse;
2772} 2783}
2773int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) 2784int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full )
2774{ 2785{
2775 2786
2776 //void setZaurusId(int id); 2787 //void setZaurusId(int id);
2777 // int zaurusId() const; 2788 // int zaurusId() const;
2778 // void setZaurusUid(int id); 2789 // void setZaurusUid(int id);
2779 // int zaurusUid() const; 2790 // int zaurusUid() const;
2780 // void setZaurusStat(int id); 2791 // void setZaurusStat(int id);
2781 // int zaurusStat() const; 2792 // int zaurusStat() const;
2782 // 0 equal 2793 // 0 equal
2783 // 1 take local 2794 // 1 take local
2784 // 2 take remote 2795 // 2 take remote
2785 // 3 cancel 2796 // 3 cancel
2786 QDateTime lastSync = mLastAddressbookSync; 2797 QDateTime lastSync = mLastAddressbookSync;
2787 QDateTime localMod = local->revision(); 2798 QDateTime localMod = local->revision();
2788 QDateTime remoteMod = remote->revision(); 2799 QDateTime remoteMod = remote->revision();
2789 2800
2790 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2801 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2791 2802
2792 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2803 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2793 bool remCh, locCh; 2804 bool remCh, locCh;
2794 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); 2805 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) );
2795 //if ( remCh ) 2806 //if ( remCh )
2796 // qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); 2807 // qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
2797 locCh = ( localMod > mLastAddressbookSync ); 2808 locCh = ( localMod > mLastAddressbookSync );
2798 //qDebug("cahnged rem %d loc %d",remCh, locCh ); 2809 //qDebug("cahnged rem %d loc %d",remCh, locCh );
2799 if ( !remCh && ! locCh ) { 2810 if ( !remCh && ! locCh ) {
2800 //qDebug("both not changed "); 2811 //qDebug("both not changed ");
2801 lastSync = localMod.addDays(1); 2812 lastSync = localMod.addDays(1);
2802 if ( mode <= SYNC_PREF_ASK ) 2813 if ( mode <= SYNC_PREF_ASK )
2803 return 0; 2814 return 0;
2804 } else { 2815 } else {
2805 if ( locCh ) { 2816 if ( locCh ) {
2806 //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1()); 2817 //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1());
2807 lastSync = localMod.addDays( -1 ); 2818 lastSync = localMod.addDays( -1 );
2808 if ( !remCh ) 2819 if ( !remCh )
2809 remoteMod =( lastSync.addDays( -1 ) ); 2820 remoteMod =( lastSync.addDays( -1 ) );
2810 } else { 2821 } else {
2811 //qDebug(" not loc changed "); 2822 //qDebug(" not loc changed ");
2812 lastSync = localMod.addDays( 1 ); 2823 lastSync = localMod.addDays( 1 );
2813 if ( remCh ) { 2824 if ( remCh ) {
2814 //qDebug("rem changed "); 2825 //qDebug("rem changed ");
2815 remoteMod =( lastSync.addDays( 1 ) ); 2826 remoteMod =( lastSync.addDays( 1 ) );
2816 } 2827 }
2817 2828
2818 } 2829 }
2819 } 2830 }
2820 full = true; 2831 full = true;
2821 if ( mode < SYNC_PREF_ASK ) 2832 if ( mode < SYNC_PREF_ASK )
2822 mode = SYNC_PREF_ASK; 2833 mode = SYNC_PREF_ASK;
2823 } else { 2834 } else {
2824 if ( localMod == remoteMod ) 2835 if ( localMod == remoteMod )
2825 return 0; 2836 return 0;
2826 2837
2827 } 2838 }
2828 //qDebug("%s %s --- %d %d", localMod.toString().latin1() , remoteMod.toString().latin1(), localMod.time().msec(), remoteMod.time().msec()); 2839 //qDebug("%s %s --- %d %d", localMod.toString().latin1() , remoteMod.toString().latin1(), localMod.time().msec(), remoteMod.time().msec());
2829 //qDebug("lastsync %s ", lastSync.toString().latin1() ); 2840 //qDebug("lastsync %s ", lastSync.toString().latin1() );
2830 //full = true; //debug only 2841 //full = true; //debug only
2831 if ( full ) { 2842 if ( full ) {
2832 bool equ = ( (*local) == (*remote) ); 2843 bool equ = ( (*local) == (*remote) );
2833 if ( equ ) { 2844 if ( equ ) {
2834 //qDebug("equal "); 2845 //qDebug("equal ");
2835 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2846 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2836 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); 2847 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) );
2837 } 2848 }
2838 if ( mode < SYNC_PREF_FORCE_LOCAL ) 2849 if ( mode < SYNC_PREF_FORCE_LOCAL )
2839 return 0; 2850 return 0;
2840 2851
2841 }//else //debug only 2852 }//else //debug only
2842 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1()); 2853 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1());
2843 } 2854 }
2844 int result; 2855 int result;
2845 bool localIsNew; 2856 bool localIsNew;
2846 //qDebug("%s -- %s mLastCalendarSync %s lastsync %s --- local %s remote %s ",local->summary().latin1(), remote->summary().latin1(),mLastCalendarSync.toString().latin1() ,lastSync.toString().latin1() , local->lastModified().toString().latin1() , remote->lastModified().toString().latin1() ); 2857 //qDebug("%s -- %s mLastCalendarSync %s lastsync %s --- local %s remote %s ",local->summary().latin1(), remote->summary().latin1(),mLastCalendarSync.toString().latin1() ,lastSync.toString().latin1() , local->lastModified().toString().latin1() , remote->lastModified().toString().latin1() );
2847 2858
2848 if ( full && mode < SYNC_PREF_NEWEST ) 2859 if ( full && mode < SYNC_PREF_NEWEST )
2849 mode = SYNC_PREF_ASK; 2860 mode = SYNC_PREF_ASK;
2850 2861
2851 switch( mode ) { 2862 switch( mode ) {
2852 case SYNC_PREF_LOCAL: 2863 case SYNC_PREF_LOCAL:
2853 if ( lastSync > remoteMod ) 2864 if ( lastSync > remoteMod )
2854 return 1; 2865 return 1;
2855 if ( lastSync > localMod ) 2866 if ( lastSync > localMod )
2856 return 2; 2867 return 2;
2857 return 1; 2868 return 1;
2858 break; 2869 break;
2859 case SYNC_PREF_REMOTE: 2870 case SYNC_PREF_REMOTE:
2860 if ( lastSync > remoteMod ) 2871 if ( lastSync > remoteMod )
2861 return 1; 2872 return 1;
2862 if ( lastSync > localMod ) 2873 if ( lastSync > localMod )
2863 return 2; 2874 return 2;
2864 return 2; 2875 return 2;
2865 break; 2876 break;
2866 case SYNC_PREF_NEWEST: 2877 case SYNC_PREF_NEWEST:
2867 if ( localMod > remoteMod ) 2878 if ( localMod > remoteMod )
2868 return 1; 2879 return 1;
2869 else 2880 else
2870 return 2; 2881 return 2;
2871 break; 2882 break;
2872 case SYNC_PREF_ASK: 2883 case SYNC_PREF_ASK:
2873 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); 2884 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() );
2874 if ( lastSync > remoteMod ) 2885 if ( lastSync > remoteMod )
2875 return 1; 2886 return 1;
2876 if ( lastSync > localMod ) { 2887 if ( lastSync > localMod ) {
2877 return 2; 2888 return 2;
2878 } 2889 }
2879 localIsNew = localMod >= remoteMod; 2890 localIsNew = localMod >= remoteMod;
2880 //qDebug("conflict! ************************************** "); 2891 //qDebug("conflict! ************************************** ");
2881 { 2892 {
2882 KABC::AddresseeChooser acd ( *local,*remote, localIsNew , this ); 2893 KABC::AddresseeChooser acd ( *local,*remote, localIsNew , this );
2883 result = acd.executeD(localIsNew); 2894 result = acd.executeD(localIsNew);
2884 return result; 2895 return result;
2885 } 2896 }
2886 break; 2897 break;
2887 case SYNC_PREF_FORCE_LOCAL: 2898 case SYNC_PREF_FORCE_LOCAL:
2888 return 1; 2899 return 1;
2889 break; 2900 break;
2890 case SYNC_PREF_FORCE_REMOTE: 2901 case SYNC_PREF_FORCE_REMOTE:
2891 return 2; 2902 return 2;
2892 break; 2903 break;
2893 2904
2894 default: 2905 default:
2895 // SYNC_PREF_TAKE_BOTH not implemented 2906 // SYNC_PREF_TAKE_BOTH not implemented
2896 break; 2907 break;
2897 } 2908 }
2898 return 0; 2909 return 0;
2899} 2910}
2900 2911
2901 2912
2902bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode) 2913bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode)
2903{ 2914{
2904 bool syncOK = true; 2915 bool syncOK = true;
2905 int addedAddressee = 0; 2916 int addedAddressee = 0;
2906 int addedAddresseeR = 0; 2917 int addedAddresseeR = 0;
2907 int deletedAddresseeR = 0; 2918 int deletedAddresseeR = 0;
2908 int deletedAddresseeL = 0; 2919 int deletedAddresseeL = 0;
2909 int changedLocal = 0; 2920 int changedLocal = 0;
2910 int changedRemote = 0; 2921 int changedRemote = 0;
2911 int filteredIN = 0; 2922 int filteredIN = 0;
2912 int filteredOUT = 0; 2923 int filteredOUT = 0;
2913 2924
2914 QString mCurrentSyncName = syncManager->getCurrentSyncName(); 2925 QString mCurrentSyncName = syncManager->getCurrentSyncName();
2915 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2926 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2916 2927
2917 //QPtrList<Addressee> el = local->rawAddressees(); 2928 //QPtrList<Addressee> el = local->rawAddressees();
2918 Addressee addresseeR; 2929 Addressee addresseeR;
2919 QString uid; 2930 QString uid;
2920 int take; 2931 int take;
2921 Addressee addresseeL; 2932 Addressee addresseeL;
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index 4cef73a..80dbf08 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -1,526 +1,528 @@
1/* 1/*
2 This file is part of KAddressbook. 2 This file is part of KAddressbook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef KABCORE_H 24#ifndef KABCORE_H
25#define KABCORE_H 25#define KABCORE_H
26 26
27#include <kabc/field.h> 27#include <kabc/field.h>
28 28
29#ifndef KAB_EMBEDDED 29#ifndef KAB_EMBEDDED
30#endif //KAB_EMBEDDED 30#endif //KAB_EMBEDDED
31#include <qdict.h> 31#include <qdict.h>
32#include <qtimer.h> 32#include <qtimer.h>
33 33
34#include <qwidget.h> 34#include <qwidget.h>
35#include <qpopupmenu.h> 35#include <qpopupmenu.h>
36#include <ksyncmanager.h> 36#include <ksyncmanager.h>
37#ifndef DESKTOP_VERSION 37#ifndef DESKTOP_VERSION
38#include <qcopchannel_qws.h> 38#include <qcopchannel_qws.h>
39#endif 39#endif
40 40
41namespace KABC { 41namespace KABC {
42class AddressBook; 42class AddressBook;
43} 43}
44 44
45#ifndef KAB_EMBEDDED 45#ifndef KAB_EMBEDDED
46class KAboutData; 46class KAboutData;
47class KConfig; 47class KConfig;
48 48
49class KAddressBookService; 49class KAddressBookService;
50class LDAPSearchDialog; 50class LDAPSearchDialog;
51#else //KAB_EMBEDDED 51#else //KAB_EMBEDDED
52class KAddressBookMain; 52class KAddressBookMain;
53//US class QAction; 53//US class QAction;
54#endif //KAB_EMBEDDED 54#endif //KAB_EMBEDDED
55class KCMultiDialog; 55class KCMultiDialog;
56class KXMLGUIClient; 56class KXMLGUIClient;
57class ExtensionManager; 57class ExtensionManager;
58class XXPortManager; 58class XXPortManager;
59class JumpButtonBar; 59class JumpButtonBar;
60class IncSearchWidget; 60class IncSearchWidget;
61class KDGanttMinimizeSplitter; 61class KDGanttMinimizeSplitter;
62class KAction; 62class KAction;
63class KActionCollection; 63class KActionCollection;
64class KToggleAction; 64class KToggleAction;
65class KSyncProfile; 65class KSyncProfile;
66 66
67class QAction; 67class QAction;
68class QMenuBar; 68class QMenuBar;
69class QSplitter; 69class QSplitter;
70class ViewContainer; 70class ViewContainer;
71class ViewManager; 71class ViewManager;
72class AddresseeEditorDialog; 72class AddresseeEditorDialog;
73class Ir; 73class Ir;
74 74
75class KABCore : public QWidget, public KSyncInterface 75class KABCore : public QWidget, public KSyncInterface
76{ 76{
77 Q_OBJECT 77 Q_OBJECT
78 78
79 public: 79 public:
80 KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name = 0 ); 80 KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name = 0 );
81 81
82 82
83 ~KABCore(); 83 ~KABCore();
84 84
85 85
86#ifdef KAB_EMBEDDED 86#ifdef KAB_EMBEDDED
87 //US added functionality 87 //US added functionality
88 QPopupMenu* getViewMenu() {return viewMenu;} 88 QPopupMenu* getViewMenu() {return viewMenu;}
89 QPopupMenu* getFilterMenu() {return filterMenu;} 89 QPopupMenu* getFilterMenu() {return filterMenu;}
90 QPopupMenu* getSettingsMenu() {return settingsMenu;} 90 QPopupMenu* getSettingsMenu() {return settingsMenu;}
91 void addActionsManually(); 91 void addActionsManually();
92#endif //KAB_EMBEDDED 92#endif //KAB_EMBEDDED
93 /** 93 /**
94 Restores the global settings. 94 Restores the global settings.
95 */ 95 */
96 void restoreSettings(); 96 void restoreSettings();
97 97
98 98
99 99
100 /** 100 /**
101 Returns a pointer to the StdAddressBook of the application. 101 Returns a pointer to the StdAddressBook of the application.
102 */ 102 */
103 KABC::AddressBook *addressBook() const; 103 KABC::AddressBook *addressBook() const;
104 104
105 /** 105 /**
106 Returns a pointer to the KConfig object of the application. 106 Returns a pointer to the KConfig object of the application.
107 */ 107 */
108 static KConfig *config(); 108 static KConfig *config();
109 109
110 /** 110 /**
111 Returns a pointer to the global KActionCollection object. So 111 Returns a pointer to the global KActionCollection object. So
112 other classes can register their actions easily. 112 other classes can register their actions easily.
113 */ 113 */
114 KActionCollection *actionCollection() const; 114 KActionCollection *actionCollection() const;
115 115
116 /** 116 /**
117 Returns the current search field of the Incremental Search Widget. 117 Returns the current search field of the Incremental Search Widget.
118 */ 118 */
119 KABC::Field *currentSearchField() const; 119 KABC::Field *currentSearchField() const;
120 120
121 /** 121 /**
122 Returns the uid list of the currently selected contacts. 122 Returns the uid list of the currently selected contacts.
123 */ 123 */
124 QStringList selectedUIDs() const; 124 QStringList selectedUIDs() const;
125 125
126 /** 126 /**
127 Displays the ResourceSelectDialog and returns the selected 127 Displays the ResourceSelectDialog and returns the selected
128 resource or a null pointer if no resource was selected by 128 resource or a null pointer if no resource was selected by
129 the user. 129 the user.
130 */ 130 */
131 KABC::Resource *requestResource( QWidget *parent ); 131 KABC::Resource *requestResource( QWidget *parent );
132 132
133#ifndef KAB_EMBEDDED 133#ifndef KAB_EMBEDDED
134 static KAboutData *createAboutData(); 134 static KAboutData *createAboutData();
135#endif //KAB_EMBEDDED 135#endif //KAB_EMBEDDED
136 136
137#ifdef KAB_EMBEDDED 137#ifdef KAB_EMBEDDED
138 inline QPopupMenu* getImportMenu() { return ImportMenu;} 138 inline QPopupMenu* getImportMenu() { return ImportMenu;}
139 inline QPopupMenu* getExportMenu() { return ExportMenu;} 139 inline QPopupMenu* getExportMenu() { return ExportMenu;}
140#endif //KAB_EMBEDDED 140#endif //KAB_EMBEDDED
141 141
142 public slots: 142 public slots:
143#ifdef KAB_EMBEDDED 143#ifdef KAB_EMBEDDED
144 void createAboutData(); 144 void createAboutData();
145#endif //KAB_EMBEDDED 145#endif //KAB_EMBEDDED
146 void setDetailsToggle(); 146 void setDetailsToggle();
147 147
148 void showLicence(); 148 void showLicence();
149 void faq(); 149 void faq();
150 void whatsnew() ; 150 void whatsnew() ;
151 void synchowto() ; 151 void synchowto() ;
152 void storagehowto() ;
152 void multisynchowto() ; 153 void multisynchowto() ;
153 void kdesynchowto() ; 154 void kdesynchowto() ;
154 void writeToPhone(); 155 void writeToPhone();
155 156
156 /** 157 /**
157 Is called whenever a contact is selected in the view. 158 Is called whenever a contact is selected in the view.
158 */ 159 */
159 void setContactSelected( const QString &uid ); 160 void setContactSelected( const QString &uid );
160 161
161 /** 162 /**
162 Opens the preferred mail composer with all selected contacts as 163 Opens the preferred mail composer with all selected contacts as
163 arguments. 164 arguments.
164 */ 165 */
165 void sendMail(); 166 void sendMail();
166 167
167 /** 168 /**
168 Opens the preferred mail composer with the given contacts as 169 Opens the preferred mail composer with the given contacts as
169 arguments. 170 arguments.
170 */ 171 */
171 void sendMail( const QString& email ); 172 void sendMail( const QString& email );
172 173
173 174
174 void mailVCard(); 175 void mailVCard();
175 void mailVCard(const QStringList& uids); 176 void mailVCard(const QStringList& uids);
176 177
177 /** 178 /**
178 Beams the "WhoAmI contact. 179 Beams the "WhoAmI contact.
179 */ 180 */
180 void beamMySelf(); 181 void beamMySelf();
181 182
182 void beamVCard(); 183 void beamVCard();
183 void export2phone(); 184 void export2phone();
184 void beamVCard(const QStringList& uids); 185 void beamVCard(const QStringList& uids);
185 void beamDone( Ir *ir ); 186 void beamDone( Ir *ir );
186 187
187 188
188 /** 189 /**
189 Starts the preferred web browser with the given URL as argument. 190 Starts the preferred web browser with the given URL as argument.
190 */ 191 */
191 void browse( const QString& url ); 192 void browse( const QString& url );
192 193
193 /** 194 /**
194 Select all contacts in the view. 195 Select all contacts in the view.
195 */ 196 */
196 void selectAllContacts(); 197 void selectAllContacts();
197 198
198 /** 199 /**
199 Deletes all selected contacts from the address book. 200 Deletes all selected contacts from the address book.
200 */ 201 */
201 void deleteContacts(); 202 void deleteContacts();
202 203
203 /** 204 /**
204 Deletes given contacts from the address book. 205 Deletes given contacts from the address book.
205 206
206 @param uids The uids of the contacts, which shall be deleted. 207 @param uids The uids of the contacts, which shall be deleted.
207 */ 208 */
208 void deleteContacts( const QStringList &uids ); 209 void deleteContacts( const QStringList &uids );
209 210
210 /** 211 /**
211 Copys the selected contacts into clipboard for later pasting. 212 Copys the selected contacts into clipboard for later pasting.
212 */ 213 */
213 void copyContacts(); 214 void copyContacts();
214 215
215 /** 216 /**
216 Cuts the selected contacts and stores them for later pasting. 217 Cuts the selected contacts and stores them for later pasting.
217 */ 218 */
218 void cutContacts(); 219 void cutContacts();
219 220
220 /** 221 /**
221 Paste contacts from clipboard into the address book. 222 Paste contacts from clipboard into the address book.
222 */ 223 */
223 void pasteContacts(); 224 void pasteContacts();
224 225
225 /** 226 /**
226 Paste given contacts into the address book. 227 Paste given contacts into the address book.
227 228
228 @param list The list of addressee, which shall be pasted. 229 @param list The list of addressee, which shall be pasted.
229 */ 230 */
230 void pasteContacts( KABC::Addressee::List &list ); 231 void pasteContacts( KABC::Addressee::List &list );
231 232
232 /** 233 /**
233 Sets the whoAmI contact, that is used by many other programs to 234 Sets the whoAmI contact, that is used by many other programs to
234 get personal information about the current user. 235 get personal information about the current user.
235 */ 236 */
236 void setWhoAmI(); 237 void setWhoAmI();
237 238
238 /** 239 /**
239 Displays the category dialog and applies the result to all 240 Displays the category dialog and applies the result to all
240 selected contacts. 241 selected contacts.
241 */ 242 */
242 void setCategories(); 243 void setCategories();
243 void manageCategories(); 244 void manageCategories();
244 void editCategories(); 245 void editCategories();
245 246
246 /** 247 /**
247 Sets the field list of the Incremental Search Widget. 248 Sets the field list of the Incremental Search Widget.
248 */ 249 */
249 void setSearchFields( const KABC::Field::List &fields ); 250 void setSearchFields( const KABC::Field::List &fields );
250 251
251 /** 252 /**
252 Search with the current search field for a contact, that matches 253 Search with the current search field for a contact, that matches
253 the given text, and selects it in the view. 254 the given text, and selects it in the view.
254 */ 255 */
255 void incrementalSearch( const QString& text ); 256 void incrementalSearch( const QString& text );
256 void incrementalSearchJump( const QString& text ); 257 void incrementalSearchJump( const QString& text );
257 258
258 /** 259 /**
259 Marks the address book as modified. 260 Marks the address book as modified.
260 */ 261 */
261 void setModified(); 262 void setModified();
262 /** 263 /**
263 Marks the address book as modified without refreshing the view. 264 Marks the address book as modified without refreshing the view.
264 */ 265 */
265 void setModifiedWOrefresh(); 266 void setModifiedWOrefresh();
266 267
267 /** 268 /**
268 Marks the address book as modified concerning the argument. 269 Marks the address book as modified concerning the argument.
269 */ 270 */
270 void setModified( bool modified ); 271 void setModified( bool modified );
271 272
272 /** 273 /**
273 Returns whether the address book is modified. 274 Returns whether the address book is modified.
274 */ 275 */
275 bool modified() const; 276 bool modified() const;
276 277
277 /** 278 /**
278 Called whenever an contact is modified in the contact editor 279 Called whenever an contact is modified in the contact editor
279 dialog or the quick edit. 280 dialog or the quick edit.
280 */ 281 */
281 void contactModified( const KABC::Addressee &addr ); 282 void contactModified( const KABC::Addressee &addr );
282 void addrModified( const KABC::Addressee &addr, bool updateDetails = true ); 283 void addrModified( const KABC::Addressee &addr, bool updateDetails = true );
283 284
284 /** 285 /**
285 DCOP METHODS. 286 DCOP METHODS.
286 */ 287 */
287 void addEmail( QString addr ); 288 void addEmail( QString addr );
288 void importVCard( const KURL& url, bool showPreview ); 289 void importVCard( const KURL& url, bool showPreview );
289 void importVCard( const QString& vCard, bool showPreview ); 290 void importVCard( const QString& vCard, bool showPreview );
290 void newContact(); 291 void newContact();
291 QString getNameByPhone( const QString& phone ); 292 QString getNameByPhone( const QString& phone );
292 /** 293 /**
293 END DCOP METHODS 294 END DCOP METHODS
294 */ 295 */
295 296
296 /** 297 /**
297 Saves the contents of the AddressBook back to disk. 298 Saves the contents of the AddressBook back to disk.
298 */ 299 */
299 void save(); 300 void save();
300 301
301 /** 302 /**
302 Undos the last command using the undo stack. 303 Undos the last command using the undo stack.
303 */ 304 */
304 void undo(); 305 void undo();
305 306
306 /** 307 /**
307 Redos the last command that was undone, using the redo stack. 308 Redos the last command that was undone, using the redo stack.
308 */ 309 */
309 void redo(); 310 void redo();
310 311
311 /** 312 /**
312 Shows the edit dialog for the given uid. If the uid is QString::null, 313 Shows the edit dialog for the given uid. If the uid is QString::null,
313 the method will try to find a selected addressee in the view. 314 the method will try to find a selected addressee in the view.
314 */ 315 */
315 void editContact( const QString &uid /*US = QString::null*/ ); 316 void editContact( const QString &uid /*US = QString::null*/ );
316//US added a second method without defaultparameter 317//US added a second method without defaultparameter
317 void editContact2(); 318 void editContact2();
318 319
319 /** 320 /**
320 Shows or edits the detail view for the given uid. If the uid is QString::null, 321 Shows or edits the detail view for the given uid. If the uid is QString::null,
321 the method will try to find a selected addressee in the view. 322 the method will try to find a selected addressee in the view.
322 */ 323 */
323 void executeContact( const QString &uid /*US = QString::null*/ ); 324 void executeContact( const QString &uid /*US = QString::null*/ );
324 325
325 /** 326 /**
326 Launches the configuration dialog. 327 Launches the configuration dialog.
327 */ 328 */
328 void openConfigDialog(); 329 void openConfigDialog();
329 330
330 /** 331 /**
331 Launches the ldap search dialog. 332 Launches the ldap search dialog.
332 */ 333 */
333 void openLDAPDialog(); 334 void openLDAPDialog();
334 335
335 /** 336 /**
336 Creates a KAddressBookPrinter, which will display the print 337 Creates a KAddressBookPrinter, which will display the print
337 dialog and do the printing. 338 dialog and do the printing.
338 */ 339 */
339 void print(); 340 void print();
340 341
341 /** 342 /**
342 Registers a new GUI client, so plugins can register its actions. 343 Registers a new GUI client, so plugins can register its actions.
343 */ 344 */
344 void addGUIClient( KXMLGUIClient *client ); 345 void addGUIClient( KXMLGUIClient *client );
345 346
346 void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); 347 void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid);
347 void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); 348 void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid);
348 void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); 349 void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid);
349 350
350 351
351 signals: 352 signals:
352 void contactSelected( const QString &name ); 353 void contactSelected( const QString &name );
353 void contactSelected( const QPixmap &pixmap ); 354 void contactSelected( const QPixmap &pixmap );
354 public slots: 355 public slots:
355 void recieve(QString cmsg ); 356 void recieve(QString cmsg );
356 void getFile( bool success ); 357 void getFile( bool success );
357 void syncFileRequest(); 358 void syncFileRequest();
358 void setDetailsVisible( bool visible ); 359 void setDetailsVisible( bool visible );
359 void setDetailsToState(); 360 void setDetailsToState();
360 361
361 void saveSettings(); 362 void saveSettings();
362 363
363 private slots: 364 private slots:
364 void updateToolBar(); 365 void updateToolBar();
365 void updateMainWindow(); 366 void updateMainWindow();
366 void receive( const QCString& cmsg, const QByteArray& data ); 367 void receive( const QCString& cmsg, const QByteArray& data );
367 void toggleBeamReceive( ); 368 void toggleBeamReceive( );
368 void disableBR(bool); 369 void disableBR(bool);
369 void setJumpButtonBarVisible( bool visible ); 370 void setJumpButtonBarVisible( bool visible );
370 void setJumpButtonBar( bool visible ); 371 void setJumpButtonBar( bool visible );
371 void setCaptionBack(); 372 void setCaptionBack();
372 void resizeAndCallContactdialog(); 373 void resizeAndCallContactdialog();
373 void callContactdialog(); 374 void callContactdialog();
374 375
375 void importFromOL(); 376 void importFromOL();
376 void extensionModified( const KABC::Addressee::List &list ); 377 void extensionModified( const KABC::Addressee::List &list );
377 void extensionChanged( int id ); 378 void extensionChanged( int id );
378 void clipboardDataChanged(); 379 void clipboardDataChanged();
379 void updateActionMenu(); 380 void updateActionMenu();
380 void configureKeyBindings(); 381 void configureKeyBindings();
381 void removeVoice(); 382 void removeVoice();
382 void setFormattedName(); 383 void setFormattedName();
383#ifdef KAB_EMBEDDED 384#ifdef KAB_EMBEDDED
384 void configureResources(); 385 void configureResources();
385#endif //KAB_EMBEDDED 386#endif //KAB_EMBEDDED
386 387
387 void slotEditorDestroyed( const QString &uid ); 388 void slotEditorDestroyed( const QString &uid );
388 void configurationChanged(); 389 void configurationChanged();
389 void addressBookChanged(); 390 void addressBookChanged();
390 391
391 private: 392 private:
392 QString mEmailSourceChannel; 393 QString mEmailSourceChannel;
393 QString mEmailSourceUID; 394 QString mEmailSourceUID;
394 void resizeEvent(QResizeEvent* e ); 395 void resizeEvent(QResizeEvent* e );
395 bool mBRdisabled; 396 bool mBRdisabled;
396#ifndef DESKTOP_VERSION 397#ifndef DESKTOP_VERSION
397 QCopChannel* infrared; 398 QCopChannel* infrared;
398#endif 399#endif
399 QTimer *mMessageTimer; 400 QTimer *mMessageTimer;
400 void initGUI(); 401 void initGUI();
401 void initActions(); 402 void initActions();
402 QString getPhoneFile(); 403 QString getPhoneFile();
403 404
404 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, 405 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent,
405 const char *name = 0 ); 406 const char *name = 0 );
406 407
407 KXMLGUIClient *mGUIClient; 408 KXMLGUIClient *mGUIClient;
408 409
409 KABC::AddressBook *mAddressBook; 410 KABC::AddressBook *mAddressBook;
410 411
411 ViewManager *mViewManager; 412 ViewManager *mViewManager;
412 // QSplitter *mDetailsSplitter; 413 // QSplitter *mDetailsSplitter;
413 KDGanttMinimizeSplitter *mExtensionBarSplitter; 414 KDGanttMinimizeSplitter *mExtensionBarSplitter;
414 ViewContainer *mDetails; 415 ViewContainer *mDetails;
415 KDGanttMinimizeSplitter* mMiniSplitter; 416 KDGanttMinimizeSplitter* mMiniSplitter;
416 XXPortManager *mXXPortManager; 417 XXPortManager *mXXPortManager;
417 JumpButtonBar *mJumpButtonBar; 418 JumpButtonBar *mJumpButtonBar;
418 IncSearchWidget *mIncSearchWidget; 419 IncSearchWidget *mIncSearchWidget;
419 ExtensionManager *mExtensionManager; 420 ExtensionManager *mExtensionManager;
420 421
421 KCMultiDialog *mConfigureDialog; 422 KCMultiDialog *mConfigureDialog;
422 423
423#ifndef KAB_EMBEDDED 424#ifndef KAB_EMBEDDED
424 LDAPSearchDialog *mLdapSearchDialog; 425 LDAPSearchDialog *mLdapSearchDialog;
425#endif //KAB_EMBEDDED 426#endif //KAB_EMBEDDED
426 // QDict<AddresseeEditorDialog> mEditorDict; 427 // QDict<AddresseeEditorDialog> mEditorDict;
427 AddresseeEditorDialog *mEditorDialog; 428 AddresseeEditorDialog *mEditorDialog;
428 bool mReadWrite; 429 bool mReadWrite;
429 bool mModified; 430 bool mModified;
430 bool mIsPart; 431 bool mIsPart;
431 bool mMultipleViewsAtOnce; 432 bool mMultipleViewsAtOnce;
432 433
433 434
434 //US file menu 435 //US file menu
435 KAction *mActionMail; 436 KAction *mActionMail;
436 KAction *mActionBeam; 437 KAction *mActionBeam;
437 KToggleAction *mActionBR; 438 KToggleAction *mActionBR;
438 KAction *mActionExport2phone; 439 KAction *mActionExport2phone;
439 KAction* mActionPrint; 440 KAction* mActionPrint;
440 KAction* mActionPrintDetails; 441 KAction* mActionPrintDetails;
441 KAction* mActionNewContact; 442 KAction* mActionNewContact;
442 KAction *mActionSave; 443 KAction *mActionSave;
443 KAction *mActionEditAddressee; 444 KAction *mActionEditAddressee;
444 KAction *mActionMailVCard; 445 KAction *mActionMailVCard;
445 KAction *mActionBeamVCard; 446 KAction *mActionBeamVCard;
446 447
447 KAction *mActionQuit; 448 KAction *mActionQuit;
448 449
449 //US edit menu 450 //US edit menu
450 KAction *mActionCopy; 451 KAction *mActionCopy;
451 KAction *mActionCut; 452 KAction *mActionCut;
452 KAction *mActionPaste; 453 KAction *mActionPaste;
453 KAction *mActionSelectAll; 454 KAction *mActionSelectAll;
454 KAction *mActionUndo; 455 KAction *mActionUndo;
455 KAction *mActionRedo; 456 KAction *mActionRedo;
456 KAction *mActionDelete; 457 KAction *mActionDelete;
457 458
458 //US settings menu 459 //US settings menu
459 KAction *mActionConfigResources; 460 KAction *mActionConfigResources;
460 KAction *mActionConfigKAddressbook; 461 KAction *mActionConfigKAddressbook;
461 KAction *mActionConfigShortcuts; 462 KAction *mActionConfigShortcuts;
462 KAction *mActionConfigureToolbars; 463 KAction *mActionConfigureToolbars;
463 KAction *mActionKeyBindings; 464 KAction *mActionKeyBindings;
464 KToggleAction *mActionJumpBar; 465 KToggleAction *mActionJumpBar;
465 KToggleAction *mActionDetails; 466 KToggleAction *mActionDetails;
466 KAction *mActionWhoAmI; 467 KAction *mActionWhoAmI;
467 KAction *mActionCategories; 468 KAction *mActionCategories;
468 KAction *mActionEditCategories; 469 KAction *mActionEditCategories;
469 KAction *mActionManageCategories; 470 KAction *mActionManageCategories;
470 KAction *mActionAboutKAddressbook; 471 KAction *mActionAboutKAddressbook;
471 KAction *mActionLicence; 472 KAction *mActionLicence;
472 KAction *mActionFaq; 473 KAction *mActionFaq;
473 KAction *mActionWN; 474 KAction *mActionWN;
474 KAction *mActionSyncHowto; 475 KAction *mActionSyncHowto;
476 KAction *mActionStorageHowto;
475 KAction *mActionKdeSyncHowto; 477 KAction *mActionKdeSyncHowto;
476 KAction *mActionMultiSyncHowto; 478 KAction *mActionMultiSyncHowto;
477 479
478 KAction *mActionDeleteView; 480 KAction *mActionDeleteView;
479 481
480 QPopupMenu *viewMenu; 482 QPopupMenu *viewMenu;
481 QPopupMenu *filterMenu; 483 QPopupMenu *filterMenu;
482 QPopupMenu *settingsMenu; 484 QPopupMenu *settingsMenu;
483 QPopupMenu *changeMenu; 485 QPopupMenu *changeMenu;
484 QPopupMenu *beamMenu; 486 QPopupMenu *beamMenu;
485//US QAction *mActionSave; 487//US QAction *mActionSave;
486 QPopupMenu *ImportMenu; 488 QPopupMenu *ImportMenu;
487 QPopupMenu *ExportMenu; 489 QPopupMenu *ExportMenu;
488 //LR additional methods 490 //LR additional methods
489 KAction *mActionRemoveVoice; 491 KAction *mActionRemoveVoice;
490 KAction *mActionSetFormattedName; 492 KAction *mActionSetFormattedName;
491 KAction * mActionImportOL; 493 KAction * mActionImportOL;
492 494
493#ifndef KAB_EMBEDDED 495#ifndef KAB_EMBEDDED
494 KAddressBookService *mAddressBookService; 496 KAddressBookService *mAddressBookService;
495#endif //KAB_EMBEDDED 497#endif //KAB_EMBEDDED
496 498
497 class KABCorePrivate; 499 class KABCorePrivate;
498 KABCorePrivate *d; 500 KABCorePrivate *d;
499 //US bool mBlockSaveFlag; 501 //US bool mBlockSaveFlag;
500 502
501#ifdef KAB_EMBEDDED 503#ifdef KAB_EMBEDDED
502 KAddressBookMain *mMainWindow; // should be the same like mGUIClient 504 KAddressBookMain *mMainWindow; // should be the same like mGUIClient
503#endif //KAB_EMBEDDED 505#endif //KAB_EMBEDDED
504 506
505 //this are the overwritten callbackmethods from the syncinterface 507 //this are the overwritten callbackmethods from the syncinterface
506 virtual bool sync(KSyncManager* manager, QString filename, int mode); 508 virtual bool sync(KSyncManager* manager, QString filename, int mode);
507 virtual bool syncExternal(KSyncManager* manager, QString resource); 509 virtual bool syncExternal(KSyncManager* manager, QString resource);
508 virtual void removeSyncInfo( QString syncProfile); 510 virtual void removeSyncInfo( QString syncProfile);
509 bool syncPhone(); 511 bool syncPhone();
510 void message( QString m , bool startTimer = true); 512 void message( QString m , bool startTimer = true);
511 513
512 // LR ******************************* 514 // LR *******************************
513 // sync stuff! 515 // sync stuff!
514 QString sentSyncFile(); 516 QString sentSyncFile();
515 QPopupMenu *syncMenu; 517 QPopupMenu *syncMenu;
516 KSyncManager* syncManager; 518 KSyncManager* syncManager;
517 int mGlobalSyncMode; 519 int mGlobalSyncMode;
518 bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); 520 bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode);
519 KABC::Addressee getLastSyncAddressee(); 521 KABC::Addressee getLastSyncAddressee();
520 QDateTime mLastAddressbookSync; 522 QDateTime mLastAddressbookSync;
521 int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); 523 int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full );
522 // ********************* 524 // *********************
523 525
524}; 526};
525 527
526#endif 528#endif
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 357154e..7aa3b60 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -893,695 +893,703 @@ void MainWindow::initActions()
893 this ); 893 this );
894 mNewSubTodoAction->addTo( actionMenu ); 894 mNewSubTodoAction->addTo( actionMenu );
895 connect( mNewSubTodoAction, SIGNAL( activated() ), 895 connect( mNewSubTodoAction, SIGNAL( activated() ),
896 mView, SLOT( newSubTodo() ) ); 896 mView, SLOT( newSubTodo() ) );
897 897
898 actionMenu->insertSeparator(); 898 actionMenu->insertSeparator();
899 899
900 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); 900 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this );
901 mShowAction->addTo( actionMenu ); 901 mShowAction->addTo( actionMenu );
902 connect( mShowAction, SIGNAL( activated() ), 902 connect( mShowAction, SIGNAL( activated() ),
903 mView, SLOT( showIncidence() ) ); 903 mView, SLOT( showIncidence() ) );
904 904
905 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 905 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
906 mEditAction->addTo( actionMenu ); 906 mEditAction->addTo( actionMenu );
907 connect( mEditAction, SIGNAL( activated() ), 907 connect( mEditAction, SIGNAL( activated() ),
908 mView, SLOT( editIncidence() ) ); 908 mView, SLOT( editIncidence() ) );
909 909
910 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 910 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
911 mDeleteAction->addTo( actionMenu ); 911 mDeleteAction->addTo( actionMenu );
912 connect( mDeleteAction, SIGNAL( activated() ), 912 connect( mDeleteAction, SIGNAL( activated() ),
913 mView, SLOT( deleteIncidence() ) ); 913 mView, SLOT( deleteIncidence() ) );
914 914
915 915
916 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 916 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
917 mCloneAction->addTo( actionMenu ); 917 mCloneAction->addTo( actionMenu );
918 connect( mCloneAction, SIGNAL( activated() ), 918 connect( mCloneAction, SIGNAL( activated() ),
919 mView, SLOT( cloneIncidence() ) ); 919 mView, SLOT( cloneIncidence() ) );
920 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 920 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
921 mMoveAction->addTo( actionMenu ); 921 mMoveAction->addTo( actionMenu );
922 connect( mMoveAction, SIGNAL( activated() ), 922 connect( mMoveAction, SIGNAL( activated() ),
923 mView, SLOT( moveIncidence() ) ); 923 mView, SLOT( moveIncidence() ) );
924 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 924 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
925 mBeamAction->addTo( actionMenu ); 925 mBeamAction->addTo( actionMenu );
926 connect( mBeamAction, SIGNAL( activated() ), 926 connect( mBeamAction, SIGNAL( activated() ),
927 mView, SLOT( beamIncidence() ) ); 927 mView, SLOT( beamIncidence() ) );
928 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 928 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
929 mCancelAction->addTo( actionMenu ); 929 mCancelAction->addTo( actionMenu );
930 connect( mCancelAction, SIGNAL( activated() ), 930 connect( mCancelAction, SIGNAL( activated() ),
931 mView, SLOT( toggleCancelIncidence() ) ); 931 mView, SLOT( toggleCancelIncidence() ) );
932 932
933 actionMenu->insertSeparator(); 933 actionMenu->insertSeparator();
934 934
935 action = new QAction( "purge_completed", i18n("Purge Completed"), 0, 935 action = new QAction( "purge_completed", i18n("Purge Completed"), 0,
936 this ); 936 this );
937 action->addTo( actionMenu ); 937 action->addTo( actionMenu );
938 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 938 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
939 939
940 icon = loadPixmap( pathString + "search" ); 940 icon = loadPixmap( pathString + "search" );
941 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 941 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
942 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); 942 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5);
943 search_action->addTo( actionMenu ); 943 search_action->addTo( actionMenu );
944 connect( search_action, SIGNAL( activated() ), 944 connect( search_action, SIGNAL( activated() ),
945 mView->dialogManager(), SLOT( showSearchDialog() ) ); 945 mView->dialogManager(), SLOT( showSearchDialog() ) );
946 946
947 947
948 948
949 if ( KOPrefs::instance()->mShowFullMenu ) { 949 if ( KOPrefs::instance()->mShowFullMenu ) {
950 actionMenu->insertSeparator(); 950 actionMenu->insertSeparator();
951 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 951 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
952 952
953 } 953 }
954 // actionMenu->insertSeparator(); 954 // actionMenu->insertSeparator();
955 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 955 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
956 this ); 956 this );
957 action->addTo( importMenu_X ); 957 action->addTo( importMenu_X );
958 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 958 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
959 action = new QAction( "import_quick", i18n("Import last file"), 0, 959 action = new QAction( "import_quick", i18n("Import last file"), 0,
960 this ); 960 this );
961 action->addTo( importMenu_X ); 961 action->addTo( importMenu_X );
962 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 962 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
963 importMenu_X->insertSeparator(); 963 importMenu_X->insertSeparator();
964 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 964 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
965 this ); 965 this );
966 action->addTo( importMenu_X ); 966 action->addTo( importMenu_X );
967 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 967 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
968 //#ifndef DESKTOP_VERSION 968 //#ifndef DESKTOP_VERSION
969 importMenu_X->insertSeparator(); 969 importMenu_X->insertSeparator();
970 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 970 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
971 this ); 971 this );
972 action->addTo( importMenu_X ); 972 action->addTo( importMenu_X );
973 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); 973 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
974 //#else 974 //#else
975#ifdef _OL_IMPORT_ 975#ifdef _OL_IMPORT_
976 importMenu_X->insertSeparator(); 976 importMenu_X->insertSeparator();
977 action = new QAction( "import_ol", i18n("Import from OL"), 0, 977 action = new QAction( "import_ol", i18n("Import from OL"), 0,
978 this ); 978 this );
979 action->addTo( importMenu_X ); 979 action->addTo( importMenu_X );
980 connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); 980 connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
981#endif 981#endif
982 //#endif 982 //#endif
983 983
984 //importMenu->insertSeparator(); 984 //importMenu->insertSeparator();
985 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, 985 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0,
986 this ); 986 this );
987 action->addTo( importMenu ); 987 action->addTo( importMenu );
988 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); 988 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
989 989
990 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, 990 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0,
991 this ); 991 this );
992 action->addTo( importMenu ); 992 action->addTo( importMenu );
993 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); 993 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
994 importMenu->insertSeparator(); 994 importMenu->insertSeparator();
995 importMenu->insertItem( i18n("Import"), importMenu_X ); 995 importMenu->insertItem( i18n("Import"), importMenu_X );
996 //importMenu->insertSeparator(); 996 //importMenu->insertSeparator();
997 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, 997 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
998 this ); 998 this );
999 action->addTo( exportMenu_X ); 999 action->addTo( exportMenu_X );
1000 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); 1000 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
1001 1001
1002 1002
1003 //LR 1003 //LR
1004 QPopupMenu *ex2phone = new QPopupMenu( this ); 1004 QPopupMenu *ex2phone = new QPopupMenu( this );
1005 ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1005 ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1006 ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1006 ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1007 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); 1007 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) );
1008 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); 1008 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone );
1009 1009
1010 importMenu->insertItem( i18n("Export"), exportMenu_X ); 1010 importMenu->insertItem( i18n("Export"), exportMenu_X );
1011#ifndef DESKTOP_VERSION 1011#ifndef DESKTOP_VERSION
1012 //importMenu->insertSeparator(); 1012 //importMenu->insertSeparator();
1013 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, 1013 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0,
1014 this ); 1014 this );
1015 brAction->addTo( beamMenu_X ); 1015 brAction->addTo( beamMenu_X );
1016 brAction->setToggleAction (true ) ; 1016 brAction->setToggleAction (true ) ;
1017 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); 1017 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) );
1018 1018
1019 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, 1019 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0,
1020 this ); 1020 this );
1021 action->addTo( beamMenu_X ); 1021 action->addTo( beamMenu_X );
1022 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); 1022 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
1023 1023
1024 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, 1024 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0,
1025 this ); 1025 this );
1026 action->addTo( beamMenu_X ); 1026 action->addTo( beamMenu_X );
1027 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); 1027 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
1028 importMenu->insertItem( i18n("Beam"), beamMenu_X ); 1028 importMenu->insertItem( i18n("Beam"), beamMenu_X );
1029#else 1029#else
1030 //importMenu->insertSeparator(); 1030 //importMenu->insertSeparator();
1031 icon = loadPixmap( pathString + "print" ); 1031 icon = loadPixmap( pathString + "print" );
1032 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); 1032 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
1033 action->addTo( beamMenu_X ); 1033 action->addTo( beamMenu_X );
1034 connect( action, SIGNAL( activated() ), 1034 connect( action, SIGNAL( activated() ),
1035 this, SLOT( printCal() ) ); 1035 this, SLOT( printCal() ) );
1036 1036
1037 icon = loadPixmap( pathString + "print" ); 1037 icon = loadPixmap( pathString + "print" );
1038 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); 1038 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
1039 action->addTo( beamMenu_X ); 1039 action->addTo( beamMenu_X );
1040 connect( action, SIGNAL( activated() ), 1040 connect( action, SIGNAL( activated() ),
1041 this, SLOT( printSel() ) ); 1041 this, SLOT( printSel() ) );
1042 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); 1042 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this );
1043 action->addTo( beamMenu_X ); 1043 action->addTo( beamMenu_X );
1044 connect( action, SIGNAL( activated() ), 1044 connect( action, SIGNAL( activated() ),
1045 mView->viewManager(), SLOT( slotprintWNV() ) ); 1045 mView->viewManager(), SLOT( slotprintWNV() ) );
1046 1046
1047 action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); 1047 action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this );
1048 action->addTo( beamMenu_X ); 1048 action->addTo( beamMenu_X );
1049 connect( action, SIGNAL( activated() ), 1049 connect( action, SIGNAL( activated() ),
1050 mView, SLOT( slotprintSelInc() ) ); 1050 mView, SLOT( slotprintSelInc() ) );
1051 1051
1052 1052
1053 importMenu->insertItem( i18n("Print"), beamMenu_X ); 1053 importMenu->insertItem( i18n("Print"), beamMenu_X );
1054#endif 1054#endif
1055 importMenu->insertSeparator(); 1055 importMenu->insertSeparator();
1056 action = new QAction( "manage cat", i18n("Manage new categories..."), 0, 1056 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
1057 this ); 1057 this );
1058 action->addTo( importMenu ); 1058 action->addTo( importMenu );
1059 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 1059 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
1060 importMenu->insertSeparator(); 1060 importMenu->insertSeparator();
1061 action = new QAction( "beam all", i18n("Save"), 0, 1061 action = new QAction( "beam all", i18n("Save"), 0,
1062 this ); 1062 this );
1063 action->addTo( importMenu ); 1063 action->addTo( importMenu );
1064 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 1064 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
1065 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 1065 action = new QAction( "beam all", i18n("Exit (+save)"), 0,
1066 this ); 1066 this );
1067 action->addTo( importMenu ); 1067 action->addTo( importMenu );
1068 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 1068 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
1069 1069
1070 //menuBar->insertItem( "Configure",configureMenu ); 1070 //menuBar->insertItem( "Configure",configureMenu );
1071 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 1071 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
1072 icon = loadPixmap( "korganizer/korganizer" ); 1072 icon = loadPixmap( "korganizer/korganizer" );
1073 1073
1074 action = new QAction( "Whats New", i18n("What's new?"), 0,this ); 1074 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
1075 action->addTo( helpMenu ); 1075 action->addTo( helpMenu );
1076 connect( action, SIGNAL( activated() ), 1076 connect( action, SIGNAL( activated() ),
1077 SLOT( whatsNew() ) ); 1077 SLOT( whatsNew() ) );
1078 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 1078 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
1079 action->addTo( helpMenu ); 1079 action->addTo( helpMenu );
1080 connect( action, SIGNAL( activated() ), 1080 connect( action, SIGNAL( activated() ),
1081 SLOT( features() ) ); 1081 SLOT( features() ) );
1082 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 1082 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
1083 action->addTo( helpMenu ); 1083 action->addTo( helpMenu );
1084 connect( action, SIGNAL( activated() ), 1084 connect( action, SIGNAL( activated() ),
1085 SLOT( keyBindings() ) ); 1085 SLOT( keyBindings() ) );
1086 action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this );
1087 action->addTo( helpMenu );
1088 connect( action, SIGNAL( activated() ),
1089 SLOT( storagehowto() ) );
1086 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); 1090 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
1087 action->addTo( helpMenu ); 1091 action->addTo( helpMenu );
1088 connect( action, SIGNAL( activated() ), 1092 connect( action, SIGNAL( activated() ),
1089 SLOT( synchowto() ) ); 1093 SLOT( synchowto() ) );
1090 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); 1094 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
1091 action->addTo( helpMenu ); 1095 action->addTo( helpMenu );
1092 connect( action, SIGNAL( activated() ), 1096 connect( action, SIGNAL( activated() ),
1093 SLOT( kdesynchowto() ) ); 1097 SLOT( kdesynchowto() ) );
1094 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); 1098 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
1095 action->addTo( helpMenu ); 1099 action->addTo( helpMenu );
1096 connect( action, SIGNAL( activated() ), 1100 connect( action, SIGNAL( activated() ),
1097 SLOT( multisynchowto() ) ); 1101 SLOT( multisynchowto() ) );
1098 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 1102 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
1099 action->addTo( helpMenu ); 1103 action->addTo( helpMenu );
1100 connect( action, SIGNAL( activated() ), 1104 connect( action, SIGNAL( activated() ),
1101 SLOT( aboutAutoSaving() ) ); 1105 SLOT( aboutAutoSaving() ) );
1102 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 1106 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
1103 action->addTo( helpMenu ); 1107 action->addTo( helpMenu );
1104 connect( action, SIGNAL( activated() ), 1108 connect( action, SIGNAL( activated() ),
1105 SLOT( aboutKnownBugs() ) ); 1109 SLOT( aboutKnownBugs() ) );
1106 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 1110 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
1107 action->addTo( helpMenu ); 1111 action->addTo( helpMenu );
1108 connect( action, SIGNAL( activated() ), 1112 connect( action, SIGNAL( activated() ),
1109 SLOT( usertrans() ) ); 1113 SLOT( usertrans() ) );
1110 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 1114 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
1111 action->addTo( helpMenu ); 1115 action->addTo( helpMenu );
1112 connect( action, SIGNAL( activated() ), 1116 connect( action, SIGNAL( activated() ),
1113 SLOT( faq() ) ); 1117 SLOT( faq() ) );
1114 action = new QAction( "licence", i18n("Licence..."), 0, this ); 1118 action = new QAction( "licence", i18n("Licence..."), 0, this );
1115 action->addTo( helpMenu ); 1119 action->addTo( helpMenu );
1116 connect( action, SIGNAL( activated() ), 1120 connect( action, SIGNAL( activated() ),
1117 SLOT( licence() ) ); 1121 SLOT( licence() ) );
1118 action = new QAction( "about", i18n("About..."), 0, this ); 1122 action = new QAction( "about", i18n("About..."), 0, this );
1119 action->addTo( helpMenu ); 1123 action->addTo( helpMenu );
1120 connect( action, SIGNAL( activated() ), 1124 connect( action, SIGNAL( activated() ),
1121 SLOT( about() ) ); 1125 SLOT( about() ) );
1122 //menuBar->insertSeparator(); 1126 //menuBar->insertSeparator();
1123 1127
1124 // ****************************************************** 1128 // ******************************************************
1125 // menubar icons 1129 // menubar icons
1126 1130
1127 1131
1128 1132
1129 //menuBar->insertItem( iconToolBar ); 1133 //menuBar->insertItem( iconToolBar );
1130 //xdays_action 1134 //xdays_action
1131 if (p-> mShowIconNewEvent) 1135 if (p-> mShowIconNewEvent)
1132 ne_action->addTo( iconToolBar ); 1136 ne_action->addTo( iconToolBar );
1133 if (p->mShowIconNewTodo ) 1137 if (p->mShowIconNewTodo )
1134 nt_action->addTo( iconToolBar ); 1138 nt_action->addTo( iconToolBar );
1135 if (p-> mShowIconSearch) 1139 if (p-> mShowIconSearch)
1136 search_action->addTo( iconToolBar ); 1140 search_action->addTo( iconToolBar );
1137 if (p-> mShowIconWhatsThis) 1141 if (p-> mShowIconWhatsThis)
1138 QWhatsThis::whatsThisButton ( iconToolBar ); 1142 QWhatsThis::whatsThisButton ( iconToolBar );
1139 if (p-> mShowIconNext) 1143 if (p-> mShowIconNext)
1140 whatsnext_action->addTo( viewToolBar ); 1144 whatsnext_action->addTo( viewToolBar );
1141 if (p-> mShowIconNextDays) 1145 if (p-> mShowIconNextDays)
1142 xdays_action->addTo( viewToolBar ); 1146 xdays_action->addTo( viewToolBar );
1143 if (p-> mShowIconJournal) 1147 if (p-> mShowIconJournal)
1144 viewjournal_action->addTo( viewToolBar ); 1148 viewjournal_action->addTo( viewToolBar );
1145 if (p-> mShowIconDay1) 1149 if (p-> mShowIconDay1)
1146 day1_action->addTo( viewToolBar ); 1150 day1_action->addTo( viewToolBar );
1147 if (p-> mShowIconDay5) 1151 if (p-> mShowIconDay5)
1148 day5_action->addTo( viewToolBar ); 1152 day5_action->addTo( viewToolBar );
1149 if (p-> mShowIconDay7) 1153 if (p-> mShowIconDay7)
1150 day7_action->addTo( viewToolBar ); 1154 day7_action->addTo( viewToolBar );
1151 if (p-> mShowIconDay6) 1155 if (p-> mShowIconDay6)
1152 day6_action->addTo( viewToolBar ); 1156 day6_action->addTo( viewToolBar );
1153 if (p-> mShowIconMonth) 1157 if (p-> mShowIconMonth)
1154 month_action->addTo( viewToolBar ); 1158 month_action->addTo( viewToolBar );
1155 if (p-> mShowIconList) 1159 if (p-> mShowIconList)
1156 showlist_action->addTo( viewToolBar ); 1160 showlist_action->addTo( viewToolBar );
1157 if (p-> mShowIconTodoview) 1161 if (p-> mShowIconTodoview)
1158 todoview_action->addTo( viewToolBar ); 1162 todoview_action->addTo( viewToolBar );
1159 1163
1160 icon = loadPixmap( pathString + "2leftarrowB" ); 1164 icon = loadPixmap( pathString + "2leftarrowB" );
1161 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); 1165 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200);
1162 if (p-> mShowIconBackFast) { 1166 if (p-> mShowIconBackFast) {
1163 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 1167 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
1164 connect( action, SIGNAL( activated() ), 1168 connect( action, SIGNAL( activated() ),
1165 mView, SLOT( goPreviousMonth() ) ); 1169 mView, SLOT( goPreviousMonth() ) );
1166 action->addTo( navigatorToolBar ); 1170 action->addTo( navigatorToolBar );
1167 } 1171 }
1168 icon = loadPixmap( pathString + "1leftarrowB" ); 1172 icon = loadPixmap( pathString + "1leftarrowB" );
1169 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); 1173 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210);
1170 if (p-> mShowIconBack) { 1174 if (p-> mShowIconBack) {
1171 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 1175 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
1172 connect( action, SIGNAL( activated() ), 1176 connect( action, SIGNAL( activated() ),
1173 mView, SLOT( goPrevious() ) ); 1177 mView, SLOT( goPrevious() ) );
1174 action->addTo( navigatorToolBar ); 1178 action->addTo( navigatorToolBar );
1175 } 1179 }
1176 icon = loadPixmap( pathString + "today" ); 1180 icon = loadPixmap( pathString + "today" );
1177 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 1181 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
1178 if (p-> mShowIconToday) 1182 if (p-> mShowIconToday)
1179 today_action->addTo( navigatorToolBar ); 1183 today_action->addTo( navigatorToolBar );
1180 icon = loadPixmap( pathString + "1rightarrowB" ); 1184 icon = loadPixmap( pathString + "1rightarrowB" );
1181 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 1185 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
1182 if (p-> mShowIconForward) { 1186 if (p-> mShowIconForward) {
1183 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 1187 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
1184 connect( action, SIGNAL( activated() ), 1188 connect( action, SIGNAL( activated() ),
1185 mView, SLOT( goNext() ) ); 1189 mView, SLOT( goNext() ) );
1186 action->addTo( navigatorToolBar ); 1190 action->addTo( navigatorToolBar );
1187 } 1191 }
1188 icon = loadPixmap( pathString + "2rightarrowB" ); 1192 icon = loadPixmap( pathString + "2rightarrowB" );
1189 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 1193 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
1190 if (p-> mShowIconForwardFast) { 1194 if (p-> mShowIconForwardFast) {
1191 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 1195 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
1192 connect( action, SIGNAL( activated() ), 1196 connect( action, SIGNAL( activated() ),
1193 mView, SLOT( goNextMonth() ) ); 1197 mView, SLOT( goNextMonth() ) );
1194 action->addTo( navigatorToolBar ); 1198 action->addTo( navigatorToolBar );
1195 } 1199 }
1196 1200
1197 1201
1198 configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); 1202 configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6);
1199 1203
1200 1204
1201 if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); 1205 if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true);
1202 if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); 1206 if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true);
1203 if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); 1207 if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true);
1204 if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); 1208 if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true);
1205 1209
1206 if (p-> mShowIconNewEvent) 1210 if (p-> mShowIconNewEvent)
1207 configureToolBarMenu->setItemChecked( 10, true ); 1211 configureToolBarMenu->setItemChecked( 10, true );
1208 if (p->mShowIconNewTodo ) 1212 if (p->mShowIconNewTodo )
1209 configureToolBarMenu->setItemChecked( 20, true ); 1213 configureToolBarMenu->setItemChecked( 20, true );
1210 if (p-> mShowIconSearch) 1214 if (p-> mShowIconSearch)
1211 configureToolBarMenu->setItemChecked( 120, true ); 1215 configureToolBarMenu->setItemChecked( 120, true );
1212 if (p-> mShowIconList) 1216 if (p-> mShowIconList)
1213 configureToolBarMenu->setItemChecked( 30, true ); 1217 configureToolBarMenu->setItemChecked( 30, true );
1214 if (p-> mShowIconDay1) 1218 if (p-> mShowIconDay1)
1215 configureToolBarMenu->setItemChecked( 40, true ); 1219 configureToolBarMenu->setItemChecked( 40, true );
1216 if (p-> mShowIconDay5) 1220 if (p-> mShowIconDay5)
1217 configureToolBarMenu->setItemChecked( 50, true ); 1221 configureToolBarMenu->setItemChecked( 50, true );
1218 if (p-> mShowIconDay6) 1222 if (p-> mShowIconDay6)
1219 configureToolBarMenu->setItemChecked( 75, true ); 1223 configureToolBarMenu->setItemChecked( 75, true );
1220 if (p-> mShowIconDay7) 1224 if (p-> mShowIconDay7)
1221 configureToolBarMenu->setItemChecked( 60, true ); 1225 configureToolBarMenu->setItemChecked( 60, true );
1222 if (p-> mShowIconMonth) 1226 if (p-> mShowIconMonth)
1223 configureToolBarMenu->setItemChecked( 70, true ); 1227 configureToolBarMenu->setItemChecked( 70, true );
1224 if (p-> mShowIconTodoview) 1228 if (p-> mShowIconTodoview)
1225 configureToolBarMenu->setItemChecked( 80, true ); 1229 configureToolBarMenu->setItemChecked( 80, true );
1226 if (p-> mShowIconBackFast) 1230 if (p-> mShowIconBackFast)
1227 configureToolBarMenu->setItemChecked( 200, true ); 1231 configureToolBarMenu->setItemChecked( 200, true );
1228 if (p-> mShowIconBack) 1232 if (p-> mShowIconBack)
1229 configureToolBarMenu->setItemChecked( 210, true ); 1233 configureToolBarMenu->setItemChecked( 210, true );
1230 if (p-> mShowIconToday) 1234 if (p-> mShowIconToday)
1231 configureToolBarMenu->setItemChecked( 130, true ); 1235 configureToolBarMenu->setItemChecked( 130, true );
1232 if (p-> mShowIconForward) 1236 if (p-> mShowIconForward)
1233 configureToolBarMenu->setItemChecked( 220, true ); 1237 configureToolBarMenu->setItemChecked( 220, true );
1234 if (p-> mShowIconForwardFast) 1238 if (p-> mShowIconForwardFast)
1235 configureToolBarMenu->setItemChecked( 230, true ); 1239 configureToolBarMenu->setItemChecked( 230, true );
1236 if (p-> mShowIconNextDays) 1240 if (p-> mShowIconNextDays)
1237 configureToolBarMenu->setItemChecked( 100, true ); 1241 configureToolBarMenu->setItemChecked( 100, true );
1238 if (p-> mShowIconNext) 1242 if (p-> mShowIconNext)
1239 configureToolBarMenu->setItemChecked( 110, true ); 1243 configureToolBarMenu->setItemChecked( 110, true );
1240 if (p-> mShowIconJournal) 1244 if (p-> mShowIconJournal)
1241 configureToolBarMenu->setItemChecked( 90, true ); 1245 configureToolBarMenu->setItemChecked( 90, true );
1242 if (p-> mShowIconWhatsThis) 1246 if (p-> mShowIconWhatsThis)
1243 configureToolBarMenu->setItemChecked( 300, true ); 1247 configureToolBarMenu->setItemChecked( 300, true );
1244 if (p-> mShowIconWeekNum) 1248 if (p-> mShowIconWeekNum)
1245 configureToolBarMenu->setItemChecked( 400, true ); 1249 configureToolBarMenu->setItemChecked( 400, true );
1246 if (!p-> mShowIconStretch) { 1250 if (!p-> mShowIconStretch) {
1247 QLabel* dummy = new QLabel( iconToolBar ); 1251 QLabel* dummy = new QLabel( iconToolBar );
1248 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 1252 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
1249 dummy->setMinimumWidth( 0 ); 1253 dummy->setMinimumWidth( 0 );
1250 iconToolBar->setStretchableWidget ( dummy ) ; 1254 iconToolBar->setStretchableWidget ( dummy ) ;
1251 } 1255 }
1252 else { 1256 else {
1253 iconToolBar->setHorizontalStretchable (true ); 1257 iconToolBar->setHorizontalStretchable (true );
1254 viewToolBar->setHorizontalStretchable (true ); 1258 viewToolBar->setHorizontalStretchable (true );
1255 navigatorToolBar->setHorizontalStretchable (true ); 1259 navigatorToolBar->setHorizontalStretchable (true );
1256 iconToolBar->setVerticalStretchable (true ); 1260 iconToolBar->setVerticalStretchable (true );
1257 viewToolBar->setVerticalStretchable (true ); 1261 viewToolBar->setVerticalStretchable (true );
1258 navigatorToolBar->setVerticalStretchable (true ); 1262 navigatorToolBar->setVerticalStretchable (true );
1259 configureToolBarMenu->setItemChecked( 5, true ); 1263 configureToolBarMenu->setItemChecked( 5, true );
1260 } 1264 }
1261 if (p-> mShowIconFilter) 1265 if (p-> mShowIconFilter)
1262 configureToolBarMenu->setItemChecked( 7, true ); 1266 configureToolBarMenu->setItemChecked( 7, true );
1263 if (p-> mShowIconOnetoolbar) 1267 if (p-> mShowIconOnetoolbar)
1264 configureToolBarMenu->setItemChecked( 6, true ); 1268 configureToolBarMenu->setItemChecked( 6, true );
1265 1269
1266 1270
1267 if ( filterMenubar ) 1271 if ( filterMenubar )
1268 connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) ); 1272 connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) );
1269 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 1273 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
1270 configureAgenda( p->mHourSize ); 1274 configureAgenda( p->mHourSize );
1271 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 1275 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
1272} 1276}
1273 1277
1274void MainWindow::exportToPhone( int mode ) 1278void MainWindow::exportToPhone( int mode )
1275{ 1279{
1276 1280
1277 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1281 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1278 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1282 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1279 KOex2phonePrefs ex2phone; 1283 KOex2phonePrefs ex2phone;
1280 1284
1281 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 1285 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
1282 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 1286 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
1283 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1287 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
1284 if ( mode == 1 ) 1288 if ( mode == 1 )
1285 ex2phone.setCaption(i18n("Export complete calendar")); 1289 ex2phone.setCaption(i18n("Export complete calendar"));
1286 if ( mode == 2 ) 1290 if ( mode == 2 )
1287 ex2phone.setCaption(i18n("Export filtered calendar")); 1291 ex2phone.setCaption(i18n("Export filtered calendar"));
1288 1292
1289 if ( !ex2phone.exec() ) { 1293 if ( !ex2phone.exec() ) {
1290 return; 1294 return;
1291 } 1295 }
1292 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1296 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1293 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1297 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1294 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1298 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1295 1299
1296 int inFuture = 0; 1300 int inFuture = 0;
1297 if ( ex2phone.mWriteBackFuture->isChecked() ) 1301 if ( ex2phone.mWriteBackFuture->isChecked() )
1298 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1302 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1299 QPtrList<Incidence> delSel; 1303 QPtrList<Incidence> delSel;
1300 if ( mode == 1 ) 1304 if ( mode == 1 )
1301 delSel = mCalendar->rawIncidences(); 1305 delSel = mCalendar->rawIncidences();
1302 if ( mode == 2 ) 1306 if ( mode == 2 )
1303 delSel = mCalendar->incidences(); 1307 delSel = mCalendar->incidences();
1304 CalendarLocal* cal = new CalendarLocal(); 1308 CalendarLocal* cal = new CalendarLocal();
1305 cal->setLocalTime(); 1309 cal->setLocalTime();
1306 Incidence *incidence = delSel.first(); 1310 Incidence *incidence = delSel.first();
1307 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1311 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1308 QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); 1312 QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
1309 while ( incidence ) { 1313 while ( incidence ) {
1310 if ( incidence->type() != "Journal" ) { 1314 if ( incidence->type() != "Journal" ) {
1311 bool add = true; 1315 bool add = true;
1312 if ( inFuture ) { 1316 if ( inFuture ) {
1313 QDateTime dt; 1317 QDateTime dt;
1314 if ( incidence->type() == "Todo" ) { 1318 if ( incidence->type() == "Todo" ) {
1315 Todo * t = (Todo*)incidence; 1319 Todo * t = (Todo*)incidence;
1316 if ( t->hasDueDate() ) 1320 if ( t->hasDueDate() )
1317 dt = t->dtDue(); 1321 dt = t->dtDue();
1318 else 1322 else
1319 dt = cur.addSecs( 62 ); 1323 dt = cur.addSecs( 62 );
1320 } 1324 }
1321 else { 1325 else {
1322 bool ok; 1326 bool ok;
1323 dt = incidence->getNextOccurence( cur, &ok ); 1327 dt = incidence->getNextOccurence( cur, &ok );
1324 if ( !ok ) 1328 if ( !ok )
1325 dt = cur.addSecs( -62 ); 1329 dt = cur.addSecs( -62 );
1326 } 1330 }
1327 if ( dt < cur || dt > end ) { 1331 if ( dt < cur || dt > end ) {
1328 add = false; 1332 add = false;
1329 } 1333 }
1330 } 1334 }
1331 if ( add ) { 1335 if ( add ) {
1332 Incidence *in = incidence->clone(); 1336 Incidence *in = incidence->clone();
1333 cal->addIncidence( in ); 1337 cal->addIncidence( in );
1334 } 1338 }
1335 } 1339 }
1336 incidence = delSel.next(); 1340 incidence = delSel.next();
1337 } 1341 }
1338 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 1342 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
1339 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 1343 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
1340 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1344 KPimGlobalPrefs::instance()->mEx2PhoneModel );
1341 1345
1342 setCaption( i18n("Writing to phone...")); 1346 setCaption( i18n("Writing to phone..."));
1343 if ( PhoneFormat::writeToPhone( cal ) ) 1347 if ( PhoneFormat::writeToPhone( cal ) )
1344 setCaption( i18n("Export to phone successful!")); 1348 setCaption( i18n("Export to phone successful!"));
1345 else 1349 else
1346 setCaption( i18n("Error exporting to phone!")); 1350 setCaption( i18n("Error exporting to phone!"));
1347 delete cal; 1351 delete cal;
1348} 1352}
1349 1353
1350 1354
1351void MainWindow::setDefaultPreferences() 1355void MainWindow::setDefaultPreferences()
1352{ 1356{
1353 KOPrefs *p = KOPrefs::instance(); 1357 KOPrefs *p = KOPrefs::instance();
1354 1358
1355 p->mCompactDialogs = true; 1359 p->mCompactDialogs = true;
1356 p->mConfirm = true; 1360 p->mConfirm = true;
1357 // p->mEnableQuickTodo = false; 1361 // p->mEnableQuickTodo = false;
1358 1362
1359} 1363}
1360 1364
1361QString MainWindow::resourcePath() 1365QString MainWindow::resourcePath()
1362{ 1366{
1363 return KGlobal::iconLoader()->iconPath(); 1367 return KGlobal::iconLoader()->iconPath();
1364} 1368}
1365 1369
1366void MainWindow::displayText( QString text ,QString cap ) 1370void MainWindow::displayText( QString text ,QString cap )
1367{ 1371{
1368 QDialog dia( this, "name", true ); ; 1372 QDialog dia( this, "name", true ); ;
1369 dia.setCaption( cap ); 1373 dia.setCaption( cap );
1370 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1374 QVBoxLayout* lay = new QVBoxLayout( &dia );
1371 lay->setSpacing( 3 ); 1375 lay->setSpacing( 3 );
1372 lay->setMargin( 3 ); 1376 lay->setMargin( 3 );
1373 QTextBrowser tb ( &dia ); 1377 QTextBrowser tb ( &dia );
1374 lay->addWidget( &tb ); 1378 lay->addWidget( &tb );
1375 tb.setText( text ); 1379 tb.setText( text );
1376#ifdef DESKTOP_VERSION 1380#ifdef DESKTOP_VERSION
1377 dia.resize( 640, 480); 1381 dia.resize( 640, 480);
1378#else 1382#else
1379 dia.showMaximized(); 1383 dia.showMaximized();
1380#endif 1384#endif
1381 dia.exec(); 1385 dia.exec();
1382} 1386}
1383 1387
1384void MainWindow::features() 1388void MainWindow::features()
1385{ 1389{
1386 1390
1387 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); 1391 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" );
1388} 1392}
1389 1393
1390void MainWindow::usertrans() 1394void MainWindow::usertrans()
1391{ 1395{
1392 1396
1393 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); 1397 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" );
1394} 1398}
1395 1399
1400void MainWindow::storagehowto()
1401{
1402 KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" );
1403}
1396void MainWindow::kdesynchowto() 1404void MainWindow::kdesynchowto()
1397{ 1405{
1398 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); 1406 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
1399} 1407}
1400void MainWindow::multisynchowto() 1408void MainWindow::multisynchowto()
1401{ 1409{
1402 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); 1410 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
1403} 1411}
1404void MainWindow::synchowto() 1412void MainWindow::synchowto()
1405{ 1413{
1406 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 1414 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
1407} 1415}
1408void MainWindow::faq() 1416void MainWindow::faq()
1409{ 1417{
1410 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); 1418 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" );
1411 1419
1412} 1420}
1413void MainWindow::whatsNew() 1421void MainWindow::whatsNew()
1414{ 1422{
1415 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 1423 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
1416 1424
1417} 1425}
1418void MainWindow::licence() 1426void MainWindow::licence()
1419{ 1427{
1420 KApplication::showLicence(); 1428 KApplication::showLicence();
1421 1429
1422} 1430}
1423void MainWindow::about() 1431void MainWindow::about()
1424{ 1432{
1425 QString version; 1433 QString version;
1426#include <../version> 1434#include <../version>
1427 QMessageBox::about( this, i18n("About KOrganizer/Pi"), 1435 QMessageBox::about( this, i18n("About KOrganizer/Pi"),
1428 i18n("KOrganizer/Platform-independent\n") + 1436 i18n("KOrganizer/Platform-independent\n") +
1429 "(KO/Pi) " + version + " - " + 1437 "(KO/Pi) " + version + " - " +
1430 1438
1431#ifdef DESKTOP_VERSION 1439#ifdef DESKTOP_VERSION
1432 i18n("Desktop Edition\n") + 1440 i18n("Desktop Edition\n") +
1433#else 1441#else
1434 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + 1442 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") +
1435#endif 1443#endif
1436 i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); 1444 i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") );
1437} 1445}
1438void MainWindow::keyBindings() 1446void MainWindow::keyBindings()
1439{ 1447{
1440 QString cap = i18n("KO/Pi Keys + Colors"); 1448 QString cap = i18n("KO/Pi Keys + Colors");
1441 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1449 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1442 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1450 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1443 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + 1451 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") +
1444 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + 1452 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") +
1445 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1453 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1446 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1454 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1447 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ 1455 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+
1448 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1456 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1449 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1457 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1450 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ 1458 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+
1451 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1459 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
1452 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ 1460 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
1453 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ 1461 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
1454 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ 1462 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+
1455 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ 1463 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
1456 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ 1464 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
1457 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ 1465 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+
1458 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1466 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1459 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1467 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1460 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1468 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1461 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1469 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1462 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1470 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
1463 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ 1471 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
1464 i18n("<p><h3>In agenda view:</h3></p>\n") + 1472 i18n("<p><h3>In agenda view:</h3></p>\n") +
1465 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ 1473 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
1466 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ 1474 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
1467 i18n("<p><h3>In todo view:</h3></p>\n") + 1475 i18n("<p><h3>In todo view:</h3></p>\n") +
1468 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ 1476 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+
1469 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ 1477 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+
1470 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ 1478 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+
1471 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ 1479 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
1472 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1480 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1473 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ 1481 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
1474 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ 1482 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
1475 i18n("<p><h3>In list view:</h3></p>\n") + 1483 i18n("<p><h3>In list view:</h3></p>\n") +
1476 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1484 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1477 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1485 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1478 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1486 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1479 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1487 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1480 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1488 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1481 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1489 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1482 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1490 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1483 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1491 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1484 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1492 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1485 i18n("<p><b>E</b>: Edit item</p>\n") + 1493 i18n("<p><b>E</b>: Edit item</p>\n") +
1486 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1494 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1487 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1495 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1488 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1496 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1489 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1497 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1490 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1498 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1491 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1499 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1492 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1500 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1493 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1501 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1494 i18n("<p><b>White</b>: Item readonly</p>\n"); 1502 i18n("<p><b>White</b>: Item readonly</p>\n");
1495 displayText( text, cap); 1503 displayText( text, cap);
1496} 1504}
1497void MainWindow::aboutAutoSaving() 1505void MainWindow::aboutAutoSaving()
1498{ 1506{
1499 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); 1507 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n");
1500 1508
1501 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1509 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1502 1510
1503} 1511}
1504void MainWindow::aboutKnownBugs() 1512void MainWindow::aboutKnownBugs()
1505{ 1513{
1506 QMessageBox* msg; 1514 QMessageBox* msg;
1507 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1515 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1508 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ 1516 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+
1509 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1517 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1510 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + 1518 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
1511 i18n("\nor report them in the bugtracker on\n") + 1519 i18n("\nor report them in the bugtracker on\n") +
1512 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1520 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1513 QMessageBox::NoIcon, 1521 QMessageBox::NoIcon,
1514 QMessageBox::Ok, 1522 QMessageBox::Ok,
1515 QMessageBox::NoButton, 1523 QMessageBox::NoButton,
1516 QMessageBox::NoButton); 1524 QMessageBox::NoButton);
1517 msg->exec(); 1525 msg->exec();
1518 delete msg; 1526 delete msg;
1519 1527
1520} 1528}
1521 1529
1522QString MainWindow::defaultFileName() 1530QString MainWindow::defaultFileName()
1523{ 1531{
1524 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1532 return locateLocal( "data", "korganizer/mycalendar.ics" );
1525} 1533}
1526QString MainWindow::syncFileName() 1534QString MainWindow::syncFileName()
1527{ 1535{
1528#ifdef DESKTOP_VERSION 1536#ifdef DESKTOP_VERSION
1529 return locateLocal( "tmp", "synccalendar.ics" ); 1537 return locateLocal( "tmp", "synccalendar.ics" );
1530#else 1538#else
1531 return QString( "/tmp/synccalendar.ics" ); 1539 return QString( "/tmp/synccalendar.ics" );
1532#endif 1540#endif
1533} 1541}
1534#include "koglobals.h" 1542#include "koglobals.h"
1535#include <kcalendarsystem.h> 1543#include <kcalendarsystem.h>
1536void MainWindow::updateWeek(QDate seda) 1544void MainWindow::updateWeek(QDate seda)
1537{ 1545{
1538 int weekNum = KGlobal::locale()->weekNum ( seda ); 1546 int weekNum = KGlobal::locale()->weekNum ( seda );
1539 mWeekPixmap.fill( mWeekBgColor ); 1547 mWeekPixmap.fill( mWeekBgColor );
1540 QPainter p ( &mWeekPixmap ); 1548 QPainter p ( &mWeekPixmap );
1541 p.setFont( mWeekFont ); 1549 p.setFont( mWeekFont );
1542 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1550 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1543 p.end(); 1551 p.end();
1544 QIconSet icon3 ( mWeekPixmap ); 1552 QIconSet icon3 ( mWeekPixmap );
1545 mWeekAction->setIconSet ( icon3 ); 1553 mWeekAction->setIconSet ( icon3 );
1546 1554
1547} 1555}
1548void MainWindow::updateWeekNum(const DateList &selectedDates) 1556void MainWindow::updateWeekNum(const DateList &selectedDates)
1549{ 1557{
1550 updateWeek( selectedDates.first() ); 1558 updateWeek( selectedDates.first() );
1551} 1559}
1552void MainWindow::processIncidenceSelection( Incidence *incidence ) 1560void MainWindow::processIncidenceSelection( Incidence *incidence )
1553{ 1561{
1554 1562
1555 if ( !incidence ) { 1563 if ( !incidence ) {
1556 enableIncidenceActions( false ); 1564 enableIncidenceActions( false );
1557 1565
1558 mNewSubTodoAction->setEnabled( false ); 1566 mNewSubTodoAction->setEnabled( false );
1559 setCaptionToDates(); 1567 setCaptionToDates();
1560 return; 1568 return;
1561 1569
1562 } 1570 }
1563 1571
1564 //KGlobal::locale()->formatDateTime(nextA, true); 1572 //KGlobal::locale()->formatDateTime(nextA, true);
1565 QString startString = ""; 1573 QString startString = "";
1566 if ( incidence->type() != "Todo" ) { 1574 if ( incidence->type() != "Todo" ) {
1567 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1575 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1568 if ( incidence->doesFloat() ) { 1576 if ( incidence->doesFloat() ) {
1569 startString += ": "+incidence->dtStartDateStr( true ); 1577 startString += ": "+incidence->dtStartDateStr( true );
1570 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1578 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1571 1579
1572 } else { 1580 } else {
1573 startString = ": "+incidence->dtStartStr(true); 1581 startString = ": "+incidence->dtStartStr(true);
1574 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1582 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1575 1583
1576 } 1584 }
1577 1585
1578 } else { 1586 } else {
1579 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1587 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1580 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1588 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1581 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1589 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1582 if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) { 1590 if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) {
1583 bool ok; 1591 bool ok;
1584 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1592 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1585 if ( ok ) { 1593 if ( ok ) {
1586 int years = noc.date().year() - incidence->dtStart().date().year(); 1594 int years = noc.date().year() - incidence->dtStart().date().year();
1587 startString += i18n(" (%1 y.)"). arg( years ); 1595 startString += i18n(" (%1 y.)"). arg( years );
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 4d1753f..3151f50 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -1,173 +1,174 @@
1#ifndef KORGE_MAINWINDOW_H 1#ifndef KORGE_MAINWINDOW_H
2#define KORGE_MAINWINDOW_H 2#define KORGE_MAINWINDOW_H
3 3
4#include <qmainwindow.h> 4#include <qmainwindow.h>
5#include <qtimer.h> 5#include <qtimer.h>
6#include <qdict.h> 6#include <qdict.h>
7#include <qfile.h> 7#include <qfile.h>
8#include <qmenubar.h> 8#include <qmenubar.h>
9#include <qtextstream.h> 9#include <qtextstream.h>
10#include <qregexp.h> 10#include <qregexp.h>
11 11
12#include <libkcal/incidence.h> 12#include <libkcal/incidence.h>
13#include "simplealarmclient.h" 13#include "simplealarmclient.h"
14#include <ksyncmanager.h> 14#include <ksyncmanager.h>
15#ifndef DESKTOP_VERSION 15#ifndef DESKTOP_VERSION
16#include <qcopchannel_qws.h> 16#include <qcopchannel_qws.h>
17#endif 17#endif
18class QAction; 18class QAction;
19class CalendarView; 19class CalendarView;
20class KSyncProfile; 20class KSyncProfile;
21#ifdef DESKTOP_VERSION 21#ifdef DESKTOP_VERSION
22 22
23#define QPEToolBar QToolBar 23#define QPEToolBar QToolBar
24#define QPEMenuBar QMenuBar 24#define QPEMenuBar QMenuBar
25#endif 25#endif
26class QPEToolBar; 26class QPEToolBar;
27class QPEMenuBar; 27class QPEMenuBar;
28 28
29 29
30namespace KCal { 30namespace KCal {
31class CalendarLocal; 31class CalendarLocal;
32} 32}
33 33
34class KOMenuBar : public QMenuBar 34class KOMenuBar : public QMenuBar
35{ 35{
36 public: 36 public:
37 KOMenuBar( QWidget *parent=0 ): QMenuBar (parent ) {;} 37 KOMenuBar( QWidget *parent=0 ): QMenuBar (parent ) {;}
38 QSize sizeHint () const{ qDebug("sizejint ");return QSize ( 40,25 );} 38 QSize sizeHint () const{ qDebug("sizejint ");return QSize ( 40,25 );}
39}; 39};
40 40
41using namespace KCal; 41using namespace KCal;
42 42
43class MainWindow : public QMainWindow 43class MainWindow : public QMainWindow
44{ 44{
45 Q_OBJECT 45 Q_OBJECT
46 public: 46 public:
47 MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); 47 MainWindow( QWidget *parent = 0, const char *name = 0, QString command = "");
48 ~MainWindow(); 48 ~MainWindow();
49 bool beamReceiveEnabled(); 49 bool beamReceiveEnabled();
50 static QString defaultFileName(); 50 static QString defaultFileName();
51 static QString syncFileName(); 51 static QString syncFileName();
52 static QString resourcePath(); 52 static QString resourcePath();
53 public slots: 53 public slots:
54 void setCaption ( const QString & ); 54 void setCaption ( const QString & );
55 void updateWeekNum(const KCal::DateList &); 55 void updateWeekNum(const KCal::DateList &);
56 void updateWeek(QDate); 56 void updateWeek(QDate);
57 void updateFilterToolbar(); 57 void updateFilterToolbar();
58 virtual void showMaximized (); 58 virtual void showMaximized ();
59 void configureAgenda( int ); 59 void configureAgenda( int );
60 void recieve( const QCString& msg, const QByteArray& data ); 60 void recieve( const QCString& msg, const QByteArray& data );
61 protected slots: 61 protected slots:
62 void setCaptionToDates(); 62 void setCaptionToDates();
63 void weekAction(); 63 void weekAction();
64 void about(); 64 void about();
65 void licence(); 65 void licence();
66 void faq(); 66 void faq();
67 void usertrans(); 67 void usertrans();
68 void features(); 68 void features();
69 void synchowto(); 69 void synchowto();
70 void storagehowto();
70 void kdesynchowto(); 71 void kdesynchowto();
71 void multisynchowto(); 72 void multisynchowto();
72 void whatsNew(); 73 void whatsNew();
73 void keyBindings(); 74 void keyBindings();
74 void aboutAutoSaving();; 75 void aboutAutoSaving();;
75 void aboutKnownBugs(); 76 void aboutKnownBugs();
76 77
77 void processIncidenceSelection( Incidence * ); 78 void processIncidenceSelection( Incidence * );
78 79
79 void importQtopia(); 80 void importQtopia();
80 void importBday(); 81 void importBday();
81 void importOL(); 82 void importOL();
82 void importIcal(); 83 void importIcal();
83 void importFile( QString, bool ); 84 void importFile( QString, bool );
84 void quickImportIcal(); 85 void quickImportIcal();
85 86
86 void slotModifiedChanged( bool ); 87 void slotModifiedChanged( bool );
87 88
88 void save(); 89 void save();
89 void saveStopTimer(); 90 void saveStopTimer();
90 void configureToolBar( int ); 91 void configureToolBar( int );
91 void printSel(); 92 void printSel();
92 void printCal(); 93 void printCal();
93 void saveCalendar(); 94 void saveCalendar();
94 void loadCalendar(); 95 void loadCalendar();
95 void exportVCalendar(); 96 void exportVCalendar();
96 void fillFilterMenu(); 97 void fillFilterMenu();
97 void fillFilterMenuTB(); 98 void fillFilterMenuTB();
98 void selectFilter( int ); 99 void selectFilter( int );
99 void fillFilterMenuPopup(); 100 void fillFilterMenuPopup();
100 void selectFilterPopup( int ); 101 void selectFilterPopup( int );
101 void exportToPhone( int ); 102 void exportToPhone( int );
102 void toggleBeamReceive(); 103 void toggleBeamReceive();
103 void disableBR(bool); 104 void disableBR(bool);
104 signals: 105 signals:
105 void selectWeek ( int ); 106 void selectWeek ( int );
106 private slots: 107 private slots:
107 void showConfigureAgenda(); 108 void showConfigureAgenda();
108 void getFile( bool ); 109 void getFile( bool );
109 void syncFileRequest(); 110 void syncFileRequest();
110 111
111 protected: 112 protected:
112 void hideEvent ( QHideEvent * ); 113 void hideEvent ( QHideEvent * );
113 QString sentSyncFile(); 114 QString sentSyncFile();
114 void displayText( QString, QString); 115 void displayText( QString, QString);
115 void enableIncidenceActions( bool ); 116 void enableIncidenceActions( bool );
116 117
117 private: 118 private:
118 bool mBRdisabled; 119 bool mBRdisabled;
119#ifndef DESKTOP_VERSION 120#ifndef DESKTOP_VERSION
120 QCopChannel* infrared; 121 QCopChannel* infrared;
121#endif 122#endif
122 QAction* brAction; 123 QAction* brAction;
123 KSyncManager* mSyncManager; 124 KSyncManager* mSyncManager;
124 bool mClosed; 125 bool mClosed;
125 void saveOnClose(); 126 void saveOnClose();
126 bool mFlagKeyPressed; 127 bool mFlagKeyPressed;
127 bool mBlockAtStartup; 128 bool mBlockAtStartup;
128 QPEToolBar *iconToolBar; 129 QPEToolBar *iconToolBar;
129 QPEToolBar *viewToolBar; 130 QPEToolBar *viewToolBar;
130 QPEToolBar *navigatorToolBar; 131 QPEToolBar *navigatorToolBar;
131 QPEToolBar *filterToolBar; 132 QPEToolBar *filterToolBar;
132 QPEMenuBar *filterMenubar; 133 QPEMenuBar *filterMenubar;
133 QPopupMenu * filterPopupMenu; 134 QPopupMenu * filterPopupMenu;
134 void initActions(); 135 void initActions();
135 void setDefaultPreferences(); 136 void setDefaultPreferences();
136 void resizeEvent( QResizeEvent* e); 137 void resizeEvent( QResizeEvent* e);
137 void keyPressEvent ( QKeyEvent * ) ; 138 void keyPressEvent ( QKeyEvent * ) ;
138 void keyReleaseEvent ( QKeyEvent * ) ; 139 void keyReleaseEvent ( QKeyEvent * ) ;
139 QPopupMenu *configureToolBarMenu; 140 QPopupMenu *configureToolBarMenu;
140 QPopupMenu *selectFilterMenu; 141 QPopupMenu *selectFilterMenu;
141 QPopupMenu *selectFilterMenuTB; 142 QPopupMenu *selectFilterMenuTB;
142 QPopupMenu *configureAgendaMenu, *syncMenu; 143 QPopupMenu *configureAgendaMenu, *syncMenu;
143 CalendarLocal *mCalendar; 144 CalendarLocal *mCalendar;
144 CalendarView *mView; 145 CalendarView *mView;
145 QAction *mNewSubTodoAction; 146 QAction *mNewSubTodoAction;
146 QAction *mWeekAction; 147 QAction *mWeekAction;
147 QFont mWeekFont; 148 QFont mWeekFont;
148 QPixmap mWeekPixmap; 149 QPixmap mWeekPixmap;
149 QColor mWeekBgColor; 150 QColor mWeekBgColor;
150 151
151 QAction *mShowAction; 152 QAction *mShowAction;
152 QAction *mEditAction; 153 QAction *mEditAction;
153 QAction *mDeleteAction; 154 QAction *mDeleteAction;
154 QAction *mCloneAction; 155 QAction *mCloneAction;
155 QAction *mMoveAction; 156 QAction *mMoveAction;
156 QAction *mBeamAction; 157 QAction *mBeamAction;
157 QAction *mCancelAction; 158 QAction *mCancelAction;
158 159
159 QAction *mToggleNav; 160 QAction *mToggleNav;
160 QAction *mToggleFilter; 161 QAction *mToggleFilter;
161 QAction *mToggleAllday; 162 QAction *mToggleAllday;
162 QAction *actionFilterMenuTB; 163 QAction *actionFilterMenuTB;
163 164
164 void closeEvent( QCloseEvent* ce ); 165 void closeEvent( QCloseEvent* ce );
165 SimpleAlarmClient mAlarmClient; 166 SimpleAlarmClient mAlarmClient;
166 QTimer mSaveTimer; 167 QTimer mSaveTimer;
167 //bool mBlockSaveFlag; 168 //bool mBlockSaveFlag;
168 bool mCalendarModifiedFlag; 169 bool mCalendarModifiedFlag;
169 QPixmap loadPixmap( QString ); 170 QPixmap loadPixmap( QString );
170}; 171};
171 172
172 173
173#endif 174#endif
diff --git a/version b/version
index 662668e..f601af0 100644
--- a/version
+++ b/version
@@ -1 +1 @@
version = "2.0.23"; version = "2.0.24";