Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

playlist.h 21.9 KB
Newer Older
1 2 3 4
/***************************************************************************
                          playlist.h  -  description
                             -------------------
    begin                : Sat Feb 16 2002
5
    copyright            : (C) 2002, 2003 by Scott Wheeler
6
    email                : wheeler@kde.org
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef PLAYLIST_H
#define PLAYLIST_H

#include <klistview.h>
22
#include <kurldrag.h>
Dirk Mueller's avatar
compile  
Dirk Mueller committed
23
#include <kdebug.h>
24
#include <kglobalsettings.h>
25

26
#include <qvaluevector.h>
Dirk Mueller's avatar
compile  
Dirk Mueller committed
27
#include <qfileinfo.h>
28

29
#include "stringhash.h"
Scott Wheeler's avatar
Scott Wheeler committed
30
#include "playlistsearch.h"
31
#include "tagguesser.h"
32
#include "playlistinterface.h"
33 34

class KPopupMenu;
35
class KActionMenu;
36 37

class QEvent;
Scott Wheeler's avatar
Scott Wheeler committed
38 39 40 41 42

class PlaylistSearch;

class PlaylistItem;
typedef QValueList<PlaylistItem *> PlaylistItemList;
43

44 45
typedef QValueList<Playlist *> PlaylistList;

46
class Playlist : public KListView /*, PlaylistInterface */
47 48
{
    Q_OBJECT
49

50
public:
51

52 53
    /**
     * Before creating a playlist directly, please see
54 55
     * PlaylistSplitter::createPlaylist().
     */
56
    Playlist(QWidget *parent, const QString &name = QString::null);
57

58 59
    /**
     * Before creating a playlist directly, please see
60 61
     * PlaylistSplitter::openPlaylist().
     */
62
    Playlist(const QFileInfo &playlistFile, QWidget *parent, const QString &name);
63

64 65
    virtual ~Playlist();

66 67 68
    /**
     * Saves the file to the currently set file name.  If there is no filename
     * currently set, the default behavior is to prompt the user for a file
69
     * name.
70
     */
71
    virtual void save();
Scott Wheeler's avatar
Scott Wheeler committed
72 73 74 75 76

    /**
     * Standard "save as".  Prompts the user for a location where to save the
     * playlist to.
     */
77
    virtual void saveAs();
Scott Wheeler's avatar
Scott Wheeler committed
78 79 80 81 82 83 84 85 86 87 88 89 90 91

    /**
     * Removes \a item from the Playlist, but not from the disk.  If
     * \a emitChanged is true this will also notify relevant classes
     * that the content of the list has changed.
     *
     * In some situations, for instance when removing items in a loop, it is
     * preferable to delay this notification until after other operations have
     * completed.  In those cases set \a emitChanged to false and call the
     * signal directly.
     *
     * @see signalCountChanged()
     * @see emitCountChanged()
     */
92
    virtual void clearItem(PlaylistItem *item, bool emitChanged = true);
Scott Wheeler's avatar
Scott Wheeler committed
93 94 95 96 97

    /**
     * Remove \a items from the playlist and emit a signal indicating
     * that the number of items in the list has changed.
     */
98
    virtual void clearItems(const PlaylistItemList &items);
99

100 101
    /**
     * All of the (media) files in the list.
102
     */
103
    QStringList files();
104

105
    /**
106 107
     * Returns a list of all of the \e visible items in the playlist.
     */
108
    virtual PlaylistItemList items();
109

110
    /**
111
     * Returns a list of all of the items in the playlist.
112
     */
113
    PlaylistItemList visibleItems();
114

115 116 117
    /**
     * Returns a list of the currently selected items.
     */
118
    PlaylistItemList selectedItems();
119

120 121 122 123 124
    /**
     * Returns a list of the last 10 played items.
     */
    PlaylistItemList historyItems(PlaylistItem *current, bool random) const;

125 126
    /**
     * Allow duplicate files in the playlist.
127
     */
128
    void setAllowDuplicates(bool allow) { m_allowDuplicates = allow; }
129

130
    /**
131
     * This is being used as a mini-factory of sorts to make the construction
132 133
     * of PlaylistItems virtual.  In this case it allows for the creation of
     * both PlaylistItems and CollectionListItems.
134
     */
135
    virtual PlaylistItem *createItem(const FileHandle &file,
136 137
				     QListViewItem *after = 0,
				     bool emitChanged = true);
138

Scott Wheeler's avatar
Scott Wheeler committed
139 140 141 142 143 144 145
    /**
     * This is implemented as a template method to allow subclasses to
     * instantiate their PlaylistItem subclasses using the same method.  Some
     * of the types here are artificially templatized (i.e. CollectionListType and
     * CollectionItemType) to avoid recursive includes, but in fact will always
     * be the same.     
     */
146
    template <class ItemType, class CollectionItemType, class CollectionListType>
147
    ItemType *createItem(const FileHandle &file,
148 149 150
			 QListViewItem *after = 0,
			 bool emitChanged = true);

151
    virtual void createItems(const PlaylistItemList &siblings);
152

153 154 155 156
    /**
     * Returns the file name associated with this playlist (an m3u file) or
     * QString::null if no such file exists.
     */
157
    QString fileName() const { return m_fileName; }
158 159 160 161 162

    /**
     * Sets the file name to be associated with this playlist; this file should
     * have the "m3u" extension.
     */
163
    void setFileName(const QString &n) { m_fileName = n; }
164

165 166 167 168 169 170 171 172 173 174 175 176 177
    /**
     * Hides column \a c.  If \a emitChanged is true then a signal that the
     * visible columns have changed will be emitted and things like the search
     * will be udated.
     */
    void hideColumn(int c, bool emitChanged = true);

    /**
     * Shows column \a c.  If \a emitChanged is true then a signal that the
     * visible columns have changed will be emitted and things like the search
     * will be udated.
     */
    void showColumn(int c, bool emitChanged = true);
178 179
    bool isColumnVisible(int c) const;

180
    /**
181
     * If m_playlistName has no value -- i.e. the name has not been set to
182
     * something other than the filename, this returns the filename less the
183
     * extension.  If m_playlistName does have a value, this returns that.
184
     */
185
    virtual QString name() const;
186

187 188 189
    /**
     * Returns the number of items in the playlist.
     */
190
    virtual int count() const { return childCount(); }
191 192 193 194
    
    /**
     * Returns the combined time of all the itens.
     */
195 196 197 198 199 200
    virtual int time();

    /**
     * This sets a name for the playlist that is \e different from the file name.
     */
    void setName(const QString &n);
201

202
    /**
203 204 205 206 207
     * Returns the next item to be played.  If random is false this is just
     * the next item in the playlist (or null if the current items is the last
     * item in the list).  If random is true, then it will select an item at
     * random from this list (and try to be a bit clever about it to not repeat
     * items before everything has been played at least once).
208
     */
209
    PlaylistItem *nextItem(PlaylistItem *current, bool random = false);
210 211 212 213 214 215

    /**
     * Returns the item played before the currently playing item.  If random is
     * false, this is simply the item above the currently playing item in the
     * list.  If random is true this checks the history of recently played items.
     */
216
    PlaylistItem *previousItem(PlaylistItem *current, bool random = false);
217

218 219 220 221
    /**
     * Returns the KActionMenu that allows this to be embedded in menus outside
     * of the playlist.
     */
222
    KActionMenu *columnVisibleAction() const { return m_columnVisibleAction; }
223

224 225 226 227 228 229 230 231
    /**
     * Set item to be the playing item; also set this list to be the playing list.
     */
    static void setPlaying(PlaylistItem *item, bool p = true);

    /**
     * Returns true if this playlist is currently playing.
     */
Scott Wheeler's avatar
Scott Wheeler committed
232
    bool playing() const;
233

Scott Wheeler's avatar
Scott Wheeler committed
234 235 236
    /**
     * This forces an update of the left most visible column, but does not save
     * the settings for this.
237
     */
Scott Wheeler's avatar
Scott Wheeler committed
238
    void updateLeftColumn();
239

240 241 242 243
    /**
     * Sets the items in the list to be either visible based on the value of
     * visible.  This is useful for search operations and such.
     */
244 245
    static void setItemsVisible(const PlaylistItemList &items, bool visible = true);

246 247 248 249
    /**
     * Returns the search associated with this list, or an empty search if one
     * has not yet been set.
     */
Scott Wheeler's avatar
Scott Wheeler committed
250
    PlaylistSearch search() const { return m_search; }
251 252 253 254 255 256

    /**
     * Set the search associtated with this playlist.
     *
     * \note This does not cause the search to be rerun.
     */
Scott Wheeler's avatar
Scott Wheeler committed
257 258
    void setSearch(const PlaylistSearch &s) { m_search = s; }

259 260 261 262 263 264 265 266
    /**
     * Emits a signal indicating that the number of items have changed.  This
     * is useful in conjunction with createItem() where emitChanged is false.
     *
     * In many situations it is not practical for speed reasons to trigger the
     * actions associated with signalCountChanged() after each insertion.
     */
    void emitCountChanged() { emit signalCountChanged(this); }
267

Scott Wheeler's avatar
Scott Wheeler committed
268 269 270
    /**
     * Marks \a item as either selected or deselected based.
     */
271 272
    void markItemSelected(PlaylistItem *item, bool selected);

Scott Wheeler's avatar
Scott Wheeler committed
273 274 275 276 277 278
    /**
     * Subclasses of Playlist which add new columns will set this value to
     * specify how many of those colums exist.  This allows the Playlist
     * class to do some internal calculations on the number and positions
     * of columns.
     */
279
    virtual int columnOffset() const { return 0; }
Scott Wheeler's avatar
Scott Wheeler committed
280 281 282 283 284 285

    /**
     * Some subclasses of Playlist will be "read only" lists (i.e. the history
     * playlist).  This is a way for those subclasses to indicate that to the
     * Playlist internals.
     */
286
    virtual bool readOnly() const { return false; }
287

288 289
    void setColumnWidthUpdatesDisabled(bool disabled) { m_disableColumnWidthUpdates = disabled; }

290 291 292 293 294 295 296
    /**
     * Playlists have a common set of shared settings such as visible columns
     * that should be applied just before the playlist is shown.  Calling this
     * method applies those.
     */
    void applySharedSettings();

297 298
    void emitDataChanged() { emit signalDataChanged(); }

299 300 301 302 303 304 305 306 307 308 309 310
    /**
     * Returns true if full path sort is currently enabled for the file column.
     */
    bool fileColumnFullPathSort() const { return m_fileColumnFullPathSort; }

    /**
     * Reimplemented to add toggling of the file column sorting mode.
     *
     * \see fileColumnFullPathSort()
     */
    virtual void setSorting(int column, bool ascending = true);

311
public slots:
312
    /**
313
     * Remove the currently selected items from the playlist and disk.
314
     */
315
    void slotRemoveSelectedItems() { removeFromDisk(selectedItems()); };
Scott Wheeler's avatar
Scott Wheeler committed
316 317 318 319

    /**
     * Set the first selected item to be the next item returned by nextItem().
     */
320 321
    void slotSetNext();

322 323 324 325
    /*
     * The edit slots are required to use the canonical names so that they are
     * detected by the application wide framework.
     */
326
    virtual void cut() { copy(); clear(); }
Scott Wheeler's avatar
Scott Wheeler committed
327 328 329 330 331

    /**
     * Puts a list of URLs pointing to the files in the current selection on the
     * clipboard.
     */
332
    virtual void copy();
Scott Wheeler's avatar
Scott Wheeler committed
333 334 335 336

    /**
     * Checks the clipboard for local URLs to be inserted into this playlist.
     */
337
    virtual void paste();
Scott Wheeler's avatar
Scott Wheeler committed
338 339 340 341 342 343 344

    /**
     * Removes the selected items from the list, but not the disk.
     *
     * @see clearItem()
     * @see clearItems()
     */
345
    virtual void clear();
346
    virtual void selectAll() { KListView::selectAll(true); }
347

348 349 350 351 352 353
    /**
     * Refreshes the tags of the selection from disk, or all of the files in the
     * list if there is no selection.
     */
    virtual void slotRefresh();

354
    void slotGuessTagInfo(TagGuesser::Type type);
Scott Wheeler's avatar
Scott Wheeler committed
355 356 357 358 359 360

    /**
     * Renames the selected items' files based on their tags contents.
     *
     * @see PlaylistItem::renameFile()
     */
361 362
    void slotRenameFile();

363 364 365
    /**
     * Reload the playlist contents from the m3u file.
     */
366
    virtual void slotReload();
367

368 369 370 371 372
    /**
     * Tells the listview that the next time that it paints that the weighted
     * column widths must be recalculated.  If this is called without a column
     * all visible columns are marked as dirty.
     */
373
    void slotWeightDirty(int column = -1);
374

375
protected:
376 377 378 379
    /**
     * Remove \a items from the playlist and disk.  This will ignore items that
     * are not actually in the list.
     */
380
    void removeFromDisk(const PlaylistItemList &items);
381

382 383 384
    // the following are all reimplemented from base classes

    virtual bool eventFilter(QObject *watched, QEvent *e);
385
    virtual QDragObject *dragObject(QWidget *parent);
386
    virtual QDragObject *dragObject() { return dragObject(this); }
387
    virtual bool canDecode(QMimeSource *s);
388
    virtual void decode(QMimeSource *s, PlaylistItem *after = 0);
389
    virtual void contentsDropEvent(QDropEvent *e);
Scott Wheeler's avatar
Scott Wheeler committed
390
    virtual void showEvent(QShowEvent *e);
391
    virtual bool acceptDrag(QDropEvent *e) const { return KURLDrag::canDecode(e); }
392 393 394 395
    virtual void viewportPaintEvent(QPaintEvent *pe);
    virtual void viewportResizeEvent(QResizeEvent *re);

    void addColumn(const QString &label);
Scott Wheeler's avatar
Scott Wheeler committed
396 397 398 399 400 401 402 403

    /**
     * Here I'm using delayed setup of some things that aren't quite intuitive.
     * Creating columns and setting up connections are both time consuming if
     * there are a lot of playlists to initialize.  This moves that cost from the
     * startup time to the time when the widget is "polished" -- i.e. just before
     * it's painted the first time.
     */
404
    virtual void polish();
405

406 407 408 409 410 411 412 413
    /**
     * Do some finial initialization of created items.  Notably ensure that they
     * are shown or hidden based on the contents of the current PlaylistSearch.
     *
     * This is called by the PlaylistItem constructor.
     */
    void setupItem(PlaylistItem *item);

414 415 416 417 418 419 420 421
    /**
     * As a template this allows us to use the same code to initialize the items
     * in subclasses.  CollectionItemType should always be CollectionListItem and
     * ItemType should be a PlaylistItem subclass.
     */
    template <class CollectionItemType, class ItemType, class SiblingType>
    void createItems(const QValueList<SiblingType *> &siblings);

422
signals:
423
    /**
424
     * This is emitted when the playlist selection is changed.  This is used
425
     * primarily to notify the TagEditor of the new data.
426
     */
427
    void signalSelectionChanged(const PlaylistItemList &selection);
428

429
    /**
430
     * This is connected to the PlaylistBox::Item to let it know when the
431 432
     * playlist's name has changed.
     */
433
    void signalNameChanged(const QString &fileName);
434

435
    /**
436 437 438 439
     * This signal is emitted when items are added to or removed from the list.
     *
     * \see signalDataChanged()
     * \see signalChanged()
440
     */
441
    void signalCountChanged(Playlist *);
442

443
    /**
444 445 446 447 448 449 450 451 452 453 454
     * This signal is connected to PlaylistItem::refreshed() in the PlaylistItem
     * class.  It is emitted when a playlist item's data has been changed.
     *
     * \see signalCountChanged()
     * \see signalChanged()
     */
    void signalDataChanged();

    /**
     * This is the union of signalDataChanged() and signalCountChanged().
     * It is emitted with either quantity or value of the PlaylistItems are
455 456 457 458
     * changed.
     */
    void signalChanged();

459
    /**
460
     * This signal is emitted just before a playlist item is removed from the
461 462 463
     * list allowing for any cleanup that needs to happen.  Typically this
     * is used to remove the item from the history and safeguard against
     * dangling pointers.
464
     */
465
    void signalAboutToRemove(PlaylistItem *item);
466 467 468 469

    /**
     * This is emitted when \a files are dropped on a specific playlist.
     */
470
    void signalFilesDropped(const QStringList &files, Playlist *, PlaylistItem *after);
471 472 473 474 475

    /**
     * Set the next item to be played in the current playlist.  This is used by
     * the "Play Next" feature.
     */
476
    void signalSetNext(PlaylistItem *item);
477

478 479 480 481 482
    /**
     * Request creation of a playlist based on \a items.
     */
    void signalCreatePlaylist(const PlaylistItemList &items);

483 484
private:
    void setup();
485 486 487 488 489 490 491

    /**
     * Load the playlist from a file.  \a fileName should be the absolute path.
     * \a fileInfo should point to the same file as \a fileName.  This is a
     * little awkward API-wise, but keeps us from throwing away useful
     * information.
     */
492
    void loadFile(const QString &fileName, const QFileInfo &fileInfo);
493

494
    /**
Scott Wheeler's avatar
Scott Wheeler committed
495 496
     * Writes \a text to \a item in \a column.  This is used by the inline tag
     * editor.
497
     */
Scott Wheeler's avatar
Scott Wheeler committed
498
    void editTag(PlaylistItem *item, const QString &text, int column);
499 500 501 502 503 504

    /**
     * Returns the index of the left most visible column in the playlist.
     *
     * \see isColumnVisible()
     */
505
    int leftMostVisibleColumn() const;
506

507 508 509 510 511 512 513 514 515 516
    /**
     * This method is used internally to provide the backend to the other item
     * lists.
     *
     * \see items()
     * \see visibleItems()
     * \see selectedItems()
     */
    PlaylistItemList items(QListViewItemIterator::IteratorFlag flags);

517 518 519 520 521
    /**
     * Build the column "weights" for the weighted width mode.
     */
    void calculateColumnWeights();

522 523 524 525 526 527
    /**
     * This class is used internally to store settings that are shared by all
     * of the playlists, such as column order.  It is implemented as a singleton.
     */
    class SharedSettings;

528
private slots:
529

530 531
    void slotUpdateColumnWidths();

532 533 534 535
    /**
     * This is just used to emit the selection as a list of PlaylistItems when
     * the selection changes.
     */
536
    void slotEmitSelected() { emit signalSelectionChanged(selectedItems()); }
537 538 539 540 541

    /**
     * Show the RMB menu.  Matches the signature for the signal 
     * QListView::contextMenuRequested().
     */
542
    void slotShowRMBMenu(QListViewItem *item, const QPoint &point, int column);
543 544

    /**
Scott Wheeler's avatar
Scott Wheeler committed
545 546
     * This slot is called when the inline tag editor has completed its editing
     * and starts the process of renaming the values.
547
     *
Scott Wheeler's avatar
Scott Wheeler committed
548
     * \see editTag()
549
     */
Scott Wheeler's avatar
Scott Wheeler committed
550
    void slotInlineEditDone(QListViewItem *, const QString &, int column);
551 552 553 554 555

    /**
     * This starts the renaming process by displaying a line edit if the mouse is in 
     * an appropriate position.
     */
556
    void slotRenameTag();
557 558 559 560 561

    /**
     * Moves the column \a from to the position \a to.  This matches the signature
     * for the signal QHeader::indexChange().
     */
562
    void slotColumnOrderChanged(int, int from, int to);
563 564 565 566 567 568 569

    /**
     * Toggles a columns visible status.  Useful for KActions.
     *
     * \see hideColumn()
     * \see showColumn()
     */
570
    void slotToggleColumnVisible(int column);
571

572 573 574 575 576
    /**
     * Prompts the user to create a new playlist with from the selected items.
     */
    void slotCreateGroup() { emit signalCreatePlaylist(selectedItems()); }

577 578 579 580 581 582
    /**
     * This slot is called when the user drags the slider in the listview header
     * to manually set the size of the column.
     */
    void slotColumnSizeChanged(int column, int oldSize, int newSize);

583 584 585 586 587 588 589 590
    /**
     * The slot is called when the completion mode for the line edit in the
     * inline tag editor is changed.  It saves the settings and through the
     * magic of the SharedSettings class will apply it to the other playlists as
     * well.
     */
    void slotInlineCompletionModeChanged(KGlobalSettings::Completion mode);

591
private:
592
    StringHash m_members;
593

594
    int m_currentColumn;
595
    int m_processed;
596 597 598 599 600 601

    int m_rmbPasteID;
    int m_rmbEditID;

    int m_selectedCount;

602
    bool m_allowDuplicates;
603
    bool m_polished;
604
    bool m_applySharedSettings;
605
    bool m_fileColumnFullPathSort;
606

607
    QValueList<int> m_weightDirty;
608
    bool m_disableColumnWidthUpdates;
609
    /**
610
     * The average minimum widths of columns to be used in balancing calculations.
611
     */
612
    QValueVector<int> m_columnWeights;
613 614
    QValueVector<int> m_columnFixedWidths;
    bool m_widthsDirty;
615 616

    PlaylistItemList m_randomList;
Scott Wheeler's avatar
Scott Wheeler committed
617
    PlaylistItemList m_history;
618
    PlaylistSearch m_search;
619

620
    PlaylistItem *m_lastSelected;
621

622
    /**
623
     * Used to store the text for inline editing before it is changed so that
624 625 626 627
     * we can know if something actually changed and as such if we need to save
     * the tag.
     */
    QString m_editText;
628 629 630 631 632

    /**
     * This is only defined if the playlist name is something other than the
     * file name.
     */
633
    QString m_playlistName;
634
    QString m_fileName;
635

636 637 638
    KPopupMenu *m_rmbMenu;
    KPopupMenu *m_headerMenu;
    KActionMenu *m_columnVisibleAction;
639

640 641 642 643 644
    /**
     * This is used to indicate if the list of visible items has changed (via a 
     * call to setVisibleItems()) while random play is playing.
     */
    static bool m_visibleChanged;
645
    static int m_leftColumn;
646
    static PlaylistItem *m_playingItem;
647 648
};

649
QDataStream &operator<<(QDataStream &s, Playlist &p);
650 651
QDataStream &operator>>(QDataStream &s, Playlist &p);

652 653
// template method implementations

654
template <class ItemType, class CollectionItemType, class CollectionListType>
655 656
ItemType *Playlist::createItem(const FileHandle &file, QListViewItem *after,
			       bool emitChanged)
657
{
658
    CollectionItemType *item = CollectionListType::instance()->lookup(file.absFilePath());
659 660

    if(!item) {
661
	item = new CollectionItemType(file);
662
	setupItem(item);
663 664 665 666

	// If a valid tag was not created, destroy the CollectionListItem.
	if(!item->isValid()) {
	    kdError(65432) << "Playlist::createItem() -- A valid tag was not created for \""
667
			   << file.absFilePath() << "\"" << endl;
668 669 670 671 672
	    delete item;
	    return 0;
	}
    }

673
    if(item && !m_members.insert(file.absFilePath()) || m_allowDuplicates) {
674

675
	ItemType *i = after ? new ItemType(item, this, after) : new ItemType(item, this);
676 677
	setupItem(i);

678 679
        if(!m_randomList.isEmpty() && !m_visibleChanged)
            m_randomList.append(i);
680

681 682 683 684 685 686 687 688
	emit signalCountChanged(this);

	if(emitChanged)
	    emit signalCountChanged(this);

	return i;
    }
    else
689
	return 0;
690 691
}

692 693 694
template <class CollectionItemType, class ItemType, class SiblingType>
void Playlist::createItems(const QValueList<SiblingType *> &siblings)
{
695 696 697 698
    if(siblings.isEmpty())
	return;

    m_disableColumnWidthUpdates = true;
699
    ItemType *newItem = 0;
700 701 702

    QValueListConstIterator<SiblingType *> it = siblings.begin();
    for(; it != siblings.end(); ++it) {
703
	if(!m_members.insert((*it)->file().absFilePath()) || m_allowDuplicates) {
704 705 706 707
	    newItem = new ItemType((*it)->collectionItem(), this, newItem);
	    setupItem(newItem);
	    if(!m_randomList.isEmpty() && !m_visibleChanged)
		m_randomList.append(newItem);
708 709 710 711
	}
    }

    emit signalCountChanged(this);
712
    m_disableColumnWidthUpdates = false;
713
    slotWeightDirty();
714 715
}

716
#endif