Exemple #1
0
void HelpBrowser::languageChange()
{
	setWindowTitle( tr( "Scribus Online Help" ) );
	
	fileMenu->setTitle(tr("&File"));
	editMenu->setTitle(tr("&Edit"));
	bookMenu->setTitle(tr("&Bookmarks"));
	
	filePrint->setText(tr("&Print..."));
	fileExit->setText(tr("&Quit"));
	editFind->setText(tr("&Find..."));
	editFindNext->setText(tr("Find &Next"));
	editFindPrev->setText(tr("Find &Previous"));
	bookAdd->setText(tr("&Add Bookmark"));
	bookDel->setText(tr("&Delete"));
	bookDelAll->setText(tr("D&elete All"));
	Ui::HelpBrowser::retranslateUi(this);
	if (!firstRun)
	{
		QString fname(QDir::cleanPath(textBrowser->source().toLocalFile()));
		QFileInfo fi(fname);
		QString filename(fi.fileName());
		if (ScCore->getGuiLanguage().isEmpty())
			language="en";
		else
			language=ScCore->getGuiLanguage();
		loadMenu();
		if (menuModel!=NULL)
			loadHelp(finalBaseDir + "/" + filename);
	}
	else
		firstRun=false;
}
Exemple #2
0
void HelpBrowser::jumpToHelpSection(const QString& jumpToSection, const QString& jumpToFile, bool dontChangeIfAlreadyLoaded)
{
	QString toLoad;
	bool noDocs=false;
	if (jumpToFile.isEmpty())
	{
		toLoad = finalBaseDir + "/"; //clean this later to handle 5 char locales
		if (jumpToSection.isEmpty())
		{
			QModelIndex index=menuModel->index(0,1);
			if (index.isValid())
			{
				helpNav->listView->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect);
				toLoad += menuModel->data(index, Qt::DisplayRole).toString();
			}
			else
				noDocs=true;
		}
		else if (jumpToSection=="scripter")
		{
 			toLoad+="scripter1.html";
		}
	}
	else
	{
		toLoad=finalBaseDir + "/" + jumpToFile;
	}
	if (!noDocs)
		loadHelp(toLoad);
	else
		if (!dontChangeIfAlreadyLoaded)
			displayNoHelp();
}
QDateDisplayDlg::QDateDisplayDlg(QGraphicsItem *pItem,QWidget *parent) :
        QDialog(parent)
{
    tabWidget = new QTabWidget();
    pDateDisplayGen=new QDateDisplayGeneralDlg();

    tabWidget->addTab(pDateDisplayGen, tr("日期显示"));

    datalist = new QStringList();
    int i = 0;
    for (i=0; i<200; i++)
    {
        datalist->append("");
    }

    buttonBox = new QDialogButtonBox();
    buttonBox->addButton(tr("确定"),QDialogButtonBox::AcceptRole);
    buttonBox->addButton(tr("取消"),QDialogButtonBox::RejectRole);
    buttonBox->addButton(tr("帮助"),QDialogButtonBox::HelpRole);

    connect(buttonBox, SIGNAL(accepted()), this, SLOT(confyButton()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested ()), this, SLOT(loadHelp()));

    mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);
    InitAllProperty(pItem);
    this->setWindowTitle(tr("日期显示"));
    this->resize(420,500);
}
Exemple #4
0
Table::Table(QGraphicsItem *pItem,QWidget *parent) :
        QDialog(parent)
{
    tabWidget = new QTabWidget(this);

    pGeneralDlg = new TableDlg;

    tabWidget->addTab(pGeneralDlg, tr("外观设置"));
    pSecurity = new SecurityWidget(this);
    tabWidget->addTab(pSecurity, tr("权限设置"));
    pSecurity->setGroupVVisible(false);
    pSecurity->setTouchGroupEnabled(false);

    datalist = new QStringList();
    int i = 0;
    for (i=0; i<= 50; i++)
    {
        datalist->append("");
    }

    if(pItem)
    {
        pGeneralDlg->DoubleClickInit(pItem);
        QTableItem* pTable = dynamic_cast<QTableItem *>(pItem);
        if(pTable)
        {
            pSecurity->init(pTable);
        }
    }
    else
    {
        pGeneralDlg->InitParament();
        pSecurity->init(0);
    }

    buttonBox = new QDialogButtonBox();
    buttonBox->addButton(tr("确定"),QDialogButtonBox::AcceptRole);
    buttonBox->addButton(tr("取消"),QDialogButtonBox::RejectRole);
    buttonBox->addButton(tr("帮助"),QDialogButtonBox::HelpRole);


    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested ()), this, SLOT(loadHelp()));


    mainLayout=new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);
    this->setWindowTitle(tr("表格"));

    this->resize(450,500);
}
DataGroupDisplayDlg::DataGroupDisplayDlg(QGraphicsItem *pItem,QWidget *parent) :
    QDialog(parent)
{
    tabWidget = new QTabWidget();
    TrendChartGenDlg=new DataGroupDisplayGenDlg;
    TrendChartPenDlg=new QTrendChartPenDlg;
    TrendChartXYDlg=new QTrendChartXYDlg;
    VisibilityDlg=new QVisibilityDlg;

    datalist = new QStringList();
    int i = 0;
    for (i=0; i <= 200; i++)
    {
       datalist->append("");
    }

    tabWidget->addTab(TrendChartGenDlg, tr("一般"));
    tabWidget->addTab(TrendChartPenDlg, tr("笔"));
    tabWidget->addTab(TrendChartXYDlg, tr("XY轴"));
    tabWidget->addTab(VisibilityDlg, tr("显现"));

    if(pItem)
    {
        TrendChartGenDlg->DoubleClickInit(pItem);
        TrendChartPenDlg->Init(pItem);
        TrendChartXYDlg->Init(pItem);
        VisibilityDlg->Init(pItem);
    }
    else
    {
        TrendChartGenDlg->InitParament();
        TrendChartPenDlg->Init(NULL);
        TrendChartXYDlg->Init(NULL);
        VisibilityDlg->Init(NULL);
    }
    buttonBox = new QDialogButtonBox();
    buttonBox->addButton(tr("确定"),QDialogButtonBox::AcceptRole);
    buttonBox->addButton(tr("取消"),QDialogButtonBox::RejectRole);
    buttonBox->addButton(tr("帮助"),QDialogButtonBox::HelpRole);


    connect(buttonBox, SIGNAL(accepted()), this, SLOT(confyButton()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested ()), this, SLOT(loadHelp()));
    connect(TrendChartGenDlg, SIGNAL(GenNomberofDataChange()), this, SLOT(ChangePenAmount()));
    mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);
    this->setWindowTitle(tr("数据群组显示元件"));

    this->resize(750,600);
}
Exemple #6
0
Starfield::Starfield()
	: pattern(0), patternIter(patternList), messageDisplayTime(0), showHelp(false)
{
	loadHelp();
	patterns::addPatterns(*this);

	changePattern(IterType(patternList.begin(), patternList));
	resetValues();

	for (unsigned int i = 0; i < stars.size(); ++i)
	{
		stars[i] = pattern->newStar();
		stars[i].z = i * stars.size() / 500;
	}
}
Exemple #7
0
StaticText::StaticText(QGraphicsItem *pItem,QWidget *parent) :
    QDialog(parent)
{
    QGraphicsItem *Item;

    tabWidget = new QTabWidget(this);

    pGeneralDlg = new StaticTextDlg ;
    securitywidget = new SecurityWidget;

    tabWidget->addTab(pGeneralDlg, tr("外观设置"));
    tabWidget->addTab(securitywidget, tr("权限设置"));
    if(pItem)
    {
        //pGeneralDlg->OnDoubleClickInit(pItem);
        //pVisibleDlg->Init(pItem);
        Item = dynamic_cast<StaticTextItem *> (pItem)->Clone();
        pGeneralDlg->OnDoubleClickInit(dynamic_cast<StaticTextItem *> (Item));//外观

        securitywidget->init(dynamic_cast<StaticTextItem *> (Item));//权限
    }
    else
    {
        pGeneralDlg->InitParament();
        securitywidget->init(0);
    }

    buttonBox = new QDialogButtonBox();
    buttonBox->addButton(tr("确定"),QDialogButtonBox::AcceptRole);
    buttonBox->addButton(tr("取消"),QDialogButtonBox::RejectRole);
    buttonBox->addButton(tr("帮助"),QDialogButtonBox::HelpRole);

    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested ()), this, SLOT(loadHelp()));


    mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);
    this->setWindowTitle(tr("静态文本"));
    this->setFixedSize(625,510);
    securitywidget->setTouchGroupEnabled(false);
}
QHisTrendDisplayDlg::QHisTrendDisplayDlg(QGraphicsItem *pItem,QWidget *parent) :
        QDialog(parent)
{
    tabWidget = new QTabWidget();
    HisTrendDisplayGenDlg=new QHisTrendDisplayGenDlg;
    HisTrendDisplayPenDlg=new QHisTrendDisplayPenDlg;
    HisTrendDisplayXYDlg=new QHisTrendDisplayXYDlg;
    VisibilityDlg=new QVisibilityDlg;


    datalist = new QStringList();
    int i = 0;
    for (i=0; i <= 200; i++)
    {
        datalist->append("");
    }
    InitAllProperty(pItem);
    tabWidget->addTab(HisTrendDisplayGenDlg, tr("一般"));
    tabWidget->addTab(HisTrendDisplayPenDlg, tr("笔"));
    tabWidget->addTab(HisTrendDisplayXYDlg, tr("XY轴"));
    tabWidget->addTab(VisibilityDlg, tr("显现"));

    buttonBox = new QDialogButtonBox();
    buttonBox->addButton(tr("确定"),QDialogButtonBox::AcceptRole);
    buttonBox->addButton(tr("取消"),QDialogButtonBox::RejectRole);
    buttonBox->addButton(tr("帮助"),QDialogButtonBox::HelpRole);

    // buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
    //                                 | QDialogButtonBox::Cancel);

    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested ()), this, SLOT(loadHelp()));
    connect(HisTrendDisplayGenDlg, SIGNAL(GenNomberofDataChange()), this, SLOT(ChangePenAmount()));

    mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);
    this->setWindowTitle(tr("历史趋势图"));

    this->resize(750,530);

}
Exemple #9
0
QWeekDisplayDlg::QWeekDisplayDlg(QGraphicsItem *pItem,QWidget *parent) :
    QDialog(parent)
{
    tabWidget = new QTabWidget();

    pGeneralDlg = new QWeekDisplayGenDlg;
    pTextDlg = new QWeekDisplaytextDlg;

    tabWidget->addTab(pGeneralDlg, tr("一般"));
    tabWidget->addTab(pTextDlg, tr("文字"));

    buttonBox = new QDialogButtonBox();
    buttonBox->addButton(tr("确定"),QDialogButtonBox::AcceptRole);
    buttonBox->addButton(tr("取消"),QDialogButtonBox::RejectRole);
    buttonBox->addButton(tr("帮助"),QDialogButtonBox::HelpRole);

    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested ()), this, SLOT(loadHelp()));

    connect(pGeneralDlg, SIGNAL(GeneralStateChange()), this, SLOT(OnGeneralStateChange()));
    connect(pGeneralDlg, SIGNAL(txtChange()),this, SLOT(OnSetTextProperty()));

    connect(pTextDlg, SIGNAL(SetTextProperty()), this, SLOT(OnSetTextProperty()));
    connect(pTextDlg, SIGNAL(ClickCell()), this, SLOT(OnClickTextCell()));

    datalist = new QStringList();
    int i = 0;
    for (i = 0; i <= 250; i++)
    {
        datalist->append("");
    }
    InitAllProperty(pItem);
    mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);
    this->setWindowTitle(tr("星期显示"));

    this->resize(450,520);
}
Exemple #10
0
QTimerDlg::QTimerDlg(QGraphicsItem *pItem,QWidget *parent) :
        QDialog(parent)
{
    tabWidget = new QTabWidget();

    pGeneralDlg = new QTimerGenDlg;
    tabWidget->addTab(pGeneralDlg,tr("定时器"));

    buttonBox = new QDialogButtonBox();
    buttonBox->addButton(tr("确定"),QDialogButtonBox::AcceptRole);
    buttonBox->addButton(tr("取消"),QDialogButtonBox::RejectRole);
    buttonBox->addButton(tr("帮助"),QDialogButtonBox::HelpRole);

    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
   connect(buttonBox, SIGNAL(helpRequested ()), this, SLOT(loadHelp()));

    datalist = new QStringList();
    int i = 0;
    for (i=0; i < 20; i++)
    {
        datalist->append("");
    }
    if(pItem)
    {
        pGeneralDlg->DoubleClickInit(pItem);
    }
    else
    {
        pGeneralDlg->InitParament();
    }

    mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);
    this->setWindowTitle(tr("定时器"));

    this->resize(470,600);
}
Exemple #11
0
void HelpWindow::handleLink(const std::string &link)
{
    std::string helpFile = link;
    loadHelp(helpFile);
}
Exemple #12
0
RoundedRectDlg::RoundedRectDlg(QGraphicsItem *item,QWidget *parent) :
    QDialog(parent)
{
    tabWidget = new QTabWidget(this);

    pGeneralDlg = new RoundedRectGenDlg;

    tabWidget->addTab(pGeneralDlg, tr("圆角矩形"));
    if(item)
    {
        if(item->type() == SAM_DRAW_OBJECT_ROUNDEDRECT)
        {
            pSecurity = NULL;
        }
        else
        {
            pSecurity = new SecurityWidget(this);
            tabWidget->addTab(pSecurity, tr("权限设置"));
            pSecurity->setGroupVVisible(false);
            pSecurity->setTouchGroupEnabled(false);
        }
        if(pGeneralDlg)
        {
            pGeneralDlg->setItemType(item->type());
        }
    }
    else
    {
        pSecurity = new SecurityWidget(this);
        tabWidget->addTab(pSecurity, tr("权限设置"));
        pSecurity->setGroupVVisible(false);
        pSecurity->setTouchGroupEnabled(false);
    }

    QPalette palette;
    palette.setColor(QPalette::Background, QColor(224,237,254));
    setPalette(palette);
    //setWindowOpacity(0.95);

    buttonBox = new QDialogButtonBox();
    buttonBox->addButton(tr("确定"),QDialogButtonBox::AcceptRole);
    buttonBox->addButton(tr("取消"),QDialogButtonBox::RejectRole);
    buttonBox->addButton(tr("帮助"),QDialogButtonBox::HelpRole);


    if(item)
    {
        pGeneralDlg->DoubleClickInit(item);
        if(item->type() == SAM_DRAW_OBJECT_ROUNDEDRECT_NEW)
        {
            QRoundedRectBasic* pRoundedRect = dynamic_cast<QRoundedRectBasic*>(item);
            if(pRoundedRect && pSecurity)
            {
                pSecurity->init(pRoundedRect->sPro);
            }
        }
    }
    else
    {
        pGeneralDlg->InitParament();
    }
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested ()), this, SLOT(loadHelp()));

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);

    this->setWindowTitle(tr("圆角矩形"));
    this->setFixedSize(390,435);
    //this->resize(420,500);
}
Exemple #13
0
QValueDlg::QValueDlg(QGraphicsItem *pItem,QWidget *parent) :
    QDialog(parent),
    ui(new Ui::QValueDlg)
{
    QGraphicsItem *Item;
    bInitFlag = false;
    oId = -1;
    pScaleWidget = new QValueScaleDlg;
    pQvalueBace = new QValueBaseDlg(0,pScaleWidget);
    pQvalueShow = new QValueShowDlg;
    pQvalueColor = new QValueColorDlg;
    pSecurityWight = new SecurityWidget;
    pValueDateInput = new QValueDateInputDlg;

    pTabWidget = new QTabWidget(this);

    pTabWidget->addTab(pQvalueBace,tr("基本"));
    pTabWidget->addTab(pQvalueShow,tr("显示"));
    pTabWidget->addTab(pQvalueColor,tr("外观设置"));
    pTabWidget->addTab(pSecurityWight,tr("权限设置"));
    pSecurityWight->setTouchGroupEnabled(false);
    eDataType = DATAINPUTSHOW;
    pTabWidget->setGeometry(QRect(155,10,610,485));

    connect(pQvalueBace, SIGNAL(onTabWightSwitch(int)),this, SLOT(onTabWightSwitch(int)));//接收基本页面发送的页面切换消息
    connect(pQvalueColor, SIGNAL(onDrawSence(QString)),this, SLOT(onDrawSence(QString)));//接收颜色页面字体颜色改变消息
    connect(pQvalueBace, SIGNAL(onDrawSence(QString)),this, SLOT(onDrawSence(QString)));//接收时间页面字符串改变消息
    connect(pQvalueShow, SIGNAL(onDrawSence(QString)),this, SLOT(onDrawSence(QString)));//接收显示页面小数位数改变消息
    connect(pQvalueBace, SIGNAL(onTabWightSwitch(int)),pQvalueShow, SLOT(onTabWightSwitch(int)));//接收基本页面发送的页面切换消息
    connect(pQvalueBace, SIGNAL(onTabWightSwitch(int)),pQvalueColor, SLOT(onTabWightSwitch(int)));//接收基本页面发送的页面切换消息
    connect(pQvalueColor, SIGNAL(addPicture(QGraphicsItem*,QPixmap*,QString,EITEM_TYPE)),this, SLOT(onAddPicture(QGraphicsItem*,QPixmap*,QString,EITEM_TYPE)));
    connect(pQvalueBace, SIGNAL(setRange(double, double, int,int)),pQvalueColor, SLOT(setdataRange(double, double,int,int)));//接收时间页面字符串改变消息
    connect(pQvalueBace, SIGNAL(setDataLength(int,int,bool,bool)),pQvalueShow, SLOT(setDataLength(int,int,bool,bool)));
    connect(pQvalueBace, SIGNAL(getDataLength(int &)),pQvalueShow, SLOT(getDataLength( int &)));
    connect(pQvalueShow, SIGNAL(setDatadefault(int, bool)),pQvalueBace, SLOT(setDatadefault( int ,bool)));

    connect(pQvalueBace, SIGNAL(setRange(double, double, int,int)),pScaleWidget, SLOT(onSetRange(double, double,int,int)));//接收时间页面字符串改变消息

    connect(pQvalueBace, SIGNAL(scaleClicked(bool )),this, SLOT(onScaleClicked(bool )));//接收基本页面发送的缩放消息
    ui->setupUi(this);
    this->setFixedSize(this->size());
    QPalette palette;
    palette.setColor(QPalette::Background, QColor(224,237,254));
    setPalette(palette);
    //setWindowOpacity(0.95);

    connect(ui->m_cancelBtn, SIGNAL(clicked()), this, SLOT(reject()));
    connect(ui->m_helpBtn, SIGNAL(clicked()), this, SLOT(loadHelp()));
    connect(ui->m_okBtn, SIGNAL(clicked()), this, SLOT(confyButton()));

    pScene = new QGraphicsScene(this);//建场景
    ui->MainView->setScene(pScene);

    if(pItem)
    {
        pQvalueShow->Init(NULL);
        pQvalueColor->Init(NULL);
        //pQvalueBace->Init(NULL);
        Item = dynamic_cast<DataDisplayItem *> (pItem)->Clone();
        InitAllProperty(dynamic_cast<DataDisplayItem *> (Item));
    }
    else
    {
        InitAllProperty(NULL);
        ui->m_Titellabel->setText(tr("数值输入/显示"));
    }
    ui->m_okBtn->setFocus();
    bInitFlag = true;
}