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/") ...@@ -32,34 +32,34 @@ gettext.install("pardus-flatpak-gui", "po/")
class InfoWindow(object): class InfoWindow(object):
def __init__(self, application, infostring, app): def __init__(self, application, info_string, app):
self.Application = application self.Application = application
self.InfoString = infostring self.InfoString = info_string
self.App = app self.App = app
try: try:
InfoGUIFile = "ui/infowindow.glade" info_gui_file = "ui/infowindow.glade"
InfoBuilder = Gtk.Builder.new_from_file(InfoGUIFile) info_builder = Gtk.Builder.new_from_file(info_gui_file)
InfoBuilder.connect_signals(self) info_builder.connect_signals(self)
except GLib.GError: except GLib.GError:
print(_("Error reading GUI file: ") + InfoGUIFile) print(_("Error reading GUI file: ") + info_gui_file)
raise raise
InfoTextBuffer = InfoBuilder.get_object( info_text_buffer = info_builder.get_object(
"InfoTextBuffer") "InfoTextBuffer")
InfoTextBuffer.set_text(infostring) info_text_buffer.set_text(info_string)
InfoButton = InfoBuilder.get_object("InfoButton") info_button = info_builder.get_object("InfoButton")
InfoButton.set_label(_("_Copy to Clipboard")) 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_application(application)
self.InfoWindow.set_title(_("Info About ") + app.get_name()) self.InfoWindow.set_title(_("Info About ") + app.get_name())
self.InfoWindow.show() self.InfoWindow.show()
def onDestroy(self, *args): def on_delete_info_window(self, widget, event):
self.InfoWindow.destroy() widget.destroy()
def onPressedCopyToClipboard(self, button): def on_copy_to_clipboard(self, button):
ClipboardCurrent = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD) clipboard_current = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
ClipboardCurrent.set_text(self.InfoString, -1) clipboard_current.set_text(self.InfoString, -1)
This diff is collapsed.
...@@ -42,6 +42,10 @@ Author: Erdem Ersoy ...@@ -42,6 +42,10 @@ Author: Erdem Ersoy
<property name="default_height">400</property> <property name="default_height">400</property>
<property name="icon_name">dialog-information</property> <property name="icon_name">dialog-information</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<signal name="delete-event" handler="on_delete_info_window" swapped="no"/>
<child>
<placeholder/>
</child>
<child> <child>
<object class="GtkBox" id="InfoBox"> <object class="GtkBox" id="InfoBox">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -84,7 +88,7 @@ Author: Erdem Ersoy ...@@ -84,7 +88,7 @@ Author: Erdem Ersoy
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="image">InfoButtonImage</property> <property name="image">InfoButtonImage</property>
<property name="use_underline">True</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> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
......
...@@ -117,7 +117,7 @@ Author: Erdem Ersoy ...@@ -117,7 +117,7 @@ Author: Erdem Ersoy
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="image">UninstallImage</property> <property name="image">UninstallImage</property>
<property name="use_stock">False</property> <property name="use_stock">False</property>
<signal name="activate" handler="onUninstall" swapped="no"/> <signal name="activate" handler="on_uninstall" swapped="no"/>
</object> </object>
</child> </child>
<child> <child>
...@@ -128,7 +128,7 @@ Author: Erdem Ersoy ...@@ -128,7 +128,7 @@ Author: Erdem Ersoy
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="image">InstallImage</property> <property name="image">InstallImage</property>
<property name="use_stock">False</property> <property name="use_stock">False</property>
<signal name="activate" handler="onInstall" swapped="no"/> <signal name="activate" handler="on_install" swapped="no"/>
</object> </object>
</child> </child>
</object> </object>
...@@ -148,7 +148,7 @@ Author: Erdem Ersoy ...@@ -148,7 +148,7 @@ Author: Erdem Ersoy
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="image">InstallFromEntryImage</property> <property name="image">InstallFromEntryImage</property>
<property name="use_stock">False</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> </object>
</child> </child>
<child> <child>
...@@ -159,7 +159,7 @@ Author: Erdem Ersoy ...@@ -159,7 +159,7 @@ Author: Erdem Ersoy
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="image">InstallFromFileImage</property> <property name="image">InstallFromFileImage</property>
<property name="use_stock">False</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> </object>
</child> </child>
<child> <child>
...@@ -170,7 +170,7 @@ Author: Erdem Ersoy ...@@ -170,7 +170,7 @@ Author: Erdem Ersoy
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="image">UpdateAllImage</property> <property name="image">UpdateAllImage</property>
<property name="use_stock">False</property> <property name="use_stock">False</property>
<signal name="activate" handler="onUpdateAll" swapped="no"/> <signal name="activate" handler="on_update_all" swapped="no"/>
</object> </object>
</child> </child>
<child> <child>
...@@ -253,6 +253,7 @@ Author: Erdem Ersoy ...@@ -253,6 +253,7 @@ Author: Erdem Ersoy
<property name="model">SearchFilter</property> <property name="model">SearchFilter</property>
<property name="search_column">0</property> <property name="search_column">0</property>
<property name="activate_on_single_click">True</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"/> <signal name="row-activated" handler="on_show_actions_menu" swapped="no"/>
<child internal-child="selection"> <child internal-child="selection">
<object class="GtkTreeSelection" id="TreeSelectionMain"> <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