OTHER: Fix crash on disconnected server.

Promoe now displays a message box, telling about what happened and
terminates correctly after that
This commit is contained in:
Thomas Frauendorfer 2008-07-03 10:39:54 +02:00
parent c0ca792481
commit 8221642227
4 changed files with 22 additions and 3 deletions

View file

@ -39,6 +39,7 @@
#include <QFileDialog>
#include <QSettings>
#include <QDebug>
#include <QMessageBox>
MainDisplay::MainDisplay (QWidget *parent) : SkinDisplay(parent)
{
@ -110,8 +111,21 @@ MainDisplay::MainDisplay (QWidget *parent) : SkinDisplay(parent)
client.volumeGet();
setupServerConfig ();
//TODO: move to better place
connect (&client, SIGNAL(disconnected(XClient *)), this, SLOT(handleDisconnected ()));
}
void
MainDisplay::handleDisconnected ()
{
QMessageBox::critical( this, "xmms2 daemon disconnecte",
"The xmms2 deamon has disconnected\n"
"This could be because the server crashed\n"
"or because another client has shut down the sever.",
"Quit Promoe");
qApp->quit ();
}
void
MainDisplay::updateVolume (uint volume)

View file

@ -77,7 +77,7 @@ class MainDisplay : public SkinDisplay
protected slots:
void serverConfigChanged (QString key, QString value);
void setRepeatAllEnabled (bool enabled);
void handleDisconnected ();
protected:
void SetupPushButtons (void);
void SetupToggleButtons (void);