Exemplo n.º 1
0
void medPacsSelector::readSettings( void )
{

    QList<QVariant> nodes;

    QSettings settings;

    settings.beginGroup("medBrowserPacsNodesToolBox");
    nodes = settings.value("nodes").toList();
    settings.endGroup();

    fillWidget(nodes);

}
void medBrowserPacsNodesToolBox::readSettings(void)
{
    QList<QVariant> nodes;

    QSettings settings;

    settings.beginGroup("medBrowserPacsHostToolBox");
    d->hostTitle = settings.value("title").toString();
    d->hostAddress = settings.value("address").toString();
    d->hostPort = settings.value("port").toString();
    settings.endGroup();

    settings.beginGroup("medBrowserPacsNodesToolBox");
    nodes = settings.value("nodes").toList();
    settings.endGroup();

    fillWidget(nodes);

}
ReorderDialog::ReorderDialog(QWidget *parent, SoundFileList *list) :
    QDialog(parent),
    ui(new Ui::ReorderDialog)
{
    qDebug("Entering ReorderDialog::ReorderDialog()...");
    ui->setupUi(this);

    this->list = list;

    fillWidget(0);

    connect(list, SIGNAL(moved(int)), this, SLOT(fillWidget(int)));

    connect(ui->bottom, SIGNAL(clicked()), this, SLOT(moveBottom()));
    connect(ui->down, SIGNAL(clicked()), this, SLOT(moveDown()));
    connect(ui->down10, SIGNAL(clicked()), this, SLOT(moveTenDown()));
    connect(ui->up10, SIGNAL(clicked()), this, SLOT(moveTenUp()));
    connect(ui->up, SIGNAL(clicked()), this, SLOT(moveUp()));
    connect(ui->top, SIGNAL(clicked()), this, SLOT(moveTop()));
}
Exemplo n.º 4
0
StatisticsDialog::StatisticsDialog(KileProject *project, KileDocument::TextInfo* docinfo, QWidget* parent,
                                   KTextEditor::View *view, const char* name, const QString &caption)
		: KPageDialog(parent), m_project(project), m_docinfo(docinfo), m_view(view)
{
	setObjectName(name);
	setFaceType(Tabbed);
	setCaption(caption);
	setModal(true);
	setButtons(Help | Close | User1 | User2);
	setDefaultButton(Close);
	showButtonSeparator(false);

	setButtonText(User1, i18n("Copy"));
	setButtonText(User2, i18n("Copy as LaTeX"));
	setHelp("statistics");

	m_summarystats = new long[SIZE_STAT_ARRAY];
	m_summarystats[0] = m_summarystats[1] = m_summarystats[2] = m_summarystats[3] = m_summarystats[4] = m_summarystats[5] = 0;

	const long* stats;
	QString tempName;
	KileWidget::StatisticsWidget* tempWidget;
	KileWidget::StatisticsWidget* summary;
	KileDocument::TextInfo* tempDocinfo;

	m_hasSelection = false; // class variable, if the user has selected text,
	summary = new KileWidget::StatisticsWidget(mainWidget());
	KPageWidgetItem *itemSummary = new KPageWidgetItem(summary, i18n("Summary"));
	addPage(itemSummary);
	summary->m_commentAboutHelp->setText(i18n("For information about the accuracy see the Help."));
	// we have in every case a summary tab

	m_pagetowidget[itemSummary] = summary;
	m_pagetoname[itemSummary] = i18n("Summary");

	if (m_docinfo->getDoc()->activeView()->selection()) { // the user should really have that doc as active in which the selection is
		m_hasSelection = true;
	}

	if (!m_project) { // the active doc doesn't belong to a project
		setCaption(i18n("Statistics for %1", m_docinfo->getDoc()->url().fileName()));
		stats = m_docinfo->getStatistics(m_view);
		fillWidget(stats, summary);
	}
	else { // active doc belongs to a project
		setCaption(i18n("Statistics for the Project %1", m_project->name()));
		KILE_DEBUG() << "Project file is " << project->baseURL() << endl;

		QList<KileProjectItem*> items = project->items();

		if (m_hasSelection) { // if the active doc has a selection
			stats = m_docinfo->getStatistics(m_view);
			fillWidget(stats, summary); // if yes we fill the summary widget and are finished
		}
		else {
			for(QList<KileProjectItem*>::iterator i = items.begin(); i != items.end(); ++i) {
				KileProjectItem *item = *i;

				if (item->type() ==  KileProjectItem::ProjectFile) { // ignore project files
					continue;
				}

				tempDocinfo = item->getInfo();
				if(tempDocinfo && tempDocinfo->getDoc()) { // closed items don't have a doc
					tempName = tempDocinfo->getDoc()->url().fileName();
					stats = tempDocinfo->getStatistics(m_view);

					for (uint j = 0; j < SIZE_STAT_ARRAY; j++) {
						m_summarystats[j] += stats[j];
					}

					tempWidget = new KileWidget::StatisticsWidget();
					KPageWidgetItem *itemTemp = new KPageWidgetItem(tempWidget, tempName);
					addPage(itemTemp);
					KILE_DEBUG() << "TempName is " << tempName << endl;
					m_pagetowidget[itemTemp] = tempWidget;
					m_pagetoname[itemTemp] = tempName;
					fillWidget(stats, tempWidget);
				}
				else {
					m_notAllFilesOpenWarning = true; // print warning
				}
			}

			fillWidget(m_summarystats, summary);
			if (m_notAllFilesOpenWarning) {
				summary->m_warning->setText(i18n("To get statistics for all project files, you have to open them all."));
			}

			KILE_DEBUG() << "All keys in name " << m_pagetoname.keys() << " Nr. of keys " << m_pagetowidget.count() << endl;
			KILE_DEBUG() << "All keys in widget " << m_pagetowidget.keys() << " Nr. of keys " << m_pagetowidget.count() << endl;
		}
	}
//  setInitialSize( QSize(550,560), true);
}