RegisteredUserPropertiesDialog::RegisteredUserPropertiesDialog(QWidget * p,KviPointerHashTable<QString,QString> * dict)
: QDialog(p)
{
	setObjectName("property_editor");
	setWindowModality(Qt::WindowModal);
	m_pPropertyDict = dict;

	setWindowTitle(__tr2qs_ctx("Property Editor","register"));
	setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Linux)));

	QGridLayout * g = new QGridLayout(this);

	m_pTable = new QTableWidget(this);
	//g->addMultiCellWidget(m_pTable,0,1,0,1);
	g->addWidget(m_pTable,0,0);
	m_pTable->setColumnCount(2);
	m_pTable->setSelectionMode(QAbstractItemView::SingleSelection);
	m_pTable->setSelectionBehavior(QAbstractItemView::SelectRows);

	QStringList header;
	header.append(__tr2qs_ctx("Property","register"));
	header.append(__tr2qs_ctx("Value","register"));
	m_pTable->setHorizontalHeaderLabels(header);

	m_pTable->setMinimumSize(250,250);
	//connect(m_pTable,SIGNAL(valueChanged(int,int)),this,SLOT(propertyValueChanged(int,int)));

	KviTalVBox * vb = new KviTalVBox(this);
	vb->setSpacing(4);
	g->addWidget(vb,0,1,0,3);

	m_pAddButton = new QPushButton(__tr2qs_ctx("&New","register"),vb);
	connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked()));
	m_pAddButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem)));

	m_pDelButton = new QPushButton(__tr2qs_ctx("&Remove","register"),vb);
	connect(m_pDelButton,SIGNAL(clicked()),this,SLOT(delClicked()));
	m_pDelButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DeleteItem)));

	KviTalHBox * b = new KviTalHBox(this);
	b->setSpacing(4);
	//g->addMultiCellWidget(b,2,2,1,2);
	g->addWidget(b,1,1);
	QPushButton * pb = new QPushButton(__tr2qs_ctx("&OK","register"),b);
	connect(pb,SIGNAL(clicked()),this,SLOT(okClicked()));
	pb->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)));

	pb = new QPushButton(__tr2qs_ctx("Cancel","register"),b);
	connect(pb,SIGNAL(clicked()),this,SLOT(reject()));
	pb->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)));

	g->setRowStretch(1,1);
	g->setColumnStretch(0,1);

	fillData();
}
Exemple #2
0
void Staff::on_delBtn_clicked()
{
    emit delClicked(id);
}
Exemple #3
0
void MythUIVirtualKeyboard::updateKeys(bool connectSignals)
{
    QList<MythUIType *> *children = GetAllChildren();
    for (int i = 0; i < children->size(); ++i)
    {
        MythUIButton *button = dynamic_cast<MythUIButton *>(children->at(i));
        if (button)
        {
            if (m_keyMap.contains(button->objectName()))
            {
                KeyDefinition key = m_keyMap.value(button->objectName());
                button->SetText(getKeyText(key));

                if (connectSignals)
                {
                    if (key.type == "shift")
                    {
                        if (!m_shiftLButton)
                            m_shiftLButton = button;
                        else if (!m_shiftRButton)
                            m_shiftRButton = button;

                        button->SetLockable(true);
                        connect(button, SIGNAL(Clicked()), SLOT(shiftClicked()));
                    }
                    else if (key.type == "char")
                        connect(button, SIGNAL(Clicked()), SLOT(charClicked()));
                    else if (key.type == "done")
                        connect(button, SIGNAL(Clicked()), SLOT(returnClicked()));
                    else if (key.type == "del")
                        connect(button, SIGNAL(Clicked()), SLOT(delClicked()));
                    else if (key.type == "lock")
                    {
                        m_lockButton = button;
                        m_lockButton->SetLockable(true);
                        connect(m_lockButton, SIGNAL(Clicked()), SLOT(lockClicked()));
                    }
                    else if (key.type == "alt")
                    {
                        m_altButton = button;
                        m_altButton->SetLockable(true);
                        connect(m_altButton, SIGNAL(Clicked()), SLOT(altClicked()));
                    }
                    else if (key.type == "comp")
                    {
                        m_compButton = button;
                        m_compButton->SetLockable(true);
                        connect(m_compButton, SIGNAL(Clicked()), SLOT(compClicked()));
                    }
                    else if (key.type == "moveleft")
                        connect(button, SIGNAL(Clicked()), SLOT(moveleftClicked()));
                    else if (key.type == "moveright")
                        connect(button, SIGNAL(Clicked()), SLOT(moverightClicked()));
                    else if (key.type == "back")
                        connect(button, SIGNAL(Clicked()), SLOT(backClicked()));
                }
            }
            else
                LOG(VB_GENERAL, LOG_WARNING,
                    QString("WARNING - Key '%1' not found in map")
                        .arg(button->objectName()));
        }
    }
}
AdminSailingTimesItem::AdminSailingTimesItem(QString id, QString cat, SaverDbSailingTimes data, QStringList islands, QWidget *parent) : QWidget(parent) {

	allData = data;
	this->islands = islands;
	this->id = id;
	category = cat;

	fromIsland = (data.from == cat);
	toIsland = (data.to == cat);

	// THIS IS THE LAYOUT STRUCTURE:
	/****************************************************************************************
	 *		islands				time	*			*	*
	 ********************************************************	dates		*  del	*
	 *			days				*			*	*
	 ****************************************************************************************/



	// The first row containing the islands and the time


	QLabel *labelSailingFrom = new QLabel("Sailing from");
	labelSailingFrom->setStyleSheet("font-weight: bold");


	QLabel *islandFixed = new QLabel(cat);
	islandFixed->setStyleSheet("font-weight: bold");

	QLabel *labelSailingTo = new QLabel("to");
	labelSailingTo->setStyleSheet("font-weight: bold");

	islandVariable = new QComboBox;
	islandVariable->setStyleSheet("font-weight: bold");
	islandVariable->addItem("Mainland");
	for(int j = 0; j < islands.length(); ++j) {
		islandVariable->addItem(islands.at(j));
		if(islands.at(j) == data.to && !fromIsland) islandVariable->setCurrentIndex(j+1);
	}
	if((fromIsland && !toIsland) || (!fromIsland && toIsland)) islandVariable->setCurrentIndex(0);



	QLabel *timeLabel = new QLabel("at");
	timeLabel->setStyleSheet("font-weight: bold");
	time = new Clock;
	time->setStyleSheet("font-weight: bold");
	time->setTime(QTime(data.sailingtime/100,data.sailingtime%100));


	QHBoxLayout *islandTimesLay = new QHBoxLayout;
	islandTimesLay->addWidget(labelSailingFrom);
	if(fromIsland) islandTimesLay->addWidget(islandFixed);
	else islandTimesLay->addWidget(islandVariable);
	islandTimesLay->addWidget(labelSailingTo);
	if(fromIsland) islandTimesLay->addWidget(islandVariable);
	else islandTimesLay->addWidget(islandFixed);
	islandTimesLay->addWidget(timeLabel);
	islandTimesLay->addWidget(time);
	islandTimesLay->addSpacing(10);
	islandTimesLay->addStretch();



	// The part containing checkboxes for all the days


	QHBoxLayout *dayLay = new QHBoxLayout;

	QStringList days;
	days << "Mo" << "Tue" << "Wed" << "Thu" << "Fri" << "Sat" << "Sun";
	for(int j = 0; j < days.length(); ++j) {
		QCheckBox *ch = new QCheckBox(days.at(j));
		ch->setCursor(Qt::PointingHandCursor);
		allDays.append(ch);
		if(data.daysofweek.at(j) == *"1") ch->setChecked(true);
		dayLay->addWidget(ch);
	}

	QVBoxLayout *islandsTimesDaysLay = new QVBoxLayout;
	islandsTimesDaysLay->addLayout(islandTimesLay);
	islandsTimesDaysLay->addLayout(dayLay);


	// the two rows of dates (start and end)

	QLabel *dateStartLabel = new QLabel("Starting:");
	dateStart = new DateEdit(150,"dd MMMM yyyy");
	dateStart->setDate(data.start);
	dateStart->setNoDateLimits();
	QHBoxLayout *dateStartLay = new QHBoxLayout;
	dateStartLay->addWidget(dateStartLabel);
	dateStartLay->addWidget(dateStart);

	QLabel *dateEndLabel = new QLabel("Ending:");
	dateEnd = new DateEdit(150,"dd MMMM yyyy");
	dateEnd->setDate(data.end);
	dateEnd->setNoDateLimits();
	QHBoxLayout *dateEndLay = new QHBoxLayout;
	dateEndLay->addWidget(dateEndLabel);
	dateEndLay->addWidget(dateEnd);

	QVBoxLayout *dateLay = new QVBoxLayout;
	dateLay->addLayout(dateStartLay);
	dateLay->addLayout(dateEndLay);


	// A delete button

	QPushButton *del = new QPushButton("X");
	del->setFixedWidth(40);
	del->setCursor(Qt::PointingHandCursor);
	del->setStyleSheet("font-weight: bold; color: red");
	connect(del, SIGNAL(clicked()), this, SLOT(delClicked()));



	// The main layout combining all the elements above

	QHBoxLayout *lay = new QHBoxLayout;
	lay->addStretch();
	lay->addLayout(islandsTimesDaysLay);
	lay->addSpacing(10);
	lay->addLayout(dateLay);
	lay->addSpacing(10);
	lay->addWidget(del);
	lay->addStretch();

	this->setLayout(lay);

}
Exemple #5
0
KHTMLSearchConfig::KHTMLSearchConfig(QWidget *parent, const char *name)
  : KCModule(parent, name), indexProc(0)
{
  QVBoxLayout *vbox = new QVBoxLayout(this, 5);


  QGroupBox *gb = new QGroupBox(i18n("ht://dig"), this);
  vbox->addWidget(gb);

  QGridLayout *grid = new QGridLayout(gb, 3,2, 6,6);

  grid->addRowSpacing(0, gb->fontMetrics().lineSpacing());

  QLabel *l = new QLabel(i18n("The fulltext search feature makes use of the "
                  "ht://dig HTML search engine. "
                  "You can get ht://dig at the"), gb);
  l->setAlignment(QLabel::WordBreak);
  l->setMinimumSize(l->sizeHint());
  grid->addMultiCellWidget(l, 1, 1, 0, 1);
  QWhatsThis::add( gb, i18n( "Information about where to get the ht://dig package." ) );

  KURLLabel *url = new KURLLabel(gb);
  url->setURL("http://www.htdig.org");
  url->setText(i18n("ht://dig home page"));
  url->setAlignment(QLabel::AlignHCenter);
  grid->addMultiCellWidget(url, 2,2, 0, 1);
  connect(url, SIGNAL(leftClickedURL(const QString&)),
      this, SLOT(urlClicked(const QString&)));

  gb = new QGroupBox(i18n("Program Locations"), this);

  vbox->addWidget(gb);
  grid = new QGridLayout(gb, 4,2, 6,6);
  grid->addRowSpacing(0, gb->fontMetrics().lineSpacing());

  htdigBin = new KURLRequester(gb);
  l = new QLabel(htdigBin, i18n("ht&dig"), gb);
  l->setBuddy( htdigBin );
  grid->addWidget(l, 1,0);
  grid->addWidget(htdigBin, 1,1);
  connect(htdigBin->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(configChanged()));
  QString wtstr = i18n( "Enter the path to your htdig program here, e.g. /usr/local/bin/htdig" );
  QWhatsThis::add( htdigBin, wtstr );
  QWhatsThis::add( l, wtstr );

  htsearchBin = new KURLRequester(gb);
  l = new QLabel(htsearchBin, i18n("ht&search"), gb);
  l->setBuddy( htsearchBin );
  grid->addWidget(l, 2,0);
  grid->addWidget(htsearchBin, 2,1);
  connect(htsearchBin->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(configChanged()));
  wtstr = i18n( "Enter the path to your htsearch program here, e.g. /usr/local/bin/htsearch" );
  QWhatsThis::add( htsearchBin, wtstr );
  QWhatsThis::add( l, wtstr );

  htmergeBin = new KURLRequester(gb);
  l = new QLabel(htmergeBin, i18n("ht&merge"), gb);
  l->setBuddy( htmergeBin );
  grid->addWidget(l, 3,0);
  grid->addWidget(htmergeBin, 3,1);
  connect(htmergeBin->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(configChanged()));
  wtstr = i18n( "Enter the path to your htmerge program here, e.g. /usr/local/bin/htmerge" );
  QWhatsThis::add( htmergeBin, wtstr );
  QWhatsThis::add( l, wtstr );

  QHBoxLayout *hbox = new QHBoxLayout(vbox);

  gb = new QGroupBox(i18n("Scope"), this);
  hbox->addWidget(gb);
  QWhatsThis::add( gb, i18n( "Here you can select which parts of the documentation should be included in the fulltext search index. Available options are the KDE Help pages, the installed man pages, and the installed info pages. You can select any number of these." ) );

  QVBoxLayout *vvbox = new QVBoxLayout(gb, 6,2);
  vvbox->addSpacing(gb->fontMetrics().lineSpacing());

  indexKDE = new QCheckBox(i18n("&KDE help"), gb);
  vvbox->addWidget(indexKDE);
  connect(indexKDE, SIGNAL(clicked()), this, SLOT(configChanged()));

  indexMan = new QCheckBox(i18n("&Man pages"), gb);
  vvbox->addWidget(indexMan);
  indexMan->setEnabled(false),
  connect(indexMan, SIGNAL(clicked()), this, SLOT(configChanged()));

  indexInfo = new QCheckBox(i18n("&Info pages"), gb);
  vvbox->addWidget(indexInfo);
  indexInfo->setEnabled(false);
  connect(indexInfo, SIGNAL(clicked()), this, SLOT(configChanged()));

  gb = new QGroupBox(i18n("Additional Search Paths"), this);
  hbox->addWidget(gb);
  QWhatsThis::add( gb, i18n( "Here you can add additional paths to search for documentation. To add a path, click on the <em>Add...</em> button and select the folder from where additional documentation should be searched. You can remove folders by clicking on the <em>Delete</em> button." ) );

  grid = new QGridLayout(gb, 4,3, 6,2);
  grid->addRowSpacing(0, gb->fontMetrics().lineSpacing());

  addButton = new QPushButton(i18n("Add..."), gb);
  grid->addWidget(addButton, 1,0);

  delButton = new QPushButton(i18n("Delete"), gb);
  grid->addWidget(delButton, 2,0);

  searchPaths = new KListBox(gb);
  grid->addMultiCellWidget(searchPaths, 1,3, 1,1);
  grid->setRowStretch(2,2);

  gb = new QGroupBox(i18n("Language Settings"), this);
  vbox->addWidget(gb);
  QWhatsThis::add(gb, i18n("Here you can select the language you want to create the index for."));
  language = new KLanguageCombo(gb);
  l = new QLabel(language, i18n("&Language"), gb);
  vvbox = new QVBoxLayout(gb, 6,2);
  vvbox->addSpacing(gb->fontMetrics().lineSpacing());
  hbox = new QHBoxLayout(vvbox, 6);
  hbox->addWidget(l);
  hbox->addWidget(language,1);
  hbox->addStretch(1);

  loadLanguages();

  vbox->addStretch(1);

  runButton = new QPushButton(i18n("Generate Index..."), this);
  QWhatsThis::add( runButton, i18n( "Click this button to generate the index for the fulltext search." ) );
  runButton->setFixedSize(runButton->sizeHint());
  vbox->addWidget(runButton, AlignRight);
  connect(runButton, SIGNAL(clicked()), this, SLOT(generateIndex()));

  connect(addButton, SIGNAL(clicked()), this, SLOT(addClicked()));
  connect(delButton, SIGNAL(clicked()), this, SLOT(delClicked()));
  connect(searchPaths, SIGNAL(highlighted(const QString &)),
      this, SLOT(pathSelected(const QString &)));

  checkButtons();

  load();
}