diff --git a/onionshare/strings.json b/onionshare/strings.json index 39d12308..5f696914 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 00000000..de82a657 --- /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 0352052e..1c17828c 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 835cd4c1..b9d03dd1 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)