EditToolBar::EditToolBar(QWidget *parent) : QDialog(parent) { //configure u ui.setupUi(this); //no search made yet searchMade = false; //icons size - copied from kedittoolbar class, in kdelibs iconSize = this->style()->pixelMetric(QStyle::PM_SmallIconSize); //separator item separatorItem = new QListWidgetItem(QString("--- %1 ---").arg(tr("Separator"))); separatorItem->setData(32, "_separator"); //setup icons ui.okButton->setIcon(QIcon::fromTheme("dialog-ok")); ui.applyButton->setIcon(QIcon::fromTheme("dialog-ok-apply")); ui.cancelButton->setIcon(QIcon::fromTheme("dialog-cancel")); ui.clearButton1->setIcon(QIcon::fromTheme("edit-clear-locationbar-rtl")); ui.clearButton2->setIcon(QIcon::fromTheme("edit-clear-locationbar-rtl")); ui.addButton->setIcon(QIcon::fromTheme("go-next")); ui.removeButton->setIcon(QIcon::fromTheme("go-previous")); ui.moveDownButton->setIcon(QIcon::fromTheme("go-down")); ui.moveUpButton->setIcon(QIcon::fromTheme("go-up")); ui.setDefaultsButton->setIcon(QIcon::fromTheme("document-revert")); //connections connect(this, SIGNAL(actionsListChanged()), this, SLOT(updateButtons())); connect(ui.currentActions, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons())); connect(ui.availableActions, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons())); connect(this, SIGNAL(actionsListChanged()), this, SLOT(actionsChangedSlot())); connect(ui.okButton, SIGNAL(clicked()), this, SLOT(okSlot())); connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applySlot())); connect(ui.addButton, SIGNAL(clicked()), this, SLOT(addAction())); connect(ui.removeButton, SIGNAL(clicked()), this, SLOT(removeAction())); connect(ui.moveDownButton, SIGNAL(clicked()), this, SLOT(moveDownAction())); connect(ui.moveUpButton, SIGNAL(clicked()), this, SLOT(moveUpAction())); connect(ui.currentFilter, SIGNAL(textChanged(QString)), this, SLOT(searchInCurrentActionsSlot(QString))); connect(ui.availableFilter, SIGNAL(textChanged(QString)), this, SLOT(searchInAvailableActionsSlot(QString))); connect(ui.setDefaultsButton, SIGNAL(clicked()), this, SLOT(setDefaults())); this->setWindowTitle(tr("Configure toolbar")); }
EditToolBar::EditToolBar(QWidget *parent) : QDialog(parent) { ui.setupUi(this); ui.okButton->setIcon(QIcon::fromTheme("dialog-ok")); ui.applyButton->setIcon(QIcon::fromTheme("dialog-ok-apply")); ui.cancelButton->setIcon(QIcon::fromTheme("dialog-cancel")); tbe = new ToolBarEdit(this); tbe->setMaximumWidth(ui.widget->maximumWidth()); tbe->setMaximumHeight(ui.widget->maximumHeight()); connect(tbe, SIGNAL(actionsListChanged()), this, SLOT(actionsChangedSlot())); connect(ui.okButton, SIGNAL(clicked()), this, SLOT(okSlot())); connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applySlot())); ui.widget = tbe; this->setWindowTitle(tr("Configure toolbar")); }