extragear/multimedia/amarok/src/dialogs

Seb Ruiz ruiz at kde.org
Wed Dec 3 22:10:09 CET 2008


2008/12/4 Teo Mrnjavac <teo.mrnjavac at gmail.com>:
> 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.
> Added back the hint picture. This is open for discussion but I would like if it stayed in.

Yes, I strongly disagree. The collection root token adds _no_
information and uses up a huge amout of space. Leinir gave the thumbs
up to the refactor from a usability perspective, so he is not unaware.

>
>
>
>  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" >
>



-- 
Seb Ruiz

http://www.sebruiz.net/
http://amarok.kde.org/


More information about the Amarok-devel mailing list