[Libreoffice-commits] core.git: dbaccess/inc dbaccess/source dbaccess/uiconfig dbaccess/UIConfig_dbaccess.mk

Caolán McNamara caolanm at redhat.com
Tue Apr 18 10:22:50 UTC 2017


 dbaccess/UIConfig_dbaccess.mk                    |    1 
 dbaccess/inc/dbaccess_helpid.hrc                 |    2 -
 dbaccess/source/ui/inc/browserids.hxx            |    1 
 dbaccess/source/ui/inc/dbu_resource.hrc          |    1 
 dbaccess/source/ui/querydesign/JoinTableView.cxx |   18 +++++++---------
 dbaccess/source/ui/querydesign/query.src         |   19 -----------------
 dbaccess/uiconfig/ui/joinviewmenu.ui             |   25 +++++++++++++++++++++++
 7 files changed, 34 insertions(+), 33 deletions(-)

New commits:
commit a6426327266f1f4c3d7738051a8ce7402368553a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 18 11:21:36 2017 +0100

    convert join menu to .ui
    
    Change-Id: I4e38e431df00a8a97772c5eb0056f824beaf8912

diff --git a/dbaccess/UIConfig_dbaccess.mk b/dbaccess/UIConfig_dbaccess.mk
index 61a49fcb19c6..c324004b06f4 100644
--- a/dbaccess/UIConfig_dbaccess.mk
+++ b/dbaccess/UIConfig_dbaccess.mk
@@ -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/joinviewmenu \
     dbaccess/uiconfig/ui/keymenu \
     dbaccess/uiconfig/ui/ldapconnectionpage \
     dbaccess/uiconfig/ui/ldappage \
diff --git a/dbaccess/inc/dbaccess_helpid.hrc b/dbaccess/inc/dbaccess_helpid.hrc
index 79bb6eafbee9..d8a2b8c61bff 100644
--- a/dbaccess/inc/dbaccess_helpid.hrc
+++ b/dbaccess/inc/dbaccess_helpid.hrc
@@ -84,8 +84,6 @@
 #define HID_DLGINDEX_INDEXDETAILS_FIELD                   "DBACCESS_HID_DLGINDEX_INDEXDETAILS_FIELD"
 #define HID_DLGINDEX_INDEXDETAILS_SORTORDER               "DBACCESS_HID_DLGINDEX_INDEXDETAILS_SORTORDER"
 
-#define HID_QUERY_EDIT_JOINCONNECTION                     "DBACCESS_HID_QUERY_EDIT_JOINCONNECTION"
-
 #define HID_TAB_AUTOINCREMENTVALUE                        "DBACCESS_HID_TAB_AUTOINCREMENTVALUE"
 
 #define HID_DSADMIN_DBASE_PATH                            "DBACCESS_HID_DSADMIN_DBASE_PATH"
diff --git a/dbaccess/source/ui/inc/browserids.hxx b/dbaccess/source/ui/inc/browserids.hxx
index ba3404fd0b76..1777d619d009 100644
--- a/dbaccess/source/ui/inc/browserids.hxx
+++ b/dbaccess/source/ui/inc/browserids.hxx
@@ -99,7 +99,6 @@
 #define ID_QUERY_TABLENAME                  (SID_SBA_START + 42) // show table name
 #define ID_QUERY_ALIASNAME                  (SID_SBA_START + 43) // show alias name
 #define ID_QUERY_DISTINCT                   (SID_SBA_START + 44) // show distinct
-#define ID_QUERY_EDIT_JOINCONNECTION        (SID_SBA_START + 45) // show-edit Join
 #define ID_BROWSER_INSERT_ROW               (SID_SBA_START + 46) // insert row
 #define ID_QUERY_ZOOM_IN                    SID_ZOOM_IN
 #define ID_QUERY_ZOOM_OUT                   SID_ZOOM_OUT
diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc
index 70d00dbd234f..52d6aefd3373 100644
--- a/dbaccess/source/ui/inc/dbu_resource.hrc
+++ b/dbaccess/source/ui/inc/dbu_resource.hrc
@@ -124,7 +124,6 @@
 // menus
 
 #define RID_QUERYFUNCTION_POPUPMENU     RID_MENU_START +  6
-#define RID_MENU_JOINVIEW_CONNECTION    RID_MENU_START + 16
 #define RID_MENU_JOINVIEW_TABLE         RID_MENU_START + 17
 
 // strings
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 0c8fedfc97f9..ff97680c0e89 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -1129,16 +1129,14 @@ bool OJoinTableView::IsAddAllowed()
 
 void OJoinTableView::executePopup(const Point& _aPos, VclPtr<OTableConnection>& rSelConnection)
 {
-    ScopedVclPtrInstance<PopupMenu> aContextMenu( ModuleRes( RID_MENU_JOINVIEW_CONNECTION ) );
-    switch (aContextMenu->Execute(this, _aPos))
-    {
-        case SID_DELETE:
-            RemoveConnection(rSelConnection, true);
-            break;
-        case ID_QUERY_EDIT_JOINCONNECTION:
-            ConnDoubleClicked(rSelConnection); // is the same as double clicked
-            break;
-    }
+    VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "dbaccess/ui/joinviewmenu.ui", "");
+    VclPtr<PopupMenu> aContextMenu(aBuilder.get_menu("menu"));
+    aContextMenu->Execute(this, _aPos);
+    OString sIdent = aContextMenu->GetCurItemIdent();
+    if (sIdent == "delete")
+        RemoveConnection(rSelConnection, true);
+    else if (sIdent == "edit")
+        ConnDoubleClicked(rSelConnection); // is the same as double clicked
 }
 
 void OJoinTableView::Command(const CommandEvent& rEvt)
diff --git a/dbaccess/source/ui/querydesign/query.src b/dbaccess/source/ui/querydesign/query.src
index f84fce531999..e18a19d5936d 100644
--- a/dbaccess/source/ui/querydesign/query.src
+++ b/dbaccess/source/ui/querydesign/query.src
@@ -21,25 +21,6 @@
 #include "browserids.hxx"
 #include "dbaccess_helpid.hrc"
 
-Menu RID_MENU_JOINVIEW_CONNECTION
-{
-    ItemList =
-    {
-        MenuItem
-        {
-            Identifier = SID_DELETE ;
-            Command = ".uno:Delete" ;
-            Text [ en-US ] = "~Delete" ;
-        };
-        MenuItem
-        {
-            Identifier = ID_QUERY_EDIT_JOINCONNECTION;
-            HelpId = HID_QUERY_EDIT_JOINCONNECTION ;
-            Text [ en-US ] = "Edit...";
-        };
-    };
-};
-
 Menu RID_MENU_JOINVIEW_TABLE
 {
     ItemList =
diff --git a/dbaccess/uiconfig/ui/joinviewmenu.ui b/dbaccess/uiconfig/ui/joinviewmenu.ui
new file mode 100644
index 000000000000..6c1e88d76353
--- /dev/null
+++ b/dbaccess/uiconfig/ui/joinviewmenu.ui
@@ -0,0 +1,25 @@
+<?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="GtkMenuItem" id="delete">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Delete</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="edit">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Edit...</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list