• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kaddressbook

  • sources
  • kde-4.14
  • kdepim
  • kaddressbook
  • merge
  • searchduplicate
mergecontactselectinformationtabwidget.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2015 Montel Laurent <montel@kde.org>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License, version 2, as
6  published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful, but
9  WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #include "mergecontactselectinformationtabwidget.h"
19 #include "merge/widgets/mergecontactselectinformationscrollarea.h"
20 #include <QTabBar>
21 
22 using namespace KABMergeContacts;
23 
24 MergeContactSelectInformationTabWidget::MergeContactSelectInformationTabWidget(QWidget *parent)
25  : QTabWidget(parent)
26 {
27 
28 }
29 
30 MergeContactSelectInformationTabWidget::~MergeContactSelectInformationTabWidget()
31 {
32 
33 }
34 
35 void MergeContactSelectInformationTabWidget::updateTabWidget()
36 {
37  tabBar()->setVisible(count()>1);
38 }
39 
40 bool MergeContactSelectInformationTabWidget::tabBarVisible() const
41 {
42  return tabBar()->isVisible();
43 }
44 
45 void MergeContactSelectInformationTabWidget::addNewWidget(const KABMergeContacts::MergeConflictResult &list, const Akonadi::Collection &col)
46 {
47  KABMergeContacts::MergeContactSelectInformationScrollArea *area = new KABMergeContacts::MergeContactSelectInformationScrollArea;
48  area->setContacts(list.conflictInformation, list.list, col);
49  //KF5 add i18n
50  addTab(area, QString::fromLatin1("Duplicate contact %1").arg(count()+1));
51 }
52 
53 void MergeContactSelectInformationTabWidget::setRequiresSelectInformationWidgets(const QVector<KABMergeContacts::MergeConflictResult> &list, const Akonadi::Collection &col)
54 {
55  clear();
56  Q_FOREACH(const KABMergeContacts::MergeConflictResult &lst, list) {
57  addNewWidget(lst, col);
58  }
59  updateTabWidget();
60 }
KABMergeContacts::MergeContactSelectInformationScrollArea::setContacts
void setContacts(MergeContacts::ConflictInformations conflictTypes, const Akonadi::Item::List &listItem, const Akonadi::Collection &col)
Definition: mergecontactselectinformationscrollarea.cpp:72
QWidget
QWidget::setVisible
virtual void setVisible(bool visible)
QTabWidget::count
int count() const
QTabWidget
QTabWidget::clear
void clear()
KABMergeContacts::MergeConflictResult
Definition: searchduplicateresultwidget.h:36
KABMergeContacts::MergeContactSelectInformationTabWidget::~MergeContactSelectInformationTabWidget
~MergeContactSelectInformationTabWidget()
Definition: mergecontactselectinformationtabwidget.cpp:30
QTabWidget::addTab
int addTab(QWidget *page, const QString &label)
KABMergeContacts::MergeContactSelectInformationTabWidget::MergeContactSelectInformationTabWidget
MergeContactSelectInformationTabWidget(QWidget *parent=0)
Definition: mergecontactselectinformationtabwidget.cpp:24
KABMergeContacts::MergeConflictResult::conflictInformation
MergeContacts::ConflictInformations conflictInformation
Definition: searchduplicateresultwidget.h:38
KABMergeContacts::MergeContactSelectInformationTabWidget::updateTabWidget
void updateTabWidget()
Definition: mergecontactselectinformationtabwidget.cpp:35
KABMergeContacts::MergeContactSelectInformationTabWidget::tabBarVisible
bool tabBarVisible() const
Definition: mergecontactselectinformationtabwidget.cpp:40
mergecontactselectinformationtabwidget.h
QVector< KABMergeContacts::MergeConflictResult >
KABMergeContacts::MergeConflictResult::list
Akonadi::Item::List list
Definition: searchduplicateresultwidget.h:37
KABMergeContacts::MergeContactSelectInformationTabWidget::setRequiresSelectInformationWidgets
void setRequiresSelectInformationWidgets(const QVector< KABMergeContacts::MergeConflictResult > &list, const Akonadi::Collection &col)
Definition: mergecontactselectinformationtabwidget.cpp:53
QString::fromLatin1
QString fromLatin1(const char *str, int size)
KABMergeContacts::MergeContactSelectInformationScrollArea
Definition: mergecontactselectinformationscrollarea.h:28
QTabWidget::tabBar
QTabBar * tabBar() const
mergecontactselectinformationscrollarea.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:34 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kaddressbook

Skip menu "kaddressbook"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal