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

(-)a/krfb/invitationsrfbserver.cpp (+18 lines)
Lines 81-86 const QString& InvitationsRfbServer::unattendedPassword() const Link Here
81
    return m_unattendedPassword;
81
    return m_unattendedPassword;
82
}
82
}
83
83
84
bool InvitationsRfbServer::enableSharing() const
85
{
86
    return m_enableSharing;
87
}
88
84
void InvitationsRfbServer::setUnattendedPassword(const QString& password)
89
void InvitationsRfbServer::setUnattendedPassword(const QString& password)
85
{
90
{
86
    m_unattendedPassword = password;
91
    m_unattendedPassword = password;
Lines 108-113 void InvitationsRfbServer::stop() Link Here
108
    RfbServer::stop();
113
    RfbServer::stop();
109
}
114
}
110
115
116
void InvitationsRfbServer::toggleSharing(bool allow)
117
{
118
    m_enableSharing = allow;
119
}
120
111
void InvitationsRfbServer::toggleUnattendedAccess(bool allow)
121
void InvitationsRfbServer::toggleUnattendedAccess(bool allow)
112
{
122
{
113
    m_allowUnattendedAccess = allow;
123
    m_allowUnattendedAccess = allow;
Lines 117-122 InvitationsRfbServer::InvitationsRfbServer() Link Here
117
{
127
{
118
    m_desktopPassword = readableRandomString(4)+"-"+readableRandomString(3);
128
    m_desktopPassword = readableRandomString(4)+"-"+readableRandomString(3);
119
    m_unattendedPassword = readableRandomString(4)+"-"+readableRandomString(3);
129
    m_unattendedPassword = readableRandomString(4)+"-"+readableRandomString(3);
130
    KConfigGroup krfbConfig(KSharedConfig::openConfig(),"MainWindow");
131
    m_enableSharing = krfbConfig.readEntry(
132
            "enableSharing", QVariant(false)).toBool();
120
    KConfigGroup krfbConfig(KSharedConfig::openConfig(),"Security");
133
    KConfigGroup krfbConfig(KSharedConfig::openConfig(),"Security");
121
    m_allowUnattendedAccess = krfbConfig.readEntry(
134
    m_allowUnattendedAccess = krfbConfig.readEntry(
122
            "allowUnattendedAccess", QVariant(false)).toBool();
135
            "allowUnattendedAccess", QVariant(false)).toBool();
Lines 125-130 InvitationsRfbServer::InvitationsRfbServer() Link Here
125
InvitationsRfbServer::~InvitationsRfbServer()
138
InvitationsRfbServer::~InvitationsRfbServer()
126
{
139
{
127
    stop();
140
    stop();
141
    KConfigGroup krfbConfig(KSharedConfig::openConfig(),"MainWindow");
142
    krfbConfig.writeEntry("enableSharing",m_enableSharing);
128
    KConfigGroup krfbConfig(KSharedConfig::openConfig(),"Security");
143
    KConfigGroup krfbConfig(KSharedConfig::openConfig(),"Security");
129
    krfbConfig.writeEntry("allowUnattendedAccess",m_allowUnattendedAccess);
144
    krfbConfig.writeEntry("allowUnattendedAccess",m_allowUnattendedAccess);
130
    if(!KrfbConfig::noWallet()) {
145
    if(!KrfbConfig::noWallet()) {
Lines 145-150 InvitationsRfbServer::~InvitationsRfbServer() Link Here
145
                KStringHandler::obscure(m_unattendedPassword));
160
                KStringHandler::obscure(m_unattendedPassword));
146
        krfbConfig.writeEntry("allowUnattendedAccess",
161
        krfbConfig.writeEntry("allowUnattendedAccess",
147
                m_allowUnattendedAccess);
162
                m_allowUnattendedAccess);
163
        KConfigGroup krfbConfig(KSharedConfig::openConfig(),"MainWindow");
164
        krfbConfig.writeEntry("enableSharing",
165
                m_enableSharing);
148
    }
166
    }
149
}
167
}
150
168
(-)a/krfb/invitationsrfbserver.h (+3 lines)
Lines 42-47 public: 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 public Q_SLOTS: Link Here
50
    bool start() override;
51
    bool start() override;
51
    void stop() override;
52
    void stop() override;
52
    void toggleUnattendedAccess(bool allow);
53
    void toggleUnattendedAccess(bool allow);
54
    void toggleSharing(bool allow);
53
55
54
protected:
56
protected:
55
    InvitationsRfbServer();
57
    InvitationsRfbServer();
Lines 62-67 private Q_SLOTS: Link Here
62
private:
64
private:
63
    KDNSSD::PublicService *m_publicService;
65
    KDNSSD::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;
(-)a/krfb/krfb.kcfg (+4 lines)
Lines 8-13 Link Here
8
    <label>Start minimized</label>
8
    <label>Start minimized</label>
9
    <default>false</default>
9
    <default>false</default>
10
    </entry>
10
    </entry>
11
    <entry name="enableSharing" type="Bool">
12
      <label>Enable sharing.</label>
13
      <default>false</default>
14
    </entry>
11
  </group>
15
  </group>
12
  <group name="TCP">
16
  <group name="TCP">
13
    <entry name="useDefaultPort" type="Bool">
17
    <entry name="useDefaultPort" type="Bool">
(-)a/krfb/mainwindow.cpp (+3 lines)
Lines 57-62 MainWindow::MainWindow(QWidget *parent) Link Here
57
    QWidget *mainWidget = new QWidget;
57
    QWidget *mainWidget = new QWidget;
58
    m_ui.setupUi(mainWidget);
58
    m_ui.setupUi(mainWidget);
59
    m_ui.krfbIconLabel->setPixmap(QIcon::fromTheme("krfb").pixmap(128));
59
    m_ui.krfbIconLabel->setPixmap(QIcon::fromTheme("krfb").pixmap(128));
60
    m_ui.enableSharingCheckBox->setChecked(
61
            InvitationsRfbServer::instance->enableSharing());
62
    toggleDesktopSharing(InvitationsRfbServer::instance->enableSharing());
60
    m_ui.enableUnattendedCheckBox->setChecked(
63
    m_ui.enableUnattendedCheckBox->setChecked(
61
            InvitationsRfbServer::instance->allowUnattendedAccess());
64
            InvitationsRfbServer::instance->allowUnattendedAccess());
62
65

Return to bug 32648