wire up other menu items, add app logo icon

This commit is contained in:
mappu 2017-05-20 15:20:30 +12:00
parent e8030a9579
commit 4b3fb783c4
6 changed files with 40 additions and 4 deletions

View File

@ -13,6 +13,8 @@ int main(int argc, char *argv[])
} }
QApplication a(argc, argv); QApplication a(argc, argv);
QApplication::setApplicationDisplayName("QBolt");
MainWindow w; MainWindow w;
w.show(); w.show();

View File

@ -39,3 +39,26 @@ void MainWindow::on_actionOpen_database_triggered()
// Free // Free
delete bdb; delete bdb;
} }
void MainWindow::on_actionExit_triggered()
{
close();
}
void MainWindow::on_actionAbout_Qt_triggered()
{
QApplication::aboutQt();
}
void MainWindow::on_actionAbout_qbolt_triggered()
{
QMessageBox::about(
this,
QApplication::applicationDisplayName(),
"<b>QBolt</b><br>Graphical interface for managing Bolt databases<br><br>"
"- <a href='https://github.com/boltdb/bolt'>About BoltDB</a><br>"
"- <a href='http://www.famfamfam.com/lab/icons/silk/'>FamFamFam &quot;Silk&quot; icon set</a><br>"
"- <a href='https://code.ivysaur.me/qbolt'>QBolt homepage</a><br>"
);
}

View File

@ -18,6 +18,12 @@ public:
private slots: private slots:
void on_actionOpen_database_triggered(); void on_actionOpen_database_triggered();
void on_actionExit_triggered();
void on_actionAbout_Qt_triggered();
void on_actionAbout_qbolt_triggered();
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
}; };

View File

@ -13,6 +13,10 @@
<property name="windowTitle"> <property name="windowTitle">
<string>QBolt</string> <string>QBolt</string>
</property> </property>
<property name="windowIcon">
<iconset resource="resources.qrc">
<normaloff>:/rsrc/database_lightning.png</normaloff>:/rsrc/database_lightning.png</iconset>
</property>
<widget class="QWidget" name="centralWidget"> <widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<property name="leftMargin"> <property name="leftMargin">
@ -172,12 +176,12 @@
<normaloff>:/rsrc/information.png</normaloff>:/rsrc/information.png</iconset> <normaloff>:/rsrc/information.png</normaloff>:/rsrc/information.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>About QBolt</string> <string>&amp;About QBolt</string>
</property> </property>
</action> </action>
<action name="actionAbout_Qt"> <action name="actionAbout_Qt">
<property name="text"> <property name="text">
<string>About Qt</string> <string>About &amp;Qt</string>
</property> </property>
</action> </action>
<action name="actionOpen_database"> <action name="actionOpen_database">
@ -186,12 +190,12 @@
<normaloff>:/rsrc/database_add.png</normaloff>:/rsrc/database_add.png</iconset> <normaloff>:/rsrc/database_add.png</normaloff>:/rsrc/database_add.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Open database...</string> <string>&amp;Open database...</string>
</property> </property>
</action> </action>
<action name="actionExit"> <action name="actionExit">
<property name="text"> <property name="text">
<string>Exit</string> <string>&amp;Exit</string>
</property> </property>
</action> </action>
</widget> </widget>

View File

@ -3,5 +3,6 @@
<file>rsrc/database_add.png</file> <file>rsrc/database_add.png</file>
<file>rsrc/table.png</file> <file>rsrc/table.png</file>
<file>rsrc/information.png</file> <file>rsrc/information.png</file>
<file>rsrc/database_lightning.png</file>
</qresource> </qresource>
</RCC> </RCC>

BIN
qbolt/rsrc/database_lightning.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 B