void ImportMidiPanel::tweakUi() { connect(updateUiTimer, SIGNAL(timeout()), this, SLOT(updateUi())); connect(ui->pushButtonImport, SIGNAL(clicked()), SLOT(doMidiImport())); connect(ui->pushButtonUp, SIGNAL(clicked()), SLOT(moveTrackUp())); connect(ui->pushButtonDown, SIGNAL(clicked()), SLOT(moveTrackDown())); connect(ui->toolButtonHideMidiPanel, SIGNAL(clicked()), SLOT(hidePanel())); const QItemSelectionModel *sm = ui->tableViewTracks->selectionModel(); connect(sm, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), SLOT(onCurrentTrackChanged(QModelIndex))); connect(ui->treeViewOperations->model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), SLOT(onOperationChanged(QModelIndex))); updateUiTimer->start(100); updateUi(); ui->tableViewTracks->verticalHeader()->setDefaultSectionSize(22); ui->tableViewTracks->setHorizontalHeader(new CustomHorizHeaderView()); ui->tableViewTracks->horizontalHeader()->setResizeMode(TrackCol::TRACK_NUMBER, QHeaderView::ResizeToContents); ui->tableViewTracks->horizontalHeader()->setResizeMode(TrackCol::DO_IMPORT, QHeaderView::ResizeToContents); ui->tableViewTracks->horizontalHeader()->setResizeMode(TrackCol::LYRICS, QHeaderView::Stretch); ui->tableViewTracks->horizontalHeader()->setResizeMode(TrackCol::STAFF_NAME, QHeaderView::Stretch); ui->tableViewTracks->horizontalHeader()->setResizeMode(TrackCol::INSTRUMENT, QHeaderView::Stretch); ui->treeViewOperations->header()->resizeSection(0, 285); ui->treeViewOperations->setAllColumnsShowFocus(true); ui->comboBoxCharset->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon); fillCharsetList(); }
void BookmarksToolbar::customContextMenuRequested(const QPoint &pos) { Q_UNUSED(pos) QMenu menu; menu.addAction(tr("&Bookmark Current Page"), p_QupZilla, SLOT(bookmarkPage())); menu.addAction(tr("Bookmark &All Tabs"), p_QupZilla, SLOT(bookmarkAllTabs())); menu.addAction(qIconProvider->fromTheme("user-bookmarks"), tr("&Organize Bookmarks"), p_QupZilla, SLOT(showBookmarksManager())); menu.addSeparator(); QAction act(tr("Show Most &Visited"), this); act.setCheckable(true); act.setChecked(m_bookmarksModel->isShowingMostVisited()); connect(&act, SIGNAL(triggered()), this, SLOT(showMostVisited())); menu.addAction(&act); QAction act2(tr("Show Only Icons"), this); act2.setCheckable(true); act2.setChecked(m_bookmarksModel->isShowingOnlyIconsInToolbar()); connect(&act2, SIGNAL(triggered()), this, SLOT(toggleShowOnlyIcons())); menu.addAction(&act2); menu.addSeparator(); menu.addAction(tr("&Hide Toolbar"), this, SLOT(hidePanel())); //Prevent choosing first option with double rightclick QPoint position = mapToGlobal(pos); QPoint p(position.x(), position.y() + 1); menu.exec(p); }
AutoHideBehavior::AutoHideBehavior(QWidget* panel) : AbstractVisibilityBehavior(panel) , m_autohideTimer(new QTimer(this)) , m_edgeHitDetector(0) { m_autohideTimer->setSingleShot(true); m_autohideTimer->setInterval(AUTOHIDE_TIMEOUT); connect(m_autohideTimer, SIGNAL(timeout()), SLOT(hidePanel())); setPanel(panel); }
ProvidersEditor::ProvidersEditor( QWidget *parent, bool newProvider, const QSqlDatabase& database ) : KDialog( parent ) { modelCreated = false; db = database; enableButtonOk(false); ui = new ProvidersEditorUI( this ); setMainWidget( ui ); setCaption( i18n("Product Editor") ); setButtons( KDialog::Ok|KDialog::Cancel ); connect( ui->btnRemove, SIGNAL(clicked()), SLOT( removeItem()) ); connect( ui->btnAttach, SIGNAL(clicked()), SLOT( addItem()) ); connect( ui->editName, SIGNAL(editingFinished()), this, SLOT(checkFieldsState())); connect( ui->editAddress, SIGNAL(textChanged()), this, SLOT(checkFieldsState())); connect( ui->editPhone, SIGNAL(editingFinished()), this, SLOT(checkFieldsState())); connect( ui->editCell, SIGNAL(textChanged(const QString &)), this, SLOT(checkFieldsState())); QString path = KStandardDirs::locate("appdata", "styles/"); path = path+"floating_bottom.svg"; panel = new MibitFloatPanel(this, path, Bottom); panel->setSize(350,200); panel->setMode(pmManual); panel->setHiddenTotally(true); panel->addWidget(ui->attachment); connect( ui->btnAdd, SIGNAL(clicked()), panel, SLOT( showPanel() ) ); connect( ui->btnAttach, SIGNAL(clicked()), panel, SLOT( hidePanel() ) ); connect( ui->btnCancelAttach, SIGNAL(clicked()), panel, SLOT( hidePanel()) ); m_pInfo.id = 0; m_pInfo.name = ""; m_pInfo.address = ""; m_pInfo.phone = ""; m_pInfo.cell = ""; }
void BookmarksToolbar::customContextMenuRequested(const QPoint &pos) { Q_UNUSED(pos) QMenu menu; menu.addAction(tr("&Bookmark Current Page"), p_QupZilla, SLOT(bookmarkPage())); menu.addAction(tr("Bookmark &All Tabs"), p_QupZilla, SLOT(bookmarkAllTabs())); menu.addAction(IconProvider::fromTheme("user-bookmarks"), tr("&Organize Bookmarks"), p_QupZilla, SLOT(showBookmarksManager())); menu.addSeparator(); menu.addAction(m_bookmarksModel->isShowingMostVisited() ? tr("Hide Most &Visited") : tr("Show Most &Visited"), this, SLOT(showMostVisited())); menu.addAction(tr("&Hide Toolbar"), this, SLOT(hidePanel())); //Prevent choosing first option with double rightclick QPoint position = QCursor::pos(); QPoint p(position.x(), position.y() + 1); menu.exec(p); }
void UIVisoCreator::sltPanelActionToggled(bool fChecked) { QAction *pSenderAction = qobject_cast<QAction*>(sender()); if (!pSenderAction) return; UIDialogPanel* pPanel = 0; /* Look for the sender() within the m_panelActionMap's values: */ for (QMap<UIDialogPanel*, QAction*>::const_iterator iterator = m_panelActionMap.begin(); iterator != m_panelActionMap.end(); ++iterator) { if (iterator.value() == pSenderAction) pPanel = iterator.key(); } if (!pPanel) return; if (fChecked) showPanel(pPanel); else hidePanel(pPanel); }
ReservationsDialog::ReservationsDialog( QWidget *parent, Gaveta *theDrawer, int userid ) : KDialog( parent ) { drawer = theDrawer; userId = userid; m_modelAssigned = false; trNumber = 0; rNumber = 0; rPayment = 0; rProfit = 0; item_discounts = ""; ui = new ReservationsDialogUI( this ); setMainWidget( ui ); setCaption( i18n("Reservations") ); setButtons( KDialog::Ok|KDialog::Cancel ); enableButtonOk(false); QString path = KStandardDirs::locate("appdata", "styles/"); path = path+"floating_bottom.svg"; panel = new MibitFloatPanel(this, path, Top); panel->setSize(250,150); panel->addWidget(ui->confirmFrame); panel->setMode(pmManual); panel->setHiddenTotally(true); panel->hide(); connect(ui->btnYes, SIGNAL(clicked()), SLOT(cancelReservation() )); connect(ui->btnNo, SIGNAL(clicked()), panel, SLOT(hidePanel() )); connect(ui->btnCancelReservation, SIGNAL(clicked()), panel, SLOT(showPanel() )); connect(ui->tableWidget, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &))); setDefaultButton(KDialog::Ok); //disable the cancel button ui->btnCancelReservation->setDisabled(true); }
SpecialOrderEditor::SpecialOrderEditor( QWidget *parent, bool newOne ) : KDialog( parent ) { m_modelAssigned = false; priceEach = 0; paymentEach = 0; groupInfo.isAvailable = true; groupInfo.cost = 0; groupInfo.price = 0; groupInfo.count = 0; groupInfo.name = ""; ui = new SpecialOrderUI( this ); setMainWidget( ui ); setCaption( i18n("Special Orders") ); setButtons( KDialog::Ok|KDialog::Cancel ); //Set Validators for input boxes ui->editAddQty->setValidator(new QDoubleValidator(0.00, 999999999999.99, 3, ui->editAddQty)); ui->editQty->setValue(1); ui->editAddQty->setText("1.00"); connect( ui->editQty, SIGNAL(editingFinished()), this, SLOT(calculateCost())); connect( ui->editQty, SIGNAL(valueChanged(int)), this, SLOT(calculateCost())); connect( ui->editQty, SIGNAL(editingFinished()), this, SLOT(checkFieldsState())); connect( ui->editPayment, SIGNAL(valueChanged(double)), this, SLOT(checkFieldsState())); connect( ui->editFilter, SIGNAL(textEdited ( const QString &)), SLOT(applyFilter(const QString &)) ); connect( ui->btnAdd, SIGNAL(clicked()), SLOT(addItem()) ); connect( ui->editAddQty, SIGNAL(returnPressed()), SLOT(addItem()) ); connect( ui->btnRemove, SIGNAL(clicked()), SLOT(removeItem()) ); connect( ui->groupView, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), SLOT(itemDoubleClicked(QTableWidgetItem*)) ); connect( ui->deliveryDT, SIGNAL(valueChanged(QDateTime)), this, SLOT(checkDate(QDateTime)) ); connect( ui->editNotes, SIGNAL(textChanged()), SLOT(updateNoteLength()) ); //for now, when creating a s.o. the status cannot be modified. It can be when edited. if (newOne) { dateTime = QDateTime::currentDateTime(); ui->deliveryDT->setDateTime(QDateTime::currentDateTime().addDays(1)); } //tip QString path = KStandardDirs::locate("appdata", "styles/"); path = path+"tip.svg"; qtyTip = new MibitTip(this, ui->editQty, path, DesktopIcon("dialog-warning",32) ); path = KStandardDirs::locate("appdata", "styles/")+"rotated_tip.svg"; groupTip = new MibitTip(this, ui->groupView, path, DesktopIcon("dialog-warning",32), tpAbove ); path = KStandardDirs::locate("appdata", "styles/"); path = path+"floating_bottom.svg"; newClientPanel = new MibitFloatPanel(this, path, Top); newClientPanel->setSize(550,250); newClientPanel->addWidget(ui->frameClient); newClientPanel->setMode(pmManual); newClientPanel->setHiddenTotally(true); ui->editClientName->setEmptyMessage(i18n("Enter client name here...")); ui->editClientPhone->setEmptyMessage(i18n("Enter client phone here...")); ui->editClientCell->setEmptyMessage(i18n("Enter client cell phone here...")); connect( ui->btnNewClient, SIGNAL(clicked()), newClientPanel, SLOT(showPanel() )); connect( ui->btnNewClient, SIGNAL(clicked()), this, SLOT(enableCreateClient() )); connect( ui->btnClientCancel, SIGNAL(clicked()), newClientPanel, SLOT(hidePanel())); connect( ui->btnClientAdd, SIGNAL(clicked()), this, SLOT(createClient())); connect( ui->editClientName, SIGNAL(textEdited(const QString &)), this, SLOT(checkValidInfo()) ); connect( ui->editClientAddress, SIGNAL(textChanged()), this, SLOT(checkValidInfo()) ); connect( ui->editClientPhone, SIGNAL(textEdited(const QString &)), this, SLOT(checkValidInfo()) ); connect( ui->editClientCell, SIGNAL(textEdited(const QString &)), this, SLOT(checkValidInfo()) ); setDefaultButton(KDialog::None); ui->btnFilter->setDefault(true); ui->btnFilter->hide(); //hack to dont have a default OK or Cancel button ui->clientsCombo->setFocus(); enableButtonOk(false); }
void UIVisoCreator::sltHandleHidePanel(UIDialogPanel *pPanel) { hidePanel(pPanel); }