mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-09-03 20:52:57 -05:00
Add a menu option to the runtime to copy the appserver URL to the clipboard. Fixes #3510
This commit is contained in:
@@ -11,7 +11,7 @@ Features
|
|||||||
********
|
********
|
||||||
|
|
||||||
| `Feature #3397 <https://redmine.postgresql.org/issues/3397>`_ - Add support for Trigger and JIT stats in the graphical query plan viewer.
|
| `Feature #3397 <https://redmine.postgresql.org/issues/3397>`_ - Add support for Trigger and JIT stats in the graphical query plan viewer.
|
||||||
|
| `Feature #3510 <https://redmine.postgresql.org/issues/3510>`_ - Add a menu option to the runtime to copy the appserver URL to the clipboard.
|
||||||
|
|
||||||
Bug fixes
|
Bug fixes
|
||||||
*********
|
*********
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ void FloatingWindow::createMenu()
|
|||||||
|
|
||||||
m_floatingWindowMenu = menuBar()->addMenu(QString(tr("&%1")).arg(PGA_APP_NAME));
|
m_floatingWindowMenu = menuBar()->addMenu(QString(tr("&%1")).arg(PGA_APP_NAME));
|
||||||
m_floatingWindowMenu->addAction(m_newAction);
|
m_floatingWindowMenu->addAction(m_newAction);
|
||||||
|
m_floatingWindowMenu->addAction(m_copyUrlAction);
|
||||||
m_floatingWindowMenu->addSeparator();
|
m_floatingWindowMenu->addSeparator();
|
||||||
m_floatingWindowMenu->addAction(m_configAction);
|
m_floatingWindowMenu->addAction(m_configAction);
|
||||||
m_floatingWindowMenu->addAction(m_logAction);
|
m_floatingWindowMenu->addAction(m_logAction);
|
||||||
@@ -70,7 +71,10 @@ void FloatingWindow::createActions()
|
|||||||
m_newAction = new QAction(QString(tr("&New %1 window...")).arg(PGA_APP_NAME), this);
|
m_newAction = new QAction(QString(tr("&New %1 window...")).arg(PGA_APP_NAME), this);
|
||||||
connect(m_newAction, SIGNAL(triggered()), m_menuActions, SLOT(onNew()));
|
connect(m_newAction, SIGNAL(triggered()), m_menuActions, SLOT(onNew()));
|
||||||
|
|
||||||
m_configAction = new QAction(tr("&Configure..."), this);
|
m_copyUrlAction = new QAction(tr("&Copy server URL"), this);
|
||||||
|
connect(m_copyUrlAction, SIGNAL(triggered()), m_menuActions, SLOT(onCopyUrl()));
|
||||||
|
|
||||||
|
m_configAction = new QAction(tr("C&onfigure..."), this);
|
||||||
connect(m_configAction, SIGNAL(triggered()), m_menuActions, SLOT(onConfig()));
|
connect(m_configAction, SIGNAL(triggered()), m_menuActions, SLOT(onConfig()));
|
||||||
|
|
||||||
m_logAction = new QAction(tr("&View log..."), this);
|
m_logAction = new QAction(tr("&View log..."), this);
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ private:
|
|||||||
void closeEvent(QCloseEvent * event);
|
void closeEvent(QCloseEvent * event);
|
||||||
|
|
||||||
QAction *m_newAction;
|
QAction *m_newAction;
|
||||||
|
QAction *m_copyUrlAction;
|
||||||
QAction *m_configAction;
|
QAction *m_configAction;
|
||||||
QAction *m_logAction;
|
QAction *m_logAction;
|
||||||
QAction *m_quitAction;
|
QAction *m_quitAction;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "MenuActions.h"
|
#include "MenuActions.h"
|
||||||
|
|
||||||
// QT headers
|
// QT headers
|
||||||
|
#include <QClipboard>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
MenuActions::MenuActions()
|
MenuActions::MenuActions()
|
||||||
@@ -58,6 +59,15 @@ void MenuActions::onNew()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Copy the application server URL to the clipboard
|
||||||
|
void MenuActions::onCopyUrl()
|
||||||
|
{
|
||||||
|
QClipboard *clipboard = QApplication::clipboard();
|
||||||
|
clipboard->setText(m_appServerUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Show the config dialogue
|
// Show the config dialogue
|
||||||
void MenuActions::onConfig()
|
void MenuActions::onConfig()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ private:
|
|||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void onNew();
|
void onNew();
|
||||||
|
void onCopyUrl();
|
||||||
void onConfig();
|
void onConfig();
|
||||||
void onLog();
|
void onLog();
|
||||||
void onQuit();
|
void onQuit();
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ void TrayIcon::createTrayIcon()
|
|||||||
|
|
||||||
m_trayIconMenu = new QMenu(this);
|
m_trayIconMenu = new QMenu(this);
|
||||||
m_trayIconMenu->addAction(m_newAction);
|
m_trayIconMenu->addAction(m_newAction);
|
||||||
|
m_trayIconMenu->addAction(m_copyUrlAction);
|
||||||
m_trayIconMenu->addSeparator();
|
m_trayIconMenu->addSeparator();
|
||||||
m_trayIconMenu->addAction(m_configAction);
|
m_trayIconMenu->addAction(m_configAction);
|
||||||
m_trayIconMenu->addAction(m_logAction);
|
m_trayIconMenu->addAction(m_logAction);
|
||||||
@@ -78,6 +79,9 @@ void TrayIcon::createActions()
|
|||||||
m_newAction = new QAction(QString(tr("&New %1 window...")).arg(PGA_APP_NAME), this);
|
m_newAction = new QAction(QString(tr("&New %1 window...")).arg(PGA_APP_NAME), this);
|
||||||
connect(m_newAction, SIGNAL(triggered()), m_menuActions, SLOT(onNew()));
|
connect(m_newAction, SIGNAL(triggered()), m_menuActions, SLOT(onNew()));
|
||||||
|
|
||||||
|
m_copyUrlAction = new QAction(tr("&Copy server URL"), this);
|
||||||
|
connect(m_copyUrlAction, SIGNAL(triggered()), m_menuActions, SLOT(onCopyUrl()));
|
||||||
|
|
||||||
m_configAction = new QAction(tr("&Configure..."), this);
|
m_configAction = new QAction(tr("&Configure..."), this);
|
||||||
connect(m_configAction, SIGNAL(triggered()), m_menuActions, SLOT(onConfig()));
|
connect(m_configAction, SIGNAL(triggered()), m_menuActions, SLOT(onConfig()));
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ private:
|
|||||||
void createActions();
|
void createActions();
|
||||||
|
|
||||||
QAction *m_newAction;
|
QAction *m_newAction;
|
||||||
|
QAction *m_copyUrlAction;
|
||||||
QAction *m_configAction;
|
QAction *m_configAction;
|
||||||
QAction *m_logAction;
|
QAction *m_logAction;
|
||||||
QAction *m_quitAction;
|
QAction *m_quitAction;
|
||||||
|
|||||||
Reference in New Issue
Block a user