<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi,<br>
      If i understand correctly, you're trying to access the actions in
      the menubar from outside the classes that own them? Depending on
      which actions you're interested in exactly you have a few
      different ways to do it. If you got lucky the action you want
      already has a way to access it's state, though I can't think of
      any that do. If not i can think of 3 ways you could do it,
      depending on what you're trying to do. KXmlGuiWindow already
      supports changing the state on the menus, so if all you need is
      something like:<br>
          if quit is enabled<br>
              enable some other actions<br>
          if quit is disabled<br>
              disable those actions<br>
      then that would probably be the way to go. If you need something
      more complicated your remaining options would be either accessing
      the Okular instance via dbus, or adding methods to the action
      creating classes to give you the visibility you need.<br>
      <br>
      Brian<br>
      <br>
      On 08/12/2012 01:28 PM, Jaydeep Solanki wrote:<br>
    </div>
    <blockquote
cite="mid:CALCx485VRXtxsJzSMCNYt1_jjtDsoGr1N-WArk7d1Zvg24QL=w@mail.gmail.com"
      type="cite">hi,<br>
      I also wanted to ask if I can access the menubar in other files,
      like I if I need to check if "Quit" action in File Menu is enabled
      or not, can that be done ??<br>
      <br>
      <div class="gmail_quote">On Sun, Aug 12, 2012 at 11:53 PM, Jaydeep
        Solanki <span dir="ltr"><<a moz-do-not-send="true"
            href="mailto:jaydp17@gmail.com" target="_blank">jaydp17@gmail.com</a>></span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks man,<br>
          Got what I was asking, <a moz-do-not-send="true"
href="http://techbase.kde.org/Development/Architecture/KDE4/XMLGUI_Technology"
            target="_blank">http://techbase.kde.org/Development/Architecture/KDE4/XMLGUI_Technology</a>
          did the work :)
          <div class="HOEnZb">
            <div class="h5"><br>
              <br>
              <br>
              <div class="gmail_quote">On Sun, Aug 12, 2012 at 11:22 PM,
                Brian K <span dir="ltr"><<a moz-do-not-send="true"
                    href="mailto:bri.kor.21@gmail.com" target="_blank">bri.kor.21@gmail.com</a>></span>
                wrote:<br>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div bgcolor="#FFFFFF" text="#000000">
                    <div>Hi,<br>
                      Where you need to go to add the actions depends on
                      what exactly you are intending. The Okular program
                      that you use directly is a shell, which uses a
                      kpart, a kind of plugin, to do most of the work.
                      So if your action is specific to Okular, but not
                      the plugin, you would add it to the shell
                      (shell.h, shell.cpp, shell.rc). If on the other
                      hand the action would go in the kpart (plugin)
                      then you would want to modify (part.cpp, part.h,
                      part.rc).<br>
                      <br>
                      The reason you've likely been unable to add is
                      that Okular, and the kpart plugin use kxmlgui:<br>
                      <a moz-do-not-send="true"
href="http://techbase.kde.org/Development/Architecture/KDE4/XMLGUI_Technology"
                        target="_blank">http://techbase.kde.org/Development/Architecture/KDE4/XMLGUI_Technology</a><br>
                      What that means is that you have to modify both
                      the c++ file and a second rc file that defines the
                      menu. The techbase tutorial looks pretty good on
                      basic kpart usage if you're looking for somewhere
                      to start:<br>
                      <a moz-do-not-send="true"
                        href="http://techbase.kde.org/Development/Tutorials/Using_KParts"
                        target="_blank">http://techbase.kde.org/Development/Tutorials/Using_KParts</a><br>
                      <br>
                      Good luck,<br>
                      Brian
                      <div>
                        <div><br>
                          <br>
                          On 08/12/2012 11:59 AM, Jaydeep Solanki wrote:<br>
                        </div>
                      </div>
                    </div>
                    <blockquote type="cite">
                      <div>
                        <div>Hi everyone,<br>
                          I just wanted to know about how to add an
                          action to a Menu.<br>
                          Like we have Open in the File Menu, suppose if
                          I want to add something to the File Menu, how
                          to do that.<br>
                          I experimented with the part.cpp file but all
                          in vain :(<br>
                          <br>
                          Thanks :),<br>
                          Jaydeep<br>
                          <br>
                          <br>
                          <br>
                          <fieldset></fieldset>
                          <br>
                        </div>
                      </div>
                      <pre>_______________________________________________
Okular-devel mailing list
<a moz-do-not-send="true" href="mailto:Okular-devel@kde.org" target="_blank">Okular-devel@kde.org</a>
<a moz-do-not-send="true" href="https://mail.kde.org/mailman/listinfo/okular-devel" target="_blank">https://mail.kde.org/mailman/listinfo/okular-devel</a>
</pre>
                    </blockquote>
                    <br>
                  </div>
                  <br>
                  _______________________________________________<br>
                  Okular-devel mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:Okular-devel@kde.org" target="_blank">Okular-devel@kde.org</a><br>
                  <a moz-do-not-send="true"
                    href="https://mail.kde.org/mailman/listinfo/okular-devel"
                    target="_blank">https://mail.kde.org/mailman/listinfo/okular-devel</a><br>
                  <br>
                </blockquote>
              </div>
              <br>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
  </body>
</html>