Rename dialog files and classes

Rename the files and classes for the dialogs to share all the same
naming pattern. This should make navigation in the code a bit easier.
Do not include dialogs not rewritten yet; they'll be edited as they are
redesigned.
This commit is contained in:
Martin Kleusberg
2013-01-08 21:19:01 +01:00
parent 32ab512f08
commit 24c3eca2e5
15 changed files with 141 additions and 141 deletions

22
src/AboutDialog.h Normal file
View File

@@ -0,0 +1,22 @@
#ifndef __ABOUTDIALOG_H__
#define __ABOUTDIALOG_H__
#include <QDialog>
namespace Ui {
class AboutDialog;
}
class AboutDialog : public QDialog
{
Q_OBJECT
public:
explicit AboutDialog(QWidget *parent = 0);
~AboutDialog();
private:
Ui::AboutDialog *ui;
};
#endif

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogAbout</class>
<widget class="QDialog" name="DialogAbout">
<class>AboutDialog</class>
<widget class="QDialog" name="AboutDialog">
<property name="geometry">
<rect>
<x>0</x>
@@ -124,7 +124,7 @@
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DialogAbout</receiver>
<receiver>AboutDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
@@ -140,7 +140,7 @@
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DialogAbout</receiver>
<receiver>AboutDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">

View File

@@ -1,10 +1,10 @@
#include "DialogAbout.h"
#include "ui_DialogAbout.h"
#include "AboutDialog.h"
#include "ui_AboutDialog.h"
#include <sqlite3.h>
DialogAbout::DialogAbout(QWidget *parent) :
AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogAbout)
ui(new Ui::AboutDialog)
{
ui->setupUi(this);
this->setFixedSize(669, 306);
@@ -14,7 +14,7 @@ DialogAbout::DialogAbout(QWidget *parent) :
ui->label_versionsqlite->setText(ui->label_versionsqlite->text() + " " + SQLITE_VERSION);
}
DialogAbout::~DialogAbout()
AboutDialog::~AboutDialog()
{
delete ui;
}

View File

@@ -1,22 +0,0 @@
#ifndef DIALOGABOUT_H
#define DIALOGABOUT_H
#include <QDialog>
namespace Ui {
class DialogAbout;
}
class DialogAbout : public QDialog
{
Q_OBJECT
public:
explicit DialogAbout(QWidget *parent = 0);
~DialogAbout();
private:
Ui::DialogAbout *ui;
};
#endif // DIALOGABOUT_H

View File

@@ -1,12 +1,12 @@
#include "EditFieldForm.h"
#include "ui_EditFieldForm.h"
#include "EditFieldDialog.h"
#include "ui_EditFieldDialog.h"
#include "sqlitedb.h"
#include <QPushButton>
#include <QMessageBox>
editFieldForm::editFieldForm(QWidget* parent)
EditFieldDialog::EditFieldDialog(QWidget* parent)
: QDialog(parent),
ui(new Ui::editFieldForm)
ui(new Ui::EditFieldDialog)
{
ui->setupUi(this);
@@ -17,12 +17,12 @@ editFieldForm::editFieldForm(QWidget* parent)
ui->radioCustom->setProperty("field_type", "__custom__");
}
editFieldForm::~editFieldForm()
EditFieldDialog::~EditFieldDialog()
{
delete ui;
}
void editFieldForm::setInitialValues(DBBrowserDB *db, bool is_new, QString table, QString fld_name, QString fld_type)
void EditFieldDialog::setInitialValues(DBBrowserDB *db, bool is_new, QString table, QString fld_name, QString fld_type)
{
pdb = db;
original_field_name = QString(fld_name);
@@ -54,7 +54,7 @@ void editFieldForm::setInitialValues(DBBrowserDB *db, bool is_new, QString table
checkInput();
}
void editFieldForm::accept()
void EditFieldDialog::accept()
{
field_name = ui->nameLineEdit->text();
field_type = ui->groupRadioTypes->checkedButton()->property("field_type").toString();
@@ -78,7 +78,7 @@ void editFieldForm::accept()
QDialog::accept();
}
void editFieldForm::checkInput()
void EditFieldDialog::checkInput()
{
ui->nameLineEdit->setText(ui->nameLineEdit->text().trimmed());
bool valid = true;

View File

@@ -1,21 +1,21 @@
#ifndef EDITFIELDFORM_H
#define EDITFIELDFORM_H
#ifndef __EDITFIELDDIALOG_H__
#define __EDITFIELDDIALOG_H__
#include <QDialog>
class DBBrowserDB;
namespace Ui {
class editFieldForm;
class EditFieldDialog;
}
class editFieldForm : public QDialog
class EditFieldDialog : public QDialog
{
Q_OBJECT
public:
editFieldForm(QWidget* parent = 0);
~editFieldForm();
EditFieldDialog(QWidget* parent = 0);
~EditFieldDialog();
QString table_name;
QString field_name;
@@ -30,7 +30,7 @@ public slots:
private:
DBBrowserDB *pdb;
Ui::editFieldForm *ui;
Ui::EditFieldDialog *ui;
};
#endif // EDITFIELDFORM_H
#endif

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>editFieldForm</class>
<widget class="QDialog" name="editFieldForm">
<class>EditFieldDialog</class>
<widget class="QDialog" name="EditFieldDialog">
<property name="geometry">
<rect>
<x>0</x>
@@ -131,7 +131,7 @@
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>editFieldForm</receiver>
<receiver>EditFieldDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
@@ -147,7 +147,7 @@
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>editFieldForm</receiver>
<receiver>EditFieldDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
@@ -179,7 +179,7 @@
<connection>
<sender>nameLineEdit</sender>
<signal>textChanged(QString)</signal>
<receiver>editFieldForm</receiver>
<receiver>EditFieldDialog</receiver>
<slot>checkInput()</slot>
<hints>
<hint type="sourcelabel">
@@ -195,7 +195,7 @@
<connection>
<sender>txtCustomType</sender>
<signal>textChanged(QString)</signal>
<receiver>editFieldForm</receiver>
<receiver>EditFieldDialog</receiver>
<slot>checkInput()</slot>
<hints>
<hint type="sourcelabel">
@@ -211,7 +211,7 @@
<connection>
<sender>groupRadioTypes</sender>
<signal>buttonClicked(int)</signal>
<receiver>editFieldForm</receiver>
<receiver>EditFieldDialog</receiver>
<slot>checkInput()</slot>
<hints>
<hint type="sourcelabel">

View File

@@ -1,25 +1,25 @@
#include "EditTableForm.h"
#include "ui_EditTableForm.h"
#include "EditFieldForm.h"
#include "EditTableDialog.h"
#include "ui_EditTableDialog.h"
#include "EditFieldDialog.h"
#include <QMessageBox>
#include <QPushButton>
#include "sqlitedb.h"
editTableForm::editTableForm(QWidget* parent)
EditTableDialog::EditTableDialog(QWidget* parent)
: QDialog(parent),
modified(false),
pdb(0),
ui(new Ui::editTableForm)
ui(new Ui::EditTableDialog)
{
ui->setupUi(this);
}
editTableForm::~editTableForm()
EditTableDialog::~EditTableDialog()
{
delete ui;
}
void editTableForm::setActiveTable(DBBrowserDB * thedb, QString tableName)
void EditTableDialog::setActiveTable(DBBrowserDB * thedb, QString tableName)
{
// Set variables
pdb = thedb;
@@ -40,7 +40,7 @@ void editTableForm::setActiveTable(DBBrowserDB * thedb, QString tableName)
checkInput();
}
void editTableForm::populateFields()
void EditTableDialog::populateFields()
{
if (!pdb) return;
@@ -60,7 +60,7 @@ void editTableForm::populateFields()
}
}
void editTableForm::accept()
void EditTableDialog::accept()
{
// Are we editing an already existing table or designing a new one? In the first case there is a table name set,
// in the latter the current table name is empty
@@ -105,7 +105,7 @@ void editTableForm::accept()
QDialog::accept();
}
void editTableForm::reject()
void EditTableDialog::reject()
{
// Have we been in the process of editing an old table?
if(curTable != "")
@@ -117,7 +117,7 @@ void editTableForm::reject()
QDialog::reject();
}
void editTableForm::checkInput()
void EditTableDialog::checkInput()
{
ui->editTableName->setText(ui->editTableName->text().trimmed());
bool valid = true;
@@ -128,14 +128,14 @@ void editTableForm::checkInput()
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(valid);
}
void editTableForm::editField()
void EditTableDialog::editField()
{
if(!ui->treeWidget->currentItem())
return;
// Show the edit dialog
QTreeWidgetItem *item = ui->treeWidget->currentItem();
editFieldForm dialog(this);
EditFieldDialog dialog(this);
dialog.setInitialValues(pdb, curTable == "", curTable, item->text(0), item->text(1));
if(dialog.exec())
{
@@ -145,9 +145,9 @@ void editTableForm::editField()
}
}
void editTableForm::addField()
void EditTableDialog::addField()
{
editFieldForm dialog(this);
EditFieldDialog dialog(this);
dialog.setInitialValues(pdb, true, curTable, QString(""), QString(""));
if(dialog.exec())
{
@@ -160,7 +160,7 @@ void editTableForm::addField()
}
}
void editTableForm::removeField()
void EditTableDialog::removeField()
{
// Is there any item selected to delete?
if(!ui->treeWidget->currentItem())
@@ -193,7 +193,7 @@ void editTableForm::removeField()
checkInput();
}
void editTableForm::fieldSelectionChanged()
void EditTableDialog::fieldSelectionChanged()
{
ui->renameFieldButton->setEnabled(ui->treeWidget->selectionModel()->hasSelection());
ui->removeFieldButton->setEnabled(ui->treeWidget->selectionModel()->hasSelection());

View File

@@ -1,20 +1,20 @@
#ifndef EDITTABLEFORM_H
#define EDITTABLEFORM_H
#ifndef __EDITTABLEDIALOG_H__
#define __EDITTABLEDIALOG_H__
#include <QDialog>
class DBBrowserDB;
namespace Ui {
class editTableForm;
class EditTableDialog;
}
class editTableForm : public QDialog
class EditTableDialog : public QDialog
{
Q_OBJECT
public:
editTableForm(QWidget* parent = 0);
~editTableForm();
EditTableDialog(QWidget* parent = 0);
~EditTableDialog();
bool modified;
QString curTable;
@@ -36,7 +36,7 @@ protected:
DBBrowserDB *pdb;
private:
Ui::editTableForm *ui;
Ui::EditTableDialog *ui;
};
#endif // EDITTABLEFORM_H
#endif

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>editTableForm</class>
<widget class="QDialog" name="editTableForm">
<class>EditTableDialog</class>
<widget class="QDialog" name="EditTableDialog">
<property name="geometry">
<rect>
<x>0</x>
@@ -161,7 +161,7 @@
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>editTableForm</receiver>
<receiver>EditTableDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
@@ -177,7 +177,7 @@
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>editTableForm</receiver>
<receiver>EditTableDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
@@ -193,7 +193,7 @@
<connection>
<sender>treeWidget</sender>
<signal>itemSelectionChanged()</signal>
<receiver>editTableForm</receiver>
<receiver>EditTableDialog</receiver>
<slot>fieldSelectionChanged()</slot>
<hints>
<hint type="sourcelabel">
@@ -209,7 +209,7 @@
<connection>
<sender>addFieldButton</sender>
<signal>clicked()</signal>
<receiver>editTableForm</receiver>
<receiver>EditTableDialog</receiver>
<slot>addField()</slot>
<hints>
<hint type="sourcelabel">
@@ -225,7 +225,7 @@
<connection>
<sender>renameFieldButton</sender>
<signal>clicked()</signal>
<receiver>editTableForm</receiver>
<receiver>EditTableDialog</receiver>
<slot>editField()</slot>
<hints>
<hint type="sourcelabel">
@@ -241,7 +241,7 @@
<connection>
<sender>removeFieldButton</sender>
<signal>clicked()</signal>
<receiver>editTableForm</receiver>
<receiver>EditTableDialog</receiver>
<slot>removeField()</slot>
<hints>
<hint type="sourcelabel">
@@ -257,7 +257,7 @@
<connection>
<sender>editTableName</sender>
<signal>textChanged(QString)</signal>
<receiver>editTableForm</receiver>
<receiver>EditTableDialog</receiver>
<slot>checkInput()</slot>
<hints>
<hint type="sourcelabel">
@@ -273,7 +273,7 @@
<connection>
<sender>treeWidget</sender>
<signal>itemChanged(QTreeWidgetItem*,int)</signal>
<receiver>editTableForm</receiver>
<receiver>EditTableDialog</receiver>
<slot>checkInput()</slot>
<hints>
<hint type="sourcelabel">

View File

@@ -12,12 +12,12 @@
#include <QDragEnterEvent>
#include <QScrollBar>
#include "CreateIndexDialog.h"
#include "DialogAbout.h"
#include "EditTableForm.h"
#include "EditFieldForm.h"
#include "AboutDialog.h"
#include "EditTableDialog.h"
#include "EditFieldDialog.h"
#include "ImportCSVForm.h"
#include "ExportTableCSVForm.h"
#include "PreferencesForm.h"
#include "PreferencesDialog.h"
#include "EditForm.h"
#include "FindForm.h"
#include "SQLLogDock.h"
@@ -551,7 +551,7 @@ void MainWindow::createTable()
return;
}
editTableForm dialog(this);
EditTableDialog dialog(this);
dialog.setActiveTable(&db, "");
if(dialog.exec())
{
@@ -625,7 +625,7 @@ void MainWindow::editTable()
}
QString tableToEdit = ui->dbTreeWidget->currentItem()->text(0);
editTableForm dialog(this);
EditTableDialog dialog(this);
dialog.setActiveTable(&db, tableToEdit);
dialog.exec();
//check modified status
@@ -674,7 +674,7 @@ void MainWindow::helpWhatsThis()
void MainWindow::helpAbout()
{
DialogAbout dialog(this);
AboutDialog dialog(this);
dialog.exec();
}
@@ -1003,7 +1003,7 @@ void MainWindow::importDatabaseFromSQL()
void MainWindow::openPreferences()
{
preferencesForm dialog(this);
PreferencesDialog dialog(this);
if(dialog.exec())
{
updatePreferences();
@@ -1013,7 +1013,7 @@ void MainWindow::openPreferences()
void MainWindow::updatePreferences()
{
preferencesForm prefs(this);
PreferencesDialog prefs(this);
if(prefs.defaultencoding == "Latin1")
db.setEncoding(kEncodingLatin1);
@@ -1086,7 +1086,7 @@ void MainWindow::addField(){
// return;
//}
editFieldForm dialog(this);
EditFieldDialog dialog(this);
dialog.setInitialValues(&db, true, ui->dbTreeWidget->currentItem()->text(0), "", "TEXT");
if(dialog.exec())
populateStructure();
@@ -1097,7 +1097,7 @@ void MainWindow::editField(){
return;
QTreeWidgetItem *item = ui->dbTreeWidget->currentItem();
editFieldForm dialog(this);
EditFieldDialog dialog(this);
dialog.setInitialValues(&db, false, item->parent()->text(0), item->text(0), item->text(2));
if(dialog.exec())
{

View File

@@ -1,13 +1,13 @@
#include "PreferencesForm.h"
#include "ui_PreferencesForm.h"
#include "PreferencesDialog.h"
#include "ui_PreferencesDialog.h"
#include <QDir>
#include <QSettings>
#include <QFileDialog>
#include "sqlitedb.h"
preferencesForm::preferencesForm(QWidget* parent)
PreferencesDialog::PreferencesDialog(QWidget* parent)
: QDialog(parent),
ui(new Ui::preferencesForm)
ui(new Ui::PreferencesDialog)
{
ui->setupUi(this);
@@ -17,12 +17,12 @@ preferencesForm::preferencesForm(QWidget* parent)
/*
* Destroys the object and frees any allocated resources
*/
preferencesForm::~preferencesForm()
PreferencesDialog::~PreferencesDialog()
{
delete ui;
}
void preferencesForm::defaultDataChanged( int which )
void PreferencesDialog::defaultDataChanged( int which )
{
if (which==2) {
defaultnewdata = QString("\'\'");
@@ -33,7 +33,7 @@ void preferencesForm::defaultDataChanged( int which )
}
}
void preferencesForm::defaultTextChanged( int which )
void PreferencesDialog::defaultTextChanged( int which )
{
if (which==1) {
defaulttext = QString("Auto");
@@ -43,7 +43,7 @@ void preferencesForm::defaultTextChanged( int which )
}
void preferencesForm::encodingChanged( int which )
void PreferencesDialog::encodingChanged( int which )
{
if (which==1) {
defaultencoding = QString("Latin1");
@@ -52,7 +52,7 @@ void preferencesForm::encodingChanged( int which )
}
}
void preferencesForm::chooseLocation()
void PreferencesDialog::chooseLocation()
{
QString s = QFileDialog::getExistingDirectory(
this,
@@ -67,7 +67,7 @@ void preferencesForm::chooseLocation()
}
}
void preferencesForm::loadSettings()
void PreferencesDialog::loadSettings()
{
QSettings settings(QApplication::organizationName(), g_sApplicationNameShort);
settings.sync();
@@ -107,7 +107,7 @@ void preferencesForm::loadSettings()
ui->locationEdit->setText(defaultlocation);
}
void preferencesForm::saveSettings()
void PreferencesDialog::saveSettings()
{
QSettings settings(QApplication::organizationName(), g_sApplicationNameShort);

View File

@@ -1,19 +1,19 @@
#ifndef PREFERENCESFORM_H
#define PREFERENCESFORM_H
#ifndef __PREFERENCESDIALOG_H__
#define __PREFERENCESDIALOG_H__
#include <QDialog>
namespace Ui {
class preferencesForm;
class PreferencesDialog;
}
class preferencesForm : public QDialog
class PreferencesDialog : public QDialog
{
Q_OBJECT
public:
preferencesForm(QWidget* parent = 0);
~preferencesForm();
PreferencesDialog(QWidget* parent = 0);
~PreferencesDialog();
QString defaulttext;
QString defaultlocation;
@@ -29,7 +29,7 @@ public slots:
virtual void saveSettings();
private:
Ui::preferencesForm *ui;
Ui::PreferencesDialog *ui;
};
#endif // PREFERENCESFORM_H
#endif

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>preferencesForm</class>
<widget class="QDialog" name="preferencesForm">
<class>PreferencesDialog</class>
<widget class="QDialog" name="PreferencesDialog">
<property name="geometry">
<rect>
<x>0</x>
@@ -154,7 +154,7 @@
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>preferencesForm</receiver>
<receiver>PreferencesDialog</receiver>
<slot>saveSettings()</slot>
<hints>
<hint type="sourcelabel">
@@ -170,7 +170,7 @@
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>preferencesForm</receiver>
<receiver>PreferencesDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
@@ -186,7 +186,7 @@
<connection>
<sender>encodingComboBox</sender>
<signal>activated(int)</signal>
<receiver>preferencesForm</receiver>
<receiver>PreferencesDialog</receiver>
<slot>encodingChanged(int)</slot>
<hints>
<hint type="sourcelabel">
@@ -202,7 +202,7 @@
<connection>
<sender>defaultdataComboBox</sender>
<signal>activated(int)</signal>
<receiver>preferencesForm</receiver>
<receiver>PreferencesDialog</receiver>
<slot>defaultDataChanged(int)</slot>
<hints>
<hint type="sourcelabel">
@@ -218,7 +218,7 @@
<connection>
<sender>setLocationButton</sender>
<signal>clicked()</signal>
<receiver>preferencesForm</receiver>
<receiver>PreferencesDialog</receiver>
<slot>chooseLocation()</slot>
<hints>
<hint type="sourcelabel">
@@ -234,7 +234,7 @@
<connection>
<sender>defaultTextComboBox</sender>
<signal>activated(int)</signal>
<receiver>preferencesForm</receiver>
<receiver>PreferencesDialog</receiver>
<slot>defaultTextChanged(int)</slot>
<hints>
<hint type="sourcelabel">

View File

@@ -14,17 +14,17 @@ HEADERS += \
sqlitedb.h \
sqlbrowser_util.h \
SQLLogDock.h \
DialogAbout.h \
EditFieldForm.h \
EditForm.h \
EditTableForm.h \
ExportTableCSVForm.h \
FindForm.h \
ImportCSVForm.h \
MainWindow.h \
PreferencesForm.h \
SQLiteSyntaxHighlighter.h \
CreateIndexDialog.h
CreateIndexDialog.h \
EditFieldDialog.h \
AboutDialog.h \
EditTableDialog.h \
PreferencesDialog.h
SOURCES += \
sqlitedb.cpp \
@@ -32,16 +32,16 @@ SOURCES += \
SQLLogDock.cpp \
main.cpp \
DialogAbout.cpp \
EditFieldForm.cpp \
EditForm.cpp \
EditTableForm.cpp \
ExportTableCSVForm.cpp \
FindForm.cpp \
ImportCSVForm.cpp \
MainWindow.cpp \
PreferencesForm.cpp \
SQLiteSyntaxHighlighter.cpp \
CreateIndexDialog.cpp
CreateIndexDialog.cpp \
EditFieldDialog.cpp \
EditTableDialog.cpp \
PreferencesDialog.cpp
QMAKE_CXXFLAGS += -DAPP_VERSION=\\\"`cd $$PWD;git log -n1 --format=%h_git`\\\"
@@ -63,9 +63,9 @@ mac {
RESOURCES += icons/icons.qrc
FORMS += \
DialogAbout.ui \
EditFieldForm.ui \
EditTableForm.ui \
MainWindow.ui \
PreferencesForm.ui \
CreateIndexDialog.ui
CreateIndexDialog.ui \
AboutDialog.ui \
EditFieldDialog.ui \
EditTableDialog.ui \
PreferencesDialog.ui