VehicleTemplateExportDialog::VehicleTemplateExportDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::VehicleTemplateExportDialog), m_autopilotConnected(false)
{
    ui->setupUi(this);
    connect(ui->ImportButton, SIGNAL(clicked()), this, SLOT(importImage()));
    ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
    m_uavoManager = pm->getObject<UAVObjectManager>();
    ui->Photo->setScene(new QGraphicsScene(this));
    ui->Type->setText(setupVehicleType());
    ui->selectionWidget->setTemplateInfo(m_type, m_subType);

    connect(ui->Name, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
    connect(ui->Owner, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
    connect(ui->ForumNick, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
    connect(ui->Size, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
    connect(ui->Weight, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));

    connect(ui->exportBtn, SIGNAL(clicked()), this, SLOT(exportTemplate()));
    connect(ui->saveAsBtn, SIGNAL(clicked()), this, SLOT(saveAsTemplate()));
    connect(ui->importBtn, SIGNAL(clicked()), this, SLOT(importTemplate()));
    connect(ui->cancelBtn, SIGNAL(clicked()), this, SLOT(reject()));
    connect(ui->cancelBtn_2, SIGNAL(clicked()), this, SLOT(reject()));

    TelemetryManager *telemManager = pm->getObject<TelemetryManager>();
    if (telemManager->isConnected()) {
        onAutoPilotConnect();
    } else {
        onAutoPilotDisconnect();
    }

    connect(telemManager, SIGNAL(connected()), this, SLOT(onAutoPilotConnect()));
    connect(telemManager, SIGNAL(disconnected()), this, SLOT(onAutoPilotDisconnect()));
}
Пример #2
0
void KOEventEditor::slotSaveTemplate( const QString &templateName )
{
  Event *event = new Event;
  fillEvent( event );
  saveAsTemplate( event, templateName );
}
Пример #3
0
void KOTodoEditor::slotSaveTemplate(const QString &templateName)
{
    Todo *todo = new Todo;
    writeTodo(todo);
    saveAsTemplate(todo, templateName);
}