qbolt/qbolt/mainwindow.h
2017-06-19 20:53:50 +12:00

71 lines
1.6 KiB
C++

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "boltdb.h"
#include <QMainWindow>
#include <QMenu>
#include <QTreeWidgetItem>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_actionOpen_database_triggered();
void on_actionExit_triggered();
void on_actionAbout_Qt_triggered();
void on_actionAbout_qbolt_triggered();
void on_actionDisconnect_triggered();
void on_bucketTree_customContextMenuRequested(const QPoint &pos);
void on_actionRefresh_buckets_triggered();
void on_bucketTree_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
void on_actionClear_selection_triggered();
void on_bucketData_doubleClicked(const QModelIndex &index);
void on_actionNew_database_triggered();
void on_actionAdd_bucket_triggered();
void on_actionDelete_bucket_triggered();
void on_AddDataButton_clicked();
void on_DeleteDataButton_clicked();
void on_bucketData_itemSelectionChanged();
void on_actionOpen_database_as_read_only_triggered();
protected:
void openDatabase(QString file, bool readOnly);
void refreshBucketTree(QTreeWidgetItem* top);
void refreshData(BoltDB *bdb, const QList<QByteArray>& browse);
void openEditor(BoltDB *bdb, const QList<QByteArray>& saveAs, QByteArray saveAsKey, QByteArray currentContent);
private:
Ui::MainWindow *ui;
QMenu *databaseContext;
QMenu *bucketContext;
QTreeWidgetItem* lastContextSelection;
};
#endif // MAINWINDOW_H