Commit 654f8da8 authored by Christoph Cullmann's avatar Christoph Cullmann

kate sql is back

parent f2f64604
......@@ -34,7 +34,7 @@ include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core DBus Widgets Script Test)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core DBus Widgets Script Sql Test)
# Load the frameworks we need
find_package(KF5 CONFIG REQUIRED COMPONENTS
......
......@@ -43,7 +43,7 @@ add_subdirectory( kate-ctags )
#add_subdirectory( tabify )
#add_subdirectory( katesql )
ecm_optional_add_subdirectory ( katesql )
#add_subdirectory( close-except-like )
......
......@@ -66,7 +66,7 @@ ExportOutputPage::ExportOutputPage(QWidget *parent)
fileUrl = new KUrlRequester(this);
fileUrl->setMode(KFile::File);
fileUrl->setFilter("*.csv|Comma Separated Values\n*|All files");
fileUrl->setFilter(i18n("*.csv|Comma Separated Values\n*|All files"));
fileLayout->addWidget(fileUrl);
......@@ -77,10 +77,10 @@ ExportOutputPage::ExportOutputPage(QWidget *parent)
setLayout(layout);
registerField("outDocument", documentRadioButton);
registerField("outClipboard", clipboardRadioButton);
registerField("outFile", fileRadioButton);
registerField("outFileUrl", fileUrl, "text");
registerField(QLatin1String("outDocument"), documentRadioButton);
registerField(QLatin1String("outClipboard"), clipboardRadioButton);
registerField(QLatin1String("outFile"), fileRadioButton);
registerField(QLatin1String("outFileUrl"), fileUrl, "text");
connect(fileRadioButton, SIGNAL(toggled(bool)), fileUrl, SLOT(setEnabled(bool)));
}
......@@ -165,13 +165,13 @@ ExportFormatPage::ExportFormatPage(QWidget *parent)
setLayout(layout);
registerField("exportColumnNames", exportColumnNamesCheckBox);
registerField("exportLineNumbers", exportLineNumbersCheckBox);
registerField("checkQuoteStrings", quoteStringsCheckBox);
registerField("checkQuoteNumbers", quoteNumbersCheckBox);
registerField("quoteStringsChar", quoteStringsLine);
registerField("quoteNumbersChar", quoteNumbersLine);
registerField("fieldDelimiter*", fieldDelimiterLine);
registerField(QLatin1String("exportColumnNames"), exportColumnNamesCheckBox);
registerField(QLatin1String("exportLineNumbers"), exportLineNumbersCheckBox);
registerField(QLatin1String("checkQuoteStrings"), quoteStringsCheckBox);
registerField(QLatin1String("checkQuoteNumbers"), quoteNumbersCheckBox);
registerField(QLatin1String("quoteStringsChar"), quoteStringsLine);
registerField(QLatin1String("quoteNumbersChar"), quoteNumbersLine);
registerField(QLatin1String("fieldDelimiter*"), fieldDelimiterLine);
connect(quoteStringsCheckBox, SIGNAL(toggled(bool)), quoteStringsLine, SLOT(setEnabled(bool)));
connect(quoteNumbersCheckBox, SIGNAL(toggled(bool)), quoteNumbersLine, SLOT(setEnabled(bool)));
......@@ -187,9 +187,9 @@ void ExportFormatPage::initializePage()
quoteStringsLine->setEnabled(false);
quoteNumbersLine->setEnabled(false);
quoteStringsLine->setText("\"");
quoteNumbersLine->setText("\"");
fieldDelimiterLine->setText("\\t");
quoteStringsLine->setText(QLatin1String("\""));
quoteNumbersLine->setText(QLatin1String("\""));
fieldDelimiterLine->setText(QLatin1String("\\t"));
}
......
[Desktop Entry]
Type=Service
ServiceTypes=Kate/Plugin
ServiceTypes=KTextEditor/Plugin
X-KDE-Library=katesqlplugin
X-Kate-Version=3.0
Name=SQL Plugin
Name[ast]=Complementu SQL
Name[bg]=Приставка за SQL
......
......@@ -21,6 +21,7 @@
#include <kconfiggroup.h>
#include <klocalizedstring.h>
#include <KSharedConfig>
#include <qboxlayout.h>
#include <qgroupbox.h>
......@@ -59,7 +60,7 @@ KateSQLConfigPage::~KateSQLConfigPage()
void KateSQLConfigPage::apply()
{
KConfigGroup config(KGlobal::config(), "KateSQLPlugin");
KConfigGroup config(KSharedConfig::openConfig(), "KateSQLPlugin");
config.writeEntry("SaveConnections", m_box->isChecked());
......@@ -73,7 +74,7 @@ void KateSQLConfigPage::apply()
void KateSQLConfigPage::reset()
{
KConfigGroup config(KGlobal::config(), "KateSQLPlugin");
KConfigGroup config(KSharedConfig::openConfig(), "KateSQLPlugin");
m_box->setChecked(config.readEntry("SaveConnections", true));
......@@ -83,7 +84,7 @@ void KateSQLConfigPage::reset()
void KateSQLConfigPage::defaults()
{
KConfigGroup config(KGlobal::config(), "KateSQLPlugin");
KConfigGroup config(KSharedConfig::openConfig(), "KateSQLPlugin");
config.revertToDefault("SaveConnections");
config.revertToDefault("OutputCustomization");
......
......@@ -22,13 +22,14 @@
#include <qfont.h>
#include <qbrush.h>
#include <qvariant.h>
#include <QIcon>
#include <QFontDatabase>
#include <KSharedConfig>
#include <kcolorbutton.h>
#include <kicon.h>
#include <klocalizedstring.h>
#include <kconfig.h>
#include <kconfiggroup.h>
#include <kglobalsettings.h>
#include <kcolorscheme.h>
OutputStyleWidget::OutputStyleWidget(QWidget *parent)
......@@ -45,17 +46,17 @@ OutputStyleWidget::OutputStyleWidget(QWidget *parent)
setHeaderLabels(headerLabels);
headerItem()->setIcon(1, KIcon("format-text-bold"));
headerItem()->setIcon(2, KIcon("format-text-italic"));
headerItem()->setIcon(3, KIcon("format-text-underline"));
headerItem()->setIcon(4, KIcon("format-text-strikethrough"));
headerItem()->setIcon(1, QIcon::fromTheme(QLatin1String("format-text-bold")));
headerItem()->setIcon(2, QIcon::fromTheme(QLatin1String("format-text-italic")));
headerItem()->setIcon(3, QIcon::fromTheme(QLatin1String("format-text-underline")));
headerItem()->setIcon(4, QIcon::fromTheme(QLatin1String("format-text-strikethrough")));
addContext("text", i18nc("@item:intable", "Text"));
addContext("number", i18nc("@item:intable", "Number"));
addContext("bool", i18nc("@item:intable", "Bool"));
addContext("datetime", i18nc("@item:intable", "Date & Time"));
addContext("null", i18nc("@item:intable", "NULL"));
addContext("blob", i18nc("@item:intable", "BLOB"));
addContext(QLatin1String("text"), i18nc("@item:intable", "Text"));
addContext(QLatin1String("number"), i18nc("@item:intable", "Number"));
addContext(QLatin1String("bool"), i18nc("@item:intable", "Bool"));
addContext(QLatin1String("datetime"), i18nc("@item:intable", "Date & Time"));
addContext(QLatin1String("null"), i18nc("@item:intable", "NULL"));
addContext(QLatin1String("blob"), i18nc("@item:intable", "BLOB"));
for (int i = 0; i < columnCount(); ++i)
resizeColumnToContents(i);
......@@ -110,7 +111,7 @@ QTreeWidgetItem* OutputStyleWidget::addContext(const QString &key, const QString
void OutputStyleWidget::readConfig(QTreeWidgetItem *item)
{
KConfigGroup config(KGlobal::config(), "KateSQLPlugin");
KConfigGroup config(KSharedConfig::openConfig(), "KateSQLPlugin");
KConfigGroup g = config.group("OutputCustomization").group(item->data(0, Qt::UserRole).toString());
QCheckBox *boldCheckBox = static_cast<QCheckBox*>(itemWidget(item, 1));
......@@ -134,7 +135,7 @@ void OutputStyleWidget::readConfig(QTreeWidgetItem *item)
void OutputStyleWidget::writeConfig(QTreeWidgetItem *item)
{
KConfigGroup config(KGlobal::config(), "KateSQLPlugin");
KConfigGroup config(KSharedConfig::openConfig(), "KateSQLPlugin");
KConfigGroup g = config.group("OutputCustomization").group(item->data(0, Qt::UserRole).toString());
......@@ -169,7 +170,7 @@ void OutputStyleWidget::readConfig()
void OutputStyleWidget::writeConfig()
{
KConfigGroup config(KGlobal::config(), "KateSQLPlugin");
KConfigGroup config(KSharedConfig::openConfig(), "KateSQLPlugin");
config.deleteGroup("OutputCustomization");
QTreeWidgetItem *root = invisibleRootItem();
......
......@@ -29,9 +29,9 @@ KateSQLOutputWidget::KateSQLOutputWidget (QWidget *parent)
{
addTab (m_textOutputWidget=new TextOutputWidget (this),
SmallIcon("view-list-text"), i18nc("@title:window", "SQL Text Output"));
QIcon::fromTheme(QLatin1String("view-list-text")), i18nc("@title:window", "SQL Text Output"));
addTab (m_dataOutputWidget=new DataOutputWidget(this),
SmallIcon("view-form-table"),i18nc("@title:window", "SQL Data Output"));
QIcon::fromTheme(QLatin1String("view-form-table")),i18nc("@title:window", "SQL Data Output"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment