Exemple #1
0
void AirspaceHelperThread::run()
{
#ifndef WIN32
  sigset_t sigset;
  sigfillset( &sigset );

  // deactivate all signals in this thread
  pthread_sigmask( SIG_SETMASK, &sigset, 0 );
#endif

  // Check is signal is connected to a slot.
  if( receivers( SIGNAL( loadedList( int, SortableAirspaceList* )) ) == 0 )
    {
      qWarning() << "AirspaceHelperThread: No Slot connection to Signal loadedList!";
      return;
    }

  SortableAirspaceList* airspaceList = new SortableAirspaceList;

  int ok = AirspaceHelper::loadAirspaces( *airspaceList );

  /* It is expected that a receiver slot is connected to this signal. The
   * receiver is responsible to delete the passed lists. Otherwise a big
   * memory leak will occur.
   */
  emit loadedList( ok, airspaceList );
}
Exemple #2
0
DynamicPage::DynamicPage(QWidget *p)
    : SinglePageWidget(p)
{
    addAction = new Action(Icon("document-new"), i18n("Add"), this);
    editAction = new Action(Icons::self()->editIcon, i18n("Edit"), this);
    removeAction = new Action(Icon("list-remove"), i18n("Remove"), this);
    toggleAction = new Action(this);

    ToolButton *addBtn=new ToolButton(this);
    ToolButton *editBtn=new ToolButton(this);
    ToolButton *removeBtn=new ToolButton(this);
    ToolButton *startBtn=new ToolButton(this);

    addBtn->setDefaultAction(addAction);
    editBtn->setDefaultAction(editAction);
    removeBtn->setDefaultAction(removeAction);
    startBtn->setDefaultAction(Dynamic::self()->startAct());

    view->addAction(editAction);
    view->addAction(removeAction);
    view->addAction(Dynamic::self()->startAct());
    view->alwaysShowHeader();
    view->setMode(ItemView::Mode_List);

    connect(view, SIGNAL(itemsSelected(bool)), this, SLOT(controlActions()));
    connect(view, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(toggle()));
    connect(view, SIGNAL(headerClicked(int)), SLOT(headerClicked(int)));
    connect(MPDConnection::self(), SIGNAL(dynamicSupport(bool)), this, SLOT(remoteDynamicSupport(bool)));
    connect(addAction, SIGNAL(triggered()), SLOT(add()));
    connect(editAction, SIGNAL(triggered()), SLOT(edit()));
    connect(removeAction, SIGNAL(triggered()), SLOT(remove()));
    connect(Dynamic::self()->startAct(), SIGNAL(triggered()), SLOT(start()));
    connect(Dynamic::self()->stopAct(), SIGNAL(triggered()), SLOT(stop()));
    connect(toggleAction, SIGNAL(triggered()), SLOT(toggle()));
    connect(Dynamic::self(), SIGNAL(running(bool)), SLOT(running(bool)));
    connect(Dynamic::self(), SIGNAL(loadingList()), view, SLOT(showSpinner()));
    connect(Dynamic::self(), SIGNAL(loadedList()), view, SLOT(hideSpinner()));

    #ifdef Q_OS_WIN
    remoteRunningLabel=new StatusLabel(this);
    remoteRunningLabel->setType(StatusLabel::Error);
    #endif
    Dynamic::self()->stopAct()->setEnabled(false);
    proxy.setSourceModel(Dynamic::self());
    view->setModel(&proxy);
    view->setDeleteAction(removeAction);
    view->setMode(ItemView::Mode_List);
    controlActions();
    Configuration config(metaObject()->className());
    view->load(config);
    controls=QList<QWidget *>() << addBtn << editBtn << removeBtn << startBtn;
    init(0, QList<QWidget *>(), controls);
    #ifdef Q_OS_WIN
    addWidget(remoteRunningLabel);
    enableWidgets(false);
    #endif
}
JulyMoveDialog::JulyMoveDialog(QWidget *parent)
	: QWidget(parent)
{
	wasDropboxStarted=false;
	dropBoxAppFile=QDesktopServices::storageLocation(QDesktopServices::ApplicationsLocation).replace("\\","/")+"/Dropbox/Dropbox.lnk";
	if(QFile::exists(dropBoxAppFile))
	{
		dropBoxAppFile=QFileInfo(dropBoxAppFile).symLinkTarget();
		if(!QFile::exists(dropBoxAppFile))dropBoxAppFile="";
	}	else	dropBoxAppFile="";

	ui.setupUi(this);
	setWindowModality(Qt::ApplicationModal);
	setWindowFlags(Qt::Tool);

	scanDir = new JulyScanDir(this);
	scanDir->setFilesFilter("*");
    scanDir->setSearchSubFolders(true);
    scanDir->setSearchHidden(true);
	connect(scanDir,SIGNAL(fileChanged(QString)),this,SLOT(fileChanged(QString)));
	connect(scanDir,SIGNAL(loadedList(QStringList)),this,SLOT(loadedList(QStringList)));
	connect(scanDir,SIGNAL(dirChanged(QString)),this,SLOT(dirChanged(QString)));
	connect(scanDir,SIGNAL(errorHeppend(int)),this,SLOT(errorHeppend(int)));
}
Exemple #4
0
DynamicPage::DynamicPage(QWidget *p)
    : QWidget(p)
{
    setupUi(this);
    addAction = new Action(Icon("document-new"), i18n("Add"), this);
    editAction = new Action(Icons::self()->editIcon, i18n("Edit"), this);
    removeAction = new Action(Icon("list-remove"), i18n("Remove"), this);
    toggleAction = new Action(this);

    addBtn->setDefaultAction(addAction);
    editBtn->setDefaultAction(editAction);
    removeBtn->setDefaultAction(removeAction);
    startBtn->setDefaultAction(Dynamic::self()->startAct());
    stopBtn->setDefaultAction(Dynamic::self()->stopAct());

    view->addAction(editAction);
    view->addAction(removeAction);
    view->addAction(Dynamic::self()->startAct());

    connect(view, SIGNAL(itemsSelected(bool)), this, SLOT(controlActions()));
    connect(view, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(toggle()));
    connect(view, SIGNAL(searchItems()), this, SLOT(searchItems()));
    connect(MPDConnection::self(), SIGNAL(dynamicSupport(bool)), this, SLOT(remoteDynamicSupport(bool)));
    connect(addAction, SIGNAL(triggered()), SLOT(add()));
    connect(editAction, SIGNAL(triggered()), SLOT(edit()));
    connect(removeAction, SIGNAL(triggered()), SLOT(remove()));
    connect(Dynamic::self()->startAct(), SIGNAL(triggered()), SLOT(start()));
    connect(Dynamic::self()->stopAct(), SIGNAL(triggered()), SLOT(stop()));
    connect(toggleAction, SIGNAL(triggered()), SLOT(toggle()));
    connect(Dynamic::self(), SIGNAL(running(bool)), SLOT(running(bool)));
    connect(Dynamic::self(), SIGNAL(loadingList()), view, SLOT(showSpinner()));
    connect(Dynamic::self(), SIGNAL(loadedList()), view, SLOT(hideSpinner()));

    #ifdef Q_OS_WIN
    remoteRunningLabel->setType(StatusLabel::Error);
    enableWidgets(false);
    #else
    remoteRunningLabel->setVisible(false);
    #endif
    Dynamic::self()->stopAct()->setEnabled(false);
    proxy.setSourceModel(Dynamic::self());
    view->setModel(&proxy);
    view->setDeleteAction(removeAction);
    view->setMode(ItemView::Mode_List);
    controlActions();
    view->load(metaObject()->className());
}
void JulyMoveDialog::errorHeppend(int)
{
	loadedList(QStringList());
}
Exemple #6
0
DynamicPage::DynamicPage(QWidget *p)
    : SinglePageWidget(p)
{
    addAction = new Action(Icons::self()->addNewItemIcon, i18n("Add"), this);
    editAction = new Action(Icons::self()->editIcon, i18n("Edit"), this);
    removeAction = new Action(Icons::self()->removeDynamicIcon, i18n("Remove"), this);
    toggleAction = new Action(this);

    ToolButton *addBtn=new ToolButton(this);
    ToolButton *editBtn=new ToolButton(this);
    ToolButton *removeBtn=new ToolButton(this);
    ToolButton *startBtn=new ToolButton(this);

    addBtn->setDefaultAction(addAction);
    editBtn->setDefaultAction(editAction);
    removeBtn->setDefaultAction(removeAction);
    startBtn->setDefaultAction(Dynamic::self()->startAct());

    view->addAction(editAction);
    view->addAction(removeAction);
    view->addAction(Dynamic::self()->startAct());
    view->alwaysShowHeader();

    connect(view, SIGNAL(itemsSelected(bool)), this, SLOT(controlActions()));
    connect(view, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(toggle()));
    connect(view, SIGNAL(headerClicked(int)), SLOT(headerClicked(int)));
    connect(MPDConnection::self(), SIGNAL(dynamicSupport(bool)), this, SLOT(remoteDynamicSupport(bool)));
    connect(addAction, SIGNAL(triggered()), SLOT(add()));
    connect(editAction, SIGNAL(triggered()), SLOT(edit()));
    connect(removeAction, SIGNAL(triggered()), SLOT(remove()));
    connect(Dynamic::self()->startAct(), SIGNAL(triggered()), SLOT(start()));
    connect(Dynamic::self()->stopAct(), SIGNAL(triggered()), SLOT(stop()));
    connect(toggleAction, SIGNAL(triggered()), SLOT(toggle()));
    connect(Dynamic::self(), SIGNAL(running(bool)), SLOT(running(bool)));
    connect(Dynamic::self(), SIGNAL(loadingList()), view, SLOT(showSpinner()));
    connect(Dynamic::self(), SIGNAL(loadedList()), view, SLOT(hideSpinner()));

    #ifdef Q_OS_WIN
    remoteRunningLabel=new QLabel(this);
    remoteRunningLabel->setStyleSheet(QString(".QLabel {"
                          "background-color: rgba(235, 187, 187, 196);"
                          "border-radius: 3px;"
                          "border: 1px solid red;"
                          "padding: 4px;"
                          "margin: 1px;"
                          "color: black; }"));
    remoteRunningLabel->setText(i18n("Remote dynamizer is not running."));
    #endif
    Dynamic::self()->stopAct()->setEnabled(false);
    proxy.setSourceModel(Dynamic::self());
    view->setModel(&proxy);
    view->setDeleteAction(removeAction);
    view->setMode(ItemView::Mode_List);
    controlActions();
    Configuration config(metaObject()->className());
    view->load(config);
    controls=QList<QWidget *>() << addBtn << editBtn << removeBtn << startBtn;
    init(0, QList<QWidget *>(), controls);
    #ifdef Q_OS_WIN
    addWidget(remoteRunningLabel);
    enableWidgets(false);
    #endif
}