From c1827bde5108d1f4709072739f25276c03b827da Mon Sep 17 00:00:00 2001 From: walker0643 <> Date: Sun, 25 Feb 2018 13:37:29 -0500 Subject: [PATCH] redo GUI menu a bit; remove unused items --- src/gui/src/MainWindow.cpp | 66 +++++++---------------------------- src/gui/src/MainWindow.h | 13 +------ src/gui/src/MainWindowBase.ui | 51 --------------------------- 3 files changed, 14 insertions(+), 116 deletions(-) diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 83dbd548..c9292144 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -85,9 +85,7 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) : m_pTrayIconMenu(NULL), m_AlreadyHidden(false), m_pMenuBar(NULL), - m_pMenuFile(NULL), - m_pMenuEdit(NULL), - m_pMenuWindow(NULL), + m_pMenuBarrier(NULL), m_pMenuHelp(NULL), m_pZeroconfService(NULL), m_pDataDownloader(NULL), @@ -105,8 +103,6 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) : loadSettings(); initConnections(); - m_pWidgetUpdate->hide(); - m_VersionChecker.setApp(appPath(appConfig.barriercName())); m_pLabelScreenName->setText(getScreenName()); m_pLabelIpAddresses->setText(getIPAddresses()); @@ -136,9 +132,6 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) : sslToggled(appConfig.getCryptoEnabled()); - connect (this, SIGNAL(windowShown()), - this, SLOT(on_windowShown()), Qt::QueuedConnection); - connect (m_AppConfig, SIGNAL(sslToggled(bool)), this, SLOT(sslToggled(bool)), Qt::QueuedConnection); } @@ -175,8 +168,6 @@ void MainWindow::open() showNormal(); } - m_VersionChecker.checkLatest(); - if (!appConfig().autoConfigPrompted()) { promptAutoConfig(); } @@ -223,37 +214,25 @@ void MainWindow::createTrayIcon() void MainWindow::retranslateMenuBar() { - m_pMenuFile->setTitle(tr("&File")); - m_pMenuEdit->setTitle(tr("&Edit")); - m_pMenuWindow->setTitle(tr("&Window")); + m_pMenuBarrier->setTitle(tr("&Barrier")); m_pMenuHelp->setTitle(tr("&Help")); } void MainWindow::createMenuBar() { m_pMenuBar = new QMenuBar(this); - m_pMenuFile = new QMenu("", m_pMenuBar); - m_pMenuEdit = new QMenu("", m_pMenuBar); - m_pMenuWindow = new QMenu("", m_pMenuBar); + m_pMenuBarrier = new QMenu("", m_pMenuBar); m_pMenuHelp = new QMenu("", m_pMenuBar); retranslateMenuBar(); - m_pMenuBar->addAction(m_pMenuFile->menuAction()); - m_pMenuBar->addAction(m_pMenuEdit->menuAction()); -#if !defined(Q_OS_MAC) - m_pMenuBar->addAction(m_pMenuWindow->menuAction()); -#endif + m_pMenuBar->addAction(m_pMenuBarrier->menuAction()); m_pMenuBar->addAction(m_pMenuHelp->menuAction()); - m_pMenuFile->addAction(m_pActionStartBarrier); - m_pMenuFile->addAction(m_pActionStopBarrier); - m_pMenuFile->addSeparator(); - m_pMenuFile->addAction(m_pActionSave); - m_pMenuFile->addSeparator(); - m_pMenuFile->addAction(m_pActionQuit); - m_pMenuEdit->addAction(m_pActionSettings); - m_pMenuWindow->addAction(m_pActionMinimize); - m_pMenuWindow->addAction(m_pActionRestore); + m_pMenuBarrier->addAction(m_pActionSave); + m_pMenuBarrier->addSeparator(); + m_pMenuBarrier->addAction(m_pActionSettings); + m_pMenuBarrier->addSeparator(); + m_pMenuBarrier->addAction(m_pActionQuit); m_pMenuHelp->addAction(m_pActionAbout); setMenuBar(m_pMenuBar); @@ -279,7 +258,6 @@ void MainWindow::initConnections() connect(m_pActionStartBarrier, SIGNAL(triggered()), this, SLOT(startBarrier())); connect(m_pActionStopBarrier, SIGNAL(triggered()), this, SLOT(stopBarrier())); connect(m_pActionQuit, SIGNAL(triggered()), qApp, SLOT(quit())); - connect(&m_VersionChecker, SIGNAL(updateFound(const QString&)), this, SLOT(updateFound(const QString&))); } void MainWindow::saveSettings() @@ -343,16 +321,6 @@ void MainWindow::logError() } } -void MainWindow::updateFound(const QString &version) -{ - m_pWidgetUpdate->show(); - m_pLabelUpdate->setText( - tr("

Your version of Barrier is out of date. " - "Version %1 is now available to " - "download.

") - .arg(version).arg(DOWNLOAD_URL)); -} - void MainWindow::appendLogInfo(const QString& text) { appendLogRaw(getTimeStamp() + " INFO: " + text); @@ -470,12 +438,6 @@ void MainWindow::proofreadInfo() setBarrierState((qBarrierState)oldState); } -void MainWindow::showEvent(QShowEvent* event) -{ - QMainWindow::showEvent(event); - emit windowShown(); -} - void MainWindow::clearLog() { m_pLogOutput->clear(); @@ -1119,12 +1081,15 @@ bool MainWindow::isServiceRunning(QString name) return true; } } + + return false; +} #else bool MainWindow::isServiceRunning() { -#endif return false; } +#endif bool MainWindow::isBonjourRunning() { @@ -1298,11 +1263,6 @@ void MainWindow::bonjourInstallFinished() m_pCheckBoxAutoConfig->setChecked(true); } -void MainWindow::on_windowShown() -{ - // removed activation garbage; leaving stub to be optimized out -} - QString MainWindow::getProfileRootForArg() { CoreInterface coreInterface; diff --git a/src/gui/src/MainWindow.h b/src/gui/src/MainWindow.h index 74313796..725b7ed9 100644 --- a/src/gui/src/MainWindow.h +++ b/src/gui/src/MainWindow.h @@ -136,7 +136,6 @@ public slots: void stopBarrier(); void logOutput(); void logError(); - void updateFound(const QString& version); void bonjourInstallFinished(); protected: @@ -146,17 +145,14 @@ public slots: void setBarrierProcess(QProcess* p) { m_pBarrier = p; } void initConnections(); void createMenuBar(); - void createStatusBar(); void createTrayIcon(); void loadSettings(); void saveSettings(); void setIcon(qBarrierState state); void setBarrierState(qBarrierState state); - bool checkForApp(int which, QString& app); bool clientArgs(QStringList& args, QString& app); bool serverArgs(QStringList& args, QString& app); void setStatus(const QString& status); - void sendIpcMessage(qIpcMessageType type, const char* buffer, bool showErrors); void updateFromLogLine(const QString& line); QString getIPAddresses(); void stopService(); @@ -178,8 +174,6 @@ public slots: void restartBarrier(); void proofreadInfo(); - void showEvent (QShowEvent*); - void windowStateChanged(); @@ -196,9 +190,7 @@ public slots: VersionChecker m_VersionChecker; IpcClient m_IpcClient; QMenuBar* m_pMenuBar; - QMenu* m_pMenuFile; - QMenu* m_pMenuEdit; - QMenu* m_pMenuWindow; + QMenu* m_pMenuBarrier; QMenu* m_pMenuHelp; ZeroconfService* m_pZeroconfService; DataDownloader* m_pDataDownloader; @@ -218,10 +210,7 @@ private slots: void on_m_pComboServerList_currentIndexChanged(QString ); void on_m_pButtonApply_clicked(); void installBonjour(); - void on_windowShown(); -signals: - void windowShown(); }; #endif diff --git a/src/gui/src/MainWindowBase.ui b/src/gui/src/MainWindowBase.ui index 16f85dfe..8ac00713 100644 --- a/src/gui/src/MainWindowBase.ui +++ b/src/gui/src/MainWindowBase.ui @@ -27,57 +27,6 @@ - - - - - 2 - - - 0 - - - 0 - - - 8 - - - - - - - - :/res/icons/16x16/warning.png - - - - - - - m_pLabelUpdate - - - true - - - - - - - Qt::Horizontal - - - - 469 - 20 - - - - - - -