convert primary key menu to .ui

Change-Id: I78b4f6edc33ddc908402d8ab952bfebc11e4f929
This commit is contained in:
Caolán McNamara 2017-04-18 10:52:22 +01:00
parent 2f30782b03
commit 1660bdd08b
7 changed files with 34 additions and 37 deletions

View file

@ -41,6 +41,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
dbaccess/uiconfig/ui/indexdesigndialog \
dbaccess/uiconfig/ui/jdbcconnectionpage \
dbaccess/uiconfig/ui/joindialog \
dbaccess/uiconfig/ui/keymenu \
dbaccess/uiconfig/ui/ldapconnectionpage \
dbaccess/uiconfig/ui/ldappage \
dbaccess/uiconfig/ui/migratepage \

View file

@ -58,7 +58,6 @@
#define HID_TABDESIGN_NAMECELL "DBACCESS_HID_TABDESIGN_NAMECELL"
#define HID_TABDESIGN_TYPECELL "DBACCESS_HID_TABDESIGN_TYPECELL"
#define HID_TABDESIGN_COMMENTCELL "DBACCESS_HID_TABDESIGN_COMMENTCELL"
#define HID_TABLEDESIGN_TABED_PRIMARYKEY "DBACCESS_HID_TABLEDESIGN_TABED_PRIMARYKEY"
#define HID_TAB_DESIGN_HELP_TEXT_FRAME "DBACCESS_HID_TAB_DESIGN_HELP_TEXT_FRAME"
#define HID_TABLE_DESIGN_TABPAGE_GENERAL "DBACCESS_HID_TABLE_DESIGN_TABPAGE_GENERAL"
#define HID_TAB_ENT_DEFAULT "DBACCESS_HID_TAB_ENT_DEFAULT"

View file

@ -99,10 +99,8 @@
#define SID_APP_NEW_REPORT ( SID_DBACCESS_START + 65 )
#define SID_DB_APP_EDIT_SQL_VIEW ( SID_DBACCESS_START + 66 )
#define SID_TABLEDESIGN_TABED_PRIMARYKEY ( SID_DBACCESS_START + 67 )
//FREE
//FREE
#define SID_QUERY_PROP_DLG ( SID_DBACCESS_START + 69 )
#endif

View file

@ -124,7 +124,6 @@
// menus
#define RID_QUERYFUNCTION_POPUPMENU RID_MENU_START + 6
#define RID_SBA_RTF_PKEYPOPUP RID_MENU_START + 9
#define RID_MENU_JOINVIEW_CONNECTION RID_MENU_START + 16
#define RID_MENU_JOINVIEW_TABLE RID_MENU_START + 17

View file

@ -434,7 +434,8 @@ bool OWizTypeSelectList::PreNotify( NotifyEvent& rEvt )
if (pComEvt->IsMouseEvent())
ptWhere = pComEvt->GetMousePosPixel();
ScopedVclPtrInstance<PopupMenu> aContextMenu(ModuleRes(RID_SBA_RTF_PKEYPOPUP));
VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "dbaccess/ui/keymenu.ui", "");
VclPtr<PopupMenu> aContextMenu(aBuilder.get_menu("menu"));
// Should primary key checkbox be checked?
const sal_Int32 nCount = GetEntryCount();
bool bCheckOk = false;
@ -454,31 +455,27 @@ bool OWizTypeSelectList::PreNotify( NotifyEvent& rEvt )
}
if (bCheckOk)
aContextMenu->CheckItem( SID_TABLEDESIGN_TABED_PRIMARYKEY );
aContextMenu->CheckItem(aContextMenu->GetItemId("primarykey"));
switch( aContextMenu->Execute( this, ptWhere ) )
if (aContextMenu->Execute(this, ptWhere))
{
case SID_TABLEDESIGN_TABED_PRIMARYKEY:
for (sal_Int32 j = 0 ; j < nCount ; ++j)
{
for(sal_Int32 j = 0 ; j < nCount ; ++j)
OFieldDescription* pFieldDescr = static_cast<OFieldDescription*>(GetEntryData(j));
if( pFieldDescr )
{
OFieldDescription* pFieldDescr = static_cast<OFieldDescription*>(GetEntryData(j));
if( pFieldDescr )
if(!bCheckOk && IsEntryPosSelected(j))
{
if(!bCheckOk && IsEntryPosSelected(j))
{
setPrimaryKey(pFieldDescr,j,true);
SelectEntryPos(j);
}
else
{
setPrimaryKey(pFieldDescr,j);
}
setPrimaryKey(pFieldDescr,j,true);
SelectEntryPos(j);
}
else
{
setPrimaryKey(pFieldDescr,j);
}
}
GetSelectHdl().Call(*this);
}
break;
GetSelectHdl().Call(*this);
}
bDone = true;
}

View file

@ -56,20 +56,6 @@ String STR_WIZ_PB_OK
Text [ en-US ] = "C~reate";
};
Menu RID_SBA_RTF_PKEYPOPUP
{
ItemList =
{
MenuItem
{
Identifier = SID_TABLEDESIGN_TABED_PRIMARYKEY ;
HelpID = HID_TABLEDESIGN_TABED_PRIMARYKEY ;
Checkable = TRUE ;
Text [ en-US ] = "Primary Key" ;
};
};
};
Bitmap BMP_UP
{
File = "sortup.png" ;

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.10"/>
<object class="GtkMenu" id="menu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckMenuItem" id="primarykey">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Primary Key</property>
<property name="use_underline">True</property>
</object>
</child>
</object>
</interface>