-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/origin/development' into featur…
…e/audio_enhancements
- Loading branch information
Showing
18 changed files
with
697 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
include/f1x/openauto/autoapp/Configuration/IRecentAddressesList.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* This file is part of openauto project. | ||
* Copyright (C) 2018 f1x.studio (Michal Szwaj) | ||
* | ||
* openauto is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* openauto is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with openauto. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <deque> | ||
#include <string> | ||
|
||
namespace f1x | ||
{ | ||
namespace openauto | ||
{ | ||
namespace autoapp | ||
{ | ||
namespace configuration | ||
{ | ||
|
||
class IRecentAddressesList | ||
{ | ||
public: | ||
typedef std::deque<std::string> RecentAddresses; | ||
|
||
virtual void read() = 0; | ||
virtual void insertAddress(const std::string& address) = 0; | ||
virtual RecentAddresses getList() const = 0; | ||
}; | ||
|
||
} | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
include/f1x/openauto/autoapp/Configuration/RecentAddressesList.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* This file is part of openauto project. | ||
* Copyright (C) 2018 f1x.studio (Michal Szwaj) | ||
* | ||
* openauto is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* openauto is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with openauto. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <deque> | ||
#include <f1x/openauto/autoapp/Configuration/IRecentAddressesList.hpp> | ||
|
||
namespace f1x | ||
{ | ||
namespace openauto | ||
{ | ||
namespace autoapp | ||
{ | ||
namespace configuration | ||
{ | ||
|
||
class RecentAddressesList: public IRecentAddressesList | ||
{ | ||
public: | ||
RecentAddressesList(size_t maxListSize); | ||
|
||
void read() override; | ||
void insertAddress(const std::string& address) override; | ||
RecentAddresses getList() const override; | ||
|
||
private: | ||
void load(); | ||
void save(); | ||
|
||
size_t maxListSize_; | ||
RecentAddresses list_; | ||
|
||
static const std::string cConfigFileName; | ||
static const std::string cRecentEntiresCount; | ||
static const std::string cRecentEntryPrefix; | ||
}; | ||
|
||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#pragma once | ||
|
||
#include <QDialog> | ||
#include <QStringListModel> | ||
#include <f1x/aasdk/TCP/ITCPEndpoint.hpp> | ||
#include <f1x/aasdk/TCP/ITCPWrapper.hpp> | ||
#include <f1x/openauto/autoapp/Configuration/IRecentAddressesList.hpp> | ||
|
||
namespace Ui { | ||
class ConnectDialog; | ||
} | ||
|
||
namespace f1x | ||
{ | ||
namespace openauto | ||
{ | ||
namespace autoapp | ||
{ | ||
namespace ui | ||
{ | ||
|
||
class ConnectDialog : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit ConnectDialog(boost::asio::io_service& ioService, aasdk::tcp::ITCPWrapper& tcpWrapper, openauto::autoapp::configuration::IRecentAddressesList& recentAddressesList, QWidget *parent = nullptr); | ||
~ConnectDialog() override; | ||
|
||
signals: | ||
void connectToDevice(const QString& ipAddress); | ||
void connectionSucceed(aasdk::tcp::ITCPEndpoint::SocketPointer socket, const std::string& ipAddress); | ||
void connectionFailed(const QString& message); | ||
|
||
private slots: | ||
void onConnectButtonClicked(); | ||
void onConnectionFailed(const QString& message); | ||
void onConnectionSucceed(aasdk::tcp::ITCPEndpoint::SocketPointer socket, const std::string& ipAddress); | ||
void onRecentAddressClicked(const QModelIndex& index); | ||
|
||
private: | ||
void insertIpAddress(const std::string& ipAddress); | ||
void loadRecentList(); | ||
void setControlsEnabledStatus(bool status); | ||
void connectHandler(const boost::system::error_code& ec, const std::string& ipAddress, aasdk::tcp::ITCPEndpoint::SocketPointer socket); | ||
|
||
boost::asio::io_service& ioService_; | ||
aasdk::tcp::ITCPWrapper& tcpWrapper_; | ||
openauto::autoapp::configuration::IRecentAddressesList& recentAddressesList_; | ||
Ui::ConnectDialog *ui_; | ||
QStringListModel recentAddressesModel_; | ||
}; | ||
|
||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.