void DesktopMainWindow::createActions() { _newProjectAction = new QAction(tr("New Project"), this); _newProjectAction->setShortcut(QKeySequence::New); _newProjectAction->setStatusTip(tr("Start a new project")); connect(_newProjectAction, SIGNAL(triggered()), this, SLOT(newProject())); _openProjectAction = new QAction(QIcon(":/resources/images/open.png"), tr("&Open Project"), this); _openProjectAction->setShortcut(QKeySequence::Open); _openProjectAction->setStatusTip(tr("Open an existing file")); connect(_openProjectAction, SIGNAL(triggered()), this, SLOT(openProject())); _saveProjectAction = new QAction(QIcon(":/resources/images/save.png"), tr("&Save Project"), this); _saveProjectAction->setShortcut(QKeySequence::Save); _saveProjectAction->setStatusTip(tr("Save current project")); connect(_saveProjectAction, SIGNAL(triggered()), this, SLOT(saveProject())); _exitAction = new QAction(tr("&Exit"), this); connect(_exitAction, SIGNAL(triggered()), this, SLOT(close())); _undoAction = new QAction(QIcon(":/resources/images/undo.png"), tr("&Undo"), this); connect(_undoAction, SIGNAL(triggered()), this, SLOT(undo())); _settingsAction = new QAction(QIcon(":/resources/images/gear.png"), tr("&Options"), this); connect(_settingsAction, SIGNAL(triggered()), this, SLOT(editSettings())); _restoreLayoutAction = new QAction(tr("&Restore Layout"), this); connect(_restoreLayoutAction, SIGNAL(triggered()), this, SLOT(restoreLayout())); _aboutAction = new QAction(QIcon(":/resources/images/info.png"), tr("&About"), this); _aboutAction->setStatusTip(tr("About Godzi")); connect(_aboutAction, SIGNAL(triggered()), this, SLOT(showAbout())); }
LogListView::LogListView(KConfig& cfg, QWidget *parent, const char *name) : K3ListView(parent) , partConfig(cfg) { setObjectName(name); setAllColumnsShowFocus(true); setShowToolTips(false); setShowSortIndicator(true); setMultiSelection(true); setSorting(LogListViewItem::Revision, false); addColumn(i18n("Revision")); addColumn(i18n("Author")); addColumn(i18n("Date")); addColumn(i18n("Branch")); addColumn(i18n("Comment")); addColumn(i18n("Tags")); Cervisia::ToolTip* toolTip = new Cervisia::ToolTip(viewport()); connect(toolTip, SIGNAL(queryToolTip(QPoint,QRect&,QString&)), this, SLOT(slotQueryToolTip(QPoint,QRect&,QString&))); // without this restoreLayout() can't change the column widths for (int i = 0; i < columns(); ++i) setColumnWidthMode(i, Manual); restoreLayout(&partConfig, QLatin1String("LogList view")); }
ObjectWidget::ObjectWidget(const SceneObject& object, QWidget* parent) : DockWidget(object, parent), objectRenderer(Document::document->getSimulation(), object.name.toAscii().constData()), objectGlWidget(0), showSensorsAct(0), showDrawingsAct(0) { connect(Document::document, SIGNAL(updatedSceneGraph()), this, SLOT(updateObject())); connect(Document::document, SIGNAL(restoreLayoutSignal()), this, SLOT(restoreLayout())); connect(Document::document, SIGNAL(writeLayoutSignal()), this, SLOT(writeLayout())); connect(Document::document, SIGNAL(updateViewsSignal()), this, SLOT(updateView())); updateObject(); }
void PageMarker::markupPage() { processShortVerticalLines(); if (hasFlag(DEBUG_LAYOUT_FROM_FILE)) restoreLayout(); else extractBlocks(); cpage_ = image_data_->hCPAGE; }
void KMMimePartTree::restoreLayoutIfPresent() { // first column: soaks up the rest of the space: setColumnWidthMode( 0, Manual ); header()->setStretchEnabled( true, 0 ); // rest of the columns: if ( KMKernel::config()->hasGroup( configGroup ) ) { // there is a saved layout. use it... restoreLayout( KMKernel::config(), configGroup ); // and disable Maximum mode: for ( int i = 1 ; i < 4 ; ++i ) setColumnWidthMode( i, Manual ); } else { // columns grow with their contents: for ( int i = 1 ; i < 4 ; ++i ) setColumnWidthMode( i, Maximum ); } }
void KNCollectionView::readConfig() { KConfig *conf = knGlobals.config(); conf->setGroup("GroupView"); // execute the listview layout stuff only once static bool initDone = false; if(!initDone) { initDone = true; const int unreadColumn = conf->readNumEntry("UnreadColumn", 1); const int totalColumn = conf->readNumEntry("TotalColumn", 2); // we need to _activate_ them in the correct order // this is ugly because we can't use header()->moveSection // but otherwise the restoreLayout doesn't know that to do if(unreadColumn != -1 && unreadColumn < totalColumn) addUnreadColumn(i18n("Unread"), 48); if(totalColumn != -1) addTotalColumn(i18n("Total"), 36); if(unreadColumn != -1 && unreadColumn > totalColumn) addUnreadColumn(i18n("Unread"), 48); updatePopup(); restoreLayout(knGlobals.config(), "GroupView"); } // font & color settings KNConfig::Appearance *app = knGlobals.configManager()->appearance(); setFont(app->groupListFont()); QPalette p = palette(); p.setColor(QColorGroup::Base, app->backgroundColor()); p.setColor(QColorGroup::Text, app->textColor()); setPalette(p); setAlternateBackground(app->backgroundColor()); // FIXME: make this configurable mPaintInfo.colUnread = QColor("blue"); mPaintInfo.colFore = app->textColor(); mPaintInfo.colBack = app->backgroundColor(); }
BoardSetupDialog::BoardSetupDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f), m_wheelCurrentDelta(0), m_selectedPiece(Empty), inDrag(false) { setObjectName("BoardSetupDialog"); ui.setupUi(this); QPushButton *pasteButton = ui.buttonBox->addButton(tr("Paste FEN"), QDialogButtonBox::ActionRole); copyButton = ui.buttonBox->addButton(tr("Copy FEN"), QDialogButtonBox::ApplyRole); btCopyText = ui.buttonBox->addButton(tr("Copy Text"), QDialogButtonBox::ApplyRole); restoreLayout(); ui.boardView->configure(); ui.boardView->setFlags(BoardView::IgnoreSideToMove | BoardView::SuppressGuessMove | BoardView::AllowCopyPiece); ui.boardView->showMoveIndicator(false); ui.boardView->showCoordinates(true); m_minDeltaWheel = AppSettings->getValue("/Board/minWheelCount").toInt(); for(int piece = Empty; piece <= BlackPawn; piece++) { BoardSetupToolButton* button = new BoardSetupToolButton(this); button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); button->setMinimumSize(QSize(10, 10)); button->m_piece = (Piece)piece; if(piece == Empty) { button->m_pixmap = QPixmap(0, 0); ui.buttonLayout->addWidget(button, 6, 0); } else { button->m_pixmap = ui.boardView->theme().piece(Piece(piece)); ui.buttonLayout->addWidget(button, (piece - 1) % 6, piece >= BlackKing); } connect(button, SIGNAL(signalDragStarted(QWidget*, QMouseEvent*)), this, SLOT(startDrag(QWidget*, QMouseEvent*))); connect(button, SIGNAL(signalClicked(Piece)), this, SLOT(labelClicked(Piece))); connect(this, SIGNAL(signalClearBackground(Piece)), button, SLOT(slotClearBackground(Piece))); } emit signalClearBackground(Empty); ui.buttonBoxTools->button(QDialogButtonBox::RestoreDefaults)->setText(tr("Clear")); connect(ui.buttonBoxTools->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked()), SLOT(slotClear())); connect(ui.buttonBoxTools->button(QDialogButtonBox::Reset), SIGNAL(clicked()), SLOT(slotReset())); connect(ui.boardView, SIGNAL(clicked(Square, int, QPoint, Square)), SLOT(slotSelected(Square, int))); connect(ui.boardView, SIGNAL(moveMade(Square, Square, int)), SLOT(slotMovePiece(Square, Square))); connect(ui.boardView, SIGNAL(copyPiece(Square, Square)), SLOT(slotCopyPiece(Square, Square))); connect(ui.boardView, SIGNAL(invalidMove(Square)), SLOT(slotInvalidMove(Square))); connect(ui.boardView, SIGNAL(wheelScrolled(int)), SLOT(slotChangePiece(int))); connect(ui.boardView, SIGNAL(pieceDropped(Square, Piece)), SLOT(slotDroppedPiece(Square, Piece))); connect(ui.toMoveButton, SIGNAL(clicked()), SLOT(slotToggleSide())); connect(ui.wkCastleCheck, SIGNAL(stateChanged(int)), SLOT(slotCastlingRights())); connect(ui.wqCastleCheck, SIGNAL(stateChanged(int)), SLOT(slotCastlingRights())); connect(ui.bkCastleCheck, SIGNAL(stateChanged(int)), SLOT(slotCastlingRights())); connect(ui.bqCastleCheck, SIGNAL(stateChanged(int)), SLOT(slotCastlingRights())); connect(ui.epCombo, SIGNAL(currentIndexChanged(int)), SLOT(slotEnPassantSquare())); connect(ui.halfmoveSpin, SIGNAL(valueChanged(int)), SLOT(slotHalfmoveClock())); connect(ui.moveSpin, SIGNAL(valueChanged(int)), SLOT(slotMoveNumber())); connect(ui.btFlipBoard, SIGNAL(clicked()), ui.boardView, SLOT(flip())); ui.btFlipBoard->setCheckable(true); connect(copyButton, SIGNAL(clicked()), SLOT(slotCopyFen())); connect(pasteButton, SIGNAL(clicked()), SLOT(slotPasteFen())); connect(btCopyText, SIGNAL(clicked()), SLOT(slotCopyText())); connect(ui.btFlipVertical, SIGNAL(clicked()), SLOT(mirrorVertical())); connect(ui.btFlipHorizontal, SIGNAL(clicked()), SLOT(mirrorHorizontal())); connect(ui.btSwapColor, SIGNAL(clicked()), SLOT(swapColors())); ui.tabWidget->setCurrentIndex(0); }
TrackEditor::TrackEditor(QWidget *parent) : QMainWindow(parent), // m_idev_factory(), m_serial_port(0), m_device_io(0), m_dev_data(0), m_command_mode_step(-1), m_command_response_step(-1), m_device_file(0), m_socket_notifier(0), m_nema_string(""), m_line(""), m_log_buf(), m_tmp_buf(), m_read_start(-1), m_retry_count(-1), m_expect_binary_data(-1), m_binary_data_already_read(-1), m_lastsection(false), m_blocksize(-1), m_track_collection(0), m_selection_model(0), m_track_filename("") { ui.setupUi(this); // set m_track_collection to 0 to prevent setTrackCollection() from trying to delete it. m_track_collection = 0; PlotData::initializeMaps(); connect(ui.actionExit, SIGNAL(triggered()), this, SLOT(close())); connect(ui.action_Connect, SIGNAL(triggered()), this, SLOT(connectDevice())); connect(ui.action_Disconnect, SIGNAL(triggered()), this, SLOT(disconnectDevice())); connect(ui.action_Load_Track, SIGNAL(triggered()), this, SLOT(loadTrack())); connect(ui.actionAppend_Track, SIGNAL(triggered()), this, SLOT(appendTrack())); connect(ui.action_Save_Track, SIGNAL(triggered()), this, SLOT(saveTrack())); connect(ui.action_Save_Track_As, SIGNAL(triggered()), this, SLOT(saveTrackAs())); connect(ui.action_Read_Log, SIGNAL(triggered()), this, SLOT(readLog())); ui.action_Read_Log->setDisabled(true); connect(ui.action_Start_Recording, SIGNAL(triggered()), this, SLOT(startRecording())); connect(ui.action_Stop_Recording, SIGNAL(triggered()), this, SLOT(stopRecording())); connect(ui.actionStart_Animation, SIGNAL(triggered()), &m_animation, SLOT(start())); connect(ui.actionStop_Animation, SIGNAL(triggered()), &m_animation, SLOT(stop())); connect(ui.actionFaster, SIGNAL(triggered()), &m_animation, SLOT(incSpeed())); connect(ui.actionSlower, SIGNAL(triggered()), &m_animation, SLOT(decSpeed())); connect(ui.actionX_0_125, SIGNAL(triggered()), &m_animation, SLOT(setTimeScaleX0125())); connect(ui.actionX_0_25, SIGNAL(triggered()), &m_animation, SLOT(setTimeScaleX025())); connect(ui.actionX_0_5, SIGNAL(triggered()), &m_animation, SLOT(setTimeScaleX05())); connect(ui.actionX_1, SIGNAL(triggered()), &m_animation, SLOT(setTimeScaleX1())); connect(ui.actionX_2, SIGNAL(triggered()), &m_animation, SLOT(setTimeScaleX2())); connect(ui.actionX_4, SIGNAL(triggered()), &m_animation, SLOT(setTimeScaleX4())); connect(ui.actionX_8, SIGNAL(triggered()), &m_animation, SLOT(setTimeScaleX8())); connect(ui.actionX_16, SIGNAL(triggered()), &m_animation, SLOT(setTimeScaleX16())); connect(ui.actionX_32, SIGNAL(triggered()), &m_animation, SLOT(setTimeScaleX32())); connect(ui.actionX_64, SIGNAL(triggered()), &m_animation, SLOT(setTimeScaleX64())); connect(ui.actionX_128, SIGNAL(triggered()), &m_animation, SLOT(setTimeScaleX128())); connect(ui.actionSettings, SIGNAL(triggered()), this, SLOT(showSettingsDlg())); connect(ui.action_About, SIGNAL(triggered()), this, SLOT(showAboutDialog())); connect(this, SIGNAL(setText(QString)), ui.nemaText, SLOT(appendPlainText(QString))); m_track_view = new TrackView(ui.scrollArea); ui.scrollArea->setWidget(m_track_view); connect(&m_animation, SIGNAL(setMarkers(QList<CMarker>)), m_track_view, SLOT(setMarkers(QList<CMarker>))); connect(ui.actionZoom_in, SIGNAL(triggered()), m_track_view, SLOT(zoomIn())); connect(ui.actionZoom_out, SIGNAL(triggered()), m_track_view, SLOT(zoomOut())); ui.treeView->setSelectionMode(QAbstractItemView::ExtendedSelection); m_selection_model = ui.treeView->selectionModel(); connect(m_selection_model, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(selectionChanged(QItemSelection,QItemSelection))); m_diagrams_layout = new CDiagramsLayout(ui.diagramWidget); ui.diagramWidget->setLayout(m_diagrams_layout); connect(m_diagrams_layout, SIGNAL(setMarkers(QList<CMarker>)), m_track_view, SLOT(setMarkers(QList<CMarker>))); m_settings = new CSettings(); m_settings->load(); QList<enum plotTypeY> distList; distList = m_settings->getDistQuantities(); QList<enum plotTypeY> timeList; timeList = m_settings->getTimeQuantities(); QList<enum plotTypeY> trackPointsList; trackPointsList = m_settings->getTrackpointsQuantities(); m_diagrams_layout->setQuantities(distList, timeList, trackPointsList ); setTrackCollection(new TrackCollection); m_device_io = 0; m_dev_data = 0; m_expect_binary_data = 0; m_command_mode_step = 0; m_command_response_step = 0; m_track_filename.clear(); connect(ui.treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(treeViewClicked(QModelIndex))); ui.treeView->setEditTriggers( QAbstractItemView::DoubleClicked | QAbstractItemView::SelectedClicked | QAbstractItemView::EditKeyPressed ); m_progress_dlg = new QDialog(this); prg_dlg.setupUi(m_progress_dlg); m_progress_dlg->setModal(false); connect(prg_dlg.cancelButton, SIGNAL(clicked()), this, SLOT(readLogFinished())); statusBar()->addWidget(m_animation.statusBarWidget()); statusBar()->addPermanentWidget(m_track_view->statusBarWidget()); restoreLayout(); }
void KFileDetailView::readConfig( TDEConfig *config, const TQString& group ) { restoreLayout( config, group ); }