int MainWindow::save_on_amp(char *name, int slot) { int ret; if(!connected) return -1; ret = amp_ops->save_on_amp(name, slot); if(name[0] == 0x00) { setWindowTitle(QString(tr("RePlug: NONE"))); setAccessibleName(QString(tr("Main window: NONE"))); } else { setWindowTitle(QString(tr("RePlug: %1")).arg(name)); setAccessibleName(QString(tr("Main window: %1")).arg(name)); } current_name=name; memcpy(names[slot], name, 32); return ret; }
SMIHED_widget::SMIHED_widget(QWidget *parent) : QWidget(parent) { #ifdef RELEASE_MODE setAccessibleName("SMIHED"); #else setAccessibleName("SMIHED_d"); #endif _ui.setupUi(this); _fileListModel = new QStringListModel(); _fileListModel->setStringList(_fileList); _ui.listView->setModel(_fileListModel); }
void MainWindow::change_title(QString name) { current_name = name; if(current_name.isEmpty()) { setWindowTitle(QString(tr("RePlug: NONE"))); setAccessibleName(QString(tr("Main window: NONE"))); } else { setWindowTitle(QString(tr("RePlug: %1")).arg(current_name)); setAccessibleName(QString(tr("Main window: %1")).arg(name)); } }
MainWindow::MainWindow(QWidget *parent) : QWidget(parent), m_updatePanelVisible(true), m_mainPanel(new MainPanel(this)), m_positionUpdateTimer(new QTimer(this)), m_expandDelayTimer(new QTimer(this)), m_sizeChangeAni(new QPropertyAnimation(this, "size")), m_posChangeAni(new QPropertyAnimation(this, "pos")), m_panelShowAni(new QPropertyAnimation(m_mainPanel, "pos")), m_panelHideAni(new QPropertyAnimation(m_mainPanel, "pos")), m_xcbMisc(XcbMisc::instance()) { setAccessibleName("dock-mainwindow"); setWindowFlags(Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus); setAttribute(Qt::WA_TranslucentBackground); m_settings = new DockSettings(this); m_xcbMisc->set_window_type(winId(), XcbMisc::Dock); initComponents(); initConnections(); m_mainPanel->setFixedSize(m_settings->windowSize()); updatePanelVisible(); // setStyleSheet("background-color:red;"); connect(m_mainPanel, &MainPanel::geometryChanged, this, &MainWindow::panelGeometryChanged); }
/*! \brief constructor * * initialize layout, attributes, etc. */ XletSwitchBoard::XletSwitchBoard(QWidget *parent) : XLet(parent), m_drawGrid(false), m_trace_box(false), m_group_to_resize(0) { setTitle(tr("Switchboard")); m_layout = new PeersLayout(this); setObjectName("scroller"); // in order for the style settings to be set accordingly setAccessibleName(tr("Switchboard")); setAcceptDrops(true); reloadGroups(); reloadExternalPhones(); connect(b_engine, SIGNAL(userUpdated(UserInfo *)), this, SLOT(updateUser(UserInfo *))); connect(b_engine, SIGNAL(updatePeerAgent(double, const QString &, const QString &, const QVariant &)), this, SLOT(updatePeerAgent(double, const QString &, const QString &, const QVariant &))); // savePositions() needs m_peerhash to be non-empty in order to be useful, // thus we call it before removePeers() connect(b_engine, SIGNAL(delogged()), this, SLOT(savePositions())); connect(b_engine, SIGNAL(delogged()), this, SLOT(removePeers())); setMouseTracking(true); }
ControlFrame::ControlFrame(QString name, QWidget *parent) : QFrame(parent), ui(new Ui::ControlFrame) { ui->setupUi(this); setAccessibleName(name); }
NewWizardPage4::NewWizardPage4(QWidget* parent) : QWizardPage(parent) { setFinalPage(true); setTitle(tr("Create New Score")); setSubTitle(tr("Choose template file:")); setAccessibleName(title()); setAccessibleDescription(subTitle()); templateFileBrowser = new ScoreBrowser; templateFileBrowser->setStripNumbers(true); templateFileBrowser->setShowCustomCategory(true); templateFileBrowser->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored)); buildTemplatesList(); QVBoxLayout* layout = new QVBoxLayout; QHBoxLayout* searchLayout = new QHBoxLayout; QLineEdit* search = new QLineEdit; search->setPlaceholderText(tr("Search")); search->setClearButtonEnabled(true); search->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); searchLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::Maximum)); searchLayout->addWidget(search); layout->addLayout(searchLayout); layout->addWidget(templateFileBrowser); setLayout(layout); connect(templateFileBrowser, SIGNAL(scoreSelected(const QString&)), SLOT(templateChanged(const QString&))); connect(templateFileBrowser, SIGNAL(scoreActivated(const QString&)), SLOT(fileAccepted(const QString&))); connect(search, &QLineEdit::textChanged, [this] (const QString& searchString) { this->templateFileBrowser->filter(searchString); }); }
CaptureFilterCombo::CaptureFilterCombo(QWidget *parent, bool plain) : QComboBox(parent), cf_edit_(NULL) { cf_edit_ = new CaptureFilterEdit(this, plain); setEditable(true); // Enabling autocompletion here gives us two simultaneous completions: // Inline (highlighted text) for entire filters, handled here and popup // completion for fields handled by CaptureFilterEdit. setAutoCompletion(false); setLineEdit(cf_edit_); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); setInsertPolicy(QComboBox::NoInsert); setAccessibleName(tr("Capture filter selector")); setStyleSheet( "QComboBox {" #ifdef Q_OS_MAC " border: 1px solid gray;" #else " border: 1px solid palette(shadow);" #endif " border-radius: 3px;" " padding: 0px 0px 0px 0px;" " margin-left: 0px;" " min-width: 20em;" " }" "QComboBox::drop-down {" " subcontrol-origin: padding;" " subcontrol-position: top right;" " width: 16px;" " border-left-width: 0px;" " }" "QComboBox::down-arrow {" " image: url(:/icons/toolbar/14x14/x-filter-dropdown.png);" " }" "QComboBox::down-arrow:on { /* shift the arrow when popup is open */" " top: 1px;" " left: 1px;" "}" ); connect(this, SIGNAL(interfacesChanged()), cf_edit_, SLOT(checkFilter())); connect(cf_edit_, SIGNAL(pushFilterSyntaxStatus(const QString&)), this, SIGNAL(pushFilterSyntaxStatus(const QString&))); connect(cf_edit_, SIGNAL(popFilterSyntaxStatus()), this, SIGNAL(popFilterSyntaxStatus())); connect(cf_edit_, SIGNAL(captureFilterSyntaxChanged(bool)), this, SIGNAL(captureFilterSyntaxChanged(bool))); connect(cf_edit_, SIGNAL(startCapture()), this, SIGNAL(startCapture())); connect(cf_edit_, SIGNAL(startCapture()), this, SLOT(saveAndRebuildFilterList())); connect(wsApp, SIGNAL(appInitialized()), this, SLOT(rebuildFilterList())); connect(wsApp, SIGNAL(preferencesChanged()), this, SLOT(rebuildFilterList())); rebuildFilterList(); clearEditText(); }
/* void MainWindow::get_amp_hid() { int g; g = amp_ops->poll_amp_hid(); if (g < 0) return; //amp->update_gain(g); } */ void MainWindow::stop_amp() { int x; save->delete_items(); load->delete_items(); quickpres->delete_items(); x = amp_ops->stop_amp(); if(x == 0) // if request succeded { // deactivate buttons amp->enable_set_button(false); effect1->enable_set_button(false); effect2->enable_set_button(false); effect3->enable_set_button(false); effect4->enable_set_button(false); ui->actionConnect->setDisabled(false); ui->actionDisconnect->setDisabled(true); ui->actionSave_to_amplifier->setDisabled(true); ui->action_Load_from_amplifier->setDisabled(true); ui->actionSave_effects->setDisabled(true); ui->action_Library_view->setDisabled(true); setWindowTitle(QString(tr("RePlug"))); setAccessibleName(QString(tr("Main window: None"))); ui->statusBar->showMessage(tr("Disconnected"), 5000); // show message on the status bar connected = false; } else // if request failed ui->statusBar->showMessage(QString(tr("Error: %1")).arg(x), 5000); }
void LineEditWidget::setTitle(const QString &title) { m_title->setText(title); setAccessibleName(title); m_edit->setAccessibleName(title); }
InterfaceTree::InterfaceTree(QWidget *parent) : QTreeWidget(parent) #ifdef HAVE_LIBPCAP ,stat_cache_(NULL) ,stat_timer_(NULL) #endif // HAVE_LIBPCAP { QTreeWidgetItem *ti; qRegisterMetaType< PointList >("PointList"); header()->setVisible(false); setRootIsDecorated(false); setUniformRowHeights(true); /* Seems to have no effect, still the default value (2) is being used, as it * was set in the .ui file. But better safe, then sorry. */ resetColumnCount(); setSelectionMode(QAbstractItemView::ExtendedSelection); setAccessibleName(tr("Welcome screen list")); setItemDelegateForColumn(IFTREE_COL_STATS, new SparkLineDelegate(this)); setDisabled(true); ti = new QTreeWidgetItem(); ti->setText(IFTREE_COL_NAME, tr("Waiting for startup%1").arg(UTF8_HORIZONTAL_ELLIPSIS)); addTopLevelItem(ti); resizeColumnToContents(IFTREE_COL_NAME); connect(wsApp, SIGNAL(appInitialized()), this, SLOT(getInterfaceList())); connect(wsApp, SIGNAL(localInterfaceListChanged()), this, SLOT(interfaceListChanged())); connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelectedInterfaces())); }
GridButton::GridButton(const int i , const int j , QWidget *parent) :QPushButton(parent) { setAccessibleName(QString("GridButton")); row = i; col = j; XIcon = QIcon(":/new/prefix1/images/x3.png"); color = QColor(Qt::white); borderTop = QColor(); borderRight = QColor(); borderBottom = QColor(); borderLeft = QColor(); borderTop.setNamedColor("#A0A0A0"); borderRight.setNamedColor("#A0A0A0"); borderBottom.setNamedColor("#A0A0A0"); borderLeft.setNamedColor("#A0A0A0"); this->setFixedSize(20,20); //Load the stylesheet file for widgets QFile stylesFile(":/new/prefix1/qss/styles.qss"); if(stylesFile.open(QIODevice::ReadOnly | QIODevice::Text)) { qss = stylesFile.readAll(); stylesFile.close(); } initBorders(); updateStyle(); }
NewWizardPage4::NewWizardPage4(QWidget* parent) : QWizardPage(parent) { setTitle(tr("Create New Score")); setSubTitle(tr("Select Template File:")); setAccessibleName(title()); setAccessibleDescription(subTitle()); templateFileBrowser = new ScoreBrowser; templateFileBrowser->setStripNumbers(true); QDir dir(mscoreGlobalShare + "/templates"); templateFileBrowser->setScores(dir.entryInfoList(QDir::NoDotAndDotDot | QDir::Readable | QDir::Dirs | QDir::Files, QDir::Name)); templateFileBrowser->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored)); QFileInfo myTemplates(preferences.myTemplatesPath); if (myTemplates.isRelative()) myTemplates.setFile(QDir::home(), preferences.myTemplatesPath); QLayout* layout = new QVBoxLayout; layout->addWidget(templateFileBrowser); setLayout(layout); connect(templateFileBrowser, SIGNAL(scoreSelected(const QString&)), SLOT(templateChanged(const QString&))); connect(templateFileBrowser, SIGNAL(scoreActivated(const QString&)), SLOT(fileAccepted(const QString&))); }
InterfaceTree::InterfaceTree(QWidget *parent) : QTreeWidget(parent) #ifdef HAVE_LIBPCAP ,stat_cache_(NULL) ,stat_timer_(NULL) #endif // HAVE_LIBPCAP { QTreeWidgetItem *ti; header()->setVisible(false); setRootIsDecorated(false); setUniformRowHeights(true); setColumnCount(2); setSelectionMode(QAbstractItemView::ExtendedSelection); setAccessibleName(tr("Welcome screen list")); setItemDelegateForColumn(1, new SparkLineDelegate()); setDisabled(true); ti = new QTreeWidgetItem(); ti->setText(0, tr("Waiting for startup" UTF8_HORIZONTAL_ELLIPSIS)); addTopLevelItem(ti); resizeColumnToContents(0); connect(wsApp, SIGNAL(appInitialized()), this, SLOT(getInterfaceList())); connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelectedInterfaces())); }
AccessibleToolButton::AccessibleToolButton(QWidget* parent, QAction* defaultQAction ): QToolButton(parent) { setDefaultAction(defaultQAction); setFocusPolicy(Qt::TabFocus); setAccessibleName(defaultQAction->text()); setAccessibleDescription(defaultQAction->toolTip()); }
ByteViewTab::ByteViewTab(QWidget *parent) : QTabWidget(parent) { setAccessibleName(tr("Packet bytes")); setTabPosition(QTabWidget::South); setDocumentMode(true); addTab(); }
CaptureFilterCombo::CaptureFilterCombo(QWidget *parent) : QComboBox(parent), cf_edit_(NULL) { cf_edit_ = new CaptureFilterEdit(); setEditable(true); setLineEdit(cf_edit_); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); setInsertPolicy(QComboBox::NoInsert); setAccessibleName(tr("Capture filter selector")); setStyleSheet( "QComboBox {" #ifdef Q_OS_MAC " border: 1px solid gray;" #else " border: 1px solid palette(shadow);" #endif " border-radius: 3px;" " padding: 0px 0px 0px 0px;" " margin-left: 0px;" " min-width: 20em;" " }" "QComboBox::drop-down {" " subcontrol-origin: padding;" " subcontrol-position: top right;" " width: 16px;" " border-left-width: 0px;" " }" "QComboBox::down-arrow {" " image: url(:/dfilter/dfilter_dropdown.png);" " }" "QComboBox::down-arrow:on { /* shift the arrow when popup is open */" " top: 1px;" " left: 1px;" "}" ); completer()->setCompletionMode(QCompleter::PopupCompletion); connect(this, SIGNAL(interfacesChanged()), cf_edit_, SLOT(checkFilter())); connect(cf_edit_, SIGNAL(pushFilterSyntaxStatus(QString&)), this, SIGNAL(pushFilterSyntaxStatus(QString&))); connect(cf_edit_, SIGNAL(popFilterSyntaxStatus()), this, SIGNAL(popFilterSyntaxStatus())); connect(cf_edit_, SIGNAL(captureFilterSyntaxChanged(bool)), this, SIGNAL(captureFilterSyntaxChanged(bool))); connect(cf_edit_, SIGNAL(startCapture()), this, SIGNAL(startCapture())); connect(cf_edit_, SIGNAL(startCapture()), this, SLOT(rebuildFilterList())); connect(wsApp, SIGNAL(appInitialized()), this, SLOT(rebuildFilterList())); connect(wsApp, SIGNAL(preferencesChanged()), this, SLOT(rebuildFilterList())); rebuildFilterList(false); clearEditText(); }
ThreeSpinBox::ThreeSpinBox(QString name, QString description, QWidget *parent) : QFrame(parent), ui(new Ui::ThreeSpinBox) { ui->setupUi(this); ui->label->setText(name); ui->label->setToolTip(description); setAccessibleName(name); }
ByteViewTab::ByteViewTab(QWidget *parent) : QTabWidget(parent), cap_file_(0) { setAccessibleName(tr("Packet bytes")); setTabPosition(QTabWidget::South); setDocumentMode(true); connect(wsApp, SIGNAL(appInitialized()), this, SLOT(connectToMainWindow())); }
void LauncherContextualMenu::setTitle(const QString& title) { setAccessibleName(title); m_title = title; /* Escaping ampersands so that they are not considered as keyboard accelerators. */ m_titleAction->setText(m_title.replace("&", "&&")); Q_EMIT titleChanged(m_title); }
ProtoTree::ProtoTree(QWidget *parent) : QTreeWidget(parent) { setAccessibleName(tr("Packet details")); setUniformRowHeights(true); connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(updateSelectionStatus(QTreeWidgetItem*))); connect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(expand(QModelIndex))); connect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(collapse(QModelIndex))); connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(itemDoubleClick(QTreeWidgetItem*, int))); }
NewWizardPage3::NewWizardPage3(QWidget* parent) : QWizardPage(parent) { setTitle(tr("Create New Score")); setSubTitle(tr("Create Time Signature")); setAccessibleName(title()); setAccessibleDescription(subTitle()); w = new TimesigWizard; QGridLayout* grid = new QGridLayout; grid->addWidget(w, 0, 0); setLayout(grid); }
LootAnimationWidget::LootAnimationWidget(QString name, QWidget *parent) : QFrame(parent), ui(new Ui::LootAnimationWidget), editedStyle("background-color:#66FF99;") { ui->setupUi(this); setAccessibleName(name); connect(ui->animations, SIGNAL(textChanged()), SLOT(markNotEmptyPlainTextEdits())); connect(ui->animationMin, SIGNAL(textChanged()), SLOT(markNotEmptyPlainTextEdits())); connect(ui->animationMax, SIGNAL(textChanged()), SLOT(markNotEmptyPlainTextEdits())); connect(ui->lootAnimAdd, SIGNAL(clicked()), SLOT(lootAnimAdd())); }
void KCapacityBar::setText(const QString &text) { bool updateGeom = d->text.isEmpty() || text.isEmpty(); d->text = text; if (updateGeom) { updateGeometry(); } #ifndef QT_NO_ACCESSIBILITY setAccessibleName(text); #endif update(); }
InspectorBase::InspectorBase(QWidget* parent) : QWidget(parent) { setAccessibleName(tr("Inspector")); resetMapper = new QSignalMapper(this); valueMapper = new QSignalMapper(this); inspector = static_cast<Inspector*>(parent); _layout = new QVBoxLayout; _layout->setSpacing(0); _layout->setContentsMargins(0, 10, 0, 0); _layout->addStretch(100); setLayout(_layout); }
NewWizardPage1::NewWizardPage1(QWidget* parent) : QWizardPage(parent) { setTitle(tr("Create New Score")); setSubTitle(tr("Enter score information:")); setAccessibleName(QWizardPage::title()); setAccessibleDescription(QWizardPage::subTitle()); w = new TitleWizard; QGridLayout* grid = new QGridLayout; grid->addWidget(w, 0, 0); setLayout(grid); }
NewWizardPage1::NewWizardPage1(QWidget* parent) : QWizardPage(parent) { setTitle(tr("Create New Score")); setSubTitle(tr("This wizard creates a new score")); //crash setAccessibleName(title()); setAccessibleName(tr("Create New Score")); setAccessibleDescription(subTitle()); w = new TitleWizard; QGridLayout* grid = new QGridLayout; grid->addWidget(w, 0, 0); setLayout(grid); }
DialPanel::DialPanel(QWidget *parent) : XLet(parent) { setTitle(tr("Dial")); setAccessibleName(tr("Dial Panel")); setAcceptDrops(true); m_input = new QComboBox(this); m_input->setObjectName("extension_input"); m_input->setToolTip(tr("Input here the phone number to dial")); m_input->setEditable(true); m_input->setDuplicatesEnabled(false); m_input->setInsertPolicy(QComboBox::InsertAtTop); m_input->setMinimumContentsLength(15); m_input->lineEdit()->setMaxLength(30); m_lbl = new QLabel(tr("Enter &Number :"), this); m_lbl->setBuddy(m_input); loadHistory(); m_input->clearEditText(); QPixmap pmphone = QPixmap(":/images/sipphone.png"); QPushButton * dialButton = new QPushButton(this); dialButton->setObjectName("dial_button"); dialButton->setIcon(pmphone); dialButton->setIconSize(pmphone.size()); QHBoxLayout * vlayout = new QHBoxLayout(this); vlayout->setMargin(0); vlayout->addStretch(1); vlayout->addWidget(m_lbl, 0, Qt::AlignCenter); vlayout->addWidget(m_input, 0, Qt::AlignCenter); vlayout->addWidget(dialButton, 0, Qt::AlignCenter); vlayout->addStretch(1); connect(dialButton, SIGNAL(clicked()), m_input->lineEdit(), SIGNAL(returnPressed())); connect(b_engine, SIGNAL(pasteToXlets(const QString &)), this, SLOT(setNumberToDial(const QString &))); connect(this, SIGNAL(textEdited(const QString &)), b_engine, SLOT(textEdited(const QString &))); connect(m_input->lineEdit(), SIGNAL(returnPressed()), this, SLOT(inputValidated())); connect(m_input, SIGNAL(editTextChanged(const QString &)), this, SIGNAL(textEdited(const QString &))); }
NewWizardPage2::NewWizardPage2(QWidget* parent) : QWizardPage(parent) { setFinalPage(true); setTitle(tr("Create New Score")); setSubTitle(tr("Choose instruments on the left to add to instrument list on the right:")); setAccessibleName(title()); setAccessibleDescription(subTitle()); w = new InstrumentsWidget; QGridLayout* grid = new QGridLayout; grid->setSpacing(0); grid->setContentsMargins(0, 0, 0, 0); grid->addWidget(w, 0, 0); setLayout(grid); connect(w, SIGNAL(completeChanged(bool)), SLOT(setComplete(bool))); }
NewWizardPage5::NewWizardPage5(QWidget* parent) : QWizardPage(parent) { setFinalPage(true); setTitle(tr("Create New Score")); setSubTitle(tr("Choose key signature and tempo:")); setAccessibleName(title()); setAccessibleDescription(subTitle()); QGroupBox* b1 = new QGroupBox; b1->setTitle(tr("Key Signature")); b1->setAccessibleName(title()); sp = MuseScore::newKeySigPalette(); sp->setMoreElements(false); sp->setShowContextMenu(false); sp->setSelectable(true); sp->setDisableDoubleClick(true); sp->setSelected(14); PaletteScrollArea* sa = new PaletteScrollArea(sp); QVBoxLayout* l1 = new QVBoxLayout; l1->addWidget(sa); b1->setLayout(l1); tempoGroup = new QGroupBox; tempoGroup->setCheckable(true); tempoGroup->setChecked(false); tempoGroup->setTitle(tr("Tempo")); QLabel* bpm = new QLabel; bpm->setText(tr("BPM:")); _tempo = new QDoubleSpinBox; _tempo->setAccessibleName(tr("Beats per minute")); _tempo->setRange(20.0, 400.0); _tempo->setValue(120.0); _tempo->setDecimals(1); QHBoxLayout* l2 = new QHBoxLayout; l2->addWidget(bpm); l2->addWidget(_tempo); l2->addStretch(100); tempoGroup->setLayout(l2); QVBoxLayout* l3 = new QVBoxLayout; l3->addWidget(b1); l3->addWidget(tempoGroup); l3->addStretch(100); setLayout(l3); setFocusPolicy(Qt::StrongFocus); }