From 8433b869c86fe6cc153ce410a1946d97d509b85f Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 10 Aug 2014 12:59:41 -0700 Subject: Clean up help dialog text. --- src/leap/bitmask/gui/mainwindow.py | 48 +++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 16 deletions(-) (limited to 'src/leap/bitmask') diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 02488af1..3f74feb5 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -1073,22 +1073,38 @@ class MainWindow(QtGui.QMainWindow): # TODO: don't hardcode! smtp_port = 2013 - url = ("bitmask addon") - - msg = self.tr( - "Instructions to use mail:
" - "If you use Thunderbird you can use the Bitmask extension helper. " - "Search for 'Bitmask' in the add-on manager or download it " - "from: {0}.

" - "You can configure Bitmask manually with these options:
" - "" - " Incoming -> IMAP, port: {1}
" - " Outgoing -> SMTP, port: {2}
" - " Username -> your bitmask username.
" - " Password -> does not matter, use any text. " - " Just don't leave it empty and don't use your account's password." - "
").format(url, IMAP_PORT, smtp_port) + help_url = "

{0}

".format( + self.tr("bitmask.net/help")) + + lang = QtCore.QLocale.system().name().replace('_','-') + thunderbird_extension_url = \ + "https://addons.mozilla.org/{0}/" \ + "thunderbird/addon/bitmask/".format(lang) + + email_quick_reference = self.tr("Email quick reference") + thunderbird_text = self.tr("For Thunderbird, you can use the " + "Bitmask extension. Search for \"Bitmask\" in the add-on " + "manager or download it from " + "addons.mozilla.org.".format(thunderbird_extension_url)) + manual_text = self.tr("Alternately, you can manually configure " + "your mail client to use Bitmask Email with these options:") + manual_imap = self.tr("IMAP: localhost, port {0}".format(IMAP_PORT)) + manual_smtp = self.tr("SMTP: localhost, port {0}".format(smtp_port)) + manual_username = self.tr("Username: your full email address") + manual_password = self.tr("Password: any non-empty text") + + msg = help_url + self.tr( + "

{0}

" + "

{1}

" + "

{2}" + "

").format(email_quick_reference, thunderbird_text, + manual_text, manual_imap, manual_smtp, + manual_username, manual_password) QtGui.QMessageBox.about(self, self.tr("Bitmask Help"), msg) def _needs_update(self): -- cgit v1.2.3 From a54a4bcd1aac5d42953f5f7f152080a391cbf643 Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 10 Aug 2014 13:06:37 -0700 Subject: remove "Hide Main Window" -- much better UX, less buggy, and makes it possible raise window when it is obscured. To hide, just close window. --- src/leap/bitmask/gui/mainwindow.py | 79 +++++++++++++------------------------- 1 file changed, 26 insertions(+), 53 deletions(-) (limited to 'src/leap/bitmask') diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 3f74feb5..c11cff9f 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -237,8 +237,8 @@ class MainWindow(QtGui.QMainWindow): self._action_eip_startstop = QtGui.QAction("", self) self._eip_status.set_action_eip_startstop(self._action_eip_startstop) - self._action_visible = QtGui.QAction(self.tr("Hide Main Window"), self) - self._action_visible.triggered.connect(self._toggle_visible) + self._action_visible = QtGui.QAction(self.tr("Show Main Window"), self) + self._action_visible.triggered.connect(self._ensure_visible) # disable buttons for now, may come back later. # self.ui.btnPreferences.clicked.connect(self._show_preferences) @@ -957,8 +957,6 @@ class MainWindow(QtGui.QMainWindow): Display the context menu from the tray icon """ - self._update_hideshow_menu() - context_menu = self._systray.contextMenu() if not IS_MAC: # for some reason, context_menu.show() @@ -967,50 +965,38 @@ class MainWindow(QtGui.QMainWindow): # this works however. context_menu.exec_(self._systray.geometry().center()) - def _update_hideshow_menu(self): - """ - Update the Hide/Show main window menu text based on the - visibility of the window. + @QtCore.Slot() + def _ensure_visible(self): """ - get_action = lambda visible: ( - self.tr("Show Main Window"), - self.tr("Hide Main Window"))[int(visible)] + TRIGGERS: + self._action_visible.triggered - # set labels - visible = self.isVisible() and self.isActiveWindow() - self._action_visible.setText(get_action(visible)) + Ensure that the window is visible and raised. + """ + QtGui.QApplication.setQuitOnLastWindowClosed(True) + self.show() + if IS_LINUX: + # On ubuntu, activateWindow doesn't work reliably, so + # we do the following as a workaround. See + # https://bugreports.qt-project.org/browse/QTBUG-24932 + # for more details + QtGui.QX11Info.setAppUserTime(0) + self.activateWindow() + self.raise_() @QtCore.Slot() - def _toggle_visible(self): + def _ensure_invisible(self): """ TRIGGERS: self._action_visible.triggered - Toggle the window visibility + Ensure that the window is hidden. """ - visible = self.isVisible() and self.isActiveWindow() - - if not visible: - QtGui.QApplication.setQuitOnLastWindowClosed(True) - self.show() - if IS_LINUX: - # On ubuntu, activateWindow doesn't work reliably, so - # we do the following as a workaround. See - # https://bugreports.qt-project.org/browse/QTBUG-24932 - # for more details - QtGui.QX11Info.setAppUserTime(0) - self.activateWindow() - self.raise_() - else: - # We set this in order to avoid dialogs shutting down the - # app on close, as they will be the only visible window. - # e.g.: PreferencesWindow, LoggerWindow - QtGui.QApplication.setQuitOnLastWindowClosed(False) - self.hide() - - # Wait a bit until the window visibility has changed so - # the menu is set with the correct value. - QtDelayedCall(500, self._update_hideshow_menu) + # We set this in order to avoid dialogs shutting down the + # app on close, as they will be the only visible window. + # e.g.: PreferencesWindow, LoggerWindow + QtGui.QApplication.setQuitOnLastWindowClosed(False) + self.hide() def _center_window(self): """ @@ -1130,19 +1116,6 @@ class MainWindow(QtGui.QMainWindow): "Error: API version incompatible.") QtGui.QMessageBox.warning(self, self.tr("Incompatible Provider"), msg) - def changeEvent(self, e): - """ - Reimplementation of changeEvent method to minimize to tray - """ - if not IS_MAC and \ - QtGui.QSystemTrayIcon.isSystemTrayAvailable() and \ - e.type() == QtCore.QEvent.WindowStateChange and \ - self.isMinimized(): - self._toggle_visible() - e.accept() - return - QtGui.QMainWindow.changeEvent(self, e) - def closeEvent(self, e): """ Reimplementation of closeEvent to close to tray @@ -1155,7 +1128,7 @@ class MainWindow(QtGui.QMainWindow): if QtGui.QSystemTrayIcon.isSystemTrayAvailable() and \ not self._really_quit: - self._toggle_visible() + self._ensure_invisible() e.ignore() return -- cgit v1.2.3 From 047b4bce66532f43456eff7f2f1d847e2b746a6d Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 10 Aug 2014 13:44:59 -0700 Subject: properly align login and logout buttons --- src/leap/bitmask/gui/ui/login.ui | 60 +++++++++++++++++++------------ src/leap/bitmask/gui/ui/logout.ui | 74 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+), 22 deletions(-) create mode 100644 src/leap/bitmask/gui/ui/logout.ui (limited to 'src/leap/bitmask') diff --git a/src/leap/bitmask/gui/ui/login.ui b/src/leap/bitmask/gui/ui/login.ui index 216eca9e..cd20108e 100644 --- a/src/leap/bitmask/gui/ui/login.ui +++ b/src/leap/bitmask/gui/ui/login.ui @@ -33,7 +33,7 @@ 0 - -1 + 6 @@ -79,8 +79,14 @@ - + + + + 0 + 0 + + Log In @@ -198,26 +204,17 @@ - - - 0 - 0 - - - - - 0 - 0 - - - + 0 + + 26 + - 12 + 18 - + @@ -231,22 +228,41 @@ - + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 24 + 24 + + + + + Logout - - + + Qt::Horizontal + + QSizePolicy::Fixed + - 40 - 20 + 24 + 24 diff --git a/src/leap/bitmask/gui/ui/logout.ui b/src/leap/bitmask/gui/ui/logout.ui new file mode 100644 index 00000000..3faa93b6 --- /dev/null +++ b/src/leap/bitmask/gui/ui/logout.ui @@ -0,0 +1,74 @@ + + + Form + + + + 0 + 0 + 434 + 202 + + + + Form + + + + + + + 15 + 75 + true + + + + ... + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 24 + 24 + + + + + + + + Logout + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 24 + 24 + + + + + + + + + -- cgit v1.2.3 From 9b8251efe382f944e14a320e60e26a372a87d66b Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 10 Aug 2014 14:14:17 -0700 Subject: added non-functional decorative footer --- src/leap/bitmask/gui/ui/mainwindow.ui | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/leap/bitmask') diff --git a/src/leap/bitmask/gui/ui/mainwindow.ui b/src/leap/bitmask/gui/ui/mainwindow.ui index 1eeb636f..5bd21484 100644 --- a/src/leap/bitmask/gui/ui/mainwindow.ui +++ b/src/leap/bitmask/gui/ui/mainwindow.ui @@ -7,7 +7,7 @@ 0 0 524 - 640 + 600 @@ -216,6 +216,28 @@ + + + + + 0 + 0 + + + + false + + + background-color: rgba(0,0,0,20); border-top: 1px solid rgba(0,0,0,30); + + + + 0 + 16 + + + + -- cgit v1.2.3 From dddd670e8d9fde0772547453696c26c3d08fe5a1 Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 10 Aug 2014 15:07:24 -0700 Subject: simplify wizard instructions --- src/leap/bitmask/gui/ui/wizard.ui | 32 ++++++++++++++++---------------- src/leap/bitmask/gui/wizard.py | 15 ++++----------- 2 files changed, 20 insertions(+), 27 deletions(-) (limited to 'src/leap/bitmask') diff --git a/src/leap/bitmask/gui/ui/wizard.ui b/src/leap/bitmask/gui/ui/wizard.ui index 8c52897d..e895dc5a 100644 --- a/src/leap/bitmask/gui/ui/wizard.ui +++ b/src/leap/bitmask/gui/ui/wizard.ui @@ -23,7 +23,7 @@ - Bitmask first run + Bitmask Provider Setup @@ -40,10 +40,10 @@ - Welcome + Welcome to Bitmask - This is the Bitmask first run wizard + 0 @@ -59,7 +59,7 @@ - <html><head/><body><p>Now we will guide you through some configuration that is needed before you can connect for the first time.</p><p>If you ever need to modify these options again, you can find the wizard in the <span style=" font-style:italic;">'Bitmask -&gt; Create new account...'</span> menu from the main window.</p><p>Do you want to <span style=" font-weight:600;">sign up</span> for a new account, or <span style=" font-weight:600;">log in</span> with an already existing username?</p></body></html> + Qt::RichText @@ -109,10 +109,10 @@ - Provider selection + Choose a provider - Please enter the domain of the provider you want to use for your connection + 1 @@ -156,7 +156,7 @@ - Getting provider information + Getting provider information. @@ -350,10 +350,10 @@ - Provider Information + About this provider - Description of services offered by this provider + 2 @@ -495,7 +495,7 @@ Provider setup - Gathering configuration options for this provider + 3 @@ -517,7 +517,7 @@ - We are downloading some bits that we need to establish a secure connection with the provider for the first time. + Bitmask is attempting to establish a secure connection with this provider for the first time. true @@ -590,21 +590,21 @@ - Getting info from the Certificate Authority + Fetching provider credentials. - Do we trust this Certificate Authority? + Do we trust these credentials? - Establishing a trust relationship with this provider + Connecting to provider. @@ -666,7 +666,7 @@ Register new user - Register a new user with provider + 4 @@ -791,7 +791,7 @@ Service selection - Please select the services you would like to have + 5 diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index be5bde52..e0b4b620 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -679,7 +679,7 @@ class Wizard(QtGui.QWizard): the user to enable or disable. """ self.ui.grpServices.setTitle( - self.tr("Services by {0}").format(self._provider_details['name'])) + self.tr("Services by {0}").format(self._provider_details['domain'])) services = get_supported(self._provider_details['services']) @@ -723,18 +723,11 @@ class Wizard(QtGui.QWizard): if pageId == self.SETUP_PROVIDER_PAGE: if not self._provider_setup_ok: self._reset_provider_setup() - sub_title = self.tr("Gathering configuration options for {0}") - sub_title = sub_title.format(self._provider_details['name']) - self.page(pageId).setSubTitle(sub_title) self.ui.lblDownloadCaCert.setPixmap(self.QUESTION_ICON) self._provider_setup_defer = self._backend.\ provider_bootstrap(provider=self._domain) if pageId == self.PRESENT_PROVIDER_PAGE: - sub_title = self.tr("Description of services offered by {0}") - sub_title = sub_title.format(self._provider_details['name']) - self.page(pageId).setSubTitle(sub_title) - details = self._provider_details name = "{0}".format(details['name']) domain = "https://{0}".format(details['domain']) @@ -746,9 +739,9 @@ class Wizard(QtGui.QWizard): self.ui.lblProviderPolicy.setText(details['enrollment_policy']) if pageId == self.REGISTER_USER_PAGE: - sub_title = self.tr("Register a new user with {0}") - sub_title = sub_title.format(self._provider_details['name']) - self.page(pageId).setSubTitle(sub_title) + title = self.tr("Register a new user with {0}") + title = title.format(self._provider_details['domain']) + self.page(pageId).setTitle(title) self.ui.chkRemember.setVisible(False) if pageId == self.SERVICES_PAGE: -- cgit v1.2.3 From 7e48a36a681e89def5826f00e322c3c37b5dfe98 Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 10 Aug 2014 15:08:28 -0700 Subject: clean up icons in mainwindow.qrc --- src/leap/bitmask/gui/wizard.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/leap/bitmask') diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index e0b4b620..175d744c 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -70,9 +70,9 @@ class Wizard(QtGui.QWizard): self.setPixmap(QtGui.QWizard.LogoPixmap, QtGui.QPixmap(":/images/mask-icon.png")) - self.QUESTION_ICON = QtGui.QPixmap(":/images/Emblem-question.png") - self.ERROR_ICON = QtGui.QPixmap(":/images/Dialog-error.png") - self.OK_ICON = QtGui.QPixmap(":/images/Dialog-accept.png") + self.QUESTION_ICON = QtGui.QPixmap(":/images/black/24/question.png") + self.ERROR_ICON = QtGui.QPixmap(":/images/black/24/off.png") + self.OK_ICON = QtGui.QPixmap(":/images/black/24/on.png") self._selected_services = set() self._shown_services = set() -- cgit v1.2.3 From 9dc94c0eb18a625e3a4a9e0126349ad7c21567c5 Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 10 Aug 2014 16:24:56 -0700 Subject: svg icons! well, how about that? --- src/leap/bitmask/gui/eip_status.py | 12 +++---- src/leap/bitmask/gui/mail_status.py | 12 +++---- src/leap/bitmask/gui/ui/eip_status.ui | 2 +- src/leap/bitmask/gui/ui/mail_status.ui | 2 +- src/leap/bitmask/gui/ui/wizard.ui | 66 ++++++++++++++++++++++++++++++---- src/leap/bitmask/gui/wizard.py | 6 ++-- 6 files changed, 77 insertions(+), 23 deletions(-) (limited to 'src/leap/bitmask') diff --git a/src/leap/bitmask/gui/eip_status.py b/src/leap/bitmask/gui/eip_status.py index 1e764a8c..05e28f92 100644 --- a/src/leap/bitmask/gui/eip_status.py +++ b/src/leap/bitmask/gui/eip_status.py @@ -214,15 +214,15 @@ class EIPStatusWidget(QtGui.QWidget): WIN : light icons """ EIP_ICONS = EIP_ICONS_TRAY = ( - ":/images/black/32/wait.png", - ":/images/black/32/on.png", - ":/images/black/32/off.png") + ":/images/black/wait.svg", + ":/images/black/on.svg", + ":/images/black/off.svg") if IS_LINUX: EIP_ICONS_TRAY = ( - ":/images/white/32/wait.png", - ":/images/white/32/on.png", - ":/images/white/32/off.png") + ":/images/white/wait.svg", + ":/images/white/on.svg", + ":/images/white/off.svg") self.CONNECTING_ICON = QtGui.QPixmap(EIP_ICONS[0]) self.CONNECTED_ICON = QtGui.QPixmap(EIP_ICONS[1]) diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py index bb755b5c..4ec93d88 100644 --- a/src/leap/bitmask/gui/mail_status.py +++ b/src/leap/bitmask/gui/mail_status.py @@ -134,15 +134,15 @@ class MailStatusWidget(QtGui.QWidget): WIN : light icons """ EIP_ICONS = EIP_ICONS_TRAY = ( - ":/images/black/32/wait.png", - ":/images/black/32/on.png", - ":/images/black/32/off.png") + ":/images/black/wait.svg", + ":/images/black/on.svg", + ":/images/black/off.svg") if IS_LINUX: EIP_ICONS_TRAY = ( - ":/images/white/32/wait.png", - ":/images/white/32/on.png", - ":/images/white/32/off.png") + ":/images/white/wait.svg", + ":/images/white/on.svg", + ":/images/white/off.svg") self.CONNECTING_ICON = QtGui.QPixmap(EIP_ICONS[0]) self.CONNECTED_ICON = QtGui.QPixmap(EIP_ICONS[1]) diff --git a/src/leap/bitmask/gui/ui/eip_status.ui b/src/leap/bitmask/gui/ui/eip_status.ui index e0996620..e97add61 100644 --- a/src/leap/bitmask/gui/ui/eip_status.ui +++ b/src/leap/bitmask/gui/ui/eip_status.ui @@ -111,7 +111,7 @@ - :/images/black/32/off.png + :/images/black/off.svg true diff --git a/src/leap/bitmask/gui/ui/mail_status.ui b/src/leap/bitmask/gui/ui/mail_status.ui index 22976f39..6103c77b 100644 --- a/src/leap/bitmask/gui/ui/mail_status.ui +++ b/src/leap/bitmask/gui/ui/mail_status.ui @@ -60,7 +60,7 @@ - :/images/black/32/off.png + :/images/black/off.svg true diff --git a/src/leap/bitmask/gui/ui/wizard.ui b/src/leap/bitmask/gui/ui/wizard.ui index e895dc5a..f67e9dd5 100644 --- a/src/leap/bitmask/gui/ui/wizard.ui +++ b/src/leap/bitmask/gui/ui/wizard.ui @@ -181,11 +181,20 @@ 24 + + + 24 + 24 + + + + true + - :/images/Emblem-question.png + :/images/black/question.svg @@ -203,11 +212,20 @@ 24 + + + 24 + 24 + + + + true + - :/images/Emblem-question.png + :/images/black/question.svg @@ -225,11 +243,20 @@ 24 + + + 24 + 24 + + + + true + - :/images/Emblem-question.png + :/images/black/question.svg @@ -557,11 +584,20 @@ 24 + + + 24 + 24 + + + + true + - :/images/Emblem-question.png + :/images/black/question.svg @@ -579,11 +615,20 @@ 24 + + + 24 + 24 + + + + true + - :/images/Emblem-question.png + :/images/black/question.svg @@ -622,11 +667,20 @@ 24 + + + 24 + 24 + + + + true + - :/images/Emblem-question.png + :/images/black/question.svg diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index 175d744c..44f91365 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -70,9 +70,9 @@ class Wizard(QtGui.QWizard): self.setPixmap(QtGui.QWizard.LogoPixmap, QtGui.QPixmap(":/images/mask-icon.png")) - self.QUESTION_ICON = QtGui.QPixmap(":/images/black/24/question.png") - self.ERROR_ICON = QtGui.QPixmap(":/images/black/24/off.png") - self.OK_ICON = QtGui.QPixmap(":/images/black/24/on.png") + self.QUESTION_ICON = QtGui.QPixmap(":/images/black/question.svg") + self.ERROR_ICON = QtGui.QPixmap(":/images/black/off.svg") + self.OK_ICON = QtGui.QPixmap(":/images/black/on.svg") self._selected_services = set() self._shown_services = set() -- cgit v1.2.3