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

messageviewer

  • sources
  • kde-4.12
  • kdepim
  • messageviewer
  • adblock
adblockaddsubscriptiondialog.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2013 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 "adblockaddsubscriptiondialog.h"
19 #include "adblockutil.h"
20 
21 #include <KLocale>
22 
23 #include <QComboBox>
24 #include <QLabel>
25 #include <QHBoxLayout>
26 
27 using namespace MessageViewer;
28 AdBlockAddSubscriptionDialog::AdBlockAddSubscriptionDialog(const QStringList &excludeList, QWidget *parent)
29  : KDialog(parent)
30 {
31  setCaption( i18n("Add subscription") );
32  setButtons( Ok|Cancel );
33  QWidget *w = new QWidget;
34  QHBoxLayout *lay = new QHBoxLayout;
35  QLabel *lab = new QLabel(i18n("Select List:"));
36  lay->addWidget(lab);
37 
38  mListSubscription = new QComboBox;
39  lay->addWidget(mListSubscription);
40 
41  w->setLayout(lay);
42  setMainWidget(w);
43  initializeList(excludeList);
44 }
45 
46 AdBlockAddSubscriptionDialog::~AdBlockAddSubscriptionDialog()
47 {
48 
49 }
50 
51 void AdBlockAddSubscriptionDialog::initializeList(const QStringList &excludeList)
52 {
53  QMapIterator<QString, QString> i(MessageViewer::AdBlockUtil::listSubscriptions());
54  while (i.hasNext()) {
55  i.next();
56  if (!excludeList.contains(i.key())) {
57  mListSubscription->addItem(i.key(), i.value());
58  }
59  }
60 }
61 
62 void AdBlockAddSubscriptionDialog::selectedList(QString &name, QString &url)
63 {
64  name = mListSubscription->currentText();
65  url = mListSubscription->itemData(mListSubscription->currentIndex()).toString();
66 }
67 
68 #include "adblockaddsubscriptiondialog.moc"
MessageViewer::AdBlockAddSubscriptionDialog::~AdBlockAddSubscriptionDialog
~AdBlockAddSubscriptionDialog()
Definition: adblockaddsubscriptiondialog.cpp:46
QWidget
KDialog
adblockaddsubscriptiondialog.h
MessageViewer::AdBlockAddSubscriptionDialog::selectedList
void selectedList(QString &name, QString &url)
Definition: adblockaddsubscriptiondialog.cpp:62
MessageViewer::AdBlockAddSubscriptionDialog::AdBlockAddSubscriptionDialog
AdBlockAddSubscriptionDialog(const QStringList &excludeList, QWidget *parent=0)
Definition: adblockaddsubscriptiondialog.cpp:28
adblockutil.h
MessageViewer::AdBlockUtil::listSubscriptions
QMap< QString, QString > listSubscriptions()
Definition: adblockutil.cpp:20
QLabel
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

messageviewer

Skip menu "messageviewer"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

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

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