void ExplorerTreeView::openPropertyServerDialog() { QModelIndex sel = selectedIndex(); if(!sel.isValid()){ return; } ExplorerServerItem *node = common::utils_qt::item<ExplorerServerItem*>(sel); if(!node){ return; } IServerSPtr server = node->server(); if(!server){ return; } PropertyServerDialog infDialog(QString("%1 properties").arg(server->name()), server->type(), this); VERIFY(connect(server.get(), &IServer::startedLoadServerProperty, &infDialog, &PropertyServerDialog::startServerProperty)); VERIFY(connect(server.get(), &IServer::finishedLoadServerProperty, &infDialog, &PropertyServerDialog::finishServerProperty)); VERIFY(connect(server.get(), &IServer::startedChangeServerProperty, &infDialog, &PropertyServerDialog::startServerChangeProperty)); VERIFY(connect(server.get(), &IServer::finishedChangeServerProperty, &infDialog, &PropertyServerDialog::finishServerChangeProperty)); VERIFY(connect(&infDialog, &PropertyServerDialog::changedProperty, server.get(), &IServer::changeProperty)); VERIFY(connect(&infDialog, &PropertyServerDialog::showed, server.get(), &IServer::serverProperty)); infDialog.exec(); }
IDatabase::IDatabase(IServerSPtr server, DataBaseInfoSPtr info) : info_(info), server_(server) { DCHECK(server); DCHECK(info); DCHECK(server->type() == info->type()); }
SsdbDatabase::SsdbDatabase(IServerSPtr server, IDataBaseInfoSPtr info) : IDatabase(server, info) { DCHECK(server); DCHECK(info); DCHECK(server->type() == SSDB); DCHECK(info->type() == SSDB); }
MemcachedDatabase::MemcachedDatabase(IServerSPtr server, DataBaseInfoSPtr info) : IDatabase(server, info) { DCHECK(server); DCHECK(info); DCHECK(server->type() == MEMCACHED); DCHECK(info->type() == MEMCACHED); }
connectionTypes QueryWidget::connectionType() const { IServerSPtr ser = shellWidget_->server(); if(!ser){ return DBUNKNOWN; } return ser->type(); }
void ExplorerTreeView::openHistoryServerDialog() { QModelIndex sel = selectedIndex(); if(!sel.isValid()){ return; } ExplorerServerItem *node = common::utils_qt::item<ExplorerServerItem*>(sel); if(!node){ return; } IServerSPtr server = node->server(); if(!server){ return; } ServerHistoryDialog histDialog(QString("%1 history").arg(server->name()), server->type(), this); VERIFY(connect(server.get(), &IServer::startedLoadServerHistoryInfo, &histDialog, &ServerHistoryDialog::startLoadServerHistoryInfo)); VERIFY(connect(server.get(), &IServer::finishedLoadServerHistoryInfo, &histDialog, &ServerHistoryDialog::finishLoadServerHistoryInfo)); VERIFY(connect(server.get(), &IServer::serverInfoSnapShoot, &histDialog, &ServerHistoryDialog::snapShotAdd)); VERIFY(connect(&histDialog, &ServerHistoryDialog::showed, server.get(), &IServer::requestHistoryInfo)); histDialog.exec(); }