void CombinedSymbolSettings::symbolChanged(int index)
{
	if (symbol_edits[index]->symbol() != NULL)
		symbol->setPart(index, symbol_edits[index]->symbol(), false);
	else if (symbol_edits[index]->customID() > 0)
	{
		// Changing to a private symbol
		Symbol::Type new_symbol_type;
		if (symbol_edits[index]->customID() == 1)
			new_symbol_type = Symbol::Line;
		else // if (symbol_edits[index]->customID() == 2)
			new_symbol_type = Symbol::Area;
		
		Symbol* new_symbol = NULL;
		if (symbol->getPart(index) != NULL && new_symbol_type == symbol->getPart(index)->getType())
		{
			if (QMessageBox::question(this, tr("Change from public to private symbol"),
				tr("Take the old symbol as template for the private symbol?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
			{
				new_symbol = symbol->getPart(index)->duplicate();
			}
		}
		
		if (new_symbol == NULL)
			new_symbol = Symbol::getSymbolForType(new_symbol_type);
		
		symbol->setPart(index, new_symbol, true);
		editClicked(index);
	}
	else
		symbol->setPart(index, NULL, false);
	
	edit_buttons[index]->setEnabled(symbol->isPartPrivate(index));
	emit propertiesModified();
}
NoteView::NoteView(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::NoteView)
{
    //initialize controller
    ui->setupUi(this);
    this->_controller = new NoteController();

    //prepare green button
    QFile data(":/new/prefix1/greenButton.qss");
    data.open(QFile::ReadOnly);
    QTextStream styleIn(&data);
    this->_greenButton = styleIn.readAll();
    data.close();

    //fix screen size
    this->setFixedSize(this->width(), this->height());

    //setup error fields
    ui->addError->setStyleSheet("QLabel {color:red};");
    ui->bodyError->setStyleSheet("QLabel {color:red};");
    clear();

    //connect signals and slots
    connect(ui->doneButton, SIGNAL(clicked()), this, SLOT(doneClicked()));
    connect(ui->nextButton, SIGNAL(clicked()), this, SLOT(nextClicked()));
    connect(ui->prevButton, SIGNAL(clicked()), this, SLOT(prevClicked()));
    connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));
    connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addClicked()));
    connect(ui->editButton,SIGNAL(clicked()),this,SLOT(editClicked()));
}
Example #3
0
QWidget* medDatabaseDataSource::mainViewWidget()
{
    if(d->mainWidget.isNull())
    {
        d->mainWidget = new QWidget;
        d->largeView = new medDatabaseView(d->mainWidget);
        d->largeView->setModel(d->proxy);

        QVBoxLayout *database_layout = new QVBoxLayout(d->mainWidget);
        database_layout->setContentsMargins(0, 0, 0, 0);
        database_layout->setSpacing(0);
        database_layout->addWidget(d->largeView);

        connect(d->largeView, SIGNAL(open(const medDataIndex&)), this, SIGNAL(open(const medDataIndex&)));
        connect(d->largeView, SIGNAL(exportData(const medDataIndex&)), this, SIGNAL(exportData(const medDataIndex&)));
        connect(d->largeView, SIGNAL(dataRemoved(const medDataIndex&)), this, SIGNAL(dataRemoved(const medDataIndex&)));

        if(!d->toolBoxes.isEmpty())
        {
            connect(d->actionsToolBox, SIGNAL(removeClicked()), d->largeView, SLOT(onRemoveSelectedItemRequested()));
            connect(d->actionsToolBox, SIGNAL(exportClicked()), d->largeView, SLOT(onExportSelectedItemRequested()));
            connect(d->actionsToolBox, SIGNAL(viewClicked()), d->largeView, SLOT(onViewSelectedItemRequested()));
            connect(d->actionsToolBox, SIGNAL(saveClicked()), d->largeView, SLOT(onSaveSelectedItemRequested()));
            connect(d->actionsToolBox, SIGNAL(newPatientClicked()), d->largeView, SLOT(onCreatePatientRequested()));
            connect(d->actionsToolBox, SIGNAL(newStudyClicked()), d->largeView, SLOT(onCreateStudyRequested()));
            connect(d->actionsToolBox, SIGNAL(editClicked()), d->largeView, SLOT(onEditRequested()));

            connect(d->largeView, SIGNAL(patientClicked(const medDataIndex&)), d->actionsToolBox, SLOT(patientSelected(const medDataIndex&)));
            connect(d->largeView, SIGNAL(seriesClicked(const medDataIndex&)), d->actionsToolBox, SLOT(seriesSelected(const medDataIndex&)));
            connect(d->largeView, SIGNAL(noPatientOrSeriesSelected()), d->actionsToolBox, SLOT(noPatientOrSeriesSelected()));
            connect(d->largeView, SIGNAL(multipleEntriesSelected(const QVector<medDataIndex>&)), d->actionsToolBox, SLOT(multipleEntriesSelected(const QVector<medDataIndex>&)));
        }
Example #4
0
RateCenterManager::RateCenterManager
(
	QWidget* parent,
	const char* name
) : TAAWidget(parent)
{
    setCaption( "Rate Center Manager" );

    rcList = new Q3ListView(this, "Rate Center Manager");
    rcList->setAllColumnsShowFocus(true);
    rcList->setRootIsDecorated(true);
    rcList->addColumn("Country/State/City");
    rcList->addColumn("Active");
    rcList->addColumn("Avail");
    rcList->addColumn("Total");
    connect(rcList, SIGNAL(doubleClicked(Q3ListViewItem *)), this, SLOT(itemDoubleClicked(Q3ListViewItem *)));

    activeColumn    = 1;
    availColumn     = 2;
    totalColumn     = 3;
    idColumn        = 4;

    rcList->setColumnAlignment(activeColumn, Qt::AlignRight);
    rcList->setColumnAlignment(availColumn,  Qt::AlignRight);
    rcList->setColumnAlignment(totalColumn,  Qt::AlignRight);


    addButton = new QPushButton(this, "Add Button");
    addButton->setText("&Add");
    connect(addButton, SIGNAL(clicked()), this, SLOT(addClicked()));

    editButton = new QPushButton(this, "Edit Button");
    editButton->setText("&Edit");
    connect(editButton, SIGNAL(clicked()), this, SLOT(editClicked()));

    deleteButton = new QPushButton(this, "Delete Button");
    deleteButton->setText("&Delete");
    connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));
    deleteButton->setEnabled(false);

    closeButton = new QPushButton(this, "Close Button");
    closeButton->setText("&Close");
    connect(closeButton, SIGNAL(clicked()), this, SLOT(closeClicked()));

    Q3BoxLayout  *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3);
    ml->addWidget(rcList, 1);

    
    Q3BoxLayout  *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 1);
    bl->addStretch(1);
    bl->addWidget(addButton, 0);
    bl->addWidget(editButton, 0);
    bl->addWidget(deleteButton, 0);
    bl->addWidget(closeButton, 0);

    ml->addLayout(bl, 0);

    refreshRateCenters();
}
EditCalendarsPage::EditCalendarsPage(QWidget *parent)
    :QWidget(parent),
    m_manager(0)
{
    m_calendarList = new QListWidget(this);
    connect(m_calendarList, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(itemDoubleClicked(QListWidgetItem *)));

#ifndef Q_OS_SYMBIAN
    // Add push buttons for non-Symbian platforms as they do not support soft keys
    QHBoxLayout* hbLayout = new QHBoxLayout();
    QPushButton *addButton = new QPushButton("Add new", this);
    connect(addButton,SIGNAL(clicked()), this, SIGNAL(addClicked()));
    hbLayout->addWidget(addButton);
    QPushButton *editButton = new QPushButton("Edit", this);
    connect(editButton,SIGNAL(clicked()),this,SLOT(editClicked()));
    hbLayout->addWidget(editButton);
    QPushButton *deleteButton = new QPushButton("Delete", this);
    connect(deleteButton,SIGNAL(clicked()),this,SLOT(deleteClicked()));
    hbLayout->addWidget(deleteButton);
    QPushButton *backButton = new QPushButton("Back", this);
    connect(backButton,SIGNAL(clicked()),this,SLOT(backClicked()));
    hbLayout->addWidget(backButton);
#endif

    QVBoxLayout *scrollAreaLayout = new QVBoxLayout();
    scrollAreaLayout->addWidget(m_calendarList);

#ifndef Q_OS_SYMBIAN
    scrollAreaLayout->addLayout(hbLayout);
#endif

    QScrollArea *scrollArea = new QScrollArea(this);
    scrollArea->setWidgetResizable(true);
    QWidget *formContainer = new QWidget(scrollArea);
    formContainer->setLayout(scrollAreaLayout);
    scrollArea->setWidget(formContainer);

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

    // Add softkeys
    QAction* cancelSoftKey = new QAction("Back", this);
    cancelSoftKey->setSoftKeyRole(QAction::NegativeSoftKey);
    addAction(cancelSoftKey);
    connect(cancelSoftKey, SIGNAL(triggered(bool)), this, SLOT(backClicked()));

    QAction* editSoftKey = new QAction("Edit",this);
    editSoftKey->setSoftKeyRole(QAction::PositiveSoftKey); // Perhaps SelectSoftKey
    addAction(editSoftKey);
    connect(editSoftKey, SIGNAL(triggered(bool)), this, SLOT(editClicked()));
}
ListEditButtonsWidget::ListEditButtonsWidget(QWidget *parent) :
    QWidget(parent),
    m_addButton(new QPushButton(tr("Add"))),
    m_removeButton(new QPushButton(tr("Remove"))),
    m_editButton(new QPushButton(tr("Edit")))
{
    QHBoxLayout *layout = new QHBoxLayout(this);
    layout->setSpacing(10);
    layout->addStretch();
    layout->addWidget(m_addButton);
    layout->addWidget(m_removeButton);
    layout->addWidget(m_editButton);
    setLayout(layout);

    connect(m_addButton, SIGNAL(clicked()), this, SIGNAL(addClicked()));
    connect(m_removeButton, SIGNAL(clicked()), this, SIGNAL(removeClicked()));
    connect(m_editButton, SIGNAL(clicked()), this, SIGNAL(editClicked()));
}
Example #7
0
SharedFilesWindow::SharedFilesWindow()
: KviWindow(KviWindow::Tool,"shared files window",0)
{
	g_pSharedFilesWindow = this;
	m_pSplitter = new KviTalSplitter(Qt::Horizontal,this);
	m_pSplitter->setObjectName("sharedfiles_splitter");

	KviTalVBox * vbox = new KviTalVBox(m_pSplitter);

	m_pTreeWidget  = new KviThemedTreeWidget(vbox, this, "sharedfileswindow_treewidget");
	//m_pTreeWidget->header()->hide();
	m_pTreeWidget->setAllColumnsShowFocus(true);
	QStringList columsLabels;
	columsLabels.append(__tr2qs_ctx("Name","sharedfileswindow"));
	columsLabels.append(__tr2qs_ctx("Filename","sharedfileswindow"));
	columsLabels.append(__tr2qs_ctx("Mask","sharedfileswindow"));

	columsLabels.append(__tr2qs_ctx("Expires","sharedfileswindow"));
	m_pTreeWidget->setHeaderLabels(columsLabels);
	m_pTreeWidget->setColumnWidth(0,200);
	m_pTreeWidget->setColumnWidth(0,300);
	m_pTreeWidget->setColumnWidth(0,300);
	m_pTreeWidget->setColumnWidth(0,200);

	m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
	connect(m_pTreeWidget,SIGNAL(itemSelectionChanged()),this,SLOT(enableButtons()));

	connect(g_pSharedFilesManager,SIGNAL(sharedFilesChanged()),this,SLOT(fillFileView()));
	connect(g_pSharedFilesManager,SIGNAL(sharedFileAdded(KviSharedFile *)),this,SLOT(sharedFileAdded(KviSharedFile *)));
	connect(g_pSharedFilesManager,SIGNAL(sharedFileRemoved(KviSharedFile *)),this,SLOT(sharedFileRemoved(KviSharedFile *)));

	KviTalHBox * b = new KviTalHBox(vbox);

	m_pAddButton = new QPushButton(__tr2qs_ctx("&Add...","sharedfileswindow"),b);
	connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked()));
	m_pRemoveButton = new QPushButton(__tr2qs_ctx("Re&move","sharedfileswindow"),b);
	connect(m_pRemoveButton,SIGNAL(clicked()),this,SLOT(removeClicked()));
	m_pEditButton = new QPushButton(__tr2qs_ctx("&Edit","sharedfileswindow"),b);
	connect(m_pEditButton,SIGNAL(clicked()),this,SLOT(editClicked()));

	fillFileView();
}
ManageTeachersWidget::ManageTeachersWidget(MainController *mainController, QWidget *parent) :
		QWidget(parent),
		m_ui(new Ui::ManageTeachersWidget),
		m_mainController(mainController),
		m_schoolDatabase(mainController->schoolData()->schoolDatabase())

{
	m_ui->setupUi(this);

	m_selectTeacherWidget = new SelectTeacherWidget(this);
	m_ui->verticalLayout->insertWidget(0, m_selectTeacherWidget);
	m_selectTeacherWidget->setTeacherTableModel(m_mainController->teacherTableModel());
	m_selectTeacherWidget->teacherTable()->
			hideColumn(TeacherTableModel::TeacherSelected);

	connect(m_ui->addTeacherButton, SIGNAL(clicked()), this, SLOT(addClicked()));
	connect(m_ui->editTeacherButton, SIGNAL(clicked()), this, SLOT(editClicked()));
	connect(m_ui->deleteTeacherButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));
	connect(m_selectTeacherWidget->teacherTable()->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(setEditButtons()));

	setEditButtons();
}
Example #9
0
TabsSettings::TabsSettings ( QWidget *parent, const char *name )
	: QWidget ( parent, name )
{
	QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 );

	QLabel *l = new QLabel ( tr( "Launcher Tabs:" ), this );
	lay-> addMultiCellWidget ( l, 0, 0, 0, 1 );

	m_list = new QListBox ( this );
	lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 );

	QWhatsThis::add ( m_list, tr( "foobar" ));

	QPushButton *p1;
	p1 = new QPushButton ( tr( "Edit" ), this );
	lay-> addWidget ( p1, 1, 1 );
	connect ( p1, SIGNAL( clicked()), this, SLOT( editClicked()));

	lay-> setRowStretch ( 4, 10 );

                m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ),  this );
                lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 );

	m_busyani = new QCheckBox ( tr( "Enable animated busy indicator" ), this );
	lay-> addMultiCellWidget ( m_busyani, 6, 6, 0, 1 );

        m_staticbackground = new QCheckBox( tr( "Enable static background pixmap" ), this );
        lay->addMultiCellWidget( m_staticbackground, 7, 7, 0, 1 );

	init ( );

	QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." ));
	QWhatsThis::add ( p1, tr( "Opens a new dialog to customize the select Tab." ));
       	QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." ));
	QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." ));
	QWhatsThis::add ( m_staticbackground, tr( "Activate this, if you want the background pixmap not to scroll with the icons." ));
}
Example #10
0
NicksOnline::NicksOnline(QWidget* parent): ChatWindow(parent)
{
    setName(i18n("Watched Nicks Online"));
    setType(ChatWindow::NicksOnline);

    m_nickListView=new KListView(this);

    // Set to false every 8 seconds to permit a whois on watched nicks lacking information.
    // Remove when server or addressbook does this automatically.
    m_whoisRequested = true;

    m_nickListView->addColumn(i18n("Network/Nickname/Channel"));
    m_kabcIconSet = KGlobal::iconLoader()->loadIconSet("kaddressbook",KIcon::Small);
    m_nickListView->addColumn(i18n("Additional Information"));
    m_nickListView->setFullWidth(true);
    m_nickListView->setRootIsDecorated(true);
    m_nickListView->setShowToolTips(false);
    m_nickListView->setShadeSortColumn(true);
    m_nickListView->setShowSortIndicator(true);

    QString nickListViewWT = i18n(
                                 "<p>These are all the nicknames on your Nickname Watch list, listed under the "
                                 "server network they are connected to.  The list also includes the nicknames "
                                 "in KAddressBook associated with the server network.</p>"
                                 "<p>The <b>Additional Information</b> column shows the information known "
                                 "for each nickname.</p>"
                                 "<p>The channels the nickname has joined are listed underneath each nickname.</p>"
                                 "<p>Nicknames appearing under <b>Offline</b> are not connected to any of the "
                                 "servers in the network.</p>"
                                 "<p>Right-click with the mouse on a nickname to perform additional functions.</p>");
    QWhatsThis::add(m_nickListView, nickListViewWT);

    m_tooltip = new Konversation::KonversationNicksOnlineToolTip(m_nickListView->viewport(), this);

    setMargin(margin());
    setSpacing(spacing());

    QHBox* buttonBox=new QHBox(this);
    buttonBox->setSpacing(spacing());
    QPushButton* editButton=new QPushButton(i18n("&Edit Watch List..."),
                                            buttonBox,"edit_notify_button");
    QString editButtonWT = i18n(
                               "Click to edit the list of nicknames that appear on this screen.");
    QWhatsThis::add(editButton, editButtonWT);

    connect(editButton, SIGNAL(clicked()), SIGNAL(editClicked()) );
    connect(m_nickListView, SIGNAL(doubleClicked(QListViewItem*)),
            this,SLOT(processDoubleClick(QListViewItem*)));

    QLabel* addressbookLabel = new QLabel(i18n("Address book:"),
                                          buttonBox, "nicksonline_addressbook_label");
    QString addressbookLabelWT = i18n(
                                     "When you select a nickname in the list above, the buttons here are used "
                                     "to associate the nickname with an entry in KAddressBook.");
    QWhatsThis::add(addressbookLabel, addressbookLabelWT);
    addressbookLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    m_editContactButton = new QPushButton(i18n("Edit C&ontact..."),
                                          buttonBox, "nicksonline_editcontact_button");
    QString editContactButtonWT = i18n(
                                      "Click to create, view, or edit the KAddressBook entry associated with the nickname "
                                      "selected above.");
    QWhatsThis::add(m_editContactButton, editContactButtonWT);
    m_editContactButton->setIconSet(m_kabcIconSet);
    m_changeAssociationButton = new QPushButton(i18n("&Change Association..."),
            buttonBox, "nicksonline_changeassociation_button");
    QString changeAssociationButtonWT = i18n(
                                            "Click to associate the nickname selected above with an entry in KAddressBook.");
    QWhatsThis::add(m_changeAssociationButton, changeAssociationButtonWT);
    m_changeAssociationButton->setIconSet(m_kabcIconSet);
    m_deleteAssociationButton = new QPushButton(i18n("&Delete Association"),
            buttonBox, "nicksonline_deleteassociation_button");
    QString deleteAssociationButtonWT = i18n(
                                            "Click to remove the association between the nickname selected above and a "
                                            "KAddressBook entry.");
    QWhatsThis::add(m_deleteAssociationButton, deleteAssociationButtonWT);
    m_deleteAssociationButton->setIconSet(m_kabcIconSet);

    connect(m_editContactButton, SIGNAL(clicked()),
            this, SLOT(slotEditContactButton_Clicked()));
    connect(m_changeAssociationButton, SIGNAL(clicked()),
            this, SLOT(slotChangeAssociationButton_Clicked()));
    connect(m_deleteAssociationButton, SIGNAL(clicked()),
            this, SLOT(slotDeleteAssociationButton_Clicked()));
    connect(m_nickListView, SIGNAL(selectionChanged()),
            this, SLOT(slotNickListView_SelectionChanged()));

    setupAddressbookButtons(nsNotANick);

    // Create context menu.  Individual menu entries are created in rightButtonClicked slot.
    m_popupMenu = new QPopupMenu(this,"nicksonline_context_menu");
    connect(m_nickListView, SIGNAL(rightButtonClicked(QListViewItem *, const QPoint &, int )),
            this, SLOT(slotNickListView_RightButtonClicked(QListViewItem*, const QPoint &)));
    connect(m_popupMenu, SIGNAL(activated(int)),
            this, SLOT(slotPopupMenu_Activated(int)));

    // Display info for all currently-connected servers.
    refreshAllServerOnlineLists();

    // Connect and start refresh timer.
    m_timer = new QTimer(this, "nicksOnlineTimer");
    connect(m_timer, SIGNAL (timeout()), this, SLOT(timerFired()));
    // TODO: User preference for refresh interval.
    m_timer->start(8000);
}
void ListWidgetButtonContainer::setButtons(const RecordItNow::CollectionListWidget::ButtonCodes &buttons)
{

    m_buttons.clear();

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setContentsMargins(-1, -1, -1, 0);
    mainLayout->setSizeConstraint(QVBoxLayout::SetMinimumSize);

    KSeparator *mainSeparator = new KSeparator(this);
    mainSeparator->setFrameShape(KSeparator::HLine);

    QHBoxLayout *layout = new QHBoxLayout;
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSizeConstraint(QLayout::SetMinimumSize);

    mainLayout->addLayout(layout);
    mainLayout->addWidget(mainSeparator);

    QToolButton *button = 0;
    if (buttons & CollectionListWidget::PlayButton) {
        button = newButton(this);
        button->setIcon(KIcon("media-playback-start"));
        button->setToolTip(i18n("Play"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(playClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::PlayButton, button);
    }
/*
    if (button) {
        KSeparator *separator = new KSeparator(this);
        separator->setFrameShape(QFrame::VLine);
        layout->addWidget(separator);
    }
*/

    if (buttons & CollectionListWidget::UploadButton) {
        button = newButton(this);
        button->setIcon(KIcon("recorditnow-upload-media"));
        button->setToolTip(i18n("Upload"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(uploadClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::UploadButton, button);
    }

    if (buttons & CollectionListWidget::AddButton) {
        button = newButton(this);
        button->setIcon(KIcon("list-add"));
        button->setToolTip(i18n("Add"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(addClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::AddButton, button);
    }

    if (buttons & CollectionListWidget::EditButton) {
        button = newButton(this);
        button->setIcon(KIcon("document-edit"));
        button->setToolTip(i18n("Edit"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(editClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::EditButton, button);
    }

    if (buttons & CollectionListWidget::DeleteButton) {
        button = newButton(this);
        button->setIcon(KIcon("edit-delete"));
        button->setToolTip(i18n("Delete"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(deleteClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::DeleteButton, button);
    }

    QWidget *spacer = new QWidget(this);
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
    layout->addWidget(spacer);

    setLayout(mainLayout);

}
Example #12
0
TypeTypeForm::TypeTypeForm(TypeType *type,
                           QEbuMainWindow *mainWindow,
                           QWidget *parent) :
    StackableWidget(mainWindow, parent)
{
    m_op = (type) ? Edit : Add;
    if (!type)
        m_type = new TypeType;
    else
        m_type = type;
    // Layout
    QHBoxLayout *mainHLayout = new QHBoxLayout;
    QVBoxLayout *l = new QVBoxLayout;
    {
        QFormLayout *fl = new QFormLayout;
        m_buttonType = new QPushButton(">>");
        fl->addRow(tr("Type"), m_buttonType);
        QObject::connect(m_buttonType, SIGNAL(toggled(bool)),
                         this, SLOT(typeChecked(bool)));
        m_buttonGenre = new QPushButton(">>");
        fl->addRow(tr("Genre"), m_buttonGenre);
        QObject::connect(m_buttonGenre, SIGNAL(toggled(bool)),
                         this, SLOT(genreChecked(bool)));
        m_buttonObjectType = new QPushButton(">>");
        fl->addRow(tr("Object type"), m_buttonObjectType);
        QObject::connect(m_buttonObjectType, SIGNAL(toggled(bool)),
                         this, SLOT(objectTypeChecked(bool)));
        m_buttonTargetAudience = new QPushButton(">>");
        fl->addRow(tr("Target audience"), m_buttonTargetAudience);
        QObject::connect(m_buttonTargetAudience, SIGNAL(toggled(bool)),
                         this, SLOT(targetAudienceChecked(bool)));
        l->addLayout(fl);
        QButtonGroup *group = new QButtonGroup(this);
        m_buttonType->setCheckable(true);
        group->addButton(m_buttonType);
        m_buttonGenre->setCheckable(true);
        group->addButton(m_buttonGenre);
        m_buttonObjectType->setCheckable(true);
        group->addButton(m_buttonObjectType);
        m_buttonTargetAudience->setCheckable(true);
        group->addButton(m_buttonTargetAudience);
    }
    {
        QHBoxLayout *hl = new QHBoxLayout;
        hl->addWidget(new QLabel(tr("Note")));
        m_textNote = new QTextEdit;
        hl->addWidget(m_textNote);
        l->addLayout(hl);
    }
    mainHLayout->addLayout(l);
    // Add list view on the right
    m_listView = new ListView();
    QObject::connect(m_listView->buttonAdd(), SIGNAL(clicked()),
                     this, SLOT(addClicked()));
    QObject::connect(m_listView->buttonEdit(), SIGNAL(clicked()),
                     this, SLOT(editClicked()));
    QObject::connect(m_listView->buttonRemove(), SIGNAL(clicked()),
                     this, SLOT(removeClicked()));
    mainHLayout->addWidget(m_listView);
    this->setLayout(mainHLayout);

    //Event filter
    m_textDocumentation->setText(tr("The nature or genre or target audience of the resource. Type includes terms describing general categories, functions, genres, or aggregation levels for content. Recommended best practice is to select a value from a controlled vocabulary or classification scheme. To describe the physical or digital manifestation of the resource, use the Format element."));
    m_textNote->installEventFilter(this);
    m_buttonType->installEventFilter(this);
    m_buttonGenre->installEventFilter(this);
    m_buttonObjectType->installEventFilter(this);
    m_buttonTargetAudience->installEventFilter(this);

    // Set data fields...
    m_textNote->setText(m_type->note());
    m_buttonType->setChecked(true);
}
RegisteredUsersDialog::RegisteredUsersDialog(QWidget * par)
: QWidget(par)
{
	g_pRegisteredUsersDialog = this;

	g_pLocalRegisteredUserDataBase = new KviRegisteredUserDataBase();
	g_pLocalRegisteredUserDataBase->copyFrom(g_pRegisteredUserDataBase);

	setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::RegUsers)));
	setWindowTitle(__tr2qs_ctx("Registered Users - KVIrc","register"));

	QGridLayout * g = new QGridLayout(this);


	m_pListView = new KviRegisteredUsersListView(this);
	m_pListView->setItemDelegate(new RegisteredUsersDialogItemDelegate());

	connect(m_pListView,SIGNAL(itemPressed(QTreeWidgetItem *,int)),this,SLOT(itemPressed(QTreeWidgetItem *,int)));
	connect(m_pListView,SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),this,SLOT(itemDoubleClicked(QTreeWidgetItem *, int)));

	g->addWidget(m_pListView,0,0,2,2);

	KviTalVBox * vbox = new KviTalVBox(this);
	vbox->setSpacing(4);
	g->addWidget(vbox,0,2);

	m_pWizardAddButton = new QPushButton(__tr2qs_ctx("Add (Wizard)...","register"),vbox);
	connect(m_pWizardAddButton,SIGNAL(clicked()),this,SLOT(addWizardClicked()));
	m_pWizardAddButton->setToolTip(__tr2qs_ctx("Add a registered user by means of a user-friendly wizard.","register"));
	m_pWizardAddButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItemByWizard)));


	m_pAddButton = new QPushButton(__tr2qs_ctx("&Add...","register"),vbox);
	connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked()));
	m_pAddButton->setToolTip(__tr2qs_ctx("Open the edit dialog to create a new user entry.","register"));
	m_pAddButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem)));

	m_pAddGroupButton = new QPushButton(__tr2qs_ctx("&Add Group...","register"),vbox);
	connect(m_pAddGroupButton,SIGNAL(clicked()),this,SLOT(addGroupClicked()));
	m_pAddGroupButton->setToolTip(__tr2qs_ctx("Adds a new group","register"));
	m_pAddGroupButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem)));

	m_pRemoveButton = new QPushButton(__tr2qs_ctx("Re&move","register"),vbox);
	connect(m_pRemoveButton,SIGNAL(clicked()),this,SLOT(removeClicked()));
	m_pRemoveButton->setEnabled(false);
	m_pRemoveButton->setToolTip(__tr2qs_ctx("Remove the currently selected entries.","register"));
	m_pRemoveButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DeleteItem)));


	m_pEditButton = new QPushButton(__tr2qs_ctx("&Edit...","register"),vbox);
	connect(m_pEditButton,SIGNAL(clicked()),this,SLOT(editClicked()));
	m_pEditButton->setEnabled(false);
	m_pEditButton->setToolTip(__tr2qs_ctx("Edit the first selected entry.","register"));
	m_pEditButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::EditItem)));

	QFrame * f = new QFrame(vbox);
	f->setFrameStyle(QFrame::HLine | QFrame::Sunken);

	m_pSelectAllButton = new QPushButton(__tr2qs_ctx("Select all","register"),vbox);
	connect(m_pSelectAllButton,SIGNAL(clicked()),this,SLOT(selectAllClicked()));
	m_pSelectAllButton->setToolTip(__tr2qs_ctx("Select all the entries","register"));
	m_pSelectAllButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Plus)));

	m_pExportButton = new QPushButton(__tr2qs_ctx("Export To...","register"),vbox);
	m_pExportButton->setEnabled(false);
	connect(m_pExportButton,SIGNAL(clicked()),this,SLOT(exportClicked()));
	m_pExportButton->setToolTip(__tr2qs_ctx("Export the selected entries to a file.<br>All the data associated with the selected registered users will be exported.<br>You (or anyone else) can later import the entries by using the \"Import\" button.","register"));
	m_pExportButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Floppy)));


	m_pImportButton = new QPushButton(__tr2qs_ctx("Import From...","register"),vbox);
	connect(m_pImportButton,SIGNAL(clicked()),this,SLOT(importClicked()));
	m_pImportButton->setToolTip(__tr2qs_ctx("Import entries from a file exported earlier by the \"export\" function of this dialog.","register"));
	m_pImportButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Folder)));


	KviTalHBox * hbox = new KviTalHBox(this);
	hbox->setSpacing(4);
	g->addWidget(hbox,3,1,1,2);

	QPushButton * b;


	b = new QPushButton(__tr2qs_ctx("&OK","register"),hbox);
	connect(b,SIGNAL(clicked()),this,SLOT(okClicked()));
	b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)));
	//b->setMinimumWidth(120);

	b = new QPushButton(__tr2qs_ctx("Cancel","register"),hbox);
	connect(b,SIGNAL(clicked()),this,SLOT(cancelClicked()));
	b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)));
	//b->setMinimumWidth(120);

	g->addItem(new QSpacerItem(0, 15), 2, 0);
	g->setColumnStretch(0,1);
	g->setRowStretch(1,1);

	connect(m_pListView,SIGNAL(itemSelectionChanged()),this,SLOT(selectionChanged()));
	connect(m_pListView,SIGNAL(rightButtonPressed(QTreeWidgetItem *, QPoint)),this,SLOT(rightButtonPressed(QTreeWidgetItem *, QPoint)));

	new QShortcut(Qt::Key_Escape, this, SLOT(cancelClicked()));

	fillList();

	if(!parent())
	{
		if(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).y() < 5)
			KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).setY(5);

		//setGeometry(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry));
		resize(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).width(),
			KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).height());

		QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow);
		move(rect.x() + ((rect.width() - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).width())/2),rect.y() + ((rect.height() - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).height())/2));

	}
}
Example #14
0
HtmlEntitiesDialog::HtmlEntitiesDialog(QWidget *parent) :
    QDialog(parent)
{

    editMode = false;
    cancelString = tr("Cancel");
    closeString = tr("Close");
    editString = tr("Edit entries list");
    saveString = tr("Save enities list");
    defaultEntities.append("&larr;");
    defaultEntities.append("&rarr;");
    defaultEntities.append("&lArr;");
    defaultEntities.append("&rArr;");
    defaultEntities.append("&uarr;");
    defaultEntities.append("&darr;");
    defaultEntities.append("&uArr;");
    defaultEntities.append("&dArr;");
    defaultEntities.append("&harr;");
    defaultEntities.append("&#8597;");
    defaultEntities.append("&#8661;");
    defaultEntities.append("&hArr;");
    defaultEntities.append("&spades;");
    defaultEntities.append("&clubs;");
    defaultEntities.append("&diams;");
    defaultEntities.append("&hearts;");
    defaultEntities.append("&#9785;");
    defaultEntities.append("&#9786;");
    defaultEntities.append("&#9787;");
    defaultEntities.append("&#9775;");
    defaultEntities.append("&copy;");
    defaultEntities.append("&reg;");
    defaultEntities.append("&euro;");
    defaultEntities.append("&deg;");
    defaultEntities.append("&frac14;");
    defaultEntities.append("&frac12;");
    defaultEntities.append("&frac34;");
    defaultEntities.append("&plusmn;");
    defaultEntities.append("&#10003;");
    defaultEntities.append("&#10004;");
    defaultEntities.append("&#10007;");
    defaultEntities.append("&#10008;");
    this->listSeparator = ",";
    loadCustomEntities();
    setWindowTitle(tr("HTML Entities Selection"));
    this->setWindowIcon(QIcon(":htmlentities.png"));
    setModal(false);

    initGrid();
    initEntitiesGrid();
    signalmapper = new QSignalMapper();
    initEntitiesButtons();
    connect(signalmapper, SIGNAL(mapped(QString)), this, SLOT(htmlEntityClicked(QString)));

    scrollArea = new QScrollArea();
    scrollArea->setBackgroundRole(QPalette::Dark);
    scrollArea->setMinimumWidth(ENTITY_BUTTON_COLUMNS*(ENTITY_BUTTON_WIDTH+2*ENTITY_MARGIN));
    scrollArea->setMinimumHeight(ENTITY_BUTTON_ROWS*(ENTITY_BUTTON_HEIGHT+2*ENTITY_MARGIN));

    initEntitiesWidget();
    scrollArea->setWidget(entitiesWidget);
    scrollArea->setWidgetResizable(false);
    scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    grid->addWidget(scrollArea,2,1);

    buttonLayout = new QHBoxLayout();
    editButton = new QPushButton(editString);
    closeButton = new QPushButton(closeString);
    connect(closeButton, SIGNAL(clicked()), this, SLOT(closeClicked()));
    connect(editButton, SIGNAL(clicked()), this, SLOT(editClicked()));
    buttonLayout->addStretch();
    buttonLayout->addWidget(editButton);
    buttonLayout->addWidget(closeButton);
    buttonLayout->addStretch();
    grid->addLayout(buttonLayout,3,1);
    setWindowFlags(Qt::WindowStaysOnTopHint);
    textEdit = NULL;
    scrollArea->setWidgetResizable(false);
    //layout()->setSizeConstraint( QLayout::SetFixedSize);
    //saveSize = this->size();
}
Example #15
0
DataFormatTypeForm::DataFormatTypeForm(DataFormatType *dataFormat,
                                       QEbuMainWindow *mainWindow,
                                       QWidget *parent) :
    StackableWidget(mainWindow, parent)
{
    m_op = (dataFormat) ? Edit : Add;
    if (!dataFormat)
        m_dataFormat = new DataFormatType;
    else
        m_dataFormat = dataFormat;
    //Layout
    QHBoxLayout *mainHLayout = new QHBoxLayout;
    QVBoxLayout *vl = new QVBoxLayout;
    {
        QFormLayout *fl = new QFormLayout;
        m_editDataFormatId = new QLineEdit;
        m_editDataFormatId->setValidator(TypeConverter::getUriValidator());
        fl->addRow(tr("Data format ID"), m_editDataFormatId);
        m_editDataFormatName = new QLineEdit;
        fl->addRow(tr("Data format name"), m_editDataFormatName);
        m_editDataFormatDefinition = new QLineEdit;
        fl->addRow(tr("Data format definition"), m_editDataFormatDefinition);
        vl->addLayout(fl);
    }
    {
        QFormLayout *fl = new QFormLayout;
        m_buttonCaptioningFormat = new QPushButton(">>");
        fl->addRow(tr("Captioning format"), m_buttonCaptioningFormat);
        QObject::connect(m_buttonCaptioningFormat, SIGNAL(toggled(bool)),
                         this, SLOT(captioningFormatChecked(bool)));
        m_buttonAncillaryDataFormat = new QPushButton(">>");
        fl->addRow(tr("Ancillary data format"), m_buttonAncillaryDataFormat);
        QObject::connect(m_buttonAncillaryDataFormat, SIGNAL(toggled(bool)),
                         this, SLOT(ancillaryDataFormatChecked(bool)));
        m_buttonTechnicalAttributes = new QPushButton(">>");
        fl->addRow(tr("Technical attributes"), m_buttonTechnicalAttributes);
        QObject::connect(m_buttonTechnicalAttributes, SIGNAL(toggled(bool)),
                         this, SLOT(technicalAttributesChecked(bool)));
        vl->addLayout(fl);
        QButtonGroup *group = new QButtonGroup(this);
        m_buttonCaptioningFormat->setCheckable(true);
        group->addButton(m_buttonCaptioningFormat);
        m_buttonAncillaryDataFormat->setCheckable(true);
        group->addButton(m_buttonAncillaryDataFormat);
        m_buttonTechnicalAttributes->setCheckable(true);
        group->addButton(m_buttonTechnicalAttributes);
    }
    mainHLayout->addLayout(vl);
    // Add list view on the right
    m_listView = new ListView();
    QObject::connect(m_listView->buttonAdd(), SIGNAL(clicked()),
                     this, SLOT(addClicked()));
    QObject::connect(m_listView->buttonEdit(), SIGNAL(clicked()),
                     this, SLOT(editClicked()));
    QObject::connect(m_listView->buttonRemove(), SIGNAL(clicked()),
                     this, SLOT(removeClicked()));
    mainHLayout->addWidget(m_listView);
    this->setLayout(mainHLayout);

    //Set data fields...
    m_textDocumentation->setText(tr("To provide information on captioning and ancillary data formats optionally used in the resource"));
    m_editDataFormatId->setText(m_dataFormat->dataFormatId());
    m_editDataFormatName->setText(m_dataFormat->dataFormatName());
    m_editDataFormatDefinition->setText(m_dataFormat->dataFormatDefinition());
    m_editDataFormatId->installEventFilter(this);
    m_editDataFormatName->installEventFilter(this);
    m_editDataFormatDefinition->installEventFilter(this);
    m_buttonCaptioningFormat->installEventFilter(this);
    m_buttonAncillaryDataFormat->installEventFilter(this);
    m_buttonTechnicalAttributes->installEventFilter(this);
    m_buttonCaptioningFormat->setChecked(true);
}
bool JCurveGroupWidget::addCurveView(const QString &suffix, const QString &nameX,
                                     const QString &nameY, int axisXYType)
{
    if (axisXYType == JCurveWidget::AxisXY_Invalid) {
        return false;
    }

    JCurveWidget *curveView = new JCurveWidget(this, true);
    curveView->setMinimumHeight(300);
    curveView->setAxisXYType((JCurveWidget::AxisXYType)axisXYType);
    curveView->setTitle(QString("%2 - %3 (<font color='#aaf'>%1</font>)")
                        .arg(QString(suffix).replace('_', '-')).arg(nameX).arg(nameY));
    curveView->setProperty("suffix", suffix);
    curveView->setProperty("nameX", nameX);
    curveView->setProperty("nameY", nameY);
    //
    curveView->setLegendVisible(false);
    curveView->setEnableDbClick(true);
    curveView->setBaseLineVisible(false);
    curveView->setBaseLineEnabled(false);
    //
    if (!GlobalConfig::instance()->canExportData()) {
        curveView->setExportVisible(false);
    }
    //
    if (axisXYType == JCurveWidget::AxisXY_Time_Time
            || axisXYType == JCurveWidget::AxisXY_Time_Value) {
        if (GlobalConfig::instance()->canWriteDatabase()) {
            curveView->setEditEnabled(true);
        }
        curveView->setZoomModeVisible(true);
        curveView->setSiftModeVisible(true);
    } else {
        curveView->setEditEnabled(false);
        curveView->setZoomModeVisible(false);
        curveView->setSiftModeVisible(false);
    }
    curveView->setZoomMode(true);
    //
    q_curveViews.append(curveView);
    q_vertLayoutCurveArea->addWidget(curveView);

    //
    updateCurve(curveView);

    //
    //updateBaseLine(curveView);

    //
    int currentIndex = q_curveViews.count() - 1;

    //
    connect(curveView, &JCurveWidget::doubleClicked, [=](bool checked){
        //
        bool zoomEnabled = (q_curveViews.count() < 3) ? true : checked;
        QListIterator<JCurveWidget *> citer(q_curveViews);
        while (citer.hasNext()) {
            JCurveWidget *item = citer.next();
            if (item == 0) {
                continue;
            }
            //
            if (item != curveView) {
                item->setVisible(!checked);
            }
            //
            if (!item->editEnabled()) {
                item->setZoomMode(zoomEnabled);
            }
        }
        //
        Q_EMIT curveViewDoubleClicked(currentIndex, checked);
    });
    connect(curveView, &JCurveWidget::editClicked, [=](){
        //
        Q_EMIT editClicked(currentIndex);
    });
    connect(curveView, &JCurveWidget::timeBandApply,
            [=](const QTime &minimum, const QTime &maximum, bool retain){
        //
        Q_EMIT timeBandApply(currentIndex, minimum, maximum, retain);
    });

    return true;
}
Example #17
0
ContactDetailsTypeForm::ContactDetailsTypeForm(
        ContactDetailsType *contactDetails,
        QEbuMainWindow *mainWindow, QWidget *parent) :
    StackableWidget(mainWindow, parent)
{
    m_op = (contactDetails) ? Edit : Add;
    if (!contactDetails)
        m_contactDetails = new ContactDetailsType;
    else
        m_contactDetails = contactDetails;
    // Layout
    QHBoxLayout *mainHLayout = new QHBoxLayout;
    QVBoxLayout *l = new QVBoxLayout;
    {
        QFormLayout *fl = new QFormLayout;
        m_editContactId = new QLineEdit;
        m_editContactId->setValidator(TypeConverter::getUriValidator());
        fl->addRow(tr("Contact ID"), m_editContactId);
        l->addLayout(fl);
    }
    {

        m_radioName = new QRadioButton(tr("Simple name"));
        m_radioCName = new QRadioButton(tr("Complex name"));
        QButtonGroup *radio = new QButtonGroup;
        m_radioName->setCheckable(true);
        m_radioCName->setCheckable(true);

        QObject::connect(m_radioName, SIGNAL(toggled(bool)),
                         this, SLOT(simpleNameChecked(bool)));
        QObject::connect(m_radioCName, SIGNAL(toggled(bool)),
                         this, SLOT(complexNameChecked(bool)));

        radio->addButton(m_radioName);
        radio->addButton(m_radioCName);

        QHBoxLayout *rl = new QHBoxLayout;
        rl->addWidget(m_radioName);
        rl->addWidget(m_radioCName);
        l->addLayout(rl);
    }
    {
        QFormLayout *fl = new QFormLayout;
        m_editName = new QLineEdit;
        fl->addRow(tr("Name"), m_editName);
        m_editGivenName = new QLineEdit;
        fl->addRow(tr("Given name"), m_editGivenName);
        m_editFamilyName = new QLineEdit;
        fl->addRow(tr("Family name"), m_editFamilyName);
        m_editUsername = new QLineEdit;
        fl->addRow(tr("Username"), m_editUsername);
        m_editOccupation = new QLineEdit;
        fl->addRow(tr("Occupation"), m_editOccupation);

        m_buttonDetails = new QPushButton(">>");
        fl->addRow(tr("Details"), m_buttonDetails);
        QObject::connect(m_buttonDetails, SIGNAL(toggled(bool)),
                         this, SLOT(contactDetailsChecked(bool)));
        m_buttonStageName = new QPushButton(">>");
        fl->addRow(tr("Stage Name"), m_buttonStageName);
        QObject::connect(m_buttonStageName, SIGNAL(toggled(bool)),
                         this, SLOT(stageNameChecked(bool)));
        m_buttonRelatedContacts = new QPushButton(">>");
        fl->addRow(tr("Related Contacts"), m_buttonRelatedContacts);
        QObject::connect(m_buttonRelatedContacts, SIGNAL(toggled(bool)),
                         this, SLOT(relatedContactsChecked(bool)));
        l->addLayout(fl);
        QButtonGroup *group = new QButtonGroup(this);
        m_buttonDetails->setCheckable(true);
        group->addButton(m_buttonDetails);
        m_buttonStageName->setCheckable(true);
        group->addButton(m_buttonStageName);
        m_buttonRelatedContacts->setCheckable(true);
        group->addButton(m_buttonRelatedContacts);
    }
    mainHLayout->addLayout(l);
    // Add list view on the right
    m_listView = new ListView();
    QObject::connect(m_listView->buttonAdd(), SIGNAL(clicked()),
                     this, SLOT(addClicked()));
    QObject::connect(m_listView->buttonEdit(), SIGNAL(clicked()),
                     this, SLOT(editClicked()));
    QObject::connect(m_listView->buttonRemove(), SIGNAL(clicked()),
                     this, SLOT(removeClicked()));
    mainHLayout->addWidget(m_listView);
    this->setLayout(mainHLayout);

    // Event Filter
    m_textDocumentation->setText(tr("Minimum information providing means to further identify and contact a person."));
    m_editContactId->installEventFilter(this);
    m_editName->installEventFilter(this);
    m_editFamilyName->installEventFilter(this);
    m_editGivenName->installEventFilter(this);
    m_editUsername->installEventFilter(this);
    m_editOccupation->installEventFilter(this);
    m_buttonDetails->installEventFilter(this);
    m_buttonStageName->installEventFilter(this);
    m_buttonRelatedContacts->installEventFilter(this);

    // Set data fields...
    m_editContactId->setText(m_contactDetails->contactId());
    m_editName->setText(m_contactDetails->name().getName());
    m_editFamilyName->setText(m_contactDetails->name().getFamilyName());
    m_editGivenName->setText(m_contactDetails->name().getGivenName());
    m_editOccupation->setText(m_contactDetails->occupation());
    m_editUsername->setText(m_contactDetails->username());
    m_buttonDetails->setChecked(true);

    if (m_contactDetails && !m_contactDetails->name().isComplexName())
        m_radioName->setChecked(true);
    else if (m_contactDetails && m_contactDetails->name().isComplexName())
        m_radioCName->setChecked(true);
    else
        m_radioName->setChecked(true);

}
Example #18
0
VideoFormatTypeForm::VideoFormatTypeForm(VideoFormatType *videoFormat,
                                         QEbuMainWindow *mainWindow,
                                         QWidget *parent) :
    StackableWidget(mainWindow, parent)
{
    m_op = (videoFormat) ? Edit : Add;
    if (!videoFormat)
        m_videoFormat = new VideoFormatType;
    else
        m_videoFormat = videoFormat;
    //Layout
    QHBoxLayout *mainHLayout = new QHBoxLayout;
    QVBoxLayout *vl = new QVBoxLayout;
    {
        QFormLayout *fl = new QFormLayout;
        m_editVideoFormatId = new QLineEdit;
        fl->addRow(tr("Video Format Id"), m_editVideoFormatId);
        m_editVideoFormatName = new QLineEdit;
        fl->addRow(tr("Video Format Name"), m_editVideoFormatName);
        m_editVideoFormatDefinition = new QLineEdit;
        fl->addRow(tr("Video Format Definition"), m_editVideoFormatDefinition);
        vl->addLayout(fl);
    }
    {
        QGridLayout *gl = new QGridLayout;

        m_spinRegionDelimX = new QUnsignedSpinBox;
        m_spinRegionDelimX->setRange(qEbuLimits::getMinUInt(), qEbuLimits::getMaxUInt());
        m_checkRegionDelimX = new QCheckBox(tr("Region Delim X"));
        gl->addWidget(m_checkRegionDelimX, 0, 0);
        gl->addWidget(m_spinRegionDelimX, 0, 1);
        QObject::connect(m_spinRegionDelimX, SIGNAL(valueChanged()),
                         this, SLOT(regionDelimXChanged()));

        m_spinRegionDelimY = new QUnsignedSpinBox;
        m_spinRegionDelimY->setRange(qEbuLimits::getMinUInt(), qEbuLimits::getMaxUInt());
        m_checkRegionDelimY = new QCheckBox(tr("Region Delim Y"));
        gl->addWidget(m_checkRegionDelimY, 1, 0);
        gl->addWidget(m_spinRegionDelimY, 1, 1);
        QObject::connect(m_spinRegionDelimY, SIGNAL(valueChanged()),
                         this, SLOT(regionDelimYChanged()));

        m_editWidth = new LengthTypeEditBox(m_videoFormat->width());
        m_editWidth->setLabel(tr("Width"));
        gl->addWidget(m_editWidth, 2, 0, 1, 2);

        m_editHeight = new LengthTypeEditBox(m_videoFormat->height());
        m_editHeight->setLabel(tr("Heigth"));
        gl->addWidget(m_editHeight, 3, 0, 1, 2);

        vl->addLayout(gl);
    }
    {
        QFormLayout *fl = new QFormLayout;

        m_buttonAspectRatio = new QPushButton(">>");
        fl->addRow(tr("Aspect Ratio"), m_buttonAspectRatio);
        QObject::connect(m_buttonAspectRatio, SIGNAL(toggled(bool)),
                         this, SLOT(aspectRatioChecked(bool)));
        m_buttonVideoEncoding = new QPushButton(">>");
        fl->addRow(tr("Video Encoding"), m_buttonVideoEncoding);
        QObject::connect(m_buttonVideoEncoding, SIGNAL(toggled(bool)),
                         this, SLOT(videoEncodingChecked(bool)));
        m_buttonVideoTrack = new QPushButton(">>");
        fl->addRow(tr("Video Track"), m_buttonVideoTrack);
        QObject::connect(m_buttonVideoTrack, SIGNAL(toggled(bool)),
                         this, SLOT(videoTrackTypeChecked(bool)));
        m_buttonTechnicalAttributes = new QPushButton(">>");
        fl->addRow(tr("Technical Attributes"), m_buttonTechnicalAttributes);
        QObject::connect(m_buttonTechnicalAttributes, SIGNAL(toggled(bool)),
                         this, SLOT(technicalAttributesChecked(bool)));
        vl->addLayout(fl);
        QButtonGroup *group = new QButtonGroup(this);
        m_buttonAspectRatio->setCheckable(true);
        group->addButton(m_buttonAspectRatio);
        m_buttonVideoEncoding->setCheckable(true);
        group->addButton(m_buttonVideoEncoding);
        m_buttonVideoTrack->setCheckable(true);
        group->addButton(m_buttonVideoTrack);
        m_buttonTechnicalAttributes->setCheckable(true);
        group->addButton(m_buttonTechnicalAttributes);
    }
    mainHLayout->addLayout(vl);
    // Add list view on the right
    m_listView = new ListView();
    QObject::connect(m_listView->buttonAdd(), SIGNAL(clicked()),
                     this, SLOT(addClicked()));
    QObject::connect(m_listView->buttonEdit(), SIGNAL(clicked()),
                     this, SLOT(editClicked()));
    QObject::connect(m_listView->buttonRemove(), SIGNAL(clicked()),
                     this, SLOT(removeClicked()));
    mainHLayout->addWidget(m_listView);
    this->setLayout(mainHLayout);

    //Event filter
    m_textDocumentation->setText(tr("A description of video characteristics of the resource to provide technical information such as colour, greyscale or black and white colour schemes, frame rate, sampling rate, scanning format, encoding, track configuration."));
    m_editVideoFormatId->installEventFilter(this);
    m_editVideoFormatDefinition->installEventFilter(this);
    m_editVideoFormatName->installEventFilter(this);
    m_spinRegionDelimX->installEventFilter(this);
    m_spinRegionDelimY->installEventFilter(this);
    m_editWidth->editValue()->installEventFilter(this);
    m_editWidth->editUnit()->installEventFilter(this);
    m_editHeight->editValue()->installEventFilter(this);
    m_editHeight->editUnit()->installEventFilter(this);
    m_buttonAspectRatio->installEventFilter(this);
    m_buttonVideoEncoding->installEventFilter(this);
    m_buttonVideoTrack->installEventFilter(this);
    m_buttonTechnicalAttributes->installEventFilter(this);

    //Set data fields...
    m_editVideoFormatId->setText(m_videoFormat->videoFormatId());
    m_editVideoFormatName->setText(m_videoFormat->videoFormatName());
    m_editVideoFormatDefinition->setText(m_videoFormat->videoFormatDefinition());
    if (m_videoFormat->regionDelimX()) {
        m_spinRegionDelimX->setValue(*(m_videoFormat->regionDelimX()));
        m_checkRegionDelimX->setChecked(true);
    }
    if (m_videoFormat->regionDelimY()) {
        m_spinRegionDelimY->setValue(*(m_videoFormat->regionDelimY()));
        m_checkRegionDelimY->setChecked(true);
    }
    m_buttonAspectRatio->setChecked(true);
}
Example #19
0
void Staff::on_editBtn_clicked()
{
    emit editClicked(id);
}
Example #20
0
void MateriaPrimaDetail::setParam(const ParameterList& param)
{
	formulaTitleLabel->hide();
	formulaLabel->hide();
	label1->hide();
	label2->hide();
	lineEdit1->hide();
	lineEdit2->hide();

	nomeEdit->clear();
	tipoComboBox->setCurrentIndex(-1);
	precoEdit->clear();

	if (param["mode"] != "new")
	{
		disconnect(pushButton, SIGNAL(clicked()), this, SLOT(newClicked()));
		connect(pushButton, SIGNAL(clicked()), this, SLOT(editClicked()));
		pushButton->setText("&Salvar");
		query.prepare("UPDATE materiaprima SET nome = :nome, preco_por_kilo = :preco_por_kilo, tipo = :tipo WHERE cod_materiaprima = :cod");
		query.bindValue(":cod", param["cod"].toULongLong());

		QSqlQuery sql;
		sql.prepare("SELECT nome, tipo, preco_por_kilo FROM materia_prima WHERE cod_materiaprima=:cod_materia_prima");
		sql.bindValue("cod_materia_prima", param["cod"].toULongLong());

		if (!sql.exec())
		{
			QMessageBox::warning(this, "Admin",
				QString::fromUtf8("Erro na consulta\1%1").arg(query.lastError().text()));
		}

		else
		{
			sql.last();

			nomeEdit->setText(sql.value(0).toString());
			tipoComboBox->setCurrentIndex(sql.value(1).toInt());
			precoEdit->setText(sql.value(2).toString());
		}

		if (param["mode"] == "view")
		{
			setWindowTitle(QString::fromUtf8("Visualizando registro [%1]").arg(sql.value(0).toString()));

			nomeEdit->setReadOnly(true);
			precoEdit->setReadOnly(true);
			pushButton->hide();
			cancelButton->setText("Fe&char");
		} else {
			setWindowTitle(QString::fromUtf8("Editando registro [%1]").arg(sql.value(0).toString()));
		}
	}

	else
	{
		setWindowTitle(QString::fromUtf8("Novo registro"));
		disconnect(pushButton, SIGNAL(clicked()), this, SLOT(editClicked()));
		connect(pushButton, SIGNAL(clicked()), this, SLOT(newClicked()));
		pushButton->setText("&Inserir");
		query.prepare("INSERT INTO materiaprima (nome, preco_por_kilo, tipo) VALUES (:nome, :preco_por_kilo, :tipo)");
	}
}