mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
save the activated log view(user, application) between a session
This commit is contained in:
@@ -35,10 +35,10 @@ void SQLLogDock::setupUi()
|
||||
|
||||
hboxLayout->addWidget(textLabel1);
|
||||
|
||||
comboBox3 = new QComboBox(this);
|
||||
comboBox3->setObjectName(QString::fromUtf8("comboBox3"));
|
||||
m_comboLogType = new QComboBox(this);
|
||||
m_comboLogType->setObjectName(QString::fromUtf8("comboBox3"));
|
||||
|
||||
hboxLayout->addWidget(comboBox3);
|
||||
hboxLayout->addWidget(m_comboLogType);
|
||||
|
||||
spacer10 = new QSpacerItem(150, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
@@ -89,7 +89,7 @@ void SQLLogDock::setupUi()
|
||||
|
||||
retranslateUi();
|
||||
QObject::connect(clearButton, SIGNAL(clicked()), this, SLOT(clearLog()));
|
||||
QObject::connect(comboBox3, SIGNAL(activated(int)), logStack, SLOT(setCurrentIndex(int)));
|
||||
QObject::connect(m_comboLogType, SIGNAL(currentIndexChanged(int)), logStack, SLOT(setCurrentIndex(int)));
|
||||
|
||||
QMetaObject::connectSlotsByName(this);
|
||||
}
|
||||
@@ -98,8 +98,8 @@ void SQLLogDock::retranslateUi()
|
||||
{
|
||||
this->setWindowTitle(QObject::tr("SQL Log"));
|
||||
textLabel1->setText(QObject::tr("Show SQL submitted by:"));
|
||||
comboBox3->clear();
|
||||
comboBox3->insertItems(0, QStringList()
|
||||
m_comboLogType->clear();
|
||||
m_comboLogType->insertItems(0, QStringList()
|
||||
<< QObject::tr("User")
|
||||
<< QObject::tr("Application")
|
||||
);
|
||||
|
||||
@@ -21,12 +21,14 @@ public:
|
||||
SQLLogDock(QWidget* parent = 0);
|
||||
~SQLLogDock();
|
||||
|
||||
QComboBox* comboLogType() { return m_comboLogType; }
|
||||
|
||||
private:
|
||||
QWidget* contentWidget;
|
||||
QVBoxLayout *vboxLayout;
|
||||
QHBoxLayout *hboxLayout;
|
||||
QLabel *textLabel1;
|
||||
QComboBox *comboBox3;
|
||||
QComboBox *m_comboLogType;
|
||||
QSpacerItem *spacer10;
|
||||
QPushButton *clearButton;
|
||||
QStackedWidget *logStack;
|
||||
|
||||
@@ -878,6 +878,7 @@ void MainWindow::init()
|
||||
QSettings settings(QApplication::organizationName(), g_sApplicationNameShort);
|
||||
restoreGeometry(settings.value("MainWindow/geometry").toByteArray());
|
||||
restoreState(settings.value("MainWindow/windowState").toByteArray());
|
||||
logWin->comboLogType()->setCurrentIndex(logWin->comboLogType()->findText(settings.value("SQLLogDock/Log", "Application").toString()));
|
||||
}
|
||||
|
||||
void MainWindow::destroy()
|
||||
@@ -886,6 +887,7 @@ void MainWindow::destroy()
|
||||
QSettings settings(QApplication::organizationName(), g_sApplicationNameShort);
|
||||
settings.setValue("MainWindow/geometry", saveGeometry());
|
||||
settings.setValue("MainWindow/windowState", saveState());
|
||||
settings.setValue("SQLLogDock/Log", logWin->comboLogType()->currentText());
|
||||
|
||||
if (gotoValidator){
|
||||
delete gotoValidator;
|
||||
|
||||
Reference in New Issue
Block a user