Skip to content
Permalink
Browse files

UserLocalVolumeDialog: subclass QDialog instead of QWidget.

This automatically gives us the ability to close the dialog
with the escape key.

Fixes #1938
  • Loading branch information...
mkrautz committed Dec 7, 2015
1 parent 864b7ee commit 42c0684c8bb497f4037b48da0c6603db097b640c
@@ -1499,7 +1499,6 @@ void MainWindow::on_qaUserLocalVolume_triggered() {
void MainWindow::openUserLocalVolumeDialog(ClientUser *p) {
unsigned int session = p->uiSession;
UserLocalVolumeDialog *uservol = new UserLocalVolumeDialog(session);
uservol->setWindowFlags(Qt::Dialog);
uservol->show();
}

@@ -37,7 +37,7 @@
#include "Database.h"

UserLocalVolumeDialog::UserLocalVolumeDialog(unsigned int sessionId)
: QWidget(NULL)
: QDialog(NULL)
, m_clientSession(sessionId) {
setupUi(this);

@@ -34,7 +34,7 @@
#include "ui_UserLocalVolumeDialog.h"
#include "ClientUser.h"

class UserLocalVolumeDialog : public QWidget, private Ui::UserLocalVolumeDialog {
class UserLocalVolumeDialog : public QDialog, private Ui::UserLocalVolumeDialog {
Q_OBJECT
Q_DISABLE_COPY(UserLocalVolumeDialog);

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>UserLocalVolumeDialog</class>
<widget class="QWidget" name="UserLocalVolumeDialog">
<widget class="QDialog" name="UserLocalVolumeDialog">
<property name="geometry">
<rect>
<x>0</x>

0 comments on commit 42c0684

Please sign in to comment.
You can’t perform that action at this time.