Commit 08abfacd authored by Alexandre Lision's avatar Alexandre Lision

wizard: fix workflow

- enable "share by mail" when rechecking your ringID
- populate RingID field on first setup in the main window (field was blank)
- Hide the "show certificates" button on more cases

Issue: #80704
Change-Id: I25109437f7fac4e30535d04906b372641747746f
parent 4e280d62
...@@ -57,13 +57,15 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier"; ...@@ -57,13 +57,15 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier";
[currentVC initFrame]; [currentVC initFrame];
// Fresh run, we need to make sure RingID appears
[self updateRingID];
// Update Ring ID label based on account model changes // Update Ring ID label based on account model changes
QObject::connect(AccountModel::instance(), QObject::connect(AccountModel::instance(),
&AccountModel::dataChanged, &AccountModel::dataChanged,
[=] { [=] {
[self updateRingID]; [self updateRingID];
}); });
} }
/** /**
......
...@@ -15,17 +15,6 @@ ...@@ -15,17 +15,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/ */
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
......
...@@ -15,17 +15,6 @@ ...@@ -15,17 +15,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/ */
#import "RingWizardWC.h" #import "RingWizardWC.h"
...@@ -41,11 +30,7 @@ ...@@ -41,11 +30,7 @@
#import "AppDelegate.h" #import "AppDelegate.h"
#define PVK_PASSWORD_TAG 0 @implementation RingWizardWC {
#define NICKNAME_TAG 1
@interface RingWizardWC () {
__unsafe_unretained IBOutlet NSButton *goToAppButton; __unsafe_unretained IBOutlet NSButton *goToAppButton;
__unsafe_unretained IBOutlet NSTextField *nickname; __unsafe_unretained IBOutlet NSTextField *nickname;
__unsafe_unretained IBOutlet NSProgressIndicator *progressBar; __unsafe_unretained IBOutlet NSProgressIndicator *progressBar;
...@@ -60,13 +45,11 @@ ...@@ -60,13 +45,11 @@
__unsafe_unretained IBOutlet NSPathControl *caListPathControl; __unsafe_unretained IBOutlet NSPathControl *caListPathControl;
__unsafe_unretained IBOutlet NSPathControl *pvkPathControl; __unsafe_unretained IBOutlet NSPathControl *pvkPathControl;
BOOL isExpanded; BOOL isExpanded;
Account* accountToCreate;
} }
@property Account* accountToCreate; NSInteger const PVK_PASSWORD_TAG = 0;
@end NSInteger const NICKNAME_TAG = 1;
@implementation RingWizardWC
@synthesize accountToCreate;
- (void)windowDidLoad { - (void)windowDidLoad {
[super windowDidLoad]; [super windowDidLoad];
...@@ -85,7 +68,6 @@ ...@@ -85,7 +68,6 @@
@"Display message to user")]; @"Display message to user")];
auto accList = AccountModel::instance()->getAccountsByProtocol(Account::Protocol::RING); auto accList = AccountModel::instance()->getAccountsByProtocol(Account::Protocol::RING);
[self displayHash:accList[0]->username().toNSString()]; [self displayHash:accList[0]->username().toNSString()];
[showCustomCertsButton setHidden:YES];
} }
[caListPathControl setDelegate:self]; [caListPathControl setDelegate:self];
...@@ -112,6 +94,8 @@ ...@@ -112,6 +94,8 @@
[nickname setEditable:NO]; [nickname setEditable:NO];
[nickname setHidden:NO]; [nickname setHidden:NO];
[showCustomCertsButton setHidden:YES];
[goToAppButton setHidden:NO]; [goToAppButton setHidden:NO];
NSSharingService* emailSharingService = [NSSharingService sharingServiceNamed:NSSharingServiceNameComposeEmail]; NSSharingService* emailSharingService = [NSSharingService sharingServiceNamed:NSSharingServiceNameComposeEmail];
...@@ -119,6 +103,8 @@ ...@@ -119,6 +103,8 @@
[createButton setTitle:NSLocalizedString(@"Share by mail", [createButton setTitle:NSLocalizedString(@"Share by mail",
@"Share button")]; @"Share button")];
[createButton setAlternateImage:emailSharingService.alternateImage]; [createButton setAlternateImage:emailSharingService.alternateImage];
[createButton setEnabled:YES];
[createButton setAction:@selector(shareByEmail)]; [createButton setAction:@selector(shareByEmail)];
} }
...@@ -136,10 +122,10 @@ ...@@ -136,10 +122,10 @@
if (isExpanded) { if (isExpanded) {
// retract panel // retract panel
[self chooseOwnCertificates:nil]; [self chooseOwnCertificates:nil];
[showCustomCertsButton setHidden:YES];
} }
[self performSelector:@selector(saveAccount) withObject:nil afterDelay:1]; [showCustomCertsButton setHidden:YES];
[self performSelector:@selector(saveAccount) withObject:nil afterDelay:1];
[self registerAutoStartup]; [self registerAutoStartup];
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment