mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Get rid of renameTableForm dialog
Delete the renameTableForm class and dialog. They are basically useless as their functionality can (and has been) easily be integrated into the editTableForm.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#include "edittableform.h"
|
||||
#include "ui_edittableform.h"
|
||||
#include "renametableform.h"
|
||||
#include "editfieldform.h"
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
|
||||
/*
|
||||
* Constructs a editTableForm as a child of 'parent', with the
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
#include "renametableform.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qimage.h>
|
||||
#include <qpixmap.h>
|
||||
|
||||
#include "sqlitedb.h"
|
||||
/*
|
||||
* Constructs a renameTableForm as a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
renameTableForm::renameTableForm(QWidget* parent, Qt::WindowFlags fl)
|
||||
: QDialog(parent, fl)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
renameTableForm::~renameTableForm()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets the strings of the subwidgets using the current
|
||||
* language.
|
||||
*/
|
||||
void renameTableForm::languageChange()
|
||||
{
|
||||
retranslateUi(this);
|
||||
}
|
||||
|
||||
void renameTableForm::renameClicked()
|
||||
{
|
||||
QString tabname = tablenameLineEdit->text();
|
||||
if (tabname.isEmpty()) {
|
||||
QMessageBox::information( this, QApplication::applicationName(), "Table name can not be empty" );
|
||||
return;
|
||||
}
|
||||
if (tabname.contains(" ")>0) {
|
||||
QMessageBox::warning( this, QApplication::applicationName(), "Spaces are not allowed in the table name" );
|
||||
return;
|
||||
}
|
||||
accept();
|
||||
}
|
||||
|
||||
QString renameTableForm::getTableName()
|
||||
{
|
||||
return tablenameLineEdit->text();
|
||||
}
|
||||
|
||||
void renameTableForm::setTableName(QString name)
|
||||
{
|
||||
tablenameLineEdit->setText(name);
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
#ifndef RENAMETABLEFORM_H
|
||||
#define RENAMETABLEFORM_H
|
||||
|
||||
#include <qvariant.h>
|
||||
|
||||
/* QT_BEGIN_NAMESPACE and QT_END_NAMESPACE weren't introduced into QT right away... */
|
||||
#ifndef QT_BEGIN_NAMESPACE
|
||||
#define QT_BEGIN_NAMESPACE
|
||||
#endif
|
||||
|
||||
#ifndef QT_END_NAMESPACE
|
||||
#define QT_END_NAMESPACE
|
||||
#endif
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QButtonGroup>
|
||||
#include <QtGui/QDialog>
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QSpacerItem>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Ui_renameTableForm
|
||||
{
|
||||
public:
|
||||
QVBoxLayout *vboxLayout;
|
||||
QLineEdit *tablenameLineEdit;
|
||||
QSpacerItem *spacer27;
|
||||
QHBoxLayout *hboxLayout;
|
||||
QSpacerItem *spacer26;
|
||||
QPushButton *closeButton;
|
||||
QPushButton *renameButton;
|
||||
|
||||
void setupUi(QDialog *renameTableForm)
|
||||
{
|
||||
if (renameTableForm->objectName().isEmpty()){
|
||||
renameTableForm->setObjectName(QString::fromUtf8("renameTableForm"));
|
||||
}
|
||||
renameTableForm->setWindowIcon(QIcon(":/icons/table_modify"));
|
||||
renameTableForm->resize(313, 101);
|
||||
vboxLayout = new QVBoxLayout(renameTableForm);
|
||||
vboxLayout->setSpacing(6);
|
||||
vboxLayout->setContentsMargins(11, 11, 11, 11);
|
||||
vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
|
||||
tablenameLineEdit = new QLineEdit(renameTableForm);
|
||||
tablenameLineEdit->setObjectName(QString::fromUtf8("tablenameLineEdit"));
|
||||
|
||||
vboxLayout->addWidget(tablenameLineEdit);
|
||||
|
||||
spacer27 = new QSpacerItem(20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
|
||||
vboxLayout->addItem(spacer27);
|
||||
|
||||
hboxLayout = new QHBoxLayout();
|
||||
hboxLayout->setSpacing(6);
|
||||
hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
|
||||
spacer26 = new QSpacerItem(31, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
hboxLayout->addItem(spacer26);
|
||||
|
||||
closeButton = new QPushButton(renameTableForm);
|
||||
closeButton->setObjectName(QString::fromUtf8("closeButton"));
|
||||
closeButton->setIcon(QIcon(":/icons/cancel"));
|
||||
hboxLayout->addWidget(closeButton);
|
||||
|
||||
renameButton = new QPushButton(renameTableForm);
|
||||
renameButton->setObjectName(QString::fromUtf8("renameButton"));
|
||||
renameButton->setDefault(true);
|
||||
renameButton->setIcon(QIcon(":/icons/save"));
|
||||
hboxLayout->addWidget(renameButton);
|
||||
|
||||
|
||||
vboxLayout->addLayout(hboxLayout);
|
||||
|
||||
|
||||
retranslateUi(renameTableForm);
|
||||
QObject::connect(closeButton, SIGNAL(clicked()), renameTableForm, SLOT(reject()));
|
||||
QObject::connect(renameButton, SIGNAL(clicked()), renameTableForm, SLOT(renameClicked()));
|
||||
|
||||
QMetaObject::connectSlotsByName(renameTableForm);
|
||||
} // setupUi
|
||||
|
||||
void retranslateUi(QDialog *renameTableForm)
|
||||
{
|
||||
renameTableForm->setWindowTitle(QApplication::translate("renameTableForm", "Rename table", 0, QApplication::UnicodeUTF8));
|
||||
closeButton->setText(QApplication::translate("renameTableForm", "Cancel", 0, QApplication::UnicodeUTF8));
|
||||
renameButton->setText(QApplication::translate("renameTableForm", "Rename", 0, QApplication::UnicodeUTF8));
|
||||
} // retranslateUi
|
||||
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class renameTableForm: public Ui_renameTableForm {};
|
||||
} // namespace Ui
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class renameTableForm : public QDialog, public Ui::renameTableForm
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
renameTableForm(QWidget* parent = 0, Qt::WindowFlags fl = Qt::Window);
|
||||
~renameTableForm();
|
||||
|
||||
virtual QString getTableName();
|
||||
|
||||
public slots:
|
||||
virtual void renameClicked();
|
||||
virtual void setTableName( QString name );
|
||||
|
||||
protected slots:
|
||||
virtual void languageChange();
|
||||
|
||||
};
|
||||
|
||||
#endif // RENAMETABLEFORM_H
|
||||
@@ -26,7 +26,6 @@ HEADERS += \
|
||||
exporttablecsvform.h \
|
||||
findform.h \
|
||||
importcsvform.h \
|
||||
renametableform.h \
|
||||
preferencesform.h \
|
||||
mainwindow.h \
|
||||
createtabledialog.h \
|
||||
@@ -50,7 +49,6 @@ SOURCES += \
|
||||
exporttablecsvform.cpp \
|
||||
findform.cpp \
|
||||
importcsvform.cpp \
|
||||
renametableform.cpp \
|
||||
preferencesform.cpp \
|
||||
mainwindow.cpp \
|
||||
createtabledialog.cpp \
|
||||
|
||||
Reference in New Issue
Block a user