Skip to content
Closed
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
24 changes: 24 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Android CI

on:
push:
branches: [ feature/android ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew build

4 changes: 4 additions & 0 deletions Jamulus.pro
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ DEFINES += APP_VERSION=\\\"$$VERSION\\\" \
USE_ALLOCA \
CUSTOM_MODES \
_REENTRANT
DEFINES += "BOOL_CLOSE_DIALOGS_ON_BACKBUTTON=0" # fixes android ui issue

# some depreciated functions need to be kept for older versions to build
# TODO as soon as we drop support for the old Qt version, remove the following line
Expand Down Expand Up @@ -176,6 +177,9 @@ win32 {
# enabled only for debugging on android devices
DEFINES += ANDROIDDEBUG

DEFINES -= BOOL_CLOSE_DIALOGS_ON_BACKBUTTON=0 # fixes android ui issue
DEFINES += BOOL_CLOSE_DIALOGS_ON_BACKBUTTON=1 # fixes android ui issue

target.path = /tmp/your_executable # path on device
INSTALLS += target

Expand Down
10 changes: 10 additions & 0 deletions src/analyzerconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,13 @@ int CAnalyzerConsole::CalcYPosInGraph ( const double dAxisMin,
return GraphGridFrame.y() + static_cast<int> (
static_cast<double> ( GraphGridFrame.height() ) * ( 1 - dYValNorm ) );
}

void CAnalyzerConsole::keyPressEvent ( QKeyEvent *e )
{
if (BOOL_CLOSE_DIALOGS_ON_BACKBUTTON && ( e->key() == Qt::Key_Back )){
this->close(); // otherwise, dialog does not show properly again in android
return;
}else{
QDialog::keyPressEvent ( e );
}
}
3 changes: 3 additions & 0 deletions src/analyzerconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <QImage>
#include <QPainter>
#include <QTimer>
#include <QKeyEvent>
#include "client.h"


Expand Down Expand Up @@ -87,4 +88,6 @@ class CAnalyzerConsole : public QDialog

public slots:
void OnTimerErrRateUpdate();

void keyPressEvent ( QKeyEvent *e );
};
13 changes: 13 additions & 0 deletions src/chatdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,16 @@ void CChatDlg::OnAnchorClicked ( const QUrl& Url )
}
}
}

void CChatDlg::keyPressEvent ( QKeyEvent *e ) // block escape key & fix android back key
{
if ( e->key() == Qt::Key_Escape ){
; // ignore escape key
}else if (BOOL_CLOSE_DIALOGS_ON_BACKBUTTON && ( e->key() == Qt::Key_Back )){
this->close(); // otherwise, dialog does not show properly again in android
return;
}else{
QDialog::keyPressEvent ( e );
}
}

3 changes: 1 addition & 2 deletions src/chatdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ 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 ); }
void keyPressEvent ( QKeyEvent *e );

signals:
void NewLocalInputText ( QString strNewText );
Expand Down
12 changes: 12 additions & 0 deletions src/clientdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1354,3 +1354,15 @@ rbtReverbSelR->setStyleSheet ( "" );
// also apply GUI design to child GUI controls
MainMixerBoard->SetGUIDesign ( eNewDesign );
}

void CClientDlg::keyPressEvent ( QKeyEvent *e ) // block escape key & fix android back key
{
if ( e->key() == Qt::Key_Escape ){
; // ignore escape key
}else if (BOOL_CLOSE_DIALOGS_ON_BACKBUTTON && ( e->key() == Qt::Key_Back )){
this->close(); // otherwise, dialog does not show properly again in android
return;
}else{
QDialog::keyPressEvent ( e );
}
}
3 changes: 1 addition & 2 deletions src/clientdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,5 @@ public slots:

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

void keyPressEvent ( QKeyEvent *e ) // block escape key
{ if ( e->key() != Qt::Key_Escape ) QDialog::keyPressEvent ( e ); }
void keyPressEvent ( QKeyEvent *e );
};
10 changes: 10 additions & 0 deletions src/clientsettingsdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,3 +754,13 @@ void CClientSettingsDlg::UpdateCustomCentralServerComboBox()
}
}
}

void CClientSettingsDlg::keyPressEvent ( QKeyEvent *e ) // block escape key & fix android back key
{
if (BOOL_CLOSE_DIALOGS_ON_BACKBUTTON && ( e->key() == Qt::Key_Back )){
this->close(); // otherwise, dialog does not show properly again in android
return;
}else{
QDialog::keyPressEvent ( e );
}
}
2 changes: 2 additions & 0 deletions src/clientsettingsdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <QLayout>
#include <QButtonGroup>
#include <QMessageBox>
#include <QKeyEvent>
#include "global.h"
#include "client.h"
#include "settings.h"
Expand Down Expand Up @@ -107,6 +108,7 @@ public slots:
void OnGUIDesignActivated ( int iDesignIdx );
void OnDriverSetupClicked();
void OnLanguageChanged ( QString strLanguage ) { pSettings->strLanguage = strLanguage; }
void keyPressEvent ( QKeyEvent *e );

signals:
void GUIDesignChanged();
Expand Down
10 changes: 10 additions & 0 deletions src/connectdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,3 +921,13 @@ void CConnectDlg::DeleteAllListViewItemChilds ( QTreeWidgetItem* pItem )
delete pCurChildItem;
}
}

void CConnectDlg::keyPressEvent ( QKeyEvent *e )
{
if (BOOL_CLOSE_DIALOGS_ON_BACKBUTTON && ( e->key() == Qt::Key_Back )){
this->close(); // otherwise, dialog does not show properly again in android
return;
}else{
QDialog::keyPressEvent ( e );
}
}
3 changes: 3 additions & 0 deletions src/connectdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <QTimer>
#include <QLocale>
#include <QtConcurrent>
#include <QKeyEvent>
#include "global.h"
#include "settings.h"
#include "multicolorled.h"
Expand Down Expand Up @@ -109,6 +110,8 @@ public slots:
void OnTimerPing();
void OnTimerReRequestServList();

void keyPressEvent ( QKeyEvent *e );

signals:
void ReqServerListQuery ( CHostAddress InetAddr );
void CreateCLServerListPingMes ( CHostAddress InetAddr );
Expand Down
12 changes: 12 additions & 0 deletions src/serverdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -834,3 +834,15 @@ void CServerDlg::changeEvent ( QEvent* pEvent )
}
}
}

void CServerDlg::keyPressEvent ( QKeyEvent *e ) // block escape key & fix android back key
{
if ( e->key() == Qt::Key_Escape ){
; // ignore escape key
}else if (BOOL_CLOSE_DIALOGS_ON_BACKBUTTON && ( e->key() == Qt::Key_Back )){
this->close(); // otherwise, dialog does not show properly again in android
return;
}else{
QDialog::keyPressEvent ( e );
}
}
3 changes: 1 addition & 2 deletions src/serverdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ public slots:
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 keyPressEvent ( QKeyEvent *e );

void OnLanguageChanged ( QString strLanguage ) { pSettings->strLanguage = strLanguage; }
void OnNewRecordingClicked() { pServer->RequestNewRecording(); }
Expand Down
10 changes: 10 additions & 0 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,16 @@ void CMusProfDlg::OnSkillActivated ( int iCntryListItem )
pClient->SetRemoteInfo();
}

void CMusProfDlg::keyPressEvent ( QKeyEvent *e )
{
if (BOOL_CLOSE_DIALOGS_ON_BACKBUTTON && ( e->key() == Qt::Key_Back )){
this->close(); // otherwise, dialog does not show properly again in android
return;
}else{
QDialog::keyPressEvent ( e );
}
}


// Help menu -------------------------------------------------------------------
CHelpMenu::CHelpMenu ( const bool bIsClient, QWidget* parent ) : QMenu ( tr ( "&Help" ), parent )
Expand Down
3 changes: 3 additions & 0 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 @@ -420,6 +421,8 @@ public slots:
void OnCountryActivated ( int iCntryListItem );
void OnCityTextChanged ( const QString& strNewName );
void OnSkillActivated ( int iCntryListItem );

void keyPressEvent ( QKeyEvent *e );
};


Expand Down