Exemple #1
0
void QSlider::addStep()
{
    addPage();
}
PreferencesDialog::PreferencesDialog(QWidget *parent)
    : ConfigDialog(parent, "PreferencesDialog")
{
    iCount++;
    server = new ServerSettings(this);
    playback = new PlaybackSettings(this);
    files = new FileSettings(this);
    interface = new InterfaceSettings(this);
    context = new ContextSettings(this);
    cache = new CacheSettings(this);
    scrobbling = new ScrobblingSettings(this);
    custom = new CustomActionsSettings(this);
    server->load();
    playback->load();
    files->load();
    interface->load();
    context->load();
    scrobbling->load();
    custom->load();
    addPage(QLatin1String("collection"), server, i18n("Collection"), Icons::self()->audioFileIcon, i18n("Collection Settings"));
    addPage(QLatin1String("playback"), playback, i18n("Playback"), Icons::self()->speakerIcon, i18n("Playback Settings"));
    addPage(QLatin1String("files"), files, i18n("Downloaded Files"), Icons::self()->filesIcon, i18n("Downloaded Files Settings"));
    addPage(QLatin1String("interface"), interface, i18n("Interface"), Icon("preferences-other"), i18n("Interface Settings"));
    addPage(QLatin1String("info"), context, i18n("Info"), Icons::self()->contextIcon, i18n("Info View Settings"));
    addPage(QLatin1String("scrobbling"), scrobbling, i18n("Scrobbling"), Icons::self()->lastFmIcon, i18n("Scrobbling Settings"));
    #if defined CDDB_FOUND || defined MUSICBRAINZ5_FOUND
    audiocd = new AudioCdSettings(0);
    audiocd->load();
    addPage(QLatin1String("cd"), audiocd, i18n("Audio CD"), Icon("media-optical"), i18n("Audio CD Settings"));
    #endif
    #ifdef ENABLE_PROXY_CONFIG
    proxy = new ProxySettings(0);
    proxy->load();
    addPage(QLatin1String("proxy"), proxy, i18n("Proxy"), Icon("preferences-system-network"), i18nc("Qt-only", "Proxy Settings"));
    #endif
    #ifndef ENABLE_KDE_SUPPORT
    shortcuts = new ShortcutsSettingsPage(0);
    addPage(QLatin1String("shortcuts"), shortcuts, i18nc("Qt-only", "Shortcuts"), Icon(QStringList() << "preferences-desktop-keyboard" << "keyboard"),
            i18nc("Qt-only", "Keyboard Shortcut Settings"));
    shortcuts->load();
    #endif
    addPage(QLatin1String("cache"), cache, i18n("Cache"), Icon(QStringList() << "folder-temp" << "folder"), i18n("Cached Items"));
    addPage(QLatin1String("custom"), custom, i18n("Custom Actions"), Icon(QStringList() << "fork" << "gtk-execute"), i18n("Custom Actions"));
    #ifdef Q_OS_MAC
    setCaption(i18n("Cantata Preferences"));
    #else
    setCaption(i18n("Configure"));
    #endif
    setAttribute(Qt::WA_DeleteOnClose);
    setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
    setCurrentPage(QLatin1String("collection"));
}
// ------------------- LibraryWizardDialog
LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
                                         const QIcon &icon,
                                         bool showModulesPage,
                                         QWidget *parent,
                                         const Core::WizardDialogParameters &parameters) :
    BaseQt4ProjectWizardDialog(showModulesPage, new LibraryIntroPage, -1, parent, parameters),
    m_filesPage(new FilesPage),
    m_mobilePage(new MobileLibraryWizardOptionPage),
    m_pluginBaseClassesInitialized(false),
    m_filesPageId(-1), m_modulesPageId(-1), m_targetPageId(-1),
    m_mobilePageId(-1)
{
    setWindowIcon(icon);
    setWindowTitle(templateName);
    setSelectedModules(QLatin1String("core"));

    // Note that QWizard::currentIdChanged() is emitted at strange times.
    // Use the intro page instead, set up initially
    setIntroDescription(tr("This wizard generates a C++ library project."));

    if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS)) {
        m_targetPageId = addTargetSetupPage();
        m_mobilePageId = addPage(m_mobilePage);
    } else if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM)) {
        m_mobilePageId = addPage(m_mobilePage);
    }

    m_modulesPageId = addModulesPage();

    m_filesPage->setNamespacesEnabled(true);
    m_filesPage->setFormFileInputVisible(false);
    m_filesPage->setClassTypeComboVisible(false);

    m_filesPageId = addPage(m_filesPage);

    Utils::WizardProgressItem *introItem = wizardProgress()->item(startId());
    Utils::WizardProgressItem *targetItem = 0;
    Utils::WizardProgressItem *mobileItem = 0;
    if (m_targetPageId != -1) {
        targetItem = wizardProgress()->item(m_targetPageId);
    }
    if (m_mobilePageId != -1) {
        mobileItem = wizardProgress()->item(m_mobilePageId);
        mobileItem->setTitle(QLatin1String("    ") + tr("Symbian Specific"));
    }
    Utils::WizardProgressItem *modulesItem = wizardProgress()->item(m_modulesPageId);
    Utils::WizardProgressItem *filesItem = wizardProgress()->item(m_filesPageId);
    filesItem->setTitle(tr("Details"));

    if (m_targetPageId != -1) {
        targetItem->setNextItems(QList<Utils::WizardProgressItem *>()
                                 << mobileItem << modulesItem << filesItem);
        targetItem->setNextShownItem(0);
        mobileItem->setNextItems(QList<Utils::WizardProgressItem *>()
                                 << modulesItem << filesItem);
        mobileItem->setNextShownItem(0);
    } else if (m_mobilePageId != -1) {
        introItem->setNextItems(QList<Utils::WizardProgressItem *>()
                                 << mobileItem);
        mobileItem->setNextItems(QList<Utils::WizardProgressItem *>()
                                 << modulesItem << filesItem);
        mobileItem->setNextShownItem(0);
    } else {
        introItem->setNextItems(QList<Utils::WizardProgressItem *>()
                                 << modulesItem << filesItem);
        introItem->setNextShownItem(0);
    }

    connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));

    addExtensionPages(parameters.extensionPages());
}
Exemple #4
0
KMWizard::KMWizard(TQWidget *parent, const char *name)
: TQDialog(parent,name,true)
{
	m_start = KMWizard::Start;
	m_end = KMWizard::End;
	m_inclusive = true;
	m_printer = new KMPrinter();

	m_pagepool.setAutoDelete(false);

	m_stack = new TQWidgetStack(this);
	m_next = new KPushButton(i18n("&Next >"), this);
	m_next->setDefault(true);
	m_prev = new KPushButton(i18n("< &Back"), this);
	TQPushButton	*m_cancel = new KPushButton(KStdGuiItem::cancel(), this);
	m_title = new TQLabel(this);
	TQFont	f(m_title->font());
	f.setBold(true);
	m_title->setFont(f);
	KSeparator* sep = new KSeparator( KSeparator::HLine, this);
	sep->setFixedHeight(5);
	KSeparator* sep2 = new KSeparator( KSeparator::HLine, this);
	TQPushButton	*m_help = new KPushButton(KStdGuiItem::help(), this);

	connect(m_cancel,TQT_SIGNAL(clicked()),TQT_SLOT(reject()));
	connect(m_next,TQT_SIGNAL(clicked()),TQT_SLOT(slotNext()));
	connect(m_prev,TQT_SIGNAL(clicked()),TQT_SLOT(slotPrev()));
	connect(m_help, TQT_SIGNAL(clicked()), TQT_SLOT(slotHelp()));

	m_side = new SidePixmap(this);
	if (!m_side->isValid())
	{
		delete m_side;
		m_side = 0;
	}

	// layout
	TQVBoxLayout *main0_ = new TQVBoxLayout(this, 10, 10);
	TQVBoxLayout	*main_ = new TQVBoxLayout(0, 0, 0);
	TQHBoxLayout *main1_ = new TQHBoxLayout(0, 0, 10);
	TQHBoxLayout	*btn_ = new TQHBoxLayout(0, 0, 10);
	main0_->addLayout(main1_);
	if (m_side)
		main1_->addWidget(m_side);
	main1_->addLayout(main_);
	main_->addWidget(m_title);
	main_->addWidget(sep);
	main_->addSpacing(10);
	main_->addWidget(m_stack,1);
	main0_->addWidget(sep2);
	main0_->addLayout(btn_);
	btn_->addWidget(m_help);
	btn_->addStretch(1);
	btn_->addWidget(m_prev);
	btn_->addWidget(m_next);
	btn_->addWidget(m_cancel);

	// create standard pages
	addPage(new KMWInfoPage(this));
	m_backend = new KMWBackend(this);
	addPage(m_backend);
	addPage(new KMWPassword(this));
	addPage(new KMWSocket(this));
	addPage(new KMWDriver(this));
	addPage(new KMWDriverSelect(this));
	addPage(new KMWDriverTest(this));
	addPage(new KMWName(this));
	addPage(new KMWEnd(this));
	addPage(new KMWClass(this));
	addPage(new KMWLpd(this));
	addPage(new KMWFile(this));
	addPage(new KMWSmb(this));
	addPage(new KMWLocal(this));

	// add other pages
	KMFactory::self()->uiManager()->setupWizard(this);

	setCurrentPage(m_start,false);
	setCaption(i18n("Add Printer Wizard"));
	resize(400,350);
}
Exemple #5
0
KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, Kate::View *view )
 : KDialogBase ( KDialogBase::TreeList,
                 i18n("Configure"),
                 KDialogBase::Ok | KDialogBase::Apply|KDialogBase::Cancel | KDialogBase::Help,
                 KDialogBase::Ok,
                 parent,
                 "configdialog" )
{
  TDEConfig *config = KateApp::self()->config();

  KWin::setIcons( winId(), KateApp::self()->icon(), KateApp::self()->miniIcon() );

  actionButton( KDialogBase::Apply)->setEnabled( false );

  mainWindow = parent;

  setMinimumSize(600,400);

  v = view;

  pluginPages.setAutoDelete (false);
  editorPages.setAutoDelete (false);

  TQStringList path;

  setShowIconsInTreeList(true);

  path.clear();
  path << i18n("Application");
  setFolderIcon (path, SmallIcon("kate", TDEIcon::SizeSmall));

  path.clear();

  //BEGIN General page
  path << i18n("Application") << i18n("General");
  TQFrame* frGeneral = addPage(path, i18n("General Options"), BarIcon("go-home", TDEIcon::SizeSmall));

  TQVBoxLayout *lo = new TQVBoxLayout( frGeneral );
  lo->setSpacing(KDialog::spacingHint());
  config->setGroup("General");

  // GROUP with the one below: "Appearance"
  TQButtonGroup *bgStartup = new TQButtonGroup( 1, Qt::Horizontal, i18n("&Appearance"), frGeneral );
  lo->addWidget( bgStartup );

  // show full path in title
  config->setGroup("General");
  cb_fullPath = new TQCheckBox( i18n("&Show full path in title"), bgStartup);
  cb_fullPath->setChecked( mainWindow->viewManager()->getShowFullPath() );
  TQWhatsThis::add(cb_fullPath,i18n("If this option is checked, the full document path will be shown in the window caption."));
  connect( cb_fullPath, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) );

  // sort filelist if desired
   cb_sortFiles = new TQCheckBox(bgStartup);
   cb_sortFiles->setText(i18n("Sort &files alphabetically in the file list"));
   cb_sortFiles->setChecked(parent->filelist->sortType() == KateFileList::sortByName);
   TQWhatsThis::add( cb_sortFiles, i18n(
         "If this is checked, the files in the file list will be sorted alphabetically.") );
   connect( cb_sortFiles, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) );

  // GROUP with the one below: "Behavior"
  bgStartup = new TQButtonGroup( 1, Qt::Horizontal, i18n("&Behavior"), frGeneral );
  lo->addWidget( bgStartup );

  // number of recent files
  TQHBox *hbNrf = new TQHBox( bgStartup );
  TQLabel *lNrf = new TQLabel( i18n("&Number of recent files:"), hbNrf );
  sb_numRecentFiles = new TQSpinBox( 0, 1000, 1, hbNrf );
  sb_numRecentFiles->setValue( mainWindow->fileOpenRecent->maxItems() );
  lNrf->setBuddy( sb_numRecentFiles );
  TQString numRecentFileHelpString ( i18n(
        "<qt>Sets the number of recent files remembered by Kate.<p><strong>NOTE: </strong>"
        "If you set this lower than the current value, the list will be truncated and "
        "some items forgotten.</qt>") );
  TQWhatsThis::add( lNrf, numRecentFileHelpString );
  TQWhatsThis::add( sb_numRecentFiles, numRecentFileHelpString );
  connect( sb_numRecentFiles, TQT_SIGNAL( valueChanged ( int ) ), this, TQT_SLOT( slotChanged() ) );

  // Use only one instance of kate (MDI) ?
  cb_useInstance = new TQCheckBox(bgStartup);
  cb_useInstance->setText(i18n("Always use the current instance of kate to open new files"));
  cb_useInstance->setChecked(parent->useInstance);
  TQWhatsThis::add( cb_useInstance, i18n(
        "When checked, all files opened from outside of Kate will only use the "
        "currently opened instance of Kate.") );
  connect( cb_useInstance, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) );

  // sync the konsole ?
  cb_syncKonsole = new TQCheckBox(bgStartup);
  cb_syncKonsole->setText(i18n("Sync &terminal emulator with active document"));
  cb_syncKonsole->setChecked(parent->syncKonsole);
  TQWhatsThis::add( cb_syncKonsole, i18n(
        "If this is checked, the built in Konsole will <code>cd</code> to the directory "
        "of the active document when started and whenever the active document changes, "
        "if the document is a local file.") );
  connect( cb_syncKonsole, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) );

  // modified files notification
  cb_modNotifications = new TQCheckBox(
      i18n("Wa&rn about files modified by foreign processes"), bgStartup );
  cb_modNotifications->setChecked( parent->modNotification );
  TQWhatsThis::add( cb_modNotifications, i18n(
      "If enabled, when Kate receives focus you will be asked what to do with "
      "files that have been modified on the hard disk. If not enabled, you will "
      "be asked what to do with a file that has been modified on the hard disk only "
      "when that file gains focus inside Kate.") );
  connect( cb_modNotifications, TQT_SIGNAL( toggled( bool ) ),
           this, TQT_SLOT( slotChanged() ) );

  // GROUP with the one below: "Meta-informations"
  bgStartup = new TQButtonGroup( 2, Qt::Horizontal, i18n("Meta-Information"), frGeneral );
  lo->addWidget( bgStartup );

  // save meta infos
  cb_saveMetaInfos = new TQCheckBox( bgStartup );
  cb_saveMetaInfos->setText(i18n("Keep &meta-information past sessions"));
  cb_saveMetaInfos->setChecked(KateDocManager::self()->getSaveMetaInfos());
  TQWhatsThis::add(cb_saveMetaInfos, i18n(
        "Check this if you want document configuration like for example "
        "bookmarks to be saved past editor sessions. The configuration will be "
        "restored if the document has not changed when reopened."));
  connect( cb_saveMetaInfos, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) );

  // meta infos days
  TQHBox *hbDmf = new TQHBox( bgStartup );
  hbDmf->setEnabled(KateDocManager::self()->getSaveMetaInfos());
  TQLabel *lDmf = new TQLabel( i18n("&Delete unused meta-information after:"), hbDmf );
  sb_daysMetaInfos = new TQSpinBox( 0, 180, 1, hbDmf );
  sb_daysMetaInfos->setSpecialValueText(i18n("(never)"));
  sb_daysMetaInfos->setSuffix(i18n(" day(s)"));
  sb_daysMetaInfos->setValue( KateDocManager::self()->getDaysMetaInfos() );
  lDmf->setBuddy( sb_daysMetaInfos );
  connect( cb_saveMetaInfos, TQT_SIGNAL( toggled( bool ) ), hbDmf, TQT_SLOT( setEnabled( bool ) ) );
  connect( sb_daysMetaInfos, TQT_SIGNAL( valueChanged ( int ) ), this, TQT_SLOT( slotChanged() ) );

  lo->addStretch(1); // :-] works correct without autoadd
  //END General page

  path.clear();

  //BEGIN Session page
  path << i18n("Application") << i18n("Sessions");
  TQFrame* frSessions = addPage(path, i18n("Session Management"), BarIcon("history", TDEIcon::SizeSmall));

  lo = new TQVBoxLayout( frSessions );
  lo->setSpacing(KDialog::spacingHint());

  // GROUP with the one below: "Startup"
  bgStartup = new TQButtonGroup( 1, Qt::Horizontal, i18n("Elements of Sessions"), frSessions );
  lo->addWidget( bgStartup );

  // restore view  config
  cb_restoreVC = new TQCheckBox( bgStartup );
  cb_restoreVC->setText(i18n("Include &window configuration"));
  config->setGroup("General");
  cb_restoreVC->setChecked( config->readBoolEntry("Restore Window Configuration", true) );
  TQWhatsThis::add(cb_restoreVC, i18n(
        "Check this if you want all your views and frames restored each time you open Kate"));
  connect( cb_restoreVC, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) );

  TQRadioButton *rb1, *rb2, *rb3;

  sessions_start = new TQButtonGroup( 1, Qt::Horizontal, i18n("Behavior on Application Startup"), frSessions );
  lo->add (sessions_start);

  sessions_start->setRadioButtonExclusive( true );
  sessions_start->insert( rb1=new TQRadioButton( i18n("&Start new session"), sessions_start ), 0 );
  sessions_start->insert( rb2=new TQRadioButton( i18n("&Load last-used session"), sessions_start ), 1 );
  sessions_start->insert( rb3=new TQRadioButton( i18n("&Manually choose a session"), sessions_start ), 2 );

  config->setGroup("General");
  TQString sesStart (config->readEntry ("Startup Session", "manual"));
  if (sesStart == "new")
    sessions_start->setButton (0);
  else if (sesStart == "last")
    sessions_start->setButton (1);
  else
    sessions_start->setButton (2);

  connect(rb1, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotChanged()));
  connect(rb2, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotChanged()));
  connect(rb3, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotChanged()));

  sessions_exit = new TQButtonGroup( 1, Qt::Horizontal, i18n("Behavior on Application Exit or Session Switch"), frSessions );
  lo->add (sessions_exit);

  sessions_exit->setRadioButtonExclusive( true );
  sessions_exit->insert( rb1=new TQRadioButton( i18n("&Do not save session"), sessions_exit ), 0 );
  sessions_exit->insert( rb2=new TQRadioButton( i18n("&Save session"), sessions_exit ), 1 );
  sessions_exit->insert( rb3=new TQRadioButton( i18n("&Ask user"), sessions_exit ), 2 );

  config->setGroup("General");
  TQString sesExit (config->readEntry ("Session Exit", "save"));
  if (sesExit == "discard")
    sessions_exit->setButton (0);
  else if (sesExit == "save")
    sessions_exit->setButton (1);
  else
    sessions_exit->setButton (2);

  connect(rb1, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotChanged()));
  connect(rb2, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotChanged()));
  connect(rb3, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotChanged()));

  lo->addStretch(1); // :-] works correct without autoadd
  //END Session page

  path.clear();

  // file selector page
  path << i18n("Application") << i18n("File Selector");

  TQVBox *page = addVBoxPage( path, i18n("File Selector Settings"),
                              BarIcon("document-open", TDEIcon::SizeSmall) );
  fileSelConfigPage = new KFSConfigPage( page, "file selector config page",
                                         mainWindow->fileselector );
  connect( fileSelConfigPage, TQT_SIGNAL( changed() ), this, TQT_SLOT( slotChanged() ) );
  path.clear();

  path << i18n("Application") << i18n("Document List");
  page = addVBoxPage( path, i18n("Document List Settings"),
  BarIcon("view_text", TDEIcon::SizeSmall) );
  filelistConfigPage = new KFLConfigPage( page, "file list config page",
					  mainWindow->filelist );
  connect( filelistConfigPage, TQT_SIGNAL( changed() ), this, TQT_SLOT( slotChanged() ) );
  path.clear();

  path << i18n("Application") << i18n("Plugins");
  /*TQVBox **/page=addVBoxPage(path,i18n("Plugin Manager"),
                          BarIcon("connect_established",TDEIcon::SizeSmall));
  KateConfigPluginPage *configPluginPage = new KateConfigPluginPage(page, this);
  connect( configPluginPage, TQT_SIGNAL( changed() ), TQT_TQOBJECT(this), TQT_SLOT( slotChanged() ) );

  // Tools->External Tools menu
  path.clear();
  path << i18n("Application") << i18n("External Tools");
  page = addVBoxPage( path, i18n("External Tools"),
      BarIcon("configure", TDEIcon::SizeSmall) );
  configExternalToolsPage = new KateExternalToolsConfigWidget(page, "external tools config page");
  connect( configExternalToolsPage, TQT_SIGNAL(changed()), TQT_TQOBJECT(this), TQT_SLOT(slotChanged()) );

  // editor widgets from kwrite/kwdialog
  path.clear();
  path << i18n("Editor");
  setFolderIcon (path, SmallIcon("edit", TDEIcon::SizeSmall));

  for (uint i = 0; i < KTextEditor::configInterfaceExtension (v->document())->configPages (); i++)
  {
    path.clear();
    path << i18n("Editor") << KTextEditor::configInterfaceExtension (v->document())->configPageName (i);
    /*TQVBox **/page = addVBoxPage(path, KTextEditor::configInterfaceExtension (v->document())->configPageFullName (i),
                              KTextEditor::configInterfaceExtension (v->document())->configPagePixmap(i, TDEIcon::SizeSmall) );

    KTextEditor::ConfigPage *cPage = KTextEditor::configInterfaceExtension (v->document())->configPage(i, page);
    connect( cPage, TQT_SIGNAL( changed() ), this, TQT_SLOT( slotChanged() ) );
    editorPages.append (cPage);
  }

  KatePluginList &pluginList (KatePluginManager::self()->pluginList());
  for (unsigned int i=0; i < pluginList.size(); ++i)
  {
    if  ( pluginList[i].load
          && Kate::pluginConfigInterfaceExtension(pluginList[i].plugin) )
      addPluginPage (pluginList[i].plugin);
  }

  enableButtonSeparator(true);
  dataChanged = false;
  unfoldTreeList ();
}
FancyPlotterSettings::FancyPlotterSettings( QWidget* parent, bool locked )
  : KPageDialog( parent ), mModel( new SensorModel( this ) )
{
  setFaceType( Tabbed );
  setCaption( i18n( "Plotter Settings" ) );
  setButtons( Ok | Apply | Cancel );
  setObjectName( "FancyPlotterSettings" );
  setModal( false );

  QFrame *page = 0;
  QGridLayout *pageLayout = 0;
  QGridLayout *boxLayout = 0;
  QGroupBox *groupBox = 0;
  QLabel *label = 0;

  // Style page
  page = new QFrame();
  addPage( page, i18n( "General" ) );
  pageLayout = new QGridLayout( page );
  pageLayout->setSpacing( spacingHint() );
  pageLayout->setMargin( 0 );

  label = new QLabel( i18n( "Title:" ), page );
  pageLayout->addWidget( label, 0, 0 );

  mTitle = new KLineEdit( page );
  mTitle->setWhatsThis( i18n( "Enter the title of the display here." ) );
  pageLayout->addWidget( mTitle, 0, 1 );
  label->setBuddy( mTitle );

  mStackBeams = new QCheckBox( i18n("Stack the beams on top of each other"), page);
  mStackBeams->setWhatsThis( i18n("The beams are stacked on top of each other, and the area is drawn filled in. So if one beam has a value of 2 and another beam has a value of 3, the first beam will be drawn at value 2 and the other beam drawn at 2+3=5.") );
  pageLayout->addWidget( mStackBeams, 1, 0,1,2);

  pageLayout->setRowStretch( 2, 1 );

  // Scales page
  page = new QFrame();
  addPage( page, i18n( "Scales" ) );
  pageLayout = new QGridLayout( page );
  pageLayout->setSpacing( spacingHint() );
  pageLayout->setMargin( 0 );

  groupBox = new QGroupBox( i18n( "Vertical scale" ), page );
  boxLayout = new QGridLayout;
  groupBox->setLayout( boxLayout );
  boxLayout->setSpacing( spacingHint() );
  boxLayout->setColumnStretch( 2, 1 );

  mManualRange = new QCheckBox( i18n( "Specify graph range:" ), groupBox );
  mManualRange->setWhatsThis( i18n( "Check this box if you want the display range to adapt dynamically to the currently displayed values; if you do not check this, you have to specify the range you want in the fields below." ) );
  mManualRange->setChecked(true);
  boxLayout->addWidget( mManualRange, 0, 0, 1, 5 );

  mMinValueLabel = new QLabel( i18n( "Minimum value:" ), groupBox );
  boxLayout->addWidget( mMinValueLabel, 1, 0 );

  mMinValue = new QDoubleSpinBox( groupBox );
  mMinValue->setMaximum( std::numeric_limits<long long>::max());
  mMinValue->setMinimum( std::numeric_limits<long long>::min());
  mMinValue->setWhatsThis( i18n( "Enter the minimum value for the display here." ) );
  mMinValue->setSingleStep(10);
  boxLayout->addWidget( mMinValue, 1, 1 );
  mMinValueLabel->setBuddy( mMinValue );

  mMaxValueLabel = new QLabel( i18n( "Maximum value:" ), groupBox );
  boxLayout->addWidget( mMaxValueLabel, 1, 3 );

  mMaxValue = new QDoubleSpinBox( groupBox);
  mMaxValue->setMaximum( std::numeric_limits<long long>::max());
  mMaxValue->setMinimum( std::numeric_limits<long long>::min());
  mMaxValue->setWhatsThis( i18n( "Enter the soft maximum value for the display here. The upper range will not be reduced below this value, but will still go above this number for values above this value." ) );
  mMaxValue->setSingleStep(10);
  boxLayout->addWidget( mMaxValue, 1, 4 );
  mMaxValueLabel->setBuddy( mMaxValue );

  pageLayout->addWidget( groupBox, 0, 0 );

  groupBox = new QGroupBox( i18n( "Horizontal scale" ), page );
  QFormLayout *formLayout = new QFormLayout(groupBox);

  mHorizontalScale = new KIntNumInput( 1, groupBox );
  mHorizontalScale->setMinimum( 1 );
  mHorizontalScale->setMaximum( 50 );

  formLayout->addRow( i18n("Pixels per time period:"), mHorizontalScale );


  pageLayout->addWidget( groupBox, 1, 0 );

  // Grid page
  page = new QFrame( );
  addPage( page, i18n( "Grid" ) );
  pageLayout = new QGridLayout( page );
  pageLayout->setSpacing( spacingHint() );
  pageLayout->setMargin( 0 );

  groupBox = new QGroupBox( i18n( "Lines" ), page );
  boxLayout = new QGridLayout;
  groupBox->setLayout( boxLayout );
  boxLayout->setSpacing( spacingHint() );
  boxLayout->setColumnStretch( 1, 1 );

  mShowVerticalLines = new QCheckBox( i18n( "Vertical lines" ), groupBox );
  mShowVerticalLines->setWhatsThis( i18n( "Check this to activate the vertical lines if display is large enough." ) );
  boxLayout->addWidget( mShowVerticalLines, 0, 0 );

  label = new QLabel( i18n( "Distance:" ), groupBox );
  boxLayout->addWidget( label, 0, 2 );

  mVerticalLinesDistance = new KIntNumInput( 0, groupBox );
  mVerticalLinesDistance->setMinimum( 10 );
  mVerticalLinesDistance->setMaximum( 120 );
  mVerticalLinesDistance->setWhatsThis( i18n( "Enter the distance between two vertical lines here." ) );
  boxLayout->addWidget( mVerticalLinesDistance , 0, 3 );
  label->setBuddy( mVerticalLinesDistance );

  mVerticalLinesScroll = new QCheckBox( i18n( "Vertical lines scroll" ), groupBox );
  boxLayout->addWidget( mVerticalLinesScroll, 1, 0, 1, -1 );

  mShowHorizontalLines = new QCheckBox( i18n( "Horizontal lines" ), groupBox );
  mShowHorizontalLines->setWhatsThis( i18n( "Check this to enable horizontal lines if display is large enough." ) );
  boxLayout->addWidget( mShowHorizontalLines, 2, 0, 1, -1 );

  pageLayout->addWidget( groupBox, 0, 0, 1, 2 );

  groupBox = new QGroupBox( i18n( "Text" ), page );
  boxLayout = new QGridLayout;
  groupBox->setLayout( boxLayout );
  boxLayout->setSpacing( spacingHint() );
  boxLayout->setColumnStretch( 1, 1 );

  mShowAxis = new QCheckBox( i18n( "Show axis labels" ), groupBox );
  mShowAxis->setWhatsThis( i18n( "Check this box if horizontal lines should be decorated with the values they mark." ) );
  boxLayout->addWidget( mShowAxis, 0, 0, 1, -1 );

  label = new QLabel( i18n( "Font size:" ), groupBox );
  boxLayout->addWidget( label, 1, 0 );

  mFontSize = new KIntNumInput( 8, groupBox );
  mFontSize->setMinimum( 1 );
  mFontSize->setMaximum( 1000 );
  boxLayout->addWidget( mFontSize, 1, 1 );
  label->setBuddy( mFontSize );

  pageLayout->addWidget( groupBox, 1, 0 );

  pageLayout->setRowStretch( 2, 1 );

  // Sensors page
  page = new QFrame( );
  addPage( page, i18n( "Sensors" ) );
  pageLayout = new QGridLayout( page );
  pageLayout->setSpacing( spacingHint() );
  pageLayout->setMargin( 0 );
  pageLayout->setRowStretch( 2, 1 );
  pageLayout->setRowStretch( 5, 1 );

  mView = new QTreeView( page );
  mView->header()->setStretchLastSection( false );
  mView->setRootIsDecorated( false );
  mView->setItemsExpandable( false );
  mView->setModel( mModel );
  mView->header()->setResizeMode(QHeaderView::ResizeToContents);
  bool hideFirstColumn = true;
  for(int i = 0; i < mModel->rowCount(); i++)
    if(mModel->data(mModel->index(i, 0)) != "localhost") {
      hideFirstColumn = false;
      break;
    }
  if(hideFirstColumn)
    mView->hideColumn(0);

  pageLayout->addWidget( mView, 0, 0, 6, 1 );
  connect(mView,SIGNAL(doubleClicked(QModelIndex)), this, SLOT(editSensor()));

  mEditButton = new QPushButton( i18n( "Set Color..." ), page );
  mEditButton->setWhatsThis( i18n( "Push this button to configure the color of the sensor in the diagram." ) );
  pageLayout->addWidget( mEditButton, 0, 1 );

  mRemoveButton = 0;
  mMoveUpButton = 0;
  mMoveDownButton = 0;
  if ( !locked ) {
    mRemoveButton = new QPushButton( i18n( "Delete" ), page );
    mRemoveButton->setWhatsThis( i18n( "Push this button to delete the sensor." ) );
    pageLayout->addWidget( mRemoveButton, 1, 1 );
    connect( mRemoveButton, SIGNAL(clicked()), SLOT(removeSensor()) );

    mMoveUpButton = new QPushButton( i18n( "Move Up" ), page );
    mMoveUpButton->setEnabled( false );
    pageLayout->addWidget( mMoveUpButton, 2, 1 );
    connect( mMoveUpButton, SIGNAL(clicked()), SLOT(moveUpSensor()) );

    mMoveDownButton = new QPushButton( i18n( "Move Down" ), page );
    mMoveDownButton->setEnabled( false );
    pageLayout->addWidget( mMoveDownButton, 3, 1 );
    connect( mMoveDownButton, SIGNAL(clicked()), SLOT(moveDownSensor()) );

    connect(mView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(selectionChanged(QModelIndex)));

  }

  connect( mManualRange, SIGNAL(toggled(bool)), mMinValue,
           SLOT(setEnabled(bool)) );
  connect( mManualRange, SIGNAL(toggled(bool)), mMaxValue,
           SLOT(setEnabled(bool)) );
  connect( mManualRange, SIGNAL(toggled(bool)), mMinValueLabel,
           SLOT(setEnabled(bool)) );
  connect( mManualRange, SIGNAL(toggled(bool)), mMaxValueLabel,
           SLOT(setEnabled(bool)) );

  connect( mShowVerticalLines, SIGNAL(toggled(bool)), mVerticalLinesDistance,
           SLOT(setEnabled(bool)) );
  connect( mShowVerticalLines, SIGNAL(toggled(bool)), mVerticalLinesScroll,
           SLOT(setEnabled(bool)) );

  connect( mEditButton, SIGNAL(clicked()), SLOT(editSensor()) );

  KAcceleratorManager::manage( this );
}
Exemple #7
0
Wizard::Wizard(bool upgrade, QWidget *parent) :
        QWizard(parent)
{
    setWindowTitle(i18n("Config Wizard"));
    setPixmap(QWizard::WatermarkPixmap, QPixmap(KStandardDirs::locate("appdata", "banner.png")));

    QWizardPage *page1 = new QWizardPage;
    page1->setTitle(i18n("Welcome"));
    QLabel *label;
    if (upgrade)
        label = new QLabel(i18n("Your Kdenlive version was upgraded. Please take some time to review the basic settings"));
    else
        label = new QLabel(i18n("This is the first time you run Kdenlive. This wizard will let you adjust some basic settings, you will be ready to edit your first movie in a few seconds..."));
    label->setWordWrap(true);
    m_startLayout = new QVBoxLayout;
    m_startLayout->addWidget(label);
    page1->setLayout(m_startLayout);
    addPage(page1);

    QWizardPage *page4 = new QWizardPage;
    page4->setTitle(i18n("Checking MLT engine"));
    m_mltCheck.setupUi(page4);
    addPage(page4);

    WizardDelegate *listViewDelegate = new WizardDelegate(m_mltCheck.programList);
    m_mltCheck.programList->setItemDelegate(listViewDelegate);

    QWizardPage *page2 = new QWizardPage;
    page2->setTitle(i18n("Video Standard"));
    m_standard.setupUi(page2);

    m_okIcon = KIcon("dialog-ok");
    m_badIcon = KIcon("dialog-close");

    // build profiles lists
    QMap<QString, QString> profilesInfo = ProfilesDialog::getProfilesInfo();
    QMap<QString, QString>::const_iterator i = profilesInfo.constBegin();
    while (i != profilesInfo.constEnd()) {
        QMap< QString, QString > profileData = ProfilesDialog::getSettingsFromFile(i.value());
        if (profileData.value("width") == "720") m_dvProfiles.insert(i.key(), i.value());
        else if (profileData.value("width").toInt() >= 1080) m_hdvProfiles.insert(i.key(), i.value());
        else m_otherProfiles.insert(i.key(), i.value());
        ++i;
    }

    m_standard.button_all->setChecked(true);
    connect(m_standard.button_all, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
    connect(m_standard.button_hdv, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
    connect(m_standard.button_dv, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
    slotCheckStandard();
    connect(m_standard.profiles_list, SIGNAL(itemSelectionChanged()), this, SLOT(slotCheckSelectedItem()));


    if (!KdenliveSettings::default_profile().isEmpty()) {
        for (int i = 0; i < m_standard.profiles_list->count(); i++) {
            if (m_standard.profiles_list->item(i)->data(Qt::UserRole).toString() == KdenliveSettings::default_profile()) {
                m_standard.profiles_list->setCurrentRow(i);
                m_standard.profiles_list->scrollToItem(m_standard.profiles_list->currentItem());
                break;
            }
        }
    }

    // select default profile
    fprintf(stderr, "LOOKING FOR: %s", ProfilesDialog::getProfileDescription(KdenliveSettings::default_profile()).toUtf8().data());
    QList<QListWidgetItem *> profiles = m_standard.profiles_list->findItems(ProfilesDialog::getProfileDescription(KdenliveSettings::default_profile()), Qt::MatchExactly);
    if (profiles.count() > 0) m_standard.profiles_list->setCurrentItem(profiles.at(0));

    fprintf(stderr, "LOOKING FOR: %s // %d", ProfilesDialog::getProfileDescription(KdenliveSettings::default_profile()).toUtf8().data(), profiles.count());
    addPage(page2);

    QWizardPage *page3 = new QWizardPage;
    page3->setTitle(i18n("Additional Settings"));
    m_extra.setupUi(page3);
    m_extra.projectfolder->setMode(KFile::Directory);
    m_extra.projectfolder->setPath(KdenliveSettings::defaultprojectfolder());
    m_extra.videothumbs->setChecked(KdenliveSettings::videothumbnails());
    m_extra.audiothumbs->setChecked(KdenliveSettings::audiothumbnails());
    m_extra.autosave->setChecked(KdenliveSettings::crashrecovery());
    connect(m_extra.videothumbs, SIGNAL(stateChanged(int)), this, SLOT(slotCheckThumbs()));
    connect(m_extra.audiothumbs, SIGNAL(stateChanged(int)), this, SLOT(slotCheckThumbs()));
    slotCheckThumbs();
    addPage(page3);


    QWizardPage *page5 = new QWizardPage;
    page5->setTitle(i18n("Checking system"));
    m_check.setupUi(page5);
    addPage(page5);

    listViewDelegate = new WizardDelegate(m_check.programList);
    m_check.programList->setItemDelegate(listViewDelegate);

    QTimer::singleShot(500, this, SLOT(slotCheckMlt()));
}
Exemple #8
0
PreferencesDialog::PreferencesDialog(QWidget *parent)
    : ConfigDialog(parent, "PreferencesDialog")
{
    iCount++;
    server = new ServerSettings(0);
    playback = new PlaybackSettings(0);
    files = new FileSettings(0);
    interface = new InterfaceSettings(0);
    context = new ContextSettings(0);
    cache = new CacheSettings(0);
    scrobbling = new ScrobblingSettings(0);
    server->load();
    playback->load();
    files->load();
    interface->load();
    context->load();
    scrobbling->load();
    addPage(QLatin1String("collection"), server, i18n("Collection"), Icons::self()->audioFileIcon, i18n("Collection Settings"));
    addPage(QLatin1String("playback"), playback, i18n("Playback"), Icon("media-playback-start"), i18n("Playback Settings"));
    addPage(QLatin1String("files"), files, i18n("Files"), Icons::self()->filesIcon, i18n("File Settings"));
    addPage(QLatin1String("interface"), interface, i18n("Interface"), Icon("preferences-other"), i18n("Interface Settings"));
    #ifdef ENABLE_STREAMS
    streams = new StreamsSettings(0);
    addPage(QLatin1String("streams"), streams, i18n("Streams"), Icons::self()->radioStreamIcon, i18n("Streams Settings"));
    streams->load();
    #endif
    #ifdef ENABLE_ONLINE_SERVICES
    online = new OnlineSettings(0);
    addPage(QLatin1String("online"), online, i18n("Online"), Icon("applications-internet"), i18n("Online Providers"));
    online->load();
    #endif
    addPage(QLatin1String("context"), context, i18n("Context"), Icons::self()->contextIcon, i18n("Context View Settings"));
    addPage(QLatin1String("scrobbling"), scrobbling, i18n("Scrobbling"), Icons::self()->lastFmIcon, i18n("Scrobbling Settings"));
    #ifdef ENABLE_HTTP_SERVER
    http = new HttpServerSettings(0);
    if (http->haveMultipleInterfaces()) {
        http->load();
        Icon icon("network-server");
        if (icon.isNull()) {
            icon=Icons::self()->streamIcon;
        }
        addPage(QLatin1String("http"), http, i18n("HTTP Server"), icon, i18n("HTTP Server Settings"));
    } else {
        http->deleteLater();
        http=0;
    }
    #endif
    #if defined CDDB_FOUND || defined MUSICBRAINZ5_FOUND
    audiocd = new AudioCdSettings(0);
    audiocd->load();
    addPage(QLatin1String("cd"), audiocd, i18n("Audio CD"), Icon("media-optical"), i18n("Audio CD Settings"));
    #endif
    #ifdef ENABLE_PROXY_CONFIG
    proxy = new ProxySettings(0);
    proxy->load();
    addPage(QLatin1String("proxy"), proxy, i18n("Proxy"), Icon("preferences-system-network"), i18nc("Qt-only", "Proxy Settings"));
    #endif
    #ifndef ENABLE_KDE_SUPPORT
    shortcuts = new ShortcutsSettingsPage(0);
    addPage(QLatin1String("shortcuts"), shortcuts, i18nc("Qt-only", "Shortcuts"), Icons::self()->shortcutsIcon, i18nc("Qt-only", "Keyboard Shortcut Settings"));
    shortcuts->load();
    #endif
    addPage(QLatin1String("cache"), cache, i18n("Cache"), Icons::self()->folderIcon, i18n("Cached Items"));
    #ifdef Q_OS_MAC
    setCaption(i18n("Cantata Preferences"));
    #else
    setCaption(i18n("Configure"));
    #endif
    setAttribute(Qt::WA_DeleteOnClose);
    setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
    setCurrentPage(QLatin1String("collection"));
}
void ofxSimpleGuiToo::setup() {
	config			= &defaultSimpleGuiConfig;
	
	doSave			= false;
	changePage		= false;
	titleButton		= NULL;
	keyboardShortcutsEnabled = true;
	doDrawPageBoundary = false;
	
	headerPage		= &addPage("Header");
	headerPage->height = config->buttonHeight * 2;
	headerPage->width = 0;
	titleButton = &headerPage->addButton("title", changePage);
	headerPage->addToggle("Auto Save", doAutoSave);
	headerPage->addButton("Save Settings", doSave);
	headerPage->addFPSCounter();
	
	cols = ceilf(ofGetWidth() / config->gridSize.x);
	rows = ceilf(ofGetHeight() / config->gridSize.y);
	
	addPage(); // default settings page
	addFPSCounter();
	
	setAutoSave(true);
	setAlignRight(false);
	setDraw(false);
	
	
	//addToggle("", <#bool value#>)
	
	//addControl(*titleButton);
	
	page(1).addPageShortcut(addPage("Keyboard Shortcuts"));
	page(1).addPageShortcut(addPage("GUI"));
	//setPage("GUI");
	addButton("save settings", doSave);
	addToggle("auto save", doAutoSave);
	//gui.addTitle("gui display");

	gui.addTitle("controls");
	string choices[] = {"simple","advanced","all"};
	gui.addComboBox("display priority", ofxSimpleGuiPage::mainPriority, 3, choices);
	gui.addButton("collapse all", 't', this, &ofxSimpleGuiToo::closeAllTitles);
	gui.addButton("open all", 'T', this, &ofxSimpleGuiToo::openAllTitles);
	
	gui.addTitle("display mode");
	string displayModeChoices[GUI_MODE_COUNT] = {"fixed","floating"};
	addComboBox("display mode", displayMode, GUI_MODE_COUNT, displayModeChoices);
	gui.addTitle("floating parameters");
	gui.addSlider("x", displayRect.x, 0, ofGetWidth());
	gui.addSlider("y", displayRect.y, 0, ofGetHeight());
	gui.addSlider("columns", cols, 1, 10);
	gui.addSlider("rows", rows, 5, 30);
	gui.addButton("reset", this, &ofxSimpleGuiToo::setDefaultDimensions);
	gui.addToggle("draw boundaries", doDrawPageBoundary);
	//gui.addSlider("gui width", displayRect.width, 256, ofGetWidth());
	//gui.addSlider("gui height", displayRect.height, 256, ofGetHeight());

	setPage(1);
	
	//addSlider("advanced gui", ofxSimpleGuiControl::mainPriority, 0, 2);
	ofAddListener(ofEvents.keyPressed, this, &ofxSimpleGuiToo::keyPressed);
}
Exemple #10
0
	void UIScrollPage::addOneEmptyPage(int pageIndex)
	{
		CCLayer* layer = CCLayer::create();
		layer->setAnchorPoint(ccp(0, 0));
		{
			int deltaX, deltaY;
			if(m_cellBinFile == "")
			{
				m_cellBinFile = KUI_BIN;
			}
			ASprite *as = AspriteManager::getInstance()->getAsprite(m_cellBinFile);
			int idx = getResourceIDByName(m_cellAsfile.c_str());
			int selectedId = getResourceIDByName(m_cellSelectedAsfile.c_str());
			CCSize buttonSize = as->getframeRect(idx).size;
//			float contentScale = CCDirector::sharedDirector()->getContentScaleFactor();
//			buttonSize = CCSizeMake(buttonSize.width * contentScale, buttonSize.height * contentScale);

			if (m_icolumn <= 1)
				deltaX = 0;
			else
				deltaX = (getContentSize().width - 2 * m_celloffsetX - buttonSize.width) / (m_icolumn - 1);

			if (m_irow <= 1)
				deltaY = 0;
			else
				deltaY = (getContentSize().height - 2 * m_celloffsetY - buttonSize.height) / (m_irow - 1);
			
			/////////////////////////////////////////////////////////////////////////////
			// row 
			// row
			for(int r = 0; r < (int)m_irow; r++)
			{
				for(int l = 0; l < (int) m_icolumn; l++)
				{
					// clone one ccsprite 
					CCPoint pt;
					CCSprite *pEmptyItem = as->getSpriteFromFrame_Middle( idx, 0, pt);
					CCSprite *pSelectedItem = as->getSpriteFromFrame_Middle(selectedId ,0,pt); 
					IconButton * pIcon = new IconButton(pEmptyItem, NULL, pSelectedItem, this, 
						menu_selector(UIScrollPage::OnItemClicked));
					pIcon->autorelease();
					int index = pageIndex * m_icolumn * m_irow;
					index += r * m_icolumn + l;
					pIcon->SetButtonIndex(index+1);
					pIcon->setContentSize(pEmptyItem->getContentSize());
					if(m_itemType != 0)
					{
						pIcon->creatDragReceiver((DragHandlerType)m_itemType);
					}
					pIcon->SetDoubleClickHandler(this,menu_selector(UIScrollPage::OnItemDoubleClicked));
					pIcon->SetTappedHandler(this,menu_selector(UIScrollPage::OnTapped),menu_selector(UIScrollPage::OnTapCancel));
					pIcon->SetDragFlagTime(150);
					m_lstButton.push_back(pIcon);

					int x = l * deltaX + m_celloffsetX + buttonSize.width / 2 - getContentSize().width / 2 ;
					int y = getContentSize().height / 2 - (r * deltaY + m_celloffsetY + buttonSize.height / 2);

//					x /= contentScale;
//					y /= contentScale;

					pIcon->setPosition(ccp(x, y));

					char name[50];
					sprintf(name,"%s_%d",this->m_strName.c_str(),index+1);
					pIcon->SetButtonName(name);

					layer->addChild(pIcon);
				}
			}
		}

		addPage(layer);		
	}
Exemple #11
0
        {
            connect(control,SIGNAL(addPage()),this,SLOT(addPageAfterFirst()));
            connect(control,SIGNAL(removePage()),this,SLOT(removeFirstPage()));
            connect(control,SIGNAL(addPageFromTemplate(LayoutTemplate*)),this,SLOT(addPageAfterFirst(LayoutTemplate*)));
        }
        break;
    case DoublePageSecond:
        if(bSwapDirection)
        {
            connect(control,SIGNAL(addPage()),this,SLOT(addPageAfterFirst()));
            connect(control,SIGNAL(removePage()),this,SLOT(removeFirstPage()));
            connect(control,SIGNAL(addPageFromTemplate(LayoutTemplate*)),this,SLOT(addPageAfterFirst(LayoutTemplate*)));
        }
        else
        {
            connect(control,SIGNAL(addPage()),this,SLOT(addPageAfterSecond()));
            connect(control,SIGNAL(removePage()),this,SLOT(removeSecondPage()));
            connect(control,SIGNAL(addPageFromTemplate(LayoutTemplate*)),this,SLOT(addPageAfterSecond(LayoutTemplate*)));
        }
        break;
    }

    if( book->templateMode() == Book::ConformityMode)
    {
        control->setCanAddPage(book->bookTemplate()->canAddPageAfter(pageIndex,book->pages()->count()));
        control->setCanRemovePage(book->bookTemplate()->canRemovePageAt(pageIndex,book->pages()->count()));
    }
    else
    {
        control->setCanAddPage(true);
        control->setCanRemovePage(true);
Exemple #12
0
Wizard::Wizard(QWidget* const parent, GalleryInfo* const info)
    : KPWizardDialog(parent)
{
    d        = new Private;
    d->mInfo = info;

    setCaption(i18n("Export image collections to HTML pages"));

    // ---------------------------------------------------------------
    // About data and help button.

    KPAboutData* about = new KPAboutData(
                                ki18n("HTML Export"),
                                QByteArray(),
                                KAboutLicense::GPL,
                                ki18n("A KIPI plugin to export image collections to HTML pages"),
                                ki18n("(c) 2006-2009, Aurelien Gateau\n"
                                      "(c) 2010, Gianluca Urgese"));

    about->addAuthor(
        ki18n("Gianluca Urgese"),
        ki18n("Maintainer"),
        "*****@*****.**");

    about->addAuthor(
        ki18n("Aurelien Gateau"),
        ki18n("Former Author and Maintainer"),
        "*****@*****.**");

    about->setHandbookEntry("htmlexport");
    setAboutData(about);

    // ---------------------------------------------------------------

    d->mCollectionSelector     = iface()->imageCollectionSelector(this);
    d->mCollectionSelectorPage = addPage(d->mCollectionSelector, i18n("Collection Selection"));
    updateCollectionSelectorPageValidity();

    connect(d->mCollectionSelector, SIGNAL(selectionChanged()),
            this, SLOT(updateCollectionSelectorPageValidity()));

    d->mThemePage = new ThemePage(this, i18n("Theme"));
    d->initThemePage();

    connect(d->mThemePage->mThemeList, SIGNAL(itemSelectionChanged()),
            this, SLOT(slotThemeSelectionChanged()) );

    d->mThemeParametersPage = new ThemeParametersPage(this, i18n("Theme Parameters"));
    d->mImageSettingsPage   = new ImageSettingsPage(this, i18n("Image Settings"));
    d->mOutputPage          = new OutputPage(this, i18n("Output"));
    d->mOutputPage->kcfg_destUrl->setMode(KFile::Directory);

    connect(d->mOutputPage->kcfg_destUrl, SIGNAL(textChanged(QString)),
            this, SLOT(updateFinishPageValidity()) );

    d->mConfigManager = new KConfigDialogManager(this, d->mInfo);
    d->mConfigManager->updateWidgets();

    // Set page states
    // Pages can only be disabled after they have *all* been added!
    slotThemeSelectionChanged();
    updateFinishPageValidity();
}
Exemple #13
0
DancingBarsSettings::DancingBarsSettings( QWidget* parent, const char* name )
  : KPageDialog( parent ), mModel( new SensorModel( this ) )
{
  setFaceType( Tabbed );
  setWindowTitle( i18n( "Edit BarGraph Preferences" ) );
  setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
  setObjectName( name );
  setModal( false );

  mModel->setHasLabel( true );

  // Range page
  QFrame *page = new QFrame( this );
  addPage( page, i18n( "Range" ) );
  QGridLayout *pageLayout = new QGridLayout( page );
  pageLayout->setMargin( 0 );

  QGroupBox *groupBox = new QGroupBox( i18n( "Title" ), page );
  QGridLayout *boxLayout = new QGridLayout;
  groupBox->setLayout( boxLayout );

  mTitle = new QLineEdit( groupBox );
  mTitle->setWhatsThis( i18n( "Enter the title of the display here." ) );
  boxLayout->addWidget( mTitle, 0, 0 );

  pageLayout->addWidget( groupBox, 0, 0 );

  groupBox = new QGroupBox( i18n( "Display Range" ), page );
  boxLayout = new QGridLayout;
  groupBox->setLayout( boxLayout );
  boxLayout->setColumnStretch( 2, 1 );

  QLabel *label = new QLabel( i18n( "Minimum value:" ), groupBox );
  boxLayout->addWidget( label, 0, 0 );

  mMinValue = new QDoubleSpinBox(groupBox);
  mMinValue->setRange(0, 10000);
  mMinValue->setSingleStep(0.5);
  mMinValue->setValue(0);
  mMinValue->setDecimals(2);
  mMinValue->setWhatsThis( i18n( "Enter the minimum value for the display here. If both values are 0, automatic range detection is enabled." ) );
  boxLayout->addWidget( mMinValue, 0, 1 );
  label->setBuddy( mMinValue );

  label = new QLabel( i18n( "Maximum value:" ), groupBox );
  boxLayout->addWidget( label, 0, 3 );

  mMaxValue = new QDoubleSpinBox( groupBox);
  mMaxValue->setRange(0, 100);
  mMaxValue->setSingleStep(0.5);
  mMaxValue->setValue(100);
  mMaxValue->setDecimals(2);
  mMaxValue->setWhatsThis( i18n( "Enter the maximum value for the display here. If both values are 0, automatic range detection is enabled." ) );
  boxLayout->addWidget( mMaxValue, 0, 4 );
  label->setBuddy( mMaxValue );

  pageLayout->addWidget( groupBox, 1, 0 );

  pageLayout->setRowStretch( 2, 1 );

  // Alarm page
  page = new QFrame( this );
  addPage( page, i18n( "Alarms" ) );
  pageLayout = new QGridLayout( page );
  pageLayout->setMargin( 0 );

  groupBox = new QGroupBox( i18n( "Alarm for Minimum Value" ), page );
  boxLayout = new QGridLayout;
  groupBox->setLayout( boxLayout );
  boxLayout->setColumnStretch( 1, 1 );

  mUseLowerLimit = new QCheckBox( i18n( "Enable alarm" ), groupBox );
  mUseLowerLimit->setWhatsThis( i18n( "Enable the minimum value alarm." ) );
  boxLayout->addWidget( mUseLowerLimit, 0, 0 );

  label = new QLabel( i18n( "Lower limit:" ), groupBox );
  boxLayout->addWidget( label, 0, 2 );

  mLowerLimit = new QDoubleSpinBox(groupBox);
  mLowerLimit->setRange(0, 100);
  mLowerLimit->setSingleStep(0.5);
  mLowerLimit->setValue(0);
  mLowerLimit->setDecimals(2);
  mLowerLimit->setEnabled( false );
  boxLayout->addWidget( mLowerLimit, 0, 3 );
  label->setBuddy( mLowerLimit );

  pageLayout->addWidget( groupBox, 0, 0 );

  groupBox = new QGroupBox( i18n( "Alarm for Maximum Value" ), page );
  boxLayout = new QGridLayout;
  groupBox->setLayout( boxLayout );
  boxLayout->setColumnStretch( 1, 1 );

  mUseUpperLimit = new QCheckBox( i18n( "Enable alarm" ), groupBox );
  mUseUpperLimit->setWhatsThis( i18n( "Enable the maximum value alarm." ) );
  boxLayout->addWidget( mUseUpperLimit, 0, 0 );

  label = new QLabel( i18n( "Upper limit:" ), groupBox );
  boxLayout->addWidget( label, 0, 2 );

  mUpperLimit = new QDoubleSpinBox( groupBox);
  mUpperLimit->setRange(0, 1000);
  mUpperLimit->setSingleStep(0.5);
  mUpperLimit->setDecimals(2);
  mUpperLimit->setEnabled( false );
  boxLayout->addWidget( mUpperLimit, 0, 3 );
  label->setBuddy( mUpperLimit );

  pageLayout->addWidget( groupBox, 1, 0 );

  pageLayout->setRowStretch( 2, 1 );

  // Look page
  page = new QFrame( this );
  addPage( page, i18nc( "@title:tab Appearance of the bar graph", "Look" ) );
  pageLayout = new QGridLayout( page );
  pageLayout->setMargin( 0 );

  label = new QLabel( i18n( "Normal bar color:" ), page );
  pageLayout->addWidget( label, 0, 0 );

  mForegroundColor = new KColorButton( page );
  pageLayout->addWidget( mForegroundColor, 0, 1 );
  label->setBuddy( mForegroundColor );

  label = new QLabel( i18n( "Out-of-range color:" ), page );
  pageLayout->addWidget( label, 1, 0 );

  mAlarmColor = new KColorButton( page );
  pageLayout->addWidget( mAlarmColor, 1, 1 );
  label->setBuddy( mAlarmColor );

  label = new QLabel( i18n( "Background color:" ), page );
  pageLayout->addWidget( label, 2, 0 );

  mBackgroundColor = new KColorButton( page );
  pageLayout->addWidget( mBackgroundColor, 2, 1 );
  label->setBuddy( mBackgroundColor );

  label = new QLabel( i18n( "Font size:" ), page );
  pageLayout->addWidget( label, 3, 0 );

  mFontSize = new QSpinBox( page );
  mFontSize->setValue( 9 );
  mFontSize->setWhatsThis( i18n( "This determines the size of the font used to print a label underneath the bars. Bars are automatically suppressed if text becomes too large, so it is advisable to use a small font size here." ) );
  pageLayout->addWidget( mFontSize, 3, 1 );
  label->setBuddy( mFontSize );

  pageLayout->setRowStretch( 4, 1 );

  // Sensor page
  page = new QFrame( this );
  addPage( page, i18n( "Sensors" ) );
  pageLayout = new QGridLayout( page );
  pageLayout->setMargin( 0 );
  pageLayout->setRowStretch( 2, 1 );

  mView = new QTreeView( page );
  mView->header()->setStretchLastSection( true );
  mView->setRootIsDecorated( false );
  mView->setItemsExpandable( false );
  mView->setModel( mModel );
  pageLayout->addWidget( mView, 0, 0, 3, 1);

  mEditButton = new QPushButton( i18n( "Edit..." ), page );
  mEditButton->setWhatsThis( i18n( "Push this button to configure the label." ) );
  pageLayout->addWidget( mEditButton, 0, 1 );

  mRemoveButton = new QPushButton( i18n( "Delete" ), page );
  mRemoveButton->setWhatsThis( i18n( "Push this button to delete the sensor." ) );
  pageLayout->addWidget( mRemoveButton, 1, 1 );

  connect(mUseLowerLimit, &QCheckBox::toggled, mLowerLimit, &QDoubleSpinBox::setEnabled);
  connect(mUseUpperLimit, &QCheckBox::toggled, mUpperLimit, &QDoubleSpinBox::setEnabled);
  connect(mEditButton, &QPushButton::clicked, this, &DancingBarsSettings::editSensor);
  connect(mRemoveButton, &QPushButton::clicked, this, &DancingBarsSettings::removeSensor);

  KAcceleratorManager::manage( this );

  mTitle->setFocus();
}
KoPADocumentStructureDocker::KoPADocumentStructureDocker(KoDocumentSectionView::DisplayMode mode, KoPageApp::PageType pageType, QWidget* parent)
: QDockWidget(parent)
, KoCanvasObserverBase()
, m_doc(0)
, m_model(0)
{
    setWindowTitle(i18n("Document"));

    QWidget *mainWidget = new QWidget(this);
    QGridLayout* layout = new QGridLayout(mainWidget);
    layout->addWidget(m_sectionView = new KoDocumentSectionView(mainWidget), 0, 0, 1, -1);

    QToolButton *button = new QToolButton(mainWidget);
    button->setIcon(koIcon("list-add"));
    if (pageType == KoPageApp::Slide) {
        button->setToolTip(i18n("Add a new slide or layer"));
    }
    else {
        button->setToolTip(i18n("Add a new page or layer"));
    }
    layout->addWidget(button, 1, 0);

    QMenu *menu = new QMenu(button);
    button->setMenu(menu);
    button->setPopupMode(QToolButton::InstantPopup);
    menu->addAction(koIcon("document-new"),
                    (pageType == KoPageApp::Slide) ? i18n("Slide") : i18n("Page"),
                    this, SLOT(addPage()));
    m_addLayerAction = menu->addAction(koIcon("layer-new"), i18n("Layer"), this, SLOT(addLayer()));

    m_buttonGroup = new QButtonGroup(mainWidget);
    m_buttonGroup->setExclusive(false);

    button = new QToolButton(mainWidget);
    button->setIcon(koIcon("list-remove"));
    button->setToolTip(i18n("Delete selected objects"));
    m_buttonGroup->addButton(button, Button_Delete);
    layout->addWidget(button, 1, 1);

    button = new QToolButton(mainWidget);
    button->setIcon(koIcon("arrow-up"));
    button->setToolTip(i18n("Raise selected objects"));
    m_buttonGroup->addButton(button, Button_Raise);
    layout->addWidget(button, 1, 3);

    button = new QToolButton(mainWidget);
    button->setIcon(koIcon("arrow-down"));
    button->setToolTip(i18n("Lower selected objects"));
    m_buttonGroup->addButton(button, Button_Lower);
    layout->addWidget(button, 1, 4);

    button = new QToolButton(mainWidget);
    menu = new QMenu(this);
    QActionGroup *group = new QActionGroup(this);

    m_viewModeActions.insert(KoDocumentSectionView::MinimalMode,
                              menu->addAction(koIcon("view-list-text"), i18n("Minimal View"), this, SLOT(minimalView())));
    m_viewModeActions.insert(KoDocumentSectionView::DetailedMode,
                              menu->addAction(koIcon("view-list-details"), i18n("Detailed View"), this, SLOT(detailedView())));
    m_viewModeActions.insert(KoDocumentSectionView::ThumbnailMode,
                              menu->addAction(koIcon("view-preview"), i18n("Thumbnail View"), this, SLOT(thumbnailView())));

    foreach (QAction* action, m_viewModeActions) {
        action->setCheckable(true);
        action->setActionGroup(group);
    }
Exemple #15
0
StatisticsDialog::StatisticsDialog(KileProject *project, KileDocument::TextInfo* docinfo, QWidget* parent,
                                   KTextEditor::View *view, const char* name, const QString &caption)
		: KPageDialog(parent), m_project(project), m_docinfo(docinfo), m_view(view)
{
	setObjectName(name);
	setFaceType(Tabbed);
	setCaption(caption);
	setModal(true);
	setButtons(Help | Close | User1 | User2);
	setDefaultButton(Close);
	showButtonSeparator(false);

	setButtonText(User1, i18n("Copy"));
	setButtonText(User2, i18n("Copy as LaTeX"));
	setHelp("statistics");

	m_summarystats = new long[SIZE_STAT_ARRAY];
	m_summarystats[0] = m_summarystats[1] = m_summarystats[2] = m_summarystats[3] = m_summarystats[4] = m_summarystats[5] = 0;

	const long* stats;
	QString tempName;
	KileWidget::StatisticsWidget* tempWidget;
	KileWidget::StatisticsWidget* summary;
	KileDocument::TextInfo* tempDocinfo;

	m_hasSelection = false; // class variable, if the user has selected text,
	summary = new KileWidget::StatisticsWidget(mainWidget());
	KPageWidgetItem *itemSummary = new KPageWidgetItem(summary, i18n("Summary"));
	addPage(itemSummary);
	summary->m_commentAboutHelp->setText(i18n("For information about the accuracy see the Help."));
	// we have in every case a summary tab

	m_pagetowidget[itemSummary] = summary;
	m_pagetoname[itemSummary] = i18n("Summary");

	if (m_docinfo->getDoc()->activeView()->selection()) { // the user should really have that doc as active in which the selection is
		m_hasSelection = true;
	}

	if (!m_project) { // the active doc doesn't belong to a project
		setCaption(i18n("Statistics for %1", m_docinfo->getDoc()->url().fileName()));
		stats = m_docinfo->getStatistics(m_view);
		fillWidget(stats, summary);
	}
	else { // active doc belongs to a project
		setCaption(i18n("Statistics for the Project %1", m_project->name()));
		KILE_DEBUG() << "Project file is " << project->baseURL() << endl;

		QList<KileProjectItem*> items = project->items();

		if (m_hasSelection) { // if the active doc has a selection
			stats = m_docinfo->getStatistics(m_view);
			fillWidget(stats, summary); // if yes we fill the summary widget and are finished
		}
		else {
			for(QList<KileProjectItem*>::iterator i = items.begin(); i != items.end(); ++i) {
				KileProjectItem *item = *i;

				if (item->type() ==  KileProjectItem::ProjectFile) { // ignore project files
					continue;
				}

				tempDocinfo = item->getInfo();
				if(tempDocinfo && tempDocinfo->getDoc()) { // closed items don't have a doc
					tempName = tempDocinfo->getDoc()->url().fileName();
					stats = tempDocinfo->getStatistics(m_view);

					for (uint j = 0; j < SIZE_STAT_ARRAY; j++) {
						m_summarystats[j] += stats[j];
					}

					tempWidget = new KileWidget::StatisticsWidget();
					KPageWidgetItem *itemTemp = new KPageWidgetItem(tempWidget, tempName);
					addPage(itemTemp);
					KILE_DEBUG() << "TempName is " << tempName << endl;
					m_pagetowidget[itemTemp] = tempWidget;
					m_pagetoname[itemTemp] = tempName;
					fillWidget(stats, tempWidget);
				}
				else {
					m_notAllFilesOpenWarning = true; // print warning
				}
			}

			fillWidget(m_summarystats, summary);
			if (m_notAllFilesOpenWarning) {
				summary->m_warning->setText(i18n("To get statistics for all project files, you have to open them all."));
			}

			KILE_DEBUG() << "All keys in name " << m_pagetoname.keys() << " Nr. of keys " << m_pagetowidget.count() << endl;
			KILE_DEBUG() << "All keys in widget " << m_pagetowidget.keys() << " Nr. of keys " << m_pagetowidget.count() << endl;
		}
	}
//  setInitialSize( QSize(550,560), true);
}
SettingsDialog::SettingsDialog(QWidget* parent)
    : QDialog(parent),
      ui_(new Ui_SettingsDialog),
      settingsViewMenu_(new QMenu(this)),
      settingsViewGroup_(new QActionGroup(this)),
      treeView_(new QAction(this)),
      iconView_(new QAction(this)),
      generalSettingsModel_(new QStandardItemModel(this)),
      tableSettingsModel_(new QStandardItemModel(this)),
      plot2dSettingsModel_(new QStandardItemModel(this)),
      plot3dSettingsModel_(new QStandardItemModel(this)),
      fittingSettingsModel_(new QStandardItemModel(this)),
      scriptingSettingsModel_(new QStandardItemModel(this)) {
  ui_->setupUi(this);
  setWindowTitle(tr("Settings"));
  setWindowIcon(IconLoader::load("edit-preference", IconLoader::LightDark));
  setModal(true);
  setMinimumSize(sizeHint());

  // Colors (TODO: use some central qpalette handling)
  baseColor_ = palette().color(QPalette::Base);
  fontColor_ = palette().color(QPalette::Text);

  // adjust layout spacing & margins.
  ui_->settingGridLayout->setSpacing(3);
  ui_->settingGridLayout->setContentsMargins(0, 0, 0, 0);
  ui_->headerHorizontalLayout->setSpacing(0);
  ui_->scrollVerticalLayout->setSpacing(0);
  ui_->scrollVerticalLayout->setContentsMargins(3, 3, 3, 3);
  ui_->scrollVerticalLayout->setContentsMargins(0, 0, 0, 0);
  ui_->stackGridLayout->setSpacing(0);
  ui_->stackGridLayout->setContentsMargins(0, 0, 0, 0);

  // Setup search box.
  ui_->searchBox->setMaximumWidth(300);
  ui_->searchBox->setToolTip(tr("search"));

  // Prepare buttons
  ui_->configureButton->setIcon(
      IconLoader::load("edit-preference", IconLoader::LightDark));
  ui_->settingsButton->setIcon(
      IconLoader::load("go-previous", IconLoader::LightDark));
  ui_->settingsButton->setEnabled(false);

  // Add settings configure menu items(tree/icon view)
  settingsViewGroup_->addAction(treeView_);
  settingsViewGroup_->addAction(iconView_);
  treeView_->setText(tr("Tree view"));
  iconView_->setText(tr("Icon view"));
  treeView_->setCheckable(true);
  iconView_->setCheckable(true);
  settingsViewMenu_->addAction(treeView_);
  settingsViewMenu_->addAction(iconView_);
  ui_->configureButton->setMenu(settingsViewMenu_);

  // Prepare scrollarea.
  QString scrollbackcol =
      "QScrollArea {background-color : "
      "rgba(%1,%2,%3,%4); border: 0;}";
  ui_->scrollArea->setStyleSheet(scrollbackcol.arg(baseColor_.red())
                                     .arg(baseColor_.green())
                                     .arg(baseColor_.blue())
                                     .arg(baseColor_.alpha()));

  // Prepare label.
  QString label_font_color =
      "QLabel {color : rgba(%1,%2,%3,%4);"
      " padding-left: 10px;"
      " padding-right: 10px;"
      " padding-top: 10px;"
      " padding-bottom: 10px}";
  ui_->generalLabel->setStyleSheet(label_font_color.arg(fontColor_.red())
                                       .arg(fontColor_.green())
                                       .arg(fontColor_.blue())
                                       .arg(150));
  ui_->plot2dLabel->setStyleSheet(label_font_color.arg(fontColor_.red())
                                      .arg(fontColor_.green())
                                      .arg(fontColor_.blue())
                                      .arg(150));
  ui_->generalLabel->hide();
  ui_->tableLabel->hide();
  ui_->plot2dLabel->hide();
  ui_->plot3dLabel->hide();
  ui_->fittingLabel->hide();
  ui_->scriptingLabel->hide();

  // Add pages to stack widget
  addPage(General, Page_GeneralApplication, new ApplicationSettingsPage(this));
  addPage(General, Page_GeneralConfirmation, new ApplicationSettingsPage(this));
  addPage(General, Page_GeneralAppearance, new GeneralAppreanceSettings(this));

  // Make standard item models for listviews & add items
  QStandardItemModel* iStandardModel = new QStandardItemModel(this);
  QStandardItem* item1 =
      new QStandardItem(QIcon(":/data/document-open-remote.png"), "Open");
  QStandardItem* item2 =
      new QStandardItem(QIcon(":/data/document-save.png"), "Save");
  QStandardItem* item3 =
      new QStandardItem(QIcon(":/data/drive-removable-media-usb-pendrive.png"),
                        "Removable Drive");
  QStandardItem* item4 =
      new QStandardItem(QIcon(":/data/download.png"), "Download");
  QStandardItem* item5 =
      new QStandardItem(QIcon(":/data/ipodtouchicon.png"), "Ipod Touch Device");
  QStandardItem* item6 = new QStandardItem(
      QIcon(":/data/multimedia-player-ipod-mini-pink.png"), "Ipod Mini");
  QStandardItem* item7 = new QStandardItem(QIcon(":/data/qtlogo.png"), "Qt");
  iStandardModel->appendRow(item1);
  iStandardModel->appendRow(item2);
  iStandardModel->appendRow(item3);
  iStandardModel->appendRow(item4);
  iStandardModel->appendRow(item5);
  iStandardModel->appendRow(item6);
  iStandardModel->appendRow(item7);

  // Set model to the view
  ui_->generalListView->setModel(generalSettingsModel_);
  ui_->tableListView->setModel(tableSettingsModel_);
  ui_->plot2dListView->setModel(iStandardModel);
  ui_->plot3dListView->setModel(plot3dSettingsModel_);
  ui_->fittingListView->setModel(fittingSettingsModel_);
  ui_->scriptingListView->setModel(scriptingSettingsModel_);

  // Signals & slot connections
  connect(ui_->settingsButton, SIGNAL(clicked()), this,
          SLOT(getBackToRootSettingsPage()));
  connect(ui_->generalListView, SIGNAL(clicked(const QModelIndex&)), this,
          SLOT(generalEnsureSelection(const QModelIndex&)));
  connect(ui_->plot2dListView, SIGNAL(clicked(const QModelIndex&)), this,
          SLOT(plot2dEnsureSelection(const QModelIndex&)));
  connect(ui_->generalListView, SIGNAL(doubleClicked(QModelIndex)), this,
          SLOT(test(QModelIndex)));
}
Exemple #17
0
RegistrationWizard::RegistrationWizard(const QString &startMask,KviRegisteredUserDataBase * db,QWidget * par,bool bModal)
: KviTalWizard(par)
{
	m_pDb = db;

	setModal(bModal);

	m_bModal = bModal;

	KviIrcMask mask(!startMask.isEmpty() ? startMask.toUtf8().data() : "*!*@*");

	g_pRegistrationWizardList->append(this);

	QGridLayout* m_pPage1Layout;
	QGridLayout* m_pPage2Layout;
	QGridLayout* m_pPage3Layout;
	QGridLayout* m_pPage4Layout;
	QGridLayout* m_pPage5Layout;

	QLabel* TextLabel10_2;
	QLabel* TextLabel10;
	QLabel* TextLabel10_3;
	QLabel* TextLabel10_3_2;

	QFrame * f;

//    resize( 490, 456 );
	setWindowTitle(__tr2qs_ctx("User Registration Wizard - KVIrc","register"));
	setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Linux)));

	setSizeGripEnabled(true);

	m_pPage1 = new QWidget(this);
	m_pPage1Layout = new QGridLayout(m_pPage1);
	m_pPage1Layout->setSpacing(4);
	m_pPage1Layout->setMargin(8);

	m_pLabel1 = new QLabel(m_pPage1);
	m_pLabel1->setText(__tr2qs_ctx("<p>Welcome to the user registration wizard.<br>This process allows you to add an IRC user to the database and set properties for that user. KVIrc will be (hopefully) able to recognize the user, add him to the notify list, and display the associated avatar.<br><br>First of all, you must insert an <b>entry name or real name</b> for the user you're going to register. The name will be used to identify the database entry and has no specific requirements, it can be a given name, nickname, or just some text to remind you of the real person.<br>Examples: \"George W Bush\", \"Dubya\".\n</p>","register"));
	m_pLabel1->setWordWrap(true);

	m_pPage1Layout->addWidget(m_pLabel1,0,0,1,2);

	m_pEditRealName = new QLineEdit(m_pPage1);
	//m_pEditRealName->setAlignment(int(QLineEdit::AlignHCenter));

	m_pPage1Layout->addWidget(m_pEditRealName,3,1);

	m_pEntryNameLabel = new QLabel(m_pPage1);
	m_pEntryNameLabel->setText(__tr2qs_ctx("Entry name:","register"));
	m_pPage1Layout->addWidget(m_pEntryNameLabel,3,0);
	m_pPage1Layout->setRowStretch(1,1);

	addPage( m_pPage1,__tr2qs_ctx("Step 1: Entry Name","register"));

	if(mask.nick() != "*")m_pEditRealName->setText(mask.nick());

	connect(m_pEditRealName,SIGNAL(textChanged(const QString &)),this,SLOT(realNameChanged(const QString &)));

	// PAGE 2

	m_pPage2 = new QWidget(this);
	m_pPage2Layout = new QGridLayout(m_pPage2);
	m_pPage2Layout->setSpacing(4);
	m_pPage2Layout->setMargin(8);

	m_pLabel2 = new QLabel( m_pPage2);
	m_pLabel2->setText(__tr2qs_ctx("<p>A registered user is identified by one or more <b>IRC masks</b>.<br>A mask must be in the following form:<br><b>nickname!username@hostname</b><br>and can contain wildcard characters '*' and '?'. Be careful in choosing the masks, as they are the only way to verify the identity of a registered user.<br><br>You can enter at most two masks here, if you wish to add more masks, use the \"<b>Edit</b>\" button in the Registered Users dialog. You must enter at least one mask.</p>","register"));
	m_pLabel2->setWordWrap(true);

	m_pPage2Layout->addWidget(m_pLabel2,0,0,1,5);

	//KviCString szMask;

	//mask.mask(szMask,11);

	//KviIrcMask masktempl(szMask.ptr());

	m_pNicknameEdit1 = new QLineEdit(m_pPage2);
	m_pNicknameEdit1->setAlignment(Qt::AlignRight);
	if(mask.nick() != "*")m_pNicknameEdit1->setText(mask.nick());
	connect(m_pNicknameEdit1,SIGNAL(textChanged(const QString &)),this,SLOT(maskChanged(const QString &)));
	m_pPage2Layout->addWidget( m_pNicknameEdit1,3,0);

	m_pUsernameEdit1 = new QLineEdit(m_pPage2);
	m_pUsernameEdit1->setAlignment(Qt::AlignHCenter);
	if(mask.hasUser())m_pUsernameEdit1->setText(mask.user());
	connect(m_pUsernameEdit1,SIGNAL(textChanged(const QString &)),this,SLOT(maskChanged(const QString &)));
	m_pPage2Layout->addWidget(m_pUsernameEdit1,3,2);

	m_pHostEdit1 = new QLineEdit(m_pPage2);
	if(mask.hasHost())m_pHostEdit1->setText(mask.host());
	connect(m_pHostEdit1,SIGNAL(textChanged(const QString &)),this,SLOT(maskChanged(const QString &)));
	m_pPage2Layout->addWidget(m_pHostEdit1,3,4);

	m_pNicknameEdit2 = new QLineEdit(m_pPage2);
	m_pNicknameEdit2->setAlignment(Qt::AlignRight);
	m_pPage2Layout->addWidget(m_pNicknameEdit2,4,0);

	m_pUsernameEdit2 = new QLineEdit(m_pPage2);
	m_pUsernameEdit2->setAlignment(Qt::AlignHCenter);
	m_pPage2Layout->addWidget(m_pUsernameEdit2,4,2);

	m_pHostEdit2 = new QLineEdit(m_pPage2);
	m_pPage2Layout->addWidget(m_pHostEdit2,4,4);

	TextLabel10_2 = new QLabel(m_pPage2);
	TextLabel10_2->setText("<b>!</b>");
	TextLabel10_2->setAlignment(Qt::AlignCenter);
	m_pPage2Layout->addWidget(TextLabel10_2,4,1);

	TextLabel10 = new QLabel(m_pPage2);
	TextLabel10->setText("<b>!</b>");
	TextLabel10->setAlignment(Qt::AlignCenter);
	m_pPage2Layout->addWidget(TextLabel10,3,1);

	TextLabel10_3 = new QLabel(m_pPage2);
	TextLabel10_3->setText("<b>@</b>");
	TextLabel10_3->setAlignment(Qt::AlignCenter);
	m_pPage2Layout->addWidget(TextLabel10_3,3,3);

	TextLabel10_3_2 = new QLabel(m_pPage2);
	TextLabel10_3_2->setText("<b>@</b>");
	TextLabel10_3_2->setAlignment(Qt::AlignCenter);
	m_pPage2Layout->addWidget(TextLabel10_3_2,4,3);
	m_pPage2Layout->setRowStretch(1,1);

	addPage(m_pPage2,__tr2qs_ctx("Step 2: Mask Selection","register"));

	// PAGE 3

	m_pPage3 = new QWidget(this);
	m_pPage3Layout = new QGridLayout(m_pPage3);
	m_pPage3Layout->setSpacing(4);
	m_pPage3Layout->setMargin(8);

	m_pLabel3 = new QLabel(m_pPage3);
	m_pLabel3->setText(__tr2qs_ctx("<p>If you want to store an avatar image for this user, you can set it here. KVIrc will show the avatar in the userlist next to the user's nickname.<br>An avatar can be in any supported image format (PNG is recommended). Keep in mind that KVIrc stores avatars in memory and has to resize them to fit in the userlist, thus it's better to use small, low-resolution images.</p>","register"));
	m_pLabel3->setWordWrap(true);
	m_pPage3Layout->addWidget(m_pLabel3,0,0);

	f = new QFrame(m_pPage3);
	f->setFrameStyle(QFrame::HLine | QFrame::Sunken);
	m_pPage3Layout->addWidget(f,1,0);

	m_pAvatar = new KviPixmap();
	m_pAvatarSelector = new KviPixmapSelector(m_pPage3,__tr2qs_ctx("Store an avatar for this user:"******"register"),m_pAvatar,true);
	m_pPage3Layout->addWidget(m_pAvatarSelector,2,0);
	m_pPage3Layout->setRowStretch(2,1);

	addPage(m_pPage3,__tr2qs_ctx("Step 3: Avatar Selection","register"));

	// PAGE 4

	m_pPage4 = new QWidget(this);
	m_pPage4Layout = new QGridLayout(m_pPage4);
	m_pPage4Layout->setSpacing(4);
	m_pPage4Layout->setMargin(8);

	m_pLabel4 = new QLabel(m_pPage4);
	m_pLabel4->setText(__tr2qs_ctx("<p>If you want to be notified when this user is online or goes offline, you must specify the list of nicknames that KVIrc will look for.<br><br>You can enter at most two nicknames here, if you wish to add more nicknames, use the \"<b>Edit</b>\" button in the  \"Registered Users\" dialog.</p>","register"));
	m_pLabel4->setWordWrap(true);
	m_pPage4Layout->addWidget(m_pLabel4,0,0,1,5);

	m_pNotifyCheck = new QCheckBox(m_pPage4);
	m_pNotifyCheck->setText(__tr2qs_ctx("Add this user to the notify list","register"));
	m_pNotifyCheck->setChecked(false);
	connect(m_pNotifyCheck,SIGNAL(toggled(bool)),this,SLOT(notifyCheckToggled(bool)));
	m_pPage4Layout->addWidget(m_pNotifyCheck,3,0,1,2);

	m_pNotifyNickLabel1 = new QLabel(m_pPage4);
	m_pNotifyNickLabel1->setText(__tr2qs_ctx("Nickname:","register"));
	m_pPage4Layout->addWidget(m_pNotifyNickLabel1,4,0);

	m_pNotifyNickLabel2 = new QLabel(m_pPage4);
	m_pNotifyNickLabel2->setText(__tr2qs_ctx("Nickname 2:","register"));
	m_pPage4Layout->addWidget(m_pNotifyNickLabel2,5,0);

	m_pNotifyNickEdit1 = new QLineEdit(m_pPage4);
	if(mask.nick() != "*")m_pNotifyNickEdit1->setText(mask.nick());
	connect(m_pNotifyNickEdit1,SIGNAL(textChanged(const QString &)),this,SLOT(notifyNickChanged(const QString &)));
	m_pPage4Layout->addWidget(m_pNotifyNickEdit1,4,1);

	m_pNotifyNickEdit2 = new QLineEdit(m_pPage4);
	connect(m_pNotifyNickEdit2,SIGNAL(textChanged(const QString &)),this,SLOT(notifyNickChanged(const QString &)));
	m_pPage4Layout->addWidget(m_pNotifyNickEdit2,5,1);
	m_pPage4Layout->setRowStretch(1,1);

	addPage(m_pPage4,__tr2qs_ctx("Step 4: Notify List","register"));

	// PAGE 5

	m_pPage5 = new QWidget(this);
	m_pPage5Layout = new QGridLayout(m_pPage5);
	m_pPage5Layout->setSpacing(4);
	m_pPage5Layout->setMargin(8);

	m_pTextLabel5 = new QLabel(m_pPage5);
	m_pTextLabel5->setText(__tr2qs_ctx("<p>That's it. The user registration has been completed.<br><br>Click \"<b>Finish</b>\" to close this dialog.</p>","register"));
	m_pTextLabel5->setWordWrap(true);
	m_pPage5Layout->addWidget(m_pTextLabel5,0,0);
	m_pPage5Layout->setRowStretch(1,1);

	addPage(m_pPage5,__tr2qs_ctx("Registration Complete","register"));

	setFinishEnabled(m_pPage5,true);
	QString dummy;
	maskChanged(dummy);
	realNameChanged(dummy);
	notifyCheckToggled(false);

	setMinimumSize(QSize(350,420));

	// signals and slots connections
}
Exemple #18
0
SaveThemeDialog::SaveThemeDialog(QWidget * pParent)
: KviTalWizard(pParent)
{
	setWindowTitle(__tr2qs_ctx("Save Current Theme - KVIrc","theme"));
	setMinimumSize(400,350);

	KviThemeInfo info;
	info.load(KVI_OPTION_STRING(KviOption_stringIconThemeSubdir),KviThemeInfo::Auto);

	// welcome page ==================================================================================
	QWidget * pPage = new QWidget(this);
	QGridLayout * pLayout = new QGridLayout(pPage);

	QLabel * pLabel = new QLabel(pPage);
	pLabel->setWordWrap(true);
	QString szText = "<p>";
	szText += __tr2qs_ctx("This procedure allows you to save the current theme settings to a single directory. It is useful if you want to apply other themes or play with the theme settings and later come back to this theme with a single click. It will also allow you to manually modify the theme settings and later export them to a distributable package.","theme");
	szText += "</p><p>";
	szText += __tr2qs_ctx("You will be asked to provide a theme name, a description and, if you want, a screenshot.","theme");
	szText += "</p><p>";
	szText += __tr2qs_ctx("Hit the \"Next\" button to begin.","theme");
	szText += "<p>";

	pLabel->setText(szText);
	pLayout->addWidget(pLabel,0,0);
	pLayout->setRowStretch(1,1);

	addPage(pPage,__tr2qs_ctx("Welcome","theme"));
	setBackEnabled(pPage,false);
	setNextEnabled(pPage,true);
	setHelpEnabled(pPage,false);
	setFinishEnabled(pPage,false);

	// packager information ================================================================================

	pPage = new QWidget(this);
	pLayout = new QGridLayout(pPage);

	pLabel = new QLabel(pPage);
	pLabel->setText(__tr2qs_ctx("Here you need to provide information about you (the author) and a short description of the theme you're creating.","theme"));
	pLabel->setWordWrap(true);
	pLabel->setTextFormat(Qt::RichText);
	pLayout->addWidget(pLabel,0,0,1,2);

	pLabel = new QLabel(pPage);
	pLabel->setText(__tr2qs_ctx("Theme Name:","theme"));
	pLayout->addWidget(pLabel,1,0);

	m_pThemeNameEdit = new QLineEdit(pPage);
	m_pThemeNameEdit->setText(info.name());
	pLayout->addWidget(m_pThemeNameEdit,1,1);

	pLabel = new QLabel(pPage);
	pLabel->setText(__tr2qs_ctx("Version:","theme"));
	pLayout->addWidget(pLabel,2,0);

	m_pThemeVersionEdit = new QLineEdit(pPage);
	m_pThemeVersionEdit->setText(info.version());
	QRegExp rx("\\d{1,2}\\.\\d{1,2}(\\.\\d{1,2})?");
	QValidator *validator = new QRegExpValidator(rx, this);
	m_pThemeVersionEdit->setValidator(validator);

	pLayout->addWidget(m_pThemeVersionEdit,2,1);

	pLabel = new QLabel(pPage);
	pLabel->setText(__tr2qs_ctx("Description:","theme"));
	pLayout->addWidget(pLabel,3,0);

	m_pThemeDescriptionEdit = new QTextEdit(pPage);
	m_pThemeDescriptionEdit->setText(info.description());
	pLayout->addWidget(m_pThemeDescriptionEdit,3,1);

	pLabel = new QLabel(pPage);
	pLabel->setText(__tr2qs_ctx("Theme Author:","theme"));
	pLayout->addWidget(pLabel,4,0);

	m_pAuthorNameEdit = new QLineEdit(pPage);
	m_pAuthorNameEdit->setText(info.author());
	pLayout->addWidget(m_pAuthorNameEdit,4,1);


	pLayout->setRowStretch(3,1);
	pLayout->setColumnStretch(1,1);

	addPage(pPage,__tr2qs_ctx("Theme Information","theme"));
	setBackEnabled(pPage,true);
	setHelpEnabled(pPage,false);
	setNextEnabled(pPage,true);
	setFinishEnabled(pPage,false);


	// options page ==================================================================================
	pPage = new QWidget(this);
	pLayout = new QGridLayout(pPage);

	m_pSaveIconsCheckBox = new QCheckBox(__tr2qs_ctx("Save icons and images with theme","theme"),this);
	m_pSaveIconsCheckBox->setChecked(true);

	pLabel = new QLabel(pPage);
	pLabel->setWordWrap(true);
	QString ozText = "<p>";
	ozText += __tr2qs_ctx("To use the default and latest icon/image set automatically, uncheck this option.<br><br>To replace specific icons/images in your theme, include only those you wish to replace.","theme");
	ozText += "</p><p>";
	ozText += __tr2qs_ctx("Hit the <b>\"Next\"</b> button to continue.","theme");
	ozText += "<p>";

	pLayout->addWidget(m_pSaveIconsCheckBox,0,0);
	pLabel->setText(ozText);
	pLayout->addWidget(pLabel,1,0);
	pLayout->setRowStretch(2,1);

	addPage(pPage,__tr2qs_ctx("Theme options","theme"));
	setBackEnabled(pPage,true);
	setNextEnabled(pPage,true);
	setHelpEnabled(pPage,false);
	setFinishEnabled(pPage,false);

	// screenshot/logo/icon ================================================================================

	pPage = new QWidget(this);
	pLayout = new QGridLayout(pPage);

	pLabel = new QLabel(pPage);
	pLabel->setText(__tr2qs_ctx("Here you can either choose a screenshot image from disk or make one now. The screenshot will be displayed in the tooltips of the theme management dialog and will be also visible in the package installation dialog if you will export the theme to a distributable package.","theme"));
	pLabel->setWordWrap(true);
	pLabel->setTextFormat(Qt::RichText);
	pLayout->addWidget(pLabel,0,0);

	m_pImageLabel = new QLabel(pPage);
	m_pImageLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel);
	m_pImageLabel->setMinimumSize(300,225);
	m_pImageLabel->setAlignment(Qt::AlignCenter | Qt::AlignVCenter);
	pLayout->addWidget(m_pImageLabel,1,0);

	m_pImageSelector = new KviFileSelector(pPage,"",&m_szScreenshotPath,true,0,KVI_FILTER_IMAGE);
	connect(m_pImageSelector,SIGNAL(selectionChanged(const QString &)),this,SLOT(imageSelectionChanged(const QString &)));
	pLayout->addWidget(m_pImageSelector,2,0);

	QPushButton * pButton = new QPushButton(pPage);
	pButton->setText(__tr2qs_ctx("Make Screenshot Now","theme"));
	connect(pButton,SIGNAL(clicked()),this,SLOT(makeScreenshot()));
	pLayout->addWidget(pButton,3,0);

	pLayout->setRowStretch(1,1);

	m_pImageSelectionPage = pPage;
	addPage(pPage,__tr2qs_ctx("Screenshot","theme"));
	setBackEnabled(pPage,true);
	setHelpEnabled(pPage,false);
	setNextEnabled(pPage,false); // a screenshot should be ALWAYS provided.
	setFinishEnabled(pPage,false); // a screenshot should be ALWAYS provided.

}
PageGroup::PageGroup(Page& page)
    : m_identifier(getUniqueIdentifier())
{
    addPage(page);
}
void BaseProjectWizardDialog::addExtensionPages(const QList<QWizardPage *> &wizardPageList)
{
    foreach (QWizardPage *p,wizardPageList)
        Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
}
Exemple #21
0
DvdWizard::DvdWizard(MonitorManager *manager, const QString &url, QWidget *parent) :
    QWizard(parent)
  , m_authorFile(QStringLiteral("XXXXXX.xml"))
  , m_menuFile(QStringLiteral("XXXXXX.xml"))
  , m_menuVobFile(QStringLiteral("XXXXXX.mpg"))
  , m_letterboxMovie(QStringLiteral("XXXXXX.mpg"))
  , m_dvdauthor(NULL)
  , m_mkiso(NULL)
  , m_vobitem(NULL)
  , m_selectedImage(QStringLiteral("XXXXXX.png"))
  , m_selectedLetterImage(QStringLiteral("XXXXXX.png"))
  , m_highlightedImage(QStringLiteral("XXXXXX.png"))
  , m_highlightedLetterImage(QStringLiteral("XXXXXX.png"))
  , m_menuVideo(QStringLiteral("XXXXXX.vob"))
  , m_menuFinalVideo(QStringLiteral("XXXXXX.vob"))
  , m_menuImageBackground(QStringLiteral("XXXXXX.png"))
  , m_burnMenu(new QMenu(parent))
  , m_previousPage(0)
{
    setWindowTitle(i18n("DVD Wizard"));
    //setPixmap(QWizard::WatermarkPixmap, QPixmap(QStandardPaths::locate(QStandardPaths::DataLocation, "banner.png")));
    m_pageVob = new DvdWizardVob(this);
    m_pageVob->setTitle(i18n("Select Files For Your DVD"));
    addPage(m_pageVob);

    m_pageChapters = new DvdWizardChapters(manager, m_pageVob->dvdFormat(), this);
    m_pageChapters->setTitle(i18n("DVD Chapters"));
    addPage(m_pageChapters);

    if (!url.isEmpty()) m_pageVob->setUrl(url);
    m_pageVob->setMinimumSize(m_pageChapters->size());

    m_pageMenu = new DvdWizardMenu(m_pageVob->dvdFormat(), this);
    m_pageMenu->setTitle(i18n("Create DVD Menu"));
    addPage(m_pageMenu);

    QWizardPage *page4 = new QWizardPage;
    page4->setTitle(i18n("Creating DVD Image"));
    m_status.setupUi(page4);
    m_status.error_box->setHidden(true);
    m_status.tmp_folder->setUrl(QUrl::fromLocalFile(KdenliveSettings::currenttmpfolder()));
    m_status.tmp_folder->setMode(KFile::Directory | KFile::ExistingOnly);
    m_status.iso_image->setUrl(QUrl::fromLocalFile(QDir::homePath() + "/untitled.iso"));
    m_status.iso_image->setFilter(QStringLiteral("*.iso"));
    m_status.iso_image->setMode(KFile::File);

    m_isoMessage = new KMessageWidget;
    QGridLayout *s =  static_cast <QGridLayout*> (page4->layout());
    s->addWidget(m_isoMessage, 5, 0, 1, -1);
    m_isoMessage->hide();

    addPage(page4);

    connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotPageChanged(int)));
    connect(m_status.button_start, SIGNAL(clicked()), this, SLOT(slotGenerate()));
    connect(m_status.button_abort, SIGNAL(clicked()), this, SLOT(slotAbort()));
    connect(m_status.button_preview, SIGNAL(clicked()), this, SLOT(slotPreview()));

    QString programName(QStringLiteral("k3b"));
    QString exec = QStandardPaths::findExecutable(programName);
    if (!exec.isEmpty()) {
        //Add K3b action
        QAction *k3b = m_burnMenu->addAction(QIcon::fromTheme(programName), i18n("Burn with %1", programName), this, SLOT(slotBurn()));
        k3b->setData(exec);
    }
    programName = QStringLiteral("brasero");
    exec = QStandardPaths::findExecutable(programName);
    if (!exec.isEmpty()) {
        //Add Brasero action
        QAction *brasero = m_burnMenu->addAction(QIcon::fromTheme(programName), i18n("Burn with %1", programName), this, SLOT(slotBurn()));
        brasero->setData(exec);
    }
    if (m_burnMenu->isEmpty()) m_burnMenu->addAction(i18n("No burning program found (K3b, Brasero)"));
    m_status.button_burn->setMenu(m_burnMenu);
    m_status.button_burn->setIcon(QIcon::fromTheme(QStringLiteral("tools-media-optical-burn")));
    m_status.button_burn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    m_status.button_preview->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-start")));

    setButtonText(QWizard::CustomButton1, i18n("Load"));
    setButtonText(QWizard::CustomButton2, i18n("Save"));
    button(QWizard::CustomButton1)->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
    button(QWizard::CustomButton2)->setIcon(QIcon::fromTheme(QStringLiteral("document-save")));
    connect(button(QWizard::CustomButton1), SIGNAL(clicked()), this, SLOT(slotLoad()));
    connect(button(QWizard::CustomButton2), SIGNAL(clicked()), this, SLOT(slotSave()));
    setOption(QWizard::HaveCustomButton1, true);
    setOption(QWizard::HaveCustomButton2, true);
    QList<QWizard::WizardButton> layout;
    layout << QWizard::CustomButton1 << QWizard::CustomButton2 << QWizard::Stretch << QWizard::BackButton << QWizard::NextButton << QWizard::CancelButton << QWizard::FinishButton;
    setButtonLayout(layout);
}
UnitsEditDialog::UnitsEditDialog( BpDocument *bp, const QString &captionKey,
        const char *name, const QString &acceptKey, const QString &rejectKey ) :
    AppTabDialog( appWindow(), captionKey, name, acceptKey, rejectKey ),
    m_bp(bp),
    m_pageList(0)
{
    // Create the UnitsEditPage list
    m_pageList = new QPtrList<UnitsEditPage>();
    Q_CHECK_PTR( m_pageList );
    m_pageList->setAutoDelete( false );

    // Fuel & Vegetation Units
    UnitsEditPage *page;
    int rows = 7;
    if ( appWindow()->m_release >= 20000 )
    {
        rows += 2;
    }
    int row = 1;
	bool nodecimals = false;
    page = addPage( "UnitsEditDialog:FuelVeg:Tab", rows,
                    "KitchenPreserve.png", "Kitchen Preserve",
                    "fuelVegetationUnits.html" );
    page->addEdit( "UnitsEditDialog:FuelVeg:FuelLoad",
                    FuelLoadVars, FuelLoadUnits, row++ );
    page->addEdit( "UnitsEditDialog:FuelVeg:FuelSavr",
                    FuelSavrVars, FuelSavrUnits, row++ );
    page->addEdit( "UnitsEditDialog:FuelVeg:UnderstoryFuelDepth",
                    FuelUnderstoryDepthVars, FuelDepthUnits, row++ );
    page->addEdit( "UnitsEditDialog:FuelVeg:GroundFuelDepth",
                    FuelGroundDepthVars, DistShortUnits, row++, nodecimals );
    page->addEdit( "UnitsEditDialog:FuelVeg:FuelMois",
                    FuelMoisVars, PercentUnits, row++ );
    page->addEdit( "UnitsEditDialog:FuelVeg:FuelHeat",
                    FuelHeatVars, FuelHeatUnits, row++, nodecimals );
    page->addEdit( "UnitsEditDialog:FuelVeg:FuelBulk",
                    FuelBulkVars, FuelBulkUnits, row++ );
    page->addEdit( "UnitsEditDialog:FuelVeg:PackingRatio",
                    FuelPackingRatioVars, RatioUnits, row++ );
    page->addEdit( "UnitsEditDialog:FuelVeg:TreeHt",
                    TreeHtVars, DistMedUnits, row++ );
    page->addEdit( "UnitsEditDialog:FuelVeg:TreeDbh",
                    TreeDbhVars, DistShortUnits, row++ );
    page->addEdit( "UnitsEditDialog:FuelVeg:TreeBulk",
                    TreeBulkVars, FuelBulkUnits, row++, nodecimals );
    page->addEdit( "UnitsEditDialog:FuelVeg:Cover",
                    FuelCoverVars, PercentUnits, row++, nodecimals );
    page->addEdit( "UnitsEditDialog:FuelVeg:BasalArea",
                    BasalAreaVars, BasalAreaUnits, row++, nodecimals );
    page->addEdit( "UnitsEditDialog:FuelVeg:Fractions",
                    FuelFractionVars, PercentUnits, row++ );
    page->addEdit( "UnitsEditDialog:FuelVeg:CrownRatio",
                    FuelCrownVars, PercentUnits, row++ );

    // Weather Units
    page = addPage( "UnitsEditDialog:Weather:Tab", 4,
                    "TieOneOn.png", "Tie One On",
                    "weatherUnits.html" );
    row = 1;
    page->addEdit( "UnitsEditDialog:Weather:WindSpeed",
                    WindSpeedVars, WindSpeedUnits, row++ );
    page->addEdit( "UnitsEditDialog:Weather:Temperature",
                    TemperatureVars, TemperatureUnits, row++, nodecimals );
    //page->addEdit( "UnitsEditDialog:Weather:Humidity",
    //                HumidityVars, PercentUnits, row++ );
    page->addEdit( "UnitsEditDialog:Weather:SunShade",
                    WthrCoverVars, PercentUnits, row++, nodecimals );
    page->addEdit( "UnitsEditDialog:FuelVeg:Waf",
                    FuelWafVars, WafUnits, row++ );

    // Terrain & Spotting Units
    page = addPage( "UnitsEditDialog:TerrainSpot:Tab", 3,
                    "HomeOnTheReef.png", "Home on the Reef",
                    "terrainSpottingUnits.html" );
    row = 1;
    page->addEdit( "UnitsEditDialog:TerrainSpot:SlopeSteepness",
                    SlopeSteepnessVars, SlopeUnits, row++ );
    page->addEdit( "UnitsEditDialog:TerrainSpot:Elevation",
                    ElevationVars, ElevationUnits, row++ );
    page->addEdit( "UnitsEditDialog:TerrainSpot:SiteDistance",
                    SiteDistanceVars, DistLongUnits, row++, nodecimals );
    page->addEdit( "UnitsEditDialog:TerrainSpot:SpotDistance",
                    SpotDistanceVars, DistLongUnits, row++ );
    page->addEdit( "UnitsEditDialog:TerrainSpot:Height",
                    SpotHeightVars, DistMedUnits, row++ );
    page->addEdit( "UnitsEditDialog:TerrainSpot:Ratios",
                    SpotRatioVars, RatioUnits, row++ );

    // Fire & Effects Units
    page = addPage( "UnitsEditDialog:FireEffects:Tab", 10,
                    "LeaveItToBeavers1.png", "Leave It To Beavers",
                    "fireUnits.html" );
    row = 1;
    page->addEdit( "UnitsEditDialog:FireEffects:FireSurfaceSpread",
                    FireSurfaceSpreadVars, FireSpreadUnits, row++ );
    page->addEdit( "UnitsEditDialog:FireEffects:FireCrownSpread",
                    FireCrownSpreadVars, FireSpreadUnits, row++ );
    page->addEdit( "UnitsEditDialog:FireEffects:FireHpua",
                    FireHpuaVars, FireHpuaUnits, row++ );
    page->addEdit( "UnitsEditDialog:FireEffects:FireLineInt",
                    FireLineIntVars, FireLineIntUnits, row++ );
    page->addEdit( "UnitsEditDialog:FireEffects:FireFlameLength",
                    FireFlameLengthVars, FireFlameUnits, row++ );
    page->addEdit( "UnitsEditDialog:FireEffects:FireRxInt",
                    FireRxIntVars, FireRxIntUnits, row++ );
    page->addEdit( "UnitsEditDialog:FuelVeg:HeatSink",
                    FuelHeatSinkVars, FuelHeatSinkUnits, row++ );
    page->addEdit( "UnitsEditDialog:FireEffects:FireDistance",
                    FireDistVars, FireDistUnits, row++ );
    page->addEdit( "UnitsEditDialog:FireEffects:FireArea",
                    FireAreaVars, FireAreaUnits, row++ );
    page->addEdit( "UnitsEditDialog:FireEffects:FirePerimeter",
                    FirePerimeterVars, FireDistUnits, row++ );
    page->addEdit( "UnitsEditDialog:FireEffects:TreeScorch",
                    TreeScorchRatioVars, PercentUnits, row++ );
    page->addEdit( "UnitsEditDialog:FireEffects:IgnitionProb",
                    IgnitionProbVars, PercentUnits, row++ );
    page->addEdit( "UnitsEditDialog:FireEffects:Ratios",
                    FireRatioVars, RatioUnits, row++ );
    page->addEdit( "UnitsEditDialog:FireEffects:Factors",
                    FireFactorVars, RatioUnits, row++ );
    page->addEdit( "UnitsEditDialog:FireEffects:Power",
                    FirePowerVars, FirePowerUnits, row++ );

    // Time & Map Units
    page = addPage( "UnitsEditDialog:TimeMap:Tab", 3,
                    "LeaveItToBeavers2.png", "Leave It To Beavers",
                    "timeMapUnits.html" );
    row = 1;
    page->addEdit("UnitsEditDialog:TimeMap:ElapsedTime",
                    FireTimeVars, TimeMedUnits, row++ );
    page->addEdit("UnitsEditDialog:TimeMap:FlameResidenceTime",
                    FlameResidenceTimeVars, TimeShortUnits, row++ );
    page->addEdit("UnitsEditDialog:TimeMap:PalmettoAge",
                    PalmettoAgeVars, TimeLongUnits, row++, nodecimals );
    page->addEdit("UnitsEditDialog:TimeMap:MapElevation",
                    MapElevationVars, DistMedUnits, row++, nodecimals );
    page->addEdit("UnitsEditDialog:TimeMap:MapDistance",
                    MapDistanceVars, DistMapUnits, row++ );

    // Contain & Safety Units
    page = addPage( "UnitsEditDialog:Contain:Tab", 3,
                    "BearsDen.png", "Bear's Den",
                    "containUnits.html" );
    row = 1;
    page->addEdit("UnitsEditDialog:Contain:Rate",
                    ContainRateVars, FireSpreadUnits, row++, nodecimals );
    page->addEdit("UnitsEditDialog:Contain:Dist",
                    ContainDistVars, FireDistUnits, row++ );
    page->addEdit("UnitsEditDialog:Safety:Dist",
                    SafetyDistVars,  DistMedUnits, row++ );
    page->addEdit("UnitsEditDialog:Safety:Area",
                    SafetyAreaVars,  FireAreaUnits, row++ );
    page->addEdit("UnitsEditDialog:Safety:PE",
                    SafetyPEVars,    SafetyAreaUnits, row++, nodecimals );
    return;
}
Exemple #23
0
IPTCEditWidget::IPTCEditWidget(MetadataEditDialog* const parent)
    : DConfigDlgWdg(parent),
      d(new Private)
{
    d->dlg           = parent;

    d->contentPage   = new IPTCContent(this);
    d->page_content  = addPage(d->contentPage, i18n("Content"));
    d->page_content->setIcon(QIcon::fromTheme(QLatin1String("help-contents")));

    d->originPage  = new IPTCOrigin(this);
    d->page_origin = addPage(d->originPage, i18n("Origin"));
    d->page_origin->setIcon(QIcon::fromTheme(QLatin1String("applications-internet")));

    d->creditsPage  = new IPTCCredits(this);
    d->page_credits = addPage(d->creditsPage, i18n("Credits"));
    d->page_credits->setIcon(QIcon::fromTheme(QLatin1String("view-pim-contacts")));

    d->subjectsPage  = new IPTCSubjects(this);
    d->page_subjects = addPage(d->subjectsPage, i18n("Subjects"));
    d->page_subjects->setIcon(QIcon::fromTheme(QLatin1String("feed-subscribe")));

    d->keywordsPage  = new IPTCKeywords(this);
    d->page_keywords = addPage(d->keywordsPage, i18n("Keywords"));
    d->page_keywords->setIcon(QIcon::fromTheme(QLatin1String("bookmarks")));

    d->categoriesPage  = new IPTCCategories(this);
    d->page_categories = addPage(d->categoriesPage, i18n("Categories"));
    d->page_categories->setIcon(QIcon::fromTheme(QLatin1String("folder-image")));

    d->statusPage  = new IPTCStatus(this);
    d->page_status = addPage(d->statusPage, i18n("Status"));
    d->page_status->setIcon(QIcon::fromTheme(QLatin1String("view-pim-tasks")));

    d->propertiesPage  = new IPTCProperties(this);
    d->page_properties = addPage(d->propertiesPage, i18n("Properties"));
    d->page_properties->setIcon(QIcon::fromTheme(QLatin1String("draw-freehand")));

    d->envelopePage  = new IPTCEnvelope(this);
    d->page_envelope = addPage(d->envelopePage, i18n("Envelope"));
    d->page_envelope->setIcon(QIcon::fromTheme(QLatin1String("view-pim-mail")));

    // ---------------------------------------------------------------

    connect(d->contentPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->propertiesPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->subjectsPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->keywordsPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->categoriesPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->creditsPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->statusPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->originPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->envelopePage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    // ------------------------------------------------------------

    readSettings();
    slotItemChanged();
}
void BaseProjectWizardDialog::addExtensionPages(const QList<QWizardPage *> &wizardPageList)
{
    foreach (QWizardPage *p,wizardPageList)
        addPage(p);
}
Exemple #25
0
void
QvisOpacitySlider::addStep()
{
    addPage();
}
Exemple #26
0
ValidityDialog::ValidityDialog(QWidget* parent, Selection* selection)
        : KPageDialog(parent)

{
    setFaceType(Tabbed);
    setCaption(i18n("Validity"));
    setModal(true);
    setButtons(Ok | Cancel | User1);
    setButtonGuiItem(User1, KGuiItem(i18n("Clear &All")));

    m_selection = selection;

    QFrame *page1 = new QFrame();
    addPage(page1, i18n("&Criteria"));

    QGridLayout* tmpGridLayout = new QGridLayout(page1);
    tmpGridLayout->setMargin(KDialog::marginHint());
    tmpGridLayout->setSpacing(KDialog::spacingHint());

    QLabel *tmpQLabel = new QLabel(page1);
    tmpQLabel->setText(i18n("Allow:"));
    tmpGridLayout->addWidget(tmpQLabel, 0, 0);

    chooseType = new KComboBox(page1);
    tmpGridLayout->addWidget(chooseType, 0, 1);
    chooseType->addItem(i18n("All"), QVariant::fromValue(KCValidity::None));
    chooseType->addItem(i18n("Number"), QVariant::fromValue(KCValidity::KCNumber));
    chooseType->addItem(i18n("Integer"), QVariant::fromValue(KCValidity::Integer));
    chooseType->addItem(i18n("Text"), QVariant::fromValue(KCValidity::Text));
    chooseType->addItem(i18n("Date"), QVariant::fromValue(KCValidity::Date));
    chooseType->addItem(i18n("Time"), QVariant::fromValue(KCValidity::Time));
    chooseType->addItem(i18n("Text Length"), QVariant::fromValue(KCValidity::TextLength));
    chooseType->addItem(i18n("List"), QVariant::fromValue(KCValidity::List));
    chooseType->setCurrentIndex(0);

    allowEmptyCell = new QCheckBox(i18n("Allow blanks"), page1);
    tmpGridLayout->addWidget(allowEmptyCell, 1, 0, 1, 2);

    chooseLabel = new QLabel(page1);
    chooseLabel->setText(i18n("Data:"));
    tmpGridLayout->addWidget(chooseLabel, 2, 0);

    choose = new KComboBox(page1);
    tmpGridLayout->addWidget(choose, 2, 1);
    choose->addItem(i18n("equal to"), QVariant::fromValue(KCConditional::Equal));
    choose->addItem(i18n("greater than"), QVariant::fromValue(KCConditional::Superior));
    choose->addItem(i18n("less than"), QVariant::fromValue(KCConditional::Inferior));
    choose->addItem(i18n("equal to or greater than"), QVariant::fromValue(KCConditional::SuperiorEqual));
    choose->addItem(i18n("equal to or less than"), QVariant::fromValue(KCConditional::InferiorEqual));
    choose->addItem(i18n("between"), QVariant::fromValue(KCConditional::Between));
    choose->addItem(i18n("different from"), QVariant::fromValue(KCConditional::Different));
    choose->addItem(i18n("different to"), QVariant::fromValue(KCConditional::DifferentTo));
    choose->setCurrentIndex(0);

    edit1 = new QLabel(page1);
    edit1->setText(i18n("Minimum:"));
    tmpGridLayout->addWidget(edit1, 3, 0);

    val_min = new KLineEdit(page1);
    tmpGridLayout->addWidget(val_min, 3, 1);
    val_min->setValidator(new KDoubleValidator(val_min));

    edit2 = new QLabel(page1);
    edit2->setText(i18n("Maximum:"));
    tmpGridLayout->addWidget(edit2, 4, 0);

    val_max = new KLineEdit(page1);
    tmpGridLayout->addWidget(val_max, 4, 1);
    val_max->setValidator(new KDoubleValidator(val_max));

    //Apply minimum width of column1 to avoid horizontal move when changing option
    //A bit ugly to apply text always, but I couldn't get a label->QFontMetrix.boundingRect("text").width()
    //to give mew the correct results - Philipp
    edit2->setText(i18n("Date:"));
    tmpGridLayout->addItem(new QSpacerItem(edit2->width(), 0), 0, 0);
    edit2->setText(i18n("Date minimum:"));
    tmpGridLayout->addItem(new QSpacerItem(edit2->width(), 0), 0, 0);
    edit2->setText(i18n("Date maximum:"));
    tmpGridLayout->addItem(new QSpacerItem(edit2->width(), 0), 0, 0);
    edit2->setText(i18n("Time:"));
    tmpGridLayout->addItem(new QSpacerItem(edit2->width(), 0), 0, 0);
    edit2->setText(i18n("Time minimum:"));
    tmpGridLayout->addItem(new QSpacerItem(edit2->width(), 0), 0, 0);
    edit2->setText(i18n("Time maximum:"));
    tmpGridLayout->addItem(new QSpacerItem(edit2->width(), 0), 0, 0);
    edit2->setText(i18n("Minimum:"));
    tmpGridLayout->addItem(new QSpacerItem(edit2->width(), 0), 0, 0);
    edit2->setText(i18n("Maximum:"));
    tmpGridLayout->addItem(new QSpacerItem(edit2->width(), 0), 0, 0);
    edit2->setText(i18n("Number:"));
    tmpGridLayout->addItem(new QSpacerItem(edit2->width(), 0), 0, 0);

    validityList = new KTextEdit(page1);
    tmpGridLayout->addWidget(validityList, 2, 1, 3, 1);

    validityLabelList = new QLabel(page1);
    validityLabelList->setText(i18n("Entries:"));
    tmpGridLayout->addWidget(validityLabelList, 2, 0, Qt::AlignTop);

    tmpGridLayout->setRowStretch(5, 1);

    QFrame *page2 = new QFrame();
    addPage(page2, i18n("&Error Alert"));

    tmpGridLayout = new QGridLayout(page2);
    tmpGridLayout->setMargin(KDialog::marginHint());
    tmpGridLayout->setSpacing(KDialog::spacingHint());

    displayMessage = new QCheckBox(i18n("Show error message when invalid values are entered"), page2);
    displayMessage->setChecked(true);
    tmpGridLayout->addWidget(displayMessage, 0, 0, 1, 2);

    tmpQLabel = new QLabel(page2);
    tmpQLabel->setText(i18n("Action:"));
    tmpGridLayout->addWidget(tmpQLabel, 1, 0);

    chooseAction = new KComboBox(page2);
    tmpGridLayout->addWidget(chooseAction, 1, 1);
    chooseAction->addItem(i18n("Stop"), QVariant::fromValue(KCValidity::Stop));
    chooseAction->addItem(i18n("Warning"), QVariant::fromValue(KCValidity::Warning));
    chooseAction->addItem(i18n("Information"), QVariant::fromValue(KCValidity::Information));
    chooseAction->setCurrentIndex(0);

    tmpQLabel = new QLabel(page2);
    tmpQLabel->setText(i18n("Title:"));
    tmpGridLayout->addWidget(tmpQLabel, 2, 0);

    title = new KLineEdit(page2);
    tmpGridLayout->addWidget(title, 2, 1);

    tmpQLabel = new QLabel(page2);
    tmpQLabel->setText(i18n("Message:"));
    tmpGridLayout->addWidget(tmpQLabel, 3, 0, Qt::AlignTop);

    message = new KTextEdit(page2);
    tmpGridLayout->addWidget(message, 3, 1);

    QFrame *page3 = new QFrame();
    addPage(page3, i18n("Input Help"));

    tmpGridLayout = new QGridLayout(page3);
    tmpGridLayout->setMargin(KDialog::marginHint());
    tmpGridLayout->setSpacing(KDialog::spacingHint());

    displayHelp = new QCheckBox(i18n("Show input help when cell is selected"), page3);
    displayMessage->setChecked(false);
    tmpGridLayout->addWidget(displayHelp, 0, 0, 1, 2);

    tmpQLabel = new QLabel(page3);
    tmpQLabel->setText(i18n("Title:"));
    tmpGridLayout->addWidget(tmpQLabel, 1, 0);

    titleHelp = new KLineEdit(page3);
    tmpGridLayout->addWidget(titleHelp, 1, 1);

    tmpQLabel = new QLabel(page3);
    tmpQLabel->setText(i18n("Message:"));
    tmpGridLayout->addWidget(tmpQLabel, 2, 0, Qt::AlignTop);

    messageHelp = new KTextEdit(page3);
    tmpGridLayout->addWidget(messageHelp, 2, 1);

    connect(choose, SIGNAL(activated(int)), this, SLOT(changeIndexCond(int)));
    connect(chooseType, SIGNAL(activated(int)), this, SLOT(changeIndexType(int)));
    connect(this, SIGNAL(okClicked()), SLOT(OkPressed()));
    connect(this, SIGNAL(user1Clicked()), SLOT(clearAllPressed()));

    init();
}
Exemple #27
0
SetupDialog::SetupDialog(QWidget*, int nWin)
        : SetupDialogBase(NULL, "setup", false, WStyle_Minimize)
{
    new TransparentTop(this, pMain->UseTransparentContainer, pMain->TransparentContainer);

    setIcon(Pict("configure"));
    setCaption(i18n("Setup"));
    connect(btnUpdate, SIGNAL(clicked()), this, SLOT(update()));
    connect(btnClose, SIGNAL(clicked()), this, SLOT(close()));
    connect(btnOK, SIGNAL(clicked()), this, SLOT(ok()));
    connect(btnApply, SIGNAL(clicked()), this, SLOT(apply()));
    lstBars->clear();
    lstBars->header()->hide();
    lstBars->setSorting(1);
    connect(lstBars, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));

    itemMain = new QListViewItem(lstBars, i18n("My details"), QString::number(SETUP_DETAILS));
    itemMain->setOpen(true);

    addPage(new MainInfo(tabBars), SETUP_MAININFO, i18n("Main info"), "main");
    addPage(new HomeInfo(tabBars), SETUP_HOMEINFO, i18n("Home info"), "home");
    addPage(new WorkInfo(tabBars), SETUP_WORKINFO, i18n("Work info"), "work");
    addPage(new MoreInfo(tabBars), SETUP_MOREINFO, i18n("More info"), "more");
    addPage(new AboutInfo(tabBars), SETUP_ABOUT, i18n("About info"), "info");
    addPage(new InterestsInfo(tabBars), SETUP_INTERESTS, i18n("Interests"), "interest");
    addPage(new PastInfo(tabBars), SETUP_PAST, i18n("Group/Past"), "past");
    addPage(new PhoneBookDlg(tabBars), SETUP_PHONE, i18n("Phone book"), "phone");

    itemMain = new QListViewItem(lstBars, i18n("Preferences"), QString::number(SETUP_PREFERENCES));
    itemMain->setOpen(true);

    addPage(new StatusSetup(tabBars), SETUP_STATUS, i18n("Status mode"), "status");
    addPage(new NetworkSetup(tabBars), SETUP_CONNECTION, i18n("Connection"), "network");
    addPage(new ThemeSetup(tabBars), SETUP_STYLE, i18n("Style"), "style");
    addPage(new FontSetup(tabBars), SETUP_INTERFACE, i18n("Interface"), "text");
    addPage(new KeySetup(tabBars), SETUP_KEYS, i18n("Key shortcuts"), "key_bindings");
    addPage(new SoundSetup(tabBars), SETUP_SOUND, i18n("Sound"), "sound");
    addPage(new XOSDSetup(tabBars), SETUP_XOSD, i18n("On Screen notification"), "screen");
    addPage(new AlertDialog(tabBars), SETUP_ALERT, i18n("Alert"), "alert");
    addPage(new AcceptDialog(tabBars), SETUP_ACCEPT, i18n("Accept file"), "file");

#ifndef WIN32
    addPage(new MiscSetup(tabBars), SETUP_MISC, i18n("Miscellaneous"), "misc");
#endif

#ifdef USE_SPELL
    addPage(new SpellSetup(tabBars), SETUP_SPELL, i18n("Spell check"), "spellcheck");
#endif

    itemMain = new QListViewItem(lstBars, i18n("Auto reply"), QString::number(SETUP_AUTOREPLY));
    itemMain->setOpen(true);

    addPage(new MsgDialog(tabBars, ICQ_STATUS_AWAY), SETUP_AR_AWAY, Client::getStatusText(ICQ_STATUS_AWAY), "away");
    addPage(new MsgDialog(tabBars, ICQ_STATUS_NA), SETUP_AR_NA, Client::getStatusText(ICQ_STATUS_NA), "na");
    addPage(new MsgDialog(tabBars, ICQ_STATUS_OCCUPIED), SETUP_AR_OCCUPIED, Client::getStatusText(ICQ_STATUS_OCCUPIED), "occupied");
    addPage(new MsgDialog(tabBars, ICQ_STATUS_DND), SETUP_AR_DND, Client::getStatusText(ICQ_STATUS_DND), "dnd");
    addPage(new MsgDialog(tabBars, ICQ_STATUS_FREEFORCHAT), SETUP_AR_FREEFORCHAT, Client::getStatusText(ICQ_STATUS_FREEFORCHAT), "ffc");

    itemMain = new QListViewItem(lstBars, i18n("Security"), QString::number(SETUP_SECURITY));
    itemMain->setOpen(true);

    addPage(new GeneralSecurity(tabBars), SETUP_GENERAL_SEC, i18n("General"), "webaware");
    addPage(new ChangePasswd(tabBars), SETUP_PASSWD, i18n("Password"), "password");
    addPage(new IgnoreListSetup(tabBars), SETUP_IGNORE_LIST, i18n("Ignore list"), "ignorelist");
    addPage(new InvisibleListSetup(tabBars), SETUP_INVISIBLE_LIST, i18n("Invisible list"), "invisiblelist");
    addPage(new VisibleListSetup(tabBars), SETUP_VISIBLE_LIST, i18n("Visible list"), "visiblelist");

    tabBars->raiseWidget(nWin ? nWin : SETUP_MAININFO);
    connect(pMain, SIGNAL(iconChanged()), this, SLOT(iconChanged()));

    transparent = new TransparentTop(this, pMain->UseTransparentContainer, pMain->TransparentContainer);
};
Exemple #28
0
// on "init" you need to initialize your instance
bool PageTest::init()
{
    //////////////////////////////
    // 1. super init first
    if ( !Layer::init() )
    {
        return false;
    }
    
    scheduleUpdate();
    
    percent = 0;
    
    Size visibleSize = Director::getInstance()->getVisibleSize();
    Vec2 origin = Director::getInstance()->getVisibleOrigin();
    
    
    auto loadingBar = ui::LoadingBar::create("sliderProgress.png");
    loadingBar->setTag(0);
    loadingBar->setPosition(Vec2(visibleSize.width/2, visibleSize.height/2));
    loadingBar->setPercent(percent);
    this->addChild(loadingBar);
    
    
    
    
    auto checkBox = ui::CheckBox::create("check_box_normal.png", "check_box_normal_press.png", "check_box_active.png", "check_box_normal_disable.png", "check_box_active_disable.png");
    checkBox->setPosition(Vec2(visibleSize.width / 2.0f, visibleSize.height - 100));
    checkBox->addEventListener(CC_CALLBACK_2(PageTest::selectedEvent, this));
    this->addChild(checkBox);
    
    
    auto slider = ui::Slider::create();
    slider->loadBarTexture("sliderTrack.png");
    slider->loadSlidBallTextures("sliderThumb.png", "sliderThumb.png", "");
    slider->loadProgressBarTexture("sliderProgress.png");
    slider->setPosition(Vec2(visibleSize.width / 2.0f, visibleSize.height - 200));
    slider->addEventListener(CC_CALLBACK_2(PageTest::sliderEvent, this));
    this->addChild(slider);
    
    

    
    // auto recustom = ui::RichElementCustomNode::create(1, Color3B::WHITE, 255, pAr);
    // richText->pushBackElement(recustom);
    
    
    // androidだとバックグランドが緑がデフォ?
    // androidだと盤面全体が背景白になる
    // http://discuss.cocos2d-x.org/t/ui-pageview-bug-with-v3-rc1-green-background-on-android/12897
    //
    auto layout = ui::Layout::create();
    layout->setSize(Size(visibleSize.width, 200.0f));
    layout->setPosition(Vec2::ZERO);
    layout->setBackGroundColorType(ui::Layout::BackGroundColorType::SOLID);
    layout->setBackGroundColor(Color3B::BLUE);
    this->addChild(layout);
    
    auto pageView = ui::PageView::create();
    /*
    pageView->setBackGroundColorType(ui::Layout::BackGroundColorType::SOLID);
    pageView->setBackGroundColor(Color3B::RED);
    */
    pageView->setSize(Size(visibleSize.width, 130.0f));
    pageView->setPosition(Vec2::ZERO);
    pageView->setContentSize(Size(visibleSize.width, 130.0f));
    
    for (int i = 0; i < 3; ++i) {
        auto layout = ui::Layout::create();
        layout->setBackGroundImage("");
        layout->setBackGroundColor(Color3B::YELLOW);
        layout->setBackGroundColorType(ui::Layout::BackGroundColorType::SOLID);
        layout->setSize(Size(240.0f, 130.0f));
        // layout->addTouchEventListener(<#ccWidgetTouchCallback callback#>)

        
        auto imageView = ui::ImageView::create("HelloWorld.png");
        imageView->setScale9Enabled(true);
        imageView->setSize(Size(240, 130));
        imageView->setPosition(Vec2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f));
        layout->addChild(imageView);
        
        auto label = ui::Text::create(StringUtils::format("page %d",(i+1)), "Arial", 30);
        label->setColor(Color3B(192, 192, 192));
        label->setPosition(Vec2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f));
        layout->addChild(label);
        
        auto btn = ui::Button::create("");
        btn->setTitleText("");
        btn->setTitleFontSize(12);
        btn->setTitleFontName("");

        
        
        pageView->addPage(layout);
    }
    // pageView->scrollToPage(2);  // うまくいかない。handleReleaseLogicのboundaryのためだと思われる
    pageView->addEventListener(CC_CALLBACK_2(PageTest::pageViewEvent, this));
    
    
    layout->addChild(pageView);
    
    
    auto richText = ui::RichText::create();
    richText->ignoreContentAdaptWithSize(false);
    richText->setSize(Size(100, 100));
    richText->setPosition(Vec2(visibleSize.width / 2.0f, visibleSize.height - 300));
    this->addChild(richText);
    
    auto re1 = ui::RichElementText::create(1, Color3B::WHITE, 255, "This color is white. ", "Arial", 10);
    richText->pushBackElement(re1);
    
    auto re2 = ui::RichElementText::create(2, Color3B::YELLOW, 255, "This color is yellow. ", "Arial", 24);
    richText->insertElement(re2, 1);
    
    auto reimg = ui::RichElementImage::create(6, Color3B::WHITE, 255, "sliderballnormal.png");
    richText->pushBackElement(reimg);

    
    return true;
}
Exemple #29
0
EntryDlg::EntryDlg(
  KMainWindow   *main,
  kvoctrainDoc  *doc,
  bool           multi_sel,
  bool           origin,
  grade_t        f_grd,
  grade_t        t_grd,
  count_t        f_qcount,
  count_t        t_qcount,
  count_t        f_bcount,
  count_t        t_bcount,
  time_t         f_qdate,
  time_t         t_qdate,
  QString        f_faux_ami,
  QString        t_faux_ami,
  QString        expr,
  int            lesson,
  QComboBox     *lessonbox,
  QString        lang,
  LangSet       &langset,
  QString        rem,
  QString        type,
  QString        pronunce,
  QString        synonym,
  QString        antonym,
  QString        example,
  QString        usagelabel,
  QString        paraphrase,
  const          Conjugation &con_prefix,
  const          Conjugation &conjugations,
  const          Article &/*article*/,
  const          Comparison &comp,
  const          MultipleChoice &mc,
  QueryManager  &querymanager,
  const QString &title,
  bool           active,
  const QFont&   ipafont,
  QWidget       *parent,
  const char    *name,
  bool           modal)
  :
  KDialogBase(Tabbed, title, User1|User2|User3|Apply|Close, Apply, parent, name, modal, false,
    KGuiItem(i18n("&Reset")),
    KGuiItem(QString::null, "view_left_right"),
    KGuiItem(QString::null, "view_top_bottom"))

{
  mainwin = main;
  docked = false;
  edit_row = -1;
  edit_col = -1;
  from_page = 0;
  to_page = 0;

  QString s;
  if (langset.findLongId(lang).isEmpty() )
    s = lang;
  else
    s = langset.findLongId(lang);

  QFrame *page;
  QVBoxLayout *topLayout;

  if (origin)
  {
    page = addPage( i18n("Co&mmon") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    comm_page = new CommonEntryPage (this, doc, multi_sel, expr, lesson, lessonbox,
                                      lang, type, pronunce, usagelabel,
                                      i18n("Original &expression in %1:").arg(s), querymanager, active,
                                      ipafont, page, name);
    topLayout->addWidget(comm_page);

    page = addPage( i18n("A&dditional") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    aux_page = new AuxInfoEntryPage (this, multi_sel, synonym, antonym, example, rem, paraphrase, page, name);
    topLayout->addWidget(aux_page);

    page = addPage( i18n("&Multiple Choice") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    mc_page = new MCEntryPage (this, multi_sel, mc, page, "MultipleChoice");
    topLayout->addWidget(mc_page);

    page = addPage( i18n("Con&jugation") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    tense_page = new TenseEntryPage (this, multi_sel, con_prefix, conjugations, page, "Conjugation");
    topLayout->addWidget(tense_page);

    page = addPage( i18n("Compar&ison") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    adj_page = new AdjEntryPage (this, multi_sel, comp, page, "Comparison");
    topLayout->addWidget(adj_page);
  }
  else
  {
    page = addPage( i18n("Co&mmon") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    comm_page = new CommonEntryPage (this, doc, multi_sel, expr, lesson, lessonbox,
                                      lang, type, pronunce, usagelabel,
                                      i18n("Translated &expression in %1:").arg(s), querymanager, active,
                                      ipafont, page, name);
    topLayout->addWidget(comm_page);

    page = addPage( i18n("A&dditional") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    aux_page = new AuxInfoEntryPage (this, multi_sel, synonym, antonym, example, rem, paraphrase, page, name);
    topLayout->addWidget(aux_page);

    page = addPage( i18n("&Multiple Choice") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    mc_page = new MCEntryPage (this, multi_sel, mc, page, "MultipleChoice");
    topLayout->addWidget(mc_page);

    page = addPage( i18n("Con&jugation") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    tense_page = new TenseEntryPage (this, multi_sel, con_prefix, conjugations, page, "Conjugation");
    topLayout->addWidget(tense_page);

    page = addPage( i18n("Compar&ison") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    adj_page = new AdjEntryPage (this, multi_sel, comp, page, "Comparison");
    topLayout->addWidget(adj_page);
  }

  page = addPage( i18n("&From Original") );
  topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
  from_page = new FromToEntryPage (this, multi_sel, f_grd, f_qdate, f_qcount, f_bcount,
                                    f_faux_ami,
                                    i18n("Properties From Original"), page, name);
  topLayout->addWidget(from_page);

  page = addPage( i18n("&To Original") );
  topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
  to_page   = new FromToEntryPage (this, multi_sel, t_grd, t_qdate, t_qcount, t_bcount,
                                    t_faux_ami,
                                    i18n("Properties to Original"), page, name);
  topLayout->addWidget(to_page);

  updatePages (type);

  connect(comm_page, SIGNAL(typeSelected(const QString&)), SLOT(updatePages(const QString&)) );

  connect( this, SIGNAL(user1Clicked()), this, SLOT(slotUndo()) );
  connect( this, SIGNAL(applyClicked()), this, SLOT(slotApply()) );
  connect( this, SIGNAL(user2Clicked()), this, SLOT(slotDockVertical()) );
  connect( this, SIGNAL(user3Clicked()), this, SLOT(slotDockHorizontal()) );

  connect (comm_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() ));
  connect (aux_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() ));
  connect (adj_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() ));
  connect (mc_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() ));
  connect (tense_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() ));

  if (from_page != 0)
    connect (from_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() ));
  if (to_page != 0)
    connect (to_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() ));

  enableButtonApply(false);
  enableButton(User1, false);
  comm_page->expr_line->setFocus();
}
Exemple #30
0
MainForm::MainForm(QWidget *parent): QMainWindow(parent)
{
    setupUi(this);

    ///!!!!!
    //alignButton->hide();
    //unalignButton->hide();


    setWindowTitle("YAGF");
    spellChecker = new SpellChecker(textEdit);
    spellChecker->enumerateDicts();
    selectLangsBox = new QComboBox();
    QLabel *label = new QLabel();
    label->setMargin(4);
    label->setText(trUtf8("Recognition language"));
    frame->show();
    toolBar->addWidget(label);
    selectLangsBox->setFrame(true);
    toolBar->addWidget(selectLangsBox);
    graphicsInput = new QGraphicsInput(QRectF(0, 0, 2000, 2000), graphicsView) ;
    graphicsInput->addToolBarAction(actionHideShowTolbar);
    graphicsInput->addToolBarAction(this->actionTBLV);
    graphicsInput->addToolBarAction(this->actionSmaller_view);
    graphicsInput->addToolBarSeparator();
    graphicsInput->addToolBarAction(actionRotate_90_CCW);
    graphicsInput->addToolBarAction(actionRotate_180);
    graphicsInput->addToolBarAction(actionRotate_90_CW);
    graphicsInput->addToolBarAction(actionDeskew);
    graphicsInput->addToolBarSeparator();
    graphicsInput->addToolBarAction(actionSelect_Text_Area);
    graphicsInput->addToolBarAction(actionSelect_multiple_blocks);
    graphicsInput->addToolBarAction(ActionClearAllBlocks);

    statusBar()->show();
    imageLoaded = false;
    useXSane = TRUE;
    textSaved = TRUE;
    hasCopy = false;
    //rotation = 0;
    m_menu = new QMenu(graphicsView);
    ifCounter = 0;

    connect(actionOpen, SIGNAL(triggered()), this, SLOT(loadImage()));
    connect(actionQuit, SIGNAL(triggered()), this, SLOT(close()));
    connect(this, SIGNAL(windowShown()), this, SLOT(onShowWindow()), Qt::QueuedConnection);
    connect(actionScan, SIGNAL(triggered()), this, SLOT(scanImage()));
    connect(actionPreviousPage, SIGNAL(triggered()), this, SLOT(loadPreviousPage()));
    connect(actionNextPage, SIGNAL(triggered()), this, SLOT(loadNextPage()));
    connect(actionRecognize, SIGNAL(triggered()), this, SLOT(recognize()));
    connect(action_Save, SIGNAL(triggered()), this, SLOT(saveText()));
    connect(actionAbout, SIGNAL(triggered()), this, SLOT(showAboutDlg()));
    connect(actionOnlineHelp, SIGNAL(triggered()), this, SLOT(showHelp()));
    connect(actionCopyToClipboard, SIGNAL(triggered()), this, SLOT(copyClipboard()));
    textEdit->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(textEdit, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint)));
    connect(textEdit, SIGNAL(copyAvailable(bool)), this, SLOT(copyAvailable(bool)));
    connect(textEdit, SIGNAL(textChanged()), this, SLOT(textChanged()));
    connect(graphicsInput, SIGNAL(rightMouseClicked(int, int, bool)), this, SLOT(rightMouseClicked(int, int, bool)));


    tesMap = new TesMap();
    fillLanguagesBox();
    initSettings();
    delTmpFiles();
    scanProcess = new QProcess(this);
    QXtUnixSignalCatcher::connectUnixSignal(SIGUSR2);
    ba = new QByteArray();
    connect(QXtUnixSignalCatcher::catcher(), SIGNAL(unixSignal(int)), this, SLOT(readyRead(int)));

    connect(textEdit->document(), SIGNAL(cursorPositionChanged(const QTextCursor &)), this, SLOT(updateSP()));

    //displayLabel->installEventFilter(this);
    textEdit->installEventFilter(this);
    QPixmap l_cursor;
    l_cursor.load(":/resize.png");
    resizeCursor = new QCursor(l_cursor);
    graphicsInput->setMagnifierCursor(resizeCursor);
    l_cursor.load(":/resize_block.png");
    resizeBlockCursor = new QCursor(l_cursor);
   // textEdit->setContextMenuPolicy(Qt::ActionsContextMenu);

    this->sideBar->show();
    connect(sideBar, SIGNAL(fileSelected(const QString &)), this, SLOT(fileSelected(const QString &)));

    connect(actionRecognize_All_Pages, SIGNAL(triggered()), this, SLOT(recognizeAll()));

    graphicsInput->setSideBar(sideBar);

    QPixmap pm;
    pm.load(":/align.png");
    //alignButton->setIcon(pm);
    pm.load(":/undo.png");
    //unalignButton->setIcon(pm);
    //connect(unalignButton, SIGNAL(clicked()), this, SLOT(unalignButtonClicked()));

    //clearBlocksButton->setDefaultAction(ActionClearAllBlocks);
    loadFromCommandLine();
    emit windowShown();

    pdfx = NULL;
    if (findProgram("pdftoppm")) {
        pdfx = new PDF2PPT();
    } else
    if (findProgram("gs")) {
         pdfx = new GhostScr();
    }

    if (pdfx) {
        connect(pdfx, SIGNAL(addPage(QString)), this, SLOT(addPDFPage(QString)), Qt::QueuedConnection);
        connect (pdfx, SIGNAL(finished()), this, SLOT(finishedPDF()));
    }

    pdfPD.setWindowTitle("YAGF");
    pdfPD.setLabelText(trUtf8("Importing pages from the PDF document..."));
    pdfPD.setCancelButtonText(trUtf8("Cancel"));
    pdfPD.setMinimum(-1);
    pdfPD.setMaximum(-1);
    pdfPD.setWindowIcon(QIcon(":/yagf.png"));
    if (pdfx)
        connect(&pdfPD, SIGNAL(canceled()), pdfx, SLOT(cancel()));

}