Exemplo n.º 1
3
MainWindow::MainWindow()
{
    outputLog = new QTextEdit(this);
    outputLog->setReadOnly(true);
    outputLog->append("MTG log \n-------\n");



    //to be created a central widget
    //setCentralWidget(new QWidget());
    setCentralWidget(outputLog);
    setWindowIcon(QIcon(":/images/MTG.png"));
    //creating the menu titles
    fileMenu = menuBar()->addMenu(tr("&File"));
    //editMenu = menuBar()->addMenu(tr("&Edit"));
    analyzerMenu = menuBar()->addMenu(tr("Analyzer"));
    DMmenu = menuBar()->addMenu(tr("DataManager"));
    MMmenu = menuBar()->addMenu(tr("MaskManager"));
    viewMenu = menuBar()->addMenu(tr("&View"));
    menuBar()->addSeparator();
    helpMenu = menuBar()->addMenu(tr("&Help"));

    // creating stuff
    //warning: take care of the order you call these functions
    createDockWindows();
    createActions();
    createMenus();
    createToolBars();
    createStatusBar();

    QFile file(":/styles.qss");
    file.open(QFile::ReadOnly);
    QString styleSheet = QLatin1String(file.readAll());
    qApp->setStyleSheet(styleSheet);

    setWindowTitle(tr("Matrix Tool GUI"));
    setIconSize(QSize(35,35));

    desktop = qApp->desktop();

    connect(desktop, SIGNAL(resized(int)), this, SLOT(centerMainWindowGeometry()));

    //connect(dataManager, SIGNAL(plotHisto(QPair<matrixData*, QString>)), this, SLOT(raisePlotDock()));
    connect(dataManager, SIGNAL(plotHisto(QPair<matrixData*, QString>)), plotWidget, SLOT(histoMatrix(QPair<matrixData*, QString>)));

    //connect(dataManager, SIGNAL(inspectMatrixData(QPair<matrixData*, QString>)), this, SLOT(raiseEVDock()));
    connect(dataManager, SIGNAL(inspectMatrixData(QPair<matrixData*, QString>)),eventViewer, SLOT(attachMatrixData(QPair<matrixData*, QString>)));

    //raise the involved dock when action is triggered
    connect(newDataSetAct, SIGNAL(triggered()), this, SLOT(raiseDMDock()));
    connect(rmDataSetAct, SIGNAL(triggered()), this, SLOT(raiseDMDock()));
    connect(rmAllDataSetAct, SIGNAL(triggered()), this, SLOT(raiseDMDock()));
    connect(plotDataSetAct, SIGNAL(triggered()), this, SLOT(raiseDMDock()));
        connect(plotDataSetAct, SIGNAL(triggered()), this, SLOT(raisePlotDock()));
    connect(saveDataSetAct, SIGNAL(triggered()), this, SLOT(raiseDMDock()));
    connect(inspectEventAct, SIGNAL(triggered()), this, SLOT(raiseDMDock()));
        connect(inspectEventAct, SIGNAL(triggered()), this, SLOT(raiseEVDock()));
    connect(renameDataSetAct, SIGNAL(triggered()), this, SLOT(raiseDMDock()));
    //
    connect(newMaskSetAct, SIGNAL(triggered()), this, SLOT(raiseMMDock()));
    connect(printMaskAct, SIGNAL(triggered()), this, SLOT(raiseMMDock()));
    connect(rmMaskSetAct, SIGNAL(triggered()), this, SLOT(raiseMMDock()));
    connect(renameMaskSetAct, SIGNAL(triggered()), this, SLOT(raiseMMDock()));
    connect(editMaskAct, SIGNAL(triggered()), this, SLOT(raiseMMDock()));


    //raise the involved dock when made visible
    connect(DMviewAct, SIGNAL(triggered()), this, SLOT(raiseDMDock()));
    connect(MMviewAct, SIGNAL(triggered()), this, SLOT(raiseMMDock()));
    connect(plotViewAct, SIGNAL(triggered()), this, SLOT(raisePlotDock()));
    connect(EVviewAct, SIGNAL(triggered()), this, SLOT(raiseEVDock()));

    //connect the log output signals
    connect(dataManager, SIGNAL(outputLog(QString)), outputLog, SLOT(append(QString)));
    connect(maskManager, SIGNAL(outputLog(QString)), outputLog, SLOT(append(QString)));
    connect(plotWidget, SIGNAL(outputLog(QString)), outputLog, SLOT(append(QString)));
    connect(eventViewer, SIGNAL(outputLog(QString)), outputLog, SLOT(append(QString)));


    setUnifiedTitleAndToolBarOnMac(true);

}
Exemplo n.º 2
0
void screen::setWindowIcon2()
{ 
  QPixmap p = interpreter_loadPixmap("VIEW_KONSOLE.png");
  setWindowIcon(QIcon(p));
}
Exemplo n.º 3
0
BitcoinGUI::BitcoinGUI(QWidget *parent):
    QMainWindow(parent),
    clientModel(0),
    walletModel(0),
    encryptWalletAction(0),
    changePassphraseAction(0),
    lockWalletToggleAction(0),
    aboutQtAction(0),
    trayIcon(0),
    notificator(0),
    rpcConsole(0)
{
    resize(850, 550);
    setWindowTitle(tr("SGcoin") + " - " + tr("Wallet"));
#ifndef Q_OS_MAC
    qApp->setWindowIcon(QIcon(":icons/bitcoin"));
    setWindowIcon(QIcon(":icons/bitcoin"));
#else
    setUnifiedTitleAndToolBarOnMac(true);
    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon
    createActions();

    // Create application menu bar
    createMenuBar();

    // Create the toolbars
    createToolBars();

    // Create the tray icon (or setup the dock icon)
    createTrayIcon();

    // Create tabs
    overviewPage = new OverviewPage();

    transactionsPage = new QWidget(this);
    QVBoxLayout *vbox = new QVBoxLayout();
    transactionView = new TransactionView(this);
    vbox->addWidget(transactionView);
    transactionsPage->setLayout(vbox);

    addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);

    receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);

    sendCoinsPage = new SendCoinsDialog(this);

    signVerifyMessageDialog = new SignVerifyMessageDialog(this);

    centralWidget = new QStackedWidget(this);
    centralWidget->addWidget(overviewPage);
    centralWidget->addWidget(transactionsPage);
    centralWidget->addWidget(addressBookPage);
    centralWidget->addWidget(receiveCoinsPage);
    centralWidget->addWidget(sendCoinsPage);
    setCentralWidget(centralWidget);

    // Create status bar
    statusBar();

    // Status bar notification icons
    QFrame *frameBlocks = new QFrame();
    frameBlocks->setContentsMargins(0,0,0,0);
    frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
    QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
    frameBlocksLayout->setContentsMargins(3,0,3,0);
    frameBlocksLayout->setSpacing(3);
    labelEncryptionIcon = new QLabel();
    labelMintingIcon = new QLabel();
    labelConnectionsIcon = new QLabel();
    labelBlocksIcon = new QLabel();
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelEncryptionIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelMintingIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelConnectionsIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelBlocksIcon);
    frameBlocksLayout->addStretch();

    // Set minting pixmap
    labelMintingIcon->setPixmap(QIcon(":/icons/minting").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
    labelMintingIcon->setEnabled(false);
    // Add timer to update minting icon
    QTimer *timerMintingIcon = new QTimer(labelMintingIcon);
    timerMintingIcon->start(MODEL_UPDATE_DELAY);
    connect(timerMintingIcon, SIGNAL(timeout()), this, SLOT(updateMintingIcon()));
    // Add timer to update minting weights
    QTimer *timerMintingWeights = new QTimer(labelMintingIcon);
    timerMintingWeights->start(30 * 1000);
    connect(timerMintingWeights, SIGNAL(timeout()), this, SLOT(updateMintingWeights()));
    // Set initial values for user and network weights
    nWeight, nNetworkWeight = 0;

    // Progress bar and label for blocks download
    progressBarLabel = new QLabel();
    progressBarLabel->setVisible(false);
    progressBar = new QProgressBar();
    progressBar->setAlignment(Qt::AlignCenter);
    progressBar->setVisible(false);

    // Override style sheet for progress bar for styles that have a segmented progress bar,
    // as they make the text unreadable (workaround for issue #1071)
    // See https://qt-project.org/doc/qt-4.8/gallery.html
    QString curStyle = qApp->style()->metaObject()->className();
    if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
    {
        progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }");
    }

    statusBar()->addWidget(progressBarLabel);
    statusBar()->addWidget(progressBar);
    statusBar()->addPermanentWidget(frameBlocks);

    syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this);
    // this->setStyleSheet("background-color: #effbef;");

    // Clicking on a transaction on the overview page simply sends you to transaction history page
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));

    // Double-clicking on a transaction on the transaction history page shows details
    connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));

    rpcConsole = new RPCConsole(this);
    connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));

    // Clicking on "Verify Message" in the address book sends you to the verify message tab
    connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
    // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab
    connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));

    gotoOverviewPage();
}
void EditorMainWindow::SetupUI(QMainWindow *MainWindow) {

	setWindowIcon(*QtConfig::GetIcon("colorwheel.png"));

	MainWindow->setWindowTitle("Sound Engine v0.2.3");

	MainWindow->resize(1280, 720);

	MainWindow->setDockOptions(QMainWindow::AnimatedDocks |
								QMainWindow::AllowNestedDocks |
								QMainWindow::AllowTabbedDocks);

	MainWindow->setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::TabPosition::North);

	// ************************************************************************
	// Load styling

	ReloadStyleSheets();

	// ************************************************************************
	// File Picker

	auto *picker = new FilePicker();
	picker->setNameFilter("*.xml");
	GUI::Set(QT_INSTACE::FILE_PICKER, (void*) picker);

	// ************************************************************************
	// Menu Bar

	QMenuBar *menuBar = new QMenuBar(MainWindow);
	menuBar->setObjectName(QStringLiteral("menuBar"));
	menuBar->setGeometry(QRect(0, 0, 1051, 21));
	MainWindow->setMenuBar(menuBar);

	// Menu Entry
	{
		QMenu *menuEngine = new QMenu(menuBar);
		menuEngine->setObjectName(QStringLiteral("menuEngine"));
		menuEngine->setTitle("File");

		menuBar->addAction(menuEngine->menuAction());

		{
			QAction *action = new QAction(MainWindow);
			action->setText("Exit");
			action->setIcon(*QtConfig::GetIcon("power.png"));
			menuEngine->addAction(action);
			QObject::connect(action, &QAction::triggered, this, &EditorMainWindow::close);
		}

		{
			QAction *action = new QAction(MainWindow);
			action->setText("Save As...");
			action->setIcon(*QtConfig::GetIcon("memorycard.png"));
			menuEngine->addAction(action);

			QObject::connect(action, &QAction::triggered, this, [picker]() {
				picker->OpenForSave();
			});

			QObject::connect(picker, &QFileDialog::fileSelected, this, [picker] (const QString & file) {
				if (picker->IsSaving()) {
					CSoundEditor::GetScene()->SaveSceneAs(file.toStdString().c_str());
				}
			});
		}
	}

	// Menu Entry
	{
		QMenu *menu = new QMenu(menuBar);
		menu->setTitle("Scene");
		menuBar->addAction(menu->menuAction());

		// Submenu buttons
		QAction *action = new QAction(MainWindow);
		action->setText("Clear Scene");
		action->setIcon(*QtConfig::GetIcon("denied.png"));
		menu->addAction(action);

		QObject::connect(action, &QAction::triggered, this, []() {
			CSoundEditor::GetScene()->Clear();
			GUI::Get<SceneWindow>(QT_INSTACE::SCENE_EDITOR)->Clear();
		});
	}

	// Menu Entry
	{
		QMenu *menu = new QMenu(menuBar);
		menu->setTitle("Tools");
		menuBar->addAction(menu->menuAction());

		// Submenu buttons
		{
			QAction *action = new QAction(MainWindow);
			action->setText("Reload StyleSheets");
			action->setIcon(*QtConfig::GetIcon("cmyk.png"));
			menu->addAction(action);
			QObject::connect(action, &QAction::triggered, this, &EditorMainWindow::ReloadStyleSheets);
		}

		// Submenu buttons
		{
			QAction *action = new QAction(MainWindow);
			action->setText("Reload CSound Config");
			action->setIcon(*QtConfig::GetIcon("loading.png"));
			menu->addAction(action);
			QObject::connect(action, &QAction::triggered, this, []() {
				SoundManager::Init();
			});
		}
	}

	// Menu Entry
	{
		QMenu *menu = new QMenu(menuBar);
		menu->setTitle("CSound");
		menuBar->addAction(menu->menuAction());

		// Submenu buttons
		QAction *action = new QAction(MainWindow);
		action->setText("Options");
		action->setIcon(*QtConfig::GetIcon("gear.png"));
		menu->addAction(action);

		appWindows["CSoundOptions"] = new CSoundOptionsWindow();

		QObject::connect(action, &QAction::triggered, this, [&]() {
			appWindows["CSoundOptions"]->Toggle();
		});
	}
	// Menu Entry
	{
		QMenu *menu = new QMenu(menuBar);
		menu->setTitle("Help");
		menuBar->addAction(menu->menuAction());

		// Submenu buttons
		QAction *action = new QAction(MainWindow);
		action->setText("About");
		action->setIcon(*QtConfig::GetIcon("chat.png"));
		menu->addAction(action);

		appWindows["About"] = new AboutWindow();

		QObject::connect(action, &QAction::triggered, this, [&]() {
			appWindows["About"]->Toggle();
		});
	}

	// ************************************************************************
	// Toolbar

	QToolBar *toolbar = new QToolBar();
	toolbar->setWindowTitle("Toolbar");

	// Play Audio
	{
		QToolButton *button = new QToolButton();
		button->setText("Play");
		button->setMaximumWidth(80);
		button->setIcon(*QtConfig::GetIcon("play.png"));
		button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
		QObject::connect(button, &QToolButton::clicked, this, []() {
			CSoundEditor::GetScene()->Play();
		});
		toolbar->addWidget(button);
	}

	// Stop Audio
	{
		QToolButton *button = new QToolButton();
		button->setText("Stop");
		button->setMaximumWidth(80);
		button->setIcon(*QtConfig::GetIcon("volume_disabled.png"));
		button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
		QObject::connect(button, &QToolButton::clicked, this, []() {
			CSoundEditor::GetScene()->Stop();
		});
		toolbar->addWidget(button);
	}

	// Save Scene
	{
		QToolButton *button = new QToolButton();
		button->setText("Save Scene");
		button->setIcon(*QtConfig::GetIcon("download.png"));
		button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
		QObject::connect(button, &QToolButton::clicked, this, []() {
			auto result = CSoundEditor::GetScene()->SaveScene();
			if (!result) {
				auto picker = GUI::Get<FilePicker>(QT_INSTACE::FILE_PICKER);
				if (picker) {
					picker->OpenForSave();
				}
			}
		});
		toolbar->addWidget(button);
	}

	// Load Scene
	{
		QToolButton *button = new QToolButton();
		button->setText("Load Scene");
		button->setIcon(*QtConfig::GetIcon("upload.png"));
		button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);

		QObject::connect(picker, &QFileDialog::fileSelected, this, [picker] (const QString & file) {
			if (!picker->IsSaving())
			{
				CSoundEditor::GetScene()->LoadScene(file.toStdString().c_str());
				GUI::Get<SceneWindow>(QT_INSTACE::SCENE_EDITOR)->Init();
			}
		});

		QObject::connect(button, &QToolButton::clicked, this, [picker]() {
			picker->OpenForLoad();
		});
		toolbar->addWidget(button);
	}

	// Headphone Test
	{
		QToolButton *button = new QToolButton();
		button->setText("Headphone Test");
		button->setIcon(*QtConfig::GetIcon("speaker.png"));
		button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);

		appWindows["HeadphoneTest"] = new HeadphoneTestWindow();
		QObject::connect(button, &QToolButton::clicked, this, [this]() {
			appWindows["HeadphoneTest"]->Toggle();
		});

		toolbar->addWidget(button);
	}

	// Moving Plane
	{
		QToolButton *button = new QToolButton();
		button->setText("Moving Plane");
		button->setIcon(*QtConfig::GetIcon("frames.png"));
		button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
		toolbar->addWidget(button);

		appWindows["MovingPlane"] = new MovingPlaneWindow();
		QObject::connect(button, &QToolButton::clicked, this, [this]() {
			appWindows["MovingPlane"]->Toggle();
		});
	}

	// Sweeping Plane
	{
		QToolButton *button = new QToolButton();
		button->setText("Horizontal Sweep");
		button->setIcon(*QtConfig::GetIcon("half-loading.png"));
		button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
		toolbar->addWidget(button);

		appWindows["SweepingPlane"] = new SweepingPlaneWindow();
		QObject::connect(button, &QToolButton::clicked, this, [this]() {
			appWindows["SweepingPlane"]->Toggle();
		});
	}

	// Expanding Sphere
	{
		QToolButton *button = new QToolButton();
		button->setText("Expanding Sphere");
		button->setIcon(*QtConfig::GetIcon("target.png"));
		button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);

		appWindows["ExpandingPlane"] = new ExpandingSphereWindow();
		QObject::connect(button, &QToolButton::clicked, this, [this]() {
			appWindows["ExpandingPlane"]->Toggle();
		});

		toolbar->addWidget(button);
	}

	// Padding Scene
	{
		QWidget *empty = new QWidget();
		empty->setObjectName("ToolWiteSpace");
		toolbar->addWidget(empty);
	}

	// Sound Output Mode
	{
		dropdown = new QComboBox();
		dropdown->setMinimumWidth(60);

		QStyledItemDelegate* itemDelegate = new QStyledItemDelegate();
		dropdown->setItemDelegate(itemDelegate);

		dropdown->addItem("None", QVariant(-1));
		dropdown->addItem("Mono", QVariant(0));
		dropdown->addItem("HRTF2", QVariant(1));
		dropdown->addItem("Stereo", QVariant(2));
		dropdown->addItem("ind-HRTF", QVariant(4));
		dropdown->addItem("PAN2", QVariant(8));
		dropdown->addItem("Quad-HRTF", QVariant(16));
		dropdown->addItem("Multi-8", QVariant(32));
		dropdown->addItem("Quad-Stereo", QVariant(64));

		// Default is HRTF
		dropdown->setCurrentIndex(2);
		SoundManager::SetGlobalOutputModelIndex(1);

		// Add widget
		auto widget = new CustomWidget(QBoxLayout::LeftToRight);
		widget->setObjectName("GlobalOutputDropdown");
		auto label = new QLabel("Global output");
		widget->AddWidget(label);
		widget->AddWidget(dropdown);
		toolbar->addWidget(widget);

		void (QComboBox::* indexChangedSignal)(int index) = &QComboBox::currentIndexChanged;
		QObject::connect(dropdown, indexChangedSignal, this, [&](int index) {
			if (index == 0) {
				SoundManager::SetGlobalOutputModelIndex(1024);
				CSoundEditor::GetScene()->SetOutputModel("none");
				return;
			} else if (SoundManager::GetGlobalOutputModelIndex() == 1024) {
				CSoundEditor::GetScene()->SetOutputModel("global-output");
			}
			auto data = dropdown->currentData().toUInt();
			SoundManager::SetGlobalOutputModelIndex(data);
		});
	}

	// Attach toobar to the main window
	MainWindow->addToolBar(toolbar);

	// ************************************************************************
	// Status Bar

	QStatusBar *statusBar = new QStatusBar(MainWindow);
	statusBar->setObjectName(QStringLiteral("statusBar"));
	MainWindow->setStatusBar(statusBar);

	//QMetaObject::connectSlotsByName(MainWindow);

	// ************************************************************************
	// Central Area

	QWidget *centeralWidget = new QWidget();
	centeralWidget->setFixedWidth(0);
	MainWindow->setCentralWidget(centeralWidget);

	// ************************************************************************
	// Attach windows
	dockWindows["TextPreview"] = new TextPreviewWindow();
	dockWindows["CodeEditor"] = new CodeEditorWindow();
	dockWindows["ComponentList"] = new ComponentList();
	dockWindows["InstrumentList"] = new InstrumentList();
	dockWindows["ScoreList"] = new ScoreList();

	dockWindows["ScoreEditor"] = new ScoreEditor();
	dockWindows["InstrumentEditor"] = new InstrumentEditor();
	dockWindows["ComponentEditor"] = new ComponentEditor();
	
	dockWindows["SceneWindow"] = new SceneWindow();
	dockWindows["GameWindow"] = new GameWindow();

	dockWindows["ObjectProperty"] = new SceneObjectProperties();
	dockWindows["CameraProperty"] = new CameraPropertyEditor();
	dockWindows["CSoundControl"] = new CSoundControlWindow();

	//// Left Dock
	MainWindow->addDockWidget(Qt::DockWidgetArea::LeftDockWidgetArea, dockWindows["SceneWindow"], Qt::Orientation::Vertical);
	MainWindow->addDockWidget(Qt::DockWidgetArea::LeftDockWidgetArea, dockWindows["ScoreEditor"], Qt::Orientation::Horizontal);
	MainWindow->addDockWidget(Qt::DockWidgetArea::LeftDockWidgetArea, dockWindows["InstrumentEditor"], Qt::Orientation::Horizontal);
	MainWindow->addDockWidget(Qt::DockWidgetArea::LeftDockWidgetArea, dockWindows["ComponentEditor"], Qt::Orientation::Vertical);
	MainWindow->tabifyDockWidget(dockWindows["ComponentEditor"], dockWindows["ObjectProperty"]);
	MainWindow->tabifyDockWidget(dockWindows["ComponentEditor"], dockWindows["CameraProperty"]);
	MainWindow->tabifyDockWidget(dockWindows["ComponentEditor"], dockWindows["CSoundControl"]);

	MainWindow->addDockWidget(Qt::DockWidgetArea::LeftDockWidgetArea, dockWindows["TextPreview"], Qt::Orientation::Horizontal);
	MainWindow->tabifyDockWidget(dockWindows["TextPreview"], dockWindows["CodeEditor"]);
	MainWindow->tabifyDockWidget(dockWindows["TextPreview"], dockWindows["GameWindow"]);

	dockWindows["GameWindow"]->setFloating(true);
	dockWindows["GameWindow"]->setFloating(false);
	dockWindows["GameWindow"]->raise();

	// Right Dock
	MainWindow->addDockWidget(Qt::DockWidgetArea::RightDockWidgetArea, dockWindows["ComponentList"], Qt::Orientation::Vertical);
	MainWindow->addDockWidget(Qt::DockWidgetArea::RightDockWidgetArea, dockWindows["InstrumentList"], Qt::Orientation::Vertical);
	MainWindow->addDockWidget(Qt::DockWidgetArea::RightDockWidgetArea, dockWindows["ScoreList"], Qt::Orientation::Vertical);

	// Activate Windows
	dockWindows["ObjectProperty"]->raise();
}
Exemplo n.º 5
0
BitcoinGUI::BitcoinGUI(const NetworkStyle &networkStyle, QWidget *parent) :
    QMainWindow(parent),
    clientModel(0),
    walletFrame(0),
    unitDisplayControl(0),
    labelEncryptionIcon(0),
    labelConnectionsIcon(0),
    labelBlocksIcon(0),
    progressBarLabel(0),
    progressBar(0),
    progressDialog(0),
    appMenuBar(0),
    overviewAction(0),
    historyAction(0),
    quitAction(0),
    sendCoinsAction(0),
    sendCoinsMenuAction(0),
    usedSendingAddressesAction(0),
    usedReceivingAddressesAction(0),
    signMessageAction(0),
    verifyMessageAction(0),
    aboutAction(0),
    receiveCoinsAction(0),
    receiveCoinsMenuAction(0),
    optionsAction(0),
    toggleHideAction(0),
    encryptWalletAction(0),
    backupWalletAction(0),
    changePassphraseAction(0),
    aboutQtAction(0),
    openRPCConsoleAction(0),
    openAction(0),
    showHelpMessageAction(0),
    trayIcon(0),
    trayIconMenu(0),
    notificator(0),
    rpcConsole(0),
    infoQueue(this),
    prevBlocks(0),
    spinnerFrame(0)
{
    GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this);

    QString windowTitle = tr("Bitcoin XT") + " - ";
#ifdef ENABLE_WALLET
    /* if compiled with wallet support, -disablewallet can still disable the wallet */
    enableWallet = !GetBoolArg("-disablewallet", false);
#else
    enableWallet = false;
#endif // ENABLE_WALLET
    if(enableWallet)
    {
        windowTitle += tr("Wallet");
    } else {
        windowTitle += tr("Node");
    }
    windowTitle += " " + networkStyle.getTitleAddText();
#ifndef Q_OS_MAC
    QApplication::setWindowIcon(networkStyle.getTrayAndWindowIcon());
    setWindowIcon(networkStyle.getTrayAndWindowIcon());
#else
    // TODO we convert a QImage to a pixmap, to an icon and in the MacDockIconHandler we
    //   do it in the opposite directoin just go arrive at a QImage again.
    // A mac hacker should fix that so we just pass a QImage (networkStyle::getAppIcon()).
    MacDockIconHandler::instance()->setIcon(networkStyle.getTrayAndWindowIcon());
#endif
    setWindowTitle(windowTitle);

#if defined(Q_OS_MAC) && QT_VERSION < 0x050000
    // This property is not implemented in Qt 5. Setting it has no effect.
    // A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras.
    setUnifiedTitleAndToolBarOnMac(true);
#endif

    rpcConsole = new RPCConsole(0);
#ifdef ENABLE_WALLET
    if(enableWallet)
    {
        /** Create wallet frame and make it the central widget */
        walletFrame = new WalletFrame(this);
        setCentralWidget(walletFrame);
    } else
#endif // ENABLE_WALLET
    {
        /* When compiled without wallet or -disablewallet is provided,
         * the central widget is the rpc console.
         */
        setCentralWidget(rpcConsole);
    }

    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon
    // Needs walletFrame to be initialized
    createActions();

    // Create application menu bar
    createMenuBar();

    // Create the toolbars
    createToolBars();

    // Create system tray icon and notification
    createTrayIcon(networkStyle);

    // Create status bar
    statusBar();

    // Disable size grip because it looks ugly and nobody needs it
    statusBar()->setSizeGripEnabled(false);

    // Status bar notification icons
    QFrame *frameBlocks = new QFrame();
    frameBlocks->setContentsMargins(0,0,0,0);
    frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
    QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
    frameBlocksLayout->setContentsMargins(3,0,3,0);
    frameBlocksLayout->setSpacing(3);
    unitDisplayControl = new UnitDisplayStatusBarControl();
    labelEncryptionIcon = new QLabel();
    labelConnectionsIcon = new QLabel();
    labelBlocksIcon = new QLabel();
    if(enableWallet)
    {
        frameBlocksLayout->addStretch();
        frameBlocksLayout->addWidget(unitDisplayControl);
        frameBlocksLayout->addStretch();
        frameBlocksLayout->addWidget(labelEncryptionIcon);
    }
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelConnectionsIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelBlocksIcon);
    frameBlocksLayout->addStretch();

    // Progress bar and label for blocks download
    progressBarLabel = new QLabel();
    progressBarLabel->setVisible(false);
    progressBar = new GUIUtil::ProgressBar();
    progressBar->setAlignment(Qt::AlignCenter);
    progressBar->setVisible(false);

    // Override style sheet for progress bar for styles that have a segmented progress bar,
    // as they make the text unreadable (workaround for issue #1071)
    // See https://qt-project.org/doc/qt-4.8/gallery.html
    QString curStyle = QApplication::style()->metaObject()->className();
    if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
    {
        progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }");
    }

    statusBar()->addWidget(progressBarLabel);
    statusBar()->addWidget(progressBar);
    statusBar()->addPermanentWidget(frameBlocks);

    // prevents an open debug window from becoming stuck/unusable on client shutdown
    connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide()));
    // ditto for the notification dialog
    connect(quitAction, SIGNAL(triggered()), &infoQueue, SLOT(hideDialog()));

    // Install event filter to be able to catch status tip events (QEvent::StatusTip)
    this->installEventFilter(this);

    // Initially wallet actions should be disabled
    setWalletActionsEnabled(false);

    // Subscribe to notifications from core
    subscribeToCoreSignals();
}
Exemplo n.º 6
0
PythonEditorWidget::PythonEditorWidget(InviwoMainWindow* ivwwin, InviwoApplication* app)
    : InviwoDockWidget(tr("Python Editor"), ivwwin)
    , settings_("Inviwo", "Inviwo")
    , infoTextColor_(153, 153, 153)
    , errorTextColor_(255, 107, 107)
    , runAction_(nullptr)
    , script_()
    , unsavedChanges_(false)
    , app_(app)
    , appendLog_(true)
{

    setObjectName("PythonEditor");
    settings_.beginGroup("PythonEditor");
    QString lastFile = settings_.value("lastScript", "").toString();
    appendLog_ = settings_.value("appendLog", appendLog_).toBool();
    settings_.endGroup();
    setVisible(false);
    setWindowIcon(QIcon(":/icons/python.png"));

    QMainWindow* mainWindow = new QMainWindow();
    mainWindow->setContextMenuPolicy(Qt::NoContextMenu);
    QToolBar* toolBar = new QToolBar();
    mainWindow->addToolBar(toolBar);
    toolBar->setFloatable(false);
    toolBar->setMovable(false);
    setWidget(mainWindow);

    {
        runAction_ = toolBar->addAction(QIcon(":/icons/python.png"), "Compile and Run");
        runAction_->setShortcut(QKeySequence(tr("F5")));
        runAction_->setShortcutContext(Qt::WidgetWithChildrenShortcut);
        runAction_->setToolTip("Compile and Run Script");
        mainWindow->addAction(runAction_);
        connect(runAction_, &QAction::triggered, [this]() {run(); });
    }
    {
        auto action = toolBar->addAction(QIcon(":/icons/new.png"), tr("&New Script"));
        action->setShortcut(QKeySequence::New);
        action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
        action->setToolTip("New Script");
        mainWindow->addAction(action);
        connect(action, &QAction::triggered, [this](){setDefaultText();});
    }
    {
        auto action = toolBar->addAction(QIcon(":/icons/open.png"), tr("&Open Script"));
        action->setShortcut(QKeySequence::Open);
        action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
        action->setToolTip("Open Script");
        mainWindow->addAction(action);
        connect(action, &QAction::triggered, [this](){open();});
    }

    {
        auto action = toolBar->addAction(QIcon(":/icons/save.png"), tr("&Save Script"));
        action->setShortcut(QKeySequence::Save);
        action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
        action->setToolTip("Save Script");
        mainWindow->addAction(action);
        connect(action, &QAction::triggered, [this](){save();});
    }
    {
        auto action = toolBar->addAction(QIcon(":/icons/saveas.png"), tr("&Save Script As..."));
        action->setShortcut(QKeySequence::SaveAs);
        action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
        action->setToolTip("Save Script As...");
        mainWindow->addAction(action);
        connect(action, &QAction::triggered, [this](){saveAs();});
    }
    {
        QIcon icon;
        icon.addFile(":/icons/log-append.png", QSize(), QIcon::Normal, QIcon::On);
        icon.addFile(":/icons/log-clearonrun.png", QSize(), QIcon::Normal, QIcon::Off);

        QString str = (appendLog_ ? "Append Log" : "Clear Log on Run");
        auto action = toolBar->addAction(icon, str);
        action->setShortcut(Qt::ControlModifier + Qt::Key_E);
        action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
        action->setCheckable(true);
        action->setChecked(appendLog_);
        action->setToolTip(appendLog_ ? "Append Log" : "Clear Log on Run");
        mainWindow->addAction(action);
        connect(action, &QAction::toggled, [this, action](bool toggle) { 
            appendLog_ = toggle; 
            // update tooltip and menu entry
            QString tglstr = (toggle ? "Append Log" : "Clear Log on Run");
            action->setText(tglstr);
            action->setToolTip(tglstr);
            // update settings
            settings_.beginGroup("PythonEditor");
            settings_.setValue("appendLog", appendLog_);
            settings_.endGroup();
        });
    }
    {
        auto action = toolBar->addAction(QIcon(":/icons/log-clear.png"), "Clear Log Output");
        action->setShortcut(Qt::ControlModifier + Qt::Key_E);
        action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
        action->setToolTip("Clear Log Output");
        mainWindow->addAction(action);
        connect(action, &QAction::triggered, [this](){clearOutput();});
    }

    // Done creating buttons
    QSplitter* splitter = new QSplitter(nullptr);
    splitter->setOrientation(Qt::Vertical);
    pythonCode_ = new PythonTextEditor(nullptr);
    pythonCode_->setObjectName("pythonEditor");
    pythonCode_->setUndoRedoEnabled(true);
    setDefaultText();
    pythonOutput_ = new QTextEdit(nullptr);
    pythonOutput_->setObjectName("pythonConsole");
    pythonOutput_->setReadOnly(true);
    pythonOutput_->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    syntaxHighligther_ =
        SyntaxHighligther::createSyntaxHighligther<Python>(pythonCode_->document());

    splitter->addWidget(pythonCode_);
    splitter->addWidget(pythonOutput_);
    splitter->setStretchFactor(0, 1);
    splitter->setStretchFactor(1, 0);
    splitter->setHandleWidth(2);
    // enable QSplitter:hover stylesheet
    // QTBUG-13768 https://bugreports.qt.io/browse/QTBUG-13768
    splitter->handle(1)->setAttribute(Qt::WA_Hover);
    mainWindow->setCentralWidget(splitter);

    QObject::connect(pythonCode_, SIGNAL(textChanged()), this, SLOT(onTextChange()));
    // close this window before the main window is closed
    QObject::connect(ivwwin, &InviwoMainWindow::closingMainWindow, [this]() { delete this; });

    this->updateStyle();

    
    this->resize(500, 700);

    if (app_) {
        app_->getSettingsByType<SystemSettings>()->pythonSyntax_.onChange(
            this, &PythonEditorWidget::updateStyle);
        app_->getSettingsByType<SystemSettings>()->pyFontSize_.onChange(
            this, &PythonEditorWidget::updateStyle);
        app_->registerFileObserver(this);
    }
    unsavedChanges_ = false;

    if (lastFile.size() != 0) loadFile(lastFile.toLocal8Bit().constData(), false);

    setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
    setFloating(true);
}
Exemplo n.º 7
0
StelMainView::StelMainView(QWidget* parent)
	: QGraphicsView(parent), guiItem(NULL), gui(NULL),
	  flagInvertScreenShotColors(false),
	  flagOverwriteScreenshots(false),
	  screenShotPrefix("stellarium-"),
	  screenShotDir(""),
	  cursorTimeout(-1.f), flagCursorTimeout(false), minFpsTimer(NULL), maxfps(10000.f)
{
	StelApp::initStatic();
	
	// Can't create 2 StelMainView instances
	Q_ASSERT(!singleton);
	singleton = this;

	setWindowIcon(QIcon(":/mainWindow/icon.bmp"));
	initTitleI18n();
	setObjectName("Mainview");

	// Allows for precise FPS control
	setViewportUpdateMode(QGraphicsView::NoViewportUpdate);
	setFrameShape(QFrame::NoFrame);
	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	setFocusPolicy(Qt::StrongFocus);
	connect(this, SIGNAL(screenshotRequested()), this, SLOT(doScreenshot()));

	lastEventTimeSec = 0;


#if STEL_USE_NEW_OPENGL_WIDGETS
	// Primary test for OpenGL existence
	if (QSurfaceFormat::defaultFormat().majorVersion() < 2)
	{
		qWarning() << "No OpenGL 2 support on this system. Aborting.";
		QMessageBox::critical(0, "Stellarium", q_("No OpenGL 2 found on this system. Please upgrade hardware or use MESA or an older version."), QMessageBox::Abort, QMessageBox::Abort);
		exit(0);
	}

	//QSurfaceFormat format();
	//// TBD: What options shall be default?
	//QSurfaceFormat::setDefaultFormat(format);
	////QOpenGLContext* context=new QOpenGLContext::create();
	glWidget = new StelQOpenGLWidget(this);
	//glWidget->setFormat(format);
#else
	// Primary test for OpenGL existence
	if (QGLFormat::openGLVersionFlags() < QGLFormat::OpenGL_Version_2_1)
	{
		qWarning() << "No OpenGL 2.1 support on this system. Aborting.";
		QMessageBox::critical(0, "Stellarium", q_("No OpenGL 2 found on this system. Please upgrade hardware or use MESA or an older version."), QMessageBox::Abort, QMessageBox::Abort);
		exit(1);
	}

	// Create an openGL viewport
	QGLFormat glFormat(QGL::StencilBuffer | QGL::DepthBuffer | QGL::DoubleBuffer);
	// Even if setting a version here, it is ignored in StelQGLWidget()!
	// TBD: Maybe this must make a differentiation between OpenGL and OpenGL ES!
	// glFormat.setVersion(2, 1);
	QGLContext* context=new QGLContext(glFormat);

	if (context->format() != glFormat)
	{
		qWarning() << "Cannot provide OpenGL context. Apparently insufficient OpenGL resources on this system.";
		QMessageBox::critical(0, "Stellarium", q_("Cannot acquire necessary OpenGL resources."), QMessageBox::Abort, QMessageBox::Abort);
		exit(1);
	}
	glWidget = new StelQGLWidget(context, this);
	// This does not return the version number set previously!
	// qDebug() << "glWidget.context.format.version, result:" << glWidget->context()->format().majorVersion() << "." << glWidget->context()->format().minorVersion();
#endif

	setViewport(glWidget);

	setScene(new QGraphicsScene(this));
	scene()->setItemIndexMethod(QGraphicsScene::NoIndex);
	rootItem = new QGraphicsWidget();
	rootItem->setFocusPolicy(Qt::NoFocus);

	// Workaround (see Bug #940638) Although we have already explicitly set
	// LC_NUMERIC to "C" in main.cpp there seems to be a bug in OpenGL where
	// it will silently reset LC_NUMERIC to the value of LC_ALL during OpenGL
	// initialization. This has been observed on Ubuntu 11.10 under certain
	// circumstances, so here we set it again just to be on the safe side.
	setlocale(LC_NUMERIC, "C");
	// End workaround
}
Exemplo n.º 8
0
VpnWizard::VpnWizard(QWidget * parent)
    : FramelessWizard(parent)
{
    addPage(new CStartPage);
    addPage(new GeneralPage);
    addPage(new RemotePage);
    addPage(new CertPage);
    addPage(new AdvPage);
    addPage(new CEndPage);

    
    //this->button(QWizard::WizardButton::BackButton)->setIcon(QIcon(":/data/images/back_small.png"));
    //this->button(QWizard::WizardButton::NextButton)->setIcon(QIcon(":/data/images/next_small.png"));
    

    auto geom = this->geometry();
    geom.setHeight(460);
    geom.setWidth(501);

	QSize size = geom.size();
	//
	int h = size.height();
	int w = size.width();
	//

	size.setHeight(qFloor(h * windowsDpiScale()));
	size.setWidth(qFloor(w * windowsDpiScale()));

	setFixedWidth(size.width());
	setFixedHeight(size.height());

	//
    resize(size);
    
    QPixmap pixmap(":/data/images/banner_wiz.png");
    pixmap = pixmap.scaledToWidth(size.width(), Qt::TransformationMode::SmoothTransformation);
    setPixmap(QWizard::BannerPixmap, pixmap);
    //page(0)->setContentsMargins(0, 20, 0, 0);
    //page(1)->setContentsMargins(0, 20, 0, 0);
    //page(2)->setContentsMargins(0, 20, 0, 0);
    //page(3)->setContentsMargins(0, 20, 0, 0);
    //page(4)->setContentsMargins(0, 20, 0, 0);
    setWindowIcon(QIcon(":/data/images/logo.png"));
    setWindowTitle(QObject::tr("Create a new SSL VPN connection"));
    setWindowFlags(Qt::WindowCloseButtonHint);
    setModal(true);
    this->setWindowFlags(Qt::WindowCloseButtonHint | Qt::FramelessWindowHint);
    DWORD style = GetWindowLong((HWND)winId(), GWL_STYLE);
    SetWindowLong((HWND)winId(), GWL_STYLE, style);
    setWizardStyle(ModernStyle);
    


    //this->button(QWizard::WizardButton::NextButton)->setLayoutDirection(Qt::RightToLeft);
    this->setButtonText(QWizard::WizardButton::NextButton, QObject::tr("Next"));
    this->setButtonText(QWizard::WizardButton::BackButton, QObject::tr("Back"));
    this->setButtonText(QWizard::WizardButton::CancelButton, QObject::tr("Cancel"));
    this->setButtonText(QWizard::WizardButton::FinishButton, QObject::tr("Finish"));

    setStyleSheet("QPushButton:hover {background-color: rgb(195, 195, 195);}\nQPushButton {;text-align:center;	\npadding-left: 3px;\n	padding-top: 3px;   padding-right: 3px;\n	padding-bottom: 3px;}");

    this->setupFrameless();
}
Exemplo n.º 9
0
BitcoinGUI::BitcoinGUI(QWidget *parent):
    QMainWindow(parent),
    clientModel(0),
    walletModel(0),
    encryptWalletAction(0),
    changePassphraseAction(0),
    unlockWalletAction(0),
    lockWalletAction(0),
    aboutQtAction(0),
    trayIcon(0),
    notificator(0),
    rpcConsole(0),
    nWeight(0)
{
    setFixedSize(970, 550);
	QFontDatabase::addApplicationFont(":/fonts/Bebas");
    setWindowTitle(tr("Pentacoin") + " - " + tr("Wallet"));
	qApp->setStyleSheet("QMainWindow { background-image:url(:images/bkg);border:none; } #frame { } QToolBar QLabel { padding-top: 0px;padding-bottom: 0px;spacing: 10px;} QToolBar QLabel:item { padding-top: 0px;padding-bottom: 0px;spacing: 10px;} #spacer { background: transparent;border:none; } #toolbar2 { border:none;width:0px;hight:0px;padding-top:40px;padding-bottom:0px; background-color: transparent; } #labelMiningIcon { padding-left:5px;font-family:Century Gothic;width:100%;font-size:10px;text-align:center;color:black; } QMenu { background-color: qlineargradient(spread:pad, x1:0.511, y1:1, x2:0.482909, y2:0, stop:0 rgba(232,232,232), stop:1 rgba(232,232,232)); color: black; padding-bottom:10px; } QMenu::item { color: black; background: transparent; } QMenu::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgba(99,99,99,45), stop: 1 rgba(99,99,99,45)); } QMenuBar { background-color: white; color: white; } QMenuBar::item { font-size:12px;padding-bottom:3px;padding-top:3px;padding-left:15px;padding-right:15px;color: black; background-color: white; } QMenuBar::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgba(99,99,99,45), stop: 1 rgba(99,99,99,45)); }");
#ifndef Q_OS_MAC
    qApp->setWindowIcon(QIcon(":icons/bitcoin"));
    setWindowIcon(QIcon(":icons/bitcoin"));
#else
    setUnifiedTitleAndToolBarOnMac(true);
    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon
    createActions();

    // Create application menu bar
    createMenuBar();

    // Create the toolbars
    createToolBars();

    // Create the tray icon (or setup the dock icon)
    createTrayIcon();

    // Create tabs
    overviewPage = new OverviewPage();

    transactionsPage = new QWidget(this);
    QVBoxLayout *vbox = new QVBoxLayout();
    transactionView = new TransactionView(this);
    vbox->addWidget(transactionView);
    transactionsPage->setLayout(vbox);

    addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);

    receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);

    sendCoinsPage = new SendCoinsDialog(this);

    signVerifyMessageDialog = new SignVerifyMessageDialog(this);
    masternodeManagerPage = new MasternodeManager(this);

    centralWidget = new QStackedWidget(this);
    centralWidget->addWidget(overviewPage);
    centralWidget->addWidget(transactionsPage);
    centralWidget->addWidget(addressBookPage);
    centralWidget->addWidget(receiveCoinsPage);
    centralWidget->addWidget(sendCoinsPage);
    centralWidget->addWidget(masternodeManagerPage);
    setCentralWidget(centralWidget);

    // Create status bar
    statusBar();

    // Status bar notification icons
    QFrame *frameBlocks = new QFrame();
    frameBlocks->setContentsMargins(0,0,0,0);
    frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
    QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
    frameBlocksLayout->setContentsMargins(3,0,3,0);
    frameBlocksLayout->setSpacing(3);
    labelEncryptionIcon = new QLabel();
    labelStakingIcon = new QLabel();
    labelConnectionsIcon = new QLabel();
    labelBlocksIcon = new QLabel();
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelEncryptionIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelStakingIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelConnectionsIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelBlocksIcon);
    frameBlocksLayout->addStretch();

    if (GetBoolArg("-staking", true))
    {
        QTimer *timerStakingIcon = new QTimer(labelStakingIcon);
        connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon()));
        timerStakingIcon->start(30 * 1000);
        updateStakingIcon();
    }

    // Progress bar and label for blocks download
    progressBarLabel = new QLabel();
    progressBarLabel->setVisible(false);
    progressBar = new QProgressBar();
    addToolBarBreak(Qt::LeftToolBarArea);
    QToolBar *toolbar2 = addToolBar(tr("Tabs toolbar"));
    addToolBar(Qt::LeftToolBarArea,toolbar2);
    toolbar2->setOrientation(Qt::Vertical);
    toolbar2->setMovable( false );
    toolbar2->setObjectName("toolbar2");
    toolbar2->setFixedWidth(28);
    toolbar2->setIconSize(QSize(28,54));
	toolbar2->addWidget(labelEncryptionIcon);
	toolbar2->addWidget(labelStakingIcon);
    toolbar2->addWidget(labelConnectionsIcon);
    toolbar2->addWidget(labelBlocksIcon);
	toolbar2->setStyleSheet("#toolbar2 QToolButton { background: transparent;border:none;padding:0px;margin:0px;height:54px;width:28px; }");
	
    syncIconMovie = new QMovie(":/movies/update_spinner", "gif", this);

    // Clicking on a transaction on the overview page simply sends you to transaction history page
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));

    // Double-clicking on a transaction on the transaction history page shows details
    connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));

    rpcConsole = new RPCConsole(this);
    connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));

    // Clicking on "Verify Message" in the address book sends you to the verify message tab
    connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
    // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab
    connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));

    gotoOverviewPage();
}
Exemplo n.º 10
0
SearchDialog::SearchDialog(QWidget *parent): QDialog(parent)
{
    // Title
    setWindowTitle(tr("Search and replace"));
    setWindowIcon(QIcon(QString(ICON_PATH) + "/search.png"));

    // Layout
    QVBoxLayout *vlayout = new QVBoxLayout();
    setLayout(vlayout);

    // Search
    QGroupBox *searchGroup = new QGroupBox(this);
    searchGroup->setTitle(tr("Search"));
    vlayout->addWidget(searchGroup);

    QVBoxLayout *searchLayout = new QVBoxLayout();
    searchGroup->setLayout(searchLayout);

    QLabel *searchLabel = new QLabel(searchGroup);
    searchLabel->setText(tr("Search"));
    searchLayout->addWidget(searchLabel);

    search = new QLineEdit(searchGroup);
    searchLayout->addWidget(search);

    searchRegExp = new QCheckBox(searchGroup);
    searchRegExp->setText(tr("Regular expression"));
    searchLayout->addWidget(searchRegExp);
    //searchRegExp->hide();

    // Replace
    QGroupBox *replaceGroup = new QGroupBox(this);
    replaceGroup->setTitle(tr("Replace"));
    vlayout->addWidget(replaceGroup);

    QVBoxLayout *replaceLayout = new QVBoxLayout();
    replaceGroup->setLayout(replaceLayout);

    QLabel *replaceLabel = new QLabel(replaceGroup);
    replaceLabel->setText(tr("Replace"));
    replaceLayout->addWidget(replaceLabel);

    replace = new QLineEdit(replaceGroup);
    replaceLayout->addWidget(replace);

    // Options
    QGroupBox *optionsGroup = new QGroupBox(this);
    optionsGroup->setTitle(tr("Options"));
    vlayout->addWidget(optionsGroup);

    QHBoxLayout *optionsLayout = new QHBoxLayout();
    optionsGroup->setLayout(optionsLayout);

    QVBoxLayout *optionsV1Layout = new QVBoxLayout();
    optionsLayout->addLayout(optionsV1Layout);

    QVBoxLayout *optionsV2Layout = new QVBoxLayout();
    optionsLayout->addLayout(optionsV2Layout);

    caseSensitiveCB = new QCheckBox(optionsGroup);
    caseSensitiveCB->setText(tr("Case sensitive"));
    optionsV1Layout->addWidget(caseSensitiveCB);

    wholeWordsCB = new QCheckBox(optionsGroup);
    wholeWordsCB->setText(tr("Only full words"));
    optionsV1Layout->addWidget(wholeWordsCB);

    fromCursorCB = new QCheckBox(optionsGroup);
    fromCursorCB->setText(tr("From cursor"));
    optionsV2Layout->addWidget(fromCursorCB);

    // Buttons
    QHBoxLayout *buttonsLayout = new QHBoxLayout();
    vlayout->addLayout(buttonsLayout);

    QPushButton *acceptButton = new QPushButton(this);
    acceptButton->setText(tr("Search"));
    buttonsLayout->addWidget(acceptButton);
    connect(acceptButton, SIGNAL(clicked()), this, SIGNAL(search_signal()));

    QPushButton *replaceButton = new QPushButton(this);
    replaceButton->setText(tr("Replace"));
    buttonsLayout->addWidget(replaceButton);
    connect(replaceButton, SIGNAL(clicked()), this, SIGNAL(replace_signal()));

    QPushButton *cancelButton = new QPushButton(this);
    cancelButton->setText(tr("Cancel"));
    buttonsLayout->addWidget(cancelButton);
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(accept()));
}
Exemplo n.º 11
0
BitcoinGUI::BitcoinGUI(QWidget *parent):
    QMainWindow(parent),
    clientModel(0),
    walletModel(0),
    toolbar(0),
    encryptWalletAction(0),
    changePassphraseAction(0),
    unlockWalletAction(0),
    lockWalletAction(0),
    aboutQtAction(0),
    trayIcon(0),
    notificator(0),
    rpcConsole(0),
    prevBlocks(0),
    nWeight(0)
{
    resize(970, 550); 
    setWindowTitle(tr("SatoshiChain") + " - " + tr("Wallet"));
    qApp->setStyleSheet("QMainWindow { background-image: url(:images/bkg);border:none;font-family:'Open Sans,sans-serif'; } #frame { } QToolBar QLabel { padding-top: 0px;padding-bottom: 0px;spacing: 10px;} QToolBar QLabel:item { padding-top: 0px;padding-bottom: 0px;spacing: 10px;} #spacer { background:rgb(200,200,200);border:none; } #toolbar2 { border:none;width:0px;hight:0px;padding-top:0px;padding-bottom:0px; background: rgb(104,104,104); } #toolbar { border:1px;height:100%;padding-top:20px; background: rgb(200,200,200); text-align: left; color: black;min-width:150px;max-width:150px;} QToolBar QToolButton:hover {background-color:qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,stop: 0 rgb(200,200,200), stop: 1 rgb(104,104,104),stop: 2 rgb(104,104,104));}"
#ifdef Q_OS_MAC
"QToolBar QToolButton { font-family:sans-serif;font-size:12px;padding-left:20px;padding-right:45px;padding-top:5px;padding-bottom:5px; width:100%; color: rgb(104,104,104); text-align: left; background-color: rgb(200,200,200);  }"
#else
"QToolBar QToolButton { font-family:sans-serif;font-size:12px;padding-left:20px;padding-right:150px;padding-top:5px;padding-bottom:5px; width:100%; color: rgb(104,104,104); text-align: left; background-color: rgb(200,200,200);  }"
#endif
"#labelMiningIcon { padding-left:5px;font-family:sans-serif;width:100%;font-size:10px;text-align:center;color:black; } QMenu { background: rgb(200,200,200); color:black; padding-bottom:10px; } QMenu::item { color:black; background-color: transparent; } QMenu::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(200,200,200), stop: 1 rgb(200,200,200)); } QMenuBar { background: rgb(200,200,200); color:black; } QMenuBar::item { font-size:12px;padding-bottom:6px;padding-top:6px;padding-left:15px;padding-right:15px;color:black; background-color: transparent; } QMenuBar::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(200,200,200), stop: 1 rgb(200,200,200)); }");
#ifndef Q_OS_MAC
    qApp->setWindowIcon(QIcon(":icons/bitcoin"));
    setWindowIcon(QIcon(":icons/bitcoin"));
#else
    setUnifiedTitleAndToolBarOnMac(true);
    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon
    createActions();

    // Create application menu bar
    createMenuBar();

    // Create the toolbars
    createToolBars();

    // Create the tray icon (or setup the dock icon)
    createTrayIcon();

    // Create tabs
    overviewPage = new OverviewPage();

    //transactionsPage = new QWidget(this);
    //QVBoxLayout *vbox = new QVBoxLayout();
    //transactionView = new TransactionView(this);
    //vbox->addWidget(transactionView);
    //transactionsPage->setLayout(vbox);

    //addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);

    //receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);

    //sendCoinsPage = new SendCoinsDialog(this);

    signVerifyMessageDialog = new SignVerifyMessageDialog(this);

    centralStackedWidget = new QStackedWidget(this);
    centralStackedWidget->addWidget(overviewPage);
    //centralStackedWidget->addWidget(transactionsPage);
    //centralStackedWidget->addWidget(addressBookPage);
    //centralStackedWidget->addWidget(receiveCoinsPage);
    //centralStackedWidget->addWidget(sendCoinsPage);

    QWidget *centralWidget = new QWidget();
    QVBoxLayout *centralLayout = new QVBoxLayout(centralWidget);
#ifndef Q_OS_MAC
    centralLayout->addWidget(appMenuBar);
#endif
    centralLayout->addWidget(centralStackedWidget);

    setCentralWidget(centralWidget);

    // Status bar notification icons

    labelEncryptionIcon = new QLabel();
    labelStakingIcon = new QLabel();
    labelConnectionsIcon = new QLabel();
    labelBlocksIcon = new QLabel();
    //actionConvertIcon = new QAction(QIcon(":/icons/statistics"), tr(""), this);

    if (GetBoolArg("-staking", true))
    {
        QTimer *timerStakingIcon = new QTimer(labelStakingIcon);
        connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon()));
        timerStakingIcon->start(30 * 1000);
        updateStakingIcon();
    }

	// Progress bar and label for blocks download
    progressBarLabel = new QLabel();
    progressBarLabel->setVisible(false);
    progressBar = new QProgressBar();
    addToolBarBreak(Qt::LeftToolBarArea);
    QToolBar *toolbar2 = addToolBar(tr("Tabs toolbar"));
    addToolBar(Qt::LeftToolBarArea,toolbar2);
    toolbar2->setOrientation(Qt::Vertical);
    toolbar2->setMovable( false );
    toolbar2->setObjectName("toolbar2");
    toolbar2->setFixedWidth(28);
    toolbar2->setIconSize(QSize(28,28));
	//toolbar2->addAction(actionConvertIcon);
    toolbar2->addWidget(labelEncryptionIcon);
    toolbar2->addWidget(labelStakingIcon);
    toolbar2->addWidget(labelConnectionsIcon);
    toolbar2->addWidget(labelBlocksIcon);
    	
	syncIconMovie = new QMovie(":/movies/update_spinner", "gif", this);

    // Clicking on a transaction on the overview page simply sends you to transaction history page
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));
    //connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));

    // Double-clicking on a transaction on the transaction history page shows details
    //connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));

    rpcConsole = new RPCConsole(this);
    connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));
    // prevents an oben debug window from becoming stuck/unusable on client shutdown
    connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide()));

    // Clicking on "Verify Message" in the address book sends you to the verify message tab
    //connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
    // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab
    //connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));

    gotoOverviewPage();
}
Exemplo n.º 12
0
KiloWindow::KiloWindow(QWidget *parent): QWidget(parent), device(0), sending(false), connected(false) {
    // Create status bar
    status = new QStatusBar();
    status->showMessage("disconnected.");
    status->setSizeGripEnabled(false);

    // Create status bar button
    connect_button = new QToolButton(status);
    status->addPermanentWidget(connect_button);
    connect_button->setText("Connect");
    connect(connect_button, SIGNAL(clicked()), this, SLOT(toggleConnection()));

    // Create serial input window and its trigger button
    serial_button = new QPushButton("Serial Input");
    serial = new SerialWindow("Serial Input", this);
    QObject::connect(serial_button, SIGNAL(clicked()), this, SLOT(serialShow()));

    // Create calibration window and its trigger button
    calib_button = new QPushButton("Calibration");
    calib = new CalibWindow("Calibration Values", this);
    QObject::connect(calib_button, SIGNAL(clicked()), this, SLOT(calibShow()));

    connect(calib, SIGNAL(calibUID(int)), this, SLOT(calibUID(int)));
    connect(calib, SIGNAL(calibLeft(int)), this, SLOT(calibLeft(int)));
    connect(calib, SIGNAL(calibRight(int)), this, SLOT(calibRight(int)));
    connect(calib, SIGNAL(calibStraight(int)), this, SLOT(calibStraight(int)));
    connect(calib, SIGNAL(calibStop()), this, SLOT(calibStop()));
    connect(calib, SIGNAL(calibSave()), this, SLOT(calibSave()));

    QVBoxLayout *vbox = new QVBoxLayout;
    vbox->addWidget(createDeviceSelect());
    vbox->addWidget(createFileInput());
    vbox->addWidget(createCommands());
    vbox->addWidget(serial_button);
    vbox->addWidget(calib_button);
    vbox->addWidget(status);

    setLayout(vbox);
    setWindowTitle("Kilobots Toolkit");
    setWindowIcon(QIcon(":/images/kilogui.png"));
    setWindowState(Qt::WindowActive);


    vusb_conn = new VUSBConnection();
    ftdi_conn = new FTDIConnection();
    serial_conn = new SerialConnection();
    connect(ftdi_conn, SIGNAL(readText(QString)), serial, SLOT(addText(QString)));
    connect(serial_conn, SIGNAL(readText(QString)), serial, SLOT(addText(QString)));

    connect(vusb_conn, SIGNAL(error(QString)), this, SLOT(showError(QString)));
    connect(vusb_conn, SIGNAL(status(QString)), this, SLOT(vusbUpdateStatus(QString)));
    connect(ftdi_conn, SIGNAL(error(QString)), this, SLOT(showError(QString)));
    connect(ftdi_conn, SIGNAL(status(QString)), this, SLOT(ftdiUpdateStatus(QString)));
    connect(serial_conn, SIGNAL(error(QString)), this, SLOT(showError(QString)));
    connect(serial_conn, SIGNAL(status(QString)), this, SLOT(serialUpdateStatus(QString)));

    // Create thread
    QThread *thread = new QThread();
    connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));

    // Move connections to thread
    vusb_conn->moveToThread(thread);
    ftdi_conn->moveToThread(thread);
    serial_conn->moveToThread(thread);

    // Start thread and open connections
    thread->start();
    vusb_conn->open();
    ftdi_conn->open();
    serial_conn->open();
}
Exemplo n.º 13
0
MainWindow::MainWindow(int argc, char** argv, QWidget *parent)
	: QMainWindow(parent)
    , qnode(argc,argv)
    ,timer()
    ,scene()
    //, gps(argc,argv)
{
	ui.setupUi(this); // Calling this incidentally connects all ui's triggers to on_...() callbacks in this class.
    QObject::connect(ui.actionAbout_Qt, SIGNAL(triggered(bool)), qApp, SLOT(aboutQt())); // qApp is a global variable for the application

    ReadSettings();
	setWindowIcon(QIcon(":/images/icon.png"));
	ui.tab_manager->setCurrentIndex(0); // ensure the first tab is showing - qt-designer should have this already hardwired, but often loses it (settings?).
    QObject::connect(&qnode, SIGNAL(rosShutdown()), this, SLOT(close()));
    //QObject::connect(&gps, SIGNAL(rosShutdown()), this, SLOT(close()));
	/*********************
	** Logging
	**********************/
	ui.view_logging->setModel(qnode.loggingModel());
    QObject::connect(&qnode, SIGNAL(loggingUpdated()), this, SLOT(updateLoggingView()));

    //Mesaj detayları
    //QImuMesajEditGrup egrup;


     ui.viewFrontCamera->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
     ui.viewFrontCamera->setScaledContents(true);

     ui.viewPTZCamera->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
     ui.viewPTZCamera->setScaledContents(true);


    QObject::connect(&qnode,SIGNAL(imuSignal_accelX(QString)),ui.lineAccelX,SLOT(setText(QString)));

    QObject::connect(&qnode,SIGNAL(imuSignal_accelY(QString)),ui.lineAccelY,SLOT(setText(QString)));
    QObject::connect(&qnode,SIGNAL(imuSignal_accelZ(QString)),ui.lineAccelZ,SLOT(setText(QString)));

    QObject::connect(&qnode,SIGNAL(imuSignal_gyroX(QString)),ui.lineGyroX,SLOT(setText(QString)));
    QObject::connect(&qnode,SIGNAL(imuSignal_gyroY(QString)),ui.lineGyroY,SLOT(setText(QString)));
    QObject::connect(&qnode,SIGNAL(imuSignal_gyroZ(QString)),ui.lineGyroZ,SLOT(setText(QString)));
    QObject::connect(&qnode,SIGNAL(imuSignal_magnetomX(QString)),ui.lineMagnetomX,SLOT(setText(QString)));
    QObject::connect(&qnode,SIGNAL(imuSignal_magnetomY(QString)),ui.lineMagnetomY,SLOT(setText(QString)));
    QObject::connect(&qnode,SIGNAL(imuSignal_magnetomZ(QString)),ui.lineMagnetomZ,SLOT(setText(QString)));
    QObject::connect(&qnode,SIGNAL(imuSignal_raw(QString)),ui.lineIMURaw,SLOT(setText(QString)));


    QObject::connect(&qnode,SIGNAL(gpsSignal_raw(QString)),ui.lineGPSRaw,SLOT(setText(QString)));
    QObject::connect(&qnode,SIGNAL(gpsSignal_latitude(QString)),ui.lineLatitude,SLOT(setText(QString)));
    QObject::connect(&qnode,SIGNAL(gpsSignal_longtitude(QString)),ui.lineLongtitude,SLOT(setText(QString)));
    QObject::connect(&qnode,SIGNAL(gpsSignal_cog(QString)),ui.lineGPSCOG,SLOT(setText(QString)));
    QObject::connect(&qnode,SIGNAL(gpsSignal_vog(QString)),ui.lineGPSVOG,SLOT(setText(QString)));
    QObject::connect(&qnode,SIGNAL(gpsSignal_quality(QString)),ui.lineGPSQuality,SLOT(setText(QString)));
    qRegisterMetaType<sensor_msgs::LaserScan>("sensor_msgs::LaserScan");
    QObject::connect(&qnode,SIGNAL(scanSignal(const sensor_msgs::LaserScan)),this,SLOT(updateScan(sensor_msgs::LaserScan)));


    qRegisterMetaType<cv::Mat>("cv::Mat");
    QObject::connect(&qnode,SIGNAL(frontCamera_signal(cv::Mat)),this,SLOT(getFrontCameraImage(cv::Mat)));
    QObject::connect(&qnode,SIGNAL(ptzCamera_signal(cv::Mat)),this,SLOT(getPTZCameraImage(cv::Mat)));

     qRegisterMetaType<axis_camera::Axis>("axis_camera::Axis");
     QObject::connect(&qnode,SIGNAL(ptzStatus_signal(axis_camera::Axis)),this,SLOT(getPTZCameraStatus(axis_camera::Axis)));


    QObject::connect(ui.buttonPTZPan,SIGNAL(clicked()),this,SLOT(button_PTZPan_clicked()));

    QObject::connect(ui.buttonPTZTilt,SIGNAL(clicked()),this,SLOT(button_PTZTilt_clicked()));


    QObject::connect(ui.buttonSendVelocity,SIGNAL(clicked()),this,SLOT(on_buttonSendVelocity_clicked()));
    QObject::connect(ui.buttonSendVelocity_2,SIGNAL(clicked()),this,SLOT(on_buttonSendVelocity_2_clicked()));
    QObject::connect(ui.buttonSendVelocity_3,SIGNAL(clicked()),this,SLOT(on_buttonSendVelocity_3_clicked()));
    QObject::connect(ui.buttonSendVelocity_4,SIGNAL(clicked()),this,SLOT(on_buttonSendVelocity_4_clicked()));
    

    /*********************
    ** Auto Start
    **********************/
    if ( ui.checkbox_remember_settings->isChecked() ) {
        on_button_connect_clicked(true);
    }

    ////////////////////////////////////////////////////////////////////////
    qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));

    scene.setSceneRect(-1600,-1600, 3200, 3200);
    scene.setItemIndexMethod(QGraphicsScene::NoIndex);


    scanview = new ScanWiew();
    scanview->setPos(0,0);
    scene.addItem(scanview);
    /*
    for (int i = 0; i < MouseCount; ++i) {
        ScanWiew *mouse = new ScanWiew;
        mouse->setPos(::sin((i * 6.28) / MouseCount) * 200,
                      ::cos((i * 6.28) / MouseCount) * 200);
        scene.addItem(mouse);
    }*/

   // QGraphicsView view(&scene);
    ui.graphicsView->setScene(&scene);
    ui.graphicsView->setRenderHint(QPainter::Antialiasing);
    QColor  color( 0, 0, 0);
    ui.graphicsView->setBackgroundBrush(color);//QPixmap(":/images/cheese.jpg"));
    ui.graphicsView->setCacheMode(QGraphicsView::CacheBackground);
    ui.graphicsView->setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
    ui.graphicsView->setDragMode(QGraphicsView::ScrollHandDrag);

#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
    ui.graphicsView->showMaximized();
#else
    //ui.graphicsView.resize(400, 300);
    //view.show();
#endif


    //QObject::connect(&timer, SIGNAL(timeout()), &scene, SLOT(advance()));
    QObject::connect(this, SIGNAL(sceneUpdate()), &scene, SLOT(update()));
    QObject::connect(ui.spinBox_ArcDistanceInMeter,SIGNAL(	valueChanged (int)),this,SLOT(setArcDistanceInMeter(int)));
    QObject::connect(ui.spinBox_arcDistanceInPixels,SIGNAL(	valueChanged (int)),this,SLOT(setArcDistanceInPixels(int)));
    QObject::connect(ui.spinBox_LaserRange,SIGNAL(	valueChanged (int)),this,SLOT(setRange(int)));
    //timer.start(1000 / 33);

     ui.line_log_dir_path->setText( QDir::currentPath());

     QObject::connect(ui.button_single_save,SIGNAL(clicked()),this,SLOT(button_single_save_clicked()));

     QObject::connect(ui.checkbox_enable_sensor_logging,SIGNAL(stateChanged(int)),this,SLOT(checkbox_enable_sensor_logging_changed(int)));
}
Exemplo n.º 14
0
tagTab::tagTab(int id, QMap<QString,Site*> *sites, QList<Favorite> favorites, mainWindow *parent)
	: searchTab(id, sites, parent), ui(new Ui::tagTab), m_id(id), m_parent(parent), m_favorites(favorites), m_pagemax(-1), m_lastTags(QString()), m_sized(false), m_from_history(false), m_stop(true), m_history_cursor(0), m_history(QList<QMap<QString,QString> >()), m_modifiers(QStringList())
{
	ui->setupUi(this);
	ui->widgetMeant->hide();
	setAttribute(Qt::WA_DeleteOnClose);

	QSettings settings(savePath("settings.ini"), QSettings::IniFormat, this);
	m_ignored = loadIgnored();

	// Search fields
	QStringList favs;
	for (Favorite fav : m_favorites)
		favs.append(fav.getName());
	m_search = new TextEdit(favs, this);
	m_postFiltering = new TextEdit(favs, this);
		m_search->setContextMenuPolicy(Qt::CustomContextMenu);
		m_postFiltering->setContextMenuPolicy(Qt::CustomContextMenu);
		if (settings.value("autocompletion", true).toBool())
		{
			QFile words("words.txt");
			if (words.open(QIODevice::ReadOnly | QIODevice::Text))
			{
				while (!words.atEnd())
					m_completion.append(QString(words.readLine()).trimmed().split(" ", QString::SkipEmptyParts));
				words.close();
			}
			QFile wordsc(savePath("wordsc.txt"));
			if (wordsc.open(QIODevice::ReadOnly | QIODevice::Text))
			{
				while (!wordsc.atEnd())
					m_completion.append(QString(wordsc.readLine()).trimmed().split(" ", QString::SkipEmptyParts));
				wordsc.close();
			}
			for (int i = 0; i < sites->size(); i++)
				if (sites->value(sites->keys().at(i))->contains("Modifiers"))
					m_modifiers.append(sites->value(sites->keys().at(i))->value("Modifiers").trimmed().split(" ", QString::SkipEmptyParts));
			m_completion.append(m_modifiers);
			m_completion.append(favs);
			m_completion.removeDuplicates();
			m_completion.sort();
			QCompleter *completer = new QCompleter(m_completion, this);
				completer->setCaseSensitivity(Qt::CaseInsensitive);
			m_search->setCompleter(completer);
			m_postFiltering->setCompleter(completer);
		}
		connect(m_search, SIGNAL(returnPressed()), this, SLOT(load()));
		connect(m_search, SIGNAL(favoritesChanged()), _mainwindow, SLOT(updateFavorites()));
		connect(m_search, SIGNAL(favoritesChanged()), _mainwindow, SLOT(updateFavoritesDock()));
		connect(m_search, SIGNAL(kflChanged()), _mainwindow, SLOT(updateKeepForLater()));
		connect(m_postFiltering, SIGNAL(returnPressed()), this, SLOT(load()));
		connect(ui->labelMeant, SIGNAL(linkActivated(QString)), this, SLOT(setTags(QString)));
		ui->layoutFields->insertWidget(1, m_search, 1);
		ui->layoutPlus->addWidget(m_postFiltering, 1, 1, 1, 3);

	// Sources
	QString sel = '1'+QString().fill('0',m_sites->count()-1);
	QString sav = settings.value("sites", sel).toString();
	for (int i = 0; i < sel.count(); i++)
	{
		if (sav.count() <= i)
		{ sav[i] = '0'; }
		m_selectedSources.append(sav.at(i) == '1' ? true : false);
	}

	// Others
	ui->checkMergeResults->setChecked(settings.value("mergeresults", false).toBool());
	optionsChanged();
	ui->widgetPlus->hide();
	setWindowIcon(QIcon());
	updateCheckboxes();
	m_search->setFocus();
}
Exemplo n.º 15
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    quitDialog(0), saveChanges(false),
    newJobFileName(""), newJobDestinationDirectory("")
{
    m_has_error_happend = false;
    QMetaObject::invokeMethod(this, "loadSettings", Qt::QueuedConnection);
    setWindowIcon(QIcon(":/ui/icons/motocool.jpg"));

    // Initiallize headers
    QStringList headers;
    headers << tr("Name") << tr("Downloaded/Total") << tr("Progress") << tr("Speed")
            << tr("Status") << tr("Remaining time");

    // Main job list
    jobView = new JobView(this);
    jobView->setHeaderLabels(headers);
    jobView->setSelectionBehavior(QAbstractItemView::SelectRows);
    jobView->setAlternatingRowColors(true);
    jobView->setRootIsDecorated(false);
    setCentralWidget(jobView);

    // Set header resize modes and initial section sizes
    QFontMetrics fm = fontMetrics();
    QHeaderView *header = jobView->header();
    header->resizeSection(0, fm.width("typical-name-length-for-a-download-task"));
    header->resizeSection(1, fm.width(headers.at(1) + "100MB/999MB"));
    header->resizeSection(2, fm.width(headers.at(2) + "100%"));
    header->resizeSection(3, qMax(fm.width(headers.at(3) + "   "), fm.width(" 1023.0 KB/s")));
    header->resizeSection(4, qMax(fm.width(headers.at(4) + "   "), fm.width(tr("Downloading  ") + "   ")));
    header->resizeSection(5, qMax(fm.width(headers.at(5) + "   "), fm.width(tr("--:--") + "   ")));

    // Create common actions
    QAction *newJobAction = new QAction(QIcon(":/ui/icons/bottom.png"), tr("Add &new job"), this);
    pauseJobAction = new QAction(QIcon(":/ui/icons/player_pause.png"), tr("&Pause job"), this);
    removeJobAction = new QAction(QIcon(":/ui/icons/player_stop.png"), tr("&Remove job"), this);
    openDirAction = new QAction(QIcon(":/ui/icons/folder.png"), tr("Open file &directory"), this);

    // File menu
    QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
    fileMenu->addAction(newJobAction);
    fileMenu->addAction(pauseJobAction);
    fileMenu->addAction(removeJobAction);
    fileMenu->addAction(openDirAction);
    fileMenu->addSeparator();
    fileMenu->addAction(QIcon(":/ui/icons/exit.png"), tr("E&xit"), this, SLOT(close()));

    // Help Menu
    QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
    helpMenu->addAction(tr("&About"), this, SLOT(about()));

    // Top toolbar
    QToolBar *topBar = new QToolBar(tr("Tools"));
    addToolBar(Qt::TopToolBarArea, topBar);
    topBar->setMovable(false);
    topBar->addAction(newJobAction);
    topBar->addAction(pauseJobAction);
    topBar->addAction(removeJobAction);
    topBar->addAction(openDirAction);
    pauseJobAction->setEnabled(false);
    removeJobAction->setEnabled(false);
    openDirAction->setEnabled(false);

    // Set up connections
    connect(jobView, SIGNAL(itemSelectionChanged()),
            this, SLOT(setActionsEnabled()));
    connect(newJobAction, SIGNAL(triggered()),
            this, SLOT(addJob()));
    connect(pauseJobAction, SIGNAL(triggered()),
            this, SLOT(pauseJob()));
    connect(removeJobAction, SIGNAL(triggered()),
            this, SLOT(removeJob()));
    connect(openDirAction, SIGNAL(triggered()),
            this, SLOT(openDir()));
}
Exemplo n.º 16
0
BitcoinGUI::BitcoinGUI(QWidget *parent):
    QMainWindow(parent),
    clientModel(0),
    walletModel(0),
    encryptWalletAction(0),
    changePassphraseAction(0),
    unlockWalletAction(0),
    lockWalletAction(0),
    aboutQtAction(0),
    trayIcon(0),
    notificator(0),
    rpcConsole(0)
{
    resize(840, 550);
    setWindowTitle(tr("Global ") + tr("Wallet"));


#ifndef Q_OS_MAC
    qApp->setWindowIcon(QIcon(":icons/bitcoin"));
    setWindowIcon(QIcon(":icons/bitcoin"));
#else
    setUnifiedTitleAndToolBarOnMac(true);
    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
	QApplication::setStyle(QStyleFactory::create("Fusion"));

    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon
    createActions();

    // Create application menu bar
    createMenuBar();

    // Create the toolbars
    createToolBars();

    // Create the tray icon (or setup the dock icon)
    createTrayIcon();
//    QFile style(":/styles/styles");
//    style.open(QFile::ReadOnly);
//    qApp->setStyleSheet(QString::fromUtf8(style.readAll()));
//    setStyleSheet("QMainWindow { background-image:url(:images/bkg);border:none;font-family:'Open Sans,sans-serif'; } #frame { } QToolBar QLabel { padding-top:15px;padding-bottom:10px;margin:0px; } #spacer { background:rgb(210,192,123);border:none; } #toolbar3 { border:none;width:1px; background-color: rgb(63,109,186); } #toolbar2 { border:none;width:28px; background-color:qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,stop: 0 rgb(210,192,123), stop: 1 rgb(227,213,195),stop: 2 rgb(59,62,65)); } #toolbar { border:none;height:100%;padding-top:20px; background: rgb(210,192,123); text-align: left; color: white;min-width:150px;max-width:150px;} QToolBar QToolButton:hover {background-color:qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,stop: 0 rgb(210,192,123), stop: 1 rgb(227,213,195),stop: 2 rgb(59,62,65));} QToolBar QToolButton { font-family:Century Gothic;padding-left:20px;padding-right:150px;padding-top:10px;padding-bottom:10px; width:100%; color: white; text-align: left; background-color: rgb(210,192,123) } #labelMiningIcon { padding-left:5px;font-family:Century Gothic;width:100%;font-size:10px;text-align:center;color:white; } QMenu { background: rgb(210,192,123); color:white; padding-bottom:10px; } QMenu::item { color:white; background-color: transparent; } QMenu::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(210,192,123), stop: 1 rgb(227,213,195)); } QMenuBar { background: rgb(210,192,123); color:white; } QMenuBar::item { font-size:12px;padding-bottom:8px;padding-top:8px;padding-left:15px;padding-right:15px;color:white; background-color: transparent; } QMenuBar::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(210,192,123), stop: 1 rgb(227,213,195)); }");
    qApp->setStyleSheet("QMainWindow { background-image:url(:images/bkg);border:none;font-family:'Open Sans,sans-serif'; } #frame { } QToolBar QLabel { padding-top:15px;padding-bottom:10px;margin:0px; } #spacer { background:rgb(63,109,186);border:none; } #toolbar3 { border:none;width:1px; background-color: rgb(63,109,186); } #toolbar2 { border:none;width:28px; background-color:rgb(63,109,186); } #toolbar { border:none;height:100%;padding-top:20px; background: rgb(63,109,186); text-align: left; color: white;min-width:150px;max-width:150px;} QToolBar QToolButton:hover {background-color:qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,stop: 0 rgb(63,109,186), stop: 1 rgb(216,252,251),stop: 2 rgb(59,62,65));} QToolBar QToolButton { font-family:Century Gothic;padding-left:20px;padding-right:150px;padding-top:10px;padding-bottom:10px; width:100%; color: white; text-align: left; background-color: rgb(63,109,186) } #labelMiningIcon { padding-left:5px;font-family:Century Gothic;width:100%;font-size:10px;text-align:center;color:white; } QMenu { background: rgb(63,109,186); color:white; padding-bottom:10px; } QMenu::item { color:white; background-color: transparent; } QMenu::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(63,109,186), stop: 1 rgb(149,204,244)); } QMenuBar { background: rgb(63,109,186); color:white; } QMenuBar::item { font-size:12px;padding-bottom:8px;padding-top:8px;padding-left:15px;padding-right:15px;color:white; background-color: transparent; } QMenuBar::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(63,109,186), stop: 1 rgb(149,204,244)); }");


//#ifdef Q_OS_MAC
//    toolbar->setStyleSheet("QToolBar { background-color: transparent; border: 0px solid black; padding: 3px; }");
//#endif
    // Create tabs
    overviewPage = new OverviewPage();

    transactionsPage = new QWidget(this);
    QVBoxLayout *vbox = new QVBoxLayout();
    transactionView = new TransactionView(this);
    vbox->addWidget(transactionView);
    transactionsPage->setLayout(vbox);

    addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);

    receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);

    sendCoinsPage = new SendCoinsDialog(this);

    signVerifyMessageDialog = new SignVerifyMessageDialog(this);

    centralWidget = new QStackedWidget(this);
    centralWidget->addWidget(overviewPage);
    centralWidget->addWidget(transactionsPage);
    centralWidget->addWidget(addressBookPage);
    centralWidget->addWidget(receiveCoinsPage);
    centralWidget->addWidget(sendCoinsPage);
    setCentralWidget(centralWidget);

    // Create status bar
    statusBar();

    // Status bar notification icons

    labelEncryptionIcon = new QLabel();
    labelStakingIcon = new QLabel();
    labelConnectionsIcon = new QLabel();
    labelBlocksIcon = new QLabel();

    if (GetBoolArg("-staking", true))
    {
        QTimer *timerStakingIcon = new QTimer(labelStakingIcon);
        connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon()));
        timerStakingIcon->start(30 * 1000);
        updateStakingIcon();
    }

    // Progress bar and label for blocks download
    progressBarLabel = new QLabel();
    progressBarLabel->setVisible(false);
    progressBar = new QProgressBar();


    progressBar->setAlignment(Qt::AlignCenter);
    progressBar->setVisible(false);

    // Override style sheet for progress bar for styles that have a segmented progress bar,
    // as they make the text unreadable (workaround for issue #1071)
    // See https://qt-project.org/doc/qt-4.8/gallery.html
    QString curStyle = qApp->style()->metaObject()->className();
    if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
    {
        progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #007FFF, stop: 1 #3B5998); border-radius: 7px; margin: 0px; }");
    }

    statusBar()->addWidget(progressBarLabel);
    statusBar()->addWidget(progressBar);
	
	
	
    addToolBarBreak(Qt::LeftToolBarArea);
    QToolBar *toolbar2 = addToolBar(tr("Tabs toolbar"));
    addToolBar(Qt::LeftToolBarArea,toolbar2);
    toolbar2->setOrientation(Qt::Vertical);
    toolbar2->setMovable( false );
    toolbar2->setObjectName("toolbar2");
    toolbar2->setFixedWidth(28);
    toolbar2->setIconSize(QSize(28,28));
    toolbar2->addWidget(labelEncryptionIcon);
    toolbar2->addWidget(labelStakingIcon);
    toolbar2->addWidget(labelConnectionsIcon);
    toolbar2->addWidget(labelBlocksIcon);
    toolbar2->setStyleSheet("#toolbar2 QToolButton { border:none;padding:0px;margin:0px;height:20px;width:28px;margin-top:36px; }");
//    toolbar2->setStyleSheet(QString::fromUtf8(style.readAll()));
	
	addToolBarBreak(Qt::TopToolBarArea);
    QToolBar *toolbar3 = addToolBar(tr("Green bar"));
    addToolBar(Qt::TopToolBarArea,toolbar3);
    toolbar3->setOrientation(Qt::Horizontal);
    toolbar3->setMovable( false );
    toolbar3->setObjectName("toolbar3");
    toolbar3->setFixedHeight(2);

    syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this);

    // Clicking on a transaction on the overview page simply sends you to transaction history page
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));

    // Double-clicking on a transaction on the transaction history page shows details
    connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));

    rpcConsole = new RPCConsole(this);
    connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));

    // Clicking on "Verify Message" in the address book sends you to the verify message tab
    connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
    // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab
    connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));

    gotoOverviewPage();
}
Exemplo n.º 17
0
CustomFDialog::CustomFDialog(QWidget *parent, QString wDir, QString caption, QString filter, int flags)
			: QDialog(parent), optionFlags(flags)
{
	setModal(true);
	setWindowTitle(caption);
	setWindowIcon(IconManager::instance()->loadIcon("AppIcon.png"));
	vboxLayout = new QVBoxLayout(this);
	vboxLayout->setSpacing(5);
	vboxLayout->setMargin(10);
    hboxLayout = new QHBoxLayout;
	hboxLayout->setSpacing(5);
	hboxLayout->setMargin(0);
	fileDialog = new ScFileWidget(this);
	hboxLayout->addWidget(fileDialog);
	fileDialog->setIconProvider(new ImIconProvider());
	fileDialog->setNameFilter(filter);
	fileDialog->selectNameFilter(filter);
	fileDialog->setDirectory(wDir);
	vboxLayout1 = new QVBoxLayout;
	vboxLayout1->setSpacing(0);
	vboxLayout1->setMargin(0);
	vboxLayout1->setContentsMargins(0, 37, 0, 0);
	vboxLayout1->setAlignment( Qt::AlignTop );
	pw = new FDialogPreview( this );
	pw->setMinimumSize(QSize(200, 200));
	pw->setMaximumSize(QSize(200, 200));
	vboxLayout1->addWidget(pw);
	hboxLayout->addLayout(vboxLayout1);
	vboxLayout->addLayout(hboxLayout);
    QHBoxLayout *hboxLayout1 = new QHBoxLayout;
	hboxLayout1->setSpacing(5);
	hboxLayout1->setContentsMargins(9, 0, 0, 0);
	showPreview = new QCheckBox(this);
	showPreview->setText( tr("Show Preview"));
	showPreview->setToolTip( tr("Show a preview and information for the selected file"));
	showPreview->setChecked(true);
	previewIsShown = true;
	hboxLayout1->addWidget(showPreview);
	QSpacerItem *spacerItem = new QSpacerItem(2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum);
	hboxLayout1->addItem(spacerItem);
	OKButton = new QPushButton( CommonStrings::tr_OK, this);
	OKButton->setDefault( true );
	hboxLayout1->addWidget( OKButton );
	if (flags & fdDisableOk)
		OKButton->setEnabled(false);
	CancelB = new QPushButton( CommonStrings::tr_Cancel, this);
	CancelB->setAutoDefault( false );
	hboxLayout1->addWidget( CancelB );
	vboxLayout->addLayout(hboxLayout1);

	SaveZip=NULL;
	WithFonts=NULL;
	WithProfiles=NULL;
	TxCodeM = NULL;
	TxCodeT = NULL;
	Layout = LayoutC = NULL;
	Layout1 = Layout1C = NULL;
	if (flags & fdDirectoriesOnly)
	{
		Layout = new QFrame(this);
		Layout1 = new QHBoxLayout(Layout);
		Layout1->setSpacing( 0 );
		Layout1->setContentsMargins(9, 0, 0, 0);
		SaveZip = new QCheckBox( tr( "&Compress File" ), Layout);
		Layout1->addWidget(SaveZip, Qt::AlignLeft);
		QSpacerItem* spacer = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
		Layout1->addItem( spacer );
		vboxLayout->addWidget(Layout);
		LayoutC = new QFrame(this);
		Layout1C = new QHBoxLayout(LayoutC);
		Layout1C->setSpacing( 0 );
		Layout1C->setContentsMargins(9, 0, 0, 0);
		WithFonts = new QCheckBox( tr( "&Include Fonts" ), LayoutC);
		Layout1C->addWidget(WithFonts, Qt::AlignLeft);
		WithProfiles = new QCheckBox( tr( "&Include Color Profiles" ), LayoutC);
		Layout1C->addWidget(WithProfiles, Qt::AlignLeft);
		QSpacerItem* spacer2 = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
		Layout1C->addItem( spacer2 );
		vboxLayout->addWidget(LayoutC);
		fileDialog->setFileMode(QFileDialog::DirectoryOnly);
		pw->hide();
		showPreview->setVisible(false);
		showPreview->setChecked(false);
		previewIsShown = false;
	}
	else
	{
		if (flags & fdCompressFile)
		{
			Layout = new QFrame(this);
			Layout1 = new QHBoxLayout(Layout);
			Layout1->setSpacing( 5 );
			Layout1->setContentsMargins(9, 0, 0, 0);
			SaveZip = new QCheckBox( tr( "&Compress File" ), Layout);
			Layout1->addWidget(SaveZip);
			QSpacerItem* spacer = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
			Layout1->addItem( spacer );
		}
		if (flags & fdExistingFiles)
			fileDialog->setFileMode(QFileDialog::ExistingFile);
		else if (flags & fdExistingFilesI)
			fileDialog->setFileMode(QFileDialog::ExistingFiles);
		else
		{
			fileDialog->setFileMode(QFileDialog::AnyFile);
			if (flags & fdCompressFile)
				vboxLayout->addWidget(Layout);
		}
		
		if (SaveZip!=NULL)
			SaveZip->setToolTip( "<qt>" + tr( "Compress the Scribus document on save" ) + "</qt>");
		if (WithFonts!=NULL)
			WithFonts->setToolTip( "<qt>" + tr( "Include fonts when collecting files for the document. Be sure to know and understand licensing information for any fonts you collect and possibly redistribute." ) + "</qt>");
		if (WithProfiles!=NULL)
			WithProfiles->setToolTip( "<qt>" + tr( "Include color profiles when collecting files for the document" ) + "</qt>");
		
		if (flags & fdShowCodecs)
		{
			LayoutC = new QFrame(this);
			Layout1C = new QHBoxLayout(LayoutC);
			Layout1C->setSpacing( 0 );
			Layout1C->setContentsMargins(9, 0, 0, 0);
			TxCodeT = new QLabel(this);
			TxCodeT->setText( tr("Encoding:"));
			Layout1C->addWidget(TxCodeT);
			TxCodeM = new ScComboBox(LayoutC);
			TxCodeM->setEditable(false);
			QString tmp_txc[] = {"ISO 8859-1", "ISO 8859-2", "ISO 8859-3",
								"ISO 8859-4", "ISO 8859-5", "ISO 8859-6",
								"ISO 8859-7", "ISO 8859-8", "ISO 8859-9",
								"ISO 8859-10", "ISO 8859-13", "ISO 8859-14",
								"ISO 8859-15", "UTF-8", "UTF-16", "KOI8-R", "KOI8-U",
								"CP1250", "CP1251", "CP1252", "CP1253",
								"CP1254", "CP1255", "CP1256", "CP1257",
								"Apple Roman"};
			size_t array = sizeof(tmp_txc) / sizeof(*tmp_txc);
			for (uint a = 0; a < array; ++a)
				TxCodeM->addItem(tmp_txc[a]);
			QString localEn = QTextCodec::codecForLocale()->name();
			if (localEn == "ISO-10646-UCS-2")
				localEn = "UTF-16";
			bool hasIt = false;
			for (int cc = 0; cc < TxCodeM->count(); ++cc)
			{
				if (TxCodeM->itemText(cc) == localEn)
				{
					TxCodeM->setCurrentIndex(cc);
					hasIt = true;
					break;
				}
			}
			if (!hasIt)
			{
				TxCodeM->addItem(localEn);
				TxCodeM->setCurrentIndex(TxCodeM->count()-1);
			}
			TxCodeM->setMinimumSize(QSize(200, 0));
			Layout1C->addWidget(TxCodeM);
			QSpacerItem* spacer2 = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
			Layout1C->addItem( spacer2 );
			vboxLayout->addWidget(LayoutC);
		}
		if (flags & fdShowImportOptions)
		{
			LayoutC = new QFrame(this);
			Layout1C = new QHBoxLayout(LayoutC);
			Layout1C->setSpacing( 0 );
			Layout1C->setContentsMargins(9, 0, 0, 0);
			TxCodeT = new QLabel(this);
			TxCodeT->setText( tr("Import Option:"));
			Layout1C->addWidget(TxCodeT);
			TxCodeM = new ScComboBox(LayoutC);
			TxCodeM->setEditable(false);
			TxCodeM->addItem( tr("Keep original size"));
			TxCodeM->addItem( tr("Downscale to page size"));
			TxCodeM->addItem( tr("Upscale to page size"));
			TxCodeM->setCurrentIndex(0);
			TxCodeM->setMinimumSize(QSize(200, 0));
			Layout1C->addWidget(TxCodeM);
			QSpacerItem* spacer2 = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
			Layout1C->addItem( spacer2 );
			vboxLayout->addWidget(LayoutC);
		}
		bool setter2 = flags & fdHidePreviewCheckBox;
		if (!setter2)
		{
			bool setter = flags & fdShowPreview;
			showPreview->setChecked(setter);
			previewIsShown = setter;
			pw->setVisible(setter);
		}
		else
		{
			showPreview->hide();
			previewIsShown = false;
			pw->setVisible(false);
		}
		if (flags & fdCompressFile)
			connect(SaveZip, SIGNAL(clicked()), this, SLOT(handleCompress()));
	}
	fileDialog->setNameFilterDetailsVisible(false);
	extZip = "gz";
	connect(OKButton, SIGNAL(clicked()), this, SLOT(okClicked()));
	connect(CancelB, SIGNAL(clicked()), this, SLOT(reject()));
	connect(showPreview, SIGNAL(clicked()), this, SLOT(togglePreview()));
	connect(fileDialog, SIGNAL(currentChanged(const QString &)), this, SLOT(fileClicked(const QString &)));
	connect(fileDialog, SIGNAL(filesSelected(const QStringList &)), this, SLOT(accept()));
	connect(fileDialog, SIGNAL(accepted()), this, SLOT(accept()));
	connect(fileDialog, SIGNAL(rejected()), this, SLOT(reject()));
	resize(minimumSizeHint());
}
Exemplo n.º 18
0
LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent ) :
	ControllerDialog( _model, _parent )
{
	QString title = tr( "LFO" );
	title.append( " (" );
	title.append( _model->name() );
	title.append( ")" );
	setWindowTitle( title );
	setWindowIcon( embed::getIconPixmap( "controller" ) );
	setFixedSize( 240, 80 );
	
	ToolTip::add( this, tr( "LFO Controller" ) );

	m_baseKnob = new Knob( knobBright_26, this );
	m_baseKnob->setLabel( tr( "BASE" ) );
	m_baseKnob->move( CD_LFO_BASE_CD_KNOB_X, CD_LFO_CD_KNOB_Y );
	m_baseKnob->setHintText( tr( "Base amount:" ), "" );
	m_baseKnob->setWhatsThis( tr("todo") );


	m_speedKnob = new TempoSyncKnob( knobBright_26, this );
	m_speedKnob->setLabel( tr( "SPD" ) );
	m_speedKnob->move( CD_LFO_SPEED_CD_KNOB_X, CD_LFO_CD_KNOB_Y );
	m_speedKnob->setHintText( tr( "LFO-speed:" ), "" );
	m_speedKnob->setWhatsThis(
		tr( "Use this knob for setting speed of the LFO. The "
			"bigger this value the faster the LFO oscillates and "
			"the faster the effect." ) );


	m_amountKnob = new Knob( knobBright_26, this );
	m_amountKnob->setLabel( tr( "AMT" ) );
	m_amountKnob->move( CD_LFO_AMOUNT_CD_KNOB_X, CD_LFO_CD_KNOB_Y );
	m_amountKnob->setHintText( tr( "Modulation amount:" ), "" );
	m_amountKnob->setWhatsThis(
		tr( "Use this knob for setting modulation amount of the "
			"LFO. The bigger this value, the more the connected "
			"control (e.g. volume or cutoff-frequency) will "
			"be influenced by the LFO." ) );

	m_phaseKnob = new Knob( knobBright_26, this );
	m_phaseKnob->setLabel( tr( "PHS" ) );
	m_phaseKnob->move( CD_LFO_PHASE_CD_KNOB_X, CD_LFO_CD_KNOB_Y );
	m_phaseKnob->setHintText( tr( "Phase offset:" ) , "" + tr( "degrees" ) );
	m_phaseKnob->setWhatsThis(
			tr( "With this knob you can set the phase offset of "
				"the LFO. That means you can move the "
				"point within an oscillation where the "
				"oscillator begins to oscillate. For example "
				"if you have a sine-wave and have a phase-"
				"offset of 180 degrees the wave will first go "
				"down. It's the same with a square-wave."
				) );

	PixmapButton * sin_wave_btn = new PixmapButton( this, NULL );
	sin_wave_btn->move( CD_LFO_SHAPES_X, CD_LFO_SHAPES_Y );
	sin_wave_btn->setActiveGraphic( embed::getIconPixmap(
						"sin_wave_active" ) );
	sin_wave_btn->setInactiveGraphic( embed::getIconPixmap(
						"sin_wave_inactive" ) );
	ToolTip::add( sin_wave_btn,
			tr( "Click here for a sine-wave." ) );

	PixmapButton * triangle_wave_btn =
					new PixmapButton( this, NULL );
	triangle_wave_btn->move( CD_LFO_SHAPES_X + 15, CD_LFO_SHAPES_Y );
	triangle_wave_btn->setActiveGraphic(
		embed::getIconPixmap( "triangle_wave_active" ) );
	triangle_wave_btn->setInactiveGraphic(
		embed::getIconPixmap( "triangle_wave_inactive" ) );
	ToolTip::add( triangle_wave_btn,
			tr( "Click here for a triangle-wave." ) );

	PixmapButton * saw_wave_btn = new PixmapButton( this, NULL );
	saw_wave_btn->move( CD_LFO_SHAPES_X + 30, CD_LFO_SHAPES_Y );
	saw_wave_btn->setActiveGraphic( embed::getIconPixmap(
						"saw_wave_active" ) );
	saw_wave_btn->setInactiveGraphic( embed::getIconPixmap(
						"saw_wave_inactive" ) );
	ToolTip::add( saw_wave_btn,
			tr( "Click here for a saw-wave." ) );

	PixmapButton * sqr_wave_btn = new PixmapButton( this, NULL );
	sqr_wave_btn->move( CD_LFO_SHAPES_X + 45, CD_LFO_SHAPES_Y );
	sqr_wave_btn->setActiveGraphic( embed::getIconPixmap(
					"square_wave_active" ) );
	sqr_wave_btn->setInactiveGraphic( embed::getIconPixmap(
					"square_wave_inactive" ) );
	ToolTip::add( sqr_wave_btn,
			tr( "Click here for a square-wave." ) );

	PixmapButton * moog_saw_wave_btn =
					new PixmapButton( this, NULL );
	moog_saw_wave_btn->move( CD_LFO_SHAPES_X, CD_LFO_SHAPES_Y + 15 );
	moog_saw_wave_btn->setActiveGraphic(
		embed::getIconPixmap( "moog_saw_wave_active" ) );
	moog_saw_wave_btn->setInactiveGraphic(
		embed::getIconPixmap( "moog_saw_wave_inactive" ) );
	ToolTip::add( moog_saw_wave_btn,
			tr( "Click here for a moog saw-wave." ) );

	PixmapButton * exp_wave_btn = new PixmapButton( this, NULL );
	exp_wave_btn->move( CD_LFO_SHAPES_X + 15, CD_LFO_SHAPES_Y + 15 );
	exp_wave_btn->setActiveGraphic( embed::getIconPixmap(
						"exp_wave_active" ) );
	exp_wave_btn->setInactiveGraphic( embed::getIconPixmap(
						"exp_wave_inactive" ) );
	ToolTip::add( exp_wave_btn,
			tr( "Click here for an exponential wave." ) );

	PixmapButton * white_noise_btn = new PixmapButton( this, NULL );
	white_noise_btn->move( CD_LFO_SHAPES_X + 30, CD_LFO_SHAPES_Y + 15 );
	white_noise_btn->setActiveGraphic(
		embed::getIconPixmap( "white_noise_wave_active" ) );
	white_noise_btn->setInactiveGraphic(
		embed::getIconPixmap( "white_noise_wave_inactive" ) );
	ToolTip::add( white_noise_btn,
				tr( "Click here for white-noise." ) );

	m_userWaveBtn = new PixmapButton( this, NULL );
	m_userWaveBtn->move( CD_LFO_SHAPES_X + 45, CD_LFO_SHAPES_Y + 15 );
	m_userWaveBtn->setActiveGraphic( embed::getIconPixmap(
						"usr_wave_active" ) );
	m_userWaveBtn->setInactiveGraphic( embed::getIconPixmap(
						"usr_wave_inactive" ) );
	connect( m_userWaveBtn,
					SIGNAL( doubleClicked() ),
			this, SLOT( askUserDefWave() ) );
	ToolTip::add( m_userWaveBtn,
				tr( "Click here for a user-defined shape.\nDouble click to pick a file." ) );
	
	m_waveBtnGrp = new automatableButtonGroup( this );
	m_waveBtnGrp->addButton( sin_wave_btn );
	m_waveBtnGrp->addButton( triangle_wave_btn );
	m_waveBtnGrp->addButton( saw_wave_btn );
	m_waveBtnGrp->addButton( sqr_wave_btn );
	m_waveBtnGrp->addButton( moog_saw_wave_btn );
	m_waveBtnGrp->addButton( exp_wave_btn );
	m_waveBtnGrp->addButton( white_noise_btn );
	m_waveBtnGrp->addButton( m_userWaveBtn );


	PixmapButton * x1 = new PixmapButton( this, NULL );
	x1->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y );
	x1->setActiveGraphic( embed::getIconPixmap(
						"lfo_x1_active" ) );
	x1->setInactiveGraphic( embed::getIconPixmap(
						"lfo_x1_inactive" ) );

	PixmapButton * x100 = new PixmapButton( this, NULL );
	x100->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y - 15 );
	x100->setActiveGraphic( embed::getIconPixmap(
						"lfo_x100_active" ) );
	x100->setInactiveGraphic( embed::getIconPixmap(
						"lfo_x100_inactive" ) );

	PixmapButton * d100 = new PixmapButton( this, NULL );
	d100->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y + 15 );
	d100->setActiveGraphic( embed::getIconPixmap(
						"lfo_d100_active" ) );
	d100->setInactiveGraphic( embed::getIconPixmap(
						"lfo_d100_inactive" ) );

	m_multiplierBtnGrp = new automatableButtonGroup( this );
	m_multiplierBtnGrp->addButton( x1 );
	m_multiplierBtnGrp->addButton( x100 );
	m_multiplierBtnGrp->addButton( d100 );


	setModel( _model );

	setAutoFillBackground( true );
	QPalette pal;
	pal.setBrush( backgroundRole(),
					embed::getIconPixmap( "lfo_controller_artwork" ) );
	setPalette( pal );

}
Exemplo n.º 19
0
void ProfileManager::profileInit()
{
  setModal(true);
  resize(370, 170);
  setWindowIcon(QIcon("icons/backupsoft.png"));

  name = new QLabel(tr("Name"), this);
  name->setGeometry(10,10,100,20);
  nameField = new QLineEdit(this);
  nameField->setGeometry(100,10,150,20);

  source = new QLabel(tr("Source"), this);
  source->setGeometry(10,40,100,20);
  sourceField = new QLineEdit(this);
  sourceField->setGeometry(100,40,150,20);

  destination = new QLabel(tr("Destination"), this);
  destination->setGeometry(10,70,100,20);
  destinationField = new QLineEdit(this);
  destinationField->setGeometry(100,70,150,20);

  sourceBrowseButton = new QPushButton(tr("&Browse..."), this);
  sourceBrowseButton->setGeometry(250,40,100,20);
  destinationBrowseButton = new QPushButton(tr("&Browse..."), this);
  destinationBrowseButton->setGeometry(250,70,100,20);

  stateBox = new QCheckBox(tr("Activated"), this);
  stateBox->setGeometry(100, 100, 250, 20);

  cancelButton = new QPushButton(tr("&Cancel"), this);

  if(origin == 1) { // for a new Profile
    setWindowTitle(tr("New Profile"));

    saveButton = new QPushButton(tr("&Save"), this);
    saveButton->setEnabled(false);

    stateBox->setChecked(true); // default
  }

  if(origin == 2) {
    extractedInfo = profile.split('|', QString::SkipEmptyParts);
    setWindowTitle(tr("Edit Profile"));

    saveButton = new QPushButton(tr("&Edit"), this);
    saveButton->setEnabled(true);

    nameField->setText(extractedInfo.value(0));
    sourceField->setText(extractedInfo.value(1));
    destinationField->setText(extractedInfo.value(2));

    bool isActivated = extractedInfo.at(3) == tr("Activated");
    stateBox->setChecked(isActivated);
  }

#ifdef _WIN32
  saveButton->setGeometry(150,130,100,30);
  cancelButton->setGeometry(250,130,100,30);
#else
  saveButton->setGeometry(250,130,100,30);
  cancelButton->setGeometry(150,130,100,30);
#endif

  createActions();
}
Exemplo n.º 20
0
Arquivo: app.cpp Projeto: ertos12/bomi
App::App(int &argc, char **argv)
: QApplication(argc, argv), d(new Data(this)) {
    if (QFile::exists(applicationDirPath() % "/bomi.ini"_a)) {
        QSettings set(applicationDirPath() % "/bomi.ini"_a, QSettings::IniFormat);
        d->useLocalConfig = set.value(u"app/use-local-config"_q, false).toBool();
        Global::useLocalConfig = set.value(u"global/use-local-config"_q, false).toBool();
        if (d->useLocalConfig != Global::useLocalConfig) {
            const auto from = _WritablePath(Location::Config, false);
            Global::useLocalConfig = d->useLocalConfig;
            const auto to = _WritablePath(Location::Config, false);
            d->copyConfig(from, to);
            set.setValue(u"global/use-local-config"_q, Global::useLocalConfig);
        }
    }

#ifdef Q_OS_LINUX
    setlocale(LC_NUMERIC,"C");
#endif

    OS::initialize();

    _New(d->parser);
    d->parser->addOption(LineCmd::Open, u"open"_q,
                         u"Open given %1 for file path or URL."_q, u"mrl"_q);
    d->parser->addOption(LineCmd::SetSubtitle, u"set-subtitle"_q,
                         u"Set subtitle file to display."_q, u"file"_q);
//    d->parser->addOption(LineCmd::AddSubtitle, u"add-subtitle"_q,
//                         u"Add subtitle file to display."_q, u"file"_q);
    d->parser->addOption(LineCmd::Wake, u"wake"_q,
                         u"Bring the application window in front."_q);
    d->parser->addOption(LineCmd::Action, u"action"_q,
                         u"Exectute %1 action or open %1 menu."_q, u"id"_q);
    d->parser->addOption(LineCmd::LogLevel, u"log-level"_q,
                         u"Maximum verbosity for log. %1 should be one of nexts:\n    "_q
                         % Log::levelNames().join(u", "_q), u"lv"_q);
    d->parser->addOption(LineCmd::Debug, u"debug"_q,
                         u"Turn on options for debugging."_q);
    d->parser->addOption(LineCmd::DumpApiTree, u"dump-api-tree"_q,
                         u"Dump API structure tree to stdout."_q);
    d->parser->addOption(LineCmd::DumpActionList, u"dump-action-list"_q,
                         u"Dump executable action list to stdout."_q);
#ifdef Q_OS_WIN
    d->parser->addOption(LineCmd::WinAssoc, u"win-assoc"_q,
                         u"Associate given comma-separated extension list."_q, u"ext"_q);
    d->parser->addOption(LineCmd::WinUnassoc, u"win-unassoc"_q,
                         u"Unassociate all extensions."_q);
    d->parser->addOption(LineCmd::WinAssocDefault, u"win-assoc-default"_q,
                         u"Associate default extensions."_q);
#endif
    d->parser->parse(arguments());
    d->gldebug = d->parser->isSet(LineCmd::Debug);
    const auto lvStdOut = d->parser->stdoutLogLevel();

    d->import();

    d->storage.setObject(this, u"application"_q);
    d->storage.add("locale", &d->locale);
    d->storage.json("log-option", &d->logOption);
    d->storage.add("style-name", &d->styleName);
    d->storage.add("unique", &d->unique);
    d->storage.add("open-folders", open_folders, set_open_folders);
    d->storage.add("font");
    d->storage.add("fixedFont");
    d->storage.restore();

    setLocale(d->locale);

    auto logOption = d->logOption;
    if (logOption.level(LogOutput::StdOut) < lvStdOut)
        logOption.setLevel(LogOutput::StdOut, lvStdOut);
    Log::setOption(logOption);

    setQuitOnLastWindowClosed(false);
#ifndef Q_OS_MAC
    setWindowIcon(defaultIcon());
#endif

    d->styleNames = [this] () {
        auto names = QStyleFactory::keys();
        const auto defaultName = style()->objectName();
        for (auto it = ++names.begin(); it != names.end(); ++it) {
            if (defaultName.compare(*it, Qt::CaseInsensitive) == 0) {
                const auto name = *it;
                names.erase(it);
                names.prepend(name);
                break;
            }
        }
        return names;
    }();
    auto makeStyle = [&]() {
        auto name = d->styleName;
        if (style()->objectName().compare(name, Qt::CaseInsensitive) == 0)
            return;
        if (!d->styleNames.contains(name, Qt::CaseInsensitive))
            return;
        setStyle(QStyleFactory::create(name));
    };
    makeStyle();
    connect(&d->connection, &LocalConnection::messageReceived,
            this, &App::handleMessage);
}
void
NotifierApp::init()
{
    setWindowIcon( QIcon::fromTheme( "preferences-system" ) );
}
Exemplo n.º 22
0
burnConfigDialog::burnConfigDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::burnConfigDialog)
{
    ui->setupUi(this);
    setWindowIcon(CompanionIcon("configure.png"));
    ui->avrdude_programmer->model()->sort(0);

    getSettings();
    populateProgrammers();
    EEPROMInterface *eepromInterface = GetEepromInterface();
    if (IS_TARANIS(eepromInterface->getBoard())) {
        setWindowTitle(tr("DFU-UTIL Configuration"));
        ui->avrArgs->hide();
        ui->avrdude_location->hide();
        ui->avrdude_port->hide();
        ui->avrdude_programmer->hide();
        ui->label_av1->hide();
        ui->label_av2->hide();
        ui->label_av4->hide();
        ui->label_av5->hide();
        ui->pushButton->hide();
        ui->pushButton_3->hide();
        ui->pushButton_4->hide();
        ui->label_sb1->hide();
        ui->label_sb3->hide();
        ui->samba_location->hide();
        ui->samba_port->hide();
        ui->sb_browse->hide();
    }
    else if (IS_SKY9X(eepromInterface->getBoard())) {
        setWindowTitle(tr("SAM-BA Configuration"));
        ui->avrArgs->hide();
        ui->avrdude_location->hide();
        ui->avrdude_port->hide();
        ui->avrdude_programmer->hide();
        ui->label_av1->hide();
        ui->label_av2->hide();
        ui->label_av4->hide();
        ui->label_av5->hide();
        ui->pushButton->hide();
        ui->pushButton_3->hide();
        ui->pushButton_4->hide();
        ui->label_dfu1->hide();
        ui->dfu_location->hide();
        ui->dfu_browse->hide();
    }
    else {
        setWindowTitle(tr("AVRDUDE Configuration"));
        ui->label_sb1->hide();
        ui->label_sb3->hide();
        ui->samba_location->hide();
        ui->samba_port->hide();
        ui->sb_browse->hide();
        ui->label_dfu1->hide();
        ui->label_dfu2->hide();
        ui->dfu_location->hide();
        ui->dfu_browse->hide();
    }
    ui->label_av3->hide();
    ui->avrdude_mcu->hide();
    ui->label_sb2->hide();
    ui->arm_mcu->hide();
    ui->label_dfu2->hide();
    ui->dfuArgs->hide();

    QTimer::singleShot(0, this, SLOT(shrink()));
    connect(this,SIGNAL(accepted()),this,SLOT(putSettings()));
}
Exemplo n.º 23
0
MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) :
	Super(parent, flags)
{
	setWindowTitle(tr("Quick Event ver. %1").arg(versionString()));
	setWindowIcon(QIcon(":/quickevent/images/quickevent64.png"));
}
Exemplo n.º 24
0
void frmListIconCfg::setTheme()
{
	setWindowIcon( QIcon(fGrl->Theme() +"img16/style.png") );

// [tw_list_icon]
	ui->btn_tw_icon_width_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_tw_icon_height_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));

// [picflow_img]
	ui->btn_pf_img_width_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_pf_img_height_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));

// [list_icon]
	ui->btn_icon_width_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_icon_height_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_img_cover_top_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_img_cover_top_select_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_img_cover_top_pos_x_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_img_cover_top_pos_y_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_img_scaled_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_img_scale_w_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_img_scale_h_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_img_scale_pos_x_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_img_scale_pos_y_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_tipo_emu_show_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_tipo_emu_pos_x_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_tipo_emu_pos_y_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_rating_show_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_rating_vertical_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_rating_pos_x_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_rating_pos_y_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_bg_show_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_bg_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_bg_select_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_bg_pos_x_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_bg_pos_y_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_show_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_pos_x_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_pos_y_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_width_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_height_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_max_caracteres_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_font_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_font_size_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_font_color_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_font_color_select_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_font_bold_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_font_italic_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));
	ui->btn_title_font_underline_def->setIcon(QIcon(fGrl->Theme() +"img16/mp_aleatorio.png"));

	ui->btnIconMode->setIcon(QIcon(fGrl->Theme() +"img16/cover_mode.png"));
	ui->btnSave->setIcon(QIcon(fGrl->Theme() +"img16/floppy_2.png"));
	ui->btnSaveText->setIcon(QIcon(fGrl->Theme() +"img16/floppy_2.png"));
	ui->btnOk->setIcon(QIcon(fGrl->Theme() +"img16/aplicar.png"));

	ui->cbxListFiles->clear();
	ui->cbxListFiles->addItem(QIcon(fGrl->Theme() +"img16/style.png"), "StyleSheet.qss"        , "StyleSheet.qss"        );
	ui->cbxListFiles->addItem(QIcon(fGrl->Theme() +"img16/style.png"), "StyleSheetList.qss"    , "StyleSheetList.qss"    );
	ui->cbxListFiles->addItem(QIcon(fGrl->Theme() +"img16/html.png") , "tpl_info.html"         , "tpl_info.html"         );
	ui->cbxListFiles->addItem(QIcon(fGrl->Theme() +"img16/html.png" ), "tpl_juego_info.html"   , "tpl_juego_info.html"   );
	ui->cbxListFiles->addItem(QIcon(fGrl->Theme() +"img16/html.png") , "tpl_juego_no_info.html", "tpl_juego_no_info.html");
}
Exemplo n.º 25
0
QucsFilter::QucsFilter()
{
  QWidget *centralWidget = new QWidget(this);  
  setCentralWidget(centralWidget);
  
  // set application icon
  setWindowIcon(QPixmap(":/bitmaps/big.qucs.xpm"));
  setWindowTitle("Qucs Filter " PACKAGE_VERSION);

  // --------  create menubar  -------------------
  QMenu *fileMenu = new QMenu(tr("&File"));

  QAction * fileQuit = new QAction(tr("E&xit"), this);
  fileQuit->setShortcut(Qt::CTRL+Qt::Key_Q);
  connect(fileQuit, SIGNAL(activated()), SLOT(slotQuit()));

  fileMenu->addAction(fileQuit);

  QMenu *helpMenu = new QMenu(tr("&Help"), this);
  QAction * helpHelp = new QAction(tr("Help..."), this);
  helpHelp->setShortcut(Qt::Key_F1);
  connect(helpHelp, SIGNAL(activated()), SLOT(slotHelpIntro()));

  QAction * helpAbout = new QAction(tr("&About QucsFilter..."), this);
  helpMenu->addAction(helpAbout);
  connect(helpAbout, SIGNAL(activated()), SLOT(slotHelpAbout()));

  QAction * helpAboutQt = new QAction(tr("About Qt..."), this);
  helpMenu->addAction(helpAboutQt);
  connect(helpAboutQt, SIGNAL(activated()), SLOT(slotHelpAboutQt()));

  helpMenu->addAction(helpHelp);
  helpMenu->addSeparator();
  helpMenu->addAction(helpAbout);
  helpMenu->addAction(helpAboutQt);

  menuBar()->addMenu(fileMenu);
  menuBar()->addSeparator();
  menuBar()->addMenu(helpMenu);

  // -------  create main windows widgets --------
  all  = new QGridLayout();
  all->setSpacing(3);

  // assign layout to central widget
  centralWidget->setLayout(all);

  // ...........................................................
  box1 = new QGroupBox(tr("Filter"), this);
  all->addWidget(box1,0,0);

  gbox1 = new QGridLayout();
  gbox1->setSpacing(3);

  box1->setLayout(gbox1);

  QLabel *Label0 = new QLabel(tr("Realization:"), this);
  gbox1->addWidget(Label0, 0,0);
  ComboRealize = new QComboBox(this);
  ComboRealize->addItem("LC ladder (pi type)");
  ComboRealize->addItem("LC ladder (tee type)");
  ComboRealize->addItem("C-coupled transmission lines");
  ComboRealize->addItem("Microstrip end-coupled");
  ComboRealize->addItem("Coupled transmission lines");
  ComboRealize->addItem("Coupled microstrip");
  ComboRealize->addItem("Stepped-impedance");
  ComboRealize->addItem("Stepped-impedance microstrip");
  ComboRealize->addItem("Quarter wave");
  ComboRealize->addItem("Quarter wave microstrip");
  ComboRealize->addItem("Equation-defined");

  gbox1->addWidget(ComboRealize, 0,1);
  connect(ComboRealize, SIGNAL(activated(int)), SLOT(slotRealizationChanged(int)));

  QLabel *Label1 = new QLabel(tr("Filter type:"), this);
  gbox1->addWidget(Label1, 1,0);
  ComboType = new QComboBox(this);
  ComboType->addItem("Bessel");
  ComboType->addItem("Butterworth");
  ComboType->addItem("Chebyshev");
  ComboType->addItem("Cauer");
  gbox1->addWidget(ComboType, 1,1);
  connect(ComboType, SIGNAL(activated(int)), SLOT(slotTypeChanged(int)));

  QLabel *Label2 = new QLabel(tr("Filter class:"), this);
  gbox1->addWidget(Label2, 2,0);
  ComboClass = new QComboBox(this);
  ComboClass->addItem(tr("Low pass"));
  ComboClass->addItem(tr("High pass"));
  ComboClass->addItem(tr("Band pass"));
  ComboClass->addItem(tr("Band stop"));
  gbox1->addWidget(ComboClass, 2,1);
  connect(ComboClass, SIGNAL(activated(int)), SLOT(slotClassChanged(int)));

  IntVal = new QIntValidator(1, 200, this);
  DoubleVal = new QDoubleValidator(this);

  LabelOrder = new QLabel(tr("Order:"), this);
  gbox1->addWidget(LabelOrder, 3,0);
  EditOrder = new QLineEdit("3", this);
  EditOrder->setValidator(IntVal);
  gbox1->addWidget(EditOrder, 3,1);

  LabelStart = new QLabel(tr("Corner frequency:"), this);
  gbox1->addWidget(LabelStart, 4,0);
  EditCorner = new QLineEdit("1", this);
  EditCorner->setValidator(DoubleVal);
  gbox1->addWidget(EditCorner, 4,1);
  ComboCorner = new QComboBox(this);
  ComboCorner->addItem("Hz");
  ComboCorner->addItem("kHz");
  ComboCorner->addItem("MHz");
  ComboCorner->addItem("GHz");
  ComboCorner->setCurrentIndex(3);
  gbox1->addWidget(ComboCorner, 4,2);

  LabelStop = new QLabel(tr("Stop frequency:"), this);
  gbox1->addWidget(LabelStop, 5,0);
  EditStop = new QLineEdit("2", this);
  EditStop->setValidator(DoubleVal);
  gbox1->addWidget(EditStop, 5,1);
  ComboStop = new QComboBox(this);
  ComboStop->addItem("Hz");
  ComboStop->addItem("kHz");
  ComboStop->addItem("MHz");
  ComboStop->addItem("GHz");
  ComboStop->setCurrentIndex(3);
  gbox1->addWidget(ComboStop, 5,2);

  LabelBandStop = new QLabel(tr("Stop band frequency:"), this);
  gbox1->addWidget(LabelBandStop, 6,0);
  EditBandStop = new QLineEdit("3", this);
  EditBandStop->setValidator(DoubleVal);
  gbox1->addWidget(EditBandStop, 6,1);
  ComboBandStop = new QComboBox(this);
  ComboBandStop->addItem("Hz");
  ComboBandStop->addItem("kHz");
  ComboBandStop->addItem("MHz");
  ComboBandStop->addItem("GHz");
  ComboBandStop->setCurrentIndex(3);
  gbox1->addWidget(ComboBandStop, 6,2);

  LabelRipple = new QLabel(tr("Pass band ripple:"), this);
  gbox1->addWidget(LabelRipple, 7,0);
  EditRipple = new QLineEdit("1", this);
  EditRipple->setValidator(DoubleVal);
  gbox1->addWidget(EditRipple, 7,1);
  LabelRipple_dB = new QLabel("dB", this);
  gbox1->addWidget(LabelRipple_dB, 7,2);

  LabelAtten = new QLabel(tr("Stop band attenuation:"), this);
  gbox1->addWidget(LabelAtten, 8,0);
  EditAtten = new QLineEdit("20", this);
  EditAtten->setValidator(DoubleVal);
  gbox1->addWidget(EditAtten, 8,1);
  LabelAtten_dB = new QLabel("dB", this);
  gbox1->addWidget(LabelAtten_dB, 8,2);

  LabelImpedance = new QLabel(tr("Impedance:"), this);
  gbox1->addWidget(LabelImpedance, 9,0);
  EditImpedance = new QLineEdit("50", this);
  EditImpedance->setValidator(DoubleVal);
  gbox1->addWidget(EditImpedance, 9,1);
  LabelOhm = new QLabel("Ohm", this);
  gbox1->addWidget(LabelOhm, 9,2);

  // ...........................................................
  box2 = new QGroupBox(tr("Microstrip Substrate"), this);
  box2->setEnabled(false);
  all->addWidget(box2,0,1);

  gbox2 = new QGridLayout();
  gbox2->setSpacing(3);

  box2->setLayout(gbox2);

  QLabel *Label3 = new QLabel(tr("Relative permittivity:"), this);
  gbox2->addWidget(Label3, 0,0);
  ComboEr = new QComboBox(this);
  ComboEr->setEditable(true);
  ComboEr->lineEdit()->setValidator(DoubleVal);
  connect(ComboEr, SIGNAL(activated(const QString&)), SLOT(slotTakeEr(const QString&)));
  gbox2->addWidget(ComboEr, 0,1);

  const char **p = List_er;
  while(*(++p))
    ComboEr->addItem(*p);  // put material properties into combobox
  ComboEr->lineEdit()->setText("9.8");

  QLabel *Label4 = new QLabel(tr("Substrate height:"), this);
  gbox2->addWidget(Label4, 1,0);
  EditHeight = new QLineEdit("1.0", this);
  EditHeight->setValidator(DoubleVal);
  gbox2->addWidget(EditHeight, 1,1);
  QLabel *Label5 = new QLabel("mm", this);
  gbox2->addWidget(Label5, 1,2);

  QLabel *Label6 = new QLabel(tr("metal thickness:"), this);
  gbox2->addWidget(Label6, 2,0);
  EditThickness = new QLineEdit("12.5", this);
  EditThickness->setValidator(DoubleVal);
  gbox2->addWidget(EditThickness, 2,1);
  QLabel *Label7 = new QLabel("um", this);
  gbox2->addWidget(Label7, 2,2);

  QLabel *Label8 = new QLabel(tr("minimum width:"), this);
  gbox2->addWidget(Label8, 3,0);
  EditMinWidth = new QLineEdit("0.4", this);
  EditMinWidth->setValidator(DoubleVal);
  gbox2->addWidget(EditMinWidth, 3,1);
  QLabel *Label9 = new QLabel("mm", this);
  gbox2->addWidget(Label9, 3,2);

  QLabel *Label10 = new QLabel(tr("maximum width:"), this);
  gbox2->addWidget(Label10, 4,0);
  EditMaxWidth = new QLineEdit("5.0", this);
  EditMaxWidth->setValidator(DoubleVal);
  gbox2->addWidget(EditMaxWidth, 4,1);
  QLabel *Label11 = new QLabel("mm", this);
  gbox2->addWidget(Label11, 4,2);

  QSpacerItem *mySpacer=new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding);
  gbox2->addItem(mySpacer, 5, 0, 1, -1);

  // ...........................................................
  QPushButton *ButtonGo = new QPushButton(tr("Calculate and put into Clipboard"), this);
  connect(ButtonGo, SIGNAL(clicked()), SLOT(slotCalculate()));
  all->addWidget(ButtonGo, 1, 0, 1, -1);

  LabelResult = new QLabel(this);
  ResultState = 100;
  slotShowResult();
  LabelResult->setAlignment(Qt::AlignHCenter);
  all->addWidget(LabelResult, 2, 0, 1, -1);

  // -------  finally set initial state  --------
  slotTypeChanged(0);
  slotClassChanged(0);
}
Exemplo n.º 26
0
/*!
 * VorbitalDlg creator
 */
VorbitalDlg::VorbitalDlg( )
{
    qDebug() << "VorbitalDlg Create.";
	_done = false;
	// OpenAL Initialization
#ifdef WIN32
	alutInit(NULL, 0);
#else
    _device = alcOpenDevice(NULL);
    _context = alcCreateContext(_device, NULL);
    alcMakeContextCurrent(_context);
#endif
	alGetError();
	// Initialize position of the Listener.
	ALfloat ListenerPos[] = { 0.0, 0.0, 0.0 };
	// Velocity of the Listener.
	ALfloat ListenerVel[] = { 0.0, 0.0, 0.0 };
	// Orientation of the Listener. (first 3 elements are "at", second 3 are "up")
	// Also note that these should be units of '1'.
	ALfloat ListenerOri[] = { 0.0, 0.0, -1.0,  0.0, 1.0, 0.0 };
	alListenerfv(AL_POSITION,    ListenerPos);
	alListenerfv(AL_VELOCITY,    ListenerVel);
	alListenerfv(AL_ORIENTATION, ListenerOri);

	_listPosition = 0;
	_musicStream = NULL;
    _btnBrowse = NULL;
    _btnBrowseFolder = NULL;
    _btnPlay = NULL;
	_btnStop = NULL;
	_btnPause = NULL;
	_btnForward = NULL;
	_btnReverse = NULL;
    _btnClear = NULL;
	_btnRemove = NULL;
	_btnSettings = NULL;
	_btnAbout = NULL;
	_btnRandomize = NULL;
    _txtSampleRate = NULL;
    _txtVersion = NULL;
    _txtBitRate = NULL;
    _txtChannels = NULL;
	_txtComment = NULL;
	_txtTime = NULL;
    _volumeSlider = NULL;
    _timeElapsed = 0;
    qDebug() << "Setting VorbitalDlg play state to STOPPED.";
	_playState = STOPPED;
	_incrementNeeded = true;
    _randomize = false;
	_menuDoubleClicked = false;
	srand((unsigned)time(0));
    CreateControls();
	LoadSettings();
    QIcon icon("vorbital.ico");
	setWindowIcon(icon);
    setWindowTitle("Vorbital Player");
	// Start up the playlist thread.
    _playlistThread = new PlaylistThread(this);
	_playlistThread->start();
}
Exemplo n.º 27
0
BitcoinGUI::BitcoinGUI(QWidget *parent) :
    QMainWindow(parent),
    clientModel(0),
    encryptWalletAction(0),
    changePassphraseAction(0),
    aboutQtAction(0),
    trayIcon(0),
    notificator(0),
    rpcConsole(0),
    prevBlocks(0)
{
    restoreWindowGeometry();
    setWindowTitle(tr("YYF") + " - " + tr("Wallet")+ " - " + tr("全球第一个股权数字货币"));
#ifndef Q_OS_MAC
    QApplication::setWindowIcon(QIcon(":icons/bitcoin"));
    setWindowIcon(QIcon(":icons/bitcoin"));
#else
    setUnifiedTitleAndToolBarOnMac(true);
    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
    // Create wallet frame and make it the central widget
    walletFrame = new WalletFrame(this);
    setCentralWidget(walletFrame);

    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon
    // Needs walletFrame to be initialized
    createActions();

    // Create application menu bar
    createMenuBar();

    // Create the toolbars
    createToolBars();

    // Create system tray icon and notification
    createTrayIcon();

    // Create status bar
    statusBar();

    // Status bar notification icons
    QFrame *frameBlocks = new QFrame();
    frameBlocks->setContentsMargins(0,0,0,0);
    frameBlocks->setMinimumWidth(56);
    frameBlocks->setMaximumWidth(56);
    QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
    frameBlocksLayout->setContentsMargins(3,0,3,0);
    frameBlocksLayout->setSpacing(3);
    labelEncryptionIcon = new QLabel();
    labelConnectionsIcon = new QLabel();
    labelBlocksIcon = new QLabel();
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelEncryptionIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelConnectionsIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelBlocksIcon);
    frameBlocksLayout->addStretch();

    // Progress bar and label for blocks download
    progressBarLabel = new QLabel();
    progressBarLabel->setVisible(false);
    progressBar = new QProgressBar();
    progressBar->setAlignment(Qt::AlignCenter);
    progressBar->setVisible(false);

    // Override style sheet for progress bar for styles that have a segmented progress bar,
    // as they make the text unreadable (workaround for issue #1071)
    // See https://qt-project.org/doc/qt-4.8/gallery.html
    QString curStyle = QApplication::style()->metaObject()->className();
    if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
    {
        progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }");
    }

    statusBar()->addWidget(progressBarLabel);
    statusBar()->addWidget(progressBar);
    statusBar()->addPermanentWidget(frameBlocks);

    syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this);

    rpcConsole = new RPCConsole(this);
    connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));

    // Install event filter to be able to catch status tip events (QEvent::StatusTip)
    this->installEventFilter(this);
}
Exemplo n.º 28
0
BitcoinGUI::BitcoinGUI(QWidget *parent):
    QMainWindow(parent),
    clientModel(0),
    walletModel(0),
    encryptWalletAction(0),
    changePassphraseAction(0),
    unlockWalletAction(0),
    lockWalletAction(0),
    aboutQtAction(0),
    trayIcon(0),
    notificator(0),
    rpcConsole(0)
    
{
    resize(850, 550);
    setWindowTitle(tr("Zimstake") + " - " + tr("Wallet"));
#ifndef Q_OS_MAC
    qApp->setWindowIcon(QIcon(":icons/zimstake"));
    setWindowIcon(QIcon(":icons/zimstake"));
#else
    setUnifiedTitleAndToolBarOnMac(true);
    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif

    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon
    createActions();

    // Create application menu bar
    createMenuBar();

    // Create the toolbars
    createToolBars();

    // Create the tray icon (or setup the dock icon)
    createTrayIcon();

    // Create tabs
    overviewPage = new OverviewPage();
    blockExplorer = new BlockExplorer(this);
	chatWindow = new ChatWindow(this);

    transactionsPage = new QWidget(this);
    QVBoxLayout *vbox = new QVBoxLayout();
    transactionView = new TransactionView(this);
    vbox->addWidget(transactionView);
    transactionsPage->setLayout(vbox);

    addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);

    receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);

    sendCoinsPage = new SendCoinsDialog(this);

    signVerifyMessageDialog = new SignVerifyMessageDialog(this);

    centralWidget = new QStackedWidget(this);
    centralWidget->addWidget(overviewPage);
    centralWidget->addWidget(blockExplorer);
	centralWidget->addWidget(chatWindow);
    centralWidget->addWidget(transactionsPage);
    centralWidget->addWidget(addressBookPage);
    centralWidget->addWidget(receiveCoinsPage);
    centralWidget->addWidget(sendCoinsPage);
    setCentralWidget(centralWidget);

    // Create status bar
    statusBar();

    // Status bar notification icons
    QFrame *frameBlocks = new QFrame();
    frameBlocks->setContentsMargins(0,0,0,0);
    frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
    QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
    frameBlocksLayout->setContentsMargins(3,0,3,0);
    frameBlocksLayout->setSpacing(3);
    labelEncryptionIcon = new QLabel();
    labelStakingIcon = new QLabel();
    labelConnectionsIcon = new QLabel();
    labelBlocksIcon = new QLabel();
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelEncryptionIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelStakingIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelConnectionsIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelBlocksIcon);
    frameBlocksLayout->addStretch();

    if (GetBoolArg("-staking", true))
    {
        QTimer *timerStakingIcon = new QTimer(labelStakingIcon);
        connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon()));
        timerStakingIcon->start(30 * 1000);
        updateStakingIcon();
    }

    // Progress bar and label for blocks download
    progressBarLabel = new QLabel();
    progressBarLabel->setVisible(false);
    progressBar = new QProgressBar();
    progressBar->setAlignment(Qt::AlignCenter);
    progressBar->setVisible(false);

    // Override style sheet for progress bar for styles that have a segmented progress bar,
    // as they make the text unreadable (workaround for issue #1071)
    // See https://qt-project.org/doc/qt-4.8/gallery.html
    QString curStyle = qApp->style()->metaObject()->className();
    if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
    {
        //statusBar()->setObjectName("QProgressBar");
    }

    statusBar()->addWidget(progressBarLabel);
    statusBar()->addWidget(progressBar);
    statusBar()->addPermanentWidget(frameBlocks);

    syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this);

    // Clicking on a transaction on the overview page simply sends you to transaction history page
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));

    // Double-clicking on a transaction on the transaction history page shows details
    connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));

    rpcConsole = new RPCConsole(this);
    connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));

    // Clicking on "Verify Message" in the address book sends you to the verify message tab
    connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
    // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab
    connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));

    gotoOverviewPage();
}
BitcoinGUI::BitcoinGUI(QWidget *parent):
    QMainWindow(parent),
    clientModel(0),
    walletModel(0),
    encryptWalletAction(0),
    changePassphraseAction(0),
    aboutQtAction(0),
    trayIcon(0),
    notificator(0),
    rpcConsole(0)
{
    resize(850, 550);
    setWindowTitle(tr("BeerCoin") + " - " + tr("Wallet"));
#ifndef Q_WS_MAC
    qApp->setWindowIcon(QIcon(":icons/bitcoin"));
    setWindowIcon(QIcon(":icons/bitcoin"));
#else
    setUnifiedTitleAndToolBarOnMac(true);
    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon
    createActions();

    // Create application menu bar
    createMenuBar();

    // Create the toolbars
    createToolBars();

    // Create the tray icon (or setup the dock icon)
    createTrayIcon();

    // Create tabs
    overviewPage = new OverviewPage();

    miningPage = new MiningPage(this);

    transactionsPage = new QWidget(this);
    QVBoxLayout *vbox = new QVBoxLayout();
    transactionView = new TransactionView(this);
    vbox->addWidget(transactionView);
    transactionsPage->setLayout(vbox);

    addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);

    receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);

    sendCoinsPage = new SendCoinsDialog(this);

    signVerifyMessageDialog = new SignVerifyMessageDialog(this);

    centralWidget = new QStackedWidget(this);
    centralWidget->addWidget(overviewPage);
    centralWidget->addWidget(miningPage);
    centralWidget->addWidget(transactionsPage);
    centralWidget->addWidget(addressBookPage);
    centralWidget->addWidget(receiveCoinsPage);
    centralWidget->addWidget(sendCoinsPage);
#ifdef FIRST_CLASS_MESSAGING
    centralWidget->addWidget(signVerifyMessageDialog);
#endif
    setCentralWidget(centralWidget);

    // Create status bar
    statusBar();

    // Status bar notification icons
    QFrame *frameBlocks = new QFrame();
    frameBlocks->setContentsMargins(0,0,0,0);
    frameBlocks->setMinimumWidth(73);
    frameBlocks->setMaximumWidth(73);
    QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
    frameBlocksLayout->setContentsMargins(3,0,3,0);
    frameBlocksLayout->setSpacing(3);
    labelEncryptionIcon = new QLabel();
    labelMiningIcon = new QLabel();
    labelConnectionsIcon = new QLabel();
    labelBlocksIcon = new QLabel();
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelEncryptionIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelMiningIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelConnectionsIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelBlocksIcon);
    frameBlocksLayout->addStretch();

    // Progress bar and label for blocks download
    progressBarLabel = new QLabel();
    progressBarLabel->setVisible(false);
    progressBar = new QProgressBar();
    progressBar->setAlignment(Qt::AlignCenter);
    progressBar->setVisible(false);

    statusBar()->addWidget(progressBarLabel);
    statusBar()->addWidget(progressBar);
    statusBar()->addPermanentWidget(frameBlocks);

    syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this);

    // Clicking on a transaction on the overview page simply sends you to transaction history page
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));

    // Doubleclicking on a transaction on the transaction history page shows details
    connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));

    rpcConsole = new RPCConsole(this);
    connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));

    // Clicking on "Verify Message" in the address book sends you to the verify message tab
    connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
    // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab
    connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));

    gotoOverviewPage();
}
Exemplo n.º 30
0
bool GraphicsManager::setupSDLGL(int width, int height, uint32 flags) {
	_fsaaMax = probeFSAA(width, height, flags);

	SDL_GL_SetAttribute(SDL_GL_RED_SIZE    ,   8);
	SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE  ,   8);
	SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE   ,   8);
	SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE  ,   8);
	SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER,   1);

	SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0);
	SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0);

	int x = ConfigMan.getInt("x", SDL_WINDOWPOS_UNDEFINED);
	int y = ConfigMan.getInt("y", SDL_WINDOWPOS_UNDEFINED);

	_screen = SDL_CreateWindow(_windowTitle.c_str(), x, y, width, height, flags);
	if (!_screen)
		return false;

	setWindowIcon(*_screen);

	_gl3       = true;
	_glProfile = SDL_GL_CONTEXT_PROFILE_COMPATIBILITY;

	SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
	SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
	SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK , _glProfile);

	_glContext = SDL_GL_CreateContext(_screen);
	if (_glContext)
		return true;

	// OpenGL 3.2 context not created. Spit out an error message, and try a 2.1 core context.

	_gl3       = false;
	_glProfile = SDL_GL_CONTEXT_PROFILE_CORE;

	warning("Could not create OpenGL 3.2 context: %s", SDL_GetError());
	warning("Your graphics card hardware or driver does not support OpenGL 3.2. "
	        "Attempting to create OpenGL 2.1 context instead");

	SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
	SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
	SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK , _glProfile);

	_glContext = SDL_GL_CreateContext(_screen);
	if (_glContext)
		return true;

	// No OpenGL 2.1 core context. Let SDL decide what to give us.

	_gl3       = false;
	_glProfile = 0;

	SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
	SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
	SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK , _glProfile);

	_glContext = SDL_GL_CreateContext(_screen);
	if (_glContext)
		return true;

	SDL_DestroyWindow(_screen);
	return false;
}