Merge pull request #7 from xiannox/testing
Merge Xian Nox qcma branch into testing
This commit is contained in:
8
qcma.pro
8
qcma.pro
@@ -92,6 +92,14 @@ VERSION = \\\"'0.2.5'\\\"
|
|||||||
|
|
||||||
DEFINES += "QCMA_VER=$${VERSION}"
|
DEFINES += "QCMA_VER=$${VERSION}"
|
||||||
|
|
||||||
|
GET_HASHES {
|
||||||
|
message("Retrieving git hashes")
|
||||||
|
unix {
|
||||||
|
DEFINES += "QCMA_BUILD_HASH=\"\\\"$$system(git rev-parse --short HEAD)\\\"\""
|
||||||
|
DEFINES += "QCMA_BUILD_BRANCH=\"\\\"$$system(git rev-parse --abbrev-ref HEAD)\\\"\""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
unix {
|
unix {
|
||||||
isEmpty(PREFIX) {
|
isEmpty(PREFIX) {
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
|
@@ -610,7 +610,10 @@ void CmaEvent::vitaEventGetSettingInfo(vita_event_t *event, int eventId)
|
|||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
// Always refresh the account name
|
// Always refresh the account name
|
||||||
|
if(qstrcmp(settingsinfo->current_account.userName, "mtpr3InvalidUserName") != 0) {
|
||||||
|
// wewt, the Vita didn't go full retard again
|
||||||
settings.setValue("lastOnlineId", settingsinfo->current_account.userName);
|
settings.setValue("lastOnlineId", settingsinfo->current_account.userName);
|
||||||
|
}
|
||||||
|
|
||||||
if(settings.value("lastAccountId").toString() != settingsinfo->current_account.accountId) {
|
if(settings.value("lastAccountId").toString() != settingsinfo->current_account.accountId) {
|
||||||
db->setUUID(settingsinfo->current_account.accountId);
|
db->setUUID(settingsinfo->current_account.accountId);
|
||||||
|
@@ -36,6 +36,8 @@
|
|||||||
|
|
||||||
const QStringList MainWidget::path_list = QStringList() << "photoPath" << "musicPath" << "videoPath" << "appsPath" << "urlPath";
|
const QStringList MainWidget::path_list = QStringList() << "photoPath" << "musicPath" << "videoPath" << "appsPath" << "urlPath";
|
||||||
|
|
||||||
|
bool sleptOnce = false;
|
||||||
|
|
||||||
MainWidget::MainWidget(QWidget *parent) :
|
MainWidget::MainWidget(QWidget *parent) :
|
||||||
QWidget(parent)
|
QWidget(parent)
|
||||||
{
|
{
|
||||||
@@ -89,13 +91,14 @@ void MainWidget::deviceDisconnect()
|
|||||||
|
|
||||||
void MainWidget::deviceConnected(QString message)
|
void MainWidget::deviceConnected(QString message)
|
||||||
{
|
{
|
||||||
Q_UNUSED(message);
|
|
||||||
#ifndef Q_OS_WIN32
|
#ifndef Q_OS_WIN32
|
||||||
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon.png"));
|
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon.png"));
|
||||||
#else
|
#else
|
||||||
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon_16.png"));
|
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon_16.png"));
|
||||||
#endif
|
#endif
|
||||||
qDebug("Icon changed - connected");
|
qDebug("Icon changed - connected");
|
||||||
|
setTrayTooltip(message);
|
||||||
|
receiveMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWidget::prepareApplication()
|
void MainWidget::prepareApplication()
|
||||||
@@ -110,8 +113,6 @@ void MainWidget::connectSignals()
|
|||||||
connect(&dialog, SIGNAL(finished(int)), this, SLOT(dialogResult(int)));
|
connect(&dialog, SIGNAL(finished(int)), this, SLOT(dialogResult(int)));
|
||||||
connect(&manager, SIGNAL(stopped()), qApp, SLOT(quit()));
|
connect(&manager, SIGNAL(stopped()), qApp, SLOT(quit()));
|
||||||
connect(&manager, SIGNAL(deviceConnected(QString)), this, SLOT(deviceConnected(QString)));
|
connect(&manager, SIGNAL(deviceConnected(QString)), this, SLOT(deviceConnected(QString)));
|
||||||
connect(&manager, SIGNAL(deviceConnected(QString)), this, SLOT(receiveMessage(QString)));
|
|
||||||
connect(&manager, SIGNAL(deviceConnected(QString)), this, SLOT(setTrayTooltip(QString)));
|
|
||||||
connect(&manager, SIGNAL(deviceDisconnected()), this, SLOT(deviceDisconnect()));
|
connect(&manager, SIGNAL(deviceDisconnected()), this, SLOT(deviceDisconnect()));
|
||||||
connect(&manager, SIGNAL(messageSent(QString)), this, SLOT(receiveMessage(QString)));
|
connect(&manager, SIGNAL(messageSent(QString)), this, SLOT(receiveMessage(QString)));
|
||||||
|
|
||||||
@@ -135,7 +136,11 @@ void MainWidget::showAboutDialog()
|
|||||||
|
|
||||||
about.setText(QString("QCMA ") + QCMA_VER);
|
about.setText(QString("QCMA ") + QCMA_VER);
|
||||||
about.setWindowTitle(tr("About QCMA"));
|
about.setWindowTitle(tr("About QCMA"));
|
||||||
|
#ifndef QCMA_BUILD_HASH
|
||||||
about.setInformativeText(tr("Copyright (C) 2013 Codestation") + "\n");
|
about.setInformativeText(tr("Copyright (C) 2013 Codestation") + "\n");
|
||||||
|
#else
|
||||||
|
about.setInformativeText(tr("Copyright (C) 2013 Codestation\n\nbuild hash: %1\nbuild branch: %2").arg(QCMA_BUILD_HASH).arg(QCMA_BUILD_BRANCH));
|
||||||
|
#endif
|
||||||
about.setStandardButtons(QMessageBox::Ok);
|
about.setStandardButtons(QMessageBox::Ok);
|
||||||
about.setIconPixmap(QPixmap(":/main/resources/images/qcma.png"));
|
about.setIconPixmap(QPixmap(":/main/resources/images/qcma.png"));
|
||||||
about.setDefaultButton(QMessageBox::Ok);
|
about.setDefaultButton(QMessageBox::Ok);
|
||||||
@@ -177,6 +182,7 @@ void MainWidget::createTrayIcon()
|
|||||||
trayIconMenu->addSeparator();
|
trayIconMenu->addSeparator();
|
||||||
trayIconMenu->addAction(about);
|
trayIconMenu->addAction(about);
|
||||||
trayIconMenu->addAction(about_qt);
|
trayIconMenu->addAction(about_qt);
|
||||||
|
trayIconMenu->addSeparator();
|
||||||
trayIconMenu->addAction(quit);
|
trayIconMenu->addAction(quit);
|
||||||
|
|
||||||
trayIcon = new QSystemTrayIcon(this);
|
trayIcon = new QSystemTrayIcon(this);
|
||||||
@@ -188,11 +194,18 @@ void MainWidget::createTrayIcon()
|
|||||||
#endif
|
#endif
|
||||||
trayIcon->show();
|
trayIcon->show();
|
||||||
// try to avoid the iconTray Qt bug
|
// try to avoid the iconTray Qt bug
|
||||||
Sleeper::sleep(1);
|
//Sleeper::sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWidget::receiveMessage(QString message)
|
void MainWidget::receiveMessage(QString message)
|
||||||
{
|
{
|
||||||
|
// a timeout is added before the popups are displayed to prevent them from
|
||||||
|
// appearing in the wrong location
|
||||||
|
if(!sleptOnce) {
|
||||||
|
Sleeper::sleep(1);
|
||||||
|
sleptOnce = true;
|
||||||
|
}
|
||||||
|
|
||||||
if(trayIcon->isVisible()) {
|
if(trayIcon->isVisible()) {
|
||||||
trayIcon->showMessage(tr("Information"), message);
|
trayIcon->showMessage(tr("Information"), message);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user