Verified Kaydet (Commit) f05d8792 authored tarafından Erdem Ersoy's avatar Erdem Ersoy

Rewrite Flatpak GUI mess (6/X):

* Refactor mainwindow.py and infowindow.py (2/X)
* Fix "Info" menu item function
üst 7712942b
......@@ -32,34 +32,34 @@ gettext.install("pardus-flatpak-gui", "po/")
class InfoWindow(object):
def __init__(self, application, infostring, app):
def __init__(self, application, info_string, app):
self.Application = application
self.InfoString = infostring
self.InfoString = info_string
self.App = app
try:
InfoGUIFile = "ui/infowindow.glade"
InfoBuilder = Gtk.Builder.new_from_file(InfoGUIFile)
InfoBuilder.connect_signals(self)
info_gui_file = "ui/infowindow.glade"
info_builder = Gtk.Builder.new_from_file(info_gui_file)
info_builder.connect_signals(self)
except GLib.GError:
print(_("Error reading GUI file: ") + InfoGUIFile)
print(_("Error reading GUI file: ") + info_gui_file)
raise
InfoTextBuffer = InfoBuilder.get_object(
info_text_buffer = info_builder.get_object(
"InfoTextBuffer")
InfoTextBuffer.set_text(infostring)
info_text_buffer.set_text(info_string)
InfoButton = InfoBuilder.get_object("InfoButton")
InfoButton.set_label(_("_Copy to Clipboard"))
info_button = info_builder.get_object("InfoButton")
info_button.set_label(_("_Copy to Clipboard"))
self.InfoWindow = InfoBuilder.get_object("InfoWindow")
self.InfoWindow = info_builder.get_object("InfoWindow")
self.InfoWindow.set_application(application)
self.InfoWindow.set_title(_("Info About ") + app.get_name())
self.InfoWindow.show()
def onDestroy(self, *args):
self.InfoWindow.destroy()
def on_delete_info_window(self, widget, event):
widget.destroy()
def onPressedCopyToClipboard(self, button):
ClipboardCurrent = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
ClipboardCurrent.set_text(self.InfoString, -1)
def on_copy_to_clipboard(self, button):
clipboard_current = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
clipboard_current.set_text(self.InfoString, -1)
This diff is collapsed.
......@@ -42,6 +42,10 @@ Author: Erdem Ersoy
<property name="default_height">400</property>
<property name="icon_name">dialog-information</property>
<property name="type_hint">dialog</property>
<signal name="delete-event" handler="on_delete_info_window" swapped="no"/>
<child>
<placeholder/>
</child>
<child>
<object class="GtkBox" id="InfoBox">
<property name="visible">True</property>
......@@ -84,7 +88,7 @@ Author: Erdem Ersoy
<property name="receives_default">True</property>
<property name="image">InfoButtonImage</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="onPressedCopyToClipboard" swapped="no"/>
<signal name="clicked" handler="on_copy_to_clipboard" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
......
......@@ -117,7 +117,7 @@ Author: Erdem Ersoy
<property name="use_underline">True</property>
<property name="image">UninstallImage</property>
<property name="use_stock">False</property>
<signal name="activate" handler="onUninstall" swapped="no"/>
<signal name="activate" handler="on_uninstall" swapped="no"/>
</object>
</child>
<child>
......@@ -128,7 +128,7 @@ Author: Erdem Ersoy
<property name="use_underline">True</property>
<property name="image">InstallImage</property>
<property name="use_stock">False</property>
<signal name="activate" handler="onInstall" swapped="no"/>
<signal name="activate" handler="on_install" swapped="no"/>
</object>
</child>
</object>
......@@ -148,7 +148,7 @@ Author: Erdem Ersoy
<property name="use_underline">True</property>
<property name="image">InstallFromEntryImage</property>
<property name="use_stock">False</property>
<signal name="activate" handler="onInstallFromEntry" swapped="no"/>
<signal name="activate" handler="on_install_from_entry" swapped="no"/>
</object>
</child>
<child>
......@@ -159,7 +159,7 @@ Author: Erdem Ersoy
<property name="use_underline">True</property>
<property name="image">InstallFromFileImage</property>
<property name="use_stock">False</property>
<signal name="activate" handler="onInstallFromFile" swapped="no"/>
<signal name="activate" handler="on_install_from_file" swapped="no"/>
</object>
</child>
<child>
......@@ -170,7 +170,7 @@ Author: Erdem Ersoy
<property name="use_underline">True</property>
<property name="image">UpdateAllImage</property>
<property name="use_stock">False</property>
<signal name="activate" handler="onUpdateAll" swapped="no"/>
<signal name="activate" handler="on_update_all" swapped="no"/>
</object>
</child>
<child>
......@@ -253,6 +253,7 @@ Author: Erdem Ersoy
<property name="model">SearchFilter</property>
<property name="search_column">0</property>
<property name="activate_on_single_click">True</property>
<signal name="columns-changed" handler="on_columns_changed" swapped="no"/>
<signal name="row-activated" handler="on_show_actions_menu" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection" id="TreeSelectionMain">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment