mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-17 03:35:47 +02:00
Moved AddressBar out of Menu
Moved into DialogsManager
This commit is contained in:
parent
8f9507cd4c
commit
fb8639b85c
6 changed files with 16 additions and 16 deletions
|
@ -133,7 +133,7 @@ Menu::Menu() {
|
|||
addActionToQMenuAndActionHash(fileMenu,
|
||||
MenuOption::AddressBar,
|
||||
Qt::Key_Enter,
|
||||
this,
|
||||
dialogsManager.data(),
|
||||
SLOT(toggleAddressBar()));
|
||||
addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyAddress, 0,
|
||||
this, SLOT(copyAddress()));
|
||||
|
@ -1172,16 +1172,6 @@ void Menu::changePrivateKey() {
|
|||
sendFakeEnterEvent();
|
||||
}
|
||||
|
||||
void Menu::toggleAddressBar() {
|
||||
if (!_addressBarDialog) {
|
||||
_addressBarDialog = new AddressBarDialog();
|
||||
}
|
||||
|
||||
if (!_addressBarDialog->isVisible()) {
|
||||
_addressBarDialog->show();
|
||||
}
|
||||
}
|
||||
|
||||
void Menu::copyAddress() {
|
||||
auto addressManager = DependencyManager::get<AddressManager>();
|
||||
QString address = addressManager->currentAddress().toString();
|
||||
|
|
|
@ -158,7 +158,6 @@ public slots:
|
|||
void cachesSizeDialog();
|
||||
void lodTools();
|
||||
void hmdTools(bool showTools);
|
||||
void toggleAddressBar();
|
||||
void copyAddress();
|
||||
void copyPath();
|
||||
|
||||
|
@ -190,7 +189,6 @@ private:
|
|||
SpeechRecognizer _speechRecognizer;
|
||||
#endif
|
||||
|
||||
QPointer<AddressBarDialog> _addressBarDialog;
|
||||
QPointer<AnimationsDialog> _animationsDialog;
|
||||
QPointer<AttachmentsDialog> _attachmentsDialog;
|
||||
QPointer<BandwidthDialog> _bandwidthDialog;
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
const QString ADDRESSBAR_GO_BUTTON_ICON = "images/address-bar-submit.svg";
|
||||
const QString ADDRESSBAR_GO_BUTTON_ACTIVE_ICON = "images/address-bar-submit-active.svg";
|
||||
|
||||
AddressBarDialog::AddressBarDialog() :
|
||||
FramelessDialog(Application::getInstance()->getWindow(), 0, FramelessDialog::POSITION_TOP)
|
||||
AddressBarDialog::AddressBarDialog(QWidget* parent) :
|
||||
FramelessDialog(parent, 0, FramelessDialog::POSITION_TOP)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose, false);
|
||||
setupUI();
|
||||
|
|
|
@ -23,7 +23,7 @@ class AddressBarDialog : public FramelessDialog {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AddressBarDialog();
|
||||
AddressBarDialog(QWidget* parent);
|
||||
|
||||
private:
|
||||
void setupUI();
|
||||
|
|
|
@ -12,11 +12,19 @@
|
|||
#include <Application.h>
|
||||
#include <MainWindow.h>
|
||||
|
||||
#include "AddressBarDialog.h"
|
||||
#include "LoginDialog.h"
|
||||
|
||||
#include "DialogsManager.h"
|
||||
|
||||
void DialogsManager::toggleAddressBar() {
|
||||
maybeCreateDialog(_addressBarDialog);
|
||||
|
||||
if (!_addressBarDialog->isVisible()) {
|
||||
_addressBarDialog->show();
|
||||
}
|
||||
}
|
||||
|
||||
void DialogsManager::toggleLoginDialog() {
|
||||
maybeCreateDialog(_loginDialog);
|
||||
_loginDialog->toggleQAction();
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include <DependencyManager.h>
|
||||
|
||||
class AddressBarDialog;
|
||||
class LoginDialog;
|
||||
|
||||
class DialogsManager : public QObject, public Dependency {
|
||||
|
@ -23,6 +24,8 @@ class DialogsManager : public QObject, public Dependency {
|
|||
SINGLETON_DEPENDENCY
|
||||
|
||||
public slots:
|
||||
void toggleAddressBar();
|
||||
|
||||
void toggleLoginDialog();
|
||||
void showLoginDialog();
|
||||
|
||||
|
@ -39,6 +42,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
QPointer<AddressBarDialog> _addressBarDialog;
|
||||
QPointer<LoginDialog> _loginDialog;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue