Changeset 124 for smplayer/trunk/src/favorites.h
- Timestamp:
- Mar 16, 2012, 4:02:47 PM (13 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 121-122
- Property svn:mergeinfo changed
-
smplayer/trunk/src/favorites.h
r119 r124 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 1 Ricardo Villalba <rvm@escomposlinux.org>2 Copyright (C) 2006-2012 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 20 20 #define _FAVORITES_H_ 21 21 22 #include <Q Object>22 #include <QMenu> 23 23 #include <QString> 24 24 #include <QList> 25 25 26 class QMenu;27 26 class QAction; 28 27 class QWidget; … … 31 30 { 32 31 public: 33 Favorite() {} 34 Favorite(QString name, QString file, QString icon = QString::null) { _name = name; _file = file; _icon = icon; }; 32 Favorite() { is_subentry = false; } 33 Favorite(QString name, QString file, QString icon = QString::null, bool subentry = false) 34 { 35 _name = name; _file = file; _icon = icon; is_subentry = subentry; 36 }; 35 37 virtual ~Favorite() {}; 36 38 … … 38 40 void setFile(QString file) { _file = file; }; 39 41 void setIcon(QString file) { _icon = file; }; 42 void setSubentry(bool b) { is_subentry = b; } 40 43 41 44 QString name() { return _name; }; 42 45 QString file() { return _file; } 43 46 QString icon() { return _icon; }; 47 bool isSubentry() { return is_subentry; }; 44 48 45 49 protected: 46 50 QString _name, _file, _icon; 51 bool is_subentry; // Not a favorite file, but a new favorite list 47 52 }; 48 53 49 54 typedef QList<Favorite> FavoriteList; 50 55 51 class Favorites : public Q Object56 class Favorites : public QMenu 52 57 { 53 58 Q_OBJECT … … 56 61 ~Favorites(); 57 62 58 QMenu * menu();59 63 QAction * editAct() { return edit_act; }; 60 64 QAction * jumpAct() { return jump_act; }; 61 65 QAction * nextAct() { return next_act; }; 62 66 QAction * previousAct() { return previous_act; }; 67 QAction * addCurrentAct() { return add_current_act; }; 63 68 64 69 public slots: … … 66 71 void previous(); 67 72 73 void getCurrentMedia(const QString & filename, const QString & title); 74 68 75 signals: 69 76 void activated(QString filemane); 77 //! Signal to resend the data to child 78 void sendCurrentMedia(const QString & filename, const QString & title); 70 79 71 80 protected: 72 void save(); 73 void load(); 74 void createMenu(); 75 void updateMenu(); 76 void populateMenu(); 81 virtual void save(); 82 virtual void load(); 83 virtual void updateMenu(); 84 virtual void populateMenu(); 85 virtual Favorites * createNewObject(QString filename, QWidget * parent); 86 void delete_children(); 77 87 78 88 int findFile(QString filename); … … 85 95 virtual void edit(); 86 96 virtual void jump(); 97 virtual void addCurrentPlaying(); // Adds to menu current (or last played) file 98 99 protected: 100 virtual void retranslateStrings(); 101 virtual void changeEvent(QEvent * event); 87 102 88 103 protected: 89 104 FavoriteList f_list; 90 105 QString _filename; 91 QMenu * _menu;92 106 QAction * edit_act; 93 107 QAction * jump_act; 94 108 QAction * next_act; 95 109 QAction * previous_act; 110 QAction * add_current_act; 96 111 97 112 QWidget * parent_widget; … … 102 117 // Last item selected in the jump dialog 103 118 int last_item; 119 120 QString received_file_playing; 121 QString received_title; 122 123 QList<Favorites*> child; 104 124 }; 105 125
Note:
See TracChangeset
for help on using the changeset viewer.