Beispiel #1
0
AutoStartPage::AutoStartPage(QWidget* parent) :
    QWidget(parent),
    ui(new Ui::AutoStartPage)
{
    ui->setupUi(this);

    connect(ui->addButton, SIGNAL(clicked()), SLOT(addButton_clicked()));
    connect(ui->editButton, SIGNAL(clicked()), SLOT(editButton_clicked()));
    connect(ui->deleteButton, SIGNAL(clicked()), SLOT(deleteButton_clicked()));

    restoreSettings();
}
Beispiel #2
0
ClipboardClient::ClipboardClient(int &argc, char **argv, const QStringList &arguments, const QString &sessionName)
    : App(createClientApplication(argc, argv, arguments), sessionName)
{
    restoreSettings();

    // Start script after QCoreApplication::exec().
    auto timer = new QTimer(this);
    timer->setSingleShot(true);
    connect(timer, &QTimer::timeout, this, [&]() { start(arguments); });
    connect(timer, &QTimer::timeout, timer, &QObject::deleteLater);
    timer->start(0);
}
void DesktopConfigWindow::dialogButtonsAction(QAbstractButton *btn)
{
    if (buttons->buttonRole(btn) == QDialogButtonBox::ResetRole)
    {
        m_cache->loadToSettings();
        restoreSettings();
    }
    else
    {
        close();
    }
}
SessionConfigWindow::SessionConfigWindow() :
      LXQt::ConfigDialog(tr("LXQt Session Settings"), new LXQt::Settings("session"), 0)
{
    BasicSettings* basicSettings = new BasicSettings(mSettings, this);
    addPage(basicSettings, tr("Basic Settings"), "preferences-desktop-display-color");
    connect(basicSettings, SIGNAL(needRestart()), SLOT(setRestart()));
    connect(this, SIGNAL(reset()), basicSettings, SLOT(restoreSettings()));
    connect(this, SIGNAL(save()), basicSettings, SLOT(save()));

    DefaultApps* defaultApps = new DefaultApps(this);
    addPage(defaultApps, tr("Default Applications"), "preferences-desktop-filetype-association");

    UserLocationsPage* userLocations = new UserLocationsPage(this);
    addPage(userLocations, tr("User Directories"), QStringLiteral("folder"));
    connect(userLocations, SIGNAL(needRestart()), SLOT(setRestart()));
    connect(this, SIGNAL(reset()), userLocations, SLOT(restoreSettings()));
    connect(this, SIGNAL(save()), userLocations, SLOT(save()));

    AutoStartPage* autoStart = new AutoStartPage(this);
    addPage(autoStart, tr("Autostart"), "preferences-desktop-launch-feedback");
    connect(autoStart, SIGNAL(needRestart()), SLOT(setRestart()));
    connect(this, SIGNAL(reset()), autoStart, SLOT(restoreSettings()));
    connect(this, SIGNAL(save()), autoStart, SLOT(save()));

    EnvironmentPage* environmentPage = new EnvironmentPage(mSettings, this);
    addPage(environmentPage, tr("Environment (Advanced)"), "preferences-system-session-services");
    connect(environmentPage, SIGNAL(needRestart()), SLOT(setRestart()));
    connect(this, SIGNAL(reset()), environmentPage, SLOT(restoreSettings()));
    connect(this, SIGNAL(save()), environmentPage, SLOT(save()));

    // sync Default Apps and Environment
    connect(environmentPage, SIGNAL(envVarChanged(QString,QString)),
            defaultApps, SLOT(updateEnvVar(QString,QString)));
    connect(defaultApps, SIGNAL(defaultAppChanged(QString,QString)),
            environmentPage, SLOT(updateItem(QString,QString)));
    environmentPage->restoreSettings();
    connect(this, SIGNAL(reset()), SLOT(clearRestart()));
    m_restart = false;
}
Beispiel #5
0
void SettingsDialog::resetSettings()
{
	QMessageBox::StandardButton b = QMessageBox::question(
				this,
				tr("Reset settings"),
				tr("Clear all settings?")
				);
	if(b==QMessageBox::Yes) {
		QSettings().clear();
		restoreSettings();
		rememberSettings();
	}
}
AdvancedSettings::AdvancedSettings(LXQt::Settings* settings, QWidget *parent):
    QWidget(parent),
    mSettings(settings)
{
    setupUi(this);
    restoreSettings();

    connect(serverDecidesBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &AdvancedSettings::save);
    connect(spacingBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &AdvancedSettings::save);
    connect(widthBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &AdvancedSettings::save);
    connect(unattendedBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &AdvancedSettings::save);
    connect(blackListEdit, &QLineEdit::editingFinished, this, &AdvancedSettings::save);
}
CurvesManagerView::CurvesManagerView(SamplesManager* samplesManager, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CurvesManagerView),
    curvesManager(nullptr),
    samplesManager(samplesManager)
{
    ui->setupUi(this);
    createCurvesFiller();
    createCurvesSettings();
    createSamplesManagerView();
    connect(samplesManager, SIGNAL(haveBeenLoaded(int)), SLOT(updateCurvesToFiller(int)));
    restoreSettings();
}
Beispiel #8
0
MainView::MainView(QWidget *parent) : QMainWindow(parent) {
	ToolBar::init(this);
	LibraryView::init(this);

	// Add tool bar and library view
	addToolBar(tool_bar);
	setCentralWidget(library_view);

	// Set QMainWindow to a widget instead of top level window
	setWindowFlags(Qt::Widget);

	// Restore widget settings
	restoreSettings();
}
Beispiel #9
0
void AbstractParam::restoreSettings(QSettings& settings, QObject *object) {
    const QObjectList& L = object->children();
    for (int i = 0; i < L.size(); ++i) {
        AbstractParam *p = qobject_cast<AbstractParam*>(L[i]);
        if (p) {
            p->restoreValue(settings);
            if (!p->children().isEmpty()) {
                settings.beginGroup(p->name());
                restoreSettings(settings, p);
                settings.endGroup();
            }
        }
    }
}
Beispiel #10
0
DialogObjects::DialogObjects(QWidget *parent, const std::string& name) :
    QDialog(parent),
    ui(new Ui::DialogObjects)
{
    ui->setupUi(this);
    QString qname(name.c_str());

    QString title("Select ");
    title += qname;
    ui->labelPrompt->setText(tr(title.toStdString().c_str()));

    this->setObjectName(QString(name.c_str()));

    restoreSettings();
}
/*!
*/
void TNxSpooler::openOptions()
{
   // As this is a slot that can be called by Qt code (in response to a pushed button, for example), we
   // don't allow exceptions to go out from here. So we use a "try" block.
   try
   {
      QDEBUG_METHOD_NAME;

      TOptions options(&m_settings, this);

      // When the restore button is pushed, the the program is configured
      // with its default values.
      bool isConnected = connect(&options, SIGNAL(pushedRestore()),
                    this, SLOT(restoreSettings()));
      if (!isConnected)
      {
            // If the connection could not be restored, throw an exception
            QString message = tr("2208095 - Internal error when connecting.");
            throw runtime_error(message.toStdString());
      }

      // The options dialog is updated with the actual options
      isConnected = connect(this, SIGNAL(settingsRestored()),
          &options, SLOT(updateOptionsRows()));
      if (!isConnected)
      {
            // If the connection could not be restored, throw an exception
            QString message = tr("2208096 - Internal error when connecting.");
            throw runtime_error(message.toStdString());
      }

      do
      {
          options.exec();  // The returned value is not important here
          prepareSharedFolder();
          prepareTimer();
      }
      while(!syst.existsProgram(m_settings.value("apps").toString()));
   }
   catch(std::exception &excep)
   {
      syst.exitBecauseException(excep);
   }
   catch(...)
   {
      syst.exitBecauseException();
   }
}
Beispiel #12
0
BasicSettings::BasicSettings(LXQt::Settings *settings, QWidget *parent) :
    QWidget(parent),
    m_settings(settings),
    m_moduleModel(new ModuleModel()),
    ui(new Ui::BasicSettings)
{
    ui->setupUi(this);
    connect(ui->findWmButton, SIGNAL(clicked()), this, SLOT(findWmButton_clicked()));
    connect(ui->startButton, SIGNAL(clicked()), this, SLOT(startButton_clicked()));
    connect(ui->stopButton, SIGNAL(clicked()), this, SLOT(stopButton_clicked()));
    restoreSettings();

    ui->moduleView->setModel(m_moduleModel);
    ui->moduleView->header()->setSectionResizeMode(0, QHeaderView::Stretch);
    ui->moduleView->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
}
Beispiel #13
0
void
DeviceExplorerView::setModel(QAbstractItemModel* model)
{
    QTreeView::setModel(model);
    m_hasProxy = false;
    #ifdef MODEL_TEST
    qDebug() << "*** ADD MODEL_TEST\n";
    (void) new ModelTest(model, this);
    #endif

    if(model)
    {
        setInitialColumnsSizes();
        restoreSettings();
        initActions(); //after restoreSettings() to have actions correctly initialized
    }
}
Beispiel #14
0
void
DeviceExplorerView::setModel(DeviceExplorerFilterProxyModel* model)
{
    QTreeView::setModel(static_cast<QAbstractItemModel*>(model));
    m_hasProxy = true;
    #ifdef MODEL_TEST
    qDebug() << "*** ADD MODEL_TEST\n";
    (void) new ModelTest(model->sourceModel(), this);
    #endif

    if(model)
    {
        setInitialColumnsSizes();
        restoreSettings();
        initActions(); //after restoreSettings() to have actions correctly initialized
    }
}
Beispiel #15
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{   
    Settings::create(QApplication::applicationDirPath() + "/appSettings.ini");
    ui->setupUi(this);    
    createPlotsGroups();
    routePlotsMenu();
    createPlotsTilingMenu();
    createPlotSettingsView();
    restoreVisibilityActionsState();
    restoreSettings();
    createProject();
    createSamplesProxyActions();
    createRecentlyProjectPaths();
    initAbout();
    createTranslator();
}
Beispiel #16
0
CMainWindow::CMainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    theMainWindow = this;
    ui->setupUi(this);
    // Build backend controler
    backend = new CBackend();

    // Build widgets UI
    dbgWin = new CDebugWindow(this,ui);
    statusbar = new CStatusWidget(this);
    display = new CDisplay(this);
    // Spectrum widget
    mySpectrum = new CSpectrumWidget(this);
    ui->frequency1->addWidget(mySpectrum); // Widget channel 1

    myBandScope = new CBandScope(this);
    ui->bandscopeWidget->addWidget(myBandScope);

    // Add decoder view plotter
    myDecoder = new CSpectrumWidget(this);
    ui->DumpView->addWidget(myDecoder);
    // Decoder text
    ui->decoderText->setReadOnly(true);
    statusBar()->addPermanentWidget(statusbar);

    // Set Squelch max
    ui->knobSquelch->setScale(0.0,255.0);
    ui->knobIF->setScale(0.0,255.0);
    ui->volume1->setScale(0.0,255.0);
    ui->layoutFrequencies->addWidget(display);
    // Add two default radio struct
    for (int i=0; i<MAX_RADIO; i++) {
        radioList.append(new CCommand::radio_t);
    }
    connectSignals();
    mySpectrum->setAxis(0,16384,0,256);
    dock = addToolBar("File");
    dock->addAction(ui->actionLoad);
    dock->addAction(ui->actionQuit);

    restoreSettings();
}
Beispiel #17
0
Flipp::Flipp(QWidget *parent)
    : QMainWindow(parent)
{
    connections = new QList<ConnectionUnit*>;
    connectionListWidget = new ConnectionListWidget(this, connections);
    terminals = new TerminalListWidget(this);
    parsers = new QList<ParserUnit*>;
    parserListWidget = new ParserListWidget(this, parsers);
    linkers = new QList<LinkerUnit*>;
    linkerListWidget = new LinkerListWidget(this, linkers);
//    plotter = new PlotterWidget(this,linkers);
        plotter = new PlotterWidget(linkers);
//    thread = new QThread;
//    plotter->moveToThread(thread);
//    thread->start();

    //    plotter = new PlotterWidget(this);

    m_sSettingsFile = QApplication::applicationDirPath() + "/lastSettings.flp";
    setCentralWidget(plotter);
    createDocks();
    createMenus();

    this->setWindowTitle(tr("f l i p p"));

    QFile qss("../flipp/styles/flipp.css");
    qss.open(QFile::ReadOnly);
    setStyleSheet(qss.readAll());
    qss.close();

    connect(connectionListWidget,SIGNAL(connectionListChanged(QStringList)),terminals,SLOT(updateConnections(QStringList)));
    connect(connectionListWidget,SIGNAL(connectionListChanged(QStringList)),linkerListWidget,SLOT(updateConnections(QStringList)));
    connect(terminals,SIGNAL(terminalRequest(TerminalWidget*,QString)),this,SLOT(handleTerminalRequest(TerminalWidget*,QString)));
    connect(parserListWidget,SIGNAL(parserListChanged(QStringList)),linkerListWidget,SLOT(updateParsers(QStringList)));

    connect(linkerListWidget,SIGNAL(linkerConnectionRequest(LinkerUnit*,QString)),this,SLOT(handleLinkerConnectionRequest(LinkerUnit*, QString)));
    connect(linkerListWidget,SIGNAL(linkerParserRequest(LinkerUnit*,QString)),this,SLOT(handleLinkerParserRequest(LinkerUnit*, QString)));

    connect(linkerListWidget,SIGNAL(linkerListChanged()),plotter,SLOT(updateLinkerList()));

    restoreSettings();
}
Beispiel #18
0
MainWindow::MainWindow(QWidget *parent)
	: QMainWindow(parent)
	, stage(nullptr)
	, director(nullptr)
	, infoDialog(nullptr)
{
	// Set basic properties for the main window
	setObjectName("MainWindow"); // used to save preferences
	setWindowTitle("bot Neumann++");
	resize(1024, 768); // affects only desktop applications
	setMinimumSize(480, 320);
  #ifdef Q_OS_LINUX
	setWindowIcon(QIcon(":/game_logo.svg"));
  #endif

	// Create each window section
	setupStage();
	setupHiddenActions();
	restoreSettings();
}
Beispiel #19
0
void tpMainWindow::setupDialogs()
{
    diaOauthSetup = new dialogOauthSetup(this);
    QObject::connect(diaOauthSetup, SIGNAL(onAuthorizeRequested()), this, SLOT(onBrowserAuthorizeRequested()));
    QObject::connect(diaOauthSetup, SIGNAL(authTokenChanged(QString)), twitchUser, SLOT(validateNewAuthToken(QString)));
    QObject::connect(diaOauthSetup, SIGNAL(authTokenSetupSuccessful(bool)), twitchUser, SLOT(onAuthTokenSetupSuccessful(bool)));
    QObject::connect(diaOauthSetup, SIGNAL(authTokenSetupSuccessful(bool)), this, SLOT(on_SwitchInputEnabled(bool)));
    QObject::connect(diaOauthSetup, SIGNAL(restoreSettings()), this, SLOT(on_actionRestore_Settings_triggered()));


    diaPositioner = new DialogPositioner(this);

    diaLaunch = new DialogLaunch(this);
    QObject::connect(diaLaunch, SIGNAL(startStreamPlay(QString, QString, QString, int, int, int , int, bool, QString)), this, SLOT(executePlayer(QString, QString, QString, int, int, int , int, bool, QString)));

    diaOptions = new DialogOptions(this);
    QObject::connect(this->diaOptions, SIGNAL(settingsSaved()), this, SLOT(on_settingsSaved()));

    diaShowLogFile = new DialogShowLogFile(this);

    diaTopGameBrowser = new DialogGameBrowser;
    QObject::connect(diaTopGameBrowser, SIGNAL(startStream(const QString)), this, SLOT(startFromGBrowser(const QString)));
}
ImageExporterOutputWidget::ImageExporterOutputWidget(gloperate::ResourceManager & resourceManager, gloperate::Painter * painter, gloperate_qt::QtOpenGLWindow * context, QWidget *parent)
    :	QWidget(parent)
    ,	m_context(context)
    ,	m_supportedTags( { { "width", "<width>" }, { "height", "<height>" }, { "enum_num", "<enum#" }, { "year", "<year>" }, { "month", "<month>" }, { "day", "<day>" }, { "hour", "<hour>" }, { "minute", "<minute>" }, { "second", "<second>" }, { "millisec", "<millisecond>" }
})
,	m_ui(new Ui_ImageExporterOutputWidget)
,	m_resolution(new QSize(1,1))
{
    m_ui->setupUi(this);

    m_ui->fileNameTextEdit->setMaximumHeight(m_ui->directoryLineEdit->height() * 2);
    initializeFileNameTextEdit();

    connect(m_ui->saveButton, &QPushButton::clicked,
            this, &ImageExporterOutputWidget::handleSave);
    connect(m_ui->openDirectoryButton, &QPushButton::clicked,
            this, &ImageExporterOutputWidget::browseDirectory);
    connect(m_ui->fileNameTextEdit, &FileNameTextEdit::textChanged,
            this, &ImageExporterOutputWidget::checkFilename);
    connect(m_ui->fileNameTextEdit, &FileNameTextEdit::textChanged,
            this, &ImageExporterOutputWidget::saveFilename);

    connect(this, &ImageExporterOutputWidget::filenameChanged,
            this, &ImageExporterOutputWidget::updateFilenamePreview);

    m_imageExporter = new gloperate::ImageExporter(painter, resourceManager);
    context->makeCurrent();
    m_imageExporter->initialize();
    context->doneCurrent();

    if (!gloperate::ImageExporter::isApplicableTo(painter))
        m_ui->saveButton->setDisabled(true);

    restoreSettings();
    updateDirectory();
    checkFilename();
}
Beispiel #21
0
DesktopConfigWindow::DesktopConfigWindow()
    : QMainWindow(),
      m_restart(false)
{
    setupUi(this);

    // pages
    new QListWidgetItem(XdgIcon::fromTheme("preferences-desktop"), tr("Basic Settings"), listWidget);
    new QListWidgetItem(XdgIcon::fromTheme("show-menu"), tr("Menu Configuration"), listWidget);
    new QListWidgetItem(XdgIcon::fromTheme("preferences-desktop-personal"), tr("WM Native Desktop"), listWidget);
    listWidget->setCurrentRow(0);
    
    desktopTypeComboBox->addItem("Razor Desktop", "razor");
    desktopTypeComboBox->addItem("Window Manager Native", "wm_native");
    
    m_settings = new RazorSettings("desktop", this);
    m_cache = new RazorSettingsCache(m_settings);
    restoreSettings();
    
    connect(desktopTypeComboBox, SIGNAL(currentIndexChanged(int)),
            this, SLOT(desktopTypeComboBox_currentIndexChanged(int)));
    // UI stuff
    connect(chooseMenuFilePB, SIGNAL(clicked()), this, SLOT(chooseMenuFile()));
    //
    connect(nativeWallpaperButton, SIGNAL(clicked()), this, SLOT(nativeWallpaperButton_clicked()));
    //
    // notify it needs restart
    connect(singleclickButton, SIGNAL(clicked()), this, SLOT(setRestart()));
    connect(doubleclickButton, SIGNAL(clicked()), this, SLOT(setRestart()));
    connect(nativeIconsCheckBox, SIGNAL(clicked()), this, SLOT(setRestart()));
    connect(nativeWallpaperEdit, SIGNAL(textChanged(const QString&)), this, SLOT(setRestart()));
    connect(wheelDesktopCheckBox, SIGNAL(toggled(bool)), this, SLOT(setRestart()));
    connect(useDifferentWallpapersCheckBox, SIGNAL(clicked()), this, SLOT(setRestart()));
    //
    connect(buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*)));
}
FreeEMS_Loader::FreeEMS_Loader(QWidget *parent) :
QWidget(parent), showHelp(false), fileArg(false), unattended(false), _numBurnsPerformed(0), m_fileLoaded(false) {
	ui.setupUi(this);
	qRegisterMetaType<string>("string");
	qRegisterMetaType<unsigned int>("MESSAGE_TYPE");
	this->setWindowTitle(QString("FreeEMS-Loader ") + externalData::gitHASHShort);
	ui.label_build_info->setText(externalData::gitHASHLong);
	ui.comboDevice->installEventFilter(this);

	loaderComms = new FreeEMS_LoaderComms;
	fillBaud();
	fillDataBits();
	fillStopBits();
	fillParity();
	initGUI();
	//redirectCLI();
	loadFileName.clear();

	QObject::connect(loaderComms, SIGNAL( displayMessage(MESSAGE_TYPE, QString) ), this, SLOT( displayMessage(MESSAGE_TYPE, QString) ));
	QObject::connect(loaderComms, SIGNAL( setGUI(int) ), this, SLOT( changeGUIState(int) ));
	QObject::connect(loaderComms, SIGNAL( udProgress(int) ), this, SLOT( updateProgress(int) ));
	QObject::connect(loaderComms, SIGNAL( configureProgress(int, int) ), this, SLOT( configureProgress(int, int) ));

	fillDevice();
	restoreSettings();
	QString loadsNum;
	loadsNum.setNum(_numBurnsPerformed, 10);
	displayMessage(MESSAGE_INFO, "number of burns executed " + loadsNum);

	/* process arguments */
	QString arg;
	cmdline_args = QCoreApplication::arguments();
		bool isFileName = false;
	bool isDevice = false;
	foreach(arg, cmdline_args)
	{
		if (isFileName) {
			loadFileName = arg;
			isFileName = false;
			displayMessage(MESSAGE_INFO, "using filename: " + loadFileName);
		} else if (isDevice) {
			isDevice = false;
			ui.comboDevice->clear();
			ui.comboDevice->addItem(arg);
			displayMessage(MESSAGE_INFO, "using device: " + arg);
		}
		if (arg.contains("--")) {
			if (arg.contains("--unattended")) //TODO use nested if and detect invalid args
			{
				cout << endl << "Argument: unattended connect and load ";
				unattended = true;
			} else if (arg.contains("--file")) {
				isFileName = true;
				fileArg = true;
			} else if (arg.contains("--verify")) {
				cout << endl << "Argument: Verify True ";
				ui.chkVerify->setChecked(true);
			} else if (arg.contains("--device")) {
				isDevice = true;
				cout << endl << "Argument: Serial Device Specified";
			} else if (arg.contains("--rip")) {
				cout << endl << "Argument: Rip Set True ";
				ui.chkRip->setChecked(true);
			} else if (arg.contains("--norip")) {
				cout << endl << "Argument: Rip Before Load Set False ";
				ui.chkRip->setChecked(false);
			} else if (arg.contains("--noverify")) {
				cout << endl << "Argument: Verify Set False ";
				ui.chkVerify->setChecked(false);
			} else if (arg.contains("--help")) {
				cout << endl
						<< "Help: Valid arguments are: --rip, --norip, --verify, --noverify, --file <path to file>, --device, --unattended"
						" --help";
				showHelp = true;
			} else {
				cout << endl << "Help: Invalid argument: " << arg.toStdString();
			}
		}
	}

	if (unattended) {
	cout << "TODO unattended mode";
		//	connect();
	//	load();
	}
}
void AuxiliaryPreferencesWidget::cancel()
{
    emit restoreSettings();
}
Beispiel #24
0
/**
 * Construct a settings dialog. The actions in the list should have
 * a "defaultshortcut" property for reset to default to work.
 *
 * @param actions list of customizeable actions (for shortcut editing)
 * @param parent parent widget
 */
SettingsDialog::SettingsDialog(QWidget *parent)
	: QDialog(parent)
{
	_ui = new Ui_SettingsDialog;
	_ui->setupUi(this);

	connect(_ui->pickFfmpeg, &QToolButton::clicked, [this]() {
		QString path = QFileDialog::getOpenFileName(this, tr("Set ffmepg path"), _ui->ffmpegpath->text(),
#ifdef Q_OS_WIN
			tr("Executables (%1)").arg("*.exe") + ";;" +
#endif
			QApplication::tr("All files (*)")
		);
		if(!path.isEmpty())
			_ui->ffmpegpath->setText(path);
	});

	connect(_ui->pickRecordingFolder, &QToolButton::clicked, [this]() {
		QString path = QFileDialog::getExistingDirectory(this, tr("Recording folder"), _ui->recordingFolder->text());
		if(!path.isEmpty())
			_ui->recordingFolder->setText(path);
	});

	connect(_ui->notificationVolume, &QSlider::valueChanged, [this](int val) {
		if(val>0)
			_ui->volumeLabel->setText(QString::number(val) + "%");
		else
			_ui->volumeLabel->setText(tr("off", "notifications sounds"));
	});

	// Get available languages
	_ui->languageBox->addItem(tr("Default"), QString());
	_ui->languageBox->addItem(QStringLiteral("English"), QStringLiteral("en"));

	const QLocale localeC = QLocale::c();
	QStringList locales;
	for(const QString &datapath : DrawpileApp::dataPaths()) {
		QStringList files = QDir(datapath + "/i18n").entryList(QStringList("drawpile_*.qm"), QDir::Files, QDir::Name);
		for(const QString &file : files) {
			QString localename = file.mid(9, file.length() - 3 - 9);
			QLocale locale(localename);
			if(locale != localeC && !locales.contains(localename)) {
				locales << localename;
				_ui->languageBox->addItem(locale.nativeLanguageName(), localename);
			}
		}
	}

	// Editable shortcuts
	_customShortcuts = new CustomShortcutModel(this);
	auto filteredShortcuts = new QSortFilterProxyModel(this);
	filteredShortcuts->setSourceModel(_customShortcuts);
	connect(_ui->shortcutFilter, &QLineEdit::textChanged, filteredShortcuts, &QSortFilterProxyModel::setFilterFixedString);
	filteredShortcuts->setFilterCaseSensitivity(Qt::CaseInsensitive);
	_ui->shortcuts->setModel(filteredShortcuts);
	_ui->shortcuts->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
	_ui->shortcuts->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);

	// QKeySequence editor delegate
	QStyledItemDelegate *keyseqdel = new QStyledItemDelegate(this);
	QItemEditorFactory *itemeditorfactory = new QItemEditorFactory;
	itemeditorfactory->registerEditor(QVariant::nameToType("QKeySequence"), new KeySequenceEditFactory);
	keyseqdel->setItemEditorFactory(itemeditorfactory);
	_ui->shortcuts->setItemDelegateForColumn(1, keyseqdel);

	// Deselect item before saving. This causes the editor widget to close
	// and commit the change.
	connect(_ui->buttonBox, &QDialogButtonBox::accepted, [this]() {
		_ui->shortcuts->setCurrentIndex(QModelIndex());
	});

	// Known hosts list
	connect(_ui->knownHostList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(viewCertificate(QListWidgetItem*)));
	connect(_ui->knownHostList, SIGNAL(itemSelectionChanged()), this, SLOT(certificateSelectionChanged()));
	connect(_ui->trustKnownHosts, SIGNAL(clicked()), this, SLOT(markTrustedCertificates()));
	connect(_ui->removeKnownHosts, SIGNAL(clicked()), this, SLOT(removeCertificates()));
	connect(_ui->importTrustedButton, SIGNAL(clicked()), this, SLOT(importTrustedCertificate()));

	QStringList pemfilter; pemfilter << "*.pem";
	QDir knownHostsDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/known-hosts/");

	for(const QString &filename : knownHostsDir.entryList(pemfilter, QDir::Files)) {
		auto *i = new QListWidgetItem(filename.left(filename.length()-4), _ui->knownHostList);
		i->setData(Qt::UserRole, false);
		i->setData(Qt::UserRole+1, knownHostsDir.absoluteFilePath(filename));
	}

	QDir trustedHostsDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/trusted-hosts/");
	QIcon trustedIcon("builtin:trusted.svg");
	for(const QString &filename : trustedHostsDir.entryList(pemfilter, QDir::Files)) {
		auto *i = new QListWidgetItem(trustedIcon, filename.left(filename.length()-4), _ui->knownHostList);
		i->setData(Qt::UserRole, true);
		i->setData(Qt::UserRole+1, trustedHostsDir.absoluteFilePath(filename));
	}

	// Session listing server list
	_listservers = new sessionlisting::ListServerModel(false, this);
	_ui->listserverview->setModel(_listservers);
	_ui->listserverview->setItemDelegate(new sessionlisting::ListServerDelegate(this));

	connect(_ui->addListServer, &QPushButton::clicked, this, &SettingsDialog::addListingServer);
	connect(_ui->removeListServer, &QPushButton::clicked, this, &SettingsDialog::removeListingServer);

	// Load configuration
	restoreSettings();

	// Settings saving
	connect(_ui->buttonBox, SIGNAL(accepted()), this, SLOT(rememberSettings()));
	connect(_ui->buttonBox, SIGNAL(accepted()), this, SLOT(saveCertTrustChanges()));
	connect(_ui->buttonBox->button(QDialogButtonBox::Reset), SIGNAL(clicked()), this, SLOT(resetSettings()));
}
Beispiel #25
0
HeatmapGui::HeatmapGui( QWidget* parent, Qt::WindowFlags fl, QMap<QString, QVariant>* temporarySettings )
    : QDialog( parent, fl )
    , mRows( 500 )
{
  setupUi( this );

  QgsDebugMsg( QString( "Creating Heatmap Dialog" ) );

  blockAllSignals( true );

  mKernelShapeCombo->addItem( tr( "Quartic (biweight)" ), Heatmap::Quartic );
  mKernelShapeCombo->addItem( tr( "Triangular" ), Heatmap::Triangular );
  mKernelShapeCombo->addItem( tr( "Uniform" ), Heatmap::Uniform );
  mKernelShapeCombo->addItem( tr( "Triweight" ), Heatmap::Triweight );
  mKernelShapeCombo->addItem( tr( "Epanechnikov" ), Heatmap::Epanechnikov );

  mOutputValuesComboBox->addItem( tr( "Raw values" ), Heatmap::Raw );
  mOutputValuesComboBox->addItem( tr( "Scaled by kernel size" ), Heatmap::Scaled );

  mHeatmapSessionSettings = temporarySettings;

  // Adding point layers to the inputLayerCombo
  QString lastUsedLayer = mHeatmapSessionSettings->value( QString( "lastInputLayer" ) ).toString();
  bool usingLastInputLayer = false;

  mInputLayerCombo->setFilters( QgsMapLayerProxyModel::PointLayer );
  QgsMapLayer* defaultLayer = QgsMapLayerRegistry::instance()->mapLayer( lastUsedLayer );
  if ( defaultLayer )
  {
    mInputLayerCombo->setLayer( defaultLayer );
    usingLastInputLayer = true;
  }

  mRadiusFieldCombo->setFilters( QgsFieldProxyModel::Numeric );
  mWeightFieldCombo->setFilters( QgsFieldProxyModel::Numeric );
  connect( mInputLayerCombo, SIGNAL( layerChanged( QgsMapLayer* ) ), mRadiusFieldCombo, SLOT( setLayer( QgsMapLayer* ) ) );
  connect( mInputLayerCombo, SIGNAL( layerChanged( QgsMapLayer* ) ), mWeightFieldCombo, SLOT( setLayer( QgsMapLayer* ) ) );
  mRadiusFieldCombo->setLayer( mInputLayerCombo->currentLayer() );
  mWeightFieldCombo->setLayer( mInputLayerCombo->currentLayer() );

  // Adding GDAL drivers with CREATE to mFormatCombo
  int myTiffIndex = -1;
  int myIndex = -1;
  GDALAllRegister();
  int nDrivers = GDALGetDriverCount();
  for ( int i = 0; i < nDrivers; i += 1 )
  {
    GDALDriverH nthDriver = GDALGetDriver( i );
    char **driverMetadata = GDALGetMetadata( nthDriver, nullptr );
    // Only formats which allow creation of Float32 data types are valid
    if ( CSLFetchBoolean( driverMetadata, GDAL_DCAP_CREATE, false ) &&
         QString( GDALGetMetadataItem( nthDriver, GDAL_DMD_CREATIONDATATYPES, nullptr ) ).contains( "Float32" ) )
    {
      ++myIndex;
      QString myLongName = GDALGetMetadataItem( nthDriver, GDAL_DMD_LONGNAME, nullptr );
      // Add LongName text, shortname variant; GetDescription actually gets the shortname
      mFormatCombo->addItem( myLongName, QVariant( GDALGetDescription( nthDriver ) ) );
      // Add the drivers and their extensions to a map for filename correction
      mExtensionMap.insert( GDALGetDescription( nthDriver ), GDALGetMetadataItem( nthDriver, GDAL_DMD_EXTENSION, nullptr ) );
      if ( myLongName == "GeoTIFF" )
      {
        myTiffIndex = myIndex;
      }
    }
  }
  //Restore choice of output format from last run
  QSettings s;
  int defaultFormatIndex = s.value( "/Heatmap/lastFormat", myTiffIndex ).toInt();
  mFormatCombo->setCurrentIndex( defaultFormatIndex );

  restoreSettings( usingLastInputLayer );
  updateBBox();
  updateSize();

  mAddToCanvas->setChecked( s.value( "/Heatmap/addToCanvas", true ).toBool() );

  blockAllSignals( false );

  //finally set right the ok button
  enableOrDisableOkButton();
}
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    kwp(this),
    appSettings(new QSettings("vagblocks.ini", QSettings::IniFormat, this)),
    serialConfigured(false),
    storedRow(-1), storedCol(-1),
    currentlyLogging(false)
{
    /*
    QFile roboto(":/resources/Roboto-Regular.ttf");
    roboto.open(QIODevice::ReadOnly);
    if (QFontDatabase::addApplicationFontFromData(roboto.readAll()) < 0) {
        // error
    }
    roboto.close();
    */

    ui->setupUi(this);

    QString svnRev = APP_SVN_REV;
    int colonAt = svnRev.indexOf(":");
    if (colonAt > 0) {
        svnRev = svnRev.mid(colonAt+1);
    }
    QString appVer = APP_VERSION;
    aboutDialog = new about(appVer, svnRev, this);
    serSettings = new serialSettingsDialog(this);
    settingsDialog = new settings(appSettings, this);

    connect(ui->action_About, SIGNAL(triggered()), aboutDialog, SLOT(show()));
    connect(ui->actionApplication_settings, SIGNAL(triggered()), settingsDialog, SLOT(show()));

    setupBlockArray(ui->blocksLayout);

    connect(&kwp, SIGNAL(log(QString, int)), this, SLOT(log(QString, int)));
    connect(&kwp, SIGNAL(newBlockData(int)), this, SLOT(newBlockData(int)));
    connect(&kwp, SIGNAL(blockOpen(int)), this, SLOT(blockOpen(int)));
    connect(&kwp, SIGNAL(blockClosed(int)), this, SLOT(blockClosed(int)));
    connect(&kwp, SIGNAL(channelOpen(bool)), this, SLOT(channelOpen(bool)));
    connect(&kwp, SIGNAL(elmInitialised(bool)), this, SLOT(elmInitialised(bool)));
    connect(&kwp, SIGNAL(portOpened(bool)), this, SLOT(portOpened(bool)));
    connect(&kwp, SIGNAL(portClosed()), this, SLOT(portClosed()));
    connect(&kwp, SIGNAL(newModuleInfo(QStringList)), this, SLOT(moduleInfoReceived(QStringList)));
    connect(&kwp, SIGNAL(newEcuInfo(QStringList)), this, SLOT(ecuInfoReceived(QStringList)));
    connect(ui->pushButton_log, SIGNAL(clicked(bool)), this, SLOT(startLogging(bool)));
    connect(&kwp, SIGNAL(labelsLoaded(bool)), this, SLOT(labelsLoaded(bool)));
    connect(ui->lineEdit_moduleNum, SIGNAL(textChanged(QString)), this, SLOT(clearUI()));
    connect(ui->comboBox_modules, SIGNAL(activated(int)), this, SLOT(selectNewModule(int)));
    connect(&kwp, SIGNAL(moduleListRefreshed()), this, SLOT(refreshModules()));
    connect(ui->pushButton_refresh, SIGNAL(clicked()), &kwp, SLOT(openGW_refresh()));
    connect(&kwp, SIGNAL(sampleFormatChanged()), this, SLOT(sampleFormatChanged()));
    connect(&kwp, SIGNAL(loggingStarted()), this, SLOT(loggingStarted()));
    connect(settingsDialog, SIGNAL(settingsChanged()), this, SLOT(updateSettings()));

    for (int i = 0; i < 16; i++) { // setup running average for sample rate
        avgList.append(0);
    }

    restoreSettings();

    if (serialConfigured) {
        kwp.setSerialParams(serSettings->getSettings());
        QMetaObject::invokeMethod(&kwp, "openPort", Qt::QueuedConnection);
    }

    connect(serSettings, SIGNAL(settingsApplied()), this, SLOT(connectToSerial()));
    refreshModules(true);
}
Beispiel #27
0
QWidget *  QCamVesta::buildGUI(QWidget * parent) {
   QWidget * remoteCTRL=QCamV4L2::buildGUI(parent);

   //QHGroupBox* vestaCtrl=new QHGroupBox("Vesta controls",remoteCTRL);
   QGridBox * sliders= new QGridBox(/*vestaCtrl*/VctrlBox,Qt::Vertical,3);
   /*
   QHBox * sliders=new QHBox(remoteCTRL);
   QVBox * left = new QVBox(sliders);
   QVBox * right = new QVBox(sliders);
   */
   if (QCamUtilities::expertMode()) {
      QCheckBox * backLight = new QCheckBox(tr("Back Light"),sliders);
      connect(backLight,SIGNAL(toggled(bool)),this,SLOT(setBackLight(bool)));
      backLight->setToolTip(tr("In case the object you are viewing with the camera is\n"
                       "in front of a bright background (for example, a window\n"
                       "or some bright lights), the automatic exposure unit may\n"
                       "make the image too dark. In that case you can turn the\n"
                       "backlight compensation mode off"));
      QCheckBox * flicker = new QCheckBox(tr("Anti-flicker"),sliders);
      connect(flicker,SIGNAL(toggled(bool)),this,SLOT(setFlicker(bool)));
      flicker->setToolTip(tr("Suppress 'flickering' of the image when light with a fluo tube"));
   }
   remoteCTRLgama_=new QCamSlider(tr("Gamma"),false,sliders);
   // not very clean...but works
   remoteCTRLgama_->setMinValue(0);
   remoteCTRLgama_->setMaxValue(32);
   remoteCTRLgama_->setToolTip(tr("Low gamma implies less contrasts"));
   remoteCTRLgain_=new QCamSlider(tr("Gain"),true,sliders);
   remoteCTRLgain_->setToolTip(tr("More Gain implies more noise in the images"));
   remoteCTRLexposure_=new QCamSlider(tr("Exp."),true,sliders,0,65535,true);
   remoteCTRLexposure_->setToolTip(tr("More exposure reduce noise in images.\n"
                 "(manual exposure setting don't work on type 740\n"
                 "if automatic gain is activated).")
      );
   if (QCamUtilities::expertMode()) {
      remoteCTRLcompression_=new QCamSlider(tr("Comp."),false,sliders,0,3);
      remoteCTRLnoiseRemoval_=new QCamSlider(tr("Noise"),false,sliders,0,3);
      remoteCTRLsharpness_=new QCamSlider(tr("Sharp."),false,sliders,0,65535);

      connect(this,SIGNAL(compressionChange(int)),remoteCTRLcompression_,SLOT(setValue(int)));
      connect(remoteCTRLcompression_,SIGNAL(valueChange(int)),this,SLOT(setCompression(int)));
      connect(this,SIGNAL(noiseRemovalChange(int)),remoteCTRLnoiseRemoval_,SLOT(setValue(int)));
      connect(remoteCTRLnoiseRemoval_,SIGNAL(valueChange(int)),this,SLOT(setNoiseRemoval(int)));

      remoteCTRLnoiseRemoval_->setToolTip(tr("Dynamic Noise removal (0=none, 3=high) (0 give brighter image)"));

      connect(this,SIGNAL(sharpnessChange(int)),remoteCTRLsharpness_,SLOT(setValue(int)));
      connect(remoteCTRLsharpness_,SIGNAL(valueChange(int)),this,SLOT(setSharpness(int)));
      remoteCTRLsharpness_->setToolTip(tr("Shaprness enhancement (0=none, 65536=high) (low value blurs image)"));
   }

   int wbValue[]={PWC_WB_AUTO, PWC_WB_INDOOR, PWC_WB_OUTDOOR, PWC_WB_FL, PWC_WB_MANUAL};
   const char *wbLabel[]={"Auto", "In","Out","Neon","Manual"};
   remoteCTRLWhiteBalance_=new QCamRadioBox("White Balance",VctrlBox,5,wbValue,wbLabel,5);

   QWidget* whiteBalanceGroup=new QWidget();
   QHBoxLayout* whiteBalanceGroup_layout= new QHBoxLayout();
   whiteBalanceGroup->setLayout(whiteBalanceGroup_layout);

   connect(remoteCTRLWhiteBalance_,SIGNAL(change(int)),this,SLOT(setWhiteBalanceMode(int)));
   connect(this,SIGNAL(whiteBalanceModeChange(int)),remoteCTRLWhiteBalance_,SLOT(update(int)));

   QCheckBox * liveWBupdateB = new QCheckBox(tr("live"),whiteBalanceGroup);
   connect(liveWBupdateB,SIGNAL(toggled(bool)),this,SLOT(setLiveWhiteBalance(bool)));
   liveWBupdateB->setToolTip(tr("Live Update of red/blue value in automatic mode"));
   whiteBalanceGroup_layout->addWidget(liveWBupdateB);

   remoteCTRLWBred_ = new QCamSlider(tr("red bal."),false,whiteBalanceGroup,0,65535);
   whiteBalanceGroup_layout->addWidget(remoteCTRLWBred_);
   connect(this,SIGNAL(whiteBalanceRedChange(int)),remoteCTRLWBred_,SLOT(setValue(int)));
   connect(remoteCTRLWBred_,SIGNAL(valueChange(int)),this,SLOT(setWhiteBalanceRed(int)));

   remoteCTRLWBblue_ = new QCamSlider(tr("blue bal."),false,whiteBalanceGroup,0,65535);
   whiteBalanceGroup_layout->addWidget(remoteCTRLWBblue_);
   connect(this,SIGNAL(whiteBalanceBlueChange(int)),remoteCTRLWBblue_,SLOT(setValue(int)));
   connect(remoteCTRLWBblue_,SIGNAL(valueChange(int)),this,SLOT(setWhiteBalanceBlue(int)));

   remoteCTRLWhiteBalance_->layout()->addWidget(whiteBalanceGroup);

   remoteCTRLWBred_->setEnabled(false);
   remoteCTRLWBblue_->setEnabled(false);
   remoteCTRLWhiteBalance_->show();

   exposureTimeLeft_=NULL;
   connect(this,SIGNAL(gainChange(int)),remoteCTRLgain_,SLOT(setValue(int)));
   connect(remoteCTRLgain_,SIGNAL(valueChange(int)),this,SLOT(setGain(int)));

   /*
     connect(this,SIGNAL(exposureChange(int)),remoteCTRLexposure_,
     SLOT(setValue(int)));
   */
   connect(remoteCTRLexposure_,SIGNAL(valueChange(int)),this,SLOT(setExposure(int)));
   connect(this,SIGNAL(gamaChange(int)),remoteCTRLgama_,SLOT(setValue(int)));
   connect(remoteCTRLgama_,SIGNAL(valueChange(int)),this,SLOT(setGama(int)));

   QCamHBox* settings=new QCamHBox(VctrlBox);
   settings->setToolTip(tr("save/restore settings of gain,exposure & white balance"));

   QPushButton* saveSettingsB =new QPushButton(tr("save"),settings);
   saveSettingsB->setToolTip(tr("Save User settings (gain,exposure & white balance)"));
   connect(saveSettingsB,SIGNAL(released()),this,SLOT(saveSettings()));

   QPushButton* restoreSettingsB =new QPushButton(tr("restore"),settings);
   restoreSettingsB->setToolTip(tr("Restore User settings"));
   connect(restoreSettingsB,SIGNAL(released()),this,SLOT(restoreSettings()));

   QPushButton* restoreFactorySettingsB =new QPushButton(tr("factory"),settings);
   restoreFactorySettingsB->setToolTip(tr("Restore factory default settings"));
   connect(restoreFactorySettingsB,SIGNAL(released()),this,SLOT(restoreFactorySettings()));

   remoteCTRLframeRate_ =new QCamHGroupBox(tr("fps / long exposure"),remoteCTRL);
   int frameRate[]={5,10,15,20,25,30};
   remoteCTRLframeRate2_=new QCamComboBox("fps",remoteCTRLframeRate_,6,frameRate,NULL);
   remoteCTRLframeRate2_->setToolTip(tr("Camera frame rate"));
   connect(this,SIGNAL(frameRateChange(int)),remoteCTRLframeRate2_,SLOT(update(int)));
   connect(remoteCTRLframeRate2_,SIGNAL(change(int)),this,SLOT(setFrameRate(int)));
   remoteCTRLframeRate2_->show();

   int scModeTable[]={SCmodNone,SCmodPPort2,SCmodLed,SCmodSerial};
   const char* scModeLabel[]={"SC mod : None","SC mod : // port","SC mod : TUC led","SC mod : serial"};
   SCmodSelector_ = new QCamComboBox("SC mod",remoteCTRLframeRate_,4,scModeTable,scModeLabel);
   SCmodSelector_->setToolTip(tr("Long exposure device"));
   connect(SCmodSelector_,SIGNAL(change(int)),this,SLOT(setSCmod(int)));

   initRemoteControlLongExposure(remoteCTRLframeRate_);

   setBestQuality();
   refreshPictureSettings();

   remoteCTRL->show();

   return remoteCTRL;
}
Beispiel #28
0
ClipboardServer::ClipboardServer(QApplication *app, const QString &sessionName)
    : QObject()
    , App(app, sessionName)
    , m_wnd(nullptr)
    , m_shortcutActions()
    , m_ignoreKeysTimer()
{
    setCurrentThreadName("Server");

    const QString serverName = clipboardServerName();
    m_server = new Server(serverName, this);

    if ( m_server->isListening() ) {
        ::createSessionMutex();
        restoreSettings(true);
        COPYQ_LOG("Server \"" + serverName + "\" started.");
    } else {
        restoreSettings(false);
        COPYQ_LOG("Server \"" + serverName + "\" already running!");
        log( tr("CopyQ server is already running."), LogWarning );
        exit(0);
        return;
    }

    QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);

    QApplication::setQuitOnLastWindowClosed(false);

    m_itemFactory = new ItemFactory(this);
    m_wnd = new MainWindow(m_itemFactory);

    m_itemFactory->loadPlugins();
    if ( !m_itemFactory->hasLoaders() )
        log("No plugins loaded", LogNote);

    m_wnd->loadSettings();
    m_wnd->setCurrentTab(0);
    m_wnd->enterBrowseMode();

    connect( m_server, &Server::newConnection,
             this, &ClipboardServer::onClientNewConnection );

    connect( qApp, &QCoreApplication::aboutToQuit,
             this, &ClipboardServer::onAboutToQuit );

    connect( qApp, &QGuiApplication::commitDataRequest, this, &ClipboardServer::onCommitData );
    connect( qApp, &QGuiApplication::saveStateRequest, this, &ClipboardServer::onSaveState );
#if QT_VERSION >= QT_VERSION_CHECK(5,6,0)
    qApp->setFallbackSessionManagementEnabled(false);
#endif

    connect( m_wnd, &MainWindow::requestExit,
             this, &ClipboardServer::maybeQuit );
    connect( m_wnd, &MainWindow::disableClipboardStoringRequest,
             this, &ClipboardServer::onDisableClipboardStoringRequest );

    loadSettings();

    // notify window if configuration changes
    connect( m_wnd, &MainWindow::configurationChanged,
             this, &ClipboardServer::loadSettings );

    connect( m_wnd, &MainWindow::commandsSaved,
             this, &ClipboardServer::onCommandsSaved );
    onCommandsSaved();

    qApp->installEventFilter(this);

    m_server->start();

    // Ignore global shortcut key presses in any widget.
    m_ignoreKeysTimer.setInterval(100);
    m_ignoreKeysTimer.setSingleShot(true);

    startMonitoring();
}
Beispiel #29
0
DebuggerMainWnd::DebuggerMainWnd() :
	KXmlGuiWindow(),
	m_debugger(0),
#ifdef GDB_TRANSCRIPT
	m_transcriptFile(GDB_TRANSCRIPT),
#endif
	m_outputTermCmdStr(defaultTermCmdStr),
	m_outputTermProc(new QProcess),
	m_ttyLevel(-1),			/* no tty yet */
	m_popForeground(false),
	m_backTimeout(1000),
	m_tabWidth(0),
	m_sourceFilter(defaultSourceFilter),
	m_headerFilter(defaultHeaderFilter),
	m_animation(0),
	m_statusActive(i18n("active"))
{
    setDockNestingEnabled(true);

    m_filesWindow = new WinStack(this);
    setCentralWidget(m_filesWindow);

    QDockWidget* dw1 = createDockWidget("Stack", i18n("Stack"));
    m_btWindow = new QListWidget(dw1);
    dw1->setWidget(m_btWindow);
    QDockWidget* dw2 = createDockWidget("Locals", i18n("Locals"));
    m_localVariables = new ExprWnd(dw2, i18n("Variable"));
    dw2->setWidget(m_localVariables);
    QDockWidget* dw3 = createDockWidget("Watches", i18n("Watches"));
    m_watches = new WatchWindow(dw3);
    dw3->setWidget(m_watches);
    QDockWidget* dw4 = createDockWidget("Registers", i18n("Registers"));
    m_registers = new RegisterView(dw4);
    dw4->setWidget(m_registers);
    QDockWidget* dw5 = createDockWidget("Breakpoints", i18n("Breakpoints"));
    m_bpTable = new BreakpointTable(dw5);
    dw5->setWidget(m_bpTable);
    QDockWidget* dw6 = createDockWidget("Output", i18n("Output"));
    m_ttyWindow = new TTYWindow(dw6);
    dw6->setWidget(m_ttyWindow);
    QDockWidget* dw7 = createDockWidget("Threads", i18n("Threads"));
    m_threads = new ThreadList(dw7);
    dw7->setWidget(m_threads);
    QDockWidget* dw8 = createDockWidget("Memory", i18n("Memory"));
    m_memoryWindow = new MemoryWindow(dw8);
    dw8->setWidget(m_memoryWindow);

    m_debugger = new KDebugger(this, m_localVariables, m_watches->watchVariables(), m_btWindow);

    connect(m_debugger, SIGNAL(updateStatusMessage()), SLOT(slotNewStatusMsg()));
    connect(m_debugger, SIGNAL(updateUI()), SLOT(updateUI()));
    connect(m_debugger, SIGNAL(breakpointsChanged()), SLOT(updateLineItems()));
    connect(m_debugger, SIGNAL(debuggerStarting()), SLOT(slotDebuggerStarting()));
    m_bpTable->setDebugger(m_debugger);
    m_memoryWindow->setDebugger(m_debugger);

    setStandardToolBarMenuEnabled(true);
    initKAction();
    initStatusBar();

    connect(m_watches, SIGNAL(addWatch()), SLOT(slotAddWatch()));
    connect(m_watches, SIGNAL(deleteWatch()), m_debugger, SLOT(slotDeleteWatch()));
    connect(m_watches, SIGNAL(textDropped(const QString&)), SLOT(slotAddWatch(const QString&)));

    connect(&m_filesWindow->m_findDlg, SIGNAL(closed()), SLOT(updateUI()));
    connect(m_filesWindow, SIGNAL(newFileLoaded()),
	    SLOT(slotNewFileLoaded()));
    connect(m_filesWindow, SIGNAL(toggleBreak(const QString&,int,const DbgAddr&,bool)),
	    this, SLOT(slotToggleBreak(const QString&,int,const DbgAddr&,bool)));
    connect(m_filesWindow, SIGNAL(enadisBreak(const QString&,int,const DbgAddr&)),
	    this, SLOT(slotEnaDisBreak(const QString&,int,const DbgAddr&)));
    connect(m_debugger, SIGNAL(activateFileLine(const QString&,int,const DbgAddr&)),
	    m_filesWindow, SLOT(activate(const QString&,int,const DbgAddr&)));
    connect(m_debugger, SIGNAL(executableUpdated()),
	    m_filesWindow, SLOT(reloadAllFiles()));
    connect(m_debugger, SIGNAL(updatePC(const QString&,int,const DbgAddr&,int)),
	    m_filesWindow, SLOT(updatePC(const QString&,int,const DbgAddr&,int)));
    // value popup communication
    connect(m_filesWindow, SIGNAL(initiateValuePopup(const QString&)),
	    m_debugger, SLOT(slotValuePopup(const QString&)));
    connect(m_debugger, SIGNAL(valuePopup(const QString&)),
	    m_filesWindow, SLOT(slotShowValueTip(const QString&)));
    // disassembling
    connect(m_filesWindow, SIGNAL(disassemble(const QString&, int)),
	    m_debugger, SLOT(slotDisassemble(const QString&, int)));
    connect(m_debugger, SIGNAL(disassembled(const QString&,int,const std::list<DisassembledCode>&)),
	    m_filesWindow, SLOT(slotDisassembled(const QString&,int,const std::list<DisassembledCode>&)));
    connect(m_filesWindow, SIGNAL(moveProgramCounter(const QString&,int,const DbgAddr&)),
	    m_debugger, SLOT(setProgramCounter(const QString&,int,const DbgAddr&)));
    // program stopped
    connect(m_debugger, SIGNAL(programStopped()), SLOT(slotProgramStopped()));
    connect(&m_backTimer, SIGNAL(timeout()), SLOT(slotBackTimer()));
    // tab width
    connect(this, SIGNAL(setTabWidth(int)), m_filesWindow, SIGNAL(setTabWidth(int)));

    // connect breakpoint table
    connect(m_bpTable, SIGNAL(activateFileLine(const QString&,int,const DbgAddr&)),
	    m_filesWindow, SLOT(activate(const QString&,int,const DbgAddr&)));
    connect(m_debugger, SIGNAL(updateUI()), m_bpTable, SLOT(updateUI()));
    connect(m_debugger, SIGNAL(breakpointsChanged()), m_bpTable, SLOT(updateBreakList()));
    connect(m_debugger, SIGNAL(breakpointsChanged()), m_bpTable, SLOT(updateUI()));

    connect(m_debugger, SIGNAL(registersChanged(const std::list<RegisterInfo>&)),
	    m_registers, SLOT(updateRegisters(const std::list<RegisterInfo>&)));

    connect(m_debugger, SIGNAL(memoryDumpChanged(const QString&, const std::list<MemoryDump>&)),
	    m_memoryWindow, SLOT(slotNewMemoryDump(const QString&, const std::list<MemoryDump>&)));
    connect(m_debugger, SIGNAL(saveProgramSpecific(KConfigBase*)),
	    m_memoryWindow, SLOT(saveProgramSpecific(KConfigBase*)));
    connect(m_debugger, SIGNAL(restoreProgramSpecific(KConfigBase*)),
	    m_memoryWindow, SLOT(restoreProgramSpecific(KConfigBase*)));

    // thread window
    connect(m_debugger, SIGNAL(threadsChanged(const std::list<ThreadInfo>&)),
	    m_threads, SLOT(updateThreads(const std::list<ThreadInfo>&)));
    connect(m_threads, SIGNAL(setThread(int)),
	    m_debugger, SLOT(setThread(int)));

    // popup menu of the local variables window
    m_localVariables->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(m_localVariables, SIGNAL(customContextMenuRequested(const QPoint&)),
	    this, SLOT(slotLocalsPopup(const QPoint&)));

    makeDefaultLayout();
    setupGUI(KXmlGuiWindow::Default, "kdbgui.rc");
    restoreSettings(KGlobal::config());

    // The animation button is not part of the restored window state.
    // We must create it after the toolbar was loaded.
    initAnimation();

    updateUI();
    m_bpTable->updateUI();
}
Beispiel #30
0
void RolloutBox::restoreSettings(QSettings& settings) {
    setExpanded(settings.value("expanded", true).toBool());
    restoreSettings(settings, this);
}