summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2015-07-24 09:39:09 +0200
committerSzymon Kłos <eszkadev@gmail.com>2015-07-24 12:29:11 +0200
commit2c6ffb2c758f70e7259f8285703c22d32f47f7ab (patch)
tree51e26718297bc1e4873c422f005ea9d95ddda67b /fpicker
parent5ea686c41b16c0a44c787d9361ee680e16f7ac2f (diff)
don't show edit/delete menu when there is no service
Change-Id: Ia53c9e3f6a4bcaab5e68fbbff6d2ec8cfe5cd702
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/office/RemoteFilesDialog.cxx7
-rw-r--r--fpicker/source/office/RemoteFilesDialog.hxx1
2 files changed, 8 insertions, 0 deletions
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index ab11f2f85119..a810ff8312cc 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -176,6 +176,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
, m_pSplitter( NULL )
, m_pFileView( NULL )
, m_pContainer( NULL )
+ , m_pAddMenu( NULL )
{
get( m_pCancel_btn, "cancel" );
get( m_pAddService_btn, "add_service_btn" );
@@ -252,6 +253,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
m_pName_ed->SetModifyHdl( LINK( this, RemoteFilesDialog, FileNameModifyHdl ) );
m_pAddService_btn->SetMenuMode( MENUBUTTON_MENUMODE_TIMED );
+ m_pAddMenu = m_pAddService_btn->GetPopupMenu();
m_pAddService_btn->SetClickHdl( LINK( this, RemoteFilesDialog, AddServiceHdl ) );
m_pAddService_btn->SetSelectHdl( LINK( this, RemoteFilesDialog, EditServiceMenuHdl ) );
@@ -413,7 +415,10 @@ void RemoteFilesDialog::FillServicesListbox()
if( m_pServices_lb->GetEntryCount() > 0 )
{
m_pServices_lb->SelectEntryPos( nPos );
+ m_pAddService_btn->SetPopupMenu( m_pAddMenu );
}
+ else
+ m_pAddService_btn->SetPopupMenu( NULL );
EnableControls();
}
@@ -588,6 +593,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl )
m_pServices_lb->InsertEntry( sPrefix + newService->GetName() );
m_pServices_lb->SelectEntryPos( m_pServices_lb->GetEntryCount() - 1 );
+ m_pAddService_btn->SetPopupMenu( m_pAddMenu );
SelectServiceHdl( NULL );
m_bIsUpdated = true;
@@ -682,6 +688,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
else
{
m_pServices_lb->SetNoSelection();
+ m_pAddService_btn->SetPopupMenu( NULL );
}
m_bIsUpdated = true;
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index a62b4cf447f5..63fbd94ba090 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -144,6 +144,7 @@ private:
VclPtr< FileViewContainer > m_pContainer;
VclPtr< ListBox > m_pFilter_lb;
VclPtr< Edit > m_pName_ed;
+ PopupMenu* m_pAddMenu;
std::vector< ServicePtr > m_aServices;
std::vector< std::pair< OUString, OUString > > m_aFilters;