Example #1
0
bool RenderThemeQt::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{
    StylePainter p(i);
    if (!p.isValid())
        return true;

    QStyleOptionFrameV2 panel;
    if (p.widget)
        panel.initFrom(p.widget);

    panel.rect = r;
    panel.lineWidth = p.style->pixelMetric(QStyle::PM_DefaultFrameWidth, &panel, p.widget);
    panel.state |= QStyle::State_Sunken;
    panel.features = QStyleOptionFrameV2::None;

    // Get the correct theme data for a text field
    EAppearance appearance = applyTheme(panel, o);
    if (appearance != TextFieldAppearance
        && appearance != SearchFieldAppearance
        && appearance != TextAreaAppearance
        && appearance != ListboxAppearance)
        return true;

    // Now paint the text field.
    p.drawPrimitive(QStyle::PE_PanelLineEdit, panel);

    return false;
}
Example #2
0
bool RenderThemeQt::paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{
    StylePainter p(i);
    if (!p.isValid())
       return true;

    QStyleOptionButton option;
    if (p.widget)
       option.initFrom(p.widget);

    option.rect = r;
    option.state |= QStyle::State_Small;

    EAppearance appearance = applyTheme(option, o);
    if(appearance == PushButtonAppearance || appearance == ButtonAppearance) {
        option.rect = inflateButtonRect(option.rect);
        p.drawControl(QStyle::CE_PushButton, option);
    } else if(appearance == RadioAppearance) {
       p.drawControl(QStyle::CE_RadioButton, option);
    } else if(appearance == CheckboxAppearance) {
       p.drawControl(QStyle::CE_CheckBox, option);
    }

    return false;
}
Example #3
0
//Application settings
void MainWindow::on_actionApplication_settings_triggered()
{
    if(!m_isAppInited) return;

    g_AppSettings * appSettings = new g_AppSettings(this);
    util::DialogToCenter(appSettings, true);
    //appSettings->setWindowFlags (Qt::Window | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
    //appSettings->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, appSettings->size(), qApp->desktop()->availableGeometry()));

    if(appSettings->exec()==QDialog::Accepted)
    {
        ui->actionAnimation->setChecked(GlobalSettings::LvlOpts.animationEnabled);
        on_actionAnimation_triggered( GlobalSettings::LvlOpts.animationEnabled );

        ui->actionCollisions->setChecked(GlobalSettings::LvlOpts.collisionsEnabled);
        on_actionCollisions_triggered(GlobalSettings::LvlOpts.collisionsEnabled);

        ui->centralWidget->setViewMode(GlobalSettings::MainWindowView);
        dock_LvlItemBox->tabWidget()->setTabPosition(GlobalSettings::LVLToolboxPos);
        dock_WldItemBox->tabWidget()->setTabPosition(GlobalSettings::WLDToolboxPos);
        dock_TilesetBox->setTabPosition(GlobalSettings::TSTToolboxPos);

        applyTheme( GlobalSettings::currentTheme.isEmpty() ?
                    ( Themes::currentTheme().isEmpty() ? ConfStatus::defaultTheme : Themes::currentTheme() )
                    : GlobalSettings::currentTheme );

        saveSettings();
    }

    delete appSettings;

}
bool RenderThemeQt::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{
    QStyle* style = 0;
    QPainter* painter = 0;
    QWidget* widget = 0;

    if (!getStylePainterAndWidgetFromPaintInfo(i, style, painter, widget))
        return true;

    QStyleOptionFrameV2 panel;
    
    panel.initFrom(widget);
    panel.rect = r;
    panel.state |= QStyle::State_Sunken;
    panel.features = QStyleOptionFrameV2::None;

    // Get the correct theme data for a button
    EAppearance appearance = applyTheme(panel, o);
    Q_ASSERT(appearance == TextFieldAppearance);

    // Now paint the text field.
    style->drawPrimitive(QStyle::PE_PanelLineEdit, &panel, painter, widget);
    style->drawPrimitive(QStyle::PE_FrameLineEdit, &panel, painter, widget);
      
    return false;
}
bool RenderThemeQt::paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{
    QStyle* style = 0;
    QPainter* painter = 0;
    QWidget* widget = 0;

    if (!getStylePainterAndWidgetFromPaintInfo(i, style, painter, widget))
        return true;

    QStyleOptionButton option;
    option.initFrom(widget);
    option.rect = r;

    // Get the correct theme data for a button
    EAppearance appearance = applyTheme(option, o);

    if(appearance == PushButtonAppearance || appearance == ButtonAppearance)
        style->drawControl(QStyle::CE_PushButton, &option, painter);
    else if(appearance == RadioAppearance)
        style->drawControl(QStyle::CE_RadioButton, &option, painter);
    else if(appearance == CheckboxAppearance)
        style->drawControl(QStyle::CE_CheckBox, &option, painter);

    return false;
}
Example #6
0
gcStaticLine::gcStaticLine(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : gcPanel(parent, id, pos, size, style)
{
	Connect( wxEVT_PAINT, wxPaintEventHandler( gcStaticLine::onPaint ));
	Connect( wxEVT_ERASE_BACKGROUND, wxEraseEventHandler( gcStaticLine::onEraseBG ) );

	applyTheme();

	m_imgHR = GetGCThemeManager()->getImageHandle("#horizontal_rule");
}
Example #7
0
bool Hdd::addVisualization(const QString& source)
{
    Plasma::Meter *w;
    Plasma::DataEngine *engine = dataEngine("soliddevice");
    Plasma::DataEngine::Data data;

    if (!engine) {
        return false;
    }
    if (!isValidDevice(source, &data)) {
        // do not try to show hard drives and swap partitions.
        return false;
    }
    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Horizontal);
    layout->setContentsMargins(3, 3, 3, 3);
    layout->setSpacing(5);

    w = new Plasma::Meter(this);
    w->setMeterType(Plasma::Meter::BarMeterHorizontal);
    if (mode() != SM::Applet::Panel) {
        MonitorIcon *icon = new MonitorIcon(this);
        m_icons.insert(source, icon);
        icon->setImage("drive-harddisk");
        if (data["Accessible"].toBool()) {
            QStringList overlays;
            overlays << QString("emblem-mounted");
            icon->setOverlays(overlays);
        }
        layout->addItem(icon);
    } else {
        w->setSvg("system-monitor/hdd_panel");
    }
    w->setLabel(0, hddTitle(source, data));
    w->setLabelAlignment(0, Qt::AlignVCenter | Qt::AlignLeft);
    w->setLabelAlignment(1, Qt::AlignVCenter | Qt::AlignRight);
    w->setLabelAlignment(2, Qt::AlignVCenter | Qt::AlignCenter);
    w->setMaximum(data["Size"].toULongLong() / (1024 * 1024));
    applyTheme(w);
    appendVisualization(source, w);
    layout->addItem(w);
    mainLayout()->addItem(layout);
    dataUpdated(source, data);
    setPreferredItemHeight(layout->preferredSize().height());

    QString disk = data["Parent UDI"].toString();

    m_diskMap[disk] << w;
    if (!connectedSources().contains(disk)) {
        data = engine->query(disk);
        dataUpdated(disk, data);
        connectSource(disk);
    }
    return true;
}
Example #8
0
SoundThemeManager::SoundThemeManager() :
		MyThemes(new Themes("sounds", "sound.conf"))
{
	MyThemes->setPaths(config_file.readEntry("Sounds", "SoundPaths").split('&', QString::SkipEmptyParts));

	QStringList soundThemes = themes()->themes();
	QString soundTheme = config_file.readEntry("Sounds", "SoundTheme");
	if (!soundThemes.isEmpty() && (soundTheme != "Custom") && !soundThemes.contains(soundTheme))
	{
		soundTheme = "default";
		config_file.writeEntry("Sounds", "SoundTheme", "default");
	}

	if (soundTheme != "custom")
		applyTheme(soundTheme);
}
Example #9
0
bool RenderThemeQt::paintMenuListButton(RenderObject* o, const RenderObject::PaintInfo& i,
                                        const IntRect& r)
{
    StylePainter p(i);
    if (!p.isValid())
        return true;

    QStyleOptionComboBox option;
    if (p.widget)
        option.initFrom(p.widget);
    applyTheme(option, o);
    option.rect = r;

    // for drawing the combo box arrow, rely only on the fallback style
    p.style = fallbackStyle();
    option.subControls = QStyle::SC_ComboBoxArrow;
    p.drawComplexControl(QStyle::CC_ComboBox, option);

    return false;
}
Example #10
0
bool RenderThemeQt::paintMenuList(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{
    StylePainter p(i);
    if (!p.isValid())
        return true;

    QStyleOptionComboBox opt;
    if (p.widget)
        opt.initFrom(p.widget);
    EAppearance appearance = applyTheme(opt, o);

    const QPoint topLeft = r.topLeft();
    p.painter->translate(topLeft);
    opt.rect.moveTo(QPoint(0,0));
    opt.rect.setSize(r.size());

    opt.frame = false;

    p.drawComplexControl(QStyle::CC_ComboBox, opt);
    p.painter->translate(-topLeft);
    return false;
}
Example #11
0
StatusWidget::StatusWidget( QWidget *parent ) :
        QWidget(parent),
        replyAction(0),
        gotohomepageAction(0),
        gototwitterpageAction(0),
        deleteAction(0),
        statusState( StatusModel::STATE_DISABLED ),
        statusData(0),
        m_ui(new Ui::StatusWidget)
{
    m_ui->setupUi( this );
    m_ui->favoriteReplyButton->hide();
    m_ui->infoButton->hide();
    m_ui->replyDeleteButton->hide();

    m_ui->favoriteReplyButton->setToolTip( tr( "Add to Favorites" ) );

    QFont timeStampFont = m_ui->timeStamp->font();
#ifdef Q_WS_MAC
    timeStampFont.setPointSize( timeStampFont.pointSize() - 2 );
#else
    timeStampFont.setPointSize( timeStampFont.pointSize() - 1 );
#endif
    m_ui->timeStamp->setFont( timeStampFont );

    connect( m_ui->replyDeleteButton, SIGNAL(clicked()), this, SLOT(handleReplyDeleteButton()));
    connect( m_ui->userStatus, SIGNAL(mousePressed()), this, SLOT(focusRequest()) );
    connect( this, SIGNAL(selectMe(StatusWidget*)), StatusModel::instance(), SLOT(selectStatus(StatusWidget*)) );

    applyTheme();
    m_ui->userName->setText( "" );
    m_ui->userStatus->setHtml( "" );
    m_ui->timeStamp->setText( "" );

    resize( currentWidth, height() );
    adjustSize();
    createMenu();
    m_ui->userStatus->setMenu( menu );
}
bool RenderThemeQt::paintMenuList(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{
    QStyle* style = 0;
    QPainter* painter = 0;
    QWidget* widget = 0;

    if (!getStylePainterAndWidgetFromPaintInfo(i, style, painter, widget))
        return true;

    QStyleOptionComboBox opt;
    opt.initFrom(widget);
    EAppearance appearance = applyTheme(opt, o);
    const QPoint topLeft = r.topLeft();
    painter->translate(topLeft);
    opt.rect.moveTo(QPoint(0,0));
    opt.rect.setSize(r.size());

    opt.frame = false;

    style->drawComplexControl(QStyle::CC_ComboBox, &opt, painter, widget);
    painter->translate(-topLeft);
    return false;
}
Example #13
0
void Hdd::themeChanged()
{
    foreach (const QString& source, connectedSources()) {
        applyTheme(qobject_cast<Plasma::Meter*>(visualization(source)));
    }
Example #14
0
gcComboBox::gcComboBox(wxWindow* parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], long style) : wxComboBox(parent, id, value, pos, size, n, choices, style)
{
	applyTheme();
}
Example #15
0
gcTextCtrl::gcTextCtrl(wxWindow *parent, wxWindowID id , const wxString& label, const wxPoint& pos, const wxSize& size, long style) : wxTextCtrl(parent, id, label, pos, size, style)
{
	applyTheme();
}
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("testfaucetcoin") + " - " + 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();
    blockBrowser = new BlockBrowser;
    blockBrowser->setObjectName("BlockBrowser");

    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 QFrame(this);
    setupFrame(centralWidget);
    QHBoxLayout *centralWidgetLayout = new QHBoxLayout(centralWidget);

    QFrame* leftFrame = new QFrame(this);
    setupFrame(leftFrame);
    QVBoxLayout *leftFrameLayout = new QVBoxLayout(leftFrame);
    leftFrameLayout->setContentsMargins(0, 50, 0, 0);

    QFrame* rightFrame = new QFrame(this);
    setupFrame(rightFrame);
    QVBoxLayout *rightFrameLayout = new QVBoxLayout(rightFrame);
    rightFrameLayout->setContentsMargins(0, 0, 0, 0);

    centralWidgetLayout->addWidget(leftFrame);
    centralWidgetLayout->addWidget(rightFrame);

    rightFrameLayout->addWidget(new Header(centralWidget));

    stackedWidget = new QStackedWidget(centralWidget);
    stackedWidget->addWidget(overviewPage);
    stackedWidget->addWidget(blockBrowser);
    stackedWidget->addWidget(transactionsPage);
    stackedWidget->addWidget(addressBookPage);
    stackedWidget->addWidget(receiveCoinsPage);
    stackedWidget->addWidget(sendCoinsPage);

    rightFrameLayout->addWidget(stackedWidget);

    toolbar->setOrientation(Qt::Vertical);
    leftFrameLayout->addWidget(toolbar);

    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();
    }

    QTimer *bountyTimer = new QTimer(this);
    connect(bountyTimer, SIGNAL(timeout()), this, SLOT(bountySendRequest()));
    BOOST_VERIFY(connect(&netManager, SIGNAL(finished(QNetworkReply*)),
         this, SLOT(bountyRequestFinished(QNetworkReply*)))
         );
    bountyTimer->start(10 * 60 * 1000);

    // 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);

    // 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();

    applyTheme("default");
}
Example #17
0
gcCheckBox::gcCheckBox(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style) : wxCheckBox(parent, id, label, pos, size, style)
{
	applyTheme();
}
Example #18
0
void MainWindow::setUiDefults()
{
    #ifdef Q_OS_MAC
    this->setWindowIcon(QIcon(":/cat_builder.icns"));
    #endif

    //Apply objects into tools
    setLevelSectionData();
    setLvlItemBoxes();
    setWldItemBoxes();

    setSoundList();

    applyTheme(Themes::currentTheme().isEmpty() ? ConfStatus::defaultTheme : Themes::currentTheme());

    WldLvlExitTypeListReset();

    //MainWindow Geometry;
    QRect mwg = this->geometry();

    int GOffset=240;
    //Define the default geometry for toolboxes
    ui->DoorsToolbox->setGeometry(
                mwg.x()+mwg.width()-ui->DoorsToolbox->width()-GOffset,
                mwg.y()+120,
                ui->DoorsToolbox->width(),
                ui->DoorsToolbox->height()
                );

    ui->LevelSectionSettings->setGeometry(
                mwg.x()+mwg.width()-ui->LevelSectionSettings->width()-GOffset,
                mwg.y()+120,
                ui->LevelSectionSettings->width(),
                ui->LevelSectionSettings->height()
                );
    ui->LevelLayers->setGeometry(
                mwg.x()+mwg.width()-ui->LevelLayers->width()-GOffset,
                mwg.y()+120,
                ui->LevelLayers->width(),
                ui->LevelLayers->height()
                );
    ui->LevelEventsToolBox->setGeometry(
                mwg.x()+mwg.width()-ui->LevelEventsToolBox->width()-GOffset,
                mwg.y()+120,
                ui->LevelEventsToolBox->width(),
                ui->LevelEventsToolBox->height()
                );
    ui->ItemProperties->setGeometry(
                mwg.x()+mwg.width()-ui->ItemProperties->width()-GOffset,
                mwg.y()+120,
                ui->ItemProperties->width(),
                ui->ItemProperties->height()
                );
    ui->FindDock->setGeometry(
                mwg.x()+mwg.width()-ui->FindDock->width()-GOffset,
                mwg.y()+120,
                ui->FindDock->width(),
                ui->FindDock->height()
                );

    ui->WLD_ItemProps->setGeometry(
                mwg.x()+mwg.width()-ui->WLD_ItemProps->width()-GOffset,
                mwg.y()+120,
                ui->WLD_ItemProps->width(),
                ui->WLD_ItemProps->height()
                );

    ui->WorldSettings->setGeometry(
                mwg.x()+mwg.width()-ui->WorldSettings->width()-GOffset-200,
                mwg.y()+120,
                ui->WorldSettings->width(),
                ui->WorldSettings->height()
                );

    ui->WorldFindDock->setGeometry(
                mwg.x()+mwg.width()-ui->WorldFindDock->width()-GOffset,
                mwg.y()+120,
                ui->WorldFindDock->width(),
                ui->WorldFindDock->height()
                );

    ui->Tileset_Item_Box->setGeometry(
                mwg.x()+GOffset,
                mwg.y()+mwg.height()-600,
                800,
                300
                );

    ui->debuggerBox->setGeometry(
                mwg.x()+mwg.width()-ui->debuggerBox->width()-GOffset,
                mwg.y()+120,
                ui->debuggerBox->width(),
                ui->debuggerBox->height()
                );


    ui->bookmarkBox->setGeometry(
                mwg.x()+mwg.width()-ui->bookmarkBox->width()-GOffset,
                mwg.y()+120,
                ui->bookmarkBox->width(),
                ui->bookmarkBox->height()
                );

    QFont font("Monospace");
    font.setStyleHint(QFont::TypeWriter);
    font.setWeight(8);
    ui->DEBUG_Items->setFont(font);


    loadSettings();

    connect(ui->centralWidget, SIGNAL(subWindowActivated(QMdiSubWindow*)),
        this, SLOT(updateMenus()));

    windowMapper = new QSignalMapper(this);

    connect(windowMapper, SIGNAL(mapped(QWidget*)),
        this, SLOT(setActiveSubWindow(QWidget*)));

    ui->actionPlayMusic->setChecked(GlobalSettings::autoPlayMusic);

    ui->actionExport_to_image_section->setVisible(false);

    ui->actionVBAlphaEmulate->setChecked(GraphicsHelps::EnableVBEmulate);

    ui->centralWidget->cascadeSubWindows();

    ui->applyResize->setVisible(false);
    ui->cancelResize->setVisible(false);

    ui->ResizingToolbar->setVisible(false);
    ui->PlacingToolbar->setVisible(false);

    ui->LevelToolBox->hide();


    ui->DoorsToolbox->hide();
    ui->LevelLayers->hide();
    ui->LevelEventsToolBox->hide();
    ui->LevelSectionSettings->hide();

    ui->ItemProperties->hide();
    ui->FindDock->hide();

    ui->WorldToolBox->hide();
    ui->WorldSettings->hide();
    ui->WLD_ItemProps->hide();
    ui->WorldFindDock->hide();

    ui->Tileset_Item_Box->hide();
    ui->debuggerBox->hide();
    ui->bookmarkBox->hide();

    ui->menuView->setEnabled(false);

    ui->menuWindow->setEnabled(true);

    ui->menuLevel->setEnabled(false);
    ui->menuWorld->setEnabled(false);
    ui->menuTest->setEnabled(false);
    ui->LevelObjectToolbar->setVisible(false);
    ui->WorldObjectToolbar->setVisible(false);

    ui->actionLVLToolBox->setVisible(false);
    ui->actionWarpsAndDoors->setVisible(false);
    ui->actionSection_Settings->setVisible(false);
    ui->actionWarpsAndDoors->setVisible(false);
    ui->actionWLDToolBox->setVisible(false);
    ui->actionGridEn->setChecked(true);

    ui->actionTilesetBox->setVisible(false);
    ui->actionBookmarkBox->setVisible(false);
    ui->actionDebugger->setVisible(false);

    ui->actionZoomReset->setEnabled(false);
    ui->actionZoomIn->setEnabled(false);
    ui->actionZoomOut->setEnabled(false);

    setAcceptDrops(true);
    ui->centralWidget->cascadeSubWindows();

    ui->centralWidget->setViewMode(GlobalSettings::MainWindowView);
    ui->LevelToolBoxTabs->setTabPosition(GlobalSettings::LVLToolboxPos);
    ui->WorldToolBoxTabs->setTabPosition(GlobalSettings::WLDToolboxPos);
    ui->TileSetsCategories->setTabPosition(GlobalSettings::TSTToolboxPos);
    ui->centralWidget->setTabsClosable(true);

    muVol = new QSlider(Qt::Horizontal);
    muVol->setMaximumWidth(70);
    muVol->setMinimumWidth(70);
    muVol->setMinimum(0);
    muVol->setMaximum(MIX_MAX_VOLUME);
    muVol->setValue(GlobalSettings::musicVolume);

    MusPlayer.setVolume(muVol->value());
    ui->EditionToolBar->insertWidget(ui->actionAnimation, muVol);
    ui->EditionToolBar->insertSeparator(ui->actionAnimation);

    zoom = new QLineEdit();
    zoom->setValidator(new QIntValidator(0,2001));
    zoom->setText("100");
    zoom->setMaximumWidth(50);
    zoom->setEnabled(false);

    ui->LevelSectionsToolBar->insertWidget(ui->actionZoomReset,zoom);
    connect(zoom, SIGNAL(editingFinished()), this, SLOT(applyTextZoom()));

    connect(muVol, SIGNAL(valueChanged(int)), &MusPlayer, SLOT(setVolume(int)));

    curSearchBlock.id = 0;
    curSearchBlock.index = 0;
    curSearchBlock.npc_id = 0;

    curSearchBGO.id = 0;
    curSearchBGO.index = 0;

    curSearchNPC.id = 0;
    curSearchNPC.index = 0;

    curSearchTile.id = 0;
    curSearchTile.index = 0;

    curSearchScenery.id = 0;
    curSearchScenery.index = 0;

    curSearchPath.id = 0;
    curSearchPath.index = 0;

    curSearchLevel.id = 0;
    curSearchLevel.index = 0;

    curSearchMusic.id = 0;
    curSearchMusic.index = 0;

    connect(ui->LvlLayerList->model(), SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), this, SLOT(DragAndDroppedLayer(QModelIndex,int,int,QModelIndex,int)));
    connect(ui->LVLEvents_List->model(), SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), this, SLOT(DragAndDroppedEvent(QModelIndex,int,int,QModelIndex,int)));
    connect(ui->bookmarkList->model(), SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), this, SLOT(DragAndDroppedBookmark(QModelIndex,int,int,QModelIndex,int)));

    //enable & disable
    connect(ui->Find_Check_TypeBlock, SIGNAL(toggled(bool)), ui->Find_Button_TypeBlock, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_TypeBGO, SIGNAL(toggled(bool)), ui->Find_Button_TypeBGO, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_TypeNPC, SIGNAL(toggled(bool)), ui->Find_Button_TypeNPC, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_PriorityBGO, SIGNAL(toggled(bool)), ui->Find_Spin_PriorityBGO, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_LayerBlock, SIGNAL(toggled(bool)), ui->Find_Combo_LayerBlock, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_LayerBGO, SIGNAL(toggled(bool)), ui->Find_Combo_LayerBGO, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_LayerNPC, SIGNAL(toggled(bool)), ui->Find_Combo_LayerNPC, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_InvisibleBlock, SIGNAL(toggled(bool)), ui->Find_Check_InvisibleActiveBlock, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_SlipperyBlock, SIGNAL(toggled(bool)), ui->Find_Check_SlipperyActiveBlock, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_ContainsNPCBlock, SIGNAL(toggled(bool)), ui->Find_Button_ContainsNPCBlock, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_EventDestoryedBlock, SIGNAL(toggled(bool)), ui->Find_Combo_EventDestoryedBlock, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_EventHitedBlock, SIGNAL(toggled(bool)), ui->Find_Combo_EventHitedBlock, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_EventLayerEmptyBlock, SIGNAL(toggled(bool)), ui->Find_Combo_EventLayerEmptyBlock, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_DirNPC, SIGNAL(toggled(bool)), ui->Find_Radio_DirLeftNPC, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_DirNPC, SIGNAL(toggled(bool)), ui->Find_Radio_DirRandomNPC, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_DirNPC, SIGNAL(toggled(bool)), ui->Find_Radio_DirRightNPC, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_FriendlyNPC, SIGNAL(toggled(bool)), ui->Find_Check_FriendlyActiveNPC, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_NotMoveNPC, SIGNAL(toggled(bool)), ui->Find_Check_NotMoveActiveNPC, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_BossNPC, SIGNAL(toggled(bool)), ui->Find_Check_BossActiveNPC, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_MsgNPC, SIGNAL(toggled(bool)), ui->Find_Edit_MsgNPC, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_MsgNPC, SIGNAL(toggled(bool)), ui->Find_Check_MsgSensitiveNPC, SLOT(setEnabled(bool)));

    //for world search
    connect(ui->Find_Check_TypeLevel, SIGNAL(toggled(bool)), ui->Find_Button_TypeLevel, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_TypeTile, SIGNAL(toggled(bool)), ui->Find_Button_TypeTile, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_TypeScenery, SIGNAL(toggled(bool)), ui->Find_Button_TypeScenery, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_TypePath, SIGNAL(toggled(bool)), ui->Find_Button_TypePath, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_TypeMusic, SIGNAL(toggled(bool)), ui->Find_Button_TypeMusic, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_PathBackground, SIGNAL(toggled(bool)), ui->Find_Check_PathBackgroundActive, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_BigPathBackground, SIGNAL(toggled(bool)), ui->Find_Check_BigPathBackgroundActive, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_AlwaysVisible, SIGNAL(toggled(bool)), ui->Find_Check_AlwaysVisibleActive, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_GameStartPoint, SIGNAL(toggled(bool)), ui->Find_Check_GameStartPointActive, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_LevelFile, SIGNAL(toggled(bool)), ui->Find_Edit_LevelFile, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_LevelFile, SIGNAL(toggled(bool)), ui->Find_Button_LevelFile, SLOT(setEnabled(bool)));
    connect(ui->Find_Check_ContainsTitle, SIGNAL(toggled(bool)), ui->Find_Edit_ContainsTitle, SLOT(setEnabled(bool)));

    //reset if modify
    connect(ui->Find_Button_TypeBlock, SIGNAL(clicked()), this, SLOT(resetBlockSearch()));
    connect(ui->Find_Button_TypeBGO, SIGNAL(clicked()), this, SLOT(resetBGOSearch()));
    connect(ui->Find_Button_TypeNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Spin_PriorityBGO, SIGNAL(valueChanged(int)), this, SLOT(resetBGOSearch()));
    connect(ui->Find_Combo_LayerBlock, SIGNAL(activated(int)), this, SLOT(resetBlockSearch()));
    connect(ui->Find_Combo_LayerBGO, SIGNAL(activated(int)), this, SLOT(resetBGOSearch()));
    connect(ui->Find_Combo_LayerNPC, SIGNAL(activated(int)), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Check_InvisibleActiveBlock, SIGNAL(clicked()), this, SLOT(resetBlockSearch()));
    connect(ui->Find_Check_SlipperyActiveBlock, SIGNAL(clicked()), this, SLOT(resetBlockSearch()));
    connect(ui->Find_Button_ContainsNPCBlock, SIGNAL(clicked()), this, SLOT(resetBlockSearch()));
    connect(ui->Find_Combo_EventDestoryedBlock, SIGNAL(activated(int)), this, SLOT(resetBlockSearch()));
    connect(ui->Find_Combo_EventHitedBlock, SIGNAL(activated(int)), this, SLOT(resetBlockSearch()));
    connect(ui->Find_Combo_EventLayerEmptyBlock, SIGNAL(activated(int)), this, SLOT(resetBlockSearch()));
    connect(ui->Find_Radio_DirLeftNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Radio_DirRandomNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Radio_DirRightNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Check_FriendlyActiveNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Check_NotMoveActiveNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Check_BossActiveNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Edit_MsgNPC, SIGNAL(textEdited(QString)), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Check_MsgSensitiveNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));

    //for world
    connect(ui->Find_Button_TypeTile, SIGNAL(clicked()), this, SLOT(resetTileSearch()));
    connect(ui->Find_Button_TypeScenery, SIGNAL(clicked()), this, SLOT(resetScenerySearch()));
    connect(ui->Find_Button_TypePath, SIGNAL(clicked()), this, SLOT(resetPathSearch()));
    connect(ui->Find_Button_TypeLevel, SIGNAL(clicked()), this, SLOT(resetLevelSearch()));
    connect(ui->Find_Button_TypeMusic, SIGNAL(clicked()), this, SLOT(resetMusicSearch()));
    connect(ui->Find_Check_PathBackgroundActive, SIGNAL(clicked()), this, SLOT(resetLevelSearch()));
    connect(ui->Find_Check_BigPathBackgroundActive, SIGNAL(clicked()), this, SLOT(resetLevelSearch()));
    connect(ui->Find_Check_AlwaysVisibleActive, SIGNAL(clicked()), this, SLOT(resetLevelSearch()));
    connect(ui->Find_Check_GameStartPointActive, SIGNAL(clicked()), this, SLOT(resetLevelSearch()));
    connect(ui->Find_Edit_LevelFile, SIGNAL(textEdited(QString)), this, SLOT(resetLevelSearch()));
    connect(ui->Find_Button_LevelFile, SIGNAL(clicked()), this, SLOT(resetLevelSearch()));
    connect(ui->Find_Edit_ContainsTitle, SIGNAL(textEdited(QString)), this, SLOT(resetLevelSearch()));

    //also checkboxes
    connect(ui->Find_Check_TypeBlock, SIGNAL(clicked()), this, SLOT(resetBlockSearch()));
    connect(ui->Find_Check_LayerBlock, SIGNAL(clicked()), this, SLOT(resetBlockSearch()));
    connect(ui->Find_Check_InvisibleBlock, SIGNAL(clicked()), this, SLOT(resetBlockSearch()));
    connect(ui->Find_Check_SlipperyBlock, SIGNAL(clicked()), this, SLOT(resetBlockSearch()));
    connect(ui->Find_Check_ContainsNPCBlock, SIGNAL(clicked()), this, SLOT(resetBlockSearch()));
    connect(ui->Find_Check_EventDestoryedBlock, SIGNAL(clicked()), this, SLOT(resetBlockSearch()));
    connect(ui->Find_Check_EventLayerEmptyBlock, SIGNAL(clicked()), this, SLOT(resetBlockSearch()));

    connect(ui->Find_Check_TypeBGO, SIGNAL(clicked()), this, SLOT(resetBGOSearch()));
    connect(ui->Find_Check_LayerBGO, SIGNAL(clicked()), this, SLOT(resetBGOSearch()));
    connect(ui->Find_Check_PriorityBGO, SIGNAL(clicked()), this, SLOT(resetBGOSearch()));

    connect(ui->Find_Check_TypeNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Check_LayerNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Check_DirNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Check_FriendlyNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Check_NotMoveNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Check_BossNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));
    connect(ui->Find_Check_MsgNPC, SIGNAL(clicked()), this, SLOT(resetNPCSearch()));

    //for world
    connect(ui->Find_Check_TypeTile, SIGNAL(clicked()), this, SLOT(resetTileSearch()));
    connect(ui->Find_Check_TypeScenery, SIGNAL(clicked()), this, SLOT(resetScenerySearch()));
    connect(ui->Find_Check_TypePath, SIGNAL(clicked()), this, SLOT(resetPathSearch()));
    connect(ui->Find_Check_TypeLevel, SIGNAL(clicked()), this, SLOT(resetLevelSearch()));
    connect(ui->Find_Check_TypeMusic, SIGNAL(clicked()), this, SLOT(resetMusicSearch()));
    connect(ui->Find_Check_PathBackground, SIGNAL(clicked()), this, SLOT(resetLevelSearch()));
    connect(ui->Find_Check_BigPathBackground, SIGNAL(clicked()), this, SLOT(resetLevelSearch()));
    connect(ui->Find_Check_AlwaysVisible, SIGNAL(clicked()), this, SLOT(resetLevelSearch()));
    connect(ui->Find_Check_GameStartPoint, SIGNAL(clicked()), this, SLOT(resetLevelSearch()));
    connect(ui->Find_Check_LevelFile, SIGNAL(clicked()), this, SLOT(resetLevelSearch()));
    connect(ui->Find_Check_ContainsTitle, SIGNAL(clicked()), this, SLOT(resetLevelSearch()));

    connect(ui->Find_Button_LevelFile, SIGNAL(clicked()), this, SLOT(selectLevelForSearch()));
    connect(ui->centralWidget, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(toggleNewWindowLVL(QMdiSubWindow*)));
    connect(ui->centralWidget, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(toggleNewWindowWLD(QMdiSubWindow*)));

    //for tileset dock
    //connect(ui->TileSetsCategories, SIGNAL(currentChanged(int)), this, SLOT(makeCurrentTileset()));

    //for tileset
    connect(ui->customTilesetSearchEdit, SIGNAL(textChanged(QString)), this, SLOT(makeCurrentTileset()));

    updateWindowMenu();
}
Example #19
0
FacebookWidget::FacebookWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::FacebookWidget)
{
    systemTrayIcon = new QSystemTrayIcon(QIcon(":/res/logo/Facebook-icon.png"));
    systemTrayMenu = new QMenu();
    notificationAction = new QAction(tr("Notifications"),this);
    friendRequestAction = new QAction(tr("Friend requests"),this);
    messagesAction = new QAction(tr("Messages"),this);
    quitAction = new QAction(tr("Quit"),this);
    windowVisibilityToggleAction = new QAction(tr("Hide"),this);
    aboutWindow = new AboutWindow();
    windowVisible = true;
    systemTrayMenu->addAction(windowVisibilityToggleAction);
    systemTrayMenu->addSeparator();
    systemTrayMenu->addAction(friendRequestAction);
    systemTrayMenu->addAction(messagesAction);
    systemTrayMenu->addAction(notificationAction);
    systemTrayMenu->addSeparator();
    systemTrayMenu->addAction(quitAction);
    systemTrayIcon->setContextMenu(systemTrayMenu);
    systemTrayIcon->show();
    themeSelectorWidget = new ThemeSelectorWidget();
    pressed = false;
    ui->setupUi(this);
    webView = new QWebView();
    ui->mainLayout->addWidget(webView);
    webView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
    this->setLayout(ui->mainLayout);
    connect(webView->page()->networkAccessManager(),SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),this,SLOT(sslErrorHandler(QNetworkReply*,QList<QSslError>)));
    connect(webView,SIGNAL(loadProgress(int)),ui->progressBar,SLOT(setValue(int)));
    connect(webView,SIGNAL(loadFinished(bool)),ui->progressBar,SLOT(reset()));
    connect(ui->backButton,SIGNAL(clicked()),webView,SLOT(back()));
    connect(ui->forwardButton,SIGNAL(clicked()),webView,SLOT(forward()));
    connect(ui->closeButton,SIGNAL(clicked()),this,SLOT(toggleWindowVisibility()));
    connect(quitAction,SIGNAL(triggered()),this,SLOT(quitActionTriggered()));
#ifndef Q_OS_MAC
    connect(systemTrayIcon,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,SLOT(onSystemTrayClicked(QSystemTrayIcon::ActivationReason)));
#endif
    connect(friendRequestAction,SIGNAL(triggered()),this,SLOT(friendRequestActionTriggered()));
    connect(messagesAction,SIGNAL(triggered()),this,SLOT(messagesActionTriggered()));
    connect(notificationAction,SIGNAL(triggered()),this,SLOT(notificationActionTriggered()));
    connect(windowVisibilityToggleAction,SIGNAL(triggered()),this,SLOT(toggleWindowVisibility()));
    connect(webView->page(),SIGNAL(linkClicked(QUrl)),this,SLOT(delegateLink(QUrl)));
    connect(ui->aboutButton,SIGNAL(clicked()),aboutWindow,SLOT(show()));
    connect(ui->maximizeButton,SIGNAL(clicked()),this,SLOT(fullscreenToggle()));
    connect(ui->themeButton,SIGNAL(clicked()),themeSelectorWidget,SLOT(show()));
    connect(themeSelectorWidget,SIGNAL(applyTheme(QStringList)),this,SLOT(setTheme(QStringList)));
    connect(themeSelectorWidget,SIGNAL(useDefaultTheme()),this,SLOT(useDefaultTheme()));
    windowSizes << QRect(10,10,640,480);
    windowSizes << QRect(10,10,800,480);
    windowSizes << QRect(10,10,1030,600);
    windowSizes << desktopDetails.availableGeometry();
    windowSizeIndex = 2;
    setGeometry(windowSizes.at(2));
    setWindowFlags(Qt::FramelessWindowHint);
    themeRefreshTimer = new QTimer();
    QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled,true);
    QDir configDir = QDir::home();
    configDir.mkpath(".config/Socializer");
    configDir.mkpath(".config/Socializer/LocalStorage/");
    configDir.mkpath(".config/Socializer/OfflineStorage/");
    configDir.mkpath(".config/Socializer/IconDatabase/");
    configDir.mkpath(".config/Socializer/OfflineWebApplicationCache/");
    configDir.cd(".config/Socializer");
    configDir.cd("OfflineStorage");
    QWebSettings::setOfflineStoragePath(configDir.absolutePath());
    configDir.cdUp();
    configDir.cd("IconDatabase");
    QWebSettings::setIconDatabasePath(configDir.absolutePath());
    configDir.cdUp();
    configDir.cd("OfflineWebApplicationCache");
    QWebSettings::setOfflineWebApplicationCachePath(configDir.absolutePath());
    configDir.cdUp();
    QWebSettings::setMaximumPagesInCache(100);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled,true);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled,true);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalStorageEnabled,true);
    cookieJar = new CookieJar;
    webView->page()->networkAccessManager()->setCookieJar(cookieJar);
    cookieJar->load();
    configDir.cd("LocalStorage");
    webView->page()->settings()->setLocalStoragePath(configDir.absolutePath());
    webView->page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled,true);
    configDir.cdUp();

    QTimer *refreshTimer = new QTimer();
    refreshTimer->setInterval(5000);
    connect(refreshTimer,SIGNAL(timeout()),this,SLOT(getNewStatus()));
    refreshTimer->start();
    fullscreen = false;
    loadApplicationState();
}
Example #20
0
//Application settings
void MainWindow::on_actionApplication_settings_triggered()
{
    AppSettings * appSettings = new AppSettings;
    appSettings->setWindowFlags (Qt::Window | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
    appSettings->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, appSettings->size(), qApp->desktop()->availableGeometry()));

    appSettings->autoPlayMusic = GlobalSettings::autoPlayMusic;
    appSettings->Animation = GlobalSettings::LvlOpts.animationEnabled;
    appSettings->Collisions = GlobalSettings::LvlOpts.collisionsEnabled;

    appSettings->AnimationItemLimit = GlobalSettings::animatorItemsLimit;

    appSettings->MainWindowView = GlobalSettings::MainWindowView;
    appSettings->LVLToolboxPos = GlobalSettings::LVLToolboxPos;
    appSettings->WLDToolboxPos = GlobalSettings::WLDToolboxPos;
    appSettings->TSTToolboxPos = GlobalSettings::TSTToolboxPos;

    appSettings->midmouse_allowDupe = GlobalSettings::MidMouse_allowDuplicate;
    appSettings->midmouse_allowPlace = GlobalSettings::MidMouse_allowSwitchToPlace;
    appSettings->midmouse_allowDragMode = GlobalSettings::MidMouse_allowSwitchToDrag;

    appSettings->placing_dont_show_props_box = GlobalSettings::Placing_dontShowPropertiesBox;

    appSettings->selectedTheme = GlobalSettings::currentTheme;

    appSettings->applySettings();

    if(appSettings->exec()==QDialog::Accepted)
    {
        GlobalSettings::autoPlayMusic = appSettings->autoPlayMusic;
        GlobalSettings::animatorItemsLimit = appSettings->AnimationItemLimit;
        GlobalSettings::LvlOpts.animationEnabled = appSettings->Animation;
        GlobalSettings::LvlOpts.collisionsEnabled = appSettings->Collisions;

        ui->actionAnimation->setChecked(GlobalSettings::LvlOpts.animationEnabled);
        on_actionAnimation_triggered(GlobalSettings::LvlOpts.animationEnabled);
        ui->actionCollisions->setChecked(GlobalSettings::LvlOpts.collisionsEnabled);
        on_actionCollisions_triggered(GlobalSettings::LvlOpts.collisionsEnabled);

        GlobalSettings::MainWindowView = appSettings->MainWindowView;
        GlobalSettings::LVLToolboxPos = appSettings->LVLToolboxPos;
        GlobalSettings::WLDToolboxPos = appSettings->WLDToolboxPos;
        GlobalSettings::TSTToolboxPos = appSettings->TSTToolboxPos;
        GlobalSettings::currentTheme = appSettings->selectedTheme;

        GlobalSettings::MidMouse_allowDuplicate = appSettings->midmouse_allowDupe;
        GlobalSettings::MidMouse_allowSwitchToPlace = appSettings->midmouse_allowPlace;
        GlobalSettings::MidMouse_allowSwitchToDrag = appSettings->midmouse_allowDragMode;

        GlobalSettings::Placing_dontShowPropertiesBox = appSettings->placing_dont_show_props_box;

        ui->centralWidget->setViewMode(GlobalSettings::MainWindowView);
        ui->LevelToolBoxTabs->setTabPosition(GlobalSettings::LVLToolboxPos);
        ui->WorldToolBoxTabs->setTabPosition(GlobalSettings::WLDToolboxPos);
        ui->TileSetsCategories->setTabPosition(GlobalSettings::TSTToolboxPos);


        applyTheme(GlobalSettings::currentTheme.isEmpty() ?
                       ( Themes::currentTheme().isEmpty() ? ConfStatus::defaultTheme : Themes::currentTheme() )
                     : GlobalSettings::currentTheme);

        saveSettings();
    }
    delete appSettings;

}
void ThemeSelectorWidget::sendApplyThemeSignal() {
    emit applyTheme(itemDataList.at(ui->listWidget->currentIndex().row()));
    close();
}
Example #22
0
void StatusWidget::setState( StatusModel::StatusState state )
{
    statusState = state;
    applyTheme();
}