Connect the refresh database signal with the manager slot.
This commit is contained in:
@@ -58,6 +58,7 @@ void ClientManager::refreshDatabase()
|
||||
db.destroy();
|
||||
int count = db.create();
|
||||
qDebug("Added %i entries to the database", count);
|
||||
emit databaseUpdated(tr("Added %1 entries to the database").arg(count));
|
||||
}
|
||||
|
||||
void ClientManager::stop()
|
||||
|
@@ -27,6 +27,7 @@ signals:
|
||||
void deviceConnected(QString);
|
||||
void deviceDisconnected();
|
||||
void receivedPin(int);
|
||||
void databaseUpdated(QString);
|
||||
void stopped();
|
||||
|
||||
private slots:
|
||||
|
@@ -49,6 +49,7 @@ void MainWidget::checkSettings()
|
||||
return;
|
||||
}
|
||||
}
|
||||
first_run = false;
|
||||
manager.start();
|
||||
}
|
||||
|
||||
@@ -94,6 +95,7 @@ void MainWidget::connectSignals()
|
||||
connect(&dialog, SIGNAL(finished(int)), this, SLOT(dialogResult(int)));
|
||||
connect(&manager, SIGNAL(stopped()), qApp, SLOT(quit()));
|
||||
connect(&manager, SIGNAL(receivedPin(int)), this, SLOT(showPin(int)));
|
||||
connect(&manager, SIGNAL(databaseUpdated(QString)), this, SLOT(receiveMessage(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()));
|
||||
@@ -111,7 +113,7 @@ void MainWidget::createTrayIcon()
|
||||
quit = new QAction(tr("&Quit"), this);
|
||||
|
||||
connect(options, SIGNAL(triggered()), &dialog, SLOT(open()));
|
||||
//connect(reload, SIGNAL(triggered()), &CmaWorker, SLOT(allowRefresh()), Qt::DirectConnection);
|
||||
connect(reload, SIGNAL(triggered()), &manager, SLOT(refreshDatabase()));
|
||||
connect(quit, SIGNAL(triggered()), this, SLOT(stopServer()));
|
||||
|
||||
QMenu *trayIconMenu = new QMenu(this);
|
||||
@@ -125,7 +127,7 @@ void MainWidget::createTrayIcon()
|
||||
trayIcon->setIcon(QIcon(":/main/resources/psv_icon.png"));
|
||||
trayIcon->show();
|
||||
// try to avoid the iconTray Qt bug
|
||||
//Sleeper::sleep(1);
|
||||
Sleeper::sleep(1);
|
||||
}
|
||||
|
||||
void MainWidget::receiveMessage(QString message)
|
||||
|
Reference in New Issue
Block a user