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) , mpLabel(NULL)
, mpLineEdit(NULL) , mpLineEdit(NULL)
, mpButtons(NULL) , mpButtons(NULL)
, mpAddButton(NULL)
, mpCancelButton(NULL)
, mpLayout(NULL) , mpLayout(NULL)
, mpHLayout(NULL) , mpHLayout(NULL)
{ {
@ -521,18 +523,26 @@ UBNewFolderDlg::UBNewFolderDlg(QWidget *parent, const char *name):QDialog(parent
mpLabel = new QLabel(tr("New Folder name:"),this); mpLabel = new QLabel(tr("New Folder name:"),this);
mpLineEdit = new QLineEdit(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); mpLayout = new QVBoxLayout(this);
mpHLayout = new QHBoxLayout(this); mpHLayout = new QHBoxLayout(this);
setLayout(mpLayout); setLayout(mpLayout);
mpLayout->addLayout(mpHLayout, 0); mpLayout->addLayout(mpHLayout, 0);
mpHLayout->addWidget(mpLabel, 0); mpHLayout->addWidget(mpLabel, 0);
mpHLayout->addWidget(mpLineEdit, 1); mpHLayout->addWidget(mpLineEdit, 1);
mpButtons->addButton(mpAddButton,QDialogButtonBox::ActionRole);
mpButtons->addButton(mpCancelButton,QDialogButtonBox::ActionRole);
mpLayout->addWidget(mpButtons); mpLayout->addWidget(mpButtons);
connect(mpButtons->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(accept())); connect(mpAddButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(mpButtons->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject())); connect(mpCancelButton, SIGNAL(clicked()), this, SLOT(reject()));
connect(mpLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(text_Changed(const QString &))); connect(mpLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(text_Changed(const QString &)));
connect(mpLineEdit, SIGNAL(textEdited(const QString &)), this, SLOT(text_Edited(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() UBNewFolderDlg::~UBNewFolderDlg()
{ {
if(NULL != mpAddButton)
{
delete mpAddButton;
mpAddButton = NULL;
}
if(NULL != mpCancelButton)
{
delete mpCancelButton;
mpCancelButton = NULL;
}
if(NULL != mpButtons) if(NULL != mpButtons)
{ {
delete mpButtons; delete mpButtons;

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

Loading…
Cancel
Save