SHAPERGUI_ToolbarsDlg::SHAPERGUI_ToolbarsDlg(SHAPERGUI* theModule)
: QDialog(theModule->application()->desktop()),
myModule(theModule),
- myResult(theModule->shaperToolbars())
+ myResult(theModule->shaperToolbars()),
+ myIsReset(false)
{
myFreeCommands = theModule->getFreeCommands();
aContolsLay->addWidget(aButtonsWgt);
QPushButton* aAddBtn = new QPushButton(tr("Add..."), aButtonsWgt);
+ aAddBtn->setToolTip(tr("Add a new empty toolbar to the toolbars list"));
connect(aAddBtn, SIGNAL(clicked(bool)), SLOT(onAdd()));
aBtnLayout->addWidget(aAddBtn);
QPushButton* aEditBtn = new QPushButton(tr("Edit..."), aButtonsWgt);
+ aEditBtn->setToolTip(tr("Edit currently selected toolbar"));
connect(aEditBtn, SIGNAL(clicked(bool)), SLOT(onEdit()));
aBtnLayout->addWidget(aEditBtn);
QPushButton* aDeleteBtn = new QPushButton(tr("Delete"), aButtonsWgt);
+ aDeleteBtn->setToolTip(tr("Delete currently selected toolbar"));
connect(aDeleteBtn, SIGNAL(clicked(bool)), SLOT(onDelete()));
aBtnLayout->addWidget(aDeleteBtn);
aBtnLayout->addStretch(1);
+ QPushButton* aResetBtn = new QPushButton(tr("Reset"), aButtonsWgt);
+ aResetBtn->setToolTip(tr("Restore default toolbars structure"));
+ connect(aResetBtn, SIGNAL(clicked(bool)), SLOT(onReset()));
+ aBtnLayout->addWidget(aResetBtn);
+ aBtnLayout->addSpacing(19);
+
// Buttons part of the dialog
QDialogButtonBox* aButtons =
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
if (!myResult.contains(aNewToolbar)) {
myResult[aNewToolbar] = QIntList();
updateToolbarsList();
+ myIsReset = false;
}
else {
QString aMsg = tr("A tool bar with name %1 already exists").arg(aNewToolbar);
myResult[aToolbarName] = aDlg.toolbarItems();
updateNumber();
updateToolbarsList();
+ myIsReset = false;
}
}
}
myResult.remove(aToolbarName);
updateToolbarsList();
updateNumber();
+ myIsReset = false;
}
}
}
myFreeNbLbl->setText(QString::number(myFreeCommands.size()));
}
+void SHAPERGUI_ToolbarsDlg::onReset()
+{
+ myResult = myModule->defaultToolbars();
+ updateNumber();
+ updateToolbarsList();
+ myIsReset = true;
+}
+
+
//************************************************************************************
//************************************************************************************
//************************************************************************************
: QDialog(theParent),
myModule(theModule)
{
- setWindowTitle(tr("Edit toolbar items"));
+ setWindowTitle(tr("Edit toolbar"));
QVBoxLayout* aMailLayout = new QVBoxLayout(this);