Esempio n. 1
0
PathDeformWidget::PathDeformWidget(QWidget *parent, bool smallScreen)
    : QWidget(parent)
{
    setWindowTitle(tr("Vector Deformation"));

    m_renderer = new PathDeformRenderer(this, smallScreen);
    m_renderer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    // Layouts
    QHBoxLayout *mainLayout = new QHBoxLayout(this);
    mainLayout->addWidget(m_renderer);

    m_controls = new PathDeformControls(0, m_renderer, smallScreen);
    m_controls->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);

    if (!smallScreen)
        mainLayout->addWidget(m_controls);

    m_renderer->loadSourceFile(":res/deform/pathdeform.cpp");
    m_renderer->loadDescription(":res/deform/pathdeform.html");
    m_renderer->setDescriptionEnabled(false);

    connect(m_renderer, SIGNAL(clicked()), this, SLOT(showControls()));
    connect(m_controls, SIGNAL(okPressed()), this, SLOT(hideControls()));
    connect(m_controls, SIGNAL(quitPressed()), QApplication::instance(), SLOT(quit()));
}
Esempio n. 2
0
// ------------------------------------------------------------------------
void DicomParser::setUpDisplay()
{

	parseDicom();
	loadImages();


	QWidget * w1 = new QWidget(this);
	QHBoxLayout * l1 = new QHBoxLayout;
	l1->addWidget(createTable());
	l1->addWidget(createViewer());
	w1->setLayout(l1);
	

	
	okButton = new QPushButton("OK", this);
	connect(okButton, SIGNAL(clicked()), this, SLOT(okPressed()));
	
	cancelButton = new QPushButton("Cancel", this);
	connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelPressed()));

	QHBoxLayout * l2 = new QHBoxLayout;
	l2->addWidget(cancelButton);
	l2->addWidget(okButton);

	QWidget * w2 = new QWidget(this);
	w2->setLayout(l2);

	QVBoxLayout * l3 = new QVBoxLayout;
	l3->addWidget(w1);
	l3->addWidget(w2);

	this->setLayout(l3);

}
Esempio n. 3
0
OsmImport::OsmImport()
    : ui(new Ui::OsmImport)
    , init_(false)
{
    ui->setupUi(this);

    nam = new QNetworkAccessManager(this);
    QObject::connect(nam, SIGNAL(finished(QNetworkReply *)),
                     this, SLOT(finishedSlot(QNetworkReply *)));
    ui->minLatSpin->setDecimals(8);
    ui->minLatSpin->setMaximum(360);
    ui->minLatSpin->setMinimum(-360);
    ui->minLatSpin->setValue(48.709145);
    //ui->minLatSpin->setValue(31.23122);
    ui->minLongSpin->setDecimals(8);
    ui->minLongSpin->setMaximum(360);
    ui->minLongSpin->setMinimum(-360);
    ui->minLongSpin->setValue(9.24237);
    //ui->minLongSpin->setValue(121.46355);
    ui->maxLatSpin->setDecimals(8);
    ui->maxLatSpin->setMaximum(360);
    ui->maxLatSpin->setMinimum(-360);
    ui->maxLatSpin->setValue(48.727294);
    //ui->maxLatSpin->setValue(31.236);
    ui->maxLongSpin->setMaximum(360);
    ui->maxLongSpin->setMinimum(-360);
    ui->maxLongSpin->setDecimals(8);
    ui->maxLongSpin->setValue(9.291937);
    //ui->maxLongSpin->setValue(121.476);

    connect(this, SIGNAL(accepted()), this, SLOT(okPressed()));
    // Done //
    //
    init_ = true;
}
Esempio n. 4
0
MacroDialog::MacroDialog(QWidget *parent) : QDialog(parent), ui(new Ui::MacroDialog) {
    ui->setupUi(this);

    macroSettings = MacroSettings::Instance();

    saveTime = false;

    this->loadSettings();
    this->loadSequenceTime();

    connect(ui->okButton, SIGNAL(clicked()), this, SLOT(okPressed()));
    connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(cancelPressed()));
    connect(ui->applyButton, SIGNAL(clicked()), this, SLOT(applyPressed()));

    connect(ui->altTable, SIGNAL(currentItemChanged(QTableWidgetItem*, QTableWidgetItem*)),
            this, SLOT(altCommandChanged(QTableWidgetItem*, QTableWidgetItem*)));
    connect(ui->ctrlTable, SIGNAL(currentItemChanged(QTableWidgetItem*, QTableWidgetItem*)),
            this, SLOT(ctrlCommandChanged(QTableWidgetItem*, QTableWidgetItem*)));
    connect(ui->functionTable, SIGNAL(currentItemChanged(QTableWidgetItem*, QTableWidgetItem*)),
            this, SLOT(functionCommandChanged(QTableWidgetItem*, QTableWidgetItem*)));
    connect(ui->keypadTable, SIGNAL(currentItemChanged(QTableWidgetItem*, QTableWidgetItem*)),
            this, SLOT(keypadCommandChanged(QTableWidgetItem*, QTableWidgetItem*)));
    connect(ui->sequenceTime, SIGNAL(textChanged(const QString&)),
            this, SLOT(sequenceTimeChanged(const QString&)));

    ui->altTable->setFocus();
}
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    central = new QWidget(this);
    central->setContextMenuPolicy(Qt::NoContextMenu); // explicitly forbid usage of context menu so actions item is not shown menu
    setCentralWidget(central);

    // Create text editor and set softkeys to it
    textEditor= new QTextEdit(tr("Navigate in UI to see context sensitive softkeys in action"), this);
    QAction* clear = new QAction(tr("Clear"), this);
    clear->setSoftKeyRole(QAction::NegativeSoftKey);

    textEditor->addAction(clear);

    ok = new QAction(tr("Ok"), this);
    ok->setSoftKeyRole(QAction::PositiveSoftKey);
    connect(ok, SIGNAL(triggered()), this, SLOT(okPressed()));

    cancel = new QAction(tr("Cancel"), this);
    cancel->setSoftKeyRole(QAction::NegativeSoftKey);
    connect(cancel, SIGNAL(triggered()), this, SLOT(cancelPressed()));

    infoLabel = new QLabel(tr(""), this);
    infoLabel->setContextMenuPolicy(Qt::NoContextMenu);

    toggleButton = new QPushButton(tr("Custom"), this);
    toggleButton->setContextMenuPolicy(Qt::NoContextMenu);
    toggleButton->setCheckable(true);

    pushButton = new QPushButton(tr("File Dialog"), this);
    pushButton->setContextMenuPolicy(Qt::NoContextMenu);

    QComboBox* comboBox = new QComboBox(this);
    comboBox->setContextMenuPolicy(Qt::NoContextMenu);
    comboBox->insertItems(0, QStringList()
     << QApplication::translate("MainWindow", "Selection1", 0, QApplication::UnicodeUTF8)
     << QApplication::translate("MainWindow", "Selection2", 0, QApplication::UnicodeUTF8)
     << QApplication::translate("MainWindow", "Selection3", 0, QApplication::UnicodeUTF8)
    );

    layout = new QGridLayout;
    layout->addWidget(textEditor, 0, 0, 1, 2);
    layout->addWidget(infoLabel, 1, 0, 1, 2);
    layout->addWidget(toggleButton, 2, 0);
    layout->addWidget(pushButton, 2, 1);
    layout->addWidget(comboBox, 3, 0, 1, 2);
    central->setLayout(layout);

    fileMenu = menuBar()->addMenu(tr("&File"));
    exit = new QAction(tr("&Exit"), this);
    fileMenu->addAction(exit);

    connect(clear, SIGNAL(triggered()), this, SLOT(clearTextEditor()));
    connect(pushButton, SIGNAL(clicked()), this, SLOT(openDialog()));
    connect(exit, SIGNAL(triggered()), this, SLOT(exitApplication()));
    connect(toggleButton, SIGNAL(clicked()), this, SLOT(setCustomSoftKeys()));
    pushButton->setFocus();
}
ConfigurationDialog::ConfigurationDialog(const CFGManager *cfg, QWidget *parent) :
        Dialog("Configuration", "", parent)
{
    this->cfg = cfg;
    setFixedSize(350, 500);
    text->hide();
    connect(cfg, SIGNAL(errorMessage(QString)),
            this, SLOT(showMessage(QString)));
    connect(this, SIGNAL(okPressed()), this, SLOT(accept()));
    connect(this, SIGNAL(okPressed()), cfg, SLOT(saveDoc()));
    connect(this, SIGNAL(cancelPressed()), cfg, SLOT(undoDoc()));
    tabs = new QTabWidget();
    mainLayout->addWidget(tabs, 4, 0, 1, 4);

    createDatabaseTab();
    createSpreadSheetTab();
    createSecurityTab();
}
Esempio n. 7
0
/**
 * Class constructor.
 */
FileNameDialog::FileNameDialog(QWidget *parent):
    QDialog(parent),
    ui(new Ui::FileNameDialog),
    success(false)
{
    ui->setupUi(this);
    connect(ui->cancelButton, SIGNAL(pressed()), this, SLOT(cancelPressed()));
    connect(ui->okButton, SIGNAL(pressed()), this, SLOT(okPressed()));
}
Esempio n. 8
0
ProjectionSettings::ProjectionSettings()
    : ui(new Ui::ProjectionSettings)
{
    inst = this;
    ui->setupUi(this);

    connect(this, SIGNAL(accepted()), this, SLOT(okPressed()));

    ui->XOffsetSpin->setDecimals(10);
    ui->XOffsetSpin->setMaximum(10000000);
    ui->XOffsetSpin->setMinimum(-10000000);
    //ui->XOffsetSpin->setValue(-5439122.807299255);
    ui->XOffsetSpin->setValue(-3506000);
    //ui->XOffsetSpin->setValue(-926151);
    ui->YOffsetSpin->setDecimals(10);
    ui->YOffsetSpin->setMaximum(10000000);
    ui->YOffsetSpin->setMinimum(-10000000);
    //ui->YOffsetSpin->setValue(-984970.1841083583);
    //ui->YOffsetSpin->setValue(-3463995);
    ui->YOffsetSpin->setValue(-5400147);
    ui->ZOffsetSpin->setDecimals(10);
    ui->ZOffsetSpin->setMaximum(10000000);
    ui->ZOffsetSpin->setMinimum(-10000000);
    //ui->ZOffsetSpin->setValue(-399.4944465);
    ui->ZOffsetSpin->setValue(0.0);
    ui->FromDatumEdit->setText(QString("WGS84"));
    ui->ToProjectionEdit->setText(QString("tmerc +lat_0=0 +lon_0=9 +k=1.000000 +x_0=3500000 +y_0=0 +ellps=bessel +datum=potsdam"));
    //ui->ToProjectionEdit->setText(QString("tmerc +lat_0=0 +lon_0=9 +k=1.000000 +x_0=3500000 +y_0=0 +ellps=bessel +datum=potsdam +nadgrids=/data/porsche/BETA2007.gsb"));
    //ui->ToProjectionEdit->setText(QString("utm +zone=50 +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0"));
    QString projFromString = "+proj=latlong +datum=" + ui->FromDatumEdit->text();
    //std::string projToString = "+proj=merc +x_0=-1008832.89 +y_0=-6179385.47";.
    QString projToString = "+proj=" + ui->ToProjectionEdit->text();
    XOffset = ui->XOffsetSpin->value();
    YOffset = ui->YOffsetSpin->value();
    ZOffset = ui->ZOffsetSpin->value();
    
    projPJ new_pj_from, new_pj_to;
    if (!(new_pj_from = pj_init_plus(projFromString.toUtf8().constData())))
    {
        //std::cerr << "RoadSystem::parseIntermapRoad(): couldn't initalize projection source: " << projFromString << std::endl;
        //return false;
    }
    else
    {
        pj_from = new_pj_from;
    }
    if (!(new_pj_to = pj_init_plus(projToString.toUtf8().constData())))
    {
        //std::cerr << "RoadSystem::parseIntermapRoad(): couldn't initalize projection target: " << projToString << std::endl;
        //return false;
    }
    else
    {
        pj_to = new_pj_to;
    }
    inst = this;
}
Esempio n. 9
0
 LoginWindow::LoginWindow(QWidget * parent, Qt::WindowFlags f):QMainWindow(parent,f)
 {
   QWidget *widget = new QWidget(this);
   m_form.setupUi(widget);
   setCentralWidget(widget);
   connect(m_form.m_login, SIGNAL(clicked()), SLOT(okPressed()));
   connect(&m_query,SIGNAL(responseReceived(QString, QString,QString)),this,SLOT(responseReceived(QString,QString,QString)));
   connect(&m_query,SLOT(onManagerSslErrors()),&m_query,SIGNAL(errorReceived()));
   connect(&m_query,SLOT(onReplyError(QNetworkReply::NetworkError)),&m_query,SIGNAL(errorReceived()));
   connect(&m_query,SIGNAL(errorReceived()),this,SLOT(errorReceived()));
 }
HighlightEditDialog::HighlightEditDialog(HighlightTextTab *textTab, QWidget *parent) :
    QDialog(parent), ui(new Ui::HighlightEditDialog) {

    ui->setupUi(this);

    parentDialog = (QDialog*)parent;
    settings = new HighlightSettings();

    this->textTab = textTab;

    connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(cancelPressed()));
    connect(ui->okButton, SIGNAL(clicked()), this, SLOT(okPressed()));
}
CaptchaDialog::CaptchaDialog(const QString& id, QWidget *p)
	: QDialog(p)
	, id_(id)
{
	setAttribute(Qt::WA_DeleteOnClose);
	ui_.setupUi(this);
	toggleTEVisible(false);

	connect(ui_.buttonBox, SIGNAL(accepted()), SLOT(okPressed()));
	connect(ui_.buttonBox, SIGNAL(rejected()), SLOT(cancelPressed()));
	connect(ui_.cb_message, SIGNAL(toggled(bool)), SLOT(toggleTEVisible(bool)));

	ui_.le_answer->installEventFilter(this);
}
Esempio n. 12
0
HighlightDialog::HighlightDialog(QWidget *parent) : QDialog(parent), ui(new Ui::HighlightDialog) {
    ui->setupUi(this);

    mainWindow = (MainWindow*)qobject_cast<QObject *>(parent);
    settings = ClientSettings::Instance();

    generalTab = new HighlightGeneralTab(this);
    textTab = new HighlightTextTab(this);
    alertTab = new HighlightAlertTab(this);

    connect(ui->okButton, SIGNAL(clicked()), this, SLOT(okPressed()));
    connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(cancelPressed()));
    connect(ui->applyButton, SIGNAL(clicked()), this, SLOT(applyPressed()));
}
Esempio n. 13
0
AppearanceDialog::AppearanceDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AppearanceDialog) {
    ui->setupUi(this);

    mainWindow = (MainWindow*)parent;
    windowFacade = mainWindow->getWindowFacade();
    settings = new GeneralSettings();

    this->populateMainBox();
    this->populateDockBox();
    this->loadSettings();

    connect(ui->okButton, SIGNAL(clicked()), this, SLOT(okPressed()));
    connect(ui->applyButton, SIGNAL(clicked()), this, SLOT(applyPressed()));
    connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(cancelPressed()));
}
// -----------------------------------------------------------------------------
// CAknConfSettingItem::HandleSettingPageEventL()
// -----------------------------------------------------------------------------
//
void CAknConfSettingItem::HandleSettingPageEventL(
    CAknSettingPage *aSettingPage, TAknSettingPageEvent aEventType)
    {
    CAknIntegerEdwinSettingItem::HandleSettingPageEventL( aSettingPage,
                                                          aEventType );
    TBool okPressed( aEventType == EEventSettingOked );
    if ( aEventType == EEventSettingCancelled
        || aEventType == EEventSettingOked && iList )
        {
        StoreL();
        iList->SettingPageClosed( okPressed,
                                  *iValue,
                                  iCenRepKey );
        }
    }
bool CaptchaDialog::eventFilter(QObject *o, QEvent *e)
{
	if(o == ui_.le_answer && e->type() == QEvent::KeyPress) {
		QKeyEvent *ke = static_cast<QKeyEvent*>(e);
		if(ke->key() == Qt::Key_Escape) {
			cancelPressed();
			return true;
		}
		else if(ke->key() == Qt::Key_Enter) {
			okPressed();
			return true;
		}
	}

	return QDialog::eventFilter(o,e);
}
FunctionDialog::FunctionDialog(QWidget *parent) :
    QDialog(parent),
    m_ui(new Ui::FunctionDialog)
{
    m_ui->setupUi(this);

    m_numParam = -1;
    m_prototype = new QString();

    m_ui->funcType->setFocus();

    connect(m_ui->addParam, SIGNAL(clicked()), this, SLOT(addParam()));
    connect(m_ui->removeParam, SIGNAL(clicked()), this, SLOT(removeParam()));
    connect(m_ui->buttonBox, SIGNAL(accepted()), this, SLOT(okPressed()));
    connect(m_ui->buttonBox, SIGNAL(rejected()), this, SLOT(cancelPressed()));

}
Esempio n. 17
0
void AddStateProcessDialog::launchWindow()
{
    bool ok = false;

    std::vector<std::pair<QString, UuidKey<Process::StateProcessFactory>>> sortedFactoryList;
    for(const auto& factory : m_factoryList)
    {
        sortedFactoryList.push_back(
                    std::make_pair(
                        factory.prettyName(),
                        factory.concreteFactoryKey()));
    }

    std::sort(sortedFactoryList.begin(),
              sortedFactoryList.end(),
              [] (const auto& e1, const auto& e2) {
        return e1.first < e2.first;
    });

    QStringList nameList;
    for(const auto& elt : sortedFactoryList)
    {
        nameList.append(elt.first);
    }

    auto process_name = QInputDialog::getItem(
        qApp->activeWindow(),
        tr("Choose a state process"),
        tr("Choose a state process"),
        nameList,
        0,
        false,
        &ok);


    if(ok)
    {
        auto it = std::find_if(sortedFactoryList.begin(),
                               sortedFactoryList.end(),
                               [&] (const auto& elt) {
            return elt.first == process_name;
        });
        ISCORE_ASSERT(it != sortedFactoryList.end());
        emit okPressed(it->second);
    }
}
Esempio n. 18
0
ScriptEditDialog::ScriptEditDialog(QWidget *parent) : QDialog(parent), ui(new Ui::ScriptEditDialog) {
    ui->setupUi(this);

    completer = new QCompleter(this);
    model = new QStringListModel();

    scriptPath.setPath(QApplication::applicationDirPath() + "/scripts");

    #ifdef Q_OS_WIN
        notepadPath.setPath("notepad");
    #elif defined(Q_OS_LINUX)
        notepadPath.setPath("gedit");
    #elif defined(Q_OS_MAC)
        notepadPath.setPath("open -t");
    #endif

    connect(ui->okButton, SIGNAL(clicked()), this, SLOT(okPressed()));
    connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(cancelPressed()));
}
Esempio n. 19
0
AppearanceDialog::AppearanceDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AppearanceDialog) {
    ui->setupUi(this);

    mainWindow = (MainWindow*)parent;
    windowFacade = mainWindow->getWindowFacade();
    commandLine = mainWindow->getCommandLine();
    roundTimeDisplay = commandLine->getRoundtimeDisplay();

    settings = GeneralSettings::getInstance();

    this->populateMainBox();
    this->populateDockBox();
    this->populateCmdBox();
    this->loadSettings();

    connect(ui->okButton, SIGNAL(clicked()), this, SLOT(okPressed()));
    connect(ui->applyButton, SIGNAL(clicked()), this, SLOT(applyPressed()));
    connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(cancelPressed()));
}
Esempio n. 20
0
NewCHEInfoDialog::NewCHEInfoDialog()
{
	okButton = new QPushButton("OK");
	connect(okButton, SIGNAL(clicked()), this, SLOT(okPressed()));
	backButton = new QPushButton("Back");
	connect(backButton, SIGNAL(clicked()), this, SLOT(backPressed()));
	cancelButton = new QPushButton("Cancel");
	connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelPressed()));
	mHBox->addWidget(okButton, 0, Qt::AlignRight);
	mHBox->addWidget(backButton, 0, Qt::AlignRight);
	mHBox->addWidget(cancelButton, 0, Qt::AlignRight);

	mVBox->addLayout(mGrid);
	mVBox->addLayout(mHBox);

	mDialog->setLayout(mVBox);

    mDialog->setMinimumWidth(350);
    mDialog->adjustSize();
}
/*!
 * The construction of the dialog
 */ 
void EapMschapv2PwdExpNoteDialog::createDialog()
{
    OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_CREATEDIALOG_ENTRY );
    qDebug("EapMschapv2PwdExpNoteDialog::createDialog ENTER");
     
    QString text(hbTrId("txt_occ_info_eapmschapv2_password_has_expired_yo"));
        
    //Set the dialog to be on the screen until user reacts
    //by pressing the Action button
    this->setModal(true);
    this->setTimeout(HbPopup::NoTimeout);
    this->setDismissPolicy(HbPopup::NoDismiss);
                   
    this->setText(text);    
    this->setIconVisible(true);
    
    //Remove all default actions from the dialog          
    QList<QAction*> action_list = this->actions();
    for ( int i = 0; i < action_list.count(); i++ ) {
        this->removeAction(action_list.at(i));
        }
    
    //Add a new Ok button action 
    HbAction* actionOk = new HbAction(hbTrId("txt_common_button_ok_single_dialog"),this); 
    this->addAction(actionOk);
    
    //Connect to a SLOT owned by this class  
    bool connected = connect(actionOk, SIGNAL(triggered()), this, SLOT(okPressed()));
    Q_ASSERT(connected == true);
        
    //Connect the about to close and hide signals, so that we are able to inform 
    //the caller that the dialog was closed    
    connected = connect(this, SIGNAL(aboutToClose()), this, SLOT(closingDialog()));
    Q_ASSERT(connected == true);
    connected = connect(this, SIGNAL(aboutToHide()), this, SLOT(closingDialog()));
    Q_ASSERT(connected == true);
   
    OstTraceFunctionExit0( DUP1_EAPMSCHAPV2PWDEXPNOTEDIALOG_CREATEDIALOG_EXIT );
    qDebug("EapMschapv2PwdExpNoteDialog::createDialog EXIT");
}
Esempio n. 22
0
bool EditMetadataDialog::Create(void)
{
    bool foundtheme = false;

    // Load the theme for this screen
    foundtheme = LoadWindowFromXML("mythburn-ui.xml", "edit_metadata", this);

    if (!foundtheme)
        return false;

    bool err = false;
    UIUtilE::Assign(this, m_titleEdit, "title_edit", &err);
    UIUtilE::Assign(this, m_subtitleEdit, "subtitle_edit", &err);
    UIUtilE::Assign(this, m_descriptionEdit, "description_edit", &err);
    UIUtilE::Assign(this, m_starttimeEdit, "starttime_edit", &err);
    UIUtilE::Assign(this, m_startdateEdit, "startdate_edit", &err);
    UIUtilE::Assign(this, m_okButton, "ok_button", &err);
    UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err);

    if (err)
    {
        LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'edit_metadata'");
        return false;
    }

    connect(m_okButton, SIGNAL(Clicked()), this, SLOT(okPressed()));
    connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(cancelPressed()));

    m_titleEdit->SetText(m_sourceMetadata->title);
    m_subtitleEdit->SetText(m_sourceMetadata->subtitle);
    m_descriptionEdit->SetText(m_sourceMetadata->description);
    m_startdateEdit->SetText(m_sourceMetadata->startDate);
    m_starttimeEdit->SetText(m_sourceMetadata->startTime);

    BuildFocusList();

    SetFocusWidget(m_titleEdit);

    return true;
}
Esempio n. 23
0
InvitationDialog::InvitationDialog(const QString &jid, bool first, QWidget *parent)
    : QDialog(parent)
{
    setAttribute(Qt::WA_DeleteOnClose);
    setModal(false);
    ui_.setupUi(this);

    QString posStr;
    if(first)
        posStr = tr("second", "He wants to play second");
    else
        posStr = tr("first", "He wants to play first");

    ui_.lbl_text->setText(tr("Player %1 invites you \nto play battleship. He wants to play %2.")
                  .arg(jid).arg(posStr));

    connect(ui_.pb_accept, SIGNAL(clicked()), this, SLOT(okPressed()));
    connect(ui_.pb_reject, SIGNAL(clicked()), this, SLOT(close()));

    adjustSize();
    setFixedSize(size());
}
PathStrokeWidget::PathStrokeWidget(bool smallScreen)
{
    setWindowTitle(tr("Path Stroking"));

    // Widget construction and property setting
    m_renderer = new PathStrokeRenderer(this, smallScreen);

    m_controls = new PathStrokeControls(0, m_renderer, smallScreen);

    // Layouting
    QHBoxLayout *viewLayout = new QHBoxLayout(this);
    viewLayout->addWidget(m_renderer);

    if (!smallScreen)
        viewLayout->addWidget(m_controls);

    m_renderer->loadSourceFile(":res/pathstroke/pathstroke.cpp");
    m_renderer->loadDescription(":res/pathstroke/pathstroke.html");

    connect(m_renderer, SIGNAL(clicked()), this, SLOT(showControls()));
    connect(m_controls, SIGNAL(okPressed()), this, SLOT(hideControls()));
    connect(m_controls, SIGNAL(quitPressed()), QApplication::instance(), SLOT(quit()));
}
Esempio n. 25
0
OpenRemoteDlg::OpenRemoteDlg(QUrl& u, QWidget *parent) : QDialog(parent),
	url(u)
{
	QLabel* info = new QLabel("Insert the url of the file to load");
	QLabel* label = new QLabel("URL");
	if (url.isEmpty())
		input = new QLineEdit("http://");
	else
		input = new QLineEdit(url.toString());
	input->setMinimumWidth(500);
	
	okBtn = new QPushButton("OK");
	okBtn->setDefault(true);
	cancelBtn = new QPushButton("Cancel");
	cancelBtn->setAutoDefault(false);

	buttonBox = new QDialogButtonBox;
	buttonBox->addButton(okBtn, QDialogButtonBox::ActionRole);
	buttonBox->addButton(cancelBtn, QDialogButtonBox::RejectRole);
	
	connect(okBtn, SIGNAL(clicked()), this, SLOT(okPressed()));
	connect(cancelBtn, SIGNAL(clicked()), this, SLOT(close()));

	QSpacerItem* spacer = new QSpacerItem(10, 10, QSizePolicy::Expanding, QSizePolicy::Expanding);
	
	QGridLayout* layout = new QGridLayout;
	layout->addWidget(info, 0, 0, 1, 3, Qt::AlignLeft);
	layout->addWidget(label, 1, 0, 1, 1, Qt::AlignLeft);
	layout->addWidget(input, 1, 1, 1, 2);
	layout->addItem(spacer, 2, 1, 1, 1);
	layout->addWidget(buttonBox, 2, 2, 1, 1);
	setLayout(layout);
	
	setModal(true);
	setWindowTitle(tr("HTTP"));
	input->setFocus();
}
Esempio n. 26
0
int ColormapEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: newColorList((*reinterpret_cast< QList<QColor>(*)>(_a[1]))); break;
        case 1: rotate((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 2: bias((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 3: contrast((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 4: setColor(); break;
        case 5: okPressed(); break;
        case 6: applyPressed(); break;
        case 7: biasReset(); break;
        case 8: rotateReset(); break;
        case 9: contrastRest(); break;
        case 10: updateColormap(); break;
        case 11: resetMap((*reinterpret_cast< int(*)>(_a[1]))); break;
        }
        _id -= 12;
    }
    return _id;
}
/*!
 * The construction of the dialog
 *
 * @param [in] parameters Parameters for the Construction of the dialog.
 */ 
void EapMschapv2NewPwdDialog::createDialog(const QVariantMap &parameters )
{
    OstTraceFunctionEntry0( EAPMSCHAPV2NEWPWDDIALOG_CREATEDIALOG_ENTRY );
    qDebug("EapMschapv2NewPwdDialog::createDialog ENTER");
    
    Q_UNUSED(parameters)
    
    QString labelText1(hbTrId("txt_occ_dialog_new_eapmschapv2_password"));
    QString labelText2(hbTrId("txt_occ_dialog_verify_password"));
        
    //Set the dialog to be on the screen until user reacts
    //by pressing any of the Action buttons
    this->setModal(true);
    this->setTimeout(HbPopup::NoTimeout);
    this->setDismissPolicy(HbPopup::NoDismiss);
    this->setDismissOnAction(false);        
    this->setAdditionalRowVisible(true);
    
    //Set the first Line Edit to be on the screen
    this->setPromptText(labelText1, 0);   
    mEdit1 = this->lineEdit(0);
    mEdit1->setEchoMode(HbLineEdit::Password);
    
    //Set the second Line Edit to be on the screen also
    this->setPromptText(labelText2, 1);   
    mEdit2 = this->lineEdit(1);        
    mEdit2->setEchoMode(HbLineEdit::Password);
    
    EapQtConfigInterface eapConfigIf;
    
    mPwdValidator.reset( eapConfigIf.validatorEap(EapQtExpandedEapType::TypeEapMschapv2,
                EapQtConfig::Password ) );  
    Q_ASSERT( mPwdValidator.isNull() == false );                
                   
    mPwdValidator->updateEditor(mEdit1);
    
    //Remove all default actions from the dialog     
    QList<QAction*> action_list = this->actions();        
    for ( int i = 0; i < action_list.count(); i++ ) {
        this->removeAction(action_list.at(i));
        } 
    
    //Add a new Ok button action 
    HbAction* actionOk = new HbAction(hbTrId("txt_common_button_ok"),this); 
    this->addAction(actionOk);
    
    //Add a new Cancel button action 
    HbAction* actionCancel = new HbAction(hbTrId("txt_common_button_cancel"),this);
    this->addAction(actionCancel);    
    
    //Connect to a SLOT owned by this class
    bool connected = connect(actionOk, SIGNAL(triggered()), this, SLOT(okPressed()));
    Q_ASSERT(connected == true);
    
    //Connect to a SLOT owned by this class
    connected = connect(actionCancel, SIGNAL(triggered()), this, SLOT(cancelPressed()));
    Q_ASSERT(connected == true);
    
    //Connect the about to close and hide signals, so that we are able to inform 
    //the caller that the dialog was closed   
    connected = connect(this, SIGNAL(aboutToClose()), this, SLOT(closingDialog()));
    Q_ASSERT(connected == true);
    connected = connect(this, SIGNAL(aboutToHide()), this, SLOT(closingDialog()));
    Q_ASSERT(connected == true);
   
    OstTraceFunctionExit0( DUP1_EAPMSCHAPV2NEWPWDDIALOG_CREATEDIALOG_EXIT );
    qDebug("EapMschapv2NewPwdDialog::createDialog EXIT");
}
Esempio n. 28
0
void PathDeformControls::emitOkSignal()
{   emit okPressed();   }
void PathStrokeControls::emitOkSignal()
{
    emit okPressed();
}
Esempio n. 30
0
NickServRuleEditor::NickServRuleEditor(QWidget * par,bool bUseServerMaskField)
: QDialog(par)
{
	setWindowTitle(__tr2qs_ctx("NickServ Authentication Rule - KVIrc","options"));

	QGridLayout * gl = new QGridLayout(this);//,bUseServerMaskField ? 7 : 6,4,10,5);

	QLabel * l = new QLabel(__tr2qs_ctx("Registered nickname:","options"),this);
	gl->addWidget(l,0,0);

	m_pRegisteredNickEdit = new QLineEdit(this);
	KviTalToolTip::add(m_pRegisteredNickEdit, __tr2qs_ctx("Put here the nickname that you have registered with NickServ","options"));
	gl->addWidget(m_pRegisteredNickEdit,0,1,1,3);
//	gl->addMultiCellWidget(m_pRegisteredNickEdit,0,0,1,3);

	l = new QLabel(__tr2qs_ctx("NickServ mask:","options"),this);
	gl->addWidget(l,1,0);

	m_pNickServMaskEdit = new QLineEdit(this);
	KviTalToolTip::add(m_pNickServMaskEdit,
		__tr2qs_ctx("This is the mask that NickServ must match to be correctly identified as the NickServ service. "  \
			"This usually will be something like <b>[email protected]</b>.<br>" \
			"You can use wildcards for this field, but generally it is a security flaw. " \
			"If you're 100%% sure that NO user on the network can use the nickname \"NickServ\", " \
			"the mask <b>NickServ!*@*</b> may be safe to use in this field.","options"));
	gl->addWidget(m_pNickServMaskEdit,1,1,1,3);
//	gl->addMultiCellWidget(m_pNickServMaskEdit,1,1,1,3);

	l = new QLabel(__tr2qs_ctx("Message regexp:","options"),this);
	gl->addWidget(l,2,0);

	m_pMessageRegexpEdit = new QLineEdit(this);
	gl->addWidget(m_pMessageRegexpEdit,2,1,1,3);
//	gl->addMultiCellWidget(m_pMessageRegexpEdit,2,2,1,3);

	KviTalToolTip::add(m_pMessageRegexpEdit,
		__tr2qs_ctx("This is the simple regular expression that the identification request message "  \
			"from NickServ must match in order to be correctly recognized.<br>" \
			"The message is usually something like \"To identify yourself please use /ns IDENTIFY password\" " \
			"and it is sent when the NickServ wants you to authenticate yourself. " \
			"You can use the * and ? wildcards.","options"));
	l = new QLabel(__tr2qs_ctx("Identify command:","options"),this);
	gl->addWidget(l,3,0);

	m_pIdentifyCommandEdit = new QLineEdit(this);
	KviTalToolTip::add(m_pIdentifyCommandEdit,
		__tr2qs_ctx("This is the command that will be executed when NickServ requests authentication " \
			"for the nickname described in this rule (if the both server and NickServ mask are matched). " \
			"This usually will be something like <b>msg NickServ identify &lt;yourpassword&gt;</b>.<br>" \
			"You can use <b>msg -q</b> if you don't want the password echoed on the screen. " \
			"Please note that there is no leading slash in this command.","options"));
	gl->addWidget(m_pIdentifyCommandEdit,3,1,1,3);
//	gl->addMultiCellWidget(m_pIdentifyCommandEdit,3,3,1,3);

	int iNextLine = 4;

	if(bUseServerMaskField)
	{
		l = new QLabel(__tr2qs_ctx("Server mask:","options"),this);
		gl->addWidget(l,4,0);

		m_pServerMaskEdit = new QLineEdit(this);
		KviTalToolTip::add(m_pServerMaskEdit,
			__tr2qs_ctx("This is the mask that the current server must match in order " \
			"for this rule to apply. It can contain * and ? wildcards.<br>Do NOT use simply \"*\" here...","options"));
		gl->addWidget(m_pServerMaskEdit,4,1,1,3);
//		gl->addMultiCellWidget(m_pServerMaskEdit,4,4,1,3);
		iNextLine++;
	} else {
		m_pServerMaskEdit = 0;
	}


	l = new QLabel(__tr2qs_ctx("Hint: Move the mouse cursor over the fields to get help","options"),this);
	l->setMargin(10);
	gl->addWidget(l,iNextLine,0,1,4);
//	gl->addMultiCellWidget(l,iNextLine,iNextLine,0,3);

	iNextLine++;

	QPushButton * p = new QPushButton(__tr2qs_ctx("Cancel","options"),this);
	p->setMinimumWidth(100);
	connect(p,SIGNAL(clicked()),this,SLOT(reject()));
	gl->addWidget(p,iNextLine,2);

	m_pOkButton = new QPushButton(__tr2qs_ctx("OK","options"),this);
	m_pOkButton->setMinimumWidth(100);
	m_pOkButton->setDefault(true);
	connect(m_pOkButton,SIGNAL(clicked()),this,SLOT(okPressed()));
	gl->addWidget(m_pOkButton,iNextLine,3);

	gl->setColumnStretch(1,1);
	gl->setRowStretch(bUseServerMaskField ? 5 : 4,1);

	setMinimumWidth(250);
}