kio Library API Documentation

KOpenWithDlg Class Reference

"Open with" dialog box. More...

#include <kopenwith.h>

Inheritance diagram for KOpenWithDlg:

QDialog List of all members.

Public Slots

void slotClear ()
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)
 KOpenWithDlg (const KURL::List &urls, const QString &text, const QString &value, QWidget *parent=0L)
 KOpenWithDlg (const QString &serviceType, const QString &value, QWidget *parent=0L)
 KOpenWithDlg (QWidget *parent=0L)
 ~KOpenWithDlg ()
QString text () const
void hideNoCloseOnExit ()
void hideRunInTerminal ()
KService::Ptr service () const
void setSaveNewApplications (bool b)

Protected Slots

virtual void accept ()

Protected Member Functions

void setServiceType (const KURL::List &_urls)
void init (const QString &text, const QString &value)

Protected Attributes

KURLRequesteredit
QString m_command
KApplicationTree * m_pTree
QLabellabel
QString qName
QString qServiceType
bool m_terminaldirty
QCheckBoxterminal
QCheckBoxremember
QCheckBoxnocloseonexit
QPushButtonUNUSED
QPushButtonUNUSED2
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 293 of file kopenwith.cpp.

References init(), and setServiceType().

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 311 of file kopenwith.cpp.

References KStringHandler::csqueeze(), 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 323 of file kopenwith.cpp.

References init(), 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 337 of file kopenwith.cpp.

References init(), and text().

KOpenWithDlg::~KOpenWithDlg  ) 
 

Destructor.

Definition at line 503 of file kopenwith.cpp.


Member Function Documentation

QString KOpenWithDlg::text  )  const
 

Returns:
the text the user entered

Definition at line 760 of file kopenwith.cpp.

References KURLRequester::url.

Referenced by KRun::displayOpenWithDialog(), KFileOpenWithHandler::displayOpenWithDialog(), and KOpenWithDlg().

void KOpenWithDlg::hideNoCloseOnExit  ) 
 

Hide the "Do not &close when command exits" Checkbox.

Definition at line 768 of file kopenwith.cpp.

Referenced by hideRunInTerminal().

void KOpenWithDlg::hideRunInTerminal  ) 
 

Hide the "Run in &terminal" Checkbox.

Definition at line 775 of file kopenwith.cpp.

References hideNoCloseOnExit().

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 115 of file kopenwith.h.

Referenced by KRun::displayOpenWithDialog(), and KFileOpenWithHandler::displayOpenWithDialog().

void KOpenWithDlg::setSaveNewApplications bool  b  ) 
 

Set whether a new .desktop file should be created if the user selects an application for which no corresponding .desktop file can be found.

Regardless of this setting a new .desktop file may still be created if the user has chosen to remember the file association.

The default is false: no .desktop files are created.

Since:
3.2

Definition at line 573 of file kopenwith.cpp.

void KOpenWithDlg::slotClear  )  [slot]
 

The slot for clearing the edit widget.

Definition at line 511 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.

Definition at line 781 of file kopenwith.cpp.

References KHistoryCombo::addToHistory(), KURLRequester::comboBox(), KCompletionBase::completionMode(), KGlobal::config(), 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 348 of file kopenwith.cpp.

References KMimeType::findByURL().

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 360 of file kopenwith.cpp.

References KButtonBox::addButton(), KButtonBox::addStretch(), QBoxLayout::addWidget(), KURLRequester::button(), KURLRequester::comboBox(), KGlobal::config(), KButtonBox::layout(), KURLRequester::lineEdit(), KConfigBase::readListEntry(), KConfigBase::readNumEntry(), KConfigBase::readPathEntry(), KCompletionBase::setAutoDeleteCompletionObject(), KCompletionBase::setCompletionMode(), KCompletionBase::setCompletionObject(), KHistoryCombo::setHistoryItems(), KLineEdit::setReadOnly(), KURLRequester::setURL(), and slotClear().

Referenced by KOpenWithDlg().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kio Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Nov 27 13:46:01 2004 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003