Kaydet (Commit) f03e95da authored tarafından Caolán McNamara's avatar Caolán McNamara

convert biblio choose data source dialog to .ui

Change-Id: Ia94c417be95f5cd8c1d694a61c5004b0e8486416
üst cc74d3ce
......@@ -13,4 +13,8 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/sbibliography,\
extensions/uiconfig/sbibliography/menubar/menubar \
))
$(eval $(call gb_UIConfig_add_uifiles,modules/sbibliography,\
extensions/uiconfig/sbibliography/ui/choosedatasourcedialog \
))
# vim: set noet sw=4 ts=4:
......@@ -62,8 +62,6 @@
#define UID_BIB_FRAME_WINDOW "EXTENSIONS_UID_BIB_FRAME_WINDOW"
#define HID_BIB_DB_GRIDCTRL "EXTENSIONS_HID_BIB_DB_GRIDCTRL"
#define HID_DLG_MAPPING "EXTENSIONS_HID_DLG_MAPPING"
#define HID_DLG_DBCHANGE "EXTENSIONS_HID_DLG_DBCHANGE"
#define HID_SELECTION_TLB "EXTENSIONS_HID_SELECTION_TLB"
#endif // EXTENSIONS_BIBLIOGRAPHY_HRC
......
......@@ -29,7 +29,6 @@
#define RID_BIB_DIALOG (RID_BIB_START)
#define RID_TP_GENERAL (RID_BIB_DIALOG)
#define RID_DLG_MAPPING (RID_BIB_DIALOG + 1)
#define RID_DLG_DBCHANGE (RID_BIB_DIALOG + 2)
//Controls(100)
#define RID_BIB_CONTROLS (RID_BIB_START + 100)
......
......@@ -528,14 +528,8 @@ IMPL_LINK_NOARG(MappingDialog_Impl, OkHdl)
class DBChangeDialog_Impl : public ModalDialog
{
OKButton aOKBT;
CancelButton aCancelBT;
HelpButton aHelpBT;
FixedLine aSelectionGB;
SvTabListBox aSelectionLB;
HeaderBar aSelectionHB;
ListBox* m_pSelectionLB;
DBChangeDialogConfig_Impl aConfig;
OUString aEntryST;
BibDataManager* pDatMan;
......@@ -547,51 +541,33 @@ public:
OUString GetCurrentURL()const;
};
DBChangeDialog_Impl::DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan ) :
ModalDialog(pParent, BibResId(RID_DLG_DBCHANGE) ),
aOKBT(this, BibResId( BT_OK )),
aCancelBT(this, BibResId( BT_CANCEL )),
aHelpBT(this, BibResId( BT_HELP )),
aSelectionGB(this, BibResId( GB_SELECTION )),
aSelectionLB(this, BibResId( LB_SELECTION )),
aSelectionHB(this, BibResId( HB_SELECTION )),
aEntryST(BIB_RESSTR(ST_ENTRY)),
DBChangeDialog_Impl::DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan )
: ModalDialog(pParent, "ChooseDataSourceDialog",
"modules/sbibliography/ui/choosedatasourcedialog.ui")
,
pDatMan(pMan)
{
FreeResource();
aSelectionLB.SetDoubleClickHdl( LINK(this, DBChangeDialog_Impl, DoubleClickHdl));
try
{
::Size aSize = aSelectionHB.GetSizePixel();
long nTabs[2];
nTabs[0] = 1;// Number of Tabs
nTabs[1] = aSize.Width() / 4;
aSelectionHB.SetStyle(aSelectionHB.GetStyle()|WB_STDHEADERBAR);
aSelectionHB.InsertItem( 1, aEntryST, aSize.Width());
aSelectionHB.SetSizePixel(aSelectionHB.CalcWindowSizePixel());
aSelectionHB.Show();
get(m_pSelectionLB, "treeview");
m_pSelectionLB->set_height_request(m_pSelectionLB->GetTextHeight() * 6);
aSelectionLB.SetTabs( &nTabs[0], MAP_PIXEL );
aSelectionLB.SetStyle(aSelectionLB.GetStyle()|WB_CLIPCHILDREN|WB_SORT);
aSelectionLB.GetModel()->SetSortMode(SortAscending);
m_pSelectionLB->SetStyle(m_pSelectionLB->GetStyle() | WB_SORT);
m_pSelectionLB->SetDoubleClickHdl( LINK(this, DBChangeDialog_Impl, DoubleClickHdl));
try
{
OUString sActiveSource = pDatMan->getActiveDataSource();
const Sequence< OUString >& rSources = aConfig.GetDataSourceNames();
const OUString* pSourceNames = rSources.getConstArray();
for(int i = 0; i < rSources.getLength(); i++)
{
SvTreeListEntry* pEntry = aSelectionLB.InsertEntry(pSourceNames[i]);
if(pSourceNames[i] == sActiveSource)
{
aSelectionLB.Select(pEntry);
}
}
aSelectionLB.GetModel()->Resort();
for (sal_Int32 i = 0; i < rSources.getLength(); ++i)
m_pSelectionLB->InsertEntry(pSourceNames[i]);
m_pSelectionLB->SelectEntry(sActiveSource);
}
catch (const Exception&)
catch (const Exception& e)
{
OSL_FAIL("Exception in BibDataManager::DBChangeDialog_Impl::DBChangeDialog_Impl");
SAL_WARN("extensions.biblio",
"Exception in BibDataManager::DBChangeDialog_Impl::DBChangeDialog_Impl "
<< e.Message);
}
}
......@@ -607,13 +583,7 @@ DBChangeDialog_Impl::~DBChangeDialog_Impl()
OUString DBChangeDialog_Impl::GetCurrentURL()const
{
OUString sRet;
SvTreeListEntry* pEntry = aSelectionLB.FirstSelected();
if(pEntry)
{
sRet = aSelectionLB.GetEntryText(pEntry, 0);
}
return sRet;
return m_pSelectionLB->GetSelectEntry();
}
// XDispatchProvider
......
......@@ -87,9 +87,4 @@
#define FT_CUSTOM5 66
#define LB_CUSTOM5 67
#define GB_SELECTION 68
#define ST_ENTRY 69
#define LB_SELECTION 71
#define HB_SELECTION 72
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -425,52 +425,5 @@ ModalDialog RID_DLG_MAPPING
};
Text [ en-US ] = "Column Layout for Table %1";
};
ModalDialog RID_DLG_DBCHANGE
{
HelpID = HID_DLG_DBCHANGE;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 291 , 131 ) ;
Moveable = TRUE ;
Text [ en-US ] = "Choose Data Source";
OKButton BT_OK
{
Pos = MAP_APPFONT ( 238 , 3 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
};
CancelButton BT_CANCEL
{
Pos = MAP_APPFONT ( 238 , 18 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
};
HelpButton BT_HELP
{
Pos = MAP_APPFONT ( 238 , 36 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
};
FixedLine GB_SELECTION
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 229 , 8 ) ;
};
String ST_ENTRY
{
Text [ en-US ] = "Entry";
};
Control LB_SELECTION
{
Pos = MAP_APPFONT ( 9 , 24 ) ;
Size = MAP_APPFONT ( 223 , 100 ) ;
Border = TRUE;
TabStop = TRUE;
HelpId = HID_SELECTION_TLB;
};
Window HB_SELECTION
{
Pos = MAP_APPFONT ( 9 , 12 ) ;
Size = MAP_APPFONT ( 223 , 12 ) ;
Border = TRUE;
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkDialog" id="ChooseDataSourceDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Choose Data Source</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkTreeView" id="treeview:border">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Entry</property>
<attributes>
<attribute name="weight" value="semibold"/>
</attributes>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">ok</action-widget>
<action-widget response="0">cancel</action-widget>
</action-widgets>
</object>
</interface>
......@@ -151,6 +151,7 @@ certain functionality.
@section extensions
@li @c extensions.biblio
@li @c extensions.dbpilots
@li @c extensions.plugin
@li @c extensions.scanner
......
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