Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/analyzerconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
// Analyzer console implementation *********************************************
CAnalyzerConsole::CAnalyzerConsole ( CClient* pNCliP,
QWidget* parent ) :
QDialog ( parent, Qt::Window ), // use Qt::Window to get min/max window buttons
CBaseDlg ( parent, Qt::Window ), // use Qt::Window to get min/max window buttons
pClient ( pNCliP ),
GraphImage ( 1, 1, QImage::Format_RGB32 ),
GraphErrRateCanvasRect ( 0, 0, 600, 450 ), // defines total size of graph
Expand Down
3 changes: 2 additions & 1 deletion src/analyzerconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <QPainter>
#include <QTimer>
#include "client.h"
#include "util.h"


/* Definitions ****************************************************************/
Expand All @@ -40,7 +41,7 @@


/* Classes ********************************************************************/
class CAnalyzerConsole : public QDialog
class CAnalyzerConsole : public CBaseDlg
{
Q_OBJECT

Expand Down
2 changes: 1 addition & 1 deletion src/chatdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

/* Implementation *************************************************************/
CChatDlg::CChatDlg ( QWidget* parent ) :
QDialog ( parent, Qt::Window ) // use Qt::Window to get min/max window buttons
CBaseDlg ( parent, Qt::Window ) // use Qt::Window to get min/max window buttons
{
setupUi ( this );

Expand Down
6 changes: 2 additions & 4 deletions src/chatdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@
#include <QDesktopServices>
#include <QMessageBox>
#include "global.h"
#include "util.h"
#include "ui_chatdlgbase.h"


/* Classes ********************************************************************/
class CChatDlg : public QDialog, private Ui_CChatDlgBase
class CChatDlg : public CBaseDlg, private Ui_CChatDlgBase
{
Q_OBJECT

Expand All @@ -54,9 +55,6 @@ public slots:
void OnClearChatHistory();
void OnAnchorClicked ( const QUrl& Url );

void keyPressEvent ( QKeyEvent *e ) // block escape key
{ if ( e->key() != Qt::Key_Escape ) QDialog::keyPressEvent ( e ); }

signals:
void NewLocalInputText ( QString strNewText );
};
2 changes: 1 addition & 1 deletion src/clientdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
const bool bShowAnalyzerConsole,
const bool bMuteStream,
QWidget* parent ) :
QDialog ( parent, Qt::Window ), // use Qt::Window to get min/max window buttons
CBaseDlg ( parent, Qt::Window ), // use Qt::Window to get min/max window buttons
pClient ( pNCliP ),
pSettings ( pNSetP ),
bConnectDlgWasShown ( false ),
Expand Down
6 changes: 2 additions & 4 deletions src/clientdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
# include <QVersionNumber>
#endif
#include "global.h"
#include "util.h"
#include "client.h"
#include "settings.h"
#include "multicolorled.h"
Expand Down Expand Up @@ -69,7 +70,7 @@


/* Classes ********************************************************************/
class CClientDlg : public QDialog, private Ui_CClientDlgBase
class CClientDlg : public CBaseDlg, private Ui_CClientDlgBase
{
Q_OBJECT

Expand Down Expand Up @@ -237,7 +238,4 @@ public slots:
void OnNumClientsChanged ( int iNewNumClients );

void accept() { close(); } // introduced by pljones

void keyPressEvent ( QKeyEvent *e ) // block escape key
{ if ( e->key() != Qt::Key_Escape ) QDialog::keyPressEvent ( e ); }
};
2 changes: 1 addition & 1 deletion src/clientsettingsdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP,
CClientSettings* pNSetP,
QWidget* parent ) :
QDialog ( parent, Qt::Window ), // use Qt::Window to get min/max window buttons
CBaseDlg ( parent, Qt::Window ), // use Qt::Window to get min/max window buttons
pClient ( pNCliP ),
pSettings ( pNSetP )
{
Expand Down
3 changes: 2 additions & 1 deletion src/clientsettingsdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <QButtonGroup>
#include <QMessageBox>
#include "global.h"
#include "util.h"
#include "client.h"
#include "settings.h"
#include "multicolorled.h"
Expand All @@ -50,7 +51,7 @@


/* Classes ********************************************************************/
class CClientSettingsDlg : public QDialog, private Ui_CClientSettingsDlgBase
class CClientSettingsDlg : public CBaseDlg, private Ui_CClientSettingsDlgBase
{
Q_OBJECT

Expand Down
2 changes: 1 addition & 1 deletion src/connectdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
CConnectDlg::CConnectDlg ( CClientSettings* pNSetP,
const bool bNewShowCompleteRegList,
QWidget* parent )
: QDialog ( parent, Qt::Dialog ),
: CBaseDlg ( parent, Qt::Dialog ),
pSettings ( pNSetP ),
strSelectedAddress ( "" ),
strSelectedServerName ( "" ),
Expand Down
3 changes: 2 additions & 1 deletion src/connectdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <QLocale>
#include <QtConcurrent>
#include "global.h"
#include "util.h"
#include "settings.h"
#include "multicolorled.h"
#include "ui_connectdlgbase.h"
Expand All @@ -44,7 +45,7 @@


/* Classes ********************************************************************/
class CConnectDlg : public QDialog, private Ui_CConnectDlgBase
class CConnectDlg : public CBaseDlg, private Ui_CConnectDlgBase
{
Q_OBJECT

Expand Down
2 changes: 1 addition & 1 deletion src/serverdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CServerDlg::CServerDlg ( CServer* pNServP,
CServerSettings* pNSetP,
const bool bStartMinimized,
QWidget* parent )
: QDialog ( parent, Qt::Window ), // use Qt::Window to get min/max window buttons
: CBaseDlg ( parent, Qt::Window ), // use Qt::Window to get min/max window buttons
pServer ( pNServP ),
pSettings ( pNSetP ),
BitmapSystemTrayInactive ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDGreyArrow.png" ) ),
Expand Down
7 changes: 2 additions & 5 deletions src/serverdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
# include <QVersionNumber>
#endif
#include "global.h"
#include "util.h"
#include "server.h"
#include "settings.h"
#include "ui_serverdlgbase.h"
Expand All @@ -57,7 +58,7 @@


/* Classes ********************************************************************/
class CServerDlg : public QDialog, private Ui_CServerDlgBase
class CServerDlg : public CBaseDlg, private Ui_CServerDlgBase
{
Q_OBJECT

Expand Down Expand Up @@ -113,10 +114,6 @@ public slots:
void OnSysTrayMenuExit() { close(); }
void OnSysTrayActivated ( QSystemTrayIcon::ActivationReason ActReason );
void OnWelcomeMessageChanged() { pServer->SetWelcomeMessage ( tedWelcomeMessage->toPlainText() ); }

void keyPressEvent ( QKeyEvent *e ) // block escape key
{ if ( e->key() != Qt::Key_Escape ) QDialog::keyPressEvent ( e ); }

void OnLanguageChanged ( QString strLanguage ) { pSettings->strLanguage = strLanguage; }
void OnNewRecordingClicked() { pServer->RequestNewRecording(); }
void OnRecordingDirClicked();
Expand Down
8 changes: 4 additions & 4 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ void CAudioReverb::Process ( CVector<int16_t>& vecsStereoInOut,
\******************************************************************************/
// About dialog ----------------------------------------------------------------
#ifndef HEADLESS
CAboutDlg::CAboutDlg ( QWidget* parent ) : QDialog ( parent )
CAboutDlg::CAboutDlg ( QWidget* parent ) : CBaseDlg ( parent )
{
setupUi ( this );

Expand Down Expand Up @@ -512,7 +512,7 @@ CAboutDlg::CAboutDlg ( QWidget* parent ) : QDialog ( parent )


// Licence dialog --------------------------------------------------------------
CLicenceDlg::CLicenceDlg ( QWidget* parent ) : QDialog ( parent )
CLicenceDlg::CLicenceDlg ( QWidget* parent ) : CBaseDlg ( parent )
{
/*
The licence dialog is structured as follows:
Expand Down Expand Up @@ -555,8 +555,8 @@ CLicenceDlg::CLicenceDlg ( QWidget* parent ) : QDialog ( parent )
// Musician profile dialog -----------------------------------------------------
CMusProfDlg::CMusProfDlg ( CClient* pNCliP,
QWidget* parent ) :
QDialog ( parent ),
pClient ( pNCliP )
CBaseDlg ( parent ),
pClient ( pNCliP )
{
/*
The musician profile dialog is structured as follows:
Expand Down
35 changes: 32 additions & 3 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
# include <QLineEdit>
# include <QDateTime>
# include <QDesktopServices>
# include <QKeyEvent>
# include "ui_aboutdlgbase.h"
#endif
#include <QFile>
Expand Down Expand Up @@ -368,8 +369,36 @@ template<class TData> void CMovingAv<TData>::Add ( const TData tNewD )
* GUI Utilities *
\******************************************************************************/
#ifndef HEADLESS
// Dialog base class -----------------------------------------------------------
class CBaseDlg : public QDialog
{
Q_OBJECT

public:
CBaseDlg ( QWidget* parent = nullptr,
Qt::WindowFlags flags = Qt::WindowFlags() ) : QDialog ( parent, flags ) {}

public slots:
void keyPressEvent ( QKeyEvent* pEvent )
{
// block escape key
if ( pEvent->key() != Qt::Key_Escape )
{
#ifdef ANDROID
if ( pEvent->key() == Qt::Key_Back )
{
close(); // otherwise, dialog does not show properly again in android (nefarius2001, #832)
return;
}
#endif
QDialog::keyPressEvent ( pEvent );
}
}
};


// About dialog ----------------------------------------------------------------
class CAboutDlg : public QDialog, private Ui_CAboutDlgBase
class CAboutDlg : public CBaseDlg, private Ui_CAboutDlgBase
{
Q_OBJECT

Expand All @@ -379,7 +408,7 @@ class CAboutDlg : public QDialog, private Ui_CAboutDlgBase


// Licence dialog --------------------------------------------------------------
class CLicenceDlg : public QDialog
class CLicenceDlg : public CBaseDlg
{
Q_OBJECT

Expand All @@ -395,7 +424,7 @@ public slots:


// Musician profile dialog -----------------------------------------------------
class CMusProfDlg : public QDialog
class CMusProfDlg : public CBaseDlg
{
Q_OBJECT

Expand Down