Received: (at submit) by bugs.x2go.org; 6 Dec 2012 22:48:10 +0000
Received: from mail-ea0-f179.google.com (mail-ea0-f179.google.com [209.85.215.179])
	by ymir (Postfix) with ESMTPS id 6FF9D3BC43
	for <submit@bugs.x2go.org>; Thu,  6 Dec 2012 23:48:10 +0100 (CET)
Received: by mail-ea0-f179.google.com with SMTP id i12so2921295eaa.24
        for <submit@bugs.x2go.org>; Thu, 06 Dec 2012 14:48:10 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=from:content-type:subject:message-id:date:to:mime-version:x-mailer
         :x-gm-message-state;
        bh=/Q5wmVrmHD/6umO38aAPKNdPzkkvDpUZtrdYt4oJqO8=;
        b=e4evFgLUqlyzjgpta3J6k6KZ3S5Nkq1/772T6uQW2lm62vH33PvDaYG2Eas9qi3F/i
         y/0/MhjAe7AaKTcJgmUQbl9S2upZwK1yhNc2AVNmII8M9/7uKpVFNrBZv8RPY7W+f30E
         hrThY7cO+EkfJCN23nbqHN5wCNIWmwhoQa3o3z6nh5ZVXXR3woC3LpirZbhfZ8PhcpW9
         GFaRsDRbx0yv0ZFqXk9NF00mzdWJJCaecvGmf3vJ444xg1o10gtYc4XLgfFh3WQPLMPi
         BdT2hDSbUxOHCcPz9HH70ir5Mas7bVdEG5er49nkSrqDs9TNHxC8jx3Y/kpuiAxNeexg
         BqrA==
Received: by 10.14.174.198 with SMTP id x46mr9683713eel.23.1354834090070;
        Thu, 06 Dec 2012 14:48:10 -0800 (PST)
Received: from [10.0.0.4] (46-127-89-101.dynamic.hispeed.ch. [46.127.89.101])
        by mx.google.com with ESMTPS id b49sm18766988eem.16.2012.12.06.14.48.08
        (version=TLSv1/SSLv3 cipher=OTHER);
        Thu, 06 Dec 2012 14:48:08 -0800 (PST)
From: =?iso-8859-1?Q?Ezra_B=FChler?= <me@easyb.ch>
Content-Type: multipart/mixed; boundary="Apple-Mail=_1D101142-98A0-4DEA-8E06-BE0EDC329C0D"
Subject: [PATCH] Improve resume session dialog
Message-Id: <786AF653-7FF6-4FB6-B613-4A31467F50F6@easyb.ch>
Date: Thu, 6 Dec 2012 23:48:07 +0100
To: submit@bugs.x2go.org
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQnE7xglEVxLHeQ7WjkGh5hR1gSevC1KTgcW2VTv82bM1tgjEuORZuM59NXBIDd+GhdffVck


--Apple-Mail=_1D101142-98A0-4DEA-8E06-BE0EDC329C0D
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii

Package: x2goclient
Version: HEAD

--Apple-Mail=_1D101142-98A0-4DEA-8E06-BE0EDC329C0D
Content-Disposition: attachment;
	filename=0001-Improve-resume-session-dialog.patch
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="0001-Improve-resume-session-dialog.patch"
Content-Transfer-Encoding: quoted-printable

From 623b6f8f4f3a30cd1608dab9fecb5eb0fb808dd7 Mon Sep 17 00:00:00 2001=0A=
From: Ezra Buehler <spam@easyb.ch>=0A=
Date: Thu, 6 Dec 2012 20:57:20 +0000=0A=
Subject: [PATCH] Improve resume session dialog=0A=
To: patches@x2go.org=0A=
=0A=
Makes it possible to resume a session using the keyboard only.=0A=
Also fixes the tab order in the resume session dialog by=0A=
changing the focus policy of the main window.=0A=
=0A=
Signed-off-by: Ezra Buehler <spam@easyb.ch>=0A=
---=0A=
 onmainwindow.cpp | 12 +++++++-----=0A=
 onmainwindow.h   | 24 ++++++++++++++++++++++--=0A=
 2 files changed, 29 insertions(+), 7 deletions(-)=0A=
=0A=
diff --git a/onmainwindow.cpp b/onmainwindow.cpp=0A=
index 76f8ba9..f5b1a91 100644=0A=
--- a/onmainwindow.cpp=0A=
+++ b/onmainwindow.cpp=0A=
@@ -51,7 +51,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWind=
ow ( parent )=0A=
     image=3Dshape=3D0;=0A=
 #endif=0A=
     x2goDebug<<"ONMainWindow constructor"<<endl;=0A=
-    setFocusPolicy ( Qt::StrongFocus );=0A=
+    setFocusPolicy ( Qt::NoFocus );=0A=
     installTranslator();=0A=
     cleanAllFiles=3Dfalse;=0A=
     drawMenu=3Dtrue;=0A=
@@ -4177,6 +4177,9 @@ void ONMainWindow::selectSession ( QStringList& sessi=
ons )=0A=
         desktopFilter->setFocus();=0A=
         desktopFilter->selectAll();=0A=
     }=0A=
+=0A=
+    sessTv->setCurrentIndex ( sessTv->model()->index ( 0, 0 ) );=0A=
+    sessTv->setFocus();=0A=
     selectSessionDlg->show();=0A=
 }=0A=
=20=0A=
@@ -10411,7 +10414,7 @@ void ONMainWindow::initSelectSessDlg()=0A=
     selectSessionDlg->setEnabled ( true );=0A=
     setEnabled ( true );=0A=
=20=0A=
-    sessTv=3Dnew QTreeView ( selectSessionDlg );=0A=
+    sessTv=3Dnew SessTreeView ( selectSessionDlg );=0A=
     setWidgetStyle ( sessTv );=0A=
     setWidgetStyle ( sessTv->horizontalScrollBar() );=0A=
     setWidgetStyle ( sessTv->verticalScrollBar() );=0A=
@@ -10518,10 +10521,9 @@ void ONMainWindow::initSelectSessDlg()=0A=
     bSusp->hide();=0A=
     bTerm->hide();=0A=
=20=0A=
-    connect ( sessTv,SIGNAL ( clicked ( const QModelIndex& ) ),=0A=
+    connect ( sessTv,SIGNAL ( selected ( const QModelIndex& ) ),=0A=
               this,SLOT ( slotActivated ( const QModelIndex& ) ) );=0A=
-=0A=
-    connect ( sessTv,SIGNAL ( doubleClicked ( const QModelIndex& ) ),=0A=
+    connect ( sessTv,SIGNAL ( activated ( const QModelIndex& ) ),=0A=
               this,SLOT ( slotResumeDoubleClick ( const QModelIndex& ) ) )=
;=0A=
=20=0A=
     connect ( sOk,SIGNAL ( clicked() ),this, SLOT ( slotResumeSess() ) );=
=0A=
diff --git a/onmainwindow.h b/onmainwindow.h=0A=
index 7c1b2a5..550aa12 100644=0A=
--- a/onmainwindow.h=0A=
+++ b/onmainwindow.h=0A=
@@ -40,6 +40,7 @@=0A=
 #include <QPushButton>=0A=
 #include <QPixmap>=0A=
 #include <QProcess>=0A=
+#include <QTreeView>=0A=
 #include "LDAPSession.h"=0A=
 #include <QToolBar>=0A=
 #include <QSystemTrayIcon>=0A=
@@ -73,7 +74,6 @@ class SVGFrame;=0A=
 class SessionButton;=0A=
 class QAction;=0A=
 class QCheckBox;=0A=
-class QTreeView;=0A=
 class QModelIndex;=0A=
 class SshMasterConnection;=0A=
 class IMGFrame;=0A=
@@ -247,6 +247,26 @@ private:=0A=
     ONMainWindow* parent;=0A=
 };=0A=
 #endif=0A=
+=0A=
+=0A=
+class SessTreeView : public QTreeView=0A=
+{=0A=
+    Q_OBJECT=0A=
+=0A=
+public:=0A=
+    SessTreeView ( QWidget* parent =3D 0 ) : QTreeView ( parent ) {}=0A=
+=0A=
+    virtual void selectionChanged ( const QItemSelection& selected,=0A=
+                                    const QItemSelection& deselected ) {=
=0A=
+        emit this->selected ( currentIndex() );=0A=
+        QTreeView::selectionChanged ( selected, deselected );=0A=
+    }=0A=
+=0A=
+Q_SIGNALS:=0A=
+    void selected ( const QModelIndex& index );=0A=
+};=0A=
+=0A=
+=0A=
 class ClickLineEdit;=0A=
 class ONMainWindow : public QMainWindow=0A=
 #ifdef CFGPLUGIN=0A=
@@ -580,7 +600,7 @@ private:=0A=
=20=0A=
=20=0A=
     QLabel* selectSessionLabel;=0A=
-    QTreeView* sessTv;=0A=
+    SessTreeView* sessTv;=0A=
=20=0A=
     QLineEdit* desktopFilter;=0A=
     QCheckBox* desktopFilterCb;=0A=
--=20=0A=
1.8.0=0A=
=0A=

--Apple-Mail=_1D101142-98A0-4DEA-8E06-BE0EDC329C0D--
