diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2015-06-22 10:31:06 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2015-07-16 09:53:01 +0200 |
commit | 1c79b6b2fb74d85a53a0724c6eddb7ff6b44943b (patch) | |
tree | 4d7853e84c283363940f3921398c2da739a7aee1 | |
parent | 4d39eeaf632b4840ea2998aaba94e5448402536e (diff) |
RemoteFilesDialog: service type before the name
Change-Id: If89178e13abe7aaae06f03eb3bdd96f4d37d73db
-rw-r--r-- | svtools/source/dialogs/RemoteFilesDialog.cxx | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/svtools/source/dialogs/RemoteFilesDialog.cxx b/svtools/source/dialogs/RemoteFilesDialog.cxx index 594f1b1f137c..9ec4883e1efd 100644 --- a/svtools/source/dialogs/RemoteFilesDialog.cxx +++ b/svtools/source/dialogs/RemoteFilesDialog.cxx @@ -276,6 +276,30 @@ void RemoteFilesDialog::Resize() } } +OUString lcl_GetServiceType(ServicePtr pService) +{ + INetProtocol aProtocol = pService->GetUrlObject().GetProtocol(); + switch(aProtocol) + { + case INetProtocol::Ftp: + return OUString("FTP"); + case INetProtocol::Cmis: + return OUString("CMIS"); + case INetProtocol::Smb: + return OUString("Windows Share"); + case INetProtocol::File: + return OUString("SSH"); + case INetProtocol::Http: + return OUString("WebDAV"); + case INetProtocol::Https: + return OUString("WebDAV"); + case INetProtocol::Generic: + return OUString("SSH"); + default: + return OUString(""); + } +} + void RemoteFilesDialog::FillServicesListbox() { m_pServices_lb->Clear(); @@ -293,7 +317,12 @@ void RemoteFilesDialog::FillServicesListbox() // Add to the listbox only remote services, not local bookmarks if(!pService->IsLocal()) { - m_pServices_lb->InsertEntry(placesNamesList[nPlace]); + OUString sPrefix = lcl_GetServiceType(pService); + + if(!sPrefix.isEmpty()) + sPrefix += ": "; + + m_pServices_lb->InsertEntry(sPrefix + placesNamesList[nPlace]); } } @@ -441,7 +470,13 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl ) ServicePtr newService = aDlg->GetPlace(); m_aServices.push_back(newService); m_pServices_lb->Enable(true); - m_pServices_lb->InsertEntry(newService->GetName()); + + OUString sPrefix = lcl_GetServiceType(newService); + + if(!sPrefix.isEmpty()) + sPrefix += ": "; + + m_pServices_lb->InsertEntry(sPrefix + newService->GetName()); m_pServices_lb->SelectEntryPos(m_pServices_lb->GetEntryCount() - 1); m_bIsUpdated = true; |