@ -83,11 +83,11 @@
namespace Amarok
{
class ToolBar : public K ToolBar
class ToolBar : public TDE ToolBar
{
public :
ToolBar ( TQWidget * parent , const char * name )
: K ToolBar( parent , name )
: TDE ToolBar( parent , name )
{ }
protected :
@ -115,7 +115,7 @@ PlaylistWindow::PlaylistWindow()
// Sets caption and icon correctly (needed e.g. for GNOME)
kapp - > setTopWidget ( this ) ;
K ActionCollection* const ac = actionCollection ( ) ;
TDE ActionCollection* const ac = actionCollection ( ) ;
const EngineController * const ec = EngineController : : instance ( ) ;
ac - > setAutoConnectShortcuts ( false ) ;
@ -144,45 +144,45 @@ PlaylistWindow::PlaylistWindow()
# endif
//FIXME: after string freeze rename to "Burn Current Playlist"?
new K Action( i18n ( " Burn to CD " ) , Amarok : : icon ( " burn " ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotBurnPlaylist ( ) ) , ac , " playlist_burn " ) ;
new TDE Action( i18n ( " Burn to CD " ) , Amarok : : icon ( " burn " ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotBurnPlaylist ( ) ) , ac , " playlist_burn " ) ;
actionCollection ( ) - > action ( " playlist_burn " ) - > setEnabled ( K3bExporter : : isAvailable ( ) ) ;
new K Action( i18n ( " Play Media... " ) , Amarok : : icon ( " files " ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotPlayMedia ( ) ) , ac , " playlist_playmedia " ) ;
new K Action( i18n ( " Play Audio CD " ) , Amarok : : icon ( " album " ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( playAudioCD ( ) ) , ac , " play_audiocd " ) ;
KAction * playPause = new K Action( i18n ( " &Play/Pause " ) , Amarok : : icon ( " play " ) , Key_Space , ec , TQT_SLOT ( playPause ( ) ) , ac , " play_pause " ) ;
new K Action( i18n ( " Script Manager " ) , Amarok : : icon ( " scripts " ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( showScriptSelector ( ) ) , ac , " script_manager " ) ;
new K Action( i18n ( " Queue Manager " ) , Amarok : : icon ( " queue " ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( showQueueManager ( ) ) , ac , " queue_manager " ) ;
KAction * seekForward = new K Action( i18n ( " &Seek Forward " ) , Amarok : : icon ( " fastforward " ) , Key_Right , ec , TQT_SLOT ( seekForward ( ) ) , ac , " seek_forward " ) ;
KAction * seekBackward = new K Action( i18n ( " &Seek Backward " ) , Amarok : : icon ( " rewind " ) , Key_Left , ec , TQT_SLOT ( seekBackward ( ) ) , ac , " seek_backward " ) ;
new K Action( i18n ( " Statistics " ) , Amarok : : icon ( " info " ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( showStatistics ( ) ) , ac , " statistics " ) ;
new K Action( i18n ( " Update Collection " ) , Amarok : : icon ( " refresh " ) , 0 , CollectionDB : : instance ( ) , TQT_SLOT ( scanModifiedDirs ( ) ) , actionCollection ( ) , " update_collection " ) ;
new TDE Action( i18n ( " Play Media... " ) , Amarok : : icon ( " files " ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotPlayMedia ( ) ) , ac , " playlist_playmedia " ) ;
new TDE Action( i18n ( " Play Audio CD " ) , Amarok : : icon ( " album " ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( playAudioCD ( ) ) , ac , " play_audiocd " ) ;
TDEAction * playPause = new TDE Action( i18n ( " &Play/Pause " ) , Amarok : : icon ( " play " ) , Key_Space , ec , TQT_SLOT ( playPause ( ) ) , ac , " play_pause " ) ;
new TDE Action( i18n ( " Script Manager " ) , Amarok : : icon ( " scripts " ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( showScriptSelector ( ) ) , ac , " script_manager " ) ;
new TDE Action( i18n ( " Queue Manager " ) , Amarok : : icon ( " queue " ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( showQueueManager ( ) ) , ac , " queue_manager " ) ;
TDEAction * seekForward = new TDE Action( i18n ( " &Seek Forward " ) , Amarok : : icon ( " fastforward " ) , Key_Right , ec , TQT_SLOT ( seekForward ( ) ) , ac , " seek_forward " ) ;
TDEAction * seekBackward = new TDE Action( i18n ( " &Seek Backward " ) , Amarok : : icon ( " rewind " ) , Key_Left , ec , TQT_SLOT ( seekBackward ( ) ) , ac , " seek_backward " ) ;
new TDE Action( i18n ( " Statistics " ) , Amarok : : icon ( " info " ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( showStatistics ( ) ) , ac , " statistics " ) ;
new TDE Action( i18n ( " Update Collection " ) , Amarok : : icon ( " refresh " ) , 0 , CollectionDB : : instance ( ) , TQT_SLOT ( scanModifiedDirs ( ) ) , actionCollection ( ) , " update_collection " ) ;
m_lastfmTags < < " Alternative " < < " Ambient " < < " Chill Out " < < " Classical " < < " Dance "
< < " Electronica " < < " Favorites " < < " Heavy Metal " < < " Hip Hop " < < " Indie Rock "
< < " Industrial " < < " Japanese " < < " Pop " < < " Psytrance " < < " Rap " < < " Rock "
< < " Soundtrack " < < " Techno " < < " Trance " ;
KPopupMenu* playTagRadioMenu = new K PopupMenu( this ) ;
TDEPopupMenu* playTagRadioMenu = new TDE PopupMenu( this ) ;
int id = 0 ;
foreach ( m_lastfmTags ) {
playTagRadioMenu - > insertItem ( * it , this , TQT_SLOT ( playLastfmGlobaltag ( int ) ) , 0 , id ) ;
+ + id ;
}
KPopupMenu* addTagRadioMenu = new K PopupMenu( this ) ;
TDEPopupMenu* addTagRadioMenu = new TDE PopupMenu( this ) ;
id = 0 ;
foreach ( m_lastfmTags ) {
addTagRadioMenu - > insertItem ( * it , this , TQT_SLOT ( addLastfmGlobaltag ( int ) ) , 0 , id ) ;
+ + id ;
}
KActionMenu* playLastfm = new K ActionMenu( i18n ( " Play las&t.fm Stream " ) , Amarok : : icon ( " audioscrobbler " ) , ac , " lastfm_play " ) ;
TDEActionMenu* playLastfm = new TDE ActionMenu( i18n ( " Play las&t.fm Stream " ) , Amarok : : icon ( " audioscrobbler " ) , ac , " lastfm_play " ) ;
TQPopupMenu * playLastfmMenu = playLastfm - > popupMenu ( ) ;
playLastfmMenu - > insertItem ( i18n ( " Personal Radio " ) , this , TQT_SLOT ( playLastfmPersonal ( ) ) ) ;
playLastfmMenu - > insertItem ( i18n ( " Neighbor Radio " ) , this , TQT_SLOT ( playLastfmNeighbor ( ) ) ) ;
playLastfmMenu - > insertItem ( i18n ( " Custom Station " ) , this , TQT_SLOT ( playLastfmCustom ( ) ) ) ;
playLastfmMenu - > insertItem ( i18n ( " Global Tag Radio " ) , playTagRadioMenu ) ;
KActionMenu* addLastfm = new K ActionMenu( i18n ( " Add las&t.fm Stream " ) , Amarok : : icon ( " audioscrobbler " ) , ac , " lastfm_add " ) ;
TDEActionMenu* addLastfm = new TDE ActionMenu( i18n ( " Add las&t.fm Stream " ) , Amarok : : icon ( " audioscrobbler " ) , ac , " lastfm_add " ) ;
TQPopupMenu * addLastfmMenu = addLastfm - > popupMenu ( ) ;
addLastfmMenu - > insertItem ( i18n ( " Personal Radio " ) , this , TQT_SLOT ( addLastfmPersonal ( ) ) ) ;
addLastfmMenu - > insertItem ( i18n ( " Neighbor Radio " ) , this , TQT_SLOT ( addLastfmNeighbor ( ) ) ) ;
@ -191,16 +191,16 @@ PlaylistWindow::PlaylistWindow()
ac - > action ( " options_configure_globals " ) - > setText ( i18n ( " Configure &Global Shortcuts... " ) ) ;
new K Action( i18n ( " Previous Track " ) , Amarok : : icon ( " back " ) , 0 , ec , TQT_SLOT ( previous ( ) ) , ac , " prev " ) ;
new K Action( i18n ( " Play " ) , Amarok : : icon ( " play " ) , 0 , ec , TQT_SLOT ( play ( ) ) , ac , " play " ) ;
new K Action( i18n ( " Pause " ) , Amarok : : icon ( " pause " ) , 0 , ec , TQT_SLOT ( pause ( ) ) , ac , " pause " ) ;
new K Action( i18n ( " Next Track " ) , Amarok : : icon ( " next " ) , 0 , ec , TQT_SLOT ( next ( ) ) , ac , " next " ) ;
new TDE Action( i18n ( " Previous Track " ) , Amarok : : icon ( " back " ) , 0 , ec , TQT_SLOT ( previous ( ) ) , ac , " prev " ) ;
new TDE Action( i18n ( " Play " ) , Amarok : : icon ( " play " ) , 0 , ec , TQT_SLOT ( play ( ) ) , ac , " play " ) ;
new TDE Action( i18n ( " Pause " ) , Amarok : : icon ( " pause " ) , 0 , ec , TQT_SLOT ( pause ( ) ) , ac , " pause " ) ;
new TDE Action( i18n ( " Next Track " ) , Amarok : : icon ( " next " ) , 0 , ec , TQT_SLOT ( next ( ) ) , ac , " next " ) ;
KAction * toggleFocus = new K Action( i18n ( " Toggle Focus " ) , " reload " , CTRL + Key_Tab , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToggleFocus ( ) ) , ac , " toggle_focus " ) ;
TDEAction * toggleFocus = new TDE Action( i18n ( " Toggle Focus " ) , " reload " , CTRL + Key_Tab , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToggleFocus ( ) ) , ac , " toggle_focus " ) ;
{ // K Action idiocy -- shortcuts don't work until they've been plugged into a menu
K PopupMenu asdf ;
{ // TDE Action idiocy -- shortcuts don't work until they've been plugged into a menu
TDE PopupMenu asdf ;
playPause - > plug ( & asdf ) ;
seekForward - > plug ( & asdf ) ;
@ -264,7 +264,7 @@ void PlaylistWindow::init()
TQFrame * playlist ;
{ //<Search LineEdit>
KToolBar * bar = new K ToolBar( m_browsers - > container ( ) , " NotMainToolBar " ) ;
TDEToolBar * bar = new TDE ToolBar( m_browsers - > container ( ) , " NotMainToolBar " ) ;
bar - > setIconSize ( 22 , false ) ; //looks more sensible
bar - > setFlat ( true ) ; //removes the ugly frame
bar - > setMovingEnabled ( false ) ; //removes the ugly frame
@ -276,7 +276,7 @@ void PlaylistWindow::init()
actionCollection ( ) - > action ( " playlist_undo " ) - > plug ( bar ) ;
actionCollection ( ) - > action ( " playlist_redo " ) - > plug ( bar ) ;
bar - > boxLayout ( ) - > addStretch ( ) ;
TQWidget * button = new K ToolBarButton( " locationbar_erase " , 1 , bar ) ;
TQWidget * button = new TDE ToolBarButton( " locationbar_erase " , 1 , bar ) ;
TQLabel * filter_label = new TQLabel ( i18n ( " S&earch: " ) + ' ' , bar ) ;
m_lineEdit = new ClickLineEdit ( i18n ( " Playlist Search " ) , bar ) ;
filter_label - > setBuddy ( m_lineEdit ) ;
@ -309,7 +309,7 @@ void PlaylistWindow::init()
# endif
TQWidget * statusbar = new Amarok : : StatusBar ( this ) ;
K Action* repeatAction = Amarok : : actionCollection ( ) - > action ( " repeat " ) ;
TDE Action* repeatAction = Amarok : : actionCollection ( ) - > action ( " repeat " ) ;
connect ( repeatAction , TQT_SIGNAL ( activated ( int ) ) , playlist , TQT_SLOT ( slotRepeatTrackToggled ( int ) ) ) ;
m_menubar = new KMenuBar ( this ) ;
@ -318,7 +318,7 @@ void PlaylistWindow::init()
# endif
//BEGIN Actions menu
KPopupMenu * actionsMenu = new K PopupMenu( m_menubar ) ;
TDEPopupMenu * actionsMenu = new TDE PopupMenu( m_menubar ) ;
actionCollection ( ) - > action ( " playlist_playmedia " ) - > plug ( actionsMenu ) ;
actionCollection ( ) - > action ( " lastfm_play " ) - > plug ( actionsMenu ) ;
actionCollection ( ) - > action ( " play_audiocd " ) - > plug ( actionsMenu ) ;
@ -334,7 +334,7 @@ void PlaylistWindow::init()
//END Actions menu
//BEGIN Playlist menu
KPopupMenu * playlistMenu = new K PopupMenu( m_menubar ) ;
TDEPopupMenu * playlistMenu = new TDE PopupMenu( m_menubar ) ;
actionCollection ( ) - > action ( " playlist_add " ) - > plug ( playlistMenu ) ;
actionCollection ( ) - > action ( " stream_add " ) - > plug ( playlistMenu ) ;
actionCollection ( ) - > action ( " lastfm_add " ) - > plug ( playlistMenu ) ;
@ -355,16 +355,16 @@ void PlaylistWindow::init()
//END Playlist menu
//BEGIN Mode menu
KPopupMenu * modeMenu = new K PopupMenu( m_menubar ) ;
TDEPopupMenu * modeMenu = new TDE PopupMenu( m_menubar ) ;
actionCollection ( ) - > action ( " repeat " ) - > plug ( modeMenu ) ;
KSelectAction * random = static_cast < K SelectAction* > ( actionCollection ( ) - > action ( " random_mode " ) ) ;
TDESelectAction * random = static_cast < TDE SelectAction* > ( actionCollection ( ) - > action ( " random_mode " ) ) ;
random - > plug ( modeMenu ) ;
random - > popupMenu ( ) - > insertSeparator ( ) ;
actionCollection ( ) - > action ( " favor_tracks " ) - > plug ( random - > popupMenu ( ) ) ;
//END Mode menu
//BEGIN Tools menu
m_toolsMenu = new K PopupMenu( m_menubar ) ;
m_toolsMenu = new TDE PopupMenu( m_menubar ) ;
m_toolsMenu - > insertItem ( SmallIconSet ( Amarok : : icon ( " covermanager " ) ) , i18n ( " &Cover Manager " ) , Amarok : : Menu : : ID_SHOW_COVER_MANAGER ) ;
actionCollection ( ) - > action ( " queue_manager " ) - > plug ( m_toolsMenu ) ;
m_toolsMenu - > insertItem ( SmallIconSet ( Amarok : : icon ( " visualizations " ) ) , i18n ( " &Visualizations " ) , Amarok : : Menu : : ID_SHOW_VIS_SELECTOR ) ;
@ -386,10 +386,10 @@ void PlaylistWindow::init()
//END Tools menu
//BEGIN Settings menu
m_settingsMenu = new K PopupMenu( m_menubar ) ;
//TODO use KStdAction or K MainWindow
m_settingsMenu = new TDE PopupMenu( m_menubar ) ;
//TODO use KStdAction or TDE MainWindow
# ifndef TQ_WS_MAC
static_cast < K ToggleAction * > ( actionCollection ( ) - > action ( KStdAction : : name ( KStdAction : : ShowMenubar ) ) ) - > setChecked ( AmarokConfig : : showMenuBar ( ) ) ;
static_cast < TDE ToggleAction * > ( actionCollection ( ) - > action ( KStdAction : : name ( KStdAction : : ShowMenubar ) ) ) - > setChecked ( AmarokConfig : : showMenuBar ( ) ) ;
actionCollection ( ) - > action ( KStdAction : : name ( KStdAction : : ShowMenubar ) ) - > plug ( m_settingsMenu ) ;
m_settingsMenu - > insertItem ( AmarokConfig : : showToolbar ( ) ? i18n ( " Hide Toolbar " ) : i18n ( " Show Toolbar " ) , ID_SHOW_TOOLBAR ) ;
m_settingsMenu - > insertItem ( AmarokConfig : : showPlayerWindow ( ) ? i18n ( " Hide Player &Window " ) : i18n ( " Show Player &Window " ) , ID_SHOW_PLAYERWINDOW ) ;
@ -545,12 +545,12 @@ void PlaylistWindow::createGUI()
m_toolbar - > clear ( ) ;
// K Actions don't unplug themselves when the widget that is plugged is deleted!
// TDE Actions don't unplug themselves when the widget that is plugged is deleted!
//we need to unplug to detect if the menu is plugged in App::applySettings()
//TODO report to bugs.kde.org
//we unplug after clear as otherwise it crashes! dunno why..
K ActionPtrList actions = actionCollection ( ) - > actions ( ) ;
for ( K ActionPtrList: : Iterator it = actions . begin ( ) , end = actions . end ( ) ; it ! = end ; + + it )
TDE ActionPtrList actions = actionCollection ( ) - > actions ( ) ;
for ( TDE ActionPtrList: : Iterator it = actions . begin ( ) , end = actions . end ( ) ; it ! = end ; + + it )
( * it ) - > unplug ( m_toolbar ) ;
KXMLGUIBuilder builder ( this ) ;
@ -560,9 +560,9 @@ void PlaylistWindow::createGUI()
factory . addClient ( this ) ;
//TEXT ON RIGHT HACK
// K ToolBarButtons have independent settings for their appearance.
// KToolBarButton::modeChange() causes that button to set its mode to that of its parent K ToolBar
// K ToolBar::setIconText() calls modeChange() for children, unless 2nd param is false
// TDE ToolBarButtons have independent settings for their appearance.
// TDEToolBarButton::modeChange() causes that button to set its mode to that of its parent TDE ToolBar
// TDE ToolBar::setIconText() calls modeChange() for children, unless 2nd param is false
TQStringList list ;
list < < " toolbutton_playlist_add "
@ -572,13 +572,13 @@ void PlaylistWindow::createGUI()
< < " toolbutton_burn_menu "
< < " toolbutton_amarok_menu " ;
m_toolbar - > setIconText ( K ToolBar: : IconTextRight , false ) ; //we want some buttons to have text on right
m_toolbar - > setIconText ( TDE ToolBar: : IconTextRight , false ) ; //we want some buttons to have text on right
const TQStringList : : ConstIterator end = list . constEnd ( ) ;
const TQStringList : : ConstIterator last = list . fromLast ( ) ;
for ( TQStringList : : ConstIterator it = list . constBegin ( ) ; it ! = end ; + + it )
{
K ToolBarButton* const button = static_cast < K ToolBarButton* > ( TQT_TQWIDGET ( m_toolbar - > child ( ( * it ) . latin1 ( ) ) ) ) ;
TDE ToolBarButton* const button = static_cast < TDE ToolBarButton* > ( TQT_TQWIDGET ( m_toolbar - > child ( ( * it ) . latin1 ( ) ) ) ) ;
if ( it = = last ) {
//if the user has no PlayerWindow, he MUST have the menu action plugged
@ -593,7 +593,7 @@ void PlaylistWindow::createGUI()
}
}
m_toolbar - > setIconText ( K ToolBar: : IconOnly , false ) ; //default appearance
m_toolbar - > setIconText ( TDE ToolBar: : IconOnly , false ) ; //default appearance
conserveMemory ( ) ;
setUpdatesEnabled ( true ) ;
}
@ -649,7 +649,7 @@ bool PlaylistWindow::eventFilter( TQObject *o, TQEvent *e )
// intercept F2 for inline tag renaming
// NOTE: tab will move to the next tag
// NOTE: if item is still null don't select first item in playlist, user wouldn't want that. It's silly.
// TODO: berkus has solved the "inability to cancel" issue with K ListView, but it's not in tdelibs yet..
// TODO: berkus has solved the "inability to cancel" issue with TDE ListView, but it's not in tdelibs yet..
// item may still be null, but this is safe
// NOTE: column 0 cannot be edited currently, hence we pick column 1
@ -1050,7 +1050,7 @@ void PlaylistWindow::slotToggleFocus() //SLOT
void PlaylistWindow : : slotToggleMenu ( ) //SLOT
{
if ( static_cast < K ToggleAction * > ( actionCollection ( ) - > action ( KStdAction : : name ( KStdAction : : ShowMenubar ) ) ) - > isChecked ( ) ) {
if ( static_cast < TDE ToggleAction * > ( actionCollection ( ) - > action ( KStdAction : : name ( KStdAction : : ShowMenubar ) ) ) - > isChecked ( ) ) {
AmarokConfig : : setShowMenuBar ( true ) ;
m_menubar - > setShown ( true ) ;
}