KFile
Go to the documentation of this file.
37 #include <QtCore/QMimeData>
38 #include <QtGui/QApplication>
39 #include <QtGui/QCheckBox>
40 #include <QtGui/qdrawutil.h>
41 #include <QtGui/QFontMetrics>
42 #include <QtGui/QFormLayout>
43 #include <QtGui/QItemDelegate>
44 #include <QtGui/QLabel>
45 #include <QtGui/QMenu>
46 #include <QtGui/QPainter>
47 #include <QtGui/QStyle>
56 bool isAddingNewPlace,
57 bool& appLocal,
int iconSize,
66 if ( dialog->exec() == QDialog::Accepted ) {
69 label = dialog->
label();
70 icon = dialog->
icon();
84 bool isAddingNewPlace,
85 bool appLocal,
int iconSize,
98 QVBoxLayout *box =
new QVBoxLayout( wdg );
100 QFormLayout *layout =
new QFormLayout();
101 box->addLayout( layout );
103 QString whatsThisText =
i18n(
"<qt>This is the text that will appear in the Places panel.<br /><br />"
104 "The label should consist of one or two words "
105 "that will help you remember what this entry refers to. "
106 "If you do not enter a label, it will be derived from "
107 "the location's URL.</qt>");
109 layout->addRow(
i18n(
"L&abel:"), m_labelEdit);
112 m_labelEdit->setWhatsThis(whatsThisText);
113 layout->labelForField(m_labelEdit)->setWhatsThis(whatsThisText);
115 whatsThisText =
i18n(
"<qt>This is the location associated with the entry. Any valid URL may be used. For example:<br /><br />"
116 "%1<br />http://www.kde.org<br />ftp://ftp.kde.org/pub/kde/stable<br /><br />"
117 "By clicking on the button next to the text edit box you can browse to an "
118 "appropriate URL.</qt>", QDir::homePath());
121 layout->addRow(
i18n(
"&Location:"), m_urlEdit );
122 m_urlEdit->setWhatsThis( whatsThisText );
123 layout->labelForField(m_urlEdit)->setWhatsThis( whatsThisText );
125 m_urlEdit->setMinimumWidth( m_urlEdit->fontMetrics().height() * (40 / 2) );
127 whatsThisText =
i18n(
"<qt>This is the icon that will appear in the Places panel.<br /><br />"
128 "Click on the button to select a different icon.</qt>");
130 layout->addRow(
i18n(
"Choose an &icon:"), m_iconButton );
131 m_iconButton->setObjectName( QLatin1String(
"icon button" ) );
134 if ( icon.isEmpty() )
138 m_iconButton->setWhatsThis( whatsThisText );
139 layout->labelForField(m_iconButton)->setWhatsThis( whatsThisText );
145 if ( appName.isEmpty() )
147 m_appLocal =
new QCheckBox(
i18n(
"&Only show when using this application (%1)", appName ), wdg );
148 m_appLocal->setChecked( appLocal );
149 m_appLocal->setWhatsThis(
i18n(
"<qt>Select this setting if you want this "
150 "entry to show only when using the current application (%1).<br /><br />"
151 "If this setting is not selected, the entry will be available in all "
152 "applications.</qt>",
154 box->addWidget(m_appLocal);
159 if (!label.isEmpty()) {
161 m_labelEdit->setFocus();
164 m_urlEdit->setFocus();
180 return m_urlEdit->
url();
185 if (!m_labelEdit->text().isEmpty()) {
186 return m_labelEdit->text();
194 if (!url.host().isEmpty()) {
202 return m_iconButton->
icon();
210 return m_appLocal->isChecked();
214 #include "kfileplaceeditdialog.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sun Apr 28 2013 14:32:19 by
doxygen 1.8.1.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.