Skip to content
Snippets Groups Projects
Commit b7ee3ed0 authored by Alexandre Lision's avatar Alexandre Lision
Browse files

accounts: add account reordering feature

Refs #67077

Change-Id: I41b148143e433e0224e4259ea9ebf27605222083
parent 53428a5d
No related branches found
No related tags found
No related merge requests found
......@@ -161,11 +161,20 @@ public:
[self.ringTabItem setView:self.ringVC.view];
}
- (IBAction)moveUp:(id)sender {
AccountModel::instance()->moveUp();
}
- (IBAction)moveDown:(id)sender {
AccountModel::instance()->moveDown();
}
- (IBAction)removeAccount:(id)sender {
if(treeController.selectedNodes.count > 0) {
QModelIndex qIdx = [treeController toQIdx:[treeController selectedNodes][0]];
AccountModel::instance()->remove(qIdx);
AccountModel::instance()->save();
}
}
- (IBAction)addAccount:(id)sender {
......@@ -175,6 +184,7 @@ public:
AccountModel::instance()->protocolModel()->data(qIdx, Qt::DisplayRole).toString().toNSString(), nil];
Account* newAcc =AccountModel::instance()->add([newAccName UTF8String], qIdx);
AccountModel::instance()->save();
}
- (IBAction)protocolSelectedChanged:(id)sender {
......@@ -336,6 +346,7 @@ public:
if([[treeController selectedNodes] count] > 0) {
QModelIndex qIdx = [treeController toQIdx:[treeController selectedNodes][0]];
//Update details view
AccountModel::instance()->selectionModel()->setCurrentIndex(qIdx, QItemSelectionModel::ClearAndSelect);
Account* acc = AccountModel::instance()->getAccountByModelIndex(qIdx);
switch (acc->protocol()) {
......@@ -359,6 +370,7 @@ public:
[self.accountDetailsView setHidden:NO];
} else {
[self.accountDetailsView setHidden:YES];
AccountModel::instance()->selectionModel()->clearCurrentIndex();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment