-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lainsce
committed
May 28, 2017
1 parent
37f5b8a
commit a7056b5
Showing
8 changed files
with
101 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<schemalist> | ||
<schema id="com.github.lainsce.notejot" path="/com/github/lainsce/notejot/"> | ||
<key name="window-x" type="i"> | ||
<default>-1</default> | ||
<summary>Window position</summary> | ||
<description>The x axis of window position</description> | ||
</key> | ||
<key name="window-y" type="i"> | ||
<default>-1</default> | ||
<summary>Window position</summary> | ||
<description>The y axis of window position</description> | ||
</key> | ||
</schema> | ||
</schemalist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,33 +20,21 @@ | |
namespace Notejot { | ||
public class Application : Granite.Application { | ||
|
||
private static Notejot.Application app; | ||
private MainWindow window = null; | ||
private Notejot.MainWindow? window = null; | ||
|
||
construct { | ||
application_id = "com.github.lainsce.notejot"; | ||
program_name = "Notejot"; | ||
app_years = "2017"; | ||
exec_name = "com.github.lainsce.notejot"; | ||
app_launcher = "com.github.lainsce.notejot"; | ||
build_version = "1.0.1"; | ||
build_version = "1.0.4"; | ||
app_icon = "com.github.lainsce.notejot"; | ||
main_url = "https://github.com/lainsce/notejot/"; | ||
bug_url = "https://github.com/lainsce/notejot/issues"; | ||
help_url = "https://github.com/lainsce/notejot/"; | ||
about_authors = {"Lains <[email protected]>", null}; | ||
about_license_type = Gtk.License.GPL_3_0; | ||
} | ||
|
||
protected override void activate () { | ||
if (window != null) { | ||
window.present (); | ||
return; | ||
} | ||
|
||
window = new MainWindow (); | ||
window.set_application (this); | ||
window.show_all (); | ||
|
||
var quit_action = new SimpleAction ("quit", null); | ||
add_action (quit_action); | ||
|
@@ -59,16 +47,19 @@ namespace Notejot { | |
}); | ||
} | ||
|
||
protected override void activate () { | ||
if (window == null) { | ||
window = new MainWindow (this); | ||
add_window (window); | ||
window.show_all (); | ||
} else { | ||
window.present (); | ||
} | ||
} | ||
|
||
public static int main (string[] args) { | ||
var app = new Notejot.Application (); | ||
return app.run (args); | ||
} | ||
|
||
public static Notejot.Application get_instance () { | ||
if (app == null) | ||
app = new Notejot.Application (); | ||
|
||
return app; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/*- | ||
* Copyright (c) 2017 Lains | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 2.1 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace Notejot { | ||
public class AppSettings : Granite.Services.Settings { | ||
public int window_x { get; set; } | ||
public int window_y { get; set; } | ||
|
||
private static AppSettings? instance; | ||
public static unowned AppSettings get_default () { | ||
if (instance == null) { | ||
instance = new AppSettings (); | ||
} | ||
|
||
return instance; | ||
} | ||
|
||
private AppSettings () { | ||
base ("com.github.lainsce.notejot"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters