Add a menu option to the runtime to copy the appserver URL to the clipboard. Fixes #3510

pull/14/head
Dave Page 2018-07-19 11:32:40 +01:00
parent 051ce6afeb
commit 2ce41e77f2
7 changed files with 23 additions and 2 deletions

View File

@ -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 #3510 <https://redmine.postgresql.org/issues/3510>`_ - Add a menu option to the runtime to copy the appserver URL to the clipboard.
Bug fixes
*********

View File

@ -57,6 +57,7 @@ void FloatingWindow::createMenu()
m_floatingWindowMenu = menuBar()->addMenu(QString(tr("&%1")).arg(PGA_APP_NAME));
m_floatingWindowMenu->addAction(m_newAction);
m_floatingWindowMenu->addAction(m_copyUrlAction);
m_floatingWindowMenu->addSeparator();
m_floatingWindowMenu->addAction(m_configAction);
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);
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()));
m_logAction = new QAction(tr("&View log..."), this);

View File

@ -42,6 +42,7 @@ private:
void closeEvent(QCloseEvent * event);
QAction *m_newAction;
QAction *m_copyUrlAction;
QAction *m_configAction;
QAction *m_logAction;
QAction *m_quitAction;

View File

@ -12,6 +12,7 @@
#include "MenuActions.h"
// QT headers
#include <QClipboard>
#include <QMessageBox>
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
void MenuActions::onConfig()
{

View File

@ -35,6 +35,7 @@ private:
protected slots:
void onNew();
void onCopyUrl();
void onConfig();
void onLog();
void onQuit();

View File

@ -50,6 +50,7 @@ void TrayIcon::createTrayIcon()
m_trayIconMenu = new QMenu(this);
m_trayIconMenu->addAction(m_newAction);
m_trayIconMenu->addAction(m_copyUrlAction);
m_trayIconMenu->addSeparator();
m_trayIconMenu->addAction(m_configAction);
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);
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);
connect(m_configAction, SIGNAL(triggered()), m_menuActions, SLOT(onConfig()));

View File

@ -35,6 +35,7 @@ private:
void createActions();
QAction *m_newAction;
QAction *m_copyUrlAction;
QAction *m_configAction;
QAction *m_logAction;
QAction *m_quitAction;