Commit 4d301462 authored by Michael Pyne's avatar Michael Pyne

JuK compiles for me again. I haven't run it yet, and I don't imagine great things would

come of that anyways since I haven't been able to test.  And I still need to work on the
CMake stuff as well, it kind of assumes you have Akode at this point or something.

svn path=/trunk/KDE/kdemultimedia/juk/; revision=536433
parent 1e908c20
......@@ -91,7 +91,11 @@ kde4_add_dcop_skels(juk_SRCS jukIface.h )
kde4_add_executable(juk ${juk_SRCS})
target_link_libraries(juk ${KDE4_KDECORE_LIBS} m kio khtml )
# Add gstreamer here too...
SET(backendLibs ${AKODE_LIBRARIES})
target_link_libraries(juk ${KDE4_KDECORE_LIBS} m kio khtml kdeui tag
${backendLibs})
install_targets(/bin juk )
......
......@@ -28,7 +28,7 @@ namespace ActionCollection
return a;
}
KAction *action(const char *key)
KAction *action(const QString &key)
{
#ifndef NO_DEBUG
KAction *a = actions()->action(key);
......
......@@ -30,13 +30,13 @@ namespace ActionCollection
* Returns the action for the associated key from the global action
* collection.
*/
KAction *action(const char *key);
KAction *action(const QString &key);
/**
* Returns the action for the associated key but includes a cast to the
* type \a T. i.e. KSelectAction *a = action<KSelectAction>("chooser");
*/
template <class T> T *action(const char *key)
template <class T> T *action(const QString &key)
{
return dynamic_cast<T *>(action(key));
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -23,7 +23,7 @@
#include <qbuttongroup.h>
#include <q3widgetstack.h>
class KeyDialog : public KDialogBase
class KeyDialog : public KDialog
{
Q_OBJECT
......@@ -31,7 +31,7 @@ public:
/**
* Constructs a KeyDialog called @p name as a child of @p parent.
*/
KeyDialog(KGlobalAccel *keys, KActionCollection *actionCollection, QWidget *parent = 0, const char* name = 0);
KeyDialog(KActionCollection *actionCollection, QWidget *parent = 0);
/**
* Destructor. Deletes all resources used by a KeyDialog object.
......@@ -40,17 +40,15 @@ public:
/**
* This is a member function, provided to allow inserting both global
* accelerators and actions. It behaves essentially like the functions
* in KKeyDialog.
* accelerators and actions.
*/
static int configure(KGlobalAccel *keys, KActionCollection *actionCollection, QWidget *parent = 0);
static int configure(KActionCollection *actionCollection, QWidget *parent = 0);
/**
* This is a member function, provided to create a global accelerator with
* standard keys. It behaves like the function in KGlobalAccel.
* standard keys.
*/
static void insert(KGlobalAccel *keys, const QString &action, const QString &label,
const QObject *objSlot, const char *methodSlot);
static void setupActionShortcut(const QString &actionName);
private:
......@@ -61,10 +59,10 @@ private:
struct KeyInfo {
QString action;
KShortcut shortcut[3][2];
KShortcut shortcut[3];
};
void newDialog(KGlobalAccel *keys, KActionCollection *actionCollection, int selectedButton = 0);
void newDialog(KActionCollection *actionCollection, int selectedButton = 0);
int configure();
private slots:
......@@ -73,7 +71,6 @@ private slots:
private:
KActionCollection *m_actionCollection;
KGlobalAccel *m_keys;
KKeyChooser *m_pKeyChooser;
QButtonGroup *m_group;
Q3WidgetStack *m_widgetStack;
......
......@@ -841,11 +841,11 @@ PlaylistCollection::ActionHandler::ActionHandler(PlaylistCollection *collection)
menu = new KActionMenu(KIcon("filenew"), i18n("&New"), actions(), "file_new");
menu->insert(createAction(i18n("&Empty Playlist..."), SLOT(slotCreatePlaylist()),
"newPlaylist", "window_new", "CTRL+n"));
"newPlaylist", "window_new", Qt::CTRL + Qt::Key_N));
menu->insert(createAction(i18n("&Search Playlist..."), SLOT(slotCreateSearchPlaylist()),
"newSearchPlaylist", "find", "CTRL+f"));
"newSearchPlaylist", "find", Qt::CTRL + Qt::Key_F));
menu->insert(createAction(i18n("Playlist From &Folder..."), SLOT(slotCreateFolderPlaylist()),
"newDirectoryPlaylist", "fileopen", "CTRL+d"));
"newDirectoryPlaylist", "fileopen", Qt::CTRL + Qt::Key_D));
// Guess tag info menu
......@@ -854,23 +854,23 @@ PlaylistCollection::ActionHandler::ActionHandler(PlaylistCollection *collection)
/* menu->setIconSet(SmallIconSet("wizard")); */
menu->insert(createAction(i18n("From &File Name"), SLOT(slotGuessTagFromFile()),
"guessTagFile", "fileimport", "CTRL+g"));
"guessTagFile", "fileimport", Qt::CTRL + Qt::Key_G));
menu->insert(createAction(i18n("From &Internet"), SLOT(slotGuessTagFromInternet()),
"guessTagInternet", "connect_established", "CTRL+i"));
"guessTagInternet", "connect_established", Qt::CTRL + Qt::Key_I));
#else
createAction(i18n("Guess Tag Information From &File Name"), SLOT(slotGuessTagFromFile()),
"guessTag", "fileimport", "CTRL+f");
"guessTag", "fileimport", Qt::CTRL + Qt::Key_F);
#endif
createAction(i18n("Play First Track"),SLOT(slotPlayFirst()), "playFirst");
createAction(i18n("Play Next Album"), SLOT(slotPlayNextAlbum()), "forwardAlbum", "next");
createAction(i18n("Open..."), SLOT(slotOpen()), "file_open", "fileopen", "CTRL+o");
createAction(i18n("Open..."), SLOT(slotOpen()), "file_open", "fileopen", Qt::CTRL + Qt::Key_O);
createAction(i18n("Add &Folder..."), SLOT(slotAddFolder()), "openDirectory", "fileopen");
createAction(i18n("&Rename..."), SLOT(slotRename()), "renamePlaylist", "lineedit");
createAction(i18n("D&uplicate..."), SLOT(slotDuplicate()), "duplicatePlaylist", "editcopy");
createAction(i18n("Save"), SLOT(slotSave()), "file_save", "filesave", "CTRL+s");
createAction(i18n("Save"), SLOT(slotSave()), "file_save", "filesave", Qt::CTRL + Qt::Key_S);
createAction(i18n("Save As..."), SLOT(slotSaveAs()), "file_save_as", "filesaveas");
createAction(i18n("R&emove"), SLOT(slotRemove()), "deleteItemPlaylist", "edittrash");
createAction(i18n("Reload"), SLOT(slotReload()), "reloadPlaylist", "reload");
......@@ -878,16 +878,16 @@ PlaylistCollection::ActionHandler::ActionHandler(PlaylistCollection *collection)
createAction(i18n("&Delete"), SLOT(slotRemoveItems()), "removeItem", "editdelete");
createAction(i18n("Refresh"), SLOT(slotRefreshItems()), "refresh", "reload");
createAction(i18n("&Rename File"), SLOT(slotRenameItems()), "renameFile", "filesaveas", "CTRL+r");
createAction(i18n("&Rename File"), SLOT(slotRenameItems()), "renameFile", "filesaveas", Qt::CTRL + Qt::Key_R);
menu = new KActionMenu(i18n("Cover Manager"), actions(), "coverManager");
/* menu->setIconSet(SmallIconSet("image")); */
menu->insert(createAction(i18n("&View Cover"),
SLOT(slotViewCovers()), "viewCover", "viewmag"));
menu->insert(createAction(i18n("Get Cover From &File..."),
SLOT(slotAddLocalCover()), "addCover", "fileimport", "CTRL+SHIFT+f"));
SLOT(slotAddLocalCover()), "addCover", "fileimport", Qt::CTRL + Qt::SHIFT + Qt::Key_F));
menu->insert(createAction(i18n("Get Cover From &Internet..."),
SLOT(slotAddInternetCover()), "googleCover", "connect_established", "CTRL+SHIFT+g"));
SLOT(slotAddInternetCover()), "googleCover", "connect_established", Qt::CTRL + Qt::SHIFT + Qt::Key_G));
menu->insert(createAction(i18n("&Delete Cover"),
SLOT(slotRemoveCovers()), "removeCover", "editdelete"));
menu->insert(createAction(i18n("Show Cover &Manager"),
......
......@@ -122,7 +122,9 @@ void PlaylistSplitter::setupActions()
new KToggleAction(i18n("Show &Search Bar"), "filefind", 0, ActionCollection::actions(), "showSearch");
showSearch->setCheckedState(i18n("Hide &Search Bar"));
new KAction(i18n("Edit Track Search"), "edit_clear", "F6", this, SLOT(setFocus()), ActionCollection::actions(), "editTrackSearch");
KAction *act = new KAction(KIcon("edit_clear"), i18n("Edit Track Search"), ActionCollection::actions(), "editTrackSearch");
act->setShortcut(Qt::Key_F6);
connect(act, SIGNAL(triggered(bool)), SLOT(setFocus()));
}
void PlaylistSplitter::setupLayout()
......
......@@ -135,6 +135,7 @@ const int SliderAction::maxPosition = 1000;
SliderAction::SliderAction(const QString &text, KActionCollection* collection, const char *name)
: KAction(text, 0, 0, 0, collection, name),
m_toolBar(0),
m_widget(0),
m_layout(0),
m_trackPositionSlider(0),
m_volumeSlider(0),
......@@ -151,9 +152,9 @@ SliderAction::~SliderAction()
int SliderAction::plug(QWidget *parent, int index)
{
QWidget *w = createWidget(parent);
m_widget = createWidget(parent);
if(!w)
if(!m_widget)
return -1;
// the check for null makes sure that there is only one toolbar that this is
......@@ -162,11 +163,8 @@ int SliderAction::plug(QWidget *parent, int index)
if(parent->inherits("KToolBar") && !m_toolBar) {
m_toolBar = static_cast<KToolBar *>(parent);
int id = KAction::getToolButtonID();
m_toolBar->insertWidget(id, w->width(), w, index);
addContainer(m_toolBar, id);
// m_toolBar->insertWidget(id, m_widget->width(), m_widget, index);
m_toolBar->addWidget(m_widget);
connect(m_toolBar, SIGNAL(destroyed()), this, SLOT(slotToolbarDestroyed()));
connect(m_toolBar, SIGNAL(orientationChanged(Orientation)),
......@@ -187,15 +185,9 @@ int SliderAction::plug(QWidget *parent, int index)
void SliderAction::unplug(QWidget *parent)
{
if (parent->inherits("KToolBar")) {
m_toolBar = static_cast<KToolBar *>(parent);
int index = findContainer(m_toolBar);
if (index != -1) {
m_toolBar->removeItem(itemId(index));
removeContainer(index);
m_toolBar = 0;
}
delete m_widget;
m_widget = 0;
m_toolBar = 0;
}
}
......@@ -210,7 +202,7 @@ void SliderAction::slotUpdateOrientation()
if(!m_toolBar)
return;
if(m_toolBar->barPos() == KToolBar::Right || m_toolBar->barPos() == KToolBar::Left) {
if(m_toolBar->orientation() == Qt::Vertical) {
m_trackPositionSlider->setOrientation(Qt::Vertical);
m_volumeSlider->setOrientation(Qt::Vertical);
m_layout->setDirection(QBoxLayout::TopToBottom);
......@@ -236,15 +228,12 @@ QWidget *SliderAction::createWidget(QWidget *parent) // virtual -- used by base
KToolBar *toolBar = dynamic_cast<KToolBar *>(parent);
if(toolBar)
toolBar->setStretchableWidget(base);
Qt::Orientation orientation = Qt::Horizontal;
Qt::Orientation orientation;
if(toolBar && toolBar->barPos() == KToolBar::Right || toolBar->barPos() == KToolBar::Left)
orientation = Qt::Vertical;
else
orientation = Qt::Horizontal;
if(toolBar) {
// toolBar->setStretchableWidget(base);
orientation = toolBar->orientation();
}
m_layout = new QBoxLayout(base, QBoxLayout::TopToBottom, 5, 5);
......@@ -305,18 +294,18 @@ void SliderAction::slotUpdateSize()
if(!m_toolBar)
return;
if(m_toolBar->barPos() == KToolBar::Right || m_toolBar->barPos() == KToolBar::Left) {
m_volumeSlider->setMaximumWidth(m_toolBar->iconSize() - offset);
if(m_toolBar->orientation() == Qt::Vertical) {
m_volumeSlider->setMaximumWidth(m_toolBar->iconSize().width() - offset);
m_volumeSlider->setMaximumHeight(volumeMax);
m_trackPositionSlider->setMaximumWidth(m_toolBar->iconSize() - offset);
m_trackPositionSlider->setMaximumWidth(m_toolBar->iconSize().width() - offset);
m_trackPositionSlider->setMaximumHeight(absoluteMax);
}
else {
m_volumeSlider->setMaximumHeight(m_toolBar->iconSize() - offset);
m_volumeSlider->setMaximumHeight(m_toolBar->iconSize().height() - offset);
m_volumeSlider->setMaximumWidth(volumeMax);
m_trackPositionSlider->setMaximumHeight(m_toolBar->iconSize() - offset);
m_trackPositionSlider->setMaximumHeight(m_toolBar->iconSize().height() - offset);
m_trackPositionSlider->setMaximumWidth(absoluteMax);
}
}
......@@ -345,10 +334,12 @@ void SliderAction::slotVolumeSliderReleased()
void SliderAction::slotToolbarDestroyed()
{
#if 0 // what's going on here?
int index = findContainer(m_toolBar);
if(index != -1)
removeContainer(index);
#endif
m_toolBar = 0;
// This is probably a leak, but this code path hardly ever occurs, and it's
......
......@@ -89,6 +89,7 @@ private slots:
private:
KToolBar *m_toolBar;
QWidget *m_widget;
QBoxLayout *m_layout;
QSlider *m_trackPositionSlider;
VolumeSlider *m_volumeSlider;
......
......@@ -29,6 +29,8 @@
#include <klocale.h>
#include <kdebug.h>
#include <kiconloader.h>
#include <kicon.h>
#include <kshortcut.h>
#include <kactionclasses.h>
#include <qlabel.h>
......@@ -482,7 +484,9 @@ void TagEditor::setupActions()
show->setCheckedState(i18n("Hide &Tag Editor"));
connect(show, SIGNAL(toggled(bool)), this, SLOT(setShown(bool)));
new KAction(i18n("&Save"), "filesave", "CTRL+t", this, SLOT(slotSave()), ActionCollection::actions(), "saveItem");
KAction *act = new KAction(KIcon("filesave"), i18n("&Save"), ActionCollection::actions(), "saveItem");
act->setShortcut(Qt::CTRL + Qt::Key_T);
connect(act, SIGNAL(triggered(bool)), SLOT(slotSave()));
}
void TagEditor::setupLayout()
......
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