summaryrefslogtreecommitdiffstats
path: root/krdc
diff options
context:
space:
mode:
Diffstat (limited to 'krdc')
-rw-r--r--krdc/krdc.cpp30
-rw-r--r--krdc/kremoteview.h5
-rw-r--r--krdc/main.cpp6
-rw-r--r--krdc/rdp/krdpview.cpp24
-rw-r--r--krdc/rdp/krdpview.h1
-rw-r--r--krdc/rdp/rdphostpref.cpp18
-rw-r--r--krdc/rdp/rdpprefs.ui7
-rw-r--r--krdc/rdp/rdpprefs.ui.h16
-rw-r--r--krdc/vnc/kvncview.cpp7
-rw-r--r--krdc/vnc/kvncview.h1
10 files changed, 92 insertions, 23 deletions
diff --git a/krdc/krdc.cpp b/krdc/krdc.cpp
index d7ded0fe..36939c91 100644
--- a/krdc/krdc.cpp
+++ b/krdc/krdc.cpp
@@ -119,6 +119,7 @@ bool KRDC::start()
QString userName, password;
QString serverHost;
int serverPort = 5900;
+ int ret_status;
if (!m_host.isNull() &&
(m_host != "vnc:/") &&
@@ -204,7 +205,9 @@ bool KRDC::start()
connect(m_keyCaptureDialog, SIGNAL(keyPressed(XEvent*)),
m_view, SLOT(pressKey(XEvent*)));
- return m_view->start();
+ ret_status = m_view->start();
+
+ return ret_status;
}
void KRDC::changeProgress(RemoteViewStatus s) {
@@ -244,6 +247,10 @@ void KRDC::changeProgress(RemoteViewStatus s) {
this, SIGNAL(disconnectedError()));
connect(m_view, SIGNAL(disconnectedError()),
SIGNAL(disconnected()));
+ if (m_view->startFullscreen()) {
+ // m_view instance is asking to start in fullscreen mode
+ enableFullscreen(true);
+ }
}
else if (m_isFullscreen == WINDOW_MODE_FULLSCREEN)
switchToNormal(m_view->scaling());
@@ -462,6 +469,7 @@ void KRDC::switchToFullscreen(bool scaling)
KToolBar *t = new KToolBar(m_fsToolbar);
m_fsToolbarWidget = t;
+ t->setIconSize(KIcon::Panel);
QIconSet pinIconSet;
pinIconSet.setPixmap(m_pinup, QIconSet::Automatic, QIconSet::Normal, QIconSet::On);
@@ -471,8 +479,7 @@ void KRDC::switchToFullscreen(bool scaling)
pinButton->setIconSet(pinIconSet);
QToolTip::add(pinButton, i18n("Autohide on/off"));
t->setToggle(FS_AUTOHIDE_ID);
- t->setButton(FS_AUTOHIDE_ID, false);
- t->addConnection(FS_AUTOHIDE_ID, SIGNAL(clicked()), this, SLOT(toggleFsToolbarAutoHide()));
+ t->addConnection(FS_AUTOHIDE_ID, SIGNAL(toggled(bool)), this, SLOT(setFsToolbarAutoHide(bool)));
t->insertButton("window_nofullscreen", FS_FULLSCREEN_ID);
KToolBarButton *fullscreenButton = t->getButton(FS_FULLSCREEN_ID);
@@ -485,7 +492,6 @@ void KRDC::switchToFullscreen(bool scaling)
t->insertButton("configure", FS_ADVANCED_ID, m_popup, true, i18n("Advanced options"));
KToolBarButton *advancedButton = t->getButton(FS_ADVANCED_ID);
QToolTip::add(advancedButton, i18n("Advanced options"));
- //advancedButton->setPopupDelay(0);
QLabel *hostLabel = new QLabel(t);
hostLabel->setName("kde toolbar widget");
@@ -516,7 +522,6 @@ void KRDC::switchToFullscreen(bool scaling)
m_fsToolbar->setChild(t);
repositionView(true);
- showFullScreen();
setMaximumSize(m_fullscreenResolution.width(),
m_fullscreenResolution.height());
@@ -525,8 +530,12 @@ void KRDC::switchToFullscreen(bool scaling)
KWin::setState(winId(), NET::StaysOnTop);
- m_ftAutoHide = !m_ftAutoHide;
- setFsToolbarAutoHide(!m_ftAutoHide);
+ if (m_ftAutoHide == false) {
+ showFullscreenToolbar();
+ }
+ else {
+ t->setButton(FS_AUTOHIDE_ID, true);
+ }
if (!fromFullscreen) {
if (m_oldResolution.valid)
@@ -534,7 +543,9 @@ void KRDC::switchToFullscreen(bool scaling)
m_view->grabKeyboard();
}
- m_view->switchFullscreen( true );
+ showFullScreen();
+
+ m_view->switchFullscreen( true );
}
void KRDC::switchToNormal(bool scaling)
@@ -603,7 +614,6 @@ void KRDC::switchToNormal(bool scaling)
t->insertButton("configure", 3, m_popup, true, i18n("Advanced"));
KToolBarButton *advancedButton = t->getButton(3);
QToolTip::add(advancedButton, i18n("Advanced options"));
- //advancedButton->setPopupDelay(0);
if (m_layout)
delete m_layout;
@@ -683,7 +693,7 @@ void KRDC::toolbarChanged() {
bool KRDC::event(QEvent *e) {
-/* used to change resolution when fullscreen was minimized */
+ /* used to change resolution when fullscreen was minimized */
if ((!m_fullscreenMinimized) || (e->type() != QEvent::WindowActivate))
return QWidget::event(e);
diff --git a/krdc/kremoteview.h b/krdc/kremoteview.h
index d07b82a1..a3dbe438 100644
--- a/krdc/kremoteview.h
+++ b/krdc/kremoteview.h
@@ -124,6 +124,11 @@ public:
virtual bool viewOnly() = 0;
/**
+ * Checks whether the view is requesting full screen mode.
+ */
+ virtual bool startFullscreen() = 0;
+
+ /**
* Returns the resolution of the remote framebuffer.
* It should return a null @ref QSize when the size
* is not known.
diff --git a/krdc/main.cpp b/krdc/main.cpp
index d0cd3e4c..5c2423bd 100644
--- a/krdc/main.cpp
+++ b/krdc/main.cpp
@@ -74,13 +74,15 @@ int main(int argc, char *argv[])
{
KAboutData aboutData( "krdc", I18N_NOOP("Remote Desktop Connection"),
VERSION, description, KAboutData::License_GPL,
- "(c) 2001-2003, Tim Jansen"
- "(c) 2002-2003, Arend van Beelen jr."
+ "(c) 2009-2010, Timothy Pearson\n"
+ "(c) 2001-2003, Tim Jansen\n"
+ "(c) 2002-2003, Arend van Beelen jr.\n"
"(c) 2000-2002, Const Kaplinsky\n"
"(c) 2000, Tridia Corporation\n"
"(c) 1999, AT&T Laboratories Cambridge\n"
"(c) 1999-2003, Matthew Chapman\n", 0, 0,
"tim@tjansen.de");
+ aboutData.addAuthor("Timothy Pearson",0, "kb9vqf@pearsoncomputing.net");
aboutData.addAuthor("Tim Jansen",0, "tim@tjansen.de");
aboutData.addAuthor("Arend van Beelen jr.",
I18N_NOOP("RDP backend"), "arend@auton.nl");
diff --git a/krdc/rdp/krdpview.cpp b/krdc/rdp/krdpview.cpp
index dc388e29..720293c3 100644
--- a/krdc/rdp/krdpview.cpp
+++ b/krdc/rdp/krdpview.cpp
@@ -19,6 +19,7 @@
For any questions, comments or whatever, you may mail me at: arend@auton.nl
*/
+#include <kapplication.h>
#include <kdialogbase.h>
#include <klocale.h>
#include <kmessagebox.h>
@@ -38,6 +39,7 @@
#include "rdphostpref.h"
#include "rdpprefs.h"
+bool launch_Fullscreen_rdp = false;
bool rdpAppDataConfigured = false;
extern KWallet::Wallet *wallet;
@@ -188,6 +190,7 @@ bool KRdpView::editPreferences( HostPrefPtr host )
wv = prefs->rdpWidth();
hv = prefs->rdpHeight();
+
kl = int2keymap( prefs->kbLayout() );
hp->setAskOnConnect( prefs->showPrefs() );
hp->setWidth(wv);
@@ -206,6 +209,8 @@ bool KRdpView::start()
SmartPtr<RdpHostPref> hp, rdpDefaults;
bool useKWallet = false;
+ QWidget *desktop = QApplication::desktop();
+
if(!rdpAppDataConfigured)
{
HostPreferences *hps = HostPreferences::instance();
@@ -225,7 +230,19 @@ bool KRdpView::start()
m_process = new KProcess(m_container);
*m_process << "rdesktop";
- *m_process << "-g" << (QString::number(hp->width()) + "x" + QString::number(hp->height()));
+ // Check for fullscreen mode
+ if ((hp->width() == 0) && (hp->height() == 0)) {
+ launch_Fullscreen_rdp = true;
+ *m_process << "-g" << (QString::number(desktop->width()) + "x" + QString::number((desktop->height()-2)));
+ }
+ else {
+ if ((hp->height() > (desktop->height()-2)) && (hp->height() <= (desktop->height()))) {
+ *m_process << "-g" << (QString::number(hp->width()) + "x" + QString::number(desktop->height()-2));
+ }
+ else {
+ *m_process << "-g" << (QString::number(hp->width()) + "x" + QString::number(hp->height()));
+ }
+ }
*m_process << "-k" << hp->layout();
if(!m_user.isEmpty()) { *m_process << "-u" << m_user; }
@@ -311,6 +328,11 @@ bool KRdpView::viewOnly()
return m_container->m_viewOnly;
}
+bool KRdpView::startFullscreen()
+{
+ return launch_Fullscreen_rdp;
+}
+
void KRdpView::setViewOnly(bool s)
{
m_container->m_viewOnly = s;
diff --git a/krdc/rdp/krdpview.h b/krdc/rdp/krdpview.h
index a54c2d96..ed3f279a 100644
--- a/krdc/rdp/krdpview.h
+++ b/krdc/rdp/krdpview.h
@@ -69,6 +69,7 @@ class KRdpView : public KRemoteView
virtual QSize framebufferSize(); // returns the size of the remote view
QSize sizeHint(); // returns the suggested size
virtual bool viewOnly();
+ virtual bool startFullscreen();
// functions regarding the connection
virtual void startQuitting(); // start closing the connection
diff --git a/krdc/rdp/rdphostpref.cpp b/krdc/rdp/rdphostpref.cpp
index 783c41e4..a8186403 100644
--- a/krdc/rdp/rdphostpref.cpp
+++ b/krdc/rdp/rdphostpref.cpp
@@ -25,9 +25,9 @@ const QString RdpHostPref::RdpType = "RDP";
RdpHostPref::RdpHostPref(KConfig *conf, const QString &host, const QString &type) :
HostPref(conf, host, type),
- m_width(800),
- m_height(600),
- m_colorDepth(8),
+ m_width(0),
+ m_height(0),
+ m_colorDepth(24),
m_layout("en-us"),
m_askOnConnect(true),
m_useKWallet(true)
@@ -70,9 +70,9 @@ void RdpHostPref::load()
{
m_config->setGroup("PerHostSettings");
QString p = prefix();
- m_width = m_config->readNumEntry(p+"width", 800);
- m_height = m_config->readNumEntry(p+"height", 600);
- m_colorDepth = m_config->readNumEntry(p+"colorDepth", 8);
+ m_width = m_config->readNumEntry(p+"width", 0);
+ m_height = m_config->readNumEntry(p+"height", 0);
+ m_colorDepth = m_config->readNumEntry(p+"colorDepth", 24);
m_layout = m_config->readEntry(p+"layout", "en-us");
m_askOnConnect = m_config->readBoolEntry(p+"askOnConnect", true);
m_useKWallet = m_config->readBoolEntry(p+"useKWallet", true);
@@ -99,9 +99,9 @@ void RdpHostPref::remove()
void RdpHostPref::setDefaults()
{
m_config->setGroup("RdpDefaultSettings");
- m_width = m_config->readNumEntry("rdpWidth", 800);
- m_height = m_config->readNumEntry("rdpHeight", 600);
- m_colorDepth = m_config->readNumEntry("rdpColorDepth", 8);
+ m_width = m_config->readNumEntry("rdpWidth", 0);
+ m_height = m_config->readNumEntry("rdpHeight", 0);
+ m_colorDepth = m_config->readNumEntry("rdpColorDepth", 24);
m_layout = m_config->readEntry("rdpKeyboardLayout", "en-us");
m_askOnConnect = m_config->readBoolEntry("rdpShowHostPreferences", true);
m_useKWallet = m_config->readBoolEntry("rdpUseKWallet", true);
diff --git a/krdc/rdp/rdpprefs.ui b/krdc/rdp/rdpprefs.ui
index 8e493d7a..0e607b90 100644
--- a/krdc/rdp/rdpprefs.ui
+++ b/krdc/rdp/rdpprefs.ui
@@ -68,6 +68,11 @@
<string>Custom (...)</string>
</property>
</item>
+ <item>
+ <property name="text">
+ <string>Full Screen (Maximized)</string>
+ </property>
+ </item>
<property name="name">
<cstring>cmbResolution</cstring>
</property>
@@ -86,7 +91,7 @@
</size>
</property>
<property name="currentItem">
- <number>1</number>
+ <number>5</number>
</property>
<property name="whatsThis" stdset="0">
<string>Here you can specify the resolution of the remote desktop. This resolution determines the size of the desktop that will be presented to you.</string>
diff --git a/krdc/rdp/rdpprefs.ui.h b/krdc/rdp/rdpprefs.ui.h
index 06efe7f4..295ea5a8 100644
--- a/krdc/rdp/rdpprefs.ui.h
+++ b/krdc/rdp/rdpprefs.ui.h
@@ -34,6 +34,13 @@ void RdpPrefs::resolutionChanged( int selection )
break;
case 3:
+ break;
+
+ case 4:
+ spinWidth->setValue(0);
+ spinHeight->setValue(0);
+ break;
+
default:
break;
}
@@ -115,6 +122,15 @@ void RdpPrefs::setResolution()
{
cmbResolution->setCurrentItem(2);
}
+ else if (cmbResolution->currentItem()==4)
+ {
+ // Fullscreen selected
+ }
+ else if (rdpWidth()==0 && rdpHeight()==0)
+ {
+ // Fullscreen selected
+ cmbResolution->setCurrentItem(4);
+ }
else
{
cmbResolution->setCurrentItem(3);
diff --git a/krdc/vnc/kvncview.cpp b/krdc/vnc/kvncview.cpp
index 1b6a8de2..f734845b 100644
--- a/krdc/vnc/kvncview.cpp
+++ b/krdc/vnc/kvncview.cpp
@@ -40,6 +40,8 @@
#include <X11/Xlib.h>
+bool launch_Fullscreen_vnc = false;
+
/*
* appData is our application-specific data which can be set by the user with
* application resource specs. The AppData structure is defined in the header
@@ -324,6 +326,11 @@ bool KVncView::viewOnly() {
return m_viewOnly;
}
+bool KVncView::startFullscreen()
+{
+ return launch_Fullscreen_vnc;
+}
+
QSize KVncView::framebufferSize() {
return m_framebufferSize;
}
diff --git a/krdc/vnc/kvncview.h b/krdc/vnc/kvncview.h
index 1b961f3d..c0f9fba3 100644
--- a/krdc/vnc/kvncview.h
+++ b/krdc/vnc/kvncview.h
@@ -104,6 +104,7 @@ public:
virtual bool start();
virtual bool viewOnly();
+ virtual bool startFullscreen();
static bool editPreferences( HostPrefPtr );