AddressBookDialog::AddressBookDialog(Mode mode, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AddressBookDialog),
    model(0)
{
    ui->setupUi(this);

    switch(mode)
    {
    case ForSending:
        connect(ui->receiveTableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(on_buttonBox_accepted()));
        connect(ui->sendTableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(on_buttonBox_accepted()));
        break;
    case ForEditing:
        connect(ui->receiveTableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(on_editButton_clicked()));
        connect(ui->sendTableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(on_editButton_clicked()));
        break;
    }
}
Beispiel #2
0
void  MainWindow::onContextMenuRequested( const QPoint& pos)
{
    // qDebug() << "Context menu: pos=" << pos;
    QString  path = "/";
    int  col = -1;  // Mark not valid
    Q_UNUSED(col);
    QModelIndex  index = _ui->arnView->indexAt( pos);
    if (index.isValid()) {
        ArnNode*  node = _arnModel->nodeFromIndex( index);
        if (node) {
            col  = index.column();
            path = node->path();
        }
    }

    setCurItemPath( path);
    // qDebug() << "Context menu: path=" << _curItemPath << " col=" << col;

    QMenu*  menu = new QMenu( this);
    if ( _ui->terminalButton->isEnabled()) {
        QAction*  action = new QAction( QIcon(":/pic/terminal.png"), "Terminal", this);
        menu->addAction( action);
        connect( action, SIGNAL(triggered()), this, SLOT(on_terminalButton_clicked()));
    }
    if ( _ui->logButton->isEnabled()) {
        QAction*  action = new QAction( QIcon(":/pic/log.png"), "Log", this);
        menu->addAction( action);
        connect( action, SIGNAL(triggered()), this, SLOT(on_logButton_clicked()));
    }
    if ( _ui->editButton->isEnabled()) {
        QAction*  action = new QAction( QIcon(":/pic/Pencil-icon.png"), "Edit", this);
        menu->addAction( action);
        connect( action, SIGNAL(triggered()), this, SLOT(on_editButton_clicked()));
    }
    if ( _ui->runButton->isEnabled()) {
        QAction*  action = new QAction( QIcon(":/pic/Play.png"), "Run", this);
        menu->addAction( action);
        connect( action, SIGNAL(triggered()), this, SLOT(on_runButton_clicked()));
    }
    if ( _ui->manageButton->isEnabled()) {
        QAction*  action = new QAction( QIcon(":/pic/tools-icon.png"), "Manage", this);
        menu->addAction( action);
        connect( action, SIGNAL(triggered()), this, SLOT(on_manageButton_clicked()));
    }
    {
        QString  menuTxt = (_curItemPath == "/") ? "Release all" : "Release item(s)";
        QAction*  action = new QAction( QIcon(":/pic/close.png"), menuTxt, this);
        menu->addAction( action);
        connect( action, SIGNAL(triggered()), this, SLOT(on_releaseButton_clicked()));
    }
    menu->popup( _ui->arnView->viewport()->mapToGlobal( pos));
}
Beispiel #3
0
void  MainWindow::onItemEditTrigg( const QModelIndex& index)
{
    QString  itemPath = _arnModel->data( index, ArnModel::Role::Path).toString();
    // qDebug() << "EditItem=" << itemPath << " rect=" << _ui->arnView->visualRect( index);
    if (itemPath.isEmpty())  return;

    setCurItemPath( itemPath);
    if ( _ui->terminalButton->isEnabled()) {
        on_terminalButton_clicked();
    }
    else if ( _ui->editButton->isEnabled()) {
        on_editButton_clicked();
    }
}
MyCertListPage::MyCertListPage(const PlatformStyle *platformStyle, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::MyCertListPage),
    model(0),
    optionsModel(0)
{
    ui->setupUi(this);
	QString theme = GUIUtil::getThemeName();  
	if (!platformStyle->getImagesOnButtons())
	{
		ui->exportButton->setIcon(QIcon());
		ui->newCert->setIcon(QIcon());
		ui->sellCertButton->setIcon(QIcon());
		ui->transferButton->setIcon(QIcon());
		ui->editButton->setIcon(QIcon());
		ui->copyCert->setIcon(QIcon());
		ui->refreshButton->setIcon(QIcon());

	}
	else
	{
		ui->exportButton->setIcon(platformStyle->SingleColorIcon(":/icons/" + theme + "/export"));
		ui->newCert->setIcon(platformStyle->SingleColorIcon(":/icons/" + theme + "/add"));
		ui->sellCertButton->setIcon(platformStyle->SingleColorIcon(":/icons/" + theme + "/cart"));
		ui->transferButton->setIcon(platformStyle->SingleColorIcon(":/icons/" + theme + "/cert"));
		ui->editButton->setIcon(platformStyle->SingleColorIcon(":/icons/" + theme + "/editsys"));
		ui->copyCert->setIcon(platformStyle->SingleColorIcon(":/icons/" + theme + "/editcopy"));
		ui->refreshButton->setIcon(platformStyle->SingleColorIcon(":/icons/" + theme + "/refresh"));
		
	}

	ui->buttonBox->setVisible(false);

    ui->labelExplanation->setText(tr("These are your registered Syscoin Certificates. Certificate operations (create, update, transfer) take 2-5 minutes to become active."));
	
	
    // Context menu actions
    QAction *copyCertAction = new QAction(ui->copyCert->text(), this);
    QAction *copyCertValueAction = new QAction(tr("&Copy Title"), this);
    QAction *editAction = new QAction(tr("&Edit"), this);
    QAction *transferCertAction = new QAction(tr("&Transfer"), this);
	QAction *sellCertAction = new QAction(tr("&Sell"), this);

    // Build context menu
    contextMenu = new QMenu();
    contextMenu->addAction(copyCertAction);
    contextMenu->addAction(copyCertValueAction);
    contextMenu->addAction(editAction);
    contextMenu->addSeparator();
    contextMenu->addAction(transferCertAction);
	contextMenu->addAction(sellCertAction);

    // Connect signals for context menu actions
    connect(copyCertAction, SIGNAL(triggered()), this, SLOT(on_copyCert_clicked()));
    connect(copyCertValueAction, SIGNAL(triggered()), this, SLOT(onCopyCertValueAction()));
    connect(editAction, SIGNAL(triggered()), this, SLOT(on_editButton_clicked()));
    connect(transferCertAction, SIGNAL(triggered()), this, SLOT(on_transferButton_clicked()));
	connect(sellCertAction, SIGNAL(triggered()), this, SLOT(on_sellCertButton_clicked()));
	connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(on_editButton_clicked()));
    connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));

    // Pass through accept action from button box
    connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
}
Beispiel #5
0
QEMUGUI::QEMUGUI(QWidget *parent) :
    QMainWindow(parent), currentVM(NULL), runningVM(NULL),
    ui(new Ui::mainWindow)
{
    ui->setupUi(this);

    this->isSaveRetrace = false;

    connect(ui->confTree,       SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),  this, SLOT(changeConfigurations(QTreeWidgetItem*,QTreeWidgetItem*)));
    connect(ui->actionExit,     SIGNAL(triggered()),                                            this, SLOT(close()));
    connect(ui->actionStart,    SIGNAL(triggered()),                                            this, SLOT(onExecuteAction()));
    connect(ui->actionRecord,   SIGNAL(triggered()),                                            this, SLOT(onRecordAction()));
    connect(ui->actionCreate,   SIGNAL(triggered()),                                            this, SLOT(on_addConfButton_clicked()));
    connect(ui->actionDelete,   SIGNAL(triggered()),                                            this, SLOT(on_deleteConfButton_clicked()));
    connect(ui->actionEdit,     SIGNAL(triggered()),                                            this, SLOT(on_editButton_clicked()));
    connect(ui->actionOptions,  SIGNAL(triggered()),                                            this, SLOT(showGlobalOptions()));

    // update totalOptionsLineEdit
    connect(ui->logFileName,       SIGNAL(editingFinished()),    this, SLOT(updateControlsState()));
    connect(ui->snapshotCheckBox,  SIGNAL(clicked()),            this, SLOT(updateControlsState()));
    connect(ui->logOptions,        SIGNAL(clicked(QModelIndex)), this, SLOT(updateControlsState()));
    connect(ui->additionalOptions, SIGNAL(editingFinished()),    this, SLOT(updateControlsState()));

    connect(&monitorSocket, SIGNAL(readyRead()), this, SLOT(terminalRead()));
    connect(ui->terminalInput->lineEdit(), SIGNAL(returnPressed()), this, SLOT(terminalWrite()));

    loadConfList();
}