sqlitebrowser-2.0.0~beta1+ds.1/0000755000175000017500000000000011556107265016512 5ustar lisandrolisandrosqlitebrowser-2.0.0~beta1+ds.1/addfieldform.h0000644000175000017500000001510511304272743021300 0ustar lisandrolisandro#ifndef ADDFIELDFORM_H #define ADDFIELDFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE class Ui_addFieldForm { public: QGridLayout *gridLayout; QSpacerItem *spacer17; QHBoxLayout *hboxLayout; QSpacerItem *spacer15; QPushButton *cancelButton; QPushButton *createButton; QVBoxLayout *vboxLayout; QLabel *textLabel1; QLabel *textLabel2; QVBoxLayout *vboxLayout1; QLineEdit *nameLineEdit; QHBoxLayout *hboxLayout1; QComboBox *typeBox; QToolButton *typeButton; void setupUi(QDialog *addFieldForm) { if (addFieldForm->objectName().isEmpty()) addFieldForm->setObjectName(QString::fromUtf8("addFieldForm")); addFieldForm->resize(338, 136); gridLayout = new QGridLayout(addFieldForm); gridLayout->setSpacing(6); gridLayout->setContentsMargins(11, 11, 11, 11); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); spacer17 = new QSpacerItem(20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding); gridLayout->addItem(spacer17, 1, 1, 1, 1); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); spacer15 = new QSpacerItem(41, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacer15); cancelButton = new QPushButton(addFieldForm); cancelButton->setObjectName(QString::fromUtf8("cancelButton")); hboxLayout->addWidget(cancelButton); createButton = new QPushButton(addFieldForm); createButton->setObjectName(QString::fromUtf8("createButton")); createButton->setDefault(true); hboxLayout->addWidget(createButton); gridLayout->addLayout(hboxLayout, 2, 0, 1, 2); vboxLayout = new QVBoxLayout(); vboxLayout->setSpacing(6); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); textLabel1 = new QLabel(addFieldForm); textLabel1->setObjectName(QString::fromUtf8("textLabel1")); textLabel1->setWordWrap(false); vboxLayout->addWidget(textLabel1); textLabel2 = new QLabel(addFieldForm); textLabel2->setObjectName(QString::fromUtf8("textLabel2")); textLabel2->setWordWrap(false); vboxLayout->addWidget(textLabel2); gridLayout->addLayout(vboxLayout, 0, 0, 1, 1); vboxLayout1 = new QVBoxLayout(); vboxLayout1->setSpacing(6); vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); nameLineEdit = new QLineEdit(addFieldForm); nameLineEdit->setObjectName(QString::fromUtf8("nameLineEdit")); vboxLayout1->addWidget(nameLineEdit); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); typeBox = new QComboBox(addFieldForm); typeBox->setObjectName(QString::fromUtf8("typeBox")); hboxLayout1->addWidget(typeBox); typeButton = new QToolButton(addFieldForm); typeButton->setObjectName(QString::fromUtf8("typeButton")); QSizePolicy sizePolicy(static_cast(0), static_cast(0)); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(typeButton->sizePolicy().hasHeightForWidth()); typeButton->setSizePolicy(sizePolicy); hboxLayout1->addWidget(typeButton); vboxLayout1->addLayout(hboxLayout1); gridLayout->addLayout(vboxLayout1, 0, 1, 1, 1); retranslateUi(addFieldForm); QObject::connect(cancelButton, SIGNAL(clicked()), addFieldForm, SLOT(reject())); QObject::connect(createButton, SIGNAL(clicked()), addFieldForm, SLOT(confirmAddField())); QObject::connect(typeButton, SIGNAL(clicked()), addFieldForm, SLOT(getCustomType())); QMetaObject::connectSlotsByName(addFieldForm); } // setupUi void retranslateUi(QDialog *addFieldForm) { addFieldForm->setWindowTitle(QApplication::translate("addFieldForm", "Add database field", 0, QApplication::UnicodeUTF8)); cancelButton->setText(QApplication::translate("addFieldForm", "Cancel", 0, QApplication::UnicodeUTF8)); createButton->setText(QApplication::translate("addFieldForm", "Create", 0, QApplication::UnicodeUTF8)); textLabel1->setText(QApplication::translate("addFieldForm", "Field name:", 0, QApplication::UnicodeUTF8)); textLabel2->setText(QApplication::translate("addFieldForm", "Field type:", 0, QApplication::UnicodeUTF8)); typeBox->clear(); typeBox->insertItems(0, QStringList() << QString() << QApplication::translate("addFieldForm", "TEXT", 0, QApplication::UnicodeUTF8) << QApplication::translate("addFieldForm", "NUMERIC", 0, QApplication::UnicodeUTF8) << QApplication::translate("addFieldForm", "BLOB", 0, QApplication::UnicodeUTF8) << QApplication::translate("addFieldForm", "INTEGER PRIMARY KEY", 0, QApplication::UnicodeUTF8) ); typeButton->setText(QApplication::translate("addFieldForm", "...", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP typeButton->setProperty("toolTip", QVariant(QApplication::translate("addFieldForm", "Custom type", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS typeButton->setProperty("whatsThis", QVariant(QApplication::translate("addFieldForm", "Click this button to enter a new type for the field", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS } // retranslateUi }; namespace Ui { class addFieldForm: public Ui_addFieldForm {}; } // namespace Ui QT_END_NAMESPACE class addFieldForm : public QDialog, public Ui::addFieldForm { Q_OBJECT public: addFieldForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~addFieldForm(); QString fname; QString ftype; public slots: virtual void setInitialValues( QString name, QString type ); virtual void confirmAddField(); virtual void getCustomType(); protected slots: virtual void languageChange(); }; #endif // ADDFIELDFORM_H sqlitebrowser-2.0.0~beta1+ds.1/sqlitebrowser.pro0000644000175000017500000000343711310213640022127 0ustar lisandrolisandroQT += qt3support TEMPLATE = app LANGUAGE = C++ INCLUDEPATH += sqlite_source/ CONFIG += qt \ warn_on HEADERS += extendedmainform.h \ sqlitebrowsertypes.h \ sqlitedb.h \ sqlbrowser_util.h \ sqlite_source/sqlite3.h \ aboutform.h \ addfieldform.h \ addfieldtypeform.h \ choosetableform.h \ createindexform.h \ createtableform.h \ deleteindexform.h \ deletetableform.h \ editfieldform.h \ editform.h \ editformwindow.h \ edittableform.h \ exporttablecsvform.h \ findform.h \ form1.h \ importcsvform.h \ renametableform.h \ sqllogform.h \ preferencesform.h SOURCES += extendedmainform.cpp \ browsermain.cpp \ sqlitedb.cpp \ sqlbrowser_util.c \ sqlite_source/sqlite3.c \ aboutform.cpp \ addfieldform.cpp \ addfieldtypeform.cpp \ choosetableform.cpp \ createindexform.cpp \ createtableform.cpp \ deleteindexform.cpp \ deletetableform.cpp \ editfieldform.cpp \ editform.cpp \ editformwindow.cpp \ edittableform.cpp \ exporttablecsvform.cpp \ findform.cpp \ form1.cpp \ importcsvform.cpp \ renametableform.cpp \ sqllogform.cpp \ preferencesform.cpp IMAGES = images/create_index.png \ images/create_table.png \ images/delete_index.png \ images/delete_table.png \ images/icone16.png \ images/log.png \ images/modify_table.png \ images/new.png \ images/open.png \ images/revert.png \ images/save.png \ images/searchfind.png \ images/whatis.png \ images/128.png unix { UI_DIR = .ui MOC_DIR = .moc OBJECTS_DIR = .obj } win32:RC_FILE = winapp.rc mac { RC_FILE = macapp.icns LIBS += -framework \ Carbon QMAKE_INFO_PLIST = app.plist CONFIG += x86 \ ppc } sqlitebrowser-2.0.0~beta1+ds.1/createindexform.h0000644000175000017500000002625111304272743022043 0ustar lisandrolisandro#ifndef CREATEINDEXFORM_H #define CREATEINDEXFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "sqlitedb.h" QT_BEGIN_NAMESPACE class Ui_createIndexForm { public: QVBoxLayout *vboxLayout; QHBoxLayout *hboxLayout; QLabel *textLabel2; QLineEdit *indexLineEdit; Q3GroupBox *groupBox2; QGridLayout *gridLayout; QVBoxLayout *vboxLayout1; QComboBox *comboTables; QComboBox *comboFields; QComboBox *comboOrder; QComboBox *comboUnique; QVBoxLayout *vboxLayout2; QLabel *textLabel3; QLabel *textLabel4; QLabel *textLabel5; QLabel *textLabel6; QHBoxLayout *hboxLayout1; QSpacerItem *spacer8; QPushButton *buttonCreate; QPushButton *buttonCancel; void setupUi(QDialog *createIndexForm) { if (createIndexForm->objectName().isEmpty()) createIndexForm->setObjectName(QString::fromUtf8("createIndexForm")); createIndexForm->resize(300, 258); vboxLayout = new QVBoxLayout(createIndexForm); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); textLabel2 = new QLabel(createIndexForm); textLabel2->setObjectName(QString::fromUtf8("textLabel2")); textLabel2->setWordWrap(false); hboxLayout->addWidget(textLabel2); indexLineEdit = new QLineEdit(createIndexForm); indexLineEdit->setObjectName(QString::fromUtf8("indexLineEdit")); hboxLayout->addWidget(indexLineEdit); vboxLayout->addLayout(hboxLayout); groupBox2 = new Q3GroupBox(createIndexForm); groupBox2->setObjectName(QString::fromUtf8("groupBox2")); groupBox2->setColumnLayout(0, Qt::Vertical); groupBox2->layout()->setSpacing(6); groupBox2->layout()->setContentsMargins(11, 11, 11, 11); gridLayout = new QGridLayout(); QBoxLayout *boxlayout = qobject_cast(groupBox2->layout()); if (boxlayout) boxlayout->addLayout(gridLayout); gridLayout->setAlignment(Qt::AlignTop); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); vboxLayout1 = new QVBoxLayout(); vboxLayout1->setSpacing(6); vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); comboTables = new QComboBox(groupBox2); comboTables->setObjectName(QString::fromUtf8("comboTables")); vboxLayout1->addWidget(comboTables); comboFields = new QComboBox(groupBox2); comboFields->setObjectName(QString::fromUtf8("comboFields")); vboxLayout1->addWidget(comboFields); comboOrder = new QComboBox(groupBox2); comboOrder->setObjectName(QString::fromUtf8("comboOrder")); vboxLayout1->addWidget(comboOrder); comboUnique = new QComboBox(groupBox2); comboUnique->setObjectName(QString::fromUtf8("comboUnique")); vboxLayout1->addWidget(comboUnique); gridLayout->addLayout(vboxLayout1, 0, 1, 1, 1); vboxLayout2 = new QVBoxLayout(); vboxLayout2->setSpacing(6); vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); textLabel3 = new QLabel(groupBox2); textLabel3->setObjectName(QString::fromUtf8("textLabel3")); textLabel3->setAlignment(Qt::AlignVCenter|Qt::AlignRight); textLabel3->setWordWrap(false); vboxLayout2->addWidget(textLabel3); textLabel4 = new QLabel(groupBox2); textLabel4->setObjectName(QString::fromUtf8("textLabel4")); textLabel4->setAlignment(Qt::AlignVCenter|Qt::AlignRight); textLabel4->setWordWrap(false); vboxLayout2->addWidget(textLabel4); textLabel5 = new QLabel(groupBox2); textLabel5->setObjectName(QString::fromUtf8("textLabel5")); textLabel5->setAlignment(Qt::AlignVCenter|Qt::AlignRight); textLabel5->setWordWrap(false); vboxLayout2->addWidget(textLabel5); textLabel6 = new QLabel(groupBox2); textLabel6->setObjectName(QString::fromUtf8("textLabel6")); textLabel6->setAlignment(Qt::AlignVCenter|Qt::AlignRight); textLabel6->setWordWrap(false); vboxLayout2->addWidget(textLabel6); gridLayout->addLayout(vboxLayout2, 0, 0, 1, 1); vboxLayout->addWidget(groupBox2); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); spacer8 = new QSpacerItem(51, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout1->addItem(spacer8); buttonCreate = new QPushButton(createIndexForm); buttonCreate->setObjectName(QString::fromUtf8("buttonCreate")); hboxLayout1->addWidget(buttonCreate); buttonCancel = new QPushButton(createIndexForm); buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); buttonCancel->setDefault(true); hboxLayout1->addWidget(buttonCancel); vboxLayout->addLayout(hboxLayout1); retranslateUi(createIndexForm); QObject::connect(buttonCreate, SIGNAL(clicked()), createIndexForm, SLOT(confirmCreate())); QObject::connect(buttonCancel, SIGNAL(clicked()), createIndexForm, SLOT(reject())); QObject::connect(comboTables, SIGNAL(activated(QString)), createIndexForm, SLOT(tableSelected(QString))); QMetaObject::connectSlotsByName(createIndexForm); } // setupUi void retranslateUi(QDialog *createIndexForm) { createIndexForm->setWindowTitle(QApplication::translate("createIndexForm", "Create Index", 0, QApplication::UnicodeUTF8)); textLabel2->setText(QApplication::translate("createIndexForm", "Index name:", 0, QApplication::UnicodeUTF8)); indexLineEdit->setText(QString()); #ifndef QT_NO_TOOLTIP indexLineEdit->setProperty("toolTip", QVariant(QApplication::translate("createIndexForm", "Enter the name for the new index", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS indexLineEdit->setProperty("whatsThis", QVariant(QApplication::translate("createIndexForm", "This area contains the name of the index to be created", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS groupBox2->setTitle(QApplication::translate("createIndexForm", "Define properties:", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP comboTables->setProperty("toolTip", QVariant(QApplication::translate("createIndexForm", "Choose the table to index", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS comboTables->setProperty("whatsThis", QVariant(QApplication::translate("createIndexForm", "This control is used to select the table to be indexed. Changing the selected table will automatically update the fields available in the control below", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS #ifndef QT_NO_TOOLTIP comboFields->setProperty("toolTip", QVariant(QApplication::translate("createIndexForm", "Choose the field to be indexed", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS comboFields->setProperty("whatsThis", QVariant(QApplication::translate("createIndexForm", "This control specifies the field to be used as an index", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS comboOrder->clear(); comboOrder->insertItems(0, QStringList() << QApplication::translate("createIndexForm", "Ascending", 0, QApplication::UnicodeUTF8) << QApplication::translate("createIndexForm", "Descending", 0, QApplication::UnicodeUTF8) ); #ifndef QT_NO_TOOLTIP comboOrder->setProperty("toolTip", QVariant(QApplication::translate("createIndexForm", "Choose the index order", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS comboOrder->setProperty("whatsThis", QVariant(QApplication::translate("createIndexForm", "This option controls the ordering of the index. Ascending is the recommended ordering", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS comboUnique->clear(); comboUnique->insertItems(0, QStringList() << QApplication::translate("createIndexForm", "Allowed", 0, QApplication::UnicodeUTF8) << QApplication::translate("createIndexForm", "Not allowed", 0, QApplication::UnicodeUTF8) ); #ifndef QT_NO_TOOLTIP comboUnique->setProperty("toolTip", QVariant(QApplication::translate("createIndexForm", "Allow duplicate values in the index field", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS comboUnique->setProperty("whatsThis", QVariant(QApplication::translate("createIndexForm", "This control determines if the indexed field allows duplicate values to be inserted into the database. Attempting to insert a duplicate value in an indexed fiield that does not allow this option will generate an error", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS textLabel3->setText(QApplication::translate("createIndexForm", "Table to index:", 0, QApplication::UnicodeUTF8)); textLabel4->setText(QApplication::translate("createIndexForm", "Field to index:", 0, QApplication::UnicodeUTF8)); textLabel5->setText(QApplication::translate("createIndexForm", "Indexing order:", 0, QApplication::UnicodeUTF8)); textLabel6->setText(QApplication::translate("createIndexForm", "Duplicate values:", 0, QApplication::UnicodeUTF8)); buttonCreate->setText(QApplication::translate("createIndexForm", "Create", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonCreate->setProperty("toolTip", QVariant(QApplication::translate("createIndexForm", "Create Index", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP buttonCancel->setText(QApplication::translate("createIndexForm", "Cancel", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonCancel->setProperty("toolTip", QVariant(QApplication::translate("createIndexForm", "Cancel and close dialog box", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP } // retranslateUi }; namespace Ui { class createIndexForm: public Ui_createIndexForm {}; } // namespace Ui QT_END_NAMESPACE class createIndexForm : public QDialog, public Ui::createIndexForm { Q_OBJECT public: createIndexForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~createIndexForm(); tableMap mtablemap; QString createStatement; public slots: virtual void tableSelected( const QString & entry ); virtual void confirmCreate(); virtual void populateTable( tableMap rmap ); protected slots: virtual void languageChange(); }; #endif // CREATEINDEXFORM_H sqlitebrowser-2.0.0~beta1+ds.1/building0000644000175000017500000000236507721306311020230 0ustar lisandrolisandroBUILD INSTRUCTIONS AND REQUIREMENTS SQLite Database Browser requires Trolltech's QT. It has been tested with versions 3.12 and 3.2 of QT. QT can be included as a static or shared library, depending on the current QT configuration in the building machine. For more information on QT please consult http://www.trolltech.com. The GPL version of QT is available in almost all Linux distributions as a default package. SQLite is not used as a shared library: it is built from source code included in this package (sqlite_source directory), and linked as a static library into the executable. SQLite is ideal for embedding, so the only requirement for building this code is the presence of QT. QT can be included as a static or shared library, depending on the current QT configuration in the building machine. Provided you have QT installed and configured, simply run qmake followed by make in the main directory. This will generate the sqlitebrowser (or sqlitebrowser .exe, or sqlitebrowser .app) application in the browser subdirectory. The same process works for building the code in any platform supported by QT (including other Unix systems with X11.) Please check the LICENSING file for additional information. sqlitebrowser-2.0.0~beta1+ds.1/deleteindexform.h0000644000175000017500000001157111304272743022041 0ustar lisandrolisandro#ifndef DELETEINDEXFORM_H #define DELETEINDEXFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "QtCore/QStringRef" #include "QtCore/QStringList" #include "sqlitedb.h" QT_BEGIN_NAMESPACE class Ui_deleteIndexForm { public: QVBoxLayout *vboxLayout; QHBoxLayout *hboxLayout; QLabel *textLabel2; QComboBox *comboOptions; QSpacerItem *spacer13; QHBoxLayout *hboxLayout1; QSpacerItem *spacer11; QPushButton *buttonDelete; QPushButton *buttonCancel; void setupUi(QDialog *deleteIndexForm) { if (deleteIndexForm->objectName().isEmpty()) deleteIndexForm->setObjectName(QString::fromUtf8("deleteIndexForm")); deleteIndexForm->resize(236, 137); vboxLayout = new QVBoxLayout(deleteIndexForm); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); textLabel2 = new QLabel(deleteIndexForm); textLabel2->setObjectName(QString::fromUtf8("textLabel2")); textLabel2->setWordWrap(false); hboxLayout->addWidget(textLabel2); comboOptions = new QComboBox(deleteIndexForm); comboOptions->setObjectName(QString::fromUtf8("comboOptions")); hboxLayout->addWidget(comboOptions); vboxLayout->addLayout(hboxLayout); spacer13 = new QSpacerItem(20, 41, QSizePolicy::Minimum, QSizePolicy::Expanding); vboxLayout->addItem(spacer13); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); spacer11 = new QSpacerItem(31, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout1->addItem(spacer11); buttonDelete = new QPushButton(deleteIndexForm); buttonDelete->setObjectName(QString::fromUtf8("buttonDelete")); hboxLayout1->addWidget(buttonDelete); buttonCancel = new QPushButton(deleteIndexForm); buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); buttonCancel->setDefault(true); hboxLayout1->addWidget(buttonCancel); vboxLayout->addLayout(hboxLayout1); retranslateUi(deleteIndexForm); QObject::connect(buttonDelete, SIGNAL(clicked()), deleteIndexForm, SLOT(confirmDelete())); QObject::connect(buttonCancel, SIGNAL(clicked()), deleteIndexForm, SLOT(reject())); QMetaObject::connectSlotsByName(deleteIndexForm); } // setupUi void retranslateUi(QDialog *deleteIndexForm) { deleteIndexForm->setWindowTitle(QApplication::translate("deleteIndexForm", "Delete Index", 0, QApplication::UnicodeUTF8)); textLabel2->setText(QApplication::translate("deleteIndexForm", "Index name:", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP comboOptions->setProperty("toolTip", QVariant(QApplication::translate("deleteIndexForm", "Choose the index to delete", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS comboOptions->setProperty("whatsThis", QVariant(QApplication::translate("deleteIndexForm", "Use this control to select the name of the index to be deleted", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS buttonDelete->setText(QApplication::translate("deleteIndexForm", "Delete", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonDelete->setProperty("toolTip", QVariant(QApplication::translate("deleteIndexForm", "Delete the selected index", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP buttonCancel->setText(QApplication::translate("deleteIndexForm", "Cancel", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonCancel->setProperty("toolTip", QVariant(QApplication::translate("deleteIndexForm", "Cancel and close dialog box", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP } // retranslateUi }; namespace Ui { class deleteIndexForm: public Ui_deleteIndexForm {}; } // namespace Ui QT_END_NAMESPACE class deleteIndexForm : public QDialog, public Ui::deleteIndexForm { Q_OBJECT public: deleteIndexForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~deleteIndexForm(); QString option; public slots: virtual void confirmDelete(); virtual void populateOptions( QStringList entries ); protected slots: virtual void languageChange(); }; #endif // DELETEINDEXFORM_H sqlitebrowser-2.0.0~beta1+ds.1/deletetableform.cpp0000644000175000017500000000276011254510210022340 0ustar lisandrolisandro#include "deletetableform.h" #include #include #include #include "qmessagebox.h" /* * Constructs a deleteTableForm 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. */ deleteTableForm::deleteTableForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); } /* * Destroys the object and frees any allocated resources */ deleteTableForm::~deleteTableForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void deleteTableForm::languageChange() { retranslateUi(this); } void deleteTableForm::confirmDelete() { QString msg = "Are you sure you want to delete table "; msg.append(comboOptions->currentText()); msg.append("? \n All data in the table will be lost"); if (QMessageBox::warning( this, applicationName, msg, QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes ){ option = comboOptions->currentText(); accept(); } } void deleteTableForm::populateOptions(QStringList entries) { comboOptions->clear(); for ( QStringList::Iterator ct = entries.begin(); ct != entries.end(); ++ct ) { comboOptions->insertItem(*ct,-1); } } sqlitebrowser-2.0.0~beta1+ds.1/editform.cpp0000644000175000017500000001226311305522134021017 0ustar lisandrolisandro#include "editform.h" #include #include #include #include #include #include #include "sqlitedb.h" /* * Constructs a editForm 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. */ editForm::editForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); init(); } /* * Destroys the object and frees any allocated resources */ editForm::~editForm() { destroy(); // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void editForm::languageChange() { retranslateUi(this); } void editForm::init() { setModified(false); dataType = kSQLiteMediaType_Void; dataSize = 0; dataDepth = 0; curRow = -1; curCol = -1; textEditor->setText(""); setDataType(kSQLiteMediaType_Void, 0); } void editForm::destroy() { } void editForm::reset() { init(); } void editForm::setModified(bool modifiedstate) { modified = modifiedstate; saveChangesButton->setEnabled(modified); } void editForm::enableExport(bool enabled) { exportButton->setEnabled(enabled); } void editForm::enableTextEditor(bool enabled) { textEditor->setReadOnly(!enabled); } void editForm::setTextFormat(QString format) { if (format=="Auto") { textEditor->setTextFormat(Qt::AutoText); } else { textEditor->setTextFormat(Qt::PlainText); } } void editForm::setDataType(int type, int size) { dataType = type; dataSize = size; QString charstr; switch (dataType ) { case kSQLiteMediaType_String: currentTypeLabel->setText("Type of data currently in cell: Text / Numeric"); if (textEditor->length()>1) charstr = QString("chars"); else charstr = QString("char"); currentDataInfo->setText(QString("%1 %2").arg(textEditor->length()).arg(charstr)); editWidgetStack->setCurrentIndex(0); enableExport(true); enableTextEditor(true); break; case kSQLiteMediaType_Void: currentTypeLabel->setText("Type of data currently in cell: Empty"); currentDataInfo->setText(""); editWidgetStack->setCurrentIndex(0); enableExport(false); enableTextEditor(true); break; } } void editForm::closeEvent( QCloseEvent * ) { emit goingAway(); } void editForm::loadText(QString text, int row, int col) { textEditor->setText(text); curRow = row; curCol = col; if (textEditor->length() > 0) { setDataType(kSQLiteMediaType_String, 0); } else { setDataType(kSQLiteMediaType_Void, 0); } setModified(false); } void editForm::importData() { int type = kSQLiteMediaType_Void; QString fileName = Q3FileDialog::getOpenFileName( "", QString( "Text files (*.txt);;" "All files (*.*);;"), this, "open file dialog" "Choose an image file" ); if (QFile::exists(fileName) ) { type = kSQLiteMediaType_String; QFile file( fileName ); if ( file.open( QIODevice::ReadOnly ) ) { Q3TextStream stream( &file ); textEditor->setText(stream.read()); file.close(); } setModified(true); } } void editForm::exportData() { QString filter; switch (dataType) { case kSQLiteMediaType_String: filter = "Text files (*.txt)"; break; default: return; } QString fileName = Q3FileDialog::getSaveFileName( defaultlocation, filter, this, "save file dialog" "Choose a filename to export data" ); if (fileName.size() > 0) { switch (dataType) { case kSQLiteMediaType_String: { QFile file(fileName); if ( file.open( QIODevice::WriteOnly ) ) { Q3TextStream stream( &file ); stream << textEditor->text(); file.close(); } } break; default: return; } } } void editForm::clearData() { textEditor->setText(""); setDataType(kSQLiteMediaType_Void, 0); setModified(true); } void editForm::saveChanges() { if (dataType==kSQLiteMediaType_String) emit updateRecordText(curRow, curCol, textEditor->text()); if (dataType==kSQLiteMediaType_Void) emit updateRecordText(curRow, curCol, QString("")); setModified(false); emit goingAway(); } void editForm::editTextChanged() { int newtype = kSQLiteMediaType_String; if (textEditor->length() == 0) { newtype = kSQLiteMediaType_Void; } if (newtype!=dataType) { setDataType(newtype, 0); } setModified(true); } void editForm::editorClicked() { enableTextEditor(true); } sqlitebrowser-2.0.0~beta1+ds.1/findform.cpp0000644000175000017500000000453611254510210021011 0ustar lisandrolisandro#include "findform.h" #include #include #include /* * Constructs a findForm 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. */ findForm::findForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); } /* * Destroys the object and frees any allocated resources */ findForm::~findForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void findForm::languageChange() { retranslateUi(this); } void findForm::showResults(resultMap rmap) { findListView->clear(); findListView->setSorting(-1); resultMap::Iterator it; Q3ListViewItem * lasttbitem = 0; for ( it = rmap.begin(); it != rmap.end(); ++it ) { Q3ListViewItem * tbitem = new Q3ListViewItem( findListView, lasttbitem ); //tbitem->setOpen( TRUE ); tbitem->setText( 0, QString::number(it.key() + 1,10) ); //increase from index 0 QString firstline = it.data().section( '\n', 0,0 ); if (firstline.length()>MAX_DISPLAY_LENGTH) { firstline.truncate(MAX_DISPLAY_LENGTH); firstline.append("..."); } tbitem->setText( 1, firstline ); lasttbitem = tbitem; } QString results = "Found: "; results.append(QString::number(findListView->childCount())); resultsLabel->setText(results); } void findForm::find() { emit lookfor( findFieldCombobox->currentText(), findOperatorComboBox->currentText(),searchLine->text() ); } void findForm::resetFields(QStringList fieldlist) { findFieldCombobox->clear(); for ( QStringList::Iterator ct = fieldlist.begin(); ct != fieldlist.end(); ++ct ) { findFieldCombobox->insertItem(*ct,-1); } } void findForm::resetResults() { findListView->clear(); resultsLabel->setText("Found: 0"); } void findForm::recordSelected( Q3ListViewItem * witem) { if (witem) { int recNum = (witem->text(0)).toInt() ; emit showrecord(recNum); } } void findForm::closeEvent( QCloseEvent * ) { emit goingAway(); } sqlitebrowser-2.0.0~beta1+ds.1/preferencesform.h0000644000175000017500000002256411304272743022054 0ustar lisandrolisandro#ifndef PREFERENCESFORM_H #define PREFERENCESFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE class Ui_preferencesForm { public: QVBoxLayout *vboxLayout; QHBoxLayout *hboxLayout; QLabel *textLabel1; QSpacerItem *spacer9; QComboBox *encodingComboBox; QHBoxLayout *hboxLayout1; QLabel *textLabel2; QSpacerItem *spacer10; QComboBox *defaultdataComboBox; QHBoxLayout *hboxLayout2; QLabel *textLabel1_2; QSpacerItem *spacer9_2; QComboBox *defaultTextComboBox; QHBoxLayout *hboxLayout3; QLabel *textLabel3; QSpacerItem *spacer11; QLineEdit *locationEdit; QPushButton *setLocationButton; QSpacerItem *spacer13; QHBoxLayout *hboxLayout4; QSpacerItem *spacer12; QPushButton *OKButton; QPushButton *cancelButton; void setupUi(QDialog *preferencesForm) { if (preferencesForm->objectName().isEmpty()) preferencesForm->setObjectName(QString::fromUtf8("preferencesForm")); preferencesForm->resize(470, 198); vboxLayout = new QVBoxLayout(preferencesForm); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); textLabel1 = new QLabel(preferencesForm); textLabel1->setObjectName(QString::fromUtf8("textLabel1")); textLabel1->setWordWrap(false); hboxLayout->addWidget(textLabel1); spacer9 = new QSpacerItem(31, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacer9); encodingComboBox = new QComboBox(preferencesForm); encodingComboBox->setObjectName(QString::fromUtf8("encodingComboBox")); hboxLayout->addWidget(encodingComboBox); vboxLayout->addLayout(hboxLayout); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); textLabel2 = new QLabel(preferencesForm); textLabel2->setObjectName(QString::fromUtf8("textLabel2")); textLabel2->setWordWrap(false); hboxLayout1->addWidget(textLabel2); spacer10 = new QSpacerItem(21, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout1->addItem(spacer10); defaultdataComboBox = new QComboBox(preferencesForm); defaultdataComboBox->setObjectName(QString::fromUtf8("defaultdataComboBox")); hboxLayout1->addWidget(defaultdataComboBox); vboxLayout->addLayout(hboxLayout1); hboxLayout2 = new QHBoxLayout(); hboxLayout2->setSpacing(6); hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); textLabel1_2 = new QLabel(preferencesForm); textLabel1_2->setObjectName(QString::fromUtf8("textLabel1_2")); textLabel1_2->setWordWrap(false); hboxLayout2->addWidget(textLabel1_2); spacer9_2 = new QSpacerItem(81, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout2->addItem(spacer9_2); defaultTextComboBox = new QComboBox(preferencesForm); defaultTextComboBox->setObjectName(QString::fromUtf8("defaultTextComboBox")); hboxLayout2->addWidget(defaultTextComboBox); vboxLayout->addLayout(hboxLayout2); hboxLayout3 = new QHBoxLayout(); hboxLayout3->setSpacing(6); hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3")); textLabel3 = new QLabel(preferencesForm); textLabel3->setObjectName(QString::fromUtf8("textLabel3")); textLabel3->setWordWrap(false); hboxLayout3->addWidget(textLabel3); spacer11 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout3->addItem(spacer11); locationEdit = new QLineEdit(preferencesForm); locationEdit->setObjectName(QString::fromUtf8("locationEdit")); locationEdit->setEnabled(false); hboxLayout3->addWidget(locationEdit); setLocationButton = new QPushButton(preferencesForm); setLocationButton->setObjectName(QString::fromUtf8("setLocationButton")); QSizePolicy sizePolicy(static_cast(0), static_cast(0)); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(setLocationButton->sizePolicy().hasHeightForWidth()); setLocationButton->setSizePolicy(sizePolicy); hboxLayout3->addWidget(setLocationButton); vboxLayout->addLayout(hboxLayout3); spacer13 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); vboxLayout->addItem(spacer13); hboxLayout4 = new QHBoxLayout(); hboxLayout4->setSpacing(6); hboxLayout4->setObjectName(QString::fromUtf8("hboxLayout4")); spacer12 = new QSpacerItem(51, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout4->addItem(spacer12); OKButton = new QPushButton(preferencesForm); OKButton->setObjectName(QString::fromUtf8("OKButton")); hboxLayout4->addWidget(OKButton); cancelButton = new QPushButton(preferencesForm); cancelButton->setObjectName(QString::fromUtf8("cancelButton")); cancelButton->setDefault(true); hboxLayout4->addWidget(cancelButton); vboxLayout->addLayout(hboxLayout4); retranslateUi(preferencesForm); QObject::connect(OKButton, SIGNAL(clicked()), preferencesForm, SLOT(saveSettings())); QObject::connect(cancelButton, SIGNAL(clicked()), preferencesForm, SLOT(reject())); QObject::connect(defaultdataComboBox, SIGNAL(activated(int)), preferencesForm, SLOT(defaultDataChanged(int))); QObject::connect(encodingComboBox, SIGNAL(activated(int)), preferencesForm, SLOT(encodingChanged(int))); QObject::connect(setLocationButton, SIGNAL(clicked()), preferencesForm, SLOT(chooseLocation())); QObject::connect(defaultTextComboBox, SIGNAL(activated(int)), preferencesForm, SLOT(defaultTextChanged(int))); QMetaObject::connectSlotsByName(preferencesForm); } // setupUi void retranslateUi(QDialog *preferencesForm) { preferencesForm->setWindowTitle(QApplication::translate("preferencesForm", "Preferences", 0, QApplication::UnicodeUTF8)); textLabel1->setText(QApplication::translate("preferencesForm", "Database encoding:", 0, QApplication::UnicodeUTF8)); encodingComboBox->clear(); encodingComboBox->insertItems(0, QStringList() << QApplication::translate("preferencesForm", "UTF8 (Unicode)", 0, QApplication::UnicodeUTF8) << QApplication::translate("preferencesForm", "Latin1 (8bit)", 0, QApplication::UnicodeUTF8) ); textLabel2->setText(QApplication::translate("preferencesForm", "Default data for new records:", 0, QApplication::UnicodeUTF8)); defaultdataComboBox->clear(); defaultdataComboBox->insertItems(0, QStringList() << QApplication::translate("preferencesForm", "NULL", 0, QApplication::UnicodeUTF8) << QApplication::translate("preferencesForm", "0", 0, QApplication::UnicodeUTF8) << QApplication::translate("preferencesForm", "Empty string", 0, QApplication::UnicodeUTF8) ); textLabel1_2->setText(QApplication::translate("preferencesForm", "Default text editor format:", 0, QApplication::UnicodeUTF8)); defaultTextComboBox->clear(); defaultTextComboBox->insertItems(0, QStringList() << QApplication::translate("preferencesForm", "Plain", 0, QApplication::UnicodeUTF8) << QApplication::translate("preferencesForm", "Auto", 0, QApplication::UnicodeUTF8) ); textLabel3->setText(QApplication::translate("preferencesForm", "Default location:", 0, QApplication::UnicodeUTF8)); setLocationButton->setText(QApplication::translate("preferencesForm", "...", 0, QApplication::UnicodeUTF8)); OKButton->setText(QApplication::translate("preferencesForm", "O&K", 0, QApplication::UnicodeUTF8)); cancelButton->setText(QApplication::translate("preferencesForm", "Ca&ncel", 0, QApplication::UnicodeUTF8)); } // retranslateUi }; namespace Ui { class preferencesForm: public Ui_preferencesForm {}; } // namespace Ui QT_END_NAMESPACE class preferencesForm : public QDialog, public Ui::preferencesForm { Q_OBJECT public: preferencesForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~preferencesForm(); QString defaulttext; QString defaultlocation; QString defaultnewdata; QString defaultencoding; public slots: virtual void defaultDataChanged( int which ); virtual void defaultTextChanged( int which ); virtual void encodingChanged( int which ); virtual void chooseLocation(); virtual void loadSettings(); virtual void saveSettings(); protected slots: virtual void languageChange(); private: void init(); }; #endif // PREFERENCESFORM_H sqlitebrowser-2.0.0~beta1+ds.1/editfieldform.cpp0000644000175000017500000000436011304272743022031 0ustar lisandrolisandro#include "editfieldform.h" #include #include #include #include #include "sqlitedb.h" #include "addfieldtypeform.h" /* * Constructs a editFieldForm 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. */ editFieldForm::editFieldForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); } /* * Destroys the object and frees any allocated resources */ editFieldForm::~editFieldForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void editFieldForm::languageChange() { retranslateUi(this); } void editFieldForm::setInitialValues(QString name, QString type) { nameLineEdit->setText(name); typeBox->clear(); typeBox->insertItem(type); QString tString = ""; tString = "TEXT"; if (type.compare(tString)!=0) typeBox->insertItem(tString); tString = "NUMERIC"; if (type.compare(tString)!=0) typeBox->insertItem(tString); tString = "BLOB"; if (type.compare(tString)!=0) typeBox->insertItem(tString); tString = "INTEGER PRIMARY KEY"; if (type.compare(tString)!=0) typeBox->insertItem(tString); } void editFieldForm::confirmEdit() { QString fieldname = nameLineEdit->text(); if (fieldname.isEmpty()) { QMessageBox::information( this, applicationName, "Field name can not be empty" ); return; } if (fieldname.contains(" ")>0) { QMessageBox::warning( this, applicationName, "Spaces are not allowed in the field name" ); return; } name = fieldname; type = typeBox->currentText(); accept(); } void editFieldForm::enableSave() { saveButton->setEnabled(true); } void editFieldForm::getCustomType() { addFieldTypeForm * addForm = new addFieldTypeForm( this, "addfieldtype", TRUE ); if (addForm->exec()) { //QString nospaces = addForm->typeNameEdit->text().remove(" "); QString nospaces = addForm->typeNameEdit->text(); setInitialValues(nameLineEdit->text(),nospaces ); enableSave(); } } sqlitebrowser-2.0.0~beta1+ds.1/sqlbrowser_util.h0000644000175000017500000000441510220301657022113 0ustar lisandrolisandro#ifndef _H_SQLBROWSERUTIL #define _H_SQLBROWSERUTIL #ifdef __cplusplus extern "C" { #endif #include #include "sqlite_source/sqlite3.h" #include struct previous_mode_data { int valid; /* Is there legit data in here? */ int mode; int showHeader; int colWidth[100]; }; /* ** An pointer to an instance of this structure is passed from ** the main program to the callback. This is used to communicate ** state and mode information. */ struct callback_data { sqlite3 *db; /* The database */ int echoOn; /* True to echo input commands */ int cnt; /* Number of records displayed so far */ FILE *out; /* Write results here */ int mode; /* An output mode setting */ int showHeader; /* True to show column names in List or Column mode */ char *zDestTable; /* Name of destination table when MODE_Insert */ char separator[20]; /* Separator character for MODE_List */ int colWidth[100]; /* Requested width of each column when in column mode*/ int actualWidth[100]; /* Actual width of each column */ char nullvalue[20]; /* The text to print when a NULL comes back from ** the database */ struct previous_mode_data explainPrev; /* Holds the mode information just before ** .explain ON */ char outfile[FILENAME_MAX]; /* Filename for *out */ const char *zDbFilename; /* name of the database file */ }; /* ** These are the allowed modes. */ #define MODE_Line 0 /* One column per line. Blank line between records */ #define MODE_Column 1 /* One record per line in neat columns */ #define MODE_List 2 /* One record per line with a separator */ #define MODE_Semi 3 /* Same as MODE_List but append ";" to each line */ #define MODE_Html 4 /* Generate an XHTML table */ #define MODE_Insert 5 /* Generate SQL "insert" statements */ #define MODE_NUM_OF 6 /* The number of modes (not a mode itself) */ int dump_database(sqlite3 * db, FILE * outfile); int load_database(sqlite3 * db, FILE * infile, int * lineErr); void process_input(sqlite3 * db, FILE *in, int * lineErr); char *sqlbrowser_getline(FILE *in); #ifdef __cplusplus } /* End of the 'extern "C"' block */ #endif #endif sqlitebrowser-2.0.0~beta1+ds.1/extendedmainform.h0000644000175000017500000000064011254434065022210 0ustar lisandrolisandro#ifndef __EXTENDEDMAINFORM__ #define __EXTENDEDMAINFORM__ #include "form1.h" #include class ExtendedMainForm : public mainForm { public: ExtendedMainForm(QWidget* parent = 0, const char* name = 0, Qt::WindowFlags fl = Qt::WType_TopLevel); ~ExtendedMainForm(void); protected: void dragEnterEvent(QDragEnterEvent *event); void dropEvent(QDropEvent *event); }; #endif // __EXTENDEDMAINFORM__ sqlitebrowser-2.0.0~beta1+ds.1/edittableform.h0000644000175000017500000001643711304272743021512 0ustar lisandrolisandro#ifndef EDITTABLEFORM_H #define EDITTABLEFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "sqlitedb.h" QT_BEGIN_NAMESPACE class Ui_editTableForm { public: QGridLayout *gridLayout; QVBoxLayout *vboxLayout; QLineEdit *tableLine; Q3ListView *fieldListView; QVBoxLayout *vboxLayout1; QPushButton *renameTableButton; QSpacerItem *spacer31; QPushButton *renameFieldButton; QPushButton *removeFieldButton; QPushButton *addFieldButton; QHBoxLayout *hboxLayout; QSpacerItem *spacer34; QPushButton *closeButton; void setupUi(QDialog *editTableForm) { if (editTableForm->objectName().isEmpty()) editTableForm->setObjectName(QString::fromUtf8("editTableForm")); editTableForm->resize(428, 266); gridLayout = new QGridLayout(editTableForm); gridLayout->setSpacing(6); gridLayout->setContentsMargins(11, 11, 11, 11); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); vboxLayout = new QVBoxLayout(); vboxLayout->setSpacing(6); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); tableLine = new QLineEdit(editTableForm); tableLine->setObjectName(QString::fromUtf8("tableLine")); tableLine->setFocusPolicy(Qt::NoFocus); tableLine->setReadOnly(true); vboxLayout->addWidget(tableLine); fieldListView = new Q3ListView(editTableForm); fieldListView->addColumn(QApplication::translate("editTableForm", "Field name", 0, QApplication::UnicodeUTF8)); fieldListView->header()->setClickEnabled(true, fieldListView->header()->count() - 1); fieldListView->header()->setResizeEnabled(true, fieldListView->header()->count() - 1); fieldListView->addColumn(QApplication::translate("editTableForm", "Field type", 0, QApplication::UnicodeUTF8)); fieldListView->header()->setClickEnabled(true, fieldListView->header()->count() - 1); fieldListView->header()->setResizeEnabled(true, fieldListView->header()->count() - 1); fieldListView->setObjectName(QString::fromUtf8("fieldListView")); fieldListView->setResizePolicy(Q3ScrollView::Manual); fieldListView->setResizeMode(Q3ListView::AllColumns); vboxLayout->addWidget(fieldListView); gridLayout->addLayout(vboxLayout, 0, 0, 1, 1); vboxLayout1 = new QVBoxLayout(); vboxLayout1->setSpacing(6); vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); renameTableButton = new QPushButton(editTableForm); renameTableButton->setObjectName(QString::fromUtf8("renameTableButton")); vboxLayout1->addWidget(renameTableButton); spacer31 = new QSpacerItem(20, 23, QSizePolicy::Minimum, QSizePolicy::Expanding); vboxLayout1->addItem(spacer31); renameFieldButton = new QPushButton(editTableForm); renameFieldButton->setObjectName(QString::fromUtf8("renameFieldButton")); renameFieldButton->setEnabled(false); vboxLayout1->addWidget(renameFieldButton); removeFieldButton = new QPushButton(editTableForm); removeFieldButton->setObjectName(QString::fromUtf8("removeFieldButton")); removeFieldButton->setEnabled(false); vboxLayout1->addWidget(removeFieldButton); addFieldButton = new QPushButton(editTableForm); addFieldButton->setObjectName(QString::fromUtf8("addFieldButton")); vboxLayout1->addWidget(addFieldButton); gridLayout->addLayout(vboxLayout1, 0, 1, 1, 1); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); spacer34 = new QSpacerItem(161, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacer34); closeButton = new QPushButton(editTableForm); closeButton->setObjectName(QString::fromUtf8("closeButton")); hboxLayout->addWidget(closeButton); gridLayout->addLayout(hboxLayout, 1, 0, 1, 2); retranslateUi(editTableForm); QObject::connect(closeButton, SIGNAL(clicked()), editTableForm, SLOT(accept())); QObject::connect(renameTableButton, SIGNAL(clicked()), editTableForm, SLOT(renameTable())); QObject::connect(removeFieldButton, SIGNAL(clicked()), editTableForm, SLOT(removeField())); QObject::connect(addFieldButton, SIGNAL(clicked()), editTableForm, SLOT(addField())); QObject::connect(renameFieldButton, SIGNAL(clicked()), editTableForm, SLOT(editField())); QObject::connect(fieldListView, SIGNAL(selectionChanged()), editTableForm, SLOT(fieldSelectionChanged())); QMetaObject::connectSlotsByName(editTableForm); } // setupUi void retranslateUi(QDialog *editTableForm) { editTableForm->setWindowTitle(QApplication::translate("editTableForm", "Edit table definition", 0, QApplication::UnicodeUTF8)); fieldListView->header()->setLabel(0, QApplication::translate("editTableForm", "Field name", 0, QApplication::UnicodeUTF8)); fieldListView->header()->setLabel(1, QApplication::translate("editTableForm", "Field type", 0, QApplication::UnicodeUTF8)); fieldListView->clear(); Q3ListViewItem *__item = new Q3ListViewItem(fieldListView); __item->setText(0, QApplication::translate("editTableForm", "New Item", 0, QApplication::UnicodeUTF8)); __item->setText(1, QString()); __item->setPixmap(0, QPixmap()); __item->setPixmap(1, QPixmap()); renameTableButton->setText(QApplication::translate("editTableForm", "Rename table", 0, QApplication::UnicodeUTF8)); renameFieldButton->setText(QApplication::translate("editTableForm", "Edit field", 0, QApplication::UnicodeUTF8)); removeFieldButton->setText(QApplication::translate("editTableForm", "Remove field", 0, QApplication::UnicodeUTF8)); addFieldButton->setText(QApplication::translate("editTableForm", "Add field", 0, QApplication::UnicodeUTF8)); closeButton->setText(QApplication::translate("editTableForm", "Close", 0, QApplication::UnicodeUTF8)); } // retranslateUi }; namespace Ui { class editTableForm: public Ui_editTableForm {}; } // namespace Ui QT_END_NAMESPACE class editTableForm : public QDialog, public Ui::editTableForm { Q_OBJECT public: editTableForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~editTableForm(); bool modified; QString curTable; public slots: virtual void setActiveTable( DBBrowserDB * thedb, QString tableName ); virtual void populateFields(); virtual void renameTable(); virtual void editField(); virtual void addField(); virtual void removeField(); virtual void fieldSelectionChanged(); protected: QStringList types; QStringList fields; DBBrowserDB * pdb; protected slots: virtual void languageChange(); private: void init(); }; #endif // EDITTABLEFORM_H sqlitebrowser-2.0.0~beta1+ds.1/importcsvform.h0000644000175000017500000002022611304272743021572 0ustar lisandrolisandro#ifndef IMPORTCSVFORM_H #define IMPORTCSVFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "sqlitedb.h" QT_BEGIN_NAMESPACE class Ui_importCSVForm { public: QVBoxLayout *vboxLayout; QGridLayout *gridLayout; QLabel *textLabel3; QLineEdit *tableNameEdit; QCheckBox *extractFieldNamesCheckbox; QHBoxLayout *hboxLayout; QVBoxLayout *vboxLayout1; QLabel *textLabel1; QLabel *textLabel2; QSpacerItem *spacer15; QVBoxLayout *vboxLayout2; QComboBox *fieldBox; QComboBox *quoteBox; QSpacerItem *spacer14; Q3Table *previewTable; QHBoxLayout *hboxLayout1; QSpacerItem *spacer13; QPushButton *cancelButton; QPushButton *createButton; void setupUi(QDialog *importCSVForm) { if (importCSVForm->objectName().isEmpty()) importCSVForm->setObjectName(QString::fromUtf8("importCSVForm")); importCSVForm->resize(372, 382); importCSVForm->setModal(true); vboxLayout = new QVBoxLayout(importCSVForm); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); gridLayout = new QGridLayout(); gridLayout->setSpacing(6); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); textLabel3 = new QLabel(importCSVForm); textLabel3->setObjectName(QString::fromUtf8("textLabel3")); textLabel3->setWordWrap(false); gridLayout->addWidget(textLabel3, 0, 0, 1, 1); tableNameEdit = new QLineEdit(importCSVForm); tableNameEdit->setObjectName(QString::fromUtf8("tableNameEdit")); gridLayout->addWidget(tableNameEdit, 0, 1, 1, 1); extractFieldNamesCheckbox = new QCheckBox(importCSVForm); extractFieldNamesCheckbox->setObjectName(QString::fromUtf8("extractFieldNamesCheckbox")); gridLayout->addWidget(extractFieldNamesCheckbox, 2, 0, 1, 2); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); vboxLayout1 = new QVBoxLayout(); vboxLayout1->setSpacing(6); vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); textLabel1 = new QLabel(importCSVForm); textLabel1->setObjectName(QString::fromUtf8("textLabel1")); textLabel1->setWordWrap(false); vboxLayout1->addWidget(textLabel1); textLabel2 = new QLabel(importCSVForm); textLabel2->setObjectName(QString::fromUtf8("textLabel2")); textLabel2->setWordWrap(false); vboxLayout1->addWidget(textLabel2); hboxLayout->addLayout(vboxLayout1); spacer15 = new QSpacerItem(81, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacer15); vboxLayout2 = new QVBoxLayout(); vboxLayout2->setSpacing(6); vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); fieldBox = new QComboBox(importCSVForm); fieldBox->setObjectName(QString::fromUtf8("fieldBox")); vboxLayout2->addWidget(fieldBox); quoteBox = new QComboBox(importCSVForm); quoteBox->setObjectName(QString::fromUtf8("quoteBox")); vboxLayout2->addWidget(quoteBox); hboxLayout->addLayout(vboxLayout2); gridLayout->addLayout(hboxLayout, 1, 0, 1, 2); vboxLayout->addLayout(gridLayout); spacer14 = new QSpacerItem(138, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); vboxLayout->addItem(spacer14); previewTable = new Q3Table(importCSVForm); previewTable->setObjectName(QString::fromUtf8("previewTable")); previewTable->setNumRows(0); previewTable->setNumCols(0); previewTable->setReadOnly(true); previewTable->setSelectionMode(Q3Table::NoSelection); vboxLayout->addWidget(previewTable); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); spacer13 = new QSpacerItem(41, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout1->addItem(spacer13); cancelButton = new QPushButton(importCSVForm); cancelButton->setObjectName(QString::fromUtf8("cancelButton")); hboxLayout1->addWidget(cancelButton); createButton = new QPushButton(importCSVForm); createButton->setObjectName(QString::fromUtf8("createButton")); hboxLayout1->addWidget(createButton); vboxLayout->addLayout(hboxLayout1); retranslateUi(importCSVForm); QObject::connect(cancelButton, SIGNAL(clicked()), importCSVForm, SLOT(reject())); QObject::connect(createButton, SIGNAL(clicked()), importCSVForm, SLOT(createButtonPressed())); QObject::connect(fieldBox, SIGNAL(activated(int)), importCSVForm, SLOT(fieldSeparatorChanged())); QObject::connect(quoteBox, SIGNAL(activated(int)), importCSVForm, SLOT(textQuoteChanged())); QObject::connect(extractFieldNamesCheckbox, SIGNAL(toggled(bool)), importCSVForm, SLOT(extractFieldNamesChanged(bool))); QMetaObject::connectSlotsByName(importCSVForm); } // setupUi void retranslateUi(QDialog *importCSVForm) { importCSVForm->setWindowTitle(QApplication::translate("importCSVForm", "Create table from CSV file", 0, QApplication::UnicodeUTF8)); textLabel3->setText(QApplication::translate("importCSVForm", "New table name:", 0, QApplication::UnicodeUTF8)); extractFieldNamesCheckbox->setText(QApplication::translate("importCSVForm", "Extract field names from first line", 0, QApplication::UnicodeUTF8)); textLabel1->setText(QApplication::translate("importCSVForm", "Field separator:", 0, QApplication::UnicodeUTF8)); textLabel2->setText(QApplication::translate("importCSVForm", "Text quote character:", 0, QApplication::UnicodeUTF8)); fieldBox->clear(); fieldBox->insertItems(0, QStringList() << QApplication::translate("importCSVForm", ",", 0, QApplication::UnicodeUTF8) << QApplication::translate("importCSVForm", ";", 0, QApplication::UnicodeUTF8) << QApplication::translate("importCSVForm", "TAB", 0, QApplication::UnicodeUTF8) ); quoteBox->clear(); quoteBox->insertItems(0, QStringList() << QApplication::translate("importCSVForm", "\"", 0, QApplication::UnicodeUTF8) << QApplication::translate("importCSVForm", "'", 0, QApplication::UnicodeUTF8) << QApplication::translate("importCSVForm", "\\", 0, QApplication::UnicodeUTF8) << QString() ); cancelButton->setText(QApplication::translate("importCSVForm", "Cancel", 0, QApplication::UnicodeUTF8)); createButton->setText(QApplication::translate("importCSVForm", "Create", 0, QApplication::UnicodeUTF8)); } // retranslateUi }; namespace Ui { class importCSVForm: public Ui_importCSVForm {}; } // namespace Ui QT_END_NAMESPACE class importCSVForm : public QDialog, public Ui::importCSVForm { Q_OBJECT public: importCSVForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~importCSVForm(); public slots: virtual void initialize( QString & csvfile, DBBrowserDB * db ); virtual void createButtonPressed(); virtual void preview(); virtual void fieldSeparatorChanged(); virtual void textQuoteChanged(); virtual void extractFieldNamesChanged( bool enabled ); protected: QStringList curList; char quote; char sep; int numfields; QString csvfilename; DBBrowserDB * pdb; protected slots: virtual void languageChange(); private: void init(); }; #endif // IMPORTCSVFORM_H sqlitebrowser-2.0.0~beta1+ds.1/.obj/0000755000175000017500000000000011556107175017342 5ustar lisandrolisandrosqlitebrowser-2.0.0~beta1+ds.1/createindexform.cpp0000644000175000017500000000625711254510210022366 0ustar lisandrolisandro#include "createindexform.h" #include #include #include #include "qmessagebox.h" /* * Constructs a createIndexForm 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. */ createIndexForm::createIndexForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); } /* * Destroys the object and frees any allocated resources */ createIndexForm::~createIndexForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void createIndexForm::languageChange() { retranslateUi(this); } void createIndexForm::tableSelected( const QString & entry ) { tableMap::Iterator it; for ( it = mtablemap.begin(); it != mtablemap.end(); ++it ) { QString tname = it.data().getname() ; //populate the fields with first table name if ((tname.compare(entry)==0)){ comboFields->clear(); fieldMap::Iterator fit; fieldMap fmap = it.data().fldmap; for ( fit = fmap.begin(); fit != fmap.end(); ++fit ) { comboFields->insertItem( fit.data().getname(), -1 ); } } } } void createIndexForm::confirmCreate() { bool ok = true; QString idxname = indexLineEdit->text(); if (idxname.isEmpty()) { ok = false; QMessageBox::information( this, applicationName, "Please select a name for the index" ); return; } if (idxname.contains(" ")>0) { ok = false; QMessageBox::warning( this, applicationName, "Spaces are not allowed in the index name" ); return; } if (ok){ createStatement = "CREATE "; if (comboUnique->currentItem()==1){ createStatement.append("UNIQUE "); } createStatement.append("INDEX "); createStatement.append(indexLineEdit->text()); createStatement.append(" ON "); createStatement.append(comboTables->currentText()); createStatement.append("("); createStatement.append(comboFields->currentText()); createStatement.append(" "); if (comboOrder->currentItem()==0){ createStatement.append("ASC"); } else { createStatement.append("DESC"); } createStatement.append(");"); accept(); } } void createIndexForm::populateTable(tableMap rmap) { mtablemap = rmap; tableMap::Iterator it; for ( it = mtablemap.begin(); it != mtablemap.end(); ++it ) { comboTables->insertItem( it.data().getname() , -1); //populate the fields with first table name if (it==mtablemap.begin()){ fieldMap::Iterator fit; fieldMap fmap = it.data().fldmap; for ( fit = fmap.begin(); fit != fmap.end(); ++fit ) { comboFields->insertItem( fit.data().getname(), -1 ); } } } } sqlitebrowser-2.0.0~beta1+ds.1/renametableform.h0000644000175000017500000000661311304272743022027 0ustar lisandrolisandro#ifndef RENAMETABLEFORM_H #define RENAMETABLEFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include 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->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")); hboxLayout->addWidget(closeButton); renameButton = new QPushButton(renameTableForm); renameButton->setObjectName(QString::fromUtf8("renameButton")); renameButton->setDefault(true); 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, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~renameTableForm(); virtual QString getTableName(); public slots: virtual void renameClicked(); virtual void setTableName( QString name ); protected slots: virtual void languageChange(); }; #endif // RENAMETABLEFORM_H sqlitebrowser-2.0.0~beta1+ds.1/exporttablecsvform.h0000644000175000017500000001164511304272743022616 0ustar lisandrolisandro#ifndef EXPORTTABLECSVFORM_H #define EXPORTTABLECSVFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE class Ui_exportTableCSVForm { public: QVBoxLayout *vboxLayout; QHBoxLayout *hboxLayout; QLabel *textLabel2; QComboBox *comboOptions; QSpacerItem *spacer13; QHBoxLayout *hboxLayout1; QSpacerItem *spacer11; QPushButton *buttonCancel; QPushButton *buttonExport; void setupUi(QDialog *exportTableCSVForm) { if (exportTableCSVForm->objectName().isEmpty()) exportTableCSVForm->setObjectName(QString::fromUtf8("exportTableCSVForm")); exportTableCSVForm->resize(365, 150); vboxLayout = new QVBoxLayout(exportTableCSVForm); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); textLabel2 = new QLabel(exportTableCSVForm); textLabel2->setObjectName(QString::fromUtf8("textLabel2")); textLabel2->setWordWrap(false); hboxLayout->addWidget(textLabel2); comboOptions = new QComboBox(exportTableCSVForm); comboOptions->setObjectName(QString::fromUtf8("comboOptions")); hboxLayout->addWidget(comboOptions); vboxLayout->addLayout(hboxLayout); spacer13 = new QSpacerItem(20, 41, QSizePolicy::Minimum, QSizePolicy::Expanding); vboxLayout->addItem(spacer13); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); spacer11 = new QSpacerItem(29, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout1->addItem(spacer11); buttonCancel = new QPushButton(exportTableCSVForm); buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); buttonCancel->setDefault(false); hboxLayout1->addWidget(buttonCancel); buttonExport = new QPushButton(exportTableCSVForm); buttonExport->setObjectName(QString::fromUtf8("buttonExport")); hboxLayout1->addWidget(buttonExport); vboxLayout->addLayout(hboxLayout1); retranslateUi(exportTableCSVForm); QObject::connect(buttonExport, SIGNAL(clicked()), exportTableCSVForm, SLOT(exportPressed())); QObject::connect(buttonCancel, SIGNAL(clicked()), exportTableCSVForm, SLOT(reject())); QMetaObject::connectSlotsByName(exportTableCSVForm); } // setupUi void retranslateUi(QDialog *exportTableCSVForm) { exportTableCSVForm->setWindowTitle(QApplication::translate("exportTableCSVForm", "Choose table to export as CSV text", 0, QApplication::UnicodeUTF8)); textLabel2->setText(QApplication::translate("exportTableCSVForm", "Table name:", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP comboOptions->setProperty("toolTip", QVariant(QApplication::translate("exportTableCSVForm", "Choose the table to delete", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS comboOptions->setProperty("whatsThis", QVariant(QApplication::translate("exportTableCSVForm", "Use this control to select the name of the table to be deleted", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS buttonCancel->setText(QApplication::translate("exportTableCSVForm", "Cancel", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonCancel->setProperty("toolTip", QVariant(QApplication::translate("exportTableCSVForm", "Cancel and close dialog box", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP buttonExport->setText(QApplication::translate("exportTableCSVForm", "Export", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonExport->setProperty("toolTip", QVariant(QApplication::translate("exportTableCSVForm", "Delete the selected table", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP } // retranslateUi }; namespace Ui { class exportTableCSVForm: public Ui_exportTableCSVForm {}; } // namespace Ui QT_END_NAMESPACE class exportTableCSVForm : public QDialog, public Ui::exportTableCSVForm { Q_OBJECT public: exportTableCSVForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~exportTableCSVForm(); QString option; public slots: virtual void exportPressed(); virtual void populateOptions( QStringList entries ); protected slots: virtual void languageChange(); }; #endif // EXPORTTABLECSVFORM_H sqlitebrowser-2.0.0~beta1+ds.1/importcsvform.cpp0000644000175000017500000001545711305531167022136 0ustar lisandrolisandro#include "importcsvform.h" #include #include #include #include #include #include /* * Constructs a importCSVForm 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. */ importCSVForm::importCSVForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); init(); } /* * Destroys the object and frees any allocated resources */ importCSVForm::~importCSVForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void importCSVForm::languageChange() { retranslateUi(this); } void importCSVForm::init() { pdb = 0; sep=','; quote='"'; } void importCSVForm::initialize(QString & csvfile, DBBrowserDB * db) { pdb = db; csvfilename = csvfile; preview(); } void importCSVForm::createButtonPressed() { QString tabname; QStringList fieldList; QString sql; //minimun validation for tabname tabname = tableNameEdit->text(); if (tabname.isEmpty()) { QMessageBox::information( this, applicationName, "Please choose a name for the new table that will hold the csv data" ); return; } tabname.replace(" ", ""); tabname.replace('"', ""); tabname.replace("'",""); tabname.replace(",",""); tabname.replace(";",""); if (tabname.isEmpty()) { tabname = "tempTable"; } //parse all csv data curList = pdb->decodeCSV(csvfilename, sep, quote, -1, &numfields); //can not operate on an empty result if (numfields==0) return; if (extractFieldNamesCheckbox->isChecked()) { int cfieldnum = 0; for ( QStringList::Iterator ct = curList.begin(); ct != curList.end(); ++ct ) { QString thisfield = *ct; //basic conforming thisfield.replace(" ", ""); thisfield.replace('"', ""); thisfield.replace("'",""); thisfield.replace(",",""); thisfield.replace(";",""); if (thisfield.isEmpty()) thisfield.append("field"); fieldList << thisfield; cfieldnum++; if (cfieldnum==numfields) break; } //pop the fieldnames for (int e=0; eexecuteSQLDirect(QString("BEGIN TRANSACTION RESTOREPOINT;"))) goto rollback; //execute the create table statement if (!pdb->executeSQLDirect(sql)) goto rollback; {//avoid error on MSVC due to rollback label //now lets import all data, one row at a time for ( int i=0; i < curList.size(); ++i ) { if (colNum==0) { sql = "INSERT INTO "; sql.append(tabname); sql.append(" VALUES("); } //need to mprintf here //sql.append(*ct); char * formSQL = sqlite3_mprintf("%Q",(const char *) curList[i]); sql.append(formSQL); if (formSQL) sqlite3_free(formSQL); colNum++; if (colNumexecuteSQLDirect(sql)) goto rollback; } progress.setValue(i); if (progress.wasCanceled()) goto rollback; } } //everything ok, just return //if (!pdb->executeSQL(QString("COMMIT TRANSACTION RESTOREPOINT;"))) goto rollback; pdb->setDirtyDirect(true); QApplication::restoreOverrideCursor(); // restore original cursor accept(); return; rollback: progress.cancel(); QApplication::restoreOverrideCursor(); // restore original cursor QString error = "Error importing data. Message from database engine: "; error.append(pdb->lastErrorMessage); QMessageBox::warning( this, applicationName, error ); //we will uncomment this when SQLite support nested transactions pdb->executeSQLDirect(QString("ROLLBACK TRANSACTION RESTOREPOINT;")); } void importCSVForm::preview() { //get only 20 lines, for preview int maxrecs = 20; curList = pdb->decodeCSV(csvfilename, sep, quote, maxrecs, &numfields); //qDebug("count = %d, numfields = %d", curList .count(), numfields); previewTable->setNumRows(0); previewTable->setNumCols(0); previewTable->setNumCols(numfields); int cheadnum = 0; //can not operate on an empty result if (numfields==0) return; if (extractFieldNamesCheckbox->isChecked()) { for ( QStringList::Iterator ct = curList.begin(); ct != curList.end(); ++ct ) { previewTable->horizontalHeader()->setLabel( cheadnum, *ct ); cheadnum++; if (cheadnum==numfields) break; } //pop the fieldnames for (int e=0; esetNumRows(curList.count()/numfields); int rowNum = 0; int colNum = 0; for ( QStringList::Iterator ct = curList .begin(); ct != curList .end(); ++ct ) { if (colNum==0) previewTable->verticalHeader()->setLabel( rowNum, QString::number(rowNum,10) ); previewTable->setText( rowNum, colNum,*ct); colNum++; if (colNum==numfields) { colNum = 0; rowNum ++; } } } void importCSVForm::fieldSeparatorChanged() { QString curText =fieldBox->currentText(); if (curText.compare(QString("TAB"))==0) { sep = 9; } else { QChar qsep = curText.at(0); sep = (char) qsep.ascii(); } preview(); } void importCSVForm::textQuoteChanged() { QString curText = quoteBox->currentText(); QChar qquote = curText.at(0); quote = (char) qquote.ascii(); preview(); } void importCSVForm::extractFieldNamesChanged( bool enabled ) { preview(); } sqlitebrowser-2.0.0~beta1+ds.1/editformwindow.cpp0000644000175000017500000000430211254510210022235 0ustar lisandrolisandro#include "editformwindow.h" #include #include #include /* * Constructs a editFormWindow as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ editFormWindow::editFormWindow(QWidget* parent, const char* name, Qt::WindowFlags fl) : Q3MainWindow(parent, name, fl) { setupUi(this); (void)statusBar(); } /* * Destroys the object and frees any allocated resources */ editFormWindow::~editFormWindow() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void editFormWindow::languageChange() { retranslateUi(this); } void editFormWindow::fileNew() { qWarning("editFormWindow::fileNew(): Not implemented yet"); } void editFormWindow::fileOpen() { qWarning("editFormWindow::fileOpen(): Not implemented yet"); } void editFormWindow::fileSave() { qWarning("editFormWindow::fileSave(): Not implemented yet"); } void editFormWindow::fileSaveAs() { qWarning("editFormWindow::fileSaveAs(): Not implemented yet"); } void editFormWindow::filePrint() { qWarning("editFormWindow::filePrint(): Not implemented yet"); } void editFormWindow::fileExit() { qWarning("editFormWindow::fileExit(): Not implemented yet"); } void editFormWindow::editUndo() { qWarning("editFormWindow::editUndo(): Not implemented yet"); } void editFormWindow::editRedo() { qWarning("editFormWindow::editRedo(): Not implemented yet"); } void editFormWindow::editCut() { qWarning("editFormWindow::editCut(): Not implemented yet"); } void editFormWindow::editCopy() { qWarning("editFormWindow::editCopy(): Not implemented yet"); } void editFormWindow::editPaste() { qWarning("editFormWindow::editPaste(): Not implemented yet"); } void editFormWindow::editFind() { qWarning("editFormWindow::editFind(): Not implemented yet"); } void editFormWindow::helpIndex() { qWarning("editFormWindow::helpIndex(): Not implemented yet"); } void editFormWindow::helpContents() { qWarning("editFormWindow::helpContents(): Not implemented yet"); } void editFormWindow::helpAbout() { qWarning("editFormWindow::helpAbout(): Not implemented yet"); } sqlitebrowser-2.0.0~beta1+ds.1/editformwindow.h0000644000175000017500000003274711254510210021720 0ustar lisandrolisandro#ifndef EDITFORMWINDOW_H #define EDITFORMWINDOW_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE class Ui_editFormWindow { public: QAction *fileNewAction; QAction *fileOpenAction; QAction *fileSaveAction; QAction *fileSaveAsAction; QAction *filePrintAction; QAction *fileExitAction; QAction *editUndoAction; QAction *editRedoAction; QAction *editCutAction; QAction *editCopyAction; QAction *editPasteAction; QAction *editFindAction; QAction *helpContentsAction; QAction *helpIndexAction; QAction *helpAboutAction; QWidget *widget; QVBoxLayout *vboxLayout; Q3ToolBar *toolBar; QMenuBar *MenuBar; QMenu *fileMenu; QMenu *editMenu; QMenu *helpMenu; void setupUi(Q3MainWindow *editFormWindow) { if (editFormWindow->objectName().isEmpty()) editFormWindow->setObjectName(QString::fromUtf8("editFormWindow")); editFormWindow->resize(331, 435); editFormWindow->setDockWindowsMovable(true); fileNewAction = new QAction(editFormWindow); fileNewAction->setObjectName(QString::fromUtf8("fileNewAction")); fileNewAction->setName("fileNewAction"); const QIcon icon = QIcon(qPixmapFromMimeSource("filenew")); fileNewAction->setIcon(icon); fileOpenAction = new QAction(editFormWindow); fileOpenAction->setObjectName(QString::fromUtf8("fileOpenAction")); fileOpenAction->setName("fileOpenAction"); const QIcon icon1 = QIcon(qPixmapFromMimeSource("fileopen")); fileOpenAction->setIcon(icon1); fileSaveAction = new QAction(editFormWindow); fileSaveAction->setObjectName(QString::fromUtf8("fileSaveAction")); fileSaveAction->setName("fileSaveAction"); const QIcon icon2 = QIcon(qPixmapFromMimeSource("filesave")); fileSaveAction->setIcon(icon2); fileSaveAsAction = new QAction(editFormWindow); fileSaveAsAction->setObjectName(QString::fromUtf8("fileSaveAsAction")); fileSaveAsAction->setName("fileSaveAsAction"); filePrintAction = new QAction(editFormWindow); filePrintAction->setObjectName(QString::fromUtf8("filePrintAction")); filePrintAction->setName("filePrintAction"); const QIcon icon3 = QIcon(qPixmapFromMimeSource("print")); filePrintAction->setIcon(icon3); fileExitAction = new QAction(editFormWindow); fileExitAction->setObjectName(QString::fromUtf8("fileExitAction")); fileExitAction->setName("fileExitAction"); editUndoAction = new QAction(editFormWindow); editUndoAction->setObjectName(QString::fromUtf8("editUndoAction")); editUndoAction->setName("editUndoAction"); const QIcon icon4 = QIcon(qPixmapFromMimeSource("undo")); editUndoAction->setIcon(icon4); editRedoAction = new QAction(editFormWindow); editRedoAction->setObjectName(QString::fromUtf8("editRedoAction")); editRedoAction->setName("editRedoAction"); const QIcon icon5 = QIcon(qPixmapFromMimeSource("redo")); editRedoAction->setIcon(icon5); editCutAction = new QAction(editFormWindow); editCutAction->setObjectName(QString::fromUtf8("editCutAction")); editCutAction->setName("editCutAction"); const QIcon icon6 = QIcon(qPixmapFromMimeSource("editcut")); editCutAction->setIcon(icon6); editCopyAction = new QAction(editFormWindow); editCopyAction->setObjectName(QString::fromUtf8("editCopyAction")); editCopyAction->setName("editCopyAction"); const QIcon icon7 = QIcon(qPixmapFromMimeSource("editcopy")); editCopyAction->setIcon(icon7); editPasteAction = new QAction(editFormWindow); editPasteAction->setObjectName(QString::fromUtf8("editPasteAction")); editPasteAction->setName("editPasteAction"); const QIcon icon8 = QIcon(qPixmapFromMimeSource("editpaste")); editPasteAction->setIcon(icon8); editFindAction = new QAction(editFormWindow); editFindAction->setObjectName(QString::fromUtf8("editFindAction")); editFindAction->setName("editFindAction"); const QIcon icon9 = QIcon(qPixmapFromMimeSource("searchfind")); editFindAction->setIcon(icon9); helpContentsAction = new QAction(editFormWindow); helpContentsAction->setObjectName(QString::fromUtf8("helpContentsAction")); helpContentsAction->setName("helpContentsAction"); helpIndexAction = new QAction(editFormWindow); helpIndexAction->setObjectName(QString::fromUtf8("helpIndexAction")); helpIndexAction->setName("helpIndexAction"); helpAboutAction = new QAction(editFormWindow); helpAboutAction->setObjectName(QString::fromUtf8("helpAboutAction")); helpAboutAction->setName("helpAboutAction"); widget = new QWidget(editFormWindow); widget->setObjectName(QString::fromUtf8("widget")); vboxLayout = new QVBoxLayout(widget); vboxLayout->setSpacing(6); vboxLayout->setMargin(11); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); vboxLayout->setContentsMargins(0, 0, 0, 0); editFormWindow->setCentralWidget(widget); toolBar = new Q3ToolBar(editFormWindow); toolBar->setObjectName(QString::fromUtf8("toolBar")); MenuBar = new QMenuBar(editFormWindow); MenuBar->setObjectName(QString::fromUtf8("MenuBar")); fileMenu = new QMenu(MenuBar); fileMenu->setObjectName(QString::fromUtf8("fileMenu")); editMenu = new QMenu(MenuBar); editMenu->setObjectName(QString::fromUtf8("editMenu")); helpMenu = new QMenu(MenuBar); helpMenu->setObjectName(QString::fromUtf8("helpMenu")); toolBar->addAction(fileOpenAction); toolBar->addAction(fileSaveAction); toolBar->addAction(filePrintAction); toolBar->addSeparator(); toolBar->addAction(editCutAction); toolBar->addAction(editCopyAction); toolBar->addAction(editPasteAction); toolBar->addAction(helpContentsAction); MenuBar->addAction(fileMenu->menuAction()); MenuBar->addAction(editMenu->menuAction()); MenuBar->addAction(helpMenu->menuAction()); fileMenu->addAction(fileOpenAction); fileMenu->addAction(fileSaveAction); fileMenu->addSeparator(); fileMenu->addAction(filePrintAction); fileMenu->addSeparator(); editMenu->addAction(editUndoAction); editMenu->addAction(editRedoAction); editMenu->addSeparator(); editMenu->addAction(editCutAction); editMenu->addAction(editCopyAction); editMenu->addAction(editPasteAction); helpMenu->addAction(helpAboutAction); retranslateUi(editFormWindow); QMetaObject::connectSlotsByName(editFormWindow); } // setupUi void retranslateUi(Q3MainWindow *editFormWindow) { editFormWindow->setWindowTitle(QApplication::translate("editFormWindow", "Edit database cell", 0, QApplication::UnicodeUTF8)); fileNewAction->setIconText(QApplication::translate("editFormWindow", "New", 0, QApplication::UnicodeUTF8)); fileNewAction->setText(QApplication::translate("editFormWindow", "&New", 0, QApplication::UnicodeUTF8)); fileNewAction->setShortcut(QApplication::translate("editFormWindow", "Ctrl+N", 0, QApplication::UnicodeUTF8)); fileOpenAction->setIconText(QApplication::translate("editFormWindow", "&Import", 0, QApplication::UnicodeUTF8)); fileOpenAction->setText(QApplication::translate("editFormWindow", "&Import", 0, QApplication::UnicodeUTF8)); fileOpenAction->setShortcut(QApplication::translate("editFormWindow", "Ctrl+I", 0, QApplication::UnicodeUTF8)); fileSaveAction->setIconText(QApplication::translate("editFormWindow", "&Export", 0, QApplication::UnicodeUTF8)); fileSaveAction->setText(QApplication::translate("editFormWindow", "&Export", 0, QApplication::UnicodeUTF8)); fileSaveAction->setShortcut(QApplication::translate("editFormWindow", "Ctrl+E", 0, QApplication::UnicodeUTF8)); fileSaveAsAction->setIconText(QApplication::translate("editFormWindow", "Save As", 0, QApplication::UnicodeUTF8)); fileSaveAsAction->setText(QApplication::translate("editFormWindow", "Save &As...", 0, QApplication::UnicodeUTF8)); fileSaveAsAction->setShortcut(QString()); filePrintAction->setIconText(QApplication::translate("editFormWindow", "Print", 0, QApplication::UnicodeUTF8)); filePrintAction->setText(QApplication::translate("editFormWindow", "&Print...", 0, QApplication::UnicodeUTF8)); filePrintAction->setShortcut(QApplication::translate("editFormWindow", "Ctrl+P", 0, QApplication::UnicodeUTF8)); fileExitAction->setIconText(QApplication::translate("editFormWindow", "Exit", 0, QApplication::UnicodeUTF8)); fileExitAction->setText(QApplication::translate("editFormWindow", "E&xit", 0, QApplication::UnicodeUTF8)); fileExitAction->setShortcut(QString()); editUndoAction->setIconText(QApplication::translate("editFormWindow", "Undo", 0, QApplication::UnicodeUTF8)); editUndoAction->setText(QApplication::translate("editFormWindow", "&Undo", 0, QApplication::UnicodeUTF8)); editUndoAction->setShortcut(QApplication::translate("editFormWindow", "Ctrl+Z", 0, QApplication::UnicodeUTF8)); editRedoAction->setIconText(QApplication::translate("editFormWindow", "Redo", 0, QApplication::UnicodeUTF8)); editRedoAction->setText(QApplication::translate("editFormWindow", "&Redo", 0, QApplication::UnicodeUTF8)); editRedoAction->setShortcut(QApplication::translate("editFormWindow", "Ctrl+Y", 0, QApplication::UnicodeUTF8)); editCutAction->setIconText(QApplication::translate("editFormWindow", "Cut", 0, QApplication::UnicodeUTF8)); editCutAction->setText(QApplication::translate("editFormWindow", "&Cut", 0, QApplication::UnicodeUTF8)); editCutAction->setShortcut(QApplication::translate("editFormWindow", "Ctrl+X", 0, QApplication::UnicodeUTF8)); editCopyAction->setIconText(QApplication::translate("editFormWindow", "Copy", 0, QApplication::UnicodeUTF8)); editCopyAction->setText(QApplication::translate("editFormWindow", "C&opy", 0, QApplication::UnicodeUTF8)); editCopyAction->setShortcut(QApplication::translate("editFormWindow", "Ctrl+C", 0, QApplication::UnicodeUTF8)); editPasteAction->setIconText(QApplication::translate("editFormWindow", "Paste", 0, QApplication::UnicodeUTF8)); editPasteAction->setText(QApplication::translate("editFormWindow", "&Paste", 0, QApplication::UnicodeUTF8)); editPasteAction->setShortcut(QApplication::translate("editFormWindow", "Ctrl+V", 0, QApplication::UnicodeUTF8)); editFindAction->setIconText(QApplication::translate("editFormWindow", "Find", 0, QApplication::UnicodeUTF8)); editFindAction->setText(QApplication::translate("editFormWindow", "&Find...", 0, QApplication::UnicodeUTF8)); editFindAction->setShortcut(QApplication::translate("editFormWindow", "Ctrl+F", 0, QApplication::UnicodeUTF8)); helpContentsAction->setIconText(QApplication::translate("editFormWindow", "Contents", 0, QApplication::UnicodeUTF8)); helpContentsAction->setText(QApplication::translate("editFormWindow", "&Contents...", 0, QApplication::UnicodeUTF8)); helpContentsAction->setShortcut(QString()); helpIndexAction->setIconText(QApplication::translate("editFormWindow", "Index", 0, QApplication::UnicodeUTF8)); helpIndexAction->setText(QApplication::translate("editFormWindow", "&Index...", 0, QApplication::UnicodeUTF8)); helpIndexAction->setShortcut(QString()); helpAboutAction->setIconText(QApplication::translate("editFormWindow", "&What is", 0, QApplication::UnicodeUTF8)); helpAboutAction->setText(QApplication::translate("editFormWindow", "&What is", 0, QApplication::UnicodeUTF8)); helpAboutAction->setShortcut(QString()); toolBar->setLabel(QApplication::translate("editFormWindow", "Tools", 0, QApplication::UnicodeUTF8)); fileMenu->setTitle(QApplication::translate("editFormWindow", "&File", 0, QApplication::UnicodeUTF8)); editMenu->setTitle(QApplication::translate("editFormWindow", "&Edit", 0, QApplication::UnicodeUTF8)); helpMenu->setTitle(QApplication::translate("editFormWindow", "&Help", 0, QApplication::UnicodeUTF8)); } // retranslateUi }; namespace Ui { class editFormWindow: public Ui_editFormWindow {}; } // namespace Ui QT_END_NAMESPACE class editFormWindow : public Q3MainWindow, public Ui::editFormWindow { Q_OBJECT public: editFormWindow(QWidget* parent = 0, const char* name = 0, Qt::WindowFlags fl = Qt::WType_TopLevel); ~editFormWindow(); public slots: virtual void fileNew(); virtual void fileOpen(); virtual void fileSave(); virtual void fileSaveAs(); virtual void filePrint(); virtual void fileExit(); virtual void editUndo(); virtual void editRedo(); virtual void editCut(); virtual void editCopy(); virtual void editPaste(); virtual void editFind(); virtual void helpIndex(); virtual void helpContents(); virtual void helpAbout(); protected slots: virtual void languageChange(); }; #endif // EDITFORMWINDOW_H sqlitebrowser-2.0.0~beta1+ds.1/sqlitedb.cpp0000644000175000017500000004675711305531167021042 0ustar lisandrolisandro#include "sqlitedb.h" #include "sqlbrowser_util.h" #include #include #include #include #include #include #include void DBBrowserTable::addField(int order, const QString& wfield,const QString& wtype) { fldmap[order] = DBBrowserField(wfield,wtype); } bool DBBrowserDB::isOpen ( ) { return _db!=0; } void DBBrowserDB::setDirty(bool dirtyval) { if ((dirty==false)&&(dirtyval==true)) { setRestorePoint(); } dirty = dirtyval; if (logWin) { logWin->msgDBDirtyState(dirty); } } void DBBrowserDB::setDirtyDirect(bool dirtyval) { dirty = dirtyval; if (logWin) { logWin->msgDBDirtyState(dirty); } } bool DBBrowserDB::getDirty() { return dirty; } void DBBrowserDB::setEncoding( int encoding ) { curEncoding = encoding; } void DBBrowserDB::setDefaultNewData( const QString & data ) { curNewData = data; } QString DBBrowserDB::GetEncodedQString( const QString & input) { if (curEncoding==kEncodingUTF8) return input.utf8(); if (curEncoding==kEncodingLatin1) return input.latin1(); return input; } QString DBBrowserDB::GetDecodedQString( const QString & input) { if (curEncoding==kEncodingUTF8) return QString::fromUtf8(input); if (curEncoding==kEncodingLatin1) return QString::fromLatin1(input); return input; } bool DBBrowserDB::open ( const QString & db) { bool ok=false; int err; if (isOpen()) close(); //try to verify the SQLite version 3 file header QFile dbfile(db); if ( dbfile.open( QIODevice::ReadOnly ) ) { char buffer[16+1]; dbfile.readLine(buffer, 16); QString contents = QString(buffer); dbfile.close(); if (!contents.startsWith("SQLite format 3")) { lastErrorMessage = QString("File is not a SQLite 3 database"); return false; } } else { lastErrorMessage = QString("File could not be read"); return false; } lastErrorMessage = QString("no error"); err = sqlite3_open(GetEncodedQString(db), &_db); if ( err ) { lastErrorMessage = sqlite3_errmsg(_db); sqlite3_close(_db); _db = 0; return false; } if (_db){ if (SQLITE_OK==sqlite3_exec(_db,"PRAGMA empty_result_callbacks = ON;", NULL,NULL,NULL)){ if (SQLITE_OK==sqlite3_exec(_db,"PRAGMA show_datatypes = ON;", NULL,NULL,NULL)){ ok=true; setDirty(false); } curDBFilename = db; } } return ok; } bool DBBrowserDB::setRestorePoint() { if (!isOpen()) return false; if (_db){ sqlite3_exec(_db,"BEGIN TRANSACTION RESTOREPOINT;", NULL,NULL,NULL); setDirty(false); } return true; } bool DBBrowserDB::save() { if (!isOpen()) return false; if (_db){ sqlite3_exec(_db,"COMMIT TRANSACTION RESTOREPOINT;", NULL,NULL,NULL); setDirty(false); } return true; } bool DBBrowserDB::revert() { if (!isOpen()) return false; if (_db){ sqlite3_exec(_db,"ROLLBACK TRANSACTION RESTOREPOINT;", NULL,NULL,NULL); setDirty(false); } return true; } bool DBBrowserDB::create ( const QString & db) { bool ok=false; if (isOpen()) close(); lastErrorMessage = QString("no error"); if( sqlite3_open(GetEncodedQString(db), &_db) != SQLITE_OK ){ lastErrorMessage = sqlite3_errmsg(_db); sqlite3_close(_db); _db = 0; return false; } if (_db){ if (SQLITE_OK==sqlite3_exec(_db,"PRAGMA empty_result_callbacks = ON;", NULL,NULL,NULL)){ if (SQLITE_OK==sqlite3_exec(_db,"PRAGMA show_datatypes = ON;", NULL,NULL,NULL)){ ok=true; setDirty(false); } curDBFilename = db; } } return ok; } void DBBrowserDB::close (){ if (_db) { if (getDirty()) { QString msg = "Do you want to save the changes made to the database file "; msg.append(curDBFilename); msg.append(" ?"); if (QMessageBox::question( 0, applicationName ,msg, QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes) { save(); } else { //not really necessary, I think... but will not hurt. revert(); } } sqlite3_close(_db); } _db = 0; idxmap.clear(); tbmap.clear(); idmap.clear(); browseRecs.clear(); browseFields.clear(); hasValidBrowseSet = false; } bool DBBrowserDB::compact ( ) { char *errmsg; bool ok=false; if (!isOpen()) return false; if (_db){ save(); logSQL(QString("VACUUM;"), kLogMsg_App); if (SQLITE_OK==sqlite3_exec(_db,"VACUUM;", NULL,NULL,&errmsg)){ ok=true; setDirty(false); } } if (!ok){ lastErrorMessage = QString(errmsg); return false; }else{ return true; } } bool DBBrowserDB::reload( const QString & filename, int * lineErr) { /*to avoid a nested transaction error*/ sqlite3_exec(_db,"COMMIT;", NULL,NULL,NULL); FILE * cfile = fopen((const char *) filename, (const char *) "r"); load_database(_db, cfile, lineErr); fclose(cfile); setDirty(false); if ((*lineErr)!=0) { return false; } return true; } bool DBBrowserDB::dump( const QString & filename) { FILE * cfile = fopen((const char *) filename, (const char *) "w"); if (!cfile) { return false; } dump_database(_db, cfile); fclose(cfile); return true; } bool DBBrowserDB::executeSQL ( const QString & statement) { char *errmsg; bool ok=false; if (!isOpen()) return false; if (_db){ logSQL(statement, kLogMsg_App); setDirty(true); if (SQLITE_OK==sqlite3_exec(_db,GetEncodedQString(statement), NULL,NULL,&errmsg)){ ok=true; } } if (!ok){ lastErrorMessage = QString(errmsg); return false; }else{ return true; } } bool DBBrowserDB::executeSQLDirect ( const QString & statement) { //no transaction support char *errmsg; bool ok=false; if (!isOpen()) return false; if (_db){ logSQL(statement, kLogMsg_App); if (SQLITE_OK==sqlite3_exec(_db,GetEncodedQString(statement), NULL,NULL,&errmsg)){ ok=true; } } if (!ok){ lastErrorMessage = QString(errmsg); return false; }else{ return true; } } bool DBBrowserDB::addRecord ( ) { char *errmsg; if (!hasValidBrowseSet) return false; if (!isOpen()) return false; bool ok = false; int fields = browseFields.count(); QString emptyvalue = curNewData; QString statement = "INSERT INTO "; statement.append(GetEncodedQString(curBrowseTableName)); statement.append(" VALUES("); for ( int i=1; i<=fields; i++ ) { statement.append(emptyvalue); if (i0) {//table exists getTableRecords( tablename ); browseFields = testFields; hasValidBrowseSet = true; curBrowseTableName = tablename; } else { hasValidBrowseSet = false; curBrowseTableName = QString(" "); browseFields.clear(); browseRecs.clear(); idmap.clear(); } return hasValidBrowseSet; } void DBBrowserDB::getTableRecords( const QString & tablename ) { sqlite3_stmt *vm; const char *tail; int ncol; QStringList r; // char *errmsg; int err=0; // int tabnum = 0; browseRecs.clear(); idmap.clear(); lastErrorMessage = QString("no error"); QString statement = "SELECT rowid, * FROM "; statement.append( GetEncodedQString(tablename) ); statement.append(" ORDER BY rowid; "); //qDebug(statement); logSQL(statement, kLogMsg_App); err=sqlite3_prepare(_db,statement,statement.length(), &vm, &tail); if (err == SQLITE_OK){ int rownum = 0; while ( sqlite3_step(vm) == SQLITE_ROW ){ r.clear(); ncol = sqlite3_data_count(vm); for (int e=0; e loglimit)&&(msgtype==kLogMsg_App)) { statement.truncate(32); statement.append("... ..."); } logWin->log(statement, msgtype); } } void DBBrowserDB::updateSchema( ) { // qDebug ("Getting list of tables"); sqlite3_stmt *vm; const char *tail; QStringList r; int err=0; QString num; int idxnum =0; int tabnum = 0; idxmap.clear(); tbmap.clear(); lastErrorMessage = QString("no error"); QString statement = "SELECT name, sql " "FROM sqlite_master " "WHERE type='table' ;"; err=sqlite3_prepare(_db, (const char *) statement,statement.length(), &vm, &tail); if (err == SQLITE_OK){ logSQL(statement, kLogMsg_App); while ( sqlite3_step(vm) == SQLITE_ROW ){ num.setNum(tabnum); QString val1, val2; val1 = QString((const char *) sqlite3_column_text(vm, 0)); val2 = QString((const char *) sqlite3_column_text(vm, 1)); tbmap[num] = DBBrowserTable(GetDecodedQString(val1), GetDecodedQString(val2)); tabnum++; } sqlite3_finalize(vm); }else{ qDebug ("could not get list of tables: %d, %s",err,sqlite3_errmsg(_db)); } //now get the field list for each table in tbmap tableMap::Iterator it; for ( it = tbmap.begin(); it != tbmap.end(); ++it ) { statement = "PRAGMA TABLE_INFO("; statement.append( (const char *) GetEncodedQString(it.data().getname())); statement.append(");"); logSQL(statement, kLogMsg_App); err=sqlite3_prepare(_db,statement,statement.length(), &vm, &tail); if (err == SQLITE_OK){ it.data(). fldmap.clear(); int e = 0; while ( sqlite3_step(vm) == SQLITE_ROW ){ if (sqlite3_column_count(vm)==6) { QString val1, val2; int ispk= 0; val1 = QString((const char *) sqlite3_column_text(vm, 1)); val2 = QString((const char *) sqlite3_column_text(vm, 2)); ispk = sqlite3_column_int(vm, 5); if (ispk==1){ val2.append(QString(" PRIMARY KEY")); } it.data().addField(e,GetDecodedQString(val1),GetDecodedQString(val2)); e++; } } sqlite3_finalize(vm); } else{ lastErrorMessage = QString ("could not get types"); } } statement = "SELECT name, sql " "FROM sqlite_master " "WHERE type='index' "; /*"ORDER BY name;"*/ //finally get indices err=sqlite3_prepare(_db,statement,statement.length(), &vm, &tail); logSQL(statement, kLogMsg_App); if (err == SQLITE_OK){ while ( sqlite3_step(vm) == SQLITE_ROW ){ QString val1, val2; val1 = QString((const char *) sqlite3_column_text(vm, 0)); val2 = QString((const char *) sqlite3_column_text(vm, 1)); num.setNum(idxnum); idxmap[num] = DBBrowserIndex(GetDecodedQString(val1),GetDecodedQString(val2)); idxnum ++; } sqlite3_finalize(vm); }else{ lastErrorMessage = QString ("could not get list of indices"); } } QStringList DBBrowserDB::decodeCSV(const QString & csvfilename, char sep, char quote, int maxrecords, int * numfields) { QFile file(csvfilename); QStringList result; QString current = ""; bool inquotemode = false; bool inescapemode = false; int recs = 0; *numfields = 0; if ( file.open( QIODevice::ReadWrite ) ) { QProgressDialog progress("Decoding CSV file...", "Cancel", 0, file.size()); progress.setWindowModality(Qt::ApplicationModal); char c=0; while ( c!=-1) { c = file.getch(); if (c==quote){ if (inquotemode){ if (inescapemode){ inescapemode = false; //add the escaped char here current.append(c); } else { //are we escaping, or just finishing the quote? char d = file.getch(); if (d==quote) { inescapemode = true; } else { inquotemode = false; } file.ungetch(d); } } else { inquotemode = true; } } else if (c==sep) { if (inquotemode){ //add the sep here current.append(c); } else { //not quoting, start new record result << current; current = ""; } } else if (c==10) { if (inquotemode){ //add the newline current.append(c); } else { //not quoting, start new record result << current; current = ""; //for the first line, store the field count if (*numfields == 0){ *numfields = result.count(); } recs++; progress.setValue(file.pos()); if (progress.wasCanceled()) break; if ((recs>maxrecords)&&(maxrecords!=-1)) { break; } } } else if (c==13) { if (inquotemode){ //add the carrier return if in quote mode only current.append(c); } } else {//another character type current.append(c); } } file.close(); //do we still have a last result, not appended? //proper csv files should end with a linefeed , so this is not necessary //if (current.length()>0) result << current; } return result; } sqlitebrowser-2.0.0~beta1+ds.1/editfieldform.h0000644000175000017500000001545111304272743021501 0ustar lisandrolisandro#ifndef EDITFIELDFORM_H #define EDITFIELDFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE class Ui_editFieldForm { public: QGridLayout *gridLayout; QVBoxLayout *vboxLayout; QLabel *textLabel1; QLabel *textLabel2; QSpacerItem *spacer17; QHBoxLayout *hboxLayout; QSpacerItem *spacer15; QPushButton *cancelButton; QPushButton *saveButton; QGridLayout *gridLayout1; QHBoxLayout *hboxLayout1; QComboBox *typeBox; QToolButton *typeButton; QLineEdit *nameLineEdit; void setupUi(QDialog *editFieldForm) { if (editFieldForm->objectName().isEmpty()) editFieldForm->setObjectName(QString::fromUtf8("editFieldForm")); editFieldForm->resize(352, 140); gridLayout = new QGridLayout(editFieldForm); gridLayout->setSpacing(6); gridLayout->setContentsMargins(11, 11, 11, 11); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); vboxLayout = new QVBoxLayout(); vboxLayout->setSpacing(6); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); textLabel1 = new QLabel(editFieldForm); textLabel1->setObjectName(QString::fromUtf8("textLabel1")); textLabel1->setWordWrap(false); vboxLayout->addWidget(textLabel1); textLabel2 = new QLabel(editFieldForm); textLabel2->setObjectName(QString::fromUtf8("textLabel2")); textLabel2->setWordWrap(false); vboxLayout->addWidget(textLabel2); gridLayout->addLayout(vboxLayout, 0, 0, 1, 1); spacer17 = new QSpacerItem(20, 14, QSizePolicy::Minimum, QSizePolicy::Expanding); gridLayout->addItem(spacer17, 1, 1, 1, 1); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); spacer15 = new QSpacerItem(41, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacer15); cancelButton = new QPushButton(editFieldForm); cancelButton->setObjectName(QString::fromUtf8("cancelButton")); hboxLayout->addWidget(cancelButton); saveButton = new QPushButton(editFieldForm); saveButton->setObjectName(QString::fromUtf8("saveButton")); saveButton->setEnabled(false); saveButton->setDefault(true); hboxLayout->addWidget(saveButton); gridLayout->addLayout(hboxLayout, 2, 0, 1, 2); gridLayout1 = new QGridLayout(); gridLayout1->setSpacing(6); gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); typeBox = new QComboBox(editFieldForm); typeBox->setObjectName(QString::fromUtf8("typeBox")); hboxLayout1->addWidget(typeBox); typeButton = new QToolButton(editFieldForm); typeButton->setObjectName(QString::fromUtf8("typeButton")); QSizePolicy sizePolicy(static_cast(0), static_cast(0)); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(typeButton->sizePolicy().hasHeightForWidth()); typeButton->setSizePolicy(sizePolicy); hboxLayout1->addWidget(typeButton); gridLayout1->addLayout(hboxLayout1, 1, 0, 1, 1); nameLineEdit = new QLineEdit(editFieldForm); nameLineEdit->setObjectName(QString::fromUtf8("nameLineEdit")); gridLayout1->addWidget(nameLineEdit, 0, 0, 1, 1); gridLayout->addLayout(gridLayout1, 0, 1, 1, 1); retranslateUi(editFieldForm); QObject::connect(cancelButton, SIGNAL(clicked()), editFieldForm, SLOT(reject())); QObject::connect(saveButton, SIGNAL(clicked()), editFieldForm, SLOT(confirmEdit())); QObject::connect(nameLineEdit, SIGNAL(textChanged(QString)), editFieldForm, SLOT(enableSave())); QObject::connect(typeButton, SIGNAL(clicked()), editFieldForm, SLOT(getCustomType())); QMetaObject::connectSlotsByName(editFieldForm); } // setupUi void retranslateUi(QDialog *editFieldForm) { editFieldForm->setWindowTitle(QApplication::translate("editFieldForm", "Edit field name and type", 0, QApplication::UnicodeUTF8)); textLabel1->setText(QApplication::translate("editFieldForm", "Field name:", 0, QApplication::UnicodeUTF8)); textLabel2->setText(QApplication::translate("editFieldForm", "Field type:", 0, QApplication::UnicodeUTF8)); cancelButton->setText(QApplication::translate("editFieldForm", "Cancel", 0, QApplication::UnicodeUTF8)); saveButton->setText(QApplication::translate("editFieldForm", "Apply Changes", 0, QApplication::UnicodeUTF8)); typeBox->clear(); typeBox->insertItems(0, QStringList() << QString() << QApplication::translate("editFieldForm", "TEXT", 0, QApplication::UnicodeUTF8) << QApplication::translate("editFieldForm", "NUMERIC", 0, QApplication::UnicodeUTF8) << QApplication::translate("editFieldForm", "BLOB", 0, QApplication::UnicodeUTF8) << QApplication::translate("editFieldForm", "INTEGER PRIMARY KEY", 0, QApplication::UnicodeUTF8) ); typeButton->setText(QApplication::translate("editFieldForm", "...", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP typeButton->setProperty("toolTip", QVariant(QApplication::translate("editFieldForm", "Custom type", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS typeButton->setProperty("whatsThis", QVariant(QApplication::translate("editFieldForm", "Click this button to enter a new type for the field", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS } // retranslateUi }; namespace Ui { class editFieldForm: public Ui_editFieldForm {}; } // namespace Ui QT_END_NAMESPACE class editFieldForm : public QDialog, public Ui::editFieldForm { Q_OBJECT public: editFieldForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~editFieldForm(); QString name; QString type; public slots: virtual void setInitialValues( QString name, QString type ); virtual void confirmEdit(); virtual void enableSave(); virtual void getCustomType(); protected slots: virtual void languageChange(); }; #endif // EDITFIELDFORM_H sqlitebrowser-2.0.0~beta1+ds.1/sqlitebrowsertypes.h0000644000175000017500000000022410077300277022646 0ustar lisandrolisandro/*types for encoded media data*/ enum { kSQLiteMediaType_Void, kSQLiteMediaType_Integer, kSQLiteMediaType_String, kSQLiteMediaType_Binary }; sqlitebrowser-2.0.0~beta1+ds.1/preferencesform.cpp0000644000175000017500000000766011304272743022407 0ustar lisandrolisandro#include "preferencesform.h" #include #include #include #include "qdir.h" #include "qsettings.h" #include "q3filedialog.h" /* * Constructs a preferencesForm 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. */ preferencesForm::preferencesForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); init(); } /* * Destroys the object and frees any allocated resources */ preferencesForm::~preferencesForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void preferencesForm::languageChange() { retranslateUi(this); } /**************************************************************************** ** ui.h extension file, included from the uic-generated form implementation. ** ** If you want to add, delete, or rename functions or slots, use ** Qt Designer to update this file, preserving your code. ** ** You should not define a constructor or destructor in this file. ** Instead, write your code in functions called init() and destroy(). ** These will automatically be called by the form's constructor and ** destructor. *****************************************************************************/ void preferencesForm::init() { loadSettings(); } void preferencesForm::defaultDataChanged( int which ) { if (which==2) { defaultnewdata = QString("\'\'"); } else if (which==1) { defaultnewdata = QString("0"); } else { defaultnewdata = QString("NULL"); } } void preferencesForm::defaultTextChanged( int which ) { if (which==1) { defaulttext = QString("Auto"); } else { defaulttext = QString("Plain"); } } void preferencesForm::encodingChanged( int which ) { if (which==1) { defaultencoding = QString("Latin1"); } else { defaultencoding = QString("UTF8"); } } void preferencesForm::chooseLocation() { QString s = Q3FileDialog::getExistingDirectory( defaultlocation, this, "get existing directory", "Choose a directory", TRUE ); defaultlocation = s; locationEdit->setText(defaultlocation); } void preferencesForm::loadSettings() { QSettings settings; settings.setPath( "Tabuleiro.com", "Arca Database Browser 2", QSettings::UserScope ); defaultencoding = settings.readEntry( "/db/defaultencoding", "UTF8" ); defaultnewdata = settings.readEntry( "/db/defaultnewdata", "NULL" ); defaultlocation = settings.readEntry( "/db/defaultlocation", QDir::homeDirPath () ); defaulttext = settings.readEntry( "/db/defaulttext", "Plain" ); if (defaultencoding=="Latin1") { encodingComboBox->setCurrentItem(1) ; } else { encodingComboBox->setCurrentItem(0) ; defaultencoding = QString("UTF8"); } if (defaultnewdata=="\'\'") { defaultdataComboBox->setCurrentItem(2) ; } else if (defaultnewdata=="0") { defaultdataComboBox->setCurrentItem(1) ; } else { defaultdataComboBox->setCurrentItem(0) ; defaultnewdata = QString("NULL"); } if (defaulttext=="Auto") { defaultTextComboBox->setCurrentItem(1) ; } else { defaultTextComboBox->setCurrentItem(0) ; defaulttext = QString("Plain"); } locationEdit->setText(defaultlocation); } void preferencesForm::saveSettings() { QSettings settings; settings.setPath( "sqlitebrowser.sf.net", "SQLite Database Browser 2", QSettings::UserScope ); settings.writeEntry( "/db/defaultencoding", defaultencoding ); settings.writeEntry( "/db/defaultnewdata", defaultnewdata ); settings.writeEntry( "/db/defaultlocation", defaultlocation ); settings.writeEntry( "/db/defaulttext", defaulttext ); accept(); } sqlitebrowser-2.0.0~beta1+ds.1/sqllogform.cpp0000644000175000017500000000252111254510210021362 0ustar lisandrolisandro#include "sqllogform.h" #include #include #include #include "sqlitedb.h" /* * Constructs a sqlLogForm 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. */ sqlLogForm::sqlLogForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); } /* * Destroys the object and frees any allocated resources */ sqlLogForm::~sqlLogForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void sqlLogForm::languageChange() { retranslateUi(this); } void sqlLogForm::closeEvent( QCloseEvent * ) { emit goingAway(); } void sqlLogForm::log( QString & statement, int msgtype) { if (msgtype==kLogMsg_User) { userLogText->setText(userLogText->text()+statement+"\n"); } else { appLogText->setText(appLogText->text()+statement+"\n"); } } void sqlLogForm::msgDBDirtyState( bool dirty) { emit dbState(dirty); } void sqlLogForm::clearLog() { if (logStack->id(logStack->visibleWidget())==kLogMsg_User) { userLogText->clear(); } else { appLogText->clear(); } } sqlitebrowser-2.0.0~beta1+ds.1/addfieldtypeform.h0000644000175000017500000000613711304272743022207 0ustar lisandrolisandro#ifndef ADDFIELDTYPEFORM_H #define ADDFIELDTYPEFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE class Ui_addFieldTypeForm { public: QGridLayout *gridLayout; QLineEdit *typeNameEdit; QHBoxLayout *hboxLayout; QSpacerItem *spacer5; QPushButton *cancelButton; QPushButton *okButton; void setupUi(QDialog *addFieldTypeForm) { if (addFieldTypeForm->objectName().isEmpty()) addFieldTypeForm->setObjectName(QString::fromUtf8("addFieldTypeForm")); addFieldTypeForm->resize(294, 98); gridLayout = new QGridLayout(addFieldTypeForm); gridLayout->setSpacing(6); gridLayout->setContentsMargins(11, 11, 11, 11); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); typeNameEdit = new QLineEdit(addFieldTypeForm); typeNameEdit->setObjectName(QString::fromUtf8("typeNameEdit")); gridLayout->addWidget(typeNameEdit, 0, 0, 1, 1); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); spacer5 = new QSpacerItem(31, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacer5); cancelButton = new QPushButton(addFieldTypeForm); cancelButton->setObjectName(QString::fromUtf8("cancelButton")); hboxLayout->addWidget(cancelButton); okButton = new QPushButton(addFieldTypeForm); okButton->setObjectName(QString::fromUtf8("okButton")); okButton->setDefault(true); hboxLayout->addWidget(okButton); gridLayout->addLayout(hboxLayout, 1, 0, 1, 1); retranslateUi(addFieldTypeForm); QObject::connect(okButton, SIGNAL(clicked()), addFieldTypeForm, SLOT(accept())); QObject::connect(cancelButton, SIGNAL(clicked()), addFieldTypeForm, SLOT(reject())); QMetaObject::connectSlotsByName(addFieldTypeForm); } // setupUi void retranslateUi(QDialog *addFieldTypeForm) { addFieldTypeForm->setWindowTitle(QApplication::translate("addFieldTypeForm", "Enter field type", 0, QApplication::UnicodeUTF8)); cancelButton->setText(QApplication::translate("addFieldTypeForm", "Cancel", 0, QApplication::UnicodeUTF8)); okButton->setText(QApplication::translate("addFieldTypeForm", "OK", 0, QApplication::UnicodeUTF8)); } // retranslateUi }; namespace Ui { class addFieldTypeForm: public Ui_addFieldTypeForm {}; } // namespace Ui QT_END_NAMESPACE class addFieldTypeForm : public QDialog, public Ui::addFieldTypeForm { Q_OBJECT public: addFieldTypeForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~addFieldTypeForm(); protected slots: virtual void languageChange(); }; #endif // ADDFIELDTYPEFORM_H sqlitebrowser-2.0.0~beta1+ds.1/LICENSING0000644000175000017500000000240511126301072017732 0ustar lisandrolisandroяЛПLICENSING This code is in Public Domain. You may do whatever you want with it. However, the same is not true for the QT libraries needed to build this software, and this places restrictions on how you can develop and license derivative works. The original code was developed and built with licensed, commercial versions of QT on Windows, MacOSX and Linux. Developers that wish to produce derivative work and use it in commercial projects need to hold a commercial QT license as well. If you are however working on a project licensed with the GPL you may use the GPL version of QT. You may release derivative works of this software with any license you want as long as we are concerned, including GPL, Public Domain or Commercial, provided you abide to the licensing terms of the version of QT you have installed on your machine. Please consult www.trolltech.com/licensing if you have any questions about QT licensing. REDISTRIBUTION OF BINARIES The binaries available at sqlitebrowser.sourceforge.net were built with fully licensed commercial versions of QT, and can be redistributed freely. The Windows and MacOSX versions are standalone applications (QT has been statically linked), while the Linux packages used a shared QT 3 library for better compatibility. sqlitebrowser-2.0.0~beta1+ds.1/winapp.rc0000644000175000017500000000007507721026533020335 0ustar lisandrolisandroIDI_ICON1 ICON DISCARDABLE "iconwin.ico"sqlitebrowser-2.0.0~beta1+ds.1/app.plist0000644000175000017500000000303610375050142020336 0ustar lisandrolisandro CFBundleDevelopmentRegion English CFBundleDocumentTypes CFBundleTypeExtensions db CFBundleTypeName Database Document CFBundleTypeOSTypes **** CFBundleTypeRole Editor CFBundleTypeExtensions * CFBundleTypeName Other Document Type CFBundleTypeOSTypes **** CFBundleTypeRole Editor CFBundleExecutable @EXECUTABLE@ CFBundleGetInfoString SQLite Database Browser 1.3 CFBundleIconFile @ICON@ CFBundleIdentifier net.sourceforge.sqlitebrowser CFBundleInfoDictionaryVersion 6.0 CFBundleName SQLite Database Browser CFBundlePackageType APPL CFBundleShortVersionString 1.3 CFBundleSignature SqLB CFBundleVersion 1.3 sqlitebrowser-2.0.0~beta1+ds.1/extendedmainform.cpp0000644000175000017500000000122611254434065022544 0ustar lisandrolisandro#include "extendedmainform.h" #include ExtendedMainForm::ExtendedMainForm(QWidget* parent, const char* name, Qt::WindowFlags fl) : mainForm( parent, name, fl ) { setAcceptDrops(true); } ExtendedMainForm::~ExtendedMainForm(void) { } void ExtendedMainForm::dragEnterEvent(QDragEnterEvent *event) { if( event->mimeData()->hasFormat("text/uri-list") ) event->acceptProposedAction(); } void ExtendedMainForm::dropEvent(QDropEvent *event) { QList urls = event->mimeData()->urls(); if( urls.isEmpty() ) return; QString fileName = urls.first().toLocalFile(); if( !fileName.isEmpty() && fileName.endsWith("db") ) fileOpen(fileName); } sqlitebrowser-2.0.0~beta1+ds.1/sqlitedb.h0000644000175000017500000001000211305521542020451 0ustar lisandrolisandro#ifndef SQLITEDB_H #define SQLITEDB_H #include #include #include #include #include #include "sqllogform.h" #include "sqlite3.h" #include "sqlitebrowsertypes.h" #define MAX_DISPLAY_LENGTH 255 enum { kLogMsg_User, kLogMsg_App }; enum { kEncodingUTF8, kEncodingLatin1, kEncodingNONE }; static QString applicationName = QString("SQLite Database Browser"); static QString applicationIconName = QString("icone16.png"); static QString aboutText = QString("Version 2.0\n\nSQLite Database Browser is a freeware, public domain, open source visual tool used to create, design and edit database files compatible with SQLite 3.x.\n\nIt has been developed originally by Mauricio Piacentini from Tabuleiro Producoes. \n\nIn the spirit of the original SQLite source code, the author disclaims copyright to this source code."); typedef QMap fieldMap; typedef QMap tableMap; typedef QMap indexMap; typedef QMap rowIdMap; typedef QList rowList; typedef QMap resultMap; class DBBrowserField { public: DBBrowserField() : name( 0 ) { } DBBrowserField( const QString& wname,const QString& wtype ) : name( wname), type( wtype ) { } QString getname() const { return name; } QString gettype() const { return type; } private: QString name; QString type; }; class DBBrowserIndex { public: DBBrowserIndex() : name( 0 ) { } DBBrowserIndex( const QString& wname,const QString& wsql ) : name( wname), sql( wsql ) { } QString getname() const { return name; } QString getsql() const { return sql; } private: QString name; QString sql; }; class DBBrowserTable { public: DBBrowserTable() : name( 0 ) { } DBBrowserTable( const QString& wname,const QString& wsql ) : name( wname), sql( wsql ) { } void addField(int order, const QString& wfield,const QString& wtype); QString getname() const { return name; } QString getsql() const { return sql; } fieldMap fldmap; private: QString name; QString sql; }; class DBBrowserDB { public: DBBrowserDB (): _db( 0 ) , hasValidBrowseSet(false), curEncoding(kEncodingUTF8) {} ~DBBrowserDB (){} bool open ( const QString & db); bool create ( const QString & db); void close (); bool compact (); bool setRestorePoint(); bool save (); bool revert (); bool dump( const QString & filename); bool reload( const QString & filename, int * lineErr); bool executeSQL ( const QString & statement); bool executeSQLDirect ( const QString & statement); void updateSchema() ; bool addRecord(); bool deleteRecord(int wrow); bool updateRecord(int wrow, int wcol, const QString & wtext); bool browseTable( const QString & tablename ); QStringList getTableFields(const QString & tablename); QStringList getTableTypes(const QString & tablename); QStringList getTableNames(); QStringList getIndexNames(); resultMap getFindResults( const QString & wstatement); int getRecordCount(); bool isOpen(); void setDirty(bool dirtyval); void setDirtyDirect(bool dirtyval); bool getDirty(); void logSQL(QString statement, int msgtype); void setEncoding( int encoding ); void setDefaultNewData( const QString & data ); QString GetEncodedQString( const QString & input); QString GetDecodedQString( const QString & input); sqlite3 * _db; QStringList decodeCSV(const QString & csvfilename, char sep, char quote, int maxrecords, int * numfields); tableMap tbmap; indexMap idxmap; rowIdMap idmap; rowList browseRecs; QStringList browseFields; bool hasValidBrowseSet; QString curBrowseTableName; QString lastErrorMessage; QString curDBFilename; int curEncoding; QString curNewData; sqlLogForm * logWin; private: bool dirty; void getTableRecords( const QString & tablename ); }; #endif sqlitebrowser-2.0.0~beta1+ds.1/choosetableform.h0000644000175000017500000001141211304272743022031 0ustar lisandrolisandro#ifndef CHOOSETABLEFORM_H #define CHOOSETABLEFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE class Ui_chooseTableForm { public: QVBoxLayout *vboxLayout; QHBoxLayout *hboxLayout; QLabel *textLabel2; QComboBox *comboOptions; QSpacerItem *spacer13; QHBoxLayout *hboxLayout1; QSpacerItem *spacer11; QPushButton *buttonEdit; QPushButton *buttonCancel; void setupUi(QDialog *chooseTableForm) { if (chooseTableForm->objectName().isEmpty()) chooseTableForm->setObjectName(QString::fromUtf8("chooseTableForm")); chooseTableForm->resize(256, 163); vboxLayout = new QVBoxLayout(chooseTableForm); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); textLabel2 = new QLabel(chooseTableForm); textLabel2->setObjectName(QString::fromUtf8("textLabel2")); textLabel2->setWordWrap(false); hboxLayout->addWidget(textLabel2); comboOptions = new QComboBox(chooseTableForm); comboOptions->setObjectName(QString::fromUtf8("comboOptions")); hboxLayout->addWidget(comboOptions); vboxLayout->addLayout(hboxLayout); spacer13 = new QSpacerItem(20, 41, QSizePolicy::Minimum, QSizePolicy::Expanding); vboxLayout->addItem(spacer13); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); spacer11 = new QSpacerItem(31, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout1->addItem(spacer11); buttonEdit = new QPushButton(chooseTableForm); buttonEdit->setObjectName(QString::fromUtf8("buttonEdit")); hboxLayout1->addWidget(buttonEdit); buttonCancel = new QPushButton(chooseTableForm); buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); buttonCancel->setDefault(true); hboxLayout1->addWidget(buttonCancel); vboxLayout->addLayout(hboxLayout1); retranslateUi(chooseTableForm); QObject::connect(buttonCancel, SIGNAL(clicked()), chooseTableForm, SLOT(reject())); QObject::connect(buttonEdit, SIGNAL(clicked()), chooseTableForm, SLOT(editPressed())); QMetaObject::connectSlotsByName(chooseTableForm); } // setupUi void retranslateUi(QDialog *chooseTableForm) { chooseTableForm->setWindowTitle(QApplication::translate("chooseTableForm", "Select table to edit", 0, QApplication::UnicodeUTF8)); textLabel2->setText(QApplication::translate("chooseTableForm", "Table name:", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP comboOptions->setProperty("toolTip", QVariant(QApplication::translate("chooseTableForm", "Choose the table to delete", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS comboOptions->setProperty("whatsThis", QVariant(QApplication::translate("chooseTableForm", "Use this control to select the name of the table to be edited", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS buttonEdit->setText(QApplication::translate("chooseTableForm", "Edit", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonEdit->setProperty("toolTip", QVariant(QApplication::translate("chooseTableForm", "Edit table", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP buttonCancel->setText(QApplication::translate("chooseTableForm", "Cancel", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonCancel->setProperty("toolTip", QVariant(QApplication::translate("chooseTableForm", "Cancel and close dialog box", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP } // retranslateUi }; namespace Ui { class chooseTableForm: public Ui_chooseTableForm {}; } // namespace Ui QT_END_NAMESPACE class chooseTableForm : public QDialog, public Ui::chooseTableForm { Q_OBJECT public: chooseTableForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~chooseTableForm(); QString option; public slots: virtual void editPressed(); virtual void populateOptions( QStringList entries ); protected slots: virtual void languageChange(); }; #endif // CHOOSETABLEFORM_H sqlitebrowser-2.0.0~beta1+ds.1/createtableform.h0000644000175000017500000002303611304272743022021 0ustar lisandrolisandro#ifndef CREATETABLEFORM_H #define CREATETABLEFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "sqlitedb.h" QT_BEGIN_NAMESPACE class Ui_createTableForm { public: QVBoxLayout *vboxLayout; QHBoxLayout *hboxLayout; QLabel *textLabel1; QLineEdit *tablenameLineEdit; Q3GroupBox *groupBox1; QVBoxLayout *vboxLayout1; Q3ListView *fieldListView; QHBoxLayout *hboxLayout1; QSpacerItem *spacer4; QPushButton *buttonAddField; QPushButton *buttonDeleteField; QHBoxLayout *hboxLayout2; QSpacerItem *spacer6; QPushButton *buttonCreate; QPushButton *buttonCancel; void setupUi(QDialog *createTableForm) { if (createTableForm->objectName().isEmpty()) createTableForm->setObjectName(QString::fromUtf8("createTableForm")); createTableForm->resize(309, 320); vboxLayout = new QVBoxLayout(createTableForm); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); textLabel1 = new QLabel(createTableForm); textLabel1->setObjectName(QString::fromUtf8("textLabel1")); textLabel1->setWordWrap(false); hboxLayout->addWidget(textLabel1); tablenameLineEdit = new QLineEdit(createTableForm); tablenameLineEdit->setObjectName(QString::fromUtf8("tablenameLineEdit")); hboxLayout->addWidget(tablenameLineEdit); vboxLayout->addLayout(hboxLayout); groupBox1 = new Q3GroupBox(createTableForm); groupBox1->setObjectName(QString::fromUtf8("groupBox1")); groupBox1->setColumnLayout(0, Qt::Vertical); groupBox1->layout()->setSpacing(6); groupBox1->layout()->setContentsMargins(11, 11, 11, 11); vboxLayout1 = new QVBoxLayout(); QBoxLayout *boxlayout = qobject_cast(groupBox1->layout()); if (boxlayout) boxlayout->addLayout(vboxLayout1); vboxLayout1->setAlignment(Qt::AlignTop); vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); fieldListView = new Q3ListView(groupBox1); fieldListView->addColumn(QApplication::translate("createTableForm", "Field name", 0, QApplication::UnicodeUTF8)); fieldListView->header()->setClickEnabled(true, fieldListView->header()->count() - 1); fieldListView->header()->setResizeEnabled(true, fieldListView->header()->count() - 1); fieldListView->addColumn(QApplication::translate("createTableForm", "Field type", 0, QApplication::UnicodeUTF8)); fieldListView->header()->setClickEnabled(true, fieldListView->header()->count() - 1); fieldListView->header()->setResizeEnabled(true, fieldListView->header()->count() - 1); fieldListView->setObjectName(QString::fromUtf8("fieldListView")); fieldListView->setResizePolicy(Q3ScrollView::Manual); fieldListView->setResizeMode(Q3ListView::AllColumns); vboxLayout1->addWidget(fieldListView); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); spacer4 = new QSpacerItem(111, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout1->addItem(spacer4); buttonAddField = new QPushButton(groupBox1); buttonAddField->setObjectName(QString::fromUtf8("buttonAddField")); hboxLayout1->addWidget(buttonAddField); buttonDeleteField = new QPushButton(groupBox1); buttonDeleteField->setObjectName(QString::fromUtf8("buttonDeleteField")); buttonDeleteField->setEnabled(false); hboxLayout1->addWidget(buttonDeleteField); vboxLayout1->addLayout(hboxLayout1); vboxLayout->addWidget(groupBox1); hboxLayout2 = new QHBoxLayout(); hboxLayout2->setSpacing(6); hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); spacer6 = new QSpacerItem(91, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout2->addItem(spacer6); buttonCreate = new QPushButton(createTableForm); buttonCreate->setObjectName(QString::fromUtf8("buttonCreate")); hboxLayout2->addWidget(buttonCreate); buttonCancel = new QPushButton(createTableForm); buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); buttonCancel->setDefault(true); hboxLayout2->addWidget(buttonCancel); vboxLayout->addLayout(hboxLayout2); retranslateUi(createTableForm); QObject::connect(buttonCancel, SIGNAL(clicked()), createTableForm, SLOT(reject())); QObject::connect(buttonCreate, SIGNAL(clicked()), createTableForm, SLOT(confirmCreate())); QObject::connect(buttonAddField, SIGNAL(clicked()), createTableForm, SLOT(addField())); QObject::connect(buttonDeleteField, SIGNAL(clicked()), createTableForm, SLOT(deleteField())); QObject::connect(fieldListView, SIGNAL(selectionChanged()), createTableForm, SLOT(fieldSelectionChanged())); QMetaObject::connectSlotsByName(createTableForm); } // setupUi void retranslateUi(QDialog *createTableForm) { createTableForm->setWindowTitle(QApplication::translate("createTableForm", "Create Table", 0, QApplication::UnicodeUTF8)); textLabel1->setText(QApplication::translate("createTableForm", "Table name:", 0, QApplication::UnicodeUTF8)); tablenameLineEdit->setText(QString()); #ifndef QT_NO_TOOLTIP tablenameLineEdit->setProperty("toolTip", QVariant(QApplication::translate("createTableForm", "Enter the name for the new table", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS tablenameLineEdit->setProperty("whatsThis", QVariant(QApplication::translate("createTableForm", "Use this control to enter the name of the table to be created.", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS groupBox1->setTitle(QApplication::translate("createTableForm", "Define fields:", 0, QApplication::UnicodeUTF8)); fieldListView->header()->setLabel(0, QApplication::translate("createTableForm", "Field name", 0, QApplication::UnicodeUTF8)); fieldListView->header()->setLabel(1, QApplication::translate("createTableForm", "Field type", 0, QApplication::UnicodeUTF8)); fieldListView->clear(); Q3ListViewItem *__item = new Q3ListViewItem(fieldListView); __item->setText(0, QApplication::translate("createTableForm", "New Item", 0, QApplication::UnicodeUTF8)); __item->setText(1, QString()); __item->setPixmap(0, QPixmap()); __item->setPixmap(1, QPixmap()); buttonAddField->setText(QApplication::translate("createTableForm", "Add", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonAddField->setProperty("toolTip", QVariant(QApplication::translate("createTableForm", "Add a new field definition", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS buttonAddField->setProperty("whatsThis", QVariant(QApplication::translate("createTableForm", "This button is used to add a new field definition to your table", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS buttonDeleteField->setText(QApplication::translate("createTableForm", "Delete", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonDeleteField->setProperty("toolTip", QVariant(QApplication::translate("createTableForm", "Delete current field definition", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS buttonDeleteField->setProperty("whatsThis", QVariant(QApplication::translate("createTableForm", "This button is used to delete the currently selected field definition from your table", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS buttonCreate->setText(QApplication::translate("createTableForm", "Create", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonCreate->setProperty("toolTip", QVariant(QApplication::translate("createTableForm", "Create the table", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP buttonCancel->setText(QApplication::translate("createTableForm", "Cancel", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonCancel->setProperty("toolTip", QVariant(QApplication::translate("createTableForm", "Cancel and close dialog box", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP } // retranslateUi }; namespace Ui { class createTableForm: public Ui_createTableForm {}; } // namespace Ui QT_END_NAMESPACE class createTableForm : public QDialog, public Ui::createTableForm { Q_OBJECT public: createTableForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~createTableForm(); QString createStatement; public slots: virtual void confirmCreate(); virtual void addField(); virtual void deleteField(); virtual void fieldSelectionChanged(); protected slots: virtual void languageChange(); private: void init(); }; #endif // CREATETABLEFORM_H sqlitebrowser-2.0.0~beta1+ds.1/aboutform.h0000644000175000017500000001012711310215315020642 0ustar lisandrolisandro#ifndef ABOUTFORM_H #define ABOUTFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE class Ui_aboutForm { public: QVBoxLayout *vboxLayout; QGridLayout *gridLayout; QHBoxLayout *hboxLayout; QSpacerItem *spacer5; QPushButton *okButton; QSpacerItem *spacer13; QVBoxLayout *vboxLayout1; QLabel *pixmapLabel1; QSpacerItem *spacer12; QLabel *textLabel1; void setupUi(QDialog *aboutForm) { if (aboutForm->objectName().isEmpty()) aboutForm->setObjectName(QString::fromUtf8("aboutForm")); aboutForm->resize(542, 257); vboxLayout = new QVBoxLayout(aboutForm); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); gridLayout = new QGridLayout(); gridLayout->setSpacing(6); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); spacer5 = new QSpacerItem(424, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacer5); okButton = new QPushButton(aboutForm); okButton->setObjectName(QString::fromUtf8("okButton")); okButton->setDefault(true); hboxLayout->addWidget(okButton); gridLayout->addLayout(hboxLayout, 1, 0, 1, 3); spacer13 = new QSpacerItem(16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); gridLayout->addItem(spacer13, 0, 1, 1, 1); vboxLayout1 = new QVBoxLayout(); vboxLayout1->setSpacing(6); vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); pixmapLabel1 = new QLabel(aboutForm); pixmapLabel1->setObjectName(QString::fromUtf8("pixmapLabel1")); pixmapLabel1->setPixmap(QPixmap(qPixmapFromMimeSource("128.png"))); pixmapLabel1->setScaledContents(false); pixmapLabel1->setWordWrap(false); vboxLayout1->addWidget(pixmapLabel1); spacer12 = new QSpacerItem(20, 31, QSizePolicy::Minimum, QSizePolicy::Expanding); vboxLayout1->addItem(spacer12); gridLayout->addLayout(vboxLayout1, 0, 0, 1, 1); textLabel1 = new QLabel(aboutForm); textLabel1->setObjectName(QString::fromUtf8("textLabel1")); textLabel1->setWordWrap(false); gridLayout->addWidget(textLabel1, 0, 2, 1, 1); vboxLayout->addLayout(gridLayout); retranslateUi(aboutForm); QObject::connect(okButton, SIGNAL(clicked()), aboutForm, SLOT(close())); QMetaObject::connectSlotsByName(aboutForm); } // setupUi void retranslateUi(QDialog *aboutForm) { aboutForm->setWindowTitle(QApplication::translate("aboutForm", "About", 0, QApplication::UnicodeUTF8)); textLabel1->setText(QApplication::translate("aboutForm", "Version 2.0b1\n" "\n" "SQLite Database Browser is an open source, public domain, freeware visual tool\n used to create, design and edit SQLite 3.x database files.\n" "This program was built with version 3.6.18 of the SQLite engine.\n" "\n" "More information at http://sqlitebrowser.sourceforge.net.", 0, QApplication::UnicodeUTF8)); okButton->setText(QApplication::translate("aboutForm", "Close", 0, QApplication::UnicodeUTF8)); } // retranslateUi }; namespace Ui { class aboutForm: public Ui_aboutForm {}; } // namespace Ui QT_END_NAMESPACE class aboutForm : public QDialog, public Ui::aboutForm { Q_OBJECT public: aboutForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~aboutForm(); protected slots: virtual void languageChange(); private: void init(); }; #endif // ABOUTFORM_H sqlitebrowser-2.0.0~beta1+ds.1/.ui/0000755000175000017500000000000011556107175017205 5ustar lisandrolisandrosqlitebrowser-2.0.0~beta1+ds.1/iconwin.ico0000644000175000017500000001135607721026533020657 0ustar lisandrolisandro ш6(00ЈF( @€€€€€€€€€€РРР€€€џџџџџџџџџџџџџџџџџџџџ€‡џџџџџџџџџџx€џџџџџџџџџџџџї€џџџwwwwwwwwџџџ№wx€‡wї€џџџџџї€€€‡џџџџџџџџџџpџџџџџџџџџџџџїџџџwwwwwwwwџџџ№wx‡wї€ˆџџџџџ€ˆ€џџџџџџџџџџp€џџџџџџџџџџџџїџџџџџџџџџџџџџџ№џџџџџџџџџџџџїˆ‡џџџџџџџџџџx€€ˆ‡џџџџxˆ€џџџџџџџџџџџџџџџџџџџџџџџџџџџџўр€€€€Рќ?џџџџџџџџџџџџџџџџџџџџџџџџ( Р€€€€€€€€€РРР€€€џџџџџџџџџџџџˆwџџwˆїwwwwpˆ€ˆ€ˆwџџwˆїwwwwpˆ€ˆ€ˆwџџwˆџџџџџџpˆwџџwˆ€џџџџџџр€€€€рџџџџ(0`€ €€€€€€€€€РРРРмР№ЪІ """)))UUUMMMBBB999€|џPPџ“жџьЬЦжяжччЉ­3f™Ь3333f3™3Ь3џff3fff™fЬfџ™™3™f™™™Ь™џЬЬ3ЬfЬ™ЬЬЬџџfџ™џЬ3333f3™3Ь3џ3333333f33™33Ь33џ3f3f33ff3f™3fЬ3fџ3™3™33™f3™™3™Ь3™џ3Ь3Ь33Ьf3Ь™3ЬЬ3Ьџ3џ33џf3џ™3џЬ3џџff3fff™fЬfџf3f33f3ff3™f3Ьf3џffff3fffff™ffЬf™f™3f™ff™™f™Ьf™џfЬfЬ3fЬ™fЬЬfЬџfџfџ3fџ™fџЬЬџџЬ™™™3™™™™Ь™™33™f™3Ь™џ™f™f3™3f™f™™fЬ™3џ™™3™™f™™™™™Ь™™џ™Ь™Ь3fЬf™Ь™™ЬЬ™Ьџ™џ™џ3™Ьf™џ™™џЬ™џџЬ™3ЬfЬ™ЬЬ™3Ь33Ь3fЬ3™Ь3ЬЬ3џЬfЬf3™ffЬf™ЬfЬ™fџЬ™Ь™3Ь™fЬ™™Ь™ЬЬ™џЬЬЬЬ3ЬЬfЬЬ™ЬЬЬЬЬџЬџЬџ3™џfЬџ™ЬџЬЬџџЬ3џfџ™Ь3џ33џ3fџ3™џ3Ьџ3џџfџf3Ьffџf™џfЬЬfџџ™џ™3џ™fџ™™џ™Ьџ™џџЬџЬ3џЬfџЬ™џЬЬџЬџџџ3Ьџfџџ™џџЬffџfџffџџџffџfџџџf!Ѕ___www†††–––ЫЫЫВВВзззнннуууъъъёёёјјј№ћџЄ  €€€џџџџџџџџџџџџ C  ъыьїМёѓєџџџџєѓёМїьыъCъ їМєџџџџџџџџџџџџџџџџџџџџџџџџєМїы э№џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ№э џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџmm эџџџџџџџџџєѓђё№№№ММММММММММММ№№№ёђѓєџџџџџџџџџэmѓџџџџџѓё№ММММММММММММММММММММММММММММ№ёѓџџџџџѓmэџџђ№МММММїэјmC CmјэїМММММ№ђџџэm ъъ’ММїјCъыьїМёѓєџџџџєѓёМїьыъCјїММ’ъъ ыїМєџџџџџџџџџџџџџџџџџџџџџџџџєМїы э№џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ№э ъmџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџmъ эџџџџџџџџџєѓђё№№№ММММММММММММ№№№ёђѓєџџџџџџџџџэ ѓџџџџџѓё№ММММММММММММММММММММММММММММ№ёѓџџџџџѓmэџџђ№МММММяэјmC CmјэяМММММ№ђџџэm ъъ’ММїјъCъыьїМёѓєџџџџєѓёМїьыъCъјїММ’ъъ mъыїМєџџџџџџџџџџџџџџџџџџџџџџџџєМїыъm э№џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ№э ъmџџџџџџџџєѓѓђђђђђђђђђђђђђђђђђђѓѓєџџџџџџџџmъ mэџџџџџєѓђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђѓєџџџџџэmѓџџѓђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђѓџџѓ эѓђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђѓэ ђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђї ьђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђђь ьяёђђђђђђђђђђђђђђђђђђђђђђђђёяьmm CmјэїяМ№ёёёё№МяїэјmC   џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџјџџџјр€€рр€€€рр€€рјџџџјџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџsqlitebrowser-2.0.0~beta1+ds.1/.moc/0000755000175000017500000000000011556107175017346 5ustar lisandrolisandrosqlitebrowser-2.0.0~beta1+ds.1/renametableform.cpp0000644000175000017500000000262211254510210022342 0ustar lisandrolisandro#include "renametableform.h" #include #include #include #include #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, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, 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, applicationName, "Table name can not be empty" ); return; } if (tabname.contains(" ")>0) { QMessageBox::warning( this, 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); } sqlitebrowser-2.0.0~beta1+ds.1/form1.h0000644000175000017500000014716611304272743017721 0ustar lisandrolisandro#ifndef MAINFORM_H #define MAINFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "editform.h" #include "findform.h" #include "QtGui/QClipboard" #include "QtGui/QRegExpValidator" #include "sqlitedb.h" #include "sqllogform.h" QT_BEGIN_NAMESPACE class Ui_mainForm { public: QAction *fileNewAction; QAction *fileOpenAction; QAction *fileExitAction; QAction *editCopyAction; QAction *editPasteAction; QAction *editFindAction; QAction *helpContentsAction; QAction *helpIndexAction; QAction *helpAboutAction; QAction *fileCloseAction; QAction *newRecordAction; QAction *fileCompactAction; QAction *helpWhatsThisAction; QAction *sqlLogAction; QAction *fileImportCSVAction; QAction *fileExportCSVAction; QAction *fileSaveAction; QAction *fileRevertAction; //QAction *fileImportAction; //QAction *fileExportAction; QAction *editCreateTableAction; QAction *editDeleteTableAction; QAction *editModifyTableAction; QAction *editCreateIndexAction; QAction *editDeleteIndexAction; QAction *fileImportSQLAction; QAction *fileExportSQLAction; QAction *editPreferencesAction; QWidget *widget; QVBoxLayout *vboxLayout; QTabWidget *mainTab; QWidget *structure; QVBoxLayout *vboxLayout1; Q3ListView *dblistView; QWidget *browser; QVBoxLayout *vboxLayout2; QHBoxLayout *hboxLayout; QLabel *textLabel1; QComboBox *comboBrowseTable; QPushButton *buttonFind; QSpacerItem *spacer1; QPushButton *buttonNewRecord; QPushButton *buttonDeleteRecord; Q3Table *dataTable; QHBoxLayout *hboxLayout1; QPushButton *buttonPrevious; QLabel *labelRecordset; QPushButton *buttonNext; QSpacerItem *spacer4; QPushButton *buttonGoto; QLineEdit *editGoto; QWidget *query; QVBoxLayout *vboxLayout3; QLabel *textLabel1_2; Q3TextEdit *sqlTextEdit; QHBoxLayout *hboxLayout2; QPushButton *executeQueryButton; QSpacerItem *spacer4_2; QLabel *textLabel2; QLineEdit *queryErrorLineEdit; QLabel *textLabel3; Q3ListView *queryResultListView; Q3ToolBar *Toolbar; QMenuBar *menubar; QMenu *fileMenu; QMenu *PopupMenuEditor_9; QMenu *PopupMenuEditor_12; QMenu *EditMenu; QMenu *ViewMenu; QMenu *PopupMenu; void setupUi(Q3MainWindow *mainForm) { if (mainForm->objectName().isEmpty()) mainForm->setObjectName(QString::fromUtf8("mainForm")); mainForm->resize(702, 552); fileNewAction = new QAction(mainForm); fileNewAction->setObjectName(QString::fromUtf8("fileNewAction")); fileNewAction->setName("fileNewAction"); const QIcon icon = QIcon(qPixmapFromMimeSource("new.png")); fileNewAction->setIcon(icon); fileOpenAction = new QAction(mainForm); fileOpenAction->setObjectName(QString::fromUtf8("fileOpenAction")); fileOpenAction->setName("fileOpenAction"); const QIcon icon1 = QIcon(qPixmapFromMimeSource("open.png")); fileOpenAction->setIcon(icon1); fileExitAction = new QAction(mainForm); fileExitAction->setObjectName(QString::fromUtf8("fileExitAction")); fileExitAction->setName("fileExitAction"); editCopyAction = new QAction(mainForm); editCopyAction->setObjectName(QString::fromUtf8("editCopyAction")); editCopyAction->setName("editCopyAction"); editPasteAction = new QAction(mainForm); editPasteAction->setObjectName(QString::fromUtf8("editPasteAction")); editPasteAction->setName("editPasteAction"); editFindAction = new QAction(mainForm); editFindAction->setObjectName(QString::fromUtf8("editFindAction")); editFindAction->setName("editFindAction"); const QIcon icon2 = QIcon(qPixmapFromMimeSource("searchfind.png")); editFindAction->setIcon(icon2); helpContentsAction = new QAction(mainForm); helpContentsAction->setObjectName(QString::fromUtf8("helpContentsAction")); helpContentsAction->setName("helpContentsAction"); helpIndexAction = new QAction(mainForm); helpIndexAction->setObjectName(QString::fromUtf8("helpIndexAction")); helpIndexAction->setName("helpIndexAction"); helpAboutAction = new QAction(mainForm); helpAboutAction->setObjectName(QString::fromUtf8("helpAboutAction")); helpAboutAction->setName("helpAboutAction"); fileCloseAction = new QAction(mainForm); fileCloseAction->setObjectName(QString::fromUtf8("fileCloseAction")); fileCloseAction->setName("fileCloseAction"); fileCloseAction->setEnabled(false); newRecordAction = new QAction(mainForm); newRecordAction->setObjectName(QString::fromUtf8("newRecordAction")); newRecordAction->setName("newRecordAction"); fileCompactAction = new QAction(mainForm); fileCompactAction->setObjectName(QString::fromUtf8("fileCompactAction")); fileCompactAction->setName("fileCompactAction"); fileCompactAction->setEnabled(false); helpWhatsThisAction = new QAction(mainForm); helpWhatsThisAction->setObjectName(QString::fromUtf8("helpWhatsThisAction")); helpWhatsThisAction->setName("helpWhatsThisAction"); const QIcon icon3 = QIcon(qPixmapFromMimeSource("whatis.png")); helpWhatsThisAction->setIcon(icon3); sqlLogAction = new QAction(mainForm); sqlLogAction->setObjectName(QString::fromUtf8("sqlLogAction")); sqlLogAction->setName("sqlLogAction"); sqlLogAction->setCheckable(true); const QIcon icon4 = QIcon(qPixmapFromMimeSource("log.png")); sqlLogAction->setIcon(icon4); fileImportCSVAction = new QAction(mainForm); fileImportCSVAction->setObjectName(QString::fromUtf8("fileImportCSVAction")); fileImportCSVAction->setName("fileImportCSVAction"); fileExportCSVAction = new QAction(mainForm); fileExportCSVAction->setObjectName(QString::fromUtf8("fileExportCSVAction")); fileExportCSVAction->setName("fileExportCSVAction"); fileSaveAction = new QAction(mainForm); fileSaveAction->setObjectName(QString::fromUtf8("fileSaveAction")); fileSaveAction->setName("fileSaveAction"); fileSaveAction->setEnabled(false); const QIcon icon5 = QIcon(qPixmapFromMimeSource("save.png")); fileSaveAction->setIcon(icon5); fileRevertAction = new QAction(mainForm); fileRevertAction->setObjectName(QString::fromUtf8("fileRevertAction")); fileRevertAction->setName("fileRevertAction"); fileRevertAction->setEnabled(false); const QIcon icon6 = QIcon(qPixmapFromMimeSource("revert.png")); fileRevertAction->setIcon(icon6); //fileImportAction = new QAction(mainForm); //fileImportAction->setObjectName(QString::fromUtf8("fileImportAction")); //fileImportAction->setName("fileImportAction"); //fileExportAction = new QAction(mainForm); //fileExportAction->setObjectName(QString::fromUtf8("fileExportAction")); //fileExportAction->setName("fileExportAction"); editCreateTableAction = new QAction(mainForm); editCreateTableAction->setObjectName(QString::fromUtf8("editCreateTableAction")); editCreateTableAction->setName("editCreateTableAction"); editCreateTableAction->setEnabled(false); const QIcon icon7 = QIcon(qPixmapFromMimeSource("create_table.png")); editCreateTableAction->setIcon(icon7); editDeleteTableAction = new QAction(mainForm); editDeleteTableAction->setObjectName(QString::fromUtf8("editDeleteTableAction")); editDeleteTableAction->setName("editDeleteTableAction"); editDeleteTableAction->setEnabled(false); const QIcon icon8 = QIcon(qPixmapFromMimeSource("delete_table.png")); editDeleteTableAction->setIcon(icon8); editModifyTableAction = new QAction(mainForm); editModifyTableAction->setObjectName(QString::fromUtf8("editModifyTableAction")); editModifyTableAction->setName("editModifyTableAction"); editModifyTableAction->setEnabled(false); const QIcon icon9 = QIcon(qPixmapFromMimeSource("modify_table.png")); editModifyTableAction->setIcon(icon9); editCreateIndexAction = new QAction(mainForm); editCreateIndexAction->setObjectName(QString::fromUtf8("editCreateIndexAction")); editCreateIndexAction->setName("editCreateIndexAction"); editCreateIndexAction->setEnabled(false); const QIcon icon10 = QIcon(qPixmapFromMimeSource("create_index.png")); editCreateIndexAction->setIcon(icon10); editDeleteIndexAction = new QAction(mainForm); editDeleteIndexAction->setObjectName(QString::fromUtf8("editDeleteIndexAction")); editDeleteIndexAction->setName("editDeleteIndexAction"); editDeleteIndexAction->setEnabled(false); const QIcon icon11 = QIcon(qPixmapFromMimeSource("delete_index.png")); editDeleteIndexAction->setIcon(icon11); fileImportSQLAction = new QAction(mainForm); fileImportSQLAction->setObjectName(QString::fromUtf8("fileImportSQLAction")); fileImportSQLAction->setName("fileImportSQLAction"); fileExportSQLAction = new QAction(mainForm); fileExportSQLAction->setObjectName(QString::fromUtf8("fileExportSQLAction")); fileExportSQLAction->setName("fileExportSQLAction"); editPreferencesAction = new QAction(mainForm); editPreferencesAction->setObjectName(QString::fromUtf8("editPreferencesAction")); editPreferencesAction->setName("editPreferencesAction"); widget = new QWidget(mainForm); widget->setObjectName(QString::fromUtf8("widget")); vboxLayout = new QVBoxLayout(widget); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); vboxLayout->setContentsMargins(0, 0, 0, 0); mainTab = new QTabWidget(widget); mainTab->setObjectName(QString::fromUtf8("mainTab")); structure = new QWidget(); structure->setObjectName(QString::fromUtf8("structure")); vboxLayout1 = new QVBoxLayout(structure); vboxLayout1->setSpacing(6); vboxLayout1->setContentsMargins(11, 11, 11, 11); vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); dblistView = new Q3ListView(structure); dblistView->addColumn(QApplication::translate("mainForm", "Name", 0, QApplication::UnicodeUTF8)); dblistView->header()->setClickEnabled(false, dblistView->header()->count() - 1); dblistView->header()->setResizeEnabled(true, dblistView->header()->count() - 1); dblistView->addColumn(QApplication::translate("mainForm", "Object", 0, QApplication::UnicodeUTF8)); dblistView->header()->setClickEnabled(false, dblistView->header()->count() - 1); dblistView->header()->setResizeEnabled(true, dblistView->header()->count() - 1); dblistView->addColumn(QApplication::translate("mainForm", "Type", 0, QApplication::UnicodeUTF8)); dblistView->header()->setClickEnabled(false, dblistView->header()->count() - 1); dblistView->header()->setResizeEnabled(true, dblistView->header()->count() - 1); dblistView->addColumn(QApplication::translate("mainForm", "Schema", 0, QApplication::UnicodeUTF8)); dblistView->header()->setClickEnabled(false, dblistView->header()->count() - 1); dblistView->header()->setResizeEnabled(true, dblistView->header()->count() - 1); dblistView->setObjectName(QString::fromUtf8("dblistView")); dblistView->setResizePolicy(Q3ScrollView::Manual); dblistView->setSelectionMode(Q3ListView::NoSelection); dblistView->setRootIsDecorated(true); dblistView->setResizeMode(Q3ListView::LastColumn); vboxLayout1->addWidget(dblistView); mainTab->addTab(structure, QString()); browser = new QWidget(); browser->setObjectName(QString::fromUtf8("browser")); vboxLayout2 = new QVBoxLayout(browser); vboxLayout2->setSpacing(6); vboxLayout2->setContentsMargins(11, 11, 11, 11); vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); textLabel1 = new QLabel(browser); textLabel1->setObjectName(QString::fromUtf8("textLabel1")); textLabel1->setWordWrap(false); hboxLayout->addWidget(textLabel1); comboBrowseTable = new QComboBox(browser); comboBrowseTable->setObjectName(QString::fromUtf8("comboBrowseTable")); comboBrowseTable->setMinimumSize(QSize(115, 0)); hboxLayout->addWidget(comboBrowseTable); buttonFind = new QPushButton(browser); buttonFind->setObjectName(QString::fromUtf8("buttonFind")); buttonFind->setIcon(QPixmap(qPixmapFromMimeSource("searchfind.png"))); buttonFind->setCheckable(true); hboxLayout->addWidget(buttonFind); spacer1 = new QSpacerItem(51, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacer1); buttonNewRecord = new QPushButton(browser); buttonNewRecord->setObjectName(QString::fromUtf8("buttonNewRecord")); hboxLayout->addWidget(buttonNewRecord); buttonDeleteRecord = new QPushButton(browser); buttonDeleteRecord->setObjectName(QString::fromUtf8("buttonDeleteRecord")); hboxLayout->addWidget(buttonDeleteRecord); vboxLayout2->addLayout(hboxLayout); dataTable = new Q3Table(browser); dataTable->setObjectName(QString::fromUtf8("dataTable")); dataTable->setAcceptDrops(true); dataTable->setResizePolicy(Q3Table::Default); dataTable->setVScrollBarMode(Q3Table::Auto); dataTable->setNumRows(0); dataTable->setNumCols(0); dataTable->setReadOnly(true); dataTable->setSelectionMode(Q3Table::Single); dataTable->setFocusStyle(Q3Table::FollowStyle); vboxLayout2->addWidget(dataTable); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); buttonPrevious = new QPushButton(browser); buttonPrevious->setObjectName(QString::fromUtf8("buttonPrevious")); QSizePolicy sizePolicy(static_cast(0), static_cast(0)); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(buttonPrevious->sizePolicy().hasHeightForWidth()); buttonPrevious->setSizePolicy(sizePolicy); hboxLayout1->addWidget(buttonPrevious); labelRecordset = new QLabel(browser); labelRecordset->setObjectName(QString::fromUtf8("labelRecordset")); labelRecordset->setWordWrap(false); hboxLayout1->addWidget(labelRecordset); buttonNext = new QPushButton(browser); buttonNext->setObjectName(QString::fromUtf8("buttonNext")); sizePolicy.setHeightForWidth(buttonNext->sizePolicy().hasHeightForWidth()); buttonNext->setSizePolicy(sizePolicy); hboxLayout1->addWidget(buttonNext); spacer4 = new QSpacerItem(50, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout1->addItem(spacer4); buttonGoto = new QPushButton(browser); buttonGoto->setObjectName(QString::fromUtf8("buttonGoto")); hboxLayout1->addWidget(buttonGoto); editGoto = new QLineEdit(browser); editGoto->setObjectName(QString::fromUtf8("editGoto")); sizePolicy.setHeightForWidth(editGoto->sizePolicy().hasHeightForWidth()); editGoto->setSizePolicy(sizePolicy); hboxLayout1->addWidget(editGoto); vboxLayout2->addLayout(hboxLayout1); mainTab->addTab(browser, QString()); query = new QWidget(); query->setObjectName(QString::fromUtf8("query")); vboxLayout3 = new QVBoxLayout(query); vboxLayout3->setSpacing(6); vboxLayout3->setContentsMargins(11, 11, 11, 11); vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3")); textLabel1_2 = new QLabel(query); textLabel1_2->setObjectName(QString::fromUtf8("textLabel1_2")); textLabel1_2->setWordWrap(false); vboxLayout3->addWidget(textLabel1_2); sqlTextEdit = new Q3TextEdit(query); sqlTextEdit->setObjectName(QString::fromUtf8("sqlTextEdit")); QSizePolicy sizePolicy1(static_cast(7), static_cast(5)); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); sizePolicy1.setHeightForWidth(sqlTextEdit->sizePolicy().hasHeightForWidth()); sqlTextEdit->setSizePolicy(sizePolicy1); vboxLayout3->addWidget(sqlTextEdit); hboxLayout2 = new QHBoxLayout(); hboxLayout2->setSpacing(6); hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); executeQueryButton = new QPushButton(query); executeQueryButton->setObjectName(QString::fromUtf8("executeQueryButton")); hboxLayout2->addWidget(executeQueryButton); spacer4_2 = new QSpacerItem(325, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout2->addItem(spacer4_2); vboxLayout3->addLayout(hboxLayout2); textLabel2 = new QLabel(query); textLabel2->setObjectName(QString::fromUtf8("textLabel2")); textLabel2->setWordWrap(false); vboxLayout3->addWidget(textLabel2); queryErrorLineEdit = new QLineEdit(query); queryErrorLineEdit->setObjectName(QString::fromUtf8("queryErrorLineEdit")); queryErrorLineEdit->setReadOnly(true); vboxLayout3->addWidget(queryErrorLineEdit); textLabel3 = new QLabel(query); textLabel3->setObjectName(QString::fromUtf8("textLabel3")); textLabel3->setWordWrap(false); vboxLayout3->addWidget(textLabel3); queryResultListView = new Q3ListView(query); queryResultListView->setObjectName(QString::fromUtf8("queryResultListView")); queryResultListView->setResizePolicy(Q3ScrollView::Manual); queryResultListView->setSelectionMode(Q3ListView::NoSelection); queryResultListView->setResizeMode(Q3ListView::AllColumns); vboxLayout3->addWidget(queryResultListView); mainTab->addTab(query, QString()); vboxLayout->addWidget(mainTab); mainForm->setCentralWidget(widget); Toolbar = new Q3ToolBar(mainForm); Toolbar->setObjectName(QString::fromUtf8("Toolbar")); menubar = new QMenuBar(mainForm); menubar->setObjectName(QString::fromUtf8("menubar")); fileMenu = new QMenu(menubar); fileMenu->setObjectName(QString::fromUtf8("fileMenu")); PopupMenuEditor_9 = new QMenu(fileMenu); PopupMenuEditor_9->setObjectName(QString::fromUtf8("PopupMenuEditor_9")); PopupMenuEditor_12 = new QMenu(fileMenu); PopupMenuEditor_12->setObjectName(QString::fromUtf8("PopupMenuEditor_12")); EditMenu = new QMenu(menubar); EditMenu->setObjectName(QString::fromUtf8("EditMenu")); ViewMenu = new QMenu(menubar); ViewMenu->setObjectName(QString::fromUtf8("ViewMenu")); PopupMenu = new QMenu(menubar); PopupMenu->setObjectName(QString::fromUtf8("PopupMenu")); Toolbar->addAction(fileNewAction); Toolbar->addAction(fileOpenAction); Toolbar->addAction(fileSaveAction); Toolbar->addAction(fileRevertAction); Toolbar->addSeparator(); Toolbar->addAction(editCreateTableAction); Toolbar->addAction(editDeleteTableAction); Toolbar->addAction(editModifyTableAction); Toolbar->addAction(editCreateIndexAction); Toolbar->addAction(editDeleteIndexAction); Toolbar->addSeparator(); Toolbar->addAction(sqlLogAction); Toolbar->addSeparator(); Toolbar->addAction(helpWhatsThisAction); menubar->addAction(fileMenu->menuAction()); menubar->addAction(EditMenu->menuAction()); menubar->addAction(ViewMenu->menuAction()); menubar->addAction(PopupMenu->menuAction()); fileMenu->addAction(fileNewAction); fileMenu->addAction(fileOpenAction); fileMenu->addAction(fileCloseAction); fileMenu->addSeparator(); fileMenu->addAction(fileSaveAction); fileMenu->addAction(fileRevertAction); fileMenu->addAction(fileCompactAction); fileMenu->addSeparator(); //fileMenu->addAction(fileImportAction); fileMenu->addAction(PopupMenuEditor_9->menuAction()); //fileMenu->addAction(fileExportAction); fileMenu->addAction(PopupMenuEditor_12->menuAction()); fileMenu->addSeparator(); fileMenu->addAction(fileExitAction); PopupMenuEditor_9->addAction(fileImportSQLAction); PopupMenuEditor_9->addAction(fileImportCSVAction); PopupMenuEditor_12->addAction(fileExportSQLAction); PopupMenuEditor_12->addAction(fileExportCSVAction); EditMenu->addAction(editCreateTableAction); EditMenu->addAction(editDeleteTableAction); EditMenu->addAction(editModifyTableAction); EditMenu->addSeparator(); EditMenu->addAction(editCreateIndexAction); EditMenu->addAction(editDeleteIndexAction); EditMenu->addSeparator(); EditMenu->addAction(editPreferencesAction); ViewMenu->addAction(sqlLogAction); PopupMenu->addAction(helpWhatsThisAction); PopupMenu->addAction(helpAboutAction); retranslateUi(mainForm); QObject::connect(fileExitAction, SIGNAL(activated()), mainForm, SLOT(fileExit())); QObject::connect(fileOpenAction, SIGNAL(activated()), mainForm, SLOT(fileOpen())); QObject::connect(fileNewAction, SIGNAL(activated()), mainForm, SLOT(fileNew())); QObject::connect(fileCloseAction, SIGNAL(activated()), mainForm, SLOT(fileClose())); QObject::connect(comboBrowseTable, SIGNAL(activated(QString)), mainForm, SLOT(populateTable(QString))); QObject::connect(buttonNewRecord, SIGNAL(clicked()), mainForm, SLOT(addRecord())); QObject::connect(buttonDeleteRecord, SIGNAL(clicked()), mainForm, SLOT(deleteRecord())); QObject::connect(buttonPrevious, SIGNAL(clicked()), mainForm, SLOT(navigatePrevious())); QObject::connect(buttonNext, SIGNAL(clicked()), mainForm, SLOT(navigateNext())); QObject::connect(editGoto, SIGNAL(returnPressed()), mainForm, SLOT(navigateGoto())); QObject::connect(buttonGoto, SIGNAL(clicked()), mainForm, SLOT(navigateGoto())); QObject::connect(buttonFind, SIGNAL(toggled(bool)), mainForm, SLOT(browseFind(bool))); QObject::connect(fileCompactAction, SIGNAL(activated()), mainForm, SLOT(compact())); QObject::connect(editCopyAction, SIGNAL(activated()), mainForm, SLOT(copy())); QObject::connect(editPasteAction, SIGNAL(activated()), mainForm, SLOT(paste())); QObject::connect(helpWhatsThisAction, SIGNAL(activated()), mainForm, SLOT(helpWhatsThis())); QObject::connect(helpAboutAction, SIGNAL(activated()), mainForm, SLOT(helpAbout())); QObject::connect(dataTable, SIGNAL(doubleClicked(int,int,int,QPoint)), mainForm, SLOT(doubleClickTable(int,int,int,QPoint))); QObject::connect(mainTab, SIGNAL(selected(QString)), mainForm, SLOT(mainTabSelected(QString))); QObject::connect(sqlLogAction, SIGNAL(toggled(bool)), mainForm, SLOT(toggleLogWindow(bool))); QObject::connect(executeQueryButton, SIGNAL(clicked()), mainForm, SLOT(executeQuery())); QObject::connect(fileImportCSVAction, SIGNAL(activated()), mainForm, SLOT(importTableFromCSV())); QObject::connect(fileExportCSVAction, SIGNAL(activated()), mainForm, SLOT(exportTableToCSV())); QObject::connect(fileRevertAction, SIGNAL(activated()), mainForm, SLOT(fileRevert())); QObject::connect(fileSaveAction, SIGNAL(activated()), mainForm, SLOT(fileSave())); QObject::connect(editDeleteIndexAction, SIGNAL(activated()), mainForm, SLOT(deleteIndex())); QObject::connect(editCreateIndexAction, SIGNAL(activated()), mainForm, SLOT(createIndex())); QObject::connect(editCreateTableAction, SIGNAL(activated()), mainForm, SLOT(createTable())); QObject::connect(editDeleteTableAction, SIGNAL(activated()), mainForm, SLOT(deleteTable())); QObject::connect(editModifyTableAction, SIGNAL(activated()), mainForm, SLOT(editTable())); QObject::connect(fileExportSQLAction, SIGNAL(activated()), mainForm, SLOT(exportDatabaseToSQL())); QObject::connect(fileImportSQLAction, SIGNAL(activated()), mainForm, SLOT(importDatabaseFromSQL())); QObject::connect(editPreferencesAction, SIGNAL(activated()), mainForm, SLOT(openPreferences())); QMetaObject::connectSlotsByName(mainForm); } // setupUi void retranslateUi(Q3MainWindow *mainForm) { mainForm->setWindowTitle(QApplication::translate("mainForm", "Browser", 0, QApplication::UnicodeUTF8)); fileNewAction->setIconText(QApplication::translate("mainForm", "New Database", 0, QApplication::UnicodeUTF8)); fileNewAction->setText(QApplication::translate("mainForm", "&New Database", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP fileNewAction->setToolTip(QApplication::translate("mainForm", "Create a new database file", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS fileNewAction->setWhatsThis(QApplication::translate("mainForm", "This option is used to create a new database file.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS fileNewAction->setShortcut(QApplication::translate("mainForm", "Ctrl+N", 0, QApplication::UnicodeUTF8)); fileOpenAction->setIconText(QApplication::translate("mainForm", "Open Database", 0, QApplication::UnicodeUTF8)); fileOpenAction->setText(QApplication::translate("mainForm", "&Open Database", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP fileOpenAction->setToolTip(QApplication::translate("mainForm", "Open an existing database file", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS fileOpenAction->setWhatsThis(QApplication::translate("mainForm", "This option is used to open an existing database file.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS fileOpenAction->setShortcut(QApplication::translate("mainForm", "Ctrl+O", 0, QApplication::UnicodeUTF8)); fileExitAction->setIconText(QApplication::translate("mainForm", "Exit", 0, QApplication::UnicodeUTF8)); fileExitAction->setText(QApplication::translate("mainForm", "E&xit", 0, QApplication::UnicodeUTF8)); fileExitAction->setShortcut(QString()); editCopyAction->setIconText(QApplication::translate("mainForm", "Copy", 0, QApplication::UnicodeUTF8)); editCopyAction->setText(QApplication::translate("mainForm", "&Copy", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_WHATSTHIS editCopyAction->setWhatsThis(QApplication::translate("mainForm", "Copies the selected text to the clipboard", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS editCopyAction->setShortcut(QApplication::translate("mainForm", "Ctrl+C", 0, QApplication::UnicodeUTF8)); editPasteAction->setIconText(QApplication::translate("mainForm", "Paste", 0, QApplication::UnicodeUTF8)); editPasteAction->setText(QApplication::translate("mainForm", "&Paste", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_WHATSTHIS editPasteAction->setWhatsThis(QApplication::translate("mainForm", "Pastes text from the clipboard into the current text insertion point", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS editPasteAction->setShortcut(QApplication::translate("mainForm", "Ctrl+V", 0, QApplication::UnicodeUTF8)); editFindAction->setIconText(QApplication::translate("mainForm", "Find", 0, QApplication::UnicodeUTF8)); editFindAction->setText(QApplication::translate("mainForm", "&Find...", 0, QApplication::UnicodeUTF8)); editFindAction->setShortcut(QApplication::translate("mainForm", "F", 0, QApplication::UnicodeUTF8)); helpContentsAction->setIconText(QApplication::translate("mainForm", "Contents", 0, QApplication::UnicodeUTF8)); helpContentsAction->setText(QApplication::translate("mainForm", "&Contents...", 0, QApplication::UnicodeUTF8)); helpContentsAction->setShortcut(QString()); helpIndexAction->setIconText(QApplication::translate("mainForm", "Index", 0, QApplication::UnicodeUTF8)); helpIndexAction->setText(QApplication::translate("mainForm", "&Index...", 0, QApplication::UnicodeUTF8)); helpIndexAction->setShortcut(QString()); helpAboutAction->setIconText(QApplication::translate("mainForm", "About", 0, QApplication::UnicodeUTF8)); helpAboutAction->setText(QApplication::translate("mainForm", "&About", 0, QApplication::UnicodeUTF8)); helpAboutAction->setShortcut(QString()); fileCloseAction->setIconText(QApplication::translate("mainForm", "Close Database", 0, QApplication::UnicodeUTF8)); fileCloseAction->setText(QApplication::translate("mainForm", "Close Database", 0, QApplication::UnicodeUTF8)); newRecordAction->setIconText(QApplication::translate("mainForm", "New Record", 0, QApplication::UnicodeUTF8)); newRecordAction->setText(QApplication::translate("mainForm", "New Record", 0, QApplication::UnicodeUTF8)); fileCompactAction->setIconText(QApplication::translate("mainForm", "Compact Database", 0, QApplication::UnicodeUTF8)); fileCompactAction->setText(QApplication::translate("mainForm", "Compact Database", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_STATUSTIP fileCompactAction->setStatusTip(QApplication::translate("mainForm", "Compact the database file, removing space wasted by deleted records.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_STATUSTIP #ifndef QT_NO_WHATSTHIS fileCompactAction->setWhatsThis(QApplication::translate("mainForm", "Compact the database file, removing space wasted by deleted records.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS helpWhatsThisAction->setIconText(QApplication::translate("mainForm", "What's This?", 0, QApplication::UnicodeUTF8)); helpWhatsThisAction->setText(QApplication::translate("mainForm", "What's This?", 0, QApplication::UnicodeUTF8)); helpWhatsThisAction->setShortcut(QApplication::translate("mainForm", "Shift+F1", 0, QApplication::UnicodeUTF8)); sqlLogAction->setIconText(QApplication::translate("mainForm", "SQL Log", 0, QApplication::UnicodeUTF8)); sqlLogAction->setText(QApplication::translate("mainForm", "SQL Log", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_WHATSTHIS sqlLogAction->setWhatsThis(QApplication::translate("mainForm", "Display or hide the SQL log window, which stores all SQL commands issued by the user or the application.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS fileImportCSVAction->setIconText(QApplication::translate("mainForm", "Table from CSV file", 0, QApplication::UnicodeUTF8)); fileImportCSVAction->setText(QApplication::translate("mainForm", "Table from CSV file", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP fileImportCSVAction->setToolTip(QApplication::translate("mainForm", "Open a wizard that lets you import data from a comma separated text file into a database table.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS fileImportCSVAction->setWhatsThis(QApplication::translate("mainForm", "Open a wizard that lets you import data from a comma separated text file into a database table. CSV files can be created on most database and spreadsheet applications.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS fileExportCSVAction->setIconText(QApplication::translate("mainForm", "Table as CSV file", 0, QApplication::UnicodeUTF8)); fileExportCSVAction->setText(QApplication::translate("mainForm", "Table as CSV file", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP fileExportCSVAction->setToolTip(QApplication::translate("mainForm", "Export a database table as a comma separated text file.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS fileExportCSVAction->setWhatsThis(QApplication::translate("mainForm", "Export a database table as a comma separated text file, ready to be imported into other database or spreadsheet applications.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS fileSaveAction->setIconText(QApplication::translate("mainForm", "Save Database", 0, QApplication::UnicodeUTF8)); fileSaveAction->setText(QApplication::translate("mainForm", "Save Database", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP fileSaveAction->setToolTip(QApplication::translate("mainForm", "Save changes to the database file", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS fileSaveAction->setWhatsThis(QApplication::translate("mainForm", "This option is used to save changes to the database file.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS fileRevertAction->setIconText(QApplication::translate("mainForm", "Revert Database", 0, QApplication::UnicodeUTF8)); fileRevertAction->setText(QApplication::translate("mainForm", "Revert Database", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP fileRevertAction->setToolTip(QApplication::translate("mainForm", "Revert database to last saved state", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS fileRevertAction->setWhatsThis(QApplication::translate("mainForm", "This option is used to revert the current database file to its last saved state. All changes made since the last save operation are lost.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS //fileImportAction->setIconText(QApplication::translate("mainForm", "Import", 0, QApplication::UnicodeUTF8)); //fileImportAction->setText(QApplication::translate("mainForm", "Import", 0, QApplication::UnicodeUTF8)); //fileExportAction->setIconText(QApplication::translate("mainForm", "Export", 0, QApplication::UnicodeUTF8)); //fileExportAction->setText(QApplication::translate("mainForm", "Export", 0, QApplication::UnicodeUTF8)); editCreateTableAction->setIconText(QApplication::translate("mainForm", "Create Table", 0, QApplication::UnicodeUTF8)); editCreateTableAction->setText(QApplication::translate("mainForm", "Create Table", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_WHATSTHIS editCreateTableAction->setWhatsThis(QApplication::translate("mainForm", "Open the Create Table wizard, where it is possible to define the name and fields for a new table in the database", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS editDeleteTableAction->setIconText(QApplication::translate("mainForm", "Delete Table", 0, QApplication::UnicodeUTF8)); editDeleteTableAction->setText(QApplication::translate("mainForm", "Delete Table", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_WHATSTHIS editDeleteTableAction->setWhatsThis(QApplication::translate("mainForm", "Open the Delete Table wizard, where you can select a database table to be dropped.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS editModifyTableAction->setIconText(QApplication::translate("mainForm", "Modify Table", 0, QApplication::UnicodeUTF8)); editModifyTableAction->setText(QApplication::translate("mainForm", "Modify Table", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_WHATSTHIS editModifyTableAction->setWhatsThis(QApplication::translate("mainForm", "Open the Modify Table wizard, where it is possible to rename an existing table. It is also possible to add or delete fields form a table, as well as modify field names and types.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS editCreateIndexAction->setIconText(QApplication::translate("mainForm", "Create Index", 0, QApplication::UnicodeUTF8)); editCreateIndexAction->setText(QApplication::translate("mainForm", "Create Index", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_WHATSTHIS editCreateIndexAction->setWhatsThis(QApplication::translate("mainForm", "Open the Create Index wizard, where it is possible to define a new index on an existing database table.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS editDeleteIndexAction->setIconText(QApplication::translate("mainForm", "Delete Index", 0, QApplication::UnicodeUTF8)); editDeleteIndexAction->setText(QApplication::translate("mainForm", "Delete Index", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_WHATSTHIS editDeleteIndexAction->setWhatsThis(QApplication::translate("mainForm", "Open the Delete Index wizard, where you can select a database index to be dropped.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS fileImportSQLAction->setIconText(QApplication::translate("mainForm", "Database from SQL file", 0, QApplication::UnicodeUTF8)); fileImportSQLAction->setText(QApplication::translate("mainForm", "Database from SQL file", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP fileImportSQLAction->setToolTip(QApplication::translate("mainForm", "Import data from an .sql dump text file into a new or existing database.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS fileImportSQLAction->setWhatsThis(QApplication::translate("mainForm", "This option lets you import data from an .sql dump text file into a new or existing database. SQL dump files can be created on most database engines, including MySQL and PostgreSQL.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS fileExportSQLAction->setIconText(QApplication::translate("mainForm", "Database to SQL file", 0, QApplication::UnicodeUTF8)); fileExportSQLAction->setText(QApplication::translate("mainForm", "Database to SQL file", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP fileExportSQLAction->setToolTip(QApplication::translate("mainForm", "Export a database to a .sql dump text file.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS fileExportSQLAction->setWhatsThis(QApplication::translate("mainForm", "This option lets you export a database to a .sql dump text file. SQL dump files contain all data necessary to recreate the database on most database engines, including MySQL and PostgreSQL.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS editPreferencesAction->setIconText(QApplication::translate("mainForm", "Preferences", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP editPreferencesAction->setToolTip(QApplication::translate("mainForm", "Open the preferences window..", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS editPreferencesAction->setWhatsThis(QApplication::translate("mainForm", "Open the preferences window.", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_WHATSTHIS #ifndef QT_NO_TOOLTIP mainTab->setProperty("toolTip", QVariant(QString())); #endif // QT_NO_TOOLTIP dblistView->header()->setLabel(0, QApplication::translate("mainForm", "Name", 0, QApplication::UnicodeUTF8)); dblistView->header()->setLabel(1, QApplication::translate("mainForm", "Object", 0, QApplication::UnicodeUTF8)); dblistView->header()->setLabel(2, QApplication::translate("mainForm", "Type", 0, QApplication::UnicodeUTF8)); dblistView->header()->setLabel(3, QApplication::translate("mainForm", "Schema", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_WHATSTHIS dblistView->setProperty("whatsThis", QVariant(QApplication::translate("mainForm", "This area shows the structure of your database, including all tables and indexes.", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS mainTab->setTabText(mainTab->indexOf(structure), QApplication::translate("mainForm", "Database Structure", 0, QApplication::UnicodeUTF8)); textLabel1->setText(QApplication::translate("mainForm", "Table:", 0, QApplication::UnicodeUTF8)); comboBrowseTable->clear(); comboBrowseTable->insertItems(0, QStringList() << QApplication::translate("mainForm", "select", 0, QApplication::UnicodeUTF8) << QApplication::translate("mainForm", "users", 0, QApplication::UnicodeUTF8) ); #ifndef QT_NO_TOOLTIP comboBrowseTable->setProperty("toolTip", QVariant(QApplication::translate("mainForm", "Select a table to browse data", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS comboBrowseTable->setProperty("whatsThis", QVariant(QApplication::translate("mainForm", "Use this list to select a table to be displayed in the database view", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS buttonFind->setText(QString()); #ifndef QT_NO_TOOLTIP buttonFind->setProperty("toolTip", QVariant(QApplication::translate("mainForm", "Open or close the floating find window", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS buttonFind->setProperty("whatsThis", QVariant(QApplication::translate("mainForm", "This button toggles the appearance of the Find window, used to search records in the database view", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS buttonNewRecord->setText(QApplication::translate("mainForm", "New Record", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonNewRecord->setProperty("toolTip", QVariant(QApplication::translate("mainForm", "Insert a new record in the current table", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS buttonNewRecord->setProperty("whatsThis", QVariant(QApplication::translate("mainForm", "This button creates a new, empty record in the database", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS buttonDeleteRecord->setText(QApplication::translate("mainForm", "Delete Record", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonDeleteRecord->setProperty("toolTip", QVariant(QApplication::translate("mainForm", "Delete the current record", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS buttonDeleteRecord->setProperty("whatsThis", QVariant(QApplication::translate("mainForm", "This button deletes the record currently selected in the database", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS #ifndef QT_NO_TOOLTIP dataTable->setProperty("toolTip", QVariant(QString())); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS dataTable->setProperty("whatsThis", QVariant(QApplication::translate("mainForm", "This is the database view. You can double-click any record to edit its contents in the cell editor window.", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS buttonPrevious->setText(QApplication::translate("mainForm", "<", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonPrevious->setProperty("toolTip", QVariant(QApplication::translate("mainForm", "Go to previous record set page", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS buttonPrevious->setProperty("whatsThis", QVariant(QApplication::translate("mainForm", "This button is used to navigate to the previous set of 1000 records in the database view", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS labelRecordset->setText(QApplication::translate("mainForm", "1000 - 2000 of 100000", 0, QApplication::UnicodeUTF8)); buttonNext->setText(QApplication::translate("mainForm", ">", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonNext->setProperty("toolTip", QVariant(QApplication::translate("mainForm", "Go to next record set page", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS buttonNext->setProperty("whatsThis", QVariant(QApplication::translate("mainForm", "This button is used to navigate to the next 1000 records set in the database view", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS buttonGoto->setText(QApplication::translate("mainForm", "Go to:", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonGoto->setProperty("toolTip", QVariant(QApplication::translate("mainForm", "Click here to browse the specified record ", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS buttonGoto->setProperty("whatsThis", QVariant(QApplication::translate("mainForm", "This button is used to navigate to the record number specied in the Go to: area.", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS editGoto->setText(QApplication::translate("mainForm", "0", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP editGoto->setProperty("toolTip", QVariant(QApplication::translate("mainForm", "Enter record number to browse", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS editGoto->setProperty("whatsThis", QVariant(QApplication::translate("mainForm", "Type a record number in this area and click the Go to: button to display the record in the database view", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS mainTab->setTabText(mainTab->indexOf(browser), QApplication::translate("mainForm", "Browse Data", 0, QApplication::UnicodeUTF8)); textLabel1_2->setText(QApplication::translate("mainForm", "SQL string:", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP sqlTextEdit->setProperty("toolTip", QVariant(QApplication::translate("mainForm", "Type SQL string here", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS sqlTextEdit->setProperty("whatsThis", QVariant(QApplication::translate("mainForm", "Type the SQL query in this area, and press the button below to execute it. Results and error messages will be shown in the fields at the bottom of this form.", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS executeQueryButton->setText(QApplication::translate("mainForm", "Execute query", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP executeQueryButton->setProperty("toolTip", QVariant(QApplication::translate("mainForm", "Execute SQL query", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS executeQueryButton->setProperty("whatsThis", QVariant(QApplication::translate("mainForm", "This button is used to execute the SQL query entered in the text area above.", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS textLabel2->setText(QApplication::translate("mainForm", "Error message from database engine:", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP queryErrorLineEdit->setProperty("toolTip", QVariant(QApplication::translate("mainForm", "Error messages", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS queryErrorLineEdit->setProperty("whatsThis", QVariant(QApplication::translate("mainForm", "Messages returned from the database engine when the SQL query is executed are displayed in this area.", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS textLabel3->setText(QApplication::translate("mainForm", "Data returned:", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP queryResultListView->setProperty("toolTip", QVariant(QApplication::translate("mainForm", "Query generated data", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS queryResultListView->setProperty("whatsThis", QVariant(QApplication::translate("mainForm", "This table displays data returned from the database engine as a result of the SQL query. You can not modify data directly on this view, only consult it.", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS mainTab->setTabText(mainTab->indexOf(query), QApplication::translate("mainForm", "Execute SQL", 0, QApplication::UnicodeUTF8)); Toolbar->setLabel(QApplication::translate("mainForm", "Toolbar", 0, QApplication::UnicodeUTF8)); fileMenu->setTitle(QApplication::translate("mainForm", "&File", 0, QApplication::UnicodeUTF8)); PopupMenuEditor_9->setTitle(QApplication::translate("mainForm", "Import", 0, QApplication::UnicodeUTF8)); PopupMenuEditor_12->setTitle(QApplication::translate("mainForm", "Export", 0, QApplication::UnicodeUTF8)); EditMenu->setTitle(QApplication::translate("mainForm", "Edit", 0, QApplication::UnicodeUTF8)); ViewMenu->setTitle(QApplication::translate("mainForm", "View", 0, QApplication::UnicodeUTF8)); PopupMenu->setTitle(QApplication::translate("mainForm", "Help", 0, QApplication::UnicodeUTF8)); } // retranslateUi }; namespace Ui { class mainForm: public Ui_mainForm {}; } // namespace Ui QT_END_NAMESPACE class mainForm : public Q3MainWindow, public Ui::mainForm { Q_OBJECT public: mainForm(QWidget* parent = 0, const char* name = 0, Qt::WindowFlags fl = Qt::WType_TopLevel); ~mainForm(); sqlLogForm * logWin; editForm * editWin; QClipboard * clipboard; findForm * findWin; int recAtTop; int recsPerView; QIntValidator * gotoValidator; QString defaultlocation; public slots: virtual void fileOpen( const QString & fileName ); virtual void fileOpen(); virtual void fileNew(); virtual void populateStructure(); virtual void populateTable( const QString & tablename ); virtual void resetBrowser(); virtual void fileClose(); virtual void fileExit(); virtual void closeEvent( QCloseEvent * ); virtual void addRecord(); virtual void deleteRecord(); virtual void updateTableView( int lineToSelect ); virtual void selectTableLine( int lineToSelect ); virtual void navigatePrevious(); virtual void navigateNext(); virtual void navigateGoto(); virtual void setRecordsetLabel(); virtual void browseFind( bool open ); virtual void browseFindAway(); virtual void lookfor( const QString & wfield, const QString & woperator, const QString & wsearchterm ); virtual void showrecord( int dec ); virtual void createTable(); virtual void createIndex(); virtual void compact(); virtual void deleteTable(); virtual void editTable(); virtual void deleteIndex(); virtual void copy(); virtual void paste(); virtual void helpWhatsThis(); virtual void helpAbout(); virtual void updateRecordText( int row, int col, QString newtext ); virtual void logWinAway(); virtual void editWinAway(); virtual void editText( int row, int col ); virtual void doubleClickTable( int row, int col, int button, const QPoint & mousepoint ); virtual void executeQuery(); virtual void mainTabSelected( const QString & tabname ); virtual void toggleLogWindow( bool enable ); virtual void importTableFromCSV(); virtual void exportTableToCSV(); virtual void dbState( bool dirty ); virtual void fileSave(); virtual void fileRevert(); virtual void exportDatabaseToSQL(); virtual void importDatabaseFromSQL(); virtual void openPreferences(); virtual void updatePreferences(); protected: DBBrowserDB db; protected slots: virtual void languageChange(); private: void init(); void destroy(); }; #endif // MAINFORM_H sqlitebrowser-2.0.0~beta1+ds.1/form1.cpp0000644000175000017500000007340311310213301020222 0ustar lisandrolisandro#include "form1.h" #include #include #include #include #include #include "qmessagebox.h" #include "q3filedialog.h" #include "qfile.h" #include "qapplication.h" #include "createtableform.h" #include "createindexform.h" #include "deletetableform.h" #include "deleteindexform.h" #include "aboutform.h" #include "choosetableform.h" #include "edittableform.h" #include "importcsvform.h" #include "exporttablecsvform.h" #include "preferencesform.h" /* * Constructs a mainForm as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ mainForm::mainForm(QWidget* parent, const char* name, Qt::WindowFlags fl) : Q3MainWindow(parent, name, fl) { setupUi(this); (void)statusBar(); init(); } /* * Destroys the object and frees any allocated resources */ mainForm::~mainForm() { destroy(); // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void mainForm::languageChange() { retranslateUi(this); } void mainForm::init() { clipboard = QApplication::clipboard(); findWin = 0; editWin = 0; logWin = 0; clipboard = QApplication::clipboard(); recsPerView = 1000; recAtTop = 0; gotoValidator = new QIntValidator(0,0,this); editGoto->setValidator(gotoValidator); gotoValidator->setRange ( 0, 0); resetBrowser(); this->setCaption(applicationName); this->setIcon( qPixmapFromMimeSource( applicationIconName ) ); buttonNext->setEnabled(FALSE); buttonPrevious->setEnabled(FALSE); if (!editWin) { editWin = new editForm(this); connect( editWin, SIGNAL( goingAway() ),this, SLOT( editWinAway() ) ); connect( editWin, SIGNAL( updateRecordText(int, int , QString) ), this, SLOT( updateRecordText(int, int , QString) ) ); } if (!logWin) { logWin = new sqlLogForm(this); connect( logWin, SIGNAL( goingAway() ),this, SLOT( logWinAway() ) ); connect( logWin, SIGNAL( dbState(bool) ),this, SLOT( dbState(bool) ) ); } updatePreferences(); //connect db and log db.logWin = logWin; } void mainForm::destroy() { if (gotoValidator) delete gotoValidator; } void mainForm::fileOpen(const QString & fileName) { QString wFile = fileName; if (!QFile::exists(wFile)) { wFile = Q3FileDialog::getOpenFileName( defaultlocation, "", this, "open file dialog" "Choose a database file" ); } if (QFile::exists(wFile) ) { if (db.open(wFile)) { this->setCaption(applicationName+" - "+wFile); fileCloseAction->setEnabled(true); fileCompactAction->setEnabled(true); editCreateTableAction->setEnabled(true); editDeleteTableAction->setEnabled(true); editModifyTableAction->setEnabled(true); editCreateIndexAction->setEnabled(true); editDeleteIndexAction->setEnabled(true); } else { QString err = "An error occurred: "; err.append(db.lastErrorMessage); QMessageBox::information( this, applicationName ,err); } populateStructure(); resetBrowser(); } } void mainForm::fileOpen() { fileOpen(QString()); } void mainForm::fileNew() { QString fileName = Q3FileDialog::getSaveFileName( defaultlocation, "", this, "create file dialog" "Choose a filename to save under" ); if (QFile::exists(fileName) ) { QString err = "File "; err.append(fileName); err.append(" already exists. Please choose a different name"); QMessageBox::information( this, applicationName ,err); return; } if (!fileName.isNull()) { db.create(fileName); this->setCaption(applicationName+" - "+fileName); populateStructure(); resetBrowser(); createTable(); fileCloseAction->setEnabled(true); fileCompactAction->setEnabled(true); editCreateTableAction->setEnabled(true); editDeleteTableAction->setEnabled(true); editModifyTableAction->setEnabled(true); editCreateIndexAction->setEnabled(true); editDeleteIndexAction->setEnabled(true); } } void mainForm::populateStructure() { dblistView->clear(); dblistView->setSorting(-1); if (!db.isOpen()){ return; } db.updateSchema(); tableMap::Iterator it; tableMap tmap = db.tbmap; Q3ListViewItem * lasttbitem = 0; for ( it = tmap.begin(); it != tmap.end(); ++it ) { Q3ListViewItem * tbitem = new Q3ListViewItem( dblistView, lasttbitem ); //tbitem->setOpen( TRUE ); tbitem->setText( 0, it.data().getname() ); tbitem->setText( 1, "table" ); tbitem->setText( 3, it.data().getsql() ); fieldMap::Iterator fit; fieldMap fmap = it.data().fldmap; Q3ListViewItem * lastflditem = 0; for ( fit = fmap.begin(); fit != fmap.end(); ++fit ) { Q3ListViewItem * fielditem = new Q3ListViewItem(tbitem, lastflditem); fielditem->setText( 0, fit.data().getname() ); fielditem->setText( 1, "field" ); fielditem->setText( 2, fit.data().gettype() ); lastflditem = fielditem; } lasttbitem = tbitem; } indexMap::Iterator it2; indexMap imap = db.idxmap; for ( it2 = imap.begin(); it2 != imap.end(); ++it2 ) { Q3ListViewItem * item = new Q3ListViewItem( dblistView, lasttbitem ); item->setText( 0, it2.data().getname()); item->setText( 1, "index" ); item->setText( 3, it2.data().getsql() ); lasttbitem = item ; } } void mainForm::populateTable( const QString & tablename) { bool mustreset = false; QApplication::setOverrideCursor( Qt::waitCursor, TRUE ); if (tablename.compare(db.curBrowseTableName)!=0) mustreset = true; if (!db.browseTable(tablename)){ dataTable->setNumRows( 0 ); dataTable->setNumCols( 0 ); QApplication::restoreOverrideCursor(); if (findWin){ findWin->resetFields(db.getTableFields("")); findWin->resetResults(); } return; } if (mustreset){ recAtTop = 0; updateTableView(0); if (findWin) findWin->resetFields(db.getTableFields(db.curBrowseTableName)); } else { updateTableView(-1); } //got to keep findWin in synch if (findWin){ findWin->resetResults(); } if (editWin) { editWin->reset(); } } void mainForm::resetBrowser() { recAtTop = 0; comboBrowseTable->clear(); QStringList tab = db.getTableNames(); if (tab.isEmpty()){ comboBrowseTable->insertItem("",-1); } else { for ( QStringList::Iterator ct = tab.begin(); ct != tab.end(); ++ct ) { comboBrowseTable->insertItem(*ct,-1); } } setRecordsetLabel(); comboBrowseTable->setCurrentItem(0); populateTable(comboBrowseTable->currentText()); } void mainForm::fileClose() { db.close(); this->setCaption(applicationName); resetBrowser(); populateStructure(); fileCloseAction->setEnabled(false); fileCompactAction->setEnabled(false); editCreateTableAction->setEnabled(false); editDeleteTableAction->setEnabled(false); editModifyTableAction->setEnabled(false); editCreateIndexAction->setEnabled(false); editDeleteIndexAction->setEnabled(false); } void mainForm::fileExit() { if (db.isOpen()) { if (db.getDirty()) { QString msg = "Do you want to save the changes made to the database file "; msg.append(db.curDBFilename); msg.append("?"); if (QMessageBox::question( this, applicationName ,msg, QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes) { db.save(); } else { //not really necessary, I think... but will not hurt. db.revert(); } } db.close(); } QApplication::exit( 0 ); } void mainForm::closeEvent( QCloseEvent * ) { fileExit(); } void mainForm::addRecord() { if (db.addRecord()){ populateTable(db.curBrowseTableName); //added record will be the last one in view recAtTop = ((db.getRecordCount()-1)/recsPerView)*recsPerView; updateTableView(db.getRecordCount()-recAtTop-1); }else{ QMessageBox::information( this, applicationName, "Error adding record, make sure a table is selected.\n\n" "If the table contain fields declared as NOT NULL\n" "please select EDIT->PREFERENCES and adjust the\n" "default value for new records to insert an empty string." ); } } void mainForm::deleteRecord() { if (dataTable->currentRow()!=-1){ int lastselected = dataTable->currentRow(); db.deleteRecord(dataTable->currentRow()+recAtTop); populateTable(db.curBrowseTableName); int nextselected = lastselected ; if (nextselected > db.getRecordCount()){ nextselected = db.getRecordCount(); } if (nextselected>0){ selectTableLine(nextselected); } } else { QMessageBox::information( this, applicationName, "Please select a record first" ); } } void mainForm::updateTableView(int lineToSelect) { // qDebug("line to select value is %d, rowAttop = %d",lineToSelect, recAtTop); QApplication::setOverrideCursor( Qt::waitCursor, TRUE ); QStringList fields = db.browseFields; dataTable->setNumRows(0); dataTable->setNumCols( fields.count() ); int cheadnum = 0; for ( QStringList::Iterator ct = fields.begin(); ct != fields.end(); ++ct ) { dataTable->horizontalHeader()->setLabel( cheadnum, *ct ); cheadnum++; } rowList tab = db.browseRecs; int maxRecs = db.getRecordCount(); int recsThisView = maxRecs - recAtTop; if (recsThisView>recsPerView) recsThisView = recsPerView; // qDebug("recsthisview= %d\n",recsThisView); dataTable->setNumRows( recsThisView); if ( recsThisView > 0 ) { int rowNum = 0; int colNum = 0; //int dcols =0; QString rowLabel; for (int i = recAtTop; i < tab.size(); ++i) //for ( int = tab.at(recAtTop); rt !=tab.end(); ++rt ) { rowLabel.setNum(recAtTop+rowNum+1); dataTable->verticalHeader()->setLabel( rowNum, rowLabel ); colNum = 0; QStringList& rt = tab[i]; for (int e = 1; e < rt.size(); ++e) //for ( QStringList::Iterator it = (*rt).begin(); it != (*rt).end(); ++it ) { //skip first one (the rowid) // if (it!=(*rt).begin()){ QString& content = rt[e]; QString firstline = content.section( '\n', 0,0 ); if (content.length()>MAX_DISPLAY_LENGTH) { firstline.truncate(MAX_DISPLAY_LENGTH); firstline.append("..."); } dataTable->setText( rowNum, colNum, firstline); colNum++; //} } rowNum++; if (rowNum==recsThisView) break; } } //dataTable->clearSelection(true); if (lineToSelect!=-1){ //qDebug("inside selection"); selectTableLine(lineToSelect); } setRecordsetLabel(); QApplication::restoreOverrideCursor(); } void mainForm::selectTableLine(int lineToSelect) { dataTable->clearSelection(true); dataTable->selectRow(lineToSelect); dataTable->setCurrentCell(lineToSelect, 0); dataTable->ensureCellVisible (lineToSelect, 0 ) ; } void mainForm::navigatePrevious() { int nextFirstRec = recAtTop - recsPerView; if (nextFirstRec >= 0 ) { recAtTop = nextFirstRec; updateTableView(-1); } } void mainForm::navigateNext() { int nextFirstRec = recAtTop + recsPerView; //qDebug("called navigatenext, nextFirstRec=%d\n",nextFirstRec); if (nextFirstRec < db.getRecordCount() ) { recAtTop = nextFirstRec; updateTableView(-1); } } void mainForm::navigateGoto() { QString typed = editGoto->text(); bool ok; int dec = typed.toInt( &ok); if (dec==0) dec=1; if (dec>db.getRecordCount()) dec = db.getRecordCount(); recAtTop = ((dec-1)/recsPerView)*recsPerView; updateTableView(dec-recAtTop-1); editGoto->setText(QString::number(dec,10)); } void mainForm::setRecordsetLabel() { if (db.getRecordCount()==0){ labelRecordset->setText("0 - 0 of 0"); } else { QString label = QString::number(recAtTop+1,10); label.append(" - "); int lastrec = db.getRecordCount(); int lastthisview = recAtTop+recsPerView; if (lastthisview > lastrec) lastthisview = lastrec; label.append(QString::number(lastthisview,10)); label.append(" of "); label.append(QString::number(db.getRecordCount(),10)); labelRecordset->setText(label); } gotoValidator->setRange ( 0, db.getRecordCount()); if (db.getRecordCount()>1000){ if (recAtTop>=1000) { buttonPrevious->setEnabled(TRUE); } else { buttonPrevious->setEnabled(FALSE); } if (db.getRecordCount()>=(recAtTop+1000)) { buttonNext->setEnabled(TRUE); } else { buttonNext->setEnabled(FALSE); } } else { buttonNext->setEnabled(FALSE); buttonPrevious->setEnabled(FALSE); } } void mainForm::browseFind(bool open) { if (open){ if ( ! findWin ) { findWin= new findForm( this ); connect( findWin, SIGNAL( lookfor(const QString&, const QString&, const QString&) ), this, SLOT( lookfor(const QString&, const QString&, const QString&) ) ); connect( findWin, SIGNAL( showrecord(int) ),this, SLOT( showrecord(int) ) ); connect( findWin, SIGNAL( goingAway() ),this, SLOT( browseFindAway() ) ); } findWin->resetFields(db.getTableFields(db.curBrowseTableName)); findWin->show(); } else { if (findWin){ findWin->hide(); } } } void mainForm::browseFindAway() { buttonFind->toggle(); } void mainForm::lookfor( const QString & wfield, const QString & woperator, const QString & wsearchterm ) { if (!db.isOpen()){ QMessageBox::information( this, applicationName, "There is no database opened. Please open or create a new database file." ); return; } //we may need to modify woperator and wsearchterm, so use copies QString finaloperator = QString(woperator); QString finalsearchterm = QString(wsearchterm); //special case for CONTAINS operator: use LIKE and surround the search word with % characters if (woperator.compare("contains")==0){ finaloperator = QString("LIKE"); QString newsearchterm = "%"; newsearchterm.append(wsearchterm); newsearchterm.append("%"); finalsearchterm = QString(newsearchterm); } QApplication::setOverrideCursor( Qt::waitCursor, TRUE ); QString statement = "SELECT rowid, "; statement.append(wfield); statement.append(" FROM "); statement.append(db.curBrowseTableName); statement.append(" WHERE "); statement.append(wfield); statement.append(" "); statement.append(finaloperator); statement.append(" "); //searchterm needs to be quoted if it is not a number bool ok = false; wsearchterm.toDouble(&ok); if (!ok) wsearchterm.toInt(&ok, 10); if (!ok) {//not a number, quote it char * formSQL = sqlite3_mprintf("%Q",(const char *) finalsearchterm); statement.append(formSQL); if (formSQL) sqlite3_free(formSQL); } else {//append the number, unquoted statement.append(*finalsearchterm); } statement.append(" ORDER BY rowid; "); resultMap res = db.getFindResults(statement); findWin->showResults(res); QApplication::restoreOverrideCursor(); } void mainForm::showrecord( int dec ) { recAtTop = ((dec-1)/recsPerView)*recsPerView; updateTableView(dec-recAtTop-1); } void mainForm::createTable() { if (!db.isOpen()){ QMessageBox::information( this, applicationName, "There is no database opened. Please open or create a new database file." ); return; } createTableForm * tableForm = new createTableForm( this, "createtable", TRUE ); if ( tableForm->exec() ) { if (!db.executeSQL(tableForm->createStatement)){ QString error = "Error: could not create the table. Message from database engine: "; error.append(db.lastErrorMessage); QMessageBox::warning( this, applicationName, error ); } else { populateStructure(); resetBrowser(); } } } void mainForm::createIndex() { if (!db.isOpen()){ QMessageBox::information( this, applicationName, "There is no database opened. Please open or create a new database file." ); return; } createIndexForm * indexForm = new createIndexForm( this, "createindex", TRUE ); tableMap tmap = db.tbmap; indexForm->populateTable( tmap ); if ( indexForm->exec() ) { if (!db.executeSQL(indexForm->createStatement)){ QString error = "Error: could not create the index. Message from database engine: "; error.append(db.lastErrorMessage); QMessageBox::warning( this, applicationName, error ); } else { populateStructure(); resetBrowser(); } } } void mainForm::compact() { QApplication::setOverrideCursor( Qt::waitCursor, TRUE ); if (db.isOpen()){ if (!db.compact()){ QString error = "Error: could not compact the database file. Message from database engine: "; error.append(db.lastErrorMessage); QMessageBox::warning( this, applicationName, error ); } else { QMessageBox::warning( this, applicationName, "Database compacted" ); } } db.open(db.curDBFilename); populateStructure(); resetBrowser(); fileCloseAction->setEnabled(true); fileCompactAction->setEnabled(true); QApplication::restoreOverrideCursor( ); } void mainForm::deleteTable() { if (!db.isOpen()){ QMessageBox::information( this, applicationName, "There is no database opened." ); return; } deleteTableForm * tableForm = new deleteTableForm( this, "deletetable", TRUE ); tableForm->populateOptions( db.getTableNames()); if ( tableForm->exec() ) { QString statement = "DROP TABLE "; statement.append(tableForm->option); statement.append(";"); if (!db.executeSQL( statement)){ QString error = "Error: could not delete the table. Message from database engine: "; error.append(db.lastErrorMessage); QMessageBox::warning( this, applicationName, error ); } else { populateStructure(); resetBrowser(); } } } void mainForm::editTable() { if (!db.isOpen()){ QMessageBox::information( this, applicationName, "There is no database opened." ); return; } chooseTableForm * tableForm = new chooseTableForm( this, "choosetable", TRUE ); QStringList tablelist = db.getTableNames(); if (tablelist.empty()){ QMessageBox::information( this, applicationName, "There are no tables to edit in this database." ); return; } tableForm->populateOptions( tablelist ); if ( tableForm->exec() ) { //statement.append(tableForm->option); editTableForm * edTableForm = new editTableForm( this, "edittable", TRUE ); //send table name ? or handle it all from here? edTableForm->setActiveTable(&db, tableForm->option); edTableForm->exec(); //check modified status if (edTableForm->modified) { populateStructure(); resetBrowser(); } } } void mainForm::deleteIndex() { if (!db.isOpen()){ QMessageBox::information( this, applicationName, "There is no database opened." ); return; } deleteIndexForm * indexForm = new deleteIndexForm( this, "deleteindex", TRUE ); indexForm->populateOptions( db.getIndexNames()); if ( indexForm->exec() ) { QString statement = "DROP INDEX "; statement.append(indexForm->option); statement.append(";"); if (!db.executeSQL( statement)){ QString error = "Error: could not delete the index. Message from database engine: "; error.append(db.lastErrorMessage); QMessageBox::warning( this, applicationName, error ); } else { populateStructure(); resetBrowser(); } } } void mainForm::copy() { QWidget * t =dataTable->cellWidget(dataTable->currentRow(), dataTable->currentColumn()); if (t!=0){ if (t->isA( "QLineEdit" )){ /*we are in edit mode*/ if (t->hasFocus()){ QLineEdit * le = (QLineEdit *) t; le->copy(); } } } if (editGoto->hasFocus()) editGoto->copy(); } void mainForm::paste() { QWidget * t =dataTable->cellWidget(dataTable->currentRow(), dataTable->currentColumn()); if (t!=0){ if (t->isA( "QLineEdit" )){ /*we are in edit mode*/ if (t->hasFocus()){ QLineEdit * le = (QLineEdit *) t; le->paste();} } } if (editGoto->hasFocus()) editGoto->paste(); } void mainForm::helpWhatsThis() { Q3WhatsThis::enterWhatsThisMode (); } void mainForm::helpAbout() { aboutForm * aForm = new aboutForm( this, "about", TRUE ); aForm ->exec() ; } void mainForm::updateRecordText(int row, int col, QString newtext) { if (!db.updateRecord(row, col, newtext)){ QMessageBox::information( this, applicationName, "Data could not be updated" ); } rowList tab = db.browseRecs; QStringList& rt = tab[row]; QString& cv = rt[col+1];//must account for rowid QString content = cv ; QString firstline = content.section( '\n', 0,0 ); if (content.length()>14) { firstline.truncate(14); firstline.append("..."); } dataTable->setText( row - recAtTop, col, firstline); } void mainForm::logWinAway() { sqlLogAction->toggle(); } void mainForm::editWinAway() { editWin->hide(); setActiveWindow(); dataTable->selectCells ( editWin->curRow - recAtTop, editWin->curCol, editWin->curRow- recAtTop, editWin->curCol); } void mainForm::editText(int row, int col) { rowList tab = db.browseRecs; QStringList& rt = tab[row]; QString cv = rt[col+1];//must account for rowid editWin->loadText(cv , row, col); editWin ->show(); } void mainForm::doubleClickTable( int row, int col, int button, const QPoint & mousepoint ) { if ((row==-1) || (col==-1)){ qDebug("no cell selected"); return; } int realRow = row + recAtTop; editText(realRow , col); } void mainForm::executeQuery() { QString query = db.GetEncodedQString(sqlTextEdit->text()); if (query.isEmpty()) { QMessageBox::information( this, applicationName, "Query string is empty" ); return; } //log the query db.logSQL(query, kLogMsg_User); sqlite3_stmt *vm; const char *tail=NULL; int ncol; int err=0; QString lastErrorMessage = QString("No error"); //Accept multi-line queries, by looping until the tail is empty while (1) { if (tail!=NULL) { query = QString(tail); } queryResultListView->clear(); queryResultListView->setSorting (-1, FALSE); while (queryResultListView->columns()>0) { queryResultListView->removeColumn(0); } err=sqlite3_prepare(db._db,query,query.length(), &vm, &tail); if (err == SQLITE_OK){ db.setDirty(true); int rownum = 0; Q3ListViewItem * lasttbitem = 0; bool mustCreateColumns = true; while ( sqlite3_step(vm) == SQLITE_ROW ){ ncol = sqlite3_data_count(vm); Q3ListViewItem * tbitem = new Q3ListViewItem( queryResultListView, lasttbitem); //setup num of cols here for display grid if (mustCreateColumns) { for (int e=0; eaddColumn(sqlite3_column_name(vm, e)); mustCreateColumns = false; } for (int e=0; eMAX_DISPLAY_LENGTH) { firstline.truncate(MAX_DISPLAY_LENGTH); firstline.append("..."); } tbitem->setText( e, firstline); lasttbitem = tbitem; rownum++; } } sqlite3_finalize(vm); }else{ lastErrorMessage = QString (sqlite3_errmsg(db._db)); } queryErrorLineEdit->setText(lastErrorMessage); queryResultListView->setResizeMode(Q3ListView::AllColumns); if(*tail==0) break; } } void mainForm::mainTabSelected(const QString & tabname) { if ((mainTab->currentPageIndex ()==0)||(mainTab->currentPageIndex ()==1)) { populateStructure(); resetBrowser(); } } void mainForm::toggleLogWindow( bool enable ) { if (enable){ logWin->show(); } else { logWin->hide(); } } void mainForm::importTableFromCSV() { if (!db.isOpen()){ QMessageBox::information( this, applicationName, "There is no database opened. Please open or create a new database file first." ); return; } if (db.getDirty()) { QString msg = "Database needs to be saved before the import operation.\nSave current changes and continue?"; if (QMessageBox::question( this, applicationName ,msg, QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes) { db.save(); } else { return; } } QString wFile = Q3FileDialog::getOpenFileName( defaultlocation, "Text files (*.csv *.txt)", this, "import csv data" "Choose a text file" ); if (QFile::exists(wFile) ) { importCSVForm * csvForm = new importCSVForm( this, "importcsv", TRUE ); csvForm->initialize(wFile, &db); if ( csvForm->exec() ) { populateStructure(); resetBrowser(); QMessageBox::information( this, applicationName, "Import completed" ); } } } void mainForm::exportTableToCSV() { if (!db.isOpen()){ QMessageBox::information( this, applicationName, "There is no database opened to export" ); return; } exportTableCSVForm * exportForm = new exportTableCSVForm( this, "export table", TRUE ); exportForm->populateOptions( db.getTableNames()); if ( exportForm->exec() ) { //qDebug(exportForm->option); //load our table db.browseTable(exportForm->option); QString fileName = Q3FileDialog::getSaveFileName( defaultlocation, "Text files (*.csv *txt)", this, "save file dialog" "Choose a filename to export data" ); if (fileName.size() > 0) { QFile file(fileName); if ( file.open( QIODevice::WriteOnly ) ) { char quote = '"'; char sep = ','; char feed = 10; int colNum = 0; int colCount = 0; Q3TextStream stream( &file ); //fieldnames on first row QStringList fields = db.browseFields; colCount = fields.count(); for ( QStringList::Iterator ct = fields.begin(); ct != fields.end(); ++ct ) { stream << quote; stream << *ct; stream << quote; colNum++; if (colNumsetEnabled(dirty); fileRevertAction->setEnabled(dirty); } void mainForm::fileSave() { if (db.isOpen()){ db.save(); } } void mainForm::fileRevert() { if (db.isOpen()){ QString msg = "Are you sure you want to undo all changes made to the database file \n "; msg.append(db.curDBFilename); msg.append(" since the last save?"); if (QMessageBox::question( this, applicationName ,msg, QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes) { db.revert(); populateStructure(); resetBrowser(); } } } void mainForm::exportDatabaseToSQL() { if (!db.isOpen()){ QMessageBox::information( this, applicationName, "There is no database opened to export" ); return; } QString fileName = Q3FileDialog::getSaveFileName( defaultlocation, "Text files (*.sql *txt)", 0, "save file dialog" "Choose a filename to export" ); if (fileName.size() > 0) { if (!db.dump(fileName)) { QMessageBox::information( this, applicationName, "Could not create export file" ); } else { QMessageBox::information( this, applicationName, "Export completed" ); } } } void mainForm::importDatabaseFromSQL() { QString fileName = Q3FileDialog::getOpenFileName( defaultlocation, "Text files (*.sql *txt)", 0, "import file dialog" "Choose a file to import" ); if (fileName.size() > 0) { QString msg = "Do you want to create a new database file to hold the imported data?\nIf you answer NO we will attempt to import data in the .sql file to the current database."; if (QMessageBox::question( this, applicationName ,msg, QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes) { QString newDBfile = Q3FileDialog::getSaveFileName( defaultlocation, "", this, "create file dialog" "Choose a filename to save under" ); if (QFile::exists(newDBfile) ) { QString err = "File "; err.append(newDBfile); err.append(" already exists. Please choose a different name"); QMessageBox::information( this, applicationName ,err); return; } if (!fileName.isNull()) { db.create(newDBfile); } } int lineErr; if (!db.reload(fileName, &lineErr)) { QMessageBox::information( this, applicationName, QString("Error importing data at line %1").arg(lineErr) ); } else { QMessageBox::information( this, applicationName, "Import completed" ); } populateStructure(); resetBrowser(); } } void mainForm::openPreferences() { preferencesForm * prefForm = new preferencesForm( this, "preferences", TRUE ); if ( prefForm->exec() ) { updatePreferences(); resetBrowser(); } } void mainForm::updatePreferences() { preferencesForm * prefForm = new preferencesForm( this, "preferences", TRUE ); prefForm->loadSettings(); if (prefForm->defaultencoding=="Latin1") { db.setEncoding(kEncodingLatin1); } else { db.setEncoding(kEncodingUTF8); } db.setDefaultNewData(prefForm->defaultnewdata); defaultlocation= prefForm->defaultlocation; editWin->defaultlocation = defaultlocation; editWin->setTextFormat(prefForm->defaulttext); } sqlitebrowser-2.0.0~beta1+ds.1/deleteindexform.cpp0000644000175000017500000000271211254510210022355 0ustar lisandrolisandro#include "deleteindexform.h" #include #include #include #include "qmessagebox.h" /* * Constructs a deleteIndexForm 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. */ deleteIndexForm::deleteIndexForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); } /* * Destroys the object and frees any allocated resources */ deleteIndexForm::~deleteIndexForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void deleteIndexForm::languageChange() { retranslateUi(this); } void deleteIndexForm::confirmDelete() { QString msg = "Are you sure you want to delete index "; msg.append(comboOptions->currentText()); msg.append("?"); if (QMessageBox::warning( this, applicationName, msg, QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes ){ option = comboOptions->currentText(); accept(); } } void deleteIndexForm::populateOptions(QStringList entries) { comboOptions->clear(); for ( QStringList::Iterator ct = entries.begin(); ct != entries.end(); ++ct ) { comboOptions->insertItem(*ct,-1); } } sqlitebrowser-2.0.0~beta1+ds.1/editform.h0000644000175000017500000002763611305522134020476 0ustar lisandrolisandro#ifndef EDITFORM_H #define EDITFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE class Ui_editForm { public: QVBoxLayout *vboxLayout; QHBoxLayout *hboxLayout; QToolButton *importButton; QToolButton *exportButton; QSpacerItem *spacer11_2; QToolButton *clearButton; QStackedWidget *editWidgetStack; QWidget *WStackPage; QGridLayout *gridLayout; Q3TextEdit *textEditor; QWidget *WStackPage1; QGridLayout *gridLayout1; QLabel *editPixmap; Q3Frame *frame9; QVBoxLayout *vboxLayout1; QLabel *currentTypeLabel; QLabel *currentDataInfo; QHBoxLayout *hboxLayout1; QSpacerItem *spacer11; QPushButton *closeButton; QPushButton *saveChangesButton; void setupUi(QDialog *editForm) { if (editForm->objectName().isEmpty()) editForm->setObjectName(QString::fromUtf8("editForm")); editForm->resize(366, 431); editForm->setModal(true); vboxLayout = new QVBoxLayout(editForm); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); importButton = new QToolButton(editForm); importButton->setObjectName(QString::fromUtf8("importButton")); QSizePolicy sizePolicy(static_cast(1), static_cast(0)); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(importButton->sizePolicy().hasHeightForWidth()); importButton->setSizePolicy(sizePolicy); hboxLayout->addWidget(importButton); exportButton = new QToolButton(editForm); exportButton->setObjectName(QString::fromUtf8("exportButton")); sizePolicy.setHeightForWidth(exportButton->sizePolicy().hasHeightForWidth()); exportButton->setSizePolicy(sizePolicy); hboxLayout->addWidget(exportButton); spacer11_2 = new QSpacerItem(81, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacer11_2); clearButton = new QToolButton(editForm); clearButton->setObjectName(QString::fromUtf8("clearButton")); sizePolicy.setHeightForWidth(clearButton->sizePolicy().hasHeightForWidth()); clearButton->setSizePolicy(sizePolicy); hboxLayout->addWidget(clearButton); vboxLayout->addLayout(hboxLayout); editWidgetStack = new QStackedWidget(editForm); editWidgetStack->setObjectName(QString::fromUtf8("editWidgetStack")); WStackPage = new QWidget(editWidgetStack); WStackPage->setObjectName(QString::fromUtf8("WStackPage")); gridLayout = new QGridLayout(WStackPage); gridLayout->setSpacing(6); gridLayout->setContentsMargins(11, 11, 11, 11); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); gridLayout->setContentsMargins(0, 0, 0, 0); textEditor = new Q3TextEdit(WStackPage); textEditor->setObjectName(QString::fromUtf8("textEditor")); textEditor->setTextFormat(Qt::PlainText); gridLayout->addWidget(textEditor, 0, 0, 1, 1); editWidgetStack->addWidget(WStackPage); WStackPage1 = new QWidget(editWidgetStack); WStackPage1->setObjectName(QString::fromUtf8("WStackPage1")); gridLayout1 = new QGridLayout(WStackPage1); gridLayout1->setSpacing(6); gridLayout1->setContentsMargins(11, 11, 11, 11); gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); gridLayout1->setContentsMargins(0, 0, 0, 0); editPixmap = new QLabel(WStackPage1); editPixmap->setObjectName(QString::fromUtf8("editPixmap")); editPixmap->setMaximumSize(QSize(320, 240)); editPixmap->setScaledContents(true); editPixmap->setAlignment(Qt::AlignCenter); editPixmap->setWordWrap(false); gridLayout1->addWidget(editPixmap, 0, 0, 1, 1); editWidgetStack->addWidget(WStackPage1); vboxLayout->addWidget(editWidgetStack); frame9 = new Q3Frame(editForm); frame9->setObjectName(QString::fromUtf8("frame9")); frame9->setFrameShape(QFrame::Box); frame9->setFrameShadow(QFrame::Sunken); vboxLayout1 = new QVBoxLayout(frame9); vboxLayout1->setSpacing(6); vboxLayout1->setMargin(11); vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); currentTypeLabel = new QLabel(frame9); currentTypeLabel->setObjectName(QString::fromUtf8("currentTypeLabel")); currentTypeLabel->setAlignment(Qt::AlignVCenter|Qt::AlignLeft); currentTypeLabel->setWordWrap(false); vboxLayout1->addWidget(currentTypeLabel); currentDataInfo = new QLabel(frame9); currentDataInfo->setObjectName(QString::fromUtf8("currentDataInfo")); currentDataInfo->setAlignment(Qt::AlignVCenter|Qt::AlignLeft); currentDataInfo->setWordWrap(true); vboxLayout1->addWidget(currentDataInfo); vboxLayout->addWidget(frame9); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); spacer11 = new QSpacerItem(90, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout1->addItem(spacer11); closeButton = new QPushButton(editForm); closeButton->setObjectName(QString::fromUtf8("closeButton")); closeButton->setDefault(true); hboxLayout1->addWidget(closeButton); saveChangesButton = new QPushButton(editForm); saveChangesButton->setObjectName(QString::fromUtf8("saveChangesButton")); saveChangesButton->setEnabled(false); saveChangesButton->setDefault(false); hboxLayout1->addWidget(saveChangesButton); vboxLayout->addLayout(hboxLayout1); retranslateUi(editForm); QObject::connect(importButton, SIGNAL(clicked()), editForm, SLOT(importData())); QObject::connect(exportButton, SIGNAL(clicked()), editForm, SLOT(exportData())); QObject::connect(saveChangesButton, SIGNAL(clicked()), editForm, SLOT(saveChanges())); QObject::connect(clearButton, SIGNAL(clicked()), editForm, SLOT(clearData())); QObject::connect(textEditor, SIGNAL(textChanged()), editForm, SLOT(editTextChanged())); QObject::connect(closeButton, SIGNAL(clicked()), editForm, SLOT(close())); QObject::connect(textEditor, SIGNAL(clicked(int,int)), editForm, SLOT(editorClicked())); QMetaObject::connectSlotsByName(editForm); } // setupUi void retranslateUi(QDialog *editForm) { editForm->setWindowTitle(QApplication::translate("editForm", "Edit database cell", 0, QApplication::UnicodeUTF8)); importButton->setText(QApplication::translate("editForm", "Import", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP importButton->setProperty("toolTip", QVariant(QApplication::translate("editForm", "Import text", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS importButton->setProperty("whatsThis", QVariant(QApplication::translate("editForm", "Opens a file dialog used to import text to this database cell.", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS exportButton->setText(QApplication::translate("editForm", "Export", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP exportButton->setProperty("toolTip", QVariant(QApplication::translate("editForm", "Export text", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS exportButton->setProperty("whatsThis", QVariant(QApplication::translate("editForm", "Opens a file dialog used to export the contents of this database cell to a text file.", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS clearButton->setText(QApplication::translate("editForm", "Clear", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP clearButton->setProperty("toolTip", QVariant(QApplication::translate("editForm", "Clear cell data", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS clearButton->setProperty("whatsThis", QVariant(QApplication::translate("editForm", "Erases the contents of the cell", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS #ifndef QT_NO_TOOLTIP frame9->setProperty("toolTip", QVariant(QString())); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS frame9->setProperty("whatsThis", QVariant(QApplication::translate("editForm", "This area displays information about the data present in this database cell", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS currentTypeLabel->setText(QApplication::translate("editForm", "Type of data currently in cell: Empty", 0, QApplication::UnicodeUTF8)); currentDataInfo->setText(QApplication::translate("editForm", "Data information", 0, QApplication::UnicodeUTF8)); closeButton->setText(QApplication::translate("editForm", "Close", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP closeButton->setProperty("toolTip", QVariant(QApplication::translate("editForm", "Close", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS closeButton->setProperty("whatsThis", QVariant(QApplication::translate("editForm", "Close the window without saving changes", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS saveChangesButton->setText(QApplication::translate("editForm", "Apply Changes", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP saveChangesButton->setProperty("toolTip", QVariant(QApplication::translate("editForm", "Save changes to database", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS saveChangesButton->setProperty("whatsThis", QVariant(QApplication::translate("editForm", "Close this window saving changes to the database", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS } // retranslateUi }; namespace Ui { class editForm: public Ui_editForm {}; } // namespace Ui QT_END_NAMESPACE class editForm : public QDialog, public Ui::editForm { Q_OBJECT public: editForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~editForm(); int curCol; int curRow; QString defaultlocation; public slots: virtual void reset(); virtual void setModified( bool modifiedstate ); virtual void enableExport( bool enabled ); virtual void enableTextEditor( bool enabled ); virtual void setTextFormat( QString format ); virtual void setDataType( int type, int size ); virtual void closeEvent( QCloseEvent * ); virtual void loadText( QString text, int row, int col ); virtual void importData(); virtual void exportData(); virtual void clearData(); virtual void saveChanges(); virtual void editTextChanged(); virtual void editorClicked(); signals: void goingAway(); void updateRecordText(int, int, QString); void updateRecordBinary(int, int, unsigned char *); protected: bool modified; int dataType; int dataSize; int dataDepth; protected slots: virtual void languageChange(); private: void init(); void destroy(); }; #endif // EDITFORM_H sqlitebrowser-2.0.0~beta1+ds.1/createtableform.cpp0000644000175000017500000000774411304272743022364 0ustar lisandrolisandro#include "createtableform.h" #include #include #include #include "qmessagebox.h" #include "addfieldform.h" /* * Constructs a createTableForm 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. */ createTableForm::createTableForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); init(); } /* * Destroys the object and frees any allocated resources */ createTableForm::~createTableForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void createTableForm::languageChange() { retranslateUi(this); } void createTableForm::init() { fieldListView->clear(); fieldListView->setSorting (-1, FALSE); } void createTableForm::confirmCreate() { bool ok = true; QString tabname = tablenameLineEdit->text(); if (tabname.isEmpty()) { ok = false; QMessageBox::information( this, applicationName, "Please select a name for the table" ); return; } if (tabname.contains(" ")>0) { ok = false; QMessageBox::warning( this, applicationName, "Spaces are not allowed in the table name" ); return; } if (fieldListView->firstChild()==0) { ok = false; QMessageBox::information( this, applicationName, "No fields defined" ); return; } /*check field names for empty or illegal names TODO: move to add for (int r=0; rnumRows();r++){ QString rowname = fieldsTable->text(r, 0); if (rowname.isEmpty()) { ok = false; QMessageBox::warning( this, applicationName, "Empty field names are not allowed" ); break; } if (rowname.contains(" ")>0) { ok = false; QMessageBox::warning( this, applicationName, "Spaces are not allowed in the field names" ); break; } }*/ if (!ok){ return; } if (ok){ createStatement = "CREATE TABLE "; createStatement.append(tabname); createStatement.append(" ("); Q3ListViewItemIterator it( fieldListView ); Q3ListViewItem * item; while ( it.current() ) { item = it.current(); createStatement.append(item->text(0)); createStatement.append(" "); createStatement.append(item->text(1)); if (item->nextSibling() != 0) { createStatement.append(", "); } ++it; } /*for (int r=0; rnumRows();r++){ createStatement.append(fieldsTable->text(r, 0)); createStatement.append(" "); createStatement.append(fieldsTable->text(r, 1)); if (r<(fieldsTable->numRows() - 1)) createStatement.append(", "); }*/ createStatement.append(");"); accept(); } } void createTableForm::addField() { addFieldForm * addForm = new addFieldForm( this, "addfield", TRUE ); addForm->setInitialValues(QString(""),QString("")); if (addForm->exec()) { //qDebug(addForm->fname + addForm->ftype); Q3ListViewItem * tbitem = new Q3ListViewItem( fieldListView, fieldListView->lastItem() ); tbitem->setText( 0, addForm->fname ); tbitem->setText( 1, addForm->ftype ); } } void createTableForm::deleteField() { Q3ListViewItem * item = fieldListView->selectedItem(); if (item==0) { //should never happen, the button would not be active, but... return; } else { delete item; } } void createTableForm::fieldSelectionChanged() { Q3ListViewItem * item = fieldListView->selectedItem(); if (item==0) { buttonDeleteField->setEnabled(false); } else { buttonDeleteField->setEnabled(true); } } sqlitebrowser-2.0.0~beta1+ds.1/sqllogform.h0000644000175000017500000001240711304272743021047 0ustar lisandrolisandro#ifndef SQLLOGFORM_H #define SQLLOGFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE class Ui_sqlLogForm { public: QVBoxLayout *vboxLayout; QHBoxLayout *hboxLayout; QLabel *textLabel1; QComboBox *comboBox3; QSpacerItem *spacer10; QPushButton *clearButton; Q3WidgetStack *logStack; QWidget *WStackPage; QGridLayout *gridLayout; Q3TextEdit *userLogText; QWidget *WStackPage1; QVBoxLayout *vboxLayout1; Q3TextEdit *appLogText; void setupUi(QDialog *sqlLogForm) { if (sqlLogForm->objectName().isEmpty()) sqlLogForm->setObjectName(QString::fromUtf8("sqlLogForm")); sqlLogForm->resize(547, 203); vboxLayout = new QVBoxLayout(sqlLogForm); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); textLabel1 = new QLabel(sqlLogForm); textLabel1->setObjectName(QString::fromUtf8("textLabel1")); textLabel1->setWordWrap(false); hboxLayout->addWidget(textLabel1); comboBox3 = new QComboBox(sqlLogForm); comboBox3->setObjectName(QString::fromUtf8("comboBox3")); hboxLayout->addWidget(comboBox3); spacer10 = new QSpacerItem(150, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacer10); clearButton = new QPushButton(sqlLogForm); clearButton->setObjectName(QString::fromUtf8("clearButton")); hboxLayout->addWidget(clearButton); vboxLayout->addLayout(hboxLayout); logStack = new Q3WidgetStack(sqlLogForm); logStack->setObjectName(QString::fromUtf8("logStack")); WStackPage = new QWidget(logStack); WStackPage->setObjectName(QString::fromUtf8("WStackPage")); gridLayout = new QGridLayout(WStackPage); gridLayout->setSpacing(6); gridLayout->setContentsMargins(11, 11, 11, 11); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); gridLayout->setContentsMargins(0, 0, 0, 0); userLogText = new Q3TextEdit(WStackPage); userLogText->setObjectName(QString::fromUtf8("userLogText")); userLogText->setTextFormat(Qt::PlainText); userLogText->setReadOnly(true); gridLayout->addWidget(userLogText, 0, 0, 1, 1); logStack->addWidget(WStackPage, 0); WStackPage1 = new QWidget(logStack); WStackPage1->setObjectName(QString::fromUtf8("WStackPage1")); vboxLayout1 = new QVBoxLayout(WStackPage1); vboxLayout1->setSpacing(6); vboxLayout1->setContentsMargins(11, 11, 11, 11); vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); vboxLayout1->setContentsMargins(0, 0, 0, 0); appLogText = new Q3TextEdit(WStackPage1); appLogText->setObjectName(QString::fromUtf8("appLogText")); appLogText->setTextFormat(Qt::PlainText); appLogText->setReadOnly(true); vboxLayout1->addWidget(appLogText); logStack->addWidget(WStackPage1, 1); vboxLayout->addWidget(logStack); retranslateUi(sqlLogForm); QObject::connect(clearButton, SIGNAL(clicked()), sqlLogForm, SLOT(clearLog())); QObject::connect(comboBox3, SIGNAL(activated(int)), logStack, SLOT(raiseWidget(int))); QMetaObject::connectSlotsByName(sqlLogForm); } // setupUi void retranslateUi(QDialog *sqlLogForm) { sqlLogForm->setWindowTitle(QApplication::translate("sqlLogForm", "SQL Log", 0, QApplication::UnicodeUTF8)); textLabel1->setText(QApplication::translate("sqlLogForm", "Show SQL submitted by:", 0, QApplication::UnicodeUTF8)); comboBox3->clear(); comboBox3->insertItems(0, QStringList() << QApplication::translate("sqlLogForm", "User", 0, QApplication::UnicodeUTF8) << QApplication::translate("sqlLogForm", "Application", 0, QApplication::UnicodeUTF8) ); clearButton->setText(QApplication::translate("sqlLogForm", "Clear", 0, QApplication::UnicodeUTF8)); } // retranslateUi }; namespace Ui { class sqlLogForm: public Ui_sqlLogForm {}; } // namespace Ui QT_END_NAMESPACE class sqlLogForm : public QDialog, public Ui::sqlLogForm { Q_OBJECT public: sqlLogForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~sqlLogForm(); public slots: virtual void closeEvent( QCloseEvent * ); virtual void log( QString & statement, int msgtype ); virtual void msgDBDirtyState( bool dirty ); virtual void clearLog(); signals: void goingAway(); void dbState(bool dirty); protected slots: virtual void languageChange(); }; #endif // SQLLOGFORM_H sqlitebrowser-2.0.0~beta1+ds.1/findform.h0000644000175000017500000002113711304272743020466 0ustar lisandrolisandro#ifndef FINDFORM_H #define FINDFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "sqlitedb.h" QT_BEGIN_NAMESPACE class Ui_findForm { public: QVBoxLayout *vboxLayout; QGridLayout *gridLayout; QPushButton *searchButton; QComboBox *findFieldCombobox; QLineEdit *searchLine; QComboBox *findOperatorComboBox; Q3ListView *findListView; QHBoxLayout *hboxLayout; QLabel *resultsLabel; QSpacerItem *spacer10; void setupUi(QDialog *findForm) { if (findForm->objectName().isEmpty()) findForm->setObjectName(QString::fromUtf8("findForm")); findForm->resize(239, 319); vboxLayout = new QVBoxLayout(findForm); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); gridLayout = new QGridLayout(); gridLayout->setSpacing(6); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); searchButton = new QPushButton(findForm); searchButton->setObjectName(QString::fromUtf8("searchButton")); gridLayout->addWidget(searchButton, 1, 2, 1, 1); findFieldCombobox = new QComboBox(findForm); findFieldCombobox->setObjectName(QString::fromUtf8("findFieldCombobox")); gridLayout->addWidget(findFieldCombobox, 0, 0, 1, 1); searchLine = new QLineEdit(findForm); searchLine->setObjectName(QString::fromUtf8("searchLine")); gridLayout->addWidget(searchLine, 1, 0, 1, 2); findOperatorComboBox = new QComboBox(findForm); findOperatorComboBox->setObjectName(QString::fromUtf8("findOperatorComboBox")); gridLayout->addWidget(findOperatorComboBox, 0, 1, 1, 2); vboxLayout->addLayout(gridLayout); findListView = new Q3ListView(findForm); findListView->addColumn(QApplication::translate("findForm", "Record", 0, QApplication::UnicodeUTF8)); findListView->header()->setClickEnabled(true, findListView->header()->count() - 1); findListView->header()->setResizeEnabled(true, findListView->header()->count() - 1); findListView->addColumn(QApplication::translate("findForm", "Data", 0, QApplication::UnicodeUTF8)); findListView->header()->setClickEnabled(true, findListView->header()->count() - 1); findListView->header()->setResizeEnabled(true, findListView->header()->count() - 1); findListView->setObjectName(QString::fromUtf8("findListView")); findListView->setMidLineWidth(30); findListView->setResizePolicy(Q3ScrollView::Manual); findListView->setResizeMode(Q3ListView::LastColumn); vboxLayout->addWidget(findListView); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); resultsLabel = new QLabel(findForm); resultsLabel->setObjectName(QString::fromUtf8("resultsLabel")); QSizePolicy sizePolicy(static_cast(7), static_cast(5)); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(resultsLabel->sizePolicy().hasHeightForWidth()); resultsLabel->setSizePolicy(sizePolicy); resultsLabel->setWordWrap(false); hboxLayout->addWidget(resultsLabel); spacer10 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacer10); vboxLayout->addLayout(hboxLayout); retranslateUi(findForm); QObject::connect(searchButton, SIGNAL(clicked()), findForm, SLOT(find())); QObject::connect(findListView, SIGNAL(clicked(Q3ListViewItem*)), findForm, SLOT(recordSelected(Q3ListViewItem*))); QMetaObject::connectSlotsByName(findForm); } // setupUi void retranslateUi(QDialog *findForm) { findForm->setWindowTitle(QApplication::translate("findForm", "Find", 0, QApplication::UnicodeUTF8)); searchButton->setText(QApplication::translate("findForm", "Search", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP searchButton->setProperty("toolTip", QVariant(QApplication::translate("findForm", "Perform the search", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS searchButton->setProperty("whatsThis", QVariant(QApplication::translate("findForm", "This button starts the search process", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS findFieldCombobox->clear(); findFieldCombobox->insertItems(0, QStringList() << QApplication::translate("findForm", "user", 0, QApplication::UnicodeUTF8) ); #ifndef QT_NO_TOOLTIP findFieldCombobox->setProperty("toolTip", QVariant(QApplication::translate("findForm", "Field to be searched", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS findFieldCombobox->setProperty("whatsThis", QVariant(QApplication::translate("findForm", "Use this control to select the field to be searched in the current table", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS #ifndef QT_NO_TOOLTIP searchLine->setProperty("toolTip", QVariant(QApplication::translate("findForm", "Enter values or words to search", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS searchLine->setProperty("whatsThis", QVariant(QApplication::translate("findForm", "This is a place to enter the word or number to be searched in the database", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS findOperatorComboBox->clear(); findOperatorComboBox->insertItems(0, QStringList() << QApplication::translate("findForm", "=", 0, QApplication::UnicodeUTF8) << QApplication::translate("findForm", "contains", 0, QApplication::UnicodeUTF8) << QApplication::translate("findForm", ">", 0, QApplication::UnicodeUTF8) << QApplication::translate("findForm", ">=", 0, QApplication::UnicodeUTF8) << QApplication::translate("findForm", "<=", 0, QApplication::UnicodeUTF8) << QApplication::translate("findForm", "<", 0, QApplication::UnicodeUTF8) ); #ifndef QT_NO_TOOLTIP findOperatorComboBox->setProperty("toolTip", QVariant(QApplication::translate("findForm", "Search criteria: use 'contains' for partial matches", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS findOperatorComboBox->setProperty("whatsThis", QVariant(QApplication::translate("findForm", "This control is used to select the search criteria used to look for the search term in the database. Use '=' or 'contains' to find words, and the comparison symbols to filter numeric data.", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS findListView->header()->setLabel(0, QApplication::translate("findForm", "Record", 0, QApplication::UnicodeUTF8)); findListView->header()->setLabel(1, QApplication::translate("findForm", "Data", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_WHATSTHIS findListView->setProperty("whatsThis", QVariant(QApplication::translate("findForm", "Results of the search will appear in this area. Click on a result to select the corresponding record in the database", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS resultsLabel->setText(QApplication::translate("findForm", "Found:", 0, QApplication::UnicodeUTF8)); } // retranslateUi }; namespace Ui { class findForm: public Ui_findForm {}; } // namespace Ui QT_END_NAMESPACE class findForm : public QDialog, public Ui::findForm { Q_OBJECT public: findForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~findForm(); public slots: virtual void showResults( resultMap rmap ); virtual void find(); virtual void resetFields( QStringList fieldlist ); virtual void resetResults(); virtual void recordSelected( Q3ListViewItem * witem ); virtual void closeEvent( QCloseEvent * ); signals: void lookfor(const QString&, const QString&, const QString&); void showrecord(int); void goingAway(); protected slots: virtual void languageChange(); }; #endif // FINDFORM_H sqlitebrowser-2.0.0~beta1+ds.1/exporttablecsvform.cpp0000644000175000017500000000220011254510210023120 0ustar lisandrolisandro#include "exporttablecsvform.h" #include #include #include /* * Constructs a exportTableCSVForm 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. */ exportTableCSVForm::exportTableCSVForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); } /* * Destroys the object and frees any allocated resources */ exportTableCSVForm::~exportTableCSVForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void exportTableCSVForm::languageChange() { retranslateUi(this); } void exportTableCSVForm::exportPressed() { option = comboOptions->currentText(); accept(); } void exportTableCSVForm::populateOptions(QStringList entries) { comboOptions->clear(); for ( QStringList::Iterator ct = entries.begin(); ct != entries.end(); ++ct ) { comboOptions->insertItem(*ct,-1); } } sqlitebrowser-2.0.0~beta1+ds.1/deletetableform.h0000644000175000017500000001157111304272743022021 0ustar lisandrolisandro#ifndef DELETETABLEFORM_H #define DELETETABLEFORM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "QtCore/QStringRef" #include "QtCore/QStringList" #include "sqlitedb.h" QT_BEGIN_NAMESPACE class Ui_deleteTableForm { public: QVBoxLayout *vboxLayout; QHBoxLayout *hboxLayout; QLabel *textLabel2; QComboBox *comboOptions; QSpacerItem *spacer13; QHBoxLayout *hboxLayout1; QSpacerItem *spacer11; QPushButton *buttonDelete; QPushButton *buttonCancel; void setupUi(QDialog *deleteTableForm) { if (deleteTableForm->objectName().isEmpty()) deleteTableForm->setObjectName(QString::fromUtf8("deleteTableForm")); deleteTableForm->resize(236, 137); vboxLayout = new QVBoxLayout(deleteTableForm); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); textLabel2 = new QLabel(deleteTableForm); textLabel2->setObjectName(QString::fromUtf8("textLabel2")); textLabel2->setWordWrap(false); hboxLayout->addWidget(textLabel2); comboOptions = new QComboBox(deleteTableForm); comboOptions->setObjectName(QString::fromUtf8("comboOptions")); hboxLayout->addWidget(comboOptions); vboxLayout->addLayout(hboxLayout); spacer13 = new QSpacerItem(20, 41, QSizePolicy::Minimum, QSizePolicy::Expanding); vboxLayout->addItem(spacer13); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); spacer11 = new QSpacerItem(31, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout1->addItem(spacer11); buttonDelete = new QPushButton(deleteTableForm); buttonDelete->setObjectName(QString::fromUtf8("buttonDelete")); hboxLayout1->addWidget(buttonDelete); buttonCancel = new QPushButton(deleteTableForm); buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); buttonCancel->setDefault(true); hboxLayout1->addWidget(buttonCancel); vboxLayout->addLayout(hboxLayout1); retranslateUi(deleteTableForm); QObject::connect(buttonCancel, SIGNAL(clicked()), deleteTableForm, SLOT(reject())); QObject::connect(buttonDelete, SIGNAL(clicked()), deleteTableForm, SLOT(confirmDelete())); QMetaObject::connectSlotsByName(deleteTableForm); } // setupUi void retranslateUi(QDialog *deleteTableForm) { deleteTableForm->setWindowTitle(QApplication::translate("deleteTableForm", "Delete Table", 0, QApplication::UnicodeUTF8)); textLabel2->setText(QApplication::translate("deleteTableForm", "Table name:", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP comboOptions->setProperty("toolTip", QVariant(QApplication::translate("deleteTableForm", "Choose the table to delete", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP #ifndef QT_NO_WHATSTHIS comboOptions->setProperty("whatsThis", QVariant(QApplication::translate("deleteTableForm", "Use this control to select the name of the table to be deleted", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_WHATSTHIS buttonDelete->setText(QApplication::translate("deleteTableForm", "Delete", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonDelete->setProperty("toolTip", QVariant(QApplication::translate("deleteTableForm", "Delete the selected table", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP buttonCancel->setText(QApplication::translate("deleteTableForm", "Cancel", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonCancel->setProperty("toolTip", QVariant(QApplication::translate("deleteTableForm", "Cancel and close dialog box", 0, QApplication::UnicodeUTF8))); #endif // QT_NO_TOOLTIP } // retranslateUi }; namespace Ui { class deleteTableForm: public Ui_deleteTableForm {}; } // namespace Ui QT_END_NAMESPACE class deleteTableForm : public QDialog, public Ui::deleteTableForm { Q_OBJECT public: deleteTableForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~deleteTableForm(); QString option; public slots: virtual void confirmDelete(); virtual void populateOptions( QStringList entries ); protected slots: virtual void languageChange(); }; #endif // DELETETABLEFORM_H sqlitebrowser-2.0.0~beta1+ds.1/sqlbrowser_util.c0000644000175000017500000002575611310221127022113 0ustar lisandrolisandro#include "sqlbrowser_util.h" #include "sqlite_source/sqlite3.h" #include #include #include #include "sqlite_source/sqlite3.h" /*following routines extracted from shell.c for dump support*/ /* ** Determines if a string is a number of not. */ static int isNumber(const char *z, int *realnum){ if( *z=='-' || *z=='+' ) z++; if( !isdigit(*z) ){ return 0; } z++; if( realnum ) *realnum = 0; while( isdigit(*z) ){ z++; } if( *z=='.' ){ z++; if( !isdigit(*z) ) return 0; while( isdigit(*z) ){ z++; } if( realnum ) *realnum = 1; } if( *z=='e' || *z=='E' ){ z++; if( *z=='+' || *z=='-' ) z++; if( !isdigit(*z) ) return 0; while( isdigit(*z) ){ z++; } if( realnum ) *realnum = 1; } return *z==0; } char *modeDescr[MODE_NUM_OF] = { "line", "column", "list", "semi", "html", "insert" }; /* ** Number of elements in an array */ #define ArraySize(X) (sizeof(X)/sizeof(X[0])) /* ** Output the given string as a quoted string using SQL quoting conventions. */ static void output_quoted_string(FILE *out, const char *z){ int i; int nSingle = 0; for(i=0; z[i]; i++){ if( z[i]=='\'' ) nSingle++; } if( nSingle==0 ){ fprintf(out,"'%s'",z); }else{ fprintf(out,"'"); while( *z ){ for(i=0; z[i] && z[i]!='\''; i++){} if( i==0 ){ fprintf(out,"''"); z++; }else if( z[i]=='\'' ){ fprintf(out,"%.*s''",i,z); z += i+1; }else{ fprintf(out,"%s",z); break; } } fprintf(out,"'"); } } /* ** Output the given string with characters that are special to ** HTML escaped. */ static void output_html_string(FILE *out, const char *z){ int i; while( *z ){ for(i=0; z[i] && z[i]!='<' && z[i]!='&'; i++){} if( i>0 ){ fprintf(out,"%.*s",i,z); } if( z[i]=='<' ){ fprintf(out,"<"); }else if( z[i]=='&' ){ fprintf(out,"&"); }else{ break; } z += i + 1; } } /* ** This is the callback routine that the SQLite library ** invokes for each row of a query result. */ static int callback(void *pArg, int nArg, char **azArg, char **azCol){ int i; struct callback_data *p = (struct callback_data*)pArg; switch( p->mode ){ case MODE_Line: { int w = 5; if( azArg==0 ) break; for(i=0; iw ) w = len; } if( p->cnt++>0 ) fprintf(p->out,"\n"); for(i=0; iout,"%*s = %s\n", w, azCol[i], azArg[i] ? azArg[i] : p->nullvalue); } break; } case MODE_Column: { if( p->cnt++==0 ){ for(i=0; icolWidth) ){ w = p->colWidth[i]; }else{ w = 0; } if( w<=0 ){ w = strlen(azCol[i] ? azCol[i] : ""); if( w<10 ) w = 10; n = strlen(azArg && azArg[i] ? azArg[i] : p->nullvalue); if( wactualWidth) ){ p->actualWidth[i] = w; } if( p->showHeader ){ fprintf(p->out,"%-*.*s%s",w,w,azCol[i], i==nArg-1 ? "\n": " "); } } if( p->showHeader ){ for(i=0; iactualWidth) ){ w = p->actualWidth[i]; }else{ w = 10; } fprintf(p->out,"%-*.*s%s",w,w,"-----------------------------------" "----------------------------------------------------------", i==nArg-1 ? "\n": " "); } } } if( azArg==0 ) break; for(i=0; iactualWidth) ){ w = p->actualWidth[i]; }else{ w = 10; } fprintf(p->out,"%-*.*s%s",w,w, azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " "); } break; } case MODE_Semi: case MODE_List: { if( p->cnt++==0 && p->showHeader ){ for(i=0; iout,"%s%s",azCol[i], i==nArg-1 ? "\n" : p->separator); } } if( azArg==0 ) break; for(i=0; inullvalue; fprintf(p->out, "%s", z); if( iout, "%s", p->separator); }else if( p->mode==MODE_Semi ){ fprintf(p->out, ";\n"); }else{ fprintf(p->out, "\n"); } } break; } case MODE_Html: { if( p->cnt++==0 && p->showHeader ){ fprintf(p->out,""); for(i=0; iout,"%s",azCol[i]); } fprintf(p->out,"\n"); } if( azArg==0 ) break; fprintf(p->out,""); for(i=0; iout,""); output_html_string(p->out, azArg[i] ? azArg[i] : p->nullvalue); fprintf(p->out,"\n"); } fprintf(p->out,"\n"); break; } case MODE_Insert: { if( azArg==0 ) break; fprintf(p->out,"INSERT INTO %s VALUES(",p->zDestTable); for(i=0; i0 ? ",": ""; if( azArg[i]==0 ){ fprintf(p->out,"%sNULL",zSep); }else if( isNumber(azArg[i], 0) ){ fprintf(p->out,"%s%s",zSep, azArg[i]); }else{ if( zSep[0] ) fprintf(p->out,"%s",zSep); output_quoted_string(p->out, azArg[i]); } } fprintf(p->out,");\n"); break; } } return 0; } /* ** Set the destination table field of the callback_data structure to ** the name of the table given. Escape any quote characters in the ** table name. */ static void set_table_name(struct callback_data *p, const char *zName){ int i, n; int needQuote; char *z; if( p->zDestTable ){ free(p->zDestTable); p->zDestTable = 0; } if( zName==0 ) return; needQuote = !isalpha(*zName) && *zName!='_'; for(i=n=0; zName[i]; i++, n++){ if( !isalnum(zName[i]) && zName[i]!='_' ){ needQuote = 1; if( zName[i]=='\'' ) n++; } } if( needQuote ) n += 2; z = p->zDestTable = malloc( n+1 ); if( z==0 ){ fprintf(stderr,"Out of memory!\n"); exit(1); } n = 0; if( needQuote ) z[n++] = '\''; for(i=0; zName[i]; i++){ z[n++] = zName[i]; if( zName[i]=='\'' ) z[n++] = '\''; } if( needQuote ) z[n++] = '\''; z[n] = 0; } /* ** This is a different callback routine used for dumping the database. ** Each row received by this callback consists of a table name, ** the table type ("index" or "table") and SQL to create the table. ** This routine should print text sufficient to recreate the table. */ static int dump_callback(void *pArg, int nArg, char **azArg, char **azCol){ struct callback_data *p = (struct callback_data *)pArg; if( nArg!=3 ) return 1; fprintf(p->out, "%s;\n", azArg[2]); if( strcmp(azArg[1],"table")==0 ){ struct callback_data d2; char* stmt; d2 = *p; d2.mode = MODE_Insert; d2.zDestTable = 0; set_table_name(&d2, azArg[0]); stmt = sqlite3_mprintf("SELECT * FROM '%q'", azArg[0]); sqlite3_exec(p->db,stmt, callback, &d2, 0); sqlite3_free(stmt); set_table_name(&d2, 0); } return 0; } /* /Dump database to a file */ int dump_database(sqlite3 * db, FILE * outfile){ int rc = 0; char *zErrMsg = 0; struct callback_data p; memset(&p, 0, sizeof(p)); p.db = db; p.mode = MODE_List; strcpy(p.separator,"|"); p.showHeader = 0; p.out = outfile; //open_db(p); fprintf(p.out, "BEGIN TRANSACTION;\n"); sqlite3_exec(p.db, "SELECT name, type, sql FROM sqlite_master " "WHERE type!='meta' AND sql NOT NULL " "ORDER BY substr(type,2,1), name", dump_callback, &p, &zErrMsg ); if( zErrMsg ){ /*fprintf(stderr,"Error: %s\n", zErrMsg);*/ free(zErrMsg); }else{ fprintf(p.out, "COMMIT;\n"); } return rc; } /* /Dump database to a file */ int load_database(sqlite3 * db, FILE * infile, int * lineErr){ int rc = 0; process_input(db, infile, lineErr); return rc; } /* ** Return TRUE if the last non-whitespace character in z[] is a semicolon. ** z[] is N characters long. */ static int _ends_with_semicolon(const char *z, int N){ while( N>0 && isspace(z[N-1]) ){ N--; } return N>0 && z[N-1]==';'; } /* ** Test to see if a line consists entirely of whitespace. */ static int _all_whitespace(const char *z){ for(; *z; z++){ if( isspace(*z) ) continue; if( *z=='/' && z[1]=='*' ){ z += 2; while( *z && (*z!='*' || z[1]!='/') ){ z++; } if( *z==0 ) return 0; z++; continue; } if( *z=='-' && z[1]=='-' ){ z += 2; while( *z && *z!='\n' ){ z++; } if( *z==0 ) return 1; continue; } return 0; } return 1; } char *sqlbrowser_getline(FILE *in){ char *zLine; int nLine; int n; int eol; nLine = 100; zLine = malloc( nLine ); if( zLine==0 ) return 0; n = 0; eol = 0; while( !eol ){ if( n+100>nLine ){ nLine = nLine*2 + 100; zLine = realloc(zLine, nLine); if( zLine==0 ) return 0; } if( fgets(&zLine[n], nLine - n, in)==0 ){ if( n==0 ){ free(zLine); return 0; } zLine[n] = 0; eol = 1; break; } while( zLine[n] ){ n++; } if( n>0 && zLine[n-1]=='\n' ){ n--; zLine[n] = 0; eol = 1; } } zLine = realloc( zLine, n+1 ); return zLine; } void process_input(sqlite3 * db, FILE *in, int * lineErr){ char *zLine; char *zSql = 0; char * zErrMsg = 0; int nSql = 0; int rc; while((zLine = sqlbrowser_getline(in))!=0 ){ if( (zSql==0 || zSql[0]==0) && _all_whitespace(zLine) ) continue; (*lineErr)++; if( zSql==0 ){ int i; for(i=0; zLine[i] && isspace(zLine[i]); i++){} if( zLine[i]!=0 ){ nSql = strlen(zLine); zSql = malloc( nSql+1 ); strcpy(zSql, zLine); } }else{ int len = strlen(zLine); zSql = realloc( zSql, nSql + len + 2 ); /*if( zSql==0 ){ fprintf(stderr,"%s: out of memory!\n", Argv0); exit(1); }*/ strcpy(&zSql[nSql++], "\n"); strcpy(&zSql[nSql], zLine); nSql += len; } free(zLine); if( zSql && _ends_with_semicolon(zSql, nSql) && sqlite3_complete(zSql) ){ rc = sqlite3_exec(db, zSql, NULL, NULL, &zErrMsg);//&zErrMsg if( rc || zErrMsg ){ //if( in!=0 && !p->echoOn ) printf("%s\n",zSql); if( zErrMsg!=0 ){ /*printf("SQL error: %s\n", zErrMsg);*/ free(zErrMsg); zErrMsg = 0; if( zSql ){ free(zSql); } return; }/*else{ printf("SQL error: %s\n", sqlite3_error_string(rc)); }*/ } free(zSql); zSql = 0; nSql = 0; } } if( zSql ){ /*if( !_all_whitespace(zSql) ) printf("Incomplete SQL: %s\n", zSql);*/ free(zSql); } /*normal exit, clear err*/ *lineErr = 0; } /* end of shell.c routines*/ sqlitebrowser-2.0.0~beta1+ds.1/images/0000755000175000017500000000000011304272743017752 5ustar lisandrolisandrosqlitebrowser-2.0.0~beta1+ds.1/images/log.png0000644000175000017500000000064010077300277021241 0ustar lisandrolisandro‰PNG  IHDR‰|Э0gIDATxœЕ’KJAEoХn??ћpIWрjœ „ЈApц:\†(фcˆIЗоuPSŠT‚ЙP№е}пЉ[ЅHТJ)ѕлl ’ЪжIuѓєњe#гз›3ЏWUтХ>VЃбY–yФЕа‡J)3€3S(ЅмšЯЧ^ŸƒрАЅ(ЌH€ .”хiк„˜ОШ(ф к”иh‘ˆ,8и?)k/ј†z€аяЃ‰“Є$iИwї2CЎ ыѕp ёМƒЄŽ‚"яыlI‰ЩзЛ‹IVoлwЋИК<ьХЎ Оуяђ €BянeRЛ6—оqИнyј“ИЊжE+ŽИШћGC—%E]“вЂVЫтˆ;нЧэOЇ‘­A§JФе„иIуˆЛНЇэO&oAZ1Ф:w&ы4=Ž#юн?џ?ёp8\ЫдЊJМdМ‘ЋбЂёМЬMFЦрЂIENDЎB`‚sqlitebrowser-2.0.0~beta1+ds.1/images/delete_index.png0000644000175000017500000000050010077300277023104 0ustar lisandrolisandro‰PNG  IHDR‰|Э0IDATxœх•MNУ0…П‡8  Hoб{T‚–гДЉї`Ы‰U $ЎѓX$ŽB‰OЩšqоЬ<йІ’ `[sБЫRRoВuFc!4ы‹Ђr#NPWЉТ.с)лcЛШЛЕКТ€НIО†вШv—ЙSˆЄ}ЇёЭУsБіыyN АHу§šxˆЙцаdV›smЄщPs;IёѕљоЋръњ–сŒK"?§иЗкŒUH•їцјхѕэWB*X…І[Iи–$зUкWtAVї;€Q7‘<Ўg‰OЧIђŸbљTЬoяЖЃDCпЎэ`ˆeWњ ќqБЦSОbтџЅётg3Чдoъ2яЩ„ПЈФIENDЎB`‚sqlitebrowser-2.0.0~beta1+ds.1/images/icone16.png0000644000175000017500000000074607721026533021735 0ustar lisandrolisandro‰PNG  IHDRѓџagAMAБŽ|ћQ“ cHRMz%€ƒљџ€шu0ъ`:—o—Љ™дqIDATxœbќџџ?% €˜(в Ф"ЊЋЋѕоПёцЭЋзЏ_+П|љRШfџјё#и~~ў"""?ХХХпŠŠŠоВ ЎhmmН@Œ)))SЮž=+''ЧghhШ ЅЅХ ЂЂТ %%ХTЖh8УГgЯюмЙУpэк5†ѓчЯ3юfњšУƒИТœbэ$S˜bž№IENDЎB`‚sqlitebrowser-2.0.0~beta1+ds.1/images/modify_table.png0000644000175000017500000000057310077300277023123 0ustar lisandrolisandro‰PNG  IHDR‰|Э0BIDATxœЕ”БNA†П!˜Œ &kЂБвЮ’–вжЪXк_A№ (щŒMh| _FsXIiiЩ&\ї[ '(мс$“ннЬЬ~;;&‰ЂbЖ-pмвz—• {)ŠF)<€э˜Ъ…Гн2)Кп6џ Љ:ˆ cѕp(WP> ’кRbAM’ШPд.зЦмžfѓоMBНCХ›ёрсœ‘к№вњT™:PХУkСБІй—ІL4юЧПкЦуlЖЮ`цFЉу“ШIVиБе§G5<!;“=ž™Эm.Г9pqцьЇ% d;“ё:ŒЧЫUкW Щ’[хB‘ИОЃїlƒŽaєGW4I˜йЪНГsз™Y7MД€qіAІ%юЧZг6зœ6RЧ‹фпчЊуUфЁќ?цГЩсBIENDЎB`‚sqlitebrowser-2.0.0~beta1+ds.1/images/searchfind.png0000644000175000017500000000122610077300277022567 0ustar lisandrolisandro‰PNG  IHDRФДl;]IDATxœе“Ёrл@†?g VьФ"xаe6“ ТhжТц ђ4”™ТTЈ2›U№р‰нБ[ІЗf’ж™Жг™ўшngчлwяргтЧKзuГsя=Q#‚Еk-WWW‹)ПЗm;‡Й-XЎз`яуЧЈЊŠыыыWСп mлR]зTяЖЈ*IŠ52ь:Ф+›ЭцUЮ/њОŸ‡У@§с=ЫMЊЂNHюЦ‚8С–›ŠœуёјЊQ\8чШ­ЅЊkФ_œgв#“ŒˆцШ`бБе’б9КЎ›ЯƒЇ‰eЕFQ4€.IEРуP dъDТрН?яXSТф† ŸM„ѕ„AƒbА@Ž‹#Щ$P“1MгY№€˜ %@ё–L МHKфhˆ€Р)ызŽAAѕД4§v†L?K…€&T@c@DЮƒ‹МР9‡ІPЃЂ(^ZDаpŠЅ˜!b­=Жжт‡ЯЄ˜P'@PDspBŒ‘Џ§D`Œ9 ^мннЭŽ€ЉоBHш„V№>}r”eЩКZуF‡1цЇŸх`ЕZaФю@І‰L3ђЫ БQ(јј™В,ЙЙЙYИбёјјHг4Дmћт›ў^­яћљx<2:‡ьД QЈыšэvЛ†aюКŽ§~1†эvЫjЕzтўY]зЭо{bŒˆyžc­ЅЊЊgЙЛнnnšя=u]?)ўЧъћ~ОНН­ЕsY–ѓ§§§ќЂупеУУУм4 г4БйlўNcмяїЄ”ў&іщ МL^YИЌ‰^IENDЎB`‚sqlitebrowser-2.0.0~beta1+ds.1/images/128.png0000644000175000017500000001031211304272743020767 0ustar lisandrolisandro‰PNG  IHDR€€У>aЫ pHYs  šœ|IDATxэY•ХЧ{6YФ‘evApE\‰( UИЄBUАxŠZтCbёђMJѕ2ЉJ4–yА(I%ЉЈIEХ Ј (‚ьћŽ0"ћ@ўП†3~мЙїЮмY˜ЙУщЊ3§-=пзпџœ>}њєщО!xrGРpGРpGРpGРpGРpGРpGРpGРpGРpGРpGРpGРpGРpGРШ ђЅІз]w]ЯŽ;,--эпЎ]Л^mкДщQTTTVXXихТ… ЅчЯŸяpюмЙіЂvgЮœ)ЙDХЪ‹D…gЯž-PtП@T>пЏgD*..Ђ з\sM())!?/Њ…tџЄш„ўчxAAAЅžsИЊЊъащгЇїž|8Ј|`„^Нz“РžъаЁCЅо}HГWЯоЊglPЙU{їю§Bя;емј_Q ІtянЛїD1nЌZ№0аG€v;x№`1ЉЈММр"ѕьй3мxу‘nИс†СШ|HœАoпОH{іь аюнЛУЎ]Л"эиБ#ЈLUзЎ]K`H ЗKƒЌ•0-пЙsч" Щў+ѕM&bvЗ~§њ=,fп-щЏPK.ев‹  Iх‚ЃЦ7KЕЧж)[нJi­v=ylзШгчz2'‰?Д\R2ч8•ш2И–ЬS9WU]&ёšx(F‡­[З†Э›7GкДiSиИqcfЈ’р•циЁя[#ЁXЂrџ–PH}Fcœ7šˆбФШ_IџBв§єгѓВЪр]ОџўП­_Пў­\оV'(++*ЦЯRŸ4I}QЯћяППшž{ю 0žŠ1М‚œйЙ@_џВ…jhpТ'Ÿ|>ќ№У*й^Лe,” Ь9tшаКко’UдЇO‘eў; [ю–jя№РЯаJ§|TщЕНРя7=tВтAјрƒш*ŽkИМD#Ž?Шf˜ŸЉi@Ч8ѕчЯЫј˜№шЃЖ›2eJЈЈЈ`шт­<’-ф:ксђš5kТќљѓУ;яМsRЦјbй /Ъ0_–ZЭpЧwќQЮŒЧек;‹љбƒёžђRB€V8"Э§жчŸўлф—T €ёƒV…УwK№оЈПЏ’›БPC…x‹_*"Žѓ­Ачљ~MOWЯЈjˆЛў|aъЇ1t`žЫбSы@^ТSx›š 5aГGўфЫЎ#-\x‘юŸ.+ь'-xgС3№4™р9М—лИ№?яОћnђ^[sвAA AОЈ№2yjйР#Z<<ƒw№^І&xя‹˜АF­§AЭ/—aІ&І*>Xx“?<‘‚Œˆдт~о 0€G8§<9<ƒwщвœ9s˜M\ПdЩ’™4щrMьlPXжЭщwb?U]иC.ю! H*†—›@ј№бjкмќ§№€aDK‡7йД4ёŒ їп{яН-Š!xAЁcˆШhЊ+-а[ЎрйRO?§tбФ‰sњ ֘ЉБœћqN0ж( C“Бvœб5Ђ ‹- ЏНіZ•њЙ‚_Gp'хЊРўI“AП—'№СI“&•NŸ>=мzы­v+чœ.Т#‚j‡­Жˆ t}xэOНXт›oО ѓцЭ .ЌT7ёО&ƒ.zќ.=Ј]sщ-Я MПЎщр5)я8ƒ”‹КІмˆЇ /7ёtЉ …љj‹yђфЩqL™Ў|c_3Ca@(Œь:чvœЬ9N%ъЦЕdOЬhJцЇŒфZ2O=6fлѕФkšьP†|XА`AŒPќр)uы+2O!K3Мє Cvˆ№њДO-Фт $•ўќЭ7п /НєRИяОћТ„ "a|4Udk!MѕŽ|Ў ЙАxётH}єQ\?гžС;x˜сOшњЛ ѓћ‰ЂЋCPqњOiюxДнFvAŒу'юOj$lиА!|§ѕзAAˆA“Iqr.‚xOMыPёФ~ійgLч‡#F„СƒЧ…4 Yg ўС8-ŸР ї_ЧМT;"|ЖŠN˜pWQ_}/hXјриБcKiхЬ#џ—.8p .nјюЛяЂ@ž gё‡Ї†#3“aсDљР№›oО9Ј›нКuKћ†…Ќ3„хЫ—Wъќ}…ГUx›(2ЕZд_Фˆ -Ч=єаCХHS.qL"1САmлЖИТ…E T,гТД5і‹i†ааX\ƒ†элЗo`т.=N"ДЖЦџчВ,€ˆ 1|Ўт‡Ъћ–.ЉpНН}и R9БЫрYH-Њ uХ‡дeiXk–0‘qVciн*ј MY.ЇYtщ2ўЏOТХaФГ№Ъ@|р: Ф НkU€{яНw…ц‡GЭš5+ЈпЏŽФРАs,ю†&„B#Š(|(і*ŠХ’є[WгтPь)ћ^˜LУРw/M? ХкЯœ€ъчИ‚5Ађу?]@DдЪ3sчЮяD2S™ € `U2fЗсTC+iџЯћx6qBТћ дš„!•‡l† kjфхсе ]шжшЕ *6 4"ѕЬЖ<мъMН`(н ецтЋ7=LjЬФЈ ыŸ–Ю;Б’‰їй"м3fа]џЙXрзˆтC“‰Б\›dLZtc$*f>э>}њЄ}$-&•0†5њидтDYˆzZ]yuFˆ:tоЊmDN? б‡BЬи<­‰cі%`щ:чvВ<уJ%ЋЋ WІїR/KDI4,"№i А­ЌВž_Ž-І›вxjK4bФŒG A8‚.K@}ЁъR5Сeub­–ыД.Л.Ѓ)КŠдї_-чІкa"§9ИчЂaаLt Љ]ј_Šъ5mкДj<)hj!@…ж–Ј}DBL;˜ ЦЅыZ";’ц§4ќ­•г=хšhЬж-бХ%“EыAЯ$€‚ќвF’§)LЌKЂТ=%„ a}3ZУќќW›`Рh0ЦеMу1[ЬыУlӘчйГшѓSoх,"ˆa`Й† d a˜-бЯгšQёІцГ•Џы=Œ1ŠфГгљ& 0иZ3LЉhVШ”‰9uХЭЪЅ>э‘-]Ўз0p2P!+vИvћxQŽ ўЯ>ћlь/В=€{0† УШ­5зіѕНіАw™%Я5Гъ”$ёОњ  $3-‡qжzЙ0рiЭ0Й!­8О4Ыгі.rЎе–Аы^yхAD=ЏнEVѓ…TrЭxЦ"XЉT†'ЋэAI4ZиБuh #nЧ щ*<"Ј™™mЬЅХ&Л Юa0ЙQcVе#‚Ви™l˜EJцЇŒфZ2O=6fлѕЦdnІgyDP&dZёujХЬЭєi” ™Vzн#‚Z)cг}VК­b="(Ry~Э#‚<"Ш#‚ЌуЦѕˆ CЃў9CS| фAiЅШ#‚вТ’iщИŠ-VР#‚ђ‡9еиT;ГŒ”tљWf37@ 'nРZ9}{Ў‰џїˆ \QЛBхaДЭ4wDPH. Щі§” ЫяС`kЭ6ѓзТ"‚тТЈWєыOj†lЎ@‡f‹В †DK@UA™’G§Œ …жh@DKУžф‰ч?u рЭъэтgЮœYт{§ xs™=`ЯrЎч’ˆzѕеWkl_-і0ћСэдйї2Tš6ЗЎТ"€ШaДЃ!ы›Aй0"љ‚фOЦh vОGPмŽЙДX3њ8†`А“7fJDхі“1ЩJhѓЫ~4ЪїКhиСH›ЬSйv=‰kS'#‚єЃQЉдJг?7AЛ‡@8&<5Щˆ FџйИtŸ•щ‡#} th5ЭЕdDаљсШLŸQлOЧњA™ЫэzjD љ~:6SеЕЂ8ЇЮєœЋ§zКˆ -хn™?Yrъ4јчуГ=?пяeŠГѓѓчуыТ EwmQ2QкbЌмЂУфныЃ@nкІƒ&.ŠlЯЖІcGіЮиbr# hЕю.ћ Aк‰=ю‡d{"ЉL•–в—Wѕ€†ƒлЕюq­ЌјхŒEђШюПRпYУtЅ^œ|hЋ­Яnзо?#%$ƒхщЇ(ЁZpZ&+ЗTлвДе^ХЖзN>ьЄ­cЮiGŽS%UЪe{HУСНšKй*цnа/Г­RKџB  і’@5Сq‹€К|—ZJO:PРіWdK/irž” и.šЧ(•Рt эEэ$8%—ЈXy‘ЈPр(gуŠQЦ=‚$Œ№БKЩЯ‹ЊDчDg!н?):Ёї—/ Rя=Ќy‘CjС{ЕФ}—u‹v“4люК|——qGРpGРpGРpGРpGРpGРpGРpGРpGРpGРpGРpGРpGРpGРpъŒРџ*ƒ50WГEIENDЎB`‚sqlitebrowser-2.0.0~beta1+ds.1/images/delete_table.png0000644000175000017500000000045510077300277023075 0ustar lisandrolisandro‰PNG  IHDR‰|Э0єIDATxœэ“ЫmУ0DпЉ&€Жв…ћ№-ејц>в…IЁ”39Pќ$‘R€o`еR|‡Л&‰Џ{ UЏћЃІблk/ЭФyЃЮ1З§Q5<­9ѓ]8ы ЗЁќaўрЕМb[ЌаœЛодP#Za’03­pVЕД!AВЧ‡ї.А]N?р5`“Чсr"]bRэ9ŠŽЉ'tF"”ќ6Фчiє\ЫЏек/(+№n+œ‹н`€˜Л€XOъˆэ5‘№YкtНе“ЗЙнj-wЖBRŽtФжк’ЖtƒЮ—gіЧІцк’žg=Ьуo4'їRмГЙIENDЎB`‚sqlitebrowser-2.0.0~beta1+ds.1/images/revert.png0000644000175000017500000000033110077300277021764 0ustar lisandrolisandro‰PNG  IHDR‰|Э0 IDATxœэ”KУ0D™ЈїПђdЂ‰ †TђЂRйХЧЯcДvlЁў$јЃhfа3пСхЫ ;Ѕp’|$пTP6 ^й)@qzішZ~дЎW Dмъё­хааJpБ4ЫжНnсп+еОЙЧ!%ыЗb1уtйЃ@Ъ$Јй’жћ=XK |lmj5’євd\А@ЪЗѓџаЛfIFˆKš IENDЎB`‚sqlitebrowser-2.0.0~beta1+ds.1/images/open.png0000644000175000017500000000071310077300277021422 0ustar lisandrolisandro‰PNG  IHDR‰|Э0’IDATxœ­дЛnAЦёџ…в$H4ИBI$‡@Œ“№@(тu NBрu ВваPИЁH*”‚‚ЕчђQЌНЙ(YkmŸfWЭя\fvMMТЬюldїз%™oŠ>ЭмNjM+ЎK:{—dnеш,–†Ba:ŠyВPТвЙ›дЙ›FъЮ ЎofгЭ)`ж&Цx bц8ЪЦ fѕMy3#ч69HO0+ŸPmЬЦ8зТ,v Џяœ#„ПЄДŽtєщА\гj­с§?Мoa–ЋŠчсо9ЧxќŒЩф7)НFфмF8їœNЧHirдГй—шc7ЂEQŒ˜LЖˆё‚œЛHCœлІлg'oцЖ}?о ё’с%EqA=р;f=њ§Фрѓ+ЎЎ†аЫЫiХ’ˆё'!ьуŒпeŽ?э,„NЫkшsЮЄДEJCЄ}іФщрѕR(€Я9Пpn›Н=q~ж[…ђ+РћMvwсы—З+AсцRђэМП2Д‚?~hфUёZС‹Бѕ?Ёџ•ЉчнЃћ%ъIENDЎB`‚sqlitebrowser-2.0.0~beta1+ds.1/images/create_table.png0000644000175000017500000000040710077300277023073 0ustar lisandrolisandro‰PNG  IHDR‰|Э0ЮIDATxœэ’С Т0 EП•‘ze8†и…-RЇ}ІIhi•TН ё%Ћюoђj[ITGIG’№-hОЃљvfдЗр7АA“П<LŸc'РYлV]–Л8 ! ! хл”З>]ыЯ’ћСЇЫГ” }`ИйKC`xCр*p(ІM }їYiпс§ГЛЕAXU[aќ$ Ъ%OƒFЈхъз€МйцTЯИTЧ1‘йЧRя›bХyДЪ[я­џŒчрНѕ{3~шТ l.„~IENDЎB`‚sqlitebrowser-2.0.0~beta1+ds.1/images/new.png0000644000175000017500000000065310077300277021255 0ustar lisandrolisandro‰PNG  IHDR‰|Э0rIDATxœ•”Kn1D_л‚ЁMЖж"dщŒ:†сSђœ…!У‹LЋ*‹&GДчЃq ‚ФљМ.‹ лдŠˆЫрJйŽЙћЋ‘fСУус9јœесь’,сМЪ~ЗП _T0v6ЉЕћН˜…O(NpЊnТЇ[`0*b=№>Ўи9§„–џХГШgОЦЭ6чwЌъo§&ИыVМќyЁы:ŽЯGŽOG‡УЇоŒ VњйBm#›ЛЛlю7ЌзkЖ?ЗlmŒqАВzЈ­ŒœЬъіяО\”*Сjр"Чqѓ> ŸX<•ИїZR+гmcПБЙп,WЌтЇ” ]-)ЛO&э:Ÿ_GС9ОLвЄ~њ|ЋЙЖЌfзЕЩЈIQ6(&-‹œvнЦmф\žшѕъ[ŠЫBhеж­]w{еуЫЄъ |јt:?ˆ€ИˆЯL ЮŠoОџЉкГт?)Є8rЕIENDЎB`‚sqlitebrowser-2.0.0~beta1+ds.1/images/create_index.png0000644000175000017500000000045310077300277023114 0ustar lisandrolisandro‰PNG  IHDR‰|Э0ђIDATxœэ”AJ1E_Щ(M{ЄйшŒ'h—эdFOтжрJг^чЛH щ8jврBА ЈЎпЩKU‚$š}Bв(IЈ'D zXГ кЃяcœщKР%ЄŒБ“р ЊЫОЧ4 “„™‰JSŸ%/йЖsЫuKрюъЁ–Прp'8DЈСЮЊi%t]TК&vк ZoК€оŽ~цсЬЙэюvђ“OP?y}uWy›OЯ?ŽЂs],:іњ‘ †вКцзкъЛŸћћ}•ж о\l>AKm{Й=ЙїзFё?уdoЦЭЯц)“dЅіšЎXt%?љIENDЎB`‚sqlitebrowser-2.0.0~beta1+ds.1/images/whatis.png0000644000175000017500000000035010077300277021755 0ustar lisandrolisandro‰PNG  IHDR‰|Э0ЏIDATxœЕ”QУ0Cmдћ_™§‰Q $н,UŠМ:)…ЊŠH€фЯщ—-HЊЊrZ˜™ёѕт‚#ч$ЕЪѓqёSИЙѓO„KRPТ-ž]YŒ=РЛЮ+Ѕр }Ўр•b^ žТ§Оh ^С3(р~ЂшЩZ+BS0Iјљ1љXYЮзUмPšг7mчgХШнЪЉIВЄЉыnnШъЭЇb7шя.Аѕ–QŸЈu є­гf„RaIENDЎB`‚sqlitebrowser-2.0.0~beta1+ds.1/macapp.icns0000644000175000017500000010160407721026533020630 0ustar lisandrolisandroicnsƒ„icm#8ј`€`ў€`ў€`ј?ќџџџџџџџџџџџџџџџџџџ?ќics#Hј`€`ў€`ў€`ј?ќџџџџџџџџџџџџџџџџџџ?ќis32ž 7@9((9@7:.O€ЊЮшљљшЮЊ€O.:$Т‰џ'Т$:/O€ЊЮшљљшЮЊ€O/:34TYH..HYT43$ЛфйвЮЬ+ЮвйфЛ$:/O€ЊЮшљљшЮЊ€O/:34TYH..HYT43$ЛфйвЮЬ$ЮвйфЛ$:.O€ЊЮшљљшЮЊ€O.:7@9((9@7Ўž 7@9((9@7:.O€ЊЮшљљшЮЊ€O.:$Т‰џ'Т$:/O€ЊЮшљљшЮЊ€O/:34TYH..HYT43$ЛфйвЮЬ+ЮвйфЛ$:/O€ЊЮшљљшЮЊ€O/:34TYH..HYT43$ЛфйвЮЬ$ЮвйфЛ$:.O€ЊЮшљљшЮЊ€O.:7@9((9@7Ўž 7@9((9@7:.O€ЊЮшљљшЮЊ€O.:$Т‰џ'Т$:/O€ЊЮшљљшЮЊ€O/:34TYH..HYT43$ЛфйвЮЬ+ЮвйфЛ$:/O€ЊЮшљљшЮЊ€O/:34TYH..HYT43$ЛфйвЮЬ$ЮвйфЛ$:.O€ЊЮшљљшЮЊ€O.:7@9((9@7Ўs8mk.†Руі§џџ§іуР†.”ёџџџџџџџџџџџџё”љџџџџџџџџџџџџџџљЉѕџџџџџџџџџџџџѕЉЁіџџџџџџџџџџџџіЁљџџџџџџџџџџџџџџљЉѕџџџџџџџџџџџџѕЉЁѕџџџџџџџџџџџџѕЁјџџџџџџџџџџџџџџј”№џџџџџџџџџџџџ№”.†Руі§џџ§іуР†.ICN#ў€№8Р€Р0 ?€ќРџџ€Р0 ?€ќ@џџ€@0 €№ўџџ€џџјџџўџџџџџџџџџџџџџџўџџўџџџџџџџџџџџџџџўџџўџџџџџџџџџџџџџџўџџјџџ€il32'џР 0770&&0770 „#17$&Ge€™ЎПЮиооиЮПЎ™€eG&$71M-JВ‘р ВJ-M\fПѕэц‘рцэѕПf\цџњѕёэъчфусррсуфчъэёѕњџц\fС—џСf\^:T‘Ы‘џGЫ‘T:^5?n_2+Qs’ЎЦкъі§§іъкЦЎ’sQ+2_n?5@fЛуеЭГ™fM7$  $7Mf™ГЭеуЛf@ц€џўяфлебЯЭƒЬЭЯбелфяў€џц@fС—џСf@=0T‘Ы‘џGЫ‘T0=53WT0+Qs’ЎЦкъі§§іъкЦЎ’sQ+0TW35@fЛуеЭБ–}dL7$  $7Ld}–БЭеуЛf@ц€џўяфлебЯЭƒЬЭЯбелфяў€џц@fС—џСf@=/T‘Ы‘џ#Ы‘T/=8?)+Qs’ЎЦкъі§§іъкЦЎ’sQ+)?8„$7?>7,    ,7>?7$џрџР 0770&&0770 „#17$&Ge€™ЎПЮиооиЮПЎ™€eG&$71M-JВ‘р ВJ-M\fПѕэц‘рцэѕПf\цџњѕёэъчфусррсуфчъэёѕњџц\fС—џСf\^:T‘Ы‘џGЫ‘T:^5?n_2+Qs’ЎЦкъі§§іъкЦЎ’sQ+2_n?5@fЛуеЭГ™fM7$  $7Mf™ГЭеуЛf@ц€џўяфлебЯЭƒЬЭЯбелфяў€џц@fС—џСf@=0T‘Ы‘џGЫ‘T0=53WT0+Qs’ЎЦкъі§§іъкЦЎ’sQ+0TW35@fЛуеЭБ–}dL7$  $7Ld}–БЭеуЛf@ц€џўяфлебЯЭƒЬЭЯбелфяў€џц@fС—џСf@=/T‘Ы‘џ#Ы‘T/=8?)+Qs’ЎЦкъі§§іъкЦЎ’sQ+)?8„$7?>7,    ,7>?7$џрџР 0770&&0770 „#17$&Ge€™ЎПЮиооиЮПЎ™€eG&$71M-JВ‘р ВJ-M\fПѕэц‘рцэѕПf\цџњѕёэъчфусррсуфчъэёѕњџц\fС—џСf\^:T‘Ы‘џGЫ‘T:^5?n_2+Qs’ЎЦкъі§§іъкЦЎ’sQ+2_n?5@fЛуеЭГ™fM7$  $7Mf™ГЭеуЛf@ц€џўяфлебЯЭƒЬЭЯбелфяў€џц@fС—џСf@=0T‘Ы‘џGЫ‘T0=53WT0+Qs’ЎЦкъі§§іъкЦЎ’sQ+0TW35@fЛуеЭБ–}dL7$  $7Ld}–БЭеуЛf@ц€џўяфлебЯЭƒЬЭЯбелфяў€џц@fС—џСf@=/T‘Ы‘џ#Ы‘T/=8?)+Qs’ЎЦкъі§§іъкЦЎ’sQ+)?8„$7?>7,    ,7>?7$џрl8mkOˆВахђњ§џџџџ§њђхаВˆO&ŒаєџџџџџџџџџџџџџџџџџџџџєаŒ&ЙѓџџџџџџџџџџџџџџџџџџџџџџџџџџѓЙпџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџпџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџхџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџх:г§џџџџџџџџџџџџџџџџџџџџџџџџџџ§г:ЏіџџџџџџџџџџџџџџџџџџџџџџџџџџіЏРџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџР§џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ§ЬџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџЬ4ЖѕџџџџџџџџџџџџџџџџџџџџџџџџџџѕЖ4ЏѕџџџџџџџџџџџџџџџџџџџџџџџџџџѕЏПџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџП§џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ§ПџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџПЃ№џџџџџџџџџџџџџџџџџџџџџџџџџџ№Ѓ&ŒаєџџџџџџџџџџџџџџџџџџџџєаŒ&OˆВахђњ§џџџџ§њђхаВˆOich#Hџџ€ў€р`€€€`?€ќ`ў€џџР€€`?€ќ`ў€џџР€€`€р~~џџ€џџрџџџџџџџџ№?џџџџќџџџџўџџџџџџџџџџџџџџџџџџџџџџџџ?џџџџќ?џџџџќџџџџўџџџџџџџџџџџџџџџџџџџџџџў?џџџџќ?џџџџќџџџџўџџџџџџџџџџџџџџџџџџџџџџў?џџџџќџџџџ№џџџџџџрih32Ўџџџт(3774,$  $,4773(Ž#+74$4Mf|ЃВРЬелпплеЬРВЃ|fM4$47+† 17;eДй•рйДe;71  5+IƒЛŸр ЛƒI+5 39ZІЅрІZ93U”ытЅр ты”UэџћюхсŸрсхюћџэU–џћёщфс—рсфщёћџ–U=PfН„џљђэщцфтсс…рсстфцщэђљ„џ НfP=^–џљуеЭЬНЉ”~jVC3#  #3CVj~”ЉНЬЭеуљџ–>эџјшлгЮ—ЬЮглшјџэ>–†џѕътлжваЮЭ…ЬЭЮавжлтъѕ†џ–>#–џљуеЭЬЛІ‘|hUB2#  #2BUh|‘ІЛЬЭеуљџ–>эџјшлгЮ—ЬЮглшјџэ>–†џѕътлжваЮЭ…ЬЭЮавжлтъѕ†џ–>##CsЁЭї•џїЭЁsC#>8†#1?;(;XtЄЙЫлшђљўўљђшлЫЙЄtX;(;?1Ž-:??;3)  )3;??:-џџџџџџџт(3774,$  $,4773(Ž#+74$4Mf|ЃВРЬелпплеЬРВЃ|fM4$47+† 17;eДй•рйДe;71  5+IƒЛŸр ЛƒI+5 39ZІЅрІZ93U”ытЅр ты”UэџћюхсŸрсхюћџэU–џћёщфс—рсфщёћџ–U=PfН„џљђэщцфтсс…рсстфцщэђљ„џ НfP=^–џљуеЭЬНЉ”~jVC3#  #3CVj~”ЉНЬЭеуљџ–>эџјшлгЮ—ЬЮглшјџэ>–†џѕътлжваЮЭ…ЬЭЮавжлтъѕ†џ–>#–џљуеЭЬЛІ‘|hUB2#  #2BUh|‘ІЛЬЭеуљџ–>эџјшлгЮ—ЬЮглшјџэ>–†џѕътлжваЮЭ…ЬЭЮавжлтъѕ†џ–>##CsЁЭї•џїЭЁsC#>8†#1?;(;XtЄЙЫлшђљўўљђшлЫЙЄtX;(;?1Ž-:??;3)  )3;??:-џџџџџџџт(3774,$  $,4773(Ž#+74$4Mf|ЃВРЬелпплеЬРВЃ|fM4$47+† 17;eДй•рйДe;71  5+IƒЛŸр ЛƒI+5 39ZІЅрІZ93U”ытЅр ты”UэџћюхсŸрсхюћџэU–џћёщфс—рсфщёћџ–U=PfН„џљђэщцфтсс…рсстфцщэђљ„џ НfP=^–џљуеЭЬНЉ”~jVC3#  #3CVj~”ЉНЬЭеуљџ–>эџјшлгЮ—ЬЮглшјџэ>–†џѕътлжваЮЭ…ЬЭЮавжлтъѕ†џ–>#–џљуеЭЬЛІ‘|hUB2#  #2BUh|‘ІЛЬЭеуљџ–>эџјшлгЮ—ЬЮглшјџэ>–†џѕътлжваЮЭ…ЬЭЮавжлтъѕ†џ–>##CsЁЭї•џїЭЁsC#>8†#1?;(;XtЄЙЫлшђљўўљђшлЫЙЄtX;(;?1Ž-:??;3)  )3;??:-џџџџh8mk 3h’ГЬпьєњ§ўџџџџў§њєьпЬГ’h3!tВмѕўџџџџџџџџџџџџџџџџџџџџџџџџўѕмВt!‹гјџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџјг‹ЃюџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџюЃaоџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџоaэџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџэџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ№џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ№ˆєџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџєˆ*SгќџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџќгS*BЕєџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџєЕBMлџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџлMдџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџдўџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџўлџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџлqсџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџсq*IЖђџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџђЖI*CЖѓџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџѓЖCMлџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџлMдџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџдўџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџўдџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџдMкџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџкMЃюџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџюЃ‹гјџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџјг‹!tВмѕўџџџџџџџџџџџџџџџџџџџџџџџџўѕмВt!3h’ГЬпьєњ§ўџџџџў§њєьпЬГ’h3it32!Зџџџџџџџџџџџџџџџџџџџџџџџџџџџџя+ +4;>@?=95/)#  #)/59=?@>;4+ Ш=0;@>8,"6I[l}ŒšЈЕРЫеоцьђїћ§џџ§ћїђьцоеЫРЕЈšŒ}l[I6",8>@;0Й (9@; ExЊл§љѕ№ьшфсПрсфшь№ѕљ§лЊxE ;>&˜ (?5-iЂзїђэшуЭр ушэђїзЂi-5?(’ <:/sБъящузр ущяъБs/:<!?,_ЄтыфпрфытЄ_,?!‰?&vОыухруыОv&?†:1vЦшыршЦv1:ƒ@TЗыярыЗT@€>ƒъчёр чъƒ>?Žџыѓр ыџŽ?;[џџтѓр тџџ[;9Њџџыѓр ыџџЊ9цџџїчёрчїџџцц€џјыярыј€џц9Њџ§ѓшыршѓ§џЊ9;[ƒџ§єыухруыє§ƒџ[;?Ž…џњђыфпрфыђњ…џŽ?>ƒђ†џќіящузрущяіќ†џђƒ>€@UМ‰џќїђэшуЭрушэђїќ‰џМU@ƒ:1wаŒџ§љѕ№ьшфсПрсфшь№ѕљ§Œџаw1:†?&wЧ‘џ ќљіђяьщчфс­р сфчщьяђіљќ‘џЧw&?‰!?-_Їю—џўќљїѕѓђ№юэыъшчцхфуттссƒрссттуфхцчшъыэю№ђѓѕїљќў—џюЇ_-?!‹21ZI1sГѓнџѓГs1IZ12‰ 2^˜МЖœuE.iЂкзџ кЂi.EuœЖ̘^2†/(^žКƒГ|S#ExЊлЯџлЊxE#S|ƒГКž^(/ƒ@K•МˆГ Ћ’rM"8dЙуХџ уЙd8"Mr’ЋˆГМ•K@€>ƒънРЕ‹Г Ў™b@2W{žСтЙџ тСž{W2@b™Ў‹ГЕРнъƒ>?ŽџыррдРЕŽГЎœ‡pV:"@\x“­ЧпїЇџїпЧ­“x\@":Vp‡œЎŽГЕРдррыџŽ?;[џџтрйХИД‘Г=БЄ”„r^J4"6I[l}ŒšЈЕРЫеоцьђїћ§џџ§ћїђьцоеЫРЕЈšŒ}l[I6"4J^r„”ЄБ‘ГДИХйр тџџ[;9Њџџы„раРȘГ+­Єš„zndYND:1(    (1:DNYdnz„šЄ­˜ГИРа„р ыџџЊ9цџџїч†рбУЙДзГДЙУб†рчїџџцц€џјыˆркЫПИДЯГДИПЫкˆрыј€џц9Њџ§ѓшŠрмЮФМЗДХГДЗМФЮмŠршѓ§џЊ9;[ƒџ§єыуŒрмаЧПЙЖДЙГДЖЙПЧамŒруыє§ƒџ[;?Ž…џњђыфроеЭЦПЛИЕДЉГДЕИЛПЦЭеорфыђњ…џŽ?>ƒђ†џќіящу”рмеЯЪЦТПМКИЗЖЕДД‹ГДДЕЖЗИКМПТЦЪЯем”рущяіќ†џђƒ>€@UМ‰џќїђэшуЭрушэђїќ‰џМU@ƒ:1wаŒџ§љѕ№ьшфсПрсфшь№ѕљ§Œџаw1:†?&wЧ‘џ ќљіђяьщчфс­р сфчщьяђіљќ‘џЧw&?‰!?-_Їю—џўќљїѕѓђ№юэыъшчцхфуттссƒрссттуфхцчшъыэю№ђѓѕїљќў—џюЇ_-?!‹21ZI1sГѓнџѓГs1IZ12‰ 2^˜МЖœuE.iЂкзџ кЂi.EuœЖ̘^2†/(^žКƒГ|S#ExЊлЯџлЊxE#S|ƒГКž^(/ƒ@K•МˆГ Ћ’rM"8dЙуХџ уЙd8"Mr’ЋˆГМ•K@€>ƒънРЕ‹Г Ў™b@2W{žСтЙџ тСž{W2@b™Ў‹ГЕРнъƒ>?ŽџыррдРЕŽГЎœ‡pV:"@\x“­ЧпїЇџїпЧ­“x\@":Vp‡œЎŽГЕРдррыџŽ?;[џџтрйХИД‘Г=БЄ”„r^J4"6I[l}ŒšЈЕРЫеоцьђїћ§џџ§ћїђьцоеЫРЕЈšŒ}l[I6"4J^r„”ЄБ‘ГДИХйр тџџ[;9Њџџы„раРȘГ+­Єš„zndYND:1(    (1:DNYdnz„šЄ­˜ГИРа„р ыџџЊ9цџџїч†рбУЙДзГДЙУб†рчїџџцц€џјыˆркЫПИДЯГДИПЫкˆрыј€џц9Њџ§ѓшŠрмЮФМЗДХГДЗМФЮмŠршѓ§џЊ9;[ƒџ§єыуŒрмаЧПЙЖДЙГДЖЙПЧамŒруыє§ƒџ[;?Ž…џњђыфроеЭЦПЛИЕДЉГДЕИЛПЦЭеорфыђњ…џŽ?>ƒђ†џќіящу”рмеЯЪЦТПМКИЗЖЕДД‹ГДДЕЖЗИКМПТЦЪЯем”рущяіќ†џђƒ>€@TМ‰џќїђэшуЭрушэђїќ‰џМT@ƒ:1wаŒџ§љѕ№ьшфсПрсфшь№ѕљ§Œџаw1:†?&wЧ‘џ ќљіђяьщчфс­р сфчщьяђіљќ‘џЧw&?‰!?,_Їю—џўќљїѕѓђ№юэыъшчцхфуттссƒрссттуфхцчшъыэю№ђѓѕїљќў—џюЇ_,?!<:/sГѓнџѓГs/:<’(?5-iЂкзџкЂi-5?(˜&>; ExЊлЯџлЊxE ;>&ž 2@98dЙуХџ уЙd89@2Ѕ ,=?32W{žСтЙџ тСž{W23?=, Ў (9@8,"6I[l}ŒšЈЕРЫеоцьђїћ§џџ§ћїђьцоеЫРЕЈšŒ}l[I6",8>@;0Ш+ +4;>@?=95/)#  #)/59=?@>;4+ џџџџџџџџџџџџџџџџџџџџџџџџџџџџяџџџџџџџџџџџџџџџџџџџџџџџџџџџџя+ +4;>@?=95/)#  #)/59=?@>;4+ Ш=0;@>8,"6I[l}ŒšЈЕРЫеоцьђїћ§џџ§ћїђьцоеЫРЕЈšŒ}l[I6",8>@;0Й (9@; ExЊл§љѕ№ьшфсПрсфшь№ѕљ§лЊxE ;>&˜ (?5-iЂзїђэшуЭр ушэђїзЂi-5?(’ <:/sБъящузр ущяъБs/:<!?,_ЄтыфпрфытЄ_,?!‰?&vОыухруыОv&?†:1vЦшыршЦv1:ƒ@TЗыярыЗT@€>ƒъчёр чъƒ>?Žџыѓр ыџŽ?;[џџтѓр тџџ[;9Њџџыѓр ыџџЊ9цџџїчёрчїџџцц€џјыярыј€џц9Њџ§ѓшыршѓ§џЊ9;[ƒџ§єыухруыє§ƒџ[;?Ž…џњђыфпрфыђњ…џŽ?>ƒђ†џќіящузрущяіќ†џђƒ>€@UМ‰џќїђэшуЭрушэђїќ‰џМU@ƒ:1wаŒџ§љѕ№ьшфсПрсфшь№ѕљ§Œџаw1:†?&wЧ‘џ ќљіђяьщчфс­р сфчщьяђіљќ‘џЧw&?‰!?-_Їю—џўќљїѕѓђ№юэыъшчцхфуттссƒрссттуфхцчшъыэю№ђѓѕїљќў—џюЇ_-?!‹21ZI1sГѓнџѓГs1IZ12‰ 2^˜МЖœuE.iЂкзџ кЂi.EuœЖ̘^2†/(^žКƒГ|S#ExЊлЯџлЊxE#S|ƒГКž^(/ƒ@K•МˆГ Ћ’rM"8dЙуХџ уЙd8"Mr’ЋˆГМ•K@€>ƒънРЕ‹Г Ў™b@2W{žСтЙџ тСž{W2@b™Ў‹ГЕРнъƒ>?ŽџыррдРЕŽГЎœ‡pV:"@\x“­ЧпїЇџїпЧ­“x\@":Vp‡œЎŽГЕРдррыџŽ?;[џџтрйХИД‘Г=БЄ”„r^J4"6I[l}ŒšЈЕРЫеоцьђїћ§џџ§ћїђьцоеЫРЕЈšŒ}l[I6"4J^r„”ЄБ‘ГДИХйр тџџ[;9Њџџы„раРȘГ+­Єš„zndYND:1(    (1:DNYdnz„šЄ­˜ГИРа„р ыџџЊ9цџџїч†рбУЙДзГДЙУб†рчїџџцц€џјыˆркЫПИДЯГДИПЫкˆрыј€џц9Њџ§ѓшŠрмЮФМЗДХГДЗМФЮмŠршѓ§џЊ9;[ƒџ§єыуŒрмаЧПЙЖДЙГДЖЙПЧамŒруыє§ƒџ[;?Ž…џњђыфроеЭЦПЛИЕДЉГДЕИЛПЦЭеорфыђњ…џŽ?>ƒђ†џќіящу”рмеЯЪЦТПМКИЗЖЕДД‹ГДДЕЖЗИКМПТЦЪЯем”рущяіќ†џђƒ>€@UМ‰џќїђэшуЭрушэђїќ‰џМU@ƒ:1wаŒџ§љѕ№ьшфсПрсфшь№ѕљ§Œџаw1:†?&wЧ‘џ ќљіђяьщчфс­р сфчщьяђіљќ‘џЧw&?‰!?-_Їю—џўќљїѕѓђ№юэыъшчцхфуттссƒрссттуфхцчшъыэю№ђѓѕїљќў—џюЇ_-?!‹21ZI1sГѓнџѓГs1IZ12‰ 2^˜МЖœuE.iЂкзџ кЂi.EuœЖ̘^2†/(^žКƒГ|S#ExЊлЯџлЊxE#S|ƒГКž^(/ƒ@K•МˆГ Ћ’rM"8dЙуХџ уЙd8"Mr’ЋˆГМ•K@€>ƒънРЕ‹Г Ў™b@2W{žСтЙџ тСž{W2@b™Ў‹ГЕРнъƒ>?ŽџыррдРЕŽГЎœ‡pV:"@\x“­ЧпїЇџїпЧ­“x\@":Vp‡œЎŽГЕРдррыџŽ?;[џџтрйХИД‘Г=БЄ”„r^J4"6I[l}ŒšЈЕРЫеоцьђїћ§џџ§ћїђьцоеЫРЕЈšŒ}l[I6"4J^r„”ЄБ‘ГДИХйр тџџ[;9Њџџы„раРȘГ+­Єš„zndYND:1(    (1:DNYdnz„šЄ­˜ГИРа„р ыџџЊ9цџџїч†рбУЙДзГДЙУб†рчїџџцц€џјыˆркЫПИДЯГДИПЫкˆрыј€џц9Њџ§ѓшŠрмЮФМЗДХГДЗМФЮмŠршѓ§џЊ9;[ƒџ§єыуŒрмаЧПЙЖДЙГДЖЙПЧамŒруыє§ƒџ[;?Ž…џњђыфроеЭЦПЛИЕДЉГДЕИЛПЦЭеорфыђњ…џŽ?>ƒђ†џќіящу”рмеЯЪЦТПМКИЗЖЕДД‹ГДДЕЖЗИКМПТЦЪЯем”рущяіќ†џђƒ>€@TМ‰џќїђэшуЭрушэђїќ‰џМT@ƒ:1wаŒџ§љѕ№ьшфсПрсфшь№ѕљ§Œџаw1:†?&wЧ‘џ ќљіђяьщчфс­р сфчщьяђіљќ‘џЧw&?‰!?,_Їю—џўќљїѕѓђ№юэыъшчцхфуттссƒрссттуфхцчшъыэю№ђѓѕїљќў—џюЇ_,?!<:/sГѓнџѓГs/:<’(?5-iЂкзџкЂi-5?(˜&>; ExЊлЯџлЊxE ;>&ž 2@98dЙуХџ уЙd89@2Ѕ ,=?32W{žСтЙџ тСž{W23?=, Ў (9@8,"6I[l}ŒšЈЕРЫеоцьђїћ§џџ§ћїђьцоеЫРЕЈšŒ}l[I6",8>@;0Ш+ +4;>@?=95/)#  #)/59=?@>;4+ џџџџџџџџџџџџџџџџџџџџџџџџџџџџяџџџџџџџџџџџџџџџџџџџџџџџџџџџџя+ +4;>@?=95/)#  #)/59=?@>;4+ Ш=0;@>8,"6I[l}ŒšЈЕРЫеоцьђїћ§џџ§ћїђьцоеЫРЕЈšŒ}l[I6",8>@;0Й (9@; ExЊл§љѕ№ьшфсПрсфшь№ѕљ§лЊxE ;>&˜ (?5-iЂзїђэшуЭр ушэђїзЂi-5?(’ <:/sБъящузр ущяъБs/:<!?,_ЄтыфпрфытЄ_,?!‰?&vОыухруыОv&?†:1vЦшыршЦv1:ƒ@TЗыярыЗT@€>ƒъчёр чъƒ>?Žџыѓр ыџŽ?;[џџтѓр тџџ[;9Њџџыѓр ыџџЊ9цџџїчёрчїџџцц€џјыярыј€џц9Њџ§ѓшыршѓ§џЊ9;[ƒџ§єыухруыє§ƒџ[;?Ž…џњђыфпрфыђњ…џŽ?>ƒђ†џќіящузрущяіќ†џђƒ>€@UМ‰џќїђэшуЭрушэђїќ‰џМU@ƒ:1wаŒџ§љѕ№ьшфсПрсфшь№ѕљ§Œџаw1:†?&wЧ‘џ ќљіђяьщчфс­р сфчщьяђіљќ‘џЧw&?‰!?-_Їю—џўќљїѕѓђ№юэыъшчцхфуттссƒрссттуфхцчшъыэю№ђѓѕїљќў—џюЇ_-?!‹21ZI1sГѓнџѓГs1IZ12‰ 2^˜МЖœuE.iЂкзџ кЂi.EuœЖ̘^2†/(^žКƒГ|S#ExЊлЯџлЊxE#S|ƒГКž^(/ƒ@K•МˆГ Ћ’rM"8dЙуХџ уЙd8"Mr’ЋˆГМ•K@€>ƒънРЕ‹Г Ў™b@2W{žСтЙџ тСž{W2@b™Ў‹ГЕРнъƒ>?ŽџыррдРЕŽГЎœ‡pV:"@\x“­ЧпїЇџїпЧ­“x\@":Vp‡œЎŽГЕРдррыџŽ?;[џџтрйХИД‘Г=БЄ”„r^J4"6I[l}ŒšЈЕРЫеоцьђїћ§џџ§ћїђьцоеЫРЕЈšŒ}l[I6"4J^r„”ЄБ‘ГДИХйр тџџ[;9Њџџы„раРȘГ+­Єš„zndYND:1(    (1:DNYdnz„šЄ­˜ГИРа„р ыџџЊ9цџџїч†рбУЙДзГДЙУб†рчїџџцц€џјыˆркЫПИДЯГДИПЫкˆрыј€џц9Њџ§ѓшŠрмЮФМЗДХГДЗМФЮмŠршѓ§џЊ9;[ƒџ§єыуŒрмаЧПЙЖДЙГДЖЙПЧамŒруыє§ƒџ[;?Ž…џњђыфроеЭЦПЛИЕДЉГДЕИЛПЦЭеорфыђњ…џŽ?>ƒђ†џќіящу”рмеЯЪЦТПМКИЗЖЕДД‹ГДДЕЖЗИКМПТЦЪЯем”рущяіќ†џђƒ>€@UМ‰џќїђэшуЭрушэђїќ‰џМU@ƒ:1wаŒџ§љѕ№ьшфсПрсфшь№ѕљ§Œџаw1:†?&wЧ‘џ ќљіђяьщчфс­р сфчщьяђіљќ‘џЧw&?‰!?-_Їю—џўќљїѕѓђ№юэыъшчцхфуттссƒрссттуфхцчшъыэю№ђѓѕїљќў—џюЇ_-?!‹21ZI1sГѓнџѓГs1IZ12‰ 2^˜МЖœuE.iЂкзџ кЂi.EuœЖ̘^2†/(^žКƒГ|S#ExЊлЯџлЊxE#S|ƒГКž^(/ƒ@K•МˆГ Ћ’rM"8dЙуХџ уЙd8"Mr’ЋˆГМ•K@€>ƒънРЕ‹Г Ў™b@2W{žСтЙџ тСž{W2@b™Ў‹ГЕРнъƒ>?ŽџыррдРЕŽГЎœ‡pV:"@\x“­ЧпїЇџїпЧ­“x\@":Vp‡œЎŽГЕРдррыџŽ?;[џџтрйХИД‘Г=БЄ”„r^J4"6I[l}ŒšЈЕРЫеоцьђїћ§џџ§ћїђьцоеЫРЕЈšŒ}l[I6"4J^r„”ЄБ‘ГДИХйр тџџ[;9Њџџы„раРȘГ+­Єš„zndYND:1(    (1:DNYdnz„šЄ­˜ГИРа„р ыџџЊ9цџџїч†рбУЙДзГДЙУб†рчїџџцц€џјыˆркЫПИДЯГДИПЫкˆрыј€џц9Њџ§ѓшŠрмЮФМЗДХГДЗМФЮмŠршѓ§џЊ9;[ƒџ§єыуŒрмаЧПЙЖДЙГДЖЙПЧамŒруыє§ƒџ[;?Ž…џњђыфроеЭЦПЛИЕДЉГДЕИЛПЦЭеорфыђњ…џŽ?>ƒђ†џќіящу”рмеЯЪЦТПМКИЗЖЕДД‹ГДДЕЖЗИКМПТЦЪЯем”рущяіќ†џђƒ>€@TМ‰џќїђэшуЭрушэђїќ‰џМT@ƒ:1wаŒџ§љѕ№ьшфсПрсфшь№ѕљ§Œџаw1:†?&wЧ‘џ ќљіђяьщчфс­р сфчщьяђіљќ‘џЧw&?‰!?,_Їю—џўќљїѕѓђ№юэыъшчцхфуттссƒрссттуфхцчшъыэю№ђѓѕїљќў—џюЇ_,?!<:/sГѓнџѓГs/:<’(?5-iЂкзџкЂi-5?(˜&>; ExЊлЯџлЊxE ;>&ž 2@98dЙуХџ уЙd89@2Ѕ ,=?32W{žСтЙџ тСž{W23?=, Ў (9@8,"6I[l}ŒšЈЕРЫеоцьђїћ§џџ§ћїђьцоеЫРЕЈšŒ}l[I6",8>@;0Ш+ +4;>@?=95/)#  #)/59=?@>;4+ џџџџџџџџџџџџџџџџџџџџџџџџџџџџяt8mk@?a}–ЊНЫзсъяєјћ§ўўџџџџџџџџўў§ћјєяъсзЫНЊ–}a??p—ИбхѓћџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџћѓхбИ—p?ZЛк№ќџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџќ№кЛZdЁЮьќџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџќьЮЁd#wИуњџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџњуИw#UЇнњџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџњнЇUZВш§џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ§шВZ*›сќџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџќс›*HЖѓџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџѓЖH8ЖіџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџіЖ8“эџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџэ“%УњџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџњУ%1еџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџе1ЭџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџЭ–џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ–уџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџу§џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ§§џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ§уџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџу–џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ–зџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџз-[нџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџн[-33PЯќџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџќЯP333333ЈёџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџёЈ3333-3333`ХјџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџјХ`3333-333333lХїџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџїХl333333)33333mХїџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџїХm33333) +33`ХјџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџјХ`33+ 'ЈёџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџёЈ'%УћџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџћУ%1еџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџе1ЭџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџЭ–џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ–уџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџу§џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ§§џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ§уџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџу–џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ–зџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџз-[нџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџн[-33PЯќџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџќЯP333333ЈёџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџёЈ3333-3333`ХјџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџјХ`3333-333333lХїџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџїХl333333)33333mХїџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџїХm33333) +33`ХјџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџјХ`33+ 'ЈёџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџёЈ'%УћџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџћУ%1еџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџе1ЭџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџЭ–џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ–уџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџу§џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ§§џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ§уџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџу–џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ–ЭџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџЭ1еџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџе1%УњџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџњУ%“эџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџэ“8ЖіџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџіЖ8HЖѓџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџѓЖH*›сќџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџќс›*ZВш§џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ§шВZUЇнњџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџњнЇU#wИуњџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџњуИw#dЁЮьќџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџќьЮЁdZЛк№ќџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџќ№кЛZ?p—ИбхѓћџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџћѓхбИ—p??a}–ЊНЫзсъяєјћ§ўўџџџџџџџџўў§ћјєяъсзЫНЊ–}a?sqlitebrowser-2.0.0~beta1+ds.1/browsermain.cpp0000644000175000017500000000501111223374037021535 0ustar lisandrolisandro#include #include "form1.h" #include "extendedmainform.h" #if defined(Q_WS_MAC) #include static OSErr checkAppleEventForMissingParams(const AppleEvent& theAppleEvent) { DescType returnedType; Size actualSize; OSErr err; switch (err = AEGetAttributePtr(&theAppleEvent, keyMissedKeywordAttr, typeWildCard, &returnedType, nil, 0, &actualSize)) { case errAEDescNotFound: // If we couldnеt find the error attribute return noErr; // everything is ok, return noErr case noErr: // We found an error attribute, so return errAEEventNotHandled; // tell the client we ignored the event default: return err; // Something else happened, return it } } static pascal OSErr odocHandler(const AppleEvent* inEvent, AppleEvent* /*reply*/, long refCon) { AEDescList documentList; OSErr err = AEGetParamDesc(inEvent, keyDirectObject, typeAEList, &documentList); if (err == noErr) { err = checkAppleEventForMissingParams(*inEvent); if (err == noErr) { long documentCount; err = AECountItems(&documentList, &documentCount); for (long documentIndex = 1; err == noErr && documentIndex <= documentCount; documentIndex++) { // What kind of document is it? DescType returnedType; Size actualSize; err = AESizeOfNthItem(&documentList, documentIndex, &returnedType, &actualSize); if (err == noErr) { // It's just a normal document file AEKeyword keyword; FSRef ref; err = AEGetNthPtr(&documentList, documentIndex, typeFSRef, &keyword, &returnedType, (Ptr)&ref, sizeof(FSRef), &actualSize); if (err == noErr) { char buf[1024]; err = FSRefMakePath(&ref, reinterpret_cast(buf), 1024); if ( err == noErr ) reinterpret_cast(refCon)->fileOpen(QString::fromUtf8(buf)); } } } } AEDisposeDesc(&documentList); } return err; } #endif // Q_WS_MAC int main( int argc, char ** argv ) { QApplication a( argc, argv ); mainForm w1; ExtendedMainForm w; #if defined(Q_WS_MAC) AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, NewAEEventHandlerUPP(odocHandler),reinterpret_cast(&w),false); #endif // Q_WS_MAC w.show(); if (argc>1) { //first and only argument we accept is the name of the database to open w.fileOpen(QString(argv[1])); } a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); return a.exec(); } sqlitebrowser-2.0.0~beta1+ds.1/addfieldform.cpp0000644000175000017500000000426111304272743021634 0ustar lisandrolisandro#include "addfieldform.h" #include #include #include #include #include "sqlitedb.h" #include "addfieldtypeform.h" /* * Constructs a addFieldForm 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. */ addFieldForm::addFieldForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); } /* * Destroys the object and frees any allocated resources */ addFieldForm::~addFieldForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void addFieldForm::languageChange() { retranslateUi(this); } void addFieldForm::setInitialValues(QString name, QString type) { nameLineEdit->setText(name); typeBox->clear(); typeBox->insertItem(type); QString tString = ""; if (type.compare(tString)!=0) typeBox->insertItem(tString); tString = "TEXT"; if (type.compare(tString)!=0) typeBox->insertItem(tString); tString = "NUMERIC"; if (type.compare(tString)!=0) typeBox->insertItem(tString); tString = "BLOB"; if (type.compare(tString)!=0) typeBox->insertItem(tString); tString = "INTEGER PRIMARY KEY"; if (type.compare(tString)!=0) typeBox->insertItem(tString); } void addFieldForm::confirmAddField() { QString fieldname = nameLineEdit->text(); if (fieldname.isEmpty()) { QMessageBox::information( this, applicationName, "Field name can not be empty" ); return; } if (fieldname.contains(" ")>0) { QMessageBox::warning( this, applicationName, "Spaces are not allowed in the field name" ); return; } fname = fieldname; ftype = typeBox->currentText(); accept(); } void addFieldForm::getCustomType() { addFieldTypeForm * addForm = new addFieldTypeForm( this, "addfieldtype", TRUE ); if (addForm->exec()) { //QString nospaces = addForm->typeNameEdit->text().remove(" "); QString nospaces = addForm->typeNameEdit->text(); setInitialValues(nameLineEdit->text(),nospaces ); } } sqlitebrowser-2.0.0~beta1+ds.1/aboutform.cpp0000644000175000017500000000160511254510210021175 0ustar lisandrolisandro#include "aboutform.h" #include #include #include #include "sqlitedb.h" /* * Constructs a aboutForm 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. */ aboutForm::aboutForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); init(); } /* * Destroys the object and frees any allocated resources */ aboutForm::~aboutForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void aboutForm::languageChange() { retranslateUi(this); } void aboutForm::init() { this->setCaption(applicationName); //aboutBrowser->setText(aboutText); } sqlitebrowser-2.0.0~beta1+ds.1/edittableform.cpp0000644000175000017500000004365411304272743022046 0ustar lisandrolisandro#include "edittableform.h" #include #include #include #include #include #include "renametableform.h" #include "addfieldform.h" #include "editfieldform.h" /* * Constructs a editTableForm 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. */ editTableForm::editTableForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); init(); } /* * Destroys the object and frees any allocated resources */ editTableForm::~editTableForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void editTableForm::languageChange() { retranslateUi(this); } void editTableForm::init() { pdb = NULL; modified = false; } void editTableForm::setActiveTable(DBBrowserDB * thedb, QString tableName) { pdb = thedb; curTable = tableName; populateFields(); tableLine->setText(curTable); } void editTableForm::populateFields() { if (!pdb) return; //make sure we are not using cached information pdb->updateSchema(); fields= pdb->getTableFields(curTable); types= pdb->getTableTypes(curTable); fieldListView->clear(); fieldListView->setSorting (-1, FALSE); Q3ListViewItem * lasttbitem = 0; QStringList::Iterator tt = types.begin(); for ( QStringList::Iterator ct = fields.begin(); ct != fields.end(); ++ct ) { Q3ListViewItem * tbitem = new Q3ListViewItem( fieldListView, lasttbitem); tbitem->setText( 0, *ct ); tbitem->setText( 1, *tt ); lasttbitem = tbitem; ++tt; } } void editTableForm::renameTable() { renameTableForm * renTableForm = new renameTableForm( this, "renametable", TRUE ); renTableForm->setTableName(curTable); if (renTableForm->exec()) { QApplication::setOverrideCursor( Qt::waitCursor ); // this might take time modified = true; QString newName = renTableForm->getTableName(); qDebug(newName); QString sql; //do the sql rename here //if (!pdb->executeSQL(QString("BEGIN TRANSACTION;"))) goto rollback; sql = "CREATE TEMPORARY TABLE TEMP_TABLE("; Q3ListViewItemIterator it( fieldListView ); Q3ListViewItem * item; while ( it.current() ) { item = it.current(); sql.append(item->text(0)); sql.append(" "); sql.append(item->text(1)); if (item->nextSibling() != 0) { sql.append(", "); } ++it; } sql.append(");"); if (!pdb->executeSQL(sql)) goto rollback; sql = "INSERT INTO TEMP_TABLE SELECT "; it = Q3ListViewItemIterator( fieldListView ); while ( it.current() ) { item = it.current(); sql.append(item->text(0)); if (item->nextSibling() != 0) { sql.append(", "); } ++it; } sql.append(" FROM "); sql.append(curTable); sql.append(";"); if (!pdb->executeSQL(sql)) goto rollback; sql = "DROP TABLE "; sql.append(curTable); sql.append(";"); if (!pdb->executeSQL(sql)) goto rollback; sql = "CREATE TABLE "; sql.append(newName); sql.append(" ("); it = Q3ListViewItemIterator( fieldListView ); while ( it.current() ) { item = it.current(); sql.append(item->text(0)); sql.append(" "); sql.append(item->text(1)); if (item->nextSibling() != 0) { sql.append(", "); } ++it; } sql.append(");"); if (!pdb->executeSQL(sql)) goto rollback; sql = "INSERT INTO "; sql.append(newName); sql.append(" SELECT "); it = Q3ListViewItemIterator( fieldListView ); while ( it.current() ) { item = it.current(); sql.append(item->text(0)); if (item->nextSibling() != 0) { sql.append(", "); } ++it; } sql.append(" FROM TEMP_TABLE;"); if (!pdb->executeSQL(sql)) goto rollback; if (!pdb->executeSQL(QString("DROP TABLE TEMP_TABLE;"))) goto rollback; //if (!pdb->executeSQL(QString("COMMIT;"))) goto rollback; setActiveTable(pdb, newName); } //everything ok, just return QApplication::restoreOverrideCursor(); // restore original cursor return; rollback: QApplication::restoreOverrideCursor(); // restore original cursor QString error = "Error renaming table. Message from database engine: "; error.append(pdb->lastErrorMessage); QMessageBox::warning( this, applicationName, error ); pdb->executeSQL(QString("DROP TABLE TEMP_TABLE;")); //pdb->executeSQL(QString("ROLLBACK;")); setActiveTable(pdb, curTable); } void editTableForm::editField() { Q3ListViewItem * item = fieldListView->selectedItem(); if (item==0) { //should never happen, the button would not be active, but... return; } else { editFieldForm * fieldForm = new editFieldForm( this, "editfield", TRUE ); fieldForm->setInitialValues(item->text(0),item->text(1)); if (fieldForm->exec()) { modified = true; //do the sql rename here //qDebug(fieldForm->name + fieldForm->type); item->setText(0,fieldForm->name); item->setText(1,fieldForm->type); //not until nested transaction are supported //if (!pdb->executeSQL(QString("BEGIN TRANSACTION;"))) goto rollback; QString sql = "CREATE TEMPORARY TABLE TEMP_TABLE("; Q3ListViewItemIterator it( fieldListView ); Q3ListViewItem * item; while ( it.current() ) { item = it.current(); sql.append(item->text(0)); sql.append(" "); sql.append(item->text(1)); if (item->nextSibling() != 0) { sql.append(", "); } ++it; } sql.append(");"); if (!pdb->executeSQL(sql)) goto rollback; sql = "INSERT INTO TEMP_TABLE SELECT "; for ( QStringList::Iterator ct = fields.begin(); ct != fields.end(); ++ct ) { sql.append( *ct ); if (*ct != fields.last()) { sql.append(", "); } } sql.append(" FROM "); sql.append(curTable); sql.append(";"); if (!pdb->executeSQL(sql)) goto rollback; sql = "DROP TABLE "; sql.append(curTable); sql.append(";"); if (!pdb->executeSQL(sql)) goto rollback; sql = "CREATE TABLE "; sql.append(curTable); sql.append(" ("); it = Q3ListViewItemIterator( fieldListView ); while ( it.current() ) { item = it.current(); sql.append(item->text(0)); sql.append(" "); sql.append(item->text(1)); if (item->nextSibling() != 0) { sql.append(", "); } ++it; } sql.append(");"); if (!pdb->executeSQL(sql)) goto rollback; sql = "INSERT INTO "; sql.append(curTable); sql.append(" SELECT "); it = Q3ListViewItemIterator( fieldListView ); while ( it.current() ) { item = it.current(); sql.append(item->text(0)); if (item->nextSibling() != 0) { sql.append(", "); } ++it; } sql.append(" FROM TEMP_TABLE;"); if (!pdb->executeSQL(sql)) goto rollback; if (!pdb->executeSQL(QString("DROP TABLE TEMP_TABLE;"))) goto rollback; //not until nested transaction are supported //if (!pdb->executeSQL(QString("COMMIT;"))) goto rollback; setActiveTable(pdb, curTable); } //everything ok, just return QApplication::restoreOverrideCursor(); // restore original cursor return; rollback: QApplication::restoreOverrideCursor(); // restore original cursor QString error = "Error editing field. Message from database engine: "; error.append(pdb->lastErrorMessage); QMessageBox::warning( this, applicationName, error ); //not until nested transaction are supported //pdb->executeSQL(QString("ROLLBACK;")); setActiveTable(pdb, curTable); } } void editTableForm::addField() { addFieldForm * addForm = new addFieldForm( this, "addfield", TRUE ); addForm->setInitialValues(QString(""),QString("")); if (addForm->exec()) { modified = true; Q3ListViewItem * tbitem = new Q3ListViewItem( fieldListView); tbitem->setText( 0, addForm->fname); tbitem->setText( 1, addForm->ftype); //do the sql creation here modified = true; //do the sql rename here //qDebug(fieldForm->name + fieldForm->type); QString sql = "CREATE TEMPORARY TABLE TEMP_TABLE("; Q3ListViewItemIterator it( fieldListView ); Q3ListViewItem * item; //not until nested transaction are supported //if (!pdb->executeSQL(QString("BEGIN TRANSACTION;"))) goto rollback; {//nest for MSVC support for ( QStringList::Iterator ct = fields.begin(); ct != fields.end(); ++ct ) { sql.append( *ct ); if (*ct != fields.last()) { sql.append(", "); } } sql.append(");"); if (!pdb->executeSQL(sql)) goto rollback; sql = "INSERT INTO TEMP_TABLE SELECT "; for ( QStringList::Iterator ct1 = fields.begin(); ct1 != fields.end(); ++ct1 ) { sql.append( *ct1 ); if (*ct1 != fields.last()) { sql.append(", "); } } } sql.append(" FROM "); sql.append(curTable); sql.append(";"); if (!pdb->executeSQL(sql)) goto rollback; sql = "DROP TABLE "; sql.append(curTable); sql.append(";"); if (!pdb->executeSQL(sql)) goto rollback; sql = "CREATE TABLE "; sql.append(curTable); sql.append(" ("); it = Q3ListViewItemIterator( fieldListView ); while ( it.current() ) { item = it.current(); sql.append(item->text(0)); sql.append(" "); sql.append(item->text(1)); if (item->nextSibling() != 0) { sql.append(", "); } ++it; } sql.append(");"); if (!pdb->executeSQL(sql)) goto rollback; {//nest for MSVC support sql = "INSERT INTO "; sql.append(curTable); sql.append("("); for ( QStringList::Iterator ct2 = fields.begin(); ct2 != fields.end(); ++ct2 ) { sql.append( *ct2 ); if (*ct2 != fields.last()) { sql.append(", "); } } } {//nest for MSVC support sql.append(") SELECT "); for ( QStringList::Iterator ct3 = fields.begin(); ct3 != fields.end(); ++ct3 ) { sql.append( *ct3 ); if (*ct3 != fields.last()) { sql.append(", "); } } } sql.append(" FROM TEMP_TABLE;"); if (!pdb->executeSQL(sql)) goto rollback; if (!pdb->executeSQL(QString("DROP TABLE TEMP_TABLE;"))) goto rollback; //not until nested transaction are supported //if (!pdb->executeSQL(QString("COMMIT;"))) goto rollback; setActiveTable(pdb, curTable); QApplication::restoreOverrideCursor(); // restore original cursor return; rollback: QApplication::restoreOverrideCursor(); // restore original cursor QString error = "Error adding field. Message from database engine: "; error.append(pdb->lastErrorMessage); QMessageBox::warning( this, applicationName, error ); //not until nested transaction are supported //pdb->executeSQL(QString("ROLLBACK;")); setActiveTable(pdb, curTable); } } void editTableForm::removeField() { Q3ListViewItem * remitem = fieldListView->selectedItem(); if (remitem==0) { //should never happen, the button would not be active, but... return; } else { QString msg = "Are you sure you want to delete field "; msg.append(remitem->text(0)); msg.append("? \n All data currently stored in this field will be lost"); if (QMessageBox::warning( this, applicationName, msg, QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes ){ //delete field here /*fields= pdb->getTableFields(curTable); types= pdb->getTableTypes(curTable);*/ modified = true; delete remitem; QString sql = "CREATE TEMPORARY TABLE TEMP_TABLE("; Q3ListViewItemIterator it( fieldListView ); Q3ListViewItem * item; //not until nested transaction are supported // if (!pdb->executeSQL(QString("BEGIN TRANSACTION;"))) goto rollback; it = Q3ListViewItemIterator( fieldListView ); while ( it.current() ) { item = it.current(); sql.append(item->text(0)); sql.append(" "); sql.append(item->text(1)); if (item->nextSibling() != 0) { sql.append(", "); } ++it; } sql.append(");"); if (!pdb->executeSQL(sql)) goto rollback; sql = "INSERT INTO TEMP_TABLE SELECT "; it = Q3ListViewItemIterator( fieldListView ); while ( it.current() ) { item = it.current(); sql.append(item->text(0)); if (item->nextSibling() != 0) { sql.append(", "); } ++it; } sql.append(" FROM "); sql.append(curTable); sql.append(";"); if (!pdb->executeSQL(sql)) goto rollback; sql = "DROP TABLE "; sql.append(curTable); sql.append(";"); if (!pdb->executeSQL(sql)) goto rollback; sql = "CREATE TABLE "; sql.append(curTable); sql.append(" ("); it = Q3ListViewItemIterator( fieldListView ); while ( it.current() ) { item = it.current(); sql.append(item->text(0)); sql.append(" "); sql.append(item->text(1)); if (item->nextSibling() != 0) { sql.append(", "); } ++it; } sql.append(");"); if (!pdb->executeSQL(sql)) goto rollback; sql = "INSERT INTO "; sql.append(curTable); sql.append("("); it = Q3ListViewItemIterator( fieldListView ); while ( it.current() ) { item = it.current(); sql.append(item->text(0)); if (item->nextSibling() != 0) { sql.append(", "); } ++it; } sql.append(") SELECT "); it = Q3ListViewItemIterator( fieldListView ); while ( it.current() ) { item = it.current(); sql.append(item->text(0)); if (item->nextSibling() != 0) { sql.append(", "); } ++it; } sql.append(" FROM TEMP_TABLE;"); if (!pdb->executeSQL(sql)) goto rollback; if (!pdb->executeSQL(QString("DROP TABLE TEMP_TABLE;"))) goto rollback; //not until nested transaction are supported //if (!pdb->executeSQL(QString("COMMIT;"))) goto rollback; setActiveTable(pdb, curTable); QApplication::restoreOverrideCursor(); // restore original cursor return; rollback: QApplication::restoreOverrideCursor(); // restore original cursor QString error = "Error removing field. Message from database engine: "; error.append(pdb->lastErrorMessage); QMessageBox::warning( this, applicationName, error ); //not until nested transaction are supported //pdb->executeSQL(QString("ROLLBACK;")); setActiveTable(pdb, curTable); } } } void editTableForm::fieldSelectionChanged() { Q3ListViewItem * item = fieldListView->selectedItem(); if (item==0) { renameFieldButton->setEnabled(false); removeFieldButton->setEnabled(false); } else { renameFieldButton->setEnabled(true); removeFieldButton->setEnabled(true); } } sqlitebrowser-2.0.0~beta1+ds.1/addfieldtypeform.cpp0000644000175000017500000000153011254510210022516 0ustar lisandrolisandro#include "addfieldtypeform.h" #include #include #include #include #include "sqlitedb.h" /* * Constructs a addFieldTypeForm 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. */ addFieldTypeForm::addFieldTypeForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); } /* * Destroys the object and frees any allocated resources */ addFieldTypeForm::~addFieldTypeForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void addFieldTypeForm::languageChange() { retranslateUi(this); } sqlitebrowser-2.0.0~beta1+ds.1/choosetableform.cpp0000644000175000017500000000215211254510210022351 0ustar lisandrolisandro#include "choosetableform.h" #include #include #include /* * Constructs a chooseTableForm 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. */ chooseTableForm::chooseTableForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); } /* * Destroys the object and frees any allocated resources */ chooseTableForm::~chooseTableForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void chooseTableForm::languageChange() { retranslateUi(this); } void chooseTableForm::editPressed() { option = comboOptions->currentText(); accept(); } void chooseTableForm::populateOptions(QStringList entries) { comboOptions->clear(); for ( QStringList::Iterator ct = entries.begin(); ct != entries.end(); ++ct ) { comboOptions->insertItem(*ct,-1); } }