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

kopete/libkopete

  • sources
  • kde-4.14
  • kdenetwork
  • kopete
  • libkopete
  • ui
kopeteinfodialog.cpp
Go to the documentation of this file.
1 /*
2  kopeteinfodialog.cpp - A dialog to configure information for contacts,
3  metacontacts, groups, identities, etc
4 
5  Copyright (c) 2007 by Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net>
6 
7  Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org>
8 
9  *************************************************************************
10  * *
11  * This library is free software; you can redistribute it and/or *
12  * modify it under the terms of the GNU Lesser General Public *
13  * License as published by the Free Software Foundation; either *
14  * version 2 of the License, or (at your option) any later version. *
15  * *
16  *************************************************************************
17 */
18 
19 #include "kopeteinfodialog.h"
20 #include "collapsiblewidget.h"
21 #include <kopetepropertycontainer.h>
22 #include <KLocale>
23 #include <KTitleWidget>
24 #include <KIconLoader>
25 #include <QVBoxLayout>
26 
27 namespace Kopete
28 {
29 
30 namespace UI
31 {
32 
33 class InfoDialog::Private
34 {
35 public:
36  QVBoxLayout *layout;
37  KTitleWidget *title;
38  SettingsContainer *container;
39 };
40 
41 InfoDialog::InfoDialog(QWidget *parent, const QString &title, const QString &icon)
42 : KDialog(parent), d(new Private())
43 {
44  initialize();
45 
46  if (!title.isEmpty())
47  setTitle( title );
48  else
49  setTitle( i18n( "Information" ) );
50  setIcon( icon );
51 
52  connect(this, SIGNAL(okClicked()), this, SLOT(slotSave()));
53 }
54 
55 InfoDialog::InfoDialog(QWidget *parent, const QString &title, const KIcon &icon)
56 : KDialog(parent), d(new Private())
57 {
58  initialize();
59 
60  if (!title.isEmpty())
61  setTitle( title );
62  else
63  setTitle( i18n( "Information" ) );
64  setIcon( icon );
65 
66 }
67 
68 void InfoDialog::initialize()
69 {
70  //FIXME: this should be changed
71  resize(500,500);
72 
73  d->layout = new QVBoxLayout(mainWidget());
74 
75  d->title = new KTitleWidget();
76  d->layout->addWidget( d->title );
77 
78  d->container = new SettingsContainer();
79  d->layout->addWidget( d->container );
80 }
81 
82 InfoDialog::~InfoDialog()
83 {
84  delete d;
85 }
86 
87 void InfoDialog::slotSave()
88 {
89 }
90 
91 void InfoDialog::setTitle(const QString &title)
92 {
93  d->title->setText( title, Qt::AlignLeft );
94 }
95 
96 void InfoDialog::setIcon(const QString &icon)
97 {
98  d->title->setPixmap( icon );
99 }
100 
101 void InfoDialog::setIcon(const KIcon &icon)
102 {
103  d->title->setPixmap( icon );
104 }
105 
106 void InfoDialog::addWidget(QWidget *w, const QString &caption)
107 {
108  CollapsibleWidget *c = d->container->insertWidget(w, caption);
109  // FIXME: maybe we could check for pages that were collapsed by the user the
110  // last time the dialog was shown
111  c->setExpanded(true);
112 }
113 
114 } // namespace UI
115 } // namespace Kopete
116 
117 #include "kopeteinfodialog.moc"
QWidget
Kopete::UI::InfoDialog::addWidget
void addWidget(QWidget *w, const QString &caption)
Definition: kopeteinfodialog.cpp:106
KDialog
Kopete::UI::InfoDialog::~InfoDialog
~InfoDialog()
Destructor.
Definition: kopeteinfodialog.cpp:82
CollapsibleWidget
A widget that has a caption and a collapsible widget.
Definition: collapsiblewidget.h:65
kopetepropertycontainer.h
kopeteinfodialog.h
CollapsibleWidget::setExpanded
void setExpanded(bool collapsed)
Definition: collapsiblewidget.cpp:235
Kopete::UI::InfoDialog::setIcon
void setIcon(const QString &icon)
Definition: kopeteinfodialog.cpp:96
collapsiblewidget.h
Kopete::UI::InfoDialog::slotSave
virtual void slotSave()
This should be reimplemented in derived dialogs to enable saving info.
Definition: kopeteinfodialog.cpp:87
QString::isEmpty
bool isEmpty() const
QVBoxLayout
QString
SettingsContainer
A scrollable container that contains groups of settings, usually in the form of CollapsibleWidgets.
Definition: collapsiblewidget.h:104
Kopete::UI::Global::mainWidget
KOPETE_EXPORT QWidget * mainWidget()
Returns the main widget - this is the widget that message boxes and KNotify stuff should use as a par...
Definition: kopeteuiglobal.cpp:37
Kopete::UI::InfoDialog::InfoDialog
InfoDialog(QWidget *parent, const QString &title=QString(), const QString &icon=QString())
Constructor.
Definition: kopeteinfodialog.cpp:41
Kopete::UI::InfoDialog::setTitle
void setTitle(const QString &title)
Definition: kopeteinfodialog.cpp:91
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/libkopete

Skip menu "kopete/libkopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

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