mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-31 08:20:09 -06:00
File Extension management interface (#659)
[NEW] Add new interface and functionality to manage database file extension. (Implements feature request #659)
This commit is contained in:
committed by
Martin Kleusberg
parent
b08960f504
commit
a993c19853
@@ -5,6 +5,7 @@
|
||||
#include "Application.h"
|
||||
#include "MainWindow.h"
|
||||
#include "RemoteDatabase.h"
|
||||
#include "FileExtensionManager.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QColorDialog>
|
||||
@@ -14,7 +15,8 @@
|
||||
|
||||
PreferencesDialog::PreferencesDialog(QWidget* parent)
|
||||
: QDialog(parent),
|
||||
ui(new Ui::PreferencesDialog)
|
||||
ui(new Ui::PreferencesDialog),
|
||||
m_dbFileExtensions(FileDialog::getSqlDatabaseFileFilter().split(";;"))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->treeSyntaxHighlighting->setColumnHidden(0, true);
|
||||
@@ -280,6 +282,8 @@ void PreferencesDialog::saveSettings()
|
||||
Settings::setValue("General", "language", newLanguage);
|
||||
Settings::setValue("General", "toolbarStyle", ui->toolbarStyleComboBox->currentIndex());
|
||||
|
||||
Settings::setValue("General", "DBFileExtensions", m_dbFileExtensions.join(";;") );
|
||||
|
||||
accept();
|
||||
}
|
||||
|
||||
@@ -564,3 +568,13 @@ void PreferencesDialog::updatePreviewFont()
|
||||
ui->txtBlob->setFont(textFont);
|
||||
}
|
||||
}
|
||||
|
||||
void PreferencesDialog::on_buttonManageFileExtension_clicked()
|
||||
{
|
||||
FileExtensionManager *manager = new FileExtensionManager(m_dbFileExtensions, this);
|
||||
|
||||
if(manager->exec() == QDialog::Accepted)
|
||||
{
|
||||
m_dbFileExtensions = manager->getDBFileExtensions();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user