OTHER: Small changes to fix problems with some window managers
This commit is contained in:
parent
d0d07f7553
commit
fbb7808c7f
4 changed files with 37 additions and 26 deletions
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QSettings>
|
||||||
|
|
||||||
Skin *Skin::singleton = NULL;
|
Skin *Skin::singleton = NULL;
|
||||||
|
|
||||||
|
@ -33,6 +34,9 @@ Skin::Skin ()
|
||||||
{
|
{
|
||||||
setSizes ();
|
setSizes ();
|
||||||
setPositions ();
|
setPositions ();
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
setSkin (settings.value("skin/path", ":CleanAMP/").toString ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "equalizerwindow.h"
|
||||||
|
#include "playlistwindow.h"
|
||||||
#include "Skin.h"
|
#include "Skin.h"
|
||||||
|
|
||||||
#ifdef HAVE_SERVERBROWSER
|
#ifdef HAVE_SERVERBROWSER
|
||||||
|
@ -29,6 +31,10 @@
|
||||||
|
|
||||||
Application::Application (int &argc, char **argv) : QApplication (argc, argv)
|
Application::Application (int &argc, char **argv) : QApplication (argc, argv)
|
||||||
{
|
{
|
||||||
|
setOrganizationName("xmms2");
|
||||||
|
setOrganizationDomain("xmms.org");
|
||||||
|
setApplicationName("Promoe");
|
||||||
|
|
||||||
//TODO: Change to XClient sometime later
|
//TODO: Change to XClient sometime later
|
||||||
XMMSHandler &client = XMMSHandler::getInstance ();
|
XMMSHandler &client = XMMSHandler::getInstance ();
|
||||||
|
|
||||||
|
@ -37,6 +43,27 @@ Application::Application (int &argc, char **argv) : QApplication (argc, argv)
|
||||||
connect (&client, SIGNAL(disconnected(XClient *)),
|
connect (&client, SIGNAL(disconnected(XClient *)),
|
||||||
this, SLOT(handleDisconnected ()));
|
this, SLOT(handleDisconnected ()));
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
|
MainWindow *mw = new MainWindow (NULL);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Now that everything is initialized
|
||||||
|
* open the skin and send the
|
||||||
|
* SkinChanged signal that will cause
|
||||||
|
* all widgets to get their pixmaps
|
||||||
|
* TODO: Now the Skin class loads the skin itself. This call is necessarry until
|
||||||
|
* all widgets that receive the skinChanged signal fetch their pixmaps themself
|
||||||
|
* on startup
|
||||||
|
*/
|
||||||
|
Skin::getInstance()->setSkin (settings.value("skin/path").toString ());
|
||||||
|
|
||||||
|
mw->show ();
|
||||||
|
// The Playlist- and EqualizerWindow has to become visible after the mainwindow
|
||||||
|
// because metacity (gnome-windowmanager) can't handle them correctly otherwise
|
||||||
|
mw->getEQ ()->setVisible (settings.value ("equalizer/visible", false).toBool ());
|
||||||
|
mw->getPL ()->setVisible (settings.value ("playlist/visible", false).toBool ());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -69,9 +96,6 @@ main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
Application app(argc, argv);
|
Application app(argc, argv);
|
||||||
|
|
||||||
QCoreApplication::setOrganizationName("xmms2");
|
|
||||||
QCoreApplication::setOrganizationDomain("xmms.org");
|
|
||||||
QCoreApplication::setApplicationName("Promoe");
|
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
|
@ -82,21 +106,6 @@ main (int argc, char **argv)
|
||||||
*/
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MainWindow *mw = new MainWindow (NULL);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Now that everything is initialized
|
|
||||||
* open the skin and send the
|
|
||||||
* SkinChanged signal that will cause
|
|
||||||
* all widgets to get their pixmaps
|
|
||||||
*/
|
|
||||||
if (!settings.contains ("skin/path")) {
|
|
||||||
settings.setValue ("skin/path", ":CleanAMP/");
|
|
||||||
}
|
|
||||||
|
|
||||||
Skin::getInstance()->setSkin (settings.value("skin/path").toString ());
|
|
||||||
|
|
||||||
mw->show ();
|
|
||||||
|
|
||||||
#ifdef HAVE_SERVERBROWSER
|
#ifdef HAVE_SERVERBROWSER
|
||||||
ServerBrowserWindow *browser = new ServerBrowserWindow (mw);
|
ServerBrowserWindow *browser = new ServerBrowserWindow (mw);
|
||||||
|
|
|
@ -38,7 +38,7 @@ MainWindow::MainWindow (QWidget *parent) : BaseWindow (parent)
|
||||||
QSettings s;
|
QSettings s;
|
||||||
|
|
||||||
setWindowFlags(Qt::FramelessWindowHint);
|
setWindowFlags(Qt::FramelessWindowHint);
|
||||||
setGeometry(100, 100, 275, 116);
|
setMaximumSize (275, 116);
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
setWindowIcon (QIcon (":icon.png"));
|
setWindowIcon (QIcon (":icon.png"));
|
||||||
#endif
|
#endif
|
||||||
|
@ -48,6 +48,10 @@ MainWindow::MainWindow (QWidget *parent) : BaseWindow (parent)
|
||||||
else
|
else
|
||||||
setShaded (!isShaded ());
|
setShaded (!isShaded ());
|
||||||
|
|
||||||
|
if (!s.contains ("mainwindow/pos"))
|
||||||
|
s.setValue ("mainwindow/pos", QPoint (100, 100));
|
||||||
|
move (s.value("mainwindow/pos").toPoint ());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* initialize EqualizerWindow
|
* initialize EqualizerWindow
|
||||||
*/
|
*/
|
||||||
|
@ -57,7 +61,6 @@ MainWindow::MainWindow (QWidget *parent) : BaseWindow (parent)
|
||||||
pos ().y ()+size ().height ()));
|
pos ().y ()+size ().height ()));
|
||||||
}
|
}
|
||||||
m_equalizer->move (s.value ("equalizer/pos").toPoint ());
|
m_equalizer->move (s.value ("equalizer/pos").toPoint ());
|
||||||
m_equalizer->setVisible (s.value ("equalizer/visible", false).toBool ());
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* initialtize PlaylistWindow
|
* initialtize PlaylistWindow
|
||||||
|
@ -70,7 +73,6 @@ MainWindow::MainWindow (QWidget *parent) : BaseWindow (parent)
|
||||||
m_playlistwin->move (s.value ("playlist/pos").toPoint ());
|
m_playlistwin->move (s.value ("playlist/pos").toPoint ());
|
||||||
// FIXME: this should be done in PlaylistWindow.
|
// FIXME: this should be done in PlaylistWindow.
|
||||||
// But promoe segfaults if done so
|
// But promoe segfaults if done so
|
||||||
m_playlistwin->setVisible (s.value("playlist/visible", false).toBool ());
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The MainDisplay is the mainwindow non-shaded mode
|
* The MainDisplay is the mainwindow non-shaded mode
|
||||||
|
@ -93,10 +95,6 @@ MainWindow::MainWindow (QWidget *parent) : BaseWindow (parent)
|
||||||
|
|
||||||
switchDisplay ();
|
switchDisplay ();
|
||||||
|
|
||||||
if (!s.contains ("mainwindow/pos"))
|
|
||||||
s.setValue ("mainwindow/pos", QPoint (100, 100));
|
|
||||||
|
|
||||||
move (s.value("mainwindow/pos").toPoint ());
|
|
||||||
|
|
||||||
attachWidgets ();
|
attachWidgets ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ class MainWindow : public BaseWindow
|
||||||
void moveEvent (QMoveEvent *event);
|
void moveEvent (QMoveEvent *event);
|
||||||
|
|
||||||
bool isTimemodeReverse(void) { QSettings s; return s.value("MainWindow/timemodereverse").toBool(); }
|
bool isTimemodeReverse(void) { QSettings s; return s.value("MainWindow/timemodereverse").toBool(); }
|
||||||
void setTimemodeReverse(bool b) { QSettings s; return s.setValue("MainWindow/timemodereverse",b); }
|
void setTimemodeReverse(bool b) { QSettings s; s.setValue("MainWindow/timemodereverse",b); }
|
||||||
|
|
||||||
void attachWidgets ();
|
void attachWidgets ();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue