Commit 6fcead44 authored by David Faure's avatar David Faure

Some Qt4/KDE4 porting.

Does nobody care about juk anymore, that I have to port it regularly so that kdemultimedia compiles?
CCMAIL: kde-multimedia@kde.org

SliderAction remains to be ported (by providing a QActionWidgetFactory-derived class, apparently).

svn path=/trunk/KDE/kdemultimedia/juk/; revision=526141
parent 14c5a5bb
......@@ -3,7 +3,7 @@ project(juk)
add_subdirectory( pics )
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
include_directories( ${KDE4_INCLUDE_DIR}/taglib ${KDE4_INCLUDES} )
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")
########### next target ###############
......
......@@ -23,7 +23,8 @@ namespace ActionCollection
KActionCollection *actions()
{
static KActionCollection *a =
new KActionCollection(static_cast<QWidget *>(0));
new KActionCollection(static_cast<QObject *>(0));
// The widget of the action collection is set in Juk::setupActions().
return a;
}
......
......@@ -56,12 +56,12 @@ void DeleteWidget::slotShouldDelete(bool shouldDelete)
ddDeleteText->setText(i18n("<qt>These items will be <b>permanently "
"deleted</b> from your hard disk.</qt>"));
ddWarningIcon->setPixmap(KGlobal::iconLoader()->loadIcon("messagebox_warning",
KIcon::Desktop, KIcon::SizeLarge));
K3Icon::Desktop, K3Icon::SizeLarge));
}
else {
ddDeleteText->setText(i18n("<qt>These items will be moved to the Trash Bin.</qt>"));
ddWarningIcon->setPixmap(KGlobal::iconLoader()->loadIcon("trashcan_full",
KIcon::Desktop, KIcon::SizeLarge));
K3Icon::Desktop, K3Icon::SizeLarge));
}
}
......
......@@ -112,7 +112,7 @@ void JuK::setupLayout()
void JuK::setupActions()
{
ActionCollection::actions()->setWidget(this);
ActionCollection::actions()->setAssociatedWidget(this);
KStdAction::quit(this, SLOT(slotQuit()), ActionCollection::actions());
KStdAction::undo(this, SLOT(slotUndo()), ActionCollection::actions());
......@@ -124,19 +124,21 @@ void JuK::setupActions()
new KAction(i18n("Remove From Playlist"), "edit_remove", 0, kapp, SLOT(clear()), ActionCollection::actions(), "removeFromPlaylist");
KActionMenu *actionMenu = new KActionMenu(i18n("&Random Play"), "roll", ActionCollection::actions(), "actionMenu");
KActionMenu *actionMenu = new KActionMenu(KIcon("roll"), i18n("&Random Play"), ActionCollection::actions(), "actionMenu");
actionMenu->setDelayed(false);
KRadioAction *ka = new KRadioAction(i18n("&Disable Random Play"), "player_playlist", 0, ActionCollection::actions(), "disableRandomPlay");
ka->setExclusiveGroup("randomPlayGroup");
QActionGroup* randomPlayGroup = new QActionGroup( this );
KAction *ka = new KAction(KIcon("player_playlist"), i18n("&Disable Random Play"), ActionCollection::actions(), "disableRandomPlay");
ka->setActionGroup(randomPlayGroup);
actionMenu->insert(ka);
m_randomPlayAction = new KRadioAction(i18n("Use &Random Play"), "roll", 0, ActionCollection::actions(), "randomPlay");
m_randomPlayAction->setExclusiveGroup("randomPlayGroup");
m_randomPlayAction = new KAction(KIcon("roll"), i18n("Use &Random Play"), ActionCollection::actions(), "randomPlay");
m_randomPlayAction->setActionGroup(randomPlayGroup);
actionMenu->insert(m_randomPlayAction);
ka = new KRadioAction(i18n("Use &Album Random Play"), "roll", 0, ActionCollection::actions(), "albumRandomPlay");
ka->setExclusiveGroup("randomPlayGroup");
ka = new KAction(i18n("Use &Album Random Play"), "roll", ActionCollection::actions(), "albumRandomPlay");
ka->setActionGroup(randomPlayGroup);
connect(ka, SIGNAL(toggled(bool)), SLOT(slotCheckAlbumNextAction(bool)));
actionMenu->insert(ka);
......@@ -229,18 +231,18 @@ void JuK::setupGlobalAccels()
{
m_accel = new KGlobalAccel(this);
KeyDialog::insert(m_accel, "Play", i18n("Play"), action("play"), SLOT(activate()));
KeyDialog::insert(m_accel, "PlayPause", i18n("Play / Pause"), action("playPause"), SLOT(activate()));
KeyDialog::insert(m_accel, "Stop", i18n("Stop Playing"), action("stop"), SLOT(activate()));
KeyDialog::insert(m_accel, "Back", i18n("Back"), action("back"), SLOT(activate()));
KeyDialog::insert(m_accel, "Forward", i18n("Forward"), action("forward"), SLOT(activate()));
KeyDialog::insert(m_accel, "SeekBack", i18n("Seek Back"), action("seekBack"), SLOT(activate()));
KeyDialog::insert(m_accel, "SeekForward", i18n("Seek Forward"), action("seekForward"), SLOT(activate()));
KeyDialog::insert(m_accel, "VolumeUp", i18n("Volume Up"), action("volumeUp"), SLOT(activate()));
KeyDialog::insert(m_accel, "VolumeDown", i18n("Volume Down"), action("volumeDown"), SLOT(activate()));
KeyDialog::insert(m_accel, "Mute", i18n("Mute"), action("mute"), SLOT(activate()));
KeyDialog::insert(m_accel, "Play", i18n("Play"), action("play"), SLOT(trigger()));
KeyDialog::insert(m_accel, "PlayPause", i18n("Play / Pause"), action("playPause"), SLOT(trigger()));
KeyDialog::insert(m_accel, "Stop", i18n("Stop Playing"), action("stop"), SLOT(trigger()));
KeyDialog::insert(m_accel, "Back", i18n("Back"), action("back"), SLOT(trigger()));
KeyDialog::insert(m_accel, "Forward", i18n("Forward"), action("forward"), SLOT(trigger()));
KeyDialog::insert(m_accel, "SeekBack", i18n("Seek Back"), action("seekBack"), SLOT(trigger()));
KeyDialog::insert(m_accel, "SeekForward", i18n("Seek Forward"), action("seekForward"), SLOT(trigger()));
KeyDialog::insert(m_accel, "VolumeUp", i18n("Volume Up"), action("volumeUp"), SLOT(trigger()));
KeyDialog::insert(m_accel, "VolumeDown", i18n("Volume Down"), action("volumeDown"), SLOT(trigger()));
KeyDialog::insert(m_accel, "Mute", i18n("Mute"), action("mute"), SLOT(trigger()));
KeyDialog::insert(m_accel, "ShowHide", i18n("Show / Hide"), this, SLOT(slotShowHide()));
KeyDialog::insert(m_accel, "ForwardAlbum", i18n("Play Next Album"), action("forwardAlbum"), SLOT(activate()));
KeyDialog::insert(m_accel, "ForwardAlbum", i18n("Play Next Album"), action("forwardAlbum"), SLOT(trigger()));
m_accel->setConfigGroup("Shortcuts");
m_accel->readSettings();
......@@ -379,7 +381,7 @@ bool JuK::queryExit()
hide();
action("stop")->activate();
action("stop")->trigger();
delete m_systemTray;
m_systemTray = 0;
......
......@@ -83,7 +83,7 @@ private:
SystemTray *m_systemTray;
SliderAction *m_sliderAction;
KToggleAction *m_randomPlayAction;
KAction *m_randomPlayAction;
KToggleAction *m_toggleSystemTrayAction;
KToggleAction *m_toggleDockOnCloseAction;
KToggleAction *m_togglePopupsAction;
......
......@@ -244,7 +244,7 @@ void PlayerManager::setStatusLabel(StatusLabel *label)
KSelectAction *PlayerManager::playerSelectAction() // static
{
KSelectAction *action =
new KSelectAction(i18n("&Output To"), 0, ActionCollection::actions(), "outputSelect");
new KSelectAction(i18n("&Output To"), ActionCollection::actions(), "outputSelect");
QStringList l;
#if HAVE_ARTS
......@@ -420,7 +420,7 @@ void PlayerManager::seekBack()
void PlayerManager::playPause()
{
playing() ? action("pause")->activate() : action("play")->activate();
playing() ? action("pause")->trigger() : action("play")->trigger();
}
void PlayerManager::forward()
......
......@@ -483,7 +483,7 @@ void Playlist::playFirst()
{
TrackSequenceManager::instance()->setNextItem(static_cast<PlaylistItem *>(
Q3ListViewItemIterator(const_cast<Playlist *>(this), Q3ListViewItemIterator::Visible).current()));
action("forward")->activate();
action("forward")->trigger();
}
void Playlist::playNextAlbum()
......@@ -499,7 +499,7 @@ void Playlist::playNextAlbum()
current = TrackSequenceManager::instance()->nextItem();
TrackSequenceManager::instance()->setNextItem(current);
action("forward")->activate();
action("forward")->trigger();
}
void Playlist::playNext()
......@@ -993,7 +993,7 @@ void Playlist::removeFromDisk(const PlaylistItemList &items)
for(PlaylistItemList::ConstIterator it = items.begin(); it != items.end(); ++it) {
if(playingItem() == *it)
action("forward")->activate();
action("forward")->trigger();
QString removePath = (*it)->file().absFilePath();
if((!shouldDelete && KIO::NetAccess::synchronousRun(KIO::trash(removePath), this)) ||
......@@ -1646,7 +1646,7 @@ void Playlist::slotPlayFromBackMenu(int number) const
return;
TrackSequenceManager::instance()->setNextItem(m_backMenuItems[number]);
action("forward")->activate();
action("forward")->trigger();
}
////////////////////////////////////////////////////////////////////////////////
......@@ -2323,7 +2323,7 @@ void Playlist::slotPlayCurrent()
Q3ListViewItemIterator it(this, Q3ListViewItemIterator::Selected);
PlaylistItem *next = static_cast<PlaylistItem *>(it.current());
TrackSequenceManager::instance()->setNextItem(next);
action("forward")->activate();
action("forward")->trigger();
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -112,10 +112,15 @@ PlaylistBox::PlaylistBox(QWidget *parent, Q3WidgetStack *playlistStack) :
viewModeAction->setItems(modeNames);
#ifdef __GNUC__
#warning This needs to be ported to proper QActions
#endif
#if 0
QMenu *p = viewModeAction->popupMenu();
p->changeItem(0, SmallIconSet("view_detailed"), modeNames[0]);
p->changeItem(1, SmallIconSet("view_text"), modeNames[1]);
p->changeItem(2, SmallIconSet("view_tree"), modeNames[2]);
#endif
CollectionList::initialize(this);
Cache::loadPlaylists(this);
......@@ -647,8 +652,8 @@ void PlaylistBox::slotPlaylistChanged()
void PlaylistBox::slotDoubleClicked()
{
action("stop")->activate();
action("play")->activate();
action("stop")->trigger();
action("play")->trigger();
}
void PlaylistBox::slotShowContextMenu(Q3ListViewItem *, const QPoint &point, int)
......
......@@ -838,7 +838,7 @@ PlaylistCollection::ActionHandler::ActionHandler(PlaylistCollection *collection)
// "New" menu
menu = new KActionMenu(i18n("&New"), "filenew", actions(), "file_new");
menu = new KActionMenu(KIcon("filenew"), i18n("&New"), actions(), "file_new");
menu->insert(createAction(i18n("&Empty Playlist..."), SLOT(slotCreatePlaylist()),
"newPlaylist", "window_new", "CTRL+n"));
......@@ -880,7 +880,7 @@ PlaylistCollection::ActionHandler::ActionHandler(PlaylistCollection *collection)
createAction(i18n("Refresh"), SLOT(slotRefreshItems()), "refresh", "reload");
createAction(i18n("&Rename File"), SLOT(slotRenameItems()), "renameFile", "filesaveas", "CTRL+r");
menu = new KActionMenu(i18n("Cover Manager"), QString::null, actions(), "coverManager");
menu = new KActionMenu(i18n("Cover Manager"), actions(), "coverManager");
/* menu->setIconSet(SmallIconSet("image")); */
menu->insert(createAction(i18n("&View Cover"),
SLOT(slotViewCovers()), "viewCover", "viewmag"));
......
......@@ -154,8 +154,8 @@ bool SearchLine::eventFilter(QObject *watched, QEvent *e)
void SearchLine::slotActivate()
{
action("stop")->activate();
action("playFirst")->activate();
action("stop")->trigger();
action("playFirst")->trigger();
}
void SearchLine::updateColumns()
......@@ -267,7 +267,7 @@ void SearchWidget::updateColumns()
void SearchWidget::setupLayout()
{
boxLayout()->setSpacing(5);
/// Qt4 porting: disabled this: boxLayout()->setSpacing(5);
QToolButton *clearSearchButton = new QToolButton(this);
clearSearchButton->setTextLabel(i18n("Clear Search"), true);
......@@ -282,7 +282,11 @@ void SearchWidget::setupLayout()
connect(m_searchLine, SIGNAL(signalQueryChanged()), this, SIGNAL(signalQueryChanged()));
connect(m_searchLine, SIGNAL(signalDownPressed()), this, SIGNAL(signalDownPressed()));
connect(clearSearchButton, SIGNAL(pressed()), m_searchLine, SLOT(clear()));
setStretchableWidget(m_searchLine);
#ifdef __GNUC__
#warning TODO Find replacement for KToolBar::setStretchableWidget
#endif
//setStretchableWidget(m_searchLine);
// I've decided that I think this is ugly, for now.
......
......@@ -91,7 +91,7 @@ StatusLabel::StatusLabel(PlaylistInterface *playlist, QWidget *parent, const cha
jumpButton->setFlat(true);
jumpButton->setToolTip( i18n("Jump to the currently playing item"));
connect(jumpButton, SIGNAL(clicked()), action("showPlaying"), SLOT(activate()));
connect(jumpButton, SIGNAL(clicked()), action("showPlaying"), SLOT(trigger()));
installEventFilter(this);
......@@ -190,7 +190,7 @@ bool StatusLabel::eventFilter(QObject *o, QEvent *e)
updateTime();
}
else
action("showPlaying")->activate();
action("showPlaying")->trigger();
return true;
}
......
......@@ -470,19 +470,19 @@ void SystemTray::createButtonBox(QWidget *parent)
}
/**
* What happens here is that the action->activate() call will end up invoking
* What happens here is that the action->trigger() call will end up invoking
* createPopup(), which sets m_fade to true. Before the text starts fading
* control returns to this function, which resets m_fade to false.
*/
void SystemTray::slotBack()
{
action("back")->activate();
action("back")->trigger();
m_fade = false;
}
void SystemTray::slotForward()
{
action("forward")->activate();
action("forward")->trigger();
m_fade = false;
}
......@@ -565,15 +565,15 @@ void SystemTray::wheelEvent(QWheelEvent *e)
switch(e->state()) {
case Qt::ShiftButton:
if(e->delta() > 0)
action("volumeUp")->activate();
action("volumeUp")->trigger();
else
action("volumeDown")->activate();
action("volumeDown")->trigger();
break;
default:
if(e->delta() > 0)
action("forward")->activate();
action("forward")->trigger();
else
action("back")->activate();
action("back")->trigger();
break;
}
e->accept();
......@@ -594,9 +594,9 @@ void SystemTray::mousePressEvent(QMouseEvent *e)
if(!rect().contains(e->pos()))
return;
if(action("pause")->isEnabled())
action("pause")->activate();
action("pause")->trigger();
else
action("play")->activate();
action("play")->trigger();
break;
}
}
......
......@@ -597,7 +597,8 @@ void TagEditor::setupLayout()
trackRowLayout->setWidth();
}
m_commentBox = new KEdit(this, "commentBox");
m_commentBox = new KEdit(this);
m_commentBox->setObjectName( "commentBox" );
m_commentBox->setTextFormat(Qt::PlainText);
addItem(i18n("&Comment:"), m_commentBox, rightColumnLayout, "edit");
fileNameLabel->setMinimumHeight(m_trackSpin->height());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment