コード例 #1
0
void EntityEditorWindow::create_connections()
{
    connect(
        m_entity_editor.get(), SIGNAL(signal_applied(foundation::Dictionary)),
        SIGNAL(signal_applied(foundation::Dictionary)));

    connect(m_ui->buttonbox, SIGNAL(accepted()), SLOT(slot_accept()));
    connect(m_ui->buttonbox, SIGNAL(rejected()), SLOT(slot_cancel()));

    connect(
        create_window_local_shortcut(this, Qt::Key_Escape), SIGNAL(activated()),
        SLOT(slot_cancel()));
}
コード例 #2
0
ファイル: download_options.cpp プロジェクト: aurusov/winwget
// -------------------------------------------------------
// -------- WGDownloadOptionsDlg
// -------------------------------------------------------
WGDownloadOptionsDlg::WGDownloadOptionsDlg( QWidget* parent, const char* name, bool modal, WFlags fl ): WGDownloadOptionsDlgBase( parent, name, modal, fl )
{
	QIconSet image_open( QPixmap((const char**)image_open_data) );
	image_open.setPixmap( QPixmap((const char**)image_open_d_data), QIconSet::Automatic, QIconSet::Disabled );

	DirectoryB->setIconSet( image_open );
	LogDirectoryB->setIconSet( image_open );

	RetriesNumberLE->setValidator( new WGIntValidator( RetriesNumberLE ) );
	RetriesWaitLE->setValidator( new WGIntValidator( RetriesWaitLE ) );

	connect( OkB            , SIGNAL(clicked())      , this, SLOT(slot_ok())              );
	connect( CancelB        , SIGNAL(clicked())      , this, SLOT(slot_cancel())          );
	connect( DirectoryB     , SIGNAL(clicked())      , this, SLOT(slot_directory())       );
	connect( RestartCB      , SIGNAL(clicked())      , this, SLOT(slot_restart())         );
	connect( PasswordCB     , SIGNAL(clicked())      , this, SLOT(slot_password())        );
	connect( LogCB          , SIGNAL(clicked())      , this, SLOT(slot_log())             );
	connect( LogDirectoryB  , SIGNAL(clicked())      , this, SLOT(slot_log_directory())   );
	connect( URLLE          , SIGNAL(returnPressed()), this, SLOT(slot_ok())              );
	connect( PasswordUsrLE  , SIGNAL(returnPressed()), this, SLOT(slot_ok())              );
	connect( PasswordPassLE , SIGNAL(returnPressed()), this, SLOT(slot_ok())              );
	connect( RetriesNumberLE, SIGNAL(returnPressed()), this, SLOT(slot_ok())              );
	connect( RetriesWaitLE  , SIGNAL(returnPressed()), this, SLOT(slot_ok())              );

	updateControls();

	URLLE->setFocus();
}
コード例 #3
0
ファイル: proxydialog.cpp プロジェクト: skoczo/MiastoMuzyki
proxyDialog::proxyDialog(QWidget *parent) : QDialog(parent),
ui(new Ui::proxyDialog)
{
	ui->setupUi(this);

    if(parent==0||parent==NULL)
    {
        QMessageBox::critical(this,tr("Błąd aplikacji"),
                              tr("Do okna ustawień przekazany został błędny wskaźnik. "
                                 "Skontaktuj się z autorem programu.")
                              ,QMessageBox::Ok);
        this->hide();
    }
    else
    {
        this->parent=parent;
        ok=new QPushButton(tr("Ok"),this);
        cancel=new QPushButton(tr("Anuluj"),this);
        ui->buttons->addWidget(ok);
        ui->buttons->addWidget(cancel);

        connect(ui->type,SIGNAL(currentIndexChanged(int)),this,SLOT(type_change(int)));
        connect(ok,SIGNAL(clicked()),this,SLOT(slot_ok()));
        connect(cancel,SIGNAL(clicked()),this,SLOT(slot_cancel()));

        ui->name->setDisabled(true);
        ui->port->setDisabled(true);
        ui->password->setDisabled(true);
        ui->user->setDisabled(true);

        ui->type->setCurrentIndex(2);
    }
}
コード例 #4
0
ファイル: serverlistdialog.cpp プロジェクト: EPeillard/qgo
ServerListDialog::ServerListDialog(std::vector <ServerItem *> serverlist, int current)
{
	current_server = current;
	serverListView = constructTreeWidget(serverlist);
	
	connectButton = new QPushButton(tr("Connect"));
	connectButton->setDefault(true);
	
	cancelButton = new QPushButton(tr("&Cancel"));
	cancelButton->setAutoDefault(false);
	
	buttonBox = new QDialogButtonBox(Qt::Horizontal);
	buttonBox->addButton(cancelButton, QDialogButtonBox::ActionRole);
	buttonBox->addButton(connectButton, QDialogButtonBox::ActionRole);
	
	connect(serverListView, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(slot_listDoubleClicked(QTreeWidgetItem *, int)));
	
	connect(connectButton, SIGNAL(clicked()), this, SLOT(slot_connect()));
	connect(cancelButton, SIGNAL(clicked()), this, SLOT(slot_cancel()));
	
	QGridLayout * mainLayout = new QGridLayout;
	mainLayout->setSizeConstraint(QLayout::SetFixedSize);
	mainLayout->addWidget(serverListView, 0, 0);
	mainLayout->addWidget(buttonBox, 1, 0);
	setLayout(mainLayout);
	
	setWindowTitle(tr("Choose server..."));
}
コード例 #5
0
ファイル: unitExchange.cpp プロジェクト: q4a/attal
UnitExchange::UnitExchange( QWidget * parent, const char * /* name */)
	: QDialog( parent, Qt::Dialog )
{
	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->addStretch( 1 );
	
	QHBoxLayout * layH1 = new QHBoxLayout();
	layH1->addStretch( 1 );
	_icoLeft = new Icon( this );
	layH1->addWidget( _icoLeft );
	layH1->addStretch( 2 );
	_icoRight = new Icon( this );
	layH1->addWidget( _icoRight );
	layH1->addStretch( 1 );
	layout->addLayout( layH1 );
	
	QHBoxLayout * layH2 = new QHBoxLayout();
	layH2->addStretch( 1 );
	_leftLCD = new QLCDNumber( this );
	layH2->addWidget( _leftLCD );
	layH2->addStretch( 2 );
	_rightLCD = new QLCDNumber( this );
	layH2->addWidget( _rightLCD );
	layH2->addStretch( 1 );
	layout->addLayout( layH2 );
	
	QHBoxLayout * layH3 = new QHBoxLayout();
	layH3->addStretch( 1 );
	_scroll = new QScrollBar( Qt::Horizontal, this );
	layH3->addWidget( _scroll, 2 );
	layH3->addStretch( 1 );
	layout->addLayout( layH3 );

	layout->addSpacing( 5 );
	layout->addStretch( 1 );

	QHBoxLayout * layH4 = new QHBoxLayout();
	layH4->addStretch( 1 );
	AttalButton * pbCancel = new AttalButton( this, AttalButton::BT_CANCEL );	
	layH4->addWidget( pbCancel );
	layH4->addStretch( 1 );
	AttalButton * pbOk = new AttalButton( this, AttalButton::BT_OK );
	layH4->addWidget( pbOk );
	layH4->addStretch( 1 );
	layout->addLayout( layH4 );

	layout->addSpacing( 5 );

	layout->activate();
	connect( _scroll, SIGNAL( valueChanged( int ) ), SLOT( slot_barScrolled( int ) ) );
	connect( pbOk, SIGNAL( clicked() ), SLOT( slot_ok() ) );
	connect( pbCancel, SIGNAL( clicked() ), SLOT( slot_cancel() ) );
	
	setFixedSize( 190, 220 );
}
コード例 #6
0
//************************************************************************************************
//*************************************** class ZSearch ******************************************
//************************************************************************************************
ZSearch::ZSearch(const QString &curPath, const QString &originName)
  :MyBaseDlg()
{
  QString ProgDir =  QString ( qApp->argv() [0] );
  int i = ProgDir.findRev ( "/" );
  ProgDir.remove ( i+1, ProgDir.length() - i );

  ZConfig readlang("/ezxlocal/download/appwrite/setup/ezx_system.cfg", true);
  Idioma = ProgDir + "/languages/" + readlang.readEntry(QString("SYS_SYSTEM_SET"), QString("LanguageType"), "en-us");
  if ( ! QFileInfo(Idioma).isFile() ) Idioma = ProgDir + "/languages/en-us";
  ZConfig lang (Idioma,false); 

  this->setMainWidgetTitle("zTextViewer");
  
  QWidget *myWidget = new ZWidget ( this, NULL, 0);
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  myWidget->setFixedWidth(240);
  ZAppInfoArea* pAIA = new ZAppInfoArea(myWidget, NULL, 0);
  pAIA->setActArea(ZAppInfoArea::no_progress_meter);
  pAIA->appendText(ZAppInfoArea::activity, lang.readEntry(QString("TEXTVIEWER"), "IDS_SAVE", ""), "name");
  setAppInfoArea(pAIA);
  myVBoxLayout->addWidget ( pAIA, 1, 1 );

    ZFormContainer* fc = new ZFormContainer(this);
    setContentWidget(fc);

    lineEdit = new ZLineEdit(this, NULL);
    lineEdit->setTitle(lang.readEntry(QString("TEXTVIEWER"), "IDS_ENTER_FILE_NAME", ""));
    lineEdit->setTitlePosition(ZLineEdit::TitleTop);
    lineEdit->setMaxLength(50);
	lineEdit->setText(originName);
    fc->addChild(lineEdit);

 	buttonDir = new myButton(this, "ZPressButton");
	buttonDir->setTitle(lang.readEntry(QString("TEXTVIEWER"), "IDS_LOCATION", ""));
	QString direc = curPath;
	if ( direc == "" ) direc = "/mmc/mmca1";
	if ( direc[direc.length()-1] == QChar('/') ) 
	  {	direc.remove( direc.length()-1, 1 ); }
    buttonDir->setText(direc); 
	FStext=direc;
	buttonDir->setPixmap(QPixmap(ProgDir+"/img/folder.png"));
    fc->addChild(buttonDir);
	

  ZSoftKey *softKey = new ZSoftKey ( "CST_2A", this, this );
  softKey->setText ( ZSoftKey::RIGHT, lang.readEntry(QString("TEXTVIEWER"), "IDS_CANCEL", ""), ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setText ( ZSoftKey::LEFT, lang.readEntry(QString("TEXTVIEWER"), "IDS_SAVE", ""), ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( slot_cancel() ) );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( slot_search() ) );


  this->setCSTWidget( softKey );

}
コード例 #7
0
ProgressBarDialog::ProgressBarDialog( QWidget *parent ) : QDialog(parent)
{
	setupUi( this );
//	layout()->setSizeConstraint( QLayout::SetFixedSize );

	timer = new QTimer( this );
	connect( timer, SIGNAL(timeout()), this, SLOT(slot_update()) );
	timer->start();

	progressbar->setMinimum( 0 );
	progressbar->setMaximum( 100 );
	progressbar->setValue( 0 );

	connect( cancelButton, SIGNAL(clicked()), this, SLOT(slot_cancel()) );
}
コード例 #8
0
ファイル: report_create.cpp プロジェクト: gnu-swta/Chat
Report_create::Report_create(struct classArr data, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Report_create)
{
    ui->setupUi(this);

    test = data;

    ui->user_name->setText(test.userName);
    ui->class_name->setText(test.className);

    api_http = new Api_http();
    connect(ui->add, SIGNAL(clicked()), this, SLOT(slot_create()));
    connect(ui->cancel, SIGNAL(clicked()), this, SLOT(slot_cancel()));
}
コード例 #9
0
ファイル: report_create.cpp プロジェクト: gnu-swta/Chat
Report_create::Report_create(classArr data, Report_form *ori, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Report_create)
{
    ui->setupUi(this);

    test = data;

    ui->user_name->setText(test.userName);
    ui->class_name->setText(test.className);
    ui->add->setText("수정");

    connect(ui->add, SIGNAL(clicked()), this, SLOT(slot_create()));
    connect(ui->cancel, SIGNAL(clicked()), this, SLOT(slot_cancel()));
}
コード例 #10
0
ファイル: login.cpp プロジェクト: petrip/qgo
LoginDialog::LoginDialog(HostList * h)
{
	ui.setupUi(this);
    connectionName = ui.serverComboBox->currentText();
	connection = 0;
	serverlistdialog_open = false;

    hostlist = h; // Should just read it from settings here
    loadAccounts();
	
    connect(ui.serverComboBox, SIGNAL(currentIndexChanged ( int )), SLOT(slot_cbconnectChanged(int )));
	connect(ui.connectPB, SIGNAL(clicked()), this, SLOT(slot_connect()));
	connect(ui.cancelPB, SIGNAL(clicked()), this, SLOT(slot_cancel()));

	connect(ui.loginEdit, SIGNAL(editTextChanged(const QString &)), this, SLOT(slot_editTextChanged(const QString &)));
}
コード例 #11
0
//************************************************************************************************
//************************************** class ZFolderSelect2 ***********************************
//************************************************************************************************
ZFolderSelect2::ZFolderSelect2(bool onlyDirs, QString path)
  :MyBaseDlg()
{
  QString ProgDir =  QString ( qApp->argv() [0] );
  int i = ProgDir.findRev ( "/" );
  ProgDir.remove ( i+1, ProgDir.length() - i );

  ZConfig readlang("/ezxlocal/download/appwrite/setup/ezx_system.cfg", true);
  Idioma = ProgDir + "/languages/" + readlang.readEntry(QString("SYS_SYSTEM_SET"), QString("LanguageType"), "en-us");
  if ( ! QFileInfo(Idioma).isFile() ) Idioma = ProgDir + "/languages/en-us";
  ZConfig lang (Idioma,false); 

  this->setMainWidgetTitle("zFileManager");
  
  QWidget *myWidget = new ZWidget ( this, NULL, 0);
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  myWidget->setFixedWidth(240);
  ZAppInfoArea* pAIA = new ZAppInfoArea(myWidget, NULL, 0);
  pAIA->setActArea(ZAppInfoArea::no_progress_meter);
  QPixmap pixmap; pixmap.load(ProgDir+"/img/folder.png");
  pAIA->appendIcon(ZAppInfoArea::activity,pixmap,"");
  pAIA->appendText(ZAppInfoArea::activity, lang.readEntry(QString("LANGUAGE"), "SEARCH_IN", ""), "name");
  setAppInfoArea(pAIA);
  myVBoxLayout->insertWidget (0, pAIA );

  fb = new FileBrowser2("*", onlyDirs, QString ( "%I%M" ), myWidget, 0);
  fb->setDir(path);
  QObject::connect(fb, SIGNAL(isFilePicked(bool)), SLOT(filePicked(bool)));

  
  fb->ProgramDir = ProgDir;
  setContentWidget ( fb );
  
  ZSoftKey *softKey = new ZSoftKey ( "CST_2A", this, this );
  
  softKey->setText ( ZSoftKey::RIGHT, lang.readEntry(QString("LANGUAGE"), "CANCEL", ""), ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setText ( ZSoftKey::LEFT, lang.readEntry(QString("LANGUAGE"), "CHOISE", ""), ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( slot_cancel() ) );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
   
  this->setCSTWidget( softKey );

}
コード例 #12
0
Getgraphptr::Getgraphptr(QWidget *parent, const char *name,const char* message )
: QDialog(parent,Qt::WindowStaysOnTopHint)
{
    //was false,Qt::WStyle_StaysOnTop
    this->setWindowTitle(name);
    specptr=0;
    //show the message and an OK and cancel button
    this->setFocusPolicy(Qt::NoFocus);     
    QGridLayout *vbox = new QGridLayout( this );

    QLabel* mylabel=new QLabel(message,this);
    vbox->addWidget(mylabel,0,0,1,2);
    
    QPushButton *OK = new QPushButton( "&OK", this);
    QPushButton *cancel = new QPushButton( "&Cancel", this);
    vbox->addWidget(OK,1,0);
    vbox->addWidget(cancel,1,2);

    //wait for a user to click either OK or cancel
    connect( OK, SIGNAL( clicked()), this, SLOT( slot_ok() ) );
    connect( cancel, SIGNAL( clicked()), this, SLOT( slot_cancel() ) );
}
コード例 #13
0
ExportPNGForm::ExportPNGForm(EditData *pEditData, Settings *pSetting, QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::ExportPNGForm)
{
    m_pEditData = pEditData;
    m_pSetting = pSetting;

    m_pEditData->setEditMode(EditData::kEditMode_ExportPNG);
    ui->setupUi(this);

    setWindowTitle(trUtf8("連番PNG 保存"));
    ui->textEdit->setText(m_pSetting->getSavePngDir());

    connect(ui->pushButton_sel_dir, SIGNAL(clicked()), this, SLOT(slot_openSaveDir()));
    connect(ui->spinBox_left, SIGNAL(valueChanged(int)), this, SLOT(slot_changeLeft(int)));
    connect(ui->spinBox_right, SIGNAL(valueChanged(int)), this, SLOT(slot_changeRight(int)));
    connect(ui->spinBox_top, SIGNAL(valueChanged(int)), this, SLOT(slot_changeTop(int)));
    connect(ui->spinBox_bottom, SIGNAL(valueChanged(int)), this, SLOT(slot_changeBottom(int)));
    connect(ui->pushButton_ok, SIGNAL(clicked()), this, SLOT(slot_startExport()));
    connect(ui->textEdit, SIGNAL(textChanged()), this, SLOT(slot_changeSaveDir()));
    connect(ui->pushButton_cancel, SIGNAL(clicked()), this, SLOT(slot_cancel()));

    slot_changeRect();
}
コード例 #14
0
ファイル: utilitydlg.cpp プロジェクト: nic0lae/freebsddistro
CUtilityDlg::CUtilityDlg(CUtility *u, const char *szId, unsigned long nPPID,
  CICQDaemon *_server)
  : QWidget(0, "UtilityDialog",  WDestructiveClose)
{
  m_szId = szId ? strdup(szId) : 0;
  m_nPPID = nPPID;
  m_xUtility = u;
  server = _server;
  m_bIntWin = false;
  intwin = NULL;
  snOut = snErr = NULL;

  m_xUtility->SetFields(m_szId, m_nPPID);

  QGridLayout *lay = new QGridLayout(this, 1, 3, 8, 4);
  lay->setColStretch(2, 2);
  lay->addColSpacing(1, 8);
  setCaption(QString(tr("Licq Utility: %1")).arg(m_xUtility->Name()));
  lblUtility = new QLabel(tr("Command:"), this);
  lay->addWidget(lblUtility, 0, 0);
  nfoUtility = new CInfoField(this, true);
  nfoUtility->setMinimumWidth(nfoUtility->sizeHint().width()*2);
  lay->addWidget(nfoUtility, 0, 2);
  nfoUtility->setText(m_xUtility->FullCommand());

  lay->addWidget(new QLabel(tr("Window:"), this), 1, 0);
  nfoWinType = new CInfoField(this, true);
  lay->addWidget(nfoWinType, 1, 2);
  switch (m_xUtility->WinType())
  {
    case UtilityWinGui: nfoWinType->setText(tr("GUI")); break;
    case UtilityWinTerm: nfoWinType->setText(tr("Terminal")); break;
    case UtilityWinLicq: nfoWinType->setText(tr("Internal")); break;
  }

  lay->addWidget(new QLabel(tr("Description:"), this), 2, 0);
  nfoDesc = new CInfoField(this, true);
  lay->addWidget(nfoDesc, 2, 2);
  nfoDesc->setText(m_xUtility->Description());

  chkEditFinal = new QCheckBox(tr("Edit final command"), this);
  lay->addMultiCellWidget(chkEditFinal, 3, 3, 0, 2);

  boxFields = new QGroupBox(1, Horizontal, tr("User Fields"), this);
  lay->addMultiCellWidget(boxFields, 4, 4, 0, 2);
  for (unsigned short i = 0; i < m_xUtility->NumUserFields(); i++)
  {
    QString s;
    s.sprintf("%s (%%%d): ", m_xUtility->UserField(i)->Title(), i+1);
    QLabel *lbl = new QLabel(s, boxFields);
    lblFields.push_back(lbl);
    QLineEdit *edt = new QLineEdit(boxFields);
    edt->setText(m_xUtility->UserField(i)->FullDefault());
    edt->setMinimumSize(edt->sizeHint());
    edtFields.push_back(edt);
  }

  splOutput = new QSplitter(Vertical, boxFields);
  splOutput->setOpaqueResize();
  mleOut = new MLEditWrap(true, splOutput);
  mleOut->setReadOnly(true);
  mleErr = new MLEditWrap(true, splOutput);
  mleErr->setReadOnly(true);

  splOutput->setResizeMode(mleErr, QSplitter::Stretch);//FollowSizeHint);
  splOutput->setResizeMode(mleOut, QSplitter::Stretch);
  splOutput->hide();
  if (m_xUtility->NumUserFields() == 0) boxFields->hide();

  QHBoxLayout *hlay = new QHBoxLayout();
  lay->addMultiCell(hlay, 5, 5, 0, 2);
  hlay->addStretch(1);
  btnRun = new QPushButton(tr("&Run"), this);
  btnRun->setDefault(true);
  btnRun->setMinimumWidth(75);
  hlay->addWidget(btnRun, 0, AlignRight);
  hlay->addSpacing(20);
  btnCancel = new QPushButton(tr("&Cancel"), this);
  btnCancel->setMinimumWidth(75);
  hlay->addWidget(btnCancel, 0, AlignLeft);

  connect(btnRun, SIGNAL(clicked()), SLOT(slot_run()));
  connect(btnCancel, SIGNAL(clicked()), SLOT(slot_cancel()));

  show();
}
コード例 #15
0
ExpressionEditorWindow::ExpressionEditorWindow(
    const Project&  project,
    ParamArray&     settings,
    const QString&  widget_name,
    const string&   expression,
    QWidget*        parent)
  : WindowBase(parent, "expression_editor_window")
  , m_ui(new Ui::ExpressionEditorWindow())
  , m_project(project)
  , m_settings(settings)
  , m_widget_name(widget_name)
  , m_show_examples(false)
{
    m_ui->setupUi(this);

    setAttribute(Qt::WA_DeleteOnClose);
    setWindowFlags(Qt::Tool);

    QHBoxLayout* root_layout = new QHBoxLayout(m_ui->scrollarea);

    QVBoxLayout* left_layout = new QVBoxLayout();
    QVBoxLayout* right_layout = new QVBoxLayout();
    root_layout->addLayout(left_layout);
    root_layout->addLayout(right_layout);

    // Expression controls.
    SeExprEdControlCollection* controls = new SeExprEdControlCollection();
    QScrollArea* controls_scrollarea = new QScrollArea(this);
    controls_scrollarea->setObjectName("expression_controls");
    controls_scrollarea->setMinimumHeight(200);
    controls_scrollarea->setWidgetResizable(true);
    controls_scrollarea->setWidget(controls);
    left_layout->addWidget(controls_scrollarea);

    // Clear button.
    QShortcut* clear_shortcut = new QShortcut(QKeySequence("Ctrl+N"), this);
    connect(clear_shortcut, SIGNAL(activated()), SLOT(slot_clear_expression()));
    QPushButton* clear_button = new QPushButton("Clear");
    clear_button->setToolTip(clear_shortcut->key().toString(QKeySequence::NativeText));
    connect(clear_button, SIGNAL(clicked()), SLOT(slot_clear_expression()));

    // Save button.
    QShortcut* save_shortcut = new QShortcut(QKeySequence("Ctrl+S"), this);
    connect(save_shortcut, SIGNAL(activated()), SLOT(slot_save_script()));
    QPushButton* save_button = new QPushButton("Save");
    save_button->setToolTip(save_shortcut->key().toString(QKeySequence::NativeText));
    connect(save_button, SIGNAL(clicked()), SLOT(slot_save_script()));

    // Load button.
    QShortcut* load_shortcut = new QShortcut(QKeySequence("Ctrl+O"), this);
    connect(load_shortcut, SIGNAL(activated()), SLOT(slot_load_script()));
    QPushButton* load_button = new QPushButton("Load");
    load_button->setToolTip(load_shortcut->key().toString(QKeySequence::NativeText));
    connect(load_button, SIGNAL(clicked()), SLOT(slot_load_script()));

    // Help button.
    QPushButton* help_button = new QPushButton("Help");
    connect(help_button, SIGNAL(clicked()), SLOT(slot_show_help()));

    // Examples button.
    QPushButton* examples_button = new QPushButton("Examples");
    connect(examples_button, SIGNAL(clicked()), SLOT(slot_show_examples()));

    QHBoxLayout* file_buttonbox = new QHBoxLayout();
    file_buttonbox->addWidget(clear_button);
    file_buttonbox->addWidget(load_button);
    file_buttonbox->addWidget(save_button);
    file_buttonbox->addWidget(help_button);
    file_buttonbox->addWidget(examples_button);
    left_layout->addLayout(file_buttonbox);

    m_editor = new SeExprEditor(this, controls);
    QTextEdit* text_edit = m_editor->findChild<QTextEdit*>("");
    text_edit->setObjectName("expression_editor");
    m_editor->setExpr(expression, true);
    left_layout->addWidget(m_editor);

    m_error = new QLabel("Expression has errors. Check log for details.");
    m_error->setObjectName("error");
    m_error->hide();
    left_layout->addWidget(m_error);

    // Expression browser.
    m_browser = new SeExprEdBrowser(nullptr, m_editor);
    const bf::path root_path(Application::get_root_path());
    const string scripts_path = (root_path / "seexpr").string();
    m_browser->addPath("Examples", scripts_path);
    m_browser->update();
    m_browser->hide();
    right_layout->addWidget(m_browser);

    m_ui->buttonbox_layout->addStretch(1);
    m_ui->buttonbox_layout->setStretch(0, 1);
    m_ui->buttonbox_layout->setStretch(1, 0);

    connect(m_ui->buttonbox, SIGNAL(accepted()), SLOT(slot_accept()));
    connect(m_ui->buttonbox, SIGNAL(rejected()), SLOT(slot_cancel()));

    connect(
        m_ui->buttonbox->button(QDialogButtonBox::Apply), SIGNAL(clicked()),
        SLOT(slot_apply()));

    connect(
        create_window_local_shortcut(this, Qt::Key_Escape), SIGNAL(activated()),
        SLOT(close()));

    WindowBase::load_settings();
}