void ChineseCalendar::createTray()
{
    this->actionShow = new QAction(tr("隐藏/显示"), this);
    connect(actionShow, SIGNAL(triggered()), this, SLOT(showOrHide()));
    QShortcut *shortcut = new QShortcut(QKeySequence("Ctrl+H"), this);
    connect(shortcut, SIGNAL(activated()), this, SLOT(showOrHide()));

    this->actionAutoStart = new QAction(tr("AutoStart"), this);
    this->actionAutoStart->setCheckable(true);
    connect(actionAutoStart, SIGNAL(triggered(bool)), this, SLOT(setAutoStart(bool)));

    this->actionStaysOnTop = new QAction(tr("总在最前"), this);
    this->actionStaysOnTop->setCheckable(true);
    connect(actionStaysOnTop, SIGNAL(triggered()), this, SLOT(slotChangeMode()));

    this->actionStaysOnBottom = new QAction(tr("总在最后"), this);
    this->actionStaysOnBottom->setCheckable(true);
    connect(actionStaysOnBottom, SIGNAL(triggered()), this, SLOT(slotChangeMode()));

    this->actionStaysNormal = new QAction(tr("普通模式"), this);
    this->actionStaysNormal->setCheckable(true);
    this->actionStaysNormal->setChecked(true);
    connect(actionStaysNormal, SIGNAL(triggered()), this, SLOT(slotChangeMode()));

    // default skin
    this->actionDefault = new QAction(tr("Default"), this);
    actionDefault->setCheckable(true);
    actionDefault->setChecked(true);
    m_skinName = QString("default");
    connect(actionDefault, SIGNAL(triggered()), this, SLOT(slotChangeSkin()));

    // blue skin
    this->actionSkin = new QAction(tr("Blue"), this);
    actionSkin->setCheckable(true);
    connect(actionSkin, SIGNAL(triggered()), this, SLOT(slotChangeSkin()));

    this->skinMenu = new QMenu(tr("换肤"), this);
    this->skinMenu->addAction(actionDefault);
    this->skinMenu->addAction(actionSkin);

    QActionGroup *actSkinGrp = new QActionGroup(this);
    actSkinGrp->addAction(actionDefault);
    actSkinGrp->addAction(actionSkin);

    readSetting();
    actionDefault->setChecked(m_skinName == "default");
    actionSkin->setChecked(m_skinName == "blue");

    // read user customizated skin files
    readSkinFiles();

    foreach (QString strSkin, m_strFileList)
    {
        QAction *actionNew = new QAction(strSkin, this);
        actionNew->setCheckable(true);
        actionNew->setChecked(m_skinName == strSkin);
        actSkinGrp->addAction(actionNew);
        this->skinMenu->addAction(actionNew);
        connect(actionNew, SIGNAL(triggered()), this, SLOT(slotChangeSkin()));
    }
示例#2
0
void SubBarAlbumClock::xSetup()
{
   //DAVID Setup Background;
   pixBackground.load("/root/kde_application/hdass08/skin/SubBarBackground.png");
   setBackgroundPixmap(pixBackground);
   
   //InitBtn Graphic
   btnGraphic[0]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Album-Btn-Album.png");
   btnGraphic[1]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Album-Btn-Album-Active.png");
   btnGraphic[2]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Album-Btn-Clock.png");
   btnGraphic[3]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Album-Btn-Clock-Active.png");
   btnGraphic[4]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Album-Btn-Previous.png");
   btnGraphic[5]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Album-Btn-Previous-Active.png");
   btnGraphic[6]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Album-Btn-Play.png");
   btnGraphic[7]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Album-Btn-Play-Active.png");
   btnGraphic[8]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Album-Btn-Pause.png");
   btnGraphic[9]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Album-Btn-Pause-Active.png");
   btnGraphic[10]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Album-Btn-Next.png");
   btnGraphic[11]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Album-Btn-Next-Active.png");
   //Init Btn
   SubBarBtnAlbumClock=new SkinButton(this);
   SubBarBtnAlbumClock->setPixmaps(btnGraphic[0],btnGraphic[1]);
   SubBarBtnAlbumClock->setGeometry(457,0,80,80);
   SubBarBtnAlbumClock->show();
   
   SubBarBtnPrevious=new SkinButton(this);
   SubBarBtnPrevious->setPixmaps(btnGraphic[4],btnGraphic[5]);
   SubBarBtnPrevious->setGeometry(175,0,60,80);
   SubBarBtnPrevious->show();
   
   SubBarBtnPlayNPause=new SkinButton(this);
   SubBarBtnPlayNPause->setPixmaps(btnGraphic[6],btnGraphic[7]);
   SubBarBtnPlayNPause->setGeometry(240,0,80,80);
   SubBarBtnPlayNPause->show();
   
   SubBarBtnNext=new SkinButton(this);
   SubBarBtnNext->setPixmaps(btnGraphic[10],btnGraphic[11]);
   SubBarBtnNext->setGeometry(323,0,60,80);
   SubBarBtnNext->show();
   
   QObject::connect(SubBarBtnAlbumClock,SIGNAL(pressed()),this,SLOT(slotChangeMode()));
   QObject::connect(SubBarBtnPlayNPause,SIGNAL(pressed()),this,SLOT(slotChangePlayNPauseBtnGraphic()));
  // slideshowstate=AlbumControl::GO;

}
示例#3
0
StationInfoWidget::StationInfoWidget(MetroMapMainWindow* ctrl, QWidget* parent) :
  QWidget(parent),
  m_ui(new Ui::StationInfoWidget()),
  m_controller(ctrl),
  m_lockMode(true),
  m_currentStation(0)
{
  Q_CHECK_PTR(m_controller);

  m_ui->setupUi(this);

  initLineColors();
  setShowMode();

  connect(m_controller, SIGNAL(mapChanged()), SLOT(slotMapChanged()));
  connect(m_ui->lockButton, SIGNAL(clicked()), SLOT(slotChangeMode()));
  connect(m_ui->addNextButton, SIGNAL(clicked()), SLOT(slotAddNextStation()));
  connect(m_ui->addCrossButton, SIGNAL(clicked()), SLOT(slotAddCrossStation()));
}
示例#4
0
KatePluginSymbolViewerView::KatePluginSymbolViewerView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mw)
:QObject(mw)
,m_mainWindow(mw)
,m_plugin(qobject_cast<KatePluginSymbolViewer*>(plugin))
{
  // FIXME KF5 KGlobal::locale()->insertCatalog("katesymbolviewerplugin");

  KXMLGUIClient::setComponentName (QLatin1String("katesymbolviewer"), i18n ("SymbolViewer"));
  setXMLFile(QLatin1String("ui.rc"));

  mw->guiFactory()->addClient (this);
  m_symbols = 0;

  m_popup = new QMenu(m_symbols);
  m_popup->addAction(i18n("Refresh List"), this, SLOT(slotRefreshSymbol()));
  m_popup->addSeparator();
  m_macro = m_popup->addAction(i18n("Show Macros"), this, SLOT(toggleShowMacros()));
  m_struct = m_popup->addAction(i18n("Show Structures"), this, SLOT(toggleShowStructures()));
  m_func = m_popup->addAction(i18n("Show Functions"), this, SLOT(toggleShowFunctions()));
  m_popup->addSeparator();
  m_popup->addAction(i18n("List/Tree Mode"), this, SLOT(slotChangeMode()));
  m_sort = m_popup->addAction(i18n("Enable Sorting"), this, SLOT(slotEnableSorting()));

  KConfigGroup config(KSharedConfig::openConfig(), "PluginSymbolViewer");
  m_plugin->typesOn = config.readEntry(QLatin1String("ViewTypes"), false);
  m_plugin->expandedOn = config.readEntry(QLatin1String("ExpandTree"), false);
  m_plugin->treeOn = config.readEntry(QLatin1String("TreeView"), false);
  m_plugin->sortOn = config.readEntry(QLatin1String("SortSymbols"), false);

  m_macro->setChecked(true);
  m_struct->setChecked(true);
  m_func->setChecked(true);
  m_sort->setChecked(m_plugin->sortOn);
  macro_on = true;
  struct_on = true;
  func_on = true;

  m_updateTimer.setSingleShot(true);
  connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(slotRefreshSymbol()));

  m_currItemTimer.setSingleShot(true);
  connect(&m_currItemTimer, SIGNAL(timeout()), this, SLOT(updateCurrTreeItem()));

  QPixmap cls( ( const char** ) class_xpm );

  m_toolview = m_mainWindow->createToolView(plugin, QLatin1String("kate_plugin_symbolviewer"),
                                            KTextEditor::MainWindow::Left,
                                            cls,
                                            i18n("Symbol List"));

  QWidget *container = new QWidget(m_toolview);
  QHBoxLayout *layout = new QHBoxLayout(container);

  m_symbols = new QTreeWidget();
  m_symbols->setFocusPolicy(Qt::NoFocus);
  m_symbols->setLayoutDirection( Qt::LeftToRight );
  layout->addWidget(m_symbols, 10);
  layout->setContentsMargins(0,0,0,0);

  connect(m_symbols, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(goToSymbol(QTreeWidgetItem*)));
  connect(m_symbols, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotShowContextMenu(QPoint)));

  connect(m_mainWindow, SIGNAL(viewChanged(KTextEditor::View *)), this, SLOT(slotDocChanged()));

  QStringList titles;
  titles << i18nc("@title:column", "Symbols") << i18nc("@title:column", "Position");
  m_symbols->setColumnCount(2);
  m_symbols->setHeaderLabels(titles);

  m_symbols->setColumnHidden(1, true);
  m_symbols->setSortingEnabled(m_plugin->sortOn);
  m_symbols->setRootIsDecorated(0);
  m_symbols->setContextMenuPolicy(Qt::CustomContextMenu);
  m_symbols->setIndentation(10);

  m_toolview->installEventFilter(this);

  /* First Symbols parsing here...*/
  QTimer::singleShot(10, this, SLOT(slotRefreshSymbol()));
  if (m_plugin->sortOn == true) m_symbols->sortItems(0, Qt::AscendingOrder);
}
示例#5
0
DigiSettingsDialog::DigiSettingsDialog(TextDoc *Doc_)
                  : QDialog(Doc_) 
{
  Doc = Doc_;
  setWindowTitle(tr("Document Settings"));

  Expr.setPattern("[0-9][0-9a-zA-Z ]+"); // valid expression for LineEdit
  Validator = new QRegExpValidator(Expr, this);

  QVBoxLayout *all = new QVBoxLayout(this);
  all->setMargin(5);

  QGroupBox *setGroup = new QGroupBox(tr("Digital Simulation Settings"));
  all->addWidget(setGroup);
 
  QVBoxLayout *group = new QVBoxLayout();
  setGroup->setLayout(group);
   
  QButtonGroup *toggleGroup = new QButtonGroup();
  simRadio = new QRadioButton(tr("Simulation"));
  group->addWidget(simRadio);
  simRadio->setChecked(Doc->simulation);

  QHBoxLayout *hb1 = new QHBoxLayout();
  hb1->setSpacing(5);
  TimeLabel = new QLabel(tr("Duration of Simulation:"));
  hb1->addWidget(TimeLabel);
  Doc->loadSimulationTime(SimTime);
  TimeEdit = new QLineEdit();
  hb1->addWidget(TimeEdit);
  TimeEdit->setValidator(Validator);
  TimeEdit->setText(SimTime);
  group->addLayout(hb1);

  QRadioButton *comRadio = new QRadioButton(tr("Precompile Module"));
  group->addWidget(comRadio);
  toggleGroup->insert(simRadio);
  toggleGroup->insert(comRadio);
  connect(toggleGroup, SIGNAL(buttonClicked(int)), SLOT(slotChangeMode(int)));

  QHBoxLayout *hb3 = new QHBoxLayout();
  hb3->setSpacing(5);
  NameLabel = new QLabel(tr("Library Name:"));
  hb3->addWidget(NameLabel);
  NameEdit = new QLineEdit();
  hb3->addWidget(NameEdit);
  NameEdit->setText(Doc->Library);
  group->addLayout(hb3);

  group->addSpacing(15);
  
  QHBoxLayout *hb2 = new QHBoxLayout();
  hb2->setSpacing(5);
  LibLabel = new QLabel(tr("Libraries:"));
  hb2->addWidget(LibLabel);
  LibEdit = new QLineEdit();
  hb2->addWidget(LibEdit);
  LibEdit->setText(Doc->Libraries);
  group->addLayout(hb2);

  all->addSpacing(5);
  all->addStretch();
  QHBoxLayout *Buttons = new QHBoxLayout();
  QPushButton *ButtonOk = new QPushButton(tr("Ok"));
  QPushButton *ButtonCancel = new QPushButton(tr("Cancel"));
  Buttons->addWidget(ButtonOk);
  Buttons->addWidget(ButtonCancel);
  connect(ButtonOk, SIGNAL(clicked()), SLOT(slotOk()));
  connect(ButtonCancel, SIGNAL(clicked()), SLOT(reject()));
  all->addLayout(Buttons);

  simRadio->setChecked(Doc->simulation);
  Doc->SimOpenDpl = Doc->simulation ? true : false;
  comRadio->setChecked(!Doc->simulation);
  slotChangeMode(!Doc->simulation);

  ButtonOk->setDefault(true);
  if(Doc->simulation) {
    setFocusProxy(TimeEdit);
    TimeEdit->setFocus();
  }
  else {
    setFocusProxy(NameEdit);
    NameEdit->setFocus();
  }
}