summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Oros <poros@redhat.com>2013-04-19 08:18:14 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-05-22 17:07:40 +0200
commitf361823448710c8cf40834ff78e261848b733453 (patch)
treefb99558a38912bcddc1905dd656a75a80add9c8a
parent21265685c58c7ef0d5b7728d1d3e89ad68353223 (diff)
downloadtuna-f361823448710c8cf40834ff78e261848b733453.tar.gz
gui: Add profile related windows
Main window divided into 3 pages: Monitoring, Profile management, Profile editing. Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--MANIFEST2
-rw-r--r--po/POTFILES.in2
-rw-r--r--tuna/gui/commonview.py239
-rw-r--r--tuna/gui/profileview.py361
-rw-r--r--tuna/tuna_gui.glade1185
-rwxr-xr-xtuna/tuna_gui.py51
6 files changed, 1619 insertions, 221 deletions
diff --git a/MANIFEST b/MANIFEST
index 324742f..95ae7c5 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -13,6 +13,8 @@ tuna/gui/__init__.py
tuna/gui/cpuview.py
tuna/gui/irqview.py
tuna/gui/procview.py
+tuna/gui/commonview.py
+tuna/gui/profileview.py
tuna/gui/util.py
setup.py
rpm/SPECS/tuna.spec
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1e38f29..be8ec2e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -11,5 +11,7 @@ tuna/gui/util.py
tuna/gui/cpuview.py
tuna/gui/procview.py
tuna/gui/irqview.py
+tuna/gui/profileview.py
+tuna/gui/commonview.py
tuna-cmd.py
oscilloscope-cmd.py
diff --git a/tuna/gui/commonview.py b/tuna/gui/commonview.py
new file mode 100644
index 0000000..4d018f5
--- /dev/null
+++ b/tuna/gui/commonview.py
@@ -0,0 +1,239 @@
+import pygtk
+import gtk
+from tuna import tuna, gui
+
+class commonview:
+ def updateCommonView(self):
+ try:
+ self.contentTable
+ self.config
+ except:
+ pass
+ self.cleanUp()
+ self.setup()
+
+ def cleanUp(self):
+ for value in self.contentTable.get_children():
+ if value.get_name() == "controls":
+ self.ctrl = value
+ if value.get_name() == "profileSelectorBox":
+ self.selector = value
+ self.contentTable.remove(value)
+
+ def setup(self):
+ try:
+ self.contentTable.set_homogeneous(False)
+ catListlenght = len(self.config.categories)
+ if catListlenght <= 0:
+ return False
+ row = ((catListlenght+(catListlenght%2))/2)-catListlenght%2
+ frames = {}
+ frameContent = {}
+ catCntr = 0
+ contentCntr = 0
+ self.contentTable.resize(row+3,2)
+ self.contentTable.attach(self.ctrl,0,2,1,2,gtk.FILL,gtk.FILL)
+ self.contentTable.attach(self.selector,0,2,0,1,gtk.FILL,gtk.FILL)
+ cur = self.profileview.configFileCombo.get_model()
+ for val in cur:
+ if val[0] == self.config.cacheFileName:
+ self.profileview.configFileCombo.set_active(val.path[0])
+ while catCntr < catListlenght:
+ frames[catCntr] = gtk.Frame()
+ tLabel = gtk.Label('<b>'+self.config.categories[catCntr]+'</b>')
+ tLabel.set_use_markup(True)
+ frames[catCntr].set_label_widget(tLabel)
+ frameContent[catCntr] = {}
+ frameContent[catCntr]['labels'] = {}
+ frameContent[catCntr]['texts'] = {}
+ frameContent[catCntr]['tooltips'] = {}
+ currentCol = catCntr%2
+ currentRow = (catCntr/2)+2
+ if len(self.config.ctlParams[catCntr]) > 0:
+ frameContent[catCntr]['table'] = gtk.Table(len(self.config.ctlParams[catCntr]),2,False)
+ else:
+ frameContent[catCntr]['table'] = gtk.Table(1,2,False)
+ contentCntr = 0
+ for val in sorted(self.config.ctlParams[catCntr], key=str.lower):
+ if self.config.getSystemValue(val) != self.config.ctlParams[catCntr][val]:
+ star = "*"
+ else:
+ star = ""
+ frameContent[catCntr]['labels'][contentCntr] = gtk.Label(self.config.originalToAlias(val)+star)
+ frameContent[catCntr]['labels'][contentCntr].set_alignment(0,0.5)
+ frameContent[catCntr]['tooltips'][contentCntr] = tuna.proc_sys_help(val)
+ if len(frameContent[catCntr]['tooltips'][contentCntr]):
+ frameContent[catCntr]['labels'][contentCntr].set_tooltip_text(frameContent[catCntr]['tooltips'][contentCntr])
+ if val in self.config.ctlGuiParams[catCntr]:
+ # scale control
+ frameContent[catCntr]['texts'][contentCntr] = gtk.HScale()
+ frameContent[catCntr]['texts'][contentCntr].set_range(self.config.ctlGuiParams[catCntr][val][0], self.config.ctlGuiParams[catCntr][val][1])
+ frameContent[catCntr]['texts'][contentCntr].set_update_policy(gtk.UPDATE_CONTINUOUS)
+ frameContent[catCntr]['texts'][contentCntr].set_value(int(self.config.ctlParams[catCntr][val]))
+ frameContent[catCntr]['texts'][contentCntr].set_digits(0)
+ else:
+ # input field
+ frameContent[catCntr]['texts'][contentCntr] = gtk.Entry(256)
+ frameContent[catCntr]['texts'][contentCntr].set_alignment(0)
+ frameContent[catCntr]['texts'][contentCntr].set_text(self.config.ctlParams[catCntr][val])
+ frameContent[catCntr]['texts'][contentCntr].connect("focus-in-event", self.checkStar, catCntr,contentCntr,val, frameContent[catCntr]['labels'][contentCntr])
+ frameContent[catCntr]['texts'][contentCntr].connect("focus-out-event", self.checkStar, catCntr,contentCntr,val, frameContent[catCntr]['labels'][contentCntr])
+ frameContent[catCntr]['table'].attach(frameContent[catCntr]['labels'][contentCntr],0,1,contentCntr,contentCntr+1,gtk.FILL,xpadding=5)
+ frameContent[catCntr]['table'].attach(frameContent[catCntr]['texts'][contentCntr],1,2,contentCntr,contentCntr+1,xpadding=10)
+ contentCntr = contentCntr+1
+ frames[catCntr].add(frameContent[catCntr]['table'])
+ self.contentTable.attach(frames[catCntr],currentCol,currentCol+1,currentRow,currentRow+1,gtk.FILL | gtk.EXPAND,gtk.FILL,1,1)
+ catCntr = catCntr+1
+ self.ctrl.set_padding(5,5,0,5)
+ self.contentTable.set_border_width(5)
+ self.contentTable.show_all()
+ except AttributeError as e:
+ return False
+
+ def guiSnapshot(self):
+ self.ret = {}
+ self.property_cntr = 0
+ for value in self.contentTable.get_children():
+ if value.get_name() == "controls" or value.get_name() == "profileSelectorBox":
+ continue
+ self.ret[value.get_label()] = {}
+ for content in value:
+ if content.get_name() != "GtkTable":
+ continue
+ self.property_cntr = 0
+ for content_last in content.get_children():
+ if not content.child_get_property(content_last,"top-attach") in self.ret[value.get_label()]:
+ self.ret[value.get_label()][content.child_get_property(content_last,"top-attach")] = {}
+ if content_last.get_name() == "GtkLabel":
+ self.ret[value.get_label()][content.child_get_property(content_last,"top-attach")]['label'] = content_last.get_label()
+ else:
+ if content_last.get_name() == "GtkEntry":
+ self.ret[value.get_label()][content.child_get_property(content_last,"top-attach")]['value'] = content_last.get_text()
+ else:
+ self.ret[value.get_label()][content.child_get_property(content_last,"top-attach")]['value'] = str(int(content_last.get_value()))
+ return self.ret
+
+ def systemSnapshot(self):
+ self.ret = {}
+ self.property_cntr = 0
+ for value in self.contentTable.get_children():
+ if value.get_name() == "controls" or value.get_name() == "profileSelectorBox":
+ continue
+ self.ret[value.get_label()] = {}
+ for content in value:
+ if content.get_name() != "GtkTable":
+ continue
+ self.property_cntr = 0
+ for content_last in content.get_children():
+ if not content.child_get_property(content_last,"top-attach") in self.ret[value.get_label()]:
+ self.ret[value.get_label()][content.child_get_property(content_last,"top-attach")] = {}
+ if content_last.get_name() == "GtkLabel":
+ self.ret[value.get_label()][content.child_get_property(content_last,"top-attach")]['label'] = content_last.get_label()
+ self.ret[value.get_label()][content.child_get_property(content_last,"top-attach")]['value'] = self.config.getSystemValue(self.ret[value.get_label()][content.child_get_property(content_last,"top-attach")]['label'])
+ return self.ret
+
+ def on_applyChanges_clicked(self,widget):
+ self.config.backup = self.systemSnapshot()
+ self.config.applyChanges(self.guiSnapshot())
+ self.updateCommonView()
+
+ def on_undoChanges_clicked(self,widget):
+ try:
+ self.config.backup
+ self.config.applyChanges(self.config.backup)
+ self.updateCommonView()
+ except:
+ dialog = gtk.MessageDialog(None,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_WARNING, gtk.BUTTONS_OK,
+ _("Backup not found, this button is useable after click on apply"))
+ ret = dialog.run()
+ dialog.destroy()
+
+ def on_saveSnapshot_clicked(self,widget):
+ ret = self.guiSnapshot()
+ self.config.saveSnapshot(self.ret)
+ old_name = self.get_current_combo_selection()
+ if self.profileview.setProfileFileList() and old_name[0] > 0:
+ self.profileview.set_current_tree_selection(old_name[1])
+ self.set_current_combo_selection(old_name[1])
+
+ def on_saveTunedChanges_clicked(self,widget):
+ if not self.config.checkTunedDaemon():
+ dialog = gtk.MessageDialog(None,gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, _("Tuned daemon undetected!\nFor this function you must have installed Tuned daemon."))
+ ret = dialog.run()
+ dialog.destroy()
+ return False
+ dialog = gtk.MessageDialog(None,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_WARNING, gtk.BUTTONS_YES_NO,
+ _("This function can create new profile for tuned daemon and apply config permanently after reboot.\nProfile will be permanently saved and rewrite all old profiles created by tuna!\nUsing this only if you know that config cant corrupt your system!\nRealy can do it?"))
+ ret = dialog.run()
+ dialog.destroy()
+ if ret == gtk.RESPONSE_NO:
+ return False
+ try:
+ ret = self.guiSnapshot()
+ self.config.saveTuned(ret)
+ except RuntimeError as e:
+ dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_ERROR, gtk.BUTTONS_OK,str(e))
+ ret = dialog.run()
+ dialog.destroy()
+ self.profileview.setProfileFileList()
+
+ def on_profileSelector_changed(self, widget):
+ ret = self.get_current_combo_selection()
+ if ret[0] < 0:
+ return False
+ err = self.config.checkConfigFile(self.config.config['root']+ret[1])
+ if err != '':
+ dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR,\
+ gtk.BUTTONS_OK, (_("Config file contain errors: %s") % (err)))
+ ret = dialog.run()
+ dialog.destroy()
+ old = self.config.cacheFileName.rfind("/")
+ old = self.config.cacheFileName[old+1:len(self.config.cacheFileName)]
+ cur = self.configFileCombo.get_model()
+ for val in cur:
+ if val[0] == old:
+ self.configFileCombo.handler_block_by_func(self.on_profileSelector_changed)
+ self.configFileCombo.set_active(val.path[0])
+ self.configFileCombo.handler_unblock_by_func(self.on_profileSelector_changed)
+ return False
+ cur = self.profileview.configFileTree.get_model()
+ for val in cur:
+ if val[0] == ret[1]:
+ self.configFileCombo.handler_block_by_func(self.on_profileSelector_changed)
+ self.profileview.configFileTree.set_cursor(val.path[0])
+ self.configFileCombo.handler_unblock_by_func(self.on_profileSelector_changed)
+ self.config.loadTuna(ret[1])
+ self.config.updateDefault(ret[1])
+ self.updateCommonView()
+
+ def get_current_combo_selection(self):
+ combo_iter = self.configFileCombo.get_active_iter()
+ combo_row = self.configFileCombo.get_active()
+ if combo_iter != None:
+ model = self.configFileCombo.get_model()
+ return (combo_row,model[combo_iter][0])
+ else:
+ return (-1,"ERROR")
+
+ def set_current_combo_selection(self, string):
+ cur = self.configFileCombo.get_model()
+ for val in cur:
+ if val[0] == string:
+ self.configFileCombo.set_active(val.path[0])
+
+ def checkStar(self, widget, event, catCntr,contentCntr,val,label):
+ lbl = label.get_label().replace("*","");
+ if widget.get_name() == "GtkEntry":
+ value = widget.get_text()
+ else:
+ value = str(int(widget.get_value()))
+ if value != self.config.getSystemValue(lbl):
+ label.set_label(lbl+"*")
+ else:
+ label.set_label(lbl)
diff --git a/tuna/gui/profileview.py b/tuna/gui/profileview.py
new file mode 100644
index 0000000..e465c80
--- /dev/null
+++ b/tuna/gui/profileview.py
@@ -0,0 +1,361 @@
+import pygtk
+import gtk
+
+from tuna import tuna, gui
+
+import os, shutil
+
+class profileview:
+ def on_loadProfileButton_clicked(self, button):
+ self.dialog = gtk.FileChooserDialog("Open...", None,
+ gtk.FILE_CHOOSER_ACTION_OPEN, (gtk.STOCK_CANCEL,
+ gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK))
+ self.dialog.set_default_response(gtk.RESPONSE_OK)
+ filter = gtk.FileFilter()
+ filter.set_name("All files")
+ filter.add_pattern("*")
+ self.dialog.add_filter(filter)
+ self.dialog.set_current_folder(self.config.config["root"])
+ self.response = self.dialog.run()
+ if self.response == gtk.RESPONSE_OK:
+ self.addFile(self.dialog.get_filename())
+ self.setProfileFileList()
+ self.dialog.destroy()
+
+ def setWtree(self, wtree):
+ self.configFileTree = wtree.get_widget("profileTree")
+ self.profileContent = wtree.get_widget("profileContent")
+ self.configFileCombo = wtree.get_widget("profileSelector")
+ self.profileDescription = wtree.get_widget("profileDescriptionText")
+ self.frame = wtree.get_widget("TunableFramesw")
+
+ def setProfileFileList(self):
+ self.clearConfig()
+ for val in self.config.populate():
+ self.addConfig(val)
+ return True
+
+ def addFile(self,value):
+ try:
+ if os.path.isfile(value):
+ tmp = value.rfind("/")
+ shutil.copy(value, self.config.config['root']+value[tmp:len(value)])
+ self.setProfileFileList()
+ self.config.load(value[tmp:len(value)])
+ except Exception as e:
+ dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_ERROR, gtk.BUTTONS_OK,str(e))
+ ret = dialog.run()
+ dialog.destroy()
+
+ def updateProfileContent(self):
+ try:
+ self.config.cache
+ except:
+ self.config.cache = ""
+ self.profileContentBuffer = self.profileContent.get_buffer()
+ self.profileContentBuffer.set_text(self.config.cache)
+
+ def clearConfig(self):
+ try:
+ self.config_store.clear()
+ self.combo_store.clear()
+ except:
+ pass
+
+ def addConfig(self,config):
+ if not self.configFileTree or not self.configFileCombo:
+ return False
+ try:
+ self.configs
+ self.configFileCombo
+ except AttributeError:
+ self.config_store = gtk.ListStore(str)
+ self.configs = self.configFileTree
+ self.configFileTree.append_column(gtk.TreeViewColumn('Profile Name', gtk.CellRendererText(), text=0))
+ self.configHandler = self.configs.connect('cursor_changed', self.changeProfile)
+ self.configs.set_model(self.config_store)
+ self.combo_store = gtk.ListStore(str)
+ self.configFileCombo.set_model(self.combo_store)
+ cell = gtk.CellRendererText()
+ self.configFileCombo.pack_start(cell, True)
+ self.configFileCombo.add_attribute(cell, "text", 0)
+ self.comboHandler = self.configFileCombo.connect('changed', self.commonview.on_profileSelector_changed)
+ self.config_store.append([config])
+ self.configs.show()
+ self.combo_store.append([config])
+ self.configFileCombo.show()
+
+ def changeProfile(self,config):
+ try:
+ f = open(self.config.config['root']+self.config.cacheFileName, 'r')
+ temp = f.read()
+ f.close()
+ self.profileContentBuffer = self.profileContent.get_buffer()
+ buff = self.profileContentBuffer.get_text(self.profileContentBuffer.get_start_iter(),self.profileContentBuffer.get_end_iter())
+ if temp != buff:
+ dialog = gtk.MessageDialog(None,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_WARNING,
+ gtk.BUTTONS_YES_NO,
+ "%s\n\n%s\n%s" % \
+ (_("Config file was changed!"),
+ _("All changes will be lost"),
+ _("Realy continue?"),))
+ ret = dialog.run()
+ dialog.destroy()
+ if ret == gtk.RESPONSE_NO:
+ old = self.config.cacheFileName.rfind("/")
+ old = self.config.cacheFileName[old+1:len(self.config.cacheFileName)]
+ self.set_current_tree_selection(old)
+ return False
+ except IOError as e:
+ pass
+ currentFile = self.get_current_tree_selection()
+ self.config.fileToCache(currentFile)
+ self.updateProfileContent()
+ self.profileDescription.set_text(self.config.description)
+
+ def on_SaveButton_clicked(self, widget):
+ try:
+ self.profileContentBuffer = self.profileContent.get_buffer()
+ self.config.cache = self.profileContentBuffer.get_text(self.profileContentBuffer.get_start_iter(),self.profileContentBuffer.get_end_iter())
+ self.config.cacheToFile(self.config.cacheFileName)
+ except IOError as e:
+ dialog = gtk.MessageDialog(None,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_ERROR, gtk.BUTTONS_OK,
+ _("Cannot write to config file: %s") % \
+ (self.config.cacheFileName))
+ ret = dialog.run()
+ dialog.destroy()
+
+ def on_UpdateButton_clicked(self, widget):
+ self.profileContentBuffer = self.profileContent.get_buffer()
+ self.temp = self.profileContentBuffer.get_text(self.profileContentBuffer.get_start_iter(),self.profileContentBuffer.get_end_iter())
+ try:
+ if not self.config.loadDirect(self.temp):
+ self.commonview.updateCommonView()
+ self.config.updateDefault(self.config.cacheFileName)
+ self.frame.show()
+ else:
+ self.frame.hide()
+ except RuntimeError as e:
+ dialog = gtk.MessageDialog(None,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _(str(e)))
+ ret = dialog.run()
+ dialog.destroy()
+ self.frame.hide()
+
+ def init_default_file(self):
+ self.setProfileFileList()
+ try:
+ if 'lastfile' in self.config.config and \
+ not self.config.load(self.config.config['lastfile']):
+ cur = self.configFileTree.get_model()
+ for val in cur:
+ if val[0] == self.config.config['lastfile']:
+ self.configFileTree.set_cursor(val.path[0])
+ self.commonview.updateCommonView()
+ self.frame.show()
+ else:
+ self.frame.hide()
+ except RuntimeError as e:
+ dialog = gtk.MessageDialog(None,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("Default %s" % str(e)))
+ ret = dialog.run()
+ dialog.destroy()
+ self.frame.hide()
+
+ def on_profileTree_button_press_event(self, treeview, event):
+ if event.button == 3:
+ x = int(event.x)
+ y = int(event.y)
+ time = event.time
+ pthinfo = treeview.get_path_at_pos(x, y)
+ if pthinfo is not None:
+ path, col, cellx, celly = pthinfo
+ treeview.grab_focus()
+ treeview.set_cursor( path, col, 0)
+ context = gtk.Menu()
+
+ item = gtk.ImageMenuItem(_("New profile"))
+ item.connect("activate", self.on_menu_new)
+ img = gtk.image_new_from_stock(gtk.STOCK_NEW, gtk.ICON_SIZE_MENU)
+ img.show()
+ item.set_image(img)
+ context.append(item)
+
+ item = gtk.ImageMenuItem(_("Rename"))
+ item.connect("activate", self.on_menu_rename)
+ img = gtk.image_new_from_stock(gtk.STOCK_FILE, gtk.ICON_SIZE_MENU)
+ img.show()
+ item.set_image(img)
+ context.append(item)
+
+ item = gtk.ImageMenuItem(_("Copy"))
+ item.connect("activate", self.on_menu_copy)
+ img = gtk.image_new_from_stock(gtk.STOCK_COPY, gtk.ICON_SIZE_MENU)
+ img.show()
+ item.set_image(img)
+ context.append(item)
+
+ item = gtk.ImageMenuItem(_("Delete"))
+ item.connect("activate", self.on_menu_delete)
+ img = gtk.image_new_from_stock(gtk.STOCK_DELETE, gtk.ICON_SIZE_MENU)
+ img.show()
+ item.set_image(img)
+ context.append(item)
+
+ item = gtk.ImageMenuItem(_("Check"))
+ item.connect("activate", self.on_menu_check)
+ img = gtk.image_new_from_stock(gtk.STOCK_SPELL_CHECK, gtk.ICON_SIZE_MENU)
+ img.show()
+ item.set_image(img)
+ context.append(item)
+
+ context.show_all()
+ context.popup(None, None, None, event.button, time)
+ return True
+
+ def get_current_tree_selection(self):
+ selection = self.configFileTree.get_selection()
+ tree_model, tree_iter = selection.get_selected()
+ return tree_model.get_value(tree_iter, 0)
+
+ def set_current_tree_selection(self, string):
+ cur = self.configFileTree.get_model()
+ for val in cur:
+ if val[0] == string:
+ self.configFileTree.set_cursor(val.path[0])
+ return True
+ return False
+
+ def on_menu_new(self, widget):
+ filename = self.get_text_dialog(_("Please enter new filename"))
+ if(filename == None or filename == "" or os.path.exists(self.config.config['root']+filename)):
+ dialog = gtk.MessageDialog(None,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_WARNING, gtk.BUTTONS_OK,
+ _("Bad or empty filename %s" % (filename)))
+ ret = dialog.run()
+ dialog.destroy()
+ return False
+ else:
+ f = open(self.config.config['root']+filename,'w')
+ f.write("#List of enabled categories\n")
+ f.write("[categories]\n")
+ f.write("#format:\n")
+ f.write("# category_identifier=Category Name\n")
+ f.write("\n")
+ f.write("#[category_identifier]\n")
+ f.write("#value.name=default\n")
+ f.write("#value.name=slider_min,slider_max,default\n")
+ f.write("\n")
+ f.write("#[guiAlias]\n")
+ f.write("#value.name=Alias\n")
+ f.write("\n")
+ f.write("#[fileDescription]\n")
+ f.write("#text=Description of this profile\n")
+ f.write("\n")
+ f.close()
+ if self.setProfileFileList():
+ self.set_current_tree_selection(filename)
+ return True
+
+ def on_menu_check(self, widget):
+ filename = self.get_current_tree_selection()
+ err = self.config.checkConfigFile(self.config.config['root']+filename)
+ if err != '':
+ dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR,\
+ gtk.BUTTONS_OK, "%s\n%s" % (_("Config file contain errors:"), _(err)))
+ ret = dialog.run()
+ dialog.destroy()
+ return False
+ else:
+ dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO,\
+ gtk.BUTTONS_OK, "%s\n" % (_("Config file looks OK")))
+ ret = dialog.run()
+ dialog.destroy()
+ self.set_current_tree_selection(filename)
+ return True
+
+ def on_menu_rename(self, widget):
+ old_filename = self.get_current_tree_selection()
+ new_filename = self.get_text_dialog(_("Please enter new name for %s" % (old_filename)))
+ if(new_filename == None or new_filename == ""):
+ dialog = gtk.MessageDialog(None,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_WARNING, gtk.BUTTONS_OK,
+ _("Bad or empty filename %s" % (new_filename)))
+ ret = dialog.run()
+ dialog.destroy()
+ return False
+ else:
+ os.rename(self.config.config['root']+old_filename, self.config.config['root']+new_filename)
+ if self.setProfileFileList():
+ self.set_current_tree_selection(new_filename)
+ return True
+
+ def on_menu_copy(self, widget):
+ old_filename = self.get_current_tree_selection()
+ new_filename = self.get_text_dialog(_("Please enter name for new file"))
+ if(new_filename == None or new_filename == ""):
+ dialog = gtk.MessageDialog(None,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_WARNING, gtk.BUTTONS_OK,
+ _("Bad or empty filename %s" % \
+ _(new_filename)))
+ ret = dialog.run()
+ dialog.destroy()
+ return False
+ else:
+ try:
+ shutil.copy2(self.config.config['root']+old_filename, self.config.config['root']+new_filename)
+ except shutil.Error as e:
+ dialog = gtk.MessageDialog(None,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_WARNING, gtk.BUTTONS_OK,
+ _("%s" % (e)))
+ ret = dialog.run()
+ dialog.destroy()
+ if self.setProfileFileList():
+ self.set_current_tree_selection(new_filename)
+ return True
+
+ def on_menu_delete(self, widget):
+ filename = self.get_current_tree_selection()
+ dialog = gtk.MessageDialog(None,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_WARNING, gtk.BUTTONS_YES_NO,
+ _("Profile %s will be deleted!\nReally?" % (filename)))
+ ret = dialog.run()
+ dialog.destroy()
+ if ret == gtk.RESPONSE_YES:
+ os.unlink(self.config.config['root']+filename)
+ if self.setProfileFileList():
+ self.configFileTree.set_cursor(0)
+ return True
+ return False
+
+ def get_text_dialog(self, message, default=''):
+ d = gtk.MessageDialog(None,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_QUESTION,
+ gtk.BUTTONS_OK_CANCEL,
+ message)
+ entry = gtk.Entry()
+ entry.set_text(default)
+ entry.show()
+ d.vbox.pack_end(entry)
+ entry.connect('activate', lambda _: d.response(gtk.RESPONSE_OK))
+ d.set_default_response(gtk.RESPONSE_OK)
+ r = d.run()
+ text = entry.get_text().decode('utf8')
+ d.destroy()
+ if r == gtk.RESPONSE_OK:
+ return text
+ else:
+ return None
diff --git a/tuna/tuna_gui.glade b/tuna/tuna_gui.glade
index b543a3f..b188c1d 100644
--- a/tuna/tuna_gui.glade
+++ b/tuna/tuna_gui.glade
@@ -1,105 +1,959 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--*- mode: xml -*-->
+<?xml version="1.0"?>
<glade-interface>
+ <!-- interface-requires gtk+ 2.6 -->
+ <!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="mainbig_window">
<property name="visible">True</property>
<property name="border_width">1</property>
<property name="title" translatable="yes">Tuna</property>
<property name="default_width">800</property>
<property name="default_height">600</property>
- <signal name="delete_event" handler="on_mainbig_window_delete_event"/>
<signal name="destroy_event" handler="on_mainbig_window_destroy_event"/>
+ <signal name="delete_event" handler="on_mainbig_window_delete_event"/>
<child>
- <widget class="GtkViewport" id="viewport1">
+ <widget class="GtkTable" id="table2">
<property name="visible">True</property>
<child>
- <widget class="GtkVPaned" id="vpaned1">
+ <widget class="GtkNotebook" id="notebook2">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="border_width">3</property>
+ <property name="tab_hborder">1</property>
<child>
- <widget class="GtkHPaned" id="hpaned2">
- <property name="height_request">160</property>
+ <widget class="GtkFrame" id="monitor_frame">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="border_width">3</property>
- <property name="position">200</property>
+ <property name="label_xalign">0</property>
<child>
- <widget class="GtkScrolledWindow" id="cpuview">
+ <widget class="GtkViewport" id="viewport1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<child>
- <widget class="GtkViewport" id="viewport2">
+ <widget class="GtkVPaned" id="vpaned1">
<property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="border_width">3</property>
+ <child>
+ <widget class="GtkHPaned" id="hpaned2">
+ <property name="height_request">160</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="border_width">3</property>
+ <property name="position">200</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="cpuview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <widget class="GtkViewport" id="viewport2">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkVBox" id="cpuview_box">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="border_width">2</property>
+ <signal name="button_press_event" handler="on_cpuview_button_press_event"/>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <widget class="GtkTreeView" id="irqlist">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="border_width">2</property>
+ <property name="rules_hint">True</property>
+ <signal name="button_press_event" handler="on_irqlist_button_press_event"/>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
<child>
- <widget class="GtkVBox" id="cpuview_box">
+ <widget class="GtkScrolledWindow" id="bottomscrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="border_width">2</property>
- <signal name="button_press_event" handler="on_cpuview_button_press_event"/>
+ <child>
+ <widget class="GtkTreeView" id="processlist">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="border_width">2</property>
+ <property name="rules_hint">True</property>
+ <signal name="button_press_event" handler="on_processlist_button_press_event"/>
+ </widget>
+ </child>
</widget>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
</child>
</widget>
</child>
</widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="monitor_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Kernel Monitoring</property>
+ <property name="use_markup">True</property>
+ </widget>
<packing>
- <property name="resize">False</property>
- <property name="shrink">True</property>
+ <property name="type">label_item</property>
</packing>
</child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="monitor_tab_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Monitoring</property>
+ </widget>
+ <packing>
+ <property name="tab_fill">False</property>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkScrolledWindow" id="TunableFramesw">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
<child>
- <widget class="GtkScrolledWindow" id="scrolledwindow2">
+ <widget class="GtkViewport" id="TunableFrame">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <property name="resize_mode">queue</property>
<child>
- <widget class="GtkTreeView" id="irqlist">
+ <widget class="GtkTable" id="commonTbl">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="border_width">2</property>
- <property name="rules_hint">True</property>
- <signal name="button_press_event" handler="on_irqlist_button_press_event"/>
+ <property name="n_rows">2</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <widget class="GtkAlignment" id="profileSelectorBox">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <widget class="GtkHBox" id="selectorHbox">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkLabel" id="currentProfileLabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Current active tuna profile: </property>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="profileSelector">
+ <property name="visible">True</property>
+ <signal name="changed" handler="on_profileSelector_changed"/>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="controls">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <widget class="GtkHBox" id="controls-sub">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkButton" id="saveChanges">
+ <property name="width_request">150</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip" translatable="yes">Save current values to file as default values</property>
+ <signal name="clicked" handler="on_saveSnapshot_clicked"/>
+ <child>
+ <widget class="GtkAlignment" id="alignment14">
+ <property name="visible">True</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <widget class="GtkHBox" id="hbox10">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkImage" id="image3">
+ <property name="visible">True</property>
+ <property name="stock">gtk-save</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label18">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Save Snapshot</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="saveTunedChanges">
+ <property name="width_request">220</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip" translatable="yes">Create and activate new profile in tuned daemon. This daemon can apply this settings after boot.</property>
+ <signal name="clicked" handler="on_saveTunedChanges_clicked"/>
+ <child>
+ <widget class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <widget class="GtkHBox" id="hbox9">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkImage" id="image5">
+ <property name="visible">True</property>
+ <property name="stock">gtk-save</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label13">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Save &amp; Apply permanently</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="undoChanges">
+ <property name="width_request">150</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip" translatable="yes">Undo the last change applied</property>
+ <signal name="clicked" handler="on_undoChanges_clicked"/>
+ <child>
+ <widget class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <widget class="GtkHBox" id="hbox12">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkImage" id="image6">
+ <property name="visible">True</property>
+ <property name="stock">gtk-undo</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label14">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Restore changes</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="applyChanges">
+ <property name="width_request">220</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip" translatable="yes">Apply current values on this system. Values marked with star will be changed. All other system values is same as here</property>
+ <signal name="clicked" handler="on_applyChanges_clicked"/>
+ <child>
+ <widget class="GtkAlignment" id="alignment15">
+ <property name="visible">True</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <widget class="GtkHBox" id="hbox11">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkImage" id="image4">
+ <property name="visible">True</property>
+ <property name="stock">gtk-apply</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label19">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Apply changes</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ <property name="x_padding">20</property>
+ <property name="y_padding">20</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="common_tab_l">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Profile management</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="profile_frame">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkFrame" id="frame4">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment6">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkVBox" id="vbox6">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkButton" id="loadProfileButton">
+ <property name="label" translatable="yes">Load Profile from External Location</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <signal name="clicked" handler="on_loadProfileButton_clicked" after="yes"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="loadedProfileFrame">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <widget class="GtkAlignment" id="profileAlignment">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow6">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <widget class="GtkTreeView" id="profileTree">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Right mouse click on profile for more options</property>
+ <signal name="button_press_event" handler="on_profileTree_button_press_event"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="profileConfigsLabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Preloaded Configurations&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="profileDescriptionFrame">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <widget class="GtkLabel" id="profileDescriptionText">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="wrap">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="profileDescriptionLabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Profile description&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="Profiles">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Loaded Profiles&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="tunableFrame">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <widget class="GtkAlignment" id="tunableAlignment">
+ <property name="visible">True</property>
+ <property name="left_padding">4</property>
+ <child>
+ <widget class="GtkVBox" id="vbox7">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkAlignment" id="tune_alignment">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <widget class="GtkTextView" id="profileContent">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox5">
+ <property name="height_request">46</property>
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkButton" id="SaveButton">
+ <property name="height_request">34</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <signal name="clicked" handler="on_SaveButton_clicked"/>
+ <child>
+ <widget class="GtkAlignment" id="alignment9">
+ <property name="visible">True</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <widget class="GtkHBox" id="hbox7">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="stock">gtk-save</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label12">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Save Configuration to File</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="updateButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <signal name="clicked" handler="on_UpdateButton_clicked"/>
+ <child>
+ <widget class="GtkAlignment" id="alignment8">
+ <property name="height_request">34</property>
+ <property name="visible">True</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <widget class="GtkHBox" id="hbox6">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="stock">gtk-apply</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label11">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Update Management Tab</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Tunable Profile Settings&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
</child>
</widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="tuning_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Tuning Profiles</property>
+ <property name="use_markup">True</property>
+ </widget>
<packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
+ <property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
- <property name="resize">False</property>
- <property name="shrink">True</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
- <widget class="GtkScrolledWindow" id="bottomscrolledwindow">
+ <widget class="GtkLabel" id="profile_tab_l">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Profile editing</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ <property name="tab_fill">False</property>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ <packing>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="GtkDialog" id="set_irq_attributes">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Set IRQ Attributes</property>
+ <property name="type_hint">dialog</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="label_xalign">0.05000000074505806</property>
+ <child>
+ <widget class="GtkVBox" id="vbox4">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<child>
- <widget class="GtkTreeView" id="processlist">
+ <widget class="GtkLabel" id="irq_text">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="border_width">2</property>
- <property name="rules_hint">True</property>
- <signal name="button_press_event" handler="on_processlist_button_press_event"/>
+ <property name="ypad">12</property>
+ <property name="use_markup">True</property>
+ <property name="single_line_mode">True</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
+ <child>
+ <widget class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">10</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <widget class="GtkEntry" id="irq_affinity_text">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ <signal name="changed" handler="on_irq_affinity_text_changed"/>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="irq_pri_spinbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">0 0 100 1 10 0</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="irq_policy_combobox">
+ <property name="visible">True</property>
+ <signal name="changed" handler="on_irq_policy_combobox_changed"/>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">A_ffinity</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">irq_affinity_text</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Scheduler priority</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">irq_pri_spinbutton</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Policy</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">irq_policy_combobox</property>
+ </widget>
+ <packing>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Set attributes for this IRQ:&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
</widget>
<packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
+ <property name="type">label_item</property>
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <widget class="GtkButton" id="cancelbutton2">
+ <property name="label">gtk-cancel</property>
+ <property name="response_id">-6</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="okbutton2">
+ <property name="label">gtk-ok</property>
+ <property name="response_id">-5</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
</child>
</widget>
</child>
@@ -109,9 +963,8 @@
<property name="height_request">500</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Set Process Attributes</property>
- <property name="resizable">True</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="type_hint">dialog</property>
+ <property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
@@ -127,7 +980,6 @@
<widget class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="label_xalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
<widget class="GtkVBox" id="vbox2">
<property name="visible">True</property>
@@ -135,26 +987,27 @@
<property name="spacing">3</property>
<child>
<widget class="GtkRadioButton" id="just_this_thread">
+ <property name="label" translatable="yes">_Just the selected thread</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">_Just the selected thread</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
<signal name="clicked" handler="on_just_this_thread_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="all_these_threads">
+ <property name="label" translatable="yes">_All threads of the selected process</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">_All threads of the selected process</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
<property name="group">just_this_thread</property>
<signal name="clicked" handler="on_all_these_threads_clicked"/>
@@ -167,11 +1020,11 @@
</child>
<child>
<widget class="GtkRadioButton" id="command_regex">
+ <property name="label" translatable="yes">A_ll command lines matching the regex below:</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">A_ll command lines matching the regex below:</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
<property name="group">just_this_thread</property>
<signal name="clicked" handler="on_command_regex_clicked"/>
@@ -195,6 +1048,9 @@
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkVBox" id="vbox3">
@@ -214,6 +1070,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -229,6 +1086,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -240,20 +1098,20 @@
<property name="visible">True</property>
<property name="label" translatable="yes">_Scheduler priority:</property>
<property name="use_underline">True</property>
- <property name="justify">GTK_JUSTIFY_RIGHT</property>
<property name="mnemonic_widget">sched_pri_spin</property>
<property name="single_line_mode">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="sched_pri_spin">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">0 0 100 1 10 10</property>
+ <property name="adjustment">0 0 100 1 10 0</property>
<property name="climb_rate">1</property>
<property name="numeric">True</property>
</widget>
@@ -281,13 +1139,15 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="affinity_text">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <signal name="changed" handler="on_affinity_text_changed"/>
+ <property name="invisible_char">&#x25CF;</property>
+ <signal name="changed" handler="on_affinity_text_changed"/>
</widget>
<packing>
<property name="position">1</property>
@@ -311,6 +1171,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -329,12 +1190,14 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="cmdline_regex">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
<signal name="changed" handler="on_cmdline_regex_changed"/>
</widget>
<packing>
@@ -352,9 +1215,8 @@
<widget class="GtkScrolledWindow" id="scrolledwindow3">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
<child>
<widget class="GtkTreeView" id="matching_process_list">
<property name="visible">True</property>
@@ -368,217 +1230,106 @@
</child>
</widget>
<packing>
- <property name="position">2</property>
+ <property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="cancelbutton1">
+ <property name="label">gtk-cancel</property>
+ <property name="response_id">-6</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="label">gtk-cancel</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
- <property name="response_id">-6</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkButton" id="okbutton1">
+ <property name="label">gtk-ok</property>
+ <property name="response_id">-5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="label">gtk-ok</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
- <property name="response_id">-5</property>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
</child>
</widget>
- <widget class="GtkDialog" id="set_irq_attributes">
+ <widget class="GtkFileChooserDialog" id="profileChooser">
<property name="visible">True</property>
- <property name="title" translatable="yes">Set IRQ Attributes</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
- <property name="resizable">True</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="border_width">5</property>
+ <property name="role">GtkFileChooserDialog</property>
+ <property name="type_hint">dialog</property>
<child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox2">
+ <widget class="GtkVBox" id="dialog-vbox4">
<property name="visible">True</property>
- <child>
- <widget class="GtkFrame" id="frame2">
- <property name="visible">True</property>
- <property name="label_xalign">0.05000000074505806</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <child>
- <widget class="GtkVBox" id="vbox4">
- <property name="visible">True</property>
- <child>
- <widget class="GtkLabel" id="irq_text">
- <property name="visible">True</property>
- <property name="ypad">12</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property>
- <property name="single_line_mode">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">3</property>
- <property name="column_spacing">10</property>
- <property name="homogeneous">True</property>
- <child>
- <widget class="GtkEntry" id="irq_affinity_text">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <signal name="changed" handler="on_irq_affinity_text_changed"/>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="irq_pri_spinbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">0 0 100 1 10 10</property>
- <property name="climb_rate">1</property>
- <property name="numeric">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkComboBox" id="irq_policy_combobox">
- <property name="visible">True</property>
- <signal name="changed" handler="on_irq_policy_combobox_changed"/>
- </widget>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label9">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">A_ffinity</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">irq_affinity_text</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Scheduler priority</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">irq_pri_spinbutton</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Policy</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">irq_policy_combobox</property>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Set attributes for this IRQ:&lt;/b&gt;</property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
+ <property name="spacing">2</property>
<child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area2">
+ <widget class="GtkHButtonBox" id="dialog-action_area4">
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="layout_style">end</property>
<child>
- <widget class="GtkButton" id="cancelbutton2">
+ <widget class="GtkButton" id="button3">
+ <property name="label">gtk-cancel</property>
+ <property name="response_id">-6</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="label">gtk-cancel</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
- <property name="response_id">-6</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <widget class="GtkButton" id="okbutton2">
+ <widget class="GtkButton" id="button4">
+ <property name="label">gtk-open</property>
+ <property name="response_id">-5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="label">gtk-ok</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
- <property name="response_id">-5</property>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
diff --git a/tuna/tuna_gui.py b/tuna/tuna_gui.py
index 4cb6ea8..d99f447 100755
--- a/tuna/tuna_gui.py
+++ b/tuna/tuna_gui.py
@@ -6,9 +6,13 @@ pygtk.require("2.0")
import gtk, gobject, os, procfs, sys
import gtk.glade
+from gtk import ListStore
from gui.cpuview import cpuview
from gui.irqview import irqview
from gui.procview import procview
+from gui.commonview import commonview
+from gui.profileview import profileview
+from config import Config
tuna_glade_dirs = [ ".", "tuna", "/usr/share/tuna" ]
tuna_glade = None
@@ -44,9 +48,35 @@ class main_gui:
self.wtree.get_widget("cpuview"),
self.procview, self.irqview, cpus_filtered)
- event_handlers = { "on_mainbig_window_delete_event" : self.on_mainbig_window_delete_event,
- "on_processlist_button_press_event" : self.procview.on_processlist_button_press_event,
- "on_irqlist_button_press_event" : self.irqview.on_irqlist_button_press_event }
+ self.config = Config()
+ self.check_env()
+ self.commonview = commonview()
+ self.commonview.contentTable = self.wtree.get_widget("commonTbl")
+ self.commonview.configFileCombo = self.wtree.get_widget("profileSelector")
+
+ self.profileview = profileview()
+ self.profileview.config = self.config
+ self.commonview.config = self.config
+ self.profileview.commonview = self.commonview
+ self.commonview.profileview = self.profileview
+
+ self.profileview.setWtree(self.wtree)
+ self.profileview.init_default_file()
+
+ event_handlers = { "on_mainbig_window_delete_event" : self.on_mainbig_window_delete_event,
+ "on_processlist_button_press_event" : self.procview.on_processlist_button_press_event,
+ "on_irqlist_button_press_event" : self.irqview.on_irqlist_button_press_event,
+ "on_loadProfileButton_clicked" : self.profileview.on_loadProfileButton_clicked,
+ "on_SaveButton_clicked" : self.profileview.on_SaveButton_clicked,
+ "on_UpdateButton_clicked" : self.profileview.on_UpdateButton_clicked,
+ "on_applyChanges_clicked" : self.commonview.on_applyChanges_clicked,
+ "on_undoChanges_clicked" : self.commonview.on_undoChanges_clicked,
+ "on_saveSnapshot_clicked" : self.commonview.on_saveSnapshot_clicked,
+ "on_saveTunedChanges_clicked" : self.commonview.on_saveTunedChanges_clicked,
+ "on_profileSelector_changed" : self.commonview.on_profileSelector_changed,
+ "on_profileTree_button_press_event" : self.profileview.on_profileTree_button_press_event
+ }
+
self.wtree.signal_autoconnect(event_handlers)
self.ps.reload_threads()
@@ -112,6 +142,19 @@ class main_gui:
if ret == gtk.RESPONSE_NO:
return True
return False
-
+
+ def check_env(self):
+ if not os.path.exists(self.config.config["root"]):
+ try:
+ os.stat(self.config.config["root"])
+ except (IOError,OSError):
+ os.mkdir(self.config.config["root"])
+ if not os.path.exists("/root/.local/share/"):
+ try:
+ os.stat("/root/.local/share/")
+ except (IOError,OSError):
+ os.mkdir("/root/.local/")
+ os.mkdir("/root/.local/share/")
+
def run(self):
gtk.main()