mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-12-13 16:16:36 +01:00
2021-02-09 Fred Gleason <fredg@paravelsystems.com>
* Added a 'RDLogLine::transTypeFromString()' method. * Refactored the cart stack lists in the 'Edit Event' dialog in rdlogmanger(1) to use the model based API. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -18,10 +18,12 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#include <QMimeSource>
|
||||
#include <QPixmap>
|
||||
|
||||
#include "rd.h"
|
||||
#include "rdcartdrag.h"
|
||||
#include "rdprofile.h"
|
||||
|
||||
RDCartDrag::RDCartDrag(unsigned cartnum,const QString &title,
|
||||
const QColor &color)
|
||||
@@ -44,6 +46,42 @@ bool RDCartDrag::hasFormat(const QString &mimetype) const
|
||||
}
|
||||
|
||||
|
||||
bool RDCartDrag::canDecode(QMimeSource *e)
|
||||
{
|
||||
return e->provides(RDMIMETYPE_CART);
|
||||
}
|
||||
|
||||
|
||||
bool RDCartDrag::decode(QMimeSource *e,unsigned *cartnum,QColor *color,
|
||||
QString *title)
|
||||
{
|
||||
RDProfile *p=new RDProfile();
|
||||
p->setSourceString(QString::fromUtf8(e->encodedData(RDMIMETYPE_CART)));
|
||||
*cartnum=p->intValue("Rivendell-Cart","Number");
|
||||
if(color!=NULL) {
|
||||
color->setNamedColor(p->stringValue("Rivendell-Cart","Color"));
|
||||
}
|
||||
if(title!=NULL) {
|
||||
*title=p->stringValue("Rivendell-Cart","ButtonText");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool RDCartDrag::decode(QMimeSource *e,RDLogLine *ll,
|
||||
RDLogLine::TransType next_trans,int log_mach,
|
||||
bool timescale,RDLogLine::TransType trans)
|
||||
{
|
||||
unsigned cartnum;
|
||||
|
||||
RDCartDrag::decode(e,&cartnum);
|
||||
ll->loadCart(cartnum,next_trans,log_mach,timescale,trans);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
QVariant RDCartDrag::retrieveData(const QString &mimetype,QVariant::Type type)
|
||||
const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user