PlotItemDialog::PlotItemDialog(PlotItem *item, QWidget *parent)
    : ViewItemDialog(item, parent), _plotItem(item), _defaultTagString("<Auto Name>") {

  Q_ASSERT(_plotItem);

  _store = kstApp->mainWindow()->document()->objectStore();

  setWindowTitle(tr("Edit Plot Item"));

  _contentTab = new ContentTab(this, _store);
  connect(_contentTab, SIGNAL(apply()), this, SLOT(contentChanged()));
  DialogPage *contentsPage = new DialogPage(this);
  contentsPage->setPageTitle(tr("Contents"));
  contentsPage->addDialogTab(_contentTab);
  addDialogPage(contentsPage, true);

  _labelTab = new LabelTab(_plotItem, this);
  _topLabelTab = new OverrideLabelTab(tr("Top Font"), this);
  _bottomLabelTab = new OverrideLabelTab(tr("Bottom Font"), this);
  _leftLabelTab = new OverrideLabelTab(tr("Left Font"), this);
  _rightLabelTab = new OverrideLabelTab(tr("Right Font"), this);
  _axisLabelTab = new OverrideLabelTab(tr("Axis Font"), this);

  _labelPage = new DialogPageTab(this);
  _labelPage->setPageTitle(tr("Labels"));
  _labelPage->addDialogTab(_labelTab);
  _labelPage->addDialogTab(_topLabelTab);
  _labelPage->addDialogTab(_bottomLabelTab);
  _labelPage->addDialogTab(_leftLabelTab);
  _labelPage->addDialogTab(_rightLabelTab);
  _labelPage->addDialogTab(_axisLabelTab);
  addDialogPage(_labelPage, true);

  connect(_labelTab, SIGNAL(apply()), this, SLOT(labelsChanged()));
  connect(_labelTab, SIGNAL(globalFontUpdate()), this, SLOT(globalFontUpdate()));

  connect(_topLabelTab, SIGNAL(useDefaultChanged(bool)), this, SLOT(useTopDefaultChanged(bool)));
  connect(_bottomLabelTab, SIGNAL(useDefaultChanged(bool)), this, SLOT(useBottomDefaultChanged(bool)));
  connect(_leftLabelTab, SIGNAL(useDefaultChanged(bool)), this, SLOT(useLeftDefaultChanged(bool)));
  connect(_rightLabelTab, SIGNAL(useDefaultChanged(bool)), this, SLOT(useRightDefaultChanged(bool)));
  connect(_axisLabelTab, SIGNAL(useDefaultChanged(bool)), this, SLOT(useAxisDefaultChanged(bool)));

  _rangeTab = new RangeTab(_plotItem, this);
  DialogPage *rangePage = new DialogPage(this);
  rangePage->setPageTitle(tr("Range/Zoom"));
  rangePage->addDialogTab(_rangeTab);
  addDialogPage(rangePage, true);
  connect(_rangeTab, SIGNAL(apply()), this, SLOT(rangeChanged()));

  _xAxisTab = new AxisTab(this);
  _xAxisPage = new DialogPage(this);
  _xAxisPage->setPageTitle(tr("X-Axis"));
  _xAxisPage->addDialogTab(_xAxisTab);
  addDialogPage(_xAxisPage, true);
  connect(_xAxisTab, SIGNAL(apply()), this, SLOT(xAxisChanged()));

  _yAxisTab = new AxisTab(this);
  _yAxisTab->setAsYAxis();
  _yAxisPage = new DialogPage(this);
  _yAxisPage->setPageTitle(tr("Y-Axis"));
  _yAxisPage->addDialogTab(_yAxisTab);
  addDialogPage(_yAxisPage, true);
  connect(_yAxisTab, SIGNAL(apply()), this, SLOT(yAxisChanged()));

  _xMarkersTab = new MarkersTab(this);
  DialogPage *xMarkersPage = new DialogPage(this);
  xMarkersPage->setPageTitle(tr("X-Axis Markers"));
  xMarkersPage->addDialogTab(_xMarkersTab);
  addDialogPage(xMarkersPage, true);
  _xMarkersTab->setObjectStore(_store);
  connect(_xMarkersTab, SIGNAL(apply()), this, SLOT(xAxisPlotMarkersChanged()));

  _yMarkersTab = new MarkersTab(this);
  DialogPage *yMarkersPage = new DialogPage(this);
  yMarkersPage->setPageTitle(tr("Y-Axis Markers"));
  yMarkersPage->addDialogTab(_yMarkersTab);
  addDialogPage(yMarkersPage, true);
  _yMarkersTab->setObjectStore(_store);
  connect(yMarkersPage, SIGNAL(apply()), this, SLOT(yAxisPlotMarkersChanged()));

  // addRelations(); This tends to clutter the plot dialog, let's test skipping it

  setupContent();
  setupAxis();
  setupRange();
  setupLabels();
  setupMarkers();

  setSupportsMultipleEdit(true);

  if (_plotItem->descriptiveNameIsManual()) {
    setTagString(_plotItem->descriptiveName());
  } else {
    setTagString(_defaultTagString);
  }

  QList<PlotItem*> list = ViewItem::getItems<PlotItem>();
  clearMultipleEditOptions();
  foreach(PlotItem* plot, list) {
    addMultipleEditOption(plot->plotName(), plot->descriptionTip(), plot->shortName());
  }
void WebBrowserGui::loadFinished()
{
    setWindowTitle(ui->webView->title());
}
Esempio n. 3
0
QxCommandEditor::QxCommandEditor(QWidget* parent)
	: QxDialog(parent),
	  iconSelector_(new QxIconSelector(parent)),
	  command_(0)
{
	setWindowTitle(qApp->applicationName() + tr("- Edit Command"));
	
	QVBoxLayout* col = new QVBoxLayout;
	{
		QFormLayout* form = new QFormLayout;
		form->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
		{
			icon_ = new QToolButton(this);
			icon_->setText("...");
			icon_->setIconSize(QSize(24, 24));
			iconReset_ = new QToolButton(this);
			iconReset_->setText(tr("Reset"));
			connect(icon_, SIGNAL(clicked()), this, SLOT(loadIcon()));
			connect(iconReset_, SIGNAL(clicked()), this, SLOT(resetIcon()));
		
			QHBoxLayout* row = new QHBoxLayout;
			row->addWidget(icon_);
			row->addWidget(iconReset_);
			row->addStretch();
			form->addRow(tr("Icon"), row);
		}
		{
			noDescription_ = tr("<optional text>");
			description_ = new QLineEdit(this);
			description_->setText(noDescription_);
			form->addRow(tr("Description"), description_);
		}
		{
			modifier_ = new QComboBox(this);
			modifier_->addItem(tr("None"));
			modifier_->addItem(tr("Alt"), Qt::Key_Alt);
			modifier_->addItem(tr("Control"), Qt::Key_Control);
			modifier_->addItem(tr("Meta"), Qt::Key_Meta);
			keyGroup_ = new QComboBox(this);
			keyGroup_->addItem(tr("F1-F12"));
			keyGroup_->addItem(tr("0-9"));
			key_ = new QComboBox(this);
			connect(keyGroup_, SIGNAL(currentIndexChanged(int)), this, SLOT(updateKey(int)));
			updateKey(0);
			
			QHBoxLayout* row = new QHBoxLayout;
			row->addWidget(modifier_);
			row->addWidget(keyGroup_);
			row->addWidget(key_);
			row->addStretch();
			form->addRow(tr("Short key"), row);
		}
		{
			scriptLabel_ = new QLabel(tr("Script"), this);
			target_ = new QComboBox(this);
			target_->addItem(tr("Paste into current terminal"), QxCommand::ActiveTerminal);
			target_->addItem(tr("Paste into new terminal"), QxCommand::NewTerminal);
			// target_->addItem(tr("Paste into editor"), QxCommand::TextEditor);
			target_->addItem(tr("Open by default application"), QxCommand::WebBrowser);
			connect(target_, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTarget(int)));
			QHBoxLayout* row = new QHBoxLayout;
			row->addWidget(target_);
			row->addStretch();
			form->addRow(scriptLabel_, row);
		}
		{
			autoSaveFile_ = new QCheckBox(tr("Automatically save current file"), this);
			autoOpenNextLink_ = new QCheckBox(tr("Automatically open next link"), this);
			QVBoxLayout* col = new QVBoxLayout();
			col->addWidget(autoSaveFile_);
			col->addWidget(autoOpenNextLink_);
			form->addRow(tr("Options"), col);
		}
		col->addLayout(form);
	}
	{
		QFrame* frame = new QFrame(this);
		frame->setFrameStyle(QFrame::Sunken|QFrame::StyledPanel);
		
		script_ = new EditWidget(frame);
		script_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
		
		QHBoxLayout* cell = new QHBoxLayout;
		cell->setSpacing(0);
		cell->setMargin(0);
		cell->addWidget(script_);
		frame->setLayout(cell);
		
		QMenu* editMenu = script_->edit()->contextMenu();
		editMenu->addSeparator();
		QMenu* substMenu = editMenu->addMenu(tr("Insert $SUBST"));
		const char* substNames[] = {
			"$DIRPATH", "$DIRNAME",
			"$FILEPATH", "$FILENAME", "$FILEID", "$FILEEXT",
			"$TEXT", "$WORD", "$CURSOR_LINE", "$CURSOR_COLUMN", "$OFFSET"
		};
		for (int i = 0, n = sizeof(substNames) / sizeof(const char*); i < n; ++i)
			substMenu->addAction(substNames[i]);
		connect(substMenu, SIGNAL(triggered(QAction*)), this, SLOT(substTriggered(QAction*)));
		
		col->addWidget(frame);
	}
	{
		QDialogButtonBox* box = new QDialogButtonBox(
			QDialogButtonBox::Ok | QDialogButtonBox::Cancel
		);
		connect(box, SIGNAL(accepted()), this, SLOT(accept()));
		connect(box, SIGNAL(rejected()), this, SLOT(reject()));
		col->addWidget(box);
	}
	setLayout(col);
	
	// design HACK
	resize(parent->size() * 1.2);
	
	connect(this, SIGNAL(accepted()), this, SLOT(updateCommand()));
}
PProgressDialog::PProgressDialog( const QString & title , QDialog *parent )
    : QDialog(parent)
{
  setWindowTitle( title );
  createProgressDialog();
}
Esempio n. 5
0
// Dialog setup loader.
void patchesDialog::setup ( fluid_synth_t * pSynth, int iChan,
                            const QString & _chanName,
                            LcdSpinBoxModel * _bankModel,
                            LcdSpinBoxModel * _progModel,
                            QLabel * _patchLabel )
{

    // We'll going to changes the whole thing...
    m_dirty = 0;
    m_bankModel = _bankModel;
    m_progModel = _progModel;
    m_patchLabel =  _patchLabel;

    // Set the proper caption...
    setWindowTitle( _chanName + " - Soundfont patches" );

    // set m_pSynth to NULL so we don't trigger any progChanged events
    m_pSynth = NULL;

    // Load bank list from actual synth stack...
    m_bankListView->setSortingEnabled(false);
    m_bankListView->clear();

    // now it should be safe to set internal stuff
    m_pSynth = pSynth;
    m_iChan  = iChan;


    fluid_preset_t preset;
    QTreeWidgetItem *pBankItem = NULL;
    // For all soundfonts (in reversed stack order) fill the available banks...
    int cSoundFonts = ::fluid_synth_sfcount(m_pSynth);
    for (int i = 0; i < cSoundFonts; i++) {
        fluid_sfont_t *pSoundFont = ::fluid_synth_get_sfont(m_pSynth, i);
        if (pSoundFont) {
#ifdef CONFIG_FLUID_BANK_OFFSET
            int iBankOffset = ::fluid_synth_get_bank_offset(m_pSynth, pSoundFont->id);
#endif
            pSoundFont->iteration_start(pSoundFont);
            while (pSoundFont->iteration_next(pSoundFont, &preset)) {
                int iBank = preset.get_banknum(&preset);
#ifdef CONFIG_FLUID_BANK_OFFSET
                iBank += iBankOffset;
#endif
                if (!findBankItem(iBank)) {
                    pBankItem = new patchItem(m_bankListView, pBankItem);
                    if (pBankItem)
                        pBankItem->setText(0, QString::number(iBank));
                }
            }
        }
    }
    m_bankListView->setSortingEnabled(true);

    // Set the selected bank.
    m_iBank = 0;
    fluid_preset_t *pPreset = ::fluid_synth_get_channel_preset(m_pSynth, m_iChan);
    if (pPreset) {
        m_iBank = pPreset->get_banknum(pPreset);
#ifdef CONFIG_FLUID_BANK_OFFSET
        m_iBank += ::fluid_synth_get_bank_offset(m_pSynth, (pPreset->sfont)->id);
#endif
    }

    pBankItem = findBankItem(m_iBank);
    m_bankListView->setCurrentItem(pBankItem);
    m_bankListView->scrollToItem(pBankItem);
    bankChanged();

    // Set the selected program.
    if (pPreset)
        m_iProg = pPreset->get_num(pPreset);
    QTreeWidgetItem *pProgItem = findProgItem(m_iProg);
    m_progListView->setCurrentItem(pProgItem);
    m_progListView->scrollToItem(pProgItem);

    // Done with setup...
    //m_iDirtySetup--;
}
//! [5]
void MainWindow::insertCalendar()
{
    editor->clear();
    QTextCursor cursor = editor->textCursor();
    cursor.beginEditBlock();

    QDate date(selectedDate.year(), selectedDate.month(), 1);
//! [5]

//! [6]
    QTextTableFormat tableFormat;
    tableFormat.setAlignment(Qt::AlignHCenter);
    tableFormat.setBackground(QColor("#e0e0e0"));
    tableFormat.setCellPadding(2);
    tableFormat.setCellSpacing(4);
//! [6] //! [7]
    QVector<QTextLength> constraints;
    constraints << QTextLength(QTextLength::PercentageLength, 14)
                << QTextLength(QTextLength::PercentageLength, 14)
                << QTextLength(QTextLength::PercentageLength, 14)
                << QTextLength(QTextLength::PercentageLength, 14)
                << QTextLength(QTextLength::PercentageLength, 14)
                << QTextLength(QTextLength::PercentageLength, 14)
                << QTextLength(QTextLength::PercentageLength, 14);
    tableFormat.setColumnWidthConstraints(constraints);
//! [7]

//! [8]
    QTextTable *table = cursor.insertTable(1, 7, tableFormat);
//! [8]

//! [9]
    QTextFrame *frame = cursor.currentFrame();
    QTextFrameFormat frameFormat = frame->frameFormat();
    frameFormat.setBorder(1);
    frame->setFrameFormat(frameFormat);
//! [9]

//! [10]
    QTextCharFormat format = cursor.charFormat();
    format.setFontPointSize(fontSize);

    QTextCharFormat boldFormat = format;
    boldFormat.setFontWeight(QFont::Bold);

    QTextCharFormat highlightedFormat = boldFormat;
    highlightedFormat.setBackground(Qt::yellow);
//! [10]

//! [11]
    for (int weekDay = 1; weekDay <= 7; ++weekDay) {
        QTextTableCell cell = table->cellAt(0, weekDay-1);
//! [11] //! [12]
        QTextCursor cellCursor = cell.firstCursorPosition();
        cellCursor.insertText(QString("%1").arg(QDate::longDayName(weekDay)),
                              boldFormat);
    }
//! [12]

//! [13]
    table->insertRows(table->rows(), 1);
//! [13]

    while (date.month() == selectedDate.month()) {
        int weekDay = date.dayOfWeek();
        QTextTableCell cell = table->cellAt(table->rows()-1, weekDay-1);
        QTextCursor cellCursor = cell.firstCursorPosition();

        if (date == QDate::currentDate())
            cellCursor.insertText(QString("%1").arg(date.day()), highlightedFormat);
        else
            cellCursor.insertText(QString("%1").arg(date.day()), format);

        date = date.addDays(1);
        if (weekDay == 7 && date.month() == selectedDate.month())
            table->insertRows(table->rows(), 1);
    }

    cursor.endEditBlock();
//! [14]
    setWindowTitle(tr("Calendar for %1 %2"
        ).arg(QDate::longMonthName(selectedDate.month())
        ).arg(selectedDate.year()));
}
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 = nullptr;
	}

	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);
}
Esempio n. 8
0
MainWindow::MainWindow(QWidget *parent) :
    ParentWindow(parent),
    m_page(0),
    m_webView(new QWebView),
#ifndef MEEGO_EDITION_HARMATTAN
    m_actionMinimizeToTray(new QAction(i18n("&Minimize to Tray"), this)),
#endif
    m_inspector(0),
    m_fontDB(),
    m_signIn(false),
    m_firstLoad(true)
{
#ifdef Q_OS_UNIX
    chdir(PREFIX);
#endif
    setWindowTitle(i18n("Hotot"));
    setWindowIcon(QIcon::fromTheme("hotot_qt", QIcon("share/hotot/image/ic64_hotot.png")));
    qApp->setWindowIcon(QIcon::fromTheme("hotot_qt", QIcon("share/hotot/image/ic64_hotot.png")));
#ifndef MEEGO_EDITION_HARMATTAN
    this->resize(QSize(640, 480));
    this->setCentralWidget(m_webView);
    this->setMinimumSize(QSize(400, 400));
#else
    MApplicationPage* page = new MApplicationPage;
    page->setCentralWidget(m_webView);
    page->setComponentsDisplayMode(MApplicationPage::AllComponents,
                                           MApplicationPageModel::Hide);
    page->setAutoMarginsForComponentsEnabled(false);
    page->resize(page->exposedContentRect().size());
    page->appear(this, MSceneWindow::DestroyWhenDone);
    page->setPannable(false);
#endif

    m_menu = new QMenu(this);

    m_actionCompose = new QAction(QIcon(), i18n("&Compose"), this);
    connect(m_actionCompose, SIGNAL(triggered()), this, SLOT(compose()));
    m_menu->addAction(m_actionCompose);
    m_actionCompose->setVisible(false);
#ifndef MEEGO_EDITION_HARMATTAN
    QSettings settings("hotot-qt", "hotot");
    m_actionMinimizeToTray->setCheckable(true);
    m_actionMinimizeToTray->setChecked(settings.value("minimizeToTray", false).toBool());
    connect(m_actionMinimizeToTray, SIGNAL(toggled(bool)), this, SLOT(toggleMinimizeToTray(bool)));
    m_menu->addAction(m_actionMinimizeToTray);
#endif
    m_actionShow = new QAction(QIcon(), i18n("Show &MainWindow"), this);
    connect(m_actionShow, SIGNAL(triggered()), this, SLOT(show()));
    m_menu->addAction(m_actionShow);

    m_actionExit = new QAction(QIcon::fromTheme("application-exit"), i18n("&Exit"), this);
    m_actionExit->setShortcut(QKeySequence::Quit);
    connect(m_actionExit, SIGNAL(triggered()), this, SLOT(exit()));
    m_menu->addAction(m_actionExit);

    m_actionDev = new QAction(QIcon::fromTheme("configure"), i18n("&Developer Tool"), this);
    connect(m_actionDev, SIGNAL(triggered()), this, SLOT(showDeveloperTool()));

#ifdef HAVE_KDE
    m_tray = new KDETrayBackend(this);
#else
    m_tray = new QtTrayBackend(this);
#endif

    m_tray->setContextMenu(m_menu);
#ifndef MEEGO_EDITION_HARMATTAN
    addAction(m_actionExit);
#endif

    m_page = new HototWebPage(this);
#ifdef HAVE_KDE
    m_page->setNetworkAccessManager(new KIO::Integration::AccessManager(m_page));
#endif

#ifdef Q_OS_UNIX
    QDir dir(QDir::homePath().append("/.config/hotot-qt"));
#else
    QDir dir(QDesktopServices::storageLocation(QDesktopServices::DataLocation).append("/Hotot"));
#endif

    if (!dir.exists())
        dir.mkpath(".");

    m_confDir = dir.absolutePath();

    QWebSettings::setOfflineStoragePath(dir.absolutePath());
    QWebSettings::setOfflineStorageDefaultQuota(15 * 1024 * 1024);

    m_webView->setPage(m_page);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, true);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::JavascriptEnabled, true);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::AcceleratedCompositingEnabled, true);


    m_inspector = new QWebInspector;
    m_inspector->setPage(m_page);

#ifdef MEEGO_EDITION_HARMATTAN
    connect(page, SIGNAL(exposedContentRectChanged()), this, SLOT(contentSizeChanged()));
    m_page->setPreferredContentsSize(page->exposedContentRect().size().toSize());
    m_webView->setResizesToContents(true);
#endif

#ifdef Q_OS_UNIX
    m_webView->load(QUrl("file://" PREFIX "/share/hotot/index.html"));
#else
    QFileInfo f("share/hotot/index.html");
    m_webView->load(QUrl::fromLocalFile(f.absoluteFilePath()));
#endif
    connect(m_webView, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
    connect(m_page, SIGNAL(linkHovered(QString, QString, QString)), this, SLOT(onLinkHovered(QString, QString, QString)));
}
ImportASCIIDialog::ImportASCIIDialog(bool new_windows_only, QWidget * parent, bool extended, Qt::WFlags flags )
: ExtensibleFileDialog(parent, extended, flags )
{
	setWindowTitle(tr("QtiPlot - Import ASCII File(s)"));
	setFileMode( QFileDialog::ExistingFiles );

	d_current_path = QString::null;

	initAdvancedOptions();
	setNewWindowsOnly(new_windows_only);
	setExtensionWidget(d_advanced_options);

	// get rembered option values
	ApplicationWindow *app = (ApplicationWindow *)parent;
	setLocale(app->locale());

	d_strip_spaces->setChecked(app->strip_spaces);
	d_simplify_spaces->setChecked(app->simplify_spaces);
	d_ignored_lines->setValue(app->ignoredLines);
	d_rename_columns->setChecked(app->renameColumns);
	setColumnSeparator(app->columnSeparator);
    d_comment_string->setText(app->d_ASCII_comment_string);
    d_import_comments->setChecked(app->d_ASCII_import_comments);
    d_first_line_role->setCurrentIndex(app->d_ASCII_import_first_row_role);
    d_read_only->setChecked(app->d_ASCII_import_read_only);

	if (app->d_ASCII_import_locale.name() == QLocale::c().name())
        boxDecimalSeparator->setCurrentIndex(1);
    else if (app->d_ASCII_import_locale.name() == QLocale(QLocale::German).name())
        boxDecimalSeparator->setCurrentIndex(2);
    else if (app->d_ASCII_import_locale.name() == QLocale(QLocale::French).name())
        boxDecimalSeparator->setCurrentIndex(3);

	QLocale::NumberOptions groupSep = app->d_ASCII_import_locale.numberOptions();
	d_omit_thousands_sep->setChecked(groupSep & QLocale::OmitGroupSeparator);

	connect(d_import_mode, SIGNAL(currentIndexChanged(int)), this, SLOT(updateImportMode(int)));
	if (app->d_ASCII_import_mode < d_import_mode->count())
		d_import_mode->setCurrentIndex(app->d_ASCII_import_mode);

	d_preview_lines_box->setValue(app->d_preview_lines);
	d_preview_button->setChecked(app->d_ASCII_import_preview);

    boxEndLine->setCurrentIndex((int)app->d_ASCII_end_line);

	if (!app->d_ASCII_import_preview)
		d_preview_stack->hide();

	initPreview(d_import_mode->currentIndex());

    connect(d_preview_lines_box, SIGNAL(valueChanged(int)), this, SLOT(preview()));
    connect(d_rename_columns, SIGNAL(clicked()), this, SLOT(preview()));
    connect(d_import_comments, SIGNAL(clicked()), this, SLOT(preview()));
    connect(d_strip_spaces, SIGNAL(clicked()), this, SLOT(preview()));
    connect(d_simplify_spaces, SIGNAL(clicked()), this, SLOT(preview()));
    connect(d_ignored_lines, SIGNAL(valueChanged(int)), this, SLOT(preview()));
    connect(d_omit_thousands_sep, SIGNAL(clicked()), this, SLOT(preview()));
    connect(d_column_separator, SIGNAL(currentIndexChanged(int)), this, SLOT(preview()));
    connect(boxDecimalSeparator, SIGNAL(currentIndexChanged(int)), this, SLOT(preview()));
    connect(d_comment_string, SIGNAL(textChanged(const QString&)), this, SLOT(preview()));
    connect(this, SIGNAL(currentChanged(const QString&)), this, SLOT(changePreviewFile(const QString&)));
}
Esempio n. 10
0
ConfigDialog::ConfigDialog(QDir _home, Zones *_zones, Context *context) :
    home(_home), zones(_zones), context(context)
{
    setAttribute(Qt::WA_DeleteOnClose);

#ifdef Q_OS_MAC
    QToolBar *head = addToolBar(tr("Preferences"));
    setMinimumSize(600,540);
    setUnifiedTitleAndToolBarOnMac(true);
    head->setFloatable(false);
    head->setMovable(false);
#else
    QToolBar *head = addToolBar(tr("Options"));
    head->setMovable(false); // oops!

    QFont defaultFont;
    setMinimumSize(60 * defaultFont.pointSize(),580);   //Change for 53 to 60 - To be decided if also Size for Q_OS_MAC need change
#endif

    // center
    QWidget *spacer = new QWidget(this);
    spacer->setAutoFillBackground(false);
    spacer->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
    head->addWidget(spacer);

    // icons
    static QIcon generalIcon(QPixmap(":images/toolbar/GeneralPreferences.png"));
    static QIcon athleteIcon(QPixmap(":/images/toolbar/user.png"));
    static QIcon passwordIcon(QPixmap(":/images/toolbar/passwords.png"));
    static QIcon appearanceIcon(QPixmap(":/images/toolbar/color.png"));
    static QIcon dataIcon(QPixmap(":/images/toolbar/data.png"));
    static QIcon metricsIcon(QPixmap(":/images/toolbar/abacus.png"));
    static QIcon devicesIcon(QPixmap(":/images/devices/kickr.png"));

    // Setup the signal mapping so the right config
    // widget is displayed when the icon is clicked
    QSignalMapper *iconMapper = new QSignalMapper(this); // maps each option
    connect(iconMapper, SIGNAL(mapped(int)), this, SLOT(changePage(int)));
    head->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);

    QAction *added;

    // General settings
    added = head->addAction(generalIcon, tr("General"));
    connect(added, SIGNAL(triggered()), iconMapper, SLOT(map()));
    iconMapper->setMapping(added, 0);

    added =head->addAction(athleteIcon, tr("Athlete"));
    connect(added, SIGNAL(triggered()), iconMapper, SLOT(map()));
    iconMapper->setMapping(added, 1);

    added =head->addAction(passwordIcon, tr("Passwords"));
    connect(added, SIGNAL(triggered()), iconMapper, SLOT(map()));
    iconMapper->setMapping(added, 2);

    added =head->addAction(appearanceIcon, tr("Appearance"));
    connect(added, SIGNAL(triggered()), iconMapper, SLOT(map()));
    iconMapper->setMapping(added, 3);

    added =head->addAction(dataIcon, tr("Data Fields"));
    connect(added, SIGNAL(triggered()), iconMapper, SLOT(map()));
    iconMapper->setMapping(added, 4);

    added =head->addAction(metricsIcon, tr("Metrics"));
    connect(added, SIGNAL(triggered()), iconMapper, SLOT(map()));
    iconMapper->setMapping(added, 5);

    added =head->addAction(devicesIcon, tr("Train Devices"));
    connect(added, SIGNAL(triggered()), iconMapper, SLOT(map()));
    iconMapper->setMapping(added, 6);

    // more space
    spacer = new QWidget(this);
    spacer->setAutoFillBackground(false);
    spacer->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
    head->addWidget(spacer);


    pagesWidget = new QStackedWidget(this);

    // create those config pages
    general = new GeneralConfig(_home, _zones, context);
    pagesWidget->addWidget(general);

    athlete = new AthleteConfig(_home, _zones, context);
    pagesWidget->addWidget(athlete);

    password = new PasswordConfig(_home, _zones, context);
    pagesWidget->addWidget(password);

    appearance = new AppearanceConfig(_home, _zones, context);
    pagesWidget->addWidget(appearance);

    data = new DataConfig(_home, _zones, context);
    pagesWidget->addWidget(data);

    metric = new MetricConfig(_home, _zones, context);
    pagesWidget->addWidget(metric);

    device = new DeviceConfig(_home, _zones, context);
    pagesWidget->addWidget(device);


    closeButton = new QPushButton(tr("Close"));
    saveButton = new QPushButton(tr("Save"));

    QHBoxLayout *horizontalLayout = new QHBoxLayout;
    horizontalLayout->addWidget(pagesWidget, 1);

    QHBoxLayout *buttonsLayout = new QHBoxLayout;
    buttonsLayout->addStretch();
    buttonsLayout->setSpacing(5);
    buttonsLayout->addWidget(closeButton);
    buttonsLayout->addWidget(saveButton);

    QWidget *contents = new QWidget(this);
    setCentralWidget(contents);
    contents->setContentsMargins(0,0,0,0);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addLayout(horizontalLayout);
    mainLayout->addStretch();
    mainLayout->addLayout(buttonsLayout);
    mainLayout->setSpacing(0);
    contents->setLayout(mainLayout);

    // We go fixed width to ensure a consistent layout for
    // tabs, sub-tabs and internal widgets and lists
#ifdef Q_OS_MACX
    setWindowTitle(tr("Preferences"));
#else
    setWindowTitle(tr("Options"));
#endif

    connect(closeButton, SIGNAL(clicked()), this, SLOT(closeClicked()));
    connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
}
Esempio n. 11
0
 GraphicsView()
 {
     setWindowTitle(tr("Boxes"));
     setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
     //setRenderHints(QPainter::SmoothPixmapTransform);
 }
Esempio n. 12
0
AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstStart)
    :
    QMessageBox(parent),
    m_settings(settings),
    m_disque(NULL),
    m_disqueTimer(NULL),
    m_rotateNext(false),
    m_disqueDelay(_I64_MAX)
{
    const QString versionStr = QString().sprintf
                               (
                                   "Version %d.%02d %s, Build %d [%s], %s %s, Qt v%s",
                                   lamexp_version_major(),
                                   lamexp_version_minor(),
                                   lamexp_version_release(),
                                   lamexp_version_build(),
                                   lamexp_version_date().toString(Qt::ISODate).toLatin1().constData(),
                                   lamexp_version_compiler(),
                                   lamexp_version_arch(),
                                   qVersion()
                               );
    const QString copyrightStr = QString().sprintf
                                 (
                                     "Copyright (C) 2004-%04d LoRd_MuldeR &lt;[email protected]&gt;. Some rights reserved.",
                                     qMax(lamexp_version_date().year(), QDate::currentDate().year())
                                 );

    for(int i = 0; i < 4; i++)
    {
        m_cartoon[i] = NULL;
    }

    QString aboutText;

    aboutText += QString("<h2>%1</h2>").arg(NOBR(tr("LameXP - Audio Encoder Front-end")));
    aboutText += QString("<b>%1</b><br>").arg(NOBR(copyrightStr));
    aboutText += QString("<b>%1</b><br><br>").arg(NOBR(versionStr));
    aboutText += QString("%1<br>").arg(NOBR(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url()))));

    if(LAMEXP_DEBUG)
    {
        int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
        aboutText += QString("<hr><font color=\"crimson\">%1</font>").arg(NOBR(QString("!!! --- DEBUG BUILD --- Expires at: %1 &middot; Days left: %2 --- DEBUG BUILD --- !!!").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft))));
    }
    else if(lamexp_version_demo())
    {
        int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
        aboutText += QString("<hr><font color=\"crimson\">%1</font>").arg(NOBR(tr("Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left.").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft))));
    }

    aboutText += "<hr><br>";
    aboutText += "<nobr><tt>This program is free software; you can redistribute it and/or<br>";
    aboutText += "modify it under the terms of the GNU General Public License<br>";
    aboutText += "as published by the Free Software Foundation; either version 2<br>";
    aboutText += "of the License, or (at your option) any later version.<br><br>";
    aboutText += "This program is distributed in the hope that it will be useful,<br>";
    aboutText += "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>";
    aboutText += "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>";
    aboutText += "GNU General Public License for more details.<br><br>";
    aboutText += "You should have received a copy of the GNU General Public License<br>";
    aboutText += "along with this program; if not, write to the Free Software<br>";
    aboutText += "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110&minus;1301, USA.</tt></nobr><br>";
    aboutText += "<hr><table><tr>";
    aboutText += "<td valign=\"middle\"><img src=\":/icons/error_big.png\"</td><td>&nbsp;</td>";
    aboutText += QString("<td><font color=\"darkred\">%1</font></td>").arg(tr("Note: LameXP is free software. Do <b>not</b> pay money to obtain or use LameXP! If some third-party website tries to make you pay for downloading LameXP, you should <b>not</b> respond to the offer !!!"));
    aboutText += "</tr></table><hr><br>";
    aboutText += QString("%1<br>").arg(NOBR(tr("Special thanks go out to \"John33\" from %1 for his continuous support.")).arg(LINK("http://www.rarewares.org/")));

    setText(aboutText);
    setIconPixmap(dynamic_cast<QApplication*>(QApplication::instance())->windowIcon().pixmap(QSize(64,64)));
    setWindowTitle(tr("About LameXP"));

    if(firstStart)
    {
        QPushButton *firstButton = addButton(tr("Show License Text"), QMessageBox::AcceptRole);
        firstButton->setIcon(QIcon(":/icons/script.png"));
        firstButton->setIconSize(QSize(16, 16));
        firstButton->setMinimumWidth(135);
        firstButton->disconnect();
        connect(firstButton, SIGNAL(clicked()), this, SLOT(openLicenseText()));

        QPushButton *secondButton = addButton(tr("Accept License"), QMessageBox::AcceptRole);
        secondButton->setIcon(QIcon(":/icons/accept.png"));
        secondButton->setIconSize(QSize(16, 16));
        secondButton->setMinimumWidth(120);

        QPushButton *thirdButton = addButton(tr("Decline License"), QMessageBox::AcceptRole);
        thirdButton->setIcon(QIcon(":/icons/delete.png"));
        thirdButton->setIconSize(QSize(16, 16));
        thirdButton->setMinimumWidth(120);
        thirdButton->setEnabled(false);
    }
    else
    {
        QPushButton *firstButton = addButton(tr("3rd Party S/W"), QMessageBox::AcceptRole);
        firstButton->setIcon(QIcon(":/icons/page_white_cplusplus.png"));
        firstButton->setIconSize(QSize(16, 16));
        firstButton->setMinimumWidth(120);
        firstButton->disconnect();
        connect(firstButton, SIGNAL(clicked()), this, SLOT(showMoreAbout()));

        QPushButton *secondButton = addButton(tr("Contributors"), QMessageBox::AcceptRole);
        secondButton->setIcon(QIcon(":icons/user_suit.png"));
        secondButton->setIconSize(QSize(16, 16));
        secondButton->setMinimumWidth(120);
        secondButton->disconnect();
        connect(secondButton, SIGNAL(clicked()), this, SLOT(showAboutContributors()));

        QPushButton *thirdButton = addButton(tr("About Qt4"), QMessageBox::AcceptRole);
        thirdButton->setIcon(QIcon(":/images/Qt.svg"));
        thirdButton->setIconSize(QSize(16, 16));
        thirdButton->setMinimumWidth(120);
        thirdButton->disconnect();
        connect(thirdButton, SIGNAL(clicked()), this, SLOT(showAboutQt()));

        QPushButton *fourthButton = addButton(tr("Discard"), QMessageBox::AcceptRole);
        fourthButton->setIcon(QIcon(":/icons/cross.png"));
        fourthButton->setIconSize(QSize(16, 16));
        fourthButton->setMinimumWidth(90);

        QPixmap disque(":/images/Disque.png");
        QRect screenGeometry = QApplication::desktop()->availableGeometry();
        m_disque = new QLabel(this, Qt::Window | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
        m_disque->installEventFilter(this);
        m_disque->setStyleSheet("background:transparent;");
        m_disque->setAttribute(Qt::WA_TranslucentBackground);
        m_disque->setGeometry(qrand() % (screenGeometry.width() - disque.width()), qrand() % (screenGeometry.height() - disque.height()), disque.width(), disque.height());
        m_disque->setPixmap(disque);
        m_disque->setWindowOpacity(0.01);
        m_disque->show();
        m_disqueFlags[0] = (qrand() > (RAND_MAX/2));
        m_disqueFlags[1] = (qrand() > (RAND_MAX/2));
        m_disqueTimer = new QTimer;
        connect(m_disqueTimer, SIGNAL(timeout()), this, SLOT(moveDisque()));
        m_disqueTimer->setInterval(10);
        m_disqueTimer->start();
    }

    m_firstShow = firstStart;
}
Esempio n. 13
0
BlockingClient::BlockingClient(QWidget *parent)
    : QDialog(parent)
{
    hostLabel = new QLabel(tr("&Server name:"));
    portLabel = new QLabel(tr("S&erver port:"));

    // find out which IP to connect to
    QString ipAddress;
    QList<QHostAddress> ipAddressesList = QNetworkInterface::allAddresses();
    // use the first non-localhost IPv4 address
    for (int i = 0; i < ipAddressesList.size(); ++i) {
        if (ipAddressesList.at(i) != QHostAddress::LocalHost &&
            ipAddressesList.at(i).toIPv4Address()) {
            ipAddress = ipAddressesList.at(i).toString();
            break;
        }
    }
    // if we did not find one, use IPv4 localhost
    if (ipAddress.isEmpty())
        ipAddress = QHostAddress(QHostAddress::LocalHost).toString();

    hostLineEdit = new QLineEdit(ipAddress);
    portLineEdit = new QLineEdit;
    portLineEdit->setValidator(new QIntValidator(1, 65535, this));

    hostLabel->setBuddy(hostLineEdit);
    portLabel->setBuddy(portLineEdit);

    statusLabel = new QLabel(tr("This examples requires that you run the "
                                "Fortune Server example as well."));

    getFortuneButton = new QPushButton(tr("Get Fortune"));
    getFortuneButton->setDefault(true);
    getFortuneButton->setEnabled(false);

    quitButton = new QPushButton(tr("Quit"));

    buttonBox = new QDialogButtonBox;
    buttonBox->addButton(getFortuneButton, QDialogButtonBox::ActionRole);
    buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);

    connect(hostLineEdit, SIGNAL(textChanged(QString)),
            this, SLOT(enableGetFortuneButton()));
    connect(portLineEdit, SIGNAL(textChanged(QString)),
            this, SLOT(enableGetFortuneButton()));
    connect(getFortuneButton, SIGNAL(clicked()),
            this, SLOT(requestNewFortune()));
    connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
//! [0]
    connect(&thread, SIGNAL(newFortune(QString)),
            this, SLOT(showFortune(QString)));
//! [0] //! [1]
    connect(&thread, SIGNAL(error(int,QString)),
            this, SLOT(displayError(int,QString)));
//! [1]

    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(hostLabel, 0, 0);
    mainLayout->addWidget(hostLineEdit, 0, 1);
    mainLayout->addWidget(portLabel, 1, 0);
    mainLayout->addWidget(portLineEdit, 1, 1);
    mainLayout->addWidget(statusLabel, 2, 0, 1, 2);
    mainLayout->addWidget(buttonBox, 3, 0, 1, 2);
    setLayout(mainLayout);

    setWindowTitle(tr("Blocking Fortune Client"));
    portLineEdit->setFocus();
}
Esempio n. 14
0
AddressBook::AddressBook(QWidget *parent)
    : QWidget(parent)
{
    QLabel *nameLabel = new QLabel(tr("Name:"));
    nameLine = new QLineEdit;
    nameLine->setReadOnly(true);

    QLabel *addressLabel = new QLabel(tr("Address:"));
    addressText = new QTextEdit;
    addressText->setReadOnly(true);

    addButton = new QPushButton(tr("&Add"));

    editButton = new QPushButton(tr("&Edit"));
    editButton->setEnabled(false);
    removeButton = new QPushButton(tr("&Remove"));
    removeButton->setEnabled(false);
//! [instantiating findButton]
    findButton = new QPushButton(tr("&Find"));
    findButton->setEnabled(false);
//! [instantiating findButton]
    submitButton = new QPushButton(tr("&Submit"));
    submitButton->hide();
    cancelButton = new QPushButton(tr("&Cancel"));
    cancelButton->hide();

    nextButton = new QPushButton(tr("&Next"));
    nextButton->setEnabled(false);
    previousButton = new QPushButton(tr("&Previous"));
    previousButton->setEnabled(false);

//! [instantiating FindDialog]
    dialog = new FindDialog;
//! [instantiating FindDialog]

    connect(addButton, SIGNAL(clicked()), this, SLOT(addContact()));
    connect(submitButton, SIGNAL(clicked()), this, SLOT(submitContact()));
    connect(editButton, SIGNAL(clicked()), this, SLOT(editContact()));
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancel()));
    connect(removeButton, SIGNAL(clicked()), this, SLOT(removeContact()));
//! [signals and slots for find]    
    connect(findButton, SIGNAL(clicked()), this, SLOT(findContact()));
//! [signals and slots for find]        
    connect(nextButton, SIGNAL(clicked()), this, SLOT(next()));
    connect(previousButton, SIGNAL(clicked()), this, SLOT(previous()));
    
    QVBoxLayout *buttonLayout1 = new QVBoxLayout;
    buttonLayout1->addWidget(addButton);
    buttonLayout1->addWidget(editButton);
    buttonLayout1->addWidget(removeButton);
//! [adding findButton to layout]        
    buttonLayout1->addWidget(findButton);
//! [adding findButton to layout]            
    buttonLayout1->addWidget(submitButton);
    buttonLayout1->addWidget(cancelButton);
    buttonLayout1->addStretch();

    QHBoxLayout *buttonLayout2 = new QHBoxLayout;
    buttonLayout2->addWidget(previousButton);
    buttonLayout2->addWidget(nextButton);

    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(nameLabel, 0, 0);
    mainLayout->addWidget(nameLine, 0, 1);
    mainLayout->addWidget(addressLabel, 1, 0, Qt::AlignTop);
    mainLayout->addWidget(addressText, 1, 1);
    mainLayout->addLayout(buttonLayout1, 1, 2);
    mainLayout->addLayout(buttonLayout2, 2, 1);

    setLayout(mainLayout);
    setWindowTitle(tr("Simple Address Book"));
}
Esempio n. 15
0
Window::Window(int argc, char *argv[]) :
    QMainWindow(NULL),
    ui(new Ui::Window)
{
    ui->setupUi(this);

	// Cache size
	cacheSize = 50;
	cachePos  = 0;

	prefs = new Preferences(this);
    about = new AboutDialog(this);

    connect(prefs, SIGNAL(finished(int)), this, SLOT(updatePrefs()));

    initSlider(ui->xSlider);
    initSlider(ui->ySlider);
    initSlider(ui->zSlider);
    initSpanSlider(ui->xSpanSlider);
    initSpanSlider(ui->ySpanSlider);
    initSpanSlider(ui->zSpanSlider);

	// Rotation
    connect(ui->xSlider,  SIGNAL(valueChanged(int)),     ui->viewport, SLOT(setXRotation(int)));
    connect(ui->viewport, SIGNAL(xRotationChanged(int)), ui->xSlider, SLOT(setValue(int)));
    connect(ui->ySlider,  SIGNAL(valueChanged(int)),     ui->viewport, SLOT(setYRotation(int)));
    connect(ui->viewport, SIGNAL(yRotationChanged(int)), ui->ySlider, SLOT(setValue(int)));
    connect(ui->zSlider,  SIGNAL(valueChanged(int)),     ui->viewport, SLOT(setZRotation(int)));
    connect(ui->viewport, SIGNAL(zRotationChanged(int)), ui->zSlider, SLOT(setValue(int)));

	// Slicing
    connect(ui->xSpanSlider, SIGNAL(lowerValueChanged(int)), ui->viewport, SLOT(setXSliceLow(int)));
    connect(ui->xSpanSlider, SIGNAL(upperValueChanged(int)), ui->viewport, SLOT(setXSliceHigh(int)));
    connect(ui->ySpanSlider, SIGNAL(lowerValueChanged(int)), ui->viewport, SLOT(setYSliceLow(int)));
    connect(ui->ySpanSlider, SIGNAL(upperValueChanged(int)), ui->viewport, SLOT(setYSliceHigh(int)));
    connect(ui->zSpanSlider, SIGNAL(lowerValueChanged(int)), ui->viewport, SLOT(setZSliceLow(int)));
    connect(ui->zSpanSlider, SIGNAL(upperValueChanged(int)), ui->viewport, SLOT(setZSliceHigh(int)));

    ui->animSlider->setRange(0, 10);
    ui->animSlider->setSingleStep(1);
    ui->animSlider->setPageStep(10);
    ui->animSlider->setTickInterval(2);
    ui->animSlider->setTickPosition(QSlider::TicksRight);
    ui->animSlider->setEnabled(false);

    // Actions
    connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(openAbout()));
    connect(ui->actionPreferences, SIGNAL(triggered()), this, SLOT(openSettings()));
    connect(ui->actionFiles, SIGNAL(triggered()), this, SLOT(openFiles()));
    connect(ui->actionDir, SIGNAL(triggered()), this, SLOT(openDir()));

    connect(ui->actionCubes,   SIGNAL(triggered()), this, SLOT(toggleDisplay()));
    connect(ui->actionCones,   SIGNAL(triggered()), this, SLOT(toggleDisplay()));
    connect(ui->actionVectors, SIGNAL(triggered()), this, SLOT(toggleDisplay()));

    displayType = new QActionGroup(this);
    displayType->addAction(ui->actionCubes);
    displayType->addAction(ui->actionCones);
    displayType->addAction(ui->actionVectors);
    ui->actionCubes->setChecked(true);

    signalMapper = new QSignalMapper(this);
    signalMapper->setMapping (ui->actionFollow, "") ;
    connect (signalMapper, SIGNAL(mapped(QString)), this, SLOT(watchDir(QString))) ;
    connect(ui->actionFollow, SIGNAL(triggered()), signalMapper, SLOT(map()));

    ui->xSlider->setValue(15 * 16);
    ui->ySlider->setValue(345 * 16);
    ui->zSlider->setValue(0 * 16);
	setWindowTitle(tr("MuView 0.9"));

	// Data, don't connect until we are ready (probably still not ready here)...
    connect(ui->animSlider, SIGNAL(valueChanged(int)), this, SLOT(updateDisplayData(int)));
	
	// Load files from command line if supplied
	if (argc > 1) {
		QStringList rawList;
		for (int i=1; i<argc; i++) {
			rawList << argv[i];
		}

		if (rawList.contains(QString("-w"))) {
			if (rawList.indexOf("-w") < (rawList.length() - 1))  {
				watchDir(rawList[rawList.indexOf("-w")+1]);
			}
		} else {
			QStringList allLoadedFiles;
			foreach (QString item, rawList)
			{
				QFileInfo info(item);
				if (!info.exists()) {
					std::cout << "File " << item.toStdString() << " does not exist" << std::endl;
				} else {
								// Push our new content...
					if (info.isDir()) {
						QDir chosenDir(item);
						dirString = chosenDir.path()+"/";
						QStringList filters;
						filters << "*.omf" << "*.ovf";
						chosenDir.setNameFilters(filters);
						QStringList files = chosenDir.entryList();

						foreach (QString file, files)
						{
							filenames << (dirString+file);
							displayNames << (dirString+item);
							//omfCache.push_back(readOMF((dirString+file).toStdString(), tempHeader));
						}

					} else {
Esempio n. 16
0
TextTools::TextTools(QWidget* parent)
   : QDockWidget(parent)
      {
      _textElement = 0;
      setObjectName("text-tools");
      setWindowTitle(tr("Text Tools"));
      setAllowedAreas(Qt::DockWidgetAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea));

      QToolBar* tb = new QToolBar(tr("Text Edit"));
      tb->setIconSize(QSize(preferences.iconWidth, preferences.iconHeight));

      textStyles = new QComboBox;
      tb->addWidget(textStyles);

      showKeyboard = getAction("show-keys");
      showKeyboard->setCheckable(true);
      tb->addAction(showKeyboard);

      typefaceBold = tb->addAction(*icons[textBold_ICON], "");
      typefaceBold->setToolTip(tr("bold"));
      typefaceBold->setCheckable(true);

      typefaceItalic = tb->addAction(*icons[textItalic_ICON], "");
      typefaceItalic->setToolTip(tr("italic"));
      typefaceItalic->setCheckable(true);

      typefaceUnderline = tb->addAction(*icons[textUnderline_ICON], "");
      typefaceUnderline->setToolTip(tr("underline"));
      typefaceUnderline->setCheckable(true);

      tb->addSeparator();

      QActionGroup* ha = new QActionGroup(tb);
      leftAlign   = new QAction(*icons[textLeft_ICON],   "", ha);
      leftAlign->setToolTip(tr("align left"));
      leftAlign->setCheckable(true);
      leftAlign->setData(ALIGN_LEFT);
      hcenterAlign = new QAction(*icons[textCenter_ICON], "", ha);
      hcenterAlign->setToolTip(tr("align horizontal center"));
      hcenterAlign->setCheckable(true);
      hcenterAlign->setData(ALIGN_HCENTER);
      rightAlign  = new QAction(*icons[textRight_ICON],  "", ha);
      rightAlign->setToolTip(tr("align right"));
      rightAlign->setCheckable(true);
      rightAlign->setData(ALIGN_RIGHT);
      tb->addActions(ha->actions());

      QActionGroup* va = new QActionGroup(tb);
      topAlign  = new QAction(*icons[textTop_ICON],  "", va);
      topAlign->setToolTip(tr("align top"));
      topAlign->setCheckable(true);
      topAlign->setData(ALIGN_TOP);

      bottomAlign  = new QAction(*icons[textBottom_ICON],  "", va);
      bottomAlign->setToolTip(tr("align bottom"));
      bottomAlign->setCheckable(true);
      bottomAlign->setData(ALIGN_BOTTOM);

      baselineAlign  = new QAction(*icons[textBaseline_ICON],  "", va);
      baselineAlign->setToolTip(tr("align vertical baseline"));
      baselineAlign->setCheckable(true);
      baselineAlign->setData(ALIGN_BASELINE);

      vcenterAlign  = new QAction(*icons[textVCenter_ICON],  "", va);
      vcenterAlign->setToolTip(tr("align vertical center"));
      vcenterAlign->setCheckable(true);
      vcenterAlign->setData(ALIGN_VCENTER);
      tb->addActions(va->actions());

      typefaceSubscript   = tb->addAction(*icons[textSub_ICON], "");
      typefaceSubscript->setToolTip(tr("subscript"));
      typefaceSubscript->setCheckable(true);

      typefaceSuperscript = tb->addAction(*icons[textSuper_ICON], "");
      typefaceSuperscript->setToolTip(tr("superscript"));
      typefaceSuperscript->setCheckable(true);

      unorderedList = tb->addAction(*icons[formatListUnordered_ICON], "");
      unorderedList->setToolTip(tr("unordered list"));

      orderedList = tb->addAction(*icons[formatListOrdered_ICON], "");
      orderedList->setToolTip(tr("ordered list"));

      indentMore = tb->addAction(*icons[formatIndentMore_ICON], "");
      indentMore->setToolTip(tr("indent more"));

      indentLess = tb->addAction(*icons[formatIndentLess_ICON], "");
      indentLess->setToolTip(tr("indent less"));

      tb->addSeparator();

      typefaceFamily = new QFontComboBox(this);
      tb->addWidget(typefaceFamily);
      typefaceSize = new QDoubleSpinBox(this);
      tb->addWidget(typefaceSize);

      setWidget(tb);
      QWidget* w = new QWidget(this);
      setTitleBarWidget(w);
      titleBarWidget()->hide();

      connect(typefaceSize,        SIGNAL(valueChanged(double)), SLOT(sizeChanged(double)));
      connect(typefaceFamily,      SIGNAL(currentFontChanged(const QFont&)), SLOT(fontChanged(const QFont&)));
      connect(typefaceBold,        SIGNAL(triggered(bool)), SLOT(boldClicked(bool)));
      connect(typefaceItalic,      SIGNAL(triggered(bool)), SLOT(italicClicked(bool)));
      connect(typefaceUnderline,   SIGNAL(triggered(bool)), SLOT(underlineClicked(bool)));
      connect(typefaceSubscript,   SIGNAL(triggered(bool)), SLOT(subscriptClicked(bool)));
      connect(typefaceSuperscript, SIGNAL(triggered(bool)), SLOT(superscriptClicked(bool)));
      connect(typefaceFamily,      SIGNAL(currentFontChanged(const QFont&)), SLOT(fontChanged(const QFont&)));
      connect(ha,                  SIGNAL(triggered(QAction*)), SLOT(setHalign(QAction*)));
      connect(va,                  SIGNAL(triggered(QAction*)), SLOT(setValign(QAction*)));
      connect(showKeyboard,        SIGNAL(triggered(bool)), SLOT(showKeyboardClicked(bool)));
      connect(textStyles,          SIGNAL(currentIndexChanged(int)), SLOT(styleChanged(int)));
      connect(unorderedList,       SIGNAL(triggered()),     SLOT(unorderedListClicked()));
      connect(orderedList,         SIGNAL(triggered()),     SLOT(orderedListClicked()));
      connect(indentLess,          SIGNAL(triggered()),     SLOT(indentLessClicked()));
      connect(indentMore,          SIGNAL(triggered()),     SLOT(indentMoreClicked()));
      }
CSwordSetupInstallSourcesDialog::CSwordSetupInstallSourcesDialog(/*QWidget *parent*/)
        : QDialog() {
    setWindowTitle(tr("New  Installation Source"));

    QVBoxLayout* mainLayout = new QVBoxLayout( this );
    mainLayout->setMargin( 10 );
    mainLayout->setSpacing( 5 );

    QHBoxLayout *captionLayout = new QHBoxLayout( this );
    mainLayout->addLayout(captionLayout);
    QLabel *label = new QLabel( tr("Caption"), this );
    captionLayout->addWidget( label );

    m_captionEdit = new QLineEdit( this );
    m_captionEdit->setText("Crosswire Bible Society");
    captionLayout->addWidget( m_captionEdit );

    mainLayout->addSpacing( 10 );

    QGridLayout* layout = new QGridLayout( this );
    layout->setSpacing(3);
    layout->setMargin(3);
    mainLayout->addLayout(layout);
    layout->setSpacing( 5 );

    label = new QLabel(tr("Type"), this);
    layout->addWidget( label, 0, 0);

    m_serverLabel = new QLabel(tr("Server"), this);
    layout->addWidget( m_serverLabel, 0, 1);

    label = new QLabel(tr("Path"), this);
    layout->addWidget( label, 0, 2 );

    m_protocolCombo = new QComboBox( this );
    layout->addWidget(m_protocolCombo, 1, 0);
    m_protocolCombo->addItem( PROTO_FTP  );
    m_protocolCombo->addItem( PROTO_FILE );

    m_serverEdit = new QLineEdit( this );
    layout->addWidget( m_serverEdit, 1, 1 );
    m_serverEdit->setText("ftp.crosswire.org");

    m_pathEdit = new QLineEdit( this );
    layout->addWidget( m_pathEdit, 1, 2 );
    m_pathEdit->setText("/pub/sword/raw");

    mainLayout->addSpacing( 10 );

    QHBoxLayout* buttonLayout = new QHBoxLayout( this );
    mainLayout->addLayout(buttonLayout);
    buttonLayout->addStretch();
    QPushButton* okButton = new QPushButton( tr("Ok"), this);
    QPushButton* discardButton = new QPushButton( tr("Discard"), this);
    buttonLayout->addWidget( discardButton);
    buttonLayout->addWidget( okButton);
    buttonLayout->addStretch();

    connect( okButton, SIGNAL( clicked() ), this, SLOT( slotOk() ) );
    connect( discardButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( m_protocolCombo, SIGNAL( activated(int) ), this, SLOT( slotProtocolChanged() ) );

}
Esempio n. 18
0
void StatisticsWindow::setupText ()
{
	setWindowTitle (tr (ntr_title));
}
// Update whole channel info state.
bool ChannelStrip::updateChannelInfo (void)
{
	if (m_pChannel == NULL)
		return false;

	// Check for error limit/recycle...
	if (m_iErrorCount > QSAMPLER_ERROR_LIMIT)
		return true;

	// Update strip caption.
	QString sText = m_pChannel->channelName();
	setWindowTitle(sText);
	m_ui.ChannelSetupPushButton->setText('&' + sText);

	// Check if we're up and connected.
	MainForm* pMainForm = MainForm::getInstance();
	if (pMainForm->client() == NULL)
		return false;

	// Read actual channel information.
	m_pChannel->updateChannelInfo();

	// Engine name...
	if (m_pChannel->engineName().isEmpty()) {
		m_ui.EngineNameTextLabel->setText(
			' ' + Channel::noEngineName());
	} else {
		m_ui.EngineNameTextLabel->setText(
			' ' + m_pChannel->engineName());
	}

	// Instrument name...
	updateInstrumentName(false);

	// MIDI Port/Channel...
	QString sMidiPortChannel = QString::number(m_pChannel->midiPort()) + " / ";
	if (m_pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL)
		sMidiPortChannel += tr("All");
	else
		sMidiPortChannel += QString::number(m_pChannel->midiChannel() + 1);
	m_ui.MidiPortChannelTextLabel->setText(sMidiPortChannel);

	// Common palette...
	QPalette pal;
	const QColor& rgbFore = pal.color(QPalette::Foreground);

	// Instrument status...
	int iInstrumentStatus = m_pChannel->instrumentStatus();
	if (iInstrumentStatus < 0) {
		pal.setColor(QPalette::Foreground, Qt::red);
		m_ui.InstrumentStatusTextLabel->setPalette(pal);
		m_ui.InstrumentStatusTextLabel->setText(
			tr("ERR%1").arg(iInstrumentStatus));
		m_iErrorCount++;
		return false;
	}
	// All seems normal...
	pal.setColor(QPalette::Foreground,
		iInstrumentStatus < 100 ? Qt::yellow : Qt::green);
	m_ui.InstrumentStatusTextLabel->setPalette(pal);
	m_ui.InstrumentStatusTextLabel->setText(
		QString::number(iInstrumentStatus) + '%');
	m_iErrorCount = 0;

#ifdef CONFIG_MUTE_SOLO
	// Mute/Solo button state coloring...
	bool bMute = m_pChannel->channelMute();
	const QColor& rgbButton = pal.color(QPalette::Button);
	pal.setColor(QPalette::Foreground, rgbFore);
	pal.setColor(QPalette::Button, bMute ? Qt::yellow : rgbButton);
	m_ui.ChannelMutePushButton->setPalette(pal);
	m_ui.ChannelMutePushButton->setDown(bMute);
	bool bSolo = m_pChannel->channelSolo();
	pal.setColor(QPalette::Button, bSolo ? Qt::cyan : rgbButton);	
	m_ui.ChannelSoloPushButton->setPalette(pal);
	m_ui.ChannelSoloPushButton->setDown(bSolo);
#else
	m_ui.ChannelMutePushButton->setEnabled(false);
	m_ui.ChannelSoloPushButton->setEnabled(false);
#endif

	// And update the both GUI volume elements;
	// return success if, and only if, intrument is fully loaded...
	return updateChannelVolume() && (iInstrumentStatus == 100);
}
Esempio n. 20
0
BitcoinGUI::BitcoinGUI(QWidget *parent):
    QMainWindow(parent),
    clientModel(0),
    walletModel(0),
    encryptWalletAction(0),
    changePassphraseAction(0),
    lockWalletToggleAction(0),
    aboutQtAction(0),
    trayIcon(0),
    notificator(0),
    rpcConsole(0)
{
    resize(850, 550);
    setWindowTitle(tr("Pseudocoin") + " - " + tr("Wallet"));
#ifndef Q_OS_MAC
    qApp->setWindowIcon(QIcon(":icons/bitcoin"));
    setWindowIcon(QIcon(":icons/bitcoin"));
#else
    setUnifiedTitleAndToolBarOnMac(true);
    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon
    createActions();

    // Create application menu bar
    createMenuBar();

    // Create the toolbars
    createToolBars();

    // Create the tray icon (or setup the dock icon)
    createTrayIcon();

    // Create tabs
    overviewPage = new OverviewPage();

    transactionsPage = new QWidget(this);
    QVBoxLayout *vbox = new QVBoxLayout();
    transactionView = new TransactionView(this);
    vbox->addWidget(transactionView);
    transactionsPage->setLayout(vbox);

    addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);

    receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);

    sendCoinsPage = new SendCoinsDialog(this);

    signVerifyMessageDialog = new SignVerifyMessageDialog(this);

    centralWidget = new QStackedWidget(this);
    centralWidget->addWidget(overviewPage);
    centralWidget->addWidget(transactionsPage);
    centralWidget->addWidget(addressBookPage);
    centralWidget->addWidget(receiveCoinsPage);
    centralWidget->addWidget(sendCoinsPage);
    setCentralWidget(centralWidget);

    // Create status bar
    statusBar();

    // Status bar notification icons
    QFrame *frameBlocks = new QFrame();
    frameBlocks->setContentsMargins(0,0,0,0);
    frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
    QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
    frameBlocksLayout->setContentsMargins(3,0,3,0);
    frameBlocksLayout->setSpacing(3);
    labelEncryptionIcon = new QLabel();
    labelMintingIcon = new QLabel();
    labelConnectionsIcon = new QLabel();
    labelBlocksIcon = new QLabel();
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelEncryptionIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelMintingIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelConnectionsIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelBlocksIcon);
    frameBlocksLayout->addStretch();

    labelEncryptionIcon->setObjectName("labelEncryptionIcon");
    labelConnectionsIcon->setObjectName("labelConnectionsIcon");
    labelBlocksIcon->setObjectName("labelBlocksIcon");
    labelMintingIcon->setObjectName("labelMintingIcon");
    labelEncryptionIcon->setStyleSheet("#labelEncryptionIcon QToolTip {color:#cecece;background-color:#333333;border:0px;}");
    labelConnectionsIcon->setStyleSheet("#labelConnectionsIcon QToolTip {color:#cecece;background-color:#333333;border:0px;}");
    labelBlocksIcon->setStyleSheet("#labelBlocksIcon QToolTip {color:#cecece;background-color:#333333;border:0px;}");
    labelMintingIcon->setStyleSheet("#labelMintingIcon QToolTip {color:#cecece;background-color:#333333;border:0px;}");

    // Set minting pixmap
    labelMintingIcon->setPixmap(QIcon(":/icons/minting").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
    labelMintingIcon->setEnabled(false);
    // Add timer to update minting icon
    QTimer *timerMintingIcon = new QTimer(labelMintingIcon);
    timerMintingIcon->start(MODEL_UPDATE_DELAY);
    connect(timerMintingIcon, SIGNAL(timeout()), this, SLOT(updateMintingIcon()));
    // Add timer to update minting weights
    QTimer *timerMintingWeights = new QTimer(labelMintingIcon);
    timerMintingWeights->start(30 * 1000);
    connect(timerMintingWeights, SIGNAL(timeout()), this, SLOT(updateMintingWeights()));
    // Set initial values for user and network weights
    nWeight, nNetworkWeight = 0;

    // Progress bar and label for blocks download
    progressBarLabel = new QLabel();
    progressBarLabel->setVisible(false);
    progressBar = new QProgressBar();
    progressBar->setAlignment(Qt::AlignCenter);
    progressBar->setVisible(false);

    // Override style sheet for progress bar for styles that have a segmented progress bar,
    // as they make the text unreadable (workaround for issue #1071)
    // See https://qt-project.org/doc/qt-4.8/gallery.html
    QString curStyle = qApp->style()->metaObject()->className();
    if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
    {
        progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }");
    }

    statusBar()->addWidget(progressBarLabel);
    statusBar()->addWidget(progressBar);
    statusBar()->addPermanentWidget(frameBlocks);

    syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this);
    // this->setStyleSheet("background-color: #effbef;");

    // Clicking on a transaction on the overview page simply sends you to transaction history page
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));

    // Double-clicking on a transaction on the transaction history page shows details
    connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));

    rpcConsole = new RPCConsole(this);
    connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));

    // Clicking on "Verify Message" in the address book sends you to the verify message tab
    connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
    // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab
    connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));

    gotoOverviewPage();
}
PProgressDialog::PProgressDialog( QDialog *parent )
    : QDialog(parent)
{
  setWindowTitle( tr("Подождите, выполняется работа приложения") );
  createProgressDialog();
}
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    setWindowTitle(tr("Game of Life"));
    statusBar()->showMessage(QString("Game of Life by Kelvin Silva"));
}
Esempio n. 23
0
void Dialog::setDefaultWindowTitle() { setWindowTitle( QString("Watch - ") + afqt::stoq( af::Environment::getUserName()) + "@" + afqt::stoq( af::Environment::getServerName()) );}
Esempio n. 24
0
KisAboutApplication::KisAboutApplication(QWidget *parent)
    : QDialog(parent)
{
    setWindowTitle(i18n("About Krita"));

    QVBoxLayout *vlayout = new QVBoxLayout(this);
    vlayout->setMargin(0);
    QTabWidget *wdg = new QTabWidget;
    vlayout->addWidget(wdg);

    KisSplashScreen *splash = new KisSplashScreen(qApp->applicationVersion(), QPixmap(splash_screen_xpm), true);
    splash->setWindowFlags(Qt::Widget);
    splash->setFixedSize(splash->sizeHint());
    wdg->addTab(splash, i18n("About"));
    setMinimumSize(wdg->sizeHint());

    QTextEdit *lblAuthors = new QTextEdit();
    lblAuthors->setReadOnly(true);

    QString authors = i18n("<html>"
                          "<head/>"
                          "<body>"
                          "<h1 align=\"center\">Created By</h1></p>"
                          "<p>");

    QFile fileDevelopers(":/developers.txt");
    Q_ASSERT(fileDevelopers.exists());
    fileDevelopers.open(QIODevice::ReadOnly);

    Q_FOREACH (const QByteArray &author, fileDevelopers.readAll().split('\n')) {
        authors.append(QString::fromUtf8(author));
        authors.append(", ");
    }
    authors.chop(2);
    authors.append(".</p></body></html>");
    lblAuthors->setText(authors);
    wdg->addTab(lblAuthors, i18n("Authors"));

    QTextEdit *lblKickstarter = new QTextEdit();
    lblKickstarter->setReadOnly(true);

    QString backers = i18n("<html>"
                          "<head/>"
                          "<body>"
                          "<h1 align=\"center\">Backed By</h1>"
                          "<p>");

    QFile fileBackers(":/backers.txt");
    Q_ASSERT(fileBackers.exists());
    fileBackers.open(QIODevice::ReadOnly);
    Q_FOREACH (const QByteArray &backer, fileBackers.readAll().split('\n')) {
        backers.append(QString::fromUtf8(backer));
        backers.append(", ");
    }
    backers.chop(2);
    backers.append(i18n(".</p><p><i>Thanks! You were all <b>awesome</b>!</i></p></body></html>"));
    lblKickstarter->setText(backers);
    wdg->addTab(lblKickstarter, i18n("Backers"));



    QTextEdit *lblCredits = new QTextEdit();
    lblCredits->setReadOnly(true);
    QString credits = i18n("<html>"
                          "<head/>"
                          "<body>"
                          "<h1 align=\"center\">Thanks To</h1>"
                          "<p>");

    QFile fileCredits(":/credits.txt");
    Q_ASSERT(fileCredits.exists());
    fileCredits.open(QIODevice::ReadOnly);

    Q_FOREACH (const QByteArray &credit, fileCredits.readAll().split('\n')) {
        if (!credit.isEmpty()) {
            QList<QByteArray> creditSplit = credit.split(':');
            Q_ASSERT(creditSplit.size() == 2);
            credits.append(QString::fromUtf8(creditSplit.at(0)));
            credits.append(" (<i>" + QString::fromUtf8(creditSplit.at(1)) + "</i>)");
            credits.append(", ");
        }
    }
    credits.chop(2);
    credits.append(i18n(".</p><p><i>For supporting Krita development with advice, icons, brush sets and more.</i></p></body></html>"));

    lblCredits->setText(credits);
    wdg->addTab(lblCredits, i18n("Also Thanks To"));

    QTextEdit *lblLicense = new QTextEdit();
    lblLicense->setReadOnly(true);
    QString license = i18n("<html>"
                           "<head/>"
                           "<body>"
                           "<h1 align=\"center\"><b>Your Rights</h1>"
                           "<p>Krita is released under the GNU General Public License (version 2 or any later version).</p>"
                           "<p>This license grants people a number of freedoms:</p>"
                           "<ul>"
                           "<li>You are free to use Krita, for any purpose</li>"
                           "<li>You are free to distribute Krita</li>"
                           "<li>You can study how Krita works and change it</li>"
                           "<li>You can distribute changed versions of Krita</li>"
                           "</ul>"
                           "<p>The Krita Foundation and its projects on krita.org are <b>committed</b> to preserving Krita as free software.</p>"
                           "<h1 align=\"center\">Your artwork</h1>"
                           "<p>What you create with Krita is your sole property. All your artwork is free for you to use as you like.</p>"
                           "<p>That means that Krita can be used commercially, for any purpose. There are no restrictions whatsoever.</p>"
                           "<p>Krita’s GNU GPL license guarantees you this freedom. Nobody is ever permitted to take it away, in contrast "
                           "to trial or educational versions of commercial software that will forbid your work in commercial situations.</p>"
                           "<br/><hr/><pre>");

    QFile licenseFile(":/LICENSE");
    Q_ASSERT(licenseFile.exists());
    licenseFile.open(QIODevice::ReadOnly);
    QByteArray ba = licenseFile.readAll();
    license.append(QString::fromUtf8(ba));
    license.append("</pre></body></html>");
    lblLicense->setText(license);

    wdg->addTab(lblLicense, i18n("License"));

    QPushButton *bnClose = new QPushButton(i18n("Close"));
    connect(bnClose, SIGNAL(clicked()), SLOT(close()));

    QHBoxLayout *hlayout = new QHBoxLayout;
    hlayout->setMargin(0);
    hlayout->addStretch(10);
    hlayout->addWidget(bnClose);

    vlayout->addLayout(hlayout);
}
Esempio n. 25
0
BitcoinGUI::BitcoinGUI(QWidget *parent) :
    QMainWindow(parent),
    clientModel(0),
    encryptWalletAction(0),
    changePassphraseAction(0),
    aboutQtAction(0),
    trayIcon(0),
    notificator(0),
    rpcConsole(0),
    prevBlocks(0)
{
    restoreWindowGeometry();
    setWindowTitle(tr("Czarcoin") + " - " + tr("Wallet"));
#ifndef Q_OS_MAC
    QApplication::setWindowIcon(QIcon(":icons/bitcoin"));
    setWindowIcon(QIcon(":icons/bitcoin"));
#else
    setUnifiedTitleAndToolBarOnMac(true);
    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
    // Create wallet frame and make it the central widget
    walletFrame = new WalletFrame(this);
    setCentralWidget(walletFrame);

    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon
    // Needs walletFrame to be initialized
    createActions();

    // Create application menu bar
    createMenuBar();

    // Create the toolbars
    createToolBars();

    // Create system tray icon and notification
    createTrayIcon();

    // Create status bar
    statusBar();

    // Status bar notification icons
    QFrame *frameBlocks = new QFrame();
    frameBlocks->setContentsMargins(0,0,0,0);
    frameBlocks->setMinimumWidth(56);
    frameBlocks->setMaximumWidth(56);
    QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
    frameBlocksLayout->setContentsMargins(3,0,3,0);
    frameBlocksLayout->setSpacing(3);
    labelEncryptionIcon = new QLabel();
    labelConnectionsIcon = new QLabel();
    labelBlocksIcon = new QLabel();
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelEncryptionIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelConnectionsIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelBlocksIcon);
    frameBlocksLayout->addStretch();

    // Progress bar and label for blocks download
    progressBarLabel = new QLabel();
    progressBarLabel->setVisible(false);
    progressBar = new QProgressBar();
    progressBar->setAlignment(Qt::AlignCenter);
    progressBar->setVisible(false);

    // Override style sheet for progress bar for styles that have a segmented progress bar,
    // as they make the text unreadable (workaround for issue #1071)
    // See https://qt-project.org/doc/qt-4.8/gallery.html
    QString curStyle = QApplication::style()->metaObject()->className();
    if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
    {
        progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }");
    }

    statusBar()->addWidget(progressBarLabel);
    statusBar()->addWidget(progressBar);
    statusBar()->addPermanentWidget(frameBlocks);

    syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this);

    rpcConsole = new RPCConsole(this);
    connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));
    // prevents an oben debug window from becoming stuck/unusable on client shutdown
    connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide()));

    // Install event filter to be able to catch status tip events (QEvent::StatusTip)
    this->installEventFilter(this);

    // Initially wallet actions should be disabled
    setWalletActionsEnabled(false);
}
Esempio n. 26
0
BitcoinGUI::BitcoinGUI(QWidget *parent):
    QMainWindow(parent),
    clientModel(0),
    walletModel(0),
    encryptWalletAction(0),
    unlockForMintingAction(0),
    changePassphraseAction(0),
    aboutQtAction(0),
    trayIcon(0),
    notificator(0),
    rpcConsole(0)
{
    resize(850, 550);
    setWindowTitle(tr("Minermind Wallet"));
#ifndef Q_WS_MAC
    setWindowIcon(QIcon(":icons/minermind_icon"));
#else
    setUnifiedTitleAndToolBarOnMac(true);
    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon
    createActions();

    // Create application menu bar
    createMenuBar();

    // Create the toolbars
    createToolBars();

    // Create the tray icon (or setup the dock icon)
    createTrayIcon();

    // Create tabs
    overviewPage = new OverviewPage();

    transactionsPage = new QWidget(this);
    QVBoxLayout *vbox = new QVBoxLayout();
    transactionView = new TransactionView(this);
    vbox->addWidget(transactionView);
    transactionsPage->setLayout(vbox);

    mintingPage = new QWidget(this);
    QVBoxLayout *vboxMinting = new QVBoxLayout();
    mintingView = new MintingView(this);
    vboxMinting->addWidget(mintingView);
    mintingPage->setLayout(vboxMinting);

    addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);

    receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);

    sendCoinsPage = new SendCoinsDialog(this);

    messagePage = new SignVerifyMessageDialog(this);

    multisigPage = new MultisigDialog(this);

    centralWidget = new QStackedWidget(this);
    centralWidget->addWidget(overviewPage);
    centralWidget->addWidget(transactionsPage);
    centralWidget->addWidget(mintingPage);
    centralWidget->addWidget(addressBookPage);
    centralWidget->addWidget(receiveCoinsPage);
    centralWidget->addWidget(sendCoinsPage);
#ifdef FIRST_CLASS_MESSAGING
    centralWidget->addWidget(messagePage);
#endif
    setCentralWidget(centralWidget);

    // Create status bar
    statusBar();

    // Status bar notification icons
    QFrame *frameBlocks = new QFrame();
    frameBlocks->setContentsMargins(0,0,0,0);
    frameBlocks->setMinimumWidth(56);
    frameBlocks->setMaximumWidth(56);
    QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
    frameBlocksLayout->setContentsMargins(3,0,3,0);
    frameBlocksLayout->setSpacing(3);
    labelEncryptionIcon = new QLabel();
    labelConnectionsIcon = new QLabel();
    labelBlocksIcon = new QLabel();
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelEncryptionIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelConnectionsIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelBlocksIcon);
    frameBlocksLayout->addStretch();

    // Progress bar and label for blocks download
    progressBarLabel = new QLabel();
    progressBarLabel->setVisible(false);
    progressBar = new QProgressBar();
    progressBar->setAlignment(Qt::AlignCenter);
    progressBar->setVisible(false);

    statusBar()->addWidget(progressBarLabel);
    statusBar()->addWidget(progressBar);
    statusBar()->addPermanentWidget(frameBlocks);

    syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this);

    // Clicking on a transaction on the overview page simply sends you to transaction history page
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));

    // Doubleclicking on a transaction on the transaction history page shows details
    connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));

    rpcConsole = new RPCConsole(this);
    connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));

    gotoOverviewPage();
}
Esempio n. 27
0
FenPrincipale::FenPrincipale()
{

    // Groupe : Définition de la classe
    nom = new QLineEdit;
    classeMere = new QLineEdit;

    QFormLayout *definitionLayout = new QFormLayout;
    definitionLayout->addRow("&Nom :", nom);
    definitionLayout->addRow("Classe &mère :", classeMere);

    QGroupBox *groupDefinition = new QGroupBox("Définition de la classe");
    groupDefinition->setLayout(definitionLayout);


    // Groupe : Options

    protections = new QCheckBox("Protéger le &header contre les inclusions multiples");
    protections->setChecked(true);
    genererConstructeur = new QCheckBox("Générer un &constructeur par défaut");
    genererDestructeur = new QCheckBox("Générer un &destructeur");

    QVBoxLayout *optionsLayout = new QVBoxLayout;
    optionsLayout->addWidget(protections);
    optionsLayout->addWidget(genererConstructeur);
    optionsLayout->addWidget(genererDestructeur);

    QGroupBox *groupOptions = new QGroupBox("Options");
    groupOptions->setLayout(optionsLayout);



    // Groupe : Commentaires

    auteur = new QLineEdit;
    date = new QDateEdit;
    date->setDate(QDate::currentDate());
    role = new QTextEdit;

    QFormLayout *commentairesLayout = new QFormLayout;
    commentairesLayout->addRow("&Auteur :", auteur);
    commentairesLayout->addRow("Da&te de création :", date);
    commentairesLayout->addRow("&Rôle de la classe :", role);

    groupCommentaires = new QGroupBox("Ajouter des commentaires");
    groupCommentaires->setCheckable(true);
    groupCommentaires->setChecked(false);
    groupCommentaires->setLayout(commentairesLayout);


    // Layout : boutons du bas (générer, quitter...)
    generer = new QPushButton("&Générer !");
    quitter = new QPushButton("&Quitter");

    QHBoxLayout *boutonsLayout = new QHBoxLayout;
    boutonsLayout->setAlignment(Qt::AlignRight);

    boutonsLayout->addWidget(generer);
    boutonsLayout->addWidget(quitter);


    // Définition du layout principal, du titre de la fenêtre, etc.

    QVBoxLayout *layoutPrincipal = new QVBoxLayout;
    layoutPrincipal->addWidget(groupDefinition);
    layoutPrincipal->addWidget(groupOptions);
    layoutPrincipal->addWidget(groupCommentaires);
    layoutPrincipal->addLayout(boutonsLayout);

    setLayout(layoutPrincipal);
    setWindowTitle("Zero Class Generator");
    setWindowIcon(QIcon("icone.png"));
    resize(400, 450);


    // Connexions des signaux et des slots
    connect(quitter, SIGNAL(clicked()), qApp, SLOT(quit()));
    connect(generer, SIGNAL(clicked()), this, SLOT(genererCode()));

}
SimulationMainWindow2D::SimulationMainWindow2D(){
	
   QWidget *widget = new QWidget;
   setCentralWidget(widget);
   
   QWidget *topFiller = new QWidget;
   topFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
   
   infoLabel = new QLabel(tr("<i>Choose a menu option, or right-click to "
                             "invoke a context menu</i>"));
   infoLabel->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
   infoLabel->setAlignment(Qt::AlignCenter);
 
   infoLabel2 = new QLabel(tr("<i>Simulation Status: "
                              "Field is not initialized</i>"));
   infoLabel2->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
   infoLabel2->setAlignment(Qt::AlignBottom);

   timeLabel = new QLabel(tr("Time : "));
   QString timeLabelString = tr("Time : ") + QString::number(simulationTime)
                   + tr("   Error : ") + QString::number(simulationErr) ; 	
   timeLabel->setText(timeLabelString);	

   QWidget *bottomFiller = new QWidget;
   bottomFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

   QVBoxLayout *layout = new QVBoxLayout;

   layout->setMargin(5);
   layout->addWidget(topFiller);
   layout->addWidget(infoLabel);
   layout->addWidget(infoLabel2);
   layout->addWidget(timeLabel);
   layout->addWidget(bottomFiller);
   widget->setLayout(layout);

   createActions();
   createMenus();
   createButtons();

   QString message = tr("A context menu is available by right-clicking");
   statusBar()->showMessage(message);

   setWindowTitle(tr("PDE simulation"));
   setMinimumSize(480, 320);
   resize(720, 480);

   // Default values

   xGridSize = 200;
   yGridSize = 400;

   gridSize  = xGridSize * yGridSize;

   vx = 1.0;
   vy = 1.0;

   mainSolverName = "LaxFriedrichs";
   fluxSolverName = "LinearReconstruction";

   simulationErrorTolerance = 1e-2;

   simulation = new Simulation2DClass;
   restartSimulation();
   
}
Esempio n. 29
0
bool AddFeedDialog::fillFeed(const std::string &feedId)
{
	mFeedId = feedId;

	if (!mFeedId.empty()) {
		FeedInfo feedInfo;
		if (!mFeedReader->getFeedInfo(mFeedId, feedInfo)) {
			mFeedId.clear();
			return false;
		}

		setWindowTitle(tr("Edit feed"));
		ui->typeGroupBox->setEnabled(false);

		mParentId = feedInfo.parentId;

		ui->nameLineEdit->setText(QString::fromUtf8(feedInfo.name.c_str()));
		ui->urlLineEdit->setText(QString::fromUtf8(feedInfo.url.c_str()));
		ui->useInfoFromFeedCheckBox->setChecked(feedInfo.flag.infoFromFeed);
		ui->updateForumInfoCheckBox->setChecked(feedInfo.flag.updateForumInfo);
		ui->activatedCheckBox->setChecked(!feedInfo.flag.deactivated);
		ui->embedImagesCheckBox->setChecked(feedInfo.flag.embedImages);
		ui->saveCompletePageCheckBox->setChecked(feedInfo.flag.saveCompletePage);

		ui->descriptionPlainTextEdit->setPlainText(QString::fromUtf8(feedInfo.description.c_str()));

		ui->typeGroupBox->setEnabled(false);
		ui->forumComboBox->hide();
		ui->forumNameLabel->clear();
		ui->forumNameLabel->show();

		if (feedInfo.flag.forum) {
			ui->typeForumRadio->setChecked(true);
			ui->saveCompletePageCheckBox->setEnabled(false);
			ui->embedImagesCheckBox->setEnabled(false);

			if (feedInfo.forumId.empty()) {
				ui->forumNameLabel->setText(tr("Not yet created"));
			} else {
				ForumInfo forumInfo;
				if (rsForums->getForumInfo(feedInfo.forumId, forumInfo)) {
					ui->forumNameLabel->setText(QString::fromStdWString(forumInfo.forumName));
				} else {
					ui->forumNameLabel->setText(tr("Unknown forum"));
				}
			}
		} else {
			ui->typeLocalRadio->setChecked(true);
		}

		ui->useAuthenticationCheckBox->setChecked(feedInfo.flag.authentication);
		ui->userLineEdit->setText(QString::fromUtf8(feedInfo.user.c_str()));
		ui->passwordLineEdit->setText(QString::fromUtf8(feedInfo.password.c_str()));

		ui->useStandardProxyCheckBox->setChecked(feedInfo.flag.standardProxy);
		ui->proxyAddressLineEdit->setText(QString::fromUtf8(feedInfo.proxyAddress.c_str()));
		ui->proxyPortSpinBox->setValue(feedInfo.proxyPort);

		ui->useStandardUpdateInterval->setChecked(feedInfo.flag.standardUpdateInterval);
		ui->updateIntervalSpinBox->setValue(feedInfo.updateInterval / 60);
		QDateTime dateTime;
		dateTime.setTime_t(feedInfo.lastUpdate);
		ui->lastUpdate->setText(dateTime.toString());

		ui->useStandardStorageTimeCheckBox->setChecked(feedInfo.flag.standardStorageTime);
		ui->storageTimeSpinBox->setValue(feedInfo.storageTime / (60 * 60 *24));

		mXPathsToUse = feedInfo.xpathsToUse;
		mXPathsToRemove = feedInfo.xpathsToRemove;
	}

	return true;
}
Esempio n. 30
0
void LogConfigDialog::buildDialog()
{
  setWindowTitle(tr("Configure Logging"));
  QPushButton* button;
  QVBoxLayout *vLayout;
  QHBoxLayout *hLayout;
  QFormLayout *fLayout = new QFormLayout;

  m_configFilePath = new QLineEdit();
  m_logFilePath = new QLineEdit();

  hLayout = new QHBoxLayout();

  vLayout = new QVBoxLayout();
  vLayout->addWidget(new QLabel(tr("Configuration File: ")));
  vLayout->addWidget(new QLabel(tr("Log File: ")));
  hLayout->addLayout(vLayout);

  vLayout = new QVBoxLayout();
  vLayout->addWidget(m_configFilePath);
  vLayout->addWidget(m_logFilePath);
  hLayout->addLayout(vLayout);

  vLayout = new QVBoxLayout();
  button = new QPushButton(tr("Load"));
  connect(button, SIGNAL(clicked()), this, SLOT(loadLogConfiguration()));
  vLayout->addWidget(button);
  button = new QPushButton(tr("Select"));
  connect(button, SIGNAL(clicked()), this, SLOT(selectLogFile()));
  vLayout->addWidget(button);
  hLayout->addLayout(vLayout);

  vLayout = new QVBoxLayout();
  button = new QPushButton(tr("Save"));
  connect(button, SIGNAL(clicked()), this, SLOT(saveLogConfiguration()));
  vLayout->addWidget(button);
  vLayout->addStretch();
  hLayout->addLayout(vLayout);

  fLayout->addRow(hLayout);

  hLayout = new QHBoxLayout();
  vLayout = new QVBoxLayout();
  vLayout->addWidget(new QLabel(tr("Routings:")));
  button = new QPushButton(tr("Edit"));
  connect(button, SIGNAL(clicked()), this, SLOT(editSelectedRouting()));
  vLayout->addWidget(button);
  button = new QPushButton(tr("Add"));
  connect(button, SIGNAL(clicked()), this, SLOT(addRouting()));
  vLayout->addWidget(button);
  button = new QPushButton(tr("Copy"));
  connect(button, SIGNAL(clicked()), this, SLOT(copyRouting()));
  vLayout->addWidget(button);
  button = new QPushButton(tr("Delete"));
  connect(button, SIGNAL(clicked()), this, SLOT(delSelectedRouting()));
  vLayout->addWidget(button);
  vLayout->addStretch();
  hLayout->addLayout(vLayout);

  m_routingTableView = new QTableView();
  m_tableModel = new LogRoutingInfoTableModel();
  m_routingTableView->setModel(m_tableModel);

  LinkBackFilterDelegate* delegate = new LinkBackFilterDelegate(m_routingTableView);
  m_routingTableView->setItemDelegate(delegate);

  CheckBoxOnlyDelegate * cboDelegate = new CheckBoxOnlyDelegate(m_routingTableView);
  m_routingTableView->setItemDelegateForColumn(LogRoutingInfoTableModel::enabledColumn, cboDelegate);
  m_routingTableView->setItemDelegateForColumn(LogRoutingInfoTableModel::routFileColumn, cboDelegate);
  m_routingTableView->setItemDelegateForColumn(LogRoutingInfoTableModel::routScreenColumn, cboDelegate);
  m_routingTableView->setItemDelegateForColumn(LogRoutingInfoTableModel::routDebugColumn, cboDelegate);

  hLayout->addWidget(m_routingTableView);
  fLayout->addRow(hLayout);


  QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);
  connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
  connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
  fLayout->addRow(buttonBox);

  setLayout(fLayout);

  QSettings settings;
  restoreGeometry(settings.value("LogConfigDialogGeometry").toByteArray());
  setConfigFilePath(settings.value("LogConfigDialogLastConfigPath").toString());
  QString s = settings.value("LogConfigDialogRoutingColumnWidths").toString();
  if (s.length() > 0)
  {
    QStringList list = s.split(',');
    bool ok = true;
    for (int i=0; i<list.count() && i<LogRoutingInfoTableModel::numColumns; ++i)
    {
      int width = list[i].toInt(&ok);
      if (ok && width > 0)
      {
        m_routingTableView->setColumnWidth(i, width);
      }
    }
  }
}