mirror of
https://github.com/debauchee/barrier.git
synced 2026-07-04 10:56:26 +08:00
support for qt 5.2
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
QT += network
|
||||
QT += widgets network
|
||||
TEMPLATE = app
|
||||
TARGET = synergy
|
||||
DEPENDPATH += . \
|
||||
@@ -74,7 +74,6 @@ RESOURCES += res/Synergy.qrc
|
||||
RC_FILE = res/win/Synergy.rc
|
||||
macx {
|
||||
QMAKE_INFO_PLIST = res/mac/Info.plist
|
||||
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
|
||||
TARGET = Synergy
|
||||
QSYNERGY_ICON.files = res/mac/Synergy.icns
|
||||
QSYNERGY_ICON.path = Contents/Resources
|
||||
|
||||
@@ -31,7 +31,7 @@ AboutDialog::AboutDialog(QWidget* parent, const QString& synergyApp) :
|
||||
m_versionChecker.setApp(synergyApp);
|
||||
m_pLabelSynergyVersion->setText(m_versionChecker.getVersion());
|
||||
|
||||
// change default size based on os
|
||||
// change default size based on os
|
||||
#if defined(Q_OS_MAC)
|
||||
QSize size(600, 380);
|
||||
setMaximumSize(size);
|
||||
|
||||
@@ -42,10 +42,7 @@ IpcClient::~IpcClient()
|
||||
|
||||
void IpcClient::connected()
|
||||
{
|
||||
char typeBuf[1];
|
||||
typeBuf[0] = kIpcClientGui;
|
||||
sendHello();
|
||||
|
||||
infoMessage("connection established");
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class IpcClient : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
IpcClient();
|
||||
IpcClient();
|
||||
virtual ~IpcClient();
|
||||
|
||||
void sendHello();
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "KeySequenceWidget.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <QMouseEvent>
|
||||
|
||||
KeySequenceWidget::KeySequenceWidget(QWidget* parent, const KeySequence& seq) :
|
||||
QPushButton(parent),
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#define KEYSEQUENCEWIDGET__H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "KeySequence.h"
|
||||
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
#include <QtGui>
|
||||
#include <QtNetwork>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QMessageBox>
|
||||
#include <QFileDialog>
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
@@ -97,7 +101,7 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
|
||||
m_pElevateCheckBox->hide();
|
||||
#endif
|
||||
|
||||
// change default size based on os
|
||||
// change default size based on os
|
||||
#if defined(Q_OS_MAC)
|
||||
resize(720, 550);
|
||||
setMinimumSize(size());
|
||||
@@ -117,7 +121,7 @@ MainWindow::~MainWindow()
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
void MainWindow::start(bool firstRun)
|
||||
void MainWindow::start()
|
||||
{
|
||||
createTrayIcon();
|
||||
|
||||
@@ -226,8 +230,8 @@ void MainWindow::loadSettings()
|
||||
{
|
||||
// the next two must come BEFORE loading groupServerChecked and groupClientChecked or
|
||||
// disabling and/or enabling the right widgets won't automatically work
|
||||
m_pRadioExternalConfig->setChecked(settings().value("useExternalConfig", false).toBool());
|
||||
m_pRadioInternalConfig->setChecked(settings().value("useInternalConfig", true).toBool());
|
||||
m_pRadioExternalConfig->setChecked(settings().value("useExternalConfig", false).toBool());
|
||||
m_pRadioInternalConfig->setChecked(settings().value("useInternalConfig", true).toBool());
|
||||
|
||||
m_pGroupServer->setChecked(settings().value("groupServerChecked", false).toBool());
|
||||
m_pLineEditConfigFile->setText(settings().value("configFile", QDir::homePath() + "/" + synergyConfigName).toString());
|
||||
@@ -253,9 +257,9 @@ void MainWindow::saveSettings()
|
||||
{
|
||||
// program settings
|
||||
settings().setValue("groupServerChecked", m_pGroupServer->isChecked());
|
||||
settings().setValue("useExternalConfig", m_pRadioExternalConfig->isChecked());
|
||||
settings().setValue("useExternalConfig", m_pRadioExternalConfig->isChecked());
|
||||
settings().setValue("configFile", m_pLineEditConfigFile->text());
|
||||
settings().setValue("useInternalConfig", m_pRadioInternalConfig->isChecked());
|
||||
settings().setValue("useInternalConfig", m_pRadioInternalConfig->isChecked());
|
||||
settings().setValue("groupClientChecked", m_pGroupClient->isChecked());
|
||||
settings().setValue("serverHostname", m_pLineEditHostname->text());
|
||||
|
||||
@@ -355,7 +359,7 @@ void MainWindow::updateStateFromLogLine(const QString &line)
|
||||
|
||||
void MainWindow::clearLog()
|
||||
{
|
||||
m_pLogOutput->clear();
|
||||
m_pLogOutput->clear();
|
||||
}
|
||||
|
||||
void MainWindow::startSynergy()
|
||||
@@ -508,7 +512,7 @@ QString MainWindow::configFilename()
|
||||
if (!m_pTempConfigFile->open())
|
||||
{
|
||||
QMessageBox::critical(this, tr("Cannot write configuration file"), tr("The temporary configuration file required to start synergy can not be written."));
|
||||
return false;
|
||||
return "";
|
||||
}
|
||||
|
||||
serverConfig().save(*m_pTempConfigFile);
|
||||
@@ -524,7 +528,7 @@ QString MainWindow::configFilename()
|
||||
tr("You have not filled in a valid configuration file for the synergy server. "
|
||||
"Do you want to browse for the configuration file now?"), QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes
|
||||
|| !on_m_pButtonBrowseConfigFile_clicked())
|
||||
return false;
|
||||
return "";
|
||||
}
|
||||
|
||||
filename = m_pLineEditConfigFile->text();
|
||||
@@ -684,7 +688,7 @@ void MainWindow::setVisible(bool visible)
|
||||
m_pActionMinimize->setEnabled(visible);
|
||||
m_pActionRestore->setEnabled(!visible);
|
||||
|
||||
#if MAC_OS_X_VERSION_10_7
|
||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 // lion
|
||||
// dock hide only supported on lion :(
|
||||
ProcessSerialNumber psn = { 0, kCurrentProcess };
|
||||
GetCurrentProcess(&psn);
|
||||
|
||||
@@ -88,7 +88,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
|
||||
QString configFilename();
|
||||
QString address();
|
||||
QString appPath(const QString& name);
|
||||
void start(bool firstRun);
|
||||
void start();
|
||||
void clearLog();
|
||||
VersionChecker& versionChecker() { return m_VersionChecker; }
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
#include <QMessageBox>
|
||||
|
||||
ScreenSettingsDialog::ScreenSettingsDialog(QWidget* parent, Screen* pScreen) :
|
||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
#include <QMessageBox>
|
||||
#include <QFileDialog>
|
||||
|
||||
SettingsDialog::SettingsDialog(QWidget* parent, AppConfig& config) :
|
||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
|
||||
@@ -205,7 +205,7 @@ void SetupWizard::accept()
|
||||
|
||||
if (m_StartMain)
|
||||
{
|
||||
m_MainWindow.start(true);
|
||||
m_MainWindow.start();
|
||||
}
|
||||
|
||||
QWizard::accept();
|
||||
@@ -217,7 +217,7 @@ void SetupWizard::reject()
|
||||
|
||||
if (m_StartMain)
|
||||
{
|
||||
m_MainWindow.start(true);
|
||||
m_MainWindow.start();
|
||||
}
|
||||
|
||||
QWizard::reject();
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "SynergyLocale.h"
|
||||
|
||||
#include <QResource>
|
||||
#include <QtXml/QXmlStreamReader>
|
||||
#include <QXmlStreamReader>
|
||||
#include <QDebug>
|
||||
|
||||
SynergyLocale::SynergyLocale()
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
#include <QSettings>
|
||||
#include <QMessageBox>
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
#include <Carbon/Carbon.h>
|
||||
@@ -93,7 +94,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
mainWindow.start(false);
|
||||
mainWindow.start();
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
@@ -126,7 +127,7 @@ int waitForTray()
|
||||
#if defined(Q_OS_MAC)
|
||||
bool checkMacAssistiveDevices()
|
||||
{
|
||||
#if defined(MAC_OS_X_VERSION_10_9) // mavericks
|
||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 // mavericks
|
||||
|
||||
// new in mavericks, applications are trusted individually
|
||||
// with use of the accessibility api. this call will show a
|
||||
|
||||
Reference in New Issue
Block a user