redo GUI menu a bit; remove unused items

This commit is contained in:
walker0643 2018-02-25 13:37:29 -05:00
parent 1648c1d51a
commit c1827bde51
3 changed files with 14 additions and 116 deletions

View File

@ -85,9 +85,7 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
m_pTrayIconMenu(NULL), m_pTrayIconMenu(NULL),
m_AlreadyHidden(false), m_AlreadyHidden(false),
m_pMenuBar(NULL), m_pMenuBar(NULL),
m_pMenuFile(NULL), m_pMenuBarrier(NULL),
m_pMenuEdit(NULL),
m_pMenuWindow(NULL),
m_pMenuHelp(NULL), m_pMenuHelp(NULL),
m_pZeroconfService(NULL), m_pZeroconfService(NULL),
m_pDataDownloader(NULL), m_pDataDownloader(NULL),
@ -105,8 +103,6 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
loadSettings(); loadSettings();
initConnections(); initConnections();
m_pWidgetUpdate->hide();
m_VersionChecker.setApp(appPath(appConfig.barriercName()));
m_pLabelScreenName->setText(getScreenName()); m_pLabelScreenName->setText(getScreenName());
m_pLabelIpAddresses->setText(getIPAddresses()); m_pLabelIpAddresses->setText(getIPAddresses());
@ -136,9 +132,6 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
sslToggled(appConfig.getCryptoEnabled()); sslToggled(appConfig.getCryptoEnabled());
connect (this, SIGNAL(windowShown()),
this, SLOT(on_windowShown()), Qt::QueuedConnection);
connect (m_AppConfig, SIGNAL(sslToggled(bool)), connect (m_AppConfig, SIGNAL(sslToggled(bool)),
this, SLOT(sslToggled(bool)), Qt::QueuedConnection); this, SLOT(sslToggled(bool)), Qt::QueuedConnection);
} }
@ -175,8 +168,6 @@ void MainWindow::open()
showNormal(); showNormal();
} }
m_VersionChecker.checkLatest();
if (!appConfig().autoConfigPrompted()) { if (!appConfig().autoConfigPrompted()) {
promptAutoConfig(); promptAutoConfig();
} }
@ -223,37 +214,25 @@ void MainWindow::createTrayIcon()
void MainWindow::retranslateMenuBar() void MainWindow::retranslateMenuBar()
{ {
m_pMenuFile->setTitle(tr("&File")); m_pMenuBarrier->setTitle(tr("&Barrier"));
m_pMenuEdit->setTitle(tr("&Edit"));
m_pMenuWindow->setTitle(tr("&Window"));
m_pMenuHelp->setTitle(tr("&Help")); m_pMenuHelp->setTitle(tr("&Help"));
} }
void MainWindow::createMenuBar() void MainWindow::createMenuBar()
{ {
m_pMenuBar = new QMenuBar(this); m_pMenuBar = new QMenuBar(this);
m_pMenuFile = new QMenu("", m_pMenuBar); m_pMenuBarrier = new QMenu("", m_pMenuBar);
m_pMenuEdit = new QMenu("", m_pMenuBar);
m_pMenuWindow = new QMenu("", m_pMenuBar);
m_pMenuHelp = new QMenu("", m_pMenuBar); m_pMenuHelp = new QMenu("", m_pMenuBar);
retranslateMenuBar(); retranslateMenuBar();
m_pMenuBar->addAction(m_pMenuFile->menuAction()); m_pMenuBar->addAction(m_pMenuBarrier->menuAction());
m_pMenuBar->addAction(m_pMenuEdit->menuAction());
#if !defined(Q_OS_MAC)
m_pMenuBar->addAction(m_pMenuWindow->menuAction());
#endif
m_pMenuBar->addAction(m_pMenuHelp->menuAction()); m_pMenuBar->addAction(m_pMenuHelp->menuAction());
m_pMenuFile->addAction(m_pActionStartBarrier); m_pMenuBarrier->addAction(m_pActionSave);
m_pMenuFile->addAction(m_pActionStopBarrier); m_pMenuBarrier->addSeparator();
m_pMenuFile->addSeparator(); m_pMenuBarrier->addAction(m_pActionSettings);
m_pMenuFile->addAction(m_pActionSave); m_pMenuBarrier->addSeparator();
m_pMenuFile->addSeparator(); m_pMenuBarrier->addAction(m_pActionQuit);
m_pMenuFile->addAction(m_pActionQuit);
m_pMenuEdit->addAction(m_pActionSettings);
m_pMenuWindow->addAction(m_pActionMinimize);
m_pMenuWindow->addAction(m_pActionRestore);
m_pMenuHelp->addAction(m_pActionAbout); m_pMenuHelp->addAction(m_pActionAbout);
setMenuBar(m_pMenuBar); setMenuBar(m_pMenuBar);
@ -279,7 +258,6 @@ void MainWindow::initConnections()
connect(m_pActionStartBarrier, SIGNAL(triggered()), this, SLOT(startBarrier())); connect(m_pActionStartBarrier, SIGNAL(triggered()), this, SLOT(startBarrier()));
connect(m_pActionStopBarrier, SIGNAL(triggered()), this, SLOT(stopBarrier())); connect(m_pActionStopBarrier, SIGNAL(triggered()), this, SLOT(stopBarrier()));
connect(m_pActionQuit, SIGNAL(triggered()), qApp, SLOT(quit())); connect(m_pActionQuit, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(&m_VersionChecker, SIGNAL(updateFound(const QString&)), this, SLOT(updateFound(const QString&)));
} }
void MainWindow::saveSettings() void MainWindow::saveSettings()
@ -343,16 +321,6 @@ void MainWindow::logError()
} }
} }
void MainWindow::updateFound(const QString &version)
{
m_pWidgetUpdate->show();
m_pLabelUpdate->setText(
tr("<p>Your version of Barrier is out of date. "
"Version <b>%1</b> is now available to "
"<a href=\"%2\">download</a>.</p>")
.arg(version).arg(DOWNLOAD_URL));
}
void MainWindow::appendLogInfo(const QString& text) void MainWindow::appendLogInfo(const QString& text)
{ {
appendLogRaw(getTimeStamp() + " INFO: " + text); appendLogRaw(getTimeStamp() + " INFO: " + text);
@ -470,12 +438,6 @@ void MainWindow::proofreadInfo()
setBarrierState((qBarrierState)oldState); setBarrierState((qBarrierState)oldState);
} }
void MainWindow::showEvent(QShowEvent* event)
{
QMainWindow::showEvent(event);
emit windowShown();
}
void MainWindow::clearLog() void MainWindow::clearLog()
{ {
m_pLogOutput->clear(); m_pLogOutput->clear();
@ -1119,12 +1081,15 @@ bool MainWindow::isServiceRunning(QString name)
return true; return true;
} }
} }
return false;
}
#else #else
bool MainWindow::isServiceRunning() bool MainWindow::isServiceRunning()
{ {
#endif
return false; return false;
} }
#endif
bool MainWindow::isBonjourRunning() bool MainWindow::isBonjourRunning()
{ {
@ -1298,11 +1263,6 @@ void MainWindow::bonjourInstallFinished()
m_pCheckBoxAutoConfig->setChecked(true); m_pCheckBoxAutoConfig->setChecked(true);
} }
void MainWindow::on_windowShown()
{
// removed activation garbage; leaving stub to be optimized out
}
QString MainWindow::getProfileRootForArg() QString MainWindow::getProfileRootForArg()
{ {
CoreInterface coreInterface; CoreInterface coreInterface;

View File

@ -136,7 +136,6 @@ public slots:
void stopBarrier(); void stopBarrier();
void logOutput(); void logOutput();
void logError(); void logError();
void updateFound(const QString& version);
void bonjourInstallFinished(); void bonjourInstallFinished();
protected: protected:
@ -146,17 +145,14 @@ public slots:
void setBarrierProcess(QProcess* p) { m_pBarrier = p; } void setBarrierProcess(QProcess* p) { m_pBarrier = p; }
void initConnections(); void initConnections();
void createMenuBar(); void createMenuBar();
void createStatusBar();
void createTrayIcon(); void createTrayIcon();
void loadSettings(); void loadSettings();
void saveSettings(); void saveSettings();
void setIcon(qBarrierState state); void setIcon(qBarrierState state);
void setBarrierState(qBarrierState state); void setBarrierState(qBarrierState state);
bool checkForApp(int which, QString& app);
bool clientArgs(QStringList& args, QString& app); bool clientArgs(QStringList& args, QString& app);
bool serverArgs(QStringList& args, QString& app); bool serverArgs(QStringList& args, QString& app);
void setStatus(const QString& status); void setStatus(const QString& status);
void sendIpcMessage(qIpcMessageType type, const char* buffer, bool showErrors);
void updateFromLogLine(const QString& line); void updateFromLogLine(const QString& line);
QString getIPAddresses(); QString getIPAddresses();
void stopService(); void stopService();
@ -178,8 +174,6 @@ public slots:
void restartBarrier(); void restartBarrier();
void proofreadInfo(); void proofreadInfo();
void showEvent (QShowEvent*);
void windowStateChanged(); void windowStateChanged();
@ -196,9 +190,7 @@ public slots:
VersionChecker m_VersionChecker; VersionChecker m_VersionChecker;
IpcClient m_IpcClient; IpcClient m_IpcClient;
QMenuBar* m_pMenuBar; QMenuBar* m_pMenuBar;
QMenu* m_pMenuFile; QMenu* m_pMenuBarrier;
QMenu* m_pMenuEdit;
QMenu* m_pMenuWindow;
QMenu* m_pMenuHelp; QMenu* m_pMenuHelp;
ZeroconfService* m_pZeroconfService; ZeroconfService* m_pZeroconfService;
DataDownloader* m_pDataDownloader; DataDownloader* m_pDataDownloader;
@ -218,10 +210,7 @@ private slots:
void on_m_pComboServerList_currentIndexChanged(QString ); void on_m_pComboServerList_currentIndexChanged(QString );
void on_m_pButtonApply_clicked(); void on_m_pButtonApply_clicked();
void installBonjour(); void installBonjour();
void on_windowShown();
signals:
void windowShown();
}; };
#endif #endif

View File

@ -27,57 +27,6 @@
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QWidget" name="m_pWidgetUpdate" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>8</number>
</property>
<item>
<widget class="QLabel" name="m_pIconUpdate">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="Barrier.qrc">:/res/icons/16x16/warning.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_pLabelUpdate">
<property name="text">
<string notr="true">m_pLabelUpdate</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="m_pSpacerUpdate">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>469</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QGroupBox" name="m_pGroupServer"> <widget class="QGroupBox" name="m_pGroupServer">
<property name="sizePolicy"> <property name="sizePolicy">