Added quit button and Ctrl-Q shortcut

develop
tastytea 2018-10-13 05:59:56 +02:00
parent 1bcbd320b2
commit b7c523e74e
No known key found for this signature in database
GPG Key ID: CFC39497F1B26E07
4 changed files with 35 additions and 14 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.6) cmake_minimum_required (VERSION 3.6)
project (whyblocked project (whyblocked
VERSION 0.7.0 VERSION 0.7.1
LANGUAGES CXX LANGUAGES CXX
) )
@ -88,7 +88,11 @@ if (WITH_RPM)
set(CPACK_SOURCE_GENERATOR "RPM") set(CPACK_SOURCE_GENERATOR "RPM")
set(CPACK_RPM_PACKAGE_LICENSE "GPL-3") set(CPACK_RPM_PACKAGE_LICENSE "GPL-3")
set(CPACK_RPM_PACKAGE_URL "https://schlomp.space/tastytea/whyblocked") set(CPACK_RPM_PACKAGE_URL "https://schlomp.space/tastytea/whyblocked")
set(CPACK_RPM_PACKAGE_REQUIRES "vsqlite++ >= 0.3.13 libxdg-basedir, >= 1.2.0") if(NOT WITHOUT_QT)
set(CPACK_RPM_PACKAGE_REQUIRES "vsqlite++ >= 0.3.13, libxdg-basedir >= 1.2.0, qt >= 5.0")
else()
set(CPACK_RPM_PACKAGE_REQUIRES "vsqlite++ >= 0.3.13, libxdg-basedir >= 1.2.0")
endif()
set(CPACK_PACKAGE_FILE_NAME set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-0.${CPACK_PACKAGE_ARCHITECTURE}") "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-0.${CPACK_PACKAGE_ARCHITECTURE}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME set(CPACK_SOURCE_PACKAGE_FILE_NAME

View File

@ -35,6 +35,7 @@ MainWindow::MainWindow(QMainWindow *parent) : QMainWindow(parent)
connect(action_remove, &QAction::triggered, this, &MainWindow::remove); connect(action_remove, &QAction::triggered, this, &MainWindow::remove);
connect(action_reload, &QAction::triggered, this, &MainWindow::populate_tableview); connect(action_reload, &QAction::triggered, this, &MainWindow::populate_tableview);
connect(action_about, &QAction::triggered, this, &MainWindow::about); connect(action_about, &QAction::triggered, this, &MainWindow::about);
connect(action_quit, &QAction::triggered, this, &MainWindow::close);
connect(tableview, &QTableView::clicked, this, &MainWindow::show_details); connect(tableview, &QTableView::clicked, this, &MainWindow::show_details);
connect(tableview, &QTableView::activated, this, &MainWindow::show_details); connect(tableview, &QTableView::activated, this, &MainWindow::show_details);

View File

@ -73,6 +73,7 @@
<addaction name="action_remove"/> <addaction name="action_remove"/>
<addaction name="action_reload"/> <addaction name="action_reload"/>
<addaction name="action_about"/> <addaction name="action_about"/>
<addaction name="action_quit"/>
</widget> </widget>
<action name="action_add"> <action name="action_add">
<property name="icon"> <property name="icon">
@ -118,7 +119,8 @@
</action> </action>
<action name="action_reload"> <action name="action_reload">
<property name="icon"> <property name="icon">
<iconset theme="reload"/> <iconset theme="reload">
<normaloff>.</normaloff>.</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Reload</string> <string>Reload</string>
@ -130,6 +132,20 @@
<string>Ctrl+R</string> <string>Ctrl+R</string>
</property> </property>
</action> </action>
<action name="action_quit">
<property name="icon">
<iconset theme="exit"/>
</property>
<property name="text">
<string>Quit</string>
</property>
<property name="toolTip">
<string>Quit application</string>
</property>
<property name="shortcut">
<string>Ctrl+Q</string>
</property>
</action>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>

View File

@ -15,7 +15,7 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QGridLayout" name="layout_grid" rowstretch="0,0,0,0"> <layout class="QGridLayout" name="layout_grid" rowstretch="0,0,0,0,0">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_user"> <widget class="QLabel" name="label_user">
<property name="text"> <property name="text">
@ -90,18 +90,18 @@
<item row="3" column="1"> <item row="3" column="1">
<widget class="QLineEdit" name="text_reason"/> <widget class="QLineEdit" name="text_reason"/>
</item> </item>
<item row="4" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>