Verified Commit 1246a7de authored by tallero's avatar tallero

solved 'detached head'-caused problems

parent 8b6dfc9e
......@@ -35,7 +35,7 @@ from setproctitle import setproctitle
from sys import argv
name = "ml.prevete.Daty"
version = "1.0beta"
version = "1.0rc"
setproctitle(name)
def main():
......
......@@ -30,11 +30,10 @@ require_version('Handy', '0.0')
from gi.repository.Gdk import CURRENT_TIME
from gi.repository.GLib import OptionArg, OptionFlags
from gi.repository.Gio import ApplicationFlags, SimpleAction
from gi.repository.Gtk import Application, Builder, show_uri
from gi.repository.Gtk import Application, Builder, WindowPosition, show_uri
from platform import system
from sys import argv
from .preferences import Preferences
name = "ml.prevete.Daty"
class Daty(Application):
......@@ -50,14 +49,15 @@ class Daty(Application):
def do_startup(self):
Application.do_startup(self)
# Set app menu
<<<<<<< HEAD
=======
#TODO: Parse args
#if "open-entity" in args:
>>>>>>> db00593... preferences window: initial commit
# Set app menu
action = SimpleAction.new("preferences", None)
action.connect("activate", self.on_preferences)
self.set_accels_for_action("app.preferences", ["<Control>,"])
#self.set_accels_for_action("app.preferences", ["<Control>,"])
self.add_action(action)
action = SimpleAction.new("shortcuts", None)
......@@ -120,18 +120,20 @@ class Daty(Application):
open('http://daty.prevete.ml')
def on_preferences(self, action, param):
#builder = Builder()
#builder.add_from_resource('/ml/prevete/Daty/gtk/preferences.ui')
#window = builder.get_object("Preferences")
#window.show_all()
preferences = Preferences()
preferences.show_all()
def on_shortcuts(self, action, param):
builder = Builder()
builder.add_from_resource('/ml/prevete/Daty/gtk/shortcutswindow.ui')
window = builder.get_object("shortcuts")
window.show_all()
shortcuts = builder.get_object("shortcuts")
#print(shortcuts.get_position())
#print(WindowPosition(1))
#shortcuts
shortcuts.set_transient_for(self.window)
shortcuts.show_all()
#shortcuts.set_position(WindowPosition(1))
print(shortcuts.get_position())
def on_about(self, action, param):
from .aboutdaty import AboutDaty
......
......@@ -54,7 +54,7 @@ class Config:
'config':user_config_dir(appname, appauthor),
'cache':user_cache_dir(appname, appauthor)}
verbose = False
verbose = True
def __init__(self):
self.set_dirs()
......
......@@ -27,7 +27,6 @@ require_version('Gtk', '3.0')
from gi.repository.GLib import idle_add
from gi.repository.Gtk import Align, CssProvider, Dialog, Entry, Grid, Label, ListBoxRow, Separator, StyleContext, STYLE_PROVIDER_PRIORITY_APPLICATION, IconTheme, Template, Window
from pprint import pprint
from pywikibot.data.sparql import SparqlQuery
from re import sub
from threading import Thread
......@@ -116,6 +115,7 @@ class Preferences(Window):
entity (dict): have keys "URI", "Label", "Description"
"""
def do_call():
from pywikibot.data.sparql import SparqlQuery
sparql = SparqlQuery()
results = sparql.query(query)
idle_add(lambda: callback(results, *cb_args, **kwargs))
......
......@@ -51,12 +51,10 @@ class Property(Button):
context = self.description.get_style_context()
set_style(context, resource, 'popover_description', True)
#wikidata = Wikidata()
#label, tooltip = wikidata.get_label(prop), wikidata.get_description(prop)
self.set_label(prop["Label"], prop["Description"])
self.description.set_text(prop['Description'])
self.description.set_line_wrap(True)
#del prop
def set_label(self, label, tooltip):
self.property_label.set_text(label)
......
......@@ -8,7 +8,7 @@
<property name="modal">True</property>
<property name="type_hint">dialog</property>
<property name="program_name">Daty</property>
<property name="version">1.0β</property>
<property name="version">1.0 RC</property>
<property name="copyright" translatable="yes">Copyright © 2018, 2019 Pellegrino Prevete</property>
<property name="comments" translatable="yes">A free cross-platform Wikidata editor.</property>
<property name="website">https://gitlab.gnome.org/World/Daty</property>
......
......@@ -580,11 +580,8 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<<<<<<< HEAD
<property name="position">2</property>
=======
<property name="position">3</property>
>>>>>>> db00593... preferences window: initial commit
</packing>
</child>
<child>
......
......@@ -88,11 +88,8 @@
<property name="margin_bottom">18</property>
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<<<<<<< HEAD
<property name="spacing">18</property>
=======
<property name="spacing">12</property>
>>>>>>> db00593... preferences window: initial commit
<child>
<object class="GtkLabel">
<property name="visible">True</property>
......@@ -113,12 +110,12 @@
<object class="GtkFrame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<<<<<<< HEAD
<property name="halign">start</property>
<property name="valign">center</property>
<property name="margin_bottom">18</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<property name="hexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">out</property>
<child>
<object class="GtkLabel" id="username_label">
<property name="visible">True</property>
......@@ -139,11 +136,6 @@
<property name="top_attach">0</property>
</packing>
</child>
=======
<property name="hexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">out</property>
>>>>>>> db00593... preferences window: initial commit
<child>
<object class="GtkListBox" id="credentials">
<property name="visible">True</property>
......@@ -151,9 +143,6 @@
<property name="selection_mode">none</property>
</object>
</child>
<child type="label_item">
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -329,15 +318,6 @@
<property name="can_focus">False</property>
<property name="title" translatable="yes">Preferences</property>
<property name="show_close_button">True</property>
<child>
<object class="GtkButton" id="back">
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Close this window and come back to the editor</property>
<property name="image">back-icon</property>
<property name="always_show_image">True</property>
</object>
</child>
</object>
</child>
</template>
......
......@@ -43,7 +43,7 @@
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Preferences</property>
<property name="accelerator">&lt;Primary&gt;,</property>
<property name="accelerator">&lt;Primary&gt;comma</property>
</object>
</child>
</object>
......
......@@ -104,64 +104,64 @@ StartupNotify=true
Terminal=false
Icon=ml.prevete.Daty
Type=Application
Categories=Network;
Categories=GNOME;GTK;Network;Wikidata;
MimeType=text/html;text/xml;application/xhtml_xml;image/webp;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;
#Actions=new-window;new-private-window;
Actions=open;
[Desktop Action open]
Name=Open entity
#Name[am]=
#Name[ar]=
#Name[bg]=
#Name[bn]=
#Name[ca]=
#Name[cs]=
#Name[da]=
#Name[de]=
#Name[el]=
Name[en_GB]=Open entity
#Name[es]=
#Name[et]=
#Name[fa]=
#Name[fi]=
#Name[fil]=
#Name[fr]=
#Name[gu]=
#Name[hi]=
#Name[hr]=
#Name[hu]=
#Name[id]=
#Name[it]=
#Name[iw]=
#Name[ja]=
#Name[kn]=
#Name[ko]=
#Name[lt]=
#Name[lv]=
#Name[ml]=
#Name[mr]=
#Name[nl]=
#Name[no]=
#Name[pl]=
#Name[pt]=
#Name[pt_BR]=
#Name[ro]=
#Name[ru]=
#Name[sk]=
#Name[sl]=
#Name[sr]=
#Name[sv]=
#Name[sw]=
#Name[ta]=
#Name[te]=
#Name[th]=
#Name[tr]=
#Name[uk]=
#Name[vi]=
#Name[zh_CN]=
#Name[zh_TW]=
Exec=daty --open-entity
#[Desktop Action new-window]
#Name=New Window
#Name[am]=አዲስ መስኮት
#Name[ar]=نافذة جديدة
#Name[bg]=Нов прозорец
#Name[bn]=নতুন উইন্ডো
#Name[ca]=Finestra nova
#Name[cs]=Nové okno
#Name[da]=Nyt vindue
#Name[de]=Neues Fenster
#Name[el]=Νέο Παράθυρο
#Name[en_GB]=New Window
#Name[es]=Nueva ventana
#Name[et]=Uus aken
#Name[fa]=پنجره جدید
#Name[fi]=Uusi ikkuna
#Name[fil]=New Window
#Name[fr]=Nouvelle fenêtre
#Name[gu]=નવી વિંડો
#Name[hi]=नई विंडो
#Name[hr]=Novi prozor
#Name[hu]=Új ablak
#Name[id]=Jendela Baru
#Name[it]=Nuova finestra
#Name[iw]=חלון חדש
#Name[ja]=新規ウインドウ
#Name[kn]=ಹೊಸ ವಿಂಡೊ
#Name[ko]=새 창
#Name[lt]=Naujas langas
#Name[lv]=Jauns logs
#Name[ml]=പുതിയ വിന്‍ഡോ
#Name[mr]=नवीन विंडो
#Name[nl]=Nieuw venster
#Name[no]=Nytt vindu
#Name[pl]=Nowe okno
#Name[pt]=Nova janela
#Name[pt_BR]=Nova janela
#Name[ro]=Fereastră nouă
#Name[ru]=Новое окно
#Name[sk]=Nové okno
#Name[sl]=Novo okno
#Name[sr]=Нови прозор
#Name[sv]=Nytt fönster
#Name[sw]=Dirisha Jipya
#Name[ta]=புதிய சாளரம்
#Name[te]=క్రొత్త విండో
#Name[th]=หน้าต่างใหม่
#Name[tr]=Yeni Pencere
#Name[uk]=Нове вікно
#Name[vi]=Cửa sổ Mới
#Name[zh_CN]=新建窗口
#Name[zh_TW]=開新視窗
#Exec=/usr/bin/chromium
#
#[Desktop Action new-private-window]
#Name=New Incognito Window
#Name[ar]=نافذة جديدة للتصفح المتخفي
......
......@@ -10,7 +10,7 @@ confinement: devmode
base: core18
parts:
offlineimap:
daty:
plugin: python
python-version: python3
source: .
......
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