diff --git a/AUTHORS b/AUTHORS index 778db28..b0297f6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -28,7 +28,7 @@ N: Tobias Rundström E: tru@xmms.org W: http://tobi.nu/ P: 1024D/EA0C5340 E203 6001 264C 71CE DBFD 7A95 102A 11D0 EA0C 5340 -D: Main developer and coordinator. +D: Previous main developer and coordinator. N: Daniel Svensson E: daniel@nittionio.nu diff --git a/README b/README index ddd383a..899f4df 100644 --- a/README +++ b/README @@ -14,6 +14,6 @@ Compiling: 5) ???? 6) profit -Bugs: +Known bugs: Tons of them. diff --git a/TODO b/TODO index 25eda83..8191694 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,9 @@ Todo: -* Config - * ServerConfig - * ApplicationConfig -* Balance ++ Mainwindow + + Balancebackgrounds are wrong + + enable repeat button + + enable random play (will have to wait for a randomplay service client) * Playlist + Make displayed Information configurable + Add scrollbuttons to slider @@ -23,5 +23,3 @@ Todo: * Textbox * redraw text in textbox when switching skin. * figure out something smart on osx. -* xclient: - * connect disconnected callback, so that it emits 'disconnected ()' diff --git a/lib/lib.pro b/lib/lib.pro index b7666e2..6a97f62 100644 --- a/lib/lib.pro +++ b/lib/lib.pro @@ -7,14 +7,14 @@ OBJECTS_DIR = .obj SOURCES += xclient.cpp \ xclientcache.cpp \ - xsettings.cpp \ + xconfig.cpp \ playlistmodel.cpp \ xmmsqt4.cpp HEADERS += xclient.h \ xclientcache.h \ - xsettings.h \ + xconfig.h \ playlistmodel.h \ xmmsqt4.h \ debug.h diff --git a/lib/xclient.cpp b/lib/xclient.cpp index a0f73bc..a8450eb 100644 --- a/lib/xclient.cpp +++ b/lib/xclient.cpp @@ -73,7 +73,7 @@ XClient::XClient (QObject *parent, const std::string &name) : QObject (parent), m_client = NULL; m_isconnected = false; m_cache = new XClientCache (this, this); - m_settings = new XSettings (this, this); + m_config = new XConfig (this, this); m_name = name; } diff --git a/lib/xclient.h b/lib/xclient.h index d3e93c9..980133f 100644 --- a/lib/xclient.h +++ b/lib/xclient.h @@ -29,7 +29,9 @@ class XClient; #include #include "xclientcache.h" -#include "xsettings.h" +#include "xconfig.h" + +class XConfig; /* class XSettings : public QObject @@ -67,8 +69,8 @@ class XClient : public QObject { return m_cache; }; - XSettings *settings () const { - return m_settings; + XConfig *xconfig () const { + return m_config; }; const Xmms::Client *sync () const { @@ -103,7 +105,7 @@ class XClient : public QObject { std::string m_name; // Xmms::Client *m_client; XClientCache *m_cache; - XSettings *m_settings; + XConfig *m_config; bool m_isconnected; Xmms::Client m_sync; diff --git a/lib/xsettings.cpp b/lib/xconfig.cpp similarity index 77% rename from lib/xsettings.cpp rename to lib/xconfig.cpp index 208e09c..5cf1821 100644 --- a/lib/xsettings.cpp +++ b/lib/xconfig.cpp @@ -16,11 +16,11 @@ #include -#include "xsettings.h" +#include "xconfig.h" #include -XSettings::XSettings (QObject *parent, XClient *client) : QObject (parent) +XConfig::XConfig (QObject *parent, XClient *client) : QObject (parent) { m_ready = false; @@ -36,10 +36,10 @@ XSettings::XSettings (QObject *parent, XClient *client) : QObject (parent) } QString -XSettings::value_get (QString key) +XConfig::value_get (QString key) { - /* if XSettings is ready, the local cache should be in sync with the - * serverside settings, otherwise the cache is empty */ + /* if XConfig is ready, the local cache should be in sync with the + * serverside configuration, otherwise the cache is empty */ if (!m_ready) { return QString (); } @@ -47,7 +47,7 @@ XSettings::value_get (QString key) } bool -XSettings::value_set (QString key, QString val) +XConfig::value_set (QString key, QString val) { /* Only send change request to server here * update of local cache will be done through handle_config_value_changed @@ -65,7 +65,7 @@ XSettings::value_set (QString key, QString val) } bool -XSettings::value_register (QString key, QString defval) +XConfig::value_register (QString key, QString defval) { if (!m_client->isConnected ()) { return false; @@ -77,19 +77,19 @@ XSettings::value_register (QString key, QString defval) } void -XSettings::on_connect (XClient *client) +XConfig::on_connect (XClient *client) { client->config ()->valueList () - (Xmms::bind (&XSettings::handle_config_value, this)); + (Xmms::bind (&XConfig::handle_config_value, this)); client->config ()->broadcastValueChanged () - (Xmms::bind (&XSettings::handle_config_value_changed, this)); + (Xmms::bind (&XConfig::handle_config_value_changed, this)); m_client = client; } void -XSettings::on_disconnect (XClient *client) +XConfig::on_disconnect (XClient *client) { /* We don't emit any signals here, as every class must be able to * react on the configChanged signal, which will be fired for every @@ -100,7 +100,7 @@ XSettings::on_disconnect (XClient *client) } bool -XSettings::handle_config_value (const Xmms::Dict &value) +XConfig::handle_config_value (const Xmms::Dict &value) { bool ok = handle_config_value_changed (value); if (ok) { @@ -110,7 +110,7 @@ XSettings::handle_config_value (const Xmms::Dict &value) } bool -XSettings::handle_config_value_changed (const Xmms::Dict &value) +XConfig::handle_config_value_changed (const Xmms::Dict &value) { QHash tmp = XClient::convert_dict(value); diff --git a/lib/xsettings.h b/lib/xconfig.h similarity index 89% rename from lib/xsettings.h rename to lib/xconfig.h index e99ca6e..fc7145d 100644 --- a/lib/xsettings.h +++ b/lib/xconfig.h @@ -14,10 +14,8 @@ * GNU General Public License for more details. */ -#ifndef __XSETTINGS__ -#define __XSETTINGS__ - -class XSettings; +#ifndef __XConfig__ +#define __XConfig__ #include "xclient.h" @@ -25,11 +23,11 @@ class XSettings; #include #include -class XSettings : public QObject +class XConfig : public QObject { Q_OBJECT public: - XSettings (QObject *parent, XClient *client); + XConfig (QObject *parent, XClient *client); QString value_get (QString key); bool value_set (QString key, QString value); diff --git a/src/Display.cpp b/src/Display.cpp index dc52a8f..0f4049e 100644 --- a/src/Display.cpp +++ b/src/Display.cpp @@ -74,6 +74,7 @@ SkinDisplay::paintEvent (QPaintEvent *event) paint.end(); } + void SkinDisplay::fileOpen (void) { diff --git a/src/XMMSHandler.cpp b/src/XMMSHandler.cpp index 35f0ce2..2cf5191 100644 --- a/src/XMMSHandler.cpp +++ b/src/XMMSHandler.cpp @@ -179,6 +179,7 @@ XMMSHandler::DictToQHash (const std::string &key, } } +/* void XMMSHandler::PropDictToQHash (const std::string &key, const Xmms::Dict::Variant &value, @@ -196,7 +197,7 @@ XMMSHandler::PropDictToQHash (const std::string &key, QString::fromUtf8 (boost::get< std::string > (value).c_str())); } } - +*/ /* uint XMMSHandler::medialibQuery (QString q) diff --git a/src/XMMSHandler.h b/src/XMMSHandler.h index 1224445..39d4f51 100644 --- a/src/XMMSHandler.h +++ b/src/XMMSHandler.h @@ -103,10 +103,10 @@ class XMMSHandler : public XClient { void DictToQHash (const std::string &key, const Xmms::Dict::Variant &value, QHash &hash); - void PropDictToQHash (const std::string &key, - const Xmms::Dict::Variant &value, - const std::string &source, - QHash &hash); +// void PropDictToQHash (const std::string &key, +// const Xmms::Dict::Variant &value, +// const std::string &source, +// QHash &hash); bool volume_get (const Xmms::Dict &levels); bool volume_error (const std::string &error); diff --git a/src/equalizer/equalizerwidget.cpp b/src/equalizer/equalizerwidget.cpp index 8b39b66..8aef95e 100644 --- a/src/equalizer/equalizerwidget.cpp +++ b/src/equalizer/equalizerwidget.cpp @@ -14,7 +14,7 @@ */ #include "XMMSHandler.h" -#include "xsettings.h" +#include "xconfig.h" #include "equalizerwidget.h" @@ -49,7 +49,7 @@ EqualizerWidget::EqualizerWidget (QWidget *parent) : QWidget (parent) { Skin *skin = Skin::getInstance (); XMMSHandler &client = XMMSHandler::getInstance (); - m_xsettings = client.settings (); + m_xconfig = client.xconfig (); connect (skin, SIGNAL(skinChanged(Skin *)), this, SLOT(setPixmaps(Skin *))); @@ -93,25 +93,25 @@ EqualizerWidget::EqualizerWidget (QWidget *parent) : QWidget (parent) this, SLOT (updateServerBands (int, int))); } - connect (m_xsettings, SIGNAL (configChanged (QString, QString)), + connect (m_xconfig, SIGNAL (configChanged (QString, QString)), this, SLOT (serverConfigChanged (QString, QString))); - // if the settings from the server were already loaded, we will only + // if the config from the server were already loaded, we will only // receive configChanged signals for values that really change // so we must request the existing values manually - if (m_xsettings->isReady()) { + if (m_xconfig->isReady()) { QString key; QString value; // set enabled checkbox key = QString ("equalizer.enabled"); - value = m_xsettings->value_get (key); + value = m_xconfig->value_get (key); serverConfigChanged (key, value); // set preamp // Set band-sliders for (int i=0; i < 10; i++) { key = QString ("equalizer.legacy%1").arg(i); - value = m_xsettings->value_get (key); + value = m_xconfig->value_get (key); serverConfigChanged (key, value); } } @@ -185,22 +185,22 @@ EqualizerWidget::serverConfigChanged (QString key, QString value) void EqualizerWidget::setEqualizerEnabled (bool enabled) { if (enabled) { - m_xsettings->value_set ("equalizer.enabled", "1"); - m_xsettings->value_set ("equalizer.use_legacy", "1"); + m_xconfig->value_set ("equalizer.enabled", "1"); + m_xconfig->value_set ("equalizer.use_legacy", "1"); } else { - m_xsettings->value_set ("equalizer.enabled", "0"); + m_xconfig->value_set ("equalizer.enabled", "0"); } } void EqualizerWidget::updateServerPreamp (int value) { - m_xsettings->value_set ("equalizer.preamp", QString::number (value)); + m_xconfig->value_set ("equalizer.preamp", QString::number (value)); } void EqualizerWidget::updateServerBands (int value, int id) { QString key = QString ("equalizer.legacy%1").arg (id); - m_xsettings->value_set (key, QString::number (value)); + m_xconfig->value_set (key, QString::number (value)); } diff --git a/src/equalizer/equalizerwidget.h b/src/equalizer/equalizerwidget.h index 9d5baab..003427d 100644 --- a/src/equalizer/equalizerwidget.h +++ b/src/equalizer/equalizerwidget.h @@ -23,7 +23,7 @@ class QPixmap; class QPaintEvent; #include "VolumeSlider.h" -class XSettings; +class XConfig; class Skin; class Button; class ToggleButton; @@ -66,7 +66,7 @@ class EqualizerWidget : public QWidget void updateServerBands (int value, int id); private: - XSettings *m_xsettings; + XConfig *m_xconfig; QPixmap m_pixmap; QPixmap m_graph; ToggleButton *m_enable; diff --git a/src/playlist/playlistwidget.cpp b/src/playlist/playlistwidget.cpp index 25316ca..4f9769b 100644 --- a/src/playlist/playlistwidget.cpp +++ b/src/playlist/playlistwidget.cpp @@ -180,17 +180,17 @@ PlaylistWidget::PlaylistWidget (QWidget *parent) : QWidget (parent) m_view = new PlaylistView (this); m_view->move (10, 20); - m_view->resize (size().width()-30, size().height()-20-38); +// m_view->resize (size().width()-30, size().height()-20-38); // TODO: creation of Playlistmodel should be done elsewhere m_view->setModel (XMMSHandler::getInstance().getPlaylistModel()); - //m_list = new PlaylistList (m_view); - /* * This is a hack to make PlaylistScrollBar work with PlaylistView. * It is necessery because of limitations and at least one Bug in the * QT library (as of Version 4.3) * TODO: This might break in a future Qt version. Try to find a better solution + * FIXME: scrollbar is only visible if playlist was closed on startup or + * after resizing the playlist */ m_scrollBar = new PlaylistScrollBar (this); m_view->setVerticalScrollBar (m_scrollBar); @@ -208,7 +208,7 @@ PlaylistWidget::PlaylistWidget (QWidget *parent) : QWidget (parent) addButtons (); setMinimumSize (275, 116); - resize (275, 300); +// resize (275, 300); } void @@ -246,7 +246,6 @@ PlaylistWidget::addButtons (void) Skin::PLS_DEL_FIL_1); connect (b, SIGNAL (activated ()), m_view, SLOT (removeSelected ())); -// connect (b, SIGNAL(activated ()), m_list, SLOT (deleteFiles ())); /* Selection menu */ m_sel = new PlaylistMenu (this, Skin::PLS_SEL, @@ -370,7 +369,8 @@ void PlaylistWidget::setPixmaps (Skin *skin) { setActive (m_active); - resize (size().width(), size().height()); + + update (); } void diff --git a/src/playlist/playlistwidget.h b/src/playlist/playlistwidget.h index 001a5a7..19e9efd 100644 --- a/src/playlist/playlistwidget.h +++ b/src/playlist/playlistwidget.h @@ -19,23 +19,19 @@ #include "XMMSHandler.h" -#include -#include #include #include -class MainWindow; class PlaylistWidget; class PlaylistScroller; #include "Button.h" class Skin; -//class PlaylistList; class PlaylistView; -class PlaylistShade; class PlaylistMenu; + class PlaylistSizeGrip : public QSizeGrip { Q_OBJECT