View | Details | Raw Unified | Return to bug 32648
Collapse All | Expand All

(-)2/invitationsrfbserver.cpp (+15 lines)
Lines 80-85 Link Here
80
    m_unattendedPassword = password;
80
    m_unattendedPassword = password;
81
}
81
}
82
82
83
bool InvitationsRfbServer::enableSharing() const
84
{
85
    return m_enableSharing;
86
}
87
83
bool InvitationsRfbServer::allowUnattendedAccess() const
88
bool InvitationsRfbServer::allowUnattendedAccess() const
84
{
89
{
85
    return m_allowUnattendedAccess;
90
    return m_allowUnattendedAccess;
Lines 102-107 Link Here
102
    RfbServer::stop(disconnectClients);
107
    RfbServer::stop(disconnectClients);
103
}
108
}
104
109
110
void InvitationsRfbServer::toggleSharing(bool allow)
111
{
112
    m_enableSharing = allow;
113
}
114
105
void InvitationsRfbServer::toggleUnattendedAccess(bool allow)
115
void InvitationsRfbServer::toggleUnattendedAccess(bool allow)
106
{
116
{
107
    m_allowUnattendedAccess = allow;
117
    m_allowUnattendedAccess = allow;
Lines 113-118 Link Here
113
    m_unattendedPassword = readableRandomString(4)+"-"+readableRandomString(3);
123
    m_unattendedPassword = readableRandomString(4)+"-"+readableRandomString(3);
114
    KSharedConfigPtr config = KGlobal::config();
124
    KSharedConfigPtr config = KGlobal::config();
115
    KConfigGroup krfbConfig(config,"Security");
125
    KConfigGroup krfbConfig(config,"Security");
126
    m_enableSharing = krfbConfig.readEntry(
127
            "enableSharing", QVariant(false)).toBool();
116
    m_allowUnattendedAccess = krfbConfig.readEntry(
128
    m_allowUnattendedAccess = krfbConfig.readEntry(
117
            "allowUnattendedAccess", QVariant(false)).toBool();
129
            "allowUnattendedAccess", QVariant(false)).toBool();
118
}
130
}
Lines 122-127 Link Here
122
    stop();
134
    stop();
123
    KSharedConfigPtr config = KGlobal::config();
135
    KSharedConfigPtr config = KGlobal::config();
124
    KConfigGroup krfbConfig(config,"Security");
136
    KConfigGroup krfbConfig(config,"Security");
137
    krfbConfig.writeEntry("enableSharing",m_enableSharing);
125
    krfbConfig.writeEntry("allowUnattendedAccess",m_allowUnattendedAccess);
138
    krfbConfig.writeEntry("allowUnattendedAccess",m_allowUnattendedAccess);
126
    if(m_wallet && m_wallet->isOpen()) {
139
    if(m_wallet && m_wallet->isOpen()) {
127
140
Lines 138-143 Link Here
138
                KStringHandler::obscure(m_desktopPassword));
151
                KStringHandler::obscure(m_desktopPassword));
139
        krfbConfig.writeEntry("unattendedPassword",
152
        krfbConfig.writeEntry("unattendedPassword",
140
                KStringHandler::obscure(m_unattendedPassword));
153
                KStringHandler::obscure(m_unattendedPassword));
154
        krfbConfig.writeEntry("enableSharing",
155
                m_enableSharing);
141
        krfbConfig.writeEntry("allowUnattendedAccess",
156
        krfbConfig.writeEntry("allowUnattendedAccess",
142
                m_allowUnattendedAccess);
157
                m_allowUnattendedAccess);
143
    }
158
    }
(-)2/invitationsrfbserver.h (+3 lines)
Lines 42-47 Link Here
42
    const QString& unattendedPassword() const;
42
    const QString& unattendedPassword() const;
43
    void setUnattendedPassword(const QString&);
43
    void setUnattendedPassword(const QString&);
44
    bool allowUnattendedAccess() const;
44
    bool allowUnattendedAccess() const;
45
    bool enableSharing() const;
45
46
46
Q_SIGNALS:
47
Q_SIGNALS:
47
    void passwordChanged(const QString&);
48
    void passwordChanged(const QString&);
Lines 50-55 Link Here
50
    bool start();
51
    bool start();
51
    void stop(bool disconnectClients=true);
52
    void stop(bool disconnectClients=true);
52
    void toggleUnattendedAccess(bool allow=true);
53
    void toggleUnattendedAccess(bool allow=true);
54
    void toggleSharing(bool allow=true);
53
55
54
protected:
56
protected:
55
    InvitationsRfbServer();
57
    InvitationsRfbServer();
Lines 62-67 Link Here
62
private:
64
private:
63
    DNSSD::PublicService *m_publicService;
65
    DNSSD::PublicService *m_publicService;
64
    bool m_allowUnattendedAccess;
66
    bool m_allowUnattendedAccess;
67
    bool m_enableSharing;
65
    QString m_desktopPassword;
68
    QString m_desktopPassword;
66
    QString m_unattendedPassword;
69
    QString m_unattendedPassword;
67
    KWallet::Wallet *m_wallet;
70
    KWallet::Wallet *m_wallet;
(-)2/krfb.kcfg (+4 lines)
Lines 18-23 Link Here
18
    </entry>
18
    </entry>
19
  </group>
19
  </group>
20
  <group name="Security">
20
  <group name="Security">
21
    <entry name="enableSharing" type="Bool">
22
      <label>Enable sharing.</label>
23
      <default>false</default>
24
    </entry>
21
    <entry name="allowDesktopControl" type="Bool">
25
    <entry name="allowDesktopControl" type="Bool">
22
      <label>Allow remote connections to manage the desktop.</label>
26
      <label>Allow remote connections to manage the desktop.</label>
23
      <default>true</default>
27
      <default>true</default>
(-)2/mainwindow.cpp (+3 lines)
Lines 70-75 Link Here
70
    QWidget *mainWidget = new QWidget;
70
    QWidget *mainWidget = new QWidget;
71
    m_ui.setupUi(mainWidget);
71
    m_ui.setupUi(mainWidget);
72
    m_ui.krfbIconLabel->setPixmap(KIcon("krfb").pixmap(128));
72
    m_ui.krfbIconLabel->setPixmap(KIcon("krfb").pixmap(128));
73
    m_ui.enableSharingCheckBox->setChecked(
74
            InvitationsRfbServer::instance->enableSharing());
75
    toggleDesktopSharing(InvitationsRfbServer::instance->enableSharing());
73
    m_ui.enableUnattendedCheckBox->setChecked(
76
    m_ui.enableUnattendedCheckBox->setChecked(
74
            InvitationsRfbServer::instance->allowUnattendedAccess());
77
            InvitationsRfbServer::instance->allowUnattendedAccess());
75
78

Return to bug 32648