コード例 #1
0
QgsComposerManager::QgsComposerManager( QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f )
{
  QPushButton *pb;

  setupUi( this );

  QSettings settings;
  restoreGeometry( settings.value( "/Windows/ComposerManager/geometry" ).toByteArray() );

  connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( close() ) );

  pb = new QPushButton( tr( "&Show" ) );
  mButtonBox->addButton( pb, QDialogButtonBox::ActionRole );
  connect( pb, SIGNAL( clicked() ), this, SLOT( show_clicked() ) );

  pb = new QPushButton( tr( "&Duplicate" ) );
  mButtonBox->addButton( pb, QDialogButtonBox::ActionRole );
  connect( pb, SIGNAL( clicked() ), this, SLOT( duplicate_clicked() ) );

  pb = new QPushButton( tr( "&Remove" ) );
  mButtonBox->addButton( pb, QDialogButtonBox::ActionRole );
  connect( pb, SIGNAL( clicked() ), this, SLOT( remove_clicked() ) );

  pb = new QPushButton( tr( "Re&name" ) );
  mButtonBox->addButton( pb, QDialogButtonBox::ActionRole );
  connect( pb, SIGNAL( clicked() ), this, SLOT( rename_clicked() ) );

  initialize();
}
コード例 #2
0
ファイル: trayicon.cpp プロジェクト: Floo/upplay
GUI_TrayIcon::GUI_TrayIcon(QObject *parent)
    : QSystemTrayIcon(parent)
{

    m_settings = CSettingsStorage::getInstance();
    m_playing = false;
    m_mute = false;

    QIcon play_icon = QIcon(Helper::getIconPath("play.png"));
    QIcon pause_icon = QIcon(Helper::getIconPath("pause.png"));
    QIcon sayo_icon = QIcon(Helper::getIconPath("logo.png"));
    QPixmap play_pixmap = play_icon.pixmap(24, 24);
    QPixmap pause_pixmap = pause_icon.pixmap(24, 24);
    QPixmap sayo_pixmap = sayo_icon.pixmap(24, 24);
    setIcon(QIcon(sayo_pixmap));

    m_playIcon = QIcon(play_pixmap);
    m_pauseIcon = QIcon(pause_pixmap);

    m_vol_step = 5;

//    m_plugin_loader = NotificationPluginLoader::getInstance();
    m_notification_active = m_settings->getShowNotifications();
    m_timeout = m_settings->getNotificationTimeout();

    _timer = new QTimer(this);
    _timer->setInterval(300);
    _md_set = false;

    m_playAction = new QAction(tr("Play"), this);
    m_playAction->setIcon(QIcon(Helper::getIconPath("play.png")));
    m_stopAction = new QAction(tr("Stop"), this);
    m_stopAction->setIcon(QIcon(Helper::getIconPath("stop.png")));
    m_bwdAction = new QAction(tr("Previous"), this);
    m_bwdAction->setIcon(QIcon(Helper::getIconPath("bwd.png")));
    m_fwdAction = new QAction(tr("Next"), this);
    m_fwdAction->setIcon(QIcon(Helper::getIconPath("fwd.png")));
    m_muteAction = new QAction(tr("Mute"), this);
    m_muteAction->setIcon(QIcon(Helper::getIconPath("vol_mute.png")));
    m_closeAction = new QAction(tr("Close"), this);
    m_closeAction->setIcon(QIcon(Helper::getIconPath("close.png")));
    m_showAction = new QAction(tr("Show"), this);

    m_trayContextMenu = new QMenu();
    m_trayContextMenu->addAction(m_playAction);
    m_trayContextMenu->addAction(m_stopAction);
    m_trayContextMenu->addSeparator();
    m_trayContextMenu->addAction(m_fwdAction);
    m_trayContextMenu->addAction(m_bwdAction);
    m_trayContextMenu->addSeparator();
    m_trayContextMenu->addAction(m_muteAction);
    m_trayContextMenu->addSeparator();
    m_trayContextMenu->addAction(m_showAction);
    m_trayContextMenu->addAction(m_closeAction);
    setContextMenu(m_trayContextMenu);

    connect(m_playAction, SIGNAL(triggered()), this, SLOT(play_clicked()));
    connect(m_fwdAction, SIGNAL(triggered()), this, SLOT(fwd_clicked()));
    connect(m_bwdAction, SIGNAL(triggered()), this, SLOT(bwd_clicked()));
    connect(m_stopAction, SIGNAL(triggered()), this, SLOT(stop_clicked()));
    connect(m_showAction, SIGNAL(triggered()), this, SLOT(show_clicked()));
    connect(m_closeAction, SIGNAL(triggered()), this, SLOT(close_clicked()));
    connect(m_muteAction, SIGNAL(triggered()), this, SLOT(mute_clicked()));
    connect(_timer, SIGNAL(timeout()), this, SLOT(timer_timed_out()));
}
コード例 #3
0
ファイル: qgscomposermanager.cpp プロジェクト: Aladar64/QGIS
QgsComposerManager::QgsComposerManager( QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f )
{
  QPushButton *pb;

  setupUi( this );

  QSettings settings;
  restoreGeometry( settings.value( "/Windows/ComposerManager/geometry" ).toByteArray() );

  connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( close() ) );
  connect( QgisApp::instance(), SIGNAL( composerAdded( QgsComposerView* ) ), this, SLOT( refreshComposers() ) );
  connect( QgisApp::instance(), SIGNAL( composerRemoved( QgsComposerView* ) ), this, SLOT( refreshComposers() ) );

  pb = new QPushButton( tr( "&Show" ) );
  mButtonBox->addButton( pb, QDialogButtonBox::ActionRole );
  connect( pb, SIGNAL( clicked() ), this, SLOT( show_clicked() ) );

  pb = new QPushButton( tr( "&Duplicate" ) );
  mButtonBox->addButton( pb, QDialogButtonBox::ActionRole );
  connect( pb, SIGNAL( clicked() ), this, SLOT( duplicate_clicked() ) );

  pb = new QPushButton( tr( "&Remove" ) );
  mButtonBox->addButton( pb, QDialogButtonBox::ActionRole );
  connect( pb, SIGNAL( clicked() ), this, SLOT( remove_clicked() ) );

  pb = new QPushButton( tr( "Re&name" ) );
  mButtonBox->addButton( pb, QDialogButtonBox::ActionRole );
  connect( pb, SIGNAL( clicked() ), this, SLOT( rename_clicked() ) );

#ifdef Q_WS_MAC
  // Create action to select this window
  mWindowAction = new QAction( windowTitle(), this );
  connect( mWindowAction, SIGNAL( triggered() ), this, SLOT( activate() ) );
#endif

  mTemplate->addItem( tr( "Empty composer" ) );
  mTemplate->addItem( tr( "Specific" ) );

  mUserTemplatesDir = QgsApplication::qgisSettingsDirPath() + "/composer_templates";
  QMap<QString, QString> userTemplateMap = defaultTemplates( true );
  if ( userTemplateMap.size() > 0 )
  {
    mTemplate->insertSeparator( mTemplate->count() );
    QMap<QString, QString>::const_iterator templateIt = userTemplateMap.constBegin();
    for ( ; templateIt != userTemplateMap.constEnd(); ++templateIt )
    {
      mTemplate->addItem( templateIt.key(), templateIt.value() );
    }
  }

  mDefaultTemplatesDir = QgsApplication::pkgDataPath() + "/composer_templates";
  QMap<QString, QString> defaultTemplateMap = defaultTemplates( false );
  if ( defaultTemplateMap.size() > 0 )
  {
    mTemplate->insertSeparator( mTemplate->count() );
    QMap<QString, QString>::const_iterator templateIt = defaultTemplateMap.constBegin();
    for ( ; templateIt != defaultTemplateMap.constEnd(); ++templateIt )
    {
      mTemplate->addItem( templateIt.key(), templateIt.value() );
    }
  }

  mTemplatePathLineEdit->setText( settings.value( "/UI/ComposerManager/templatePath", QString( "" ) ).toString() );

  refreshComposers();
}