Add note-label classes to ensure consistency

This commit is contained in:
craig.p.drummond
2014-08-21 16:40:46 +00:00
committed by craig.p.drummond
parent 435717b7d5
commit 0d681a4d78
25 changed files with 365 additions and 736 deletions

View File

@@ -349,7 +349,8 @@ set(CANTATA_CORE_MOC_HDRS ${ANTATA_CORE_MOC_HDRS}
models/multimusicmodel.h models/searchmodel.h
mpd/mpdconnection.h mpd/mpdstats.h mpd/mpdstatus.h
network/networkaccessmanager.h
streams/streamfetcher.h)
streams/streamfetcher.h
widgets/notelabel.h)
set(CANTATA_SRCS ${CANTATA_CORE_SRCS} ${CANTATA_SRCS}
gui/settings.cpp gui/application.cpp gui/initialsettingswizard.cpp gui/mainwindow.cpp gui/preferencesdialog.cpp
@@ -362,7 +363,7 @@ set(CANTATA_SRCS ${CANTATA_CORE_SRCS} ${CANTATA_SRCS}
widgets/volumeslider.cpp widgets/genrecombo.cpp widgets/menubutton.cpp widgets/icons.cpp widgets/toolbutton.cpp widgets/wizardpage.cpp
widgets/statuslabel.cpp widgets/searchwidget.cpp widgets/messageoverlay.cpp widgets/basicitemdelegate.cpp widgets/sizegrip.cpp
widgets/sizewidget.cpp widgets/servicestatuslabel.cpp widgets/spacerwidget.cpp widgets/songdialog.cpp widgets/stretchheaderview.cpp
widgets/tableview.cpp widgets/thinsplitterhandle.cpp widgets/coverwidget.cpp widgets/ratingwidget.cpp
widgets/tableview.cpp widgets/thinsplitterhandle.cpp widgets/coverwidget.cpp widgets/ratingwidget.cpp widgets/notelabel.cpp
context/lyricsettings.cpp context/ultimatelyricsprovider.cpp context/ultimatelyrics.cpp context/lyricsdialog.cpp
context/contextwidget.cpp context/view.cpp context/artistview.cpp context/albumview.cpp context/songview.cpp context/contextengine.cpp
context/wikipediaengine.cpp context/wikipediasettings.cpp context/othersettings.cpp context/contextsettings.cpp context/togglelist.cpp

View File

@@ -33,6 +33,7 @@
19. Reorganize playqueue context menu.
20. Use 'Metadata' and not 'Tags' as metadata/tags view in context song pane.
21. Minor changes to song progress slider.
22. Show covers in playlist tree and list views.
1.4.1
-----

View File

@@ -214,45 +214,14 @@
</property>
</widget>
</item>
<item row="5" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="0" colspan="2">
<widget class="StateLabel" name="wikipediaIntroOnlyNote">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item row="5" column="0" colspan="2">
<widget class="NoteLabel" name="wikipediaIntroOnlyNote">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Cantata only shows a trimmed down version of wikipedia pages (no images, links, etc). This trimming is not always 100% accurate, which is why Cantata defaults to only showing the introduction. If you elect to show the full article, then there may be parsing errors. You will also need to remove any currently cached articles (using the 'Cache' page).&lt;/i&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>Cantata only shows a trimmed down version of wikipedia pages (no images, links, etc). This trimming is not always 100% accurate, which is why Cantata defaults to only showing the introduction. If you elect to show the full article, then there may be parsing errors. You will also need to remove any currently cached articles (using the 'Cache' page).</string>
</property>
</widget>
</item>
<item row="7" column="1">
<item row="6" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -277,9 +246,9 @@
<header>support/buddylabel.h</header>
</customwidget>
<customwidget>
<class>StateLabel</class>
<class>NoteLabel</class>
<extends>QLabel</extends>
<header>widgets/statelabel.h</header>
<header>widgets/notelabel.h</header>
</customwidget>
<customwidget>
<class>PathRequester</class>

View File

@@ -200,12 +200,9 @@
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="UrlLabel" name="mopidyNote">
<widget class="UrlNoteLabel" name="mopidyNote">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Connected to a Mopidy server (manual update required).&lt;/i&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>Connected to a Mopidy server (manual update required).</string>
</property>
</widget>
</item>
@@ -409,6 +406,11 @@
<extends>QLabel</extends>
<header>support/urllabel.h</header>
</customwidget>
<customwidget>
<class>UrlNoteLabel</class>
<extends>QLabel</extends>
<header>widgets/notelabel.h</header>
</customwidget>
<customwidget>
<class>SplitLabelWidget</class>
<extends>QLabel</extends>

View File

@@ -15,15 +15,9 @@
<number>0</number>
</property>
<item>
<widget class="QLabel" name="remoteDeviceNote">
<widget class="PlainNoteLabel" name="remoteDeviceNote">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; These settings are only valid, and editable, when the device is connected.&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>These settings are only valid, and editable, when the device is connected.</string>
</property>
</widget>
</item>
@@ -261,6 +255,11 @@
<extends>QSlider</extends>
<header>devices/valueslider.h</header>
</customwidget>
<customwidget>
<class>PlainNoteLabel</class>
<extends>QLabel</extends>
<header>widgets/notelabel.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>musicFolder</tabstop>

View File

@@ -12,15 +12,9 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="connectionNote">
<widget class="PlainNoteLabel" name="connectionNote">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; These settings are only editable when the device is not connected.&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>These settings are only editable when the device is not connected.</string>
</property>
</widget>
</item>
@@ -161,15 +155,9 @@
</layout>
</item>
<item>
<widget class="QLabel" name="label_4">
<widget class="PlainNoteLabel" name="label_4">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; If you enter a password here, it will be stored &lt;b&gt;unencrypted&lt;/b&gt; in Cantata's config file. To have Cantata prompt for the password before accessing the share, set the password to '-'&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>If you enter a password here, it will be stored &lt;b&gt;unencrypted&lt;/b&gt; in Cantata's config file. To have Cantata prompt for the password before accessing the share, set the password to '-'</string>
</property>
</widget>
</item>
@@ -264,9 +252,9 @@
</layout>
</item>
<item>
<widget class="QLabel" name="label_4x">
<widget class="PlainNoteLabel" name="label_4x">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; If you enter a password here, it will be stored &lt;b&gt;unencrypted&lt;/b&gt; in Cantata's config file. To have Cantata prompt for the password before accessing the share, set the password to '-'&lt;/i&gt;</string>
<string>If you enter a password here, it will be stored &lt;b&gt;unencrypted&lt;/b&gt; in Cantata's config file. To have Cantata prompt for the password before accessing the share, set the password to '-'</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -367,9 +355,9 @@
</layout>
</item>
<item>
<widget class="QLabel" name="label_5">
<widget class="PlainNoteLabel" name="label_5">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Due to the way sshfs works, a suitable ssh-askpass application (ksshaskpass, ssh-askpass-gnome, etc.) will be required to enter the password.&lt;/i&gt;</string>
<string>Due to the way sshfs works, a suitable ssh-askpass application (ksshaskpass, ssh-askpass-gnome, etc.) will be required to enter the password.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -417,24 +405,9 @@
</widget>
</item>
<item>
<widget class="QLabel" name="infoLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="PlainNoteLabel" name="infoLabel">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; This dialog is only used to add remote devices (e.g. via Samba), or to access locally mounted folders. For normal media players, attached via USB, Cantata will automatically display the device when it is attached.&lt;/i&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>This dialog is only used to add remote devices (e.g. via Samba), or to access locally mounted folders. For normal media players, attached via USB, Cantata will automatically display the device when it is attached.</string>
</property>
</widget>
</item>
@@ -456,6 +429,11 @@
<extends>QLabel</extends>
<header>support/buddylabel.h</header>
</customwidget>
<customwidget>
<class>PlainNoteLabel</class>
<extends>QLabel</extends>
<header>widgets/notelabel.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>type</tabstop>

View File

@@ -223,66 +223,16 @@
<widget class="QLabel" name="errorLabel"/>
</item>
<item>
<spacer name="verticalSpacer_3xz">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>4</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_7">
<widget class="NoteLabel" name="label_7">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Only enter values for the tags you wish to be search on. &lt;/i&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>Only enter values for the tags you wish to be search on.</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3x">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>4</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_7x">
<widget class="NoteLabel" name="label_7x">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; For genre, end string with an asterisk to match various genres. e.g 'rock*' matches 'Hard Rock' and 'Rock and Roll'. &lt;/i&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>For genre, end string with an asterisk to match various genres. e.g 'rock*' matches 'Hard Rock' and 'Rock and Roll'.</string>
</property>
</widget>
</item>
@@ -310,6 +260,11 @@
<extends>QLabel</extends>
<header>support/buddylabel.h</header>
</customwidget>
<customwidget>
<class>NoteLabel</class>
<extends>QLabel</extends>
<header>widgets/notelabel.h</header>
</customwidget>
<customwidget>
<class>LineEdit</class>
<extends>QLineEdit</extends>

View File

@@ -45,69 +45,16 @@
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="NoteLabel" name="label_2">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; If you elect to have Cantata store covers, lyrics, or backdrops, within the music folder, and you do not have write access to this folder, then Cantata will revert to saving the files in your personal cache folder.&lt;/i&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>If you elect to have Cantata store covers, lyrics, or backdrops, within the music folder, and you do not have write access to this folder, then Cantata will revert to saving the files in your personal cache folder.</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="persNote_2">
<widget class="NoteLabel" name="persNote_2">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Cantata can only save backdrops and artist images within the music folder hierarchy if this is 2 levels deep. (i.e. 'Artist/Album/Tracks')&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>Cantata can only save backdrops and artist images within the music folder hierarchy if this is 2 levels deep. (i.e. 'Artist/Album/Tracks')</string>
</property>
</widget>
</item>
@@ -129,6 +76,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NoteLabel</class>
<extends>QLabel</extends>
<header>widgets/notelabel.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -485,60 +485,16 @@
</layout>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="musicFolderNoteLabel">
<widget class="NoteLabel" name="musicFolderNoteLabel">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; The 'Music folder' setting is used to lookup cover-art, lyrics, etc. If you're MPD instance is on a remote host, you may set this to a HTTP URL.&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>The 'Music folder' setting is used to lookup cover-art, lyrics, etc. If you're MPD instance is on a remote host, you may set this to a HTTP URL.</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="socketNoteLabel">
<widget class="NoteLabel" name="socketNoteLabel">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; When using a local socket the full absolute path to the socket needs to be set. (Port number is not required.)&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>When using a local socket the full absolute path to the socket needs to be set. (Port number is not required.)</string>
</property>
</widget>
</item>
@@ -751,89 +707,23 @@
</widget>
</item>
<item>
<spacer name="verticalSpacer_5x">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="persNote">
<widget class="NoteLabel" name="persNote">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; If you elect to have Cantata store covers, lyrics, or backdrops, within the music folder, and you do not have write access to this folder, then Cantata will revert to saving the files in your personal cache folder.&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>If you elect to have Cantata store covers, lyrics, or backdrops, within the music folder, and you do not have write access to this folder, then Cantata will revert to saving the files in your personal cache folder.</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_7f2_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="persNote_2">
<widget class="NoteLabel" name="persNote_2">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Cantata can only save backdrops and artist images within the music folder hierarchy if this is 2 levels deep. i.e. 'Artist/Album/Tracks'.&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>Cantata can only save backdrops and artist images within the music folder hierarchy if this is 2 levels deep. i.e. 'Artist/Album/Tracks'.</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_7f2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="StateLabel" name="httpNote">
<widget class="NoteLabel" name="httpNote">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; The 'Music folder' is set to a HTTP address, and Cantata currently cannot upload files to external HTTP servers. Therefore, the above settings should be left un-checked.&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>The 'Music folder' is set to a HTTP address, and Cantata currently cannot upload files to external HTTP servers. Therefore, the above settings should be left un-checked.</string>
</property>
</widget>
</item>
@@ -977,9 +867,9 @@
<container>1</container>
</customwidget>
<customwidget>
<class>StateLabel</class>
<class>NoteLabel</class>
<extends>QLabel</extends>
<header>widgets/statelabel.h</header>
<header>widgets/notelabel.h</header>
</customwidget>
</customwidgets>
<resources/>

View File

@@ -23,14 +23,15 @@
#include "interfacesettings.h"
#include "settings.h"
#include "widgets/itemview.h"
#include "support/localize.h"
#include "models/musiclibraryitemalbum.h"
#include "models/albumsmodel.h"
#include "support/localize.h"
#include "support/utils.h"
#include "support/fancytabwidget.h"
#include "support/pathrequester.h"
#include "widgets/basicitemdelegate.h"
#include "widgets/playqueueview.h"
#include "support/pathrequester.h"
#include "widgets/itemview.h"
#include <QComboBox>
#ifndef ENABLE_KDE_SUPPORT
#include <QDir>
@@ -100,7 +101,7 @@ static inline int getValue(QComboBox *box)
static const char * constValueProperty="value";
InterfaceSettings::InterfaceSettings(QWidget *p, bool limitedHeight)
InterfaceSettings::InterfaceSettings(QWidget *p)
: QWidget(p)
#ifndef ENABLE_KDE_SUPPORT
, loadedLangs(false)
@@ -230,7 +231,7 @@ InterfaceSettings::InterfaceSettings(QWidget *p, bool limitedHeight)
// If we are on a display less than 800 pixels tall (e.g. a netbook), then re-arrange
// the view settings to allow dialog to shrink more...
if (limitedHeight) {
if (Utils::limitedHeight(this)) {
viewsLayout->removeWidget(otherViewGroupBox);
viewsLayout->addWidget(otherViewGroupBox, 0, 1, 3, 1);
viewsLayout->addItem(new QSpacerItem(0, 2, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2, 1, 1);

View File

@@ -56,34 +56,9 @@
<widget class="QListWidget" name="views"/>
</item>
<item>
<spacer name="verticalSpacer_xx">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>4</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="sbPlayQueueLabel">
<widget class="NoteLabel" name="sbPlayQueueLabel">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; By default, the play queue appears to the side of the other views, and the Info view is accessible by pressing its icon in the main toolbar. Checking the appropriate option above will cause the view to be merged into the sidebar as per other views.&lt;/i&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>By default, the play queue appears to the side of the other views, and the Info view is accessible by pressing its icon in the main toolbar. Checking the appropriate option above will cause the view to be merged into the sidebar as per other views.</string>
</property>
</widget>
</item>
@@ -763,98 +738,23 @@
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>4</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="StateLabel" name="singleClickLabel">
<widget class="NoteLabel" name="singleClickLabel">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Changing the 'Enforce single-click activation of items' setting will require a re-start of Cantata.&lt;/i&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>Changing the 'Enforce single-click activation of items' setting will require a re-start of Cantata.</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2b">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>4</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="StateLabel" name="langNoteLabel">
<widget class="NoteLabel" name="langNoteLabel">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Changing the language setting will require a re-start of Cantata.&lt;/i&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>Changing the language setting will require a re-start of Cantata.</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2tf">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>4</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="StateLabel" name="touchFriendlyNoteLabel">
<widget class="NoteLabel" name="touchFriendlyNoteLabel">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Changing the 'touch friendly' setting will require a re-start of Cantata.&lt;/i&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>Changing the 'touch friendly' setting will require a re-start of Cantata.</string>
</property>
</widget>
</item>
@@ -884,9 +784,9 @@
<header>support/buddylabel.h</header>
</customwidget>
<customwidget>
<class>StateLabel</class>
<class>NoteLabel</class>
<extends>QLabel</extends>
<header>widgets/statelabel.h</header>
<header>widgets/notelabel.h</header>
</customwidget>
<customwidget>
<class>PathRequester</class>

View File

@@ -24,6 +24,7 @@
#include "playbacksettings.h"
#include "settings.h"
#include "support/localize.h"
#include "support/utils.h"
#include "mpd/mpdconnection.h"
#include "support/icon.h"
#include "widgets/basicitemdelegate.h"
@@ -35,7 +36,7 @@
w->deleteLater(); \
w=0;
PlaybackSettings::PlaybackSettings(QWidget *p, bool limitedHeight)
PlaybackSettings::PlaybackSettings(QWidget *p)
: QWidget(p)
{
setupUi(this);
@@ -56,7 +57,7 @@ PlaybackSettings::PlaybackSettings(QWidget *p, bool limitedHeight)
connect(this, SIGNAL(setCrossFade(int)), MPDConnection::self(), SLOT(setCrossFade(int)));
connect(this, SIGNAL(getReplayGain()), MPDConnection::self(), SLOT(getReplayGain()));
connect(aboutReplayGain, SIGNAL(leftClickedUrl()), SLOT(showAboutReplayGain()));
int iconSize=limitedHeight ? 22 : Icon::dlgIconSize();
int iconSize=Utils::limitedHeight(this) ? 22 : Icon::dlgIconSize();
messageIcon->setMinimumSize(iconSize, iconSize);
messageIcon->setMaximumSize(iconSize, iconSize);
mpdConnectionStateChanged(MPDConnection::self()->isConnected());

View File

@@ -66,32 +66,10 @@
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer_8">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="noteLabel">
<item row="3" column="0" colspan="2">
<widget class="NoteLabel" name="noteLabel">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; If you press and hold the stop button, then a menu will be shown allowing you to choose whether to stop playback now, or after the current track. (The stop button can be enabled in the Interface/Toolbar section)&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>If you press and hold the stop button, then a menu will be shown allowing you to choose whether to stop playback now, or after the current track. (The stop button can be enabled in the Interface/Toolbar section)</string>
</property>
</widget>
</item>
@@ -249,6 +227,11 @@
<extends>QLabel</extends>
<header>support/buddylabel.h</header>
</customwidget>
<customwidget>
<class>NoteLabel</class>
<extends>QLabel</extends>
<header>widgets/notelabel.h</header>
</customwidget>
<customwidget>
<class>UrlLabel</class>
<extends>QWidget</extends>

View File

@@ -69,22 +69,12 @@ PreferencesDialog::PreferencesDialog(QWidget *parent)
iCount++;
setButtons(Ok|Apply|Cancel);
// If we are on a display less than 800 pixels tall (e.g. a netbook), then re-arrange
// the view settings to allow dialog to shrink more...
bool limitedHeight=!qgetenv("CANTATA_NETBOOK").isEmpty();
if (!limitedHeight) {
QDesktopWidget *dw=QApplication::desktop();
if (dw) {
limitedHeight=dw->availableGeometry(this).size().height()<=800;
}
}
pageWidget = new PageWidget(this, limitedHeight);
pageWidget = new PageWidget(this, Utils::limitedHeight(this));
setMainWidget(pageWidget);
server = new ServerSettings(0);
playback = new PlaybackSettings(0, limitedHeight);
playback = new PlaybackSettings(0);
files = new FileSettings(0);
interface = new InterfaceSettings(0, limitedHeight);
interface = new InterfaceSettings(0);
context = new ContextSettings(0);
cache = new CacheSettings(0);
scrobbling = new ScrobblingSettings(0);

View File

@@ -83,9 +83,8 @@ ServerSettings::ServerSettings(QWidget *p)
{
setupUi(this);
#if defined ENABLE_DEVICES_SUPPORT
musicFolderNoteLabel->setText(musicFolderNoteLabel->text()+
i18n("<i> This folder will also be used to locate music files "
"for transferring to (and from) devices.</i>"));
musicFolderNoteLabel->appendText(i18n("<i> This folder will also be used to locate music files "
"for transferring to (and from) devices.</i>"));
#endif
connect(combo, SIGNAL(activated(int)), SLOT(showDetails(int)));
connect(removeButton, SIGNAL(clicked(bool)), SLOT(remove()));

View File

@@ -168,110 +168,28 @@
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="1" column="0" colspan="2">
<widget class="NoteLabel" name="musicFolderNoteLabel">
<property name="text">
<string>The 'Music folder' setting is used to lookup cover-art (either the value specified above, or &lt;code&gt;cover.jpg / cover.png&lt;/code&gt; if not set). If you also have write permissions to this folder (and it's sub-folders), then Cantata will save any downloaded covers into the respective album folder.</string>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>13</height>
</size>
</property>
</spacer>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="musicFolderNoteLabel">
<widget class="NoteLabel" name="socketNoteLabel">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; The 'Music folder' setting is used to lookup cover-art (either the value specified above, or &lt;code&gt;cover.jpg / cover.png&lt;/code&gt; if not set). If you also have write permissions to this folder (and it's sub-folders), then Cantata will save any downloaded covers into the respective album folder.&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>When using a local socket the full absolute path to the socket needs to be set. (Port number is not required.)</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="socketNoteLabel">
<item row="3" column="0" colspan="2">
<widget class="NoteLabel" name="streamUrlNoteLabel">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; When using a local socket the full absolute path to the socket needs to be set. (Port number is not required.)&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>'HTTP Stream URL' is only of use if you have MPD configured to output to a HTTP stream, and you wish Cantata to be able to play that stream.</string>
</property>
</widget>
</item>
<item row="5" column="0">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer_streamUrlNote">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="streamUrlNoteLabel">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; 'HTTP Stream URL' is only of use if you have MPD configured to output to a HTTP stream, and you wish Cantata to be able to play that stream.&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
</property>
</widget>
</item>
<item row="8" column="0">
<item row="4" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -338,51 +256,20 @@
</layout>
</item>
<item row="2" column="0" colspan="4">
<widget class="StateLabel" name="basicMusicFolderNoteLabel">
<widget class="NoteLabel" name="basicMusicFolderNoteLabel">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; If you change the 'Music folder' setting, then you will need to manually update the music database. This can be performed by pressing the 'Refresh Database' button in the 'Artists' or 'Albums' views.&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>If you change the 'Music folder' setting, then you will need to manually update the music database. This can be performed by pressing the 'Refresh Database' button in the 'Artists' or 'Albums' views.</string>
</property>
</widget>
</item>
<item row="3" column="1">
<spacer name="verticalSpacer_8">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0" colspan="4">
<widget class="QLabel" name="musicFolderNoteLabel_2">
<item row="3" column="0" colspan="4">
<widget class="NoteLabel" name="musicFolderNoteLabel_2">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; If no setting is specified for 'Cover filename, then Cantata will use a default of &lt;code&gt;cover&lt;/code&gt; &lt;/i&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>If no setting is specified for 'Cover filename, then Cantata will use a default of &lt;code&gt;cover&lt;/code&gt;</string>
</property>
</widget>
</item>
<item row="5" column="2">
<item row="4" column="2">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -408,9 +295,9 @@
<header>support/buddylabel.h</header>
</customwidget>
<customwidget>
<class>StateLabel</class>
<class>NoteLabel</class>
<extends>QLabel</extends>
<header>widgets/statelabel.h</header>
<header>widgets/notelabel.h</header>
</customwidget>
<customwidget>
<class>LineEdit</class>

View File

@@ -35,32 +35,16 @@
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="NoteLabel" name="label_4">
<property name="text">
<string>MPD usually only plays songs that are stored within its folders. Cantata contains a minimal HTTP server that can be used to serve other files to MPD. This, however, will only work whilst Cantata is running.</string>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>16</height>
</size>
</property>
</spacer>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<widget class="NoteLabel" name="label_4b">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; MPD usually only plays songs that are stored within its folders. Cantata contains a minimal HTTP server that can be used to serve other files to MPD. This, however, will only work whilst Cantata is running.&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;NOTE:&lt;/b&gt; If you choose 'Local loopback' for 'Network interface', then MPD &lt;b&gt;must&lt;/b&gt; also be on this computer.&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>If you choose 'Local loopback' for 'Network interface', then MPD &lt;b&gt;must&lt;/b&gt; also be on this computer.</string>
</property>
</widget>
</item>
@@ -85,6 +69,11 @@
<extends>QLabel</extends>
<header>support/buddylabel.h</header>
</customwidget>
<customwidget>
<class>NoteLabel</class>
<extends>QLabel</extends>
<header>widgets/notelabel.h</header>
</customwidget>
</customwidgets>
<tabstops/>
<resources/>

View File

@@ -156,28 +156,16 @@
</widget>
</item>
<item>
<widget class="QLabel" name="noteLabel">
<widget class="NoteLabel" name="noteLabel">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; These settings apply to Digitally Imported, JazzRadio.com, RockRadio.com, and Sky.fm&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>These settings apply to Digitally Imported, JazzRadio.com, RockRadio.com, and Sky.fm</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="note2Label">
<widget class="NoteLabel" name="note2Label">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; If you enter account details, then a 'DI' status item will appear under the list of streams. This will indicate if you are logged in or not&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>If you enter account details, then a 'DI' status item will appear under the list of streams. This will indicate if you are logged in or not.</string>
</property>
</widget>
</item>
@@ -207,6 +195,11 @@
<extends>QLabel</extends>
<header>support/buddylabel.h</header>
</customwidget>
<customwidget>
<class>NoteLabel</class>
<extends>QLabel</extends>
<header>widgets/notelabel.h</header>
</customwidget>
<customwidget>
<class>MessageWidget</class>
<extends>QFrame</extends>

View File

@@ -75,20 +75,21 @@
</widget>
</item>
<item row="3" column="0" colspan="4">
<widget class="QLabel" name="note">
<widget class="PlainNoteLabel" name="note">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Built-in categories are shown in italic, and these cannot be removed.&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>Built-in categories are shown in italic, and these cannot be removed.</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>PlainNoteLabel</class>
<extends>QLabel</extends>
<header>widgets/notelabel.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -35,6 +35,7 @@
#include <QTime>
#include <QWidget>
#include <QStyle>
#include <QDesktopWidget>
#if QT_VERSION >= 0x050000
#include <QStandardPaths>
#else
@@ -858,6 +859,22 @@ int Utils::scaleForDpi(int v)
return isHighDpi() ? v*2 : v;
}
bool Utils::limitedHeight(QWidget *w)
{
static bool init=false;
static bool limited=false;
if (!init) {
limited=!qgetenv("CANTATA_NETBOOK").isEmpty();
if (!limited) {
QDesktopWidget *dw=QApplication::desktop();
if (dw) {
limited=dw->availableGeometry(w).size().height()<=800;
}
}
}
return limited;
}
Utils::Desktop Utils::currentDe()
{
#if !defined Q_OS_WIN && !defined Q_OS_MAC

View File

@@ -112,6 +112,7 @@ namespace Utils
extern int layoutSpacing(QWidget *w);
extern bool isHighDpi();
extern int scaleForDpi(int v);
extern bool limitedHeight(QWidget *w);
enum Desktop {
KDE,

View File

@@ -189,95 +189,45 @@
</layout>
</item>
<item>
<spacer name="verticalSpacer_3x">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>4</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_7x">
<widget class="PlainNoteLabel" name="label_7x">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Multiple genres should be separated via a semicolon (e.g. 'Rock;Hard Rock')&lt;/i&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>Multiple genres should be separated via a semicolon (e.g. 'Rock;Hard Rock')</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3y">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>4</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_7y">
<widget class="PlainNoteLabel" name="label_7y">
<property name="text">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Ratings are stored in an external database, and &lt;b&gt;not&lt;/b&gt; in the song's file.&lt;/i&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<string>Ratings are stored in an external database, and &lt;b&gt;not&lt;/b&gt; in the song's file.</string>
</property>
</widget>
</item>
<item>
<spacer name="mopidyNoteSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="UrlLabel" name="mopidyNote">
<widget class="PlainUrlNoteLabel" name="mopidyNote">
<property name="text" stdset="0">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Connected to a Mopidy server (manual update required).&lt;/i&gt;</string>
<string>Connected to a Mopidy server (manual update required).</string>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progress"/>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>2</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
@@ -306,6 +256,16 @@
<extends>QLabel</extends>
<header>widgets/statelabel.h</header>
</customwidget>
<customwidget>
<class>PlainNoteLabel</class>
<extends>QLabel</extends>
<header>widgets/notelabel.h</header>
</customwidget>
<customwidget>
<class>PlainUrlNoteLabel</class>
<extends>QLabel</extends>
<header>widgets/notelabel.h</header>
</customwidget>
<customwidget>
<class>UrlLabel</class>
<extends>QLabel</extends>

View File

@@ -125,16 +125,16 @@
</layout>
</item>
<item>
<widget class="UrlLabel" name="mopidyNote">
<widget class="UrlNoteLabel" name="mopidyNote">
<property name="text" stdset="0">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Connected to a Mopidy server (manual update required).&lt;/i&gt;</string>
<string>Connected to a Mopidy server (manual update required).</string>
</property>
</widget>
</item>
<item>
<widget class="UrlLabel" name="ratingsNote">
<widget class="UrlNoteLabel" name="ratingsNote">
<property name="text" stdset="0">
<string>&lt;i&gt;&lt;b&gt;NOTE:&lt;/b&gt; Ratings will be lost if a file is renamed.&lt;/i&gt;</string>
<string>Ratings will be lost if a file is renamed.</string>
</property>
</widget>
</item>
@@ -155,9 +155,9 @@
<header>support/buddylabel.h</header>
</customwidget>
<customwidget>
<class>UrlLabel</class>
<class>UrlNoteLabel</class>
<extends>QLabel</extends>
<header>support/urllabel.h</header>
<header>widgets/notelabel.h</header>
</customwidget>
</customwidgets>
<tabstops>

86
widgets/notelabel.cpp Normal file
View File

@@ -0,0 +1,86 @@
/*
* Cantata
*
* Copyright (c) 2011-2014 Craig Drummond <craig.p.drummond@gmail.com>
*
* ----
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "notelabel.h"
#include "support/utils.h"
#include "support/localize.h"
#include <QVBoxLayout>
static QLabel * init(QWidget *p, bool url)
{
int layoutSpacing=Utils::layoutSpacing(p);
int spacing=p->fontMetrics().height()*(Utils::limitedHeight(p) ? 0.25 : 1.0)-layoutSpacing;
if (spacing<layoutSpacing) {
spacing=layoutSpacing;
}
QVBoxLayout *l=new QVBoxLayout(p);
l->setMargin(0);
l->setSpacing(0);
QLabel *label;
if (url) {
label=new UrlLabel(p);
} else {
label=new StateLabel(p);
}
label->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop);
label->setWordWrap(true);
label->setTextInteractionFlags(Qt::NoTextInteraction);
l->addItem(new QSpacerItem(2, spacing, QSizePolicy::Fixed, QSizePolicy::Fixed));
l->addWidget(label);
return label;
}
void NoteLabel::setText(QLabel *l, const QString &text)
{
l->setText(i18n("<i><b>NOTE:</b> %1</i>", text));
}
NoteLabel::NoteLabel(QWidget *parent)
: QWidget(parent)
{
label=static_cast<StateLabel *>(init(this, false));
}
UrlNoteLabel::UrlNoteLabel(QWidget *parent)
: QWidget(parent)
{
label=static_cast<UrlLabel *>(init(this, true));
connect(label, SIGNAL(leftClickedUrl()), this, SIGNAL(leftClickedUrl()));
}
PlainNoteLabel::PlainNoteLabel(QWidget *parent)
: StateLabel(parent)
{
setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop);
setWordWrap(true);
setTextInteractionFlags(Qt::NoTextInteraction);
}
PlainUrlNoteLabel::PlainUrlNoteLabel(QWidget *parent)
: UrlLabel(parent)
{
setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop);
setWordWrap(true);
setTextInteractionFlags(Qt::NoTextInteraction);
}

72
widgets/notelabel.h Normal file
View File

@@ -0,0 +1,72 @@
/*
* Cantata
*
* Copyright (c) 2011-2014 Craig Drummond <craig.p.drummond@gmail.com>
*
* ----
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef NOTELABEL_H
#define NOTELABEL_H
#include <QWidget>
#include "statelabel.h"
#include "support/urllabel.h"
class NoteLabel : public QWidget
{
public:
static void setText(QLabel *l, const QString &text);
NoteLabel(QWidget *parent=0);
void setText(const QString &text) { setText(label, text); }
void appendText(const QString &text) { label->setText(label->text()+text); }
QString text() const { return label->text(); }
void setOn(bool o) { label->setOn(o); }
private:
StateLabel *label;
};
class UrlNoteLabel : public QWidget
{
Q_OBJECT
public:
UrlNoteLabel(QWidget *parent=0);
void setText(const QString &text) { NoteLabel::setText(label, text); }
void appendText(const QString &text) { label->setText(label->text()+text); }
QString text() const { return label->text(); }
Q_SIGNALS:
void leftClickedUrl();
private:
UrlLabel *label;
};
class PlainNoteLabel : public StateLabel
{
public:
PlainNoteLabel(QWidget *parent=0);
void setText(const QString &text) { NoteLabel::setText(this, text); }
};
class PlainUrlNoteLabel : public UrlLabel
{
public:
PlainUrlNoteLabel(QWidget *parent=0);
void setText(const QString &text) { NoteLabel::setText(this, text); }
};
#endif