Example #1
0
MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
    setCaption(tr("IRC Client"));
    m_tabWidget = new IRCTabWidget(this);
    QWhatsThis::add(m_tabWidget, tr("Server connections, channels, queries and other things will be placed here"));
    connect(m_tabWidget, SIGNAL(currentChanged(QWidget*)), this, SLOT(selected(QWidget*)));
    setCentralWidget(m_tabWidget);
    setToolBarsMovable(FALSE);
    QMenuBar *menuBar = new QMenuBar(this);
    QPopupMenu *irc = new QPopupMenu(this);
    menuBar->insertItem(tr("IRC"), irc);
    QAction *a = new QAction( tr("New connection"),
                              Opie::Core::OResource::loadPixmap( "pass", Opie::Core::OResource::SmallIcon ),
                              QString::null, 0, this, 0 );
    connect(a, SIGNAL(activated()), this, SLOT(newConnection()));
    a->setWhatsThis(tr("Create a new connection to an IRC server"));
    a->addTo(irc);
    a = new QAction( tr("Settings"),
                     Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon ),
                     QString::null, 0, this, 0 );
    a->setWhatsThis(tr("Configure OpieIRC's behavior and appearance"));
    connect(a, SIGNAL(activated()), this, SLOT(settings()));
    a->addTo(irc);
    m_dccTab = 0;
    loadSettings();
}
Example #2
0
void UrlCatcher::setupActions()
{
    m_toolBar = new KToolBar(this, true, true);
    m_contextMenu = new QMenu(this);

    QAction* action;

    action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("window-new")), i18nc("open url", "&Open"), this, SLOT(openSelectedUrls()));
    m_itemActions.append(action);
    m_contextMenu->addAction(action);
    action->setStatusTip(i18n("Open URLs in external browser."));
    action->setWhatsThis(i18n("<p>Select one or several <b>URLs</b> below, then click this button to launch the application associated with the mimetype of the URL.</p>-<p>In the <b>Settings</b>, under <b>Behavior</b> | <b>General</b>, you can specify a custom web browser for web URLs.</p>"));
    action->setEnabled(false);

    action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("document-save")), i18n("&Save..."), this, SLOT(saveSelectedUrls()));
    m_itemActions.append(action);
    m_contextMenu->addAction(action);
    action->setStatusTip(i18n("Save selected URLs to the disk."));
    action->setEnabled(false);

    action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("bookmark-new")), i18n("Add Bookmark..."), this, SLOT (bookmarkSelectedUrls()));
    m_itemActions.append(action);
    m_contextMenu->addAction(action);
    action->setEnabled(false);

    m_toolBar->addSeparator();
    m_contextMenu->addSeparator();

    action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("edit-copy")), i18nc("copy url","&Copy"), this, SLOT(copySelectedUrls()));
    m_itemActions.append(action);
    m_contextMenu->addAction(action);
    action->setStatusTip(i18n("Copy URLs to the clipboard."));
    action->setWhatsThis(i18n("Select one or several <b>URLs</b> above, then click this button to copy them to the clipboard."));
    action->setEnabled(false);

    action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18nc("delete url","&Delete"), this, SLOT(deleteSelectedUrls()));
    m_itemActions.append(action);
    m_contextMenu->addAction(action);
    action->setWhatsThis(i18n("Select one or several <b>URLs</b> above, then click this button to delete them from the list."));
    action->setStatusTip(i18n("Delete selected link."));
    action->setEnabled(false);

    m_toolBar->addSeparator();
    m_contextMenu->addSeparator();

    action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("document-save")), i18nc("save url list", "&Save List..."), this, SLOT(saveUrlModel()));
    m_listActions.append(action);
    action->setStatusTip(i18n("Save list."));
    action->setWhatsThis(i18n("Click to save the entire list to a file."));
    action->setEnabled(false);

    action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("edit-clear-list")), i18nc("clear url list","&Clear List"), this, SLOT(clearUrlModel()));
    m_listActions.append(action);
    action->setStatusTip(i18n("Clear list."));
    action->setWhatsThis(i18n("Click to erase the entire list."));
    action->setEnabled(false);

    updateListActionStates();
}
Example #3
0
KexiReportView::KexiReportView(QWidget *parent)
        : KexiView(parent)
{
    m_preRenderer = 0;
    setObjectName("KexiReportDesigner_DataView");
    m_scrollArea = new QScrollArea(this);
    m_scrollArea->setBackgroundRole(QPalette::Dark);
    m_scrollArea->viewport()->setAutoFillBackground(true);

    m_pageSelector = new KexiRecordNavigator(this, 0);
    layout()->addWidget(m_scrollArea);
    layout()->addWidget(m_pageSelector);

    m_pageSelector->setRecordCount(0);
    m_pageSelector->setInsertingButtonVisible(false);
    m_pageSelector->setLabelText(i18n("Page"));


    // -- setup local actions
    QList<QAction*> viewActions;
    QAction* a;
    viewActions << (a = new KAction(KIcon("printer"), i18n("Print"), this));
    a->setObjectName("pgzkexirpt_print_report");
    a->setToolTip(i18n("Print Report"));
    a->setWhatsThis(i18n("Prints the current report."));
    connect(a, SIGNAL(triggered()), this, SLOT(slotPrintReport()));

    viewActions << (a = new KAction(KIcon("kword"), i18n("Open in KWord"), this));
    a->setObjectName("pgzkexirpt_open_kword");
    a->setToolTip(i18n("Open the report in KWord"));
    a->setWhatsThis(i18n("Opens the current report in KWord."));
    a->setEnabled(false);
//! @todo connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKWord()));

#ifdef HAVE_KSPREAD
    viewActions << (a = new KAction(KIcon("kspread"), i18n("Open in KSpread"), this));
    a->setObjectName("pgzkexirpt_open_kspread");
    a->setToolTip(i18n("Open the report in KSpread"));
    a->setWhatsThis(i18n("Opens the current report in KSpread."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKSpread()));
#endif

    viewActions << (a = new KAction(KIcon("text-html"), i18n("Export to HTML"), this));
    a->setObjectName("pgzkexirpt_export_html");
    a->setToolTip(i18n("Export the report to HTML"));
    a->setWhatsThis(i18n("Exports the report to a HTML file."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportHTML()));

    setViewActions(viewActions);


    connect(m_pageSelector, SIGNAL(nextButtonClicked()), this, SLOT(nextPage()));
    connect(m_pageSelector, SIGNAL(prevButtonClicked()), this, SLOT(prevPage()));
    connect(m_pageSelector, SIGNAL(firstButtonClicked()), this, SLOT(firstPage()));
    connect(m_pageSelector, SIGNAL(lastButtonClicked()), this, SLOT(lastPage()));

}
Example #4
0
KexiReportView::KexiReportView(QWidget *parent)
        : KexiView(parent), m_preRenderer(0), m_reportDocument(0), m_kexi(0), m_functions(0)
{   
    setObjectName("KexiReportDesigner_DataView");
    m_scrollArea = new QScrollArea(this);
    m_scrollArea->setBackgroundRole(QPalette::Dark);
    m_scrollArea->viewport()->setAutoFillBackground(true);

    layout()->addWidget(m_scrollArea);
    
#ifndef KEXI_MOBILE
    m_pageSelector = new KexiRecordNavigator(this, 0);
    layout()->addWidget(m_pageSelector);
    m_pageSelector->setRecordCount(0);
    m_pageSelector->setInsertingButtonVisible(false);
    m_pageSelector->setLabelText(i18n("Page"));
#endif
    
    // -- setup local actions
    QList<QAction*> viewActions;
    QAction* a;
    viewActions << (a = new KAction(KIcon("printer"), i18n("Print"), this));
    a->setObjectName("print_report");
    a->setToolTip(i18n("Print Report"));
    a->setWhatsThis(i18n("Prints the current report."));
    connect(a, SIGNAL(triggered()), this, SLOT(slotPrintReport()));

    viewActions << (a = new KAction(KIcon("kword"), i18n("Save to KWord"), this));
    a->setObjectName("save_to_kword");
    a->setToolTip(i18n("Save the report to a KWord document"));
    a->setWhatsThis(i18n("Save the report to a KWord document"));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderODT()));

    viewActions << (a = new KAction(KIcon("kspread"), i18n("Save to KSpread"), this));
    a->setObjectName("save_to_kspread");
    a->setToolTip(i18n("Save the report to a KSpread document"));
    a->setWhatsThis(i18n("Saves the current report to a KSpread document."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKSpread()));

    viewActions << (a = new KAction(KIcon("text-html"), i18n("Export as Web Page"), this));
    a->setObjectName("export_as_web_page");
    a->setToolTip(i18n("Export the report as web page"));
    a->setWhatsThis(i18n("Exports the report to a web page file."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportHTML()));

    setViewActions(viewActions);

#ifndef KEXI_MOBILE
    connect(m_pageSelector, SIGNAL(nextButtonClicked()), this, SLOT(nextPage()));
    connect(m_pageSelector, SIGNAL(prevButtonClicked()), this, SLOT(prevPage()));
    connect(m_pageSelector, SIGNAL(firstButtonClicked()), this, SLOT(firstPage()));
    connect(m_pageSelector, SIGNAL(lastButtonClicked()), this, SLOT(lastPage()));
#endif
}
Example #5
0
void KWrite::setupActions()
{
    m_closeAction = actionCollection()->addAction(KStandardAction::Close, QStringLiteral("file_close"), this, SLOT(slotFlush()));
    m_closeAction->setWhatsThis(i18n("Use this command to close the current document"));
    m_closeAction->setDisabled(true);

    // setup File menu
    actionCollection()->addAction(KStandardAction::New, QStringLiteral("file_new"), this, SLOT(slotNew()))
    ->setWhatsThis(i18n("Use this command to create a new document"));
    actionCollection()->addAction(KStandardAction::Open, QStringLiteral("file_open"), this, SLOT(slotOpen()))
    ->setWhatsThis(i18n("Use this command to open an existing document for editing"));

    m_recentFiles = KStandardAction::openRecent(this, SLOT(slotOpen(QUrl)), this);
    actionCollection()->addAction(m_recentFiles->objectName(), m_recentFiles);
    m_recentFiles->setWhatsThis(i18n("This lists files which you have opened recently, and allows you to easily open them again."));

    QAction *a = actionCollection()->addAction(QStringLiteral("view_new_view"));
    a->setIcon(QIcon::fromTheme(QStringLiteral("window-new")));
    a->setText(i18n("&New Window"));
    connect(a, SIGNAL(triggered()), this, SLOT(newView()));
    a->setWhatsThis(i18n("Create another view containing the current document"));

    actionCollection()->addAction(KStandardAction::Quit, this, SLOT(close()))
    ->setWhatsThis(i18n("Close the current document view"));

    // setup Settings menu
    setStandardToolBarMenuEnabled(true);

    m_paShowMenuBar = KStandardAction::showMenubar(this, SLOT(toggleMenuBar()), actionCollection());

    m_paShowStatusBar = KStandardAction::showStatusbar(this, SLOT(toggleStatusBar()), this);
    actionCollection()->addAction(m_paShowStatusBar->objectName(), m_paShowStatusBar);
    m_paShowStatusBar->setWhatsThis(i18n("Use this command to show or hide the view's statusbar"));

    m_paShowPath = new KToggleAction(i18n("Sho&w Path in Titlebar"), this);
    actionCollection()->addAction(QStringLiteral("set_showPath"), m_paShowPath);
    connect(m_paShowPath, SIGNAL(triggered()), this, SLOT(documentNameChanged()));
    m_paShowPath->setWhatsThis(i18n("Show the complete document path in the window caption"));

    a = actionCollection()->addAction(KStandardAction::KeyBindings, this, SLOT(editKeys()));
    a->setWhatsThis(i18n("Configure the application's keyboard shortcut assignments."));

    a = actionCollection()->addAction(KStandardAction::ConfigureToolbars, QStringLiteral("options_configure_toolbars"),
                                      this, SLOT(editToolbars()));
    a->setWhatsThis(i18n("Configure which items should appear in the toolbar(s)."));

    a = actionCollection()->addAction(QStringLiteral("help_about_editor"));
    a->setText(i18n("&About Editor Component"));
    connect(a, SIGNAL(triggered()), this, SLOT(aboutEditor()));
}
void CSVImportExportPluginInterface::createAction(KActionCollection *ac)
{
    QAction *action = ac->addAction(QStringLiteral("file_export_csv"));
    action->setText(i18n("Export CSV file..."));
    action->setWhatsThis(i18n("Export contacts to a file in comma separated value format."));
    setExportActions(QList<QAction *>() << action);
    connect(action, &QAction::triggered, this, &CSVImportExportPluginInterface::slotExportCVS);

    action = ac->addAction(QStringLiteral("file_import_csv"));
    action->setText(i18n("Import CSV file..."));
    action->setWhatsThis(i18n("Import contacts from a file in comma separated value format."));
    setImportActions(QList<QAction *>() << action);
    connect(action, &QAction::triggered, this, &CSVImportExportPluginInterface::slotImportCVS);
}
int entryPoint ( BlMainWindow *bges )
{
    BL_FUNC_DEBUG

    /// Inicializa el sistema de traducciones 'gettext'.
    setlocale ( LC_ALL, "" );
    blBindTextDomain ( "pluginbl_importcsv", g_confpr->value( CONF_DIR_TRADUCCION ).toLatin1().constData() );

    g_pluginbl_importcsv = bges;

    PluginBl_ImportCSV *mcont = new PluginBl_ImportCSV;

    /// Creamos el men&uacute;.
    QAction *accion = new QAction ( _ ( "&Importacion CSV" ), 0 );
    accion->setStatusTip ( _ ( "Importacion CSV" ) );
    accion->setWhatsThis ( _ ( "Importacion CSV" ) );
    accion->setIcon ( QIcon ( QString::fromUtf8 ( ":/Images/document-import.png" ) ) );
	
    mcont->connect ( accion, SIGNAL ( activated() ), mcont, SLOT ( elslot() ) );
    
    /// Miramos si existe un menu Herramientas
    QMenu *pPluginMenu = bges->newMenu ( _("&Herramientas"), "menuHerramientas", "menuAcerca_de" );

    pPluginMenu->addSeparator();
    pPluginMenu->addAction ( accion );


    
    return 0;
}
Example #8
0
///////////////////////////////////////////////////////////
//                                                       //
// File Menu                                             //
//                                                       //
///////////////////////////////////////////////////////////
void WinImage::setupFileMenu()
{
  // Actions
  QAction* open = new QAction( "&Open", this );
  open->setShortcut( Qt::CTRL + Qt::Key_O );
  open->setStatusTip( "This will open a file");
  connect( open, SIGNAL( triggered() ), this, SLOT( slotOpen() ) );

  //QAction* save = new QAction( "&Save", this );
  //connect( save, SIGNAL( triggered() ), this, SLOT( save() ) );

  QAction* saveAs = new QAction( "Save &As", this );
  saveAs->setShortcut( Qt::CTRL + Qt::Key_A );
  connect( saveAs, SIGNAL( triggered() ), this, SLOT( slotSaveAs() ) );

  QAction* quit = new QAction( "&Quit", this );
  quit->setShortcut( Qt::CTRL + Qt::Key_Q );
  quit->setStatusTip("This will quit the application unconditionally");
  quit->setWhatsThis("This is a button, stupid!");
  connect( quit, SIGNAL( triggered() ), qApp, SLOT( quit() ) );

  // Menubarvoid Test::paintEvent( QPaintEvent* )

  QMenu* file = new QMenu( "&File", menuBar());
  menuBar()->addMenu( file);
  file->addAction( open);
  //file->addAction( save);
  file->addAction( saveAs);
  file->addAction( quit);
}
Example #9
0
ThemeDialog::ThemeDialog(QWidget *parent, LPlugins *plugs, QString themeFilePath) : QDialog(parent), ui(new Ui::ThemeDialog){
  ui->setupUi(this); //load the designer file
  filepath = themeFilePath;
  this->setWindowIcon( LXDG::findIcon("preferences-desktop-theme","") );
  ui->line_name->setText( themeFilePath.section("/",-1).section(".qss",0,0) );
  //Load the icons for the window
  ui->push_cancel->setIcon( LXDG::findIcon("dialog-cancel","") );
  ui->push_save->setIcon( LXDG::findIcon("document-save","") );
  ui->push_apply->setIcon( LXDG::findIcon("dialog-ok","") );
  ui->tool_color->setIcon( LXDG::findIcon("color-picker","") );
  //Now create entries for the available colors in the database
  QStringList colors = plugs->colorItems();
  colors.sort();
  colormenu = new QMenu(this);
  for(int i=0; i<colors.length(); i++){
    LPI info = plugs->colorInfo(colors[i]);
    QAction *act = new QAction(info.name, this);
	act->setWhatsThis("%%"+info.ID+"%%");
	act->setToolTip(info.description);
    colormenu->addAction(act);
  }
  ui->tool_color->setMenu(colormenu);
  //Now load the given file
  loadTheme();
  connect(colormenu, SIGNAL(triggered(QAction*)),this, SLOT(menuTriggered(QAction*)) );
  connect(ui->text_file, SIGNAL(textChanged()), this, SLOT(themeChanged()) );
  
  //Now center the window on the parent
  QPoint cen = parent->geometry().center();
  this->move( cen.x() - (this->width()/2) , cen.y() - (this->height()/2) );
}
Example #10
0
QMenu *
ViewLightGL::createToolsMenu(QWidget * parent)
{
	QMenu * menu = new QMenu(parent);
    QPixmap home(ViewerIcon::getPixmap(ViewerIcon::home));
    QPixmap _light(ViewerIcon::getPixmap(ViewerIcon::light));
	menu->addAction(home,tr("&Home"),this,SLOT(home()),Qt::CTRL+Qt::SHIFT+Qt::Key_H);
    menu->addAction(tr("on X axis"),this,SLOT(XAxis()),Qt::CTRL+Qt::SHIFT+Qt::Key_X);
    menu->addAction(tr("on Y axis"),this,SLOT(YAxis()),Qt::CTRL+Qt::SHIFT+Qt::Key_Y);
    menu->addAction(tr("on Z axis"),this,SLOT(ZAxis()),Qt::CTRL+Qt::SHIFT+Qt::Key_Z);
    menu->addSeparator();
    QAction * idVisibility = menu->addAction(_light,tr("Visible"),this,SLOT(changeVisibility()),Qt::CTRL+Qt::SHIFT+Qt::Key_S);
    idVisibility->setCheckable( TRUE );
    idVisibility->setChecked( isVisible() );
    QObject::connect(this,SIGNAL(visibilityChanged( bool)),idVisibility,SLOT(setChecked(bool)));
    menu->addSeparator();
    QAction * idLight = menu->addAction(_light,     tr("&Enabled"),     this, SLOT(toggleEnabled()));
	idLight->setCheckable(true);
	idLight->setChecked(isEnabled());
    idLight->setWhatsThis(tr("<b>Light Rendering</b><br><br>"
	"Set <b>Light Rendering</b> enable/disable.<br><br>"
	"The Rendering will (not) take into account ligth source.<br><br>"
	"You can also use Menu <br><b>Tools > Renderer > Light</b><br>"));
	return menu;
}
Example #11
0
void QuantaProjectPart::setupActions()
{
  // create XMLGUI actions here
  QAction *action;
  action = actionCollection()->addAction("insert_files");
  action->setText(i18n("&Insert Files...")); 
  connect(action, SIGNAL(triggered(bool)), SLOT(slotInsertFiles()));
  action->setToolTip( i18n( "Insert Files" ) );
  action->setWhatsThis( i18n( "Insert Files - Insert new files into the project." ) );

  action =  actionCollection()->addAction("insert_folder");
  action->setText(i18n("&Insert Folder..."));
  connect(action, SIGNAL(triggered(bool)), SLOT(slotInsertFolder()));
  action->setToolTip( i18n( "Insert Folder" ) );
  action->setWhatsThis( i18n( "Insert Folder - Insert a new folder into the project." ) );
}
Example #12
0
PopupButton::PopupButton(QWidget* parent)
{
	//	this->setFrameStyle(QFrame::Box);

	QVBoxLayout* layout = new QVBoxLayout(this);
	layout->setMargin(0);
	this->setLayout(layout);

	//	QToolButton* expandButton = new QToolButton(this);
	QToolButton* expandButton = new CXSmallToolButton(this);
	mShowHeaderButton = expandButton;
	this->setFixedSize(expandButton->sizeHint());

	QAction* action = new QAction(QIcon(":icons/open_icon_library/layer-lower-3.png"), "Controls", this);
	QString tip = "Show Controls";
	action->setStatusTip(tip);
	action->setWhatsThis(tip);
	action->setToolTip(tip);
	connect(action, SIGNAL(triggered()), this, SLOT(onTriggered()));
	mAction = action;

	mShowHeaderButton->setDefaultAction(action);
	layout->addWidget(mShowHeaderButton);

	action->setCheckable(true);
}
//===========
//  PRIVATE
//===========
void AppMenu::updateAppList(){
  this->clear();
  APPS.clear();
  APPS = LXDG::sortDesktopCats( LXDG::systemDesktopFiles() );
  //Now fill the menu
  bool ok; //for checking inputs
    //--Look for the app store
    XDGDesktop store = LXDG::loadDesktopFile(appstorelink, ok);
    if(ok){ 
      this->addAction( LXDG::findIcon(store.icon, ""), tr("Get Applications"), this, SLOT(launchStore()) );
      this->addSeparator(); 
    }
    //--Now create the sub-menus
    QStringList cats = APPS.keys();
    cats.sort(); //make sure they are alphabetical
    for(int i=0; i<cats.length(); i++){
      //QString cat, icon;
      //if(cats[i] == ""){ name = tr(""); icon = ""; }
      QMenu *menu = new QMenu(cats[i], this);
      connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(launchApp(QAction*)) );
      QList<XDGDesktop> appL = APPS.value(cats[i]);
      for( int a=0; a<appL.length(); a++){
        QAction *act = new QAction(LXDG::findIcon(appL[a].icon, ""), appL[a].name, this);
        act->setToolTip(appL[a].comment);
        act->setWhatsThis(appL[a].filePath);
        menu->addAction(act);
      }
      this->addMenu(menu);
    }
}
Action * StdCmdWindowsMenu::createAction(void)
{
    // Allow to show 10 menu items in the 'Window' menu and one separator.
    // If we have more windows then the user can use the 'Windows...' item.
    WindowAction *pcAction;
    pcAction = new WindowAction(this, getMainWindow());
    for ( int i=0; i<10; i++ ) {
        QAction* window = pcAction->addAction(QObject::tr(sToolTipText));
        window->setCheckable(true);
        window->setToolTip(QCoreApplication::translate(
            this->className(), sToolTipText, 0,
            QCoreApplication::CodecForTr));
        window->setStatusTip(QCoreApplication::translate(
            this->className(), sStatusTip, 0,
            QCoreApplication::CodecForTr));
        window->setWhatsThis(QCoreApplication::translate(
            this->className(), sWhatsThis, 0,
            QCoreApplication::CodecForTr));
    }

    QAction* sep = pcAction->addAction(QLatin1String(""));
    sep->setSeparator(true);

    return pcAction;
}
Example #15
0
void MainUI::RebuildBookmarksMenu(){
  //Create the bookmarks menu
  ui->menuBookmarks->clear();
    ui->menuBookmarks->addAction(ui->actionManage_Bookmarks);
    ui->menuBookmarks->addSeparator();
  QStringList BM = settings->value("bookmarks", QStringList()).toStringList();
  ui->menuBookmarks->clear();
    ui->menuBookmarks->addAction(ui->actionManage_Bookmarks);
    ui->menuBookmarks->addSeparator();
  bool changed = false;
  BM.sort(); //Sort alphabetically
  for(int i=0; i<BM.length(); i++){
    if(QFile::exists(BM[i].section("::::",1,1)) ){
      QAction *act = new QAction(BM[i].section("::::",0,0),this);
        act->setWhatsThis(BM[i].section("::::",1,1));
      ui->menuBookmarks->addAction(act);
    }else{
      //Invalid directory - remove the bookmark
      BM.removeAt(i);
      i--;
      changed = true;
    }
  }
  if(changed){ settings->setValue("bookmarks",BM); }
  ui->actionManage_Bookmarks->setEnabled(BM.length()>0);
}
Example #16
0
JournalPlugin::JournalPlugin(KontactInterface::Core *core, const QVariantList &)
    : KontactInterface::Plugin(core, core, "korganizer", "journal"), mIface(Q_NULLPTR)
{
    setComponentName(QStringLiteral("korganizer"), QStringLiteral("korganizer"));

    KIconLoader::global()->addAppDir(QStringLiteral("korganizer"));

    QAction *action =
        new QAction(QIcon::fromTheme(QStringLiteral("journal-new")),
                    i18nc("@action:inmenu", "New Journal..."), this);
    actionCollection()->addAction(QStringLiteral("new_journal"), action);
    actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_J));
    QString str = i18nc("@info:status", "Create a new journal");
    action->setStatusTip(str);
    action->setToolTip(str);

    action->setWhatsThis(
        i18nc("@info:whatsthis",
              "You will be presented with a dialog where you can create "
              "a new journal entry."));
    connect(action, &QAction::triggered, this, &JournalPlugin::slotNewJournal);
    insertNewAction(action);

    mUniqueAppWatcher = new KontactInterface::UniqueAppWatcher(
        new KontactInterface::UniqueAppHandlerFactory<KOrganizerUniqueAppHandler>(), this);
}
Example #17
0
void DividerItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
{
  QMenu menu;
  QAction *editAction     = menu.addAction("Change Divider");
  QAction *deleteAction   = menu.addAction("Delete Divider");

  editAction->setWhatsThis("Put the steps in this row together with the steps after this");
  
  QAction *selectedAction = menu.exec(event->screenPos());

  if (selectedAction == NULL) {
    return;
  }
  
  Step *nextStep = step->nextStep();
  if ( ! nextStep) {
    return;
  }
  
  Where topOfStep    = nextStep->topOfStep();
  Where bottomOfStep = nextStep->bottomOfStep();
  Range *range = step->range();

  if (selectedAction == editAction) {
    changeDivider("Divider",topOfStep,bottomOfStep,&range->sepMeta,1,false);
  } else if (selectedAction == deleteAction) {
    deleteDivider(parentRelativeType,topOfStep);
  }
}
Example #18
0
void MainWindow::installTool(Tool* controllingWidget)
{
    QAction* action = controllingWidget->action();

    action->setCheckable(true);

    tools_list.push_back(controllingWidget);

    sidebarContents->addWidget(controllingWidget);
    modeActions->addAction(action);

    connect(action, SIGNAL(triggered(bool)),
            this, SLOT(actionTriggered()));

    connect(controllingWidget, SIGNAL(activateMe()),
            this, SLOT(activateTool()));

    connect(controllingWidget, SIGNAL(showEvent(Event_model*)),
            this, SLOT(showEvent(Event_model*)));

    connect(controllingWidget, SIGNAL(showState(State_model*)),
            this, SLOT(showState(State_model*)));


    connect(controllingWidget, SIGNAL(browse()),
            this, SLOT(browse()));

    action->setWhatsThis(controllingWidget->whatsThis());
}
Example #19
0
QAction* ActionResource::toQAction() const {
    Log log( Log::LT_TRACE, Log::MOD_MAIN, "QAction* ActionResource::toQAction() const" );

    if( !( m_Type == AT_ITEM || m_Type == AT_SEPARATOR ) ) {
        return NULL;
    };

    log.write( Log::LT_TRACE, "Produce item %s", getText() );
    QAction* act = new QAction( getText(), NULL );
    act->setAutoRepeat( getAutoRepeat() );
    act->setCheckable( getCheckable() );
    act->setChecked( getChecked() );
    act->setData( getData() );
    act->setFont( getFont() );
    act->setIcon( getIcon() );
    act->setIconVisibleInMenu( getIconVisibleInMenu() );
    act->setMenuRole( getMenuRole() );
    act->setSeparator( m_Type == AT_SEPARATOR );
    act->setShortcut( getShortcut() );
    act->setShortcutContext( getShortcutContext() );
    act->setStatusTip( getStatusTip() );
    act->setToolTip( getTooltip() );
    act->setVisible( getVisible() );
    act->setWhatsThis( getWhatsThis() );

    return act;
};
Example #20
0
void Part::createGUIClients()//KexiMainWindow *win)
{
    if (!d->guiClient) {
        //create part's gui client
        d->guiClient = new GUIClient(this, false, "part");

        //default actions for part's gui client:
        QAction* act = info()->newObjectAction();
        // - update action's tooltip and "what's this"
        QString tip(toolTip());
        if (!tip.isEmpty()) {
            act->setToolTip(tip);
        }
        QString what(whatsThis());
        if (!what.isEmpty()) {
            act->setWhatsThis(what);
        }

        //default actions for part instance's gui client:
        //NONE
        //let init specific actions for part instances
        for (int mode = 1; mode <= 0x01000; mode <<= 1) {
            if (info()->supportedViewModes() & (Kexi::ViewMode)mode) {
                GUIClient *instanceGuiClient = new GUIClient(
                    this, true, Kexi::nameForViewMode((Kexi::ViewMode)mode).toLatin1());
                d->instanceGuiClients.insert((Kexi::ViewMode)mode, instanceGuiClient);
            }
        }
        // also add an instance common for all modes (mode==0)
        GUIClient *instanceGuiClient = new GUIClient(this, true, "allViews");
        d->instanceGuiClients.insert(Kexi::AllViewModes, instanceGuiClient);

        initPartActions();
    }
}
Example #21
0
void LClock::LocaleChange(){
  //Refresh all the time zone information
  TZMenu->clear();
    TZMenu->addAction(tr("Use System Time"));
    TZMenu->addSeparator();
  QList<QByteArray> TZList = QTimeZone::availableTimeZoneIds();
  //Orgnize time zones for smaller menus (Continent/Country/City)
  // Note: id = Continent/City
  QStringList info;
  for(int i=0; i<TZList.length(); i++){
    QTimeZone tz(TZList[i]);
    if(!QString(tz.id()).contains("/")){ continue; }
    info << "::::"+QString(tz.id()).section("/",0,0)+"::::"+QLocale::countryToString(tz.country())+"::::"+QString(tz.id()).section("/",1,100).replace("_"," ")+"::::"+QString(tz.id());
  }
  //Now sort alphabetically
  info.sort();
  //Now create the menu tree
  QString continent, country; //current continent/country
  QMenu *tmpC=0; //continent menu
  QMenu *tmpCM=0; //country menu
  for(int i=0; i<info.length(); i++){
    //Check if different continent
    if(info[i].section("::::",1,1)!=continent){
      if(tmpC!=0){
        if(tmpCM!=0 && !tmpCM->isEmpty()){
	  tmpC->addMenu(tmpCM);
	}
	if(!tmpC->isEmpty()){ TZMenu->addMenu(tmpC); }
      }
      tmpC = new QMenu(this);
	tmpC->setTitle(info[i].section("::::",1,1));
      tmpCM = new QMenu(this);
	  tmpCM->setTitle(info[i].section("::::",2,2));
    //Check if different country
    }else if(info[i].section("::::",2,2)!=country){
        if(tmpC!=0 && tmpCM!=0 && !tmpCM->isEmpty()){
	  tmpC->addMenu(tmpCM);
	}
	tmpCM = new QMenu(this);
	  tmpCM->setTitle(info[i].section("::::",2,2));
    }
    //Now create the entry within the country menu
    if(tmpCM!=0){
      QAction *act = new QAction(info[i].section("::::",3,3), this);
	act->setWhatsThis(info[i].section("::::",4,4) );
      tmpCM->addAction(act);
    }
    //Save the values for the next run
    continent = info[i].section("::::",1,1);
    country = info[i].section("::::",2,2);

    if(i== info.length()-1){
      //last go through - save all menus
      if(tmpCM!=0 && tmpC!=0 && !tmpCM->isEmpty()){ tmpC->addMenu(tmpCM); }
      if(tmpC!=0 && !tmpC->isEmpty()){ TZMenu->addMenu(tmpC); }
    }
  }
  
}
QAction* specActionLibrary::undoAction(QObject* target)
{
	QAction* undoAction = undoStack->createUndoAction(target) ;
	undoAction->setIcon(QIcon::fromTheme("edit-undo"));
	undoAction->setToolTip(tr("Undo")) ;
	undoAction->setWhatsThis(tr("Undo - By clicking this button you can revert changes.  To \"undo the undo\" click the redo button right next door.\nNote that all of your undo history will be saved along with your work and will be available again upon loading your file again."));
	return undoAction ;
}
QAction* specActionLibrary::redoAction(QObject* target)
{
	QAction* redoAction = undoStack->createRedoAction(target) ;
	redoAction->setIcon(QIcon::fromTheme("edit-redo")) ;
	redoAction->setToolTip(tr("Redo")) ;
	redoAction->setWhatsThis(tr("Redo - Redoes what has been undone by clicking the undo button.\nNote that all of your undo history (including possible redos) will be saved along with your work and will be available again upon loading your file again."));
	return redoAction ;
}
Example #24
0
QAction* getAction(Shortcut* s)
      {
      if (s == 0)
            return 0;
      if (s->action == 0) {
            QAction* a = new QAction(s->xml, 0); // mscore);
            s->action  = a;
            a->setData(s->xml);
            if(!s->key.isEmpty())
                a->setShortcut(s->key);
            else
                a->setShortcuts(s->standardKey);
            a->setShortcutContext(s->context);
            if (!s->help.isEmpty()) {
                  a->setToolTip(s->help);
                  a->setWhatsThis(s->help);
                  }
            else {
                  a->setToolTip(s->descr);
                  a->setWhatsThis(s->descr);
                  }
            if (s->standardKey != QKeySequence::UnknownKey) {
                  QList<QKeySequence> kl = a->shortcuts();
                  if (!kl.isEmpty()) {
                        QString s(a->toolTip());
                        s += " (";
                        for (int i = 0; i < kl.size(); ++i) {
                              if (i)
                                    s += ",";
                              s += kl[i].toString(QKeySequence::NativeText);
                              }
                        s += ")";
                        a->setToolTip(s);
                        }
                  }
            else if (!s->key.isEmpty()) {
                  a->setToolTip(a->toolTip() +
                        " (" + s->key.toString(QKeySequence::NativeText) + ")" );
                  }
            if (!s->text.isEmpty())
                  a->setText(s->text);
            if (s->icon != -1)
                  a->setIcon(*icons[s->icon]);
            }
      return s->action;
      }
SettingsMenu::SettingsMenu() : QMenu(){
  this->setTitle( tr("Desktop Settings") );
  this->setIcon( LXDG::findIcon("configure","") );
  connect(this, SIGNAL(triggered(QAction*)), this, SLOT(runApp(QAction*)) );
  //Now setup the possible configuration options
  QAction *act = new QAction(LXDG::findIcon("preferences-desktop-screensaver",""), tr("Screensaver"), this);
	act->setWhatsThis("xscreensaver-demo");
	this->addAction(act);
	
}
Example #26
0
void mainUI::updateMenus(){
  //Reset the button menu's to correspond to the selected dataset
  QString ds = getSelectedDS();
  //Enable/disable the remove/config buttons if nothing selected
  if(ds.isEmpty()){
    ui->tool_remove->setVisible(false);
    ui->tool_config->setVisible(false);

  }else{
    ui->tool_remove->setVisible(true);
    ui->tool_config->setVisible(true);	  
  }
  //Enabled/disable the SSH key management
  if(RLIST.contains(ds) && !ds.isEmpty()){
    ui->tool_keys->setVisible(true);
  }else{
    ui->tool_keys->setVisible(false);
  }
  //check for a valid ds/snapshot combination
  bool ok = !ds.isEmpty();
  if(ok){ ok = HLIST.contains(ds); }
  if(ok){ ok = (HLIST[ds].numberOfSnapshots.toInt() > 0); }
  //Now set the items appropriately
  revMenu->clear();
  brMenu->clear();
  if(ok){
    //Reset the Menu Contents
    QStringList subsets = HLIST[ds].subsets();	
    for(int i=0; i<subsets.length(); i++){
      //Build the menu of snapshots for this subset
	QStringList snaps = HLIST[ds].snapshots(subsets[i]);
	if(snaps.isEmpty()){ continue; }
	QMenu *menu = new QMenu(subsets[i],this);
	for(int s =0; s<snaps.length(); s++){
	  QAction *act = new QAction(snaps[s],this);
		act->setWhatsThis(ds+":::"+subsets[i]+":::"+snaps[s]);
	  menu->addAction(act);
	}
	revMenu->addMenu(menu);
	brMenu->addMenu(menu);
    }	    
    //Enable the buttons if appropriate
    if(revMenu->isEmpty()){
      ui->tool_revert->setEnabled(false);
      ui->tool_browse->setEnabled(false);
    }else{
      ui->tool_revert->setEnabled(true);
      ui->tool_browse->setEnabled(true);
    }
  }else{
    //Disable the buttons
    ui->tool_revert->setEnabled(false);
    ui->tool_browse->setEnabled(false);
  }
}
QAction *MainWindow::createAction(const QString icon, const QString toolTip, const QString statusTip, bool scripted)
{
    QAction *ACTION = new QAction(QIcon("icons/" + getSettingsGeneralIconTheme() + "/" + icon + ".png"), toolTip, this); //TODO: Qt4.7 wont load icons without an extension...
    ACTION->setStatusTip(statusTip);
    ACTION->setObjectName(icon);
    // TODO: Set What's This Context Help to statusTip for now so there is some infos there.
    // Make custom whats this context help popup with more descriptive help than just
    // the status bar/tip one liner(short but not real long) with a hyperlink in the custom popup
    // at the bottom to open full help file description. Ex: like wxPython AGW's SuperToolTip.
    ACTION->setWhatsThis(statusTip);
    // TODO: Finish All Commands ... <.<

    if     (icon == "donothing")                  connect(ACTION, SIGNAL(triggered()), this, SLOT(doNothing()));
    else if(icon == "new")                      { ACTION->setShortcut(QKeySequence::New);      connect(ACTION, SIGNAL(triggered()), this, SLOT(newFile()));         }
    else if(icon == "open")                     { ACTION->setShortcut(QKeySequence::Open);     connect(ACTION, SIGNAL(triggered()), this, SLOT(openFile()));        }
    else if(icon == "save")                     { ACTION->setShortcut(QKeySequence::Save);     connect(ACTION, SIGNAL(triggered()), this, SLOT(savefile()));        }
    else if(icon == "saveas")                   { ACTION->setShortcut(QKeySequence::SaveAs);   connect(ACTION, SIGNAL(triggered()), this, SLOT(saveasfile()));      }
    else if(icon == "print")                    { ACTION->setShortcut(QKeySequence::Print);    connect(ACTION, SIGNAL(triggered()), this, SLOT(print()));           }
    else if(icon == "designdetails")            { ACTION->setShortcut(QKeySequence("Ctrl+D")); connect(ACTION, SIGNAL(triggered()), this, SLOT(designDetails()));   }
    else if(icon == "exit")                     { ACTION->setShortcut(QKeySequence("Ctrl+Q")); connect(ACTION, SIGNAL(triggered()), this, SLOT(exit()));            }

    else if(icon == "cut")                      { ACTION->setShortcut(QKeySequence::Cut);   connect(ACTION, SIGNAL(triggered()), this, SLOT(cut()));   }
    else if(icon == "copy")                     { ACTION->setShortcut(QKeySequence::Copy);  connect(ACTION, SIGNAL(triggered()), this, SLOT(copy()));  }
    else if(icon == "paste")                    { ACTION->setShortcut(QKeySequence::Paste); connect(ACTION, SIGNAL(triggered()), this, SLOT(paste())); }

    else if(icon == "windowcascade")              connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(cascade()));
    else if(icon == "windowtile")                 connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(tile()));
    else if(icon == "windowclose")              { ACTION->setShortcut(QKeySequence::Close);    connect(ACTION, SIGNAL(triggered()), this, SLOT(onCloseWindow()));   }
    else if(icon == "windowcloseall")             connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows()));
    else if(icon == "windownext")               { ACTION->setShortcut(QKeySequence::NextChild);     connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow()));     }
    else if(icon == "windowprevious")           { ACTION->setShortcut(QKeySequence::PreviousChild); connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); }

    else if(icon == "help")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(help()));
    else if(icon == "changelog")                  connect(ACTION, SIGNAL(triggered()), this, SLOT(changelog()));
    else if(icon == "tipoftheday")                connect(ACTION, SIGNAL(triggered()), this, SLOT(tipOfTheDay()));
    else if(icon == "about")                      connect(ACTION, SIGNAL(triggered()), this, SLOT(about()));
    else if(icon == "whatsthis")                  connect(ACTION, SIGNAL(triggered()), this, SLOT(whatsThisContextHelp()));

    else if(icon == "icon16")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon16()));
    else if(icon == "icon24")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon24()));
    else if(icon == "icon32")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon32()));
    else if(icon == "icon48")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon48()));
    else if(icon == "icon64")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon64()));
    else if(icon == "icon128")                    connect(ACTION, SIGNAL(triggered()), this, SLOT(icon128()));

    else if(icon == "settingsdialog")             connect(ACTION, SIGNAL(triggered()), this, SLOT(settingsDialog()));

    else if(icon == "undo")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(undo()));
    else if(icon == "redo")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(redo()));

    else if(icon == "makelayercurrent")           connect(ACTION, SIGNAL(triggered()), this, SLOT(makeLayerActive()));
    else if(icon == "layers")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(layerManager()));
    else if(icon == "layerprevious")              connect(ACTION, SIGNAL(triggered()), this, SLOT(layerPrevious()));

    else if(icon == "textbold")                 { ACTION->setCheckable(true); connect(ACTION, SIGNAL(toggled(bool)), this, SLOT(setTextBold(bool)));   }
Example #28
0
  void CnetEditorWidget::createActions() {
    ASSERT(m_menuActions);

    QAction * freezeTablesAct = new QAction(QIcon(":ice"),
                                            tr("&Freeze Tables"), this);
    freezeTablesAct->setCheckable(true);
    freezeTablesAct->setToolTip(tr("Freeze tables (filters will not take "
                                   "effect until unfrozen)"));
    freezeTablesAct->setStatusTip(tr("Freeze tables (filters will not take "
                                   "effect until unfrozen)"));
    freezeTablesAct->setWhatsThis(tr("<html>When frozen, the contents of the "
        "tables will be locked.  Current filters will not be applied to the "
        "tables until they are unfrozen.</html>"));
    connect(freezeTablesAct, SIGNAL(toggled(bool)),
            this, SLOT(setTablesFrozen(bool)));
    QList< QString > freezeTablesLocation;
    freezeTablesLocation.append(tr("&Tables"));
    m_menuActions->insert(freezeTablesAct, freezeTablesLocation);

    QAction * configureSortAct = new QAction(QIcon(":sort"),
                                             tr("&Sorting Options..."), this);
    QString configureSortToolTipText = tr("Configure table sorting options");
    configureSortAct->setToolTip(configureSortToolTipText);
    configureSortAct->setStatusTip(configureSortToolTipText);
    configureSortAct->setWhatsThis(tr("<html>Click here to configure options "
        "related to the sorting of table columns.</html>"));
    connect(configureSortAct, SIGNAL(triggered()),
            this, SLOT(configSorting()));
    QList< QString > configureSortLocation;
    configureSortLocation.append(tr("&Tables"));
    m_menuActions->insert(configureSortAct, configureSortLocation);

    QAction * whatsThisAct = QWhatsThis::createAction(this);
    QList< QString > whatsThisLocation;
    whatsThisLocation.append(tr("&Help"));
    m_menuActions->insert(whatsThisAct, whatsThisLocation);

    QList< QAction * > tbActionList;
    tbActionList.append(freezeTablesAct);
    tbActionList.append(configureSortAct);
    m_toolBarActions->insert("settingsToolBar", tbActionList);
  }
Example #29
0
  /**
   * Attaches this tool to the toolpad
   *
   * @param toolpad
   *
   * @return QAction*
   */
  QAction *StatisticsTool::toolPadAction(ToolPad *toolpad) {
    QAction *action = new QAction("Statistics", toolpad);
    action->setIcon(QPixmap(toolIconDir() + "/statistics.png"));
    action->setToolTip("Statistics");
    QObject::connect(action, SIGNAL(activated()), p_dialog, SLOT(show()));

    QString text  = "";

    action->setWhatsThis(text);
    return action;
  }
Example #30
0
void
ViewCameraGL::fillToolBar(QToolBar * toolBar)
{
  QPixmap home(ViewerIcon::getPixmap(ViewerIcon::home));
  QPixmap persp(ViewerIcon::getPixmap(ViewerIcon::perspective));
  QPixmap eye(ViewerIcon::getPixmap(ViewerIcon::eye));
  QPixmap eyef(ViewerIcon::getPixmap(ViewerIcon::eyef));
  drawArrow(&eye,2);
  QBitmap mask=eye.mask();
  drawArrow(&mask,2);
  QAction * bt = toolBar->addAction(home,tr("Home Position"),this, SLOT(home()));
  bt->setWhatsThis(tr("<b>Home Position</b><br><br>"
	"Set the view to the Initial Position.<br>"
	"You can also use Menu <br><b>Tools > Camera > Home</b><br>"));

  bt = toolBar->addAction(eye,tr("Camera Position"));
  QMenu * selctmenu = new QMenu(toolBar);
  selctmenu->addAction(tr("Front View (YZ)"),this,SLOT(YZView()));
  selctmenu->addAction(tr("Right View (XZ)"),this,SLOT(XZView()));
  selctmenu->addAction(tr("Top View (XY)"),this,SLOT(XYView()));
  bt->setMenu(selctmenu);
  // bt2->setPopupDelay(0);

  bt = toolBar->addAction(eyef,tr("Fit to Window"),this, SLOT(reDim()));
  bt->setWhatsThis(tr("<b>Fit to Window</b><br><br>"
	"Set the view to fit the scene.<br>"
	"You can also use Menu <br><b>Tools > Camera > Fit to Window</b><br>"));

  bt = toolBar->addAction(persp,tr("Perspective Camera"),
                         this, SLOT(changeCameraMode()));
  bt->setWhatsThis(tr("<b>Projection</b><br><br>"
	"Camera can be <b>Perspective</b> or <b>Orthographic</b>.<br><br>"
	"Setting this button <i>On</i> make the camera in Perspective mode, "
	"<i>Off</i> in Orthographic mode<br><br>"
	"You can also use Menu <br><b>Tools > Camera > Projection</b><br>"
	));
   bt->setCheckable(true) ;
   bt->setChecked(__projectionmode);
   QObject::connect(this,SIGNAL(projectionChanged(bool)),bt,SLOT(setChecked(bool)));
   toolBar->addSeparator();
}