summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 4fa9253..b4734a4 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -40,144 +40,144 @@
40#include <qtoolbutton.h> 40#include <qtoolbutton.h>
41 41
42#include <stdlib.h> 42#include <stdlib.h>
43#include <sys/stat.h> 43#include <sys/stat.h>
44#include <sys/types.h> 44#include <sys/types.h>
45#include <fcntl.h> 45#include <fcntl.h>
46#include <unistd.h> 46#include <unistd.h>
47 47
48 48
49#include "picker.h" 49#include "picker.h"
50#include "configdlg.h" 50#include "configdlg.h"
51 51
52extern QString addressbookPersonalVCardName(); 52extern QString addressbookPersonalVCardName();
53 53
54AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, 54AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
55 WFlags /*f*/ ) 55 WFlags /*f*/ )
56 : Opie::OPimMainWindow( "Addressbook", "Contacts", tr( "Contact" ), "AddressBook", 56 : Opie::OPimMainWindow( "Addressbook", "Contacts", tr( "Contact" ), "AddressBook",
57 parent, name, WType_TopLevel | WStyle_ContextHelp ), 57 parent, name, WType_TopLevel | WStyle_ContextHelp ),
58 abEditor(0l), 58 abEditor(0l),
59 syncing(false) 59 syncing(false)
60{ 60{
61 setCaption( tr( "Contacts" ) ); 61 setCaption( tr( "Contacts" ) );
62 62
63 isLoading = true; 63 isLoading = true;
64 64
65 m_config.load(); 65 m_config.load();
66 66
67 // Create Views 67 // Create Views
68 m_listContainer = new QWidget( this ); 68 m_listContainer = new QWidget( this );
69 QVBoxLayout *vb = new QVBoxLayout( m_listContainer ); 69 QVBoxLayout *vb = new QVBoxLayout( m_listContainer );
70 70
71 m_abView = new AbView( m_listContainer, m_config.orderList() ); 71 m_abView = new AbView( m_listContainer, m_config.orderList() );
72 vb->addWidget( m_abView ); 72 vb->addWidget( m_abView );
73 connect( m_abView, SIGNAL(signalViewSwitched(int)), 73 connect( m_abView, SIGNAL(signalViewSwitched(int)),
74 this, SLOT(slotViewSwitched(int)) ); 74 this, SLOT(slotViewSwitched(int)) );
75 75
76 QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); 76 QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) );
77 77
78 // Letter Picker 78 // Letter Picker
79 pLabel = new LetterPicker( m_listContainer ); 79 pLabel = new LetterPicker( m_listContainer );
80 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); 80 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char)));
81 connect(m_abView, SIGNAL(signalClearLetterPicker()), pLabel, SLOT(clear()) ); 81 connect(m_abView, SIGNAL(signalClearLetterPicker()), pLabel, SLOT(clear()) );
82 82
83 vb->addWidget( pLabel ); 83 vb->addWidget( pLabel );
84 84
85 // Quick search bar 85 // Quick search bar
86 m_searchBar = new OFloatBar( "Search", this, QMainWindow::Top, true ); 86 m_searchBar = new OFloatBar( "Search", this, QMainWindow::Top, true );
87 m_searchBar->setHorizontalStretchable( true ); 87 m_searchBar->setHorizontalStretchable( true );
88 m_searchBar->hide(); 88 m_searchBar->hide();
89 m_searchEdit = new QLineEdit( m_searchBar, "m_searchEdit" ); 89 m_searchEdit = new QLineEdit( m_searchBar, "m_searchEdit" );
90 90
91 m_searchBar->setStretchableWidget( m_searchEdit ); 91 m_searchBar->setStretchableWidget( m_searchEdit );
92 connect( m_searchEdit, SIGNAL(returnPressed()), this, SLOT(slotFind()) ); 92 connect( m_searchEdit, SIGNAL(returnPressed()), this, SLOT(slotFind()) );
93 93
94 QAction *a = new QAction( tr( "Start Search" ), 94 QAction *a = new QAction( tr( "Start Search" ),
95 Opie::Core::OResource::loadPixmap( "find", Opie::Core::OResource::SmallIcon ), 95 Opie::Core::OResource::loadPixmap( "find", Opie::Core::OResource::SmallIcon ),
96 QString::null, 0, this, 0 ); 96 QString::null, 0, this, 0 );
97 connect( a, SIGNAL(activated()), this, SLOT(slotFind()) ); 97 connect( a, SIGNAL(activated()), this, SLOT(slotFind()) );
98 a->addTo( m_searchBar ); 98 a->addTo( m_searchBar );
99 99
100 // Insert Contact menu items 100 // Insert Contact menu items
101 QActionGroup *items = new QActionGroup( this, QString::null, false ); 101 QActionGroup *items = new QActionGroup( this, QString::null, false );
102 102
103 m_actionMail = new QAction( tr( "Write Mail To" ), 103 m_actionMail = new QAction( tr( "Write Mail To" ),
104 Opie::Core::OResource::loadPixmap( "addressbook/sendmail" ), 104 Opie::Core::OResource::loadPixmap( "addressbook/sendmail", Opie::Core::OResource::SmallIcon ),
105 QString::null, 0, items, 0 ); 105 QString::null, 0, items, 0 );
106 connect( m_actionMail, SIGNAL(activated()), this, SLOT(writeMail()) ); 106 connect( m_actionMail, SIGNAL(activated()), this, SLOT(writeMail()) );
107 107
108 a = new QAction( tr("Import vCard"), 108 a = new QAction( tr("Import vCard"),
109 Opie::Core::OResource::loadPixmap( "addressbook/fileimport" ), 109 Opie::Core::OResource::loadPixmap( "addressbook/fileimport", Opie::Core::OResource::SmallIcon ),
110 QString::null, 0, items, 0 ); 110 QString::null, 0, items, 0 );
111 connect( a, SIGNAL(activated()), this, SLOT(importvCard()) ); 111 connect( a, SIGNAL(activated()), this, SLOT(importvCard()) );
112 112
113 a = new QAction( tr("Export vCard"), 113 a = new QAction( tr("Export vCard"),
114 Opie::Core::OResource::loadPixmap( "addressbook/fileexport" ), 114 Opie::Core::OResource::loadPixmap( "addressbook/fileexport", Opie::Core::OResource::SmallIcon ),
115 QString::null, 0, items, 0 ); 115 QString::null, 0, items, 0 );
116 connect( a, SIGNAL(activated()), this, SLOT(exportvCard()) ); 116 connect( a, SIGNAL(activated()), this, SLOT(exportvCard()) );
117 117
118 m_actionPersonal = new QAction( tr("My Personal Details"), 118 m_actionPersonal = new QAction( tr("My Personal Details"),
119 Opie::Core::OResource::loadPixmap( "addressbook/identity" ), 119 Opie::Core::OResource::loadPixmap( "addressbook/identity", Opie::Core::OResource::SmallIcon ),
120 QString::null, 0, items, 0 , true ); 120 QString::null, 0, items, 0 , true );
121 connect( m_actionPersonal, SIGNAL(activated()), this, SLOT(slotPersonalView()) ); 121 connect( m_actionPersonal, SIGNAL(activated()), this, SLOT(slotPersonalView()) );
122 122
123 insertItemMenuItems( items ); 123 insertItemMenuItems( items );
124 124
125 // Insert View menu items 125 // Insert View menu items
126 items = new QActionGroup( this, QString::null, false ); 126 items = new QActionGroup( this, QString::null, false );
127 127
128 a = new QAction( tr("Show quick search bar"),QString::null, 0, items, 0, true ); 128 a = new QAction( tr("Show quick search bar"),QString::null, 0, items, 0, true );
129 connect( a, SIGNAL(toggled(bool)), this, SLOT(slotShowFind(bool)) ); 129 connect( a, SIGNAL(toggled(bool)), this, SLOT(slotShowFind(bool)) );
130 130
131 insertViewMenuItems( items ); 131 insertViewMenuItems( items );
132 132
133 // Fontsize 133 // Fontsize
134 defaultFont = new QFont( m_abView->font() ); 134 defaultFont = new QFont( m_abView->font() );
135 slotSetFont(m_config.fontSize()); 135 slotSetFont(m_config.fontSize());
136 m_curFontSize = m_config.fontSize(); 136 m_curFontSize = m_config.fontSize();
137 137
138 setCentralWidget(m_listContainer); 138 setCentralWidget(m_listContainer);
139 139
140 //odebug << "adressbook contrsuction: t=" << t.elapsed() << oendl; 140 //odebug << "adressbook contrsuction: t=" << t.elapsed() << oendl;
141 connect( qApp, SIGNAL(flush()), this, SLOT(flush()) ); 141 connect( qApp, SIGNAL(flush()), this, SLOT(flush()) );
142 connect( qApp, SIGNAL(reload()), this, SLOT(reload()) ); 142 connect( qApp, SIGNAL(reload()), this, SLOT(reload()) );
143 connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), 143 connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)),
144 this, SLOT(appMessage(const QCString&,const QByteArray&)) ); 144 this, SLOT(appMessage(const QCString&,const QByteArray&)) );
145 145
146 isLoading = false; 146 isLoading = false;
147 147
148 // Handle category selection 148 // Handle category selection
149 setViewCategory( m_config.category() ); 149 setViewCategory( m_config.category() );
150 m_abView->setShowByCategory( m_config.category() ); 150 m_abView->setShowByCategory( m_config.category() );
151 connect( this, SIGNAL(categorySelected(const QString&)), 151 connect( this, SIGNAL(categorySelected(const QString&)),
152 this, SLOT(slotSetCategory(const QString&)) ); 152 this, SLOT(slotSetCategory(const QString&)) );
153} 153}
154 154
155void AddressbookWindow::slotSetFont( int size ) 155void AddressbookWindow::slotSetFont( int size )
156{ 156{
157 odebug << "void AddressbookWindow::slotSetFont( " << size << " )" << oendl; 157 odebug << "void AddressbookWindow::slotSetFont( " << size << " )" << oendl;
158 158
159 if (size > 2 || size < 0) 159 if (size > 2 || size < 0)
160 size = 1; 160 size = 1;
161 161
162 m_config.setFontSize( size ); 162 m_config.setFontSize( size );
163 163
164 QFont *currentFont; 164 QFont *currentFont;
165 165
166 switch (size) { 166 switch (size) {
167 case 0: 167 case 0:
168 m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) ); 168 m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) );
169 currentFont = new QFont (m_abView->font()); 169 currentFont = new QFont (m_abView->font());
170 // abList->resizeRows(currentFont->pixelSize() + 7); :SX 170 // abList->resizeRows(currentFont->pixelSize() + 7); :SX
171 // abList->resizeRows(); 171 // abList->resizeRows();
172 break; 172 break;
173 case 1: 173 case 1:
174 m_abView->setFont( *defaultFont ); 174 m_abView->setFont( *defaultFont );
175 currentFont = new QFont (m_abView->font()); 175 currentFont = new QFont (m_abView->font());
176 // // abList->resizeRows(currentFont->pixelSize() + 7); 176 // // abList->resizeRows(currentFont->pixelSize() + 7);
177 // abList->resizeRows(); 177 // abList->resizeRows();
178 break; 178 break;
179 case 2: 179 case 2:
180 m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); 180 m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) );
181 currentFont = new QFont (m_abView->font()); 181 currentFont = new QFont (m_abView->font());
182 // //abList->resizeRows(currentFont->pixelSize() + 7); 182 // //abList->resizeRows(currentFont->pixelSize() + 7);
183 // abList->resizeRows(); 183 // abList->resizeRows();