dbhub: Add context menu actions to all tree views

This adds context menus and some context menu actions to all the tree
views in the Remote dock. No new features are added. This just adds a
new way to trigger existing features but also establishes a place for
future actions for new features.
This commit is contained in:
Martin Kleusberg
2020-07-23 10:56:07 +02:00
parent 1af81359a9
commit 4c4e55f890
2 changed files with 92 additions and 10 deletions

View File

@@ -126,12 +126,15 @@
<property name="floatable">
<bool>false</bool>
</property>
<addaction name="actionCloneDatabase"/>
<addaction name="actionCloneDatabaseLink"/>
<addaction name="actionRefresh"/>
</widget>
</item>
<item>
<widget class="QTreeView" name="treeRemote">
<property name="contextMenuPolicy">
<enum>Qt::ActionsContextMenu</enum>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In this pane, remote databases from dbhub.io website can be added to DB Browser for SQLite. First you need an identity:&lt;/p&gt;&lt;ol style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Login to the dbhub.io website (use your GitHub credentials or whatever you want)&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Click the button to &amp;quot;Generate client certificate&amp;quot; (that's your identity). That'll give you a certificate file (save it to your local disk).&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Go to the Remote tab in DB Browser for SQLite Preferences. Click the button to add a new certificate to DB Browser for SQLite and choose the just downloaded certificate file.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Now the Remote panel shows your identity and you can add remote databases.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@@ -290,7 +293,11 @@
</layout>
</item>
<item>
<widget class="QTreeView" name="treeDatabaseCommits"/>
<widget class="QTreeView" name="treeDatabaseCommits">
<property name="contextMenuPolicy">
<enum>Qt::ActionsContextMenu</enum>
</property>
</widget>
</item>
</layout>
</widget>
@@ -398,9 +405,6 @@
</item>
</layout>
<action name="actionDeleteDatabase">
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="icons/icons.qrc">
<normaloff>:/icons/close</normaloff>:/icons/close</iconset>
@@ -418,19 +422,19 @@
<normaloff>:/icons/browser_open</normaloff>:/icons/browser_open</iconset>
</property>
<property name="text">
<string>Open in web browser</string>
<string>Open in Web Browser</string>
</property>
<property name="toolTip">
<string>Open the web page for the current database in your browser</string>
</property>
</action>
<action name="actionCloneDatabase">
<action name="actionCloneDatabaseLink">
<property name="icon">
<iconset resource="icons/icons.qrc">
<normaloff>:/icons/clone_database</normaloff>:/icons/clone_database</iconset>
</property>
<property name="text">
<string>Clone from link</string>
<string>Clone from Link</string>
</property>
<property name="toolTip">
<string>Use this to download a remote database for local editing using a URL as provided on the web page of the database.</string>
@@ -451,6 +455,53 @@
<string>F5</string>
</property>
</action>
<action name="actionCloneDatabaseDoubleClick">
<property name="icon">
<iconset resource="icons/icons.qrc">
<normaloff>:/icons/clone_database</normaloff>:/icons/clone_database</iconset>
</property>
<property name="text">
<string>Clone Database</string>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
</action>
<action name="actionOpenLocalDatabase">
<property name="icon">
<iconset resource="icons/icons.qrc">
<normaloff>:/icons/db_open</normaloff>:/icons/db_open</iconset>
</property>
<property name="text">
<string>Open Database</string>
</property>
<property name="toolTip">
<string>Open the local copy of this database</string>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
</action>
<action name="actionFetchCommit">
<property name="text">
<string>Check out Commit</string>
</property>
<property name="toolTip">
<string>Download and open this specific commit</string>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
</action>
</widget>
<tabstops>
<tabstop>comboUser</tabstop>
@@ -547,7 +598,7 @@
</hints>
</connection>
<connection>
<sender>actionCloneDatabase</sender>
<sender>actionCloneDatabaseLink</sender>
<signal>triggered()</signal>
<receiver>RemoteDock</receiver>
<slot>fetchDatabase()</slot>