void ExplorerTreeView::viewKeys() { QModelIndex sel = selectedIndex(); if(!sel.isValid()){ return; } ExplorerDatabaseItem* node = common::utils_qt::item<ExplorerDatabaseItem*>(sel); if(node){ ViewKeysDialog diag(QString("View key in %1 database").arg(node->name()), node->db(), this); diag.exec(); } }
void ExplorerTreeView::loadContentDb() { QModelIndex sel = selectedIndex(); if(!sel.isValid()){ return; } ExplorerDatabaseItem *node = common::utils_qt::item<ExplorerDatabaseItem*>(sel); if(node){ LoadContentDbDialog loadDb(QString("Load %1 content").arg(node->name()), node->server()->type(), this); int result = loadDb.exec(); if(result == QDialog::Accepted){ node->loadContent(common::convertToString(loadDb.pattern()), loadDb.count()); } } }
void ExplorerTreeView::createKey() { QModelIndex sel = selectedIndex(); if(!sel.isValid()){ return; } ExplorerDatabaseItem *node = common::utils_qt::item<ExplorerDatabaseItem*>(sel); if(node){ CreateDbKeyDialog loadDb(QString("Create key for %1 database").arg(node->name()), node->server()->type(), this); int result = loadDb.exec(); if(result == QDialog::Accepted){ FastoObjectIPtr val = loadDb.value(); NKey key = loadDb.key(); node->createKey(key, val); } } }