extragear/multimedia/amarok/src/dialogs

Dan Meltzer parallelgrapefruit at gmail.com
Wed Dec 3 18:16:01 CET 2008


On Wed, Dec 3, 2008 at 12:08 PM, Teo Mrnjavac <teo.mrnjavac at gmail.com>wrote:

> SVN commit 892146 by mrnjavac:
>
> Added back the fixed Collection Root token. This was done with our
> usability guy leinir's suggestion, approval and blessing and should not have
> been removed.

I have to disagree with this.

1) There was a thread about this on amarok-devel.  The agreement there was
to remove this (along with the other changes).  If there are objections they
should be raised there first.  The thread was not there for all that long
before Seb commited, but objections should still be raised there even after
committing.

2)  The token itself-- Seb's objection was extremely valid.  It takes up a
_lot_ of horizontal space, and it does not add any new information.  The
preview widget below shows how it will go.  I'm really curious about why you
(and leinir) deem it necessary?

>
> Added back the hint picture. This is open for discussion but I would like
> if it stayed in.
>
>
>
>  M  +56 -7     FilenameLayoutDialog.cpp
>  M  +86 -17    FilenameLayoutDialog.ui
>
>
> --- trunk/extragear/multimedia/amarok/src/dialogs/FilenameLayoutDialog.cpp
> #892145:892146
> @@ -40,14 +40,23 @@
>     filenameLayoutEdit->hide();
>     syntaxLabel->hide();
>     syntaxLabel->setWordWrap( true );
> +    QString hintImagePath = QString( KStandardDirs::locate( "data",
> "amarok/images/FilenameLayoutDialogHint.png" ) );
> +    QPixmap *hintImage = new QPixmap( hintImagePath );
> +    hintPicture->setPixmap( *hintImage );
> +
> +    connect( cbCase, SIGNAL( toggled( bool ) ),
> +             this, SLOT( editStateEnable( bool ) ) );
> +    connect( parent, SIGNAL( accepted() ),
> +             this, SLOT( onAccept() ) );
> +    connect( tokenPool, SIGNAL( onDoubleClick( QString ) ),
> +             filenameLayout, SLOT( addToken( QString ) ) );
> +    connect( kpbAdvanced, SIGNAL( clicked() ),
> +             this, SLOT( toggleAdvancedMode() ) );
> +    connect( filenameLayout, SIGNAL( schemeChanged() ),
> +             this, SIGNAL( schemeChanged() ) );
> +    connect( filenameLayoutEdit, SIGNAL( textChanged( const QString & ) ),
> +             this, SIGNAL( schemeChanged() ) );
>
> -    connect( cbCase, SIGNAL( toggled( bool ) ), this, SLOT(
> editStateEnable( bool ) ) );
> -    connect( parent, SIGNAL( accepted() ), this, SLOT( onAccept() ) );
> -    connect( tokenPool, SIGNAL( onDoubleClick( QString ) ),
> filenameLayout, SLOT( addToken( QString ) ) );
> -    connect( kpbAdvanced, SIGNAL( clicked() ), this, SLOT(
> toggleAdvancedMode() ) );
> -    connect( filenameLayout, SIGNAL( schemeChanged() ), this, SIGNAL(
> schemeChanged() ) );
> -    connect( filenameLayoutEdit, SIGNAL( textChanged( const QString & ) ),
> this, SIGNAL( schemeChanged() ) );
> -
>     //KConfig stuff:
>     int caseOptions = Amarok::config( "TagGuesser" ).readEntry( "Case
> options" ).toInt();
>     if( !caseOptions )
> @@ -73,6 +82,42 @@
>     if( !m_isOrganizeCollection )
>         optionsFrame->show();
>
> +    //INIT for collection root
> +    unsigned int borderColor = static_cast<unsigned int>( KColorScheme(
> QPalette::Active ).decoration( KColorScheme::HoverColor ).color().rgb() );
> +    collectionRootFrame->setStyleSheet( "\
> +        color: palette( Base );\
> +        border: 2px solid #" + QString::number( borderColor, 16 ).remove(
> 0, 2 ) + ";\
> +        border-radius: 4px;\
> +        padding: 2px;\
> +        " );
> +    QHBoxLayout *collectionRootLayout = new QHBoxLayout(
> collectionRootFrame );
> +    QLabel *collectionRootIconLabel = new QLabel( "", this );
> +    QLabel *collectionRootLabel = new QLabel( i18n( "Collection root" ),
> this );
> +    collectionRootLayout->addWidget( collectionRootIconLabel );
> +    collectionRootLayout->addWidget( collectionRootLabel );
> +    collectionRootLabel->setStyleSheet( "border:0px solid #000000;
> border-radius: 0px; padding: 0px;" );
> +    collectionRootIconLabel->setStyleSheet( "border:0px solid #000000;
> border-radius: 0px; padding: 0px;" );
> +    collectionRootLayout->setContentsMargins( 0, 0, 0, 0 );
> +    collectionRootIconLabel->setContentsMargins( 0, 0, 0, 0 );
> +    collectionRootLabel->setContentsMargins( 0, 0, 0, 0 );
> +    collectionRootIconLabel->setSizePolicy( QSizePolicy::Fixed,
> QSizePolicy::Fixed );
> +    collectionRootIconLabel->setFixedSize( 16, 16 );
> +    QPixmap collectionIcon = QPixmap( KIcon( "collection-amarok"
> ).pixmap(16, 16) );
> +    collectionRootIconLabel->setPixmap( collectionIcon );
> +
> +    collectionSlashFrame->setStyleSheet( "\
> +        color: palette( Base );\
> +        border: 2px solid #" + QString::number( borderColor, 16 ).remove(
> 0, 2 ) + ";\
> +        border-radius: 4px;\
> +        padding: 2px;\
> +        " );
> +    QHBoxLayout *collectionSlashLayout = new QHBoxLayout(
> collectionSlashFrame );
> +    QLabel *collectionSlashLabel = new QLabel( "/", this );
> +    collectionSlashLayout->addWidget(collectionSlashLabel);
> +    collectionSlashLabel->setStyleSheet( "border:0px solid #000000;
> border-radius: 0px; padding: 0px;" );
> +    collectionSlashLayout->setContentsMargins( 0, 0, 0, 0 );
> +    collectionSlashLabel->setContentsMargins( 0, 0, 0, 0 );
> +
>     //INIT for tokenPool
>     tokenPool->addItem( new QListWidgetItem( KIcon( "filename-track-amarok"
> ).pixmap( 48, 48 ), i18n( "Track" ) ) );
>     tokenPool->addItem( new QListWidgetItem( KIcon( "filename-title-amarok"
> ).pixmap( 48, 48 ), i18n( "Title" ) ) );
> @@ -92,6 +137,8 @@
>         syntaxLabel->setText( i18nc("Please do not translate the %foo words
> as they define a syntax used internally by a parser to describe a
> filename.",
>                                     "The following tokens can be used to
> define a filename scheme: \
>                                      <br>%track, %title, %artist,
> %composer, %year, %album, %comment, %genre, %ignore." ) );
> +        collectionRootFrame->hide();
> +        collectionSlashFrame->hide();
>     }
>     else
>     {
> @@ -102,6 +149,8 @@
>         syntaxLabel->setText( i18nc("Please do not translate the %foo words
> as they define a syntax used internally by a parser to describe a
> filename.",
>                                     "The following tokens can be used to
> define a filename scheme: \
>                                      <br>%track, %title, %artist,
> %composer, %year, %album, %comment, %genre, %initial, %folder, %filetype,
> %discnumber." ) );
> +        collectionRootFrame->show();
> +        collectionSlashFrame->show();
>     }
>     if( m_isOrganizeCollection )
>     {
> --- trunk/extragear/multimedia/amarok/src/dialogs/FilenameLayoutDialog.ui
> #892145:892146
> @@ -5,7 +5,7 @@
>    <rect>
>     <x>0</x>
>     <y>0</y>
> -    <width>554</width>
> +    <width>690</width>
>     <height>568</height>
>    </rect>
>   </property>
> @@ -87,34 +87,34 @@
>     </widget>
>    </item>
>    <item>
> -    <widget class="QLabel" name="syntaxLabel" >
> +    <widget class="QLabel" name="hintPicture" >
>      <property name="sizePolicy" >
> -      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
> +      <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
>        <horstretch>0</horstretch>
>        <verstretch>0</verstretch>
>       </sizepolicy>
>      </property>
>      <property name="minimumSize" >
>       <size>
> -       <width>0</width>
> -       <height>0</height>
> +       <width>682</width>
> +       <height>44</height>
>       </size>
>      </property>
>      <property name="maximumSize" >
>       <size>
>        <width>16777215</width>
> -       <height>144</height>
> +       <height>44</height>
>       </size>
>      </property>
>      <property name="text" >
> -      <string>The following tokens can be used to define a filename
> scheme: &lt;br>%track, %title, %artist, %composer, %year, %album, %comment,
> %genre&lt;br></string>
> +      <string/>
>      </property>
>     </widget>
>    </item>
>    <item>
> -    <widget class="FilenameLayoutWidget" name="filenameLayout" >
> +    <widget class="QLabel" name="syntaxLabel" >
>      <property name="sizePolicy" >
> -      <sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" >
> +      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
>        <horstretch>0</horstretch>
>        <verstretch>0</verstretch>
>       </sizepolicy>
> @@ -122,26 +122,95 @@
>      <property name="minimumSize" >
>       <size>
>        <width>0</width>
> -       <height>30</height>
> +       <height>0</height>
>       </size>
>      </property>
>      <property name="maximumSize" >
>       <size>
> -       <width>30000</width>
> -       <height>36</height>
> +       <width>16777215</width>
> +       <height>144</height>
>       </size>
>      </property>
> -     <property name="frameShape" >
> -      <enum>QFrame::StyledPanel</enum>
> +     <property name="text" >
> +      <string>The following tokens can be used to define a filename
> scheme: &lt;br>%track, %title, %artist, %composer, %year, %album, %comment,
> %genre&lt;br></string>
>      </property>
> -     <property name="frameShadow" >
> -      <enum>QFrame::Sunken</enum>
> -     </property>
>     </widget>
>    </item>
>    <item>
>     <layout class="QHBoxLayout" name="horizontalLayout_2" >
>      <item>
> +      <widget class="QFrame" name="collectionRootFrame" >
> +       <property name="sizePolicy" >
> +        <sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
> +         <horstretch>0</horstretch>
> +         <verstretch>0</verstretch>
> +        </sizepolicy>
> +       </property>
> +       <property name="maximumSize" >
> +        <size>
> +         <width>16777215</width>
> +         <height>24</height>
> +        </size>
> +       </property>
> +       <property name="frameShape" >
> +        <enum>QFrame::StyledPanel</enum>
> +       </property>
> +       <property name="frameShadow" >
> +        <enum>QFrame::Raised</enum>
> +       </property>
> +      </widget>
> +     </item>
> +     <item>
> +      <widget class="QFrame" name="collectionSlashFrame" >
> +       <property name="sizePolicy" >
> +        <sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
> +         <horstretch>0</horstretch>
> +         <verstretch>0</verstretch>
> +        </sizepolicy>
> +       </property>
> +       <property name="maximumSize" >
> +        <size>
> +         <width>16777215</width>
> +         <height>24</height>
> +        </size>
> +       </property>
> +       <property name="frameShape" >
> +        <enum>QFrame::StyledPanel</enum>
> +       </property>
> +       <property name="frameShadow" >
> +        <enum>QFrame::Raised</enum>
> +       </property>
> +      </widget>
> +     </item>
> +     <item>
> +      <widget class="FilenameLayoutWidget" name="filenameLayout" >
> +       <property name="sizePolicy" >
> +        <sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" >
> +         <horstretch>0</horstretch>
> +         <verstretch>0</verstretch>
> +        </sizepolicy>
> +       </property>
> +       <property name="minimumSize" >
> +        <size>
> +         <width>0</width>
> +         <height>30</height>
> +        </size>
> +       </property>
> +       <property name="maximumSize" >
> +        <size>
> +         <width>30000</width>
> +         <height>36</height>
> +        </size>
> +       </property>
> +       <property name="frameShape" >
> +        <enum>QFrame::StyledPanel</enum>
> +       </property>
> +       <property name="frameShadow" >
> +        <enum>QFrame::Sunken</enum>
> +       </property>
> +      </widget>
> +     </item>
> +     <item>
>       <widget class="KLineEdit" name="filenameLayoutEdit" >
>        <property name="sizePolicy" >
>         <sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/amarok-devel/attachments/20081203/e46e77dc/attachment-0001.htm 


More information about the Amarok-devel mailing list