Commit 57517a55 authored by Scott Wheeler's avatar Scott Wheeler

Added show column stuff to the view menu.

svn path=/trunk/kdemultimedia/juk/; revision=207431
parent 77a800dd
......@@ -119,7 +119,8 @@ void JuK::setupActions()
showEditorAction = new KToggleAction(i18n("Show Tag Editor"), "edit", 0, actionCollection(), "showEditor");
connect(showEditorAction, SIGNAL(toggled(bool)), splitter, SLOT(setEditorVisible(bool)));
KStdAction::redisplay(splitter, SLOT(refresh()), actionCollection());
actionCollection()->insert(splitter->columnVisibleAction());
// play menu
randomPlayAction = new KToggleAction(i18n("Random Play"), 0, actionCollection(), "randomPlay");
playAction = new KAction(i18n("&Play"), "player_play", 0, this, SLOT(play()), actionCollection(), "play");
......
......@@ -26,6 +26,7 @@
</Menu>
<Menu name="view" noMerge="1"><text>&amp;View</text>
<Action name="showEditor"/>
<Action name="showColumns"/>
<Separator/>
......
......@@ -24,6 +24,7 @@
#include <kstandarddirs.h>
#include <klocale.h>
#include <klineedit.h>
#include <kactionclasses.h>
#include <kdebug.h>
#include <qfileinfo.h>
......@@ -480,8 +481,9 @@ void Playlist::setup()
// setup header RMB menu
//////////////////////////////////////////////////
headerMenu = new KPopupMenu(this);
headerMenu->insertTitle(i18n("Show Columns"));
_columnVisibleAction = new KActionMenu(i18n("Show Columns"), this, "showColumns");
headerMenu = _columnVisibleAction->popupMenu();
headerMenu->insertTitle(i18n("Show..."));
headerMenu->setCheckable(true);
for(int i =0; i < header()->count(); ++i) {
......
......@@ -31,6 +31,7 @@ class PlaylistBoxItem;
class KPopupMenu;
class KPopupMenu;
class KActionMenu;
class QEvent;
......@@ -128,8 +129,10 @@ public:
PlaylistItem *nextItem(PlaylistItem *current, bool random = false);
PlaylistItem *previousItem(PlaylistItem *current, bool random = false);
KActionMenu *columnVisibleAction() const { return _columnVisibleAction; }
public slots:
/**
/**
* Remove the currently selected items from the playlist and disk.
*/
void removeSelectedItems() { remove(selectedItems()); };
......@@ -213,9 +216,10 @@ private:
QString playlistName;
PlaylistSplitter *splitter;
PlaylistBoxItem *boxItem;
KPopupMenu *rmbMenu;
KPopupMenu *headerMenu;
KActionMenu *_columnVisibleAction;
int rmbPasteID;
int rmbEditID;
......
......@@ -457,10 +457,14 @@ void PlaylistSplitter::readConfig()
uint i = 0;
for(QValueList<int>::Iterator it = l.begin(); it != l.end(); ++it) {
if(! bool(*it)) {
kdDebug() << "! column " << i << endl;
_visibleColumns[i] = bool(*it);
collection->hideColumn(i);
}
// while we're looping go ahead and populate _columnNames
_columnNames.append(collection->columnText(i));
i++;
}
setupColumns(collection);
......
......@@ -29,6 +29,7 @@
#include "stringhash.h"
#include "tageditor.h"
class KActionMenu;
class PlaylistBoxItem;
class PlaylistItem;
......@@ -143,6 +144,9 @@ public:
*/
void open(const QString &file);
QStringList columnNames() const { return _columnNames; }
KActionMenu *columnVisibleAction() const { return collection->columnVisibleAction(); }
// static methods
......@@ -297,6 +301,7 @@ private:
QStringList directoryQueueRemove;
QValueVector<bool> _visibleColumns;
QStringList _columnNames;
bool showEditor;
bool restore;
......
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