Merge lp:~marcobiscaro2112/unity-launcher-editor/port-to-gtk3 into lp:unity-launcher-editor

Proposed by Marco Biscaro
Status: Merged
Merged at revision: 63
Proposed branch: lp:~marcobiscaro2112/unity-launcher-editor/port-to-gtk3
Merge into: lp:unity-launcher-editor
Diff against target: 5804 lines (+380/-4337)
25 files modified
ule (+2/-10)
unitylaunchereditor/addassistant.py (+40/-43)
unitylaunchereditor/appgui.py (+0/-35)
unitylaunchereditor/core/desktop.py (+0/-1)
unitylaunchereditor/core/iconmanager.py (+9/-9)
unitylaunchereditor/core/utils.py (+0/-2)
unitylaunchereditor/data/application.glade (+0/-623)
unitylaunchereditor/data/application.glade.old (+0/-775)
unitylaunchereditor/data/application2.glade (+0/-645)
unitylaunchereditor/dialogs/app.py (+64/-66)
unitylaunchereditor/dialogs/dialogs.py (+24/-249)
unitylaunchereditor/dialogs/launcherdialog.py (+36/-41)
unitylaunchereditor/dialogs/quicklistdialog.py (+15/-15)
unitylaunchereditor/locale/unity-launcher-editor.pot (+0/-79)
unitylaunchereditor/mainwindow.py (+0/-440)
unitylaunchereditor/newlauncher.py (+0/-267)
unitylaunchereditor/utils.py (+0/-152)
unitylaunchereditor/widgets.py (+0/-276)
unitylaunchereditor/widgets/dialogheader.py (+23/-77)
unitylaunchereditor/widgets/groupinfo.py (+46/-51)
unitylaunchereditor/widgets/groupsdialog.py (+0/-245)
unitylaunchereditor/widgets/groupview.py (+28/-28)
unitylaunchereditor/widgets/labels.py (+0/-118)
unitylaunchereditor/widgets/launcherinfo.py (+53/-54)
unitylaunchereditor/widgets/launcherview.py (+40/-36)
To merge this branch: bzr merge lp:~marcobiscaro2112/unity-launcher-editor/port-to-gtk3
Reviewer Review Type Date Requested Status
Laudeci Oliveira Approve
Review via email: mp+83650@code.launchpad.net

Description of the change

As described here [1] "We strongly recommend not using PyGTK for new projects and to port existing applications from PyGTK to PyGObject."

That's what I've done. I've ported the code and everything except the filter in 'New Launcher' dialog works fine. This is better than before the port, when nothing was working in oneiric.

[1] https://live.gnome.org/PyGTK

To post a comment you must log in.
Revision history for this message
Marco Biscaro (marcobiscaro2112) wrote :

I removed some files that were not being used (commit 64). I'm not sure if I should do this, but it can be easily undone if necessary.

Revision history for this message
Laudeci Oliveira (laudeci) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ule'
--- ule 2011-06-23 15:52:56 +0000
+++ ule 2011-11-28 17:31:26 +0000
@@ -22,22 +22,14 @@
22BASE_PATH=os.path.dirname(os.path.abspath(sys.argv[0]))22BASE_PATH=os.path.dirname(os.path.abspath(sys.argv[0]))
23sys.path.append(os.path.dirname(BASE_PATH +'/'))23sys.path.append(os.path.dirname(BASE_PATH +'/'))
2424
25from gi.repository import Gtk
25from gi.repository import Gio26from gi.repository import Gio
26from unitylaunchereditor.dialogs.app import MainWindow27from unitylaunchereditor.dialogs.app import MainWindow
2728
28try:
29 import gtk
30except:
31 print "You need to install pyGTK or GTKv2 ",
32 print "or set your PYTHONPATH correctly."
33 print "try: export PYTHONPATH=",
34 print "/usr/local/lib/python2.X/site-packages/"
35 sys.exit(1)
36
37def main():29def main():
38 app = MainWindow(Gio.Settings('com.canonical.Unity.Launcher'))30 app = MainWindow(Gio.Settings('com.canonical.Unity.Launcher'))
39 app.show_all()31 app.show_all()
40 gtk.main()32 Gtk.main()
4133
42if __name__ == "__main__":34if __name__ == "__main__":
43 main()35 main()
4436
=== modified file 'unitylaunchereditor/addassistant.py'
--- unitylaunchereditor/addassistant.py 2011-06-13 20:07:33 +0000
+++ unitylaunchereditor/addassistant.py 2011-11-28 17:31:26 +0000
@@ -1,34 +1,32 @@
1from os.path import expanduser, join1from os.path import expanduser, join
2import gobject2from gi.repository import GObject
3import gtk3from gi.repository import Gtk
4from pango import WRAP_WORD,ELLIPSIZE_END
54
6from gio import app_info_get_all,ThemedIcon, AppInfo5from gio import app_info_get_all,ThemedIcon, AppInfo
7from os.path import isfile6from os.path import isfile
8from unitylaunchereditor.core.iconmanager import IconManager7from unitylaunchereditor.core.iconmanager import IconManager
9from unitylaunchereditor.dialogs.dialogs import MessageBox
10from unitylaunchereditor.core.translation import _8from unitylaunchereditor.core.translation import _
11from unitylaunchereditor.widgets.launcherview import LauncherView9from unitylaunchereditor.widgets.launcherview import LauncherView
12from unitylaunchereditor.widgets.launcherinfo import LauncherInfo10from unitylaunchereditor.widgets.launcherinfo import LauncherInfo
13from unitylaunchereditor.core.utils import normalize_path11from unitylaunchereditor.core.utils import normalize_path
1412
15class PageFromInfo(gtk.VBox):13class PageFromInfo(Gtk.VBox):
16 __gsignals__ = { 'add-clicked': (14 __gsignals__ = { 'add-clicked': (
17 gobject.SIGNAL_RUN_LAST,15 GObject.SIGNAL_RUN_LAST,
18 gobject.TYPE_NONE,16 GObject.TYPE_NONE,
19 (gobject.TYPE_PYOBJECT,),17 (GObject.TYPE_PYOBJECT,),
20 ),18 ),
21 }19 }
22 20
23 def __init__(self):21 def __init__(self):
24 super(PageFromInfo, self).__init__()22 Gtk.VBox.__init__(self)
25 self.set_border_width(12)23 self.set_border_width(12)
26 24
27 self.launcherinfo = LauncherInfo()25 self.launcherinfo = LauncherInfo()
28 26
29 bbox = gtk.HButtonBox()27 bbox = Gtk.HButtonBox()
30 bbox.set_layout(gtk.BUTTONBOX_END)28 bbox.set_layout(Gtk.ButtonBoxStyle.END)
31 button = gtk.Button(stock=gtk.STOCK_ADD)29 button = Gtk.Button(stock=Gtk.STOCK_ADD)
32 button.connect('clicked', self.__on_add_clicked)30 button.connect('clicked', self.__on_add_clicked)
33 31
34 bbox.pack_end(button, expand=False, fill=False, padding=6)32 bbox.pack_end(button, expand=False, fill=False, padding=6)
@@ -51,30 +49,30 @@
51 self.emit('add-clicked', obj)49 self.emit('add-clicked', obj)
52 50
53 51
54class PageFromFile(gtk.VBox):52class PageFromFile(Gtk.VBox):
55 __gsignals__ = { 'add-clicked': (53 __gsignals__ = { 'add-clicked': (
56 gobject.SIGNAL_RUN_LAST,54 GObject.SIGNAL_RUN_LAST,
57 gobject.TYPE_NONE,55 GObject.TYPE_NONE,
58 (gobject.TYPE_STRING,),56 (GObject.TYPE_STRING,),
59 ),57 ),
60 }58 }
61 def __init__(self):59 def __init__(self):
62 super(PageFromFile, self).__init__()60 Gtk.VBox.__init__(self)
63 self.set_border_width(12)61 self.set_border_width(12)
64 self.__gtk_file= gtk.FileChooserWidget()62 self.__gtk_file = Gtk.FileChooserWidget()
65 63
66 filter = gtk.FileFilter()64 filter = Gtk.FileFilter()
67 filter.set_name("Desktop files")65 filter.set_name("Desktop files")
68 filter.add_mime_type("application/x-desktop")66 filter.add_mime_type("application/x-desktop")
69 filter.add_pattern("*.desktop")67 filter.add_pattern("*.desktop")
70 68
71 self.__gtk_file.set_filter(filter)69 self.__gtk_file.set_filter(filter)
72 self.__gtk_file.set_current_folder(expanduser('~/.local/share/applications/'))70 self.__gtk_file.set_current_folder(expanduser('~/.local/share/applications/'))
73 self.pack_start(self.__gtk_file,True,True)71 self.pack_start(self.__gtk_file, True, True, 0)
74 72
75 self.bbox = gtk.HButtonBox()73 self.bbox = Gtk.HButtonBox()
76 self.bbox.set_layout(gtk.BUTTONBOX_END)74 self.bbox.set_layout(Gtk.ButtonBoxStyle.END)
77 button = gtk.Button(stock=gtk.STOCK_ADD)75 button = Gtk.Button(stock=Gtk.STOCK_ADD)
78 button.connect('clicked', self.__on_add_clicked)76 button.connect('clicked', self.__on_add_clicked)
79 self.bbox.pack_end(button, expand=False, fill=False, padding=0)77 self.bbox.pack_end(button, expand=False, fill=False, padding=0)
80 self.pack_start(self.bbox,fill=True,expand=False,padding=6)78 self.pack_start(self.bbox,fill=True,expand=False,padding=6)
@@ -84,33 +82,32 @@
84 self.emit('add-clicked', filename)82 self.emit('add-clicked', filename)
85 83
8684
87class PageFromSystem(gtk.Frame):85class PageFromSystem(Gtk.Frame):
88 __gsignals__ = { 'add-clicked': (86 __gsignals__ = { 'add-clicked': (
89 gobject.SIGNAL_RUN_LAST,87 GObject.SIGNAL_RUN_LAST,
90 gobject.TYPE_NONE,88 GObject.TYPE_NONE,
91 (gobject.TYPE_PYOBJECT,gobject.TYPE_PYOBJECT,),89 (Gtk.TreeModel.__gtype__, Gtk.TreeIter.__gtype__,),
92 ),90 ),
93 }91 }
94 def __init__(self):92 def __init__(self):
95 super(PageFromSystem,self).__init__()93 Gtk.Frame.__init__(self)
96 self.icon_manager = IconManager()94 self.icon_manager = IconManager()
97 self.set_shadow_type(gtk.SHADOW_NONE)95 self.set_shadow_type(Gtk.ShadowType.NONE)
98 self.set_border_width(12)96 self.set_border_width(12)
99 self.vbox1 = gtk.VBox()97 self.vbox1 = Gtk.VBox()
100 self.bbox = gtk.HButtonBox()98 self.bbox = Gtk.HButtonBox()
101 self.bbox.set_layout(gtk.BUTTONBOX_END)99 self.bbox.set_layout(Gtk.ButtonBoxStyle.END)
102 button = gtk.Button(stock=gtk.STOCK_ADD)100 button = Gtk.Button(stock=Gtk.STOCK_ADD)
103 button.connect('clicked', self.__on_add_clicked)101 button.connect('clicked', self.__on_add_clicked)
104 self.bbox.pack_end(button, expand=False, fill=True, padding=0)102 self.bbox.pack_end(button, expand=False, fill=True, padding=0)
105 103
106 self.scrolledwindow1 = gtk.ScrolledWindow()104 self.scrolledwindow1 = Gtk.ScrolledWindow()
107 self.scrolledwindow1.set_shadow_type(gtk.SHADOW_ETCHED_IN)105 self.scrolledwindow1.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
108 106
109 107 self.hbox1 = Gtk.HBox()
110 self.hbox1 = gtk.HBox()108 self.label2 = Gtk.Label('Find an item to add to panel:')
111 self.label2 = gtk.Label('Find an item to add to panel:')109 self.txtSearch = Gtk.Entry()
112 self.txtSearch = gtk.Entry()110 self.txtSearch.set_icon_from_stock (Gtk.EntryIconPosition.SECONDARY, Gtk.STOCK_CLEAR)
113 self.txtSearch.set_icon_from_stock (gtk.ENTRY_ICON_SECONDARY, gtk.STOCK_CLEAR)
114 self.txtSearch.connect("changed", self.on_change)111 self.txtSearch.connect("changed", self.on_change)
115 self.txtSearch.connect("icon-press", lambda x, y, z : self.txtSearch.set_text(''))112 self.txtSearch.connect("icon-press", lambda x, y, z : self.txtSearch.set_text(''))
116 113
@@ -136,7 +133,7 @@
136 #if self.txtSearch.get_text_length()>3:133 #if self.txtSearch.get_text_length()>3:
137 self.lvwApplications.refilter()134 self.lvwApplications.refilter()
138 135
139 def match_type(self, model, iter):136 def match_type(self, model, iter, data):
140 value = model.get_value(iter, 4)137 value = model.get_value(iter, 4)
141138
142 if self.txtSearch.get_text_length() == 0:139 if self.txtSearch.get_text_length() == 0:
@@ -161,4 +158,4 @@
161 row=(pix, title, appinfo, sname.upper(),appinfo.get_id())158 row=(pix, title, appinfo, sname.upper(),appinfo.get_id())
162 self.lvwApplications.add_row(row)159 self.lvwApplications.add_row(row)
163 160
164 return
165\ No newline at end of file161\ No newline at end of file
162 return
166163
=== removed file 'unitylaunchereditor/appgui.py'
--- unitylaunchereditor/appgui.py 2011-06-07 15:07:14 +0000
+++ unitylaunchereditor/appgui.py 1970-01-01 00:00:00 +0000
@@ -1,35 +0,0 @@
1from gi.repository import Gio
2from mainwindow import MainWindow
3import os
4from gobject import GError
5
6class AppGUI:
7 """XXX: add docs."""
8
9 def __init__(self):
10 """Display the main window."""
11 self.gsettings = Gio.Settings('com.canonical.Unity.Launcher')
12 self.main_window = MainWindow(self)
13 self.main_window.show()
14 self.get_unity_list()
15
16 def save_unity_list(self, menu_items):
17 try:
18 print str(menu_items)
19 self.gsettings.set_strv('favorites', menu_items)
20 self.get_unity_list()
21 return True
22 except GError, e:
23 return False
24 #return_code = os.system('unity --reset') #subprocess.call(['unity','--reset'])
25 #if return_code != 0:
26 # print "Settings fail to transition to new unity compiz favorites"
27
28 def get_unity_list(self):
29 """ Create a list of items from unity's Launcher Panel."""
30 unity = self.gsettings.get_value('favorites')
31
32 self.main_window.load_launcher_from_list(unity)
33
34
35
360
=== modified file 'unitylaunchereditor/core/desktop.py'
--- unitylaunchereditor/core/desktop.py 2011-06-13 20:07:33 +0000
+++ unitylaunchereditor/core/desktop.py 2011-11-28 17:31:26 +0000
@@ -17,7 +17,6 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1818
19from os.path import isfile, join19from os.path import isfile, join
20import gtk
21from ConfigParser import ConfigParser20from ConfigParser import ConfigParser
2221
2322
2423
=== modified file 'unitylaunchereditor/core/iconmanager.py'
--- unitylaunchereditor/core/iconmanager.py 2011-06-07 15:07:44 +0000
+++ unitylaunchereditor/core/iconmanager.py 2011-11-28 17:31:26 +0000
@@ -17,9 +17,9 @@
17#####################################################################17#####################################################################
1818
19from gio import AppInfo, FileIcon, ThemedIcon, content_type_get_icon19from gio import AppInfo, FileIcon, ThemedIcon, content_type_get_icon
20import gobject20from gi.repository import GObject
21import gtk21from gi.repository import Gtk
22from gtk.gdk import INTERP_BILINEAR, pixbuf_new_from_file_at_size22from gi.repository.GdkPixbuf import Pixbuf
23from os import listdir23from os import listdir
24from os.path import exists, isdir, isfile, join24from os.path import exists, isdir, isfile, join
2525
@@ -27,7 +27,7 @@
2727
28class IconManager:28class IconManager:
29 def __init__(self):29 def __init__(self):
30 self.icontheme = gtk.icon_theme_get_default()30 self.icontheme = Gtk.IconTheme.get_default()
31 # add the humanity icon theme to the iconpath, as not all icon 31 # add the humanity icon theme to the iconpath, as not all icon
32 # themes contain all the icons we need32 # themes contain all the icons we need
33 # this *shouldn't* lead to any performance regressions33 # this *shouldn't* lead to any performance regressions
@@ -50,7 +50,7 @@
50 return self.get_icon_with_name('image-missing', size)50 return self.get_icon_with_name('image-missing', size)
51 51
52 if pixbuf.get_height() != size:52 if pixbuf.get_height() != size:
53 return pixbuf.scale_simple(size, size, INTERP_BILINEAR)53 return pixbuf.scale_simple(size, size, Pixbuf.INTERP_BILINEAR)
54 54
55 return pixbuf55 return pixbuf
5656
@@ -77,14 +77,14 @@
77 def mime_type_get_icon(self,mime, size = 24):77 def mime_type_get_icon(self,mime, size = 24):
78 try:78 try:
79 gicon = content_type_get_icon(mime)79 gicon = content_type_get_icon(mime)
80 iconinfo = self.icontheme.choose_icon(gicon.get_names(), size, gtk.ICON_LOOKUP_USE_BUILTIN)80 iconinfo = self.icontheme.choose_icon(gicon.get_names(), size, Gtk.IconLookupFlags.USE_BUILTIN)
81 if not iconinfo:81 if not iconinfo:
82 pixbuf = self.get_icon_with_name('application-x-executable', size)82 pixbuf = self.get_icon_with_name('application-x-executable', size)
83 else:83 else:
84 pixbuf = iconinfo.load_icon()84 pixbuf = iconinfo.load_icon()
85 85
86 if pixbuf.get_width() != size:86 if pixbuf.get_width() != size:
87 return pixbuf.scale_simple(size, size, INTERP_BILINEAR)87 return pixbuf.scale_simple(size, size, Gtk.INTERP_BILINEAR)
88 except:88 except:
89 return self.get_icon_with_name('image-missing', size)89 return self.get_icon_with_name('image-missing', size)
90 90
@@ -109,7 +109,7 @@
109 else:109 else:
110 names_list.append(name)110 names_list.append(name)
111 111
112 iconinfo = self.icontheme.choose_icon(names_list, size, gtk.ICON_LOOKUP_USE_BUILTIN)112 iconinfo = self.icontheme.choose_icon(names_list, size, Gtk.IconLookupFlags.USE_BUILTIN)
113 if not iconinfo:113 if not iconinfo:
114 return self.get_icon_with_name('application-x-executable', size)114 return self.get_icon_with_name('application-x-executable', size)
115 115
@@ -120,4 +120,4 @@
120 else:120 else:
121 return self.get_icon_with_name(app, size)121 return self.get_icon_with_name(app, size)
122 except:122 except:
123 return self.get_icon_with_name('image-missing', size)
124\ No newline at end of file123\ No newline at end of file
124 return self.get_icon_with_name('image-missing', size)
125125
=== modified file 'unitylaunchereditor/core/utils.py'
--- unitylaunchereditor/core/utils.py 2011-06-13 20:07:33 +0000
+++ unitylaunchereditor/core/utils.py 2011-11-28 17:31:26 +0000
@@ -16,9 +16,7 @@
16#16#
17#####################################################################17#####################################################################
1818
19import gtk
20import re 19import re
21from gobject import GError
22from os.path import basename, exists, expanduser, isfile, join20from os.path import basename, exists, expanduser, isfile, join
2321
24def normalize_path(str_path, exist_only = False):22def normalize_path(str_path, exist_only = False):
2523
=== removed file 'unitylaunchereditor/data/application.glade'
--- unitylaunchereditor/data/application.glade 2011-06-07 15:07:14 +0000
+++ unitylaunchereditor/data/application.glade 1970-01-01 00:00:00 +0000
@@ -1,623 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<interface>
3 <requires lib="gtk+" version="2.24"/>
4 <!-- interface-naming-policy project-wide -->
5 <object class="GtkWindow" id="window1">
6 <property name="can_focus">False</property>
7 <child>
8 <object class="GtkVBox" id="vbox1">
9 <property name="visible">True</property>
10 <property name="can_focus">False</property>
11 <property name="border_width">12</property>
12 <child>
13 <object class="GtkVBox" id="vbox2">
14 <property name="visible">True</property>
15 <property name="can_focus">False</property>
16 <child>
17 <object class="GtkHBox" id="hbox1">
18 <property name="visible">True</property>
19 <property name="can_focus">False</property>
20 <child>
21 <object class="GtkLabel" id="label1">
22 <property name="visible">True</property>
23 <property name="can_focus">False</property>
24 <property name="xalign">0</property>
25 <property name="yalign">0</property>
26 <property name="ypad">10</property>
27 <property name="label" translatable="yes">&lt;span font_size="large" color="white"&gt;&lt;b&gt;&lt;big&gt;%s&lt;/big&gt;&lt;/b&gt;&lt;/span&gt;
28&lt;span color="white"&gt;%s&lt;/span&gt;</property>
29 <property name="use_markup">True</property>
30 </object>
31 <packing>
32 <property name="expand">False</property>
33 <property name="fill">False</property>
34 <property name="padding">10</property>
35 <property name="position">0</property>
36 </packing>
37 </child>
38 <child>
39 <object class="GtkImage" id="image1">
40 <property name="visible">True</property>
41 <property name="can_focus">False</property>
42 <property name="xalign">0</property>
43 <property name="yalign">0</property>
44 <property name="stock">gtk-missing-image</property>
45 </object>
46 <packing>
47 <property name="expand">False</property>
48 <property name="fill">False</property>
49 <property name="pack_type">end</property>
50 <property name="position">1</property>
51 </packing>
52 </child>
53 </object>
54 <packing>
55 <property name="expand">False</property>
56 <property name="fill">False</property>
57 <property name="position">0</property>
58 </packing>
59 </child>
60 <child>
61 <object class="GtkHSeparator" id="hseparator1">
62 <property name="visible">True</property>
63 <property name="can_focus">False</property>
64 </object>
65 <packing>
66 <property name="expand">False</property>
67 <property name="fill">True</property>
68 <property name="position">1</property>
69 </packing>
70 </child>
71 </object>
72 <packing>
73 <property name="expand">False</property>
74 <property name="fill">True</property>
75 <property name="position">0</property>
76 </packing>
77 </child>
78 <child>
79 <object class="GtkHPaned" id="hpaned1">
80 <property name="visible">True</property>
81 <property name="can_focus">True</property>
82 <property name="position">200</property>
83 <property name="position_set">True</property>
84 <child>
85 <object class="GtkFrame" id="frame1">
86 <property name="visible">True</property>
87 <property name="can_focus">False</property>
88 <property name="label_xalign">0</property>
89 <child>
90 <object class="GtkAlignment" id="alignment4">
91 <property name="visible">True</property>
92 <property name="can_focus">False</property>
93 <property name="top_padding">5</property>
94 <property name="bottom_padding">5</property>
95 <property name="left_padding">5</property>
96 <property name="right_padding">5</property>
97 <child>
98 <object class="GtkVPaned" id="vpaned1">
99 <property name="visible">True</property>
100 <property name="can_focus">True</property>
101 <child>
102 <object class="GtkHBox" id="hbox5">
103 <property name="visible">True</property>
104 <property name="can_focus">False</property>
105 <child>
106 <object class="GtkToolbar" id="toolbar2">
107 <property name="visible">True</property>
108 <property name="can_focus">False</property>
109 <property name="orientation">vertical</property>
110 <property name="toolbar_style">icons</property>
111 <child>
112 <object class="GtkToolButton" id="cmdAdd">
113 <property name="visible">True</property>
114 <property name="can_focus">False</property>
115 <property name="use_action_appearance">False</property>
116 <property name="label" translatable="yes">toolbutton1</property>
117 <property name="use_underline">True</property>
118 <property name="stock_id">gtk-add</property>
119 </object>
120 <packing>
121 <property name="expand">False</property>
122 <property name="homogeneous">True</property>
123 </packing>
124 </child>
125 <child>
126 <object class="GtkToolButton" id="cmdRemove">
127 <property name="visible">True</property>
128 <property name="sensitive">False</property>
129 <property name="can_focus">False</property>
130 <property name="use_action_appearance">False</property>
131 <property name="label" translatable="yes">toolbutton2</property>
132 <property name="use_underline">True</property>
133 <property name="stock_id">gtk-remove</property>
134 </object>
135 <packing>
136 <property name="expand">False</property>
137 <property name="homogeneous">True</property>
138 </packing>
139 </child>
140 </object>
141 <packing>
142 <property name="expand">False</property>
143 <property name="fill">True</property>
144 <property name="position">-1</property>
145 </packing>
146 </child>
147 <child>
148 <object class="GtkScrolledWindow" id="list_container">
149 <property name="visible">True</property>
150 <property name="can_focus">True</property>
151 <property name="hscrollbar_policy">never</property>
152 <property name="vscrollbar_policy">automatic</property>
153 <child>
154 <placeholder/>
155 </child>
156 </object>
157 <packing>
158 <property name="expand">True</property>
159 <property name="fill">True</property>
160 <property name="position">1</property>
161 </packing>
162 </child>
163 </object>
164 <packing>
165 <property name="resize">False</property>
166 <property name="shrink">True</property>
167 </packing>
168 </child>
169 <child>
170 <object class="GtkViewport" id="viewport2">
171 <property name="visible">True</property>
172 <property name="can_focus">False</property>
173 <property name="shadow_type">etched-in</property>
174 <child>
175 <object class="GtkHBox" id="hbox2">
176 <property name="visible">True</property>
177 <property name="can_focus">False</property>
178 <child>
179 <object class="GtkFrame" id="frame3">
180 <property name="visible">True</property>
181 <property name="can_focus">False</property>
182 <property name="border_width">4</property>
183 <property name="label_xalign">0</property>
184 <property name="label_yalign">0</property>
185 <property name="shadow_type">none</property>
186 <child>
187 <object class="GtkAlignment" id="alignment5">
188 <property name="visible">True</property>
189 <property name="can_focus">False</property>
190 <property name="left_padding">12</property>
191 <child>
192 <object class="GtkVBox" id="vbox5">
193 <property name="visible">True</property>
194 <property name="can_focus">False</property>
195 <child>
196 <object class="GtkButton" id="cmdIcon">
197 <property name="width_request">96</property>
198 <property name="height_request">96</property>
199 <property name="visible">True</property>
200 <property name="can_focus">True</property>
201 <property name="receives_default">True</property>
202 <property name="use_action_appearance">False</property>
203 <child>
204 <object class="GtkImage" id="imgIcon">
205 <property name="visible">True</property>
206 <property name="can_focus">False</property>
207 <property name="stock">gtk-missing-image</property>
208 </object>
209 </child>
210 </object>
211 <packing>
212 <property name="expand">False</property>
213 <property name="fill">False</property>
214 <property name="position">0</property>
215 </packing>
216 </child>
217 <child>
218 <placeholder/>
219 </child>
220 </object>
221 </child>
222 </object>
223 </child>
224 </object>
225 <packing>
226 <property name="expand">False</property>
227 <property name="fill">True</property>
228 <property name="position">0</property>
229 </packing>
230 </child>
231 <child>
232 <object class="GtkFrame" id="frame4">
233 <property name="visible">True</property>
234 <property name="can_focus">False</property>
235 <property name="border_width">4</property>
236 <property name="label_xalign">0</property>
237 <property name="label_yalign">0</property>
238 <property name="shadow_type">none</property>
239 <child>
240 <object class="GtkAlignment" id="alignment6">
241 <property name="visible">True</property>
242 <property name="can_focus">False</property>
243 <property name="left_padding">12</property>
244 <child>
245 <object class="GtkTable" id="table2">
246 <property name="visible">True</property>
247 <property name="can_focus">False</property>
248 <property name="border_width">5</property>
249 <property name="n_rows">4</property>
250 <property name="n_columns">2</property>
251 <property name="column_spacing">5</property>
252 <property name="row_spacing">5</property>
253 <child>
254 <object class="GtkEntry" id="txtName">
255 <property name="visible">True</property>
256 <property name="can_focus">True</property>
257 <property name="invisible_char">•</property>
258 <property name="invisible_char_set">True</property>
259 <property name="primary_icon_activatable">False</property>
260 <property name="secondary_icon_activatable">False</property>
261 <property name="primary_icon_sensitive">True</property>
262 <property name="secondary_icon_sensitive">True</property>
263 </object>
264 <packing>
265 <property name="left_attach">1</property>
266 <property name="right_attach">2</property>
267 <property name="y_options"></property>
268 </packing>
269 </child>
270 <child>
271 <object class="GtkEventBox" id="eventbox3">
272 <property name="visible">True</property>
273 <property name="can_focus">False</property>
274 <child>
275 <object class="GtkLabel" id="label4">
276 <property name="visible">True</property>
277 <property name="can_focus">False</property>
278 <property name="xalign">0</property>
279 <property name="label" translatable="yes">Name:</property>
280 </object>
281 </child>
282 </object>
283 <packing>
284 <property name="x_options">GTK_FILL</property>
285 <property name="y_options"></property>
286 </packing>
287 </child>
288 <child>
289 <object class="GtkEventBox" id="eventbox4">
290 <property name="visible">True</property>
291 <property name="can_focus">False</property>
292 <child>
293 <object class="GtkLabel" id="label5">
294 <property name="visible">True</property>
295 <property name="can_focus">False</property>
296 <property name="xalign">0</property>
297 <property name="yalign">0</property>
298 <property name="label" translatable="yes">Command:</property>
299 </object>
300 </child>
301 </object>
302 <packing>
303 <property name="top_attach">1</property>
304 <property name="bottom_attach">2</property>
305 <property name="x_options">GTK_FILL</property>
306 <property name="y_options">GTK_FILL</property>
307 </packing>
308 </child>
309 <child>
310 <object class="GtkEventBox" id="eventbox1">
311 <property name="visible">True</property>
312 <property name="can_focus">False</property>
313 <child>
314 <object class="GtkLabel" id="label8">
315 <property name="visible">True</property>
316 <property name="can_focus">False</property>
317 <property name="xalign">0</property>
318 <property name="yalign">0</property>
319 <property name="label" translatable="yes">Comment:</property>
320 </object>
321 </child>
322 </object>
323 <packing>
324 <property name="top_attach">2</property>
325 <property name="bottom_attach">3</property>
326 <property name="x_options">GTK_FILL</property>
327 <property name="y_options">GTK_FILL</property>
328 </packing>
329 </child>
330 <child>
331 <object class="GtkEventBox" id="eventbox2">
332 <property name="visible">True</property>
333 <property name="can_focus">False</property>
334 <child>
335 <placeholder/>
336 </child>
337 </object>
338 <packing>
339 <property name="top_attach">3</property>
340 <property name="bottom_attach">4</property>
341 <property name="x_options">GTK_FILL</property>
342 <property name="y_options">GTK_FILL</property>
343 </packing>
344 </child>
345 <child>
346 <object class="GtkHBox" id="hbox4">
347 <property name="visible">True</property>
348 <property name="can_focus">False</property>
349 <child>
350 <object class="GtkEntry" id="txtCommand">
351 <property name="visible">True</property>
352 <property name="can_focus">True</property>
353 <property name="invisible_char">•</property>
354 <property name="invisible_char_set">True</property>
355 <property name="primary_icon_activatable">False</property>
356 <property name="secondary_icon_activatable">False</property>
357 <property name="primary_icon_sensitive">True</property>
358 <property name="secondary_icon_sensitive">True</property>
359 </object>
360 <packing>
361 <property name="expand">True</property>
362 <property name="fill">True</property>
363 <property name="position">0</property>
364 </packing>
365 </child>
366 <child>
367 <object class="GtkButton" id="cmdRun">
368 <property name="label" translatable="yes">...</property>
369 <property name="visible">True</property>
370 <property name="can_focus">True</property>
371 <property name="receives_default">True</property>
372 <property name="use_action_appearance">False</property>
373 </object>
374 <packing>
375 <property name="expand">False</property>
376 <property name="fill">True</property>
377 <property name="position">1</property>
378 </packing>
379 </child>
380 </object>
381 <packing>
382 <property name="left_attach">1</property>
383 <property name="right_attach">2</property>
384 <property name="top_attach">1</property>
385 <property name="bottom_attach">2</property>
386 <property name="y_options">GTK_FILL</property>
387 </packing>
388 </child>
389 <child>
390 <object class="GtkScrolledWindow" id="scrolledwindow3">
391 <property name="visible">True</property>
392 <property name="can_focus">True</property>
393 <property name="hscrollbar_policy">automatic</property>
394 <property name="vscrollbar_policy">automatic</property>
395 <property name="shadow_type">in</property>
396 <child>
397 <object class="GtkTextView" id="txtComment">
398 <property name="visible">True</property>
399 <property name="can_focus">True</property>
400 <property name="wrap_mode">word</property>
401 </object>
402 </child>
403 </object>
404 <packing>
405 <property name="left_attach">1</property>
406 <property name="right_attach">2</property>
407 <property name="top_attach">2</property>
408 <property name="bottom_attach">3</property>
409 <property name="x_options">GTK_FILL</property>
410 <property name="y_options">GTK_FILL</property>
411 </packing>
412 </child>
413 <child>
414 <object class="GtkCheckButton" id="chkTerminal">
415 <property name="label" translatable="yes">Run in terminal</property>
416 <property name="visible">True</property>
417 <property name="can_focus">True</property>
418 <property name="receives_default">False</property>
419 <property name="use_action_appearance">False</property>
420 <property name="draw_indicator">True</property>
421 </object>
422 <packing>
423 <property name="left_attach">1</property>
424 <property name="right_attach">2</property>
425 <property name="top_attach">3</property>
426 <property name="bottom_attach">4</property>
427 <property name="y_options">GTK_FILL</property>
428 </packing>
429 </child>
430 </object>
431 </child>
432 </object>
433 </child>
434 </object>
435 <packing>
436 <property name="expand">True</property>
437 <property name="fill">True</property>
438 <property name="position">1</property>
439 </packing>
440 </child>
441 </object>
442 </child>
443 </object>
444 <packing>
445 <property name="resize">False</property>
446 <property name="shrink">False</property>
447 </packing>
448 </child>
449 </object>
450 </child>
451 </object>
452 </child>
453 <child type="label">
454 <object class="GtkLabel" id="label3">
455 <property name="visible">True</property>
456 <property name="can_focus">False</property>
457 <property name="label" translatable="yes">&lt;b&gt;Launchers&lt;/b&gt;</property>
458 <property name="use_markup">True</property>
459 </object>
460 </child>
461 </object>
462 <packing>
463 <property name="resize">False</property>
464 <property name="shrink">True</property>
465 </packing>
466 </child>
467 <child>
468 <object class="GtkFrame" id="frame2">
469 <property name="visible">True</property>
470 <property name="can_focus">False</property>
471 <property name="label_xalign">0</property>
472 <child>
473 <object class="GtkAlignment" id="alignment3">
474 <property name="visible">True</property>
475 <property name="can_focus">False</property>
476 <property name="bottom_padding">9</property>
477 <property name="left_padding">6</property>
478 <property name="right_padding">9</property>
479 <child>
480 <object class="GtkVBox" id="vbox4">
481 <property name="visible">True</property>
482 <property name="can_focus">False</property>
483 <child>
484 <object class="GtkToolbar" id="toolbar1">
485 <property name="visible">True</property>
486 <property name="can_focus">False</property>
487 <child>
488 <object class="GtkToolButton" id="btnAdd">
489 <property name="visible">True</property>
490 <property name="can_focus">False</property>
491 <property name="use_action_appearance">False</property>
492 <property name="label" translatable="yes">toolbutton1</property>
493 <property name="use_underline">True</property>
494 <property name="stock_id">gtk-add</property>
495 </object>
496 <packing>
497 <property name="expand">False</property>
498 <property name="homogeneous">True</property>
499 </packing>
500 </child>
501 <child>
502 <object class="GtkToolButton" id="btnEdit">
503 <property name="visible">True</property>
504 <property name="sensitive">False</property>
505 <property name="can_focus">False</property>
506 <property name="use_action_appearance">False</property>
507 <property name="label" translatable="yes">toolbutton1</property>
508 <property name="use_underline">True</property>
509 <property name="stock_id">gtk-edit</property>
510 </object>
511 <packing>
512 <property name="expand">False</property>
513 <property name="homogeneous">True</property>
514 </packing>
515 </child>
516 <child>
517 <object class="GtkToolButton" id="btnRemove">
518 <property name="visible">True</property>
519 <property name="sensitive">False</property>
520 <property name="can_focus">False</property>
521 <property name="use_action_appearance">False</property>
522 <property name="label" translatable="yes">toolbutton2</property>
523 <property name="use_underline">True</property>
524 <property name="stock_id">gtk-remove</property>
525 </object>
526 <packing>
527 <property name="expand">False</property>
528 <property name="homogeneous">True</property>
529 </packing>
530 </child>
531 </object>
532 <packing>
533 <property name="expand">False</property>
534 <property name="fill">True</property>
535 <property name="position">0</property>
536 </packing>
537 </child>
538 <child>
539 <object class="GtkScrolledWindow" id="group_container">
540 <property name="visible">True</property>
541 <property name="can_focus">True</property>
542 <property name="hscrollbar_policy">automatic</property>
543 <property name="vscrollbar_policy">automatic</property>
544 <child>
545 <placeholder/>
546 </child>
547 </object>
548 <packing>
549 <property name="expand">True</property>
550 <property name="fill">True</property>
551 <property name="position">1</property>
552 </packing>
553 </child>
554 </object>
555 </child>
556 </object>
557 </child>
558 <child type="label">
559 <object class="GtkLabel" id="label6">
560 <property name="visible">True</property>
561 <property name="can_focus">False</property>
562 <property name="label" translatable="yes">&lt;b&gt;Quicklist Groups&lt;/b&gt;</property>
563 <property name="use_markup">True</property>
564 </object>
565 </child>
566 </object>
567 <packing>
568 <property name="resize">True</property>
569 <property name="shrink">True</property>
570 </packing>
571 </child>
572 </object>
573 <packing>
574 <property name="expand">True</property>
575 <property name="fill">True</property>
576 <property name="position">1</property>
577 </packing>
578 </child>
579 <child>
580 <object class="GtkHButtonBox" id="hbuttonbox1">
581 <property name="visible">True</property>
582 <property name="can_focus">False</property>
583 <property name="spacing">6</property>
584 <property name="layout_style">end</property>
585 <child>
586 <object class="GtkButton" id="cmdSave">
587 <property name="label" translatable="yes">Save</property>
588 <property name="visible">True</property>
589 <property name="can_focus">True</property>
590 <property name="receives_default">True</property>
591 <property name="use_action_appearance">False</property>
592 </object>
593 <packing>
594 <property name="expand">False</property>
595 <property name="fill">False</property>
596 <property name="position">0</property>
597 </packing>
598 </child>
599 <child>
600 <object class="GtkButton" id="cmdClose">
601 <property name="label" translatable="yes">Close</property>
602 <property name="visible">True</property>
603 <property name="can_focus">True</property>
604 <property name="receives_default">True</property>
605 <property name="use_action_appearance">False</property>
606 </object>
607 <packing>
608 <property name="expand">False</property>
609 <property name="fill">False</property>
610 <property name="position">1</property>
611 </packing>
612 </child>
613 </object>
614 <packing>
615 <property name="expand">False</property>
616 <property name="fill">True</property>
617 <property name="position">2</property>
618 </packing>
619 </child>
620 </object>
621 </child>
622 </object>
623</interface>
6240
=== removed file 'unitylaunchereditor/data/application.glade.old'
--- unitylaunchereditor/data/application.glade.old 2011-06-07 15:07:44 +0000
+++ unitylaunchereditor/data/application.glade.old 1970-01-01 00:00:00 +0000
@@ -1,775 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<interface>
3 <requires lib="gtk+" version="2.24"/>
4 <!-- interface-naming-policy project-wide -->
5 <object class="GtkVBox" id="add_new_laucher_box">
6 <property name="visible">True</property>
7 <property name="can_focus">False</property>
8 <property name="spacing">6</property>
9 <child>
10 <object class="GtkRadioButton" id="radiobutton1">
11 <property name="label" translatable="yes">Selecionar existente</property>
12 <property name="visible">True</property>
13 <property name="can_focus">True</property>
14 <property name="receives_default">False</property>
15 <property name="use_action_appearance">False</property>
16 <property name="active">True</property>
17 <property name="draw_indicator">True</property>
18 <property name="group">radiobutton2</property>
19 </object>
20 <packing>
21 <property name="expand">False</property>
22 <property name="fill">True</property>
23 <property name="position">0</property>
24 </packing>
25 </child>
26 <child>
27 <object class="GtkHBox" id="hbox7">
28 <property name="visible">True</property>
29 <property name="can_focus">False</property>
30 <child>
31 <object class="GtkLabel" id="label12">
32 <property name="visible">True</property>
33 <property name="can_focus">False</property>
34 <property name="label" translatable="yes">Search:</property>
35 </object>
36 <packing>
37 <property name="expand">False</property>
38 <property name="fill">False</property>
39 <property name="padding">6</property>
40 <property name="position">0</property>
41 </packing>
42 </child>
43 <child>
44 <object class="GtkEntry" id="entry2">
45 <property name="visible">True</property>
46 <property name="can_focus">True</property>
47 <property name="invisible_char">•</property>
48 <property name="invisible_char_set">True</property>
49 <property name="secondary_icon_stock">gtk-find</property>
50 <property name="primary_icon_activatable">False</property>
51 <property name="secondary_icon_activatable">True</property>
52 <property name="primary_icon_sensitive">True</property>
53 <property name="secondary_icon_sensitive">True</property>
54 <property name="secondary_icon_tooltip_text" translatable="yes">search</property>
55 </object>
56 <packing>
57 <property name="expand">True</property>
58 <property name="fill">True</property>
59 <property name="position">1</property>
60 </packing>
61 </child>
62 </object>
63 <packing>
64 <property name="expand">False</property>
65 <property name="fill">True</property>
66 <property name="position">1</property>
67 </packing>
68 </child>
69 <child>
70 <object class="GtkAlignment" id="alignment6">
71 <property name="visible">True</property>
72 <property name="can_focus">False</property>
73 <property name="top_padding">6</property>
74 <property name="bottom_padding">6</property>
75 <property name="left_padding">6</property>
76 <property name="right_padding">6</property>
77 <child>
78 <object class="GtkScrolledWindow" id="scrolledwindow4">
79 <property name="visible">True</property>
80 <property name="can_focus">True</property>
81 <property name="hscrollbar_policy">never</property>
82 <property name="vscrollbar_policy">automatic</property>
83 <property name="shadow_type">in</property>
84 <child>
85 <object class="GtkTreeView" id="lvwAddLaunchers">
86 <property name="visible">True</property>
87 <property name="can_focus">True</property>
88 <property name="reorderable">True</property>
89 <property name="search_column">1</property>
90 <property name="rubber_banding">True</property>
91 </object>
92 </child>
93 </object>
94 </child>
95 </object>
96 <packing>
97 <property name="expand">True</property>
98 <property name="fill">True</property>
99 <property name="padding">2</property>
100 <property name="position">2</property>
101 </packing>
102 </child>
103 <child>
104 <object class="GtkRadioButton" id="radiobutton2">
105 <property name="label" translatable="yes">Adicionar novo</property>
106 <property name="visible">True</property>
107 <property name="can_focus">True</property>
108 <property name="receives_default">False</property>
109 <property name="use_action_appearance">False</property>
110 <property name="xalign">0.49000000953674316</property>
111 <property name="active">True</property>
112 <property name="draw_indicator">True</property>
113 </object>
114 <packing>
115 <property name="expand">False</property>
116 <property name="fill">True</property>
117 <property name="position">3</property>
118 </packing>
119 </child>
120 <child>
121 <object class="GtkHBox" id="hbox6">
122 <property name="visible">True</property>
123 <property name="can_focus">False</property>
124 <child>
125 <object class="GtkLabel" id="label11">
126 <property name="visible">True</property>
127 <property name="can_focus">False</property>
128 <property name="label" translatable="yes">Name:</property>
129 </object>
130 <packing>
131 <property name="expand">False</property>
132 <property name="fill">False</property>
133 <property name="padding">6</property>
134 <property name="position">0</property>
135 </packing>
136 </child>
137 <child>
138 <object class="GtkEntry" id="entry1">
139 <property name="visible">True</property>
140 <property name="can_focus">True</property>
141 <property name="invisible_char">•</property>
142 <property name="invisible_char_set">True</property>
143 <property name="primary_icon_activatable">False</property>
144 <property name="secondary_icon_activatable">False</property>
145 <property name="primary_icon_sensitive">True</property>
146 <property name="secondary_icon_sensitive">True</property>
147 </object>
148 <packing>
149 <property name="expand">True</property>
150 <property name="fill">True</property>
151 <property name="position">1</property>
152 </packing>
153 </child>
154 </object>
155 <packing>
156 <property name="expand">False</property>
157 <property name="fill">True</property>
158 <property name="position">4</property>
159 </packing>
160 </child>
161 </object>
162 <object class="GtkListStore" id="liststore1"/>
163 <object class="GtkListStore" id="lstTarget">
164 <columns>
165 <!-- column-name GObject1 -->
166 <column type="GObject"/>
167 </columns>
168 </object>
169 <object class="GtkWindow" id="window1">
170 <property name="can_focus">False</property>
171 <property name="window_position">center</property>
172 <child>
173 <object class="GtkVBox" id="vbox2624">
174 <property name="visible">True</property>
175 <property name="can_focus">False</property>
176 <property name="border_width">12</property>
177 <property name="spacing">6</property>
178 <child>
179 <object class="GtkHPaned" id="hpaned2">
180 <property name="visible">True</property>
181 <property name="can_focus">True</property>
182 <property name="position">170</property>
183 <property name="position_set">True</property>
184 <child>
185 <object class="GtkVBox" id="vbox1">
186 <property name="visible">True</property>
187 <property name="can_focus">False</property>
188 <property name="spacing">6</property>
189 <child>
190 <object class="GtkLabel" id="label1">
191 <property name="visible">True</property>
192 <property name="can_focus">False</property>
193 <property name="xalign">0</property>
194 <property name="label" translatable="yes">&lt;b&gt;Launcher Items&lt;/b&gt;</property>
195 <property name="use_markup">True</property>
196 </object>
197 <packing>
198 <property name="expand">False</property>
199 <property name="fill">False</property>
200 <property name="position">0</property>
201 </packing>
202 </child>
203 <child>
204 <object class="GtkScrolledWindow" id="list_container">
205 <property name="visible">True</property>
206 <property name="can_focus">True</property>
207 <property name="hscrollbar_policy">never</property>
208 <property name="vscrollbar_policy">automatic</property>
209 <property name="shadow_type">in</property>
210 <child>
211 <placeholder/>
212 </child>
213 </object>
214 <packing>
215 <property name="expand">True</property>
216 <property name="fill">True</property>
217 <property name="position">1</property>
218 </packing>
219 </child>
220 <child>
221 <object class="GtkHButtonBox" id="hbuttonbox2">
222 <property name="visible">True</property>
223 <property name="can_focus">False</property>
224 <property name="layout_style">end</property>
225 <child>
226 <object class="GtkButton" id="cmdAdd">
227 <property name="visible">True</property>
228 <property name="can_focus">True</property>
229 <property name="receives_default">True</property>
230 <property name="use_action_appearance">False</property>
231 <child>
232 <object class="GtkImage" id="image1">
233 <property name="visible">True</property>
234 <property name="can_focus">False</property>
235 <property name="stock">gtk-add</property>
236 </object>
237 </child>
238 </object>
239 <packing>
240 <property name="expand">False</property>
241 <property name="fill">False</property>
242 <property name="position">0</property>
243 </packing>
244 </child>
245 <child>
246 <object class="GtkButton" id="cmdRemove">
247 <property name="visible">True</property>
248 <property name="can_focus">True</property>
249 <property name="receives_default">True</property>
250 <property name="use_action_appearance">False</property>
251 <child>
252 <object class="GtkImage" id="image2">
253 <property name="visible">True</property>
254 <property name="can_focus">False</property>
255 <property name="stock">gtk-remove</property>
256 </object>
257 </child>
258 </object>
259 <packing>
260 <property name="expand">False</property>
261 <property name="fill">False</property>
262 <property name="position">1</property>
263 </packing>
264 </child>
265 </object>
266 <packing>
267 <property name="expand">False</property>
268 <property name="fill">True</property>
269 <property name="position">2</property>
270 </packing>
271 </child>
272 </object>
273 <packing>
274 <property name="resize">False</property>
275 <property name="shrink">True</property>
276 </packing>
277 </child>
278 <child>
279 <object class="GtkVBox" id="vbox2">
280 <property name="visible">True</property>
281 <property name="can_focus">False</property>
282 <property name="spacing">6</property>
283 <child>
284 <object class="GtkLabel" id="Properties">
285 <property name="visible">True</property>
286 <property name="can_focus">False</property>
287 <property name="xalign">0</property>
288 <property name="label" translatable="yes">&lt;b&gt;Properties&lt;/b&gt;</property>
289 <property name="use_markup">True</property>
290 </object>
291 <packing>
292 <property name="expand">False</property>
293 <property name="fill">False</property>
294 <property name="position">0</property>
295 </packing>
296 </child>
297 <child>
298 <object class="GtkVBox" id="vbox3">
299 <property name="visible">True</property>
300 <property name="can_focus">False</property>
301 <child>
302 <object class="GtkHBox" id="hbox2">
303 <property name="visible">True</property>
304 <property name="can_focus">False</property>
305 <child>
306 <object class="GtkFrame" id="frame3">
307 <property name="visible">True</property>
308 <property name="can_focus">False</property>
309 <property name="border_width">4</property>
310 <property name="label_xalign">0</property>
311 <property name="label_yalign">0</property>
312 <property name="shadow_type">none</property>
313 <child>
314 <object class="GtkAlignment" id="alignment4">
315 <property name="visible">True</property>
316 <property name="can_focus">False</property>
317 <property name="left_padding">12</property>
318 <child>
319 <object class="GtkHBox" id="hbox1">
320 <property name="visible">True</property>
321 <property name="can_focus">False</property>
322 <child>
323 <object class="GtkLabel" id="label7">
324 <property name="visible">True</property>
325 <property name="can_focus">False</property>
326 <property name="xalign">0</property>
327 <property name="yalign">0</property>
328 <property name="label" translatable="yes">Icon:</property>
329 </object>
330 <packing>
331 <property name="expand">True</property>
332 <property name="fill">True</property>
333 <property name="position">0</property>
334 </packing>
335 </child>
336 <child>
337 <object class="GtkVBox" id="vbox5">
338 <property name="visible">True</property>
339 <property name="can_focus">False</property>
340 <child>
341 <object class="GtkButton" id="cmdIcon">
342 <property name="width_request">96</property>
343 <property name="height_request">96</property>
344 <property name="visible">True</property>
345 <property name="can_focus">True</property>
346 <property name="receives_default">True</property>
347 <property name="use_action_appearance">False</property>
348 <child>
349 <object class="GtkImage" id="imgIcon">
350 <property name="visible">True</property>
351 <property name="can_focus">False</property>
352 <property name="stock">gtk-missing-image</property>
353 </object>
354 </child>
355 </object>
356 <packing>
357 <property name="expand">False</property>
358 <property name="fill">False</property>
359 <property name="position">0</property>
360 </packing>
361 </child>
362 <child>
363 <placeholder/>
364 </child>
365 </object>
366 <packing>
367 <property name="expand">False</property>
368 <property name="fill">False</property>
369 <property name="position">1</property>
370 </packing>
371 </child>
372 </object>
373 </child>
374 </object>
375 </child>
376 </object>
377 <packing>
378 <property name="expand">False</property>
379 <property name="fill">True</property>
380 <property name="position">0</property>
381 </packing>
382 </child>
383 <child>
384 <object class="GtkFrame" id="frame1">
385 <property name="visible">True</property>
386 <property name="can_focus">False</property>
387 <property name="border_width">4</property>
388 <property name="label_xalign">0</property>
389 <property name="label_yalign">0</property>
390 <property name="shadow_type">none</property>
391 <child>
392 <object class="GtkAlignment" id="alignment2">
393 <property name="visible">True</property>
394 <property name="can_focus">False</property>
395 <property name="left_padding">12</property>
396 <child>
397 <object class="GtkTable" id="table2">
398 <property name="visible">True</property>
399 <property name="can_focus">False</property>
400 <property name="border_width">5</property>
401 <property name="n_rows">4</property>
402 <property name="n_columns">2</property>
403 <property name="column_spacing">5</property>
404 <property name="row_spacing">5</property>
405 <child>
406 <object class="GtkEntry" id="txtName">
407 <property name="visible">True</property>
408 <property name="can_focus">True</property>
409 <property name="invisible_char">•</property>
410 <property name="invisible_char_set">True</property>
411 <property name="primary_icon_activatable">False</property>
412 <property name="secondary_icon_activatable">False</property>
413 <property name="primary_icon_sensitive">True</property>
414 <property name="secondary_icon_sensitive">True</property>
415 </object>
416 <packing>
417 <property name="left_attach">1</property>
418 <property name="right_attach">2</property>
419 <property name="y_options"></property>
420 </packing>
421 </child>
422 <child>
423 <object class="GtkEventBox" id="eventbox3">
424 <property name="visible">True</property>
425 <property name="can_focus">False</property>
426 <child>
427 <object class="GtkLabel" id="label2">
428 <property name="visible">True</property>
429 <property name="can_focus">False</property>
430 <property name="xalign">0</property>
431 <property name="label" translatable="yes">Name:</property>
432 </object>
433 </child>
434 </object>
435 <packing>
436 <property name="x_options">GTK_FILL</property>
437 <property name="y_options"></property>
438 </packing>
439 </child>
440 <child>
441 <object class="GtkEventBox" id="eventbox4">
442 <property name="visible">True</property>
443 <property name="can_focus">False</property>
444 <child>
445 <object class="GtkLabel" id="label4">
446 <property name="visible">True</property>
447 <property name="can_focus">False</property>
448 <property name="xalign">0</property>
449 <property name="label" translatable="yes">Command:</property>
450 </object>
451 </child>
452 </object>
453 <packing>
454 <property name="top_attach">1</property>
455 <property name="bottom_attach">2</property>
456 <property name="x_options">GTK_FILL</property>
457 <property name="y_options">GTK_FILL</property>
458 </packing>
459 </child>
460 <child>
461 <object class="GtkEventBox" id="eventbox1">
462 <property name="visible">True</property>
463 <property name="can_focus">False</property>
464 <child>
465 <object class="GtkLabel" id="label5">
466 <property name="visible">True</property>
467 <property name="can_focus">False</property>
468 <property name="xalign">0</property>
469 <property name="yalign">0</property>
470 <property name="label" translatable="yes">Comment:</property>
471 </object>
472 </child>
473 </object>
474 <packing>
475 <property name="top_attach">2</property>
476 <property name="bottom_attach">3</property>
477 <property name="x_options">GTK_FILL</property>
478 <property name="y_options">GTK_FILL</property>
479 </packing>
480 </child>
481 <child>
482 <object class="GtkEventBox" id="eventbox2">
483 <property name="visible">True</property>
484 <property name="can_focus">False</property>
485 <child>
486 <placeholder/>
487 </child>
488 </object>
489 <packing>
490 <property name="top_attach">3</property>
491 <property name="bottom_attach">4</property>
492 <property name="x_options">GTK_FILL</property>
493 <property name="y_options">GTK_FILL</property>
494 </packing>
495 </child>
496 <child>
497 <object class="GtkHBox" id="hbox3">
498 <property name="visible">True</property>
499 <property name="can_focus">False</property>
500 <child>
501 <object class="GtkEntry" id="txtCommand">
502 <property name="visible">True</property>
503 <property name="can_focus">True</property>
504 <property name="invisible_char">•</property>
505 <property name="invisible_char_set">True</property>
506 <property name="primary_icon_activatable">False</property>
507 <property name="secondary_icon_activatable">False</property>
508 <property name="primary_icon_sensitive">True</property>
509 <property name="secondary_icon_sensitive">True</property>
510 </object>
511 <packing>
512 <property name="expand">True</property>
513 <property name="fill">True</property>
514 <property name="position">0</property>
515 </packing>
516 </child>
517 <child>
518 <object class="GtkButton" id="cmdRun">
519 <property name="label" translatable="yes">...</property>
520 <property name="visible">True</property>
521 <property name="can_focus">True</property>
522 <property name="receives_default">True</property>
523 <property name="use_action_appearance">False</property>
524 </object>
525 <packing>
526 <property name="expand">False</property>
527 <property name="fill">True</property>
528 <property name="position">1</property>
529 </packing>
530 </child>
531 </object>
532 <packing>
533 <property name="left_attach">1</property>
534 <property name="right_attach">2</property>
535 <property name="top_attach">1</property>
536 <property name="bottom_attach">2</property>
537 </packing>
538 </child>
539 <child>
540 <object class="GtkScrolledWindow" id="scrolledwindow3">
541 <property name="visible">True</property>
542 <property name="can_focus">True</property>
543 <property name="hscrollbar_policy">automatic</property>
544 <property name="vscrollbar_policy">automatic</property>
545 <property name="shadow_type">in</property>
546 <child>
547 <object class="GtkTextView" id="txtComment">
548 <property name="visible">True</property>
549 <property name="can_focus">True</property>
550 <property name="wrap_mode">word</property>
551 </object>
552 </child>
553 </object>
554 <packing>
555 <property name="left_attach">1</property>
556 <property name="right_attach">2</property>
557 <property name="top_attach">2</property>
558 <property name="bottom_attach">3</property>
559 <property name="x_options">GTK_FILL</property>
560 <property name="y_options">GTK_FILL</property>
561 </packing>
562 </child>
563 <child>
564 <object class="GtkCheckButton" id="chkTerminal">
565 <property name="label" translatable="yes">Run in terminal</property>
566 <property name="visible">True</property>
567 <property name="can_focus">True</property>
568 <property name="receives_default">False</property>
569 <property name="use_action_appearance">False</property>
570 <property name="draw_indicator">True</property>
571 </object>
572 <packing>
573 <property name="left_attach">1</property>
574 <property name="right_attach">2</property>
575 <property name="top_attach">3</property>
576 <property name="bottom_attach">4</property>
577 <property name="y_options">GTK_FILL</property>
578 </packing>
579 </child>
580 </object>
581 </child>
582 </object>
583 </child>
584 </object>
585 <packing>
586 <property name="expand">True</property>
587 <property name="fill">True</property>
588 <property name="position">1</property>
589 </packing>
590 </child>
591 </object>
592 <packing>
593 <property name="expand">False</property>
594 <property name="fill">False</property>
595 <property name="position">0</property>
596 </packing>
597 </child>
598 <child>
599 <object class="GtkFrame" id="frame2">
600 <property name="visible">True</property>
601 <property name="can_focus">False</property>
602 <property name="label_xalign">0</property>
603 <child>
604 <object class="GtkAlignment" id="alignment3">
605 <property name="visible">True</property>
606 <property name="can_focus">False</property>
607 <property name="bottom_padding">9</property>
608 <property name="left_padding">6</property>
609 <property name="right_padding">9</property>
610 <child>
611 <object class="GtkVBox" id="vbox4">
612 <property name="visible">True</property>
613 <property name="can_focus">False</property>
614 <child>
615 <object class="GtkToolbar" id="toolbar1">
616 <property name="visible">True</property>
617 <property name="can_focus">False</property>
618 <child>
619 <object class="GtkToolButton" id="btnAdd">
620 <property name="visible">True</property>
621 <property name="can_focus">False</property>
622 <property name="use_action_appearance">False</property>
623 <property name="label" translatable="yes">toolbutton1</property>
624 <property name="use_underline">True</property>
625 <property name="stock_id">gtk-add</property>
626 </object>
627 <packing>
628 <property name="expand">False</property>
629 <property name="homogeneous">True</property>
630 </packing>
631 </child>
632 <child>
633 <object class="GtkToolButton" id="btnEdit">
634 <property name="visible">True</property>
635 <property name="sensitive">False</property>
636 <property name="can_focus">False</property>
637 <property name="use_action_appearance">False</property>
638 <property name="label" translatable="yes">toolbutton1</property>
639 <property name="use_underline">True</property>
640 <property name="stock_id">gtk-edit</property>
641 </object>
642 <packing>
643 <property name="expand">False</property>
644 <property name="homogeneous">True</property>
645 </packing>
646 </child>
647 <child>
648 <object class="GtkToolButton" id="btnRemove">
649 <property name="visible">True</property>
650 <property name="sensitive">False</property>
651 <property name="can_focus">False</property>
652 <property name="use_action_appearance">False</property>
653 <property name="label" translatable="yes">toolbutton2</property>
654 <property name="use_underline">True</property>
655 <property name="stock_id">gtk-remove</property>
656 </object>
657 <packing>
658 <property name="expand">False</property>
659 <property name="homogeneous">True</property>
660 </packing>
661 </child>
662 </object>
663 <packing>
664 <property name="expand">False</property>
665 <property name="fill">True</property>
666 <property name="position">0</property>
667 </packing>
668 </child>
669 <child>
670 <object class="GtkScrolledWindow" id="group_container">
671 <property name="visible">True</property>
672 <property name="can_focus">True</property>
673 <property name="hscrollbar_policy">automatic</property>
674 <property name="vscrollbar_policy">automatic</property>
675 <child>
676 <placeholder/>
677 </child>
678 </object>
679 <packing>
680 <property name="expand">True</property>
681 <property name="fill">True</property>
682 <property name="position">1</property>
683 </packing>
684 </child>
685 </object>
686 </child>
687 </object>
688 </child>
689 <child type="label">
690 <object class="GtkLabel" id="label6">
691 <property name="visible">True</property>
692 <property name="can_focus">False</property>
693 <property name="label" translatable="yes">&lt;b&gt;Quicklist Groups&lt;/b&gt;</property>
694 <property name="use_markup">True</property>
695 </object>
696 </child>
697 </object>
698 <packing>
699 <property name="expand">True</property>
700 <property name="fill">True</property>
701 <property name="position">1</property>
702 </packing>
703 </child>
704 </object>
705 <packing>
706 <property name="expand">True</property>
707 <property name="fill">True</property>
708 <property name="position">1</property>
709 </packing>
710 </child>
711 <child>
712 <object class="GtkAlignment" id="alignment1">
713 <property name="visible">True</property>
714 <property name="can_focus">False</property>
715 <property name="xalign">0</property>
716 <child>
717 <object class="GtkHButtonBox" id="hbuttonbox1">
718 <property name="visible">True</property>
719 <property name="can_focus">False</property>
720 <property name="layout_style">end</property>
721 <child>
722 <object class="GtkButton" id="cmdSave">
723 <property name="label">gtk-save</property>
724 <property name="visible">True</property>
725 <property name="can_focus">True</property>
726 <property name="receives_default">True</property>
727 <property name="use_action_appearance">False</property>
728 <property name="use_stock">True</property>
729 </object>
730 <packing>
731 <property name="expand">False</property>
732 <property name="fill">False</property>
733 <property name="position">0</property>
734 </packing>
735 </child>
736 <child>
737 <object class="GtkButton" id="cmdClose">
738 <property name="label" translatable="yes">Close</property>
739 <property name="visible">True</property>
740 <property name="can_focus">True</property>
741 <property name="receives_default">True</property>
742 <property name="use_action_appearance">False</property>
743 </object>
744 <packing>
745 <property name="expand">False</property>
746 <property name="fill">False</property>
747 <property name="position">1</property>
748 </packing>
749 </child>
750 </object>
751 </child>
752 </object>
753 <packing>
754 <property name="expand">False</property>
755 <property name="fill">True</property>
756 <property name="position">2</property>
757 </packing>
758 </child>
759 </object>
760 <packing>
761 <property name="resize">True</property>
762 <property name="shrink">True</property>
763 </packing>
764 </child>
765 </object>
766 <packing>
767 <property name="expand">True</property>
768 <property name="fill">True</property>
769 <property name="position">0</property>
770 </packing>
771 </child>
772 </object>
773 </child>
774 </object>
775</interface>
7760
=== removed file 'unitylaunchereditor/data/application2.glade'
--- unitylaunchereditor/data/application2.glade 2011-06-07 15:07:44 +0000
+++ unitylaunchereditor/data/application2.glade 1970-01-01 00:00:00 +0000
@@ -1,645 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<interface>
3 <requires lib="gtk+" version="2.24"/>
4 <!-- interface-naming-policy project-wide -->
5 <object class="GtkWindow" id="window1">
6 <property name="can_focus">False</property>
7 <child>
8 <object class="GtkVBox" id="vbox1">
9 <property name="visible">True</property>
10 <property name="can_focus">False</property>
11 <property name="border_width">12</property>
12 <child>
13 <object class="GtkHBox" id="hbox1">
14 <property name="visible">True</property>
15 <property name="can_focus">False</property>
16 <child>
17 <object class="GtkVBox" id="vbox2">
18 <property name="visible">True</property>
19 <property name="can_focus">False</property>
20 <child>
21 <object class="GtkLabel" id="label1">
22 <property name="visible">True</property>
23 <property name="can_focus">False</property>
24 <property name="xalign">0</property>
25 <property name="yalign">0</property>
26 <property name="xpad">12</property>
27 <property name="label" translatable="yes">&lt;span font_size="large" color="white"&gt;&lt;b&gt;&lt;big&gt;Create a Launcher&lt;/big&gt;&lt;/b&gt;&lt;/span&gt;</property>
28 <property name="use_markup">True</property>
29 </object>
30 <packing>
31 <property name="expand">False</property>
32 <property name="fill">True</property>
33 <property name="position">0</property>
34 </packing>
35 </child>
36 <child>
37 <object class="GtkLabel" id="label2">
38 <property name="visible">True</property>
39 <property name="can_focus">False</property>
40 <property name="xalign">0.059999998658895493</property>
41 <property name="xpad">12</property>
42 <property name="label" translatable="yes">&lt;span color="white"&gt;Create a Launcher item using an application installed on your system&lt;/span&gt;</property>
43 <property name="use_markup">True</property>
44 </object>
45 <packing>
46 <property name="expand">False</property>
47 <property name="fill">True</property>
48 <property name="position">1</property>
49 </packing>
50 </child>
51 </object>
52 <packing>
53 <property name="expand">False</property>
54 <property name="fill">True</property>
55 <property name="position">0</property>
56 </packing>
57 </child>
58 <child>
59 <object class="GtkAlignment" id="alignment1">
60 <property name="visible">True</property>
61 <property name="can_focus">False</property>
62 <child>
63 <object class="GtkImage" id="image1">
64 <property name="visible">True</property>
65 <property name="can_focus">False</property>
66 <property name="xalign">0</property>
67 <property name="stock">gtk-missing-image</property>
68 <property name="icon-size">6</property>
69 </object>
70 </child>
71 </object>
72 <packing>
73 <property name="expand">False</property>
74 <property name="fill">True</property>
75 <property name="padding">15</property>
76 <property name="pack_type">end</property>
77 <property name="position">1</property>
78 </packing>
79 </child>
80 </object>
81 <packing>
82 <property name="expand">False</property>
83 <property name="fill">False</property>
84 <property name="position">0</property>
85 </packing>
86 </child>
87 <child>
88 <object class="GtkHSeparator" id="hseparator1">
89 <property name="height_request">50</property>
90 <property name="visible">True</property>
91 <property name="can_focus">False</property>
92 </object>
93 <packing>
94 <property name="expand">False</property>
95 <property name="fill">False</property>
96 <property name="position">1</property>
97 </packing>
98 </child>
99 <child>
100 <object class="GtkHPaned" id="hpaned1">
101 <property name="visible">True</property>
102 <property name="can_focus">True</property>
103 <property name="position">200</property>
104 <property name="position_set">True</property>
105 <child>
106 <object class="GtkVPaned" id="vpaned1">
107 <property name="visible">True</property>
108 <property name="can_focus">True</property>
109 <child>
110 <object class="GtkHBox" id="hbox5">
111 <property name="visible">True</property>
112 <property name="can_focus">False</property>
113 <child>
114 <object class="GtkScrolledWindow" id="list_container">
115 <property name="visible">True</property>
116 <property name="can_focus">True</property>
117 <property name="hscrollbar_policy">never</property>
118 <property name="vscrollbar_policy">automatic</property>
119 <property name="shadow_type">in</property>
120 <child>
121 <placeholder/>
122 </child>
123 </object>
124 <packing>
125 <property name="expand">True</property>
126 <property name="fill">True</property>
127 <property name="position">0</property>
128 </packing>
129 </child>
130 <child>
131 <object class="GtkToolbar" id="toolbar2">
132 <property name="visible">True</property>
133 <property name="can_focus">False</property>
134 <property name="orientation">vertical</property>
135 <property name="toolbar_style">icons</property>
136 <child>
137 <object class="GtkToolButton" id="btnAdd1">
138 <property name="visible">True</property>
139 <property name="can_focus">False</property>
140 <property name="use_action_appearance">False</property>
141 <property name="label" translatable="yes">toolbutton1</property>
142 <property name="use_underline">True</property>
143 <property name="stock_id">gtk-add</property>
144 </object>
145 <packing>
146 <property name="expand">False</property>
147 <property name="homogeneous">True</property>
148 </packing>
149 </child>
150 <child>
151 <object class="GtkToolButton" id="btnRemove1">
152 <property name="visible">True</property>
153 <property name="sensitive">False</property>
154 <property name="can_focus">False</property>
155 <property name="use_action_appearance">False</property>
156 <property name="label" translatable="yes">toolbutton2</property>
157 <property name="use_underline">True</property>
158 <property name="stock_id">gtk-remove</property>
159 </object>
160 <packing>
161 <property name="expand">False</property>
162 <property name="homogeneous">True</property>
163 </packing>
164 </child>
165 </object>
166 <packing>
167 <property name="expand">False</property>
168 <property name="fill">True</property>
169 <property name="position">1</property>
170 </packing>
171 </child>
172 </object>
173 <packing>
174 <property name="resize">False</property>
175 <property name="shrink">True</property>
176 </packing>
177 </child>
178 <child>
179 <object class="GtkViewport" id="viewport2">
180 <property name="visible">True</property>
181 <property name="can_focus">False</property>
182 <property name="shadow_type">etched-in</property>
183 <child>
184 <object class="GtkHBox" id="hbox2">
185 <property name="visible">True</property>
186 <property name="can_focus">False</property>
187 <child>
188 <object class="GtkFrame" id="frame3">
189 <property name="visible">True</property>
190 <property name="can_focus">False</property>
191 <property name="border_width">4</property>
192 <property name="label_xalign">0</property>
193 <property name="label_yalign">0</property>
194 <property name="shadow_type">none</property>
195 <child>
196 <object class="GtkAlignment" id="alignment4">
197 <property name="visible">True</property>
198 <property name="can_focus">False</property>
199 <property name="left_padding">12</property>
200 <child>
201 <object class="GtkHBox" id="hbox3">
202 <property name="visible">True</property>
203 <property name="can_focus">False</property>
204 <child>
205 <object class="GtkLabel" id="label7">
206 <property name="visible">True</property>
207 <property name="can_focus">False</property>
208 <property name="xalign">0</property>
209 <property name="yalign">0</property>
210 <property name="label" translatable="yes">Icon:</property>
211 </object>
212 <packing>
213 <property name="expand">True</property>
214 <property name="fill">True</property>
215 <property name="position">0</property>
216 </packing>
217 </child>
218 <child>
219 <object class="GtkVBox" id="vbox5">
220 <property name="visible">True</property>
221 <property name="can_focus">False</property>
222 <child>
223 <object class="GtkButton" id="cmdIcon">
224 <property name="width_request">96</property>
225 <property name="height_request">96</property>
226 <property name="visible">True</property>
227 <property name="can_focus">True</property>
228 <property name="receives_default">True</property>
229 <property name="use_action_appearance">False</property>
230 <child>
231 <object class="GtkImage" id="imgIcon">
232 <property name="visible">True</property>
233 <property name="can_focus">False</property>
234 <property name="stock">gtk-missing-image</property>
235 </object>
236 </child>
237 </object>
238 <packing>
239 <property name="expand">False</property>
240 <property name="fill">False</property>
241 <property name="position">0</property>
242 </packing>
243 </child>
244 <child>
245 <placeholder/>
246 </child>
247 </object>
248 <packing>
249 <property name="expand">False</property>
250 <property name="fill">False</property>
251 <property name="position">1</property>
252 </packing>
253 </child>
254 </object>
255 </child>
256 </object>
257 </child>
258 </object>
259 <packing>
260 <property name="expand">False</property>
261 <property name="fill">True</property>
262 <property name="position">0</property>
263 </packing>
264 </child>
265 <child>
266 <object class="GtkFrame" id="frame1">
267 <property name="visible">True</property>
268 <property name="can_focus">False</property>
269 <property name="border_width">4</property>
270 <property name="label_xalign">0</property>
271 <property name="label_yalign">0</property>
272 <property name="shadow_type">none</property>
273 <child>
274 <object class="GtkAlignment" id="alignment2">
275 <property name="visible">True</property>
276 <property name="can_focus">False</property>
277 <property name="left_padding">12</property>
278 <child>
279 <object class="GtkTable" id="table2">
280 <property name="visible">True</property>
281 <property name="can_focus">False</property>
282 <property name="border_width">5</property>
283 <property name="n_rows">4</property>
284 <property name="n_columns">2</property>
285 <property name="column_spacing">5</property>
286 <property name="row_spacing">5</property>
287 <child>
288 <object class="GtkEntry" id="txtName">
289 <property name="visible">True</property>
290 <property name="can_focus">True</property>
291 <property name="invisible_char">•</property>
292 <property name="invisible_char_set">True</property>
293 <property name="primary_icon_activatable">False</property>
294 <property name="secondary_icon_activatable">False</property>
295 <property name="primary_icon_sensitive">True</property>
296 <property name="secondary_icon_sensitive">True</property>
297 </object>
298 <packing>
299 <property name="left_attach">1</property>
300 <property name="right_attach">2</property>
301 <property name="y_options"></property>
302 </packing>
303 </child>
304 <child>
305 <object class="GtkEventBox" id="eventbox3">
306 <property name="visible">True</property>
307 <property name="can_focus">False</property>
308 <child>
309 <object class="GtkLabel" id="label3">
310 <property name="visible">True</property>
311 <property name="can_focus">False</property>
312 <property name="xalign">0</property>
313 <property name="label" translatable="yes">Name:</property>
314 </object>
315 </child>
316 </object>
317 <packing>
318 <property name="x_options">GTK_FILL</property>
319 <property name="y_options"></property>
320 </packing>
321 </child>
322 <child>
323 <object class="GtkEventBox" id="eventbox4">
324 <property name="visible">True</property>
325 <property name="can_focus">False</property>
326 <child>
327 <object class="GtkLabel" id="label4">
328 <property name="visible">True</property>
329 <property name="can_focus">False</property>
330 <property name="xalign">0</property>
331 <property name="yalign">0</property>
332 <property name="label" translatable="yes">Command:</property>
333 </object>
334 </child>
335 </object>
336 <packing>
337 <property name="top_attach">1</property>
338 <property name="bottom_attach">2</property>
339 <property name="x_options">GTK_FILL</property>
340 <property name="y_options">GTK_FILL</property>
341 </packing>
342 </child>
343 <child>
344 <object class="GtkEventBox" id="eventbox1">
345 <property name="visible">True</property>
346 <property name="can_focus">False</property>
347 <child>
348 <object class="GtkLabel" id="label5">
349 <property name="visible">True</property>
350 <property name="can_focus">False</property>
351 <property name="xalign">0</property>
352 <property name="yalign">0</property>
353 <property name="label" translatable="yes">Comment:</property>
354 </object>
355 </child>
356 </object>
357 <packing>
358 <property name="top_attach">2</property>
359 <property name="bottom_attach">3</property>
360 <property name="x_options">GTK_FILL</property>
361 <property name="y_options">GTK_FILL</property>
362 </packing>
363 </child>
364 <child>
365 <object class="GtkEventBox" id="eventbox2">
366 <property name="visible">True</property>
367 <property name="can_focus">False</property>
368 <child>
369 <placeholder/>
370 </child>
371 </object>
372 <packing>
373 <property name="top_attach">3</property>
374 <property name="bottom_attach">4</property>
375 <property name="x_options">GTK_FILL</property>
376 <property name="y_options">GTK_FILL</property>
377 </packing>
378 </child>
379 <child>
380 <object class="GtkHBox" id="hbox4">
381 <property name="visible">True</property>
382 <property name="can_focus">False</property>
383 <child>
384 <object class="GtkEntry" id="txtCommand">
385 <property name="visible">True</property>
386 <property name="can_focus">True</property>
387 <property name="invisible_char">•</property>
388 <property name="invisible_char_set">True</property>
389 <property name="primary_icon_activatable">False</property>
390 <property name="secondary_icon_activatable">False</property>
391 <property name="primary_icon_sensitive">True</property>
392 <property name="secondary_icon_sensitive">True</property>
393 </object>
394 <packing>
395 <property name="expand">True</property>
396 <property name="fill">True</property>
397 <property name="position">0</property>
398 </packing>
399 </child>
400 <child>
401 <object class="GtkButton" id="cmdRun">
402 <property name="label" translatable="yes">...</property>
403 <property name="visible">True</property>
404 <property name="can_focus">True</property>
405 <property name="receives_default">True</property>
406 <property name="use_action_appearance">False</property>
407 </object>
408 <packing>
409 <property name="expand">False</property>
410 <property name="fill">True</property>
411 <property name="position">1</property>
412 </packing>
413 </child>
414 </object>
415 <packing>
416 <property name="left_attach">1</property>
417 <property name="right_attach">2</property>
418 <property name="top_attach">1</property>
419 <property name="bottom_attach">2</property>
420 <property name="y_options">GTK_FILL</property>
421 </packing>
422 </child>
423 <child>
424 <object class="GtkScrolledWindow" id="scrolledwindow3">
425 <property name="visible">True</property>
426 <property name="can_focus">True</property>
427 <property name="hscrollbar_policy">automatic</property>
428 <property name="vscrollbar_policy">automatic</property>
429 <property name="shadow_type">in</property>
430 <child>
431 <object class="GtkTextView" id="txtComment">
432 <property name="visible">True</property>
433 <property name="can_focus">True</property>
434 <property name="wrap_mode">word</property>
435 </object>
436 </child>
437 </object>
438 <packing>
439 <property name="left_attach">1</property>
440 <property name="right_attach">2</property>
441 <property name="top_attach">2</property>
442 <property name="bottom_attach">3</property>
443 <property name="x_options">GTK_FILL</property>
444 <property name="y_options">GTK_FILL</property>
445 </packing>
446 </child>
447 <child>
448 <object class="GtkCheckButton" id="chkTerminal">
449 <property name="label" translatable="yes">Run in terminal</property>
450 <property name="visible">True</property>
451 <property name="can_focus">True</property>
452 <property name="receives_default">False</property>
453 <property name="use_action_appearance">False</property>
454 <property name="draw_indicator">True</property>
455 </object>
456 <packing>
457 <property name="left_attach">1</property>
458 <property name="right_attach">2</property>
459 <property name="top_attach">3</property>
460 <property name="bottom_attach">4</property>
461 <property name="y_options">GTK_FILL</property>
462 </packing>
463 </child>
464 </object>
465 </child>
466 </object>
467 </child>
468 </object>
469 <packing>
470 <property name="expand">True</property>
471 <property name="fill">True</property>
472 <property name="position">1</property>
473 </packing>
474 </child>
475 </object>
476 </child>
477 </object>
478 <packing>
479 <property name="resize">True</property>
480 <property name="shrink">True</property>
481 </packing>
482 </child>
483 </object>
484 <packing>
485 <property name="resize">False</property>
486 <property name="shrink">True</property>
487 </packing>
488 </child>
489 <child>
490 <object class="GtkFrame" id="frame2">
491 <property name="visible">True</property>
492 <property name="can_focus">False</property>
493 <property name="label_xalign">0</property>
494 <child>
495 <object class="GtkAlignment" id="alignment3">
496 <property name="visible">True</property>
497 <property name="can_focus">False</property>
498 <property name="bottom_padding">9</property>
499 <property name="left_padding">6</property>
500 <property name="right_padding">9</property>
501 <child>
502 <object class="GtkVBox" id="vbox4">
503 <property name="visible">True</property>
504 <property name="can_focus">False</property>
505 <child>
506 <object class="GtkToolbar" id="toolbar1">
507 <property name="visible">True</property>
508 <property name="can_focus">False</property>
509 <child>
510 <object class="GtkToolButton" id="btnAdd">
511 <property name="visible">True</property>
512 <property name="can_focus">False</property>
513 <property name="use_action_appearance">False</property>
514 <property name="label" translatable="yes">toolbutton1</property>
515 <property name="use_underline">True</property>
516 <property name="stock_id">gtk-add</property>
517 </object>
518 <packing>
519 <property name="expand">False</property>
520 <property name="homogeneous">True</property>
521 </packing>
522 </child>
523 <child>
524 <object class="GtkToolButton" id="btnEdit">
525 <property name="visible">True</property>
526 <property name="sensitive">False</property>
527 <property name="can_focus">False</property>
528 <property name="use_action_appearance">False</property>
529 <property name="label" translatable="yes">toolbutton1</property>
530 <property name="use_underline">True</property>
531 <property name="stock_id">gtk-edit</property>
532 </object>
533 <packing>
534 <property name="expand">False</property>
535 <property name="homogeneous">True</property>
536 </packing>
537 </child>
538 <child>
539 <object class="GtkToolButton" id="btnRemove">
540 <property name="visible">True</property>
541 <property name="sensitive">False</property>
542 <property name="can_focus">False</property>
543 <property name="use_action_appearance">False</property>
544 <property name="label" translatable="yes">toolbutton2</property>
545 <property name="use_underline">True</property>
546 <property name="stock_id">gtk-remove</property>
547 </object>
548 <packing>
549 <property name="expand">False</property>
550 <property name="homogeneous">True</property>
551 </packing>
552 </child>
553 </object>
554 <packing>
555 <property name="expand">False</property>
556 <property name="fill">True</property>
557 <property name="position">0</property>
558 </packing>
559 </child>
560 <child>
561 <object class="GtkScrolledWindow" id="group_container">
562 <property name="visible">True</property>
563 <property name="can_focus">True</property>
564 <property name="hscrollbar_policy">automatic</property>
565 <property name="vscrollbar_policy">automatic</property>
566 <child>
567 <placeholder/>
568 </child>
569 </object>
570 <packing>
571 <property name="expand">True</property>
572 <property name="fill">True</property>
573 <property name="position">1</property>
574 </packing>
575 </child>
576 </object>
577 </child>
578 </object>
579 </child>
580 <child type="label">
581 <object class="GtkLabel" id="label6">
582 <property name="visible">True</property>
583 <property name="can_focus">False</property>
584 <property name="label" translatable="yes">&lt;b&gt;Quicklist Groups&lt;/b&gt;</property>
585 <property name="use_markup">True</property>
586 </object>
587 </child>
588 </object>
589 <packing>
590 <property name="resize">True</property>
591 <property name="shrink">True</property>
592 </packing>
593 </child>
594 </object>
595 <packing>
596 <property name="expand">True</property>
597 <property name="fill">True</property>
598 <property name="position">2</property>
599 </packing>
600 </child>
601 <child>
602 <object class="GtkHButtonBox" id="hbuttonbox1">
603 <property name="visible">True</property>
604 <property name="can_focus">False</property>
605 <property name="spacing">6</property>
606 <property name="layout_style">end</property>
607 <child>
608 <object class="GtkButton" id="cmdCancel">
609 <property name="label" translatable="yes">button</property>
610 <property name="visible">True</property>
611 <property name="can_focus">True</property>
612 <property name="receives_default">True</property>
613 <property name="use_action_appearance">False</property>
614 </object>
615 <packing>
616 <property name="expand">False</property>
617 <property name="fill">False</property>
618 <property name="position">0</property>
619 </packing>
620 </child>
621 <child>
622 <object class="GtkButton" id="cmdClose">
623 <property name="label" translatable="yes">button</property>
624 <property name="visible">True</property>
625 <property name="can_focus">True</property>
626 <property name="receives_default">True</property>
627 <property name="use_action_appearance">False</property>
628 </object>
629 <packing>
630 <property name="expand">False</property>
631 <property name="fill">False</property>
632 <property name="position">1</property>
633 </packing>
634 </child>
635 </object>
636 <packing>
637 <property name="expand">False</property>
638 <property name="fill">True</property>
639 <property name="position">3</property>
640 </packing>
641 </child>
642 </object>
643 </child>
644 </object>
645</interface>
6460
=== modified file 'unitylaunchereditor/dialogs/app.py'
--- unitylaunchereditor/dialogs/app.py 2011-06-13 20:07:33 +0000
+++ unitylaunchereditor/dialogs/app.py 2011-11-28 17:31:26 +0000
@@ -15,8 +15,8 @@
15# GNU General Public License for more details.15# GNU General Public License for more details.
16#16#
17#####################################################################17#####################################################################
18import gobject18from gi.repository import GObject
19import gtk19from gi.repository import Gtk
2020
21from gio import ThemedIcon, FileIcon, File21from gio import ThemedIcon, FileIcon, File
22from os.path import join22from os.path import join
@@ -29,7 +29,7 @@
29from unitylaunchereditor.widgets.dialogheader import DialogHeader29from unitylaunchereditor.widgets.dialogheader import DialogHeader
30from unitylaunchereditor.widgets.launcherview import LauncherView30from unitylaunchereditor.widgets.launcherview import LauncherView
31from unitylaunchereditor.widgets.launcherinfo import LauncherInfo31from unitylaunchereditor.widgets.launcherinfo import LauncherInfo
32from unitylaunchereditor.widgets.groupview import GroupView, GroupView32from unitylaunchereditor.widgets.groupview import GroupView
33from unitylaunchereditor.dialogs.launcherdialog import AddLauncherDialog,EditLauncherDialog33from unitylaunchereditor.dialogs.launcherdialog import AddLauncherDialog,EditLauncherDialog
34from unitylaunchereditor.dialogs.quicklistdialog import QuicklistDialog34from unitylaunchereditor.dialogs.quicklistdialog import QuicklistDialog
35from unitylaunchereditor.dialogs.dialogs import DialogType,MessageBox35from unitylaunchereditor.dialogs.dialogs import DialogType,MessageBox
@@ -43,25 +43,24 @@
43TOOLBUTTON_EDIT,43TOOLBUTTON_EDIT,
44TOOLBUTTON_REMOVE) = range(3)44TOOLBUTTON_REMOVE) = range(3)
4545
46class MainWindow(gtk.Window):46class MainWindow(Gtk.Window):
47 def __init__(self, gsettings):47 def __init__(self, gsettings):
48 super(MainWindow, self).__init__()48 Gtk.Window.__init__(self, title="Unity Launcher Editor")
49 log.info('Application started.')49 log.info('Application started.')
50 self.set_title("Unity Launcher Editor")
51 self.gsettings = gsettings50 self.gsettings = gsettings
52 51
53 self.set_default_size(700, 500)52 self.set_default_size(700, 500)
54 self.set_size_request(700, 500)53 self.set_size_request(700, 500)
55 self.set_position(gtk.WIN_POS_CENTER)54 self.set_position(Gtk.WindowPosition.CENTER)
56 55
57 main_box = gtk.VBox()56 main_box = Gtk.VBox()
58 self.add(main_box)57 self.add(main_box)
59 58
60 #header labels and imagem59 #header labels and imagem
61 self.__create_header(main_box)60 self.__create_header(main_box)
62 61
63 main_panel = gtk.HPaned()62 main_panel = Gtk.HPaned()
64 main_box.pack_start(main_panel,fill=True, expand=True)63 main_box.pack_start(main_panel, True, True, 0)
65 64
66 #laucher list65 #laucher list
67 self.__create_launcher(main_panel)66 self.__create_launcher(main_panel)
@@ -73,7 +72,7 @@
73 self.__create_bottom_box(main_box)72 self.__create_bottom_box(main_box)
74 73
75 self.__populate()74 self.__populate()
76 self.connect('delete-event', lambda x,y:gtk.main_quit())75 self.connect('delete-event', Gtk.main_quit)
77 76
78 def __create_header(self, container):77 def __create_header(self, container):
79 self.header_title = DialogHeader(_('Unity Launcher Editor'))78 self.header_title = DialogHeader(_('Unity Launcher Editor'))
@@ -87,70 +86,70 @@
87 #header image icon86 #header image icon
88 img_path = resource_filename(__name__, join("../data", 'plugin-unityshell.png'))87 img_path = resource_filename(__name__, join("../data", 'plugin-unityshell.png'))
89 self.header_title.set_icon(img_path)88 self.header_title.set_icon(img_path)
90 self.header_title.add_start(gtk.HSeparator())89 self.header_title.add_start(Gtk.HSeparator())
91 container.pack_start(self.header_title, expand=False)90 container.pack_start(self.header_title, False, False, 0)
92 91
93 def __create_launcher(self, container):92 def __create_launcher(self, container):
94 vbox = gtk.VBox()93 vbox = Gtk.VBox()
95 toolbar_view = gtk.Toolbar()94 toolbar_view = Gtk.Toolbar()
96 toolbar_view.set_style(gtk.TOOLBAR_ICONS)95 toolbar_view.set_style(Gtk.ToolbarStyle.ICONS)
97 96
98 add_buttom = gtk.ToolButton()97 add_buttom = Gtk.ToolButton()
99 add_buttom.set_icon_name(gtk.STOCK_NEW)98 add_buttom.set_icon_name(Gtk.STOCK_NEW)
100 add_buttom.set_use_action_appearance(False)99 add_buttom.set_use_action_appearance(False)
101 add_buttom.set_tooltip_text(_('Create a new Launcher item.'))100 add_buttom.set_tooltip_text(_('Create a new Launcher item'))
102 add_buttom.connect('clicked', self.__on_laucher_button_click, TOOLBUTTON_ADD)101 add_buttom.connect('clicked', self.__on_launcher_button_click, TOOLBUTTON_ADD)
103 102
104 edit_buttom = gtk.ToolButton()103 edit_buttom = Gtk.ToolButton()
105 edit_buttom.set_icon_name(gtk.STOCK_PROPERTIES)104 edit_buttom.set_icon_name(Gtk.STOCK_PROPERTIES)
106 edit_buttom.set_use_action_appearance(False)105 edit_buttom.set_use_action_appearance(False)
107 edit_buttom.set_tooltip_text(_('Edit select Launcher information.'))106 edit_buttom.set_tooltip_text(_('Edit select Launcher information'))
108 edit_buttom.connect('clicked', self.__on_laucher_button_click, TOOLBUTTON_EDIT)107 edit_buttom.connect('clicked', self.__on_launcher_button_click, TOOLBUTTON_EDIT)
109 108
110 remove_buttom = gtk.ToolButton()109 remove_buttom = Gtk.ToolButton()
111 remove_buttom.set_icon_name(gtk.STOCK_DELETE)110 remove_buttom.set_icon_name(Gtk.STOCK_DELETE)
112 remove_buttom.set_use_action_appearance(False)111 remove_buttom.set_use_action_appearance(False)
113 remove_buttom.set_tooltip_text(_('Remove selected Launcher.'))112 remove_buttom.set_tooltip_text(_('Remove selected Launcher'))
114 remove_buttom.connect('clicked', self.__on_laucher_button_click, TOOLBUTTON_REMOVE)113 remove_buttom.connect('clicked', self.__on_launcher_button_click, TOOLBUTTON_REMOVE)
115 114
116 toolbar_view.insert(add_buttom, TOOLBUTTON_ADD)115 toolbar_view.insert(add_buttom, TOOLBUTTON_ADD)
117 toolbar_view.insert(edit_buttom, TOOLBUTTON_EDIT)116 toolbar_view.insert(edit_buttom, TOOLBUTTON_EDIT)
118 toolbar_view.insert(remove_buttom, TOOLBUTTON_REMOVE)117 toolbar_view.insert(remove_buttom, TOOLBUTTON_REMOVE)
119 118
120 self.launcher_view = LauncherView()119 self.launcher_view = LauncherView()
121 hscroll = gtk.ScrolledWindow()120 hscroll = Gtk.ScrolledWindow()
122 hscroll.set_shadow_type(gtk.SHADOW_ETCHED_IN)121 hscroll.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
123 hscroll.set_border_width(5)122 hscroll.set_border_width(5)
124 hscroll.set_size_request(200,200)123 hscroll.set_size_request(200,200)
125 hscroll.add(self.launcher_view)124 hscroll.add(self.launcher_view)
126 125
127 126
128 vbox.pack_start(toolbar_view, expand = False)127 vbox.pack_start(toolbar_view, False, False, 0)
129 vbox.pack_start(hscroll, expand = True)128 vbox.pack_start(hscroll, True, True, 0)
130 container.set_position(100)129 container.set_position(100)
131 container.pack1(vbox, resize=False, shrink=False)130 container.pack1(vbox, resize=False, shrink=False)
132 131
133 def __create_group_view(self, container):132 def __create_group_view(self, container):
134 vbox = gtk.VBox()133 vbox = Gtk.VBox()
135 toolbar_view = gtk.Toolbar()134 toolbar_view = Gtk.Toolbar()
136 toolbar_view.set_style(gtk.TOOLBAR_ICONS)135 toolbar_view.set_style(Gtk.ToolbarStyle.ICONS)
137 136
138 add_button = gtk.ToolButton()137 add_button = Gtk.ToolButton()
139 add_button.set_icon_name(gtk.STOCK_ADD)138 add_button.set_icon_name(Gtk.STOCK_ADD)
140 add_button.set_use_action_appearance(False)139 add_button.set_use_action_appearance(False)
141 add_button.set_tooltip_text(_('Add a new quicklist group.'))140 add_button.set_tooltip_text(_('Add a new quicklist group'))
142 add_button.connect('clicked', self.__on_quicklist_button_click, TOOLBUTTON_ADD)141 add_button.connect('clicked', self.__on_quicklist_button_click, TOOLBUTTON_ADD)
143 142
144 self.edit_button = gtk.ToolButton()143 self.edit_button = Gtk.ToolButton()
145 self.edit_button.set_icon_name(gtk.STOCK_EDIT)144 self.edit_button.set_icon_name(Gtk.STOCK_EDIT)
146 self.edit_button.set_use_action_appearance(False)145 self.edit_button.set_use_action_appearance(False)
147 self.edit_button.set_tooltip_text(_('Change select quicklist group information.'))146 self.edit_button.set_tooltip_text(_('Change select quicklist group information'))
148 self.edit_button.connect('clicked', self.__on_quicklist_button_click, TOOLBUTTON_EDIT)147 self.edit_button.connect('clicked', self.__on_quicklist_button_click, TOOLBUTTON_EDIT)
149 148
150 self.remove_button = gtk.ToolButton()149 self.remove_button = Gtk.ToolButton()
151 self.remove_button.set_icon_name(gtk.STOCK_REMOVE)150 self.remove_button.set_icon_name(Gtk.STOCK_REMOVE)
152 self.remove_button.set_use_action_appearance(False)151 self.remove_button.set_use_action_appearance(False)
153 self.remove_button.set_tooltip_text(_('Remove selected quicklist group.'))152 self.remove_button.set_tooltip_text(_('Remove selected quicklist group'))
154 self.remove_button.connect('clicked', self.__on_quicklist_button_click, TOOLBUTTON_REMOVE)153 self.remove_button.connect('clicked', self.__on_quicklist_button_click, TOOLBUTTON_REMOVE)
155 154
156 toolbar_view.insert(add_button, TOOLBUTTON_ADD)155 toolbar_view.insert(add_button, TOOLBUTTON_ADD)
@@ -158,14 +157,14 @@
158 toolbar_view.insert(self.remove_button, TOOLBUTTON_REMOVE)157 toolbar_view.insert(self.remove_button, TOOLBUTTON_REMOVE)
159 158
160 self.group_view = GroupView()159 self.group_view = GroupView()
161 hscroll = gtk.ScrolledWindow()160 hscroll = Gtk.ScrolledWindow()
162 hscroll.set_shadow_type(gtk.SHADOW_ETCHED_IN)161 hscroll.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
163 hscroll.set_border_width(5)162 hscroll.set_border_width(5)
164 hscroll.set_size_request(200,200)163 hscroll.set_size_request(200,200)
165 hscroll.add(self.group_view)164 hscroll.add(self.group_view)
166 165
167 vbox.pack_start(toolbar_view, expand = False)166 vbox.pack_start(toolbar_view, False, False, 0)
168 vbox.pack_start(hscroll, expand = True)167 vbox.pack_start(hscroll, True, True, 0)
169 168
170 container.pack2(vbox, resize=False, shrink=False)169 container.pack2(vbox, resize=False, shrink=False)
171 #list group signals170 #list group signals
@@ -173,18 +172,18 @@
173 172
174 def __create_bottom_box(self, container):173 def __create_bottom_box(self, container):
175 #Bottom button list for save and close174 #Bottom button list for save and close
176 button_close = gtk.Button(stock=gtk.STOCK_CLOSE)175 button_close = Gtk.Button(stock=Gtk.STOCK_CLOSE)
177 button_save = gtk.Button(stock=gtk.STOCK_SAVE)176 button_save = Gtk.Button(stock=Gtk.STOCK_SAVE)
178 bottom_box = gtk.HButtonBox()177 bottom_box = Gtk.HButtonBox()
179 bottom_box.set_layout(gtk.BUTTONBOX_END)178 bottom_box.set_layout(Gtk.ButtonBoxStyle.END)
180 bottom_box.set_border_width(12)179 bottom_box.set_border_width(12)
181 bottom_box.pack_end(button_save)180 bottom_box.pack_end(button_save, False, False, 0)
182 bottom_box.pack_end(button_close)181 bottom_box.pack_end(button_close, False, False, 0)
183 button_close.connect('clicked', lambda x: gtk.main_quit())182 button_close.connect('clicked', Gtk.main_quit)
184 button_save.connect('clicked', self.save_launchers)183 button_save.connect('clicked', self.save_launchers)
185 184
186 container.pack_start(gtk.HSeparator(), False,True,0)185 container.pack_start(Gtk.HSeparator(), False, True, 0)
187 container.pack_start(bottom_box, expand=False)186 container.pack_start(bottom_box, False, False, 0)
188 187
189 def new_from_info(self, info):188 def new_from_info(self, info):
190 file_path = normalize_path('%s.desktop' % info['Name'])189 file_path = normalize_path('%s.desktop' % info['Name'])
@@ -236,7 +235,7 @@
236 self.new_from_file(menu_item, False)235 self.new_from_file(menu_item, False)
237 self.launcher_view.connect('selection-changed', self.__launcher_view_row_change)236 self.launcher_view.connect('selection-changed', self.__launcher_view_row_change)
238 #make first row active237 #make first row active
239 self.launcher_view.set_cursor((0,))238 self.launcher_view.set_selected_iter(0)
240 239
241 return240 return
242 def __on_quicklist_button_click(self, widget, button_type):241 def __on_quicklist_button_click(self, widget, button_type):
@@ -307,11 +306,11 @@
307 objDesktop.remove_sections(shortcut_group_name)306 objDesktop.remove_sections(shortcut_group_name)
308 objDesktop.set('X-Ayatana-Desktop-Shortcuts', groups)307 objDesktop.set('X-Ayatana-Desktop-Shortcuts', groups)
309 308
310 def __on_laucher_button_click(self, widget, button_type):309 def __on_launcher_button_click(self, widget, button_type):
311 310
312 if button_type == TOOLBUTTON_ADD:311 if button_type == TOOLBUTTON_ADD:
313 dialog = AddLauncherDialog(self)312 dialog = AddLauncherDialog(self)
314 dialog.set_position(gtk.WIN_POS_CENTER_ALWAYS)313 dialog.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
315 dialog.show_all()314 dialog.show_all()
316 if button_type == TOOLBUTTON_EDIT:315 if button_type == TOOLBUTTON_EDIT:
317 if self.launcher_view.is_selected:316 if self.launcher_view.is_selected:
@@ -340,7 +339,7 @@
340 parent=self,339 parent=self,
341 action_text=_('Remove Launcher'),340 action_text=_('Remove Launcher'),
342 message=_('You are about to remove a Launcher item, are you sure?'),341 message=_('You are about to remove a Launcher item, are you sure?'),
343 dlg_type=DialogType.DIALOG_MESSAGE342 dlg_type=DialogType.DIALOG_CONFIRMATION,
344 )343 )
345 result, text = dialog.run()344 result, text = dialog.run()
346 if result:345 if result:
@@ -386,16 +385,15 @@
386 self.edit_button.set_sensitive(True)385 self.edit_button.set_sensitive(True)
387 self.remove_button.set_sensitive(True)386 self.remove_button.set_sensitive(True)
388 else:387 else:
389 self.edit_button.set_sensitive(True)388 self.edit_button.set_sensitive(False)
390 self.remove_button.set_sensitive(True)389 self.remove_button.set_sensitive(False)
391390
392 def __save_unity_list(self, menu_items):391 def __save_unity_list(self, menu_items):
393 try:392 try:
394 print str(menu_items)
395 self.gsettings.set_strv('favorites', menu_items)393 self.gsettings.set_strv('favorites', menu_items)
396 self.__populate()394 self.__populate()
397 return True395 return True
398 except gobject.GError, e:396 except GObject.GError, e:
399 return False397 return False
400 #return_code = os.system('unity --reset') #subprocess.call(['unity','--reset'])398 #return_code = os.system('unity --reset') #subprocess.call(['unity','--reset'])
401 #if return_code != 0:399 #if return_code != 0:
@@ -441,4 +439,4 @@
441 message=_("There's a problem with your application, \n controller not found."),439 message=_("There's a problem with your application, \n controller not found."),
442 dlg_type=DialogType.DIALOG_MESSAGE440 dlg_type=DialogType.DIALOG_MESSAGE
443 ).run()441 ).run()
444
445\ No newline at end of file442\ No newline at end of file
443
446444
=== modified file 'unitylaunchereditor/dialogs/dialogs.py'
--- unitylaunchereditor/dialogs/dialogs.py 2011-06-07 15:07:44 +0000
+++ unitylaunchereditor/dialogs/dialogs.py 2011-11-28 17:31:26 +0000
@@ -1,4 +1,4 @@
1import gtk1from gi.repository import Gtk
2from unitylaunchereditor.core.translation import _2from unitylaunchereditor.core.translation import _
3class DialogType:3class DialogType:
4 """ Class to define constants for define Message class types"""4 """ Class to define constants for define Message class types"""
@@ -8,16 +8,16 @@
8 DIALOG_CONFIRMATION8 DIALOG_CONFIRMATION
9 ) = range(3)9 ) = range(3)
1010
11class FileChooser(gtk.FileChooserDialog):11class FileChooser(Gtk.FileChooserDialog):
12 def __init__(self, title='Open...', filters=None):12 def __init__(self, title='Open...', filters=None):
13 super(FileChooser, self).__init__(13 super(FileChooser, self).__init__(
14 title,14 title,
15 None,15 None,
16 gtk.FILE_CHOOSER_ACTION_OPEN, (16 Gtk.FileChooserAction.OPEN, (
17 gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,17 Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
18 gtk.STOCK_OPEN, gtk.RESPONSE_OK)18 Gtk.STOCK_OPEN, Gtk.ResponseType.OK)
19 )19 )
20 self.set_default_response(gtk.RESPONSE_OK)20 self.set_default_response(Gtk.ResponseType.OK)
21 if filters:21 if filters:
22 self.add_filter(filters)22 self.add_filter(filters)
2323
@@ -28,12 +28,12 @@
28 filename = self.get_filename()28 filename = self.get_filename()
29 if destroy:29 if destroy:
30 self.destroy()30 self.destroy()
31 if resp == gtk.RESPONSE_OK:31 if resp == Gtk.ResponseType.OK:
32 return True, filename32 return True, filename
33 else:33 else:
34 return False, None34 return False, None
35 35
36class MessageBox(gtk.MessageDialog):36class MessageBox(Gtk.MessageDialog):
37 def __init__(self, 37 def __init__(self,
38 window_title="",38 window_title="",
39 parent=None,39 parent=None,
@@ -47,17 +47,17 @@
47 self.dialog_type = dlg_type47 self.dialog_type = dlg_type
48 48
49 if dlg_type == DialogType.DIALOG_MESSAGE:49 if dlg_type == DialogType.DIALOG_MESSAGE:
50 icon = gtk.MESSAGE_WARNING50 icon = Gtk.MessageType.WARNING
51 buttons = gtk.BUTTONS_OK 51 buttons = Gtk.ButtonsType.OK
52 elif dlg_type == DialogType.DIALOG_INPUT:52 elif dlg_type == DialogType.DIALOG_INPUT:
53 icon = gtk.MESSAGE_QUESTION53 icon = Gtk.MessageType.QUESTION
54 buttons = gtk.BUTTONS_CANCEL54 buttons = Gtk.ButtonsType.CANCEL
55 elif dlg_type == DialogType.DIALOG_CONFIRMATION:55 elif dlg_type == DialogType.DIALOG_CONFIRMATION:
56 icon = gtk.MESSAGE_QUESTION56 icon = Gtk.MessageType.QUESTION
57 buttons = gtk.BUTTONS_YES_NO57 buttons = Gtk.ButtonsType.YES_NO
58 58
59 super(MessageBox, self).__init__(parent,59 super(MessageBox, self).__init__(parent,
60 gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,60 Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT,
61 icon, buttons)61 icon, buttons)
62 self.set_title(window_title)62 self.set_title(window_title)
63 self.set_markup(text)63 self.set_markup(text)
@@ -65,18 +65,18 @@
65 if dlg_type == DialogType.DIALOG_INPUT:65 if dlg_type == DialogType.DIALOG_INPUT:
66 66
67 # create a horizontal box to pack the entry and a label67 # create a horizontal box to pack the entry and a label
68 self.text = gtk.Entry()68 self.text = Gtk.Entry()
69 self.text.set_activates_default(gtk.TRUE)69 self.text.set_activates_default(Gtk.TRUE)
70 hbox = gtk.HBox()70 hbox = Gtk.HBox()
71 hbox.pack_start(gtk.Label(label_text), False, 5, 5)71 hbox.pack_start(Gtk.Label(label_text), False, 5, 5)
72 hbox.pack_end(self.text)72 hbox.pack_end(self.text)
73 self.vbox.pack_end(hbox, True, True, 0)73 self.vbox.pack_end(hbox, True, True, 0)
74 self.ok_button = self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)74 self.ok_button = self.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
75 self.ok_button.grab_default()75 self.ok_button.grab_default()
76 76
77 self.ok_button.set_sensitive(False)77 self.ok_button.set_sensitive(False)
78 self.set_alternative_button_order([gtk.RESPONSE_CANCEL, gtk.RESPONSE_OK])78 self.set_alternative_button_order([Gtk.ResponseType.CANCEL, Gtk.ResponseType.OK])
79 self.set_default_response(gtk.RESPONSE_OK)79 self.set_default_response(Gtk.ResponseType.OK)
80 self.text.connect('changed', lambda widget: self.ok_button.set_sensitive(widget.get_text_length() > 0))80 self.text.connect('changed', lambda widget: self.ok_button.set_sensitive(widget.get_text_length() > 0))
81 81
82 self.show_all()82 self.show_all()
@@ -90,233 +90,8 @@
90 text = self.text.get_text()90 text = self.text.get_text()
91 if destroy:91 if destroy:
92 self.destroy()92 self.destroy()
93 if resp == gtk.RESPONSE_YES or resp == gtk.RESPONSE_OK:93 if resp == Gtk.ResponseType.YES or resp == Gtk.ResponseType.OK:
94 if dialog_type == DialogType.DIALOG_INPUT:94 return True, text
95 return True, text
96 else:
97 return True, text
98 else:95 else:
99 return False, text96 return False, text
10097
101class GroupsDialog(gtk.Dialog):
102 """XXX: add docs."""
103
104 def __init__(self, title=_('Add Group...'), parent=None):
105 super(GroupsDialog, self).__init__(title,
106 None, (gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT |
107 gtk.DIALOG_NO_SEPARATOR),
108 (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
109
110
111 self.set_resizable(False)
112
113 if parent:
114 self.set_transient_for(parent)
115
116 self.add_group_panel = self.create_widgets()
117 self.vbox.pack_start(self.add_group_panel, True, True, 0)
118 self.vbox.show_all()
119
120 self.ok_button = self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
121 self.ok_button.grab_default()
122 self.ok_button.set_sensitive(False)
123 self.set_alternative_button_order(
124 [gtk.RESPONSE_CANCEL, gtk.RESPONSE_OK])
125
126 self.txtName.connect('changed', self.on_change)
127 self.txtCommand.connect('changed', self.on_change)
128 self.cmdGRun.connect('clicked', self.open_executable)
129
130 def create_widgets(self):
131 '''
132 this will create input widgets for our dialog
133 without depending on glade for that and
134 solving the file not found error report.
135 '''
136
137 frame4 = gtk.Frame()
138 frame4.set_shadow_type(gtk.SHADOW_NONE)
139
140 align = gtk.Alignment()
141 align.set_padding(0, 0, 12, 0)
142
143 table = gtk.Table(rows=4, columns=2, homogeneous=False)
144 table.set_col_spacings(5)
145 table.set_row_spacings(5)
146
147 label8 = gtk.Label(_('Group Name:'))
148 label8.set_alignment(0, 0.5)
149 eventbox8 = gtk.EventBox()
150 eventbox8.add(label8)
151
152 table.attach(eventbox8,
153 left_attach=0,
154 right_attach=1,
155 top_attach=0,
156 bottom_attach=1,
157 xoptions=gtk.FILL,
158 yoptions=gtk.FILL,
159 xpadding=0,
160 ypadding=0)
161
162
163 label5 = gtk.Label(_('Command Name:'))
164 label5.set_alignment(0, 0.5)
165 eventbox5 = gtk.EventBox()
166 eventbox5.add(label5)
167 table.attach(eventbox5,
168 left_attach=0,
169 right_attach=1,
170 top_attach=1,
171 bottom_attach=2,
172 xoptions=gtk.FILL,
173 yoptions=gtk.FILL,
174 xpadding=0,
175 ypadding=0)
176
177
178 label6 = gtk.Label(_('Command:'))
179 label6.set_alignment(0, 0.5)
180 eventbox6 = gtk.EventBox()
181 eventbox6.add(label6)
182 table.attach(eventbox6,
183 left_attach=0,
184 right_attach=1,
185 top_attach=2,
186 bottom_attach=3,
187 xoptions=gtk.FILL,
188 yoptions=gtk.FILL,
189 xpadding=0,
190 ypadding=0)
191
192 label7 = gtk.Label(_('Target Environment:'))
193 label7.set_alignment(0, 0.5)
194 eventbox7 = gtk.EventBox()
195 eventbox7.add(label7)
196 table.attach(eventbox7,
197 left_attach=0,
198 right_attach=1,
199 top_attach=3,
200 bottom_attach=4,
201 xoptions=gtk.FILL,
202 yoptions=gtk.FILL,
203 xpadding=0,
204 ypadding=0)
205
206 self.txtGroup = gtk.Entry()
207 table.attach(self.txtGroup,
208 left_attach=1,
209 right_attach=2,
210 top_attach=0,
211 bottom_attach=1,
212 xoptions=gtk.FILL,
213 yoptions=gtk.FILL,
214 xpadding=0,
215 ypadding=0)
216
217 self.txtName = gtk.Entry()
218 self.txtName.set_name('Name')
219 table.attach(self.txtName,
220 left_attach=1,
221 right_attach=2,
222 top_attach=1,
223 bottom_attach=2,
224 xoptions=gtk.EXPAND | gtk.FILL,
225 #yoptions=gtk.None,
226 xpadding=0,
227 ypadding=0)
228
229 hbox4 = gtk.HBox()
230 self.txtCommand = gtk.Entry()
231 self.txtCommand.set_name('Exec')
232 self.cmdGRun = gtk.Button('...')
233
234 hbox4.pack_start(self.txtCommand, expand=True, fill=True, padding=0)
235 hbox4.pack_start(self.cmdGRun, expand=False, fill=True, padding=0)
236
237 table.attach(hbox4,
238 left_attach=1,
239 right_attach=2,
240 top_attach=2,
241 bottom_attach=3,
242 xoptions=gtk.EXPAND | gtk.FILL,
243 yoptions=gtk.EXPAND | gtk.FILL,
244 xpadding=0,
245 ypadding=0)
246
247 self.cmbTargetEnvironment = gtk.ComboBox()
248 self.cmbTargetEnvironment.set_name('TargetEnvironment')
249
250 self.combo_model = gtk.ListStore(TYPE_STRING)
251 for target_key in ['Unity', 'Message Menu', 'Unity;Message Menu']:
252 self.combo_model.append([target_key])
253
254 celltitle = gtk.CellRendererText()
255
256 self.cmbTargetEnvironment.pack_start(celltitle, False)
257 self.cmbTargetEnvironment.add_attribute(celltitle, 'text', 0)
258 self.cmbTargetEnvironment.set_model(self.combo_model)
259 self.cmbTargetEnvironment.set_active(0)
260
261 table.attach(self.cmbTargetEnvironment,
262 left_attach=1,
263 right_attach=2,
264 top_attach=3,
265 bottom_attach=4,
266 xoptions=gtk.EXPAND | gtk.FILL,
267 yoptions=gtk.EXPAND | gtk.FILL,
268 xpadding=0,
269 ypadding=0)
270
271 align.add(table)
272 frame4.add(align)
273
274 return frame4
275
276 def populate(self, values):
277 try:
278 self.txtGroup.set_text(values['GroupName'])
279 self.txtGroup.set_sensitive(False)
280 self.txtName.set_text(values['Name'])
281 self.txtCommand.set_text(values['Exec'])
282 except:
283 pass
284 try:
285 for n in range(len(self.combo_model)):
286 if self.combo_model[n][0] == values['TargetEnvironment']:
287 self.cmbTargetEnvironment.set_active(n)
288 except:
289 pass
290
291 def run(self, destroy=True):
292 """Returns True if yes was clicked, False otherwise."""
293 resp = super(GroupsDialog, self).run()
294 obj = None
295 if resp == gtk.RESPONSE_OK:
296 obj = {'GroupName': self.txtGroup.get_text(),
297 'Name': self.txtName.get_text(),
298 'Exec': self.txtCommand.get_text(),
299 'TargetEnvironment': (
300 self.cmbTargetEnvironment.get_active_text()),
301 }
302 print obj
303 if destroy:
304 self.destroy()
305 if resp == gtk.RESPONSE_OK:
306 return True, obj
307 else:
308 return False, None
309
310 def on_change(self, widget):
311 if (self.txtName.get_text_length() == 0 or
312 self.txtCommand.get_text_length() == 0):
313 self.ok_button.set_sensitive(False)
314 else:
315 self.ok_button.set_sensitive(True)
316
317 def open_executable(self, widget):
318 dialog = FileChooser()
319 response, filename = dialog.run()
320 if response:
321 self.txtCommand.set_text(filename)
322
32398
=== modified file 'unitylaunchereditor/dialogs/launcherdialog.py'
--- unitylaunchereditor/dialogs/launcherdialog.py 2011-06-13 20:08:40 +0000
+++ unitylaunchereditor/dialogs/launcherdialog.py 2011-11-28 17:31:26 +0000
@@ -15,14 +15,14 @@
15# GNU General Public License for more details.15# GNU General Public License for more details.
16#16#
17#####################################################################17#####################################################################
18import gobject18from gi.repository import GObject
19import gtk19from gi.repository import Gtk
20from pango import ELLIPSIZE_END20from gi.repository import Gdk
21from unitylaunchereditor.core.translation import _21from unitylaunchereditor.core.translation import _
22from unitylaunchereditor.core.constants import TITLES, DESCRIPTION22from unitylaunchereditor.core.constants import TITLES, DESCRIPTION
23from unitylaunchereditor.addassistant import PageFromSystem, PageFromFile, PageFromInfo23from unitylaunchereditor.addassistant import PageFromSystem, PageFromFile, PageFromInfo
24from unitylaunchereditor.widgets.launcherinfo import LauncherInfo24from unitylaunchereditor.widgets.launcherinfo import LauncherInfo
25from unitylaunchereditor.widgets.dialogheader import HeaderBoxButton, DialogHeader25from unitylaunchereditor.widgets.dialogheader import DialogHeader
26from unitylaunchereditor.core.log import Logger26from unitylaunchereditor.core.log import Logger
27from unitylaunchereditor.core.utils import normalize_path, nullstring27from unitylaunchereditor.core.utils import normalize_path, nullstring
28from unitylaunchereditor.dialogs.dialogs import MessageBox28from unitylaunchereditor.dialogs.dialogs import MessageBox
@@ -30,16 +30,16 @@
3030
31log = Logger()31log = Logger()
3232
33class AddLauncherDialog(gtk.Window):33class AddLauncherDialog(Gtk.Window):
3434
35 def __init__(self, parent = None):35 def __init__(self, parent = None):
36 super(AddLauncherDialog, self).__init__()36 Gtk.Window.__init__(self)
37 self.parent_module = parent37 self.parent_module = parent
38 if parent:38 if parent:
39 self.set_transient_for(parent)39 self.set_transient_for(parent)
40 40
41 self.set_modal(True)41 self.set_modal(True)
42 self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG)42 self.set_type_hint(Gdk.WindowTypeHint.DIALOG)
43 self.set_resizable(False)43 self.set_resizable(False)
44 self.set_default_size(650, 450)44 self.set_default_size(650, 450)
45 self.set_size_request(650, 450)45 self.set_size_request(650, 450)
@@ -47,39 +47,37 @@
47 self.set_title(_('Add Launcher...'))47 self.set_title(_('Add Launcher...'))
48 48
49 #header controls49 #header controls
50 self.label_box = HeaderBoxButton(TITLES[0])50 self.label_box = DialogHeader(TITLES[0])
51 self.label_box.set_description(DESCRIPTION[0])51 self.label_box.set_description(DESCRIPTION[0])
52 52
53 #this will hold pages for each option53 #this will hold pages for each option
54 notebook= gtk.Notebook()54 notebook = Gtk.Notebook()
55 notebook.set_border_width(0)55 notebook.set_size_request(650, 350)
56 notebook.set_show_border(False)
57 notebook.set_show_tabs(False)
58 56
59 fra=PageFromSystem()57 fra = PageFromSystem()
60 fra.connect('add-clicked', self.__on_add_clicked)58 fra.connect('add-clicked', self.__on_add_clicked)
61 notebook.append_page(fra)59 notebook.append_page(fra, Gtk.Label(_('From System')))
62 60
63 pfile = PageFromFile()61 pfile = PageFromFile()
64 pfile.connect('add-clicked', self.__on_newfile_clicked)62 pfile.connect('add-clicked', self.__on_newfile_clicked)
65 notebook.append_page(pfile)63 notebook.append_page(pfile, Gtk.Label(_('From File')))
66 64
67 pnew=PageFromInfo()65 pnew = PageFromInfo()
68 pnew.connect('add-clicked', self.__on_new_frominfo_clicked)66 pnew.connect('add-clicked', self.__on_new_frominfo_clicked)
69 67
70 notebook.append_page(pnew)68 notebook.append_page(pnew, Gtk.Label(_('Custom')))
71 #----69 #----
72 bottom_box = gtk.HButtonBox()70 bottom_box = Gtk.HButtonBox()
73 bottom_box.set_layout(gtk.BUTTONBOX_END)71 bottom_box.set_layout(Gtk.ButtonBoxStyle.END)
74 bottom_box.set_border_width(6)72 bottom_box.set_border_width(6)
75 close_button = gtk.Button(stock=gtk.STOCK_CLOSE)73 close_button = Gtk.Button(stock=Gtk.STOCK_CLOSE)
76 bottom_box.pack_start(close_button, fill=True, expand=False)74 bottom_box.pack_start(close_button, True, False, 0)
77 75
78 self.label_box.add_start(notebook, True,True,0)76 self.label_box.add_start(notebook, True, True, 0)
79 self.label_box.add_start(gtk.HSeparator(), fill=True, expand=False)77 self.label_box.add_start(Gtk.HSeparator(), fill=True, expand=False)
80 self.label_box.add_end(bottom_box, fill=True, expand=False)78 self.label_box.add_end(bottom_box, fill=True, expand=False)
81 79
82 self.label_box.connect('button-clicked', self.change_page, notebook.set_current_page)80 notebook.connect('switch-page', self.change_page)
83 close_button.connect('clicked', lambda w: self.hide())81 close_button.connect('clicked', lambda w: self.hide())
84 self.add(self.label_box)82 self.add(self.label_box)
85 self.label_box.set_icon('gtk-execute')83 self.label_box.set_icon('gtk-execute')
@@ -104,45 +102,42 @@
104 if not new_item:102 if not new_item:
105 MessageBox('Erro',self.parent_module,action_text=_("Erro inserting item."),message=_("Item already exists in the list.") ).run()103 MessageBox('Erro',self.parent_module,action_text=_("Erro inserting item."),message=_("Item already exists in the list.") ).run()
106 104
107 def change_page(self, widget,id, show_page):105 def change_page(self, widget, page, id):
108 #TODO: use our own icons106 #TODO: use our own icons
109 icon_names={0:'gtk-execute', 1: 'gtk-file',2:'gtk-about'}107 icon_names={0:'gtk-execute', 1: 'gtk-file',2:'gtk-about'}
110 108
111 show_page(id)
112
113 self.label_box.set_title(TITLES[id])109 self.label_box.set_title(TITLES[id])
114 self.label_box.set_description(DESCRIPTION[id])110 self.label_box.set_description(DESCRIPTION[id])
115 self.label_box.set_icon(icon_names[id])111 self.label_box.set_icon(icon_names[id])
116112
117class EditLauncherDialog(gtk.Dialog):113class EditLauncherDialog(Gtk.Dialog):
118 """XXX: add docs."""114 """XXX: add docs."""
119 def __init__(self, title=_('Edit Launcher...'), parent=None):115 def __init__(self, title=_('Edit Launcher...'), parent=None):
120 116 Gtk.Dialog.__init__(self, title,
121 super(EditLauncherDialog, self).__init__(title,117 None, (Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT),
122 None, (gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT),118 (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
123 (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
124 119
125 self.set_modal(True)120 self.set_modal(True)
126 self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG)121 self.set_type_hint(Gdk.WindowTypeHint.DIALOG)
127 self.set_resizable(False)122 self.set_resizable(False)
128123
129 if parent:124 if parent:
130 self.set_transient_for(parent)125 self.set_transient_for(parent)
131 126
132 self.ok_button = self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)127 self.ok_button = self.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
133 self.ok_button.grab_default()128 self.ok_button.grab_default()
134 self.ok_button.set_sensitive(False)129 self.ok_button.set_sensitive(False)
135 self.set_alternative_button_order([gtk.RESPONSE_CANCEL, gtk.RESPONSE_OK])130# self.set_alternative_button_order(Gtk.ResponseType.CANCEL, Gtk.ResponseType.OK)
136 #header controls131 #header controls
137 self.label_box = DialogHeader(_('Edit Launcher'))132 self.label_box = DialogHeader(_('Edit Launcher'))
138 self.label_box.set_description(_('Fill the fields below with your Launcher information.'))133 self.label_box.set_description(_('Fill the fields below with your Launcher information.'))
139 self.label_box.set_icon(gtk.STOCK_EDIT)134 self.label_box.set_icon(Gtk.STOCK_EDIT)
140 self.label_box.add_start(gtk.HSeparator(), expand=False)135 self.label_box.add_start(Gtk.HSeparator(), expand=False)
141 136
142 self.launcher = LauncherInfo()137 self.launcher = LauncherInfo()
143 self.label_box.add_start(self.launcher)138 self.label_box.add_start(self.launcher)
144 self.launcher.connect('field-changed', self._on_change)139 self.launcher.connect('field-changed', self._on_change)
145 self.label_box.add_start(gtk.HSeparator(), expand=False)140 self.label_box.add_start(Gtk.HSeparator(), expand=False)
146 self.vbox.pack_start(self.label_box, True, True, 0)141 self.vbox.pack_start(self.label_box, True, True, 0)
147 self.vbox.show_all()142 self.vbox.show_all()
148143
@@ -175,14 +170,14 @@
175 """Returns True if yes was clicked, False otherwise."""170 """Returns True if yes was clicked, False otherwise."""
176 resp = super(EditLauncherDialog, self).run()171 resp = super(EditLauncherDialog, self).run()
177 obj = None172 obj = None
178 if resp == gtk.RESPONSE_OK:173 if resp == Gtk.ResponseType.OK:
179 obj = {'Name': self.launcher.launcher_name}174 obj = {'Name': self.launcher.launcher_name}
180 obj['Exec']= self.launcher.launcher_command175 obj['Exec']= self.launcher.launcher_command
181 obj['Comment'] = self.launcher.launcher_comment176 obj['Comment'] = self.launcher.launcher_comment
182 obj['Icon'] = self.launcher.launcher_icon_name177 obj['Icon'] = self.launcher.launcher_icon_name
183 if destroy:178 if destroy:
184 self.destroy()179 self.destroy()
185 if resp == gtk.RESPONSE_OK:180 if resp == Gtk.ResponseType.OK:
186 return True, obj181 return True, obj
187 else:182 else:
188 return False, None
189\ No newline at end of file183\ No newline at end of file
184 return False, None
190185
=== modified file 'unitylaunchereditor/dialogs/quicklistdialog.py'
--- unitylaunchereditor/dialogs/quicklistdialog.py 2011-06-13 20:08:40 +0000
+++ unitylaunchereditor/dialogs/quicklistdialog.py 2011-11-28 17:31:26 +0000
@@ -15,10 +15,10 @@
15# GNU General Public License for more details.15# GNU General Public License for more details.
16#16#
17#####################################################################17#####################################################################
18import gobject18from gi.repository import GObject
19import gtk19from gi.repository import Gtk
20from unitylaunchereditor.widgets.groupinfo import GroupInfo20from unitylaunchereditor.widgets.groupinfo import GroupInfo
21from unitylaunchereditor.widgets.dialogheader import HeaderBoxButton, DialogHeader21from unitylaunchereditor.widgets.dialogheader import DialogHeader
22from unitylaunchereditor.core.log import Logger22from unitylaunchereditor.core.log import Logger
23from unitylaunchereditor.core.utils import nullstring23from unitylaunchereditor.core.utils import nullstring
24from unitylaunchereditor.dialogs.dialogs import MessageBox24from unitylaunchereditor.dialogs.dialogs import MessageBox
@@ -26,13 +26,13 @@
2626
27log = Logger()27log = Logger()
2828
29class QuicklistDialog(gtk.Dialog):29class QuicklistDialog(Gtk.Dialog):
30 """XXX: add docs."""30 """XXX: add docs."""
31 def __init__(self, title=_('Edit Launcher...'), parent=None):31 def __init__(self, title=_('Edit Launcher...'), parent=None):
32 32
33 super(QuicklistDialog, self).__init__(title,33 Gtk.Dialog.__init__(self, title,
34 None, (gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT),34 None, (Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT),
35 (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))35 (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
36 36
37 self.set_modal(True)37 self.set_modal(True)
38 self.set_resizable(False)38 self.set_resizable(False)
@@ -42,20 +42,20 @@
42 if parent:42 if parent:
43 self.set_transient_for(parent)43 self.set_transient_for(parent)
44 44
45 self.ok_button = self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)45 self.ok_button = self.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
46 self.ok_button.grab_default()46 self.ok_button.grab_default()
47 self.ok_button.set_sensitive(False)47 self.ok_button.set_sensitive(False)
48 self.set_alternative_button_order([gtk.RESPONSE_CANCEL, gtk.RESPONSE_OK])48# self.set_alternative_button_order(Gtk.ResponseType.CANCEL, Gtk.ResponseType.OK, -1)
49 #header controls49 #header controls
50 self.label_box = DialogHeader(_('Add quicklist group'))50 self.label_box = DialogHeader(_('Add quicklist group'))
51 self.label_box.set_description(_('Fill the fields below with your quicklist group information.'))51 self.label_box.set_description(_('Fill the fields below with your quicklist group information.'))
52 self.label_box.set_icon(gtk.STOCK_EDIT)52 self.label_box.set_icon(Gtk.STOCK_EDIT)
53 self.label_box.add_start(gtk.HSeparator(), expand=False)53 self.label_box.add_start(Gtk.HSeparator(), expand=False)
54 54
55 self.groupinfo = GroupInfo()55 self.groupinfo = GroupInfo()
56 self.label_box.add_start(self.groupinfo)56 self.label_box.add_start(self.groupinfo)
57 self.groupinfo.connect('field-changed', self._on_change)57 self.groupinfo.connect('field-changed', self._on_change)
58 self.label_box.add_start(gtk.HSeparator(), expand=False)58 self.label_box.add_start(Gtk.HSeparator(), expand=False)
59 self.vbox.pack_start(self.label_box, True, True, 0)59 self.vbox.pack_start(self.label_box, True, True, 0)
60 self.vbox.show_all()60 self.vbox.show_all()
6161
@@ -90,7 +90,7 @@
90 """Returns True if yes was clicked, False otherwise."""90 """Returns True if yes was clicked, False otherwise."""
91 resp = super(QuicklistDialog, self).run()91 resp = super(QuicklistDialog, self).run()
92 obj = None92 obj = None
93 if resp == gtk.RESPONSE_OK:93 if resp == Gtk.ResponseType.OK:
94 obj = {'GroupName':self.groupinfo.quicklist_group_name}94 obj = {'GroupName':self.groupinfo.quicklist_group_name}
95 obj['Name']= self.groupinfo.quicklist_name95 obj['Name']= self.groupinfo.quicklist_name
96 obj['Exec']= self.groupinfo.quicklist_command96 obj['Exec']= self.groupinfo.quicklist_command
@@ -98,7 +98,7 @@
98 obj['Visible'] = self.groupinfo.chkVisible.get_active()98 obj['Visible'] = self.groupinfo.chkVisible.get_active()
99 if destroy:99 if destroy:
100 self.destroy()100 self.destroy()
101 if resp == gtk.RESPONSE_OK:101 if resp == Gtk.ResponseType.OK:
102 return True, obj102 return True, obj
103 else:103 else:
104 return False, None
105\ No newline at end of file104\ No newline at end of file
105 return False, None
106106
=== removed directory 'unitylaunchereditor/locale'
=== removed directory 'unitylaunchereditor/locale/en'
=== removed directory 'unitylaunchereditor/locale/pt_BR'
=== removed file 'unitylaunchereditor/locale/unity-launcher-editor.pot'
--- unitylaunchereditor/locale/unity-launcher-editor.pot 2011-05-15 03:37:51 +0000
+++ unitylaunchereditor/locale/unity-launcher-editor.pot 1970-01-01 00:00:00 +0000
@@ -1,79 +0,0 @@
1# SOME DESCRIPTIVE TITLE.
2# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3# This file is distributed under the same license as the PACKAGE package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5#
6#, fuzzy
7msgid ""
8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2011-05-15 00:23-0300\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
15"Language: \n"
16"MIME-Version: 1.0\n"
17"Content-Type: text/plain; charset=CHARSET\n"
18"Content-Transfer-Encoding: 8bit\n"
19
20#: groupsdialog.py:29
21msgid "Add Group..."
22msgstr ""
23
24#: groupsdialog.py:41 mainwindow.py:48
25#, python-format
26msgid "Critical: couldn't find glade file: %s"
27msgstr ""
28
29#: mainwindow.py:141
30msgid "Save"
31msgstr ""
32
33#: mainwindow.py:142
34msgid "Save changes"
35msgstr ""
36
37#: mainwindow.py:143
38msgid "Do you want to save your changes?"
39msgstr ""
40
41#: mainwindow.py:226 mainwindow.py:276 mainwindow.py:287
42msgid "Remove"
43msgstr ""
44
45#: mainwindow.py:227
46msgid "Remove Group"
47msgstr ""
48
49#: mainwindow.py:228
50msgid "You are about to remove a Quick List Group, are you sure?"
51msgstr ""
52
53#: mainwindow.py:277 mainwindow.py:288
54msgid "Remove Launcher"
55msgstr ""
56
57#: mainwindow.py:278
58msgid "You are about to remove a Launcher item, are you sure?"
59msgstr ""
60
61#: mainwindow.py:289
62msgid "No launcher selected"
63msgstr ""
64
65#: mainwindow.py:298
66msgid "Add Launcher"
67msgstr ""
68
69#: mainwindow.py:299
70msgid "Add a new launcher..."
71msgstr ""
72
73#: mainwindow.py:300
74msgid "Type a launcher name to create a new launcher."
75msgstr ""
76
77#: mainwindow.py:302
78msgid "Name:"
79msgstr ""
800
=== removed file 'unitylaunchereditor/mainwindow.py'
--- unitylaunchereditor/mainwindow.py 2011-06-07 15:07:14 +0000
+++ unitylaunchereditor/mainwindow.py 1970-01-01 00:00:00 +0000
@@ -1,440 +0,0 @@
1# -*- coding: utf-8 -*-
2#####################################################################
3# Laudeci Oliveira <laudeci@ubuntu.com>
4# Ursula Junque <ursinha@ubuntu.com>
5#
6# Copyright 2011 unity-launcher-editor-dev.
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published
10# by the Free Software Foundation; version 3 only.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17#####################################################################
18
19import gtk
20from gtk.gdk import Pixbuf
21import gobject
22from gobject import TYPE_STRING
23from os.path import basename, exists, expanduser, join
24from pkg_resources import resource_filename
25from gio import FileIcon, ThemedIcon,File
26from unitylaunchereditor.core.desktop import DesktopParser
27from unitylaunchereditor.core.iconmanager import IconManager,IMAGE_SIZE
28from unitylaunchereditor.core.translation import _, LOCALE
29from unitylaunchereditor.dialogs.dialogs import DialogType
30from unitylaunchereditor.dialogs.dialogs import FileChooser, MessageBox, GroupsDialog
31from unitylaunchereditor.widgets.launcherview import LauncherView
32from unitylaunchereditor.widgets.grouptree import GroupTree
33from unitylaunchereditor.core.utils import nullstring
34from unitylaunchereditor.core import iconmanager
35from unitylaunchereditor.dialogs.launcheradd import HeaderBase
36
37
38#constantes for toolbar buttons
39(TOOLBUTTON_ADD,
40TOOLBUTTON_EDIT,
41TOOLBUTTON_REMOVE) = range(3)
42
43class MainWindow(object):
44
45 builder = gtk.Builder()
46
47 def __init__(self, controller=None, glade_file="application.glade"):
48 self.controller = controller
49 glade_path = resource_filename(__name__, join("data", glade_file))
50 try:
51 self.builder.add_from_file(glade_path)
52 except gobject.GError:
53 if not exists(glade_path):
54 print _("Critical: couldn't find glade file: %s") % glade_path
55 raise
56 except Exception, exc:
57 print ("Something else went wrong: %s") % exc
58 raise
59
60 window_name = "window1"
61 self.window = self.builder.get_object(window_name)
62
63 header = gtk.EventBox()
64 header.set_visible_window(True)
65 header.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color('#3c3b37'))
66
67 self.header = HeaderBase()
68 header.add(self.header)
69 self.header.set_title('Teessste')
70 self.header.set_description('')
71 img=gtk.Image()
72 img.set_from_file(resource_filename(__name__, join("data", 'plugin-unityshell.png')))
73 self.header.set_icon(img.get_pixbuf())
74 self.builder.get_object('vbox1').pack_start(header,False,False)
75 self.builder.get_object('vbox1').reorder_child(header,0)
76 self.window.show_all()
77 # launcher Objects
78 self.list_container = self.builder.get_object('list_container')
79 self.listview_launcher = LauncherView()
80 self.list_container.add_with_viewport(self.listview_launcher)
81 # groups objects
82 self.group_container = self.builder.get_object('group_container')
83 self.tvwGroups = GroupTree()
84 self.group_container.add_with_viewport(self.tvwGroups)
85
86 # info Widgets
87 self.imgIcon = self.builder.get_object('imgIcon')
88 self.txtName = self.builder.get_object('txtName')
89 self.txtName.set_name('Name')
90 self.txtComment = self.builder.get_object('txtComment')
91 self.txtComment.set_name('Comment')
92 self.txtCommand = self.builder.get_object('txtCommand')
93 self.txtCommand.set_name('Exec')
94
95 self.chkTerminal = self.builder.get_object('chkTerminal')
96 self.chkTerminal.set_name('Terminal')
97
98 # button widgets
99 self.cmdIcon = self.builder.get_object('cmdIcon')
100 self.cmdSave = self.builder.get_object('cmdSave')
101
102 #toolbar widgets
103 self.btnRemove = self.builder.get_object('btnRemove')
104 self.btnEdit = self.builder.get_object('btnEdit')
105
106 # set signals
107 self.setup_signals()
108
109 def setup_signals(self):
110 # window close
111 self.window.connect('delete-event', gtk.main_quit)
112
113 #buttons event
114 self.builder.get_object('cmdClose').connect('clicked', gtk.main_quit)
115 self.builder.get_object('cmdAdd').connect('clicked', self.add_new_launcher)
116 self.cmdSave.connect('clicked', self.save_launchers)
117 self.builder.get_object('cmdRemove').connect('clicked', self.remove_from_launcher)
118 self.cmdIcon.connect('clicked', self.load_icon_from_file)
119 self.builder.get_object('cmdRun').connect('clicked', self.open_executable)
120 self.chkTerminal.connect('toggled', self.chk_toggle)
121
122 #editable events
123 self.txtName.connect('focus-out-event', self.on_txt_focus_out)
124 self.txtComment.connect('focus-out-event', self.on_txt_focus_out)
125 self.txtCommand.connect('focus-out-event', self.on_txt_focus_out)
126
127 #list group signals
128 self.tvwGroups.connect('selection-changed', self.on_tvwgroups_row_change)
129
130 #group signals
131 self.builder.get_object('btnAdd').connect('clicked', self.add_remove_group, TOOLBUTTON_ADD)
132 self.btnRemove.connect('clicked', self.add_remove_group, TOOLBUTTON_REMOVE)
133 self.btnEdit.connect('clicked', self.add_remove_group, TOOLBUTTON_EDIT)
134
135 def show(self):
136 self.window.show_all()
137
138 def normalize_path(self, str_path):
139 file_name = basename(str_path)
140 str_path = '%s/.local/share/applications/%s' % (expanduser('~'),
141 file_name)
142 return str_path
143
144 def load_launcher_from_list(self, unity_items):
145 self.listview_launcher.clear_list();
146 for menu_item in unity_items:
147 obj=DesktopParser(menu_item)
148 sname = obj.get('Name')
149 desc = obj.get('Comment')
150 icon = obj.get('Icon')
151 pix = IconManager().get_icon(ThemedIcon('image-missing'),IMAGE_SIZE)
152 if icon:
153 if icon.rfind('.') != -1:
154 pix = IconManager().get_icon(FileIcon(File(icon)),IMAGE_SIZE)
155 else:
156 pix = IconManager().get_icon(ThemedIcon(icon),IMAGE_SIZE)
157 data = (pix, '%s' % sname, obj, sname.upper(), menu_item)
158 self.listview_launcher.add_row(data)
159
160 self.listview_launcher.connect('selection-changed', self.listview_launcher_row_change)
161 #make first row active
162 self.listview_launcher.set_cursor((0,))
163
164 def save_launchers(self, widget):
165 dialog = MessageBox(self.window,
166 window_title=_('Save'),
167 action_text=_('Save changes'),
168 message=_('Do you want to save your changes?'),
169 dlg_type=DialogType.DIALOG_CONFIRMATION,
170 label_text=None
171 )
172 result, text = dialog.run()
173 if result:
174 launchers = []
175 for row in self.listview_launcher.get_rows():
176 file_path = self.normalize_path(row["path"])
177 fli = open(file_path, 'w')
178
179 obj = row["obj"]
180 obj.write(fli)
181 fli.close()
182 launchers.append(file_path)
183
184 if self.controller:
185 self.controller.save_unity_list(launchers)
186 MessageBox(self.window,
187 window_title=_('Information'),
188 action_text=_('Changes saved'),
189 message=_('Your changes were successfuly saved.\n\n To apply the changes to your launcher you will need to <b>logout</b> and login again.'),
190 dlg_type=DialogType.DIALOG_MESSAGE,
191 label_text=None
192 ).run()
193 else:
194 MessageBox(self.window,
195 window_title=_('Error'),
196 action_text=_('Changes not saved'),
197 message=_("There's a problem with your application, \n controller not found."),
198 dlg_type=DialogType.DIALOG_MESSAGE,
199 label_text=None
200 ).run()
201
202
203 def chk_toggle(self, widget):
204 # only run when gaving the focus
205 # this will prevent execution when setting the value by code.
206
207 if widget.is_focus():
208 objDesktop = self.listview_launcher.get_selected_desktop()
209 value = widget.get_active()
210 option = widget.get_name()
211 objDesktop.set(option, value)
212
213 def on_txt_focus_out(self, widget, event):
214 ilength = 0
215 if isinstance(widget, gtk.TextView):
216 buffer = widget.get_buffer()
217 value = buffer.get_text(buffer.get_start_iter(),
218 buffer.get_end_iter())
219 ilength = len(value)
220 else:
221 ilength = widget.get_text_length()
222 value = widget.get_text()
223
224 if ilength > 0:
225 objDesktop = self.listview_launcher.get_selected_desktop()
226 option = widget.get_name()
227 objDesktop.set(option, value)
228 if option == 'Name' or option == 'Comment':
229 sname = objDesktop.get('Name')
230 desc = objDesktop.get('Comment')
231 self.listview_launcher.set_value('<b>%s</b>\n%s' % (sname, desc), self.listview_launcher.COLUMN_NAME)
232
233 def add_remove_group(self, widget, operation):
234
235 objDesktop = self.listview_launcher.get_selected_desktop()
236
237 if operation == TOOLBUTTON_ADD:
238 #TODO : update ayatana entry
239
240 dialog = GroupsDialog(parent=self.window)
241 result, group = dialog.run()
242 if result:
243 root = self.tvwGroups.add_root(group['GroupName'])
244
245 shortcut_group_name = "%s Shortcut Group" % group['GroupName']
246 self.tvwGroups.add_root_row(root, 'Name', group['Name'])
247 self.tvwGroups.add_root_row(root, 'Exec', group['Exec'])
248 self.tvwGroups.add_root_row(root, 'TargetEnvironment', group['TargetEnvironment'])
249
250 items = objDesktop.get('X-Ayatana-Desktop-Shortcuts')
251 if items is None:
252 items = []
253 else:
254 items = [n for n in items if n != '']
255 items.append(group['GroupName'])
256 objDesktop.set('X-Ayatana-Desktop-Shortcuts', items)
257
258 objDesktop.append_section(shortcut_group_name)
259 objDesktop.set('Name', group['Name'] , None, shortcut_group_name)
260 objDesktop.set('Exec', group['Exec'] , None, shortcut_group_name)
261 objDesktop.set('TargetEnvironment', group['TargetEnvironment'] , None, shortcut_group_name)
262 self.tvwGroups.expand(root, True)
263
264
265
266 elif operation == TOOLBUTTON_REMOVE:
267 dialog = MessageBox(self.window,
268 window_title=_('Remove') ,
269 action_text=_('Remove Group'),
270 message=_('You are about to remove a Quick List Group, are you sure?'),
271 dlg_type=DialogType.DIALOG_CONFIRMATION,
272 label_text=None
273 )
274 result = dialog.run()
275
276 if result[0]:
277 root_iter = self.tvwGroups.get_selected_root()
278 group = self.tvwGroups.get_root_text()
279 shortcut_group_name = "%s Shortcut Group" % group
280
281 self.tvwGroups.remove_root(root_iter)
282
283 items = objDesktop.get('X-Ayatana-Desktop-Shortcuts')
284 items.remove(group)
285 groups = [x for x in items if x != '']
286 objDesktop.remove_sections(shortcut_group_name)
287 objDesktop.set('X-Ayatana-Desktop-Shortcuts', groups)
288
289 elif operation == TOOLBUTTON_EDIT:
290 root_iter = self.tvwGroups.get_selected_root()
291
292 root_text = self.tvwGroups.get_root_text()
293
294 shortcut_group_name = "%s Shortcut Group" % root_text
295
296 items = self.tvwGroups.get_children_values(root_iter)
297
298 dialog = GroupsDialog(parent=self.window)
299 dialog.populate(items)
300 result, group = dialog.run()
301
302 if result:
303 self.tvwGroups.set_child_value(root_iter, 0, group['Name'])
304 self.tvwGroups.set_child_value(root_iter, 1, group['Exec'])
305 self.tvwGroups.set_child_value(root_iter, 2, group['TargetEnvironment'])
306
307 objDesktop.set('Name', group['Name'] , LOCALE, shortcut_group_name)
308 objDesktop.set('Exec', group['Exec'] ,LOCALE, shortcut_group_name)
309 objDesktop.set('TargetEnvironment', group['TargetEnvironment'] , LOCALE, shortcut_group_name)
310
311
312
313 def remove_from_launcher(self, widget):
314 """Signal handler for button to remoce an item from the Launcher List"""
315
316 if self.listview_launcher.is_selected:
317 dialog = MessageBox(window_title=_('Remove') ,
318 parent=self.window,
319 action_text=_('Remove Launcher'),
320 message=_('You are about to remove a Launcher item, are you sure?'),
321 dlg_type=DialogType.DIALOG_CONFIRMATION,
322 label_text=None
323 )
324 result, text = dialog.run()
325 if result:
326 self.listview_launcher.remove_current_row()
327
328 else:
329 MessageBox(self.window, window_title=_('Remove') ,
330 action_text=_('Remove Launcher'),
331 message=_('No launcher selected'),
332 dlg_type=DialogType.DIALOG_CONFIRMATION,
333 label_text=None
334 ).run()
335
336 def add_new_launcher(self, widget):
337 """Signal handler for button to add a new item into the Launcher List"""
338
339 dialog = MessageBox(self.window,
340 window_title=_('Add Launcher') ,
341 action_text=_('Add a new launcher...') ,
342 message=_('Type a launcher name to create a new launcher.'),
343 dlg_type=DialogType.DIALOG_INPUT,
344 label_text=_('Name:')
345 )
346
347 result, text = dialog.run()
348
349 if result and len(text) > 0:
350 desktop_parser = DesktopParser()
351 desktop_parser.set('Name', text)
352 desktop_parser.set('Terminal', False)
353 desktop_parser.set('Icon', 'wft')
354 path_name = join(expanduser('~/.local/share/applications/'),
355 '%s.desktop' % text)
356 row_iter = self.listview_launcher.add_row(path_name, True, desktop_parser)
357 return row_iter
358
359 def open_executable(self, widget):
360 dialog = FileChooser()
361 response, filename = dialog.run()
362 if response:
363 self.txtCommand.set_text(filename)
364 objDesktop = self.listview_launcher.get_selected_desktop()
365 objDesktop.set(self.txtCommand.get_name(), filename)
366
367
368 def load_icon_from_file(self, widget):
369 # XXX: Here maybe we could make a list with all mimetypes and patterns
370 # somewhere else and just iterate over them here.
371 filter = gtk.FileFilter()
372 filter.set_name("Images")
373 filter.add_mime_type("image/png")
374 filter.add_mime_type("image/jpeg")
375 filter.add_mime_type("image/gif")
376 filter.add_mime_type("image/svg+xml")
377 filter.add_pattern("*.png")
378 filter.add_pattern("*.jpg")
379 filter.add_pattern("*.gif")
380 filter.add_pattern("*.tif")
381 filter.add_pattern("*.xpm")
382 filter.add_pattern("*.svg")
383
384 dialog = FileChooser(filters=filter)
385 response, filename = dialog.run()
386 if response:
387 pixbuf = get_icon(filename)
388 self.imgIcon.set_from_pixbuf(pixbuf)
389 # TODO: add code to write changes here
390 # the best way is to put an apply button?
391 objDesktop = self.listview_launcher.get_selected_desktop()
392 objDesktop.set('Icon', filename)
393 self.listview_launcher.set_value(pixbuf, self.listview_launcher.COLUMN_ICON)
394
395 def listview_launcher_row_change(self, widget, model, row_iter, objDesktop):
396
397 #disable groups toobar buttons
398 self.btnEdit.set_sensitive(False)
399 self.btnRemove.set_sensitive(False)
400
401 # show properties
402 self.imgIcon.set_from_pixbuf(widget.get_selected_icon())
403
404 self.txtName.set_text(nullstring(objDesktop.get('Name', locale = LOCALE)))
405 self.txtComment.get_buffer().set_text(
406 nullstring(objDesktop.get('Comment', locale = LOCALE)))
407 self.txtCommand.set_text(nullstring(objDesktop.get('Exec')))
408
409 checked = objDesktop.get('Terminal')
410 if not checked:
411 checked = False
412
413 self.chkTerminal.set_active(checked)
414 items = [item.replace(' Shortcut Group','') for item in objDesktop._sections]
415 #items = objDesktop.get('X-Ayatana-Desktop-Shortcuts')
416 items.remove('Desktop Entry')
417 self.tvwGroups.clear()
418
419 if items:
420 if isinstance(items, str):
421 items = [items]
422
423 for group in items:
424 if group != '':
425 root = self.tvwGroups.add_root(group)
426 for key in ('Name', 'Exec', 'TargetEnvironment'):
427 value = objDesktop.get(key, "%s Shortcut Group" % group, locale = LOCALE )
428 if value:
429 self.tvwGroups.add_root_row(root, key, value)
430 self.tvwGroups.expand_all()
431
432
433 def on_tvwgroups_row_change(self, widget, root_iter):
434 if root_iter:
435 self.btnEdit.set_sensitive(True)
436 self.btnRemove.set_sensitive(True)
437 else:
438 self.btnEdit.set_sensitive(True)
439 self.btnRemove.set_sensitive(True)
440
4410
=== removed file 'unitylaunchereditor/newlauncher.py'
--- unitylaunchereditor/newlauncher.py 2011-05-26 11:04:59 +0000
+++ unitylaunchereditor/newlauncher.py 1970-01-01 00:00:00 +0000
@@ -1,267 +0,0 @@
1# -*- coding: utf-8 -*-
2#####################################################################
3# Laudeci Oliveira <laudeci@ubuntu.com>
4# Ursula Junques <ursinha@ubuntu.com>
5#
6# Copyright 2011 unity-launcher-editor-dev.
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published
10# by the Free Software Foundation; version 3 only.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17#####################################################################
18
19import gtk
20import gobject
21import glob
22import pango
23from desktop import DesktopParser
24from os.path import exists, expanduser, isdir, isfile, join
25from xdg import BaseDirectory
26from pkg_resources import resource_filename
27from utils import DialogType, FileChooser, get_icon, MessageBox, nullstring
28# Constants for column mapping
29(COLUMN_ICON,
30 COLUMN_NAME,
31 COLUMN_DESKTOP,
32 COLUMN_PATH,
33 COLUMN_COMMENT,
34 COLUMN_SORT) = range(6)
35
36class AddLauncherDialog(gtk.Dialog):
37 """XXX: add docs."""
38 def __init__(self, title='Add Launcher...'):
39 super(AddLauncherDialog, self).__init__(title,
40 None, (gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT |
41 gtk.DIALOG_NO_SEPARATOR),
42 (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
43
44 glade_file = "application.glade"
45 self.builder = gtk.Builder()
46 glade_path = resource_filename(__name__, join("data", glade_file))
47 #glade_path = join(expanduser("~/Desktop/unity-launcher-editor/data"), glade_file)
48 if not exists(glade_path):
49 raise Exception("Critical: couldn't find glade file: %s" % glade_path)
50 self.builder.add_from_file(glade_path)
51 self.add_panel = self.builder.get_object('add_new_laucher_box')
52
53 self.ok_button = self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
54 self.ok_button.grab_default()
55 self.ok_button.set_sensitive(False)
56 self.set_alternative_button_order(
57 [gtk.RESPONSE_CANCEL, gtk.RESPONSE_OK])
58
59 self.lvwAddLaunchers = self.builder.get_object('lvwAddLaunchers')
60 self.txtSearch = self.builder.get_object('entry2')
61 self.txtSearch.connect("icon-press", lambda x, y, z : self.filter.refilter())
62
63 self.listmodel = gtk.ListStore(gtk.gdk.Pixbuf, gobject.TYPE_STRING,
64 gobject.TYPE_PYOBJECT, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING)
65
66 self.filter = self.listmodel.filter_new()
67 self.filter.set_visible_func(self.match_type)
68 self.sorter = gtk.TreeModelSort(self.filter)
69 render_pixbuf = gtk.CellRendererPixbuf()
70 render_text = gtk.CellRendererText()
71
72 col = gtk.TreeViewColumn()
73
74 col.pack_start(render_pixbuf, expand=False)
75 col.add_attribute(render_pixbuf, 'pixbuf', COLUMN_ICON)
76 col.pack_start(render_text, expand=True)
77 col.add_attribute(render_text, 'text', COLUMN_NAME)
78 self.lvwAddLaunchers.append_column(col)
79 render_comment = gtk.CellRendererText()
80
81 col = gtk.TreeViewColumn()
82 col.pack_start(render_comment, expand=True)
83 col.add_attribute(render_comment, 'text', COLUMN_COMMENT)
84 #render_comment.set_property('ellipsize',pango.ELLIPSIZE_END)
85 render_comment.set_property('wrap-mode',pango.WRAP_WORD)
86 render_comment.set_property('wrap-width',500)
87 self.lvwAddLaunchers.append_column(col)
88 self.lvwAddLaunchers.set_model(self.sorter)
89 #self.lvwAddLaunchers.set_search_entry(self.txtSearch);
90 apps_list = []
91 for n in ['/usr/share/']:#BaseDirectory.xdg_data_dirs:
92 desktop_dir = '%sapplications' % n
93
94 for launcher_location in glob.glob('%s/*.desktop' % desktop_dir):
95 # blacklist ubiquity as will have two ubiquity in the netbook live session then
96 if not "ubiquity" in launcher_location:
97 apps_list.append(launcher_location) #= self.register_new_app(launcher_location, apps_list)
98 apps_list.sort()
99 self.populate(apps_list)
100 self.listmodel.set_sort_column_id(COLUMN_SORT,gtk.SORT_ASCENDING)
101 self.vbox.pack_start(self.add_panel, True, True, 0)
102
103
104 def match_type(self, model, iter):
105 value = model.get_value(iter, COLUMN_DESKTOP)
106
107 if self.txtSearch.get_text_length() == 0:
108 return True
109 if self.txtSearch.get_text().lower() in value.get("Name").lower():
110 return True
111 else:
112 return False
113
114 def populate(self, values):
115 var = []
116 from gio import app_info_get_all
117
118 items = app_info_get_all()
119 for appinfo in items:
120 sname=appinfo.get_name()
121 icon = appinfo.get_icon()
122
123 if icon is None:
124 pix = get_icon('image-missing', 16)
125 else:
126 icon = icon.to_string()
127 pix = get_icon(icon, 16)
128
129 comm = appinfo.get_description()
130 self.listmodel.append((pix, '%s' % sname, None, appinfo.get_id(), comm,sname.upper()))
131
132 return
133 for menu_item in values:
134 print menu_item
135 desktop_parser = DesktopParser(menu_item)
136 desktop_parser.update_keys()
137 sname = desktop_parser.get('Name')
138 icon = desktop_parser.get('Icon')
139 comm = desktop_parser.get('Exec')
140 if sname is None:
141 sname = desktop_parser.get('Name', 'en')
142 if icon is None:
143 pix = get_icon('image-missing', 16)
144 else:
145 pix = get_icon(icon, 16)
146 var.append(('%s' % sname, pix, desktop_parser, menu_item, comm,sname.upper()))
147
148 #self.listmodel.append((pix, '%s' % sname, desktop_parser, menu_item))
149 #var.sort()
150
151 for sname, pix, desktop_parser, menu_item, comm, ssort in var:
152 self.listmodel.append((pix, '%s' % sname, desktop_parser, menu_item, comm,ssort.upper()))
153 #self.main_window.listview_launcher.set_model(store)
154
155 def get_desktop_dir(self):
156 ''' no python binding from xdg to get the desktop directory? '''
157
158 possible_desktop_folder = None
159 try:
160 for line in file('%s/user-dirs.dirs' % BaseDirectory.xdg_config_home):
161 values = line.split('=')
162 if values[0] == 'XDG_DESKTOP_DIR':
163 try:
164 possible_desktop_folder = values[1][1:-2].replace('$HOME', expanduser('~'))
165 if isdir(possible_desktop_folder):
166 return possible_desktop_folder
167 else:
168 possible_desktop_folder = None
169 break
170 except IndexError:
171 continue
172 except IOError:
173 pass
174 return expanduser('~/Desktop')
175
176
177 def register_new_app(self, launcher_location, apps_list):
178 ''' append a new app with full desktop path if valid, take care of dups '''
179
180 # default distribution launcher don't go into that function (as don't have an aboslute path)
181 entry = ""
182 if exists(launcher_location):
183 print " == %s: exists" % launcher_location
184 # try to strip the full path we had in unity mutter if it's part of a xdg path:
185 # or try to get that for other desktop file based on name.
186 candidate_desktop_filename = launcher_location.split("/")[-1]
187 # some desktop file with modified exec key (like in cairo-dock contains 01desktopfilename.desktop, strip that)
188 try:
189 candidate_cairodock_desktop_filename = candidate_desktop_filename.split("01")[1]
190 except IndexError:
191 candidate_cairodock_desktop_filename = ""
192 for xdg_dir in BaseDirectory.xdg_data_dirs:
193 xdg_app_dir = join(xdg_dir, "applications", "")
194 if launcher_location.startswith(xdg_app_dir):
195 candidate_desktop_file = launcher_location.split(xdg_app_dir)[1]
196 # if really the xdg path is the path to the launcher
197 if not '/' in candidate_desktop_file:
198 entry = candidate_desktop_file
199 print " Direct match found for system desktop file"
200 break
201 # second chance: try to see if the desktop filename is in xdg path and so, assume it's a match
202 if not entry and exists("%s/%s" % (xdg_app_dir, candidate_desktop_filename)):
203 entry = candidate_desktop_filename
204 print" Similar desktop file name with system desktop file"
205 break
206 # third chance: try to see if a tweaked cairo-dock like deskto file name is in xdg path
207 if not entry and exists("%s/%s" % (xdg_app_dir, candidate_cairodock_desktop_filename)):
208 entry = candidate_cairodock_desktop_filename
209 print " Similar Cairo-Dock -like desktop file name with system desktop file"
210 break
211 # fourth and last chance: try to find a corresponding Exec key.
212 # Wait! scanning /usr/share/applications is heavy !!!
213 # Don't panic, we have the bamf.index for that :)
214 if not entry:
215 exec_arg = ""
216 try:
217 for line in open(launcher_location):
218 if "Exec=" in line:
219 exec_arg = line.split("Exec=")[1]
220 break
221 except IOError:
222 print " Can't open %s for reading Exec" % launcher_location
223 if exec_arg:
224 try:
225 for line in open("/usr/share/applications/bamf.index"):
226 if exec_arg in line:
227 entry = line.split()[0]
228 print " Coherent exec key found with system desktop file"
229 break
230 except IOError:
231 print " No bamf.index file found on the system!"
232
233 if not entry:
234 entry = launcher_location
235 print " %s: real entry is %s" % (launcher_location, entry)
236 if entry not in apps_list:
237 print " --- adding %s as not in app_list" % entry
238 apps_list.append(entry)
239 else:
240 print" --- NOT adding %s as already in app_list" % entry
241 else:
242 print" == %s: doesn't exist" % launcher_location
243
244 return apps_list
245
246 def run(self, destroy=True):
247 """Returns True if yes was clicked, False otherwise."""
248 resp = super(AddLauncherDialog, self).run()
249 obj = None
250 if resp == gtk.RESPONSE_OK:
251 obj = {'GroupName': self.txtGroup.get_text(),
252 'Name': self.txtName.get_text(),
253 'Exec': self.txtCommand.get_text(),
254 'TargetEnvironment': (
255 self.cmbTargetEnvironment.get_active_text()),
256 }
257 if destroy:
258 self.destroy()
259 if resp == gtk.RESPONSE_OK:
260 return True, obj
261 else:
262 return False, None
263
264
265if __name__ == "__main__":
266 dialog = AddLauncherDialog()
267 result, group = dialog.run()
2680
=== removed file 'unitylaunchereditor/utils.py'
--- unitylaunchereditor/utils.py 2011-05-21 19:45:30 +0000
+++ unitylaunchereditor/utils.py 1970-01-01 00:00:00 +0000
@@ -1,152 +0,0 @@
1# -*- coding: utf-8 -*-
2#####################################################################
3# Laudeci Oliveira <laudeci@ubuntu.com>
4# Ursula Junque <ursinha@ubuntu.com>
5#
6# Copyright 2011 unity-launcher-editor-dev.
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published
10# by the Free Software Foundation; version 3 only.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17#####################################################################
18
19import gtk
20from gobject import GError
21from os.path import isfile
22
23
24def get_icon(filename, size=48):
25 image_size = size
26 image = gtk.Image()
27 icon_theme = gtk.icon_theme_get_default()
28
29 if isfile(filename):
30 image.set_from_file(filename)
31 icon = image.get_pixbuf()
32 # resize the image to 48 pixels
33 if icon:
34 icon = icon.scale_simple(image_size, image_size,
35 gtk.gdk.INTERP_BILINEAR)
36 else:
37 try:
38 # to fix skype error loading a named icon like skype.png and no
39 # skype
40 icon = icon_theme.load_icon(filename.split('.')[0], image_size, 0)
41 except:
42 # returns a default icon, which unity uses when no icon is found.
43 try:
44 icon = icon_theme.load_icon('twf', image_size, 0)
45 except GError:
46 # icon not found, defaulting to the last fallback
47 icon = icon_theme.load_icon('image-missing', image_size, 0)
48 return icon
49
50
51def nullstring(text):
52 if text is None:
53 text = ''
54 return text
55
56
57class DialogType:
58 """ Class to define constants for define Message class types"""
59 (
60 DIALOG_INPUT,
61 DIALOG_MESSAGE,
62 DIALOG_CONFIRMATION
63 ) = range(3)
64
65class FileChooser(gtk.FileChooserDialog):
66 def __init__(self, title='Open...', filters=None):
67 super(FileChooser, self).__init__(
68 title,
69 None,
70 gtk.FILE_CHOOSER_ACTION_OPEN, (
71 gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
72 gtk.STOCK_OPEN, gtk.RESPONSE_OK)
73 )
74 self.set_default_response(gtk.RESPONSE_OK)
75 if filters:
76 self.add_filter(filters)
77
78 def run(self, destroy=True):
79 """Returns True if yes was clicked, False otherwise."""
80 resp = super(FileChooser, self).run()
81
82 filename = self.get_filename()
83 if destroy:
84 self.destroy()
85 if resp == gtk.RESPONSE_OK:
86 return True, filename
87 else:
88 return False, None
89
90class MessageBox(gtk.MessageDialog):
91 def __init__(self, parent,
92 window_title,
93 action_text,
94 message,
95 dlg_type=DialogType.DIALOG_MESSAGE,
96 label_text=None):
97
98 text = "<b>%s</b>\n\n%s" % (action_text, message)
99
100 self.dialog_type = dlg_type
101
102 if dlg_type == DialogType.DIALOG_MESSAGE:
103 icon = gtk.MESSAGE_WARNING
104 buttons = gtk.BUTTONS_OK
105 elif dlg_type == DialogType.DIALOG_INPUT:
106 icon = gtk.MESSAGE_QUESTION
107 buttons = gtk.BUTTONS_CANCEL
108 elif dlg_type == DialogType.DIALOG_CONFIRMATION:
109 icon = gtk.MESSAGE_QUESTION
110 buttons = gtk.BUTTONS_YES_NO
111
112 super(MessageBox, self).__init__(parent,
113 gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
114 icon, buttons)
115 self.set_title(window_title)
116 self.set_markup(text)
117 self.set_transient_for(parent)
118 if dlg_type == DialogType.DIALOG_INPUT:
119
120 # create a horizontal box to pack the entry and a label
121 self.text = gtk.Entry()
122 self.text.set_activates_default(gtk.TRUE)
123 hbox = gtk.HBox()
124 hbox.pack_start(gtk.Label(label_text), False, 5, 5)
125 hbox.pack_end(self.text)
126 self.vbox.pack_end(hbox, True, True, 0)
127 self.ok_button = self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
128 self.ok_button.grab_default()
129
130 self.ok_button.set_sensitive(False)
131 self.set_alternative_button_order([gtk.RESPONSE_CANCEL, gtk.RESPONSE_OK])
132 self.set_default_response(gtk.RESPONSE_OK)
133 self.text.connect('changed', lambda widget: self.ok_button.set_sensitive(widget.get_text_length() > 0))
134
135 self.show_all()
136
137 def run(self, destroy=True):
138 """Returns True if yes was clicked, False otherwise."""
139 resp = super(MessageBox, self).run()
140 dialog_type = self.dialog_type
141 text = None
142 if self.dialog_type == DialogType.DIALOG_INPUT:
143 text = self.text.get_text()
144 if destroy:
145 self.destroy()
146 if resp == gtk.RESPONSE_YES or resp == gtk.RESPONSE_OK:
147 if dialog_type == DialogType.DIALOG_INPUT:
148 return True, text
149 else:
150 return True, text
151 else:
152 return False, text
1530
=== removed file 'unitylaunchereditor/widgets.py'
--- unitylaunchereditor/widgets.py 2011-06-07 15:07:44 +0000
+++ unitylaunchereditor/widgets.py 1970-01-01 00:00:00 +0000
@@ -1,276 +0,0 @@
1# -*- coding: utf-8 -*-
2
3# Authors: Natalia B. Bidart <nataliabidart@canonical.com>
4# Authors: Evan Dandrea <evan.dandrea@canonical.com>
5#
6# Copyright 2009-2010 Canonical Ltd.
7#
8# This program is free software; you can redistribute it and/or
9# modify it under the terms of the GNU General Public License
10# as published by the Free Software Foundation; either version 2
11# of the License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranties of
15# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
16# PURPOSE. See the GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License along
19# with this program. If not, see <http://www.gnu.org/licenses/>.
20
21"""A set of useful widgets."""
22
23from os.path import expanduser, join
24import gobject
25import gtk
26from pango import WRAP_WORD
27
28from gio import app_info_get_all,ThemedIcon, AppInfo
29
30from unitylaunchereditor.core.iconmanager import IconManager
31from unitylaunchereditor.core.util.dialogs import MessageBox
32from unitylaunchereditor.core.translation import _
33from unitylaunchereditor.widgets.launcherview import LauncherView
34from unitylaunchereditor.widgets.launcherinfo import LauncherInfo
35from unitylaunchereditor.addassistant import PageFromSystem, PageFromFile
36
37DEFAULT_PADDING = (10, 10)
38
39
40class Loading(gtk.HBox):
41 """A spinner and a label."""
42
43 def __init__(self, label, fg_color=None, *args, **kwargs):
44 super(Loading, self).__init__(*args, **kwargs)
45 self.label = gtk.Label(label)
46 self.spinner = gtk.Spinner()
47 self.spinner.start()
48
49 if fg_color is not None:
50 self.spinner.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(fg_color))
51 self.label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(fg_color))
52
53 self.pack_start(self.spinner, expand=False)
54 self.pack_start(self.label, expand=False)
55 self.set_spacing(5)
56
57 self.show_all()
58
59
60class LabelLoading(gtk.Alignment):
61 """A spinner and a label."""
62
63 def __init__(self, loading_label, fg_color=None, *args, **kwargs):
64 super(LabelLoading, self).__init__(*args, **kwargs)
65 self.loading = Loading(loading_label, fg_color=fg_color)
66
67 self.label = gtk.Label()
68 self.label.set_selectable(True)
69 self.label.show()
70 if fg_color is not None:
71 self.label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(fg_color))
72
73 self.add(self.loading)
74
75 self.show()
76 self.set(xalign=0.5, yalign=0.5, xscale=0, yscale=0)
77 self.set_padding(padding_top=5, padding_bottom=0,
78 padding_left=5, padding_right=5)
79 self.start()
80
81 @property
82 def active(self):
83 """Whether the Loading widget is visible or not."""
84 return self.gLabelLoadinget_child() is self.loading
85
86 def start(self):
87 """Show the Loading instead of the Label widget."""
88 for child in self.get_children():
89 self.remove(child)
90
91 self.add(self.loading)
92
93 def stop(self):
94 """Show the label instead of the Loading widget."""
95 for child in self.get_children():
96 self.remove(child)
97
98 self.add(self.label)
99
100 def set_text(self, text):
101 """Set 'text' to be the label's text."""
102 self.label.set_text(text)
103
104 def set_markup(self, text):
105 """Set 'text' to be the label's markup."""
106 self.label.set_markup(text)
107
108 def get_text(self):
109 """Get the label's text."""
110 return self.label.get_text()
111
112 def get_label(self):
113 """Get the label's markup."""
114 return self.label.get_label()
115
116
117class PanelTitle(gtk.Label):
118 """A box with a given color and text."""
119
120 def __init__(self, markup='', fg_color=None, **kwargs):
121 super(PanelTitle, self).__init__(fg_color, **kwargs)
122 self.set_markup(markup)
123 self.set_padding(*DEFAULT_PADDING)
124 self.set_property('xalign', 0.0)
125 self.set_line_wrap(True)
126 self.set_line_wrap_mode(WRAP_WORD)
127 self.set_selectable(False)
128 if fg_color:
129 self.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(fg_color))
130
131 self.show_all()
132
133def on_size_allocate(widget, allocation, label):
134 """Resize labels according to who 'widget' is being resized."""
135 label.set_size_request(allocation.width - 2, -1)
136
137class UbuntuOneBin(gtk.VBox):
138 """A Ubuntu One bin."""
139
140 TITLE = ''
141
142 def __init__(self, title=None):
143 gtk.VBox.__init__(self)
144 self._is_processing = False
145
146 if title is None:
147 title = self.TITLE
148
149 title = '<span font_size="large" color="white">%s</span>' % title
150 self.title = PanelTitle(markup=title)
151 self.pack_start(self.title, expand=False)
152
153 self.message = LabelLoading('loading...')
154 #self.pack_start(self.message, expand=False)
155
156 self.connect('size-allocate', on_size_allocate, self.title)
157
158 self.show_all()
159 def set_title(self,value):
160 self.title.set_markup('<span font_size="large" color="white">%s</span>' % value)
161 def _get_is_processing(self):
162 """Is this panel processing a request?"""
163 return self._is_processing
164
165 def _set_is_processing(self, new_value):
166 """Set if this panel is processing a request."""
167 if new_value:
168 self.message.start()
169 self.set_sensitive(False)
170 else:
171 self.message.stop()
172 self.set_sensitive(True)
173
174 self._is_processing = new_value
175
176 is_processing = property(fget=_get_is_processing, fset=_set_is_processing)
177
178class Doit(gtk.HBox):
179 def __init__(self):
180 super(Doit, self).__init__()
181 hsep = gtk.HSeparator()
182 hsep.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color('#43413c'))
183
184 hsep2 = gtk.HSeparator()
185 hsep2.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color('#43413c'))
186
187 hbbox = gtk.HButtonBox()
188 hbbox.set_layout(gtk.BUTTONBOX_SPREAD)
189 hbbox.set_spacing(-1)
190
191 self.grad1 = gtk.RadioButton(group=None, label="From System")
192 self.grad2 = gtk.RadioButton(group=self.grad1, label="From File")
193 self.grad3 = gtk.RadioButton(group=self.grad1, label="Custom")
194
195 self.grad1.set_property('draw_indicator', False)
196 self.grad2.set_property('draw_indicator', False)
197 self.grad3.set_property('draw_indicator', False)
198
199 hbbox.pack_start(self.grad1, False,False,-5)
200 hbbox.pack_start(self.grad2, False,False,-5)
201 hbbox.pack_start(self.grad3, False,False,-5)
202
203
204 self.pack_start(hsep)
205 self.pack_start(hbbox, False,True,0)
206 self.pack_start(hsep2)
207
208def change_page(widget,note, id, u1):
209 messages = {
210 0:"Create a Launcher from System",
211 1:"Create a Launcher from file",
212 2:"Create a custom Launcher"
213 }
214 note(id)
215 u1.set_title(messages[id])
216
217if __name__ == "__main__":
218 b= gtk.Window()
219 b.set_resizable(False)
220 b.present_with_time(1)
221 b.set_urgency_hint(True)
222
223 b.set_default_size(700, 500)
224 b.set_size_request(700, 500)
225
226 itself = gtk.VBox()
227 header = gtk.EventBox()
228 header.set_visible_window(True)
229 header.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color('#3c3b37'))
230
231 notebook= gtk.Notebook()
232 notebook.set_border_width(0)
233 notebook.set_show_border(False)
234 notebook.set_show_tabs(False)
235 button_box = gtk.HButtonBox()
236 button_box.set_layout(gtk.BUTTONBOX_END)
237 button_box.set_border_width(6)
238 #button_box.pack_start(gtk.Button('cancel'))
239 close_button = gtk.Button('Close')
240 button_box.pack_start(close_button)
241 close_button.connect('clicked', lambda w: gtk.main_quit())
242 itself.show_all()
243
244 u1=UbuntuOneBin('Create a Launcher from System')
245 vbox2 = gtk.VBox()
246 vbox2.pack_start(u1, False,False)
247 don=Doit()
248
249 don.grad1.connect('toggled', change_page, notebook.set_current_page, 0, u1)
250 don.grad2.connect('toggled', change_page,notebook.set_current_page,1, u1)
251 don.grad3.connect('toggled', change_page,notebook.set_current_page,2,u1)
252 vbox2.pack_start(don, False,False)
253
254 header.add(vbox2)
255 button_box.show_all()
256 itself.pack_start(header, False,True)
257 itself.pack_start(notebook, True,True,0)
258 itself.pack_start(gtk.HSeparator(), False,True,0)
259 itself.pack_start(button_box, False,True,0)
260
261 fra=PageFromSystem()
262
263 notebook.append_page(fra)
264
265 pfile = PageFromFile()
266 notebook.append_page(pfile)
267
268 pnew=LauncherInfo()
269 notebook.append_page(pnew)
270 itself.show_all()
271 b.add(itself)
272 b.connect('delete-event', lambda w, e: gtk.main_quit())
273
274 b.set_title("Add Launcher...")
275 #.show_all()
276 gtk.main()
2770
=== modified file 'unitylaunchereditor/widgets/dialogheader.py'
--- unitylaunchereditor/widgets/dialogheader.py 2011-06-08 20:27:45 +0000
+++ unitylaunchereditor/widgets/dialogheader.py 2011-11-28 17:31:26 +0000
@@ -15,27 +15,27 @@
15# GNU General Public License for more details.15# GNU General Public License for more details.
16#16#
17#####################################################################17#####################################################################
18import gobject18from gi.repository import GObject
19import gtk19from gi.repository import Gtk
20from pango import ELLIPSIZE_END20from gi.repository import Pango
2121
22from unitylaunchereditor.core.translation import _22from unitylaunchereditor.core.translation import _
2323
24class DialogHeader(gtk.VBox):24class DialogHeader(Gtk.VBox):
25 __title__ = 'WARNING: can not get name'25 __title__ = 'WARNING: can not get name'
26 __desc__ = ' '26 __desc__ = ' '
2727
28 def __init__(self, title = None):28 def __init__(self, title = None):
29 super(DialogHeader,self).__init__()29 Gtk.VBox.__init__(self)
30 self.set_border_width(0)30 self.set_border_width(0)
31 if title:31 if title:
32 self.__title__ = title32 self.__title__ = title
33 if self.__title__ and self.__desc__:33 if self.__title__ and self.__desc__:
34 self.__draw_title()34 self.__draw_title()
3535
36 self.inner_vbox = gtk.VBox(False, 0)36 self.inner_vbox = Gtk.VBox(False, 0)
37 self.inner_vbox.set_border_width(0)37 self.inner_vbox.set_border_width(0)
38 self.pack_start(self.inner_vbox)38 self.pack_start(self.inner_vbox, False, False, 0)
3939
40 def set_title(self, title):40 def set_title(self, title):
41 self.__title__ = title41 self.__title__ = title
@@ -50,7 +50,7 @@
50 if value.rfind('.') != -1:50 if value.rfind('.') != -1:
51 self.image.set_from_file(value)51 self.image.set_from_file(value)
52 else:52 else:
53 self.image.set_from_icon_name(value, gtk.ICON_SIZE_DIALOG)53 self.image.set_from_icon_name(value, Gtk.IconSize.DIALOG)
54 else:54 else:
55 self.image.set_from_pixbuf(value)55 self.image.set_from_pixbuf(value)
56 56
@@ -61,93 +61,39 @@
61 self.inner_vbox.pack_end(child, expand, fill, padding)61 self.inner_vbox.pack_end(child, expand, fill, padding)
6262
63 def __draw_title(self):63 def __draw_title(self):
6464 vbox = Gtk.VBox()
65 vbox = gtk.VBox()
66 self.pack_start(vbox, False, False, 0)65 self.pack_start(vbox, False, False, 0)
6766
68 align = gtk.Alignment(0.5, 0.5, 1.0, 1.0)67 align = Gtk.Alignment()
68 align.set(0.5, 0.5, 1.0, 1.0)
69 align.set_padding(5, 5, 5, 5)69 align.set_padding(5, 5, 5, 5)
70 vbox.pack_start(align)70 vbox.pack_start(align, False, False, 0)
7171
72 hbox = gtk.HBox(False, 6)72 hbox = Gtk.HBox(False, 6)
73 align.add(hbox)73 align.add(hbox)
7474
75 inner_vbox = gtk.VBox(False, 0)75 inner_vbox = Gtk.VBox(False, 0)
76 hbox.pack_start(inner_vbox)76 hbox.pack_start(inner_vbox, False, False, 0)
7777
78 align = gtk.Alignment(0.5, 0.5, 1.0, 1.0)78 align = Gtk.Alignment()
79 align.set(0.5, 0.5, 1.0, 1.0)
79 inner_vbox.pack_start(align, False, False, 0)80 inner_vbox.pack_start(align, False, False, 0)
8081
81 inner_hbox = gtk.HBox(False, 0)82 inner_hbox = Gtk.HBox(False, 0)
82 align.add(inner_hbox)83 align.add(inner_hbox)
8384
84 self.label_title = gtk.Label()85 self.label_title = Gtk.Label()
85 self.label_title.set_markup('<b><big>%s</big></b>' % self.__title__)86 self.label_title.set_markup('<b><big>%s</big></b>' % self.__title__)
86 self.label_title.set_alignment(0, 0.5)87 self.label_title.set_alignment(0, 0.5)
87 inner_hbox.pack_start(self.label_title, False, False, 0)88 inner_hbox.pack_start(self.label_title, False, False, 0)
8889
89 self.label_desc = gtk.Label(self.__desc__)90 self.label_desc = Gtk.Label(self.__desc__)
90 self.label_desc.set_ellipsize(ELLIPSIZE_END)91 self.label_desc.set_ellipsize(Pango.EllipsizeMode.END)
91 self.label_desc.set_alignment(0, 0.5)92 self.label_desc.set_alignment(0, 0.5)
92 inner_vbox.pack_start(self.label_desc, False, False, 0)93 inner_vbox.pack_start(self.label_desc, False, False, 0)
9394
94 self.image =gtk.Image()95 self.image = Gtk.Image()
95 self.image.set_from_icon_name('aptoncd', gtk.ICON_SIZE_DIALOG)96 self.image.set_from_icon_name('aptoncd', Gtk.IconSize.DIALOG)
96 self.image.set_alignment(0, 0)97 self.image.set_alignment(0, 0)
97 self.image.set_padding(5, 5)98 self.image.set_padding(5, 5)
98 hbox.pack_end(self.image, False, False, 0)99 hbox.pack_end(self.image, False, False, 0)
99
100class HeaderBoxButton(DialogHeader):
101 __gsignals__ = { 'button-clicked': (
102 gobject.SIGNAL_RUN_LAST,
103 gobject.TYPE_NONE,
104 (gobject.TYPE_INT,),
105 ),
106 }
107
108 def __init__(self, title=None, color=None):
109 super(HeaderBoxButton, self).__init__()
110 if title:
111 self.set_title(title)
112
113 self.button_box = gtk.HBox()
114 #------------------------------------
115 hsep = gtk.HSeparator()
116 #hsep.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color('#43413c'))
117
118 hsep2 = gtk.HSeparator()
119 #hsep2.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(color))
120
121 hbbox = gtk.HButtonBox()
122 hbbox.set_layout(gtk.BUTTONBOX_CENTER)
123 hbbox.set_spacing(-1)
124
125 system_tab = gtk.RadioButton(group=None, label=_('From System'))
126 file_tab = gtk.RadioButton(group=system_tab, label=_('From File'))
127 custom_tab = gtk.RadioButton(group=system_tab, label=_('Custom'))
128
129 system_tab.set_property('draw_indicator', False)
130 system_tab.set_name('system_tab')
131 file_tab.set_property('draw_indicator', False)
132 file_tab.set_name('file_tab')
133 custom_tab.set_property('draw_indicator', False)
134 custom_tab.set_name('custom_tab')
135
136 hbbox.pack_start(system_tab, False,False,-5)
137 hbbox.pack_start(file_tab, False,False,-5)
138 hbbox.pack_start(custom_tab, False,False,-5)
139
140 self.button_box.pack_start(hsep)
141 self.button_box.pack_start(hbbox, False,True,0)
142 self.button_box.pack_start(hsep2)
143
144 self.add_start(self.button_box, False,False)
145 system_tab.connect('toggled', self._on_clicked, 0)
146 file_tab.connect('toggled', self._on_clicked, 1)
147 custom_tab.connect('toggled', self._on_clicked, 2)
148
149 self.show_all()
150
151 def _on_clicked(self,w,id):
152 print getattr(w, 'name')
153 self.emit('button-clicked',id)
154\ No newline at end of file100\ No newline at end of file
155101
=== modified file 'unitylaunchereditor/widgets/groupinfo.py'
--- unitylaunchereditor/widgets/groupinfo.py 2011-06-13 20:08:40 +0000
+++ unitylaunchereditor/widgets/groupinfo.py 2011-11-28 17:31:26 +0000
@@ -16,8 +16,8 @@
16#16#
17#####################################################################17#####################################################################
1818
19import gtk19from gi.repository import Gtk
20import gobject20from gi.repository import GObject
21from gio import File,FileIcon,ThemedIcon21from gio import File,FileIcon,ThemedIcon
22from unitylaunchereditor.core.iconmanager import IconManager22from unitylaunchereditor.core.iconmanager import IconManager
23from unitylaunchereditor.core.constants import IMAGE_SIZE23from unitylaunchereditor.core.constants import IMAGE_SIZE
@@ -27,16 +27,16 @@
2727
28log = Logger('GroupInfo')28log = Logger('GroupInfo')
2929
30class GroupInfo(gtk.HBox):30class GroupInfo(Gtk.HBox):
31 __gsignals__ = { 'field-changed': (31 __gsignals__ = { 'field-changed': (
32 gobject.SIGNAL_RUN_LAST, 32 GObject.SIGNAL_RUN_LAST,
33 gobject.TYPE_NONE,33 GObject.TYPE_NONE,
34 (gobject.TYPE_STRING,),34 (GObject.TYPE_STRING,),
35 ),35 ),
36 }36 }
37 37
38 def __init__(self,edit_group=False):38 def __init__(self,edit_group=False):
39 super(GroupInfo,self).__init__()39 Gtk.HBox.__init__(self)
40 self.set_border_width(12)40 self.set_border_width(12)
41 self.editing = edit_group41 self.editing = edit_group
42 self.__group_name =""42 self.__group_name =""
@@ -76,53 +76,49 @@
76 76
77 def __create_text_frame(self):77 def __create_text_frame(self):
78 78
79 label_gname = gtk.Label(_('Group Name:'))79 label_gname = Gtk.Label(_('Group Name:'))
80 label_gname.set_alignment(xalign=0, yalign=0)80 label_gname.set_alignment(xalign=0, yalign=0)
81 self.entry_gname = gtk.Entry()81 self.entry_gname = Gtk.Entry()
82 self.entry_gname.set_sensitive(not self.editing)82 self.entry_gname.set_sensitive(not self.editing)
83 self.entry_gname.connect('changed', self._on_change)83 self.entry_gname.connect('changed', self._on_change)
84 self.entry_gname.connect('focus-out-event', self.__on_txt_focus_out, 'quicklist_group_name')84 self.entry_gname.connect('focus-out-event', self.__on_txt_focus_out, 'quicklist_group_name')
85 85
86 86
87 label_name = gtk.Label(_('Launcher Name:'))87 label_name = Gtk.Label(_('Launcher Name:'))
88 label_name.set_alignment(xalign=0, yalign=0)88 label_name.set_alignment(xalign=0, yalign=0)
89 self.entry_name = gtk.Entry()89 self.entry_name = Gtk.Entry()
90 #entry_name.set_name()90 #entry_name.set_name()
91 self.entry_name.connect('focus-out-event', self.__on_txt_focus_out, 'quicklist_name')91 self.entry_name.connect('focus-out-event', self.__on_txt_focus_out, 'quicklist_name')
92 self.entry_name.connect('changed', self._on_change)92 self.entry_name.connect('changed', self._on_change)
93 93
94 label_command = gtk.Label(_('Command:'))94 label_command = Gtk.Label(_('Command:'))
95 label_command.set_alignment(xalign=0, yalign=0)95 label_command.set_alignment(xalign=0, yalign=0)
96 self.entry_command = gtk.Entry()96 self.entry_command = Gtk.Entry()
97 self.entry_command.connect('focus-out-event', self.__on_txt_focus_out, 'quicklist_command')97 self.entry_command.connect('focus-out-event', self.__on_txt_focus_out, 'quicklist_command')
98 self.entry_command.connect('changed', self._on_change)98 self.entry_command.connect('changed', self._on_change)
99 99
100 button_command = gtk.Button('...')100 button_command = Gtk.Button('...')
101 hbox = gtk.HBox()101 hbox = Gtk.HBox()
102 hbox.pack_start(self.entry_command)102 hbox.pack_start(self.entry_command, False, False, 0)
103 hbox.pack_start(button_command, expand=False, fill=True, padding=0)103 hbox.pack_start(button_command, expand=False, fill=True, padding=0)
104 button_command.connect('clicked', self.__do_choose_run, self.entry_command)104 button_command.connect('clicked', self.__do_choose_run, self.entry_command)
105 105
106 self.combo_label= gtk.Label('Environment:')106 self.combo_label= Gtk.Label('Environment:')
107 self.combo_label.set_alignment(xalign=0, yalign=0)107 self.combo_label.set_alignment(xalign=0, yalign=0)
108 self.cmbTargetEnvironment = gtk.ComboBox()108 self.cmbTargetEnvironment = Gtk.ComboBoxText()
109 self.cmbTargetEnvironment.set_name('TargetEnvironment')109 self.cmbTargetEnvironment.set_name('TargetEnvironment')
110 110
111 self.combo_model = gtk.ListStore(gobject.TYPE_STRING)111 self.combo_model = Gtk.ListStore(GObject.TYPE_STRING)
112 for target_key in ['Unity', 'Message Menu', 'Unity;Message Menu']:112 for target_key in ['Unity', 'Message Menu', 'Unity;Message Menu']:
113 self.combo_model.append([target_key])113 self.combo_model.append([target_key])
114114
115 celltitle = gtk.CellRendererText()
116
117 self.cmbTargetEnvironment.pack_start(celltitle, False)
118 self.cmbTargetEnvironment.add_attribute(celltitle, 'text', 0)
119 self.cmbTargetEnvironment.set_model(self.combo_model)115 self.cmbTargetEnvironment.set_model(self.combo_model)
120 self.cmbTargetEnvironment.set_active(0)116 self.cmbTargetEnvironment.set_active(0)
121117
122 self.chkVisible = gtk.CheckButton()118 self.chkVisible = Gtk.CheckButton()
123 self.chkVisible.set_label('Visible')119 self.chkVisible.set_label('Visible')
124 120
125 table = gtk.Table(rows=5, columns=2, homogeneous=False)121 table = Gtk.Table(rows=5, columns=2, homogeneous=False)
126 table.set_col_spacings(5)122 table.set_col_spacings(5)
127 table.set_row_spacings(5)123 table.set_row_spacings(5)
128 124
@@ -131,8 +127,8 @@
131 right_attach=1, 127 right_attach=1,
132 top_attach=0, 128 top_attach=0,
133 bottom_attach=1, 129 bottom_attach=1,
134 xoptions=gtk.FILL, 130 xoptions=Gtk.AttachOptions.FILL,
135 yoptions=gtk.FILL, 131 yoptions=Gtk.AttachOptions.FILL,
136 xpadding=0, 132 xpadding=0,
137 ypadding=0)133 ypadding=0)
138134
@@ -141,8 +137,8 @@
141 right_attach=2, 137 right_attach=2,
142 top_attach=0, 138 top_attach=0,
143 bottom_attach=1, 139 bottom_attach=1,
144 xoptions=gtk.FILL|gtk.EXPAND , 140 xoptions=Gtk.AttachOptions.FILL|Gtk.AttachOptions.EXPAND ,
145 yoptions=gtk.FILL, 141 yoptions=Gtk.AttachOptions.FILL,
146 xpadding=0, 142 xpadding=0,
147 ypadding=0143 ypadding=0
148 )144 )
@@ -152,8 +148,8 @@
152 right_attach=1, 148 right_attach=1,
153 top_attach=1, 149 top_attach=1,
154 bottom_attach=2, 150 bottom_attach=2,
155 xoptions=gtk.FILL, 151 xoptions=Gtk.AttachOptions.FILL,
156 yoptions=gtk.FILL, 152 yoptions=Gtk.AttachOptions.FILL,
157 xpadding=0, 153 xpadding=0,
158 ypadding=0)154 ypadding=0)
159155
@@ -162,8 +158,8 @@
162 right_attach=2, 158 right_attach=2,
163 top_attach=1, 159 top_attach=1,
164 bottom_attach=2, 160 bottom_attach=2,
165 xoptions=gtk.FILL|gtk.EXPAND , 161 xoptions=Gtk.AttachOptions.FILL|Gtk.AttachOptions.EXPAND ,
166 yoptions=gtk.FILL, 162 yoptions=Gtk.AttachOptions.FILL,
167 xpadding=0, 163 xpadding=0,
168 ypadding=0164 ypadding=0
169 )165 )
@@ -173,8 +169,8 @@
173 right_attach=1, 169 right_attach=1,
174 top_attach=2, 170 top_attach=2,
175 bottom_attach=3, 171 bottom_attach=3,
176 xoptions=gtk.FILL, 172 xoptions=Gtk.AttachOptions.FILL,
177 yoptions=gtk.FILL, 173 yoptions=Gtk.AttachOptions.FILL,
178 xpadding=0, 174 xpadding=0,
179 ypadding=0)175 ypadding=0)
180 176
@@ -183,8 +179,8 @@
183 right_attach=2, 179 right_attach=2,
184 top_attach=2, 180 top_attach=2,
185 bottom_attach=3, 181 bottom_attach=3,
186 xoptions=gtk.FILL|gtk.EXPAND , 182 xoptions=Gtk.AttachOptions.FILL|Gtk.AttachOptions.EXPAND ,
187 yoptions=gtk.FILL, 183 yoptions=Gtk.AttachOptions.FILL,
188 xpadding=0, 184 xpadding=0,
189 ypadding=0)185 ypadding=0)
190 186
@@ -193,8 +189,8 @@
193 right_attach=1, 189 right_attach=1,
194 top_attach=3, 190 top_attach=3,
195 bottom_attach=4, 191 bottom_attach=4,
196 xoptions=gtk.FILL, 192 xoptions=Gtk.AttachOptions.FILL,
197 yoptions=gtk.FILL, 193 yoptions=Gtk.AttachOptions.FILL,
198 xpadding=0, 194 xpadding=0,
199 ypadding=0)195 ypadding=0)
200 196
@@ -203,18 +199,18 @@
203 right_attach=2, 199 right_attach=2,
204 top_attach=3, 200 top_attach=3,
205 bottom_attach=4, 201 bottom_attach=4,
206 xoptions=gtk.FILL, 202 xoptions=Gtk.AttachOptions.FILL,
207 yoptions=gtk.FILL, 203 yoptions=Gtk.AttachOptions.FILL,
208 xpadding=0, 204 xpadding=0,
209 ypadding=0)205 ypadding=0)
210 206
211 table.attach(gtk.Label(), 207 table.attach(Gtk.Label(),
212 left_attach=0, 208 left_attach=0,
213 right_attach=1, 209 right_attach=1,
214 top_attach=4, 210 top_attach=4,
215 bottom_attach=5, 211 bottom_attach=5,
216 xoptions=gtk.FILL, 212 xoptions=Gtk.AttachOptions.FILL,
217 yoptions=gtk.FILL, 213 yoptions=Gtk.AttachOptions.FILL,
218 xpadding=0, 214 xpadding=0,
219 ypadding=0)215 ypadding=0)
220 216
@@ -223,13 +219,13 @@
223 right_attach=2, 219 right_attach=2,
224 top_attach=4, 220 top_attach=4,
225 bottom_attach=5, 221 bottom_attach=5,
226 xoptions=gtk.FILL|gtk.EXPAND, 222 xoptions=Gtk.AttachOptions.FILL|Gtk.AttachOptions.EXPAND,
227 yoptions=gtk.FILL, 223 yoptions=Gtk.AttachOptions.FILL,
228 xpadding=0, 224 xpadding=0,
229 ypadding=0)225 ypadding=0)
230226
231 frame = gtk.Frame()227 frame = Gtk.Frame()
232 frame.set_shadow_type(gtk.SHADOW_NONE)228 frame.set_shadow_type(Gtk.ShadowType.NONE)
233 frame.set_label_align(xalign=0, yalign=0)229 frame.set_label_align(xalign=0, yalign=0)
234 frame.add(table)230 frame.add(table)
235 231
@@ -240,8 +236,7 @@
240 236
241 def __on_txt_focus_out(self, widget, event, prop_name):237 def __on_txt_focus_out(self, widget, event, prop_name):
242 ilength = 0238 ilength = 0
243 if isinstance(widget, gtk.CheckButton):239 if isinstance(widget, Gtk.CheckButton):
244 print getattr(self, prop_name)
245 value = widget.get_active()240 value = widget.get_active()
246 ilength = 1241 ilength = 1
247 else:242 else:
@@ -260,4 +255,4 @@
260 if response:255 if response:
261 self.quicklist_command=filename256 self.quicklist_command=filename
262 if entry_widget:257 if entry_widget:
263 entry_widget.set_text(filename)
264\ No newline at end of file258\ No newline at end of file
259 entry_widget.set_text(filename)
265260
=== removed file 'unitylaunchereditor/widgets/groupsdialog.py'
--- unitylaunchereditor/widgets/groupsdialog.py 2011-06-07 15:07:44 +0000
+++ unitylaunchereditor/widgets/groupsdialog.py 1970-01-01 00:00:00 +0000
@@ -1,245 +0,0 @@
1# -*- coding: utf-8 -*-
2#####################################################################
3# Laudeci Oliveira <laudeci@ubuntu.com>
4# Ursula Junque <ursinha@ubuntu.com>
5#
6# Copyright 2011 unity-launcher-editor-dev.
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published
10# by the Free Software Foundation; version 3 only.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17#####################################################################
18
19import gtk
20from gobject import TYPE_STRING
21from utils import FileChooser
22from translation import _
23
24class GroupsDialog(gtk.Dialog):
25 """XXX: add docs."""
26
27 def __init__(self, title=_('Add Group...'), parent=None):
28 super(GroupsDialog, self).__init__(title,
29 None, (gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT |
30 gtk.DIALOG_NO_SEPARATOR),
31 (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
32
33
34 self.set_resizable(False)
35
36 if parent:
37 self.set_transient_for(parent)
38
39 self.add_group_panel = self.create_widgets()
40 self.vbox.pack_start(self.add_group_panel, True, True, 0)
41 self.vbox.show_all()
42
43 self.ok_button = self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
44 self.ok_button.grab_default()
45 self.ok_button.set_sensitive(False)
46 self.set_alternative_button_order(
47 [gtk.RESPONSE_CANCEL, gtk.RESPONSE_OK])
48
49 self.txtName.connect('changed', self.on_change)
50 self.txtCommand.connect('changed', self.on_change)
51 self.cmdGRun.connect('clicked', self.open_executable)
52
53 def create_widgets(self):
54 '''
55 this will create input widgets for our dialog
56 without depending on glade for that and
57 solving the file not found error report.
58 '''
59
60 frame4 = gtk.Frame()
61 frame4.set_shadow_type(gtk.SHADOW_NONE)
62
63 align = gtk.Alignment()
64 align.set_padding(0, 0, 12, 0)
65
66 table = gtk.Table(rows=4, columns=2, homogeneous=False)
67 table.set_col_spacings(5)
68 table.set_row_spacings(5)
69
70 label8 = gtk.Label(_('Group Name:'))
71 label8.set_alignment(0, 0.5)
72 eventbox8 = gtk.EventBox()
73 eventbox8.add(label8)
74
75 table.attach(eventbox8,
76 left_attach=0,
77 right_attach=1,
78 top_attach=0,
79 bottom_attach=1,
80 xoptions=gtk.FILL,
81 yoptions=gtk.FILL,
82 xpadding=0,
83 ypadding=0)
84
85
86 label5 = gtk.Label(_('Command Name:'))
87 label5.set_alignment(0, 0.5)
88 eventbox5 = gtk.EventBox()
89 eventbox5.add(label5)
90 table.attach(eventbox5,
91 left_attach=0,
92 right_attach=1,
93 top_attach=1,
94 bottom_attach=2,
95 xoptions=gtk.FILL,
96 yoptions=gtk.FILL,
97 xpadding=0,
98 ypadding=0)
99
100
101 label6 = gtk.Label(_('Command:'))
102 label6.set_alignment(0, 0.5)
103 eventbox6 = gtk.EventBox()
104 eventbox6.add(label6)
105 table.attach(eventbox6,
106 left_attach=0,
107 right_attach=1,
108 top_attach=2,
109 bottom_attach=3,
110 xoptions=gtk.FILL,
111 yoptions=gtk.FILL,
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches