dbhub: Add view of all checked out databases

The Remote dock shows a list of all databases on dbhub.io. Double
clicking a database downloads and opens it. If the database has already
been downloaded before, the local file is simply opened. This only works
for a small number of databases: To open the database you want, you just
search for it and double click it. But for a larger number of databases
on dbhub.io this does not perform very well since finding a database can
be very difficult. Because of this this commit adds a new view which
shows all checked out databases, i.e. those databases which are already
downloaded. Double clicking one of these opens it without trying to
update it first.

In the future this might also provide a place to add extra options like
deleting local copies.
This commit is contained in:
Martin Kleusberg
2020-07-10 18:19:43 +02:00
parent 910ca3d2b9
commit c776af9880
10 changed files with 386 additions and 17 deletions

View File

@@ -97,10 +97,34 @@
</layout>
</item>
<item>
<widget class="QTreeView" name="treeStructure">
<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>
<widget class="QTabWidget" name="tabs">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tabRemote">
<attribute name="title">
<string>DBHub.io</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QTreeView" name="treeRemote">
<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>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabLocal">
<attribute name="title">
<string>Local</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QTreeView" name="treeLocal"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
@@ -213,8 +237,8 @@
<slot>setNewIdentity(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>551</x>
<y>22</y>
<x>134</x>
<y>25</y>
</hint>
<hint type="destinationlabel">
<x>419</x>
@@ -223,7 +247,7 @@
</hints>
</connection>
<connection>
<sender>treeStructure</sender>
<sender>treeRemote</sender>
<signal>doubleClicked(QModelIndex)</signal>
<receiver>RemoteDock</receiver>
<slot>fetchDatabase(QModelIndex)</slot>
@@ -245,8 +269,8 @@
<slot>pushDatabase()</slot>
<hints>
<hint type="sourcelabel">
<x>551</x>
<y>22</y>
<x>530</x>
<y>25</y>
</hint>
<hint type="destinationlabel">
<x>287</x>
@@ -261,8 +285,24 @@
<slot>switchToMainView()</slot>
<hints>
<hint type="sourcelabel">
<x>93</x>
<y>23</y>
</hint>
<hint type="destinationlabel">
<x>266</x>
<y>217</y>
<y>148</y>
</hint>
</hints>
</connection>
<connection>
<sender>treeLocal</sender>
<signal>doubleClicked(QModelIndex)</signal>
<receiver>RemoteDock</receiver>
<slot>openLocalFile(QModelIndex)</slot>
<hints>
<hint type="sourcelabel">
<x>266</x>
<y>179</y>
</hint>
<hint type="destinationlabel">
<x>266</x>
@@ -276,5 +316,6 @@
<slot>fetchDatabase(QModelIndex)</slot>
<slot>pushDatabase()</slot>
<slot>switchToMainView()</slot>
<slot>openLocalFile(QModelIndex)</slot>
</slots>
</ui>