1 /*
2  * DesktopSessionServersOverlay.cpp
3  *
4  * Copyright (C) 2021 by RStudio, PBC
5  *
6  * Unless you have received this program directly from RStudio pursuant
7  * to the terms of a commercial license agreement with RStudio, then
8  * this program is licensed to you under the terms of version 3 of the
9  * GNU Affero General Public License. This program is distributed WITHOUT
10  * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
11  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
12  * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
13  *
14  */
15 
16 #include "DesktopSessionServersOverlay.hpp"
17 
18 using namespace rstudio::core;
19 
20 namespace rstudio {
21 namespace desktop {
22 
sessionServers()23 DesktopSessionServers& sessionServers()
24 {
25    static DesktopSessionServers singleton;
26    return singleton;
27 }
28 
29 DesktopSessionServers::DesktopSessionServers() = default;
30 
showSessionServerOptionsDialog(QWidget * parent)31 void DesktopSessionServers::showSessionServerOptionsDialog(QWidget* parent)
32 {
33 }
34 
showSessionLaunchLocationDialog()35 LaunchLocationResult DesktopSessionServers::showSessionLaunchLocationDialog()
36 {
37    LaunchLocationResult result;
38    return result;
39 }
40 
setPendingSessionServerReconnect(const SessionServer & server)41 void DesktopSessionServers::setPendingSessionServerReconnect(const SessionServer& server)
42 {
43 }
44 
getPendingSessionServerReconnect()45 boost::optional<SessionServer> DesktopSessionServers::getPendingSessionServerReconnect()
46 {
47    return boost::none;
48 }
49 
toJson() const50 QJsonObject SessionServerPathMapping::toJson() const
51 {
52    return QJsonObject();
53 }
54 
fromJson(const QJsonObject & pathMappingJson)55 SessionServerPathMapping SessionServerPathMapping::fromJson(const QJsonObject& pathMappingJson)
56 {
57    return SessionServerPathMapping();
58 }
59 
label() const60 const std::string& SessionServer::label() const
61 {
62    if (!name().empty())
63       return name();
64    else
65       return url();
66 }
67 
toJson() const68 QJsonObject SessionServer::toJson() const
69 {
70    return QJsonObject();
71 }
72 
fromJson(const QJsonObject & sessionServerJson)73 SessionServer SessionServer::fromJson(const QJsonObject& sessionServerJson)
74 {
75    return SessionServer();
76 }
77 
cookieBelongs(const QNetworkCookie & cookie) const78 bool SessionServer::cookieBelongs(const QNetworkCookie& cookie) const
79 {
80    return false;
81 }
82 
test()83 Error SessionServer::test()
84 {
85    return Success();
86 }
87 
sessionServerSettings()88 SessionServerSettings& sessionServerSettings()
89 {
90    static SessionServerSettings singleton;
91    return singleton;
92 }
93 
SessionServerSettings()94 SessionServerSettings::SessionServerSettings() :
95    sessionLocation_(SessionLocation::Ask),
96    closeServerSessionsOnExit_(CloseServerSessions::Never)
97 {
98 }
99 
configSource() const100 ConfigSource SessionServerSettings::configSource() const
101 {
102    return ConfigSource::User;
103 }
104 
save(const std::vector<SessionServer> & servers,SessionLocation sessionLocation,CloseServerSessions closeServerSessionsOnExit)105 void SessionServerSettings::save(const std::vector<SessionServer>& servers,
106                                  SessionLocation sessionLocation,
107                                  CloseServerSessions closeServerSessionsOnExit)
108 {
109 }
110 
addSaveHandler(const boost::function<void ()> & onSave)111 boost::signals2::scoped_connection SessionServerSettings::addSaveHandler(const boost::function<void()>& onSave)
112 {
113    return boost::signals2::scoped_connection();
114 }
115 
116 } // namespace desktop
117 } // namespace rstudio
118