Moved into AddressManager
Showing the changes to interface/src/Menu.cpp (1 of 4 files). Show all
Unified · Split
| @@ -135,10 +135,11 @@ Menu::Menu() { · 134 unmodified lines | ||
| 135 | 135 | Qt::Key_Enter, |
| 136 | 136 | dialogsManager.data(), |
| 137 | 137 | SLOT(toggleAddressBar())); |
| 138 | + auto addressManager = DependencyManager::get<AddressManager>(); | |
| 138 | 139 | addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyAddress, 0, |
| 139 | − this, SLOT(copyAddress())); | |
| 140 | + addressManager.data(), SLOT(copyAddress())); | |
| 140 | 141 | addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyPath, 0, |
| 141 | − this, SLOT(copyPath())); | |
| 142 | + addressManager.data(), SLOT(copyPath())); | |
| 142 | 143 | |
| 143 | 144 | addDisabledActionAndSeparator(fileMenu, "Upload Avatar Model"); |
| 144 | 145 | addActionToQMenuAndActionHash(fileMenu, MenuOption::UploadHead, 0, |
| @@ -1141,20 +1142,6 @@ void Menu::changePrivateKey() { · 996 unmodified lines | ||
| 1141 | 1142 | sendFakeEnterEvent(); |
| 1142 | 1143 | } |
| 1143 | 1144 | |
| 1144 | −void Menu::copyAddress() { | |
| 1145 | − auto addressManager = DependencyManager::get<AddressManager>(); | |
| 1146 | − QString address = addressManager->currentAddress().toString(); | |
| 1147 | − QClipboard* clipboard = QApplication::clipboard(); | |
| 1148 | − clipboard->setText(address); | |
| 1149 | −} | |
| 1150 | − | |
| 1151 | −void Menu::copyPath() { | |
| 1152 | − auto addressManager = DependencyManager::get<AddressManager>(); | |
| 1153 | − QString path = addressManager->currentPath(); | |
| 1154 | − QClipboard* clipboard = QApplication::clipboard(); | |
| 1155 | − clipboard->setText(path); | |
| 1156 | −} | |
| 1157 | − | |
| 1158 | 1145 | void Menu::displayNameLocationResponse(const QString& errorString) { |
| 1159 | 1146 | |
| 1160 | 1147 | if (!errorString.isEmpty()) { |