New answers tagged application-development
0
David's question is valid also for my case: it seems that if I upgrade the Boost packages from 1.46 to 1.48 I lose the libogre-dev which depends on 1.46. The "abstract" packages (e.g., libboost-all-dev) are also removed. IMO, that is an indication of an issue with the upgrade path.
I believe an upgrade of the abstract packages to depend on the 1.48 ...
2
Before uploading to ubuntu software center
here is a guide for packing .jar into deb,
It is not necessary to package your application before submitting to ubuntu software center , you can directly upload *.jar if it is closed source app , you should provide source code if it is an open source project. Canonical will package it for you
Links
How to get ...
4
Both PyQt4 and PySide have very similar mappings to the Qt API. There are, however, some differences, my opinions on which are described below:
Maintenance
They are both well maintained. The PySide produces a lot more regular releases at the moment: I think it's more closely linked to Qt than PyQt4 and as a newer project has a more active community at ...
2
While I'm sure there's a fancier python solution, the down and dirty version is to use gksudo. gksudo does the same thing sudo does, except it creates that dialog for authentication you mentioned instead of asking on the command line.
See https://help.ubuntu.com/community/RootSudo#Graphical_sudo
3
You can use the xapian DB directly:
import xapian
db=xapian.Database("/var/cache/software-center/xapian")
for m in db.postlist(""):
appname = db.get_document(m.docid).get_data()
Or the internal software-center API:
import sys
sys.path.insert(0, "/usr/share/software-center/")
import softwarecenter.db.database
db = ...
2
At first glance:
128: App details view in the Software Center, Alt-tab Switcher
64 : Dash, and resized to 48 for the Launcher and the Software Center tiled view
32 : Software Center list view
16 : Some places on the desktop (Nautilus list view?) and probably in the software updater for 12.10 ...
5
I've found a solution: use the locale Python module instead of gettext
import locale
from locale import gettext as _
locale.bindtextdomain('qreator', '/opt/extras.ubuntu.com/qreator/share/locale/')
locale.textdomain('qreator')
Thanks to Juha Sahakangas on the #gtk+ IRC channel for providing the explanation:
For this particular case the locale module ...
0
I tested Lazarus IDE, however I don't like it, so I won't recommended you to use this application. However I also tested Geany and fpc and I can truly say you that it is a good set of programs to start programming in Pascal.
Additionally I want to tell you something about programming language you have chosen. Pascal is death language in a full sense of this ...
1
As was mentioned in the comments, Lazarus is a Pascal IDE that is available in Ubuntu, there is also a Pascal compiler for GCC.
1
You shouldn't be importing both gtk and pygtk, as they will cause conflicts with each other.
0
If you are a c# guy you could try out monodevelop. Developing .net on windows with visual studio and port it to gtk. Monodevelop has an Visual Designer to create Ubuntu look and Feel. In my opinion not the way Microsoft Visual Studio/Expression Blend has, but works fine.
1
You can do most of your development on Windows if you are making a cross-platform application (most open source toolkits and programming environments are cross-platform to some degree), but you would still need to test it on Ubuntu, of course.
If you don't like having a dedicated or dual boot system with Ubuntu, most testing can also happen in a virtual ...
6
In general, I'd recommend using the toolkit supported ways to put menus in the global menubar... but, I'm assuming it's too late to convince you at this point :-) Also, I'll note that even thought we're using Dbusmenu and registration in 12.04 the goal is to move to GMenuModel and marking the window with its menus by 14.04, so this information will become ...
0
Its not as simple as that, what language do you use? Will the program need access to the users printer or internet and lots of other little things like that to consider, you cant just code a windows app and cast the linux portius spell im afraid.
0
You can develop in QT which while it does work on linux and windows, is far more native to linux then java is and can run in ubuntu easily. For example, the ubuntu one client is in qt.
3
write them in a language available on both platforms.
One example would be to write it in Java.
3
Try setting can_focus to True, if you can't give keyboard focus to the entry you won't be able to type anything into it.
2
The issue is a problem with the Ambiance theme. There is a highlight, but the background color for the prelight is darker. If thunderbird is showing a light highlight and inverting the colors of the icons, then it is because it's using custom widgets in XUL (which isn't Gtk+), which aren't following the GTK+ or icon themes, for everything.
2
Use the package python-apt , there are docs in /usr/share/doc/python-apt
For example to get a list of all installed packages use
import apt
cache = apt.Cache()
installed_packages = [p for p in cache if p.is_installed]
As the Software Centre is written in Python you may want to have a look at its source code as well.
0
You can use python-dbus bindings, and use the API documented at http://developer.ubuntu.com/api/ubuntu-12.04/python/Dbusmenu-0.4.html for DbusMenu, to integrate with the global menu bar.
4
You can also try to have a look at the help for the add command. You can do either of these:
invoke the quickly help add command
invoke the quickly tutorial command and browse to the add command reference
From the outupt of quickly help add
For instance 'quickly add dialog dialog-name' will create:
A subclass of Gtk.Dialog called DialogNameDialog in ...
6
Those three commands are intended as three levels of "officialness" to your release.
share
share does 2 main things:
Packages your software with a version suffix like -public1
Uploads that package to a PPA
So it's good for quickly getting code to testers. Ideally you'd use a separate PPA from your normal releases.
release
release does the same thing ...
3
I'm not sure is it correct, but I'm using something like this:
checkbox:
def check_item_activated_callback (menuitem, a, b):
if menuitem.property_get_int (Dbusmenu.MENUITEM_PROP_TOGGLE_STATE) == Dbusmenu.MENUITEM_TOGGLE_STATE_CHECKED:
menuitem.property_set_int (Dbusmenu.MENUITEM_PROP_TOGGLE_STATE, Dbusmenu.MENUITEM_TOGGLE_STATE_UNCHECKED)
...
4
You can place a constants.py for example, in the python package for your program, and define the values there, instead of in setup.py. You can then import that module from setup.py or the code which shows the about dialog, and set the appropriate values from the appropriate constants.
3
As far as accessing the platform directly, you should check out Seed.
You might also take a look at UserWebKit, the Python3 library that provides the key functionality used by the Novacut and Dmedia UI (it's built atop UserCouch and Microfiber, BTW).
After a lot of thought, I decided it was more interesting to not access the platform directly from ...
1
Documentation and example code for doing this can be found on the Developer Portal
0
Could you please clarify whether you want mnemonics (keyboard shortcuts for gui widgets i.e. ctrl-q) or accelerators (keyboard shortcuts for activating menu items i.e. alt-f q). As far as I understand these are two different things, so setting a mnemonic for a menu item will not also form a accelerator for it.
In any case, for the accelerators you can form ...
5
Here's an example of making a Checkbox type Quicklist menu item:
# Create toggle-able menu item for urgency
urgent_menu_item = Dbusmenu.Menuitem.new ()
# Set the tab's name as the menu item's name
urgent_menu_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _('Urgent'))
# Make the menu item toggle-able
...
5
share - This command lets you share your current developmental snapshot of your product. You should be using this command if you have added minor features or fixed bugs in your application.
release - This command allows you to create a new release of your application. You should be using this command if you have added major features to indicate that it has ...
2
Correct, the pygame template was removed in Ubuntu 12.04, in this commit.
IIRC the rationale was that the pygame template was using desktopcouch as a dependency, which is deprecated. My understanding is that it was easier to remove the template rather than reworking it to get rid of desktopcouch, as someone mentioned that pygame would be better implemented ...
1
Assuming that you are talking about an ordinary button (as supposed to a togglebutton) you can see all the methods it has here. As I read it there does not seem to be a function for what you are looking for, probably because these things are designed to be event driven.
In any case, I am wondering, can't you just get the events to set a boolean and have a ...
1
First you need to get a hold of the dialog gui object. If I remember correctly, quickly uses glade for the gui and then loads it via the GtkBuilder, so. Get the dialog gui object from the builder
dia = self.builder.get_object('the_name_of_the_dialog_in_glade')
and then you can run it
return_value = dia.run()
the return_value will be a code that ...
1
Well it so happens that I found the answer to my question. :D
#!/usr/bin/python
import webbrowser
webbrowser.open("http://www.google.com")
Thats all it takes in a python script to open google using python. Cheers. :D
0
The add_signal_receiver function can be used without specifying a bus name. This can be useful for capturing signals when the bus name, interface or specific signal name is unknown.
session_bus = dbus.SessionBus()
session_bus.add_signal_receiver(self.do_something,
signal_name=None,
...
5
Check out the Python example in the Unity developer documentation, and try hello-unity (only compatible with Ubuntu 12.04). These are good places to start.
Here's some bit of Python code that will make your app's icon wiggle in the launcher. It's for Ubuntu 12.04, but looking at the API documentation, it should also work for 11.10.
from gi.repository ...
3
Here's how you can get the downloads folder for any user in Python:
import glib
downloads_dir = glib.get_user_special_dir(glib.USER_DIRECTORY_DOWNLOAD)
Documentation:
get_user_special_dir() function
Special dir constants
1
There is a java-gnome project . But, even thought that exists, going with JavaFX still might be a better option to invest your time in.
3
You can do this easily from NetworkManager's pygi bindings:
from gi.repository import NetworkManager, NMClient
nmc = NMClient.Client.new()
devs = nmc.get_devices()
for dev in devs:
if dev.get_device_type() == NetworkManager.DeviceType.WIFI:
for ap in dev.get_access_points():
print ap.get_ssid()
Or from DBus directly, see
...
0
iwlist scan can do it from the command line, but it has to be run as root
6
Because Java bytecode is portable, there isn't much difference between writing a Java app for Windows and writing one for Ubuntu. You can use Swing or SWT for your GUI.
You can also write native-looking apps in Java with JGIR. JGIR will let you use Gtk3 to build your application.
2
Ok, what your code does is, it lets the second window get destroyed. After that its gone.
You can either keep the window from being destroyed (and hide it instead) by adding these two lines at the end of your init method:
secondwindow = self.builder2.get_object('window1')
secondwindow.connect('delete-event', lambda w, e: w.hide() or True)
which replaces ...
0
If You wish to use Java, then take a look at Eclipse IDE and/or NetBeans IDE. Also Adroid SDK is available for free, and it uses Java as well.
Regards
BTW: read the whole topic before you downvote
4
You can move content area (GtkVBox) from GtkDialog to another GtkContainer, and then append to GtkNotebook - using gtk.Widget.reparent() method.
about = Gtk.AboutDialog()
about.set_program_name ("Application")
about.set_copyright ("Author")
box = Gtk.VBox ()
about.vbox.reparent (box)
notebook.append_page (box, Gtk.Label("About"))
about.destroy ()
With ...
2
I strongly advice to get interested in this: http://monogame.codeplex.com/
0
The source for almost anything you install from the Ubuntu software center or repositories can be easily downloaded using the apt-get command-line tool. For example, to get the source for transmission (the example given below), you simply type: apt-get source transmission
0
Source code of all programs which Ubuntu is composed from is not stored in one central location because it is developed and maintained by thousands of independent developers. So it would be easier to choose a project you're interested in and then trying to find its source.
Example: from the top of my head, I decided to find the source repository of ...
3
1
You do not enter a service address into DFeet. The connect button is for the address of the System / Session bus. Yes, the overlap in D-Bus related vocabulary is arcane and stupid.
Get your System or Session Bus address. For regular applications, you're probably looking for the Session Bus address. Open a command line and enter:
echo ...
Top 50 recent answers are included