Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Akonadi Contacts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
Akonadi Contacts
Commits
1ed0ac39
Commit
1ed0ac39
authored
Apr 14, 2009
by
Tobias Koenig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing secrecy editor widgets
svn path=/trunk/KDE/kdepim/kcontactmanager/editor/; revision=953731
parent
20cd9746
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
119 additions
and
0 deletions
+119
-0
akonadi/contact/editor/secrecyeditwidget.cpp
akonadi/contact/editor/secrecyeditwidget.cpp
+69
-0
akonadi/contact/editor/secrecyeditwidget.h
akonadi/contact/editor/secrecyeditwidget.h
+50
-0
No files found.
akonadi/contact/editor/secrecyeditwidget.cpp
0 → 100644
View file @
1ed0ac39
/*
This file is part of KContactManager.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "secrecyeditwidget.h"
#include <QtGui/QVBoxLayout>
#include <kabc/addressee.h>
#include <kabc/secrecy.h>
#include <kcombobox.h>
SecrecyEditWidget
::
SecrecyEditWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QVBoxLayout
*
layout
=
new
QVBoxLayout
(
this
);
layout
->
setMargin
(
0
);
mSecrecyCombo
=
new
KComboBox
(
this
);
layout
->
addWidget
(
mSecrecyCombo
);
const
KABC
::
Secrecy
::
TypeList
list
=
KABC
::
Secrecy
::
typeList
();
KABC
::
Secrecy
::
TypeList
::
ConstIterator
it
;
// (*it) is the type enum, which is also used as the index in the combo
for
(
it
=
list
.
begin
();
it
!=
list
.
end
();
++
it
)
mSecrecyCombo
->
insertItem
(
*
it
,
KABC
::
Secrecy
::
typeLabel
(
*
it
)
);
}
SecrecyEditWidget
::~
SecrecyEditWidget
()
{
}
void
SecrecyEditWidget
::
setReadOnly
(
bool
readOnly
)
{
mSecrecyCombo
->
setEnabled
(
!
readOnly
);
}
void
SecrecyEditWidget
::
loadContact
(
const
KABC
::
Addressee
&
contact
)
{
if
(
contact
.
secrecy
().
type
()
!=
KABC
::
Secrecy
::
Invalid
)
mSecrecyCombo
->
setCurrentIndex
(
contact
.
secrecy
().
type
()
);
}
void
SecrecyEditWidget
::
storeContact
(
KABC
::
Addressee
&
contact
)
const
{
KABC
::
Secrecy
secrecy
;
secrecy
.
setType
(
(
KABC
::
Secrecy
::
Type
)
mSecrecyCombo
->
currentIndex
()
);
contact
.
setSecrecy
(
secrecy
);
}
#include "secrecyeditwidget.moc"
akonadi/contact/editor/secrecyeditwidget.h
0 → 100644
View file @
1ed0ac39
/*
This file is part of KContactManager.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef SECRECYEDITWIDGET_H
#define SECRECYEDITWIDGET_H
#include <QtGui/QWidget>
namespace
KABC
{
class
Addressee
;
}
class
KComboBox
;
class
SecrecyEditWidget
:
public
QWidget
{
Q_OBJECT
public:
explicit
SecrecyEditWidget
(
QWidget
*
parent
=
0
);
~
SecrecyEditWidget
();
void
loadContact
(
const
KABC
::
Addressee
&
contact
);
void
storeContact
(
KABC
::
Addressee
&
contact
)
const
;
void
setReadOnly
(
bool
readOnly
);
private:
KComboBox
*
mSecrecyCombo
;
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment