From e2a7d959a63a1ec8f6e77e4005b4f6ad88439885 Mon Sep 17 00:00:00 2001 From: stefan <stefan@5a81b35b-ba03-0410-adc8-b2c5c5119f08> Date: Fri, 16 Apr 2010 09:33:22 +0000 Subject: [PATCH] RemoteLoader: - Loading selection (for example: 1dng[rname=LYS]) git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2028 5a81b35b-ba03-0410-adc8-b2c5c5119f08 --- modules/gui/src/remote_loader.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/gui/src/remote_loader.cc b/modules/gui/src/remote_loader.cc index cb5ac4f68..559a1c670 100644 --- a/modules/gui/src/remote_loader.cc +++ b/modules/gui/src/remote_loader.cc @@ -18,6 +18,7 @@ //------------------------------------------------------------------------------ #include <vector> +#include <QString> #include <QSettings> #include <QNetworkReply> #include <QHBoxLayout> @@ -139,7 +140,20 @@ void RemoteLoader::Clicked() this->BuildMenu(); if(!line_edit_->text().isEmpty() && site_actions_->checkedAction()){ RemoteSiteLoader* loader = FileLoader::GetLoaderManager()->GetRemoteSiteLoader(site_actions_->checkedAction()->text()); - QNetworkReply* network_reply = loader->ById(line_edit_->text()); + + QString text = line_edit_->text(); + QString id = text; + QString selection = ""; + int pos = text.indexOf('['); + if(pos >= 0){ + id = text.left(pos); + selection = text.right(text.size()-(pos+1)); + pos = selection.lastIndexOf(']'); + if(pos>=0){ + selection = selection.left(pos); + } + } + QNetworkReply* network_reply = loader->ById(id,selection); if(network_reply){ progress_bar_->reset(); connect(network_reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(UpdateProgress(qint64,qint64))); -- GitLab