mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-06 03:49:59 -05:00
More icons replacment
This commit is contained in:
@@ -8,7 +8,9 @@
|
||||
#include <Q3WhatsThis>
|
||||
|
||||
#include "qmessagebox.h"
|
||||
#include "q3filedialog.h"
|
||||
//#include "q3filedialog.h"
|
||||
#include <QtGui/QFileDialog>
|
||||
|
||||
#include "qfile.h"
|
||||
#include "qapplication.h"
|
||||
#include "createtableform.h"
|
||||
@@ -102,37 +104,39 @@ void mainForm::destroy()
|
||||
}
|
||||
}
|
||||
|
||||
//***********************************************************
|
||||
//*** Open File
|
||||
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" );
|
||||
wFile = QFileDialog::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();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +150,7 @@ void mainForm::fileOpen()
|
||||
|
||||
void mainForm::fileNew()
|
||||
{
|
||||
QString fileName = Q3FileDialog::getSaveFileName(
|
||||
QString fileName = QFileDialog::getSaveFileName(
|
||||
defaultlocation,
|
||||
"",
|
||||
this,
|
||||
@@ -926,7 +930,7 @@ void mainForm::importTableFromCSV()
|
||||
}
|
||||
}*/
|
||||
|
||||
QString wFile = Q3FileDialog::getOpenFileName(
|
||||
QString wFile = QFileDialog::getOpenFileName(
|
||||
defaultlocation,
|
||||
"Text files (*.csv *.txt)",
|
||||
this,
|
||||
@@ -958,7 +962,7 @@ void mainForm::exportTableToCSV()
|
||||
//load our table
|
||||
db.browseTable(exportForm->option);
|
||||
|
||||
QString fileName = Q3FileDialog::getSaveFileName(
|
||||
QString fileName = QFileDialog::getSaveFileName(
|
||||
defaultlocation,
|
||||
"Text files (*.csv *txt)",
|
||||
this,
|
||||
@@ -1067,7 +1071,7 @@ void mainForm::exportDatabaseToSQL()
|
||||
return;
|
||||
}
|
||||
|
||||
QString fileName = Q3FileDialog::getSaveFileName(
|
||||
QString fileName = QFileDialog::getSaveFileName(
|
||||
defaultlocation,
|
||||
"Text files (*.sql *txt)",
|
||||
0,
|
||||
@@ -1088,7 +1092,7 @@ void mainForm::exportDatabaseToSQL()
|
||||
|
||||
void mainForm::importDatabaseFromSQL()
|
||||
{
|
||||
QString fileName = Q3FileDialog::getOpenFileName(
|
||||
QString fileName = QFileDialog::getOpenFileName(
|
||||
defaultlocation,
|
||||
"Text files (*.sql *txt)",
|
||||
0,
|
||||
@@ -1100,7 +1104,7 @@ void mainForm::importDatabaseFromSQL()
|
||||
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(
|
||||
QString newDBfile = QFileDialog::getSaveFileName(
|
||||
defaultlocation,
|
||||
"",
|
||||
this,
|
||||
|
||||
@@ -126,21 +126,38 @@ public:
|
||||
//TODO get from settings and save last position
|
||||
mainForm->resize(702, 552);
|
||||
|
||||
//** New File
|
||||
//** New DB File
|
||||
fileNewAction = new QAction(mainForm);
|
||||
fileNewAction->setObjectName(QString::fromUtf8("fileNewAction"));
|
||||
fileNewAction->setName("fileNewAction");
|
||||
fileNewAction->setIcon(QIcon(":/icons/db_new"));
|
||||
|
||||
//** Open File
|
||||
//** Open DB File
|
||||
fileOpenAction = new QAction(mainForm);
|
||||
fileOpenAction->setObjectName(QString::fromUtf8("fileOpenAction"));
|
||||
fileOpenAction->setName("fileOpenAction");
|
||||
fileOpenAction->setIcon(QIcon(":/icons/db_open"));
|
||||
|
||||
//** Save DB Action
|
||||
fileSaveAction = new QAction(mainForm);
|
||||
fileSaveAction->setObjectName(QString::fromUtf8("fileSaveAction"));
|
||||
fileSaveAction->setName("fileSaveAction");
|
||||
fileSaveAction->setEnabled(false);
|
||||
fileSaveAction->setIcon(QIcon(":/icons/db_save"));
|
||||
|
||||
//** Db Revert
|
||||
fileRevertAction = new QAction(mainForm);
|
||||
fileRevertAction->setObjectName(QString::fromUtf8("fileRevertAction"));
|
||||
fileRevertAction->setName("fileRevertAction");
|
||||
fileRevertAction->setEnabled(false);
|
||||
fileRevertAction->setIcon(QIcon(":/icons/db_revert"));
|
||||
|
||||
|
||||
//** Exit
|
||||
fileExitAction = new QAction(mainForm);
|
||||
fileExitAction->setObjectName(QString::fromUtf8("fileExitAction"));
|
||||
fileExitAction->setName("fileExitAction");
|
||||
|
||||
editCopyAction = new QAction(mainForm);
|
||||
editCopyAction->setObjectName(QString::fromUtf8("editCopyAction"));
|
||||
editCopyAction->setName("editCopyAction");
|
||||
@@ -192,19 +209,10 @@ public:
|
||||
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);
|
||||
|
||||
//** Db Revert
|
||||
fileRevertAction = new QAction(mainForm);
|
||||
fileRevertAction->setObjectName(QString::fromUtf8("fileRevertAction"));
|
||||
fileRevertAction->setName("fileRevertAction");
|
||||
fileRevertAction->setEnabled(false);
|
||||
fileRevertAction->setIcon(QIcon("icons/db_revert"));
|
||||
|
||||
|
||||
|
||||
//fileImportAction = new QAction(mainForm);
|
||||
//fileImportAction->setObjectName(QString::fromUtf8("fileImportAction"));
|
||||
//fileImportAction->setName("fileImportAction");
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<file alias="db_new">database_add.png</file>
|
||||
<file alias="db_open">database_go.png</file>
|
||||
<file alias="db_revert">database_refresh.png</file>
|
||||
<file>database_save.png</file>
|
||||
<file alias="db_save">database_save.png</file>
|
||||
<file alias="table_create">table_add.png</file>
|
||||
<file alias="table_delete">table_delete.png</file>
|
||||
<file alias="table_modify">table_edit.png</file>
|
||||
|
||||
Reference in New Issue
Block a user