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

kmail

  • sources
  • kde-4.12
  • kdepim
  • kmail
  • searchdialog
  • debug
searchdebugdialog.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 "searchdebugdialog.h"
19 #include "searchdebugwidget.h"
20 #include "searchdebugnepomukshowdialog.h"
21 
22 #include "pimcommon/util/pimutil.h"
23 
24 #include <KLocale>
25 
26 #include <QPointer>
27 #include <QInputDialog>
28 
29 SearchDebugDialog::SearchDebugDialog(const QString &query, QWidget *parent)
30  : KDialog(parent)
31 {
32  setCaption( i18n( "Search query debug" ) );
33  setButtons( Close | User1 | User2 );
34  setButtonText(User1, i18n("Save As..."));
35  setButtonText(User2, i18n("Search info with nepomukshow..."));
36 
37  mSearchDebugWidget = new SearchDebugWidget(query, this);
38  setMainWidget( mSearchDebugWidget );
39  connect(this, SIGNAL(user1Clicked()), this, SLOT(slotSaveAs()));
40  connect(this, SIGNAL(user2Clicked()), this, SLOT(slotSearchInfoWithNepomuk()));
41  readConfig();
42 }
43 
44 SearchDebugDialog::~SearchDebugDialog()
45 {
46  writeConfig();
47 }
48 
49 void SearchDebugDialog::slotSearchInfoWithNepomuk()
50 {
51  const QString nepomukId = QInputDialog::getText(this, i18n("Search with nepomukshow"), i18n("Nepomuk id:"));
52  if (!nepomukId.isEmpty()) {
53  QPointer<SearchDebugNepomukShowDialog> dlg = new SearchDebugNepomukShowDialog(nepomukId, this);
54  dlg->exec();
55  delete dlg;
56  }
57 }
58 
59 void SearchDebugDialog::readConfig()
60 {
61  KConfigGroup group( KGlobal::config(), "SearchDebugDialog" );
62  const QSize sizeDialog = group.readEntry( "Size", QSize(800,600) );
63  if ( sizeDialog.isValid() ) {
64  resize( sizeDialog );
65  }
66 }
67 
68 void SearchDebugDialog::writeConfig()
69 {
70  KConfigGroup group( KGlobal::config(), "SearchDebugDialog" );
71  group.writeEntry( "Size", size() );
72 }
73 
74 void SearchDebugDialog::slotSaveAs()
75 {
76  const QString filter = i18n( "all files (*)" );
77  PimCommon::Util::saveTextAs(mSearchDebugWidget->queryStr(), filter, this);
78 }
79 
80 
81 #include "searchdebugdialog.moc"
searchdebugdialog.h
QWidget
KDialog
SearchDebugWidget
Definition: searchdebugwidget.h:59
SearchDebugDialog::SearchDebugDialog
SearchDebugDialog(const QString &query, QWidget *parent=0)
Definition: searchdebugdialog.cpp:29
searchdebugwidget.h
SearchDebugWidget::queryStr
QString queryStr() const
Definition: searchdebugwidget.cpp:164
searchdebugnepomukshowdialog.h
SearchDebugNepomukShowDialog
Definition: searchdebugnepomukshowdialog.h:27
SearchDebugDialog::~SearchDebugDialog
~SearchDebugDialog()
Definition: searchdebugdialog.cpp:44
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kmail

Skip menu "kmail"
  • 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

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