Kaydet (Commit) 41102d9f authored tarafından Szymon Kłos's avatar Szymon Kłos

added New Folder button

Change-Id: I4b1ef03e707fdfb3d1968dca9f48c548f872612c
üst 5c2a0cbb
......@@ -183,6 +183,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
get( m_pServices_lb, "services_lb" );
get( m_pFilter_lb, "filter_lb" );
get( m_pName_ed, "name_ed" );
get( m_pNewFolder, "new_folder" );
m_eMode = ( nBits & WB_SAVEAS ) ? REMOTEDLG_MODE_SAVE : REMOTEDLG_MODE_OPEN;
m_eType = ( nBits & WB_PATH ) ? REMOTEDLG_TYPE_PATHDLG : REMOTEDLG_TYPE_FILEDLG;
......@@ -196,10 +197,20 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
m_pName_ed->Enable( false );
if( m_eMode == REMOTEDLG_MODE_OPEN )
{
get( m_pOk_btn, "open" );
m_pNewFolder->Hide();
}
else
{
get( m_pOk_btn, "save" );
m_aImages = ImageList( fpicker::SvtResId( RID_FILEPICKER_IMAGES ) );
m_pNewFolder->SetModeImage( m_aImages.GetImage( IMG_FILEDLG_CREATEFOLDER ) );
m_pNewFolder->SetClickHdl( LINK( this, RemoteFilesDialog, NewFolderHdl ) );
}
m_pOk_btn->Show();
m_pOk_btn->Enable( false );
......@@ -324,6 +335,7 @@ void RemoteFilesDialog::dispose()
m_pServices_lb.clear();
m_pFilter_lb.clear();
m_pName_ed.clear();
m_pNewFolder.clear();
ModalDialog::dispose();
}
......@@ -872,6 +884,34 @@ IMPL_LINK ( RemoteFilesDialog, SelectBreadcrumbHdl, Breadcrumb*, pPtr )
return 1;
}
IMPL_LINK_NOARG ( RemoteFilesDialog, NewFolderHdl )
{
m_pFileView->EndInplaceEditing( false );
SmartContent aContent( m_pFileView->GetViewURL() );
OUString aTitle;
aContent.getTitle( aTitle );
ScopedVclPtrInstance< QueryFolderNameDialog > aDlg( this, aTitle, fpicker::SVT_RESSTR( STR_SVT_NEW_FOLDER ) );
bool bHandled = false;
while( !bHandled )
{
if( aDlg->Execute() == RET_OK )
{
OUString aUrl = aContent.createFolder( aDlg->GetName() );
if( !aUrl.isEmpty() )
{
m_pFileView->CreatedFolder( aUrl, aDlg->GetName() );
bHandled = true;
}
}
else
bHandled = true;
}
return 1;
}
IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
{
// auto extension
......
......@@ -37,6 +37,9 @@
#include "fpdialogbase.hxx"
#include "fpsofficeResMgr.hxx"
#include "OfficeFilePicker.hrc"
#include "QueryFolderName.hxx"
#include "iodlg.hrc"
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
......@@ -141,6 +144,7 @@ private:
VclPtr< MenuButton > m_pAddService_btn;
VclPtr< ListBox > m_pServices_lb;
VclPtr< Breadcrumb > m_pPath;
VclPtr<PushButton> m_pNewFolder;
VclPtr< Splitter > m_pSplitter;
VclPtr< FolderTree > m_pTreeView;
VclPtr< SvtFileView > m_pFileView;
......@@ -149,6 +153,8 @@ private:
VclPtr< Edit > m_pName_ed;
PopupMenu* m_pAddMenu;
ImageList m_aImages;
std::vector< ServicePtr > m_aServices;
std::vector< std::pair< OUString, OUString > > m_aFilters;
......@@ -184,6 +190,8 @@ private:
DECL_LINK( SelectBreadcrumbHdl, Breadcrumb * );
DECL_LINK( NewFolderHdl, void * );
DECL_LINK( OkHdl, void * );
DECL_LINK( CancelHdl, void * );
};
......
......@@ -138,12 +138,44 @@
</packing>
</child>
<child>
<object class="GtkBox" id="breadcrumb_container">
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="spacing">6</property>
<child>
<placeholder/>
<object class="GtkBox" id="breadcrumb_container">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="new_folder">
<property name="use_action_appearance">False</property>
<property name="width_request">25</property>
<property name="height_request">25</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Create New Folder</property>
<property name="tooltip_text" translatable="yes">Create New Folder</property>
<property name="margin_left">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment