Changeset 3046
- Timestamp:
- 06/27/08 18:15:16 (5 years ago)
- Location:
- branch/PreferencesWindow
- Files:
-
- 4 added
- 3 modified
-
share/pixmaps/umit/Preferences/expose-bw.svg (added)
-
share/pixmaps/umit/Preferences/fonts-bw.svg (added)
-
share/pixmaps/umit/Preferences/general-bw.svg (added)
-
share/pixmaps/umit/Preferences/network-bw.svg (added)
-
share/pixmaps/umit/Preferences/network.svg (modified) (2 diffs)
-
umitPreferences/PreferencesWindow.py (modified) (5 diffs)
-
umitPreferences/TabsWidget.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branch/PreferencesWindow/share/pixmaps/umit/Preferences/network.svg
r3044 r3046 36 36 inkscape:zoom="3.4263824" 37 37 inkscape:cx="-30.548629" 38 inkscape:cy=" 53.550691"38 inkscape:cy="30.202451" 39 39 inkscape:document-units="px" 40 40 inkscape:current-layer="layer1" 41 41 showgrid="false" 42 inkscape:window-width=" 1024"43 inkscape:window-height="7 68"44 inkscape:window-x=" 0"45 inkscape:window-y=" 0" />42 inkscape:window-width="768" 43 inkscape:window-height="722" 44 inkscape:window-x="4" 45 inkscape:window-y="25" /> 46 46 <metadata 47 47 id="metadata7"> … … 123 123 transform="translate(2.8543262,-1.0590396)" /> 124 124 <rect 125 style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.3495295 0000000005px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"125 style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.3495295px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" 126 126 id="rect3166" 127 127 width="36.007656" 128 128 height="34.840244" 129 x="4. 4046502"130 y=" -0.23834826" />129 x="4.1127973" 130 y="0.053504746" /> 131 131 <text 132 132 xml:space="preserve" 133 133 style="font-size:8.61121845px;font-style:normal;font-weight:bold;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Sans Bold" 134 x=" 8.6196966"135 y=" 5.0014243"134 x="12.289488" 135 y="2.4946759" 136 136 id="text3168" 137 137 transform="scale(1.4315132,0.6985615)"><tspan 138 138 sodipodi:role="line" 139 139 id="tspan3170" 140 x=" -10.306305"141 y=" 23.927425"140 x="8.6712151" 141 y="6.1129479" 142 142 style="font-size:5.9616127px;writing-mode:tb-rl;fill:#ffffff;fill-opacity:1">proxy</tspan></text> 143 143 <text 144 144 xml:space="preserve" 145 style="font-size:8.5919427 8999999916px;font-style:normal;font-weight:bold;fill:#00ec00;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Sans Bold"146 x="2 0.409737"147 y=" 6.2287245"145 style="font-size:8.59194279px;font-style:normal;font-weight:bold;fill:#00ec00;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Sans Bold" 146 x="26.910929" 147 y="4.8137159" 148 148 id="text3172" 149 149 transform="scale(1.2120904,0.825021)"><tspan 150 150 sodipodi:role="line" 151 151 id="tspan3174" 152 x=" 0.45572183"153 y=" 26.182739"154 style="font-size:6.6091871 2999999958px;writing-mode:tb-rl;fill:#00ec00;fill-opacity:1">net</tspan></text>152 x="12.729916" 153 y="18.994728" 154 style="font-size:6.60918713px;writing-mode:tb-rl;fill:#00ec00;fill-opacity:1">net</tspan></text> 155 155 <rect 156 156 style="fill:#76f564;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" -
branch/PreferencesWindow/umitPreferences/PreferencesWindow.py
r3044 r3046 24 24 from higwidgets.higframe import HIGFrame 25 25 26 26 27 from umitCore.UmitLogging import log 27 28 from umitCore.I18N import _ … … 44 45 self.set_title("Preferences") 45 46 self.set_position(gtk.WIN_POS_CENTER_ALWAYS) 46 self.resize( 600,300)47 self.resize(500,400) 47 48 self.__create() 48 49 self.__pack() 49 50 self.__frame = None 51 self.__list = { 52 'General settings':'general.svg', 53 'Fonts':'fonts.svg', 54 'Expose/Interface':'expose.svg', 55 'Network':'network.svg' 56 } 57 self.__list_bw = { 58 'General settings':'general-bw.svg', 59 'Fonts':'fonts-bw.svg', 60 'Expose/Interface':'expose-bw.svg', 61 'Network':'network-bw.svg' 62 } 63 64 65 50 66 51 67 self.connect("destroy", lambda w: gtk.main_quit()) 52 68 self.connect("delete_event", lambda w, e: gtk.main_quit()) 53 self._create_frame("General") 69 self._create_frame("General Settings") 70 self.__general_settings() 54 71 55 72 self.show_all() 56 def on_select(self,icon_view, model=None ):73 def on_select(self,icon_view, model=None, current=None): 57 74 selected = icon_view.get_selected_items() 75 76 77 78 79 # Frame changes 58 80 if len(selected) == 0: return 59 81 i = selected[0][0] 82 83 84 # Put Black and White the last selected item 85 86 if (current[0] != None and current[0] != i ): 87 cat = category = model[current[0]][0] 88 model.remove(model.get_iter(current[0])) 89 if (current[0]>model.get_n_columns()): 90 current[0]=current[0]-1 91 iter_bw = None 92 else: 93 iter_bw = model.get_iter(current[0]) 94 self.__t.add_item(category, self.__list_bw.get(category), \ 95 iter_bw) 96 current[0] = i 97 98 60 99 category = model[i][0] 61 100 self._create_frame(category) 101 102 model.remove(model.get_iter(i)) 103 104 if (i>model.get_n_columns()): 105 i=i-1 106 iter = None 107 else: 108 iter = model.get_iter(i) 109 110 111 112 113 self.__t.add_item(category, self.__list.get(category), \ 114 iter) 115 62 116 def __create(self): 63 117 """ Create mainly widgets""" … … 69 123 70 124 self.__t.add_item("General settings", "general.svg") 71 self.__t.add_item("Fonts", "fonts .svg")72 self.__t.add_item("Expose/Interface", "expose .svg")73 self.__t.add_item("Network", "network .svg")125 self.__t.add_item("Fonts", "fonts-bw.svg") 126 self.__t.add_item("Expose/Interface", "expose-bw.svg") 127 self.__t.add_item("Network", "network-bw.svg") 74 128 75 129 … … 105 159 106 160 ### Network - Proxy 161 162 163 def __general_settings(self): 164 self.__framebox = HIGVBox() 165 self.__check_splash = gtk.CheckButton(_('Enable Splash on start')) 166 self.__frame.add(self.__framebox) 167 self.__framebox.pack_start(self.__check_splash, False,False) 168 107 169 108 170 def _create_frame(self, name): … … 121 183 """ Organize widgets """ 122 184 #self.__box.pack_start(self.__treeview, True, True) 123 self.__box.pack_start(self.__t, False, True)185 self.__box.pack_start(self.__t, False, False) 124 186 self.add(self.__box) 125 187 def close(self): -
branch/PreferencesWindow/umitPreferences/TabsWidget.py
r3044 r3046 61 61 self._icons_list = [] 62 62 self._tabstruct = TabStruct() 63 63 self.__current = [0] 64 64 self.__model = gtk.ListStore(str, gtk.gdk.Pixbuf) 65 #self.__model = gtk.ListStore(str, HIGHBox) 65 66 self.__pixmap_d = Path.pixmaps_dir 66 67 … … 75 76 76 77 # Change background color -- FIXME 77 self.__icon.set_name("icon tabs")78 gtk.rc_parse_string(79 """80 style "iconview"81 {82 bg[PRELIGHT] = { 0.75, 3, 1 }83 }84 class 'GtkIconView' style 'iconview'78 #self.__icon.set_name("icon tabs") 79 #gtk.rc_parse_string( 80 #""" 81 #style "iconview" 82 #{ 83 #bg[PRELIGHT] = { 0.75, 3, 1 } 84 #} 85 #class 'GtkIconView' style 'iconview' 85 86 86 """)87 #""") 87 88 map = self.__icon.get_colormap() 88 colour = map.alloc_color("red") # light red 89 colour = map.alloc_color("#FF9999") # light red 89 90 colour = map.alloc_color("#FFF9E9") # light red 91 92 style = self.__icon.get_style().copy() 93 style.base[gtk.STATE_NORMAL] = colour 94 self.__icon.set_style(style) 90 95 91 96 92 self.cellpb = gtk.CellRendererPixbuf() 93 self.cell = gtk.CellRendererText() 94 97 #self.cellpb = gtk.CellRendererPixbuf() 98 #self.cellpb.set_property('cell-background', 'yellow') 99 100 #self.__icon.pack_start(self.cellpb, False) 101 #self.__icon.set_attributes(self.cellpb, pixbuf=0) 95 102 self.pack_start(self.scroll, True, True) 96 103 self.scroll.add(self.__icon) … … 100 107 101 108 self.on_select = func 102 self.__icon.connect('selection-changed', self.on_select, self.__model) 109 self.__icon.connect('selection-changed', self.on_select, self.__model, self.__current) 110 self.__icon.connect('selection-changed', self.on_select, self.__model, self.__current) 103 111 104 112 105 def add_item(self, name, image ):113 def add_item(self, name, image, iter=None): 106 114 """ 107 115 @name: str with name of option 108 116 @image: str with name of image (e.g. sample.svg) 109 117 """ 118 110 119 pixmap_file = os.path.join(self.__pixmap_d, "Preferences" ,image) 120 121 122 # FIXME: only put the color when is selected 111 123 pixbuf = gtk.gdk.pixbuf_new_from_file (pixmap_file) 112 113 self.__model.append([name, pixbuf]) 124 pixbuf2 = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,0,8,40,40) 125 pixbuf2.fill(0xAAEEEEFF) 126 pixbuf2.composite(pixbuf,0,0,35,35,0,0,1,1,gtk.gdk.INTERP_NEAREST,50) 127 128 129 self.__model.insert_before(iter,[name, pixbuf]) 114 130 115 131 #self.__icon.modify_bg(gtk.STATE_PRELIGHT, gtk.gdk.color_parse("blue")) 116 132 def remove_item(self, name): 133 self.__model.remove(name) 117 134 ### Private Functions #### 118 135
