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

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • kdeui
  • dialogs
kbugreport.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 1999 David Faure <faure@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include "kbugreport.h"
21 
22 #include <QtCore/QProcess>
23 #include <QtCore/QCoreApplication>
24 #include <QtGui/QPushButton>
25 #include <QtGui/QLayout>
26 #include <QtGui/QRadioButton>
27 #include <QtGui/QGroupBox>
28 #include <QtGui/QCloseEvent>
29 
30 #include <kaboutdata.h>
31 #include <kcombobox.h>
32 #include <ktoolinvocation.h>
33 #include <kdebug.h>
34 #include <klineedit.h>
35 #include <klocale.h>
36 #include <kmessagebox.h>
37 #include <kstandarddirs.h>
38 #include <kcomponentdata.h>
39 #include <kurllabel.h>
40 #include <ktextedit.h>
41 #include <ktitlewidget.h>
42 
43 #include <stdio.h>
44 #include <pwd.h>
45 #include <unistd.h>
46 #include <sys/utsname.h>
47 
48 #include "kdepackages.h"
49 #include "kdeversion.h"
50 
51 #include <config-compiler.h>
52 
53 class KBugReportPrivate {
54 public:
55  KBugReportPrivate(KBugReport *q): q(q) {}
56 
57  void _k_slotConfigureEmail();
58  void _k_slotSetFrom();
59  void _k_appChanged(int);
60  void _k_updateUrl();
61 
62  KBugReport *q;
63  QProcess * m_process;
64  const KAboutData * m_aboutData;
65 
66  KTextEdit * m_lineedit;
67  KLineEdit * m_subject;
68  QLabel * m_from;
69  QLabel * m_version;
70  QString m_strVersion;
71  QGroupBox * m_bgSeverity;
72  QPushButton * m_configureEmail;
73 
74  KComboBox *appcombo;
75  QString lastError;
76  QString kde_version;
77  QString appname;
78  QString os;
79  KUrl url;
80  QList<QRadioButton*> severityButtons;
81  int currentSeverity() {
82  for (int i=0;i<severityButtons.count();i++)
83  if (severityButtons[i]->isChecked()) return i;
84  return -1;
85  }
86  bool submitBugWeb;
87 };
88 
89 KBugReport::KBugReport( QWidget * _parent, bool modal, const KAboutData *aboutData )
90  : KDialog( _parent ), d( new KBugReportPrivate(this) )
91 {
92  setCaption( i18n("Submit Bug Report") );
93  setButtons( Ok | Cancel );
94  setModal(modal);
95 
96  // Use supplied aboutdata, otherwise the one from the active componentData
97  // otherwise the KGlobal one. _activeInstance should neved be 0L in theory.
98  d->m_aboutData = aboutData ? aboutData
99  : (KGlobal::activeComponent().isValid() ? KGlobal::activeComponent().aboutData()
100  : KGlobal::mainComponent().aboutData());
101  d->m_process = 0;
102  QWidget * parent = new QWidget(this);
103  d->submitBugWeb = false;
104 
105  if ( d->m_aboutData->bugAddress() == QLatin1String("submit@bugs.kde.org") )
106  {
107  // This is a core KDE application -> redirect to the web form
108  d->submitBugWeb = true;
109  setButtonGuiItem( Cancel, KStandardGuiItem::close() );
110  }
111 
112  QLabel * tmpLabel;
113  QVBoxLayout * lay = new QVBoxLayout( parent);
114 
115  KTitleWidget *title = new KTitleWidget( this );
116  title->setText(i18n( "Submit Bug Report" ) );
117  title->setPixmap( KIcon( "tools-report-bug" ).pixmap( 32 ) );
118  lay->addWidget( title );
119 
120  QGridLayout *glay = new QGridLayout();
121  lay->addLayout(glay);
122 
123  int row = 0;
124 
125  if ( !d->submitBugWeb )
126  {
127  // From
128  QString qwtstr = i18n( "Your email address. If incorrect, use the Configure Email button to change it" );
129  tmpLabel = new QLabel( i18nc("Email sender address", "From:"), parent );
130  glay->addWidget( tmpLabel, row,0 );
131  tmpLabel->setWhatsThis(qwtstr );
132  d->m_from = new QLabel( parent );
133  glay->addWidget( d->m_from, row, 1 );
134  d->m_from->setWhatsThis(qwtstr );
135 
136 
137  // Configure email button
138  d->m_configureEmail = new QPushButton( i18n("Configure Email..."),
139  parent );
140  connect( d->m_configureEmail, SIGNAL(clicked()), this,
141  SLOT(_k_slotConfigureEmail()) );
142  glay->addWidget( d->m_configureEmail, 0, 2, 3, 1, Qt::AlignTop|Qt::AlignRight );
143 
144  // To
145  qwtstr = i18n( "The email address this bug report is sent to." );
146  tmpLabel = new QLabel( i18nc("Email receiver address", "To:"), parent );
147  glay->addWidget( tmpLabel, ++row,0 );
148  tmpLabel->setWhatsThis(qwtstr );
149  tmpLabel = new QLabel( d->m_aboutData->bugAddress(), parent );
150  tmpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
151  glay->addWidget( tmpLabel, row, 1 );
152  tmpLabel->setWhatsThis(qwtstr );
153 
154  setButtonGuiItem( Ok, KGuiItem( i18n("&Send"), "mail-send", i18n( "Send bug report." ),
155  i18n( "Send this bug report to %1." , d->m_aboutData->bugAddress() ) ) );
156  row++;
157  }
158  else
159  {
160  d->m_configureEmail = 0;
161  d->m_from = 0;
162  }
163 
164  // Program name
165  QString qwtstr = i18n( "The application for which you wish to submit a bug report - if incorrect, please use the Report Bug menu item of the correct application" );
166  tmpLabel = new QLabel( i18n("Application: "), parent );
167  glay->addWidget( tmpLabel, row, 0 );
168  tmpLabel->setWhatsThis(qwtstr );
169  d->appcombo = new KComboBox( false, parent );
170  d->appcombo->setWhatsThis(qwtstr );
171  QStringList packageList;
172  for (int c = 0; packages[c]; ++c)
173  packageList << QString::fromLatin1(packages[c]);
174  d->appcombo->addItems(packageList);
175  connect(d->appcombo, SIGNAL(activated(int)), SLOT(_k_appChanged(int)));
176  d->appname = d->m_aboutData
177  ? d->m_aboutData->productName()
178  : qApp->applicationName() ;
179  glay->addWidget( d->appcombo, row, 1 );
180  int index = 0;
181  for (; index < d->appcombo->count(); index++) {
182  if (d->appcombo->itemText(index) == d->appname) {
183  break;
184  }
185  }
186  if (index == d->appcombo->count()) { // not present
187  d->appcombo->addItem(d->appname);
188  }
189  d->appcombo->setCurrentIndex(index);
190 
191  tmpLabel->setWhatsThis(qwtstr );
192 
193  // Version
194  qwtstr = i18n( "The version of this application - please make sure that no newer version is available before sending a bug report" );
195  tmpLabel = new QLabel( i18n("Version:"), parent );
196  glay->addWidget( tmpLabel, ++row, 0 );
197  tmpLabel->setWhatsThis(qwtstr );
198  if (d->m_aboutData)
199  d->m_strVersion = d->m_aboutData->version();
200  else
201  d->m_strVersion = i18n("no version set (programmer error)");
202  d->kde_version = QString::fromLatin1( KDE_VERSION_STRING );
203  d->kde_version += ", " + QString::fromLatin1( KDE_DISTRIBUTION_TEXT );
204  if ( !d->submitBugWeb )
205  d->m_strVersion += ' ' + d->kde_version;
206  d->m_version = new QLabel( d->m_strVersion, parent );
207  d->m_version->setTextInteractionFlags(Qt::TextBrowserInteraction);
208  //glay->addWidget( d->m_version, row, 1 );
209  glay->addWidget( d->m_version, row, 1, 1, 2 );
210  d->m_version->setWhatsThis(qwtstr );
211 
212  tmpLabel = new QLabel(i18n("OS:"), parent);
213  glay->addWidget( tmpLabel, ++row, 0 );
214 
215  struct utsname unameBuf;
216  uname( &unameBuf );
217  d->os = QString::fromLatin1( unameBuf.sysname ) +
218  " (" + QString::fromLatin1( unameBuf.machine ) + ") "
219  "release " + QString::fromLatin1( unameBuf.release );
220 
221  tmpLabel = new QLabel(d->os, parent);
222  tmpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
223  glay->addWidget( tmpLabel, row, 1, 1, 2 );
224 
225  tmpLabel = new QLabel(i18n("Compiler:"), parent);
226  glay->addWidget( tmpLabel, ++row, 0 );
227  tmpLabel = new QLabel(QString::fromLatin1(KDE_COMPILER_VERSION), parent);
228  tmpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
229  glay->addWidget( tmpLabel, row, 1, 1, 2 );
230 
231  if ( !d->submitBugWeb )
232  {
233  // Severity
234  d->m_bgSeverity = new QGroupBox( i18n("Se&verity"), parent );
235  static const char * const sevNames[5] = { "critical", "grave", "normal", "wishlist", "i18n" };
236  const QString sevTexts[5] = { i18n("Critical"), i18n("Grave"), i18nc("normal severity","Normal"), i18n("Wishlist"), i18n("Translation") };
237  QHBoxLayout *severityLayout=new QHBoxLayout(d->m_bgSeverity);
238  for (int i = 0 ; i < 5 ; i++ )
239  {
240  // Store the severity string as the name
241  QRadioButton *rb = new QRadioButton( sevTexts[i], d->m_bgSeverity);
242  rb->setObjectName(sevNames[i] );
243  d->severityButtons.append(rb);
244  severityLayout->addWidget(rb);
245  if (i==2) rb->setChecked(true); // default : "normal"
246  }
247 
248  lay->addWidget( d->m_bgSeverity );
249 
250  // Subject
251  QHBoxLayout * hlay = new QHBoxLayout();
252  lay->addItem(hlay);
253  tmpLabel = new QLabel( i18n("S&ubject: "), parent );
254  hlay->addWidget( tmpLabel );
255  d->m_subject = new KLineEdit( parent );
256  d->m_subject->setClearButtonShown(true);
257  d->m_subject->setFocus();
258  tmpLabel->setBuddy( d->m_subject );
259  hlay->addWidget( d->m_subject );
260 
261  QString text = i18n("Enter the text (in English if possible) that you wish to submit for the "
262  "bug report.\n"
263  "If you press \"Send\", a mail message will be sent to the maintainer of "
264  "this program.\n");
265  QLabel * label = new QLabel( parent);
266 
267  label->setText( text );
268  lay->addWidget( label );
269 
270  // The multiline-edit
271  d->m_lineedit = new KTextEdit( parent);
272  d->m_lineedit->setMinimumHeight( 180 ); // make it big
273  d->m_lineedit->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
274  d->m_lineedit->setLineWrapMode(QTextEdit::WidgetWidth);
275  d->m_lineedit->setCheckSpellingEnabled(true);
276  d->m_lineedit->setSpellCheckingLanguage("en");
277  lay->addWidget( d->m_lineedit, 10 /*stretch*/ );
278 
279  d->_k_slotSetFrom();
280  } else {
281  // Point to the web form
282 
283  lay->addSpacing(10);
284  QString text = i18n("<qt>To submit a bug report, click on the button below. This will open a web browser "
285  "window on <a href=\"http://bugs.kde.org\">http://bugs.kde.org</a> where you will find "
286  "a form to fill in. The information displayed above will be transferred to that server.</qt>");
287  QLabel * label = new QLabel( text, parent);
288  label->setOpenExternalLinks( true );
289  label->setTextInteractionFlags( Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard );
290  label->setWordWrap( true );
291  lay->addWidget( label );
292  lay->addSpacing(10);
293 
294  d->appcombo->setFocus();
295 
296  d->_k_updateUrl();
297 
298  setButtonText(Ok, i18n("&Launch Bug Report Wizard"));
299  setButtonIcon(Ok, KIcon("tools-report-bug"));
300  }
301  parent->setMinimumHeight( parent->sizeHint().height() + 20 ); // WORKAROUND: prevent "cropped" kcombobox
302  setMainWidget(parent);
303 }
304 
305 KBugReport::~KBugReport()
306 {
307  delete d;
308 }
309 
310 QString KBugReport::messageBody() const
311 {
312  if ( !d->submitBugWeb )
313  return d->m_lineedit->toPlainText();
314  else
315  return QString();
316 }
317 
318 void KBugReport::setMessageBody(const QString &messageBody)
319 {
320  if ( !d->submitBugWeb )
321  d->m_lineedit->setPlainText(messageBody);
322 }
323 
324 void KBugReportPrivate::_k_updateUrl()
325 {
326  url = KUrl( "https://bugs.kde.org/enter_bug.cgi" );
327  url.addQueryItem( "format", "guided" ); // use the guided form
328 
329  // the string format is product/component, where component is optional
330  QStringList list = appcombo->currentText().split('/');
331  url.addQueryItem( "product", list[0] );
332  if (list.size() == 2) {
333  url.addQueryItem( "component", list[1] );
334  }
335 
336  url.addQueryItem( "version", m_strVersion );
337 
338  // TODO: guess and fill OS(sys_os) and Platform(rep_platform) fields
339 }
340 
341 void KBugReportPrivate::_k_appChanged(int i)
342 {
343  QString appName = appcombo->itemText(i);
344  int index = appName.indexOf( '/' );
345  if ( index > 0 )
346  appName = appName.left( index );
347  kDebug() << "appName " << appName;
348 
349  QString strDisplayVersion; //Version string to show in the UI
350  if (appname == appName && m_aboutData) {
351  m_strVersion = m_aboutData->version();
352  strDisplayVersion = m_strVersion;
353  } else {
354  m_strVersion = QLatin1String("unknown"); //English string to put in the bug report
355  strDisplayVersion = i18nc("unknown program name", "unknown");
356  }
357 
358  if ( !submitBugWeb ) {
359  m_strVersion += ' ' + kde_version;
360  strDisplayVersion += ' ' + kde_version;
361  }
362 
363  m_version->setText(strDisplayVersion);
364  if ( submitBugWeb )
365  _k_updateUrl();
366 }
367 
368 void KBugReportPrivate::_k_slotConfigureEmail()
369 {
370  if (m_process) return;
371  m_process = new QProcess;
372  QObject::connect( m_process, SIGNAL(finished(int,QProcess::ExitStatus)), q, SLOT(_k_slotSetFrom()) );
373  m_process->start( QString::fromLatin1("kcmshell4"), QStringList() << QString::fromLatin1("kcm_useraccount") );
374  if ( !m_process->waitForStarted() )
375  {
376  kDebug() << "Couldn't start kcmshell4..";
377  delete m_process;
378  m_process = 0;
379  return;
380  }
381  m_configureEmail->setEnabled(false);
382 }
383 
384 void KBugReportPrivate::_k_slotSetFrom()
385 {
386  delete m_process;
387  m_process = 0;
388  m_configureEmail->setEnabled(true);
389 
390  // ### KDE4: why oh why is KEMailSettings in kio?
391  KConfig emailConf( QString::fromLatin1("emaildefaults") );
392 
393  KConfigGroup cg(&emailConf, "Defaults");
394  // find out the default profile
395  QString profile = QString::fromLatin1("PROFILE_");
396  profile += cg.readEntry( QString::fromLatin1("Profile"),
397  QString::fromLatin1("Default") );
398 
399  KConfigGroup profileGrp(&emailConf, profile );
400  QString fromaddr = profileGrp.readEntry( "EmailAddress" );
401  if (fromaddr.isEmpty()) {
402  struct passwd *p;
403  p = getpwuid(getuid());
404  fromaddr = QString::fromLatin1(p->pw_name);
405  } else {
406  QString name = profileGrp.readEntry( "FullName" );
407  if (!name.isEmpty())
408  fromaddr = name + QString::fromLatin1(" <") + fromaddr + QString::fromLatin1(">");
409  }
410  m_from->setText( fromaddr );
411 }
412 
413 void KBugReport::accept()
414 {
415  if ( d->submitBugWeb ) {
416  KToolInvocation::invokeBrowser( d->url.url() );
417  return;
418  }
419 
420  if( d->m_lineedit->toPlainText().isEmpty() ||
421  d->m_subject->text().isEmpty() )
422  {
423  QString msg = i18n("You must specify both a subject and a description "
424  "before the report can be sent.");
425  KMessageBox::error(this,msg);
426  return;
427  }
428 
429  switch ( d->currentSeverity())
430  {
431  case 0: // critical
432  if ( KMessageBox::questionYesNo( this, i18n(
433  "<p>You chose the severity <b>Critical</b>. "
434  "Please note that this severity is intended only for bugs that:</p>"
435  "<ul><li>break unrelated software on the system (or the whole system)</li>"
436  "<li>cause serious data loss</li>"
437  "<li>introduce a security hole on the system where the affected package is installed</li></ul>\n"
438  "<p>Does the bug you are reporting cause any of the above damage? "
439  "If it does not, please select a lower severity. Thank you.</p>" ),QString(),KStandardGuiItem::cont(),KStandardGuiItem::cancel() ) == KMessageBox::No )
440  return;
441  break;
442  case 1: // grave
443  if ( KMessageBox::questionYesNo( this, i18n(
444  "<p>You chose the severity <b>Grave</b>. "
445  "Please note that this severity is intended only for bugs that:</p>"
446  "<ul><li>make the package in question unusable or mostly so</li>"
447  "<li>cause data loss</li>"
448  "<li>introduce a security hole allowing access to the accounts of users who use the affected package</li></ul>\n"
449  "<p>Does the bug you are reporting cause any of the above damage? "
450  "If it does not, please select a lower severity. Thank you.</p>" ),QString(),KStandardGuiItem::cont(),KStandardGuiItem::cancel() ) == KMessageBox::No )
451  return;
452  break;
453  default:
454  break;
455  }
456  if( !sendBugReport() )
457  {
458  QString msg = i18n("Unable to send the bug report.\n"
459  "Please submit a bug report manually....\n"
460  "See http://bugs.kde.org/ for instructions.");
461  KMessageBox::error(this, msg + "\n\n" + d->lastError);
462  return;
463  }
464 
465  KMessageBox::information(this,
466  i18n("Bug report sent, thank you for your input."));
467  KDialog::accept();
468 }
469 
470 void KBugReport::closeEvent( QCloseEvent * e)
471 {
472  if( !d->submitBugWeb && ( (d->m_lineedit->toPlainText().length()>0) || d->m_subject->isModified() ) )
473  {
474  int rc = KMessageBox::warningYesNo( this,
475  i18n( "Close and discard\nedited message?" ),
476  i18n( "Close Message" ), KStandardGuiItem::discard(), KStandardGuiItem::cont() );
477  if( rc == KMessageBox::No )
478  {
479  e->ignore();
480  return;
481  }
482  }
483  KDialog::closeEvent(e);
484 }
485 
486 
487 QString KBugReport::text() const
488 {
489  kDebug() << d->severityButtons[d->currentSeverity()]->objectName();
490  // Prepend the pseudo-headers to the contents of the mail
491  QString severity = d->severityButtons[d->currentSeverity()]->objectName();
492  QString appname = d->appcombo->currentText();
493  QString os = QString::fromLatin1("OS: %1 (%2)\n").
494  arg(KDE_COMPILING_OS).
495  arg(KDE_DISTRIBUTION_TEXT);
496  QString bodyText;
497 /* for(int i = 0; i < m_lineedit->numLines(); i++)
498  {
499  QString line = m_lineedit->textLine(i);
500  if (!line.endsWith("\n"))
501  line += '\n';
502  bodyText += line;
503  }
504 */
505  bodyText=d->m_lineedit->toPlainText();
506  if (bodyText.length()>0)
507  if (bodyText[bodyText.length()-1]!='\n') bodyText+='\n';
508  if (severity == QLatin1String("i18n") && KGlobal::locale()->language() != KLocale::defaultLanguage()) {
509  // Case 1 : i18n bug
510  QString package = QString::fromLatin1("i18n_%1").arg(KGlobal::locale()->language());
511  package = package.replace('_', '-');
512  return QString::fromLatin1("Package: %1").arg(package) +
513  QString::fromLatin1("\n"
514  "Application: %1\n"
515  // not really i18n's version, so better here IMHO
516  "Version: %2\n").arg(appname).arg(d->m_strVersion)+
517  os+QString::fromLatin1("\n")+bodyText;
518  } else {
519  appname = appname.replace('_', '-');
520  // Case 2 : normal bug
521  return QString::fromLatin1("Package: %1\n"
522  "Version: %2\n"
523  "Severity: %3\n")
524  .arg(appname).arg(d->m_strVersion).arg(severity)+
525  QString::fromLatin1("Compiler: %1\n").arg(KDE_COMPILER_VERSION)+
526  os+QString::fromLatin1("\n")+bodyText;
527  }
528 }
529 
530 bool KBugReport::sendBugReport()
531 {
532  QString recipient ( d->m_aboutData ?
533  d->m_aboutData->bugAddress() :
534  QString::fromLatin1("submit@bugs.kde.org") );
535 
536  QString command;
537  command = KStandardDirs::locate("exe", "ksendbugmail");
538  if (command.isEmpty())
539  command = KStandardDirs::findExe( QString::fromLatin1("ksendbugmail") );
540 
541  QProcess proc;
542  QStringList args;
543  args << "--subject" << d->m_subject->text() << "--recipient" << recipient;
544  proc.start( command, args );
545  //kDebug() << command << args;
546  if (!proc.waitForStarted())
547  {
548  kError() << "Unable to open a pipe to " << command << endl;
549  return false;
550  }
551  proc.write( text().toUtf8() );
552  proc.closeWriteChannel();
553 
554  proc.waitForFinished();
555  kDebug() << "kbugreport: sendbugmail exit, status " << proc.exitStatus() << " code " << proc.exitCode();
556 
557  QByteArray line;
558  if (proc.exitStatus() == QProcess::NormalExit && proc.exitCode() != 0) {
559  // XXX not stderr?
560  while (!proc.atEnd())
561  line = proc.readLine();
562  d->lastError = QString::fromUtf8( line );
563  return false;
564  }
565  return true;
566 }
567 
568 
569 #include "kbugreport.moc"
KStandardGuiItem::cancel
KGuiItem cancel()
Returns the 'Cancel' gui item.
Definition: kstandardguiitem.cpp:113
QProcess::atEnd
virtual bool atEnd() const
i18n
QString i18n(const char *text)
KDialog::setButtonGuiItem
void setButtonGuiItem(ButtonCode id, const KGuiItem &item)
Sets the KGuiItem directly for the button instead of using 3 methods to set the text, tooltip and whatsthis strings.
Definition: kdialog.cpp:699
KMessageBox::No
Definition: kmessagebox.h:73
kcombobox.h
QString::indexOf
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
QWidget
KBugReport::messageBody
QString messageBody() const
The message body of the bug report.
Definition: kbugreport.cpp:310
QDialog::setModal
void setModal(bool modal)
kdebug.h
ktitlewidget.h
KStandardGuiItem::discard
KGuiItem discard()
Returns the 'Discard' gui item.
Definition: kstandardguiitem.cpp:128
QGridLayout::addWidget
void addWidget(QWidget *widget, int row, int column, QFlags< Qt::AlignmentFlag > alignment)
KBugReport::closeEvent
virtual void closeEvent(QCloseEvent *e)
Detects when a dialog is being closed from the window manager controls.
Definition: kbugreport.cpp:470
QByteArray
KMessageBox::warningYesNo
static int warningYesNo(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonYes=KStandardGuiItem::yes(), const KGuiItem &buttonNo=KStandardGuiItem::no(), const QString &dontAskAgainName=QString(), Options options=Options(Notify|Dangerous))
Display a "warning" dialog.
Definition: kmessagebox.cpp:564
QLabel::setOpenExternalLinks
void setOpenExternalLinks(bool open)
KDialog::Cancel
Show Cancel-button. (this button reject()s the dialog; result set to QDialog::Rejected) ...
Definition: kdialog.h:144
KStandardShortcut::label
QString label(StandardShortcut id)
Returns a localized label for user-visible display.
Definition: kstandardshortcut.cpp:267
KMessageBox::information
static void information(QWidget *parent, const QString &text, const QString &caption=QString(), const QString &dontShowAgainName=QString(), Options options=Notify)
Display an "Information" dialog.
Definition: kmessagebox.cpp:960
KStandardDirs::locate
static QString locate(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
KBugReport::setMessageBody
void setMessageBody(const QString &messageBody)
Sets the message body of the bug report.
Definition: kbugreport.cpp:318
KStandardAction::name
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
QHBoxLayout
kError
static QDebug kError(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
QGridLayout
KComponentData::aboutData
const KAboutData * aboutData() const
KDialog
A dialog base class with standard buttons and predefined layouts.
Definition: kdialog.h:128
QBoxLayout::addSpacing
void addSpacing(int size)
ktoolinvocation.h
kDebug
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
klocale.h
KBugReport::~KBugReport
virtual ~KBugReport()
Destructor.
Definition: kbugreport.cpp:305
KDE_VERSION_STRING
#define KDE_VERSION_STRING
KDialog::setCaption
virtual void setCaption(const QString &caption)
Make a KDE compliant caption.
Definition: kdialog.cpp:469
KUrl
KBugReport::accept
virtual void accept()
OK has been clicked.
Definition: kbugreport.cpp:413
i18nc
QString i18nc(const char *ctxt, const char *text)
QList::size
int size() const
KDialog::setMainWidget
void setMainWidget(QWidget *widget)
Sets the main widget of the dialog.
Definition: kdialog.cpp:338
KBugReport
A dialog box for sending bug reports.
Definition: kbugreport.h:40
kbugreport.h
QLabel::setBuddy
void setBuddy(QWidget *buddy)
QCloseEvent
QBoxLayout::addWidget
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
QString::fromUtf8
QString fromUtf8(const char *str, int size)
QEvent::ignore
void ignore()
QGroupBox
QProcess
KGuiItem
An abstract class for GUI data such as ToolTip and Icon.
Definition: kguiitem.h:36
QBoxLayout::addItem
virtual void addItem(QLayoutItem *item)
QObject::setObjectName
void setObjectName(const QString &name)
QString::isEmpty
bool isEmpty() const
KIcon
A wrapper around QIcon that provides KDE icon features.
Definition: kicon.h:40
KGlobal::activeComponent
KComponentData activeComponent()
QVBoxLayout
KAboutData
QLabel::setText
void setText(const QString &)
KLocale::language
QString language() const
QString
QList< QRadioButton * >
KDialog::setButtons
void setButtons(ButtonCodes buttonMask)
Creates (or recreates) the button box and all the buttons in it.
Definition: kdialog.cpp:206
KDialog::setButtonIcon
void setButtonIcon(ButtonCode id, const KIcon &icon)
Sets the icon of any button.
Definition: kdialog.cpp:742
QDialog::accept
virtual void accept()
QStringList
kdepackages.h
KMessageBox::questionYesNo
static int questionYesNo(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonYes=KStandardGuiItem::yes(), const KGuiItem &buttonNo=KStandardGuiItem::no(), const QString &dontAskAgainName=QString(), Options options=Notify)
Display a simple "question" dialog.
Definition: kmessagebox.cpp:353
KDialog::Ok
Show Ok button. (this button accept()s the dialog; result set to QDialog::Accepted) ...
Definition: kdialog.h:141
QProcess::waitForStarted
bool waitForStarted(int msecs)
packages
const char *const packages[]
Definition: kdepackages.h:1
QWidget::sizeHint
sizeHint
KStandardGuiItem::close
KGuiItem close()
Returns the 'Close' gui item.
Definition: kstandardguiitem.cpp:182
KBugReport::KBugReport
KBugReport(QWidget *parent=0L, bool modal=true, const KAboutData *aboutData=0L)
Creates a bug-report dialog.
Definition: kbugreport.cpp:89
KGlobal::locale
KLocale * locale()
QAbstractButton::setChecked
void setChecked(bool)
KConfigGroup
QLabel::setTextInteractionFlags
void setTextInteractionFlags(QFlags< Qt::TextInteractionFlag > flags)
QString::replace
QString & replace(int position, int n, QChar after)
KConfig
KLineEdit
An enhanced QLineEdit widget for inputting text.
Definition: klineedit.h:149
QWidget::setWhatsThis
void setWhatsThis(const QString &)
QLatin1String
QRadioButton
KBugReport::text
QString text() const
"Configure email" has been clicked - this calls kcmshell4 System/email
Definition: kbugreport.cpp:487
kstandarddirs.h
ktextedit.h
kurllabel.h
QWidget::QWidget
QWidget(QWidget *parent, QFlags< Qt::WindowType > f)
KStandardDirs::findExe
static QString findExe(const QString &appname, const QString &pathstr=QString(), SearchOptions options=NoSearchOptions)
KComboBox
An enhanced combo box.
Definition: kcombobox.h:148
KBugReport::sendBugReport
bool sendBugReport()
Attempt to e-mail the bug report.
Definition: kbugreport.cpp:530
KComponentData::isValid
bool isValid() const
KGlobal::mainComponent
const KComponentData & mainComponent()
KTitleWidget
Standard title widget with a white background and round border.
Definition: ktitlewidget.h:61
QString::length
int length() const
QWidget::setMinimumHeight
void setMinimumHeight(int minh)
QStringList::split
QStringList split(const QString &sep, const QString &str, bool allowEmptyEntries)
QString::left
QString left(int n) const
QIODevice::write
qint64 write(const char *data, qint64 maxSize)
QString::fromLatin1
QString fromLatin1(const char *str, int size)
KTitleWidget::setPixmap
void setPixmap(const QPixmap &pixmap, ImageAlignment alignment=ImageRight)
Definition: ktitlewidget.cpp:231
QPushButton
KStandardGuiItem::cont
KGuiItem cont()
Returns the 'Continue' gui item.
Definition: kstandardguiitem.cpp:234
klineedit.h
KDialog::setButtonText
void setButtonText(ButtonCode id, const QString &text)
Sets the text of any button.
Definition: kdialog.cpp:719
kaboutdata.h
KTitleWidget::setText
void setText(const QString &text, Qt::Alignment alignment=Qt::AlignLeft|Qt::AlignVCenter)
Definition: ktitlewidget.cpp:201
kcomponentdata.h
KToolInvocation::invokeBrowser
static void invokeBrowser(const QString &url, const QByteArray &startup_id=QByteArray())
kmessagebox.h
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QLabel
QObject::parent
QObject * parent() const
QProcess::closeWriteChannel
void closeWriteChannel()
QString::arg
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
KDialog::closeEvent
virtual void closeEvent(QCloseEvent *e)
Detects when a dialog is being closed from the window manager controls.
Definition: kdialog.cpp:1001
QProcess::exitStatus
QProcess::ExitStatus exitStatus() const
QProcess::exitCode
int exitCode() const
QLabel::setWordWrap
void setWordWrap(bool on)
QProcess::start
void start(const QString &program, const QStringList &arguments, QFlags< QIODevice::OpenModeFlag > mode)
KMessageBox::error
static void error(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Notify)
Display an "Error" dialog.
Definition: kmessagebox.cpp:818
KLocale::defaultLanguage
static QString defaultLanguage()
KTextEdit
A KDE'ified QTextEdit.
Definition: ktextedit.h:90
QBoxLayout::addLayout
void addLayout(QLayout *layout, int stretch)
QIODevice::readLine
qint64 readLine(char *data, qint64 maxSize)
QProcess::waitForFinished
bool waitForFinished(int msecs)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

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