1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-07 14:46:33 +02:00

icon update

add zeroconf config too
This commit is contained in:
Leo Franchi
2011-05-03 23:21:00 -04:00
parent c854a090e6
commit f774ae4731
17 changed files with 163 additions and 120 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 757 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

View File

@@ -1,4 +1,4 @@
<!DOCTYPE RCC><RCC version="1.0">
<RCC>
<qresource>
<file>./data/images/add-friend-button-pressed.png</file>
<file>./data/images/add-friend-button-rest.png</file>
@@ -15,6 +15,10 @@
<file>./data/images/pause-rest.png</file>
<file>./data/images/play-pressed.png</file>
<file>./data/images/play-rest.png</file>
<file>data/images/sipplugin-add.png</file>
<file>data/images/seek-slider-level.png</file>
<file>data/images/shuffle-off-rest.png</file>
<file>data/images/sipplugin-remove.png</file>
<file>./data/images/playlist-icon.png</file>
<file>./data/images/repeat-1-on-pressed.png</file>
<file>./data/images/repeat-1-on-rest.png</file>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -51,6 +51,7 @@ TwitterConfigWidget::TwitterConfigWidget( TwitterPlugin* plugin, QWidget *parent
ui->twitterTweetComboBox->setCurrentIndex( 0 );
ui->twitterUserTweetLineEdit->setReadOnly( true );
ui->twitterUserTweetLineEdit->setEnabled( false );
ui->autoConnectCheckbox->setChecked( m_plugin->twitterAutoConnect() );
if ( m_plugin->twitterOAuthToken().isEmpty() || m_plugin->twitterOAuthTokenSecret().isEmpty() || m_plugin->twitterScreenName().isEmpty() )
{

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>515</width>
<height>323</height>
<height>385</height>
</rect>
</property>
<property name="minimumSize">

View File

@@ -19,9 +19,10 @@ include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ..
${QT_INCLUDE_DIR}
)
qt4_wrap_ui( UI_SRCS configwidget.ui )
qt4_add_resources( RC_SRCS "resources.qrc" )
qt4_wrap_cpp( zeroconfMoc ${zeroconfHeaders} )
add_library( tomahawk_sipzeroconf SHARED ${zeroconfSources} ${zeroconfMoc} ${RC_SRCS} )
add_library( tomahawk_sipzeroconf SHARED ${zeroconfSources} ${zeroconfMoc} ${RC_SRCS} ${UI_SRCS} )
IF( WIN32 )
SET( OS_SPECIFIC_LINK_LIBRARIES

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -18,6 +18,9 @@
#include "zeroconf.h"
#include "tomahawksettings.h"
#include "ui_configwidget.h"
#include <QtPlugin>
SipPlugin*
@@ -26,6 +29,21 @@ ZeroconfFactory::createPlugin( const QString& pluginId )
return new ZeroconfPlugin( pluginId.isEmpty() ? generateId() : pluginId );
}
ZeroconfPlugin::ZeroconfPlugin ( const QString& pluginId )
: SipPlugin( pluginId )
, m_zeroconf( 0 )
, m_state( Disconnected )
, m_cachedNodes()
{
qDebug() << Q_FUNC_INFO;
m_configWidget = QWeakPointer< QWidget >( new QWidget );
m_ui = new Ui_ZeroconfConfig;
m_ui->setupUi( m_configWidget.data() );
m_ui->autoConnectCheckbox->setChecked( autoConnect() );
m_configWidget.data()->setVisible( false );
}
const QString
ZeroconfPlugin::name() const
{
@@ -58,8 +76,11 @@ ZeroconfFactory::icon() const
bool
ZeroconfPlugin::connectPlugin( bool /*startup*/ )
ZeroconfPlugin::connectPlugin( bool startup )
{
if( startup && !autoConnect() )
return false;
delete m_zeroconf;
m_zeroconf = new TomahawkZeroconf( Servent::instance()->port(), this );
QObject::connect( m_zeroconf, SIGNAL( tomahawkHostFound( QString, int, QString, QString ) ),
@@ -116,4 +137,17 @@ ZeroconfPlugin::lanHostFound( const QString& host, int port, const QString& name
qDebug() << "Already connected to" << host;
}
void
ZeroconfPlugin::saveConfig()
{
TomahawkSettings::instance()->setValue( pluginId() + "/autoconnect", m_ui->autoConnectCheckbox->isChecked() );
}
bool
ZeroconfPlugin::autoConnect() const
{
return TomahawkSettings::instance()->value( pluginId() + "/autoconnect", true ).toBool();
}
Q_EXPORT_PLUGIN2( sipfactory, ZeroconfFactory )

View File

@@ -26,6 +26,8 @@
#define MYNAME "Local Network"
class Ui_ZeroconfConfig;
class SIPDLLEXPORT ZeroconfFactory : public SipPluginFactory
{
Q_OBJECT
@@ -39,6 +41,7 @@ public:
virtual bool isUnique() const { return true; }
virtual QIcon icon() const;
virtual SipPlugin* createPlugin ( const QString& pluginId = QString() );
};
@@ -47,14 +50,7 @@ class SIPDLLEXPORT ZeroconfPlugin : public SipPlugin
Q_OBJECT
public:
ZeroconfPlugin( const QString& pluginId )
: SipPlugin( pluginId )
, m_zeroconf( 0 )
, m_state( Disconnected )
, m_cachedNodes()
{
qDebug() << Q_FUNC_INFO;
}
ZeroconfPlugin( const QString& pluginId );
virtual ~ZeroconfPlugin()
{
@@ -67,6 +63,8 @@ public:
virtual ConnectionState connectionState() const;
virtual bool isValid() const { return true; };
virtual QIcon icon() const;
virtual QWidget* configWidget() { return m_configWidget.data(); }
virtual void saveConfig();
public slots:
virtual bool connectPlugin( bool startup );
@@ -94,9 +92,14 @@ private slots:
void lanHostFound( const QString& host, int port, const QString& name, const QString& nodeid );
private:
bool autoConnect() const;
TomahawkZeroconf* m_zeroconf;
ConnectionState m_state;
QVector<QStringList> m_cachedNodes;
Ui_ZeroconfConfig* m_ui; // so the google wrapper can change the config dialog a bit
QWeakPointer< QWidget > m_configWidget;
};
#endif

View File

@@ -164,7 +164,7 @@ SipConfigDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option
}
// draw the online/offline status
int statusIconSize = 10;
int statusIconSize = 18;
int statusX = confRect.left() - 2*PADDING - statusIconSize;
QFont statusF = opt.font;
statusF.setPointSize( statusF.pointSize() - 2 );
@@ -198,7 +198,7 @@ SipConfigDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option
width = itemRect.width() - textLeftEdge;
if( !index.data( SipModel::ErrorString ).toString().isEmpty() ) { // error, show that too
QRect errorRect( textLeftEdge, mid + top, width, mid - PADDING );
QRect errorRect( textLeftEdge, mid + top, width, mid - PADDING + 1 );
QFontMetrics errorFm( error );
QString str = errorFm.elidedText( index.data( SipModel::ErrorString ).toString(), Qt::ElideRight, errorRect.width() );
@@ -209,7 +209,7 @@ SipConfigDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option
}
QString nameStr = namefm.elidedText( index.data( Qt::DisplayRole ).toString(), Qt::ElideRight, width );
painter->setFont( name );
painter->drawText( QRect( textLeftEdge, pos + top, width, nameHeight ), nameStr );
painter->drawText( QRect( textLeftEdge, pos + top, width, nameHeight + 1 ), nameStr );
painter->restore();
}
}

View File

@@ -100,7 +100,7 @@
<item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="accountsPage">
<layout class="QVBoxLayout" name="verticalLayout_11">
@@ -153,7 +153,7 @@
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/data/images/list-add.png</normaloff>:/data/images/list-add.png</iconset>
<normaloff>:/data/images/sipplugin-add.png</normaloff>:/data/images/sipplugin-add.png</iconset>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
@@ -167,7 +167,7 @@
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/data/images/list-remove.png</normaloff>:/data/images/list-remove.png</iconset>
<normaloff>:/data/images/sipplugin-remove.png</normaloff>:/data/images/sipplugin-remove.png</iconset>
</property>
<property name="popupMode">
<enum>QToolButton::DelayedPopup</enum>