Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: X2Go dev team <git-admin-P0WSJaAXTow <at> public.gmane.org>
Subject: x2goclient2.git - master (branch) updated: 110bbeba16404474f940ea66658b818dcbea220a
Newsgroups: gmane.linux.terminal-server.x2go.scm
Date: Wednesday 20th March 2013 13:46:27 UTC (over 3 years ago)
The branch, master has been updated
       via  110bbeba16404474f940ea66658b818dcbea220a (commit)
      from  fd0ba68dad5db7ecd7608623c64811ee58d64895 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 110bbeba16404474f940ea66658b818dcbea220a
Author: Oleksandr Shneyder

Date:   Wed Mar 20 14:45:43 2013 +0100

    continue developing

-----------------------------------------------------------------------

Summary of changes:
 messagebox.h         |    1 +
 sessionlistframe.cpp |    1 +
 sessionlistframe.ui  |    2 +-
 sessionselecter.cpp  |   45 +++++++++++++++++++++++++++++++++++----------
 sessionselecter.h    |   13 +++++++++++--
 x2gosession.cpp      |   36 ++++++++++++++++++++++++++++++------
 x2gosession.h        |    1 +
 x2gosessiondata.cpp  |    2 +-
 8 files changed, 81 insertions(+), 20 deletions(-)

The diff of changes is:
diff --git a/messagebox.h b/messagebox.h
index da40703..7348ccf 100644
--- a/messagebox.h
+++ b/messagebox.h
@@ -38,6 +38,7 @@ protected:
     QEventLoop* loop;
 private slots:
     void slotResize(QResizeEvent* event);
+protected slots:
     void slotYesClicked();
     void slotNoClicked();
     void slotOkClicked();
diff --git a/sessionlistframe.cpp b/sessionlistframe.cpp
index 923347a..661b72c 100644
--- a/sessionlistframe.cpp
+++ b/sessionlistframe.cpp
@@ -30,6 +30,7 @@ SessionListFrame::SessionListFrame(QWidget* parent,
Qt::WindowFlags f): QFrame(p
             "border-bottom: 0px transparent;border-right: 0px transparent;
border-left: 0px transparent");
     treeWidget->verticalScrollBar()->setStyleSheet("border-image:
url(:/svg/transparent.svg);border-top: 0px transparent; "
             "border-bottom: 0px transparent;border-right: 0px transparent;
border-left: 0px transparent");
+
     for(int i=0; iheader()->count(); ++i)
        
treeWidget->headerItem()->setBackgroundColor(i,QColor(0xed,0xed,0xed,255));
     checkBox->setChecked(false);
diff --git a/sessionlistframe.ui b/sessionlistframe.ui
index ec14d94..0c38cee 100644
--- a/sessionlistframe.ui
+++ b/sessionlistframe.ui
@@ -68,7 +68,7 @@
       true
      
      
-      false
+      true
      
      
       
diff --git a/sessionselecter.cpp b/sessionselecter.cpp
index 208c20e..d1d6851 100644
--- a/sessionselecter.cpp
+++ b/sessionselecter.cpp
@@ -23,15 +23,19 @@
 
 #include "x2goapplication.h"
 #include "workarea.h"
+#include "profile.h"
+
 #include 
 
-SessionSelecter::SessionSelecter(const QList& sessions)
+SessionSelecter::SessionSelecter(const QList& sessions,
Profile* profile)
 {
+    this->sessions=(QList< X2GoSessionData >*)&sessions;
     pbNo->hide();
     pbYes->setText(tr("Resume selected"));
     pbYes->setEnabled(false);
     pbOk->setText(tr("New session"));
     lPixmap->hide();
+   
lText->setText(""+profile->get_profileName()+"

"+tr("Select X2Go session to resume:")); listFrame=new SessionListFrame(frame); vlDisplayLayout->insertWidget(1,listFrame); foreach (X2GoSessionData data, sessions) @@ -42,36 +46,38 @@ SessionSelecter::SessionSelecter(const QList& sessions) name=X2GoApplication::instance()->getReadableAppName(data.get_command()); if(name.length()<=0) name=data.get_command(); - item->setText(0, name); + item->setText(NAME, name); switch(data.get_sessionType()) { case X2GoSessionData::DESKTOP: - item->setText(1, tr("Desktop")); + item->setText(TYPE, tr("Desktop")); break; case X2GoSessionData::ROOTLESS: - item->setText(1, tr("Single application")); + item->setText(TYPE, tr("Single application")); break; case X2GoSessionData::SHADOW: break; } if(data.get_status()=="S") { - item->setText(2, tr("Suspended")); + item->setText(STATUS, tr("Suspended")); } else { - item->setText(2, tr("Running")); + item->setText(STATUS, tr("Running")); } - item->setText(3,data.get_display()); + item->setText(DISPLAY, data.get_display()); QDateTime dt=QDateTime::fromString(data.get_creationTime(), Qt::ISODate); - item->setText(4,dt.toString(Qt::SystemLocaleShortDate)); - item->setText(5,data.get_clientIp()); - item->setText(6,data.get_sessionId()); + item->setText(CRTIME, dt.toString(Qt::SystemLocaleShortDate)); + item->setText(CLIENT, data.get_clientIp()); + item->setText(ID, data.get_sessionId()); } for(int i=0; itreeWidget->header()->count(); ++i) listFrame->treeWidget->resizeColumnToContents(i); connect(listFrame->treeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(slotEnableButton())); + connect(listFrame->treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), + this, SLOT(slotSessionDoubleClicked(QTreeWidgetItem*,int))); } void SessionSelecter::slotEnableButton() @@ -93,3 +99,22 @@ MessageBox::Buttons SessionSelecter::exec() X2GoApplication::instance()->get_workArea()->setEnabled(false); return (MessageBox::Buttons)loop->exec(); } + +X2GoSessionData* SessionSelecter::getSelectedSession() +{ + if(listFrame->treeWidget->selectedItems().count()<=0) + return 0; + QString id=listFrame->treeWidget->selectedItems()[0]->text(ID); + for(int i=0; icount(); ++i) + { + if((*sessions)[i].get_sessionId()==id) + return &((*sessions)[i]); + } + return 0; +} + + +void SessionSelecter::slotSessionDoubleClicked(QTreeWidgetItem*, int) +{ + slotYesClicked(); +} diff --git a/sessionselecter.h b/sessionselecter.h index 4a333c7..dfb93fd 100644 --- a/sessionselecter.h +++ b/sessionselecter.h @@ -24,18 +24,27 @@ class SessionListFrame;/******************************************************** #include "messagebox.h" #include "x2gosessiondata.h" +#include "x2goapplication.h" + +class Profile; class SessionListFrame; +class QTreeWidgetItem; + class SessionSelecter: public MessageBox { Q_OBJECT public: - SessionSelecter(const QList< X2GoSessionData >& sessions); + enum {NAME, TYPE, STATUS, DISPLAY, CRTIME, CLIENT, ID}; + SessionSelecter(const QList< X2GoSessionData >& sessions, Profile* profile); ~SessionSelecter(); virtual Buttons exec(); + X2GoSessionData* getSelectedSession(); private: SessionListFrame* listFrame; -public slots: + QList< X2GoSessionData >* sessions; +private slots: void slotEnableButton(); + void slotSessionDoubleClicked ( QTreeWidgetItem*, int ); }; #endif // SESSIONSELECTER_H diff --git a/x2gosession.cpp b/x2gosession.cpp index bce8864..e1df84b 100644 --- a/x2gosession.cpp +++ b/x2gosession.cpp @@ -75,7 +75,7 @@ void X2GoSession::startSession() } -void X2GoSession::slotSshConnectionFailed(int, QString) +void X2GoSession::setSessionNotRunning() { status=NOTRUNNING; emit signalStatusChanged(status); @@ -86,6 +86,12 @@ void X2GoSession::slotSshConnectionFailed(int, QString) } } + +void X2GoSession::slotSshConnectionFailed(int, QString) +{ + setSessionNotRunning(); +} + void X2GoSession::slotListSessions(bool success, QString answer, int id) { if(!success) @@ -114,15 +120,33 @@ void X2GoSession::slotListSessions(bool success, QString answer, int id) } } selectSession(sessions); - - } + void X2GoSession::selectSession(const QList& sessions) { - SessionSelecter* sel=new SessionSelecter(sessions); - sel->exec(); + SessionSelecter* sel=new SessionSelecter(sessions, profile); + switch(sel->exec()) + { + case MessageBox::OK: + createNewSession(); + break; + case MessageBox::YES: + if(!sel->getSelectedSession()) + { + qDebug()<<"selected session is NULL, aborting..."; + setSessionNotRunning(); + } + else + { + resumeSession(*(sel->getSelectedSession())); + } + break; + default: + qDebug()<<"canceling session"; + setSessionNotRunning(); + break; + } delete sel; - } diff --git a/x2gosession.h b/x2gosession.h index 81589c0..870073f 100644 --- a/x2gosession.h +++ b/x2gosession.h @@ -41,6 +41,7 @@ public: void startSession(); void resumeSession(const X2GoSessionData& sessionData); void createNewSession(); + void setSessionNotRunning(); private: void selectSession(const QList & sessions); public slots: diff --git a/x2gosessiondata.cpp b/x2gosessiondata.cpp index 164fb5b..2bc3840 100644 --- a/x2gosessiondata.cpp +++ b/x2gosessiondata.cpp @@ -57,7 +57,7 @@ X2GoSessionData X2GoSessionData::getSessionFromString(const QString& string) s.set_sessionId(lst[1]); s.set_display(lst[2]); s.set_server(lst[3]); - s.set_server(lst[4]); + s.set_status(lst[4]); s.set_creationTime(lst[5]); s.set_cookie(lst[6]); s.set_clientIp(lst[7]); hooks/post-receive
 
CD: 3ms