Exemple #1
0
///@brief Adds author described in the form.
void AddAuthor::save()
{
	if(!validateInput())
		return;
	Author a;
	a.setFirstName(firstNameLineEdit->text());
	a.setLastName(lastNameLineEdit->text());
	a.setDescription(descriptionLineEdit->text());
	a.setCritique(critiqueLineEdit->text());
	a.setPicture(pictureLineEdit->text());
	a.setRating(ratingWidget->getRating());

	a.setThemes(getSelectedThemes());

	try
	{
		c->insertAuthor(a);
	}
	catch(DataBaseException dbe)
	{
		MessageBoxDataBaseException q(&dbe, this);
		q.appendText(tr("The author has not been added."));
		q.exec();
	}
	emit closeRequested();
}
Exemple #2
0
AlbumsFilterBar::AlbumsFilterBar( QGraphicsItem *parent, Qt::WindowFlags wFlags )
    : QGraphicsWidget( parent, wFlags )
    , m_editor( new KLineEdit )
    , m_closeIcon( new Plasma::IconWidget( KIcon("dialog-close"), QString(), this ) )
{
    QGraphicsProxyWidget *editProxy = new QGraphicsProxyWidget( this );
    editProxy->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
    editProxy->setWidget( m_editor );

    m_editor->installEventFilter( this );
    m_editor->setAttribute( Qt::WA_NoSystemBackground );
    m_editor->setAutoFillBackground( true );
    m_editor->setClearButtonShown( true );
    m_editor->setClickMessage( i18n( "Filter Albums" ) );
    m_editor->setContentsMargins( 0, 0, 0, 0 );

    QSizeF iconSize = m_closeIcon->sizeFromIconSize( 16 );
    m_closeIcon->setMaximumSize( iconSize );
    m_closeIcon->setMinimumSize( iconSize );

    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout( Qt::Horizontal, this );
    layout->setSpacing( 1 );
    layout->addItem( editProxy );
    layout->addItem( m_closeIcon );
    layout->setStretchFactor( editProxy, 100 );
    layout->setAlignment( editProxy, Qt::AlignCenter );
    layout->setAlignment( m_closeIcon, Qt::AlignCenter );
    layout->setContentsMargins( 0, 2, 0, 0 );

    m_closeIcon->setToolTip( i18n( "Close" ) );
    connect( m_closeIcon, SIGNAL(clicked()), SIGNAL(closeRequested()) );
    connect( m_editor, SIGNAL(textChanged(QString)), SIGNAL(filterTextChanged(QString)) );
}
Exemple #3
0
	DeclarativeWindow::DeclarativeWindow (const QUrl& url, QVariantMap params,
			const QPoint& orig, ViewManager *viewMgr, ICoreProxy_ptr proxy, QWidget *parent)
	: QDeclarativeView (parent)
	{
		new Util::AutoResizeMixin (orig, [viewMgr] () { return viewMgr->GetFreeCoords (); }, this);

		if (!params.take ("keepOnFocusLeave").toBool ())
			new Util::UnhoverDeleteMixin (this, SLOT (beforeDelete ()));

		setStyleSheet ("background: transparent");
		setWindowFlags (Qt::Tool | Qt::FramelessWindowHint);
		setAttribute (Qt::WA_TranslucentBackground);

		for (const auto& cand : Util::GetPathCandidates (Util::SysPath::QML, ""))
			engine ()->addImportPath (cand);

		rootContext ()->setContextProperty ("colorProxy",
				new Util::ColorThemeProxy (proxy->GetColorThemeManager (), this));
		for (const auto& key : params.keys ())
			rootContext ()->setContextProperty (key, params [key]);
		engine ()->addImageProvider ("ThemeIcons", new Util::ThemeImageProvider (proxy));
		setSource (url);

		connect (rootObject (),
				SIGNAL (closeRequested ()),
				this,
				SLOT (deleteLater ()));
	}
Exemple #4
0
///@brief Adds book described in the form.
void AddBook::save()
{
	if(!validateInput())
		return;
	Book b;
	b.setIsbn(isbnLineEdit->text().toStdString().c_str());
	b.setTitle(titleLineEdit->text());
	b.setEdition(editionLineEdit->text().toInt());
	b.setCritique(critiqueLineEdit->text());
	b.setDescription(descriptionLineEdit->text());
	b.setRating(ratingWidget->getRating());
	b.setCover(coverLineEdit->text());
	b.setEbook(ebookLineEdit->text());
	b.setPubDate(pubDateEdit->date());
	b.setUDC(udcLineEdit->text());

	b.setThemes(getSelectedThemes());
	b.setPublishers(getSelectedPublishers());
	b.setAuthors(getSelectedAuthors());
	b.setTranslator(getSelectedTranslator());

	try
	{
		c->insertBook(b);
	}
	catch(DataBaseException dbe)
	{
		MessageBoxDataBaseException q(&dbe, this);
		q.appendText(tr("The book has not been added."));
		q.exec();
	}
	emit closeRequested();
}
/*!
 * \see navigatorWidget
 */
void ContentWidget::setNavigatorWidget(NavigatorWidget * nav)
{
	if (navigator == nav)
		return;

	bool updatesBlocked = false;
	if (navigator != 0 && navigator->isVisible() && updatesEnabled())
	{
		updatesBlocked = true;
		setUpdatesEnabled(false);
	}

	nav->setParent(this);
	if (navigator != 0)
	{
		nav->setGeometry(navigator->geometry());
		nav->setVisible(navigator->isVisible());
		navigator->setVisible(false);
		navigator->deleteLater();
	}
	navigator = nav;

	connect(navigator, SIGNAL(closeRequested()), this, SLOT(hideNavigator()));
	connect(navigator, SIGNAL(nextImageRequested()), this, SLOT(navigatorNext()));
	connect(navigator, SIGNAL(previousImageRequested()), this, SLOT(navigatorPrev()));

	if (updatesBlocked)
		setUpdatesEnabled(true);
}
Exemple #6
0
void RMdiChildQt::closeEvent(QCloseEvent* closeEvent) {
    // ask before closing (document was modified):
    if (documentInterface != NULL) {
        emit closeRequested(this);
    }
    else {
        closeEvent->accept();
        return;
    }

    // close canceled:
    if (!closeEventAccepted) {
        closeEvent->ignore();
        return;
    }

    if (documentInterface != NULL) {
        if (diLast==documentInterface) {
            diLast = NULL;
        }

        // 20130510: leads to empty layer list, etc when
        // closing background tab
        //RMainWindowQt::getMainWindow()->notifyListeners(true);

        // make sure rulers don't try to access view anymore:
        QList<RRulerQt*> rulers = findChildren<RRulerQt*>();
        for (int i=0; i<rulers.size(); i++) {
            rulers.at(i)->setGraphicsView(NULL);
        }

        // give current action a chance to clean up:
        RAction* action = documentInterface->getCurrentAction();
        if (action!=NULL) {
            action->suspendEvent();
        }

        RDocumentInterface* di = documentInterface;
        documentInterface=NULL;
        delete di;
        di = NULL;
    }
    closeEvent->accept();

#ifndef Q_OS_WIN32
    // part of the workaround for QMdiArea bug
    // with events filtering through all stacked windows:
    QMdiArea* mdiArea = RMainWindowQt::getMainWindow()->getMdiArea();
    QMdiSubWindow* child =  mdiArea->currentSubWindow();
    QList<QMdiSubWindow *> children = mdiArea->subWindowList(QMdiArea::ActivationHistoryOrder);
    int index = children.indexOf(child);
    int nextIndex = children.length()-2;
    nextIndex = nextIndex%children.length();
    if (nextIndex!=index) {
        children.at(nextIndex)->showMaximized();
        mdiArea->setActiveSubWindow(children.at(nextIndex));
    }
#endif
}
Exemple #7
0
Tab::Tab(const QUrl& url, QWidget* parent) : QWidget(parent) {
  _webView = new WebView(url, this);
  _toolBar = new ToolBar(_webView->history(), url, this);
  _searchBar = new SearchBar(this);
  _statusBar = new StatusBar(this);
  
  _layout = new QVBoxLayout(this);
  _layout->setMargin(0);
  _layout->setSpacing(0);
  _layout->addWidget(_toolBar,    0);
  _layout->addWidget(_webView,    1);
  _layout->addWidget(_searchBar,  0);
  _layout->addWidget(_statusBar,  0);

  _showSearchShortcut = new QShortcut(QKeySequence::Find, this);
  _focusAddressShortcut = new QShortcut(Qt::Key_F6, this);

  _searchBar->hide();

  connect(_toolBar, SIGNAL(goBackRequested()), _webView, SLOT(back()));
  connect(_toolBar, SIGNAL(goForwardRequested()), _webView, SLOT(forward()));
  connect(_toolBar, SIGNAL(reloadRequested()), _webView, SLOT(reload()));
  connect(_toolBar, SIGNAL(stopRequested()), _webView, SLOT(stop()));
  connect(_toolBar, SIGNAL(loadRequested(const QUrl&)), _webView, SLOT(setFocus()));
  connect(_toolBar, SIGNAL(loadRequested(const QUrl&)), _webView, SLOT(load(const QUrl&)));
  connect(_webView, SIGNAL(urlChanged(const QUrl&)), _toolBar, SLOT(setUrl(const QUrl&)));
  connect(_webView, SIGNAL(urlChanged(const QUrl&)), _toolBar, SLOT(updateActions()));
  connect(_webView, SIGNAL(loadStarted()), _toolBar, SLOT(enableStopAction()));
  connect(_webView, SIGNAL(loadFinished(bool)), _toolBar, SLOT(disableStopAction()));
  connect(_webView, SIGNAL(titleChanged(const QString&)), this, SLOT(updateTitle()));
  connect(_webView, SIGNAL(iconChanged()), this, SLOT(updateIcon()));
  connect(_searchBar, SIGNAL(searchDataChanged(const QString&, bool, bool)), _webView,
        SLOT(find(const QString&, bool, bool)));
  connect(_searchBar, SIGNAL(closeRequested()), _searchBar, SLOT(hide()));
  connect(_searchBar, SIGNAL(closeRequested()), _webView, SLOT(setFocus()));
  connect(_webView->page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)),
        _statusBar, SLOT(showMessage(const QString&)));
  connect(_webView, SIGNAL(loadProgress(int)), _statusBar->progressBar(), SLOT(setValue(int)));
  connect(_statusBar->slider(), SIGNAL(valueChanged(int)), _webView, SLOT(setZoom(int)));
  connect(_showSearchShortcut, SIGNAL(activated()), _searchBar, SLOT(show()));
  connect(_focusAddressShortcut, SIGNAL(activated()), _toolBar->addressBar(), SLOT(setFocus()));
}
WebPage::WebPage(QUrl baseUrl, QWidget *parent) :
    QWebPage(parent),
    baseUrl_(baseUrl),
    navigated_(false)
{
    settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
    settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
    setNetworkAccessManager(new NetworkAccessManager(sharedSecret, parent));
    defaultSaveDir_ = QDir::home();
    connect(this, SIGNAL(windowCloseRequested()), SLOT(closeRequested()));
}
Exemple #9
0
void Updater::run() {
    connect(ai, SIGNAL(startUpdate(QList<FileUpdate>)), this, SLOT(startUpdate(QList<FileUpdate>)));
    connect(dm, SIGNAL(downloadsFinished(QList<FileUpdate>)), this, SLOT(downloadFinished(QList<FileUpdate>)));
    connect(ai, SIGNAL(applicationClosed(bool)), this, SLOT(startExchange(bool)));
    connect(ai, SIGNAL(executableChanged(QString)), this, SLOT(setExecutable(QString)));
    connect(fh, SIGNAL(exchangingFinished(bool)), this, SLOT(exchangeFinished(bool)));
    connect(dm, SIGNAL(error(QString)), ai, SLOT(sendError(QString)));
    connect(fh, SIGNAL(error(QString)), ai, SLOT(sendError(QString)));

    connect(ai, SIGNAL(close()), this, SLOT(closeRequested()));
}
Exemple #10
0
SettingsWindow::SettingsWindow(QWidget *parent) :
    QFrame(parent)
{
    settings = new QSettings;

    genCustomise();
    genNavigation();
    genInterface();
    genBookmarks();
    genSecurity();
    genOptions();
    genReset();

    mainLayout = new QStackedWidget;
    mainLayout->addWidget(tabCustomise);
    mainLayout->addWidget(tabNavigation);
    mainLayout->addWidget(tabInterface);
    mainLayout->addWidget(tabBookmarks);
    mainLayout->addWidget(tabSecurity);
    mainLayout->addWidget(tabOptions);
    mainLayout->addWidget(tabReset);
   // connect(mainLayout,SIGNAL(currentChanged(int)),this,SLOT(indexChanged(int)));

    tabBar = new TabList;
    tabBar->setMinimumWidth(150);
    tabBar->addTab(tabCustomise->title(),0);
    tabBar->addTab(tabNavigation->title(),1);
    tabBar->addTab(tabInterface->title(),2);
    tabBar->addTab(tabBookmarks->title(),3);
    tabBar->addTab(tabSecurity->title(),4);
   /* tabBar->addTab(tabOptions->title(),5);
    tabBar->addTab("Downloads",5);
    tabBar->addTab("History",5);*/
    tabBar->addTab(tabReset->title(),6);
    connect(tabBar,SIGNAL(showTab(int)),mainLayout,SLOT(setCurrentIndex(int)));

    QSplitter *layout = new QSplitter;
    layout->setContentsMargins(0,0,0,0);
    layout->addWidget(tabBar);
    layout->addWidget(mainLayout);

    QHBoxLayout *center = new QHBoxLayout;
    center->setContentsMargins(0,0,0,0);
    center->addWidget(layout);
    setLayout(center);

    btnClose = new QPushButton(QIcon(":/img/close.png"),"",this);
    btnClose->setObjectName("TopBtn");
    btnClose->setIconSize(QSize(20,20));
    btnClose->move(this->geometry().width()-btnClose->geometry().width(),0);
    connect(btnClose,SIGNAL(clicked()),this,SIGNAL(closeRequested()));

    loadSettings();
}
void
QGLRenderer::initializeGL ()
{
  GstGLContext *context;
  GstGLDisplay *display;

#if GST_GL_HAVE_PLATFORM_GLX
  display =
      (GstGLDisplay *) gst_gl_display_x11_new_with_display (QX11Info::
      display ());
#else
  display = gst_gl_display_new ();
#endif

  /* FIXME: Allow the choice at runtime */
#if GST_GL_HAVE_PLATFORM_WGL
  context =
      gst_gl_context_new_wrapped (display, (guintptr) wglGetCurrentContext (),
      GST_GL_PLATFORM_WGL, GST_GL_API_OPENGL);
#elif GST_GL_HAVE_PLATFORM_CGL
  context =
      gst_gl_context_new_wrapped (display,
      (guintptr) qt_current_nsopengl_context (), GST_GL_PLATFORM_CGL,
      GST_GL_API_OPENGL);
#elif GST_GL_HAVE_PLATFORM_GLX
  context =
      gst_gl_context_new_wrapped (display, (guintptr) glXGetCurrentContext (),
      GST_GL_PLATFORM_GLX, GST_GL_API_OPENGL);
#endif
  gst_object_unref (display);

  // We need to unset Qt context before initializing gst-gl plugin.
  // Otherwise the attempt to share gst-gl context with Qt will fail.
  this->doneCurrent ();
  this->gst_thread =
      new GstThread (display, context, this->videoLoc,
      SLOT (newFrame ()), this);
  this->makeCurrent ();

  QObject::connect (this->gst_thread, SIGNAL (finished ()),
      this, SLOT (close ()));
  QObject::connect (this, SIGNAL (closeRequested ()),
      this->gst_thread, SLOT (stop ()), Qt::QueuedConnection);

  qglClearColor (QApplication::palette ().color (QPalette::Active,
          QPalette::Window));
  //glShadeModel(GL_FLAT);
  //glEnable(GL_DEPTH_TEST);
  //glEnable(GL_CULL_FACE);
  glEnable (GL_TEXTURE_2D);     // Enable Texture Mapping

  this->gst_thread->start ();
}
Exemple #12
0
void Albums::showFilterBar()
{
    m_filterIcon->setEnabled( false );
    AlbumsFilterBar *bar = new AlbumsFilterBar( this );
    bar->setContentsMargins( 0, 0, 0, 0 );
    QGraphicsLinearLayout *l = static_cast<QGraphicsLinearLayout*>( layout() );
    l->setItemSpacing( 1, 0 );
    l->addItem( bar );
    connect( bar, SIGNAL(filterTextChanged(QString)), this, SLOT(filterTextChanged(QString)) );
    connect( bar, SIGNAL(closeRequested()), this, SLOT(closeFilterBar()) );
    bar->focusEditor();
}
QRenderer::QRenderer(const QString videoLocation, QWidget *parent, Qt::WFlags flags)
    : QWidget(parent, flags),
      m_gt(winId(), videoLocation)
{
    setAttribute(Qt::WA_NoSystemBackground);
    setVisible(false);
    move(20, 10);

    QObject::connect(&m_gt, SIGNAL(resizeRequested(int, int)), this, SLOT(resizeRequested(int, int)));
    QObject::connect(&m_gt, SIGNAL(finished()), this, SLOT(close()));
    QObject::connect(this, SIGNAL(exposeRequested()), &m_gt, SLOT(exposeRequested()));
    QObject::connect(this, SIGNAL(closeRequested()), &m_gt, SLOT(stop()), Qt::DirectConnection);
    m_gt.start();
}
WebPage::WebPage(QUrl baseUrl, QWidget *parent, bool allowExternalNavigate) :
      QWebEnginePage(new WebProfile(baseUrl), parent),
      baseUrl_(baseUrl),
      allowExternalNav_(allowExternalNavigate)
{
   settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
   settings()->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, true);
   settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true);
   settings()->setAttribute(QWebEngineSettings::JavascriptCanAccessClipboard, true);
   settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true);
   
   defaultSaveDir_ = QDir::home();
   connect(this, SIGNAL(windowCloseRequested()), SLOT(closeRequested()));
   connect(profile(), &QWebEngineProfile::downloadRequested, onDownloadRequested);
   connect(profile(), &WebProfile::urlIntercepted, this, &WebPage::onUrlIntercepted, Qt::DirectConnection);
}
Exemple #15
0
void Config::accept(void)
{
    int count = ui.list->count();
    if(count) {
        main->manpaths.clear();
        for(int pos = 0; pos < count; ++pos) {
            QListWidgetItem *item = ui.list->item(pos);
            main->manpaths << item->text();
        }
    }
    for(unsigned index = 0; index < 10; ++index)
        Main::sections[index]->setChecked(sections[index]->isChecked());

    emit closeRequested(last);
    emit reload();
}
Exemple #16
0
	TabUnhideListView::TabUnhideListView (const QList<TabClassInfo>& tcs, ICoreProxy_ptr proxy, QWidget *parent)
	: QDeclarativeView (parent)
	, Model_ (new UnhideListModel (this))
	{
		new Util::UnhoverDeleteMixin (this);

		const auto& file = Util::GetSysPath (Util::SysPath::QML, "sb2", "TabUnhideListView.qml");
		if (file.isEmpty ())
		{
			qWarning () << Q_FUNC_INFO
					<< "file not found";
			deleteLater ();
			return;
		}

		setStyleSheet ("background: transparent");
		setWindowFlags (Qt::ToolTip);
		setAttribute (Qt::WA_TranslucentBackground);

		rootContext ()->setContextProperty ("unhideListModel", Model_);
		rootContext ()->setContextProperty ("colorProxy",
				new Util::ColorThemeProxy (proxy->GetColorThemeManager (), this));
		engine ()->addImageProvider ("ThemeIcons", new ThemeImageProvider (proxy));
		setSource (QUrl::fromLocalFile (file));

		for (const auto& tc : tcs)
		{
			auto item = new QStandardItem;
			item->setData (tc.TabClass_, UnhideListModel::Roles::TabClass);
			item->setData (tc.VisibleName_, UnhideListModel::Roles::TabName);
			item->setData (tc.Description_, UnhideListModel::Roles::TabDescription);
			item->setData (Util::GetAsBase64Src (tc.Icon_.pixmap (32, 32).toImage ()),
					UnhideListModel::Roles::TabIcon);
			Model_->appendRow (item);
		}

		connect (rootObject (),
				SIGNAL (closeRequested ()),
				this,
				SLOT (deleteLater ()));
		connect (rootObject (),
				SIGNAL (tabUnhideRequested (QString)),
				this,
				SLOT (unhide (QString)),
				Qt::QueuedConnection);
	}
Exemple #17
0
bool
AlbumsFilterBar::eventFilter( QObject *obj, QEvent *e )
{
    if( obj == m_editor )
    {
        if( e->type() == QEvent::KeyPress )
        {
            QKeyEvent *kev = static_cast<QKeyEvent*>( e );
            if( kev->key() == Qt::Key_Escape )
            {
                kev->accept();
                emit closeRequested();
                return true;
            }
        }
    }
    return QGraphicsWidget::eventFilter( obj, e );
}
Exemple #18
0
void Buffers::close(int idx) {
    Buffer *b = m_buffers.at(idx);
    qDebug("close: %i %s", idx, qPrintable(b->fileName));
    
    if (b->released) {
        b->released->deleteLater();
        b->released = 0;
    }
    
    if (!b->document->isClean()) {
        // TODO: offer the opportunity to save
    }
    
    // need to iterate on a copy:
    // closeRequested -> editor is closed -> release called
    QSet<qce::Editor*> acquired = b->acquired;
    foreach (qce::Editor *e, acquired) {
        emit closeRequested(e);
        b->released = 0;
    }
void ImageSyncApp::initializeMainWindow()
{
   configurationFile_ = boost::shared_ptr< ConfigurationFile > ( new ConfigurationFile( CONFIGURATION_FILE ) );

   readerThread_.reset( new ReaderThread( incommingJobs_, outgoingJobs_ ) );
   writerThread_.reset( new WriterThread( outgoingJobs_ ) );

   mainWindowContent_->setupUi( mainWindow_.get() );
   mainWindow_->setWindowTitle( "imageSync - E.B." );
   mainWindowContent_->downloadProgress->setMinimum( 0 );
   mainWindowContent_->downloadProgress->setMaximum( 0 );
   mainWindowContent_->downloadProgress->setValue( 0 );
   mainWindowContent_->buttonCancel->setEnabled( false );
   mainWindow_->show();
   
   new QShortcut( Qt::CTRL + Qt::Key_Q, mainWindow_.get(), SLOT( close() ) );
   QObject::connect( mainWindowContent_->buttonCancel, SIGNAL( clicked() ),
                     this, SLOT( cancelRequested() ) );
   QObject::connect( mainWindowContent_->buttonGo, SIGNAL( clicked() ),
                     this, SLOT( startConversion() ) );
   QObject::connect( mainWindowContent_->buttonBrowseSource, SIGNAL( clicked() ),
                     this, SLOT( browseSource() ) );
   QObject::connect( mainWindowContent_->buttonBrowseDestination, SIGNAL( clicked() ),
                     this, SLOT( browseDestination() ) );
   QObject::connect( mainWindowContent_->tabWidget, SIGNAL( currentChanged( int ) ),
                     this, SLOT( currentTabChanged( int ) ) );
   QObject::connect( mainWindow_.get(), SIGNAL( closeRequested() ),
                     this, SLOT( mainWindowCloseRequested() ) );
   QObject::connect( readerThread_.get(), SIGNAL( reportOperation( QString ) ),
                     mainWindowContent_->statusLine, SLOT( setText( QString ) ) );
   QObject::connect( readerThread_.get(), SIGNAL( reportSpeed( QString ) ),
                     mainWindowContent_->speedLine, SLOT( setText( QString ) ) );
   QObject::connect( writerThread_.get(), SIGNAL( oneJobFinished() ),
                     this, SLOT( writerFinishedOneJob() ) );

   populateGuiFromConfiguration();
   populateTableWidget();
   readerThread_->start();
   writerThread_->start();
}
Exemple #20
0
SearchBar::SearchBar(QWidget* parent) : QToolBar(parent) {
  _closeAction = addAction(QIcon(":/close.png"), trUtf8("Hide search bar"));
  _closeAction->setShortcut(Qt::Key_Escape);
  QLabel* label = new QLabel(trUtf8("Search"), this);
  addWidget(label);
  _lineEdit = new QLineEdit(this);
  _lineEdit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
  addWidget(_lineEdit);

  _previousAction = addAction(QIcon(":/previous.png"), trUtf8("Find previous"));
  _previousAction->setShortcut(QKeySequence::FindPrevious);

  _nextAction = addAction(QIcon(":/next.png"), trUtf8("Find next"));
  _nextAction->setShortcut(QKeySequence::FindNext);

  _checkBox = new QCheckBox(trUtf8("Case-sensitive"), this);
  addWidget(_checkBox);

  connect(_closeAction, SIGNAL(triggered()), this, SIGNAL(closeRequested()));
  connect(_lineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(changeSearchData()));
  connect(_previousAction, SIGNAL(triggered()), this, SLOT(changeSearchData()));
  connect(_nextAction, SIGNAL(triggered()), this, SLOT(changeSearchData()));
}
	UnhideListViewBase::UnhideListViewBase (ICoreProxy_ptr proxy, QWidget *parent)
	: QDeclarativeView (parent)
	, Model_ (new UnhideListModel (this))
	{
		new UnhoverDeleteMixin (this);

		const auto& file = GetSysPath (SysPath::QML, "common", "UnhideListView.qml");
		if (file.isEmpty ())
		{
			qWarning () << Q_FUNC_INFO
					<< "file not found";
			deleteLater ();
			return;
		}

		setStyleSheet ("background: transparent");
		setWindowFlags (Qt::ToolTip);
		setAttribute (Qt::WA_TranslucentBackground);

		for (const auto& cand : GetPathCandidates (SysPath::QML, ""))
			engine ()->addImportPath (cand);

		rootContext ()->setContextProperty ("unhideListModel", Model_);
		rootContext ()->setContextProperty ("colorProxy",
				new Util::ColorThemeProxy (proxy->GetColorThemeManager (), this));
		engine ()->addImageProvider ("ThemeIcons", new Util::ThemeImageProvider (proxy));
		setSource (QUrl::fromLocalFile (file));

		connect (rootObject (),
				SIGNAL (closeRequested ()),
				this,
				SLOT (deleteLater ()));
		connect (rootObject (),
				SIGNAL (itemUnhideRequested (QString)),
				this,
				SIGNAL (itemUnhideRequested (QString)));
	}
Exemple #22
0
///@brief Adds publisher described in the form.
void AddPublisher::save()
{
	if(!validateInput())
		return;
	Publisher p;
	p.setName(nameLineEdit->text());
	p.setDescription(descriptionLineEdit->text());
	p.setCritique(critiqueLineEdit->text());
	p.setLogo(logoLineEdit->text());

	p.setThemes(getSelectedThemes());

	try
	{
		c->insertPublisher(p);
	}
	catch(DataBaseException dbe)
	{
		MessageBoxDataBaseException q(&dbe, this);
		q.appendText(tr("The publisher has not been added."));
		q.exec();
	}
	emit closeRequested();
}
void QRenderer::closeEvent(QCloseEvent* event)
{
    emit closeRequested();
    m_gt.wait();
}
Exemple #24
0
/*=========================================================================
  slot exitAction 
=========================================================================*/
void KFileBrowser::handleExitAction (void)
  {
  emit closeRequested (this);
  }
Exemple #25
0
void Config::cancel(void)
{
    emit closeRequested(last);
}
Exemple #26
0
void PreviewClient::requestClose()
{
    emit closeRequested();
}
void ImageSyncMainWindow::closeEvent( QCloseEvent * event )
{
   closeRequested();
   QMainWindow::closeEvent( event );
}
Exemple #28
0
PolkaView::PolkaView(QWidget *parent)
  : QWidget( parent )
{
  m_model = new PolkaModel( this );
  connect( m_model, SIGNAL( dataWritten() ), SIGNAL( dataWritten() ) );
  
  QBoxLayout *topLayout = new QVBoxLayout( this );

  
  QBoxLayout *buttonLayout = new QHBoxLayout;
  topLayout->addLayout( buttonLayout );

  // FIXME: Use proper icon
  m_backButton = new QPushButton( "<" );
  buttonLayout->addWidget( m_backButton );
  connect( m_backButton, SIGNAL( clicked() ), SLOT( goBack() ) );
  m_backButton->setEnabled( false );

  buttonLayout->addStretch( 1 );

  m_groupNameLabel = new QLabel;
  buttonLayout->addWidget( m_groupNameLabel );

  buttonLayout->addStretch( 1 );

  m_searchEdit = new SearchEdit;
  buttonLayout->addWidget( m_searchEdit );
  connect( m_searchEdit, SIGNAL( search( const QString & ) ),
    SLOT( showSearch( const QString & ) ) );
  connect( m_searchEdit, SIGNAL( stopSearch() ), SLOT( stopSearch() ) );

  QPushButton *button = new QPushButton( i18n("...") );
  buttonLayout->addWidget( button );
  connect( button, SIGNAL( clicked() ), SLOT( showOverview() ) );

  button->setFocus();

  QBoxLayout *viewLayout = new QHBoxLayout;
  topLayout->addLayout( viewLayout );

  m_groupWidget = new QWidget;
  viewLayout->addWidget( m_groupWidget );
  
  m_listLayout = new QStackedLayout( m_groupWidget );

  m_overview = new Overview;
  m_listLayout->addWidget( m_overview );
  connect( m_overview, SIGNAL( showGroupView() ), SLOT( showGroupView() ) );
  connect( m_overview, SIGNAL( showListView() ), SLOT( showListView() ) );
  connect( m_overview, SIGNAL( showHistory() ), SLOT( showHistory() ) );

  m_groupListView = new GroupListView( m_model );
  m_listLayout->addWidget( m_groupListView );
  connectGroupView( m_groupListView );

  m_groupGraphicsView = new GroupGraphicsView( m_model );
  m_listLayout->addWidget( m_groupGraphicsView );
  connectGroupView( m_groupGraphicsView );
  connect( m_groupGraphicsView, SIGNAL( newGroup() ), SLOT( newSubGroup() ) );
  connect( m_groupGraphicsView, SIGNAL( removeIdentity( const Polka::Identity &,
    const Polka::Identity & ) ),
    SLOT( removeIdentity( const Polka::Identity &, const Polka::Identity & ) ) );
  connect( m_groupGraphicsView, SIGNAL( cloneGroup( const Polka::Identity & ) ),
    SLOT( cloneGroup( const Polka::Identity & ) ) );
  connect( m_groupGraphicsView, SIGNAL( removeGroup( const Polka::Identity & ) ),
    SLOT( removeGroup( const Polka::Identity & ) ) );
  connect( m_groupGraphicsView, SIGNAL( morphedToCompact() ),
    SLOT( finishShowPerson() ) );
  connect( m_groupGraphicsView, SIGNAL( closeRequested() ),
    SLOT( closePersonView() ) );

  m_personView = new PersonView( m_model );
  viewLayout->addWidget( m_personView );
  connect( m_personView, SIGNAL( closeRequested() ),
    SLOT( closePersonView() ) );

  m_historyView = new HistoryView( m_model );
  m_listLayout->addWidget( m_historyView );

  m_searchResultView = new SearchResultView( m_model );
  m_listLayout->addWidget( m_searchResultView );

  m_settingsWidget = new SettingsWidget( m_model );
  topLayout->addWidget( m_settingsWidget );
  connect( m_settingsWidget, SIGNAL( showView() ), SLOT( showView() ) );

  m_settingsWidget->hide();

  readConfig();

  readData();
}
Exemple #29
0
void PersonView::requestClose()
{
  emit closeRequested();
}
Exemple #30
0
//!
//! Closes the panel.
//!
//! Does not close the panel itself, but notifies connected objects that
//! the panel should be closed.
//!
void PanelFrame::on_ui_closeAction_triggered ()
{
    emit closeRequested(this);
}