Example #1
0
 /// <remarks>
 ///  Remove the association with an action from this range; it will no
 ///  longer be managed.
 ///  \param action KAction to dissociate from this range
 ///      </remarks>        <short>    Remove the association with an action from this range; it will no  longer be managed.</short>
 public void DissociateAction(KAction action)
 {
     interceptor.Invoke("dissociateAction#", "dissociateAction(KAction*)", typeof(void), typeof(KAction), action);
 }
Example #2
0
 public KAction AddAction(string name, KAction action)
 {
     return (KAction) interceptor.Invoke("addAction$#", "addAction(const QString&, KAction*)", typeof(KAction), typeof(string), name, typeof(KAction), action);
 }
Example #3
0
File: p9.cs Project: KDE/kimono
    public Browser(string name)
        : base((QWidget) null)
    {
        ObjectName = name;
        SetCaption("KDE Tutorial - p9");

        QMenu filemenu = new QMenu(KDE.I18n("&File"), this);

        KAction setDefaultPageAction = new KAction(this);
        setDefaultPageAction.Text = KDE.I18n("&Set default page");
        ActionCollection().AddAction("set_default_page", setDefaultPageAction);
        Connect(	setDefaultPageAction, SIGNAL("triggered(bool)"),
                    this, SLOT("FileSetDefaultPage()") );

        addBookmarkAction = KStandardAction.AddBookmark(this, SLOT("BookLocation()"), ActionCollection());
        backAction = KStandardAction.Back(this, SLOT("GotoPreviousPage()"), ActionCollection());
        backAction.Enabled = false;
        quitAction = KStandardAction.Quit(KApplication.kApplication(), SLOT("quit()"), ActionCollection());

        string about = KDE.I18n("p9 1.0\n\n" +
                 "(C) 1999-2002 Antonio Larrosa Jimenez\n" +
                 "[email protected]\t\[email protected]\n" +
                 "Malaga (Spain)\n\n" +
                 "Simple KDE Tutorial\n" +
                 "This tutorial comes with ABSOLUTELY NO WARRANTY\n" +
                 "This is free software, and you are welcome to redistribute it\n" +
                 "under certain conditions\n");
        QMenu helpmenu = HelpMenu(about);

        KMenuBar menu = MenuBar();
        menu.AddMenu(filemenu);
        menu.AddSeparator();
        menu.AddMenu(helpmenu);

        ToolBar().AddAction(quitAction);
        ToolBar().AddAction(addBookmarkAction);
        ToolBar().AddAction(backAction);
        StandardToolBarMenuEnabled = true;

        location = new QLineEdit();
        config = new KConfigGroup(KGlobal.Config(), "Settings");
        location.Text = config.ReadEntry("defaultPage", "http://localhost");

        Connect(location, SIGNAL("returnPressed()"), this, SLOT("ChangeLocation()"));

        QSplitter split = new QSplitter();
        split.OpaqueResize = true;

        QWidget widget = new QWidget(this);

        QVBoxLayout vbox = new QVBoxLayout(widget);
        vbox.AddWidget(location);
        vbox.AddWidget(split);

        browser = new KHTMLPart(split);
        browser.OpenUrl(new KUrl(location.Text));

        Connect( browser.BrowserExtension(),
                 SIGNAL("openUrlRequest(KUrl, KParts::OpenUrlArguments)"),
                 this, SLOT("OpenUrlRequest(KUrl, KParts::OpenUrlArguments)") );

        SetCentralWidget(widget);
        SetupGUI();
    }
Example #4
0
 /// <remarks>
 ///  Assign a global shortcut for this action. Global shortcuts
 ///  allow an action to respond to key shortcuts independently of the focused window,
 ///  i.e. the action will trigger if the keys were pressed no matter where in the X session.
 ///  The action must have a per main component unique
 ///  objectName() to enable cross-application bookeeping. If the objectName() is empty this method will
 ///  do nothing, otherwise the isGlobalShortcutEnabled() property will be set to true and the 
 ///  shortcut will be enabled.
 ///  It is mandatory that the objectName() doesn't change once isGlobalshortcutEnabled()
 ///  has become true.
 ///  <b>Note:<> KActionCollection.Insert(name, action) will set action's objectName to name so you often
 ///  don't have to set an objectName explicitly.
 ///  When an action, identified by main component name and objectName(), is assigned
 ///  a global shortcut for the first time on a KDE installation the assignment will
 ///  be saved. The shortcut will then be restored every time setGlobalShortcut() is
 ///  called with <code>loading</code> == Autoloading.
 ///  If you actually want to change the global shortcut you have to set
 ///  <code>loading</code> to NoAutoloading. The new shortcut will be automatically saved again.
 ///  \param shortcut global shortcut(s) to assign. Will be ignored unless <pre>loading</pre> is set to NoAutoloading or this is the first time ever you call this method (see above).
 ///  \param type the type of shortcut to be set, whether the active shortcut, the default shortcut,
 ///              or both (the default).
 ///  \param loading if Autoloading, assign the global shortcut this action has previously had if any.
 ///                    That way user preferences and changes made to avoid clashes will be conserved.
 ///                 if NoAutoloading the given shortcut will be assigned without looking up old values.
 ///                    You should only do this if the user wants to change the shortcut or if you have
 ///                    another very good reason. Key combinations that clash with other shortcuts will be
 ///                    dropped.
 ///  <b>Note:<> the default shortcut will never be influenced by autoloading - it will be set as given.
 ///  \sa globalShortcut()
 ///      </remarks>        <short>    Assign a global shortcut for this action.</short>
 public void SetGlobalShortcut(KShortcut shortcut, uint type, KAction.GlobalShortcutLoading loading)
 {
     interceptor.Invoke("setGlobalShortcut#$$", "setGlobalShortcut(const KShortcut&, KAction::ShortcutTypes, KAction::GlobalShortcutLoading)", typeof(void), typeof(KShortcut), shortcut, typeof(uint), type, typeof(KAction.GlobalShortcutLoading), loading);
 }