Exemple #1
0
AS_NAMESPACE_START

EditorTabs::EditorTabs(QWidget *parent)
    : QTabWidget(parent), _finder(nullptr)
{
    _connections << connect(parent, SIGNAL(editCopy()), this, SLOT(onEditCopy()));
    _connections << connect(parent, SIGNAL(editCut()), this, SLOT(onEditCut()));
    _connections << connect(parent, SIGNAL(editFind()), this, SLOT(onEditFind()));
    _connections << connect(parent, SIGNAL(editGoto()), this, SLOT(onEditGoto()));
    _connections << connect(parent, SIGNAL(editPaste()), this, SLOT(onEditPaste()));
    _connections << connect(parent, SIGNAL(editRedo()), this, SLOT(onEditRedo()));
    _connections << connect(parent, SIGNAL(editReplace()), this, SLOT(onEditReplace()));
    _connections << connect(parent, SIGNAL(editUndo()), this, SLOT(onEditUndo()));
    _connections << connect(parent, SIGNAL(fileClose()), this, SLOT(onFileClose()));
    _connections << connect(parent, SIGNAL(fileCloseAll()), this, SLOT(onFileCloseAll()));
    _connections << connect(parent, SIGNAL(fileOpen(QString)), this, SLOT(onFileOpen(QString)));
    _connections << connect(parent, SIGNAL(fileSave()), this, SLOT(onFileSave()));
    _connections << connect(parent, SIGNAL(fileSaveAll()), this, SLOT(onFileSaveAll()));
    _connections << connect(this, &QTabWidget::tabCloseRequested, this, &EditorTabs::onTabCloseRequested);
    _connections << connect(tabBar(), &QTabBar::tabMoved, this, &EditorTabs::onTabMoved);
    _connections << connect(this, &EditorTabs::currentChanged, this, &EditorTabs::onCurrentChanged);
    _connections << connect(this, SIGNAL(fileChanged(QString)), parent, SLOT(onFileChanged(QString)));
    _connections << connect(this, SIGNAL(fileSaved(QString)), parent, SLOT(onFileSaved(QString)));
    setMovable(true);
    setTabsClosable(true);
}
Exemple #2
0
void TailView::setFile(const QString & filename)
{
    m_filename = filename;
    setWindowFilePath(m_filename);

    if(!filename.isEmpty()) {
        m_watcher.reset(new YFileSystemWatcherThread(filename, this));
        connect(m_watcher.data(), SIGNAL(fileChanged()), SLOT(onFileChanged()));
    } else {
        m_watcher.reset();
    }

    verticalScrollBar()->setSliderPosition(0);
    horizontalScrollBar()->setSliderPosition(0);

    onFileChanged();
}
void AbstractImageWriter::watch(const QString& file) {
    delete m_watcher;
    m_watcher = 0;
    if (m_reload_support) {
        m_watcher = new QFileSystemWatcher(this);
        m_watcher->addPath(file);
        connect(m_watcher,SIGNAL(fileChanged(QString)),this,SLOT(onFileChanged(QString)));
    }
}
BootManager::BootManager() :
	m_service(0),
	m_currentState(BOOT_STATE_STARTUP),
	m_compositorAvailable(false)
{
	m_states[BOOT_STATE_STARTUP] = new BootStateStartup();
	m_states[BOOT_STATE_FIRSTUSE] = new BootStateFirstUse();
	m_states[BOOT_STATE_NORMAL] = new BootStateNormal();

	startService();

	connect(WebAppMgrProxy::instance(), SIGNAL(connectionStatusChanged()),
		this, SLOT(onWebAppMgrConnectionStatusChanged()));

	m_fileWatch.addPath("/var/luna/preferences");
	connect(&m_fileWatch, SIGNAL(directoryChanged(QString)), this, SLOT(onFileChanged(QString)));
	connect(&m_fileWatch, SIGNAL(fileChanged(QString)), this, SLOT(onFileChanged(QString)));

	QTimer::singleShot(0, this, SLOT(onInitialize()));
}
Exemple #5
0
Clipboard::Clipboard(QObject *parent)
    : QObject(parent)
    , m_clipboard(new bb::system::Clipboard(this))
    , m_text(QString::fromUtf8(m_clipboard->value("text/plain")))
    , m_clipboardWatcher(new QFileSystemWatcher(this))
{
    connect(m_clipboardWatcher, SIGNAL(fileChanged(QString)), SLOT(onFileChanged(QString)));
    connect(m_clipboardWatcher,
            SIGNAL(directoryChanged(QString)),
            SLOT(onDirectoryChanged(QString)));
    if (QFile::exists(CLIPBOARD_FILE_PATH))
        m_clipboardWatcher->addPath(CLIPBOARD_FILE_PATH);
    else
        m_clipboardWatcher->addPath(CLIPBOARD_PATH);
}
Exemple #6
0
void MainWindow::on_manualSyn_clicked()
{
    // 点击手动同步
    qDebug() << "onMannualSynClicked";
    click = true;
    if(!watchList.empty())
        enableInput(false);
    for(auto path : watchList)
    {
        QFileInfo check(path);
        if(check.isFile())
            onFileChanged(path);
        else if(check.isDir())
            onDirectoryChanged(path);
    }
}
Exemple #7
0
CWorkSpaceItem::CWorkSpaceItem(QObject* parent, CWorkSpaceModel* model)
	: QObject(parent)
	, m_model(model)
	, m_parent(NULL)
	, m_type(UnkownType)
	, m_nodeType(UnkownNodeType)
	, m_assignDocument(NULL)
	, m_buildConfigurations(theConf->buildConf())
{
	m_icon = QIcon(":/images/tango/small/text-x-generic.png");
    m_text = QString("this=%1").arg((long long)this, 0, 16);

	// 新しいUUIDを割り当て
	for(Configuration::BuildConfList::iterator
			ite = m_buildConfigurations.begin(),
			last= m_buildConfigurations.end();
		ite != last; ++ite)
	{
		ite->uuid = QUuid::createUuid();
		if( m_buildTarget.isNull() ) {
			m_buildTarget = ite->uuid;
		}
	}

	if( !model )
	{
		if( CWorkSpaceItem* parentItem = qobject_cast<CWorkSpaceItem*>(parent) )
		{
			m_model = parentItem->model();
		}
		else if( CWorkSpaceModel* parentModel = qobject_cast<CWorkSpaceModel*>(parent) )
		{
			m_model = parentModel;
		}
		else if( QTreeView* parentWidget = qobject_cast<QTreeView*>(parent) )
		{
			if( CWorkSpaceModel* parentModel = qobject_cast<CWorkSpaceModel*>(parentWidget->model()) )
			{
				m_model = parentModel;
			}
		}
	}

	// 通知を登録
	connect(theFile, SIGNAL(filePathChanged(QUuid)), this, SLOT(onFileChanged(QUuid)));
}
Exemple #8
0
void MainWindow::init()
{
    watcher = new QFileSystemWatcher(this);
    timer = NULL;
    connect(watcher,SIGNAL(fileChanged(QString)),this,SLOT(onFileChanged(QString)));
    connect(watcher,SIGNAL(directoryChanged(QString)),this,SLOT(onDirectoryChanged(QString)));
    connect(ui->watchEdit,SIGNAL(textChanged()),this,SLOT(onWatchEditChanged()));
    connect(ui->compareEdit,SIGNAL(textChanged()),this,SLOT(onCompareEditChanged()));
    connect(ui->exceptEdit,SIGNAL(textChanged()),this,SLOT(onExceptEditChanged()));
    // 注册表
    pReg = new regeditHelper;
    connect(pReg,SIGNAL(getetInfoFinished(vector<pair<QString,bool>>)),this,SLOT(onGetRegInfo(vector<pair<QString,bool>>)));
    connect(ui->listWidget,SIGNAL(removeRegItem(QString)),pReg,SLOT(removeRegItem(QString)));
    connect(ui->listWidget,SIGNAL(enableRegItem(QString)),pReg,SLOT(enableRegItem(QString)));
    connect(ui->listWidget,SIGNAL(addRegItem(QString)),pReg,SLOT(addRegItem(QString)));
    pReg->refreshListView();
}
Exemple #9
0
void TailView::setLayoutType(LayoutType layoutType)
{
    m_layoutType = layoutType;
    onFileChanged();
}
Exemple #10
0
void TailView::setFollowTail(bool enabled)
{
    m_followTail = enabled;
    onFileChanged();
}
Exemple #11
0
CWorkSpaceItem::CWorkSpaceItem(QObject* parent, Type type, CWorkSpaceModel* model)
	: QObject(parent)
	, m_model(NULL)
	, m_parent(NULL)
	, m_type(type)
	, m_assignDocument(NULL)
	, m_buildConfigurations(theConf->buildConf())
{
	static const struct {
		NodeType nodeType;
		QString iconPath;
		QString text;
		QString suffixFilter;
	} TypeDefaultAttributes[TypeNum] = {
		{ UnkownNodeType, ":/images/tango/small/text-x-generic.png", "",               "",                                    }, // UnkownType
		{ FileNode,       ":/images/tango/small/text-x-generic.png", tr("(untitled)"), "",                                    }, // File
		{ FolderNode,     ":/images/tango/small/folder.png",         tr("(untitled)"), "",                                    }, // Folder
		{ FolderNode,     ":/images/tango/small/edit-copy.png",      tr("(untitled)"), "",                                    }, // Solution
		{ FileNode,       ":/images/tango/small/folder.png",         tr("(untitled)"), "*.hsp;*.as",                          }, // Project
		{ FolderNode,     ":/images/tango/small/folder.png",         tr("Dependence"), "",                                    }, // DependenceFolder
		{ FolderNode,     ":/images/tango/small/folder.png",         tr("Packfile"),   "*.*",                                 }, // PackFolder
		{ FolderNode,     ":/images/tango/small/folder.png",         tr("Source"),     "*.hsp;*.as",                          }, // SourceFolder
		{ FolderNode,     ":/images/tango/small/folder.png",         tr("Resource"),   "*.png;*.jpg;*.bmp;*.gif;*,wav;*.mid", }, // ResourceFolder
	};

	// 新しいUUIDを割り当て
	for(Configuration::BuildConfList::iterator
			ite = m_buildConfigurations.begin(),
			last= m_buildConfigurations.end();
		ite != last; ++ite)
	{
		ite->uuid = QUuid::createUuid();
		if( m_buildTarget.isNull() ) {
			m_buildTarget = ite->uuid;
		}
	}

	// 種別に応じて属性をセット
	setNodeType(    TypeDefaultAttributes[type].nodeType);
	setIcon(QIcon(  TypeDefaultAttributes[type].iconPath));
	setText(        TypeDefaultAttributes[type].text);
	setSuffixFilter(TypeDefaultAttributes[type].suffixFilter.split(";"));

	m_model = model;

	if( !model )
	{
		if( CWorkSpaceItem* parentItem = qobject_cast<CWorkSpaceItem*>(parent) )
		{
			m_model = parentItem->model();
		}
		else if( CWorkSpaceModel* parentModel = qobject_cast<CWorkSpaceModel*>(parent) )
		{
			m_model = parentModel;
		}
		else if( QTreeView* parentWidget = qobject_cast<QTreeView*>(parent) )
		{
			if( CWorkSpaceModel* parentModel = qobject_cast<CWorkSpaceModel*>(parentWidget->model()) )
			{
				m_model = parentModel;
			}
		}
	}

	// 通知を登録
	connect(theFile, SIGNAL(filePathChanged(QUuid)), this, SLOT(onFileChanged(QUuid)));
}