[Pkg-anonymity-tools] [onionshare] 36/140: beginning Downloads layout

Ulrike Uhlig u-guest at moszumanska.debian.org
Mon Sep 29 20:33:45 UTC 2014


This is an automated email from the git hooks/post-receive script.

u-guest pushed a commit to branch master
in repository onionshare.

commit e7af77b3f71c5887a7964c432bdc646c8957d09e
Author: Micah Lee <micah at micahflee.com>
Date:   Wed Aug 27 16:43:18 2014 -0700

    beginning Downloads layout
---
 onionshare/strings.json          |  3 ++-
 onionshare_gui/downloads.py      | 26 ++++++++++++++++++++++++++
 onionshare_gui/onionshare_gui.py |  5 +++++
 onionshare_gui/server_status.py  | 12 +++++++++++-
 4 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/onionshare/strings.json b/onionshare/strings.json
index 39d1230..5f69691 100644
--- a/onionshare/strings.json
+++ b/onionshare/strings.json
@@ -34,7 +34,8 @@
     "gui_choose_folder": "Choose folder",
     "gui_start_server": "Start Server",
     "gui_stop_server": "Stop Server",
-    "gui_copy_url": "Copy URL"
+    "gui_copy_url": "Copy URL",
+    "gui_downloads": "Downloads:"
 }, "no": {
     "calculating_sha1": "Kalkulerer SHA1 sjekksum.",
     "connecting_ctrlport": "Kobler til Tors kontroll-port for å sette opp en gjemt tjeneste på port {0}.",
diff --git a/onionshare_gui/downloads.py b/onionshare_gui/downloads.py
new file mode 100644
index 0000000..de82a65
--- /dev/null
+++ b/onionshare_gui/downloads.py
@@ -0,0 +1,26 @@
+from PyQt4 import QtCore, QtGui
+
+import common
+from onionshare import strings, helpers
+
+class Downloads(QtGui.QVBoxLayout):
+    def __init__(self):
+        super(Downloads, self).__init__()
+        self.addSpacing(10)
+
+        # downloads label
+        self.downloads_label = QtGui.QLabel(strings._('gui_downloads'))
+        """progress_bar = QtGui.QProgressBar()
+        progress_bar.setFormat("12.3 KiB, 17%")
+        progress_bar.setTextVisible(True)
+        progress_bar.setAlignment(QtCore.Qt.AlignHCenter)
+        progress_bar.setMinimum(0)
+        progress_bar.setMaximum(100)
+        progress_bar.setValue(17)"""
+        # hide downloads by default
+        self.downloads_label.hide()
+
+        # add the widgets
+        self.addWidget(self.downloads_label)
+        #self.addWidget(progress_bar)
+
diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py
index 0352052..1c17828 100644
--- a/onionshare_gui/onionshare_gui.py
+++ b/onionshare_gui/onionshare_gui.py
@@ -13,6 +13,7 @@ from onionshare import strings, helpers, web
 
 from file_selection import FileSelection
 from server_status import ServerStatus
+from downloads import Downloads
 
 class Application(QtGui.QApplication):
     def __init__(self):
@@ -40,10 +41,14 @@ class OnionShareGui(QtGui.QWidget):
         # server status
         server_status = ServerStatus()
 
+        # downloads
+        downloads = Downloads()
+
         # main layout
         self.layout = QtGui.QVBoxLayout()
         self.layout.addLayout(file_selection)
         self.layout.addLayout(server_status)
+        self.layout.addLayout(downloads)
         self.setLayout(self.layout)
         self.show()
 
diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py
index 835cd4c..b9d03dd 100644
--- a/onionshare_gui/server_status.py
+++ b/onionshare_gui/server_status.py
@@ -6,6 +6,7 @@ from onionshare import strings, helpers
 class ServerStatus(QtGui.QVBoxLayout):
     def __init__(self):
         super(ServerStatus, self).__init__()
+        self.addSpacing(10)
 
         # server layout
         self.status_image = QtGui.QImage('{0}/server_stopped.png'.format(common.onionshare_gui_dir))
@@ -22,12 +23,21 @@ class ServerStatus(QtGui.QVBoxLayout):
         server_layout.addWidget(self.stop_server_button)
 
         # url layout
-        self.url_label = QtGui.QLabel('http://mry2aqolyzxwfxpt.onion/x6justoparr5ayreqj6zyf6w2e')
+        url_font = QtGui.QFont()
+        url_font.setPointSize(8)
+        self.url_label = QtGui.QLabel('http://mry2aqolyzxwfxpt.onion/ x6justoparr5ayreqj6zyf6w2e')
+        self.url_label.setFont(url_font)
+        self.url_label.setWordWrap(True)
+        self.url_label.setAlignment(QtCore.Qt.AlignCenter)
+        self.url_label.setMargin(3)
         self.copy_url_button = QtGui.QPushButton(strings._('gui_copy_url'))
         self.copy_url_button.clicked.connect(self.copy_url)
         url_layout = QtGui.QHBoxLayout()
         url_layout.addWidget(self.url_label)
         url_layout.addWidget(self.copy_url_button)
+        # url fields start hidden, until there's a URL
+        self.url_label.hide()
+        self.copy_url_button.hide()
 
         # add the widgets
         self.addLayout(server_layout)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/onionshare.git



More information about the Pkg-anonymity-tools mailing list