Example #1
0
ShowXmlDialog::ShowXmlDialog(const QString & node,QWidget * parent) :QDialog(parent) {
  QVBoxLayout * layout = new QVBoxLayout;
  m_xml = new QPlainTextEdit;
  m_node = node;
  m_unlock = new QCheckBox(tr("Unchecked to enable editing"));
  connect(m_unlock,SIGNAL(stateChanged(int)),this,SLOT(onUnlock(int)));

  m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Save|QDialogButtonBox::Close);
  connect(m_buttonBox,SIGNAL(accepted()),this,SLOT(onSave()));
  connect(m_buttonBox,SIGNAL(rejected()),this,SLOT(onClose()));

  QPushButton * btn = new QPushButton(tr("Export"));
  m_buttonBox->addButton(btn,QDialogButtonBox::ActionRole);
  connect(btn,SIGNAL(clicked()),this,SLOT(onExport()));

  QHBoxLayout * hlayout = new QHBoxLayout ;
  hlayout->addWidget(m_unlock);
  hlayout->addWidget(m_buttonBox);
  layout->addWidget(m_xml);
  layout->addLayout(hlayout);
  setLayout(layout);

  SETTINGS

  settings.beginGroup("Entry");
  resize(settings.value(SID_ENTRY_XML_VIEWER_SIZE,QSize(600,400)).toSize());
  move(settings.value(SID_ENTRY_XML_VIEWER_POS,QPoint(450,20)).toPoint());
  m_locked = settings.value(SID_ENTRY_XML_VIEWER_LOCKED,true).toBool();
}
Example #2
0
void crashutils::messageRouter(csystem *src, int msg, param lparam, param rparam)
{
  csystem::messageRouter(src, msg, lparam, rparam);
  
  switch (msg)
  {
    case MSG_LOAD_NSD:     onLoadNSD((char*)lparam);        break;
    case MSG_SAVE_NSD:     /*...*/                          break;
    
    case MSG_INIT_NSD:     onInitNSD((NSF*)lparam, (NSD*)rparam); break;
    case MSG_GET_NSD:      onGetNSD((NSF**)lparam, (NSD**)rparam); break;
    
    case MSG_LOOKUP_ENTRY: onLookup((unsigned long)lparam, (entry**)rparam); break;
    case MSG_SELECT_ITEM:  onSelect((entry*)lparam, (int)rparam); break;
    case MSG_EXPORT_ITEM:  onExport((entry*)lparam, (char*)rparam); break;
  }
}
void KaduExtInfo::RegisterInConfigDialog(bool migrate)
{
    kdebugf();
    config = new ConfigFile(extinfoPath(QString("ext-info.conf")));
    ConfigDialog::addTab("ExtInfo",dataPath("kadu/modules/data/ext_info/ext_info_tab.png"));
    ConfigDialog::addVGroupBox("ExtInfo", "ExtInfo", QT_TRANSLATE_NOOP("@default", "Remind"));
    ConfigDialog::addCheckBox(config, "ExtInfo", "Remind", QT_TRANSLATE_NOOP("@default", "Enable to remind of name day"), "name_day", migrate ? config_file.readBoolEntry("ExtInfo","name_day",true) : TRUE);
    ConfigDialog::addCheckBox(config, "ExtInfo", "Remind", QT_TRANSLATE_NOOP("@default", "Enable to remind of birthday"), "birthday", migrate ? config_file.readBoolEntry("ExtInfo","birthday",true) : TRUE);
    ConfigDialog::addSpinBox(config, "ExtInfo", "Remind", QT_TRANSLATE_NOOP("@default", "Remind days before:"),"remind",0,100,1, migrate ? config_file.readNumEntry("ExtInfo","remind",3) : 1);
    ConfigDialog::addSpinBox(config, "ExtInfo", "Remind", QT_TRANSLATE_NOOP("@default", "Reminds frequency (minutes):"),"remind_frequency",0,1440,1, migrate ? config_file.readNumEntry("ExtInfo","remind_frequency",10) : 10);
    ConfigDialog::addHBox("ExtInfo","ExtInfo","ieButtons");//"Import/export buttons"
    ConfigDialog::addPushButton("ExtInfo","ieButtons",QT_TRANSLATE_NOOP("@default","Import"));
    ConfigDialog::addPushButton("ExtInfo","ieButtons",QT_TRANSLATE_NOOP("@default","Export"));
    ConfigDialog::addCheckBox(config, "ExtInfo", "ExtInfo", QT_TRANSLATE_NOOP("@default", "Show ext_info button in chat windows"), "button", migrate ? config_file.readBoolEntry("ExtInfo","button",true) : TRUE);
    ConfigDialog::addCheckBox(config, "ExtInfo", "ExtInfo", QT_TRANSLATE_NOOP("@default", "Check for new stable version"), "stable", TRUE);
    ConfigDialog::addCheckBox(config, "ExtInfo", "ExtInfo", QT_TRANSLATE_NOOP("@default", "Check for new unstable version"), "unstable", FALSE);
    ConfigDialog::addLineEdit(config, "ExtInfo", "ExtInfo", QT_TRANSLATE_NOOP("@default", "Mail program"), "mail_program", "thunderbird -remote \"mailto(%1)\" || thunderbird -compose \"to=%1\"");
    if (migrate)
        config->sync();
    ConfigDialog::connectSlot("ExtInfo","Import",SIGNAL(clicked()),this,SLOT(onImport()));
    ConfigDialog::connectSlot("ExtInfo","Export",SIGNAL(clicked()),this,SLOT(onExport()));
    kdebugf2();
}
void KaduExtInfo::UnregisterInConfigDialog()
{
    kdebugf();
    ConfigDialog::disconnectSlot("ExtInfo","Import",SIGNAL(clicked()),this,SLOT(onImport()));
    ConfigDialog::disconnectSlot("ExtInfo","Export",SIGNAL(clicked()),this,SLOT(onExport()));

    ConfigDialog::removeControl("ExtInfo","Mail program");
    ConfigDialog::removeControl("ExtInfo","Check for new unstable version");
    ConfigDialog::removeControl("ExtInfo","Check for new stable version");
    ConfigDialog::removeControl("ExtInfo","Show ext_info button in chat windows");
    ConfigDialog::removeControl("ExtInfo","Export");
    ConfigDialog::removeControl("ExtInfo","Import");
    ConfigDialog::removeControl("ExtInfo","ieButtons");
    ConfigDialog::removeControl("ExtInfo","Reminds frequency (minutes):");
    ConfigDialog::removeControl("ExtInfo","Remind days before:");
    ConfigDialog::removeControl("ExtInfo","Enable to remind of name day");
    ConfigDialog::removeControl("ExtInfo","Enable to remind of birthday");
    ConfigDialog::removeControl("ExtInfo","Remind");
    ConfigDialog::removeTab("ExtInfo");
    config->sync();
    delete config;
    kdebugf2();
}
Example #5
0
dtkPlotViewToolBar::dtkPlotViewToolBar(dtkPlotView *parent) : QFrame(parent->widget()), d(new dtkPlotViewToolBarPrivate())
{
    QToolBar *bar = new QToolBar(this);

    d->view = parent;

    d->defaultViewAction = new QAction("Default", this);
    d->defaultViewAction->setToolTip("Show default view");
    d->defaultViewAction->setIcon(QPixmap(":dtkPlot/pixmaps/dtkPlotAxis.png"));

    d->gridAction = new QAction("Grid", this);
    d->gridAction->setCheckable(true);
    d->gridAction->setChecked(false);
    d->gridAction->setToolTip("Draw grid coodinates");
    d->gridAction->setIcon(QPixmap(":dtkPlot/pixmaps/dtkPlotGrid.png"));

    d->pickingAction = new QAction("Picking", this);
    d->pickingAction->setCheckable(true);
    d->pickingAction->setChecked(false);
    d->pickingAction->setToolTip("Activate picking");
    d->pickingAction->setIcon(QPixmap(":dtkPlot/pixmaps/dtkPlotPicking.png"));

    d->zoomAction = new QAction("Zoom", this);
    d->zoomAction->setCheckable(true);
    d->zoomAction->setChecked(false);
    d->zoomAction->setToolTip("Activate zoom");
    d->zoomAction->setIcon(QPixmap(":dtkPlot/pixmaps/dtkPlotZoom.png"));

    d->legendAction = new QAction("Legend", this);
    d->legendAction->setCheckable(true);
    d->legendAction->setChecked(false);
    d->legendAction->setToolTip("Activate legend");
    d->legendAction->setIcon(QPixmap(":dtkPlot/pixmaps/dtkPlotLegend.png"));

    d->exportAction = new QAction("Export", this);
    d->exportAction->setToolTip("Export view");
    d->exportAction->setIcon(QPixmap(":dtkPlot/pixmaps/dtkPlotSupportExport.png"));

    bar->addAction(d->defaultViewAction);
    bar->addAction(d->zoomAction);
    bar->addAction(d->gridAction);
    bar->addAction(d->pickingAction);
    bar->addAction(d->legendAction);
    bar->addWidget(new dtkSpacer);
    bar->addAction(d->exportAction);
    bar->setFloatable(false);
    bar->setIconSize(QSize(18, 18));
    bar->setMovable(false);
    bar->setOrientation(Qt::Horizontal);
    bar->setFixedHeight(25);
    bar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(0);
    layout->addWidget(bar);

    connect(d->defaultViewAction, SIGNAL(triggered(bool)), this, SLOT(onDefaultView()));
    connect(d->zoomAction, SIGNAL(triggered(bool)), this, SLOT(onZoomActivated(bool)));
    connect(d->gridAction, SIGNAL(triggered(bool)), this, SLOT(onGridActivated(bool)));
    connect(d->pickingAction, SIGNAL(triggered(bool)), this, SLOT(onPickingActivated(bool)));
    connect(d->legendAction, SIGNAL(triggered(bool)), this, SLOT(onLegendActivated(bool)));
    connect(d->exportAction, SIGNAL(triggered()), this, SLOT(onExport()));    
}
Example #6
0
void Selection::exportTriggered()
{
    emit onExport(left, right);
}