mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-12-14 16:46:30 +01:00
Added ability to run macros from cart list with "Run Macro" button
This commit is contained in:
@@ -427,6 +427,16 @@ MainWidget::MainWidget(QWidget *parent)
|
|||||||
lib_delete_button->setEnabled(false);
|
lib_delete_button->setEnabled(false);
|
||||||
connect(lib_delete_button,SIGNAL(clicked()),this,SLOT(deleteData()));
|
connect(lib_delete_button,SIGNAL(clicked()),this,SLOT(deleteData()));
|
||||||
|
|
||||||
|
//
|
||||||
|
// Run Macro Button
|
||||||
|
//
|
||||||
|
lib_macro_button=new QPushButton(this);
|
||||||
|
lib_macro_button->setFont(button_font);
|
||||||
|
lib_macro_button->setText(tr("Run\n&Macro"));
|
||||||
|
lib_macro_button->setEnabled(false);
|
||||||
|
lib_macro_button->setVisible(false);
|
||||||
|
connect(lib_macro_button,SIGNAL(clicked()),this,SLOT(macroData()));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Disk Gauge
|
// Disk Gauge
|
||||||
//
|
//
|
||||||
@@ -500,6 +510,11 @@ MainWidget::MainWidget(QWidget *parent)
|
|||||||
|
|
||||||
lib_resize=true;
|
lib_resize=true;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create RDMacroEvent for running macros
|
||||||
|
//
|
||||||
|
lib_macro_events=new RDMacroEvent(rda->station()->address(),rda->ripc(),this);
|
||||||
|
|
||||||
LoadGeometry();
|
LoadGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -727,6 +742,27 @@ void MainWidget::editData()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWidget::macroData()
|
||||||
|
{
|
||||||
|
Q3ListViewItemIterator *it;
|
||||||
|
Q3ListViewItem *item;
|
||||||
|
|
||||||
|
it=new Q3ListViewItemIterator(lib_cart_list);
|
||||||
|
while(it->current()) {
|
||||||
|
if (it->current()->isSelected()) {
|
||||||
|
item=it->current();
|
||||||
|
RDCart *rdcart=new RDCart(item->text(Cart).toUInt());
|
||||||
|
lib_macro_events->clear();
|
||||||
|
lib_macro_events->load(rdcart->macros());
|
||||||
|
lib_macro_events->exec();
|
||||||
|
delete rdcart;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
++(*it);
|
||||||
|
}
|
||||||
|
delete it;
|
||||||
|
}
|
||||||
|
|
||||||
void MainWidget::deleteData()
|
void MainWidget::deleteData()
|
||||||
{
|
{
|
||||||
QString filename;
|
QString filename;
|
||||||
@@ -900,17 +936,37 @@ void MainWidget::cartClickedData()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(play_count==1) {
|
if(play_count==1) {
|
||||||
lib_player->setCart(item->text(Cart));
|
RDCart *rdcart=new RDCart(item->text(Cart).toUInt());
|
||||||
lib_player->playButton()->setEnabled(true);
|
if(rdcart->type()==RDCart::Macro) {
|
||||||
lib_player->stopButton()->setEnabled(true);
|
lib_macro_button->setEnabled(true);
|
||||||
if(lib_player->isPlaying()) {
|
lib_macro_button->setVisible(true);
|
||||||
lib_player->play();
|
lib_player->playButton()->setEnabled(false);
|
||||||
|
lib_player->stopButton()->setEnabled(false);
|
||||||
|
lib_player->playButton()->setVisible(false);
|
||||||
|
lib_player->stopButton()->setVisible(false);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
lib_player->setCart(item->text(Cart));
|
||||||
|
lib_player->playButton()->setEnabled(true);
|
||||||
|
lib_player->stopButton()->setEnabled(true);
|
||||||
|
lib_player->playButton()->setVisible(true);
|
||||||
|
lib_player->stopButton()->setVisible(true);
|
||||||
|
lib_macro_button->setEnabled(false);
|
||||||
|
lib_macro_button->setVisible(false);
|
||||||
|
if(lib_player->isPlaying()) {
|
||||||
|
lib_player->play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete rdcart;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lib_player->stop();
|
lib_player->stop();
|
||||||
lib_player->playButton()->setEnabled(false);
|
lib_player->playButton()->setEnabled(false);
|
||||||
lib_player->stopButton()->setEnabled(false);
|
lib_player->stopButton()->setEnabled(false);
|
||||||
|
lib_player->playButton()->setVisible(true);
|
||||||
|
lib_player->stopButton()->setVisible(true);
|
||||||
|
lib_macro_button->setEnabled(false);
|
||||||
|
lib_macro_button->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sel_count) {
|
if(sel_count) {
|
||||||
@@ -1068,6 +1124,7 @@ void MainWidget::resizeEvent(QResizeEvent *e)
|
|||||||
setGeometry(e->size().width()-200,e->size().height()-60,80,50);
|
setGeometry(e->size().width()-200,e->size().height()-60,80,50);
|
||||||
lib_close_button->setGeometry(e->size().width()-90,e->size().height()-60,
|
lib_close_button->setGeometry(e->size().width()-90,e->size().height()-60,
|
||||||
80,50);
|
80,50);
|
||||||
|
lib_macro_button->setGeometry(290,e->size().height()-60,80,50);
|
||||||
lib_player->playButton()->setGeometry(290,e->size().height()-60,80,50);
|
lib_player->playButton()->setGeometry(290,e->size().height()-60,80,50);
|
||||||
lib_player->stopButton()->setGeometry(380,e->size().height()-60,80,50);
|
lib_player->stopButton()->setGeometry(380,e->size().height()-60,80,50);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ class MainWidget : public QWidget
|
|||||||
void addData();
|
void addData();
|
||||||
void editData();
|
void editData();
|
||||||
void deleteData();
|
void deleteData();
|
||||||
|
void macroData();
|
||||||
void ripData();
|
void ripData();
|
||||||
void reportsData();
|
void reportsData();
|
||||||
void cartOnItemData(Q3ListViewItem *item);
|
void cartOnItemData(Q3ListViewItem *item);
|
||||||
@@ -138,6 +139,8 @@ class MainWidget : public QWidget
|
|||||||
QPushButton *lib_rip_button;
|
QPushButton *lib_rip_button;
|
||||||
QPushButton *lib_reports_button;
|
QPushButton *lib_reports_button;
|
||||||
QPushButton *lib_close_button;
|
QPushButton *lib_close_button;
|
||||||
|
QPushButton *lib_macro_button;
|
||||||
|
RDMacroEvent *lib_macro_events;
|
||||||
RDSimplePlayer *lib_player;
|
RDSimplePlayer *lib_player;
|
||||||
int lib_output_card;
|
int lib_output_card;
|
||||||
int lib_output_port;
|
int lib_output_port;
|
||||||
|
|||||||
Reference in New Issue
Block a user