Kross

actioncollectionview.cpp
1 /***************************************************************************
2  * actioncollectionview.cpp
3  * This file is part of the KDE project
4  * copyright (c) 2005-2006 Cyrille Berger <[email protected]>
5  * copyright (C) 2006-2007 Sebastian Sauer <[email protected]>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  * You should have received a copy of the GNU Library General Public License
16  * along with this program; see the file COPYING. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  ***************************************************************************/
20 
21 #include "actioncollectionview.h"
22 #include "actioncollectionmodel.h"
23 
24 #include <kross/core/manager.h>
25 #include <kross/core/action.h>
26 #include <kross/core/actioncollection.h>
27 #include <kross/core/interpreter.h>
28 
29 #include <QAction>
30 #include <QBoxLayout>
31 #include <QDir>
32 #include <QFileInfo>
33 #include <QHeaderView>
34 #include <QLabel>
35 #include <QLineEdit>
36 #include <QPushButton>
37 
38 #include <kmessagebox.h>
39 #include <kpagedialog.h>
40 #include <kactioncollection.h>
41 #include <kcombobox.h>
42 #include <kiconbutton.h>
43 #include <klocalizedstring.h>
44 #include <kurlrequester.h>
45 
46 //#include <ktar.h>
47 //#include <kio/netaccess.h>
48 
49 using namespace Kross;
50 
51 /*********************************************************************************
52  * ActionCollectionEditor
53  */
54 
55 namespace Kross
56 {
57 
58 /// \internal d-pointer class.
59 class ActionCollectionEditor::Private
60 {
61 public:
62  enum Type { ActionType, CollectionType };
63  const Type type;
64  union {
65  Action *action;
67  };
68 
69  QString name() const
70  {
71  return type == ActionType ? action->name() : collection->name();
72  }
73  QString text() const
74  {
75  return type == ActionType ? action->text() : collection->text();
76  }
77  QString description() const
78  {
79  return type == ActionType ? action->description() : collection->description();
80  }
81  QString iconName() const
82  {
83  return type == ActionType ? action->iconName() : collection->iconName();
84  }
85  bool isEnabled() const
86  {
87  return type == ActionType ? action->isEnabled() : collection->isEnabled();
88  }
89 
90  QLineEdit *nameedit;
91  QLineEdit *textedit;
92  QLineEdit *commentedit;
93  QLineEdit *iconedit;
94  KComboBox *interpreteredit;
95  KUrlRequester *fileedit;
96  //QCheckBox* enabledcheckbox;
97 
98  explicit Private(Action *a) : type(ActionType), action(a)
99  {
100  Q_ASSERT(a);
101  }
102  explicit Private(ActionCollection *c) : type(CollectionType), collection(c)
103  {
104  Q_ASSERT(c);
105  }
106 };
107 
108 }
109 
111  : QWidget(parent), d(new Private(action))
112 {
113  initGui();
114 }
115 
117  : QWidget(parent), d(new Private(collection))
118 {
119  initGui();
120 }
121 
123 {
124  delete d;
125 }
126 
128 {
129  return d->type == Private::ActionType ? d->action : nullptr;
130 }
131 
133 {
134  return d->type == Private::CollectionType ? d->collection : nullptr;
135 }
136 
138 {
139  return d->nameedit;
140 }
141 QLineEdit *ActionCollectionEditor::textEdit() const
142 {
143  return d->textedit;
144 }
145 QLineEdit *ActionCollectionEditor::commentEdit() const
146 {
147  return d->commentedit;
148 }
149 QLineEdit *ActionCollectionEditor::iconEdit() const
150 {
151  return d->iconedit;
152 }
153 QComboBox *ActionCollectionEditor::interpreterEdit() const
154 {
155  return d->interpreteredit;
156 }
157 KUrlRequester *ActionCollectionEditor::fileEdit() const
158 {
159  return d->fileedit;
160 }
161 
163 {
164  QVBoxLayout *mainlayout = new QVBoxLayout();
165  setLayout(mainlayout);
166 
167  QWidget *w = new QWidget(this);
168  mainlayout->addWidget(w);
169  QGridLayout *gridlayout = new QGridLayout();
170  gridlayout->setContentsMargins(0, 0, 0, 0);
171  //gridlayout->setSpacing(0);
172  w->setLayout(gridlayout);
173 
174  QLabel *namelabel = new QLabel(i18n("Name:"), w);
175  gridlayout->addWidget(namelabel, 0, 0);
176  d->nameedit = new QLineEdit(w);
177  namelabel->setBuddy(d->nameedit);
178  d->nameedit->setText(d->name());
179  d->nameedit->setEnabled(false);
180  gridlayout->addWidget(d->nameedit, 0, 1);
181 
182  QLabel *textlabel = new QLabel(i18n("Text:"), w);
183  gridlayout->addWidget(textlabel, 1, 0);
184  d->textedit = new QLineEdit(w);
185  textlabel->setBuddy(d->textedit);
186  d->textedit->setText(d->text());
187  gridlayout->addWidget(d->textedit, 1, 1);
188 
189  QLabel *commentlabel = new QLabel(i18n("Comment:"), w);
190  gridlayout->addWidget(commentlabel, 2, 0);
191  d->commentedit = new QLineEdit(w);
192  commentlabel->setBuddy(d->commentedit);
193  d->commentedit->setText(d->description());
194  gridlayout->addWidget(d->commentedit, 2, 1);
195 
196  QLabel *iconlabel = new QLabel(i18n("Icon:"), w);
197  gridlayout->addWidget(iconlabel, 3, 0);
198  QWidget *iconbox = new QWidget(w);
199  QHBoxLayout *iconlayout = new QHBoxLayout();
200  iconlayout->setContentsMargins(0, 0, 0, 0);
201  iconbox->setLayout(iconlayout);
202  d->iconedit = new QLineEdit(iconbox);
203  iconlabel->setBuddy(d->iconedit);
204  d->iconedit->setText(d->iconName());
205  iconlayout->addWidget(d->iconedit, 1);
206  KIconButton *iconbutton = new KIconButton(iconbox);
207  iconbutton->setIcon(d->iconName());
208  connect(iconbutton, SIGNAL(iconChanged(QString)), d->iconedit, SLOT(setText(QString)));
209  iconlayout->addWidget(iconbutton);
210  gridlayout->addWidget(iconbox, 3, 1);
211 
212  //QFrame* hr1 = new QFrame(w);
213  //hr1->setFrameStyle(QFrame::HLine | QFrame::Sunken);
214  //gridlayout->addWidget(hr1, 4, 0, -1, -1, Qt::AlignVCenter);
215 
216  if (d->type == Private::ActionType) {
217  QLabel *interpreterlabel = new QLabel(i18n("Interpreter:"), w);
218  gridlayout->addWidget(interpreterlabel, 4, 0);
219  d->interpreteredit = new KComboBox(w);
220  interpreterlabel->setBuddy(d->interpreteredit);
221  d->interpreteredit->setMaxVisibleItems(10);
222  d->interpreteredit->insertItems(0, Manager::self().interpreters());
223  d->interpreteredit->setEditable(true);
224  //c->lineEdit()->setText( d->action->interpreter() );
225  int idx = Manager::self().interpreters().indexOf(d->action->interpreter());
226  if (idx >= 0) {
227  d->interpreteredit->setCurrentIndex(idx);
228  } else {
229  d->interpreteredit->setEditText(d->action->interpreter());
230  }
231  gridlayout->addWidget(d->interpreteredit, 4, 1);
232 
233  QLabel *filelabel = new QLabel(i18n("File:"), w);
234  gridlayout->addWidget(filelabel, 5, 0);
235  d->fileedit = new KUrlRequester(w);
236  filelabel->setBuddy(d->fileedit);
237  QStringList mimetypes;
238  foreach (const QString &interpretername, Manager::self().interpreters()) {
239  InterpreterInfo *info = Manager::self().interpreterInfo(interpretername);
240  Q_ASSERT(info);
241  mimetypes.append(info->mimeTypes().join(" ").trimmed());
242  }
243  //InterpreterInfo* info = Manager::self().interpreterInfo( Manager::self().interpreternameForFile( d->action->file() ) );
244  //const QString defaultmime = info ? info->mimeTypes().join(" ").trimmed() : QString();
245 
246  d->fileedit->setMimeTypeFilters(mimetypes);
247  d->fileedit->setMode(KFile::File | KFile::ExistingOnly | KFile::LocalOnly);
248  d->fileedit->setUrl(QUrl::fromLocalFile(d->action->file()));
249  gridlayout->addWidget(d->fileedit, 5, 1);
250  } else {
251  d->interpreteredit = nullptr;
252  d->fileedit = nullptr;
253  }
254 
255  //d->enabledcheckbox = new QCheckBox(this);
256  //d->enabledcheckbox->setText( i18n("Enabled") );
257  //d->enabledcheckbox->setChecked( d->isEnabled() );
258  //mainlayout->addWidget(d->enabledcheckbox);
259 
260  mainlayout->addStretch(1);
261 }
262 
264 {
265  //TODO check also if such a name already exist.
266  return ! d->nameedit->text().isEmpty();
267 }
268 
270 {
271  switch (d->type) {
272  case Private::ActionType: {
273  d->action->setText(d->textedit->text());
274  d->action->setDescription(d->commentedit->text());
275  d->action->setIconName(d->iconedit->text());
276  d->action->setInterpreter(d->interpreteredit->currentText());
277  d->action->setFile(d->fileedit->url().path());
278  //d->action->setEnabled( d->enabledcheckbox->isChecked() );
279  } break;
280  case Private::CollectionType: {
281  d->collection->setText(d->textedit->text());
282  d->collection->setDescription(d->commentedit->text());
283  d->collection->setIconName(d->iconedit->text());
284  //d->collection->setEnabled( d->enabledcheckbox->isChecked() );
285  } break;
286  default: break;
287  }
288 }
289 
290 /*********************************************************************************
291  * ActionCollectionView
292  */
293 
294 namespace Kross
295 {
296 
297 /// \internal d-pointer class.
298 class ActionCollectionView::Private
299 {
300 public:
301  bool modified;
302  KActionCollection *collection;
304  explicit Private() : modified(false) {}
305 };
306 
307 }
308 
310  : QTreeView(parent)
311  , d(new Private())
312 {
313  header()->hide();
316  setRootIsDecorated(true);
317  setSortingEnabled(false);
318  setItemsExpandable(true);
319  //setDragEnabled(true);
320  //setAcceptDrops(true);
321  setDropIndicatorShown(true);
323 
324  d->collection = new KActionCollection(this);
325 
326  QAction *runaction = new QAction(QIcon::fromTheme("system-run"), i18n("Run"), this);
327  runaction->setObjectName("run");
328  runaction->setToolTip(i18n("Execute the selected script."));
329  runaction->setEnabled(false);
330  d->collection->addAction("run", runaction);
331  connect(runaction, SIGNAL(triggered()), this, SLOT(slotRun()));
332 
333  QAction *stopaction = new QAction(QIcon::fromTheme("process-stop"), i18n("Stop"), this);
334  stopaction->setObjectName("stop");
335  stopaction->setToolTip(i18n("Stop execution of the selected script."));
336  stopaction->setEnabled(false);
337  d->collection->addAction("stop", stopaction);
338  connect(stopaction, SIGNAL(triggered()), this, SLOT(slotStop()));
339 
340  QAction *editaction = new QAction(QIcon::fromTheme("document-properties"), i18n("Edit..."), this);
341  editaction->setObjectName("edit");
342  editaction->setToolTip(i18n("Edit selected script."));
343  editaction->setEnabled(false);
344  d->collection->addAction("edit", editaction);
345  connect(editaction, SIGNAL(triggered()), this, SLOT(slotEdit()));
346 
347  QAction *addaction = new QAction(QIcon::fromTheme("list-add"), i18n("Add..."), this);
348  addaction->setObjectName("add");
349  addaction->setToolTip(i18n("Add a new script."));
350  //addaction->setEnabled(false);
351  d->collection->addAction("add", addaction);
352  connect(addaction, SIGNAL(triggered()), this, SLOT(slotAdd()));
353 
354  QAction *removeaction = new QAction(QIcon::fromTheme("list-remove"), i18n("Remove"), this);
355  removeaction->setObjectName("remove");
356  removeaction->setToolTip(i18n("Remove selected script."));
357  removeaction->setEnabled(false);
358  d->collection->addAction("remove", removeaction);
359  connect(removeaction, SIGNAL(triggered()), this, SLOT(slotRemove()));
360 
361  connect(this, SIGNAL(enabledChanged(QString)), this, SLOT(slotEnabledChanged(QString)));
362  //expandAll();
363 }
364 
366 {
367  delete d;
368 }
369 
371 {
373  d->modified = false;
374 
375  QItemSelectionModel *selectionmodel = new QItemSelectionModel(m, this);
376  setSelectionModel(selectionmodel);
377 
379  this, SLOT(slotSelectionChanged()));
382 }
383 
385 {
386  return d->modified;
387 }
388 
390 {
391  d->modified = modified;
392 }
393 
395 {
396  return d->collection;
397 }
398 
400 {
401  return d->buttons.contains(actionname) ? d->buttons[actionname] : nullptr;
402 }
403 
405 {
406  QAbstractProxyModel *proxymodel = dynamic_cast< QAbstractProxyModel * >(model());
407  QItemSelection selection = selectionModel()->selection();
408  return proxymodel ? proxymodel->mapSelectionToSource(selection) : selection;
409 }
410 
412 {
413  QAction *action = d->collection->action(actionname);
414  if (! action) {
415  return nullptr;
416  }
417  //if( d->buttons.contains(actionname) ) delete d->buttons[];
419  btn->setText(action->text());
420  btn->setToolTip(action->toolTip());
421  btn->setIcon(action->icon());
422  btn->setEnabled(action->isEnabled());
423  if (parentWidget && parentWidget->layout()) {
424  parentWidget->layout()->addWidget(btn);
425  }
426  QObject::connect(btn, SIGNAL(clicked()), action, SLOT(trigger()));
427  d->buttons.insert(actionname, btn);
428  return btn;
429 }
430 
432 {
433  if (d->buttons.contains(actionname)) {
434  QAction *action = d->collection->action(actionname);
435  d->buttons[ actionname ]->setEnabled(action ? action->isEnabled() : false);
436  }
437 }
438 
440 {
441  bool startenabled = selectionModel()->hasSelection();
442  bool stopenabled = false;
443  bool hasselection = selectionModel()->selectedIndexes().count() > 0;
444  foreach (const QModelIndex &index, itemSelection().indexes()) {
445  Action *action = ActionCollectionModel::action(index);
446  if (startenabled && ! action) {
447  startenabled = false;
448  }
449  if (! stopenabled) {
450  stopenabled = (action && ! action->isFinalized());
451  }
452  }
453  QAction *runaction = d->collection->action("run");
454  if (runaction) {
455  runaction->setEnabled(startenabled);
456  emit enabledChanged("run");
457  }
458  QAction *stopaction = d->collection->action("stop");
459  if (stopaction) {
460  stopaction->setEnabled(stopenabled);
461  emit enabledChanged("stop");
462  }
463  QAction *editaction = d->collection->action("edit");
464  if (editaction) {
465  editaction->setEnabled(hasselection);
466  emit enabledChanged("edit");
467  }
468  QAction *removeaction = d->collection->action("remove");
469  if (removeaction) {
470  removeaction->setEnabled(hasselection);
471  emit enabledChanged("remove");
472  }
473 }
474 
476 {
477  d->modified = true;
478 }
479 
481 {
482  if (! selectionModel()) {
483  return;
484  }
485  QAction *stopaction = d->collection->action("stop");
486 
487  foreach (const QModelIndex &index, itemSelection().indexes()) {
488  if (! index.isValid()) {
489  continue;
490  }
491  if (stopaction) {
492  stopaction->setEnabled(true);
493  emit enabledChanged("stop");
494  }
495  Action *action = ActionCollectionModel::action(index);
496  if (! action) {
497  continue;
498  }
499  connect(action, SIGNAL(finished(Kross::Action*)), SLOT(slotSelectionChanged()));
500  action->trigger();
501  }
503 }
504 
506 {
507  if (! selectionModel()) {
508  return;
509  }
510  foreach (const QModelIndex &index, itemSelection().indexes()) {
511  if (! index.isValid()) {
512  continue;
513  }
514  Action *action = ActionCollectionModel::action(index);
515  if (! action) {
516  continue;
517  }
518  //connect(action, SIGNAL(started(Kross::Action*)), SLOT(slotSelectionChanged()));
519  //connect(action, SIGNAL(finished(Kross::Action*)), SLOT(slotSelectionChanged()));
520  action->finalize();
521  }
523 }
524 
526 {
527  if (! selectionModel()) {
528  return;
529  }
530  Action *action = nullptr;
531  ActionCollection *collection = nullptr;
532  foreach (const QModelIndex &index, itemSelection().indexes()) {
533  if (! index.isValid()) {
534  continue;
535  }
536  if (Action *a = ActionCollectionModel::action(index)) {
537  action = a;
538  } else if (ActionCollection *c = ActionCollectionModel::collection(index)) {
539  collection = c;
540  } else {
541  continue;
542  }
543  break;
544  }
545  if ((! action) && (! collection)) {
546  return;
547  }
548  KPageDialog *dialog = new KPageDialog(this);
549  dialog->setWindowTitle(i18n("Edit"));
550  dialog->setFaceType(KPageDialog::Plain); //Auto Plain List Tree Tabbed
551  ActionCollectionEditor *editor =
552  action ? new ActionCollectionEditor(action, dialog)
553  : new ActionCollectionEditor(collection, dialog);
554  dialog->addPage(editor, i18nc("@title:group Script properties", "General"));
555  //dialog->addPage(new QWidget(this), i18n("Security"));
556  dialog->resize(QSize(580, 200).expandedTo(dialog->minimumSizeHint()));
557  int result = dialog->exec();
558  if (result == QDialog::Accepted /*&& dialog->result() == KDialog::Ok*/) {
559  editor->commit();
560  }
561  dialog->deleteLater();
562 }
563 
565 {
566 
567 //TODO
568  KMessageBox::error(nullptr, "TODO");
569 
570 //ScriptManagerAddWizard wizard(this, collection);
571 //int result = wizard.exec();
572 
573 #if 0
574  if (! selectionModel()) {
575  return;
576  }
577  ActionCollection *collection = 0;
578  foreach (QModelIndex index, itemSelection().indexes()) {
579  if (! index.isValid()) {
580  continue;
581  }
582  if (ActionCollectionModel::action(index)) {
583  //TODO probably add the item right after the current selected one?
584  QModelIndex parent = index;
585  while (parent.isValid() && ! collection) {
586  parent = d->view->model()->parent(parent);
588  }
589  if (collection) {
590  break; // job done
591  }
592  } else if (ActionCollection *c = ActionCollectionModel::collection(index)) {
593  collection = c;
594  break; // job done
595  }
596  }
597  ScriptManagerAddWizard wizard(this, collection);
598  int result = wizard.exec();
599  Q_UNUSED(result);
600 #endif
601 }
602 
604 {
605  if (! selectionModel()) {
606  return;
607  }
608  KMessageBox::error(nullptr, "TODO");
609 }
610 
611 #include "moc_actioncollectionview.cpp"
void append(const T &value)
virtual void slotRun()
Called if the "run" action was triggered and the selected script should be executed.
bool isFinalized() const
Definition: action.cpp:532
QWidget(QWidget *parent, Qt::WindowFlags f)
void finalize()
Finalize the Script instance and frees any cached or still running executions.
Definition: action.cpp:523
void setIcon(const QString &icon)
~ActionCollectionEditor() override
Destructor.
const QItemSelection selection() const const
virtual void setModel(QAbstractItemModel *model) override
static Action * action(const QModelIndex &index)
void setBuddy(QWidget *buddy)
Type type(const QSqlDatabase &db)
QAbstractItemModel * model() const const
QLayout * layout() const const
QString trimmed() const const
ActionCollectionView(QWidget *parent=nullptr)
Constructor.
QIcon fromTheme(const QString &name)
QItemSelectionModel * selectionModel() const const
QString description() const
Definition: action.cpp:295
void enabledChanged(const QString &actionname)
This signal is emitted if the enabled/disabled state of an action changed.
void setSelectionMode(QAbstractItemView::SelectionMode mode)
void setAlternatingRowColors(bool enable)
bool hasSelection() const const
void setFaceType(FaceType faceType)
QPushButton * button(const QString &actionname) const
bool isEnabled() const
Return true if this Action is enabled else false is returned.
Definition: action.cpp:320
void addStretch(int stretch)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
The ActionCollectionEditor class implements a general editor for Action and ActionCollection instance...
void hide()
bool isEnabled() const
Return the enable this ActionCollection has.
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
QHeaderView * header() const const
QLineEdit * nameEdit() const
Following getters are providing access to the edit-widgets once the initGui() was called by the const...
void deleteLater()
virtual QSize minimumSizeHint() const const override
KActionCollection * actionCollection() const
QString i18n(const char *text, const TYPE &arg...)
virtual void slotDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
This slot got called if the data changed.
virtual void setSelectionModel(QItemSelectionModel *selectionModel) override
QUrl fromLocalFile(const QString &localFile)
void setWindowTitle(const QString &)
QItemSelection itemSelection() const
This method provides us access to the QItemSelection.
QString name() const
Definition: action.cpp:285
void addPage(KPageWidgetItem *item)
void setModified(bool modified)
Set the internal modified state of the collection to modified .
static ActionCollection * collection(const QModelIndex &index)
virtual int exec()
virtual void slotEnabledChanged(const QString &actionname)
This slot got called if the enable/disable state of an action changed.
QString join(const QString &separator) const const
ActionCollection * collection() const
virtual QItemSelection mapSelectionToSource(const QItemSelection &proxySelection) const const
The Action class is an abstract container to deal with scripts like a single standalone script file.
Definition: action.h:112
bool isValid() const const
bool isEnabled() const const
void trigger()
virtual void slotStop()
Called if the "stop" action was triggered and the selected script stops execution if running.
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
void setSortingEnabled(bool enable)
void setIcon(const QIcon &icon)
void resize(int w, int h)
void setToolTip(const QString &tip)
void setEnabled(bool)
void setToolTip(const QString &)
void setDropIndicatorShown(bool enable)
The InterpreterInfo class provides abstract information about a Interpreter before the interpreter-ba...
void setObjectName(const QString &name)
QString name(StandardShortcut id)
void addWidget(QWidget *w)
virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles) override
void setContentsMargins(int left, int top, int right, int bottom)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
void addWidget(QWidget *widget, int row, int column, Qt::Alignment alignment)
virtual void slotRemove()
Called if the "remove" action was triggered and the selected item should be removed.
void setRootIsDecorated(bool show)
~ActionCollectionView() override
Destructor.
void setDragDropMode(QAbstractItemView::DragDropMode behavior)
const QStringList mimeTypes() const
List of mimetypes this interpreter supports.
virtual void slotAdd()
Called if the "add" action was triggered and a new item should be added.
ActionCollectionEditor(Action *action, QWidget *parent=nullptr)
Constructor.
void setLayout(QLayout *layout)
void clicked(const QModelIndex &index)
void setModel(QAbstractItemModel *model) override
Set the model this view should use to model .
virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override
void setItemsExpandable(bool enable)
virtual void slotEdit()
Called if the "edit" action was triggered and the select item should be edited via the scripts manage...
QWidget * parentWidget() const const
QString iconName() const
Return the name of the icon.
Definition: action.cpp:307
QObject * parent() const const
void setText(const QString &text)
virtual void commit()
This method got called if the changes done in the editor should be saved aka committed to the Action ...
The ActionCollection class manages collections of Action instances.
QPushButton * createButton(QWidget *parentWidget, const QString &actionname)
Create and return a new QPushButton instance for the given actionname.
virtual void slotSelectionChanged()
This slot got called if the selected item changed.
virtual void initGui()
Initialize the GUI.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Dec 5 2023 04:09:32 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.