[Libreoffice-commits] core.git: Branch 'feature/gsoc15-open-remote-files-dialog' - fpicker/source include/vcl

Szymon Kłos eszkadev at gmail.com
Thu Jul 16 23:48:01 PDT 2015


 fpicker/source/office/RemoteFilesDialog.cxx |   29 ++++++++++++++++------------
 fpicker/source/office/iodlg.src             |    5 ++++
 include/vcl/fpicker.hrc                     |    1 
 3 files changed, 23 insertions(+), 12 deletions(-)

New commits:
commit d001d8ac4086cc98d27771ec5dba83e1852cfbc0
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 17 08:46:31 2015 +0200

    question if delete the service
    
    Change-Id: I49e5a93ba1d58b898ec1c7b9a4682c9e86302bd0

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 716c229..da25b9d 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -579,21 +579,26 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
 
         if( nPos >= 0 )
         {
-            // TODO: Confirm dialog
-
-            m_aServices.erase( m_aServices.begin() + nPos );
-            m_pServices_lb->RemoveEntry( nSelected );
+            OUString sMsg = ResId( STR_SVT_DELETESERVICE, *ResMgrHolder::getOrCreate() );
+            sMsg = sMsg.replaceFirst( "$servicename$", m_pServices_lb->GetSelectEntry() );
+            ScopedVclPtrInstance< MessageDialog > aBox( this, sMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO );
 
-            if( m_pServices_lb->GetEntryCount() > 0 )
+            if( aBox->Execute() == RET_YES )
             {
-                m_pServices_lb->SelectEntryPos( 0 );
-            }
-            else
-            {
-                m_pServices_lb->SetNoSelection();
-            }
+                m_aServices.erase( m_aServices.begin() + nPos );
+                m_pServices_lb->RemoveEntry( nSelected );
 
-            m_bIsUpdated = true;
+                if( m_pServices_lb->GetEntryCount() > 0 )
+                {
+                    m_pServices_lb->SelectEntryPos( 0 );
+                }
+                else
+                {
+                    m_pServices_lb->SetNoSelection();
+                }
+
+                m_bIsUpdated = true;
+            }
         }
     }
 
diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src
index e09fe0b..bc43b98 100644
--- a/fpicker/source/office/iodlg.src
+++ b/fpicker/source/office/iodlg.src
@@ -105,6 +105,11 @@ String STR_SVT_ALREADYEXISTOVERWRITE
     Text [ en-US ] = "A file named \"$filename$\" already exists.\n\nDo you want to replace it?" ;
 };
 
+String STR_SVT_DELETESERVICE
+{
+    Text [ en-US ] = "Are you sure you want to delete the service?\n\"$servicename$\"" ;
+};
+
 String STR_SVT_NEW_FOLDER
 {
     Text [ en-US ] = "Folder" ;
diff --git a/include/vcl/fpicker.hrc b/include/vcl/fpicker.hrc
index 387b389..7d4bd16 100644
--- a/include/vcl/fpicker.hrc
+++ b/include/vcl/fpicker.hrc
@@ -27,6 +27,7 @@
 #define STR_SVT_FOLDERPICKER_DEFAULT_TITLE          (STR_SVT_FILEPICKER_START+12)
 #define STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION    (STR_SVT_FILEPICKER_START+13)
 #define STR_SVT_ALREADYEXISTOVERWRITE               (STR_SVT_FILEPICKER_START+14)
+#define STR_SVT_DELETESERVICE                       (STR_SVT_FILEPICKER_START+15)
 
 #endif
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list