Claudio Valerio 13 years ago
parent 7ca82a1e15
commit f404d94242
  1. 29
      src/gui/UBLibraryWidget.cpp
  2. 2
      src/gui/UBLibraryWidget.h

@ -513,6 +513,8 @@ UBNewFolderDlg::UBNewFolderDlg(QWidget *parent, const char *name):QDialog(parent
, mpLabel(NULL)
, mpLineEdit(NULL)
, mpButtons(NULL)
, mpAddButton(NULL)
, mpCancelButton(NULL)
, mpLayout(NULL)
, mpHLayout(NULL)
{
@ -521,18 +523,26 @@ UBNewFolderDlg::UBNewFolderDlg(QWidget *parent, const char *name):QDialog(parent
mpLabel = new QLabel(tr("New Folder name:"),this);
mpLineEdit = new QLineEdit(this);
mpButtons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
mpAddButton = new QPushButton(tr("Add"));
mpAddButton->setDefault(true);
mpCancelButton = new QPushButton(tr("Cancel"));
mpCancelButton->setAutoDefault(false);
mpButtons = new QDialogButtonBox(Qt::Horizontal, this);
mpLayout = new QVBoxLayout(this);
mpHLayout = new QHBoxLayout(this);
setLayout(mpLayout);
mpLayout->addLayout(mpHLayout, 0);
mpHLayout->addWidget(mpLabel, 0);
mpHLayout->addWidget(mpLineEdit, 1);
mpButtons->addButton(mpAddButton,QDialogButtonBox::ActionRole);
mpButtons->addButton(mpCancelButton,QDialogButtonBox::ActionRole);
mpLayout->addWidget(mpButtons);
connect(mpButtons->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(accept()));
connect(mpButtons->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
connect(mpAddButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(mpCancelButton, SIGNAL(clicked()), this, SLOT(reject()));
connect(mpLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(text_Changed(const QString &)));
connect(mpLineEdit, SIGNAL(textEdited(const QString &)), this, SLOT(text_Edited(const QString &)));
@ -545,6 +555,17 @@ UBNewFolderDlg::UBNewFolderDlg(QWidget *parent, const char *name):QDialog(parent
*/
UBNewFolderDlg::~UBNewFolderDlg()
{
if(NULL != mpAddButton)
{
delete mpAddButton;
mpAddButton = NULL;
}
if(NULL != mpCancelButton)
{
delete mpCancelButton;
mpCancelButton = NULL;
}
if(NULL != mpButtons)
{
delete mpButtons;

@ -107,6 +107,8 @@ private:
QLabel* mpLabel;
QLineEdit* mpLineEdit;
QDialogButtonBox* mpButtons;
QPushButton* mpAddButton;
QPushButton* mpCancelButton;
QVBoxLayout* mpLayout;
QHBoxLayout* mpHLayout;
};

Loading…
Cancel
Save