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 | Qt::Key_Enter, | 135 | Qt::Key_Enter, |
| 136 | dialogsManager.data(), | 136 | dialogsManager.data(), |
| 137 | SLOT(toggleAddressBar())); | 137 | SLOT(toggleAddressBar())); |
| 138 | auto addressManager = DependencyManager::get<AddressManager>(); | ||
| 138 | addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyAddress, 0, | 139 | addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyAddress, 0, |
| 139 | this, SLOT(copyAddress())); | 140 | addressManager.data(), SLOT(copyAddress())); |
| 140 | addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyPath, 0, | 141 | addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyPath, 0, |
| 141 | this, SLOT(copyPath())); | 142 | addressManager.data(), SLOT(copyPath())); |
| 142 | 143 | ||
| 143 | addDisabledActionAndSeparator(fileMenu, "Upload Avatar Model"); | 144 | addDisabledActionAndSeparator(fileMenu, "Upload Avatar Model"); |
| 144 | addActionToQMenuAndActionHash(fileMenu, MenuOption::UploadHead, 0, | 145 | addActionToQMenuAndActionHash(fileMenu, MenuOption::UploadHead, 0, |
| @@ -1141,20 +1142,6 @@ void Menu::changePrivateKey() { · 996 unmodified lines | |||
| 1141 | sendFakeEnterEvent(); | 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 | void Menu::displayNameLocationResponse(const QString& errorString) { | 1145 | void Menu::displayNameLocationResponse(const QString& errorString) { |
| 1159 | 1146 | ||
| 1160 | if (!errorString.isEmpty()) { | 1147 | if (!errorString.isEmpty()) { |