Example #1
0
	void EditorState::initState()
	{
		addUserTag("\\n", "\n");
		addUserTag("CurrentFileName", mFileName);

		mMainPane = new MainPane();
		mMessageBoxFadeControl = new MessageBoxFadeControl();

		mSettingsWindow = new SettingsWindow();
		mSettingsWindow->eventEndDialog = MyGUI::newDelegate(this, &EditorState::notifySettingsWindowEndDialog);

		mOpenSaveFileDialog = new OpenSaveFileDialog();
		mOpenSaveFileDialog->eventEndDialog = MyGUI::newDelegate(this, &EditorState::notifyEndDialog);
		mOpenSaveFileDialog->setFileMask("*.xml");
		mOpenSaveFileDialog->setCurrentFolder(RecentFilesManager::getInstance().getRecentFolder());
		mOpenSaveFileDialog->setRecentFilders(RecentFilesManager::getInstance().getRecentFolders());

		ActionManager::getInstance().eventChanges += MyGUI::newDelegate(this, &EditorState::notifyChanges);

		updateCaption();

		if (!Application::getInstance().getParams().empty())
		{
			mFileName = Application::getInstance().getParams().front();
			addUserTag("CurrentFileName", mFileName);

			load();
			updateCaption();
		}
	}
Example #2
0
//----------------------------------------------------------------------------
// XmlConsole
//----------------------------------------------------------------------------
XmlConsole::XmlConsole(PsiAccount *_pa)
:QWidget()
{
	ui_.setupUi(this);

	pa = _pa;
	pa->dialogRegister(this);
	connect(pa, SIGNAL(updatedAccount()), SLOT(updateCaption()));
	connect(pa->client(), SIGNAL(xmlIncoming(const QString &)), SLOT(client_xmlIncoming(const QString &)));
	connect(pa->client(), SIGNAL(xmlOutgoing(const QString &)), SLOT(client_xmlOutgoing(const QString &)));
	connect(pa->psi(), SIGNAL(accountCountChanged()), this, SLOT(updateCaption()));
	updateCaption();

	prompt = 0;

	ui_.te->setUndoRedoEnabled(false);
	ui_.te->setReadOnly(true);
	ui_.te->setAcceptRichText(false);

	QTextFrameFormat f = ui_.te->document()->rootFrame()->frameFormat();
	f.setBackground(QBrush(Qt::black));
	ui_.te->document()->rootFrame()->setFrameFormat(f);

	connect(ui_.pb_clear, SIGNAL(clicked()), SLOT(clear()));
	connect(ui_.pb_input, SIGNAL(clicked()), SLOT(insertXml()));
	connect(ui_.pb_close, SIGNAL(clicked()), SLOT(close()));
	connect(ui_.pb_dumpRingbuf, SIGNAL(clicked()), SLOT(dumpRingbuf()));
	connect(ui_.ck_enable, SIGNAL(clicked(bool)), ui_.gb_filter, SLOT(setEnabled(bool)));

	resize(560,400);
}
Example #3
0
	void EditorState::initState()
	{
		addUserTag("\\n", "\n");
		setFileName(mFileName);

		mMainPaneControl = new MainPaneControl();

		mSettingsWindow = new SettingsWindow();
		mSettingsWindow->Initialise(SettingsManager::getInstance().getValue("EditorState/SettingsWindowLayout"));
		mSettingsWindow->eventEndDialog.connect(this, &EditorState::notifySettingsWindowEndDialog);

		mCodeGenerator = new CodeGenerator();
		mCodeGenerator->eventEndDialog.connect(this, &EditorState::notifyEndDialogCodeGenerator);

		mOpenSaveFileDialog = new OpenSaveFileDialog();
		mOpenSaveFileDialog->Initialise(SettingsManager::getInstance().getValue("EditorState/OpenSaveFileDialogLayout"));
		mOpenSaveFileDialog->setFileMask("*.layout");
		mOpenSaveFileDialog->eventEndDialog.connect(this, &EditorState::notifyEndDialogOpenSaveFile);
		mOpenSaveFileDialog->setCurrentFolder(RecentFilesManager::getInstance().getRecentFolder());
		mOpenSaveFileDialog->setRecentFolders(RecentFilesManager::getInstance().getRecentFolders());

		updateCaption();

		if (!Application::getInstance().getParams().empty())
		{
			setFileName(Application::getInstance().getParams().front());

			load();
			updateCaption();
		}

		UndoManager::getInstance().eventChanges += MyGUI::newDelegate(this, &EditorState::notifyChanges);
	}
RKCommandEditorWindow::RKCommandEditorWindow (QWidget *parent, bool use_r_highlighting) : RKMDIWindow (parent, RKMDIWindow::CommandEditorWindow) {
	RK_TRACE (COMMANDEDITOR);

	KLibFactory *factory = KLibLoader::self()->factory( "libkatepart" );
	if (factory) {
		// Create the part
		m_doc = (Kate::Document *) factory->create( this, "katepart", "KParts::ReadWritePart" );
		RK_ASSERT (m_doc);
		m_view = (Kate::View *) m_doc->widget();
	}

	// strip down the khtmlpart's GUI. remove some stuff we definitely don't need.
	RKCommonFunctions::removeContainers (m_doc, QStringList::split (',', "bookmarks,tools_spelling,tools_spelling_from_cursor,tools_spelling_selection,switch_to_cmd_line"), true);
	RKCommonFunctions::moveContainer (m_doc, "Menu", "tools", "edit", true);

	m_doc->insertChildClient (new RKCommandEditorWindowPart (m_view, this));

	QHBoxLayout *pLayout = new QHBoxLayout( this, 0, -1, "layout");
	pLayout->addWidget(m_view);

	setIcon (SmallIcon ("source"));

	connect (m_doc, SIGNAL (fileNameChanged ()), this, SLOT (updateCaption ()));
	connect (m_doc, SIGNAL (modifiedChanged ()), this, SLOT (updateCaption ()));		// of course most of the time this causes a redundant call to updateCaption. Not if a modification is undone, however.
	if (use_r_highlighting) setRHighlighting ();

	updateCaption ();	// initialize
}
Example #5
0
void KviWindow::focusInEvent(QFocusEvent *)
{
	if(m_pLastFocusedChild)
	{
		if(m_pLastFocusedChild->hasFocus() && m_pLastFocusedChild->isVisible())
		{
			// focus is still in this window.
			// just make sure that we're the active one.
			if(g_pActiveWindow != this)
				g_pMainWindow->windowActivated(this);
			return;
		}
	}

	// focus doesn't seem to be in this window
	if(!m_pFocusHandler)
	{
		// figure out a child to give focus to.
		// we probably have no KviInput since it would have been grabbed anyway

		if(m_pIrcView)
			m_pFocusHandler = m_pIrcView;
		else
		{
			for(auto & it : children())
			{
				QObject * pObj = it;
				if(pObj->isWidgetType())
				{
					m_pFocusHandler = (QWidget *)pObj;
					break;
				}
			}
		}

		if(m_pFocusHandler)
			m_pFocusHandler->setFocus();
		else
		{
			// else too bad :/
			qDebug("No widget able to handle focus for window %s", objectName().toUtf8().data());
			updateCaption(); // do it anyway
			return;
		}
	}
	else
	{
		m_pFocusHandler->setFocus();
	}

	// Setting the focus to the focus handler usually
	// triggers our filter for the children's focusInEvent
	// which in turn should invoke our filter and make this window the active one.
	// So we should be already the active window at this point.
	// If we're not, then fix this.
	if(g_pActiveWindow != this)
		g_pMainWindow->windowActivated(this);

	updateCaption();
}
Example #6
0
	void EditorState::notifyEndDialog(Dialog* _sender, bool _result)
	{
		if (_result)
		{
			if (mOpenSaveFileDialog->getMode() == "SaveAs")
			{
				RecentFilesManager::getInstance().setRecentFolder(mOpenSaveFileDialog->getCurrentFolder());
				mFileName = common::concatenatePath(mOpenSaveFileDialog->getCurrentFolder(), mOpenSaveFileDialog->getFileName());
				addUserTag("CurrentFileName", mFileName);

				save();
				updateCaption();
			}
			else if (mOpenSaveFileDialog->getMode() == "Load")
			{
				RecentFilesManager::getInstance().setRecentFolder(mOpenSaveFileDialog->getCurrentFolder());
				mFileName = common::concatenatePath(mOpenSaveFileDialog->getCurrentFolder(), mOpenSaveFileDialog->getFileName());
				addUserTag("CurrentFileName", mFileName);

				load();
				updateCaption();
			}
		}

		mOpenSaveFileDialog->endModal();
	}
Example #7
0
Foo::Foo()
{
//! [0]
    QTimer *timer = new QTimer(this);
//! [0] //! [1]
    connect(timer, SIGNAL(timeout()), this, SLOT(updateCaption()));
//! [1] //! [2]
    timer->start(1000);
//! [2]

//! [3]
    QTimer::singleShot(200, this, SLOT(updateCaption()));
//! [3]

    {
    // ZERO-CASE
//! [4]
    QTimer *timer = new QTimer(this);
//! [4] //! [5]
    connect(timer, SIGNAL(timeout()), this, SLOT(processOneThing()));
//! [5] //! [6]
    timer->start();
//! [6]
    }
}
Example #8
0
void KSnapshot::slotRegionGrabbed( const QPixmap &pix )
{
    if ( !pix.isNull() )
    {
        snapshot = pix;
        updatePreview();
        modified = true;
        updateCaption();
    }

    if ( snapshot.isNull() )
    {
        mainWidget->ok_btn->setEnabled(false);
        mainWidget->save_btn->setEnabled(false);
    }
    else
    {
        mainWidget->ok_btn->setEnabled(true);
        mainWidget->save_btn->setEnabled(true);
    }

    if( mode() == KSnapshotObject::Region )
    {
        rgnGrab->deleteLater();
    }
    else if( mode() == KSnapshotObject::FreeRegion ) {
        freeRgnGrab->deleteLater();
    }

    QApplication::restoreOverrideCursor();
    show();
}
Example #9
0
void KSnapshot::slotWindowGrabbed( const QPixmap &pix )
{
    if ( !pix.isNull() )
    {
        snapshot = pix;
        updatePreview();
        modified = true;
        updateCaption();

    }

    if ( snapshot.isNull() )
    {
        mainWidget->ok_btn->setEnabled(false);
        mainWidget->save_btn->setEnabled(false);
    }
    else
    {
        mainWidget->ok_btn->setEnabled(true);
        mainWidget->save_btn->setEnabled(true);
    }

    QApplication::restoreOverrideCursor();
    show();
}
Example #10
0
	void EditorState::loadDropFile()
	{
		setFileName(mDropFileName);

		load();
		updateCaption();
	}
Example #11
0
	StateTextureControl::StateTextureControl(MyGUI::Widget* _parent) :
		TextureToolControl(_parent),
		mAreaSelectorControl(nullptr),
		mGridStep(0)
	{
		mTypeName = MyGUI::utility::toString((size_t)this);

		// сразу рисуем рамки для стейтов
		std::vector<MyGUI::IntCoord> coords(8);
		drawUnselectedStates(coords);

		addSelectorControl(mAreaSelectorControl);

		mAreaSelectorControl->eventChangePosition += MyGUI::newDelegate(this, &StateTextureControl::notifyChangePosition);

		CommandManager::getInstance().registerCommand("Command_MoveLeft", MyGUI::newDelegate(this, &StateTextureControl::CommandMoveLeft));
		CommandManager::getInstance().registerCommand("Command_MoveRight", MyGUI::newDelegate(this, &StateTextureControl::CommandMoveRight));
		CommandManager::getInstance().registerCommand("Command_MoveTop", MyGUI::newDelegate(this, &StateTextureControl::CommandMoveTop));
		CommandManager::getInstance().registerCommand("Command_MoveBottom", MyGUI::newDelegate(this, &StateTextureControl::CommandMoveBottom));
		CommandManager::getInstance().registerCommand("Command_GridMoveLeft", MyGUI::newDelegate(this, &StateTextureControl::CommandGridMoveLeft));
		CommandManager::getInstance().registerCommand("Command_GridMoveRight", MyGUI::newDelegate(this, &StateTextureControl::CommandGridMoveRight));
		CommandManager::getInstance().registerCommand("Command_GridMoveTop", MyGUI::newDelegate(this, &StateTextureControl::CommandGridMoveTop));
		CommandManager::getInstance().registerCommand("Command_GridMoveBottom", MyGUI::newDelegate(this, &StateTextureControl::CommandGridMoveBottom));

		mGridStep = SettingsManager::getInstance().getSector("Settings")->getPropertyValue<int>("Grid");
		SettingsManager::getInstance().eventSettingsChanged += MyGUI::newDelegate(this, &StateTextureControl::notifySettingsChanged);

		initialiseAdvisor();

		updateCaption();
	}
Example #12
0
void WbDlg::activated() {
	if(pending_ > 0) {
		pending_ = 0;
		updateCaption();
	}
	doFlash(false);
}
Example #13
0
void MainWindow::fileLoad(const std::vector<std::wstring>& paths)
{
	bool ret=m_allList.loadFile(paths);
	if(ret){
		m_paths = paths;
		
		//乱数リストの作成
		rndtable.generateTable(m_allList);
		//
		if(rndtable.getCurrentSize()>0){
			qindex=rndtable.getNext();
			showQes();
		}else{
			showNone();
		}
	}else{
		rndtable.clearAll();
		messageBox(L"読み込みに失敗しました",L"エラー");
		m_allList.dispose();
		qindex=0;
		showNone();
		setText(L"Paracka");
	}
	updateCaption();
}
Example #14
0
	WorkspaceControl::WorkspaceControl(MyGUI::Widget* _parent) :
		TextureToolControl(_parent),
		mAreaSelectorControl(nullptr),
		mGridStep(0),
		mCurrentWidget(nullptr),
		mMoveableWidget(false),
		mPositionSelectorCreatorControl(nullptr),
		mFreeChildMode(false)
	{
		SettingsSector* sector = SettingsManager::getInstance().getSector("Workspace");
		MyGUI::IntSize size = sector->getPropertyValue<MyGUI::IntSize>("TextureSize");
		setTextureName(sector->getPropertyValue("TextureName"));
		setTextureRegion(MyGUI::IntCoord(0, 0, size.width, size.height));

		addSelectorControl(mAreaSelectorControl);
		mAreaSelectorControl->eventChangePosition += MyGUI::newDelegate(this, &WorkspaceControl::notifyChangePosition);

		addSelectorControl(mPositionSelectorCreatorControl);
		mPositionSelectorCreatorControl->setEnabled(false);
		mPositionSelectorCreatorControl->setVisible(false);

		mGridStep = SettingsManager::getInstance().getSector("Settings")->getPropertyValue<int>("Grid");
		SettingsManager::getInstance().eventSettingsChanged += MyGUI::newDelegate(this, &WorkspaceControl::notifySettingsChanged);

		WidgetSelectorManager::getInstance().eventChangeSelectedWidget += MyGUI::newDelegate(this, &WorkspaceControl::notifyChangeSelectedWidget);
		notifyChangeSelectedWidget(nullptr);

		EditorWidgets::getInstance().eventChangeWidgetCoord += MyGUI::newDelegate(this, &WorkspaceControl::notifyPropertyChangeCoord);

		CommandManager::getInstance().registerCommand("Command_MoveLeft", MyGUI::newDelegate(this, &WorkspaceControl::Command_MoveLeft));
		CommandManager::getInstance().registerCommand("Command_MoveRight", MyGUI::newDelegate(this, &WorkspaceControl::Command_MoveRight));
		CommandManager::getInstance().registerCommand("Command_MoveTop", MyGUI::newDelegate(this, &WorkspaceControl::Command_MoveTop));
		CommandManager::getInstance().registerCommand("Command_MoveBottom", MyGUI::newDelegate(this, &WorkspaceControl::Command_MoveBottom));
		CommandManager::getInstance().registerCommand("Command_SizeLeft", MyGUI::newDelegate(this, &WorkspaceControl::Command_SizeLeft));
		CommandManager::getInstance().registerCommand("Command_SizeRight", MyGUI::newDelegate(this, &WorkspaceControl::Command_SizeRight));
		CommandManager::getInstance().registerCommand("Command_SizeTop", MyGUI::newDelegate(this, &WorkspaceControl::Command_SizeTop));
		CommandManager::getInstance().registerCommand("Command_SizeBottom", MyGUI::newDelegate(this, &WorkspaceControl::Command_SizeBottom));

		CommandManager::getInstance().registerCommand("Command_GridMoveLeft", MyGUI::newDelegate(this, &WorkspaceControl::Command_GridMoveLeft));
		CommandManager::getInstance().registerCommand("Command_GridMoveRight", MyGUI::newDelegate(this, &WorkspaceControl::Command_GridMoveRight));
		CommandManager::getInstance().registerCommand("Command_GridMoveTop", MyGUI::newDelegate(this, &WorkspaceControl::Command_GridMoveTop));
		CommandManager::getInstance().registerCommand("Command_GridMoveBottom", MyGUI::newDelegate(this, &WorkspaceControl::Command_GridMoveBottom));
		CommandManager::getInstance().registerCommand("Command_GridSizeLeft", MyGUI::newDelegate(this, &WorkspaceControl::Command_GridSizeLeft));
		CommandManager::getInstance().registerCommand("Command_GridSizeRight", MyGUI::newDelegate(this, &WorkspaceControl::Command_GridSizeRight));
		CommandManager::getInstance().registerCommand("Command_GridSizeTop", MyGUI::newDelegate(this, &WorkspaceControl::Command_GridSizeTop));
		CommandManager::getInstance().registerCommand("Command_GridSizeBottom", MyGUI::newDelegate(this, &WorkspaceControl::Command_GridSizeBottom));

		CommandManager::getInstance().registerCommand("Command_Delete", MyGUI::newDelegate(this, &WorkspaceControl::Command_Delete));
		CommandManager::getInstance().registerCommand("Command_NextItem", MyGUI::newDelegate(this, &WorkspaceControl::Command_NextItem));

		CommandManager::getInstance().registerCommand("Command_FreeChildMode", MyGUI::newDelegate(this, &WorkspaceControl::Command_FreeChildMode));

		WidgetCreatorManager::getInstance().eventChangeCreatorMode += MyGUI::newDelegate(this, &WorkspaceControl::notifyChangeCreatorMode);
		WidgetCreatorManager::getInstance().eventChangeSelector += MyGUI::newDelegate(this, &WorkspaceControl::notifyChangeSelectorCreator);

		updateCaption();

		MyGUI::Gui::getInstance().eventFrameStart += MyGUI::newDelegate(this, &WorkspaceControl::notifyFrameStart);
	}
Example #15
0
void KexiWindow::dirtyChanged(KexiView* view)
{
    if (!d->dirtyChangedEnabled)
        return;
    d->viewThatRecentlySetDirtyFlag = isDirty() ? view : 0;
    updateCaption();
    emit dirtyChanged(this);
}
Example #16
0
ScreenWidget::ScreenWidget(QWidget *parent) :
    QWidget(parent)
{
    QTimer *timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(updateCaption()));
    timer->start(100);

}
Example #17
0
	void EditorState::loadDropFile()
	{
		mFileName = mDropFileName;
		addUserTag("CurrentFileName", mFileName);

		load();
		updateCaption();
	}
Example #18
0
void ListView::disableView()
{
    m_list->setModel( NULL );

    disconnect( m_list->selectionModel(), SIGNAL( selectionChanged( const QItemSelection&, const QItemSelection& ) ),
        this, SLOT( updateActions() ) );

    updateCaption();
}
Example #19
0
void BHelpBrowserPrivate::retranslateUi()
{
    tbtnBackward->setToolTip( tr("Back", "tbtn toolTip") );
    tbtnForward->setToolTip( tr("Forward", "tbtn toolTip") );
    tbtnHome->setToolTip( tr("Home", "tbtn toolTip") );
    lblSearch->setText(tr("Search:", "lbl text") + " ");
    btnFind->setText(tr("Find", "btn text"));
    updateCaption();
}
Example #20
0
void KviWindow::youAreUndocked()
{
	m_bIsDocked = false;
	setWindowIcon(QIcon(*myIconPtr()));
	updateCaption();

	QPoint pPos = g_pMainWindow->pos();
	move(pPos.x() + 50, pPos.y() + 50);
}
Example #21
0
	void PropertyControl::setProperty(PropertyPtr _value)
	{
		unadvice();
		mProperty = _value;
		advice();

		updateCaption();
		updateProperty();
	}
Example #22
0
bool Forever::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: updateCaption(); break;
    default:
	return QWidget::qt_invoke( _id, _o );
    }
    return TRUE;
}
Example #23
0
	void EditorState::command_UpdateItemName(const MyGUI::UString& _commandName, bool& _result)
	{
		if (!checkCommand())
			return;

		setFileName(mFileName);
		updateCaption();

		_result = true;
	}
fontLoadDialog::fontLoadDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::fontLoadDialog)
{
    ui->setupUi(this);
    setWindowFlags(Qt::FramelessWindowHint);
    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(updateCaption()));
    timer->start(60000);
}
Example #25
0
	//---------------------------------------------------------------------------
	void WorldViewWindow::worldActiveChanged(const WorldEvent& _evt)
	{
		if(mWorldActive != mWorld->isActive())
		{
			updateCaption();
			updateInactiveShower();
			if(mWorld->isActive())
				getWindow()->upLayerItem();
		}
	}
Example #26
0
	void EditorState::clear()
	{
		SkinManager::getInstance().clear();
		ActionManager::getInstance().setChanges(false);

		mFileName = mDefaultFileName;
		addUserTag("CurrentFileName", mFileName);

		updateCaption();
	}
Example #27
0
//----------------------------------------------------------------------------
// XmlConsole
//----------------------------------------------------------------------------
XmlConsole::XmlConsole(PsiAccount *_pa)
:QWidget()
{
#ifdef YAPSI
	setStyle(YaStyle::defaultStyle());
#endif
	ui_.setupUi(this);

	pa = _pa;
	pa->dialogRegister(this);
	connect(pa, SIGNAL(updatedAccount()), SLOT(updateCaption()));
	connect(pa->client(), SIGNAL(xmlIncoming(const QString &)), SLOT(client_xmlIncoming(const QString &)));
	connect(pa->client(), SIGNAL(xmlOutgoing(const QString &)), SLOT(client_xmlOutgoing(const QString &)));
	connect(pa->psi(), SIGNAL(accountCountChanged()), this, SLOT(updateCaption()));
	updateCaption();

	prompt = 0;

	ui_.te->setUndoRedoEnabled(false);
	ui_.te->setReadOnly(true);
	ui_.te->setTextFormat(Qt::PlainText);

	QTextFrameFormat f = ui_.te->document()->rootFrame()->frameFormat();
	f.setBackground(QBrush(Qt::black));
	ui_.te->document()->rootFrame()->setFrameFormat(f);

	connect(ui_.pb_clear, SIGNAL(clicked()), SLOT(clear()));
	connect(ui_.pb_input, SIGNAL(clicked()), SLOT(insertXml()));
	connect(ui_.pb_close, SIGNAL(clicked()), SLOT(close()));
	connect(ui_.pb_dumpRingbuf, SIGNAL(clicked()), SLOT(dumpRingbuf()));
	connect(ui_.ck_enable, SIGNAL(clicked(bool)), ui_.gb_filter, SLOT(setEnabled(bool)));

#ifdef DEFAULT_XMLCONSOLE
	enable();
#endif

#ifdef YAPSI
	YaStyle::makeMeNativeLooking(this);
#endif

	resize(560,400);
}
Example #28
0
	void EditorState::clear()
	{
		DataManager::getInstance().clear();
		ActionManager::getInstance().reset();
		DataSelectorManager::getInstance().changeParent(DataManager::getInstance().getRoot());

		mFileName = mDefaultFileName;
		addUserTag("CurrentFileName", mFileName);

		updateCaption();
	}
Example #29
0
bool KviQueryWindow::nickChange(const QString & szOldNick, const QString & szNewNick)
{
	bool bRet = m_pUserListView->nickChange(szOldNick, szNewNick);
	if(!bRet)
		return false; // ugh!! ?

	setWindowName(szNewNick);
	updateCaption();
	updateLabelText();
	return true;
}
Example #30
0
void KviWindow::applyOptions()
{
    updateCaption();
    if(m_pIrcView)
        m_pIrcView->applyOptions();
    if(m_pInput)
        m_pInput->applyOptions();

    // trick: relayout
    resize(width() - 1,height() - 1);
    resize(width() + 1,height() + 1);
}