23 #include <config-enterprise.h>
30 using namespace Kontact;
38 #include <KontactInterface/Core>
39 #include <KontactInterface/Plugin>
41 #include <KPIMUtils/KFileIO>
43 #include <KActionCollection>
44 #include <KActionMenu>
45 #include <KApplication>
46 #include <KComponentData>
47 #include <KConfigGroup>
48 #include <KDBusServiceStarter>
50 #include <KEditToolBar>
53 #include <KMessageBox>
54 #include <KPluginInfo>
56 #include <KServiceTypeTrader>
57 #include <KShortcutsDialog>
58 #include <KSqueezedTextLabel>
59 #include <KStandardAction>
60 #include <KStandardDirs>
64 #include <KToolInvocation>
65 #include <KXMLGUIFactory>
66 #include <KParts/PartManager>
67 #include <KSettings/Dispatcher>
68 #include <KSettings/Dialog>
71 #include <QDBusConnection>
73 #include <QStackedWidget>
75 #include <QVBoxLayout>
76 #include <QWebSettings>
87 class ServiceStarter :
public KDBusServiceStarter
91 virtual int startServiceFor(
const QString &serviceType,
100 mPlugins = pluginList;
103 static void setPluginList(
PluginList *pluginList ) {
104 mPlugins = pluginList;
109 virtual ~ServiceStarter() {}
115 int ServiceStarter::startServiceFor(
const QString &serviceType,
123 if ( (*it)->createDBUSInterface( serviceType ) ) {
124 kDebug() <<
"found interface for" << serviceType;
126 *dbusService = (*it)->registerClient();
133 kDebug() <<
"Didn't find dbus interface, falling back to external process";
134 return KDBusServiceStarter::startServiceFor( serviceType, constraint,
135 error, dbusService, flags );
139 : KontactInterface::Core(), mSplitter( 0 ), mCurrentPlugin( 0 ), mAboutDialog( 0 ),
140 mReallyClose( false ), mSyncActionsEnabled( true )
144 new ServiceStarter( &mPlugins );
147 QLatin1String(
"/KontactInterface"),
this, QDBusConnection::ExportScriptableSlots );
151 setAttribute( Qt::WA_GroupLeader );
156 mSidePane->setMaximumWidth( mSidePane->sizeHint().width() );
157 mSidePane->setMinimumWidth( mSidePane->sizeHint().width() );
159 factory()->plugActionList(
this,
QLatin1String(
"navigator_actionlist" ), mActionPlugins );
161 restoreWindowSize( KConfigGroup( KGlobal::config(),
"MainWindow" ) );
162 setAutoSaveSettings();
169 setHelpMenuEnabled(
false );
170 KHelpMenu *helpMenu =
new KHelpMenu(
this, 0,
true, actionCollection() );
171 connect( helpMenu, SIGNAL(showAboutApplication()), SLOT(
showAboutDialog()) );
173 KStandardAction::keyBindings(
this, SLOT(configureShortcuts()), actionCollection() );
174 KStandardAction::configureToolbars(
this, SLOT(configureToolbars()), actionCollection() );
177 setStandardToolBarMenuEnabled(
true );
181 KToolBar *navigatorToolBar = findToolBar(
"navigatorToolBar" );
182 if ( navigatorToolBar ) {
183 if ( layoutDirection() == Qt::LeftToRight ) {
184 navigatorToolBar->setLayoutDirection( Qt::RightToLeft );
186 navigatorToolBar->setLayoutDirection( Qt::LeftToRight );
188 Q_ASSERT( navigatorToolBar->sizeHint().isValid() );
189 navigatorToolBar->setMinimumWidth( navigatorToolBar->sizeHint().width() );
191 kError() <<
"Unable to find navigatorToolBar, probably kontactui.rc is missing";
195 void MainWindow::waitForKSycoca()
199 if ( KSycoca::isAvailable() ) {
208 kDebug() <<
"Waiting for KSycoca";
213 kFatal() <<
"KSycoca unavailable. Kontact will be unable to find plugins.";
218 if ( !KSycoca::isAvailable() ) {
221 KService::List offers = KServiceTypeTrader::self()->query(
223 QString::fromLatin1(
"[X-KDE-KontactPluginVersion] == %1" ).arg( KONTACT_PLUGIN_VERSION ) );
224 mPluginInfos = KPluginInfo::fromServices(
225 offers, KConfigGroup( Prefs::self()->config(),
"Plugins" ) );
227 KPluginInfo::List::Iterator it;
228 KPluginInfo::List::Iterator end( mPluginInfos.
end() );
230 for ( it = mPluginInfos.
begin(); it != end; ++it ) {
235 mPartManager =
new KParts::PartManager(
this );
236 connect( mPartManager, SIGNAL(activePartChanged(KParts::Part*)),
245 KSettings::Dispatcher::registerComponent( componentData(),
this,
"updateConfig" );
262 if ( Prefs::lastVersionSeen() == KGlobal::mainComponent().aboutData()->
version() ) {
266 paintAboutScreen( introductionString() );
267 Prefs::setLastVersionSeen( KGlobal::mainComponent().aboutData()->
version() );
272 if ( mCurrentPlugin ) {
273 saveMainWindowSettings(
274 KGlobal::config()->group(
279 ServiceStarter::setPluginList( 0 );
289 Prefs::self()->writeConfig();
303 if (mInitialActiveModule != module) {
304 mInitialActiveModule = module;
315 right->
data().
value<KontactInterface::Plugin*>() );
319 const KontactInterface::Plugin *right )
321 return left->weight() < right->weight();
329 if ( !(*it)->identifier().isEmpty() &&
330 (*it)->identifier().contains( mInitialActiveModule ) ) {
338 void MainWindow::initWidgets()
345 setCentralWidget( mTopWidget );
357 connect( mSidePane, SIGNAL(pluginSelected(KontactInterface::Plugin*)),
367 "<h2 style='text-align:center; margin-top: 0px; margin-bottom: 0px'>%1</h2>",
368 i18nc(
"@item:intext",
"Loading Kontact..." ) );
370 paintAboutScreen( loading );
375 new KSqueezedTextLabel( i18nc(
"@info:status",
" Initializing..." ), statusBar() );
376 mStatusMsgLabel->setTextElideMode( Qt::ElideRight );
377 mStatusMsgLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
379 statusBar()->addWidget( mStatusMsgLabel, 10 );
380 statusBar()->addPermanentWidget( progressStatusBarWidget->
littleProgress(), 0 );
385 void MainWindow::paintAboutScreen(
const QString &msg )
395 "data",
QLatin1String(
"kdeui/about/kde_infopage_rtl.css") ) );
401 content.
arg(
QFont().pointSize() + 2 ).
402 arg( i18nc(
"@item:intext",
"KDE Kontact" ) ).
403 arg( i18nc(
"@item:intext",
"Get Organized!" ) ).
404 arg( i18nc(
"@item:intext",
"The KDE Personal Information Management Suite" ) ).
408 void MainWindow::initAboutScreen()
413 mIntroPart =
new KWebView( introbox );
414 mIntroPart->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
415 mIntroPart->setFocusPolicy( Qt::WheelFocus );
417 mIntroPart->settings()->setAttribute( QWebSettings::JavascriptEnabled,
false );
418 mIntroPart->settings()->setAttribute( QWebSettings::JavaEnabled,
false );
419 mIntroPart->settings()->setAttribute( QWebSettings::PluginsEnabled,
false );
421 connect( mIntroPart->page(), SIGNAL(linkClicked(
QUrl)),
this,
425 void MainWindow::setupActions()
427 actionCollection()->addAction( KStandardAction::Quit,
this, SLOT(
slotQuit()) );
429 mNewActions =
new KActionMenu(
430 i18nc(
"@title:menu create new pim items (message,calendar,to-do,etc.)",
"New" ),
this );
431 actionCollection()->addAction(
QLatin1String(
"action_new"), mNewActions );
432 mNewActions->setShortcut( KStandardShortcut::openNew() );
433 connect( mNewActions, SIGNAL(triggered(
bool)),
this, SLOT(
slotNewClicked()) );
439 KConfigGroup config( &_config,
"Groupware" );
440 #if defined(KDEPIM_ENTERPRISE_BUILD)
441 bool defGW = config.readEntry(
"Enabled",
true );
443 bool defGW = config.readEntry(
"Enabled",
false );
445 KConfig *_cfg = Prefs::self()->config();
446 KConfigGroup cfg( _cfg,
"Kontact Groupware Settings" );
447 mSyncActionsEnabled = cfg.readEntry(
"GroupwareMailFoldersEnabled", defGW );
449 if ( mSyncActionsEnabled ) {
450 mSyncActions =
new KActionMenu(
452 i18nc(
"@title:menu synchronize pim items (message,calendar,to-do,etc.)",
"Sync" ),
this );
453 actionCollection()->addAction(
QLatin1String(
"action_sync"), mSyncActions );
454 mSyncActions->setShortcut( KStandardShortcut::reload() );
455 connect( mSyncActions, SIGNAL(triggered(
bool)),
this, SLOT(
slotSyncClicked()) );
460 i18nc(
"@action:inmenu",
"Configure Kontact..." ),
this );
462 i18nc(
"@info:status",
"Configure Kontact" ) );
463 action->setWhatsThis(
464 i18nc(
"@info:whatsthis",
465 "You will be presented with a dialog where you can configure Kontact." ) );
466 actionCollection()->addAction(
QLatin1String(
"settings_configure_kontact"), action );
471 i18nc(
"@action:inmenu",
"&Kontact Introduction" ),
this );
473 i18nc(
"@info:status",
"Show the Kontact Introduction page" ) );
474 action->setWhatsThis(
475 i18nc(
"@info:whatsthis",
476 "Choose this option to see the Kontact Introduction page." ) );
477 actionCollection()->addAction(
QLatin1String(
"help_introduction"), action );
482 i18nc(
"@action:inmenu",
"&Tip of the Day" ),
this );
484 i18nc(
"@info:status",
"Show the Tip-of-the-Day dialog" ) );
485 action->setWhatsThis(
486 i18nc(
"@info:whatsthis",
487 "You will be presented with a dialog showing small tips to help "
488 "you use this program more effectively." ) );
489 actionCollection()->addAction(
QLatin1String(
"help_tipofday"), action );
490 connect( action, SIGNAL(triggered(
bool)), SLOT(
slotShowTip()) );
493 connect(shortcut, SIGNAL(activated()),
this, SLOT(slotShowHideSideBar()));
496 bool MainWindow::isPluginLoaded(
const KPluginInfo &info )
498 return ( pluginFromInfo( info ) != 0 );
501 KontactInterface::Plugin *MainWindow::pluginFromInfo(
const KPluginInfo &info )
505 if ( (*it)->identifier() == info.pluginName() ) {
512 void MainWindow::loadPlugins()
517 KPluginInfo::List::ConstIterator it;
518 KPluginInfo::List::ConstIterator end( mPluginInfos.
constEnd() );
519 for ( it = mPluginInfos.
constBegin(); it != end; ++it ) {
520 if ( !it->isPluginEnabled() ) {
524 KontactInterface::Plugin *plugin = 0;
525 if ( isPluginLoaded( *it ) ) {
526 plugin = pluginFromInfo( *it );
528 plugin->configUpdated();
533 kDebug() <<
"Loading Plugin:" << it->name();
536 it->service()->createInstance<KontactInterface::Plugin>(
this, QVariantList(), &error );
539 kDebug() <<
"Unable to create plugin for" << it->name() << error;
543 plugin->setIdentifier( it->pluginName() );
544 plugin->setTitle( it->name() );
545 plugin->setIcon( it->icon() );
553 mDelayedPreload.
append( plugin );
556 kDebug() <<
"LIBNAMEPART:" << libNameProp.
toString();
559 plugin->setExecutableName( exeNameProp.
toString() );
561 plugin->setShowInSideBar( hasPartProp.
toBool() );
564 for ( i = 0; i < plugins.
count(); ++i ) {
565 KontactInterface::Plugin *p = plugins.
at( i );
566 if ( plugin->weight() < p->weight() ) {
570 plugins.
insert( i, plugin );
574 const int numberOfPlugins( plugins.
count() );
575 for ( i = 0; i < numberOfPlugins; ++i ) {
576 KontactInterface::Plugin *plugin = plugins.
at( i );
582 for ( listIt = actionList.
begin(); listIt != end; ++listIt ) {
583 kDebug() <<
QLatin1String(
"Plugging New actions") << (*listIt)->objectName();
584 mNewActions->addAction( (*listIt) );
587 if ( mSyncActionsEnabled ) {
588 Q_FOREACH ( KAction *listIt, plugin->syncActions() ) {
589 kDebug() <<
QLatin1String(
"Plugging Sync actions") << listIt->objectName();
590 mSyncActions->addAction( listIt );
596 const bool state = ( !mPlugins.
isEmpty() );
597 mNewActions->setEnabled( state );
598 if ( mSyncActionsEnabled ) {
599 mSyncActions->setEnabled( state );
603 void MainWindow::unloadPlugins()
605 KPluginInfo::List::ConstIterator end = mPluginInfos.
constEnd();
606 KPluginInfo::List::ConstIterator it;
607 for ( it = mPluginInfos.
constBegin(); it != end; ++it ) {
608 if ( !it->isPluginEnabled() ) {
614 void MainWindow::updateShortcuts()
619 for ( it = mActionPlugins.
constBegin(); it != end; ++it ) {
620 KAction *action =
static_cast<KAction*
>( *it );
622 action->setShortcut( KShortcut( shortcut ) );
625 factory()->plugActionList(
this,
QLatin1String(
"navigator_actionlist" ), mActionPlugins );
628 bool MainWindow::removePlugin(
const KPluginInfo &info )
632 KontactInterface::Plugin *plugin = *it;
633 if ( ( *it )->identifier() == info.pluginName() ) {
637 for ( listIt = actionList.
constBegin(); listIt != listEnd; ++listIt ) {
638 kDebug() <<
QLatin1String(
"Unplugging New actions") << (*listIt)->objectName();
639 mNewActions->removeAction( *listIt );
642 if ( mSyncActionsEnabled ) {
643 actionList = plugin->syncActions();
645 kDebug() <<
QLatin1String(
"Unplugging Sync actions") << (*listIt)->objectName();
646 mSyncActions->removeAction( *listIt );
649 removeChildClient( plugin );
651 if ( mCurrentPlugin == plugin ) {
656 plugin->deleteLater();
657 mPlugins.
erase( it );
658 if ( plugin->showInSideBar() ) {
659 QAction *q = mPluginAction[plugin];
661 mPluginAction.
remove(plugin);
665 if ( mCurrentPlugin == 0 ) {
668 for ( it = mPlugins.
begin(); it != pluginEnd; ++it ) {
669 if ( (*it)->showInSideBar() ) {
683 void MainWindow::addPlugin( KontactInterface::Plugin *plugin )
687 mPlugins.
append( plugin );
689 if ( plugin->showInSideBar() ) {
690 KAction *action =
new KAction( KIcon( plugin->icon() ), plugin->title(), this );
692 i18nc(
"@info:status",
"Plugin %1", plugin->title() ) );
693 action->setWhatsThis(
694 i18nc(
"@info:whatsthis",
695 "Switch to plugin %1", plugin->title() ) );
696 action->setCheckable(
true );
700 actionCollection()->addAction( plugin->title(), action );
701 mActionPlugins.
append( action );
702 mPluginAction.
insert( plugin, action );
706 insertChildClient( plugin );
713 foreach (
QAction *qaction, mActionPlugins ) {
714 KAction *action =
static_cast<KAction*
>( qaction );
716 action->setShortcut( KShortcut( shortcut ) );
721 void MainWindow::partLoaded( KontactInterface::Plugin *plugin, KParts::ReadOnlyPart *part )
726 if ( mPartsStack->
indexOf( part->widget() ) != -1 ) {
730 mPartsStack->
addWidget( part->widget() );
732 mPartManager->addPart( part,
false );
734 part->widget()->hide();
747 statusBar()->clearMessage();
752 if ( !mCurrentPlugin->newActions().isEmpty() ) {
753 mCurrentPlugin->newActions().first()->trigger();
757 for ( it = mPlugins.
begin(); it != end; ++it ) {
758 if ( !(*it)->newActions().isEmpty() ) {
759 (*it)->newActions().first()->trigger();
768 if ( !mCurrentPlugin->syncActions().isEmpty() ) {
769 mCurrentPlugin->syncActions().first()->trigger();
773 for ( it = mPlugins.
begin(); it != end; ++it ) {
774 if ( !(*it)->syncActions().isEmpty() ) {
775 (*it)->syncActions().first()->trigger();
782 KToolBar *MainWindow::findToolBar(
const char *name )
794 if ( plugin->isRunningStandalone() ) {
795 statusBar()->showMessage(
796 i18nc(
"@info:status",
797 "Application is running standalone. Foregrounding..." ), 1000 );
798 plugin->bringToForeground();
804 if ( mCurrentPlugin ) {
805 saveMainWindowSettings(
806 KGlobal::config()->group(
810 KParts::Part *part = plugin->part();
817 "Cannot load part for %1.",
818 plugin->title() ) +
QLatin1Char(
'\n') + lastErrorMessage() );
819 plugin->setDisabled(
true );
824 if ( mCurrentPlugin ) {
825 KAction *action = mPluginAction[ mCurrentPlugin ];
827 action->setChecked(
false );
830 KAction *selectedPluginAction = mPluginAction[ plugin ];
831 if ( selectedPluginAction ) {
832 selectedPluginAction->setChecked(
true );
837 if ( mCurrentPlugin && focusWidget ) {
841 if ( parent == mCurrentPlugin->part()->widget() ) {
852 plugin->aboutToSelect();
854 mPartManager->setActivePart( part );
855 QWidget *view = part->widget();
862 if ( !mFocusWidgets.
isEmpty() && mFocusWidgets.
contains( plugin->identifier() ) ) {
863 focusWidget = mFocusWidgets[ plugin->identifier() ];
871 mCurrentPlugin = plugin;
874 if ( !plugin->newActions().isEmpty() ) {
875 newAction = plugin->newActions().first();
879 if ( !plugin->syncActions().isEmpty() ) {
880 syncAction = plugin->syncActions().first();
883 createGUI( plugin->part() );
884 plugin->shortcutChanged();
887 setCaption( i18nc(
"@title:window Plugin dependent window title",
888 "%1 - Kontact", plugin->title() ) );
891 mNewActions->setIcon( newAction->
icon() );
892 static_cast<QAction*
>( mNewActions )->setText( newAction->
text() );
893 mNewActions->setWhatsThis( newAction->
whatsThis() );
897 for ( it = mPlugins.
begin(); it != end; ++it ) {
898 if ( !(*it)->newActions().isEmpty() ) {
899 newAction = (*it)->newActions().first();
902 static_cast<QAction*
>( mNewActions )->setIcon( newAction->
icon() );
903 mNewActions->setText( newAction->
text() );
904 mNewActions->setWhatsThis( newAction->
whatsThis() );
910 if ( mSyncActionsEnabled ) {
912 mSyncActions->setIcon( syncAction->
icon() );
913 static_cast<QAction*
>( mSyncActions )->setText( syncAction->
text() );
917 for ( it = mPlugins.
begin(); it != end; ++it ) {
918 if ( !(*it)->syncActions().isEmpty() ) {
919 syncAction = (*it)->syncActions().first();
922 static_cast<QAction*
>( mSyncActions )->setIcon( syncAction->
icon() );
923 mSyncActions->setText( syncAction->
text() );
931 KToolBar *navigatorToolBar = findToolBar(
"navigatorToolBar" );
932 if ( navigatorToolBar && !navigatorToolBar->isHidden() &&
933 ( toolBarArea( navigatorToolBar ) == Qt::TopToolBarArea ||
934 toolBarArea( navigatorToolBar ) == Qt::BottomToolBarArea ) ) {
935 addToolBar( toolBarArea( navigatorToolBar ), navigatorToolBar );
938 applyMainWindowSettings( KGlobal::config()->group(
946 KAction *actionSender =
static_cast<KAction*
>( sender() );
947 actionSender->setChecked(
true );
948 KontactInterface::Plugin *plugin = actionSender->data().value<KontactInterface::Plugin*>();
959 if ( ( *it )->identifier() == pluginName ) {
966 void MainWindow::loadSettings()
971 QList<int> sizes = Prefs::self()->sidePaneSplitter();
980 for ( it = mDelayedPreload.
constBegin(); it != end; ++it ) {
986 void MainWindow::saveSettings()
989 Prefs::self()->mSidePaneSplitter = mSplitter->
sizes();
992 if ( mCurrentPlugin ) {
993 Prefs::self()->mActivePlugin = mCurrentPlugin->identifier();
1012 void MainWindow::showTip(
bool force )
1017 const QString file = (*it)->tipFile();
1023 KTipDialog::showMultiTip(
this, tips, force );
1028 mReallyClose =
true;
1037 dlg->setAllowComponentSelection(
true );
1040 KPluginInfo::List filteredPlugins = mPluginInfos;
1043 for ( it = mPlugins.
constBegin(); it != end; ++it ) {
1044 if ( (*it)->isRunningStandalone() ) {
1045 KPluginInfo::List::ConstIterator infoIt;
1046 KPluginInfo::List::ConstIterator infoEnd(filteredPlugins.constEnd());
1047 for ( infoIt = filteredPlugins.constBegin();
1048 infoIt != infoEnd; ++infoIt ) {
1049 if ( infoIt->pluginName() == (*it)->identifier() ) {
1050 filteredPlugins.removeAll( *infoIt );
1058 dlg->addPluginInfos( filteredPlugins );
1059 connect( dlg, SIGNAL(pluginSelectionChanged()), SLOT(pluginsChanged()) );
1065 void MainWindow::pluginsChanged()
1086 if ( !mAboutDialog ) {
1090 mAboutDialog->show();
1091 mAboutDialog->raise();
1095 void MainWindow::configureShortcuts()
1097 KShortcutsDialog dialog(
1098 KShortcutsEditor::AllActions, KShortcutsEditor::LetterShortcutsAllowed,
this );
1099 dialog.addCollection( actionCollection() );
1101 if ( mCurrentPlugin && mCurrentPlugin->part() ) {
1102 dialog.addCollection( mCurrentPlugin->part()->actionCollection() );
1106 if ( mCurrentPlugin && mCurrentPlugin->part() ) {
1107 mCurrentPlugin->shortcutChanged();
1111 void MainWindow::configureToolbars()
1113 if ( mCurrentPlugin ) {
1114 saveMainWindowSettings(
1115 KGlobal::config()->group(
1126 if ( mCurrentPlugin && mCurrentPlugin->part() ) {
1127 createGUI( mCurrentPlugin->part() );
1129 if ( mCurrentPlugin ) {
1130 applyMainWindowSettings(
1131 KGlobal::config()->group(
1145 const QString path( url.path() );
1147 if ( mCurrentPlugin ) {
1157 if ( !url.query().isEmpty() ) {
1158 app = url.query().
mid( 1 );
1160 KToolInvocation::invokeHelp(
QString(), app );
1163 new KRun( url,
this );
1167 void MainWindow::readProperties(
const KConfigGroup &config )
1169 Core::readProperties( config );
1174 if ( !activePlugins.
isEmpty() ) {
1175 foreach ( KontactInterface::Plugin *plugin, mPlugins ) {
1176 if ( !plugin->isRunningStandalone() && activePlugins.
contains( plugin->identifier() ) ) {
1177 plugin->readProperties( config );
1183 void MainWindow::saveProperties( KConfigGroup &config )
1185 Core::saveProperties( config );
1189 foreach (
const KPluginInfo &pluginInfo, mPluginInfos ) {
1190 if ( pluginInfo.isPluginEnabled() ) {
1191 KontactInterface::Plugin *plugin = pluginFromInfo( pluginInfo );
1193 activePlugins.
append( plugin->identifier() );
1194 plugin->saveProperties( config );
1199 config.writeEntry(
"ActivePlugins", activePlugins );
1202 bool MainWindow::queryClose()
1204 if ( kapp->sessionSaving() || mReallyClose ) {
1208 foreach ( KontactInterface::Plugin *plugin, mPlugins ) {
1209 if ( !plugin->isRunningStandalone() ) {
1210 if ( !plugin->queryClose() ) {
1220 if ( !statusBar() || !mStatusMsgLabel ) {
1224 mStatusMsgLabel->setText( msg );
1227 QString MainWindow::introductionString()
1229 KIconLoader *iconloader = KIconLoader::global();
1230 const int iconSize = iconloader->currentSize( KIconLoader::Desktop );
1232 const QString handbook_icon_path = iconloader->iconPath(
QLatin1String(
"help-contents"), KIconLoader::Desktop );
1233 const QString html_icon_path = iconloader->iconPath(
QLatin1String(
"kontact"), KIconLoader::Desktop );
1234 const QString wizard_icon_path = iconloader->iconPath(
QLatin1String(
"tools-wizard"), KIconLoader::Desktop );
1239 "<h2 style='text-align:center; margin-top: 0px;'>Welcome to Kontact %1</h2>"
1240 "<p align=\"center\">%2</p>"
1241 "<table align=\"center\">"
1242 "<tr><td><a href=\"%3\"><img width=\"%4\" height=\"%5\" src=\"%6\" /></a></td>"
1243 "<td><a href=\"%7\">%8</a><br /><span id=\"subtext\"><nobr>%9</nobr></span></td></tr>"
1244 "<tr><td><a href=\"%10\"><img width=\"%11\" height=\"%12\" src=\"%13\" /></a></td>"
1245 "<td><a href=\"%14\">%15</a><br /><span id=\"subtext\"><nobr>%16</nobr></span></td></tr>"
1246 "<tr><td><a href=\"%17\"><img width=\"%18\" height=\"%19\" src=\"%20\" /></a></td>"
1247 "<td><a href=\"%21\">%22</a><br /><span id=\"subtext\"><nobr>%23</nobr></span></td></tr>"
1249 "<p style=\"margin-bottom: 0px\"> <a href=\"%24\">Skip this introduction</a></p>" ).
1250 subs( KGlobal::mainComponent().aboutData()->
version() ).
1251 subs( i18nc(
"@item:intext",
1252 "Kontact handles your e-mail, address book, calendar, to-do list and more." ) ).
1258 subs( i18nc(
"@item:intext",
"Read Manual" ) ).
1259 subs( i18nc(
"@item:intext",
"Learn more about Kontact and its components" ) ).
1265 subs( i18nc(
"@item:intext",
"Visit Kontact Website" ) ).
1266 subs( i18nc(
"@item:intext",
"Access online resources and tutorials" ) ).
1272 subs( i18nc(
"@item:intext",
"Setup your Accounts" ) ).
1273 subs( i18nc(
"@item:intext",
"Prepare Kontact for use" ) ).
1279 void MainWindow::slotShowHideSideBar()
1283 if (sizes.
at(0) != 0) {
static bool pluginActionWeightLessThan(const QAction *left, const QAction *right)
void slotOpenUrl(const KUrl &url)
void setSizes(const QList< int > &list)
bool contains(const Key &key) const
virtual void setCurrentPlugin(const QString &)=0
static BroadcastStatus * instance()
void slotActivePartChanged(KParts::Part *part)
const T & at(int i) const
bool registerObject(const QString &path, QObject *object, QFlags< QDBusConnection::RegisterOption > options)
iterator erase(iterator pos)
QDBusConnection sessionBus()
void slotShowStatusMsg(const QString &)
void setInitialActivePluginModule(const QString &)
void slotNewToolbarConfig()
void slotShowTipOnStart()
int count(const T &value) const
void append(const T &value)
QList< int > sizes() const
static const int KSYCOCA_WAIT_TIMEOUT
int removeAll(const T &value)
void setOverrideCursor(const QCursor &cursor)
void restoreOverrideCursor()
void setMargin(int margin)
virtual void selectPlugin(KontactInterface::Plugin *plugin)
QVariant fromValue(const T &value)
bool contains(const T &value) const
void activateInitialPluginModule()
static bool pluginWeightLessThan(const KontactInterface::Plugin *left, const KontactInterface::Plugin *right)
QString mid(int position, int n) const
virtual void updatePlugins()=0
This method is called by the core whenever the count of plugins has changed.
void insert(int i, const T &value)
QSet< T > fromList(const QList< T > &list)
void slotShowIntroduction()
QString fromLatin1(const char *str, int size)
iterator insert(const Key &key, const T &value)
void setCollapsible(int index, bool collapse)
const_iterator constEnd() const
const_iterator constBegin() const
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
void slotActionTriggered()
void setSpacing(int spacing)
static const char version[]
int remove(const Key &key)
QByteArray toUtf8() const