| # kio Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KOpenWithDlg Class Reference

"Open with" dialog box. More...

`#include <kopenwith.h>`

Inheritance diagram for KOpenWithDlg:

[legend]
Collaboration diagram for KOpenWithDlg:

[legend]
List of all members.

## Public Slots
void | slotClear ()
| The slot for clearing the edit widget.
void | slotSelected (const QString &_name, const QString &_exec)
void | slotHighlighted (const QString &_name, const QString &_exec)
void | slotTextChanged ()
void | slotTerminalToggled (bool)
void | slotDbClick ()
void | slotOK ()
## Public Member Functions
| KOpenWithDlg (const KURL::List &urls, QWidget *parent=0L)
| Create a dialog that asks for a application to open a given URL(s) with.
| KOpenWithDlg (const KURL::List &urls, const QString &text, const QString &value, QWidget *parent=0L)
| Create a dialog that asks for a application to open a given URL(s) with.
| KOpenWithDlg (const QString &serviceType, const QString &value, QWidget *parent=0L)
| Create a dialog to select a service for a given service type.
| KOpenWithDlg (QWidget *parent=0L)
| Create a dialog to select an application Note that this dialog doesn't apply to URLs.
| ~KOpenWithDlg ()
| Destructor.
QString | text () const
KService::Ptr | service () const
## Protected Slots
virtual void | accept ()
| Reimplemented from QDialog::accept() to save history of the combobox.
## Protected Member Functions
void | setServiceType (const KURL::List &_urls)
| Determine service type from URLs.
void | init (const QString &text, const QString &value)
| Create a dialog that asks for a application to open a given URL(s) with.
## Protected Attributes
KURLRequester * | edit
QString | m_command
KApplicationTree * | m_pTree
QLabel * | label
QString | qName
QString | qServiceType
bool | m_terminaldirty
QCheckBox * | terminal
QCheckBox * | remember
QCheckBox * | UNUSED_IN_BRANCH
QPushButton * | UNUSED
QPushButton * | UNUSED2
KService::Ptr | m_pService
KOpenWithDlgPrivate * | d

## Detailed Description

"Open with" dialog box.

Used automatically by KRun, and used by libkonq.

Author:
  David Faure <faure@kde.org>

Definition at line 47 of file kopenwith.h.

## Constructor & Destructor Documentation

KOpenWithDlg::KOpenWithDlg | ( | const KURL::List & | urls,
|  | QWidget * | parent = 0L
| ) |

  | Create a dialog that asks for a application to open a given URL(s) with. Parameters:
  urls | the URLs that should be opened. The list can be empty, if the dialog is used to choose an application but not for some particular URLs.
  parent | parent widget
Definition at line 283 of file kopenwith.cpp. References QString::arg(), QValueList< KURL >::count(), QValueList< KURL >::first(), init(), setServiceType(), and text().

KOpenWithDlg::KOpenWithDlg | ( | const KURL::List & | urls,
|  | const QString & | text,
|  | const QString & | value,
|  | QWidget * | parent = 0L
| ) |

  | Create a dialog that asks for a application to open a given URL(s) with. Parameters:
  urls | is the URL that should be opened
  text | appears as a label on top of the entry box.
  value | is the initial value of the line
  parent | parent widget
Definition at line 301 of file kopenwith.cpp. References QValueList< KURL >::count(), KStringHandler::csqueeze(), QValueList< KURL >::first(), QString::fromLatin1(), init(), and setServiceType().

KOpenWithDlg::KOpenWithDlg | ( | const QString & | serviceType,
|  | const QString & | value,
|  | QWidget * | parent = 0L
| ) |

  | Create a dialog to select a service for a given service type. Note that this dialog doesn't apply to URLs. Parameters:
  serviceType | the service type we want to choose an application for.
  value | is the initial value of the line
  parent | parent widget
Definition at line 313 of file kopenwith.cpp. References QString::arg(), init(), QCheckBox::setChecked(), and text().

KOpenWithDlg::KOpenWithDlg | ( | QWidget * | parent = 0L | ) |

  | Create a dialog to select an application Note that this dialog doesn't apply to URLs. Parameters:
  parent | parent widget
Since: 3.1 Definition at line 330 of file kopenwith.cpp. References init(), and text().

KOpenWithDlg::~KOpenWithDlg | ( |  | ) |

| Destructor. Definition at line 461 of file kopenwith.cpp.

## Member Function Documentation

QString KOpenWithDlg::text | ( |  | ) | const

| Returns: the text the user entered Definition at line 673 of file kopenwith.cpp. References QString::isEmpty(), and KURLRequester::url(). Referenced by KRun::displayOpenWithDialog(), KFileOpenWithHandler::displayOpenWithDialog(), and KOpenWithDlg().

KService::Ptr KOpenWithDlg::service | ( |  | ) | const`[inline]`

| Returns: the chosen service in the application tree Can be null, if the user typed some text and didn't select a service. Definition at line 105 of file kopenwith.h. Referenced by KRun::displayOpenWithDialog(), and KFileOpenWithHandler::displayOpenWithDialog().

void KOpenWithDlg::slotClear | ( |  | ) | `[slot]`

| The slot for clearing the edit widget. Definition at line 467 of file kopenwith.cpp. References KURLRequester::setURL(). Referenced by init().

void KOpenWithDlg::accept | ( |  | ) | `[protected, virtual, slot]`

| Reimplemented from QDialog::accept() to save history of the combobox. Reimplemented from QDialog. Definition at line 681 of file kopenwith.cpp. References QDialog::accept(), KHistoryCombo::addToHistory(), KURLRequester::comboBox(), KCompletionBase::completionMode(), KGlobal::config(), QString::fromLatin1(), KHistoryCombo::historyItems(), KConfigBase::sync(), KURLRequester::url(), and KConfigBase::writeEntry().

void KOpenWithDlg::setServiceType | ( | const KURL::List & | _urls | ) | `[protected]`

| Determine service type from URLs. Definition at line 341 of file kopenwith.cpp. References QValueList< KURL >::count(), KMimeType::findByURL(), QValueList< KURL >::first(), and QString::fromLatin1(). Referenced by KOpenWithDlg().

void KOpenWithDlg::init | ( | const QString & | text,
|  | const QString & | value
| ) | `[protected]`

  | Create a dialog that asks for a application to open a given URL(s) with. Parameters:
  text | appears as a label on top of the entry box.
  value | is the initial value of the line
Definition at line 353 of file kopenwith.cpp. References QToolTip::add(), KButtonBox::addButton(), KButtonBox::addStretch(), QBoxLayout::addWidget(), KURLRequester::button(), KURLRequester::comboBox(), KGlobalSettings::Completion, KGlobalSettings::completionMode(), KGlobal::config(), QString::fromLatin1(), QString::isNull(), KButtonBox::layout(), KURLRequester::lineEdit(), KDialog::marginHint(), KConfigBase::readListEntry(), KConfigBase::readNumEntry(), QDialog::reject(), KCompletionBase::setCompletionMode(), KCompletionBase::setCompletionObject(), QPushButton::setDefault(), QComboBox::setDuplicatesEnabled(), KHistoryCombo::setHistoryItems(), QToolButton::setIconSet(), QComboBox::setMaxCount(), KLineEdit::setReadOnly(), KURLRequester::setURL(), slotClear(), and KDialog::spacingHint(). Referenced by KOpenWithDlg().

The documentation for this class was generated from the following files:

- kopenwith.h
- kopenwith.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:19:28 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001