Ejemplo n.º 1
0
void Html::header(const String &title, bool blank, const String &redirect)
{
	mBlank = blank;
  
	*mStream<<"<!DOCTYPE html>\n";
	*mStream<<"<html>\n";
	*mStream<<"<head>\n";
	if(blank) *mStream<<"<title>"<<title<<"</title>\n";
	else if(title.empty()) *mStream<<"<title>"<<APPNAME<<"</title>\n";
	else *mStream<<"<title>"<<title<<" - "<<APPNAME<<"</title>\n";
	*mStream<<"<meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\">\n";
	*mStream<<"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1\">\n";
	*mStream<<"<link rel=\"stylesheet\" type=\"text/css\" href=\"/style.css\">\n";
	*mStream<<"<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\">\n";
	if(!redirect.empty()) *mStream<<"<meta http-equiv=\"refresh\" content=\"5;URL='"+redirect+"'\">\n";
	*mStream<<"<noscript><meta http-equiv=\"refresh\" content=\"0;url=/noscript.html\"></noscript>\n";
	*mStream<<"<script type=\"text/javascript\" src=\"/jquery.min.js\"></script>\n";
	*mStream<<"<script type=\"text/javascript\" src=\"/jquery.form.min.js\"></script>\n";
	*mStream<<"<script type=\"text/javascript\" src=\"/common.js\"></script>\n";
	*mStream<<"<script type=\"text/javascript\" src=\"/directory.js\"></script>\n";
	*mStream<<"<script type=\"text/javascript\" src=\"/mail.js\"></script>\n";
	*mStream<<"<base target=\"_parent\">\n";
	
	javascript("var deviceAgent = navigator.userAgent.toLowerCase();\n\
		if(deviceAgent.indexOf('android') >= 0 || deviceAgent.indexOf('iPhone') >= 0 || deviceAgent.indexOf('iPad') >= 0)\n\
			$('head').append('<link rel=\"stylesheet\" type=\"text/css\" href=\"/touchscreen.css\">');");
	
	*mStream<<"</head>\n";
	*mStream<<"<body>\n";

	open("div","page");
	
	if(!mBlank)
	{
		open("div","header");
		openLink("/","#backlink"); image("/logo.png", APPNAME, "logo"); closeLink();
		open("div","title");
		if(title.empty()) text(APPNAME);
		else text(title);
		close("div");
		close("div");
		//javascript("$('#backlink').click(function(){ window.location.href = getBasePath(1); return false;});");
		open("div","content");
	}
}
Ejemplo n.º 2
0
AboutDialog::AboutDialog(QWidget *parent) :
        QDialog(parent),
        ui(new Ui::AboutDialog)
{
	ui->setupUi(this);

	ui->textLabel->setText(tr(
		"<h1>HaveClip</h1>"
		"<p>Version %1 (commit <a href=\"http://git.havefun.cz/haveclip/haveclip-desktop/tree/%2\">%3</a>)</p>"
		"<p>A simple clipboard synchronization tool.</p>"
		"<dl><dt>Homepage:</dt><dd><a href=\"http://www.havefun.cz/projects/haveclip\">http://www.havefun.cz/projects/haveclip</a></dd>"
		"</dl>"
		"<h2>Authors:</h2>"
		"<ul><li>Developed by Jakub Skokan &lt;<a href=\"mailto:[email protected]\">[email protected]</a>&gt;</li>"
		"<li>Icon created by Aleš Kocur &lt;<a href=\"mailto:[email protected]\">[email protected]</a>&gt;</li></ul>"
	).arg(VERSION).arg(GIT_CURRENT_SHA1).arg(QString(GIT_CURRENT_SHA1).left(7)));

	connect(ui->textLabel, SIGNAL(linkActivated(QString)), this, SLOT(openLink(QString)));
}
Ejemplo n.º 3
0
OsdWidget::OsdWidget(QWidget *parent)
    : StyledBar(parent),
      ui(new Ui::OsdWidget),
      _current(""),
      _file(new NetworkDownload())
{
    ui->setupUi(this);

    setLightColored(true);
    setSingleRow(false);

    setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);

    _info = new InfoBarWidget(this);
    ui->controls->addWidget(_info);

    ui->logo->hide();
    ui->teletext->hide();

    ui->buttonBack->setProperty("extraframe", true);
    ui->buttonMute->setProperty("extraframe", true);
    ui->buttonNext->setProperty("extraframe", true);
    ui->buttonPlay->setProperty("extraframe", true);
    ui->buttonRecordNow->setProperty("extraframe", true);
    ui->buttonSnapshot->setProperty("extraframe", true);
    ui->buttonStop->setProperty("extraframe", true);
    ui->buttonTeletext->setProperty("extraframe", true);

    connect(_info, SIGNAL(open(QString)), this, SIGNAL(openLink(QString)));
    connect(ui->teletext, SIGNAL(valueChanged(int)), this, SIGNAL(teletextPage(int)));

    connect(ui->buttonBack, SIGNAL(clicked()), this, SIGNAL(backClicked()));
    connect(ui->buttonMute, SIGNAL(clicked()), this, SIGNAL(muteClicked()));
    connect(ui->buttonNext, SIGNAL(clicked()), this, SIGNAL(nextClicked()));
    connect(ui->buttonPlay, SIGNAL(clicked()), this, SIGNAL(playClicked()));
    connect(ui->buttonRecordNow, SIGNAL(clicked()), this, SIGNAL(recordNowClicked()));
    connect(ui->buttonSnapshot, SIGNAL(clicked()), this, SIGNAL(snapshotClicked()));
    connect(ui->buttonStop, SIGNAL(clicked()), this, SIGNAL(stopClicked()));
    connect(ui->buttonTeletext, SIGNAL(clicked()), this, SIGNAL(teletextClicked()));

    connect(_file, SIGNAL(file(QFile *)), this, SLOT(setLogo(QFile *)));
}
Ejemplo n.º 4
0
bool HtmlEditor::load(const QString &f)
{
    if (!QFile::exists(f))
        return false;
    QFile file(f);
    if (!file.open(QFile::ReadOnly))
        return false;

    QByteArray data = file.readAll();
    ui->webView->setContent(data, "text/html");
    ui->webView->page()->setContentEditable(true);
    ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
    connect(ui->webView, SIGNAL(linkClicked(QUrl)), SLOT(openLink(QUrl)));

    const QString html(data);
    ui->actionFormatFontSize->setEnabled(html.contains("qrc:/scripts/htmleditor.js"));
    ui->actionTextOutline->setEnabled(html.contains("qrc:/scripts/htmleditor.js"));
    ui->actionTextShadow->setEnabled(html.contains("qrc:/scripts/htmleditor.js"));
    setCurrentFileName(f);
    return true;
}
Ejemplo n.º 5
0
LogDock::LogDock(QWidget *parent) :
    QWidget(parent)
{
    settings.beginGroup("LogDock");
    bool autoSave = settings.value("AutoSave", false).toBool();
    currLogSize = settings.value("LogSize", 1).toInt();
    settings.endGroup();
    // lastProbe variable for reject loop when log overflow is occurred
    // see for LogDock::saveLogToFile()
    lastProbe = true;
    setSizePolicy(
                QSizePolicy(
                    QSizePolicy::MinimumExpanding,
                    QSizePolicy::MinimumExpanding));
    int _size = this->fontInfo().pixelSize();
    currentTime = new QLabel(this);
    logSize = new QSpinBox(this);
    logSize->setToolTip("Size of Log (MB)");
    logSize->setRange(1, 100);
    logSize->setSuffix("MB");
    logSize->setValue(currLogSize);
    autoSaveLog = new QCheckBox(this);
    autoSaveLog->setToolTip("AutoSave");
    saveLog = new QPushButton(
                QIcon::fromTheme("document-save"),
                "",
                this);
    saveLog->setToolTip("Save Log to File");
    //saveLog->setMaximumSize(QSize(_size, _size));
    titleLayout = new QHBoxLayout();
    titleLayout->addWidget(currentTime, 0, Qt::AlignRight);
    titleLayout->addStretch(-1);
    titleLayout->addWidget(logSize, 0, Qt::AlignRight);
    titleLayout->addWidget(autoSaveLog, 0, Qt::AlignRight);
    titleLayout->addWidget(saveLog, 0, Qt::AlignRight);
    title = new QWidget(this);
    title->setLayout(titleLayout);
    titleLayout->setMargin(0);
    title->setContentsMargins(0, 0, 10, 0);

    Log = new TextBrowser(this);
    Log->setToolTip(QString(
    "Event/Error Log\nMaxSize:\t%1 Bytes\nCurrent:\t%2")
                    .arg(currLogSize * ONE_MB)
                    .arg(Log->toPlainText().count()));
    connect(Log, SIGNAL(anchorClicked(QUrl)),
            this, SLOT(openLink(QUrl)));

    docLayout = new QVBoxLayout(this);
    docLayout->addWidget(title);
    docLayout->addWidget(Log);
    setLayout(docLayout);
    docLayout->setMargin(0);
    setContentsMargins(0, 0, 0, 0);
    timerId = startTimer(1000);
    connect(logSize, SIGNAL(valueChanged(int)),
            this, SLOT(changeLogSize(int)));
    connect(autoSaveLog, SIGNAL(toggled(bool)),
            saveLog, SLOT(setDisabled(bool)));
    connect(saveLog, SIGNAL(clicked()),
            this, SLOT(_saveLogToFile()));
    autoSaveLog->setChecked(autoSave);
}
Ejemplo n.º 6
0
#endif

    connect(_mediaPlayer->osd(), SIGNAL(backClicked()), ui->actionBack, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(muteClicked()), ui->actionMute, SLOT(toggle()));
    connect(_mediaPlayer->osd(), SIGNAL(nextClicked()), ui->actionNext, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(playClicked()), ui->actionPlay, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(recordNowClicked()), ui->actionRecordNow, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(snapshotClicked()), ui->actionSnapshot, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(stopClicked()), ui->actionStop, SLOT(trigger()));

    connect(_xmltv, SIGNAL(current(QStringList)), _mediaPlayer->osd(), SLOT(setEpg(QStringList)));
    connect(_xmltv, SIGNAL(schedule(QString, XmltvProgrammeModel *)), _scheduleTab, SLOT(setEpg(QString, XmltvProgrammeModel *)));
    connect(_scheduleTab, SIGNAL(requestEpg(QString)), _xmltv, SLOT(request(QString)));
    connect(_scheduleTab, SIGNAL(itemSelected(QString)), _xmltv, SLOT(requestProgramme(QString)));
    connect(_xmltv, SIGNAL(programme(XmltvProgramme *)), _showInfoTab, SLOT(display(XmltvProgramme *)));
    connect(_mediaPlayer->osd(), SIGNAL(openLink(QString)), _xmltv, SLOT(requestProgramme(QString)));
    connect(_showInfoTab, SIGNAL(requestNext(QString, QString)), _xmltv, SLOT(requestProgrammeNext(QString, QString)));
    connect(_showInfoTab, SIGNAL(requestPrevious(QString, QString)), _xmltv, SLOT(requestProgrammePrevious(QString, QString)));
    connect(_playlistTab->playlist(), SIGNAL(scheduleRequested(Channel *)), _scheduleTab, SLOT(channel(Channel *)));

    connect(_mediaPlayer, SIGNAL(stateChanged(Vlc::State)), this, SLOT(setState(Vlc::State)));
    connect(_mediaPlayer, SIGNAL(vout(int)), this, SLOT(showVideo(int)));
    connect(_mediaPlayer, SIGNAL(sessionChannel(int)), _playlistTab->playlist(), SLOT(channelSelected(int)));

    connect(ui->actionRecorder, SIGNAL(triggered(bool)), this, SLOT(showRecorder()));
    connect(ui->actionRecordNow, SIGNAL(toggled(bool)), this, SLOT(recordNow(bool)));
    connect(ui->actionSnapshot, SIGNAL(triggered()), _mediaPlayer, SLOT(takeSnapshot()));

    connect(_showInfoTab, SIGNAL(requestRecord(QString)), _xmltv, SLOT(requestProgrammeRecord(QString)));
    connect(_scheduleTab, SIGNAL(requestRecord(QString)), _xmltv, SLOT(requestProgrammeRecord(QString)));
    connect(_xmltv, SIGNAL(programmeRecord(XmltvProgramme *)), this, SLOT(recordProgramme(XmltvProgramme *)));
Ejemplo n.º 7
0
void HistoryView::openLinkInNewTab()
{
    if (m_clickedIndex.isValid()) {
        emit openLink(m_clickedIndex.data(HistoryModel::UrlRole).toUrl(), OpenInNewTab);
    }
}