Skip to content

Commit

Permalink
Rename ExportCsvDialog to ExportData dialog
Browse files Browse the repository at this point in the history
Sorry for the big change but I think it's preferable to not call it CSV
dialog when it's not just doing CSV.
  • Loading branch information
MKleusberg committed Aug 25, 2016
1 parent 3ef9491 commit a1e08b3
Show file tree
Hide file tree
Showing 18 changed files with 304 additions and 304 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ set(SQLB_MOC_HDR
src/CreateIndexDialog.h
src/EditDialog.h
src/EditTableDialog.h
src/ExportCsvDialog.h
src/ExportDataDialog.h
src/ExtendedTableWidget.h
src/FilterTableHeader.h
src/ImportCsvDialog.h
Expand All @@ -96,7 +96,7 @@ set(SQLB_SRC
src/CreateIndexDialog.cpp
src/EditDialog.cpp
src/EditTableDialog.cpp
src/ExportCsvDialog.cpp
src/ExportDataDialog.cpp
src/ExtendedTableWidget.cpp
src/FilterTableHeader.cpp
src/ImportCsvDialog.cpp
Expand Down Expand Up @@ -127,7 +127,7 @@ set(SQLB_FORMS
src/CreateIndexDialog.ui
src/EditDialog.ui
src/EditTableDialog.ui
src/ExportCsvDialog.ui
src/ExportDataDialog.ui
src/ImportCsvDialog.ui
src/MainWindow.ui
src/PreferencesDialog.ui
Expand Down
32 changes: 16 additions & 16 deletions src/ExportCsvDialog.cpp → src/ExportDataDialog.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ExportCsvDialog.h"
#include "ui_ExportCsvDialog.h"
#include "ExportDataDialog.h"
#include "ui_ExportDataDialog.h"
#include "sqlitedb.h"
#include "PreferencesDialog.h"
#include "sqlitetablemodel.h"
Expand All @@ -15,9 +15,9 @@
#include <QJsonObject>
#endif

ExportCsvDialog::ExportCsvDialog(DBBrowserDB* db, ExportFormats format, QWidget* parent, const QString& query, const QString& selection)
ExportDataDialog::ExportDataDialog(DBBrowserDB* db, ExportFormats format, QWidget* parent, const QString& query, const QString& selection)
: QDialog(parent),
ui(new Ui::ExportCsvDialog),
ui(new Ui::ExportDataDialog),
pdb(db),
m_format(format),
m_sQuery(query)
Expand Down Expand Up @@ -64,12 +64,12 @@ ExportCsvDialog::ExportCsvDialog(DBBrowserDB* db, ExportFormats format, QWidget*
}
}

ExportCsvDialog::~ExportCsvDialog()
ExportDataDialog::~ExportDataDialog()
{
delete ui;
}

bool ExportCsvDialog::exportQuery(const QString& sQuery, const QString& sFilename)
bool ExportDataDialog::exportQuery(const QString& sQuery, const QString& sFilename)
{
switch(m_format)
{
Expand All @@ -82,7 +82,7 @@ bool ExportCsvDialog::exportQuery(const QString& sQuery, const QString& sFilenam
}
}

bool ExportCsvDialog::exportQueryCsv(const QString& sQuery, const QString& sFilename)
bool ExportDataDialog::exportQueryCsv(const QString& sQuery, const QString& sFilename)
{
// Prepare the quote and separating characters
QChar quoteChar = currentQuoteChar();
Expand Down Expand Up @@ -171,7 +171,7 @@ bool ExportCsvDialog::exportQueryCsv(const QString& sQuery, const QString& sFile
return true;
}

bool ExportCsvDialog::exportQueryJson(const QString& sQuery, const QString& sFilename)
bool ExportDataDialog::exportQueryJson(const QString& sQuery, const QString& sFilename)
{
#if QT_VERSION_MAJOR < 5
return false;
Expand Down Expand Up @@ -239,7 +239,7 @@ bool ExportCsvDialog::exportQueryJson(const QString& sQuery, const QString& sFil
#endif
}

void ExportCsvDialog::accept()
void ExportDataDialog::accept()
{
QString file_dialog_filter;
QString default_file_extension;
Expand Down Expand Up @@ -336,7 +336,7 @@ void ExportCsvDialog::accept()
QDialog::accept();
}

void ExportCsvDialog::showCustomCharEdits()
void ExportDataDialog::showCustomCharEdits()
{
// Retrieve selection info for the quote, separator, and newline widgets
int quoteIndex = ui->comboQuoteCharacter->currentIndex();
Expand All @@ -357,7 +357,7 @@ void ExportCsvDialog::showCustomCharEdits()
ui->editCustomNewLine->setVisible(newLineVisible);
}

void ExportCsvDialog::setQuoteChar(const QChar& c)
void ExportDataDialog::setQuoteChar(const QChar& c)
{
QComboBox* combo = ui->comboQuoteCharacter;

Expand Down Expand Up @@ -387,7 +387,7 @@ void ExportCsvDialog::setQuoteChar(const QChar& c)
}
}

char ExportCsvDialog::currentQuoteChar() const
char ExportDataDialog::currentQuoteChar() const
{
QComboBox* combo = ui->comboQuoteCharacter;

Expand Down Expand Up @@ -416,7 +416,7 @@ char ExportCsvDialog::currentQuoteChar() const
}
}

void ExportCsvDialog::setSeparatorChar(const QChar& c)
void ExportDataDialog::setSeparatorChar(const QChar& c)
{
QComboBox* combo = ui->comboFieldSeparator;

Expand Down Expand Up @@ -452,7 +452,7 @@ void ExportCsvDialog::setSeparatorChar(const QChar& c)
}
}

char ExportCsvDialog::currentSeparatorChar() const
char ExportDataDialog::currentSeparatorChar() const
{
QComboBox* combo = ui->comboFieldSeparator;

Expand Down Expand Up @@ -484,7 +484,7 @@ char ExportCsvDialog::currentSeparatorChar() const
}
}

void ExportCsvDialog::setNewLineString(const QString& s)
void ExportDataDialog::setNewLineString(const QString& s)
{
QComboBox* combo = ui->comboNewLineString;

Expand All @@ -503,7 +503,7 @@ void ExportCsvDialog::setNewLineString(const QString& s)
}
}

QString ExportCsvDialog::currentNewLineString() const
QString ExportDataDialog::currentNewLineString() const
{
QComboBox* combo = ui->comboNewLineString;

Expand Down
14 changes: 7 additions & 7 deletions src/ExportCsvDialog.h → src/ExportDataDialog.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#ifndef EXPORTCSVDIALOG_H
#define EXPORTCSVDIALOG_H
#ifndef ExportDataDialog_H
#define ExportDataDialog_H

#include <QDialog>

class DBBrowserDB;

namespace Ui {
class ExportCsvDialog;
class ExportDataDialog;
}

class ExportCsvDialog : public QDialog
class ExportDataDialog : public QDialog
{
Q_OBJECT

Expand All @@ -20,8 +20,8 @@ class ExportCsvDialog : public QDialog
ExportFormatJson,
};

explicit ExportCsvDialog(DBBrowserDB* db, ExportFormats format, QWidget* parent = 0, const QString& query = "", const QString& selection = "");
~ExportCsvDialog();
explicit ExportDataDialog(DBBrowserDB* db, ExportFormats format, QWidget* parent = 0, const QString& query = "", const QString& selection = "");
~ExportDataDialog();

private slots:
virtual void accept();
Expand All @@ -42,7 +42,7 @@ private slots:
bool exportQueryJson(const QString& sQuery, const QString& sFilename);

private:
Ui::ExportCsvDialog* ui;
Ui::ExportDataDialog* ui;
DBBrowserDB* pdb;

ExportFormats m_format;
Expand Down
14 changes: 7 additions & 7 deletions src/ExportCsvDialog.ui → src/ExportDataDialog.ui
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ExportCsvDialog</class>
<widget class="QDialog" name="ExportCsvDialog">
<class>ExportDataDialog</class>
<widget class="QDialog" name="ExportDataDialog">
<property name="geometry">
<rect>
<x>0</x>
Expand Down Expand Up @@ -324,7 +324,7 @@
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>ExportCsvDialog</receiver>
<receiver>ExportDataDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
Expand All @@ -340,7 +340,7 @@
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ExportCsvDialog</receiver>
<receiver>ExportDataDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
Expand All @@ -356,7 +356,7 @@
<connection>
<sender>comboFieldSeparator</sender>
<signal>currentIndexChanged(int)</signal>
<receiver>ExportCsvDialog</receiver>
<receiver>ExportDataDialog</receiver>
<slot>showCustomCharEdits()</slot>
<hints>
<hint type="sourcelabel">
Expand All @@ -372,7 +372,7 @@
<connection>
<sender>comboQuoteCharacter</sender>
<signal>currentIndexChanged(int)</signal>
<receiver>ExportCsvDialog</receiver>
<receiver>ExportDataDialog</receiver>
<slot>showCustomCharEdits()</slot>
<hints>
<hint type="sourcelabel">
Expand All @@ -388,7 +388,7 @@
<connection>
<sender>comboNewLineString</sender>
<signal>currentIndexChanged(int)</signal>
<receiver>ExportCsvDialog</receiver>
<receiver>ExportDataDialog</receiver>
<slot>showCustomCharEdits()</slot>
<hints>
<hint type="sourcelabel">
Expand Down
6 changes: 3 additions & 3 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "AboutDialog.h"
#include "EditTableDialog.h"
#include "ImportCsvDialog.h"
#include "ExportCsvDialog.h"
#include "ExportDataDialog.h"
#include "PreferencesDialog.h"
#include "EditDialog.h"
#include "sqlitetablemodel.h"
Expand Down Expand Up @@ -1066,7 +1066,7 @@ void MainWindow::exportTableToCSV()
current_table = ui->comboBrowseTable->currentText();

// Open dialog
ExportCsvDialog dialog(&db, ExportCsvDialog::ExportFormatCsv, this, "", current_table);
ExportDataDialog dialog(&db, ExportDataDialog::ExportFormatCsv, this, "", current_table);
dialog.exec();
}

Expand All @@ -1083,7 +1083,7 @@ void MainWindow::exportTableToJson()
current_table = ui->comboBrowseTable->currentText();

// Open dialog
ExportCsvDialog dialog(&db, ExportCsvDialog::ExportFormatJson, this, "", current_table);
ExportDataDialog dialog(&db, ExportDataDialog::ExportFormatJson, this, "", current_table);
dialog.exec();
}

Expand Down
4 changes: 2 additions & 2 deletions src/SqlExecutionArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "sqlitetablemodel.h"
#include "sqlitedb.h"
#include "PreferencesDialog.h"
#include "ExportCsvDialog.h"
#include "ExportDataDialog.h"

#include <QMenu>
#include <QInputDialog>
Expand Down Expand Up @@ -84,7 +84,7 @@ void SqlExecutionArea::enableSaveButton(bool enable)

void SqlExecutionArea::saveAsCsv()
{
ExportCsvDialog dialog(db, ExportCsvDialog::ExportFormatCsv, this, model->query());
ExportDataDialog dialog(db, ExportDataDialog::ExportFormatCsv, this, model->query());
dialog.exec();
}

Expand Down
6 changes: 3 additions & 3 deletions src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ HEADERS += \
EditTableDialog.h \
PreferencesDialog.h \
EditDialog.h \
ExportCsvDialog.h \
ExportDataDialog.h \
ImportCsvDialog.h \
sqltextedit.h \
sqlitetypes.h \
Expand Down Expand Up @@ -63,7 +63,7 @@ SOURCES += \
PreferencesDialog.cpp \
AboutDialog.cpp \
EditDialog.cpp \
ExportCsvDialog.cpp \
ExportDataDialog.cpp \
ImportCsvDialog.cpp \
sqltextedit.cpp \
sqlitetypes.cpp \
Expand Down Expand Up @@ -95,7 +95,7 @@ FORMS += \
EditTableDialog.ui \
PreferencesDialog.ui \
EditDialog.ui \
ExportCsvDialog.ui \
ExportDataDialog.ui \
ImportCsvDialog.ui \
SqlExecutionArea.ui \
VacuumDialog.ui \
Expand Down
Loading

0 comments on commit a1e08b3

Please sign in to comment.