24 #include <kedittoolbar.h>
25 #include <kkeydialog.h>
26 #include <tdelocale.h>
27 #include <tdemessagebox.h>
28 #include <kstatusbar.h>
30 #include <libtdepim/statusbarprogresswidget.h>
31 #include <libtdepim/progressdialog.h>
35 #include "kaddressbookmain.h"
37 KAddressBookMain::KAddressBookMain(
const TQString &file )
38 : DCOPObject(
"KAddressBookIface" ), TDEMainWindow( 0 )
42 setWFlags( getWFlags() | WGroupLeader );
44 setCaption( i18n(
"Address Book Browser" ) );
46 mCore =
new KABCore(
this,
true,
this, file );
47 mCore->restoreSettings();
51 setCentralWidget( mCore->widget() );
54 statusBar()->insertItem(
"", 1 );
56 KPIM::ProgressDialog *progressDialog =
new KPIM::ProgressDialog( statusBar(),
58 progressDialog->hide();
60 KPIM::StatusbarProgressWidget *progressWidget;
61 progressWidget =
new KPIM::StatusbarProgressWidget( progressDialog,
63 progressWidget->show();
65 statusBar()->addWidget( progressWidget, 0,
true );
67 mCore->setStatusBar( statusBar() );
69 setStandardToolBarMenuEnabled(
true );
71 createGUI(
"kaddressbookui.rc",
false );
74 setAutoSaveSettings();
77 KAddressBookMain::~KAddressBookMain()
79 mCore->saveSettings();
82 void KAddressBookMain::addEmail( TQString addr )
84 mCore->addEmail( addr );
87 void KAddressBookMain::importVCard(
const KURL& url )
89 mCore->importVCard( url );
92 void KAddressBookMain::importVCardFromData(
const TQString& vCard )
94 mCore->importVCardFromData( vCard );
97 ASYNC KAddressBookMain::showContactEditor( TQString uid )
99 mCore->editContact( uid );
102 void KAddressBookMain::newDistributionList()
104 mCore->newDistributionList();
107 void KAddressBookMain::newContact()
112 TQString KAddressBookMain::getNameByPhone( TQString phone )
114 return mCore->getNameByPhone( phone );
117 void KAddressBookMain::save()
122 void KAddressBookMain::exit()
127 bool KAddressBookMain::handleCommandLine()
129 return mCore->handleCommandLine(
this );
132 void KAddressBookMain::syncAllResources()
146 bool KAddressBookMain::queryClose()
148 return mCore->queryClose();
151 void KAddressBookMain::initActions()
153 KStdAction::quit(
this, TQ_SLOT( close() ), actionCollection() );
156 action = KStdAction::keyBindings(
this, TQ_SLOT( configureKeyBindings() ), actionCollection() );
157 action->setWhatsThis( i18n(
"You will be presented with a dialog, where you can configure the application wide shortcuts." ) );
159 KStdAction::configureToolbars(
this, TQ_SLOT( configureToolbars() ), actionCollection() );
162 void KAddressBookMain::configureKeyBindings()
164 KKeyDialog::configure( actionCollection(),
this );
167 void KAddressBookMain::loadProfile(
const TQString& )
171 void KAddressBookMain::saveToProfile(
const TQString& )
const
175 void KAddressBookMain::configureToolbars()
177 saveMainWindowSettings( TDEGlobal::config(),
"MainWindow" );
179 KEditToolbar edit( factory() );
180 connect( &edit, TQ_SIGNAL( newToolbarConfig() ),
181 this, TQ_SLOT( newToolbarConfig() ) );
186 void KAddressBookMain::newToolbarConfig()
188 createGUI(
"kaddressbookui.rc",
false );
189 applyMainWindowSettings( TDEGlobal::config(),
"MainWindow" );
192 #include "kaddressbookmain.moc"
void saveProperties(TDEConfig *)
This function is called when it is time for the app to save its properties for session management pur...
void readProperties(TDEConfig *)
This function is called when this app is restored.