Example #1
0
TextShow::TextShow(QWidget *p, const char *name)
        : QTextEdit(p, name)
{
    setTextFormat(RichText);
    setReadOnly(true);
#if COMPAT_QT_VERSION >= 0x030100
    if (QApplication::clipboard()->supportsSelection())
        connect(this, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()));
#endif
}
Example #2
0
void KXmlCommandAdvancedDlg::slotMoveDown()
{
	TQListViewItem	*item = m_view->currentItem(), *next = 0;
	if (item && (next=findNext(item)))
	{
		item->moveItem(next);
		m_view->setSelected(item, true);
		slotSelectionChanged(item);
	}
}
Example #3
0
OptionListView::OptionListView(TQWidget *parent, const char *name)
: OptionBaseView(parent,name)
{
	m_list = new TDEListBox(this);

	TQVBoxLayout	*main_ = new TQVBoxLayout(this, 0, 10);
	main_->addWidget(m_list);

	connect(m_list,TQT_SIGNAL(selectionChanged()),TQT_SLOT(slotSelectionChanged()));
}
Example #4
0
void FixtureManager::initDataView()
{
	// Create a splitter to divide list view and text view
	m_splitter = new QSplitter(Qt::Horizontal, this);
	layout()->addWidget(m_splitter);
	m_splitter->setSizePolicy(QSizePolicy::Expanding,
				  QSizePolicy::Expanding);

	/* Create a tree widget to the left part of the splitter */
	m_tree = new QTreeWidget(this);
	m_splitter->addWidget(m_tree);

	QStringList labels;
	labels << "Universe" << "Address" << "Name";
	m_tree->setHeaderLabels(labels);
	m_tree->setRootIsDecorated(false);
	m_tree->setSortingEnabled(true);
	m_tree->setAllColumnsShowFocus(true);
	m_tree->sortByColumn(KColumnAddress, Qt::AscendingOrder);
	m_tree->setContextMenuPolicy(Qt::CustomContextMenu);

	connect(m_tree, SIGNAL(itemSelectionChanged()),
		this, SLOT(slotSelectionChanged()));

	connect(m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
		this, SLOT(slotDoubleClicked(QTreeWidgetItem*)));

	connect(m_tree, SIGNAL(customContextMenuRequested(const QPoint&)),
		this, SLOT(slotContextMenuRequested(const QPoint&)));

	/* Create a tab widget to the right part of the splitter */
	m_tab = new QTabWidget(this);
	m_splitter->addWidget(m_tab);

	/* Create the text view */
	m_info = new QTextBrowser(this);
	m_tab->addTab(m_info, tr("Information"));

	m_splitter->setStretchFactor(0, 1);
	m_splitter->setStretchFactor(1, 0);

	slotSelectionChanged();
}
Example #5
0
MetaListViewPart::MetaListViewPart(QObject *parent)
    : KParts::Part(parent), m_proxyModel(NULL), m_defaultRow(-1)
{
    m_widget = new MetaListViewWidget;
    setWidget(m_widget);

    connect(m_widget, SIGNAL(itemActivated(QModelIndex)),
            SLOT(slotItemActivated(QModelIndex)) );
    connect(m_widget, SIGNAL(selectionChanged(QItemSelection)),
            SLOT(slotSelectionChanged(QItemSelection)) );
    connect(m_widget, SIGNAL(contextMenuRequested(QModelIndex)),
            SLOT(slotContextMenuRequested(QModelIndex)) );

    // Show initial information on the metaBar
    slotSelectionChanged(QItemSelection());

    //populate the listView (later, in order to respect the size of the listView)
    QMetaObject::invokeMethod(this, "loadModel", Qt::QueuedConnection);

    /* ACTIONS */
    KSelectAction *view_mode = new KSelectAction(i18n("View mode"), this);
    connect(view_mode, SIGNAL(triggered(int)), SLOT(changeViewMode(int)) );
    actionCollection()->addAction("view_mode", view_mode);
    actionCollection()->addAction("view_mode_list",
                view_mode->addAction(KIcon("view-list-details"), i18n("List")) );
    actionCollection()->addAction("view_mode_icons",
                view_mode->addAction(KIcon("view-list-icons"), i18n("Icons")) );

    KSelectAction *metabar_position = new KSelectAction(i18n("Metabar position"), this);
    connect(metabar_position, SIGNAL(triggered(int)), SLOT(changeMetaBarPosition(int)) );
    actionCollection()->addAction("metabar_position", metabar_position);

    QString str_left = i18nc("Opposite of right", "Left");
    QString str_right = i18nc("Opposite of left", "Right");
    if ( QApplication::isLeftToRight() ) {
        actionCollection()->addAction("metabar_position_left", metabar_position->addAction(str_left));
        actionCollection()->addAction("metabar_position_right", metabar_position->addAction(str_right));
    } else {
        actionCollection()->addAction("metabar_position_right", metabar_position->addAction(str_right));
        actionCollection()->addAction("metabar_position_left", metabar_position->addAction(str_left));
    }
    actionCollection()->addAction("metabar_position_hidden", metabar_position->addAction(i18n("Hidden")) );
}
IconSizeDialog::IconSizeDialog(const QString &caption, const QString &message, const QString &icon, int iconSize, QWidget *parent)
        : QDialog(parent)
{
    // QDialog options
    setWindowTitle(caption);

    QWidget *mainWidget = new QWidget(this);
    QVBoxLayout *mainLayout = new QVBoxLayout;
    setLayout(mainLayout);
    mainLayout->addWidget(mainWidget);

    setModal(true);

    QWidget *page = new QWidget(this);
    QVBoxLayout *topLayout = new QVBoxLayout(page);

    QLabel *label = new QLabel(message, page);
    topLayout->addWidget(label);

    QListWidget *iconView = new UndraggableKIconView(page);

    m_size16  = new QListWidgetItem(DesktopIcon(icon, 16), i18n("16 by 16 pixels"), iconView);
    m_size22  = new QListWidgetItem(DesktopIcon(icon, 22), i18n("22 by 22 pixels"), iconView);
    m_size32  = new QListWidgetItem(DesktopIcon(icon, 32), i18n("32 by 32 pixels"), iconView);
    m_size48  = new QListWidgetItem(DesktopIcon(icon, 48), i18n("48 by 48 pixels"), iconView);
    m_size64  = new QListWidgetItem(DesktopIcon(icon, 64), i18n("64 by 64 pixels"), iconView);
    m_size128 = new QListWidgetItem(DesktopIcon(icon, 128), i18n("128 by 128 pixels"), iconView);
    iconView->setIconSize(QSize(128, 128));
    iconView->setMinimumSize(QSize(128*6 + (6 + 2) * iconView->spacing() + 20, m_size128->sizeHint().height() + 2 * iconView->spacing() + 20));
    topLayout->addWidget(iconView);
    switch (iconSize) {
    case 16:  m_size16->setSelected(true); m_iconSize = 16;  break;
    case 22:  m_size22->setSelected(true); m_iconSize = 22;  break;
    default:
    case 32:  m_size32->setSelected(true); m_iconSize = 32;  break;
    case 48:  m_size48->setSelected(true); m_iconSize = 48;  break;
    case 64:  m_size64->setSelected(true); m_iconSize = 64;  break;
    case 128: m_size128->setSelected(true); m_iconSize = 128; break;
    }

    connect(iconView, SIGNAL(executed(QListWidgetItem*)),      this, SLOT(choose(QListWidgetItem*)));
    connect(iconView, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(choose(QListWidgetItem*)));
    connect(iconView, SIGNAL(itemSelectionChanged()),          this, SLOT(slotSelectionChanged()));

    mainLayout->addWidget(page);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, this);
    okButton = buttonBox->button(QDialogButtonBox::Ok);
    okButton->setDefault(true);
    okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    mainLayout->addWidget(buttonBox);
    connect(buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), SLOT(slotCancel()));
}
Example #7
0
TaskWPGanttView *View::createGanttView()
{
    TaskWPGanttView *v = new TaskWPGanttView( part(), this );

    connect( v, SIGNAL(requestPopupMenu(QString,QPoint)), this, SLOT(slotPopupMenu(QString,QPoint)) );

    connect( v, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()) );
    v->updateReadWrite( m_readWrite );
    v->loadContext();
    return v;
}
Example #8
0
TaskWorkPackageView *View::createTaskWorkPackageView()
{
    TaskWorkPackageView *v = new TaskWorkPackageView( part(), this );

    connect( v, SIGNAL( requestPopupMenu( const QString&, const QPoint & ) ), this, SLOT( slotPopupMenu( const QString&, const QPoint& ) ) );

    connect( v, SIGNAL( selectionChanged() ), SLOT( slotSelectionChanged() ) );
    v->updateReadWrite( m_readWrite );
    v->loadContext();
    return v;
}
Example #9
0
CTrackToolWidget::CTrackToolWidget(QTabWidget * parent)
: QWidget(parent)
, originator(false)
{
    setupUi(this);
    setObjectName("Tracks");
    parent->addTab(this,QIcon(":/icons/iconTrack16x16.png"),"");
    parent->setTabToolTip(parent->indexOf(this), tr("Tracks"));

    connect(&CTrackDB::self(), SIGNAL(sigModified(const QString&)), this, SLOT(slotDBChanged()));
    connect(&CTrackDB::self(), SIGNAL(sigNeedUpdate(const QString&)), this, SLOT(slotDBChanged()));
    connect(&CTrackDB::self(), SIGNAL(sigChanged()), this, SLOT(slotDBChanged()));

    connect(listTracks,SIGNAL(itemClicked(QListWidgetItem*) ),this,SLOT(slotItemClicked(QListWidgetItem*)));
    connect(listTracks,SIGNAL(itemDoubleClicked(QListWidgetItem*) ),this,SLOT(slotItemDoubleClicked(QListWidgetItem*)));
    connect(listTracks,SIGNAL(itemSelectionChanged()),this,SLOT(slotSelectionChanged()));

    contextMenu     = new QMenu(this);
    actEdit         = contextMenu->addAction(QPixmap(":/icons/iconEdit16x16.png"),tr("Edit..."),this,SLOT(slotEdit()));
    actRevert       = contextMenu->addAction(QPixmap(":/icons/iconReload16x16.png"),tr("Revert"),this,SLOT(slotRevert()));
    contextMenu->addSeparator();
    actDistance     = contextMenu->addAction(QPixmap(":/icons/iconDistance16x16.png"),tr("Make Overlay"),this,SLOT(slotToOverlay()));
    contextMenu->addSeparator();
    actHide         = contextMenu->addAction(tr("Show"),this,SLOT(slotShow()));
    actShowBullets  = contextMenu->addAction(tr("Show Bullets"),this,SLOT(slotShowBullets()));
    actShowMinMax   = contextMenu->addAction(tr("Show Min/Max"),this,SLOT(slotShowMinMax()));
    contextMenu->addSeparator();
    actZoomToFit    = contextMenu->addAction(QPixmap(":/icons/iconZoomArea16x16.png"),tr("Zoom to fit"),this,SLOT(slotZoomToFit()));
    actDel          = contextMenu->addAction(QPixmap(":/icons/iconClear16x16.png"),tr("Delete"),this,SLOT(slotDelete()));

    actHide->setCheckable(true);
    actShowBullets->setCheckable(true);
    actShowBullets->setChecked(CTrackDB::self().getShowBullets());
    actShowMinMax->setCheckable(true);
    actShowMinMax->setChecked(CTrackDB::self().getShowMinMax());

    connect(listTracks,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(slotContextMenu(const QPoint&)));

    QFontMetrics fm(listTracks->font());
    listTracks->setIconSize(QSize(15,N_LINES*fm.height()));

    connect(toolSortAlpha, SIGNAL(clicked()), this, SLOT(slotDBChanged()));
    connect(toolSortTime, SIGNAL(clicked()), this, SLOT(slotDBChanged()));

    toolSortAlpha->setIcon(QPixmap(":/icons/iconDec16x16.png"));
    toolSortTime->setIcon(QPixmap(":/icons/iconTime16x16.png"));

    SETTINGS;
    toolSortAlpha->setChecked(cfg.value("track/sortAlpha", true).toBool());
    toolSortTime->setChecked(cfg.value("track/sortTime", true).toBool());

    listTracks->installEventFilter(this);
}
Example #10
0
ServersList::ServersList(Servers *_servers, QWidget * parent )
:  QTreeWidget(parent), servers(_servers)

{
	serversDbName="servers";
	dbEnv=0;
	serverDb=0;
	connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(slotSelectionChanged()));
    serverSpeedTimer = new QTimer();
	connect(serverSpeedTimer, SIGNAL(timeout()), this, SLOT(slotServerSpeedTimeout()));
    qDebug()  << "In ServersList::ServersList 2";
}
Example #11
0
K3b::MovixView::MovixView( K3b::MovixDoc* doc, QWidget* parent )
:
    View( doc, parent ),
    m_doc( doc ),
    m_model( new MovixProjectModel( m_doc, this ) ),
    m_view( new QTreeView( this ) )
{
    m_view->setModel( m_model );
    m_view->setAcceptDrops( true );
    m_view->setDragEnabled( true );
    m_view->setDragDropMode( QTreeView::DragDrop );
    m_view->setItemsExpandable( false );
    m_view->setRootIsDecorated( false );
    m_view->setSelectionMode( QTreeView::ExtendedSelection );
    m_view->setVerticalScrollMode( QAbstractItemView::ScrollPerPixel );
    m_view->setContextMenuPolicy( Qt::ActionsContextMenu );
    // FIXME: make QHeaderView::Interactive the default but connect to model changes and call header()->resizeSections( QHeaderView::ResizeToContents );
    m_view->header()->setResizeMode( QHeaderView::ResizeToContents );
    m_view->setEditTriggers( QAbstractItemView::NoEditTriggers );
    setMainWidget( m_view );

    // setup actions
    m_actionProperties = K3b::createAction( this, i18n("Properties"), "document-properties",
                                            0, this, SLOT(showPropertiesDialog()),
                                            actionCollection(), "movix_show_props" );
    m_actionRemove = K3b::createAction( this, i18n( "Remove" ), "edit-delete",
                                        Qt::Key_Delete, this, SLOT(slotRemove()),
                                        actionCollection(), "movix_remove_item" );
    m_actionRemoveSubTitle = K3b::createAction( this, i18n( "Remove Subtitle File" ), "edit-delete",
                                                0, this, SLOT(slotRemoveSubTitleItems()),
                                                actionCollection(), "movix_remove_subtitle_item" );
    m_actionAddSubTitle = K3b::createAction( this, i18n("Add Subtitle File..."), 0,
                                             0, this, SLOT(slotAddSubTitleFile()),
                                             actionCollection(), "movix_add_subtitle" );

    connect( m_view->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
             this, SLOT(slotSelectionChanged()) );

    QAction* separator = new QAction( this );
    separator->setSeparator( true );
    m_view->addAction( m_actionRemove );
    m_view->addAction( m_actionRemoveSubTitle );
    m_view->addAction( m_actionAddSubTitle );
    m_view->addAction( separator );
    m_view->addAction( m_actionProperties );
    m_view->addAction( separator );
    m_view->addAction( actionCollection()->action("project_burn") );

    // Setup toolbar
    toolBox()->addActions( createPluginsActions( m_doc->type() ) );
    toolBox()->addWidget( new VolumeNameWidget( doc, toolBox() ) );
}
WBSDefinitionPanel::WBSDefinitionPanel( Project &project, WBSDefinition &def, QWidget *p, const char *n)
    : QWidget(p),
      m_project( project ),
      m_def(def),
      selectedRow(-1)
{
    setObjectName(n);
    setupUi(this);
    
    projectCode->setText( m_def.projectCode() );
    projectSeparator->setText( m_def.projectSeparator() );
    QStringList codeList = m_def.codeList();
    kDebug()<<codeList;
    defaultSeparator->setText(m_def.defaultSeparator());
    defaultCode->addItems(codeList);
    defaultCode->setCurrentIndex(m_def.defaultCodeIndex());
    defaultCode->setFocus();
    levelsTable->setItemDelegateForColumn(0, new ComboBoxDelegate(codeList, this));
    levelsGroup->setChecked(m_def.isLevelsDefEnabled());
    int i = 0;
    const QMap<int, WBSDefinition::CodeDef> &lev = m_def.levelsDef();
    levelsTable->setRowCount(lev.count());
    QStringList sl;
    kDebug()<<"Map size="<<lev.count();
    QMap<int, WBSDefinition::CodeDef>::const_iterator it;
    for (it = lev.begin(); it != lev.end(); ++it) {
        sl << QString("%1").arg(it.key());
        QTableWidgetItem *item = new QTableWidgetItem();
        item->setData(Qt::DisplayRole, it.value().code);
        levelsTable->setItem(i, 0, item);
        item = new QTableWidgetItem();
        item->setText(it.value().separator);
        levelsTable->setItem(i, 1, item);
        i++;
    }
    levelsTable->setVerticalHeaderLabels(sl);
    //levelsTable->setColumnStretchable(0, true);
    slotLevelChanged(level->value());
    
    connect(projectCode, SIGNAL(textChanged(const QString&)), SLOT(slotChanged()));
    connect(projectSeparator, SIGNAL(textChanged(const QString&)), SLOT(slotChanged()));
    connect(defaultCode, SIGNAL(activated(int)), SLOT(slotChanged()));
    connect(defaultSeparator, SIGNAL(textChanged(const QString&)), SLOT(slotChanged()));
    connect(levelsGroup, SIGNAL(toggled(bool)), SLOT(slotLevelsGroupToggled(bool)));
    connect(levelsTable, SIGNAL(cellChanged(int, int)), SLOT(slotChanged()));
    connect(levelsTable, SIGNAL(itemSelectionChanged()), SLOT(slotSelectionChanged()));
    connect(level, SIGNAL(valueChanged(int)), SLOT(slotLevelChanged(int)));
    connect(removeBtn, SIGNAL(clicked(bool)), SLOT(slotRemoveBtnClicked()));
    connect(addBtn, SIGNAL(clicked(bool)), SLOT(slotAddBtnClicked()));

    removeBtn->setEnabled(false);
}
CategoriesWidget::CategoriesWidget(QWidget *parent)
    : QWidget(parent)
{
    setupUi(this);

    m_buttonAddCategory->setIcon(KIcon(QLatin1String("list-add")));
    m_buttonRemoveCategory->setIcon(KIcon(QLatin1String("list-remove")));
    m_buttonEditCategory->setIcon(KIcon(QLatin1String("configure")));

    connect(m_buttonAddCategory, SIGNAL(clicked()), this, SLOT(slotAddCategory()));
    connect(m_buttonRemoveCategory, SIGNAL(clicked()), this, SLOT(slotRemoveCategory()));
    connect(m_buttonEditCategory, SIGNAL(clicked()), this, SLOT(slotEditCategory()));

    m_categoriesModel = new CategoriesModel(this);
    m_viewCategories->setModel(m_categoriesModel);

    connect(m_viewCategories->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
            this, SLOT(slotSelectionChanged(QItemSelection,QItemSelection)));
    connect(m_viewCategories, SIGNAL(doubleClicked(QModelIndex)),
            this, SLOT(slotEditCategory()));
    slotSelectionChanged(QItemSelection(), QItemSelection());
}
Example #14
0
KipiUploadWidget::KipiUploadWidget(KipiInterface* const iface, QWidget* const parent)
    : KIPI::UploadWidget(parent),
      d(new Private)
{
    d->iface                = iface;
    QVBoxLayout* const vlay = new QVBoxLayout(this);
    d->albumSel             = new AlbumSelectWidget(this);
    vlay->addWidget(d->albumSel);
    vlay->setContentsMargins(QMargins());
    vlay->setSpacing(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing));

    connect(d->albumSel, SIGNAL(itemSelectionChanged()),
            this, SLOT(slotSelectionChanged()));
}
Example #15
0
KexiPrjTypeSelector::KexiPrjTypeSelector(QWidget* parent)
        : QWidget(parent)
{
    setupUi(this);
    setObjectName("KexiPrjTypeSelector");
    icon_file->setPixmap(KIcon(KexiDB::defaultFileBasedDriverIconName()).pixmap(48,48));
    icon_file->setFixedSize(icon_file->pixmap()->size() / 2);
    icon_server->setPixmap(KIcon(KEXI_DATABASE_SERVER_ICON_NAME).pixmap(48,48));
    icon_server->setFixedSize(icon_server->pixmap()->size() / 2);

    connect(buttonGroup, SIGNAL(buttonClicked(QAbstractButton*)),
            this, SLOT(slotSelectionChanged(QAbstractButton*)));

    slotSelectionChanged(option_file);
}
Example #16
0
void ViewDepartments::slotCancel()
{
	if (m_model->cancel())
	{
		m_editMode = false;
		emit signalSave(-1, false);
	}
	else
		QMessageBox::critical(this, "", "Не удалось отменить изменения", QMessageBox::Ok);
	auto index = ui->tableView->selectionModel()->currentIndex();
	ui->tableView->reset();
	ui->tableView->selectionModel()->setCurrentIndex(index, QItemSelectionModel::Select |
		QItemSelectionModel::Rows);
	slotSelectionChanged(QItemSelection(), QItemSelection());
}
Example #17
0
ServersList::ServersList(QString dbName, DbEnv *_dbEnv, Servers *_servers, QWidget* parent)
: QTreeWidget(parent), servers(_servers), dbEnv(_dbEnv),serversDbName(dbName)
{
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
    this->header()->setMovable(false);
#else
    this->header()->setSectionsMovable(false);
#endif
	m_loadServers(); //this populates the serverlist
	addServers(); //this populates the listview
	connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(slotSelectionChanged()));
    serverSpeedTimer = new QTimer();
    connect(serverSpeedTimer, SIGNAL(timeout()), this, SLOT(slotServerSpeedTimeout()));
    qDebug()  << "In ServersList::ServersList 1";
}
Example #18
0
void AddFixture::slotModeActivated(const QString& modeName)
{
	QLCFixtureMode* mode = NULL;

	if (m_fixtureDef == NULL)
		return;

	m_mode = m_fixtureDef->mode(modeName);
	if (m_mode == NULL)
	{
		slotSelectionChanged(NULL);
		return;
	}

	m_channelsSpin->setValue(m_mode->channels());
}
Example #19
0
void FormMultiWidget::addEditor(int idx)
{
    FormatTextEdit *editor = new FormatTextEdit(this);
    m_editors.insert(idx, editor);

    m_minusButtons.insert(idx, makeButton(m_minusIcon, SLOT(minusButtonClicked())));
    m_plusButtons.insert(idx + 1,
            new ButtonWrapper(makeButton(m_plusIcon, SLOT(plusButtonClicked())), editor));

    connect(editor, SIGNAL(textChanged()), SLOT(slotTextChanged()));
    connect(editor, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()));
    connect(editor, SIGNAL(cursorPositionChanged()), SIGNAL(cursorPositionChanged()));
    editor->installEventFilter(this);

    emit editorCreated(editor);
}
KexiPrjTypeSelector::KexiPrjTypeSelector(QWidget* parent)
        : QWidget(parent)
{
    setupUi(this);
    setObjectName("KexiPrjTypeSelector");
    QString none;
    icon_file->setPixmap(DesktopIcon(KexiDB::defaultFileBasedDriverIcon(), 48));
    icon_file->setFixedSize(icon_file->pixmap()->size() / 2);
    icon_server->setPixmap(DesktopIcon(KEXI_ICON_DATABASE_SERVER, 48));
    icon_server->setFixedSize(icon_server->pixmap()->size() / 2);

    connect(buttonGroup, SIGNAL(clicked(int)),
            this, SLOT(slotSelectionChanged(int)));

    slotSelectionChanged(1);
}
Example #21
0
QTableVisualizer::QTableVisualizer(TableVisualizer * pVisualizer, QWidget * parent, const char * name, Qt::WFlags f)
: QVisualizer(pVisualizer, parent, name, f)
{
	m_pLayout = new QGridLayout(this, 1, 1, 0, -1, "layout");
	m_pTable = new QDraggingTable(this, "table");
	m_pLayout->addWidget(m_pTable, 0, 0);
	connect(m_pTable, SIGNAL(currentChanged(int, int)), this, SLOT(slotCurrentChanged(int, int)));
	connect(m_pTable, SIGNAL(clicked(int, int, int, const QPoint& )), this, SLOT(slotClicked(int, int, int, const QPoint& )));
	connect(m_pTable, SIGNAL(doubleClicked(int, int, int, const QPoint& )), this, SLOT(slotDoubleClicked(int, int, int, const QPoint& )));
	connect(m_pTable, SIGNAL(pressed(int, int, int, const QPoint& )), this, SLOT(slotPressed(int, int, int, const QPoint& )));
	connect(m_pTable, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()));
	connect(m_pTable, SIGNAL(valueChanged(int, int)), this, SLOT(slotValueChanged(int, int)));
	connect(m_pTable, SIGNAL(contextMenuRequested(int, int, const QPoint& )), this, SLOT(slotContextMenuRequested(int, int, const QPoint& )));
	connect(m_pTable, SIGNAL(dropped(QDropEvent* )), this, SLOT(slotDropped(QDropEvent* )));
	m_pTable->show();
}
Example #22
0
KonqSessionDlg::KonqSessionDlg( KonqViewManager *manager, QWidget *parent )
    : KDialog( parent )
    , d( new KonqSessionDlgPrivate( manager, this ) )
{
    d->layout()->setMargin( 0 );
    setMainWidget( d );
    
    setObjectName( QLatin1String( "konq_session_dialog" ) );
    setModal( true );
    setCaption( i18nc( "@title:window", "Manage Sessions" ) );
    setButtons( BTN_OPEN | Close );
    setDefaultButton( Close );
    
    setButtonGuiItem( BTN_OPEN, KGuiItem( i18n( "&Open" ), "document-open" ) );
    d->m_pSaveCurrentButton->setIcon(KIcon("document-save"));
    d->m_pRenameButton->setIcon(KIcon("edit-rename"));
    d->m_pDeleteButton->setIcon(KIcon("edit-delete"));
    d->m_pNewButton->setIcon(KIcon("document-new"));
    
    QString dir = KStandardDirs::locateLocal("appdata", "sessions/");
    
    d->m_pModel = new KDirModel(d->m_pListView);
    d->m_pModel->sort(QDir::Name);
    d->m_pModel->dirLister()->setDirOnlyMode(true);
    d->m_pModel->dirLister()->openUrl(dir);
    d->m_pListView->setModel(d->m_pModel);
    
    d->m_pListView->setMinimumSize( d->m_pListView->sizeHint() );
    
    connect( d->m_pListView->selectionModel(), SIGNAL( selectionChanged(
        const QItemSelection  &, const QItemSelection &) ), this, SLOT(
        slotSelectionChanged() ) );
    
    enableButton( BTN_OPEN, d->m_pListView->currentIndex().isValid() );
    slotSelectionChanged();

    d->m_pOpenTabsInsideCurrentWindow->setChecked(
	KonqSettings::openTabsInsideCurrentWindow());

    connect( this,SIGNAL(user1Clicked()),SLOT(slotOpen()));
    connect( d->m_pNewButton, SIGNAL(clicked()),SLOT(slotNew()));
    connect( d->m_pSaveCurrentButton, SIGNAL(clicked()),SLOT(slotSave()));
    connect( d->m_pRenameButton, SIGNAL(clicked()),SLOT(slotRename()));
    connect( d->m_pDeleteButton, SIGNAL(clicked()),SLOT(slotDelete()));
    
    resize( sizeHint() );
}
Example #23
0
void FixtureManager::slotModeChanged(App::Mode mode)
{
	if (mode == App::Operate)
	{
		m_addAction->setEnabled(false);
		m_removeAction->setEnabled(false);
		m_propertiesAction->setEnabled(false);
	}
	else
	{
		m_addAction->setEnabled(true);
		m_removeAction->setEnabled(true);
		m_propertiesAction->setEnabled(true);
	}

	slotSelectionChanged();
}
Example #24
0
void DeviceManagerView::initView()
{
  setCaption(QString("Device Manager"));
  resize(300, 200);

  QString dir;
  _app->settings()->get(KEY_SYSTEM_DIR, dir);
  dir += QString("/") + PIXMAPPATH;

  setIcon(dir + QString("/device.xpm"));

  m_layout = new QVBoxLayout(this);

  m_dockArea = new QDockArea(Horizontal, QDockArea::Normal, this);
  m_dockArea->setFixedHeight(30);
  m_toolbar = new QToolBar("Device Manager", _app, m_dockArea);
  
  m_dm = new DeviceManager(this);

  m_addOutputDeviceButton = new QToolButton(QIconSet(QPixmap(dir + "/addoutputdevice.xpm")), "Add New Output Device", 0, m_dm, SLOT(slotDLAddOutputDevice()), m_toolbar);

  m_addBusButton = new QToolButton(QIconSet(QPixmap(dir + "/addbus.xpm")), "Add New Bus", 0, m_dm, SLOT(slotDLAddBus()), m_toolbar);

  m_removeButton = new QToolButton(QIconSet(QPixmap(dir + "/remove.xpm")), "Remove Current Selection", 0, m_dm, SLOT(slotDLRemove()), m_toolbar);

  m_toolbar->addSeparator();

  m_propertiesButton = new QToolButton(QIconSet(QPixmap(dir + "/settings.xpm")), "Properties", 0, m_dm, SLOT(slotDLViewProperties()), m_toolbar);

  m_toolbar->addSeparator();

  m_monitorButton = new QToolButton(QIconSet(QPixmap(dir + "/monitor.xpm")), "Monitor Device", 0, m_dm, SLOT(slotDLViewMonitor()), m_toolbar);

  m_consoleButton = new QToolButton(QIconSet(QPixmap(dir + "/console.xpm")), "View Console", 0, m_dm, SLOT(slotDLViewConsole()), m_toolbar);

  m_layout->addWidget(m_dockArea);
  m_layout->addWidget(m_dm);

  connect(_app->virtualConsole(), SIGNAL(modeChange(VirtualConsole::Mode)),
	  this, SLOT(slotModeChanged(VirtualConsole::Mode)));

  connect(m_dm, SIGNAL(selectionChanged(int, int)),
	  this, SLOT(slotSelectionChanged(int, int)));

  slotSelectionChanged(-1, -1);
}
Example #25
0
//
// View Properties
//
void DeviceManagerView::slotProperties()
{
  QListViewItem* item = m_listView->currentItem();

  t_device_id id = item->text(KColumnID).toInt();
  Device* device = _app->doc()->device(id);
  
  ASSERT(device);

  device->viewProperties();

  QString address;
  address.sprintf("%.3d", device->address() + 1);
  item->setText(KColumnAddress, address);
  item->setText(KColumnName, device->name());
  slotSelectionChanged(item);
}
Example #26
0
void KXmlCommandAdvancedDlg::slotMoveUp()
{
	TQListViewItem	*item = m_view->currentItem(), *prev = 0;
	if (item && (prev=findPrev(item)))
	{
		TQListViewItem	*after(0);
		if ((after=findPrev(prev)) != 0)
			item->moveItem(after);
		else
		{
			TQListViewItem	*parent = item->parent();
			parent->takeItem(item);
			parent->insertItem(item);
		}
		m_view->setSelected(item, true);
		slotSelectionChanged(item);
	}
}
Example #27
0
int VCXYPadProperties::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: slotAddClicked(); break;
        case 1: slotRemoveClicked(); break;
        case 2: slotEditClicked(); break;
        case 3: slotSelectionChanged((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break;
        case 4: accept(); break;
        default: ;
        }
        _id -= 5;
    }
    return _id;
}
Example #28
0
IconSizeDialog::IconSizeDialog(const QString &caption, const QString &message, const QString &icon, int iconSize, QWidget *parent)
     : KDialog(parent)
{
	// KDialog options
	setCaption(caption);
	setButtons(Ok | Cancel);
	setDefaultButton(Ok);
	setModal(true);
	showButtonSeparator(false);
	connect(this, SIGNAL(cancelClicked()), SLOT(slotCancel()));

	QWidget *page = new QWidget(this);
	QVBoxLayout *topLayout = new QVBoxLayout(page);

	QLabel *label = new QLabel(message, page);
	topLayout->addWidget(label);

	KListWidget *iconView = new UndraggableKIconView(page);

	m_size16  = new QListWidgetItem(DesktopIcon(icon,16), i18n("16 by 16 pixels"),iconView);
	m_size22  = new QListWidgetItem(DesktopIcon(icon,22), i18n("22 by 22 pixels"),iconView);
	m_size32  = new QListWidgetItem(DesktopIcon(icon,32), i18n("32 by 32 pixels"),iconView);
	m_size48  = new QListWidgetItem(DesktopIcon(icon,48), i18n("48 by 48 pixels"),iconView);
	m_size64  = new QListWidgetItem(DesktopIcon(icon,64), i18n("64 by 64 pixels"),iconView);
	m_size128 = new QListWidgetItem(DesktopIcon(icon,128), i18n("128 by 128 pixels"),iconView);
	iconView->setIconSize(QSize(128,128));
	iconView->setMinimumSize(QSize(128*6 + (6+2) * iconView->spacing() + 20, m_size128->sizeHint().height() + 2 * iconView->spacing() + 20));
	topLayout->addWidget(iconView);
	switch (iconSize) {
		case 16:  m_size16->setSelected(true); m_iconSize = 16;  break;
		case 22:  m_size22->setSelected(true); m_iconSize = 22;  break;
		default:
		case 32:  m_size32->setSelected(true); m_iconSize = 32;  break;
		case 48:  m_size48->setSelected(true); m_iconSize = 48;  break;
		case 64:  m_size64->setSelected(true); m_iconSize = 64;  break;
		case 128: m_size128->setSelected(true); m_iconSize = 128; break;
	}

	connect( iconView, SIGNAL(executed(QListWidgetItem*)),      this, SLOT(choose(QListWidgetItem*)) ); 
	connect( iconView, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(choose(QListWidgetItem*)) );
	connect( iconView, SIGNAL(itemSelectionChanged()),          this, SLOT(slotSelectionChanged()) );

	setMainWidget(page);
}
K3bExternalEncoderSettingsWidget::K3bExternalEncoderSettingsWidget( QWidget* parent, const QVariantList& args )
    : K3b::PluginConfigWidget( parent, args )
{
    setupUi( this );

    connect( m_viewEncoders, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
             this, SLOT(slotSelectionChanged(QTreeWidgetItem*)) );
    connect( m_viewEncoders, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
             this, SLOT(slotEditCommand()) );
    connect( m_buttonAdd, SIGNAL(clicked()),
             this, SLOT(slotNewCommand()) );
    connect( m_buttonEdit, SIGNAL(clicked()),
             this, SLOT(slotEditCommand()) );
    connect( m_buttonRemove, SIGNAL(clicked()),
             this, SLOT(slotRemoveCommand()) );

    m_editDlg = new K3bExternalEncoderEditDialog( this );
    slotSelectionChanged( 0 );
}
Example #30
0
void ServersList::serversListInit()
{
	NntpHost::initHostMaps();

    activeIcon = new QIcon(QString::fromUtf8(":/quban/images/ginux/Entire_Network-16.png"));
    activePausedIcon = new QIcon(QString::fromUtf8(":/quban/images/ginux/Entire_Network_Paused-16.png"));
    passiveIcon = new QIcon(QString::fromUtf8(":/quban/images/ginux/Passive_Network-16.png"));
    passivePausedIcon = new QIcon(QString::fromUtf8(":/quban/images/ginux/Passive_Network_Paused-16.png"));
    dormantIcon = new QIcon(QString::fromUtf8(":/quban/images/ginux/Dormant_Network-16.png"));

    m_loadServers(); //this populates the serverlist
 	addServers(); //this populates the listview

	connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(slotSelectionChanged()));

    qDebug()  << "In ServersList::serversListInit";
    serverSpeedTimer = new QTimer(this);
    connect(serverSpeedTimer, SIGNAL(timeout()), this, SLOT(slotServerSpeedTimeout()));
}