mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-24 02:42:51 +00:00
446 lines
15 KiB
HTML
446 lines
15 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
|
|
|
<head>
|
|
<title>KSettings.Dialog</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta http-equiv="Content-Style-Type" content="text/css" />
|
|
<link rel="stylesheet" type="text/css" href="../common/doxygen.css" />
|
|
<link rel="stylesheet" media="screen" type="text/css" title="KDE Colors" href="../common/kde.css" />
|
|
</head>
|
|
<body>
|
|
<div id="container">
|
|
<div id="header">
|
|
<div id="header_top">
|
|
<div>
|
|
<div>
|
|
<img alt ="" src="../common/top-kde.jpg"/>
|
|
KDE 4.9 PyKDE API Reference
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="header_bottom">
|
|
<div id="location">
|
|
<ul>
|
|
<li>KDE's Python API</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div id="menu">
|
|
<ul>
|
|
<li><a href="../modules.html">Overview</a></li>
|
|
<li><a href="http://techbase.kde.org/Development/Languages/Python">PyKDE Home</a></li>
|
|
<li><a href="http://kde.org/family/">Sitemap</a></li>
|
|
<li><a href="http://kde.org/contact/">Contact Us</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="body_wrapper">
|
|
<div id="body">
|
|
<div id="right">
|
|
<div class="content">
|
|
<div id="main">
|
|
<div class="clearer"> </div>
|
|
|
|
<h1>Dialog Class Reference</h1>
|
|
<code>from PyKDE4.kutils import *</code>
|
|
<p>
|
|
Inherits: <a href="../kutils/KCMultiDialog.html">KCMultiDialog</a> → <a href="../kdeui/KPageDialog.html">KPageDialog</a> → <a href="../kdeui/KDialog.html">KDialog</a> → QDialog → QWidget → QObject<br />
|
|
|
|
Namespace: <a href="../kutils/KSettings.html">KSettings</a><br />
|
|
<h2>Detailed Description</h2>
|
|
|
|
<p>Generic configuration dialog that works over component boundaries
|
|
</p>
|
|
<p>
|
|
For more information see KSettings.
|
|
</p>
|
|
<p>
|
|
This class aims to standardize the use of configuration dialogs in KDE
|
|
applications. Especially when using KParts and/or Plugins you face problems
|
|
creating a consistent config dialog.
|
|
</p>
|
|
<p>
|
|
To show a configuration dialog you only have to call the show method and be
|
|
done with it. A code example:
|
|
</p>
|
|
<p>
|
|
You initialize <b>m_cfgdlg</b> with
|
|
<pre class="fragment">
|
|
m_cfgdlg = new Dialog( this );
|
|
</pre>
|
|
If you use a KPart that was not especially designed for your app you can use
|
|
the second constructor:
|
|
<pre class="fragment">
|
|
QStringList kpartslist;
|
|
for( all my kparts )
|
|
kpartslist += m_mypart->componentData().componentName();
|
|
m_cfgdlg = new Dialog( kpartslist, this );
|
|
</pre>
|
|
and the action for the config dialog is connected to the show slot:
|
|
<pre class="fragment">
|
|
KStandardAction.preferences( m_cfgdlg, SLOT( show() ), actionCollection() );
|
|
</pre>
|
|
</p>
|
|
<p>
|
|
If you need to be informed when the config was changed and applied in the
|
|
dialog you might want to take a look at Dispatcher.
|
|
</p>
|
|
<p>
|
|
For more information see KSettings.
|
|
</p>
|
|
<p>
|
|
|
|
<dl class="author" compact><dt><b>Author:</b></dt><dd> Matthias Kretz <kretz@kde.org> </dd></dl>
|
|
</p>
|
|
<table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2"><br><h2>Signals</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#pluginSelectionChanged">pluginSelectionChanged</a> ()</td></tr>
|
|
<tr><td colspan="2"><br><h2>Methods</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#Dialog">__init__</a> (self, QWidget parent=0)</td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#Dialog">__init__</a> (self, QStringList components, QWidget parent=0)</td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#addPluginInfos">addPluginInfos</a> (self, [<a href="../kdecore/KPluginInfo.html">KPluginInfo</a>] plugininfos)</td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#allowComponentSelection">allowComponentSelection</a> (self)</td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">[<a href="../kdecore/KPluginInfo.html">KPluginInfo</a>] </td><td class="memItemRight" valign="bottom"><a class="el" href="#pluginInfos">pluginInfos</a> (self)</td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setAllowComponentSelection">setAllowComponentSelection</a> (self, bool allowSelection)</td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setComponentBlacklist">setComponentBlacklist</a> (self, QStringList blacklist)</td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setKCMArguments">setKCMArguments</a> (self, QStringList arguments)</td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#showEvent">showEvent</a> (self, QShowEvent a0)</td></tr>
|
|
</table>
|
|
<hr><h2>Signal Documentation</h2><a class="anchor" name="pluginSelectionChanged"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname"><tr>
|
|
<td class="memname"> pluginSelectionChanged</td>
|
|
<td>(</td>
|
|
<td class="paramtype"> </td>
|
|
<td class="paramname">)</td>
|
|
<td width="100%"> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc"><p>If you use the dialog in Configurable mode and want to be notified
|
|
when the user changes the plugin selections use this signal. It's
|
|
emitted if the selection has changed and the user pressed Apply or
|
|
Ok. In the slot you would then load and unload the plugins as
|
|
requested.
|
|
</p><dl compact><dt><b>Signal syntax:</b></dt><dd><code>QObject.connect(source, SIGNAL("pluginSelectionChanged()"), target_slot)</code></dd></dl></div></div><hr><h2>Method Documentation</h2><a class="anchor" name="Dialog"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname"><tr>
|
|
<td class="memname">__init__</td>
|
|
<td>(</td>
|
|
<td class="paramtype"> <em>self</em>, </td>
|
|
<td class="paramname"></td>
|
|
</tr><tr>
|
|
<td class="memname"></td>
|
|
<td></td>
|
|
<td class="paramtype">QWidget </td>
|
|
<td class="paramname"><em>parent=0</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td>
|
|
<td></td>
|
|
<td width="100%"> </td>
|
|
</tr></table>
|
|
</div>
|
|
<div class="memdoc"><p>Construct a new Preferences Dialog for the application. It uses all
|
|
KCMs with X-KDE-ParentApp set to KGlobal.mainComponent().componentName().
|
|
</p>
|
|
<p>
|
|
</p><dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td></td><td valign="top"><em>content</em> </td><td> Select whether you want a static or configurable
|
|
config dialog.
|
|
|
|
<tr><td></td><td valign="top"><em>parent</em> </td><td> The parent is only used as the parent for the
|
|
dialog - centering the dialog over the parent
|
|
widget.
|
|
</td></tr>
|
|
</table></dl>
|
|
<p>
|
|
</p></div></div><a class="anchor" name="Dialog"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname"><tr>
|
|
<td class="memname">__init__</td>
|
|
<td>(</td>
|
|
<td class="paramtype"> <em>self</em>, </td>
|
|
<td class="paramname"></td>
|
|
</tr><tr>
|
|
<td class="memname"></td>
|
|
<td></td>
|
|
<td class="paramtype">QStringList </td>
|
|
<td class="paramname"><em>components</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="memname"></td>
|
|
<td></td>
|
|
<td class="paramtype">QWidget </td>
|
|
<td class="paramname"><em>parent=0</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td>
|
|
<td></td>
|
|
<td width="100%"> </td>
|
|
</tr></table>
|
|
</div>
|
|
<div class="memdoc"><p>Construct a new Preferences Dialog with the pages for the selected
|
|
instance names. For example if you want to have the configuration
|
|
pages for the kviewviewer KPart you would pass a
|
|
QStringList consisting of only the name of the part "kviewviewer".
|
|
</p>
|
|
<p>
|
|
</p><dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td></td><td valign="top"><em>components</em> </td><td> A list of the names of the components that your
|
|
config dialog should merge the config pages in.
|
|
|
|
<tr><td></td><td valign="top"><em>parent</em> </td><td> The parent is only used as the parent for the
|
|
dialog - centering the dialog over the parent
|
|
widget.
|
|
</td></tr>
|
|
</table></dl>
|
|
<p>
|
|
</p></div></div><a class="anchor" name="addPluginInfos"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname"><tr>
|
|
<td class="memname"> addPluginInfos</td>
|
|
<td>(</td>
|
|
<td class="paramtype"> <em>self</em>, </td>
|
|
<td class="paramname"></td>
|
|
</tr><tr>
|
|
<td class="memname"></td>
|
|
<td></td>
|
|
<td class="paramtype">[<a href="../kdecore/KPluginInfo.html">KPluginInfo</a>] </td>
|
|
<td class="paramname"><em>plugininfos</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td>
|
|
<td></td>
|
|
<td width="100%"> </td>
|
|
</tr></table>
|
|
</div>
|
|
<div class="memdoc"><p>If you use a Configurable dialog you need to pass KPluginInfo
|
|
objects that the dialog should configure.
|
|
</p></div></div><a class="anchor" name="allowComponentSelection"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname"><tr>
|
|
<td class="memname">bool allowComponentSelection</td>
|
|
<td>(</td>
|
|
<td class="paramtype"> </td>
|
|
<td class="paramname"><em>self</em> )</td>
|
|
<td width="100%"> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc"></div></div><a class="anchor" name="pluginInfos"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname"><tr>
|
|
<td class="memname">[<a href="../kdecore/KPluginInfo.html">KPluginInfo</a>] pluginInfos</td>
|
|
<td>(</td>
|
|
<td class="paramtype"> </td>
|
|
<td class="paramname"><em>self</em> )</td>
|
|
<td width="100%"> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc"><p>Returns a list of all KPluginInfo objects the dialog uses.
|
|
</p></div></div><a class="anchor" name="setAllowComponentSelection"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname"><tr>
|
|
<td class="memname"> setAllowComponentSelection</td>
|
|
<td>(</td>
|
|
<td class="paramtype"> <em>self</em>, </td>
|
|
<td class="paramname"></td>
|
|
</tr><tr>
|
|
<td class="memname"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>allowSelection</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td>
|
|
<td></td>
|
|
<td width="100%"> </td>
|
|
</tr></table>
|
|
</div>
|
|
<div class="memdoc"><p>Tells the dialog whether the entries in the listview are all static
|
|
or whether it should add checkboxes to select which parts
|
|
of the optional functionality should be active or not.
|
|
</p>
|
|
<p>
|
|
Note that this function only works before showing the dialog for the first time.
|
|
</p>
|
|
<p>
|
|
Defaults to <b>false.</b>
|
|
</p>
|
|
<p>
|
|
</p><dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td></td><td valign="top"><em>allowSelection</em> </td><td> <b>true</b> The user can select what functionality he wants.
|
|
|
|
<tr><td></td><td valign="top"><em>allowSelection</em> </td><td> <b>false</b> While running no entries are added or deleted
|
|
</td></tr>
|
|
</table></dl>
|
|
<p>
|
|
</p></div></div><a class="anchor" name="setComponentBlacklist"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname"><tr>
|
|
<td class="memname"> setComponentBlacklist</td>
|
|
<td>(</td>
|
|
<td class="paramtype"> <em>self</em>, </td>
|
|
<td class="paramname"></td>
|
|
</tr><tr>
|
|
<td class="memname"></td>
|
|
<td></td>
|
|
<td class="paramtype">QStringList </td>
|
|
<td class="paramname"><em>blacklist</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td>
|
|
<td></td>
|
|
<td width="100%"> </td>
|
|
</tr></table>
|
|
</div>
|
|
<div class="memdoc"><p>Set the blacklisted component list. Any KCM that lists one
|
|
of the components in the given blacklist is not loaded even if it
|
|
would fit otherwise. This is a way to explicitly prevent loading of
|
|
certain KControlModules.
|
|
</p>
|
|
<p>
|
|
Note that this function only works before showing the
|
|
KSettings.Dialog for the first time.
|
|
</p><dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td></td><td valign="top"><em>blacklist</em> </td><td> the list of components that prevent a KCM from being
|
|
loaded
|
|
</td></tr>
|
|
</table></dl>
|
|
<p>
|
|
</p></div></div><a class="anchor" name="setKCMArguments"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname"><tr>
|
|
<td class="memname"> setKCMArguments</td>
|
|
<td>(</td>
|
|
<td class="paramtype"> <em>self</em>, </td>
|
|
<td class="paramname"></td>
|
|
</tr><tr>
|
|
<td class="memname"></td>
|
|
<td></td>
|
|
<td class="paramtype">QStringList </td>
|
|
<td class="paramname"><em>arguments</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td>
|
|
<td></td>
|
|
<td width="100%"> </td>
|
|
</tr></table>
|
|
</div>
|
|
<div class="memdoc"><p>Sets the argument list that is given to all the KControlModule's when
|
|
they are created.
|
|
Use this if you have KControlModule's that need special arguments to
|
|
work
|
|
</p>
|
|
<p>
|
|
Note that this function only works before showing the
|
|
KSettings.Dialog for the first time.
|
|
</p><dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td></td><td valign="top"><em>arguments</em> </td><td> The list of arguments passed to each KCM
|
|
</td></tr>
|
|
</table></dl>
|
|
<p>
|
|
</p></div></div><a class="anchor" name="showEvent"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname"><tr>
|
|
<td class="memname"> showEvent</td>
|
|
<td>(</td>
|
|
<td class="paramtype"> <em>self</em>, </td>
|
|
<td class="paramname"></td>
|
|
</tr><tr>
|
|
<td class="memname"></td>
|
|
<td></td>
|
|
<td class="paramtype">QShowEvent </td>
|
|
<td class="paramname"><em>a0</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td>
|
|
<td></td>
|
|
<td width="100%"> </td>
|
|
</tr></table>
|
|
</div>
|
|
<div class="memdoc"><p>Reimplemented to lazy create the dialog on first show.
|
|
</p></div></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="left">
|
|
|
|
<div class="menu_box">
|
|
<div class="nav_list">
|
|
<ul>
|
|
<li><a href="../allclasses.html">Full Index</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<a name="cp-menu" /><div class="menutitle"><div>
|
|
<h2 id="cp-menu-project">Modules</h2>
|
|
</div></div>
|
|
<div class="nav_list">
|
|
<ul><li><a href="../akonadi/index.html">akonadi</a></li>
|
|
<li><a href="../dnssd/index.html">dnssd</a></li>
|
|
<li><a href="../kdecore/index.html">kdecore</a></li>
|
|
<li><a href="../kdeui/index.html">kdeui</a></li>
|
|
<li><a href="../khtml/index.html">khtml</a></li>
|
|
<li><a href="../kio/index.html">kio</a></li>
|
|
<li><a href="../knewstuff/index.html">knewstuff</a></li>
|
|
<li><a href="../kparts/index.html">kparts</a></li>
|
|
<li><a href="../kutils/index.html">kutils</a></li>
|
|
<li><a href="../nepomuk/index.html">nepomuk</a></li>
|
|
<li><a href="../phonon/index.html">phonon</a></li>
|
|
<li><a href="../plasma/index.html">plasma</a></li>
|
|
<li><a href="../polkitqt/index.html">polkitqt</a></li>
|
|
<li><a href="../solid/index.html">solid</a></li>
|
|
<li><a href="../soprano/index.html">soprano</a></li>
|
|
</ul></div></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<div class="clearer"/>
|
|
</div>
|
|
|
|
<div id="end_body"></div>
|
|
</div>
|
|
<div id="footer"><div id="footer_text">
|
|
This documentation is maintained by <a href="mailto:simon@simonzone.com">Simon Edwards</a>.<br />
|
|
KDE<sup>®</sup> and <a href="../images/kde_gear_black.png">the K Desktop Environment<sup>®</sup> logo</a> are registered trademarks of <a href="http://ev.kde.org/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> |
|
|
<a href="http://www.kde.org/contact/impressum.php">Legal</a>
|
|
</div></div>
|
|
</body>
|
|
</html>
|