Bug 103934 - Support for more rdesktop options
Summary: Support for more rdesktop options
Status: CONFIRMED
Alias: None
Product: krdc
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Urs Wolfer
URL:
Keywords:
: 73377 78356 89685 111774 130398 189189 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-15 08:40 UTC by Isaac Clerencia
Modified: 2019-02-05 10:49 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Isaac Clerencia 2005-04-15 08:40:17 UTC
Version:            (using KDE KDE 3.4.0)

rdesktop has some interesting options, like "-r printer", "-r disk" to redirect printers and disks and "-r sound" to redirect sound. I'm not sure if this options fall in the scope of krdc but it would be nice to have them available or at least have a "Extra options for rdesktop command" entry because otherwise I need to launch rdesktop manually from command line.

Best regards
Comment 1 Brad Hards 2005-12-14 11:15:14 UTC
There are a lot of similar bugs that all require passing stuff to rdesktop, so I'm going to try to summarise them here.

Bug 73377 was originally about RDP high colour support, which is done. A followup requested sound, drive, and printer options (ie the -r variations)

Bug 89685 requested ability to set the local hostname (-n option)

Bug 78356 requested ability to specify an arbitrary port

Bug 111774 requests more options (specifically, but not only sound).
Comment 2 Brad Hards 2005-12-14 11:16:09 UTC
*** Bug 111774 has been marked as a duplicate of this bug. ***
Comment 3 Brad Hards 2005-12-14 11:16:56 UTC
*** Bug 73377 has been marked as a duplicate of this bug. ***
Comment 4 Brad Hards 2005-12-14 11:17:46 UTC
*** Bug 89685 has been marked as a duplicate of this bug. ***
Comment 5 Brad Hards 2005-12-14 11:18:29 UTC
*** Bug 78356 has been marked as a duplicate of this bug. ***
Comment 6 Andreas Kling 2006-07-16 18:58:43 UTC
-0 for "attach to console" requested
Comment 7 Andreas Kling 2006-07-16 18:59:05 UTC
*** Bug 130398 has been marked as a duplicate of this bug. ***
Comment 8 Brad Hards 2006-08-13 13:15:53 UTC
Planned for KDE4 (final).

For printers, it would be desirable to pull out the list of the current printers, so you don't need to put them back in.
Comment 9 Jeffrey 2007-07-31 16:27:35 UTC
I too would like to see the ability to add options, such as non-standard port numbers (3390) for RDP.  This is an essential need for any use in a business environment with firewall rules in place.
Comment 10 Urs Wolfer 2007-08-01 17:49:00 UTC
SVN commit 695197 by uwolfer:

* Better RDP (rdesktop) integration:
  * Option for sound output (local, remote, disabled).
  * Line Edit for additional rdesktop arguments. This way experienced users can use all rdesktop options inside KRDC, but the UI does not become bloaded. Probably I will more important and often used options to the UI later (if there are more...).

* Explanation in the RDP tooltip for port option.

BUG: 103934

 M  +6 -0      config/krdc.kcfg  
 M  +2 -2      mainwindow.cpp  
 M  +45 -5     rdp/rdphostpreferences.cpp  
 M  +6 -0      rdp/rdphostpreferences.h  
 M  +72 -9     rdp/rdppreferences.ui  
 M  +20 -0     rdp/rdpview.cpp  


--- trunk/KDE/kdenetwork/krdc/config/krdc.kcfg #695196:695197
@@ -43,5 +43,11 @@
     <entry name="ColorDepth" type="Int">
       <default>0</default>
     </entry>
+    <entry name="Sound" type="Int">
+      <default>0</default>
+    </entry>
+    <entry name="ExtraOptions" type="String">
+      <default></default>
+    </entry>
   </group>
 </kcfg>
--- trunk/KDE/kdenetwork/krdc/mainwindow.cpp #695196:695197
@@ -650,8 +650,8 @@
 
     QToolTip::showText(m_addressNavigator->pos() + pos() + QPoint(m_addressNavigator->width(),
                                                                   m_addressNavigator->height() + 20),
-                       i18n("Enter here the address.<br />"
-                            "<i>Example: rdpserver (host)</i>"), this);
+                       i18n("Enter here the address. Port is optional.<br />"
+                            "<i>Example: rdpserver:3389 (host:port)</i>"), this);
 }
 
 QList<RemoteView *> MainWindow::remoteViewList() const
--- trunk/KDE/kdenetwork/krdc/rdp/rdphostpreferences.cpp #695196:695197
@@ -88,7 +88,9 @@
     m_height(600),
     m_width(800),
     m_colorDepth(0),
-    m_keyboardLayout("en-us")
+    m_keyboardLayout("en-us"),
+    m_sound(0),
+    m_extraOptions(QString())
 {
     if (hostConfigured()) {
         if (showConfigAgain() || forceShow) {
@@ -120,6 +122,8 @@
     rdpUi.kcfg_Width->setValue(width());
     rdpUi.kcfg_ColorDepth->setCurrentIndex(colorDepth());
     rdpUi.kcfg_KeyboardLayout->setCurrentIndex(keymap2int(keyboardLayout()));
+    rdpUi.kcfg_Sound->setCurrentIndex(sound());
+    rdpUi.kcfg_ExtraOptions->setText(extraOptions());
 
     connect(rdpUi.resolutionComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateWidthHeight(int)));
 
@@ -130,10 +134,12 @@
     if (dialog->exec() == KDialog::Accepted) {
         kDebug(5012) << "RdpHostPreferences config dialog accepted" << endl;
 
-       setHeight(rdpUi.kcfg_Height->value());
-       setWidth(rdpUi.kcfg_Width->value());
-       setColorDepth(rdpUi.kcfg_ColorDepth->currentIndex());
-       setKeyboardLayout(int2keymap(rdpUi.kcfg_KeyboardLayout->currentIndex()));
+        setHeight(rdpUi.kcfg_Height->value());
+        setWidth(rdpUi.kcfg_Width->value());
+        setColorDepth(rdpUi.kcfg_ColorDepth->currentIndex());
+        setKeyboardLayout(int2keymap(rdpUi.kcfg_KeyboardLayout->currentIndex()));
+        setSound(rdpUi.kcfg_Sound->currentIndex());
+        setExtraOptions(rdpUi.kcfg_ExtraOptions->text());
     }
 }
 
@@ -196,6 +202,16 @@
         setKeyboardLayout(int2keymap(m_element.firstChildElement("keyboardLayout").text().toInt()));
     else
         setKeyboardLayout(int2keymap(Settings::keyboardLayout()));
+
+    if (m_element.firstChildElement("sound") != QDomElement())
+        setSound(m_element.firstChildElement("sound").text().toInt());
+    else
+        setSound(Settings::sound());
+
+    if (m_element.firstChildElement("extraOptions") != QDomElement())
+        setExtraOptions(m_element.firstChildElement("extraOptions").text());
+    else
+        setExtraOptions(Settings::extraOptions());
 }
 
 void RdpHostPreferences::saveProtocolSpecificConfig()
@@ -206,6 +222,8 @@
     updateElement("width", QString::number(width()));
     updateElement("colorDepth", QString::number(colorDepth()));
     updateElement("keyboardLayout", QString::number(keymap2int(keyboardLayout())));
+    updateElement("sound", QString::number(sound()));
+    updateElement("extraOptions", extraOptions());
 }
 
 void RdpHostPreferences::setHeight(int height)
@@ -252,4 +270,26 @@
     return m_keyboardLayout;
 }
 
+void RdpHostPreferences::setSound(int sound)
+{
+    if (sound >= 0)
+        m_sound = sound;
+}
+
+int RdpHostPreferences::sound() const
+{
+    return m_sound;
+}
+
+void RdpHostPreferences::setExtraOptions(const QString &extraOptions)
+{
+    if (!extraOptions.isNull())
+        m_extraOptions = extraOptions;
+}
+
+QString RdpHostPreferences::extraOptions() const
+{
+    return m_extraOptions;
+}
+
 #include "rdphostpreferences.moc"
--- trunk/KDE/kdenetwork/krdc/rdp/rdphostpreferences.h #695196:695197
@@ -43,6 +43,10 @@
     int colorDepth();
     void setKeyboardLayout(const QString &keyboardLayout);
     QString keyboardLayout() const;
+    void setSound(int sound);
+    int sound() const;
+    void setExtraOptions(const QString &extraOptions);
+    QString extraOptions() const;
 
 protected:
     void showDialog();
@@ -54,6 +58,8 @@
     int m_width;
     int m_colorDepth;
     QString m_keyboardLayout;
+    int m_sound;
+    QString m_extraOptions;
     Ui::RdpPreferences rdpUi;
 
 private slots:
--- trunk/KDE/kdenetwork/krdc/rdp/rdppreferences.ui #695196:695197
@@ -1,17 +1,9 @@
 <ui version="4.0" >
  <class>RdpPreferences</class>
  <widget class="QWidget" name="RdpPreferences" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>435</width>
-    <height>174</height>
-   </rect>
-  </property>
   <layout class="QVBoxLayout" >
    <item>
-    <widget class="QGroupBox" name="rdpGroupBox" >
+    <widget class="QGroupBox" name="connectionGroupBox" >
      <property name="title" >
       <string>Connection</string>
      </property>
@@ -406,10 +398,74 @@
         </item>
        </widget>
       </item>
+      <item row="4" column="1" >
+       <widget class="QComboBox" name="kcfg_Sound" >
+        <item>
+         <property name="text" >
+          <string>On this computer</string>
+         </property>
+        </item>
+        <item>
+         <property name="text" >
+          <string>On remote computer</string>
+         </property>
+        </item>
+        <item>
+         <property name="text" >
+          <string>Disable sound</string>
+         </property>
+        </item>
+       </widget>
+      </item>
+      <item row="4" column="0" >
+       <widget class="QLabel" name="soudLabel" >
+        <property name="text" >
+         <string>Sound:</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
    <item>
+    <widget class="QGroupBox" name="expertGroupBox" >
+     <property name="title" >
+      <string>Expert options</string>
+     </property>
+     <layout class="QGridLayout" >
+      <item row="0" column="0" >
+       <widget class="QLabel" name="extraOptionsLabel" >
+        <property name="minimumSize" >
+         <size>
+          <width>116</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="text" >
+         <string>Extra options:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1" >
+       <widget class="KLineEdit" name="kcfg_ExtraOptions" >
+        <property name="minimumSize" >
+         <size>
+          <width>280</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="whatsThis" >
+         <string>Here you can enter additional rdesktop options.</string>
+        </property>
+        <property name="showClearButton" stdset="0" >
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
     <spacer>
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
@@ -424,6 +480,13 @@
    </item>
   </layout>
  </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KLineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>klineedit.h</header>
+  </customwidget>
+ </customwidgets>
  <tabstops>
   <tabstop>resolutionComboBox</tabstop>
   <tabstop>kcfg_Width</tabstop>
--- trunk/KDE/kdenetwork/krdc/rdp/rdpview.cpp #695196:695197
@@ -163,6 +163,26 @@
 
     arguments << "-X" << QString::number(m_container->winId());
     arguments << "-a" << QString::number((m_hostPreferences->colorDepth() + 1) * 8);
+
+    QString sound;
+    switch (m_hostPreferences->sound()) {
+    case 0:
+        sound = "local";
+        break;
+    case 1:
+        sound = "remote";
+        break;
+    case 2:
+    default:
+        sound = "off";
+    }
+    arguments << "-r" << "sound:" + sound;
+
+    if (!m_hostPreferences->extraOptions().isEmpty()) {
+        QStringList additionalArguments = m_hostPreferences->extraOptions().split(' ');
+        arguments += additionalArguments;
+    }
+
     arguments << (m_host + ':' + QString::number(m_port));
 
     kDebug(5012) << arguments << endl;
Comment 11 Alan Ezust 2008-04-18 00:51:21 UTC
Which version should I expect to see the new sound options in?
Comment 12 Urs Wolfer 2008-04-18 20:33:35 UTC
This feature is included in any KDE 4 version of KRDC.
Comment 13 Tristan Miller 2008-10-13 17:36:17 UTC
Can I suggest that this bug be reopened?  I think it's inappropriate to call many of the command-line features of rdesktop "expert options", as some of them, such as console logins and nonstandard ports, are very commonly used in business environments.  Not everyone is familiar with rdesktop's command-line options (heck, I wasn't until I read the man page just now), but nonetheless need their functionality.  Please consider adding GUI elements to manipulate them.  (Keep in mind that many krdc users don't even know how to use the command line!)  If you are worried about bloating the interface, it's easy enough to group the options by tabs (as in nxclient), and/or hide the less frequently used ones behind an "Advanced" button.

IMHO the following rdesktop options *definitely* need to be accessible from the GUI:

-d -- Domain for authentication.  Allow user to specify a domain in a text field.

-0 -- Attach to Windows Server console.  Checkbox.  (Default unchecked)


The following are IMHO not essential, but nonetheless useful for regulating bandwidth usage.  Perhaps they could go in a "Bandwidth" tab.

-m -- Do not send mouse motion events. Checkbox.  (Default unchecked)

-x -- More bandwidth settings.  Should be a slider or drop-down box with options (in order): "modem", "default", "broadband", "lan".

-P -- Persistent bitmap caching.  Checkbox.  (Default unchecked)

-b -- Send screen updates as bitmaps.  Checkbox (default unchecked)

Session options which advanced users will find useful; see nxclient for an example of how to make GUIs for them:

-s -- Start a specific application (text field)

-c -- Working directory (text field)

-r disk -- Redirect disk share (two text fields)

-r printer -- Redirect printer queue (two text fields)

Less frequently used options that some users with older machines may nonetheless still find useful:

-E -- Encryption.  Checkbox (default checked; unchecking triggers the -E option)

-C -- Private colourmap.  Checkbox. (Default unchecked)

-z -- Compression.  Checkbox (default checked)
Comment 14 Urs Wolfer 2008-10-13 22:09:14 UTC
Thanks for the good summary of the options :) I will look into this.
Comment 15 Scott O'Hara 2008-10-14 04:03:45 UTC
*** This bug has been confirmed by popular vote. ***
Comment 16 Brendan Hide 2009-03-02 13:45:17 UTC
Regarding the -r disk option, this parameter can be given more than once, though I don't think there's many people who take advantage of this.

I wrote a rdesktop script a while back (http://dogma.swiftspirit.co.za/archives/11) which has since been replaced by KRDC. Primary point is that I had /media/rd/ and /media/rd/honey mounted as \\tsclient\rd and \\tsclient\honey

Only the honey folder was writable while the rd folder is root:root / 444. I set up a separate script to alert me if the folder's content ever changed. If I actually copied something there, so what. But I found on more than one occasion that a virus or worm had decided to drop its payload into the "honey"pot share. If you ever log onto an infected server, you don't want to automagically infect all your \\tsclient\ shares.

This is one very good use case for multiple -r disk parameters. My current RDP Config's "Extra Options:" settings is set to "-r disk:rd=/media/rd -r disk:honey=/media/rd/honey" for this very reason.
Comment 17 jo 2009-03-14 09:59:26 UTC
Version : KRDC 4.1.3 (Win 2003 TSE)
Identification failed with the commande line -r driver.

The command line -r printer:myprinter="HP DeskJet 895Cxi" works under rdesktop.
Under krdc the driver identification fails while the command line -r printer:myprinter works with the default driver HP Color Laserjet 8500 PS.

En francais dans le texte :
L'identification  échoue avec l'option supplémentaire -r driver.
La ligne de commande -r printer:monimprimante="HP DeskJet 895Cxi" fonctionne sous rdesktop.
Sous krdc l'identification du pilote échoue alors que la ligne de commande -r printer:monimprimante fonctionne avec le pilote par défaut HP Color Laserjet 8500 PS.
Comment 18 Urs Wolfer 2009-03-15 13:28:04 UTC
SVN commit 939617 by uwolfer:

Better way to split additional arguments. Hopyfully fixes comment #17 of bug #103934.
CCBUG:103934

 M  +2 -1      rdpview.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=939617
Comment 19 Urs Wolfer 2009-04-13 13:51:33 UTC
*** Bug 189189 has been marked as a duplicate of this bug. ***
Comment 20 Urs Wolfer 2009-04-29 20:47:54 UTC
SVN commit 961244 by uwolfer:

Add option to do RDP console login.
CCBUG:103934

 M  +3 -0      core/krdc.kcfg  
 M  +13 -3     rdp/rdphostpreferences.cpp  
 M  +5 -3      rdp/rdphostpreferences.h  
 M  +168 -151  rdp/rdppreferences.ui  
 M  +4 -0      rdp/rdpview.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=961244
Comment 21 Pascal d'Hermilly 2014-07-21 07:55:40 UTC
rdesktop is not used in krdc for some time now. Using xfreerdp today.
Closing this bug should be considered, krdc also changed a lot in 9 years.
Comment 22 Brendan Hide 2014-07-22 07:45:47 UTC
(In reply to Pascal d'Hermilly from comment #21)
> rdesktop is not used in krdc for some time now. Using xfreerdp today.
> Closing this bug should be considered, krdc also changed a lot in 9 years.

Does xfreerdp support flags like these and does krdc use them? If this isn't already a duplicate then the bug should be transposed to xfreerdp or duped to a new bug that mentions these same items for xfreerdp.