Пример #1
0
StatusDialog::StatusDialog( Theme *theme, QWidget *parent) :
    QDialog(parent),
    _theme( theme ),
    _ownCloudInfo(0)
{
  setupUi( this  );
  setWindowTitle( _theme->appName() + QString (" %1" ).arg( _theme->version() ) );

  _model = new FolderStatusModel();
  FolderViewDelegate *delegate = new FolderViewDelegate();

  _folderList->setItemDelegate( delegate );
  _folderList->setModel( _model );
  _folderList->setMinimumWidth( 300 );
  _folderList->setEditTriggers( QAbstractItemView::NoEditTriggers );

  connect(_ButtonClose,  SIGNAL(clicked()), this, SLOT(accept()));
  connect(_ButtonRemove, SIGNAL(clicked()), this, SLOT(slotRemoveFolder()));
#ifdef HAVE_FETCH_AND_PUSH
  connect(_ButtonFetch,  SIGNAL(clicked()), this, SLOT(slotFetchFolder()));
  connect(_ButtonPush,   SIGNAL(clicked()), this, SLOT(slotPushFolder()));
#else
  _ButtonFetch->setVisible( false );
  _ButtonPush->setVisible( false );
#endif
  connect(_ButtonEnable, SIGNAL(clicked()), this, SLOT(slotEnableFolder()));
  connect(_ButtonInfo,   SIGNAL(clicked()), this, SLOT(slotInfoFolder()));
  connect(_ButtonAdd,    SIGNAL(clicked()), this, SLOT(slotAddSync()));

  _ButtonRemove->setEnabled(false);
  _ButtonFetch->setEnabled(false);
  _ButtonPush->setEnabled(false);
  _ButtonEnable->setEnabled(false);
  _ButtonInfo->setEnabled(false);
  _ButtonAdd->setEnabled(true);

  _ownCloudInfo = new ownCloudInfo();

  connect(_ownCloudInfo, SIGNAL(ownCloudInfoFound(const QString&, const QString&)),
          this, SLOT(slotOCInfo( const QString&, const QString& )));
  connect(_ownCloudInfo, SIGNAL(noOwncloudFound(QNetworkReply*)),
          this, SLOT(slotOCInfoFail(QNetworkReply*)));

#if defined Q_WS_X11 || defined Q_WS_MAC
  connect(_folderList, SIGNAL(activated(QModelIndex)), SLOT(slotFolderActivated(QModelIndex)));
  connect( _folderList,SIGNAL(doubleClicked(QModelIndex)),SLOT(slotDoubleClicked(QModelIndex)));
#endif
#ifdef Q_WS_WIN
  connect(_folderList, SIGNAL(clicked(QModelIndex)), SLOT(slotFolderActivated(QModelIndex)));
  connect( _folderList,SIGNAL(doubleClicked(QModelIndex)),SLOT(slotDoubleClicked(QModelIndex)));
#endif

  _ocUrlLabel->setWordWrap( true );
}
Пример #2
0
StatusDialog::StatusDialog( Theme *theme, QWidget *parent) :
    QDialog(parent),
    _theme( theme )
{
  setupUi( this );
  setWindowTitle( QString::fromLatin1( "%1 %2" ).arg(_theme->appNameGUI(), _theme->version() ) );

  _model = new FolderStatusModel();
  _delegate = new FolderViewDelegate();

  _folderList->setItemDelegate( _delegate );
  _folderList->setModel( _model );
  _folderList->setMinimumWidth( 300 );
  _folderList->setEditTriggers( QAbstractItemView::NoEditTriggers );
  connect(_ButtonClose,  SIGNAL(clicked()), this, SLOT(accept()));
  connect(_ButtonRemove, SIGNAL(clicked()), this, SLOT(slotRemoveFolder()));
  connect(_ButtonReset, SIGNAL(clicked()), this, SLOT(slotResetFolder()));

  connect(_ButtonEnable, SIGNAL(clicked()), this, SLOT(slotEnableFolder()));
  connect(_ButtonInfo,   SIGNAL(clicked()), this, SLOT(slotInfoFolder()));
  connect(_ButtonAdd,    SIGNAL(clicked()), this, SLOT(slotAddSync()));

  _ButtonRemove->setEnabled(false);
  _ButtonEnable->setEnabled(false);
  _ButtonReset->setEnabled(false);
  _ButtonInfo->setEnabled(false);
  _ButtonAdd->setEnabled(true);

  connect(_folderList, SIGNAL(clicked(QModelIndex)), SLOT(slotFolderActivated(QModelIndex)));
  connect(_folderList, SIGNAL(doubleClicked(QModelIndex)),SLOT(slotDoubleClicked(QModelIndex)));

  _ocUrlLabel->setWordWrap( true );
}
Пример #3
0
AccountSettings::AccountSettings(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::AccountSettings),
    _item(0)
{
    ui->setupUi(this);

    _model = new FolderStatusModel;
    FolderStatusDelegate *delegate = new FolderStatusDelegate;

    ui->_folderList->setItemDelegate( delegate );
    ui->_folderList->setModel( _model );
    ui->_folderList->setMinimumWidth( 300 );
    ui->_folderList->setEditTriggers( QAbstractItemView::NoEditTriggers );

    ui->_ButtonRemove->setEnabled(false);
    ui->_ButtonReset->setEnabled(false);
    ui->_ButtonEnable->setEnabled(false);
    ui->_ButtonInfo->setEnabled(false);
    ui->_ButtonAdd->setEnabled(true);

    connect(ui->_ButtonRemove, SIGNAL(clicked()), this, SLOT(slotRemoveCurrentFolder()));
    connect(ui->_ButtonReset,  SIGNAL(clicked()), this, SLOT(slotResetCurrentFolder()));
    connect(ui->_ButtonEnable, SIGNAL(clicked()), this, SLOT(slotEnableCurrentFolder()));
    connect(ui->_ButtonInfo,   SIGNAL(clicked()), this, SLOT(slotInfoAboutCurrentFolder()));
    connect(ui->_ButtonAdd,    SIGNAL(clicked()), this, SLOT(slotAddFolder()));
    connect(ui->modifyAccountButton, SIGNAL(clicked()), SLOT(slotOpenAccountWizard()));
    connect(ui->ignoredFilesButton, SIGNAL(clicked()), SLOT(slotIgnoreFilesEditor()));;

    connect(ui->_folderList, SIGNAL(clicked(QModelIndex)), SLOT(slotFolderActivated(QModelIndex)));
    connect(ui->_folderList, SIGNAL(doubleClicked(QModelIndex)),SLOT(slotDoubleClicked(QModelIndex)));

    ownCloudInfo *ocInfo = ownCloudInfo::instance();
    slotUpdateQuota(ocInfo->lastQuotaTotalBytes(), ocInfo->lastQuotaUsedBytes());
    connect(ocInfo, SIGNAL(quotaUpdated(qint64,qint64)), SLOT(slotUpdateQuota(qint64,qint64)));

    ui->connectLabel->setWordWrap( true );

    setFolderList(FolderMan::instance()->map());

    slotCheckConnection();
}
Пример #4
0
StatusDialog::StatusDialog( Theme *theme, QWidget *parent) :
    QDialog(parent),
    _theme( theme ),
    _ownCloudInfo(0)
{
  setupUi( this  );
  setWindowTitle( _theme->appName() + QString (" %1" ).arg( _theme->version() ) );

  _model = new FolderStatusModel();
  FolderViewDelegate *delegate = new FolderViewDelegate();

  _folderList->setItemDelegate( delegate );
  _folderList->setModel( _model );
  _folderList->setMinimumWidth( 300 );

  connect( _folderList,SIGNAL(doubleClicked(QModelIndex)),SLOT(slotDoubleClicked(QModelIndex)));

  connect(_ButtonClose,  SIGNAL(clicked()), this, SLOT(accept()));
  connect(_ButtonRemove, SIGNAL(clicked()), this, SLOT(slotRemoveFolder()));
#ifdef HAVE_FETCH_AND_PUSH
  connect(_ButtonFetch,  SIGNAL(clicked()), this, SLOT(slotFetchFolder()));
  connect(_ButtonPush,   SIGNAL(clicked()), this, SLOT(slotPushFolder()));
#else
  _ButtonFetch->setVisible( false );
  _ButtonPush->setVisible( false );
#endif
  connect(_ButtonOpenOC, SIGNAL(clicked()), this, SLOT(slotOpenOC()));
  connect(_ButtonEnable, SIGNAL(clicked()), this, SLOT(slotEnableFolder()));
  connect(_ButtonInfo,   SIGNAL(clicked()), this, SLOT(slotInfoFolder()));
  connect(_ButtonAdd,    SIGNAL(clicked()), this, SLOT(slotAddSync()));

  _ButtonOpenOC->setEnabled(false);
  _ButtonRemove->setEnabled(false);
  _ButtonFetch->setEnabled(false);
  _ButtonPush->setEnabled(false);
  _ButtonEnable->setEnabled(false);
  _ButtonInfo->setEnabled(false);
  _ButtonAdd->setEnabled(true);

  connect(_folderList, SIGNAL(activated(QModelIndex)), SLOT(slotFolderActivated(QModelIndex)));
}
Пример #5
0
void AccountSettings::slotButtonsSetEnabled()
{
    QModelIndex selected = ui->_folderList->currentIndex();

    slotFolderActivated(selected);
}